bundle.js 827 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704
  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.n33 = (this.getChild("n33"));
  4205. this.shopBtn = (this.getChild("shopBtn"));
  4206. this.moneyNode = (this.getChild("moneyNode"));
  4207. this.headNode = (this.getChild("headNode"));
  4208. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4209. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4210. this.classicBtn = (this.getChild("classicBtn"));
  4211. this.weeklyBtn = (this.getChild("weeklyBtn"));
  4212. this.globalBtn = (this.getChild("globalBtn"));
  4213. this.n44 = (this.getChild("n44"));
  4214. this.signBtn = (this.getChild("signBtn"));
  4215. this.drawBtn = (this.getChild("drawBtn"));
  4216. this.settingNode = (this.getChild("settingNode"));
  4217. this.n45 = (this.getChild("n45"));
  4218. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4219. this.n46 = (this.getChild("n46"));
  4220. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4221. this.liucheng1 = (this.getChild("liucheng1"));
  4222. this.rightBtn = (this.getChild("rightBtn"));
  4223. this.n75 = (this.getChild("n75"));
  4224. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4225. this.liucheng2 = (this.getChild("liucheng2"));
  4226. this.guideBtn = (this.getChild("guideBtn"));
  4227. this.n73 = (this.getChild("n73"));
  4228. this.wordsNode = (this.getChild("wordsNode"));
  4229. this.enterGuide = (this.getChild("enterGuide"));
  4230. this.talkNode = (this.getChild("talkNode"));
  4231. this.n83 = (this.getChild("n83"));
  4232. this.n84 = (this.getChild("n84"));
  4233. }
  4234. }
  4235. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4236. class ui_UIMoyu extends fgui.GComponent {
  4237. static createInstance() {
  4238. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4239. }
  4240. onConstruct() {
  4241. this.ageTip = (this.getChild("ageTip"));
  4242. this.mainBg = (this.getChild("mainBg"));
  4243. this.xyNode = (this.getChild("xyNode"));
  4244. this.rnNode = (this.getChild("rnNode"));
  4245. this.fcmNode = (this.getChild("fcmNode"));
  4246. this.ageNode = (this.getChild("ageNode"));
  4247. this.tipNode = (this.getChild("tipNode"));
  4248. this.msgNode = (this.getChild("msgNode"));
  4249. }
  4250. }
  4251. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4252. class MoyuMgr {
  4253. static initMoyu() {
  4254. this.moyuView = new MoyuView();
  4255. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4256. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4257. this.moyuView.ui.displayObject.zOrder = 1000;
  4258. this.moyuView.init();
  4259. this.moyuView.showTip(true);
  4260. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4261. window['XApk'] = this;
  4262. }
  4263. static showAge(show) {
  4264. if (this.moyuView)
  4265. this.moyuView.showAge(show);
  4266. }
  4267. static onPlatMsg(idx) {
  4268. if (!MoyuMgr.moyuView)
  4269. return;
  4270. if (idx == '0') {
  4271. MoyuMgr.moyuView.showTip(false);
  4272. }
  4273. }
  4274. static showAgree(call) {
  4275. if (this.moyuView)
  4276. this.moyuView.showAgree(call);
  4277. else
  4278. call && call();
  4279. }
  4280. static showXy(type = 1) {
  4281. if (this.moyuView)
  4282. this.moyuView.showXy(type);
  4283. }
  4284. }
  4285. MoyuMgr.isAdvise = false;
  4286. class MoyuView {
  4287. constructor() {
  4288. this.ysxyNum = 1;
  4289. this.ysJson = null;
  4290. this.ui = ui_UIMoyu.createInstance();
  4291. }
  4292. init() {
  4293. this.ui.mainBg.visible = false;
  4294. this.ui.xyNode.visible = false;
  4295. this.ui.ageNode.visible = false;
  4296. this.ui.tipNode.visible = false;
  4297. this.ui.rnNode.visible = false;
  4298. this.ui.fcmNode.visible = false;
  4299. this.ui.ageTip.visible = false;
  4300. this.ui.msgNode.visible = false;
  4301. this.ui.visible = false;
  4302. this.ui.xyNode.xyList.setVirtual();
  4303. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4304. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4305. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4306. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4307. this.ui.xyNode.btnKnown.visible = false;
  4308. this.ui.xyNode.xy1.visible = false;
  4309. this.ui.xyNode.xy2.visible = false;
  4310. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4311. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4312. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4313. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4314. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4315. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4316. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4317. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4318. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4319. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4320. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4321. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4322. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4323. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4324. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4325. this.ysxyNum = 2;
  4326. }
  4327. }
  4328. onClick(obj) {
  4329. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4330. switch (obj) {
  4331. case this.ui.ageTip:
  4332. if (Moyu.isTTApk) {
  4333. this.ui.ageNode.visible = true;
  4334. this.ui.mainBg.visible = true;
  4335. }
  4336. break;
  4337. case this.ui.tipNode:
  4338. this.showTip(false);
  4339. break;
  4340. case this.ui.ageNode.btnAge:
  4341. this.ui.ageNode.visible = false;
  4342. this.ui.mainBg.visible = false;
  4343. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4344. this.ui.visible = false;
  4345. break;
  4346. case this.ui.xyNode.btnXy3:
  4347. case this.ui.xyNode.btnXy1:
  4348. this.loadXy(1);
  4349. break;
  4350. case this.ui.xyNode.btnXy2:
  4351. this.loadXy(2);
  4352. break;
  4353. case this.ui.xyNode.btnBack:
  4354. this.ui.xyNode.xy1.visible = true;
  4355. this.ui.xyNode.xy2.visible = false;
  4356. break;
  4357. case this.ui.xyNode.btnKnown:
  4358. this.ui.xyNode.visible = false;
  4359. this.ui.mainBg.visible = false;
  4360. this.ui.visible = false;
  4361. break;
  4362. case this.ui.rnNode.btnCheck:
  4363. this.check();
  4364. break;
  4365. case this.ui.rnNode.btnExit:
  4366. case this.ui.xyNode.btnNo:
  4367. this.ysxyNum--;
  4368. if (this.ysxyNum > 0)
  4369. this.showMsg("Refuse to quit the game once again");
  4370. else {
  4371. Moyu.userAgree(false);
  4372. Moyu.exit();
  4373. }
  4374. break;
  4375. case this.ui.xyNode.btnSure:
  4376. case this.ui.xyNode.btnYes:
  4377. DataMgr.userData.isAgree = true;
  4378. DataMgr.saveUserData();
  4379. this.onAgree();
  4380. break;
  4381. case this.ui.rnNode.btnDone:
  4382. this.ui.rnNode.visible = false;
  4383. this.ui.visible = false;
  4384. break;
  4385. case this.ui.fcmNode.btnRn:
  4386. this.showRn();
  4387. break;
  4388. }
  4389. }
  4390. showTip(show) {
  4391. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4392. return;
  4393. if (show) {
  4394. MoyuMgr.isAdvise = true;
  4395. this.ui.visible = true;
  4396. this.ui.tipNode.visible = true;
  4397. this.ui.tipNode.alpha = 1;
  4398. Laya.timer.once(1000, this, this.showTip, [false]);
  4399. }
  4400. else {
  4401. this.ui.tipNode.alpha = 1;
  4402. this.ui.tipNode.visible = true;
  4403. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4404. this.ui.tipNode.visible = false;
  4405. MoyuMgr.isAdvise = false;
  4406. }), 1000);
  4407. }
  4408. }
  4409. showAge(show, px = 0, py = 0) {
  4410. if (Moyu.platType > 10 && !Moyu.isIos) {
  4411. this.ui.ageTip.x = px;
  4412. this.ui.ageTip.y = py;
  4413. this.ui.ageTip.visible = show;
  4414. if (show)
  4415. this.ui.visible = true;
  4416. }
  4417. }
  4418. showAgree(call) {
  4419. this.agreeCall = call;
  4420. this.onAgree();
  4421. return;
  4422. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4423. this.showXy(0);
  4424. }
  4425. else
  4426. this.onAgree();
  4427. }
  4428. onAgree() {
  4429. if (!this.ui.ageNode.visible)
  4430. this.ui.visible = false;
  4431. this.ui.xyNode.visible = false;
  4432. Moyu.userAgree(true);
  4433. this.showAge(false);
  4434. this.agreeCall && this.agreeCall();
  4435. this.showRn();
  4436. }
  4437. showMsg(txt) {
  4438. this.ui.msgNode.txtMsg.text = txt;
  4439. this.ui.msgNode.visible = true;
  4440. this.ui.msgNode.alpha = 1;
  4441. this.ui.visible = true;
  4442. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4443. this.ui.msgNode.visible = false;
  4444. }), 2500, true);
  4445. }
  4446. showRn() {
  4447. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4448. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4449. this.ui.rnNode.rn1.visible = true;
  4450. this.ui.rnNode.rn2.visible = false;
  4451. this.ui.rnNode.rn3.visible = false;
  4452. this.ui.rnNode.rn4.visible = false;
  4453. this.ui.rnNode.visible = true;
  4454. this.ui.mainBg.visible = true;
  4455. this.ui.rnNode.btnDone.visible = false;
  4456. this.ui.rnNode.btnExit.visible = true;
  4457. this.ui.rnNode.btnCheck.visible = true;
  4458. this.ui.fcmNode.visible = false;
  4459. this.ui.visible = true;
  4460. return;
  4461. }
  4462. }
  4463. this.showFcm();
  4464. }
  4465. showFcm() {
  4466. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4467. Moyu.initFCM(true);
  4468. if (Moyu.gameTime < 1)
  4469. this.fcmLoop();
  4470. else if (Moyu.gameTime < 999)
  4471. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4472. }
  4473. }
  4474. fcmLoop() {
  4475. if (Moyu.gameTime < 1) {
  4476. this.ui.rnNode.visible = false;
  4477. this.ui.fcmNode.visible = true;
  4478. this.ui.mainBg.visible = true;
  4479. this.ui.visible = true;
  4480. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4481. Laya.timer.clear(this.ui, this.fcmLoop);
  4482. }
  4483. }
  4484. check() {
  4485. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4486. this.ui.rnNode.rn1.visible = false;
  4487. this.ui.rnNode.rn2.visible = false;
  4488. this.ui.rnNode.rn4.visible = true;
  4489. }
  4490. else if (this.ui.rnNode.rn4.visible) {
  4491. let name = this.ui.rnNode.inputName.text;
  4492. let code = this.ui.rnNode.inputCode.text;
  4493. if (code && code.length == 18) {
  4494. this.ui.rnNode.rn1.visible = false;
  4495. this.ui.rnNode.rn4.visible = false;
  4496. Moyu.authenticate(name, code, (res) => {
  4497. this.ui.rnNode.rn2.visible = !res;
  4498. this.ui.rnNode.rn3.visible = res;
  4499. this.ui.rnNode.btnDone.visible = res;
  4500. this.ui.rnNode.btnExit.visible = !res;
  4501. this.ui.rnNode.btnCheck.visible = !res;
  4502. if (res)
  4503. this.showFcm();
  4504. });
  4505. }
  4506. else
  4507. this.showMsg("信息填写不完整");
  4508. }
  4509. }
  4510. loadXy(type = 0) {
  4511. this.ui.xyNode.xy1.visible = false;
  4512. this.ui.xyNode.xy2.visible = true;
  4513. this.ui.xyNode.xyList.scrollToView(0);
  4514. if (type == 1) {
  4515. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4516. }
  4517. else if (type == 2) {
  4518. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4519. }
  4520. }
  4521. showXy(type = 0) {
  4522. this.xyBtn();
  4523. if (type == 0) {
  4524. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4525. this.ui.xyNode.btnSure.visible = true;
  4526. }
  4527. else {
  4528. this.ui.xyNode.btnYes.visible = true;
  4529. this.ui.xyNode.btnNo.visible = true;
  4530. }
  4531. }
  4532. else {
  4533. this.ui.xyNode.btnKnown.visible = true;
  4534. this.ui.mainBg.visible = true;
  4535. }
  4536. this.ui.xyNode.xy1.visible = true;
  4537. this.ui.xyNode.xy2.visible = false;
  4538. this.ui.xyNode.visible = true;
  4539. this.ui.visible = true;
  4540. }
  4541. xyBtn() {
  4542. this.ui.xyNode.btnSure.visible = false;
  4543. this.ui.xyNode.btnYes.visible = false;
  4544. this.ui.xyNode.btnNo.visible = false;
  4545. this.ui.xyNode.btnKnown.visible = false;
  4546. {
  4547. this.ui.xyNode.btnXy3.visible = false;
  4548. this.ui.xyNode.btnXy2.visible = true;
  4549. this.ui.xyNode.btnXy1.visible = true;
  4550. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4551. }
  4552. }
  4553. createXY(json) {
  4554. this.ysJson = json.content;
  4555. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4556. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4557. this.ui.xyNode.xy2.visible = true;
  4558. }
  4559. renderListItem(idx, cell) {
  4560. let xy = this.ysJson[idx];
  4561. cell.height = xy.line * 30;
  4562. cell.xyItem.text = xy.text;
  4563. }
  4564. onDestroy() {
  4565. this.agreeCall = null;
  4566. }
  4567. }
  4568. class SettingNode {
  4569. constructor(ui) {
  4570. this.showSetting = false;
  4571. this.openSound = true;
  4572. this.openShake = true;
  4573. this.ui = ui;
  4574. this.ui.soundBtn.onClick(this, this.switchSound);
  4575. this.ui.shakeBtn.onClick(this, this.switchShake);
  4576. this.ui.xyBtn.onClick(this, this.onXy);
  4577. this.ui.clickNode.onClick(this, this.changeSetting);
  4578. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4579. this.ui.xyBtn.visible = false;
  4580. this.ui.shakeBtn.visible = false;
  4581. }
  4582. changeSetting() {
  4583. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4584. this.showSetting = !this.showSetting;
  4585. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4586. }
  4587. switchSound() {
  4588. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4589. this.openSound = !this.openSound;
  4590. Moyu.onSetting(this.openSound, this.openShake);
  4591. xGame.soundMgr.onSetting(this.openSound);
  4592. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4593. }
  4594. switchShake() {
  4595. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4596. this.openShake = !this.openShake;
  4597. Moyu.onSetting(this.openSound, this.openShake);
  4598. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4599. }
  4600. onXy() {
  4601. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4602. MoyuMgr.showXy(1);
  4603. }
  4604. }
  4605. class ui_UILevelDisplay extends fgui.GComponent {
  4606. static createInstance() {
  4607. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4608. }
  4609. onConstruct() {
  4610. this.n9 = (this.getChild("n9"));
  4611. this.myNode = (this.getChild("myNode"));
  4612. this.closeNode = (this.getChild("closeNode"));
  4613. }
  4614. }
  4615. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4616. class ui_UILevelProp extends fgui.GComponent {
  4617. static createInstance() {
  4618. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4619. }
  4620. onConstruct() {
  4621. this.n16 = (this.getChild("n16"));
  4622. this.myNode = (this.getChild("myNode"));
  4623. this.closeBtn = (this.getChild("closeBtn"));
  4624. this.moneyNode = (this.getChild("moneyNode"));
  4625. this.t1 = this.getTransition("t1");
  4626. }
  4627. }
  4628. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4629. class ui_ShowItem extends fgui.GComponent {
  4630. static createInstance() {
  4631. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4632. }
  4633. onConstruct() {
  4634. this.myImg = (this.getChild("myImg"));
  4635. }
  4636. }
  4637. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4638. class ShowItem {
  4639. constructor() {
  4640. this.ui = ui_ShowItem.createInstance();
  4641. }
  4642. destroySelf() {
  4643. if (!this.ui.isDisposed) {
  4644. this.ui.removeFromParent();
  4645. this.ui.dispose();
  4646. }
  4647. }
  4648. setParent(parent) {
  4649. parent.addChild(this.ui);
  4650. }
  4651. setPos(x, y) {
  4652. this.ui.x = x;
  4653. this.ui.y = y;
  4654. }
  4655. setUrl(index) {
  4656. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4657. }
  4658. }
  4659. class ui_UIPower extends fgui.GComponent {
  4660. static createInstance() {
  4661. return (fgui.UIPackage.createObject("game", "UIPower"));
  4662. }
  4663. onConstruct() {
  4664. this.n11 = (this.getChild("n11"));
  4665. this.myNode = (this.getChild("myNode"));
  4666. this.t0 = this.getTransition("t0");
  4667. }
  4668. }
  4669. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4670. class UIPower extends UIBase {
  4671. constructor() {
  4672. super();
  4673. }
  4674. onConstructor() {
  4675. this.ui = ui_UIPower.createInstance();
  4676. this.contentPane = this.ui;
  4677. this.isEject = false;
  4678. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4679. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4680. }
  4681. show() {
  4682. super.show();
  4683. this.ui.t0.play();
  4684. }
  4685. videoGetPower() {
  4686. console.log('zh:qjff_AD_for_uipower');
  4687. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4688. }
  4689. else {
  4690. console.log('zh:AD 失败,直接发放奖励');
  4691. this.qjff_AD_for_uipower();
  4692. }
  4693. }
  4694. qjff_AD_for_uipower() {
  4695. DataMgr.setPower(xGame.common.videoPower, true);
  4696. xGame.eventMgr.event(POWER_TIME);
  4697. this.hide();
  4698. }
  4699. }
  4700. UIPower.uiName = "UIPower";
  4701. class UILevelProp extends UIBase {
  4702. constructor() {
  4703. super();
  4704. this.firstPos = 385;
  4705. this.secondPos = 467;
  4706. this.showItemArr = [];
  4707. }
  4708. onFontLoaded() {
  4709. try {
  4710. this.ui.myNode.conditionTxt.font = "arial";
  4711. console.log("zh: onFontLoaded 设置arial字体成功");
  4712. }
  4713. catch (error) {
  4714. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4715. }
  4716. }
  4717. onConstructor() {
  4718. this.ui = ui_UILevelProp.createInstance();
  4719. this.contentPane = this.ui;
  4720. this.isEject = false;
  4721. this.addUIClick(this.ui.closeBtn, this.hide);
  4722. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4723. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4724. }
  4725. show(level) {
  4726. super.show();
  4727. this.ui.t1.play();
  4728. this.level = level;
  4729. this.data = cfgTable.placeballData[this.level];
  4730. this.updateSelf();
  4731. this.showPreView();
  4732. this.moneyNode.ui.c1.selectedIndex = 2;
  4733. this.moneyNode.checkPowerTime();
  4734. this.moneyNode.powerChange();
  4735. }
  4736. showPreView() {
  4737. let item;
  4738. let data;
  4739. for (let index = 0; index < this.showItemArr.length; index++) {
  4740. item = this.showItemArr[index];
  4741. item.destroySelf();
  4742. }
  4743. this.showItemArr = [];
  4744. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4745. for (const key in cfgData) {
  4746. data = cfgData[key];
  4747. item = new ShowItem();
  4748. item.setParent(this.ui.myNode.displayRoot);
  4749. item.setPos(data.x, data.y);
  4750. item.setUrl(data.value);
  4751. this.showItemArr.push(item);
  4752. }
  4753. }
  4754. updateSelf() {
  4755. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4756. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4757. if (this.data.ball == -1) {
  4758. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4759. }
  4760. else {
  4761. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4762. }
  4763. let localData = DataMgr.getPlaceBallLevel(this.level);
  4764. let getAward = localData.getAward;
  4765. let cfg = cfgTable.placeballData[this.level];
  4766. let coin = this.data.award[0];
  4767. let diamond = this.data.award[1];
  4768. if (cfg.type == PlaceBallType.challenge) {
  4769. diamond = 0;
  4770. coin = 100;
  4771. }
  4772. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4773. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4774. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4775. if (cfg.type == PlaceBallType.challenge) {
  4776. this.ui.myNode.coinNode.numTxt.text = "";
  4777. }
  4778. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4779. if (coin > 0 && diamond > 0) {
  4780. this.ui.myNode.diamondNode.x = 385;
  4781. this.ui.myNode.coinNode.x = 467;
  4782. }
  4783. else {
  4784. this.ui.myNode.diamondNode.x = 385;
  4785. this.ui.myNode.coinNode.x = 385;
  4786. }
  4787. if (!getAward) {
  4788. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4789. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4790. }
  4791. else {
  4792. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4793. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4794. }
  4795. }
  4796. startGame() {
  4797. if (DataMgr.powerEnough()) {
  4798. this.ui.myNode.startBtn.touchable = false;
  4799. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4800. console.log('zh:startGame ');
  4801. this.ui.myNode.startBtn.touchable = true;
  4802. DataMgr.setPower(-1);
  4803. xGame.eventMgr.event(POWER_TIME);
  4804. xGame.common.gameMode = GameMode.placeBall;
  4805. xGame.common.placeBallCurLevel = this.level;
  4806. xGame.uiMgr.Show(UIGame);
  4807. xGame.uiMgr.Hide(UILevelDisplay);
  4808. xGame.uiMgr.Hide(UIMain);
  4809. this.hide();
  4810. }));
  4811. }
  4812. else {
  4813. console.log('zh:startGame no power');
  4814. xGame.uiMgr.Show(UIPower);
  4815. }
  4816. }
  4817. hide() {
  4818. super.hide();
  4819. }
  4820. }
  4821. UILevelProp.uiName = "UILevelProp";
  4822. class PutBallLevelDisplay {
  4823. constructor(ui, index) {
  4824. this.index = 0;
  4825. this.ui = ui;
  4826. this.index = index;
  4827. this.ui.onClick(this, this.clickSelf);
  4828. this.updateSelf();
  4829. this.ui.levelTxt.text = (this.index + 1) + "";
  4830. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4831. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4832. }
  4833. updateSelf() {
  4834. let level = this.index + 1;
  4835. this.data = DataMgr.getPlaceBallLevel(level);
  4836. this.ui.starNode.c1.selectedIndex = this.data.star;
  4837. let isChallenge = cfgTable.placeballData[level].type;
  4838. if (this.data.isCur) {
  4839. if (isChallenge) {
  4840. this.ui.c1.selectedIndex = 5;
  4841. }
  4842. else {
  4843. this.ui.c1.selectedIndex = 2;
  4844. }
  4845. }
  4846. else {
  4847. if (this.data.play) {
  4848. if (this.data.star == 3) {
  4849. this.ui.c1.selectedIndex = 0;
  4850. }
  4851. else {
  4852. this.ui.c1.selectedIndex = 1;
  4853. }
  4854. }
  4855. else {
  4856. if (isChallenge) {
  4857. this.ui.c1.selectedIndex = 4;
  4858. }
  4859. else {
  4860. this.ui.c1.selectedIndex = 3;
  4861. }
  4862. }
  4863. }
  4864. }
  4865. clickSelf() {
  4866. if (!this.data.play)
  4867. return;
  4868. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4869. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4870. }
  4871. }
  4872. class UILevelDisplay extends UIBase {
  4873. constructor() {
  4874. super();
  4875. }
  4876. onConstructor() {
  4877. this.ui = ui_UILevelDisplay.createInstance();
  4878. this.contentPane = this.ui;
  4879. this.isEject = false;
  4880. this.myList = this.ui.myNode.myList;
  4881. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4882. this.levelItemArr = [];
  4883. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4884. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4885. this.myList.numItems = levelNum;
  4886. if (Moyu.isKs)
  4887. this.ui.closeNode.closeBtn.x += 100;
  4888. }
  4889. levelItemRender(index, target) {
  4890. let item = new PutBallLevelDisplay(target, index);
  4891. this.levelItemArr.push(item);
  4892. }
  4893. show() {
  4894. super.show();
  4895. this.updateLevel();
  4896. this.scrollToPlace();
  4897. }
  4898. updateLevel() {
  4899. let temp;
  4900. for (let index = 0; index < this.levelItemArr.length; index++) {
  4901. temp = this.levelItemArr[index];
  4902. temp.updateSelf();
  4903. }
  4904. }
  4905. scrollToPlace() {
  4906. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4907. let passArr = DataMgr.getPlaceBallLevelList();
  4908. let offest = passArr.length;
  4909. if (offest >= maxNum - 1)
  4910. offest = maxNum - 1;
  4911. this.myList.scrollToView(offest, true, true);
  4912. }
  4913. hide() {
  4914. super.hide();
  4915. }
  4916. }
  4917. UILevelDisplay.uiName = "UILevelDisplay";
  4918. class ui_UIMatching extends fgui.GComponent {
  4919. static createInstance() {
  4920. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4921. }
  4922. onConstruct() {
  4923. this.n5 = (this.getChild("n5"));
  4924. this.n49 = (this.getChild("n49"));
  4925. this.n51 = (this.getChild("n51"));
  4926. this.n64 = (this.getChild("n64"));
  4927. this.n2 = (this.getChild("n2"));
  4928. this.n53 = (this.getChild("n53"));
  4929. this.n54 = (this.getChild("n54"));
  4930. this.n56 = (this.getChild("n56"));
  4931. this.n58 = (this.getChild("n58"));
  4932. this.n59 = (this.getChild("n59"));
  4933. this.n57 = (this.getChild("n57"));
  4934. this.n60 = (this.getChild("n60"));
  4935. this.n62 = (this.getChild("n62"));
  4936. this.awardTxt = (this.getChild("awardTxt"));
  4937. this.n61 = (this.getChild("n61"));
  4938. this.selfHead = (this.getChild("selfHead"));
  4939. this.aiHead = (this.getChild("aiHead"));
  4940. this.n82 = (this.getChild("n82"));
  4941. this.n84 = (this.getChild("n84"));
  4942. this.n83 = (this.getChild("n83"));
  4943. this.t1 = this.getTransition("t1");
  4944. this.t2 = this.getTransition("t2");
  4945. this.t3 = this.getTransition("t3");
  4946. this.t4 = this.getTransition("t4");
  4947. }
  4948. }
  4949. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4950. class UIMatching extends UIBase {
  4951. constructor() {
  4952. super();
  4953. }
  4954. onConstructor() {
  4955. this.ui = ui_UIMatching.createInstance();
  4956. this.contentPane = this.ui;
  4957. this.isEject = false;
  4958. }
  4959. show(callback) {
  4960. super.show();
  4961. PlatMgr.showBanner(true);
  4962. this.callback = callback;
  4963. let user = Moyu.getUserInfo();
  4964. if (!this.selfPot) {
  4965. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4966. }
  4967. if (!this.aiPot) {
  4968. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4969. }
  4970. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4971. this.ui.selfHead.nameTxt.text = user.nickName;
  4972. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4973. this.ui.aiHead.nameTxt.text = "???";
  4974. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4975. this.ui.selfHead.c1.selectedIndex = 0;
  4976. this.ui.aiHead.c1.selectedIndex = 0;
  4977. this.ui.selfHead.x = this.selfPot.x;
  4978. this.ui.selfHead.y = this.selfPot.y;
  4979. this.ui.aiHead.x = this.aiPot.x;
  4980. this.ui.aiHead.y = this.aiPot.y;
  4981. switch (xGame.common.gameMode) {
  4982. case GameMode.classic:
  4983. break;
  4984. case GameMode.bigMove:
  4985. this.initSkillData();
  4986. break;
  4987. default:
  4988. break;
  4989. }
  4990. this.ui.t1.play(Laya.Handler.create(this, () => {
  4991. this.ui.t2.play(Laya.Handler.create(this, () => {
  4992. switch (xGame.common.gameMode) {
  4993. case GameMode.classic:
  4994. this.waitingPeople();
  4995. break;
  4996. case GameMode.bigMove:
  4997. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4998. break;
  4999. default:
  5000. break;
  5001. }
  5002. }));
  5003. }));
  5004. }
  5005. initSkillData() {
  5006. this.skillSelectData = [];
  5007. let skillUrl = xGame.common.skillIconList;
  5008. let skillName = xGame.common.skillNameList;
  5009. let skillLevel = DataMgr.getBigSkillList();
  5010. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5011. for (let index = 0; index < 5; index++) {
  5012. let obj = {};
  5013. obj.skillImg = skillUrl[index];
  5014. obj.skillName = skillName[index];
  5015. obj.skillType = skillType[index];
  5016. obj.skillLevel = skillLevel[index];
  5017. this.skillSelectData.push(obj);
  5018. }
  5019. }
  5020. getAISkillLevel(myLevel) {
  5021. let video = xGame.common.upSkillLevel;
  5022. let aiLevel;
  5023. let temp;
  5024. if (video) {
  5025. temp = xGame.common.randomNum(-2, -1);
  5026. }
  5027. else {
  5028. if (myLevel <= 5) {
  5029. temp = xGame.common.randomNum(1, 3);
  5030. }
  5031. else if (myLevel <= 9) {
  5032. temp = xGame.common.randomNum(-2, 1);
  5033. }
  5034. else {
  5035. temp = xGame.common.randomNum(-4, 0);
  5036. }
  5037. }
  5038. aiLevel = temp + myLevel;
  5039. if (aiLevel <= 1)
  5040. aiLevel = 1;
  5041. if (aiLevel >= 10)
  5042. aiLevel = 10;
  5043. return aiLevel;
  5044. }
  5045. getAISkillType() {
  5046. return xGame.common.randomNum(1, 4);
  5047. let successTimes = DataMgr.getSkillSuccessTimes();
  5048. let info = cfgTable.aiskillData[successTimes];
  5049. if (!info) {
  5050. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5051. info = cfgTable.aiskillData[max];
  5052. }
  5053. let dataArr = info.skillselect;
  5054. let myCfg = {};
  5055. for (let index = 0; index < dataArr.length; index++) {
  5056. let temp = dataArr[index].split('-');
  5057. myCfg[temp[0]] = {};
  5058. myCfg[temp[0]].id = parseInt(temp[0]);
  5059. myCfg[temp[0]].weight = parseInt(temp[1]);
  5060. }
  5061. let aiCfg = xGame.common.initWeight(myCfg);
  5062. let curData = xGame.common.getRandomWeightData(aiCfg);
  5063. return parseInt(curData.id);
  5064. }
  5065. getAISkillData(index) {
  5066. let myLevel = this.skillSelectData[index].skillLevel;
  5067. let aiLevel = this.getAISkillLevel(myLevel);
  5068. let aiType = this.getAISkillType() - 1;
  5069. return { aiLevel, aiType } = { aiLevel, aiType };
  5070. }
  5071. skillSelectFinish(index) {
  5072. let aiInfo = this.getAISkillData(index);
  5073. xGame.common.gameMgr.selfCurSkill = index;
  5074. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5075. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5076. this.ui.selfHead.c1.selectedIndex = 1;
  5077. this.ui.aiHead.c1.selectedIndex = 1;
  5078. let myData = this.skillSelectData[index];
  5079. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5080. let guide = DataMgr.getSkillGuide();
  5081. if (guide == 0) {
  5082. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5083. }
  5084. else {
  5085. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5086. }
  5087. let aiData = this.skillSelectData[aiInfo.aiType];
  5088. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5089. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5090. this.waitingPeople();
  5091. }
  5092. waitingPeople() {
  5093. let time = xGame.common.randomNum(1000, 3000);
  5094. time += 1000;
  5095. Laya.timer.once(time, this, () => {
  5096. this.matchingSuccess();
  5097. });
  5098. }
  5099. matchingSuccess() {
  5100. let gameUI = xGame.common.gameUI;
  5101. let name = gameUI.ui.topNode.aiNameTxt.text;
  5102. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5103. this.ui.aiHead.nameTxt.text = name;
  5104. this.ui.aiHead.headImg.url = url;
  5105. name = gameUI.ui.topNode.selfNameTxt.text;
  5106. url = gameUI.ui.topNode.selfHeadLoader.url;
  5107. this.ui.selfHead.nameTxt.text = name;
  5108. this.ui.selfHead.headImg.url = url;
  5109. this.ui.t3.play(Laya.Handler.create(this, () => {
  5110. this.callback && this.callback();
  5111. this.ui.t4.play(Laya.Handler.create(this, () => {
  5112. this.destroySelf();
  5113. }));
  5114. }));
  5115. }
  5116. destroySelf() {
  5117. this.callback = null;
  5118. this.skillSelectData = null;
  5119. this.selfPot = null;
  5120. this.aiPot = null;
  5121. if (!this.ui.isDisposed) {
  5122. this.ui.removeFromParent();
  5123. this.ui.dispose();
  5124. }
  5125. xGame.uiMgr.destroyUI(this);
  5126. }
  5127. }
  5128. UIMatching.uiName = "UIMatching";
  5129. class ui_UIRanking extends fgui.GComponent {
  5130. static createInstance() {
  5131. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5132. }
  5133. onConstruct() {
  5134. this.n26 = (this.getChild("n26"));
  5135. this.myNode = (this.getChild("myNode"));
  5136. }
  5137. }
  5138. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5139. class UIRanking extends UIBase {
  5140. constructor() {
  5141. super();
  5142. this.showSelf = true;
  5143. this.rankType = 1;
  5144. this.rankList = [];
  5145. this.myIndex = 0;
  5146. this.myStar = 0;
  5147. }
  5148. onConstructor() {
  5149. this.ui = ui_UIRanking.createInstance();
  5150. this.contentPane = this.ui;
  5151. this.isEject = false;
  5152. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5153. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5154. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5155. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5156. this.ui.myNode.myList.setVirtual();
  5157. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5158. }
  5159. show() {
  5160. super.show();
  5161. this.myIndex = 51;
  5162. Moyu.getRankList({
  5163. rankId: xGame.common.curRankID,
  5164. type: MoyuRankType.total,
  5165. page: 1,
  5166. pageSize: 50,
  5167. }, this, this.updateItemData);
  5168. this.updateSelf();
  5169. let self = Moyu.getUserInfo();
  5170. if (!self.isAuth) {
  5171. Moyu.initUser(this, () => {
  5172. DataMgr.upRankData();
  5173. });
  5174. }
  5175. }
  5176. updateSelfItem() {
  5177. let self = Moyu.getUserInfo();
  5178. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5179. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  5180. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5181. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  5182. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5183. }
  5184. updateItemData(data) {
  5185. this.myStar = xGame.common.getAllStarNum();
  5186. if (this.rankList.length < 2) {
  5187. this.rankList = data;
  5188. let self = Moyu.getUserInfo();
  5189. for (let i = 0; i < data.length; i++) {
  5190. let data = this.rankList[i];
  5191. if (data.userId == self.userId) {
  5192. this.rankList.splice(i, 1);
  5193. break;
  5194. }
  5195. }
  5196. for (let i = 0; i < data.length; i++) {
  5197. let data = this.rankList[i];
  5198. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5199. this.myIndex = i + 1;
  5200. let user = { headIcon: self.headIcon, nickName: "myself" };
  5201. let ud = { user: user, data: {} };
  5202. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5203. if (Moyu.platType < 11) {
  5204. user.headIcon = self.headIcon;
  5205. user.nickName = self.nickName;
  5206. }
  5207. this.rankList.splice(i, 0, md);
  5208. break;
  5209. }
  5210. }
  5211. }
  5212. this.updateSelfItem();
  5213. this.ui.myNode.myList.numItems = this.rankList.length;
  5214. }
  5215. updateItemUI(index, obj) {
  5216. let data = this.rankList[index];
  5217. let userData = JSON.parse(data.userData).user;
  5218. obj.nameTxt.text = userData.nickName.toString();
  5219. obj.valueTxt.text = data.rankScore;
  5220. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5221. obj.rankTxt.text = index + 1;
  5222. switch (index) {
  5223. case 0:
  5224. this.setImg(obj, 1, 0, 0);
  5225. obj.rankTxt.color = "#FFC047";
  5226. break;
  5227. case 1:
  5228. this.setImg(obj, 0, 1, 0);
  5229. obj.rankTxt.color = "#ACACAC";
  5230. break;
  5231. case 2:
  5232. this.setImg(obj, 0, 0, 1);
  5233. obj.rankTxt.color = "#D09672";
  5234. break;
  5235. default:
  5236. this.setImg(obj, 0, 0, 0);
  5237. obj.rankTxt.color = "#496FAB";
  5238. break;
  5239. }
  5240. }
  5241. setImg(obj, a, b, c) {
  5242. obj.img1.visible = a ? true : false;
  5243. obj.img2.visible = b ? true : false;
  5244. obj.img3.visible = c ? true : false;
  5245. }
  5246. changeList(type) {
  5247. this.rankType = type;
  5248. this.updateSelf();
  5249. }
  5250. changeSelfNode() {
  5251. this.showSelf = !this.showSelf;
  5252. this.updateSelf();
  5253. }
  5254. updateSelf() {
  5255. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5256. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5257. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5258. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5259. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5260. }
  5261. }
  5262. UIRanking.uiName = "UIRanking";
  5263. class ui_UISecretary extends fgui.GComponent {
  5264. static createInstance() {
  5265. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5266. }
  5267. onConstruct() {
  5268. this.n0 = (this.getChild("n0"));
  5269. this.myNode = (this.getChild("myNode"));
  5270. this.closeBtn = (this.getChild("closeBtn"));
  5271. this.t0 = this.getTransition("t0");
  5272. }
  5273. }
  5274. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5275. class UISecretary extends UIBase {
  5276. constructor() {
  5277. super();
  5278. this.curIndex = 1;
  5279. }
  5280. onConstructor() {
  5281. this.ui = ui_UISecretary.createInstance();
  5282. this.contentPane = this.ui;
  5283. this.isEject = false;
  5284. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5285. this.nodeObj = { left: null, right: null, cur: null };
  5286. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5287. }
  5288. show() {
  5289. super.show();
  5290. this.ui.t0.play();
  5291. this.updateData();
  5292. }
  5293. addSecretarySpine(node, spineName) {
  5294. if (spineName == "mishu") {
  5295. if (this.secretarySpine1) {
  5296. node.displayObject.destroyChildren();
  5297. this.playWoman(this.secretarySpine1, node.displayObject);
  5298. }
  5299. else {
  5300. let spine1 = new SpineMgr("mishu", () => {
  5301. this.secretarySpine1 = spine1;
  5302. this.playWoman(this.secretarySpine1, node.displayObject);
  5303. });
  5304. }
  5305. }
  5306. else {
  5307. if (this.secretarySpine2) {
  5308. node.displayObject.destroyChildren();
  5309. this.playWoman(this.secretarySpine2, node.displayObject);
  5310. }
  5311. else {
  5312. let spine2 = new SpineMgr("xiaomishu2", () => {
  5313. this.secretarySpine2 = spine2;
  5314. this.playWoman(this.secretarySpine2, node.displayObject);
  5315. });
  5316. }
  5317. }
  5318. }
  5319. playWoman(node, parent) {
  5320. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5321. let yy = this.ui.myNode.gameNode3.secretary.height;
  5322. let scale = 1.5;
  5323. if (node == this.secretarySpine2) {
  5324. scale = 1.2;
  5325. }
  5326. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5327. node.play(data, 0, true, parent);
  5328. }
  5329. turnLeft() {
  5330. this.curIndex--;
  5331. if (this.curIndex < 1) {
  5332. this.curIndex = 2;
  5333. }
  5334. let left = this.nodeObj.left;
  5335. let right = this.nodeObj.right;
  5336. let cur = this.nodeObj.cur;
  5337. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5338. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5339. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5340. this.updateData();
  5341. }));
  5342. this.ui.myNode.setChildIndex(right, 2);
  5343. this.nodeObj.left = cur;
  5344. this.nodeObj.right = left;
  5345. this.nodeObj.cur = right;
  5346. }
  5347. turnRight() {
  5348. this.curIndex++;
  5349. if (this.curIndex > 2) {
  5350. this.curIndex = 1;
  5351. }
  5352. let left = this.nodeObj.left;
  5353. let right = this.nodeObj.right;
  5354. let cur = this.nodeObj.cur;
  5355. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5356. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5357. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5358. this.updateData();
  5359. }));
  5360. this.ui.myNode.setChildIndex(left, 2);
  5361. this.nodeObj.left = right;
  5362. this.nodeObj.right = cur;
  5363. this.nodeObj.cur = left;
  5364. }
  5365. updateData() {
  5366. let data = cfgTable.secretaryshopData;
  5367. let children = this.ui.myNode._children;
  5368. let temp;
  5369. let curData;
  5370. for (let index = 0; index < children.length; index++) {
  5371. temp = children[index];
  5372. curData = data[1];
  5373. temp.heightTxt.text = curData.height;
  5374. temp.foodTxt.text = curData.food;
  5375. temp.historyTxt.text = curData.history;
  5376. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5377. this.addSecretarySpine(temp.secretary, curData.spine);
  5378. let womanIndex = curData.id - 1;
  5379. let getWoman = DataMgr.getSecretary(womanIndex);
  5380. let curUse = DataMgr.getCurSecretary();
  5381. if (getWoman) {
  5382. if (curUse == womanIndex) {
  5383. temp.purchaseBtn.c1.selectedIndex = 1;
  5384. }
  5385. else {
  5386. temp.purchaseBtn.c1.selectedIndex = 2;
  5387. }
  5388. }
  5389. else {
  5390. temp.purchaseBtn.c1.selectedIndex = 0;
  5391. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5392. }
  5393. temp.purchaseBtn.offClick(this, this.clickSecretary);
  5394. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  5395. }
  5396. }
  5397. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5398. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5399. if (getWoman) {
  5400. if (curUse != womanIndex) {
  5401. console.log();
  5402. DataMgr.setCurSecretary(womanIndex);
  5403. this.updateData();
  5404. }
  5405. }
  5406. else {
  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. let get = DataMgr.getBallRod(this.index);
  5465. if (get == null)
  5466. get = 1;
  5467. let curUse = DataMgr.getCurBallRod();
  5468. if (get) {
  5469. if (curUse == this.index) {
  5470. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5471. }
  5472. else {
  5473. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5474. }
  5475. }
  5476. else {
  5477. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5478. }
  5479. }
  5480. buyBallRod() {
  5481. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5482. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5483. switch (selectedIndex) {
  5484. case 0:
  5485. break;
  5486. case 1:
  5487. DataMgr.setCurBallRod(this.index);
  5488. let ui = xGame.uiMgr.getUI(UIShop);
  5489. ui.updateBallRod();
  5490. break;
  5491. case 2:
  5492. let data = cfgTable.ballrodData[this.index + 1];
  5493. let need = data.price;
  5494. if (DataMgr.diamondEnough(need)) {
  5495. DataMgr.setDiamond(-need);
  5496. DataMgr.setBallRod(this.index, 1);
  5497. DataMgr.setCurBallRod(this.index);
  5498. let ui = xGame.uiMgr.getUI(UIShop);
  5499. ui.updateBallRod();
  5500. }
  5501. else {
  5502. xGame.uiMgr.Show(UIAddProp, 1);
  5503. }
  5504. break;
  5505. default:
  5506. break;
  5507. }
  5508. }
  5509. }
  5510. class UIShop extends UIBase {
  5511. constructor() {
  5512. super();
  5513. this.itemNums = 0;
  5514. }
  5515. onConstructor() {
  5516. this.ui = ui_UIShop.createInstance();
  5517. this.contentPane = this.ui;
  5518. this.isEject = false;
  5519. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5520. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5521. this.addUIClick(this.ui, this.interuptSecretary);
  5522. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5523. this.ballRodArr = [];
  5524. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5525. this.ui.myNode.myList.numItems = this.itemNums;
  5526. if (Moyu.isKs)
  5527. this.ui.closeNode.closeBtn.x += 100;
  5528. }
  5529. show() {
  5530. super.show();
  5531. this.playSecretaryIdle();
  5532. this.updateBallRod();
  5533. }
  5534. updateBallRod() {
  5535. for (let index = 0; index < this.ballRodArr.length; index++) {
  5536. this.ballRodArr[index].updateSelf();
  5537. }
  5538. }
  5539. renderBallRod(sort, obj) {
  5540. let index = this.getIndexBySort(sort + 1) - 1;
  5541. let ballRod = new BallRodDisplay(obj, index);
  5542. this.ballRodArr.push(ballRod);
  5543. }
  5544. getIndexBySort(sort) {
  5545. let object = cfgTable.ballrodData;
  5546. for (const key in object) {
  5547. if (object[key].sort == sort) {
  5548. return parseInt(key);
  5549. }
  5550. }
  5551. }
  5552. playSecretaryIdle() {
  5553. let parent = this.ui.secretary.displayObject;
  5554. parent.destroyChildren();
  5555. let xx = this.ui.secretary.width / 2;
  5556. let yy = this.ui.secretary.height;
  5557. let scale = xGame.common.getSecretaryScale();
  5558. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5559. xGame.common.secretary.play(data, 0, true, parent);
  5560. }
  5561. interuptSecretary() {
  5562. Laya.timer.clearAll(this);
  5563. this.playSecretaryRandomSound();
  5564. }
  5565. playSecretaryRandomSound() {
  5566. if (this.isHide)
  5567. return;
  5568. let time = xGame.common.randomNum(45000, 60000);
  5569. Laya.timer.once(time, this, () => {
  5570. if (this.isHide)
  5571. return;
  5572. let index = xGame.common.randomNum(4, 7);
  5573. xGame.soundMgr.playSound("s_main0" + index);
  5574. let words = 1;
  5575. switch (index) {
  5576. case 4:
  5577. words = 5;
  5578. break;
  5579. case 5:
  5580. words = 3;
  5581. break;
  5582. case 6:
  5583. words = 6;
  5584. break;
  5585. case 7:
  5586. words = 7;
  5587. break;
  5588. default:
  5589. break;
  5590. }
  5591. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5592. this.playSecretaryRandomSound();
  5593. });
  5594. }
  5595. closeSelf() {
  5596. this.hide();
  5597. }
  5598. }
  5599. UIShop.uiName = "UIShop";
  5600. class ui_UISign extends fgui.GComponent {
  5601. static createInstance() {
  5602. return (fgui.UIPackage.createObject("game", "UISign"));
  5603. }
  5604. onConstruct() {
  5605. this.n6 = (this.getChild("n6"));
  5606. this.closeNode = (this.getChild("closeNode"));
  5607. this.myNode = (this.getChild("myNode"));
  5608. this.moneyNode = (this.getChild("moneyNode"));
  5609. this.secretary = (this.getChild("secretary"));
  5610. this.talkNode = (this.getChild("talkNode"));
  5611. this.tripleBtn = (this.getChild("tripleBtn"));
  5612. this.normalBtn = (this.getChild("normalBtn"));
  5613. this.tipsNode = (this.getChild("tipsNode"));
  5614. this.againBtn = (this.getChild("againBtn"));
  5615. this.t0 = this.getTransition("t0");
  5616. }
  5617. }
  5618. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5619. class SignMax {
  5620. constructor(ui) {
  5621. this.ui = ui;
  5622. }
  5623. updateSelf(index, sameDay, curDayIndex) {
  5624. let data = cfgTable.signData[index + 1];
  5625. this.ui.titleTxt.text = data.title;
  5626. let arr1 = data.award[0].split('-');
  5627. let arr2 = data.award[1].split('-');
  5628. let num1 = parseInt(arr1[1]);
  5629. let num2 = parseInt(arr2[1]);
  5630. this.ui.numTxt1.text = num1 + "";
  5631. this.ui.numTxt2.text = num2 + "";
  5632. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5633. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5634. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5635. this.ui.numTxt1.visible = false;
  5636. }
  5637. else {
  5638. this.ui.numTxt1.visible = true;
  5639. }
  5640. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5641. this.ui.numTxt2.visible = false;
  5642. }
  5643. else {
  5644. this.ui.numTxt2.visible = true;
  5645. }
  5646. if (index < curDayIndex) {
  5647. this.ui.c1.selectedIndex = 1;
  5648. }
  5649. else if (index == curDayIndex) {
  5650. if (sameDay) {
  5651. this.ui.c1.selectedIndex = 2;
  5652. }
  5653. else {
  5654. this.ui.c1.selectedIndex = 2;
  5655. }
  5656. }
  5657. else {
  5658. this.ui.c1.selectedIndex = 0;
  5659. }
  5660. }
  5661. }
  5662. class SignNormal {
  5663. constructor(ui) {
  5664. this.ui = ui;
  5665. }
  5666. updateSelf(index, sameDay, curDayIndex) {
  5667. let data = cfgTable.signData[index + 1];
  5668. this.ui.titleTxt.text = data.title;
  5669. let arr = data.award[0].split('-');
  5670. let type = parseInt(arr[0]);
  5671. let num = parseInt(arr[1]);
  5672. this.ui.numTxt.text = num + "";
  5673. if (type > 2) {
  5674. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5675. this.ui.myIcon.rotation = 0;
  5676. }
  5677. else {
  5678. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5679. this.ui.myIcon.rotation = 0;
  5680. }
  5681. if (xGame.common.signAwardContainsRod(data.award)) {
  5682. this.ui.numTxt.visible = false;
  5683. }
  5684. else {
  5685. this.ui.numTxt.visible = true;
  5686. }
  5687. if (index < curDayIndex) {
  5688. this.ui.c1.selectedIndex = 1;
  5689. }
  5690. else if (index == curDayIndex) {
  5691. if (sameDay) {
  5692. this.ui.c1.selectedIndex = 2;
  5693. }
  5694. else {
  5695. this.ui.c1.selectedIndex = 2;
  5696. }
  5697. }
  5698. else {
  5699. this.ui.c1.selectedIndex = 0;
  5700. }
  5701. }
  5702. }
  5703. class UISign extends UIBase {
  5704. constructor() {
  5705. super();
  5706. this.curDayIndex = 0;
  5707. this.starX = 0;
  5708. }
  5709. onConstructor() {
  5710. this.ui = ui_UISign.createInstance();
  5711. this.contentPane = this.ui;
  5712. this.isEject = false;
  5713. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5714. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5715. this.initSignItem();
  5716. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5717. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5718. }
  5719. show() {
  5720. super.show();
  5721. this.ui.t0.play();
  5722. this.playSecretaryIdle();
  5723. this.updateSign();
  5724. }
  5725. initSignItem() {
  5726. this.signArr = [];
  5727. for (let index = 0; index < 6; index++) {
  5728. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5729. this.signArr.push(temp);
  5730. }
  5731. this.signMax = new SignMax(this.ui.myNode.day7);
  5732. if (Moyu.isKs)
  5733. this.ui.closeNode.closeBtn.x += 100;
  5734. }
  5735. updateSign() {
  5736. let sameDay = xGame.common.judgeSameDay();
  5737. let max = 7;
  5738. this.curDayIndex = DataMgr.getSignData();
  5739. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5740. this.curDayIndex = 0;
  5741. if (!sameDay) {
  5742. this.ui.normalBtn.visible = true;
  5743. this.ui.tipsNode.visible = false;
  5744. this.ui.againBtn.visible = false;
  5745. }
  5746. else {
  5747. this.ui.normalBtn.visible = false;
  5748. let again = DataMgr.getExtraSign();
  5749. let isCurrency = false;
  5750. let index = this.curDayIndex;
  5751. if (index == 0)
  5752. index = 7;
  5753. let award = cfgTable.signData[index].award;
  5754. let num = award[0].split("-")[0];
  5755. if (num == "1" || num == "2")
  5756. isCurrency = true;
  5757. let showAgain = again == 0 && isCurrency;
  5758. this.ui.againBtn.visible = showAgain;
  5759. this.ui.tipsNode.visible = !showAgain;
  5760. }
  5761. for (let index = 0; index < this.signArr.length; index++) {
  5762. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5763. }
  5764. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5765. }
  5766. playSecretaryIdle() {
  5767. let parent = this.ui.secretary.displayObject;
  5768. parent.destroyChildren();
  5769. let xx = this.ui.secretary.width / 2;
  5770. let yy = this.ui.secretary.height;
  5771. let scale = xGame.common.getSecretaryScale();
  5772. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5773. xGame.common.secretary.play(data, 0, true, parent);
  5774. }
  5775. closeSelf() {
  5776. this.hide();
  5777. }
  5778. normalGetAward() {
  5779. let sameDay = xGame.common.judgeSameDay();
  5780. if (!sameDay) {
  5781. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5782. let temp;
  5783. let type;
  5784. let num;
  5785. let arr = [];
  5786. for (let index = 0; index < award.length; index++) {
  5787. temp = award[index].split("-");
  5788. type = parseInt(temp[0]);
  5789. num = parseInt(temp[1]);
  5790. let awardType = new AwardType();
  5791. awardType.num = num;
  5792. awardType.type = type;
  5793. arr.push(awardType);
  5794. }
  5795. xGame.common.getAward(arr, (watchVideo) => {
  5796. this.curDayIndex++;
  5797. if (this.curDayIndex > 7)
  5798. this.curDayIndex = 0;
  5799. DataMgr.setSignData(this.curDayIndex);
  5800. DataMgr.setSignTime(new Date().getTime());
  5801. if (watchVideo) {
  5802. DataMgr.setExtraSign(1);
  5803. Moyu.sendDataEvent("signIn1");
  5804. }
  5805. this.updateSign();
  5806. });
  5807. }
  5808. }
  5809. againGetAward() {
  5810. Moyu.sendDataEvent("signIn2");
  5811. console.log('zh:qjff_AD_for_uisign');
  5812. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  5813. }
  5814. else {
  5815. console.log('zh:AD 失败,直接发放奖励');
  5816. this.qjff_AD_for_uisign();
  5817. }
  5818. }
  5819. qjff_AD_for_uisign() {
  5820. let index = this.curDayIndex;
  5821. if (index == 0)
  5822. index = 7;
  5823. let award = cfgTable.signData[index].award;
  5824. let temp;
  5825. let type;
  5826. let num;
  5827. for (let index = 0; index < award.length; index++) {
  5828. temp = award[index].split("-");
  5829. type = parseInt(temp[0]);
  5830. num = parseInt(temp[1]) * 3;
  5831. xGame.common.playObjFlyAnim(num, type);
  5832. }
  5833. DataMgr.setExtraSign(1);
  5834. this.updateSign();
  5835. }
  5836. }
  5837. UISign.uiName = "UISign";
  5838. class ui_UISkill extends fgui.GComponent {
  5839. static createInstance() {
  5840. return (fgui.UIPackage.createObject("game", "UISkill"));
  5841. }
  5842. onConstruct() {
  5843. this.n48 = (this.getChild("n48"));
  5844. this.n0 = (this.getChild("n0"));
  5845. this.secretary = (this.getChild("secretary"));
  5846. this.talkNode = (this.getChild("talkNode"));
  5847. this.closeNode = (this.getChild("closeNode"));
  5848. this.moneyNode = (this.getChild("moneyNode"));
  5849. this.skillNode = (this.getChild("skillNode"));
  5850. this.guideNode = (this.getChild("guideNode"));
  5851. }
  5852. }
  5853. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5854. class SkillDisplay {
  5855. constructor(ui, data, uiIndex) {
  5856. this.starX = 0;
  5857. this.starY = 0;
  5858. this.index = 0;
  5859. this.ui = ui;
  5860. this.data = data;
  5861. this.index = uiIndex;
  5862. this.initSelf();
  5863. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5864. }
  5865. initSelf() {
  5866. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5867. this.ui.nameTxt.text = this.data.name;
  5868. this.ui.describeTxt.text = this.data.describe;
  5869. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5870. this.ui.startBtn.onClick(this, this.startGame);
  5871. this.updateSelf();
  5872. }
  5873. updateSelf() {
  5874. this.checkTry();
  5875. let level = DataMgr.getBigSkillByIndex(this.index);
  5876. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5877. }
  5878. checkTry() {
  5879. let index = this.index;
  5880. let level = DataMgr.getBigSkillByIndex(index);
  5881. if (level == null) {
  5882. DataMgr.setBigSkill(index, 1, false);
  5883. level = 1;
  5884. }
  5885. this.ui.levelTxt.text = "LV." + level;
  5886. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5887. this.ui.tryNode.visible = true;
  5888. else
  5889. this.ui.tryNode.visible = false;
  5890. }
  5891. clickAddLevel() {
  5892. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5893. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5894. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  5895. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  5896. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5897. }
  5898. else {
  5899. console.log('zh:AD 失败,直接发放奖励');
  5900. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5901. }
  5902. }
  5903. qjff_AD_for_skilldisplay_clickAddLevel() {
  5904. DataMgr.setBigSkill(this.data.index, 1);
  5905. this.updateSelf();
  5906. xGame.common.upSkillLevel = true;
  5907. }
  5908. startGame() {
  5909. if (this.data.index == 3) {
  5910. alert('Coming soon!');
  5911. return;
  5912. }
  5913. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5914. let needCoin = xGame.common.bigMoveNeedCoin;
  5915. xGame.common.passAwardCoin = 2000;
  5916. let guide = DataMgr.getSkillGuide();
  5917. console.log('zh:startGame guide=' + guide);
  5918. xGame.common.temSelfLevel = 0;
  5919. if (guide == 0) {
  5920. needCoin = 0;
  5921. xGame.common.temSelfLevel = 100;
  5922. }
  5923. if (DataMgr.coinEnough(needCoin)) {
  5924. DataMgr.setCoin(-needCoin);
  5925. xGame.common.curPlayerSkillType = this.index;
  5926. if (guide == 0)
  5927. xGame.common.curPlayerSkillType = 0;
  5928. xGame.uiMgr.Show(UIGame);
  5929. xGame.uiMgr.Hide(UIMain);
  5930. xGame.uiMgr.Show(UIMatching, () => {
  5931. xGame.common.gameUI.ui.alpha = 1;
  5932. xGame.common.gameUI.startGame();
  5933. xGame.uiMgr.Hide(UISkill);
  5934. });
  5935. }
  5936. else {
  5937. xGame.uiMgr.Show(UIAddProp, 0);
  5938. Moyu.sendDataEvent("AddCoinVideo");
  5939. }
  5940. }
  5941. }
  5942. class UISkill extends UIBase {
  5943. constructor() {
  5944. super();
  5945. this.skillData = [];
  5946. }
  5947. onConstructor() {
  5948. this.ui = ui_UISkill.createInstance();
  5949. this.contentPane = this.ui;
  5950. this.isEject = false;
  5951. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5952. this.initSkillData();
  5953. console.log('zh:aaaaaa1111111111');
  5954. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5955. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5956. console.log('zh:aaaaaa22222222');
  5957. this.displayList = [];
  5958. this.ui.skillNode.skillList.numItems = 3;
  5959. this.addUIClick(this.ui, this.interuptSecretary);
  5960. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5961. this.ui.talkNode.visible = false;
  5962. if (Moyu.isKs)
  5963. this.ui.closeNode.closeBtn.x += 100;
  5964. }
  5965. show() {
  5966. super.show();
  5967. this.playSecretaryIdle();
  5968. this.moneyNode.ui.c1.selectedIndex = 1;
  5969. Laya.timer.clearAll(this);
  5970. xGame.soundMgr.playSound("s_start");
  5971. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5972. let guide = DataMgr.getSkillGuide();
  5973. this.ui.guideNode.visible = guide == 0;
  5974. let item = this.getSkillItemByUIIndex(0);
  5975. if (guide == 0) {
  5976. item.ui.c1.selectedIndex = 1;
  5977. }
  5978. else {
  5979. item.ui.c1.selectedIndex = 0;
  5980. }
  5981. this.ui.guideNode.guideBtn.visible = guide == 0;
  5982. for (let index = 0; index < this.displayList.length; index++) {
  5983. this.displayList[index].checkTry();
  5984. }
  5985. }
  5986. getSkillItemByUIIndex(cur) {
  5987. for (let index = 0; index < this.displayList.length; index++) {
  5988. if (this.displayList[index].index == cur) {
  5989. return this.displayList[index];
  5990. }
  5991. }
  5992. }
  5993. enterGuideLevel() {
  5994. let item = this.getSkillItemByUIIndex(0);
  5995. item.startGame();
  5996. if (DataMgr.getNewUser())
  5997. Moyu.sendDataEvent("gameStart1");
  5998. }
  5999. initSkillData() {
  6000. this.skillData = [];
  6001. let nameList = xGame.common.skillNameList;
  6002. let iconList = xGame.common.skillIconList;
  6003. let describeList = [
  6004. "Jump shot executed — ball bounced and pocketed an extra one!",
  6005. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  6006. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  6007. ];
  6008. console.log('zh:initSkillData 111111111');
  6009. let data;
  6010. for (let index = 0; index < nameList.length; index++) {
  6011. data = {};
  6012. data.name = nameList[index];
  6013. data.icon = iconList[index];
  6014. data.describe = describeList[index];
  6015. data.index = index;
  6016. this.skillData.push(data);
  6017. }
  6018. }
  6019. updateSkillItem(index, target) {
  6020. if (this.displayList[index] == null) {
  6021. let uiIndex;
  6022. switch (index) {
  6023. case 0:
  6024. uiIndex = 1;
  6025. break;
  6026. case 1:
  6027. uiIndex = 0;
  6028. break;
  6029. case 2:
  6030. uiIndex = 2;
  6031. break;
  6032. case 3:
  6033. uiIndex = 3;
  6034. break;
  6035. default:
  6036. break;
  6037. }
  6038. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6039. this.displayList.push(temp);
  6040. }
  6041. }
  6042. playSecretaryIdle() {
  6043. let parent = this.ui.secretary.displayObject;
  6044. parent.destroyChildren();
  6045. let xx = this.ui.secretary.width / 2;
  6046. let yy = this.ui.secretary.height;
  6047. let scale = xGame.common.getSecretaryScale();
  6048. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6049. xGame.common.secretary.play(data, 0, true, parent);
  6050. }
  6051. returnUIMain() {
  6052. this.hide();
  6053. xGame.common.stopGirlPop(this.ui.talkNode);
  6054. xGame.uiMgr.Show(UIMain);
  6055. }
  6056. interuptSecretary() {
  6057. Laya.timer.clearAll(this);
  6058. this.playSecretaryRandomSound();
  6059. }
  6060. playSecretaryRandomSound() {
  6061. if (this.isHide)
  6062. return;
  6063. let time = xGame.common.randomNum(45000, 60000);
  6064. Laya.timer.once(time, this, () => {
  6065. if (this.isHide)
  6066. return;
  6067. let index = xGame.common.randomNum(4, 7);
  6068. xGame.soundMgr.playSound("s_main0" + index);
  6069. let words = 1;
  6070. switch (index) {
  6071. case 4:
  6072. words = 5;
  6073. break;
  6074. case 5:
  6075. words = 3;
  6076. break;
  6077. case 6:
  6078. words = 6;
  6079. break;
  6080. case 7:
  6081. words = 7;
  6082. break;
  6083. default:
  6084. break;
  6085. }
  6086. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6087. this.playSecretaryRandomSound();
  6088. });
  6089. }
  6090. }
  6091. UISkill.uiName = "UISkill";
  6092. class ui_UIMsg extends fgui.GComponent {
  6093. static createInstance() {
  6094. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6095. }
  6096. onConstruct() {
  6097. this.tipsNode = (this.getChild("tipsNode"));
  6098. }
  6099. }
  6100. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6101. class UIMsg extends UIBase {
  6102. constructor() {
  6103. super();
  6104. }
  6105. onConstructor() {
  6106. this.ui = ui_UIMsg.createInstance();
  6107. this.contentPane = this.ui;
  6108. this.isEject = false;
  6109. this.isMuti = true;
  6110. }
  6111. show(msg, callback) {
  6112. super.show();
  6113. this.ui.tipsNode.msgTxt.text = msg;
  6114. this.ui.alpha = 1;
  6115. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6116. this.hide();
  6117. callback && callback();
  6118. }), 1000);
  6119. }
  6120. }
  6121. UIMsg.uiName = "UIMsg";
  6122. class ui_UIModeSelection extends fgui.GComponent {
  6123. static createInstance() {
  6124. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6125. }
  6126. onConstruct() {
  6127. this.n19 = (this.getChild("n19"));
  6128. this.closeBtn = (this.getChild("closeBtn"));
  6129. this.myNode = (this.getChild("myNode"));
  6130. this.t0 = this.getTransition("t0");
  6131. }
  6132. }
  6133. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6134. class UIModeSelection extends UIBase {
  6135. constructor() {
  6136. super();
  6137. }
  6138. onConstructor() {
  6139. this.ui = ui_UIModeSelection.createInstance();
  6140. this.contentPane = this.ui;
  6141. this.isEject = false;
  6142. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6143. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6144. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6145. this.addUIClick(this.ui.closeBtn, this.hide);
  6146. this.peopleArr = [650, 6900, 3800];
  6147. this.peopleOffest = [50, 500, 200];
  6148. this.updateSelf();
  6149. }
  6150. show(callback) {
  6151. super.show();
  6152. this.ui.t0.play();
  6153. this.callback = callback;
  6154. }
  6155. updateSelf() {
  6156. let cfg = cfgTable.modeselectData;
  6157. for (let index = 1; index <= 3; index++) {
  6158. let node = this.ui.myNode["type" + index];
  6159. node.need.text = cfg[index].need;
  6160. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6161. node.peopleTxt.text = this.getRandPeople(index - 1);
  6162. }
  6163. }
  6164. enterGame(type) {
  6165. xGame.common.classicRoomType = type;
  6166. let cfg = cfgTable.modeselectData[type];
  6167. let need = cfg.need;
  6168. xGame.common.passAwardCoin = cfg.award;
  6169. if (DataMgr.coinEnough(need)) {
  6170. DataMgr.setCoin(-need);
  6171. this.ui.myNode["type" + type].t0.play();
  6172. Laya.timer.once(200, this, () => {
  6173. this.callback && this.callback();
  6174. });
  6175. }
  6176. else {
  6177. Moyu.sendDataEvent("AddCoinVideo");
  6178. xGame.uiMgr.Show(UIAddProp, 0);
  6179. }
  6180. }
  6181. getRandPeople(index) {
  6182. let rand = this.peopleOffest[index];
  6183. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6184. }
  6185. }
  6186. UIModeSelection.uiName = "UIModeSelection";
  6187. class ui_UIGetAward extends fgui.GComponent {
  6188. static createInstance() {
  6189. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6190. }
  6191. onConstruct() {
  6192. this.n4 = (this.getChild("n4"));
  6193. this.n0 = (this.getChild("n0"));
  6194. this.myList = (this.getChild("myList"));
  6195. this.n1 = (this.getChild("n1"));
  6196. this.eftNode = (this.getChild("eftNode"));
  6197. this.btnNode = (this.getChild("btnNode"));
  6198. this.t0 = this.getTransition("t0");
  6199. }
  6200. }
  6201. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6202. class UIGetAward extends UIBase {
  6203. constructor() {
  6204. super();
  6205. this.showTriple = true;
  6206. }
  6207. onConstructor() {
  6208. this.ui = ui_UIGetAward.createInstance();
  6209. this.contentPane = this.ui;
  6210. this.isEject = false;
  6211. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6212. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6213. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6214. }
  6215. show(arr, showTriple, callback) {
  6216. super.show();
  6217. this.ui.t0.play();
  6218. this.ui.eftNode.visible = true;
  6219. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6220. this.ui.eftNode.visible = false;
  6221. }), 1, 0, 0, 0.9);
  6222. this.awardArr = arr;
  6223. this.showTriple = showTriple;
  6224. this.callback = callback;
  6225. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6226. this.ui.myList.numItems = arr.length;
  6227. xGame.soundMgr.playSound("getaward");
  6228. }
  6229. updateSelf(index, obj) {
  6230. let temp = this.awardArr[index];
  6231. let icon = this.getIcon(temp.type);
  6232. let str = icon;
  6233. if (temp.type > 2) {
  6234. str = "s" + icon;
  6235. }
  6236. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6237. obj.myIcon.rotation = 0;
  6238. obj.numTxt.text = temp.num + "";
  6239. obj.numTxt.visible = temp.type > 2 ? false : true;
  6240. obj.nameTxt.text = this.getNameStr(temp.type);
  6241. }
  6242. renderItem(index, obj) {
  6243. this.updateSelf(index, obj);
  6244. }
  6245. tripleGetAward() {
  6246. console.log('zh:qjff_AD_for_uigetAward');
  6247. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6248. }
  6249. else {
  6250. console.log('zh:AD 失败,直接发放奖励');
  6251. this.qjff_AD_for_uigetAward();
  6252. }
  6253. }
  6254. qjff_AD_for_uigetAward() {
  6255. this.getAward(3);
  6256. }
  6257. normalGetAward() {
  6258. if (PlatMgr.isMisVideo())
  6259. this.tripleGetAward();
  6260. else
  6261. this.getAward();
  6262. }
  6263. getAward(times = 1) {
  6264. this.hide();
  6265. for (let index = 0; index < this.awardArr.length; index++) {
  6266. this.awardArr[index].num *= times;
  6267. }
  6268. this.callback && this.callback(times != 1);
  6269. }
  6270. getIcon(type) {
  6271. switch (type) {
  6272. case Prop.diamond:
  6273. return "ty_zs";
  6274. case Prop.coin:
  6275. return "ty_jb";
  6276. case Prop.gan1:
  6277. return "qg1";
  6278. case Prop.gan2:
  6279. return "qg2";
  6280. case Prop.gan3:
  6281. return "qg3";
  6282. case Prop.gan4:
  6283. return "qg4";
  6284. default:
  6285. break;
  6286. }
  6287. }
  6288. getNameStr(type) {
  6289. switch (type) {
  6290. case Prop.diamond:
  6291. return "Diamond";
  6292. case Prop.coin:
  6293. return "Coins";
  6294. case Prop.gan1:
  6295. case Prop.gan2:
  6296. case Prop.gan3:
  6297. case Prop.gan4:
  6298. return cfgTable.ballrodData[type - 1].name;
  6299. default:
  6300. break;
  6301. }
  6302. }
  6303. }
  6304. UIGetAward.uiName = "UIGetAward";
  6305. class ui_UIRepentProp extends fgui.GComponent {
  6306. static createInstance() {
  6307. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6308. }
  6309. onConstruct() {
  6310. this.c1 = this.getController("c1");
  6311. this.n11 = (this.getChild("n11"));
  6312. this.regretNode = (this.getChild("regretNode"));
  6313. this.helpLineNode = (this.getChild("helpLineNode"));
  6314. this.t0 = this.getTransition("t0");
  6315. }
  6316. }
  6317. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6318. class UIRepentProp extends UIBase {
  6319. constructor() {
  6320. super();
  6321. this.viewType = 0;
  6322. this.regretType = 0;
  6323. }
  6324. onConstructor() {
  6325. this.ui = ui_UIRepentProp.createInstance();
  6326. this.contentPane = this.ui;
  6327. this.isEject = false;
  6328. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6329. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6330. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6331. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6332. }
  6333. show(viewType, regretType, callback) {
  6334. PlatMgr.showInsert(true);
  6335. this.viewType = viewType;
  6336. this.regretType = regretType;
  6337. this.callback = callback;
  6338. super.show();
  6339. this.ui.t0.play();
  6340. this.ui.c1.selectedIndex = this.viewType;
  6341. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6342. if (this.viewType == 0) {
  6343. let guide = DataMgr.getGuideHelpLine();
  6344. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6345. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6346. }
  6347. xGame.common.gameMgr.gamePause = true;
  6348. }
  6349. hideSelf() {
  6350. xGame.common.gameMgr.gamePause = false;
  6351. this.callback && this.callback(false);
  6352. this.hide();
  6353. }
  6354. videoRegret() {
  6355. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6356. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6357. }
  6358. else {
  6359. console.log('zh:AD 失败,直接发放奖励');
  6360. this.qjff_AD_for_UIrepentProp_videoRegret();
  6361. }
  6362. }
  6363. qjff_AD_for_UIrepentProp_videoRegret() {
  6364. this.callback && this.callback(true);
  6365. this.hideSelf();
  6366. }
  6367. videoAddHelpLine() {
  6368. let guide = DataMgr.getGuideHelpLine();
  6369. if (guide == 0) {
  6370. this.callback && this.callback(true);
  6371. this.hideSelf();
  6372. DataMgr.setGuideHelpLine();
  6373. xGame.common.gameUI.ui.guideNode.visible = false;
  6374. }
  6375. else {
  6376. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6377. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6378. }
  6379. else {
  6380. console.log('zh:AD 失败,直接发放奖励');
  6381. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6382. }
  6383. }
  6384. }
  6385. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6386. this.callback && this.callback(true);
  6387. this.hideSelf();
  6388. }
  6389. }
  6390. UIRepentProp.uiName = "UIRepentProp";
  6391. class UIMain extends UIBase {
  6392. constructor() {
  6393. super();
  6394. this.firstEnter = true;
  6395. }
  6396. nativeCallJs(msg) {
  6397. let t = msg;
  6398. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6399. switch (t) {
  6400. case 'qjff_chouJiang':
  6401. let dui = xGame.uiMgr.getUI(UIDraw);
  6402. dui.qjff_chouJiang();
  6403. break;
  6404. case 'qjff_AD_for_uisign':
  6405. let dui2 = xGame.uiMgr.getUI(UISign);
  6406. dui2.qjff_AD_for_uisign();
  6407. break;
  6408. case 'qjff_AD_for_uitry':
  6409. let dui3 = xGame.uiMgr.getUI(UITry);
  6410. dui3.qjff_AD_for_uitry();
  6411. break;
  6412. case 'qjff_AD_for_uipower':
  6413. let dui4 = xGame.uiMgr.getUI(UIPower);
  6414. dui4.qjff_AD_for_uipower();
  6415. break;
  6416. case 'qjff_AD_for_uigetAward':
  6417. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6418. dui5.qjff_AD_for_uigetAward();
  6419. break;
  6420. case 'qjff_AD_for_uiGameEnd':
  6421. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6422. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6423. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6424. break;
  6425. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6426. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6427. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6428. break;
  6429. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6430. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6431. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6432. break;
  6433. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6434. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6435. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6436. break;
  6437. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6438. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6439. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6440. break;
  6441. case 'qjff_AD_for_UIBOX_onOpenBox':
  6442. let dui11 = xGame.uiMgr.getUI(UIBox);
  6443. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6444. break;
  6445. case 'qjff_AD_for_UIAddCoin':
  6446. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6447. dui12.qjff_AD_for_UIAddCoin();
  6448. break;
  6449. case '111a':
  6450. let dui14 = xGame.uiMgr.getUI(UISign);
  6451. dui14.qjff_AD_for_uisign();
  6452. break;
  6453. case '222a':
  6454. let dui15 = xGame.uiMgr.getUI(UISign);
  6455. dui15.qjff_AD_for_uisign();
  6456. break;
  6457. case '333a':
  6458. let dui16 = xGame.uiMgr.getUI(UISign);
  6459. dui16.qjff_AD_for_uisign();
  6460. break;
  6461. default:
  6462. console.log('zh:未知的方法名字' + t);
  6463. break;
  6464. }
  6465. }
  6466. onConstructor() {
  6467. console.log('zh: UIMain onConstructor');
  6468. this.ui = ui_UIMain.createInstance();
  6469. this.contentPane = this.ui;
  6470. this.isEject = false;
  6471. this.addEvent();
  6472. this.addClickSpine();
  6473. this.settingNode = new SettingNode(this.ui.settingNode);
  6474. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6475. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6476. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6477. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6478. let curUse = DataMgr.getCurSecretary();
  6479. this.changeSecretary(curUse);
  6480. this.ui.talkNode.visible = false;
  6481. let guide = DataMgr.getSkillGuide();
  6482. if (xGame.common.isNewDay && guide == 1) {
  6483. xGame.common.isNewDay = false;
  6484. xGame.soundMgr.playSound("s_main01");
  6485. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6486. console.log("播放小秘书每天语音");
  6487. }
  6488. this.onGetUserInfo();
  6489. this.ui.n83.visible = false;
  6490. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  6491. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6492. }
  6493. changeSecretary(curUse) {
  6494. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6495. xGame.common.secretary && xGame.common.secretary.dispose();
  6496. this.addSecretarySpine(name);
  6497. }
  6498. addSecretarySpine(name) {
  6499. let spine = new SpineMgr(name, () => {
  6500. this.playSecretaryIdle();
  6501. });
  6502. xGame.common.secretary = spine;
  6503. }
  6504. addClickSpine() {
  6505. let clickSpine = new SpineMgr("dianji", () => {
  6506. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6507. let parent = Laya.stage;
  6508. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6509. clickSpine.play(data, 0, false, parent, (spine) => {
  6510. spine.destroy(true);
  6511. });
  6512. });
  6513. });
  6514. }
  6515. addEvent() {
  6516. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6517. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6518. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6519. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6520. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  6521. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6522. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6523. this.addUIClick(this.ui, this.interuptSecretary);
  6524. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6525. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6526. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6527. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6528. this.addUIClick(this.ui.signBtn, this.openSignView);
  6529. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6530. }
  6531. show(showFailWords) {
  6532. super.show();
  6533. this.moneyNode.ui.c1.selectedIndex = 1;
  6534. this.playSecretaryIdle();
  6535. xGame.soundMgr.playMusic("caromhall01");
  6536. Laya.timer.clearAll(this);
  6537. this.playSecretaryRandomSound();
  6538. if (showFailWords) {
  6539. setTimeout(() => {
  6540. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6541. let words = -1;
  6542. if (str == "s_main02") {
  6543. words = 2;
  6544. }
  6545. else {
  6546. words = 3;
  6547. }
  6548. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6549. xGame.soundMgr.playSound(str);
  6550. }, 300);
  6551. }
  6552. this.showGuide();
  6553. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6554. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6555. let guide = DataMgr.getSkillGuide();
  6556. if (guide == 1) {
  6557. let randTime = xGame.common.randomNum(300, 800);
  6558. if (this.firstEnter) {
  6559. this.firstEnter = false;
  6560. randTime += 900;
  6561. }
  6562. Laya.timer.once(randTime, this, () => {
  6563. xGame.common.autoPopUIView();
  6564. });
  6565. }
  6566. }
  6567. checkActive(show) {
  6568. }
  6569. showGuide() {
  6570. let guide = DataMgr.getSkillGuide();
  6571. this.ui.guideBtn.visible = guide == 0;
  6572. this.ui.enterGuide.visible = false;
  6573. this.ui.secretaryGuide.visible = guide == 0;
  6574. if (guide == 0) {
  6575. xGame.soundMgr.playSound("s_guide");
  6576. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6577. }
  6578. }
  6579. ensureSecretary() {
  6580. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6581. this.ui.secretaryGuide.visible = false;
  6582. this.ui.enterGuide.visible = true;
  6583. this.ui.wordsNode.t0.play();
  6584. if (DataMgr.getNewUser())
  6585. Moyu.sendDataEvent("gameReady");
  6586. }
  6587. playSecretaryIdle() {
  6588. let parent = this.ui.secretary.displayObject;
  6589. parent.destroyChildren();
  6590. let xx = this.ui.secretary.width / 2;
  6591. let yy = this.ui.secretary.height;
  6592. let scale = xGame.common.getSecretaryScale();
  6593. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6594. console.log("zh:playSecretaryIdle", data);
  6595. xGame.common.secretary.play(data, 0, true, parent);
  6596. }
  6597. startGame(type) {
  6598. xGame.common.gameMode = type;
  6599. Moyu.sendDataEvent("PlayGame", { type: type });
  6600. switch (xGame.common.gameMode) {
  6601. case GameMode.classic:
  6602. let challengeTimes = DataMgr.getChallengeTimes();
  6603. if (challengeTimes == 0) {
  6604. xGame.uiMgr.Show(UIInvitation);
  6605. }
  6606. else {
  6607. this.beginGame();
  6608. }
  6609. break;
  6610. case GameMode.bigMove:
  6611. this.beginGame();
  6612. if (DataMgr.getNewUser())
  6613. Moyu.sendDataEvent("gameStart0");
  6614. break;
  6615. default:
  6616. break;
  6617. }
  6618. }
  6619. beginGame(isNice = false) {
  6620. if (xGame.common.gameMode == GameMode.classic) {
  6621. if (isNice) {
  6622. this.enterClassic();
  6623. }
  6624. else {
  6625. xGame.uiMgr.Show(UIModeSelection, () => {
  6626. this.enterClassic();
  6627. });
  6628. }
  6629. }
  6630. else if (xGame.common.gameMode == GameMode.bigMove) {
  6631. this.ui.enterGuide.visible = false;
  6632. xGame.uiMgr.Show(UISkill);
  6633. }
  6634. }
  6635. enterClassic() {
  6636. xGame.uiMgr.Show(UIGame);
  6637. xGame.uiMgr.Show(UIMatching, () => {
  6638. if (!this.isHide)
  6639. this.hide();
  6640. xGame.common.gameUI.ui.alpha = 1;
  6641. xGame.common.gameUI.startGame();
  6642. xGame.uiMgr.Hide(UIGameEnd);
  6643. });
  6644. }
  6645. startGlobal() {
  6646. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6647. }
  6648. startWeekly() {
  6649. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6650. }
  6651. zhouSaiMonth() {
  6652. console.log('zh: zhouSaiMonth 被调用');
  6653. }
  6654. startPlaceBall() {
  6655. xGame.uiMgr.Show(UILevelDisplay);
  6656. }
  6657. hide() {
  6658. super.hide();
  6659. xGame.common.stopGirlPop(this.ui.talkNode);
  6660. }
  6661. onGetUserInfo(force = false) {
  6662. if (Moyu.isWx) {
  6663. let info = Moyu.getSystemInfo();
  6664. if (info)
  6665. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6666. }
  6667. else {
  6668. Moyu.initUser(this, this.freshUser, force);
  6669. }
  6670. if (!Moyu.hasUserInfo) {
  6671. let user = Moyu.getUserInfo();
  6672. user.headIcon = 'res/ty_touxiang.png';
  6673. }
  6674. this.freshUser();
  6675. }
  6676. freshUser() {
  6677. let user = Moyu.getUserInfo();
  6678. if (!user.isAuth) {
  6679. user.headIcon = 'res/ty_touxiang.png';
  6680. }
  6681. else
  6682. DataMgr.upRankData();
  6683. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6684. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6685. }
  6686. interuptSecretary() {
  6687. Laya.timer.clearAll(this);
  6688. this.playSecretaryRandomSound();
  6689. }
  6690. playSecretaryRandomSound() {
  6691. if (this.isHide)
  6692. return;
  6693. let time = xGame.common.randomNum(45000, 60000);
  6694. Laya.timer.once(time, this, () => {
  6695. if (this.isHide)
  6696. return;
  6697. let index = xGame.common.randomNum(4, 7);
  6698. xGame.soundMgr.playSound("s_main0" + index);
  6699. let words = 1;
  6700. switch (index) {
  6701. case 4:
  6702. words = 5;
  6703. break;
  6704. case 5:
  6705. words = 3;
  6706. break;
  6707. case 6:
  6708. words = 6;
  6709. break;
  6710. case 7:
  6711. words = 7;
  6712. break;
  6713. default:
  6714. break;
  6715. }
  6716. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6717. this.playSecretaryRandomSound();
  6718. });
  6719. }
  6720. openSecretaryView() {
  6721. xGame.uiMgr.Show(UISecretary);
  6722. Moyu.sendDataEvent("secretary");
  6723. }
  6724. openShopView() {
  6725. xGame.uiMgr.Show(UIShop);
  6726. }
  6727. openSignView() {
  6728. xGame.uiMgr.Show(UISign);
  6729. }
  6730. openDrawView() {
  6731. xGame.uiMgr.Show(UIDraw);
  6732. }
  6733. openRanking() {
  6734. xGame.uiMgr.Show(UIRanking);
  6735. Moyu.sendDataEvent("rankingList");
  6736. }
  6737. }
  6738. UIMain.uiName = "UIMain";
  6739. class UIGameEnd extends UIBase {
  6740. constructor() {
  6741. super();
  6742. this.success = false;
  6743. this.awardCoinNum = 1000;
  6744. this.awardDiamondNum = 10;
  6745. }
  6746. onConstructor() {
  6747. this.ui = ui_UIGameEnd.createInstance();
  6748. this.contentPane = this.ui;
  6749. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6750. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6751. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6752. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6753. this.ui.talkNode.visible = false;
  6754. if (Moyu.isKs)
  6755. this.ui.closeNode.closeBtn.x += 100;
  6756. }
  6757. updateType() {
  6758. switch (xGame.common.gameMode) {
  6759. case GameMode.classic:
  6760. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6761. this.ui.coinNode.visible = this.success;
  6762. if (!this.success) {
  6763. Laya.timer.once(500, this, () => {
  6764. xGame.uiMgr.Show(UIAddCoin);
  6765. });
  6766. }
  6767. this.ui.isGetAward.visible = false;
  6768. this.ui.leftBtn.c1.selectedIndex = 3;
  6769. this.ui.rightBtn.c1.selectedIndex = 0;
  6770. this.moneyNode.ui.c1.selectedIndex = 1;
  6771. break;
  6772. case GameMode.bigMove:
  6773. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6774. this.ui.coinNode.visible = this.success;
  6775. if (xGame.common.gameMode == GameMode.bigMove) {
  6776. if (this.success) {
  6777. DataMgr.setSkillSuccessTimes(1, true);
  6778. DataMgr.setSkillAccTimes(1);
  6779. }
  6780. else {
  6781. DataMgr.setSkillSuccessTimes(0, false);
  6782. }
  6783. }
  6784. if (!this.success) {
  6785. Laya.timer.once(500, this, () => {
  6786. xGame.uiMgr.Show(UIAddCoin);
  6787. });
  6788. }
  6789. this.ui.isGetAward.visible = false;
  6790. this.ui.leftBtn.c1.selectedIndex = 3;
  6791. this.ui.rightBtn.c1.selectedIndex = 0;
  6792. this.moneyNode.ui.c1.selectedIndex = 1;
  6793. break;
  6794. case GameMode.placeBall:
  6795. this.ui.coinNode.visible = false;
  6796. if (this.success) {
  6797. if (xGame.common.placeBallStarNum == 3) {
  6798. this.ui.c1.selectedIndex = 2;
  6799. }
  6800. else {
  6801. this.ui.c1.selectedIndex = 3;
  6802. }
  6803. }
  6804. else {
  6805. this.ui.c1.selectedIndex = 4;
  6806. }
  6807. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6808. if (cfg.type == PlaceBallType.challenge) {
  6809. this.ui.c1.selectedIndex = 2;
  6810. }
  6811. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6812. this.updatePlaceBallBtn();
  6813. this.updatePlaceBallStarNum();
  6814. this.updatePlaceBallAwardState();
  6815. this.moneyNode.ui.c1.selectedIndex = 2;
  6816. this.moneyNode.checkPowerTime();
  6817. this.moneyNode.powerChange();
  6818. DataMgr.upRankData();
  6819. break;
  6820. default:
  6821. break;
  6822. }
  6823. }
  6824. updatePlaceBallBtn() {
  6825. this.ui.leftBtn.c1.selectedIndex = 5;
  6826. if (this.success) {
  6827. this.ui.rightBtn.c1.selectedIndex = 14;
  6828. }
  6829. else {
  6830. if (xGame.common.placeBallStarNum == 3) {
  6831. this.ui.rightBtn.c1.selectedIndex = 14;
  6832. }
  6833. else {
  6834. this.ui.rightBtn.c1.selectedIndex = 1;
  6835. }
  6836. }
  6837. }
  6838. updatePlaceBallStarNum() {
  6839. let starNum = xGame.common.placeBallStarNum;
  6840. if (starNum == 0)
  6841. this.ui.starNumNode.c1.selectedIndex = 3;
  6842. else {
  6843. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6844. }
  6845. }
  6846. updatePlaceBallAwardState() {
  6847. let level = xGame.common.placeBallCurLevel;
  6848. let starNum = xGame.common.placeBallStarNum;
  6849. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6850. let data = cfgTable.placeballData[level].award;
  6851. let cfg = cfgTable.placeballData[level];
  6852. this.awardDiamondNum = data[1];
  6853. this.awardCoinNum = data[0];
  6854. if (cfg.type == PlaceBallType.challenge) {
  6855. this.awardDiamondNum = 0;
  6856. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6857. }
  6858. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6859. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6860. if (cfg.type == PlaceBallType.challenge) {
  6861. this.ui.awardNode.coinNode.visible = true;
  6862. }
  6863. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6864. this.ui.awardNode.diamondNode.x = 265;
  6865. this.ui.awardNode.coinNode.x = 354;
  6866. }
  6867. else {
  6868. this.ui.awardNode.diamondNode.x = 291;
  6869. this.ui.awardNode.coinNode.x = 291;
  6870. }
  6871. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6872. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6873. if (this.awardCoinNum == 0) {
  6874. this.ui.awardNode.coinNode.numTxt.text = "";
  6875. }
  6876. if (getAward) {
  6877. this.ui.isGetAward.visible = true;
  6878. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6879. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6880. }
  6881. else {
  6882. this.ui.isGetAward.visible = false;
  6883. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6884. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6885. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6886. }
  6887. else {
  6888. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6889. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6890. }
  6891. }
  6892. }
  6893. show(success) {
  6894. super.show();
  6895. xGame.eventMgr.event(RESET_GAME);
  6896. this.success = success;
  6897. Laya.timer.clearAll(this);
  6898. this.playSecretaryAni();
  6899. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6900. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6901. offsetTime = Math.floor(offsetTime / 1000);
  6902. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6903. this.updateType();
  6904. Laya.timer.once(200, this, () => {
  6905. this.addAward(() => {
  6906. this.updateType();
  6907. Laya.timer.once(500, this, () => {
  6908. this.showChallengeLevel();
  6909. });
  6910. });
  6911. });
  6912. if (this.success) {
  6913. xGame.soundMgr.playSound('slots_roll01');
  6914. xGame.soundMgr.playSound("s_win");
  6915. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6916. }
  6917. else {
  6918. xGame.soundMgr.playSound('matchwin01');
  6919. xGame.soundMgr.playSound("s_lose");
  6920. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6921. }
  6922. if (!Moyu.isLegal)
  6923. PlatMgr.showBanner(true);
  6924. let challengeNum = DataMgr.getChallengeTimes();
  6925. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6926. DataMgr.setChallengeTimes(1);
  6927. }
  6928. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6929. DataMgr.setClassicTimes();
  6930. }
  6931. }
  6932. showChallengeLevel() {
  6933. if (DataMgr.getChallengeTimes() != 0)
  6934. return;
  6935. let skill = DataMgr.getSkillAccTimes();
  6936. let put = DataMgr.getPlaceBallLevelList().length;
  6937. if (skill >= 3 || put >= 5) {
  6938. xGame.uiMgr.Show(UIInvitation);
  6939. this.hide();
  6940. }
  6941. }
  6942. addAward(callback) {
  6943. if (!this.success) {
  6944. callback && callback();
  6945. return;
  6946. }
  6947. switch (xGame.common.gameMode) {
  6948. case GameMode.classic:
  6949. this.awardCoinNum = xGame.common.passAwardCoin;
  6950. this.awardDiamondNum = 0;
  6951. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6952. break;
  6953. case GameMode.bigMove:
  6954. this.awardCoinNum = xGame.common.passAwardCoin;
  6955. this.awardDiamondNum = 0;
  6956. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6957. callback && callback();
  6958. break;
  6959. case GameMode.placeBall:
  6960. let level = xGame.common.placeBallCurLevel;
  6961. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6962. if (xGame.common.placeBallStarNum != 3) {
  6963. callback && callback();
  6964. return;
  6965. }
  6966. else {
  6967. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6968. if (getAward) {
  6969. callback && callback();
  6970. return;
  6971. }
  6972. }
  6973. let cfg = cfgTable.placeballData[level];
  6974. let data = cfgTable.placeballData[level].award;
  6975. this.awardCoinNum = data[0];
  6976. this.awardDiamondNum = data[1];
  6977. if (cfg.type == PlaceBallType.challenge) {
  6978. this.awardDiamondNum = 0;
  6979. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6980. }
  6981. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6982. let diamondAward;
  6983. if (this.awardDiamondNum > 0) {
  6984. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6985. xGame.common.getAward([diamondAward, coinAward], callback);
  6986. }
  6987. else {
  6988. xGame.common.getAward([coinAward], callback);
  6989. }
  6990. if (cfg.type == PlaceBallType.normal) {
  6991. DataMgr.setPlaceBallAward(level);
  6992. }
  6993. break;
  6994. default:
  6995. break;
  6996. }
  6997. }
  6998. playSecretaryAni_old() {
  6999. let parent = this.ui.secretary.displayObject;
  7000. parent.destroyChildren();
  7001. let xx = this.ui.secretary.width / 2;
  7002. let yy = this.ui.secretary.height;
  7003. let scale = xGame.common.getSecretaryScale();
  7004. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7005. if (this.success) {
  7006. let rand = Math.random() <= 0.5 ? 2 : 3;
  7007. xGame.common.secretary.play(data, rand, false, parent, () => {
  7008. xGame.common.secretary.play(data, 1, true, parent);
  7009. });
  7010. }
  7011. else {
  7012. xGame.common.secretary.play(data, 0, true, parent);
  7013. }
  7014. }
  7015. playSecretaryAni() {
  7016. let parent = this.ui.secretary.displayObject;
  7017. parent.destroyChildren();
  7018. let xx = this.ui.secretary.width / 2;
  7019. let yy = this.ui.secretary.height;
  7020. let scale = xGame.common.getSecretaryScale();
  7021. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7022. if (this.success) {
  7023. let rand = 0;
  7024. xGame.common.secretary.play(data, 0, true, parent);
  7025. }
  7026. else {
  7027. xGame.common.secretary.play(data, 0, true, parent);
  7028. }
  7029. }
  7030. restartGame() {
  7031. switch (xGame.common.gameMode) {
  7032. case GameMode.classic:
  7033. xGame.eventMgr.event(RESTART_GAME);
  7034. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7035. break;
  7036. case GameMode.bigMove:
  7037. this.hide();
  7038. xGame.eventMgr.event(RESTART_GAME);
  7039. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7040. break;
  7041. default:
  7042. break;
  7043. }
  7044. }
  7045. hide() {
  7046. super.hide();
  7047. xGame.common.stopGirlPop(this.ui.talkNode);
  7048. PlatMgr.showBanner(false);
  7049. }
  7050. returnHome() {
  7051. this.hide();
  7052. let showFailWords = !this.success;
  7053. xGame.uiMgr.Show(UIMain, showFailWords);
  7054. }
  7055. clickLeftBtn() {
  7056. switch (xGame.common.gameMode) {
  7057. case GameMode.classic:
  7058. case GameMode.bigMove:
  7059. this.returnHome();
  7060. break;
  7061. case GameMode.placeBall:
  7062. let level = xGame.common.placeBallCurLevel;
  7063. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7064. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7065. break;
  7066. default:
  7067. break;
  7068. }
  7069. }
  7070. powerStartPlaceBallLevel(level, btn) {
  7071. if (DataMgr.powerEnough()) {
  7072. btn.touchable = false;
  7073. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7074. btn.touchable = true;
  7075. DataMgr.setPower(-1);
  7076. xGame.eventMgr.event(POWER_TIME);
  7077. this.startPlaceBallLevel(level);
  7078. }));
  7079. }
  7080. else {
  7081. xGame.uiMgr.Show(UIPower, 0);
  7082. }
  7083. }
  7084. clickRightBtn() {
  7085. switch (xGame.common.gameMode) {
  7086. case GameMode.classic:
  7087. console.log('zh:clickRightBtn 111');
  7088. case GameMode.bigMove:
  7089. console.log('zh:clickRightBtn 222');
  7090. this.restartGame();
  7091. break;
  7092. case GameMode.placeBall:
  7093. console.log('zh:clickRightBtn 333');
  7094. let level = xGame.common.placeBallCurLevel;
  7095. let data = DataMgr.getPlaceBallLevel(level);
  7096. let curPss = data.play && !data.isCur;
  7097. if (curPss) {
  7098. console.log('zh:clickRightBtn 333-111');
  7099. console.log('zh:当前LV=' + level);
  7100. if (level == 60) {
  7101. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7102. Laya.timer.once(3000, this, () => {
  7103. this.returnHome();
  7104. });
  7105. }
  7106. else {
  7107. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  7108. }
  7109. }
  7110. else {
  7111. console.log('zh:clickRightBtn 333-000');
  7112. Moyu.sendDataEvent("placeBallNextLevel");
  7113. console.log('zh:qjff_AD_for_uiGameEnd');
  7114. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7115. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7116. }
  7117. else {
  7118. console.log('zh:AD 失败,直接发放奖励');
  7119. this.qjff_AD_for_uiGameEnd(level);
  7120. }
  7121. }
  7122. break;
  7123. default:
  7124. console.log('zh:clickRightBtn 444');
  7125. break;
  7126. }
  7127. }
  7128. qjff_AD_for_uiGameEnd(level) {
  7129. DataMgr.setPlaceBallLevel(level, 1);
  7130. this.startPlaceBallLevel(level + 1);
  7131. }
  7132. startPlaceBallLevel(level) {
  7133. xGame.common.gameMode = GameMode.placeBall;
  7134. xGame.common.placeBallCurLevel = level;
  7135. xGame.uiMgr.Show(UIGame);
  7136. this.hide();
  7137. }
  7138. }
  7139. UIGameEnd.uiName = "UIGameEnd";
  7140. class ui_UIVideoShare extends fgui.GComponent {
  7141. static createInstance() {
  7142. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7143. }
  7144. onConstruct() {
  7145. this.n10 = (this.getChild("n10"));
  7146. this.myNode = (this.getChild("myNode"));
  7147. this.t0 = this.getTransition("t0");
  7148. }
  7149. }
  7150. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7151. class UIVideoShare extends UIBase {
  7152. constructor() {
  7153. super();
  7154. this.success = false;
  7155. this.awardNum = 0;
  7156. this.isShared = true;
  7157. }
  7158. onConstructor() {
  7159. this.ui = ui_UIVideoShare.createInstance();
  7160. this.contentPane = this.ui;
  7161. this.isEject = false;
  7162. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7163. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7164. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7165. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7166. }
  7167. show(success) {
  7168. super.show();
  7169. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7170. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7171. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7172. this.success = success;
  7173. let time = xGame.common.randomNum(600, 1500);
  7174. Moyu.showInsertAd(time, 60000);
  7175. if (success)
  7176. xGame.soundMgr.playSound("applause");
  7177. this.ui.t0.play();
  7178. this.checkShareState();
  7179. let times = DataMgr.getDailyVideoShareTimes();
  7180. this.awardNum = times == 0 ? 2000 : 200;
  7181. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  7182. }
  7183. checkShareState() {
  7184. if (PlatMgr.forceShare == 0) {
  7185. this.ui.myNode.closeBtn.visible = true;
  7186. this.ui.myNode.tipsNode.visible = false;
  7187. this.ui.myNode.closeBtn.x = 90;
  7188. this.ui.myNode.shareBtn.x = 342;
  7189. }
  7190. else if (PlatMgr.forceShare == 1) {
  7191. this.ui.myNode.closeBtn.visible = false;
  7192. this.ui.myNode.tipsNode.visible = true;
  7193. this.ui.myNode.shareBtn.x = 218;
  7194. this.isShared = true;
  7195. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7196. }
  7197. }
  7198. checkForceShare() {
  7199. this.isShared = !this.isShared;
  7200. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7201. }
  7202. videoShare() {
  7203. if (PlatMgr.forceShare == 1) {
  7204. if (this.isShared) {
  7205. this.shareGame();
  7206. }
  7207. else {
  7208. this.hideSelf();
  7209. }
  7210. }
  7211. else {
  7212. this.shareGame();
  7213. }
  7214. }
  7215. shareGame() {
  7216. Moyu.sendDataEvent("VideoShare");
  7217. if (Moyu.canShare() > 100) {
  7218. Moyu.shareGame((success) => {
  7219. if (success) {
  7220. DataMgr.setDailyVideoShareTimes(1);
  7221. DataMgr.setCoin(this.awardNum);
  7222. }
  7223. this.hideSelf();
  7224. }, this);
  7225. }
  7226. else {
  7227. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  7228. this.hideSelf();
  7229. }
  7230. }
  7231. hideSelf() {
  7232. this.hide();
  7233. xGame.uiMgr.Show(UIGameEnd, this.success);
  7234. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  7235. xGame.common.screenImg.destroy();
  7236. xGame.common.screenImg = null;
  7237. }
  7238. }
  7239. }
  7240. UIVideoShare.uiName = "UIVideoShare";
  7241. class ui_UITips extends fgui.GComponent {
  7242. static createInstance() {
  7243. return (fgui.UIPackage.createObject("game", "UITips"));
  7244. }
  7245. onConstruct() {
  7246. this.n0 = (this.getChild("n0"));
  7247. this.myNode = (this.getChild("myNode"));
  7248. this.t0 = this.getTransition("t0");
  7249. }
  7250. }
  7251. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7252. class UITips extends UIBase {
  7253. constructor() {
  7254. super();
  7255. this.type = 0;
  7256. }
  7257. onConstructor() {
  7258. this.ui = ui_UITips.createInstance();
  7259. this.contentPane = this.ui;
  7260. this.isEject = false;
  7261. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7262. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7263. }
  7264. show(tipsTxt, womanTxt, type) {
  7265. super.show();
  7266. this.ui.t0.play();
  7267. this.ui.myNode.tipsTxt.text = tipsTxt;
  7268. this.ui.myNode.womanTxt.text = womanTxt;
  7269. PlatMgr.showInsert(true);
  7270. this.ui.myNode.c1.selectedIndex = type;
  7271. this.type = type;
  7272. switch (this.type) {
  7273. case TipsType.exitGame:
  7274. xGame.common.gameMgr.gamePause = true;
  7275. break;
  7276. case TipsType.foul:
  7277. Laya.timer.once(200, this, () => {
  7278. xGame.common.gameMgr.gamePause = true;
  7279. });
  7280. break;
  7281. default:
  7282. break;
  7283. }
  7284. }
  7285. clickLeftBtn() {
  7286. this.hide();
  7287. xGame.common.gameMgr.gamePause = false;
  7288. switch (this.type) {
  7289. case TipsType.exitGame:
  7290. break;
  7291. case TipsType.foul:
  7292. break;
  7293. default:
  7294. break;
  7295. }
  7296. }
  7297. clickRightBtn() {
  7298. this.hide();
  7299. switch (this.type) {
  7300. case TipsType.exitGame:
  7301. xGame.eventMgr.event(RESET_GAME);
  7302. xGame.uiMgr.Show(UIMain);
  7303. Moyu.recordEnd(this, null);
  7304. xGame.common.longHelpLine = false;
  7305. break;
  7306. case TipsType.foul:
  7307. xGame.common.gameMgr.gamePause = false;
  7308. Laya.timer.clearAll(this);
  7309. break;
  7310. default:
  7311. break;
  7312. }
  7313. }
  7314. }
  7315. UITips.uiName = "UITips";
  7316. class GameMgr {
  7317. constructor() {
  7318. this.selfCamp = "";
  7319. this.selfFoulNum = 0;
  7320. this.selfBallArr = [];
  7321. this.selfTimer = 0;
  7322. this.selfScore = 0;
  7323. this.aiCamp = "";
  7324. this.aiFoulNum = 0;
  7325. this.aiBallArr = [];
  7326. this.aiTimer = 0;
  7327. this.aiScore = 0;
  7328. this.aiSkillLevelNum = 1;
  7329. this.targertScore = 0;
  7330. this.setTime = 30;
  7331. this.selfTurnRate = 0.5;
  7332. this.accTime = 0;
  7333. this.curFoul = "";
  7334. this.maxFoulTimes = 3;
  7335. this.isFirstInGame = true;
  7336. this.firstColliObj = null;
  7337. this.inHoleBalls = [];
  7338. this.blackNum = 8;
  7339. this.success = false;
  7340. this.holePosList = [];
  7341. this.posObj = {};
  7342. this._selfTurn = false;
  7343. this.lastRootBallPos = new Laya.Vector2(311, 430);
  7344. this.ensureBallType = false;
  7345. this.isOpenBall = true;
  7346. this.finishOneShoot = true;
  7347. this.isEnd = false;
  7348. this.isChangeTurn = false;
  7349. this.isInterrupt = false;
  7350. this.aiPlayedBreakArmy = false;
  7351. this.isTouchedBall = false;
  7352. this.finishBalls = 0;
  7353. this.needBalls = 0;
  7354. this.allBallNum = 0;
  7355. this.placeBallPosData = {};
  7356. this.curHP = 0;
  7357. this.showLongView = false;
  7358. this.firstShoot = true;
  7359. this._gamePause = false;
  7360. this.trunCount = 0;
  7361. this.isBlackInHole = false;
  7362. this.isEnter = true;
  7363. xGame.eventMgr.offAll(ALL_BALL_STOP);
  7364. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  7365. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  7366. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  7367. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  7368. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  7369. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  7370. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  7371. }
  7372. get gamePause() {
  7373. return this._gamePause;
  7374. }
  7375. set gamePause(v) {
  7376. if (v) {
  7377. Laya.physicsTimer.pause();
  7378. }
  7379. else {
  7380. Laya.physicsTimer.resume();
  7381. }
  7382. this._gamePause = v;
  7383. }
  7384. get selfTurn() {
  7385. return this._selfTurn;
  7386. }
  7387. set selfTurn(val) {
  7388. this.trunCount++;
  7389. this._selfTurn = val;
  7390. if (val) {
  7391. xGame.common.d2World.d2Gan.ui.self.visible = true;
  7392. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7393. }
  7394. else {
  7395. xGame.common.d2World.d2Gan.ui.self.visible = false;
  7396. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  7397. if (this.trunCount > 1)
  7398. PlatMgr.openBox();
  7399. }
  7400. }
  7401. resetGame() {
  7402. this.inHoleBalls = [];
  7403. this.isFirstInGame = true;
  7404. this.firstColliObj = null;
  7405. this.aiCamp = "";
  7406. this.selfCamp = "";
  7407. this.aiFoulNum = 0;
  7408. this.selfFoulNum = 0;
  7409. this.selfBallArr = [];
  7410. this.aiBallArr = [];
  7411. this.gamePause = false;
  7412. this.ensureBallType = false;
  7413. this.isInterrupt = false;
  7414. this.updateLeftBall();
  7415. this.clearTime();
  7416. this.aiPlayedBreakArmy = false;
  7417. this.isBlackInHole = false;
  7418. this.placeBallPosData = {};
  7419. if (xGame.common.d3World.knifeRoot) {
  7420. xGame.common.d3World.knifeRoot.destroyChildren();
  7421. }
  7422. }
  7423. gameReady() {
  7424. this.trunCount = 0;
  7425. this.firstColliObj = null;
  7426. this.isFirstInGame = true;
  7427. this.selfTurn = Math.random() <= this.selfTurnRate;
  7428. let challengeNum = DataMgr.getChallengeTimes();
  7429. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7430. this.selfTurn = true;
  7431. }
  7432. if (xGame.common.gameMode == GameMode.placeBall)
  7433. this.selfTurn = true;
  7434. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7435. this.selfTurn = true;
  7436. }
  7437. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7438. this.checkGuide();
  7439. if (xGame.common.uiRodMethod)
  7440. xGame.common.uiRodMethod.resetRod();
  7441. xGame.common.d2World.getHelpLine();
  7442. this.isOpenBall = true;
  7443. this.isTouchedBall = false;
  7444. xGame.common.aiPlayer.stopRun();
  7445. this.setTime = 30;
  7446. let ui = xGame.common.gameUI.ui;
  7447. switch (xGame.common.gameMode) {
  7448. case GameMode.classic:
  7449. xGame.common.aiPlayer.init();
  7450. this.blackNum = 8;
  7451. this.placeRootBall();
  7452. this.peoplePlay(9, 10);
  7453. ui.wordsBtn.visible = true;
  7454. ui.aiWordsBtn.visible = true;
  7455. xGame.common.talkMgr.changeAIState(true);
  7456. DataMgr.gameData.gameCount++;
  7457. DataMgr.saveGameData();
  7458. break;
  7459. case GameMode.bigMove:
  7460. this.blackNum = -1;
  7461. this.selfScore = 0;
  7462. this.aiScore = 0;
  7463. xGame.common.aiPlayer.init();
  7464. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7465. this.updateSelfScore();
  7466. this.updateAIScore();
  7467. this.updateTargetSroce();
  7468. this.placeRootBall();
  7469. this.peoplePlay(9, 10);
  7470. ui.wordsBtn.visible = true;
  7471. ui.aiWordsBtn.visible = true;
  7472. xGame.common.talkMgr.changeAIState(true);
  7473. if (DataMgr.getSkillGuide() < 1)
  7474. DataMgr.gameData.gameCount = 0;
  7475. else {
  7476. DataMgr.gameData.gameCount++;
  7477. DataMgr.saveGameData();
  7478. PlatMgr.openTry();
  7479. }
  7480. if (xGame.common.d3World.knifeRoot) {
  7481. xGame.common.d3World.knifeRoot.destroyChildren();
  7482. }
  7483. break;
  7484. case GameMode.placeBall:
  7485. this.blackNum = -1;
  7486. this.selfTurn = true;
  7487. this.setTime = 10000;
  7488. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7489. this.curHP = this.placeBallData.hp;
  7490. if (this.placeBallData.ball == -1)
  7491. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7492. else
  7493. this.needBalls = this.placeBallData.ball;
  7494. console.log("需要的进球数目", this.needBalls);
  7495. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7496. this.finishBalls = 0;
  7497. this.placeBallPosData = {};
  7498. this.updatePlaceBallPos();
  7499. this.updatePlaceBallState();
  7500. this.finishOneShoot = true;
  7501. xGame.common.gameUI.ui.moveNode.visible = false;
  7502. this.isOpenBall = false;
  7503. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7504. ui.wordsBtn.visible = false;
  7505. ui.aiWordsBtn.visible = false;
  7506. xGame.common.talkMgr.changeAIState(false);
  7507. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7508. PlatMgr.openBox();
  7509. });
  7510. break;
  7511. default:
  7512. break;
  7513. }
  7514. this.showLongView = false;
  7515. xGame.common.wordsMgr.comboTimes = 1;
  7516. let guide = DataMgr.getSkillGuide();
  7517. if (guide)
  7518. xGame.eventMgr.event(WAIT_SHOOT);
  7519. xGame.common.upSkillLevel = false;
  7520. xGame.common.gameStartTime = new Date().getTime();
  7521. this.firstShoot = true;
  7522. }
  7523. checkGuide() {
  7524. let guide = DataMgr.getSkillGuide();
  7525. let gameUI = xGame.common.gameUI.ui;
  7526. gameUI.guide1.visible = false;
  7527. gameUI.guide2.visible = false;
  7528. gameUI.guide3.visible = false;
  7529. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7530. this.selfTurn = true;
  7531. }
  7532. else {
  7533. return;
  7534. }
  7535. let oneBall = this.getOneBall();
  7536. gameUI.guide1.visible = true;
  7537. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7538. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7539. }
  7540. getOneBall() {
  7541. let arr = xGame.common.d2World.ballArr;
  7542. for (let index = 0; index < arr.length; index++) {
  7543. if (arr[index].number == 0)
  7544. continue;
  7545. return arr[index];
  7546. }
  7547. }
  7548. updateSelfScore() {
  7549. let ui = xGame.common.gameUI.ui.topNode;
  7550. ui.selfScoreTxt.text = this.selfScore + "";
  7551. }
  7552. updateAIScore() {
  7553. let ui = xGame.common.gameUI.ui.topNode;
  7554. ui.aiScoreTxt.text = this.aiScore + "";
  7555. }
  7556. updateTargetSroce() {
  7557. let ui = xGame.common.gameUI.ui.topNode;
  7558. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7559. }
  7560. updateLeftBall() {
  7561. let topUI = xGame.common.gameUI.ui.topNode;
  7562. topUI.selfBallList.numItems = this.selfBallArr.length;
  7563. topUI.aiBallList.numItems = this.aiBallArr.length;
  7564. }
  7565. ballShoot() {
  7566. this.clearTime();
  7567. this.finishOneShoot = false;
  7568. xGame.common.gameUI.ui.moveNode.visible = false;
  7569. if (xGame.common.gameUI.ui.guideNode.visible) {
  7570. xGame.common.gameUI.ui.guideNode.visible = false;
  7571. }
  7572. if (this.firstShoot) {
  7573. this.firstShoot = false;
  7574. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7575. }
  7576. }
  7577. ensureCamp(number) {
  7578. this.ensureBallType = true;
  7579. this.isOpenBall = false;
  7580. if (xGame.common.gameMode != GameMode.classic)
  7581. return;
  7582. let full = [1, 2, 3, 4, 5, 6, 7];
  7583. let flower = [9, 10, 11, 12, 13, 14, 15];
  7584. let sayWords = "";
  7585. if (this.selfTurn) {
  7586. if (number <= 7) {
  7587. this.selfCamp = ballCamp.full;
  7588. this.selfBallArr = full;
  7589. this.aiCamp = ballCamp.flower;
  7590. this.aiBallArr = flower;
  7591. sayWords = cfgTable.wordsData[3].msg;
  7592. }
  7593. else {
  7594. this.selfCamp = ballCamp.flower;
  7595. this.selfBallArr = flower;
  7596. this.aiCamp = ballCamp.full;
  7597. this.aiBallArr = full;
  7598. sayWords = cfgTable.wordsData[4].msg;
  7599. }
  7600. }
  7601. else {
  7602. if (number <= 7) {
  7603. this.selfCamp = ballCamp.flower;
  7604. this.selfBallArr = flower;
  7605. this.aiCamp = ballCamp.full;
  7606. this.aiBallArr = full;
  7607. sayWords = cfgTable.wordsData[2].msg;
  7608. }
  7609. else {
  7610. this.selfCamp = ballCamp.full;
  7611. this.selfBallArr = full;
  7612. this.aiCamp = ballCamp.flower;
  7613. this.aiBallArr = flower;
  7614. sayWords = cfgTable.wordsData[1].msg;
  7615. }
  7616. }
  7617. this.updateLeftBall();
  7618. xGame.uiMgr.Show(UIMsg, sayWords);
  7619. }
  7620. updatePlaceBallState() {
  7621. let ui = xGame.common.gameUI.ui;
  7622. switch (this.placeBallData.type) {
  7623. case PlaceBallType.normal:
  7624. let normal = ui.placeNormalNode;
  7625. normal.hpTxt.text = this.curHP + "";
  7626. this.updatePlaceBallStar(normal);
  7627. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7628. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7629. break;
  7630. case PlaceBallType.challenge:
  7631. let challenge = ui.placeChallengeNode;
  7632. challenge.hpTxt.text = "Shots:" + this.curHP;
  7633. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7634. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7635. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7636. break;
  7637. default:
  7638. break;
  7639. }
  7640. }
  7641. playSubHpAni() {
  7642. let ui = xGame.common.gameUI.ui;
  7643. switch (this.placeBallData.type) {
  7644. case PlaceBallType.normal:
  7645. let normal = ui.placeNormalNode;
  7646. normal.hpTxt.visible = false;
  7647. normal.starAni.c1.selectedIndex = 1;
  7648. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7649. normal.hpTxt.visible = true;
  7650. normal.starAni.c1.selectedIndex = 0;
  7651. }));
  7652. break;
  7653. default:
  7654. break;
  7655. }
  7656. }
  7657. getEndStarNum() {
  7658. let num;
  7659. let level = xGame.common.placeBallCurLevel;
  7660. if (this.curHP == this.placeBallData.hp) {
  7661. num = 3;
  7662. }
  7663. else if (this.curHP <= 1) {
  7664. num = 1;
  7665. }
  7666. else {
  7667. num = 2;
  7668. }
  7669. if (!this.success) {
  7670. num = 0;
  7671. }
  7672. else {
  7673. DataMgr.setPlaceBallLevel(level, num);
  7674. }
  7675. let myType = cfgTable.placeballData[level].type;
  7676. if (this.success && myType == 1) {
  7677. num = 3;
  7678. }
  7679. xGame.common.placeBallStarNum = num;
  7680. }
  7681. updatePlaceBallStar(node) {
  7682. let star = 0;
  7683. if (this.curHP == this.placeBallData.hp) {
  7684. star = 3;
  7685. }
  7686. else if (this.curHP >= 2) {
  7687. star = 2;
  7688. }
  7689. else if (this.curHP == 1) {
  7690. star = 1;
  7691. }
  7692. else {
  7693. star = 0;
  7694. }
  7695. let temp;
  7696. for (let index = 1; index <= 3; index++) {
  7697. temp = node["star" + index];
  7698. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7699. }
  7700. node.myProgress.value = (star / 3) * 100;
  7701. }
  7702. openRegretView(isFoul, GoalNum, challenge = false) {
  7703. let regretType = -1;
  7704. if (isFoul) {
  7705. regretType = 1;
  7706. }
  7707. else {
  7708. if (GoalNum <= 0) {
  7709. regretType = 0;
  7710. }
  7711. }
  7712. if (challenge) {
  7713. regretType = 1;
  7714. }
  7715. if (regretType != -1) {
  7716. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7717. if (success) {
  7718. this.curHP++;
  7719. this.updatePlaceBallState();
  7720. this.setPlaceBallAllPos();
  7721. xGame.common.gameUI.ui.moveNode.visible = false;
  7722. }
  7723. else {
  7724. if (this.curHP <= 0) {
  7725. this.success = false;
  7726. this.gameEnd();
  7727. }
  7728. this.playSubHpAni();
  7729. }
  7730. this.updatePlaceBallState();
  7731. this.updatePlaceBallPos();
  7732. });
  7733. }
  7734. }
  7735. setPlaceBallAllPos() {
  7736. let allBall = xGame.common.d2World.ballArr;
  7737. let cfgArr = this.placeBallPosData;
  7738. let temp;
  7739. let obj;
  7740. for (let index = 0; index < allBall.length; index++) {
  7741. temp = allBall[index];
  7742. if (temp.destroyed)
  7743. continue;
  7744. obj = cfgArr[temp.myUNID];
  7745. if (obj && obj.src && !obj.src.destroyed) {
  7746. temp.gameObj.x = obj.posX;
  7747. temp.gameObj.y = obj.posY;
  7748. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7749. }
  7750. }
  7751. xGame.common.d2World.getHelpLine();
  7752. }
  7753. updatePlaceBallPos() {
  7754. let arr = xGame.common.d2World.ballArr;
  7755. let temp;
  7756. for (let index = 0; index < arr.length; index++) {
  7757. temp = arr[index];
  7758. if (!this.placeBallPosData[temp.myUNID]) {
  7759. this.placeBallPosData[temp.myUNID] = {
  7760. src: temp,
  7761. posX: temp.gameObj.x,
  7762. posY: temp.gameObj.y
  7763. };
  7764. }
  7765. else {
  7766. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7767. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7768. }
  7769. }
  7770. let check;
  7771. for (const key in this.placeBallPosData) {
  7772. check = this.placeBallPosData[key];
  7773. if (check.src.destroyed) {
  7774. delete this.placeBallPosData[key];
  7775. }
  7776. }
  7777. }
  7778. gameRun(type) {
  7779. if (this.gamePause)
  7780. return;
  7781. this.curFoul = this.getFoulType();
  7782. if (type) {
  7783. xGame.common.d2World.d2Gan.shoot();
  7784. xGame.common.gameUI.forceCancel();
  7785. this.curFoul = type;
  7786. }
  7787. this.isEnd = false;
  7788. this.isChangeTurn = true;
  7789. if (xGame.common.gameMode == GameMode.classic) {
  7790. this.judgeClassic(this.curFoul);
  7791. this.checkClassicWords(() => {
  7792. xGame.common.destroyClassicEmotion();
  7793. if (this.isEnd) {
  7794. if (this.isBlackInHole) {
  7795. xGame.common.gameUI.ui.blackAni.visible = true;
  7796. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7797. xGame.common.gameUI.ui.blackAni.visible = false;
  7798. this.gameEnd();
  7799. }));
  7800. }
  7801. else {
  7802. this.gameEnd();
  7803. }
  7804. }
  7805. else {
  7806. this.waitShoot();
  7807. xGame.eventMgr.event(WAIT_SHOOT);
  7808. }
  7809. });
  7810. }
  7811. else if (xGame.common.gameMode == GameMode.bigMove) {
  7812. xGame.common.aiPlayer.stopRun();
  7813. let scoreArr = this.getScore(this.curFoul);
  7814. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7815. this.isEnd = true;
  7816. }
  7817. this.checkBigSkillWords(() => {
  7818. if (this.isEnd) {
  7819. this.gameEnd();
  7820. }
  7821. else {
  7822. this.waitShoot();
  7823. xGame.eventMgr.event(WAIT_SHOOT);
  7824. }
  7825. });
  7826. }
  7827. else if (xGame.common.gameMode == GameMode.placeBall) {
  7828. xGame.common.destroyAwardSpine();
  7829. let isFoul = this.curFoul == FoulType.rootHole;
  7830. let GoalNum = this.inHoleBalls.length;
  7831. if (this.inHoleBalls.indexOf(0) > -1)
  7832. GoalNum -= 1;
  7833. if (isFoul) {
  7834. this.placeRootBall();
  7835. }
  7836. console.log("neeballs", this.needBalls);
  7837. console.log("当前完成的goalNum", GoalNum);
  7838. this.finishBalls += GoalNum;
  7839. console.log("当前完成的finishballs", this.finishBalls);
  7840. let need = this.needBalls;
  7841. if (this.placeBallData.type == PlaceBallType.challenge) {
  7842. need += 100;
  7843. }
  7844. if (this.finishBalls >= need) {
  7845. this.success = true;
  7846. this.gameEnd();
  7847. }
  7848. else {
  7849. switch (this.placeBallData.type) {
  7850. case PlaceBallType.normal:
  7851. if (!isFoul && GoalNum > 0) {
  7852. this.updatePlaceBallPos();
  7853. this.updatePlaceBallState();
  7854. }
  7855. else {
  7856. this.curHP--;
  7857. this.openRegretView(isFoul, GoalNum);
  7858. }
  7859. this.waitShoot();
  7860. xGame.eventMgr.event(WAIT_SHOOT);
  7861. break;
  7862. case PlaceBallType.challenge:
  7863. this.curHP--;
  7864. this.updatePlaceBallState();
  7865. if (isFoul) {
  7866. this.openRegretView(isFoul, GoalNum, true);
  7867. }
  7868. else {
  7869. this.updatePlaceBallPos();
  7870. if (this.curHP <= 0) {
  7871. this.success = true;
  7872. this.gameEnd();
  7873. }
  7874. }
  7875. this.waitShoot();
  7876. xGame.eventMgr.event(WAIT_SHOOT);
  7877. break;
  7878. default:
  7879. break;
  7880. }
  7881. }
  7882. }
  7883. }
  7884. checkClassicWords(callback) {
  7885. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7886. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7887. let type = this.getClassicWordsType();
  7888. if (condition && type != -1) {
  7889. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7890. xGame.soundMgr.playSound(str);
  7891. xGame.common.wordsMgr.playClassicWords(type, callback);
  7892. }
  7893. else {
  7894. Laya.timer.once(300, this, () => {
  7895. callback && callback();
  7896. });
  7897. }
  7898. }
  7899. getClassicWordsType() {
  7900. let d2world = xGame.common.d2World;
  7901. let type = -1;
  7902. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7903. type = ClassicWordsType.perfectShow;
  7904. return type;
  7905. }
  7906. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7907. type = ClassicWordsType.directShoot;
  7908. return type;
  7909. }
  7910. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7911. type = ClassicWordsType.anotherShoot;
  7912. return type;
  7913. }
  7914. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7915. type = ClassicWordsType.bigPower;
  7916. return type;
  7917. }
  7918. let minSpeed = 1;
  7919. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7920. type = ClassicWordsType.hardShoot;
  7921. return type;
  7922. }
  7923. if (this.inHoleBalls.length > 0) {
  7924. type = ClassicWordsType.directShoot;
  7925. return type;
  7926. }
  7927. return type;
  7928. }
  7929. checkBigSkillWords(callback) {
  7930. if (this.curFoul == FoulType.timeOut) {
  7931. callback && callback();
  7932. }
  7933. else {
  7934. let playSkill = false;
  7935. if (this.selfTurn) {
  7936. playSkill = true;
  7937. }
  7938. else {
  7939. if (!this.aiPlayedBreakArmy) {
  7940. this.aiPlayedBreakArmy = true;
  7941. playSkill = true;
  7942. }
  7943. if (this.aiCurSkill != SkillType.breakArmy) {
  7944. playSkill = true;
  7945. }
  7946. }
  7947. if (xGame.common.skillMgr.playedLastSkill) {
  7948. xGame.common.skillMgr.playedLastSkill = false;
  7949. playSkill = false;
  7950. }
  7951. if (playSkill) {
  7952. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7953. let selfExtra = 0;
  7954. let aiExtra = 0;
  7955. if (this.selfTurn)
  7956. selfExtra += extraScore;
  7957. else
  7958. aiExtra += extraScore;
  7959. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7960. this.isEnd = true;
  7961. }
  7962. this.playBigSkillTimes(callback);
  7963. });
  7964. }
  7965. else {
  7966. this.playBigSkillTimes(callback);
  7967. }
  7968. }
  7969. }
  7970. playBigSkillTimes(callback) {
  7971. let length = this.inHoleBalls.length;
  7972. if (this.inHoleBalls.indexOf(0) > -1) {
  7973. length = this.inHoleBalls.length - 1;
  7974. }
  7975. if (length <= 0) {
  7976. callback && callback();
  7977. return;
  7978. }
  7979. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7980. callback && callback();
  7981. });
  7982. }
  7983. playSkillTips() {
  7984. let levelNum = 0;
  7985. let curType;
  7986. if (this.selfTurn) {
  7987. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7988. curType = this.selfCurSkill;
  7989. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7990. levelNum += 5;
  7991. }
  7992. }
  7993. else {
  7994. levelNum = this.aiSkillLevelNum;
  7995. curType = this.aiCurSkill;
  7996. }
  7997. let str = ``;
  7998. switch (curType) {
  7999. case SkillType.highSpace:
  8000. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8001. break;
  8002. case SkillType.breakArmy:
  8003. str = `You pocketed ${levelNum} extra balls`;
  8004. break;
  8005. case SkillType.ice:
  8006. str = `${levelNum * 2} extra balls were frozen`;
  8007. break;
  8008. case SkillType.fireworks:
  8009. str = `${levelNum} extra balls exploded `;
  8010. break;
  8011. case SkillType.GuanYu:
  8012. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8013. break;
  8014. default:
  8015. break;
  8016. }
  8017. xGame.uiMgr.Show(UIMsg, str);
  8018. }
  8019. getFoulType() {
  8020. let foulType = "";
  8021. if (this.firstColliObj == null) {
  8022. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8023. return FoulType.rootHole;
  8024. }
  8025. return FoulType.notTouch;
  8026. }
  8027. else {
  8028. if (this.selfTurn) {
  8029. if (this.selfBallArr.length > 0) {
  8030. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8031. foulType = FoulType.wrongTouch;
  8032. }
  8033. }
  8034. else {
  8035. if (this.ensureBallType) {
  8036. }
  8037. else {
  8038. if (this.firstColliObj == this.blackNum) {
  8039. foulType = FoulType.wrongTouch;
  8040. }
  8041. }
  8042. }
  8043. }
  8044. else {
  8045. if (this.aiBallArr.length > 0) {
  8046. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8047. foulType = FoulType.wrongTouch;
  8048. }
  8049. }
  8050. else {
  8051. if (this.ensureBallType) {
  8052. }
  8053. else {
  8054. if (this.firstColliObj == this.blackNum) {
  8055. foulType = FoulType.wrongTouch;
  8056. }
  8057. }
  8058. }
  8059. }
  8060. if (this.inHoleBalls.length <= 0) {
  8061. return foulType;
  8062. }
  8063. let temp;
  8064. if (this.inHoleBalls.indexOf(0) > -1) {
  8065. foulType = FoulType.rootHole;
  8066. }
  8067. else {
  8068. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8069. temp = this.inHoleBalls[index];
  8070. if (this.selfTurn) {
  8071. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8072. foulType = FoulType.wrongHole;
  8073. break;
  8074. }
  8075. }
  8076. else {
  8077. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8078. foulType = FoulType.wrongHole;
  8079. break;
  8080. }
  8081. }
  8082. }
  8083. }
  8084. let foo;
  8085. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8086. temp = this.inHoleBalls[index];
  8087. foo = this.selfBallArr.indexOf(temp);
  8088. if (foo > -1) {
  8089. this.selfBallArr.splice(foo, 1);
  8090. }
  8091. foo = this.aiBallArr.indexOf(temp);
  8092. if (foo > -1) {
  8093. this.aiBallArr.splice(foo, 1);
  8094. }
  8095. }
  8096. this.updateLeftBall();
  8097. }
  8098. return foulType;
  8099. }
  8100. judgeGameEndByBlack(arr) {
  8101. if (this.selfTurn) {
  8102. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8103. this.selfFoulNum = this.maxFoulTimes;
  8104. return true;
  8105. }
  8106. }
  8107. else {
  8108. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8109. this.aiFoulNum = this.maxFoulTimes;
  8110. return true;
  8111. }
  8112. }
  8113. }
  8114. judgeClassic(type) {
  8115. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8116. xGame.common.aiPlayer.stopRun();
  8117. if (this.judgeNormalSuccess()) {
  8118. this.isEnd = true;
  8119. return;
  8120. }
  8121. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8122. if (this.selfTurn) {
  8123. if (isFoul) {
  8124. this.selfFoulNum++;
  8125. }
  8126. if (this.selfFoulNum >= this.maxFoulTimes) {
  8127. this.success = false;
  8128. this.isEnd = true;
  8129. return;
  8130. }
  8131. }
  8132. else {
  8133. if (isFoul)
  8134. this.aiFoulNum++;
  8135. if (this.aiFoulNum >= this.maxFoulTimes) {
  8136. this.success = true;
  8137. this.isEnd = true;
  8138. return;
  8139. }
  8140. }
  8141. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8142. this.isChangeTurn = false;
  8143. }
  8144. else {
  8145. this.isInterrupt = true;
  8146. }
  8147. }
  8148. waitShoot() {
  8149. if (xGame.common.gameMode == GameMode.classic) {
  8150. switch (this.curFoul) {
  8151. case FoulType.timeOut:
  8152. case FoulType.rootHole:
  8153. this.selfTurn = !this.selfTurn;
  8154. this.peoplePlay(5, 6, true);
  8155. break;
  8156. case FoulType.notTouch:
  8157. this.selfTurn = !this.selfTurn;
  8158. this.peoplePlay(7, 7);
  8159. break;
  8160. case FoulType.wrongHole:
  8161. this.selfTurn = !this.selfTurn;
  8162. this.peoplePlay(11, 11);
  8163. break;
  8164. default:
  8165. if (this.inHoleBalls.length > 0) {
  8166. this.peoplePlay(0, 0, false, false);
  8167. }
  8168. else {
  8169. this.selfTurn = !this.selfTurn;
  8170. this.peoplePlay(7, 7);
  8171. }
  8172. break;
  8173. }
  8174. }
  8175. else if (xGame.common.gameMode == GameMode.bigMove) {
  8176. if (this.curFoul == FoulType.timeOut) {
  8177. this.selfTurn = !this.selfTurn;
  8178. this.peoplePlay(14, 15);
  8179. this.placeRootBall();
  8180. }
  8181. else {
  8182. this.selfTurn = !this.selfTurn;
  8183. if (this.curFoul == FoulType.rootHole) {
  8184. this.peoplePlay(12, 13);
  8185. this.placeRootBall();
  8186. }
  8187. else {
  8188. this.peoplePlay(0, 0, false, false);
  8189. }
  8190. }
  8191. }
  8192. else if (xGame.common.gameMode == GameMode.placeBall) {
  8193. this.finishOneShoot = true;
  8194. }
  8195. this.gameResult();
  8196. }
  8197. gameResult() {
  8198. this.firstColliObj = null;
  8199. this.inHoleBalls = [];
  8200. let curX = xGame.common.d2World.rootBall.gameObj.x;
  8201. let curY = xGame.common.d2World.rootBall.gameObj.y;
  8202. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  8203. if (xGame.common.uiRodMethod)
  8204. xGame.common.uiRodMethod.resetRod();
  8205. xGame.common.d2World.rootBall.showSelf();
  8206. this.clearIceSkill();
  8207. if (this.selfTurn) {
  8208. console.log("gameResult");
  8209. PlatMgr.gameInsert();
  8210. }
  8211. xGame.common.d3World.knifeRoot.destroyChildren();
  8212. if (this.selfTurn) {
  8213. xGame.common.gameUI.showHelpLineGuide();
  8214. xGame.common.gameUI.setTurnAlpha(true);
  8215. }
  8216. else {
  8217. xGame.common.gameUI.setTurnAlpha(false);
  8218. }
  8219. }
  8220. getScore(type) {
  8221. let selfAdd = 0;
  8222. let aiAdd = 0;
  8223. if (type == FoulType.timeOut) {
  8224. if (this.selfTurn)
  8225. aiAdd += 3;
  8226. else
  8227. selfAdd += 3;
  8228. }
  8229. else {
  8230. if (this.inHoleBalls.length > 0) {
  8231. if (this.selfTurn) {
  8232. if (type == FoulType.rootHole) {
  8233. aiAdd += 3;
  8234. if (this.inHoleBalls.length - 1 > 0) {
  8235. selfAdd += this.inHoleBalls.length - 1;
  8236. }
  8237. }
  8238. else {
  8239. selfAdd += this.inHoleBalls.length;
  8240. }
  8241. }
  8242. else {
  8243. if (type == FoulType.rootHole) {
  8244. selfAdd += 3;
  8245. if (this.inHoleBalls.length - 1 > 0) {
  8246. aiAdd += this.inHoleBalls.length - 1;
  8247. }
  8248. }
  8249. else {
  8250. aiAdd += this.inHoleBalls.length;
  8251. }
  8252. }
  8253. }
  8254. }
  8255. return [selfAdd, aiAdd];
  8256. }
  8257. judgeScoreEnd(selfAdd, aiAdd) {
  8258. this.selfScore += selfAdd;
  8259. this.aiScore += aiAdd;
  8260. this.updateAIScore();
  8261. this.updateSelfScore();
  8262. if (this.selfScore >= this.targertScore) {
  8263. this.success = true;
  8264. return true;
  8265. }
  8266. if (this.aiScore >= this.targertScore) {
  8267. this.success = false;
  8268. return true;
  8269. }
  8270. let ballArr = xGame.common.d2World.ballArr;
  8271. if (ballArr.length == 1 && ballArr[0].number == 0) {
  8272. if (this.selfScore > this.aiScore) {
  8273. this.success = true;
  8274. return true;
  8275. }
  8276. else if (this.selfScore < this.aiScore) {
  8277. this.success = false;
  8278. return true;
  8279. }
  8280. else {
  8281. if (this.selfTurn) {
  8282. this.success = false;
  8283. }
  8284. else {
  8285. this.success = true;
  8286. }
  8287. return true;
  8288. }
  8289. }
  8290. }
  8291. clearIceSkill() {
  8292. let arr = xGame.common.d2World.ballArr;
  8293. let temp;
  8294. if (this.selfTurn) {
  8295. if (this.selfCurSkill == SkillType.ice) {
  8296. for (let index = 0; index < arr.length; index++) {
  8297. temp = arr[index];
  8298. if (temp.ballFunc == "ice") {
  8299. temp.setBallFunc("normal", "self");
  8300. }
  8301. }
  8302. }
  8303. }
  8304. else {
  8305. if (this.aiCurSkill == SkillType.ice) {
  8306. for (let index = 0; index < arr.length; index++) {
  8307. temp = arr[index];
  8308. if (temp.ballFunc == "ice") {
  8309. temp.setBallFunc("normal", "ai");
  8310. }
  8311. }
  8312. }
  8313. }
  8314. }
  8315. judgeNormalSuccess() {
  8316. if (this.selfTurn) {
  8317. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8318. this.success = true;
  8319. return true;
  8320. }
  8321. }
  8322. else {
  8323. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8324. this.success = false;
  8325. return true;
  8326. }
  8327. }
  8328. }
  8329. gameEnd() {
  8330. if (Moyu.isTT) {
  8331. xGame.common.screenImg = getScreenImg();
  8332. }
  8333. console.log("游戏结束", this.success);
  8334. xGame.common.aiPlayer.stopRun();
  8335. if (xGame.common.gameMode == GameMode.placeBall) {
  8336. this.getEndStarNum();
  8337. this.updatePlaceBallState();
  8338. }
  8339. this.isEnter = false;
  8340. Moyu.recordEnd(this, () => {
  8341. if (this.isEnter)
  8342. return;
  8343. this.isEnter = true;
  8344. console.log("进入录结束回调");
  8345. this.enterNext();
  8346. });
  8347. Laya.timer.once(1000, this, () => {
  8348. if (this.isEnter)
  8349. return;
  8350. this.isEnter = true;
  8351. this.enterNext();
  8352. });
  8353. xGame.common.longHelpLine = false;
  8354. }
  8355. enterNext() {
  8356. Laya.timer.clearAll(this);
  8357. if (Moyu.canShare() > 100 || Moyu.isKs) {
  8358. xGame.uiMgr.Show(UIVideoShare, this.success);
  8359. }
  8360. else {
  8361. xGame.uiMgr.Show(UIGameEnd, this.success);
  8362. }
  8363. }
  8364. aiLeave() {
  8365. let ui = xGame.common.gameUI.ui;
  8366. ui.topNode.aiNameTxt.text = "offline";
  8367. }
  8368. aiGameEnd(suc) {
  8369. this.success = suc;
  8370. xGame.common.aiPlayer.stopRun();
  8371. if (this.success) {
  8372. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  8373. Laya.timer.once(1000, this, () => {
  8374. this.clearTime();
  8375. this.gameEnd();
  8376. });
  8377. }
  8378. }
  8379. openTimer() {
  8380. let src = xGame.common.gameUI;
  8381. if (this.selfTurn) {
  8382. src.ui.topNode.selfProgress.visible = true;
  8383. src.ui.topNode.aiProgress.visible = false;
  8384. this.curTimer = src.ui.topNode.selfProgress;
  8385. }
  8386. else {
  8387. src.ui.topNode.selfProgress.visible = false;
  8388. src.ui.topNode.aiProgress.visible = true;
  8389. this.curTimer = src.ui.topNode.aiProgress;
  8390. }
  8391. this.accTime = 0;
  8392. Laya.timer.clearAll(this);
  8393. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  8394. this.curTimer.value = 100;
  8395. }
  8396. updateTime(dt) {
  8397. if (this.gamePause)
  8398. return;
  8399. this.accTime += dt;
  8400. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8401. if (this.accTime >= this.setTime) {
  8402. this.clearTime();
  8403. console.log("时钟进入了gameRun");
  8404. this.gameRun(FoulType.timeOut);
  8405. }
  8406. }
  8407. clearTime() {
  8408. let src = xGame.common.gameUI;
  8409. src.ui.topNode.selfProgress.visible = false;
  8410. src.ui.topNode.aiProgress.visible = false;
  8411. Laya.timer.clearAll(this);
  8412. }
  8413. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8414. let ui = xGame.common.gameUI.ui;
  8415. let selfMsg, aiMsg;
  8416. if (sayWords) {
  8417. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8418. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8419. if (Foul) {
  8420. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8421. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8422. this.placeRootBall();
  8423. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8424. if (this.curFoul == FoulType.rootHole) {
  8425. if (!DataMgr.getRootBallFoul()) {
  8426. DataMgr.setRootBallFoul();
  8427. aiMsg = "";
  8428. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8429. let woman = "Boss, pay attention next time~";
  8430. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8431. }
  8432. }
  8433. else if (this.curFoul == FoulType.timeOut) {
  8434. if (!DataMgr.getTimeoutFoul()) {
  8435. DataMgr.setTimeoutFoul();
  8436. aiMsg = "";
  8437. let tips = "Game timeout, 3 fouls, this game failed.";
  8438. let woman = "Boss, pay attention to the timeline~";
  8439. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8440. }
  8441. }
  8442. }
  8443. }
  8444. }
  8445. if (this.selfTurn) {
  8446. if (sayWords) {
  8447. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8448. ui.selfTurn.visible = true;
  8449. ui.aiTurn.visible = false;
  8450. ui.selfTurn.t0.play();
  8451. Moyu.vibration();
  8452. });
  8453. }
  8454. }
  8455. else {
  8456. let aiNum = xGame.tools.random(1, 11);
  8457. let challengeNum = DataMgr.getChallengeTimes();
  8458. let delay = false;
  8459. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8460. aiNum = 9;
  8461. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8462. aiNum = 3;
  8463. if (challengeNum == 3) {
  8464. if (!this.showLongView) {
  8465. this.showLongView = true;
  8466. delay = true;
  8467. }
  8468. }
  8469. }
  8470. }
  8471. if (delay) {
  8472. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8473. if (success) {
  8474. xGame.common.longHelpLine = true;
  8475. xGame.common.d2World.getHelpLine();
  8476. }
  8477. else {
  8478. aiNum = 10;
  8479. }
  8480. xGame.common.aiPlayer.setAiLevel(aiNum);
  8481. if (sayWords) {
  8482. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8483. xGame.common.aiPlayer.runAI();
  8484. ui.selfTurn.visible = false;
  8485. ui.aiTurn.visible = true;
  8486. ui.aiTurn.t0.play();
  8487. });
  8488. }
  8489. else {
  8490. xGame.common.aiPlayer.runAI();
  8491. }
  8492. this.openTimer();
  8493. this.finishOneShoot = true;
  8494. if (this.selfTurn) {
  8495. ui.topNode.selfKuang.visible = true;
  8496. ui.topNode.aiKuang.visible = false;
  8497. ui.topNode.selfTips.visible = true;
  8498. ui.topNode.aiTips.visible = false;
  8499. }
  8500. else {
  8501. ui.topNode.selfKuang.visible = false;
  8502. ui.topNode.aiKuang.visible = true;
  8503. ui.topNode.selfTips.visible = false;
  8504. ui.topNode.aiTips.visible = true;
  8505. }
  8506. });
  8507. return;
  8508. }
  8509. if (xGame.common.gameMode == GameMode.classic) {
  8510. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8511. if (cfg) {
  8512. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8513. aiNum = aiLevel;
  8514. }
  8515. }
  8516. xGame.common.aiPlayer.setAiLevel(aiNum);
  8517. if (sayWords) {
  8518. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8519. xGame.common.aiPlayer.runAI();
  8520. ui.selfTurn.visible = false;
  8521. ui.aiTurn.visible = true;
  8522. ui.aiTurn.t0.play();
  8523. });
  8524. }
  8525. else {
  8526. xGame.common.aiPlayer.runAI();
  8527. }
  8528. }
  8529. this.openTimer();
  8530. this.finishOneShoot = true;
  8531. if (this.selfTurn) {
  8532. ui.topNode.selfKuang.visible = true;
  8533. ui.topNode.aiKuang.visible = false;
  8534. ui.topNode.selfTips.visible = true;
  8535. ui.topNode.aiTips.visible = false;
  8536. }
  8537. else {
  8538. ui.topNode.selfKuang.visible = false;
  8539. ui.topNode.aiKuang.visible = true;
  8540. ui.topNode.selfTips.visible = false;
  8541. ui.topNode.aiTips.visible = true;
  8542. }
  8543. }
  8544. placeRootBall() {
  8545. let rootBall = xGame.common.d2World.rootBall;
  8546. if (!rootBall)
  8547. return;
  8548. rootBall.gameObj.x = this.lastRootBallPos.x;
  8549. rootBall.gameObj.y = this.lastRootBallPos.y;
  8550. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8551. let moveNode = xGame.common.gameUI.ui.moveNode;
  8552. moveNode.visible = true;
  8553. moveNode.x = this.lastRootBallPos.x;
  8554. moveNode.y = this.lastRootBallPos.y;
  8555. if (!this.selfTurn) {
  8556. xGame.common.aiPlayer.resetRoot();
  8557. }
  8558. }
  8559. }
  8560. class ui_guanyuAni extends fgui.GComponent {
  8561. static createInstance() {
  8562. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8563. }
  8564. onConstruct() {
  8565. this.n0 = (this.getChild("n0"));
  8566. }
  8567. }
  8568. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8569. class UIFireworks extends UIBase {
  8570. constructor() {
  8571. super();
  8572. }
  8573. onConstructor() {
  8574. this.isEject = false;
  8575. }
  8576. show(callback) {
  8577. super.show();
  8578. }
  8579. }
  8580. UIFireworks.uiName = "UIFireworks";
  8581. class ui_UIGuanYu extends fgui.GComponent {
  8582. static createInstance() {
  8583. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8584. }
  8585. onConstruct() {
  8586. this.n2 = (this.getChild("n2"));
  8587. this.n1 = (this.getChild("n1"));
  8588. this.n3 = (this.getChild("n3"));
  8589. this.n4 = (this.getChild("n4"));
  8590. this.n5 = (this.getChild("n5"));
  8591. this.n6 = (this.getChild("n6"));
  8592. this.n8 = (this.getChild("n8"));
  8593. this.n7 = (this.getChild("n7"));
  8594. this.t0 = this.getTransition("t0");
  8595. }
  8596. }
  8597. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8598. class UIGuanYu extends UIBase {
  8599. constructor() {
  8600. super();
  8601. }
  8602. onConstructor() {
  8603. this.ui = ui_UIGuanYu.createInstance();
  8604. this.contentPane = this.ui;
  8605. this.isEject = false;
  8606. }
  8607. show(callback) {
  8608. super.show();
  8609. this.ui.t0.play(Laya.Handler.create(this, () => {
  8610. callback && callback();
  8611. this.hide();
  8612. }));
  8613. }
  8614. }
  8615. UIGuanYu.uiName = "UIGuanYu";
  8616. class SkillMgr {
  8617. constructor() {
  8618. this.leveNum = 0;
  8619. this.extraScore = 0;
  8620. this.selfTurn = false;
  8621. this.playedLastSkill = false;
  8622. this.tweenArr = [];
  8623. this._finishNum = 0;
  8624. this._curFinish = 0;
  8625. this._rootX = 0;
  8626. this._rootY = 0;
  8627. this.knifeTimes = 0;
  8628. this.knifeV2 = new Laya.Vector2();
  8629. this.knifeV3 = new Laya.Vector3();
  8630. this.rtStarX = 0;
  8631. this.rtStarY = 0;
  8632. this.addBigSkillSpine();
  8633. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8634. }
  8635. addBigSkillSpine() {
  8636. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8637. console.log("extra2 success");
  8638. });
  8639. }
  8640. runBigSkill(callback) {
  8641. this.tweenArr = [];
  8642. this.callback = callback;
  8643. this.judgeSkill();
  8644. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8645. let guide = DataMgr.getSkillGuide();
  8646. if (!xGame.common.gameMgr.selfTurn) {
  8647. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8648. }
  8649. else {
  8650. if (xGame.common.temSelfLevel != 0) {
  8651. this.leveNum = xGame.common.temSelfLevel;
  8652. }
  8653. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8654. this.leveNum += 5;
  8655. }
  8656. }
  8657. if (guide == 0) {
  8658. DataMgr.setSkillGuide(1);
  8659. if (DataMgr.getNewUser()) {
  8660. Moyu.sendDataEvent("gameFirstPlay");
  8661. DataMgr.setNewUser();
  8662. }
  8663. }
  8664. this.playSpineAni(() => {
  8665. switch (this.curSkill) {
  8666. case SkillType.highSpace:
  8667. this.runHighSpace();
  8668. break;
  8669. case SkillType.breakArmy:
  8670. this.runBreakArmy();
  8671. break;
  8672. case SkillType.ice:
  8673. this.runIce();
  8674. break;
  8675. case SkillType.fireworks:
  8676. this.runFireworks();
  8677. break;
  8678. case SkillType.GuanYu:
  8679. this.runGuanYu();
  8680. break;
  8681. default:
  8682. break;
  8683. }
  8684. });
  8685. }
  8686. judgeSkill() {
  8687. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8688. let gameMgr = xGame.common.gameMgr;
  8689. let type;
  8690. for (let index = 0; index < typeArr.length; index++) {
  8691. type = typeArr[index];
  8692. if (gameMgr.selfTurn) {
  8693. if (gameMgr.selfCurSkill == type) {
  8694. this.selfTurn = true;
  8695. this.curSkill = type;
  8696. return;
  8697. }
  8698. }
  8699. else {
  8700. if (gameMgr.aiCurSkill == type) {
  8701. this.selfTurn = false;
  8702. this.curSkill = type;
  8703. return;
  8704. }
  8705. }
  8706. }
  8707. }
  8708. playSpineAni(callback) {
  8709. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8710. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8711. parent.destroyChildren();
  8712. let aniIndex = 0;
  8713. let skillSpine;
  8714. switch (this.curSkill) {
  8715. case SkillType.highSpace:
  8716. aniIndex = 1;
  8717. xGame.soundMgr.playSound("skill01");
  8718. skillSpine = this.skillSpine2;
  8719. data.scaleX = 0.5;
  8720. data.scaleY = 0.5;
  8721. skillSpine.play(data, 1, false, parent, () => {
  8722. callback && callback();
  8723. });
  8724. break;
  8725. case SkillType.breakArmy:
  8726. aniIndex = 2;
  8727. xGame.soundMgr.playSound("skill02");
  8728. skillSpine = this.skillSpine2;
  8729. data.scaleX = 0.5;
  8730. data.scaleY = 0.5;
  8731. skillSpine.play(data, 2, false, parent, () => {
  8732. callback && callback();
  8733. });
  8734. break;
  8735. case SkillType.ice:
  8736. aniIndex = 0;
  8737. xGame.soundMgr.playSound("skill03");
  8738. skillSpine = this.skillSpine2;
  8739. data.scaleX = 0.5;
  8740. data.scaleY = 0.5;
  8741. skillSpine.play(data, 0, false, parent, () => {
  8742. callback && callback();
  8743. });
  8744. break;
  8745. case SkillType.fireworks:
  8746. xGame.soundMgr.playSound("skill_04_01");
  8747. xGame.soundMgr.playSound("skill04");
  8748. xGame.uiMgr.Show(UIFireworks, callback);
  8749. break;
  8750. case SkillType.GuanYu:
  8751. xGame.soundMgr.playSound("skill05_1");
  8752. xGame.soundMgr.playSound("skill05");
  8753. xGame.uiMgr.Show(UIGuanYu, callback);
  8754. break;
  8755. default:
  8756. break;
  8757. }
  8758. }
  8759. getAllBallArr() {
  8760. let arr = xGame.common.d2World.ballArr;
  8761. let outArr = [];
  8762. for (let index = 0; index < arr.length; index++) {
  8763. if (arr[index] instanceof D2RootBallSrc)
  8764. continue;
  8765. if (arr[index].ballFunc == "ice")
  8766. continue;
  8767. if (arr[index].destroyed)
  8768. continue;
  8769. outArr.push(arr[index]);
  8770. }
  8771. return outArr;
  8772. }
  8773. getOneArr(deletObj) {
  8774. let allArr = this.getAllBallArr();
  8775. let temp;
  8776. for (let index = 0; index < allArr.length; index++) {
  8777. temp = allArr[index];
  8778. if (temp.id == deletObj.id) {
  8779. allArr.splice(index, 1);
  8780. break;
  8781. }
  8782. }
  8783. return allArr;
  8784. }
  8785. getNearBallBag(ball) {
  8786. let ui = xGame.common.gameUI.ui;
  8787. let circleArr = [];
  8788. for (let index = 1; index <= 6; index++) {
  8789. circleArr.push(ui.border["circle" + index]);
  8790. }
  8791. let outIndex = 0;
  8792. let temp;
  8793. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8794. ;
  8795. let dis = 0;
  8796. for (let index = 1; index < circleArr.length; index++) {
  8797. temp = circleArr[index];
  8798. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8799. if (dis < min) {
  8800. min = dis;
  8801. outIndex = index;
  8802. }
  8803. }
  8804. return [circleArr[outIndex], outIndex];
  8805. }
  8806. ballFlyToBag(ballArr, time = 300) {
  8807. let temp;
  8808. let hole;
  8809. this._finishNum = ballArr.length;
  8810. this._curFinish = 0;
  8811. let holeObj = {};
  8812. let holeCfg = {
  8813. "1": 0,
  8814. "2": 0,
  8815. "3": 0,
  8816. "4": 0,
  8817. "5": 0,
  8818. "6": 0
  8819. };
  8820. for (let index = 0; index < ballArr.length; index++) {
  8821. temp = ballArr[index];
  8822. temp.outColli.isSensor = true;
  8823. temp.innerColli.isSensor = true;
  8824. temp.isRunSkillAni = true;
  8825. let holeArr = this.getNearBallBag(temp);
  8826. hole = holeArr[0];
  8827. holeObj[index] = holeArr[1];
  8828. temp.d3BallSrc.scaleXYZ = 0.5;
  8829. this.tweenArr.push(temp.d3BallSrc, temp);
  8830. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8831. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8832. }));
  8833. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8834. let mIndex = holeObj[this._curFinish];
  8835. let isDone = holeCfg[mIndex];
  8836. if (isDone) {
  8837. ballArr[this._curFinish].checkWrongBall(false);
  8838. }
  8839. else {
  8840. holeCfg[mIndex] = 1;
  8841. ballArr[this._curFinish].checkWrongBall();
  8842. }
  8843. this._curFinish++;
  8844. if (this._curFinish >= this._finishNum) {
  8845. if (this.curSkill == SkillType.highSpace) {
  8846. }
  8847. else if (this.curSkill == SkillType.breakArmy) {
  8848. let rootBall = xGame.common.d2World.rootBall;
  8849. rootBall.gameObj.x = this._rootX;
  8850. rootBall.gameObj.y = this._rootY;
  8851. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8852. xGame.common.d2World.d2Gan.ui.visible = true;
  8853. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8854. xGame.common.d2World.getHelpLine();
  8855. this.callback && this.callback(this.extraScore);
  8856. }
  8857. }
  8858. }));
  8859. }
  8860. }
  8861. runHighSpace() {
  8862. let rootBall = xGame.common.d2World.rootBall;
  8863. rootBall.showSelf();
  8864. let d3Src = rootBall.d3BallSrc;
  8865. let allArr = this.getAllBallArr();
  8866. if (allArr.length <= 0) {
  8867. this.callback && this.callback(0);
  8868. return;
  8869. }
  8870. let selectBall = xGame.common.d2World.targetBall;
  8871. let wrong = selectBall && selectBall.destroyed;
  8872. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8873. selectBall = xGame.common.getRandArrEle(allArr);
  8874. }
  8875. let targetD3Src = selectBall.d3BallSrc;
  8876. xGame.common.d2World.d2Gan.ui.visible = false;
  8877. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8878. d3Src.scaleXYZ = 0.5;
  8879. this.tweenArr.push(d3Src);
  8880. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8881. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8882. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8883. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8884. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8885. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8886. let outArr = [selectBall];
  8887. let other = this.leveNum - 1;
  8888. if (other > 0) {
  8889. let nearArr = this.getOneArr(selectBall);
  8890. if (nearArr.length > 0) {
  8891. xGame.common.botherArr(nearArr);
  8892. if (other >= nearArr.length)
  8893. other = nearArr.length;
  8894. for (let index = 0; index < other; index++) {
  8895. outArr.push(nearArr[index]);
  8896. }
  8897. }
  8898. }
  8899. xGame.common.extraMoveNum = other + 1;
  8900. this.extraScore = other + 1;
  8901. this._rootX = selectBall.gameObj.x;
  8902. this._rootY = selectBall.gameObj.y;
  8903. rootBall.gameObj.x = this._rootX;
  8904. rootBall.gameObj.y = this._rootY;
  8905. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8906. Laya.Tween.clearAll(d3Src);
  8907. this.addRandomForce(outArr);
  8908. }));
  8909. }));
  8910. }
  8911. addRandomForce(outArr) {
  8912. if (outArr.length > 0) {
  8913. xGame.common.d2World.openCheckStill = true;
  8914. this.playedLastSkill = true;
  8915. }
  8916. let temp;
  8917. for (let index = 0; index < outArr.length; index++) {
  8918. let angle = xGame.common.randomNum(0, 360);
  8919. let linearPercent = xGame.common.randomNum(65, 100);
  8920. temp = outArr[index];
  8921. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8922. }
  8923. }
  8924. setLinearSpeed(angle, rigy, linearPercent) {
  8925. let sin = Math.sin(angle * Math.PI / 180);
  8926. let cos = Math.cos(angle * Math.PI / 180);
  8927. let maxSpeed = 4;
  8928. let speed = new Laya.Vector2();
  8929. speed.x = maxSpeed * linearPercent * sin;
  8930. speed.y = -maxSpeed * linearPercent * cos;
  8931. rigy.applyLinearImpulseToCenter(speed);
  8932. }
  8933. runBreakArmy() {
  8934. xGame.common.d2World.d2Gan.ui.visible = false;
  8935. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8936. let gameUI = xGame.common.gameUI.ui;
  8937. gameUI.skillRod.visible = true;
  8938. gameUI.skillRod.rotation = 110;
  8939. let outArr = this.getAllBallArr();
  8940. if (outArr.length <= 0) {
  8941. gameUI.skillRod.visible = false;
  8942. this.callback && this.callback(0);
  8943. return;
  8944. }
  8945. xGame.common.botherArr(outArr);
  8946. if (this.leveNum >= outArr.length)
  8947. this.leveNum = outArr.length;
  8948. let deleteNum = outArr.length - this.leveNum;
  8949. outArr.splice(0, deleteNum);
  8950. this.extraScore = this.leveNum;
  8951. let potX = gameUI.skillRod.x;
  8952. let potY = gameUI.skillRod.y;
  8953. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8954. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8955. let disArr = [];
  8956. for (let index = 0; index < outArr.length; index++) {
  8957. let obj = outArr[index];
  8958. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8959. dis = Math.pow(dis, 0.5);
  8960. disArr.push(dis);
  8961. }
  8962. this.tweenArr.push(gameUI.skillRod);
  8963. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8964. })).update = Laya.Handler.create(this, (e, t, c) => {
  8965. let angle = gameUI.skillRod.rotation;
  8966. let xx;
  8967. let yy;
  8968. let temp;
  8969. for (let index = 0; index < outArr.length; index++) {
  8970. temp = outArr[index];
  8971. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8972. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8973. yy -= 20;
  8974. temp.gameObj.x = xx;
  8975. temp.gameObj.y = yy;
  8976. temp.d3BallSrc.setTransPos(xx, yy);
  8977. }
  8978. if (angle <= 60) {
  8979. Laya.Tween.clearAll(gameUI.skillRod);
  8980. this.ballFlyToBag(outArr, 150);
  8981. gameUI.skillRod.visible = false;
  8982. }
  8983. }, null, false);
  8984. }
  8985. runIce() {
  8986. let ballArr = xGame.common.d2World.ballArr;
  8987. this.leveNum *= 2;
  8988. if (this.leveNum >= ballArr.length - 1)
  8989. this.leveNum = ballArr.length - 1;
  8990. let tempArr = [];
  8991. let outArr = [];
  8992. for (let index = 0; index < ballArr.length; index++) {
  8993. if (ballArr[index] instanceof D2RootBallSrc)
  8994. continue;
  8995. tempArr.push(ballArr[index]);
  8996. }
  8997. if (tempArr.length <= 0) {
  8998. this.callback && this.callback(0);
  8999. return;
  9000. }
  9001. xGame.common.botherArr(tempArr);
  9002. for (let index = 0; index < this.leveNum; index++) {
  9003. outArr.push(tempArr[index]);
  9004. }
  9005. this.extraScore = this.leveNum;
  9006. let temp;
  9007. for (let index = 0; index < outArr.length; index++) {
  9008. temp = outArr[index];
  9009. temp.d3BallSrc.playIceEft();
  9010. }
  9011. Laya.timer.once(2000, this, () => {
  9012. for (let index = 0; index < outArr.length; index++) {
  9013. temp = outArr[index];
  9014. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9015. temp.setBallFunc("ice", str);
  9016. }
  9017. this.callback && this.callback(0);
  9018. });
  9019. }
  9020. runFireworks() {
  9021. let allArr = this.getAllBallArr();
  9022. if (allArr.length <= 0) {
  9023. this.callback && this.callback(0);
  9024. return;
  9025. }
  9026. xGame.common.d2World.d2Gan.ui.visible = false;
  9027. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9028. let outArr = [];
  9029. let other = this.leveNum;
  9030. if (other > 0) {
  9031. if (allArr.length > 0) {
  9032. xGame.common.botherArr(allArr);
  9033. if (other >= allArr.length)
  9034. other = allArr.length;
  9035. for (let index = 0; index < other; index++) {
  9036. outArr.push(allArr[index]);
  9037. }
  9038. }
  9039. }
  9040. xGame.common.extraMoveNum = other;
  9041. this.extraScore = other;
  9042. this.addRandmomFireworks(outArr);
  9043. }
  9044. addRandmomFireworks(outArr) {
  9045. Laya.timer.once(1100, this, () => {
  9046. if (outArr.length > 0) {
  9047. xGame.common.d2World.openCheckStill = true;
  9048. this.playedLastSkill = true;
  9049. }
  9050. });
  9051. xGame.soundMgr.playSound("skill_04_02");
  9052. let temp;
  9053. let delay = -200;
  9054. for (let index = 0; index < outArr.length; index++) {
  9055. temp = outArr[index];
  9056. delay += 200;
  9057. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9058. let angle = xGame.common.randomNum(0, 360);
  9059. angle = this.getFireworksAngle(obj);
  9060. let linearPercent = xGame.common.randomNum(45, 80);
  9061. if (!obj.destroyed)
  9062. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9063. });
  9064. }
  9065. }
  9066. getFireworksAngle(obj) {
  9067. let rootBall = xGame.common.d2World.rootBall;
  9068. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9069. }
  9070. resetGame() {
  9071. Laya.timer.clearAll(this);
  9072. if (this.tweenArr) {
  9073. for (let index = 0; index < this.tweenArr.length; index++) {
  9074. Laya.Tween.clearAll(this.tweenArr[index]);
  9075. }
  9076. }
  9077. this.tweenArr = null;
  9078. }
  9079. runGuanYu() {
  9080. xGame.common.d2World.d2Gan.ui.visible = false;
  9081. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9082. let rootBall = xGame.common.d2World.rootBall;
  9083. if (rootBall.isInHole) {
  9084. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9085. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9086. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9087. rootBall.showSelf();
  9088. }
  9089. this.rtStarX = rootBall.gameObj.x;
  9090. this.rtStarY = rootBall.gameObj.y;
  9091. this.knifeTimes = 0;
  9092. this.playedLastSkill = true;
  9093. rootBall.forceRun = true;
  9094. rootBall.rigy.type = "static";
  9095. xGame.common.d2World.openCheckStill = true;
  9096. this.guanyuRandomKnife();
  9097. }
  9098. guanyuRandomKnife() {
  9099. let rootBall = xGame.common.d2World.rootBall;
  9100. let dir = this.getRandDir();
  9101. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9102. console.log("当前angle", angle);
  9103. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9104. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9105. let dis = 324;
  9106. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9107. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9108. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9109. this.rtStarX = rootBall.gameObj.x;
  9110. this.rtStarY = rootBall.gameObj.y;
  9111. this.knifeTimes++;
  9112. let skillLevel;
  9113. if (xGame.common.gameMgr.selfTurn) {
  9114. skillLevel = DataMgr.getBigSkillByIndex(4);
  9115. }
  9116. else {
  9117. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9118. }
  9119. if (!skillLevel)
  9120. skillLevel = 1;
  9121. skillLevel += 2;
  9122. if (this.knifeTimes < skillLevel) {
  9123. Laya.timer.once(400, this, () => {
  9124. this.guanyuRandomKnife();
  9125. });
  9126. }
  9127. else {
  9128. rootBall.forceRun = false;
  9129. rootBall.rigy.type = "dynamic";
  9130. xGame.common.extraMoveNum = skillLevel;
  9131. }
  9132. }));
  9133. }
  9134. getRandDir() {
  9135. let rootBall = xGame.common.d2World.rootBall;
  9136. let allBall = this.getAllBallArr();
  9137. let target = xGame.common.getRandArrEle(allBall);
  9138. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9139. return this.knifeV2;
  9140. }
  9141. cloneKnife(x, y, rotation) {
  9142. let parent = xGame.common.d3World.knifeRoot;
  9143. let prefab = xGame.common.d3World.knife;
  9144. let clone = prefab.clone();
  9145. parent.addChild(clone);
  9146. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9147. clone.transform.localPositionX = this.knifeV3.x;
  9148. clone.transform.localPositionY = 0;
  9149. clone.transform.localPositionZ = this.knifeV3.z;
  9150. clone.transform.localRotationEulerX = 0;
  9151. clone.transform.localRotationEulerY = rotation;
  9152. clone.transform.localRotationEulerZ = 0;
  9153. clone.active = true;
  9154. return clone;
  9155. }
  9156. cloneGuanYuEft(x, y, angle) {
  9157. return;
  9158. let parent = xGame.common.gameUI.ui.guanyuNode;
  9159. let eft = new ui_guanyuAni();
  9160. eft.parent = parent;
  9161. eft.x = x;
  9162. eft.y = y;
  9163. eft.rotation = angle;
  9164. }
  9165. }
  9166. class ui_UIWordsList extends fgui.GComponent {
  9167. static createInstance() {
  9168. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9169. }
  9170. onConstruct() {
  9171. this.c1 = this.getController("c1");
  9172. this.n74 = (this.getChild("n74"));
  9173. this.clickNode = (this.getChild("clickNode"));
  9174. this.myNode = (this.getChild("myNode"));
  9175. this.n68 = (this.getChild("n68"));
  9176. this.n66 = (this.getChild("n66"));
  9177. this.n55 = (this.getChild("n55"));
  9178. this.wordsBtn = (this.getChild("wordsBtn"));
  9179. this.emotionBtn = (this.getChild("emotionBtn"));
  9180. this.mybggg = (this.getChild("mybggg"));
  9181. this.wordsList = (this.getChild("wordsList"));
  9182. this.emotionList = (this.getChild("emotionList"));
  9183. this.myRoot = (this.getChild("myRoot"));
  9184. }
  9185. }
  9186. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  9187. class EmotionDisplay {
  9188. constructor(index, ui) {
  9189. this.ui = ui;
  9190. this.index = index;
  9191. this.ui.onClick(this, this.clickSelf);
  9192. this.updateSelf();
  9193. }
  9194. updateSelf() {
  9195. let data = cfgTable.emotionData[this.index + 1];
  9196. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  9197. }
  9198. clickSelf() {
  9199. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9200. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  9201. xGame.common.talkMgr.closeTalkView();
  9202. }
  9203. }
  9204. class WordsDisplay {
  9205. constructor(index, ui) {
  9206. this.ui = ui;
  9207. this.index = index;
  9208. this.ui.onClick(this, this.clickSelf);
  9209. this.updateSelf();
  9210. }
  9211. updateSelf() {
  9212. let data = cfgTable.talkwordsData[this.index + 1];
  9213. this.ui.txt.text = data.msg;
  9214. }
  9215. clickSelf() {
  9216. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9217. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  9218. xGame.common.talkMgr.closeTalkView();
  9219. }
  9220. }
  9221. class UIWordsList extends UIBase {
  9222. constructor() {
  9223. super();
  9224. }
  9225. onConstructor() {
  9226. this.ui = ui_UIWordsList.createInstance();
  9227. this.contentPane = this.ui;
  9228. this.isEject = false;
  9229. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  9230. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  9231. this.addUIClick(this.ui.clickNode, this.hide);
  9232. this.initTalkList();
  9233. this.initEmotionList();
  9234. }
  9235. show() {
  9236. super.show();
  9237. }
  9238. initTalkList() {
  9239. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  9240. let data = cfgTable.talkwordsData;
  9241. let length = Object.keys(data).length;
  9242. this.ui.wordsList.numItems = length;
  9243. }
  9244. initEmotionList() {
  9245. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  9246. let data = cfgTable.emotionData;
  9247. let length = Object.keys(data).length;
  9248. this.ui.emotionList.numItems = length;
  9249. }
  9250. renderTalkItem(index, obj) {
  9251. let temp = new WordsDisplay(index, obj);
  9252. }
  9253. renderEmotionItem(index, obj) {
  9254. let temp = new EmotionDisplay(index, obj);
  9255. }
  9256. openTalkList() {
  9257. this.ui.c1.selectedIndex = 0;
  9258. }
  9259. openEmotionList() {
  9260. this.ui.c1.selectedIndex = 1;
  9261. }
  9262. }
  9263. UIWordsList.uiName = "UIWordsList";
  9264. class TalkMgr {
  9265. constructor() {
  9266. this.aiSpeak = true;
  9267. this.emotionList = [];
  9268. this.talkList = [];
  9269. this.addEvent();
  9270. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9271. this.emotionList = [];
  9272. this.talkList = [];
  9273. for (let k in cfgTable.emotionData) {
  9274. this.emotionList.push(cfgTable.emotionData[k].id);
  9275. }
  9276. for (let k in cfgTable.talkwordsData) {
  9277. this.talkList.push(cfgTable.talkwordsData[k].id);
  9278. }
  9279. }
  9280. addEvent() {
  9281. let ui = xGame.common.gameUI.ui;
  9282. ui.wordsBtn.visible = true;
  9283. ui.wordsBtn.onClick(this, this.openTalkView);
  9284. ui.aiWordsBtn.visible = true;
  9285. ui.aiWordsBtn.onClick(this, this.clickAIState);
  9286. }
  9287. openTalkView() {
  9288. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9289. xGame.uiMgr.Show(UIWordsList);
  9290. }
  9291. closeTalkView() {
  9292. xGame.uiMgr.Hide(UIWordsList);
  9293. }
  9294. clickAIState() {
  9295. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9296. this.aiSpeak = !this.aiSpeak;
  9297. this.changeAIState(this.aiSpeak);
  9298. }
  9299. changeAIState(speak) {
  9300. this.aiSpeak = speak;
  9301. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  9302. if (speak) {
  9303. btn.c1.selectedIndex = 0;
  9304. }
  9305. else {
  9306. btn.c1.selectedIndex = 1;
  9307. }
  9308. }
  9309. showSelfTalk(wordsId) {
  9310. let ui = xGame.common.gameUI.ui;
  9311. ui.selfTalk.visible = true;
  9312. ui.selfTalk.myNode.c1.selectedIndex = 1;
  9313. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9314. ui.selfTalk.t0.play();
  9315. }
  9316. showSelfEmotion(emotionId) {
  9317. let ui = xGame.common.gameUI.ui;
  9318. ui.selfTalk.visible = true;
  9319. ui.selfTalk.myNode.c1.selectedIndex = 0;
  9320. this.selfSpine && this.selfSpine.dispose();
  9321. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9322. let spineData = cfgTable.emotionData[emotionId].spine;
  9323. this.selfSpine = new SpineMgr(spineData, () => {
  9324. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  9325. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  9326. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9327. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  9328. });
  9329. ui.selfTalk.t0.play();
  9330. }
  9331. showAITalk(wordsId) {
  9332. if (!this.aiSpeak)
  9333. return;
  9334. if (DataMgr.gameData.gameCount < 2)
  9335. return;
  9336. if (wordsId < 1)
  9337. wordsId = this.getRandTalk();
  9338. let ui = xGame.common.gameUI.ui;
  9339. ui.aiTalk.visible = true;
  9340. ui.aiTalk.myNode.c1.selectedIndex = 1;
  9341. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9342. ui.aiTalk.t0.play();
  9343. }
  9344. getRandTalk() {
  9345. let rand = xGame.tools.random(0, this.talkList.length);
  9346. return this.emotionList[rand];
  9347. }
  9348. getRandEmotion() {
  9349. let rand = xGame.tools.random(0, this.emotionList.length);
  9350. return this.emotionList[rand];
  9351. }
  9352. showAIEmotion(emotionId) {
  9353. if (!this.aiSpeak)
  9354. return;
  9355. if (DataMgr.gameData.gameCount < 2)
  9356. return;
  9357. if (emotionId < 1)
  9358. emotionId = this.getRandEmotion();
  9359. let ui = xGame.common.gameUI.ui;
  9360. ui.aiTalk.visible = true;
  9361. ui.aiTalk.myNode.c1.selectedIndex = 0;
  9362. this.aiSpine && this.aiSpine.dispose();
  9363. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9364. let spineData = cfgTable.emotionData[emotionId].spine;
  9365. this.aiSpine = new SpineMgr(spineData, () => {
  9366. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  9367. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  9368. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9369. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  9370. });
  9371. ui.aiTalk.t0.play();
  9372. }
  9373. resetGame() {
  9374. let ui = xGame.common.gameUI.ui;
  9375. ui.aiTalk.visible = false;
  9376. ui.selfTalk.visible = false;
  9377. this.aiSpine && this.aiSpine.dispose();
  9378. this.selfSpine && this.selfSpine.dispose();
  9379. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9380. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9381. this.closeTalkView();
  9382. }
  9383. }
  9384. class WordsMgr {
  9385. constructor() {
  9386. this.comboTimes = 1;
  9387. this.skillTimes = 0;
  9388. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  9389. this.comboSpine = new SpineMgr("yxz_liangan");
  9390. this.skillSpine = new SpineMgr("yiganxqiu");
  9391. this.scoreSpine = new SpineMgr("defen");
  9392. }
  9393. setClassicCombo(isInterrupt) {
  9394. if (isInterrupt) {
  9395. this.comboTimes = 0;
  9396. }
  9397. }
  9398. playClassicWords(type, callback) {
  9399. this.callback = callback;
  9400. let aniIndex = type;
  9401. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9402. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9403. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9404. mySpine.destroy(true);
  9405. this.playClassicTimes();
  9406. });
  9407. }
  9408. playClassicTimes() {
  9409. this.comboTimes++;
  9410. if (this.comboTimes <= 1) {
  9411. this.callback && this.callback();
  9412. }
  9413. else {
  9414. let aniIndex = this.comboTimes - 1;
  9415. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9416. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9417. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9418. mySpine.destroy(true);
  9419. this.callback && this.callback();
  9420. });
  9421. }
  9422. }
  9423. playBigSkillTimes(times, callback) {
  9424. if (times <= 0) {
  9425. callback && callback();
  9426. return;
  9427. }
  9428. this.callback = callback;
  9429. let pre = "sz_0";
  9430. let aniIndex = 0;
  9431. this.getWordsImg(times, pre, () => {
  9432. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9433. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9434. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9435. let r1 = ``;
  9436. let r2 = ``;
  9437. if (times <= 9) {
  9438. r1 = `res/d2Res/${pre}${times}.png`;
  9439. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9440. aniIndex = 0;
  9441. }
  9442. else {
  9443. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9444. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9445. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9446. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9447. aniIndex = 1;
  9448. }
  9449. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9450. mySpine.destroy(true);
  9451. xGame.common.gameMgr.playSkillTips();
  9452. this.playScore(times);
  9453. xGame.common.playRandomMutiBallBigSkillSound();
  9454. }, mySpine);
  9455. });
  9456. }
  9457. playScore(score) {
  9458. let pre = "sz_";
  9459. let aniIndex = 0;
  9460. this.getWordsImg(score, pre, () => {
  9461. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9462. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9463. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9464. let r1 = ``;
  9465. let r2 = ``;
  9466. if (score <= 9) {
  9467. r1 = `res/d2Res/${pre}${score}.png`;
  9468. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9469. aniIndex = 0;
  9470. }
  9471. else {
  9472. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9473. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9474. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9475. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9476. aniIndex = 1;
  9477. }
  9478. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9479. mySpine.destroy(true);
  9480. this.callback && this.callback();
  9481. }, mySpine);
  9482. });
  9483. }
  9484. getWordsImg(number, pre = "", callback) {
  9485. let arr = [];
  9486. if (number <= 9) {
  9487. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9488. }
  9489. else {
  9490. 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 });
  9491. }
  9492. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9493. callback && callback();
  9494. }));
  9495. }
  9496. }
  9497. class ui_UIRodMethod extends fgui.GComponent {
  9498. static createInstance() {
  9499. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9500. }
  9501. onConstruct() {
  9502. this.n24 = (this.getChild("n24"));
  9503. this.white = (this.getChild("white"));
  9504. this.dot = (this.getChild("dot"));
  9505. this.sureBtn = (this.getChild("sureBtn"));
  9506. this.n20 = (this.getChild("n20"));
  9507. this.n21 = (this.getChild("n21"));
  9508. this.n22 = (this.getChild("n22"));
  9509. this.n23 = (this.getChild("n23"));
  9510. this.n5 = (this.getChild("n5"));
  9511. this.n14 = (this.getChild("n14"));
  9512. this.t0 = this.getTransition("t0");
  9513. }
  9514. }
  9515. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9516. class UIRodMethod extends UIBase {
  9517. constructor() {
  9518. super();
  9519. this.isPressd = false;
  9520. }
  9521. onConstructor() {
  9522. this.ui = ui_UIRodMethod.createInstance();
  9523. this.contentPane = this.ui;
  9524. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9525. this.moveDir = new Laya.Vector2();
  9526. this.moveDest = new Laya.Vector2();
  9527. this.centerPos = new Laya.Vector2();
  9528. xGame.common.uiRodMethod = this;
  9529. }
  9530. show() {
  9531. super.show();
  9532. xGame.common.gameMgr.gamePause = true;
  9533. this.openPressDotEvent();
  9534. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9535. this.centerPos.x = this.ui.white.x;
  9536. this.centerPos.y = this.ui.white.y;
  9537. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9538. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9539. this.setDot();
  9540. }
  9541. setDot() {
  9542. this.ui.dot.x = this.moveDest.x;
  9543. this.ui.dot.y = this.moveDest.y;
  9544. }
  9545. closeSelf() {
  9546. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9547. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9548. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9549. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9550. xGame.common.gameMgr.gamePause = false;
  9551. this.hide();
  9552. }
  9553. openPressDotEvent() {
  9554. this.closePressDotEvent();
  9555. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9556. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9557. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9558. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9559. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9560. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9561. }
  9562. closePressDotEvent() {
  9563. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9564. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9565. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9566. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9567. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9568. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9569. }
  9570. onDown(e) {
  9571. if (e.type == Laya.Event.MOUSE_DOWN)
  9572. this.isPressd = true;
  9573. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9574. this.isPressd = false;
  9575. if (!this.isPressd)
  9576. return;
  9577. this.moveDest.x = e.stageX;
  9578. this.moveDest.y = e.stageY;
  9579. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9580. if (dis > 6724) {
  9581. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9582. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9583. }
  9584. this.setDot();
  9585. }
  9586. resetRod() {
  9587. this.ui.dot.x = this.ui.white.x;
  9588. this.ui.dot.y = this.ui.white.y;
  9589. this.gameRod.dot.x = this.gameRod.bg.x;
  9590. this.gameRod.dot.y = this.gameRod.bg.y;
  9591. xGame.common.rodOffest.x = 0;
  9592. xGame.common.rodOffest.y = 0;
  9593. }
  9594. }
  9595. UIRodMethod.uiName = "UIRodMethod";
  9596. class UIGame extends UIBase {
  9597. constructor() {
  9598. super();
  9599. this.powerNum = 0;
  9600. this.isD3Inited = false;
  9601. this.isPrePlay = false;
  9602. this.isMoveRod = false;
  9603. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9604. this.rulerDis = 20;
  9605. this.rulerOffset = 0;
  9606. }
  9607. onConstructor() {
  9608. this.ui = ui_UIGame.createInstance();
  9609. this.contentPane = this.ui;
  9610. this.ui.x += xGame.common.sysOffestNum;
  9611. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9612. this.isEject = false;
  9613. xGame.common.gameUI = this;
  9614. this.initSelf();
  9615. }
  9616. isTurnSelf() {
  9617. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9618. return true;
  9619. }
  9620. }
  9621. initSelf() {
  9622. let topUI = this.ui.topNode;
  9623. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9624. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9625. this.barInfo = {};
  9626. this.barInfo.curY = 0;
  9627. this.barInfo.height = this.ui.powerNode.height;
  9628. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9629. this.barInfo.powerStartY = this.ui.powerNode.y;
  9630. xGame.common.aiPlayer = new AIPlayer();
  9631. xGame.common.gameMgr = new GameMgr();
  9632. xGame.common.skillMgr = new SkillMgr();
  9633. xGame.common.wordsMgr = new WordsMgr();
  9634. xGame.common.talkMgr = new TalkMgr();
  9635. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9636. console.log("加载经典模式表情文件chenggon !");
  9637. });
  9638. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9639. console.log("挑战模式奖励模式spine加载成功!");
  9640. });
  9641. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9642. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9643. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9644. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9645. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9646. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9647. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9648. }
  9649. returnHome() {
  9650. let tips = "Are you sure to exit the game?";
  9651. let woman = "Boss, why don't you play for a while longer?";
  9652. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9653. }
  9654. addRodMethodClick() {
  9655. if (this.isTurnSelf()) {
  9656. xGame.uiMgr.Show(UIRodMethod);
  9657. }
  9658. }
  9659. clickHelpLineBtn(force = false) {
  9660. if (!this.isTurnSelf())
  9661. return;
  9662. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9663. if (success) {
  9664. xGame.common.longHelpLine = true;
  9665. xGame.common.d2World.getHelpLine();
  9666. Moyu.sendDataEvent("guideNum");
  9667. }
  9668. else {
  9669. }
  9670. });
  9671. }
  9672. renderSelfDisplayBalls(index, target) {
  9673. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9674. target.myImg.url = xGame.common.getGameIconUrl(str);
  9675. }
  9676. renderAIDisplayBalls(index, target) {
  9677. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9678. target.myImg.url = xGame.common.getGameIconUrl(str);
  9679. ;
  9680. }
  9681. updateMode() {
  9682. if (xGame.common.gameMode == GameMode.classic) {
  9683. this.ui.topNode.scoreNode.visible = false;
  9684. }
  9685. else if (xGame.common.gameMode == GameMode.bigMove) {
  9686. this.ui.topNode.scoreNode.visible = true;
  9687. }
  9688. }
  9689. show() {
  9690. super.show();
  9691. console.log("zh:uigame show");
  9692. this.ui.alpha = 0;
  9693. this.updateSelf();
  9694. console.log("zh:uigame bf gamemusic01 start");
  9695. xGame.soundMgr.playMusic("gamemusic01");
  9696. console.log("zh:uigame bf gamemusic01 end");
  9697. xGame.common.gameMgr.gamePause = false;
  9698. xGame.common.gameUI.ui.blackAni.visible = false;
  9699. xGame.common.gameUI.ui.whiteAni.visible = false;
  9700. this.ui.powerEft.visible = false;
  9701. this.ui.colorNode.visible = false;
  9702. this.updateHead();
  9703. }
  9704. updateSelf() {
  9705. if (xGame.common.gameMode == GameMode.classic) {
  9706. this.ui.c1.selectedIndex = 0;
  9707. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9708. this.ui.topNode.middleNode.visible = true;
  9709. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9710. }
  9711. else if (xGame.common.gameMode == GameMode.bigMove) {
  9712. this.ui.c1.selectedIndex = 0;
  9713. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9714. this.ui.topNode.middleNode.visible = false;
  9715. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9716. let rand = xGame.common.randomNum(1, max);
  9717. let guide = DataMgr.getSkillGuide();
  9718. if (guide == 0)
  9719. rand = 1;
  9720. xGame.common.bigMoveLevelIndex = rand;
  9721. }
  9722. else if (xGame.common.gameMode == GameMode.placeBall) {
  9723. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9724. this.ui.c1.selectedIndex = 1 + data.type;
  9725. this.ui.alpha = 1;
  9726. this.startGame();
  9727. }
  9728. this.updateMode();
  9729. this.initD3world();
  9730. this.initD2world();
  9731. }
  9732. startGame() {
  9733. this.ui.snowNode.visible = Math.random() <= 0.1;
  9734. this.ui.d2Node.visible = false;
  9735. xGame.common.d3World.d3Hand.gameObj.active = false;
  9736. xGame.common.d3World.tableSrc.init();
  9737. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9738. this.cameraViewChange(() => {
  9739. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9740. switch (xGame.common.gameMode) {
  9741. case GameMode.classic:
  9742. xGame.common.d3World.d3Hand.gameObj.active = true;
  9743. this.playPutBallD3Ani();
  9744. break;
  9745. case GameMode.bigMove:
  9746. this.enterGame();
  9747. Laya.timer.once(500, this, () => {
  9748. this.ui.topNode.middleNode.visible = true;
  9749. this.ui.topNode.middleNode.t0.play();
  9750. });
  9751. break;
  9752. case GameMode.placeBall:
  9753. this.enterGame();
  9754. break;
  9755. default:
  9756. break;
  9757. }
  9758. });
  9759. PlatMgr.showBanner(false);
  9760. }
  9761. enterGame() {
  9762. this.ui.d2Node.visible = true;
  9763. xGame.common.d3World.d3Hand.gameObj.active = false;
  9764. xGame.common.showOneCamera("mainCamera");
  9765. Moyu.recordGame(30, true);
  9766. if (!this.isPrePlay) {
  9767. this.isPrePlay = true;
  9768. xGame.common.d3World.prePlayEft();
  9769. }
  9770. xGame.common.gameMgr.gameReady();
  9771. this.openAllEvent();
  9772. this.ui.snowNode.visible = false;
  9773. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9774. this.ui.helpBtn.visible = condition;
  9775. }
  9776. showHelpLineGuide() {
  9777. let longGuide = DataMgr.getGuideHelpLine();
  9778. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9779. this.ui.helpBtn.visible = true;
  9780. this.ui.guideNode.visible = true;
  9781. }
  9782. }
  9783. setTurnAlpha(alpha) {
  9784. this.ui.keduNode.alpha = alpha;
  9785. this.ui.ganNode.alpha = alpha;
  9786. this.ui.rodMethodNode.alpha = alpha;
  9787. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9788. }
  9789. cameraViewChange(callback) {
  9790. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9791. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9792. xGame.common.showOneCamera("visitAngle");
  9793. cameraSrc.localRotationEulerY = 180;
  9794. cameraSrc.localRotationEulerZ = 0;
  9795. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9796. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9797. callback && callback();
  9798. }));
  9799. }));
  9800. }
  9801. playPutBallD3Ani() {
  9802. xGame.common.showOneCamera("mainCamera");
  9803. let handSrc = xGame.common.d3World.d3Hand;
  9804. handSrc.gameObj.active = true;
  9805. handSrc.transform.localPositionZ = 3;
  9806. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9807. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9808. handSrc.gameObj.active = false;
  9809. this.enterGame();
  9810. }), 400);
  9811. }));
  9812. }
  9813. updateHead() {
  9814. let user = Moyu.getUserInfo();
  9815. this.ui.topNode.selfNameTxt.text = user.nickName;
  9816. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9817. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9818. if (DataMgr.getSkillGuide() < 1) {
  9819. this.ui.topNode.aiNameTxt.text = 'billiards';
  9820. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9821. }
  9822. else {
  9823. this.ui.topNode.aiNameTxt.text = aiData.name;
  9824. let randNo = Math.floor(Math.random() * 10) + 1;
  9825. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9826. }
  9827. }
  9828. initD2world() {
  9829. let node = this.ui.d2Root.displayObject;
  9830. let src = node.getComponent(D2World);
  9831. if (!src) {
  9832. xGame.common.d2World = node.addComponent(D2World);
  9833. }
  9834. xGame.common.d2World.initSelf();
  9835. }
  9836. initD3world() {
  9837. if (this.isD3Inited)
  9838. return;
  9839. this.isD3Inited = true;
  9840. let scene3D = xGame.common.d3Scene;
  9841. this.ui.d3Root.displayObject.addChild(scene3D);
  9842. scene3D.active = true;
  9843. xGame.common.d3World.tableSrc.setBorderPos();
  9844. }
  9845. onRootMove(e) {
  9846. let rootBall = xGame.common.d2World.rootBall;
  9847. this.ui.moveNode.x = e.x;
  9848. this.ui.moveNode.y = e.y;
  9849. rootBall.gameObj.x = e.x;
  9850. rootBall.gameObj.y = e.y;
  9851. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9852. }
  9853. aiRootMove(move) {
  9854. if (move)
  9855. this.hideBallUI();
  9856. else {
  9857. this.showBallUI();
  9858. xGame.common.d2World.getHelpLine();
  9859. }
  9860. }
  9861. aiForce(type, force = 0) {
  9862. this.pressTarget = PressType.powerNode;
  9863. if (type == 1)
  9864. this.onEventUp({ force: true });
  9865. else if (type == 2)
  9866. this.onEventMove({ stageY: force, force: true });
  9867. }
  9868. onEventPress(e) {
  9869. if (e.stopPropagation)
  9870. e.stopPropagation();
  9871. if (!this.isTurnSelf())
  9872. return;
  9873. let target = e.target;
  9874. switch (target) {
  9875. case this.ui.myPowerNode.displayObject:
  9876. this.pressTarget = PressType.powerNode;
  9877. this.barInfo.curY = e.stageY;
  9878. this.updateBarInfo();
  9879. break;
  9880. case this.ui.moveNode.displayObject:
  9881. this.pressTarget = PressType.moveNode;
  9882. this.hideBallUI();
  9883. this.eventObj.curX = this.ui.moveNode.x;
  9884. this.eventObj.curY = this.ui.moveNode.y;
  9885. this.ui.moveNode.finger.visible = false;
  9886. this.eventObj.lastX = e.stageX;
  9887. this.eventObj.lastY = e.stageY;
  9888. break;
  9889. case this.ui.rulerClickNode.displayObject:
  9890. this.pressTarget = PressType.rulerNode;
  9891. this.eventObj.lastY = e.stageY;
  9892. break;
  9893. case this.ui.d2Root.displayObject:
  9894. this.pressTarget = PressType.d2Root;
  9895. this.eventObj.lastX = e.stageX;
  9896. this.eventObj.lastY = e.stageY;
  9897. this.eventObj.starX = e.stageX;
  9898. this.eventObj.starY = e.stageY;
  9899. this.eventObj.curX = 0;
  9900. this.eventObj.curY = 0;
  9901. xGame.common.d2World.d2Gan.setGanLastInfo();
  9902. this.rulerOffset = 0;
  9903. break;
  9904. default:
  9905. break;
  9906. }
  9907. }
  9908. onEventMove(e) {
  9909. if (e.stopPropagation)
  9910. e.stopPropagation();
  9911. if (e && e.force) {
  9912. }
  9913. else {
  9914. if (!this.isTurnSelf())
  9915. return;
  9916. }
  9917. switch (this.pressTarget) {
  9918. case PressType.powerNode:
  9919. this.barInfo.curY = e.stageY;
  9920. this.updateBarInfo();
  9921. this.isMoveRod = true;
  9922. break;
  9923. case PressType.moveNode:
  9924. let rootBall = xGame.common.d2World.rootBall;
  9925. let radius = rootBall.gameObj.width / 2;
  9926. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9927. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9928. let border = xGame.common.d2World.borderRect;
  9929. if (curX <= border.x + radius)
  9930. curX = border.x + radius;
  9931. else if (curX >= border.x + border.width - radius)
  9932. curX = border.x + border.width - radius;
  9933. if (curY <= border.y + radius)
  9934. curY = border.y + radius;
  9935. else if (curY >= border.y + border.height - radius)
  9936. curY = border.y + border.height - radius;
  9937. if (xGame.common.gameMgr.isOpenBall) {
  9938. if (curX >= border.x + border.openBallW - radius)
  9939. curX = border.x + border.openBallW - radius;
  9940. }
  9941. this.ui.moveNode.x = curX;
  9942. this.ui.moveNode.y = curY;
  9943. rootBall.gameObj.x = curX;
  9944. rootBall.gameObj.y = curY;
  9945. rootBall.d3BallSrc.setTransPos(curX, curY);
  9946. this.isMoveRod = true;
  9947. break;
  9948. case PressType.rulerNode:
  9949. let yy = e.stageY - this.eventObj.lastY;
  9950. this.eventObj.lastY = e.stageY;
  9951. let ruler1 = this.ui.rulerNode.img1;
  9952. let ruler2 = this.ui.rulerNode.img2;
  9953. ruler1.y += yy;
  9954. ruler2.y += yy;
  9955. this.rulerOffset += yy;
  9956. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9957. this.rulerOffset = 0;
  9958. xGame.soundMgr.playSound("inch", 1, 10);
  9959. }
  9960. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9961. let h = ruler1.height;
  9962. this.checkGuide();
  9963. this.isMoveRod = true;
  9964. if (ruler1.y >= h) {
  9965. ruler1.y = -h;
  9966. ruler2.y = 0;
  9967. return;
  9968. }
  9969. else if (ruler1.y <= -h) {
  9970. ruler1.y = h;
  9971. ruler2.y = 0;
  9972. return;
  9973. }
  9974. if (ruler2.y >= h) {
  9975. ruler2.y = -h;
  9976. ruler1.y = 0;
  9977. return;
  9978. }
  9979. else if (ruler2.y <= -h) {
  9980. ruler2.y = h;
  9981. ruler1.y = 0;
  9982. return;
  9983. }
  9984. break;
  9985. case PressType.d2Root:
  9986. this.eventObj.curX = e.stageX;
  9987. this.eventObj.curY = e.stageY;
  9988. let offset = this.checkRodMoveDir();
  9989. xGame.common.d2World.d2Gan.rotateSelf(offset);
  9990. this.eventObj.lastX = e.stageX;
  9991. this.eventObj.lastY = e.stageY;
  9992. break;
  9993. default:
  9994. break;
  9995. }
  9996. }
  9997. onEventUp(e) {
  9998. if (e.stopPropagation)
  9999. e.stopPropagation();
  10000. if (e && e.force) {
  10001. }
  10002. else {
  10003. if (!this.isTurnSelf())
  10004. return;
  10005. }
  10006. switch (this.pressTarget) {
  10007. case PressType.powerNode:
  10008. this.ui.powerNode.value = 0;
  10009. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10010. this.ui.powerTxt.text = "";
  10011. if (this.powerNum > 0) {
  10012. xGame.eventMgr.event(BALL_SHOOT);
  10013. xGame.common.d2World.shoot(this.powerNum);
  10014. xGame.common.d2World.d2Gan.shoot();
  10015. xGame.common.d2World.d2HelpLine.shoot();
  10016. this.finishGuide();
  10017. this.ui.powerEft.visible = false;
  10018. this.ui.colorNode.visible = false;
  10019. let ganStr = "";
  10020. if (this.powerNum <= 30) {
  10021. ganStr = "gan_30";
  10022. }
  10023. else if (this.powerNum <= 60) {
  10024. ganStr = "gan_50";
  10025. }
  10026. else {
  10027. ganStr = "gan_80";
  10028. }
  10029. xGame.soundMgr.playSound(ganStr);
  10030. }
  10031. break;
  10032. case PressType.moveNode:
  10033. let rootBall = xGame.common.d2World.rootBall;
  10034. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10035. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10036. let isIntersect = this.judgeBallIntersect();
  10037. if (isIntersect) {
  10038. this.ui.moveNode.x = lastX;
  10039. this.ui.moveNode.y = lastY;
  10040. rootBall.gameObj.x = lastX;
  10041. rootBall.gameObj.y = lastY;
  10042. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10043. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10044. }
  10045. else {
  10046. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10047. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10048. }
  10049. this.showBallUI();
  10050. this.ui.moveNode.finger.visible = true;
  10051. xGame.common.d2World.getHelpLine();
  10052. break;
  10053. case PressType.rulerNode:
  10054. break;
  10055. case PressType.d2Root:
  10056. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10057. if (dis <= 25) {
  10058. this.moveToClickDot(e);
  10059. }
  10060. break;
  10061. default:
  10062. break;
  10063. }
  10064. this.pressTarget = -1;
  10065. }
  10066. checkGuide() {
  10067. let guide = DataMgr.getSkillGuide();
  10068. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10069. xGame.common.guideStep++;
  10070. xGame.common.gameUI.ui.guide2.visible = false;
  10071. xGame.common.gameUI.ui.guide3.visible = true;
  10072. }
  10073. }
  10074. finishGuide() {
  10075. let guide = DataMgr.getSkillGuide();
  10076. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10077. xGame.common.guideStep = 10;
  10078. this.closeAllGuide();
  10079. }
  10080. }
  10081. closeAllGuide() {
  10082. xGame.common.gameUI.ui.guide1.visible = false;
  10083. xGame.common.gameUI.ui.guide2.visible = false;
  10084. xGame.common.gameUI.ui.guide3.visible = false;
  10085. }
  10086. updateBarInfo() {
  10087. let star = this.ui.powerNode.y;
  10088. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10089. if (rate >= 1)
  10090. rate = 1;
  10091. if (rate <= 0)
  10092. rate = 0;
  10093. this.powerNum = Math.ceil(rate * 100);
  10094. this.ui.powerNode.value = this.powerNum;
  10095. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10096. this.ui.colorNode.value = this.powerNum;
  10097. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10098. this.ui.powerEft.visible = this.powerNum != 0;
  10099. this.ui.colorNode.visible = this.powerNum != 0;
  10100. this.ui.powerTxt.text = this.powerNum + "";
  10101. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10102. }
  10103. forceCancel() {
  10104. this.ui.powerNode.value = 0;
  10105. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10106. this.ui.powerTxt.text = "";
  10107. }
  10108. checkRodMoveDir() {
  10109. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10110. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10111. if (tempX >= 0 && tempY <= 0) {
  10112. return this.checkDir();
  10113. }
  10114. else if (tempX < 0 && tempY < 0) {
  10115. return this.checkDir(1, -1);
  10116. }
  10117. else if (tempX < 0 && tempY > 0) {
  10118. return this.checkDir(-1, -1);
  10119. }
  10120. else {
  10121. return this.checkDir(-1, 1);
  10122. }
  10123. }
  10124. checkDir(flagX = 1, flagY = 1) {
  10125. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10126. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10127. if (offsetY == 0) {
  10128. return offsetX * flagX;
  10129. }
  10130. if (offsetX == 0) {
  10131. return offsetY * flagY;
  10132. }
  10133. let angle = offsetY / offsetX;
  10134. if (Math.abs(angle) >= 1) {
  10135. return offsetY * flagY;
  10136. }
  10137. else {
  10138. return offsetX * flagX;
  10139. }
  10140. }
  10141. judgeBallIntersect() {
  10142. let rootBall = xGame.common.d2World.rootBall;
  10143. let ballArr = xGame.common.d2World.ballArr;
  10144. let radius = rootBall.gameObj.width / 2;
  10145. let temp;
  10146. let isIntersect = false;
  10147. for (let index = 0; index < ballArr.length; index++) {
  10148. temp = ballArr[index];
  10149. if (temp.number == rootBall.number)
  10150. continue;
  10151. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10152. if (isIntersect) {
  10153. break;
  10154. }
  10155. }
  10156. return isIntersect;
  10157. }
  10158. hideBallUI() {
  10159. let d2Gan = xGame.common.d2World.d2Gan;
  10160. if (!d2Gan.ui.isDisposed)
  10161. d2Gan.ui.visible = false;
  10162. let d2Help = xGame.common.d2World.d2HelpLine;
  10163. if (!d2Help.ui.isDisposed)
  10164. d2Help.ui.visible = false;
  10165. let rootBall = xGame.common.d2World.rootBall;
  10166. if (!rootBall.destroyed) {
  10167. rootBall.gameObj.active = false;
  10168. }
  10169. }
  10170. showBallUI() {
  10171. let d2Gan = xGame.common.d2World.d2Gan;
  10172. if (!d2Gan.ui.isDisposed)
  10173. d2Gan.ui.visible = true;
  10174. let d2Help = xGame.common.d2World.d2HelpLine;
  10175. if (!d2Help.ui.isDisposed)
  10176. d2Help.ui.visible = true;
  10177. let rootBall = xGame.common.d2World.rootBall;
  10178. if (!rootBall.destroyed) {
  10179. rootBall.gameObj.active = true;
  10180. }
  10181. }
  10182. moveToClickDot(e) {
  10183. if (!this.isMoveRod && !xGame.common.clickedBall) {
  10184. let root = xGame.common.d2World.rootBall.gameObj;
  10185. let xx = e.stageX - xGame.common.sysOffestNum;
  10186. let yy = e.stageY;
  10187. let x = xx - root.x;
  10188. let y = yy - root.y;
  10189. let angle = xGame.common.getfguiRotation(x, y);
  10190. xGame.common.d2World.d2Gan.ui.rotation = angle;
  10191. xGame.common.d2World.getHelpLine();
  10192. }
  10193. this.isMoveRod = false;
  10194. xGame.common.clickedBall = false;
  10195. }
  10196. openAllEvent() {
  10197. this.closeAllEvent();
  10198. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10199. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10200. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10201. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10202. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10203. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10204. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10205. }
  10206. closeAllEvent() {
  10207. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10208. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10209. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10210. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10211. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10212. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10213. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10214. }
  10215. resetGame() {
  10216. this.closeAllEvent();
  10217. this.hideBallUI();
  10218. xGame.common.gameMgr.gamePause = true;
  10219. }
  10220. }
  10221. UIGame.uiName = "UIGame";
  10222. class UIAddProp extends UIBase {
  10223. constructor() {
  10224. super();
  10225. this.curType = "";
  10226. }
  10227. onConstructor() {
  10228. this.ui = ui_UIAddProp.createInstance();
  10229. this.contentPane = this.ui;
  10230. this.isEject = false;
  10231. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  10232. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  10233. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  10234. this.updateUI();
  10235. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  10236. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  10237. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  10238. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  10239. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  10240. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  10241. }
  10242. show(type) {
  10243. super.show();
  10244. this.curType = type == 0 ? "coin" : "diamond";
  10245. this.switchBtn("");
  10246. this.ui.t0.play();
  10247. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  10248. PlatMgr.showInsert(true);
  10249. }
  10250. closeSelf() {
  10251. this.hide();
  10252. }
  10253. updateUI() {
  10254. let data = cfgTable.moneyData;
  10255. let temp;
  10256. let obj;
  10257. for (const key in data) {
  10258. temp = data[key];
  10259. obj = this.ui.myNode["node" + key];
  10260. if (parseInt(key) <= 2) {
  10261. obj.diamondTxt.text = "+" + temp.num;
  10262. }
  10263. else {
  10264. obj.coinTxt.text = temp.num;
  10265. obj.diamondTxt.text = temp.get.split('_')[1];
  10266. }
  10267. }
  10268. this.updateDiamondShare();
  10269. }
  10270. updateDiamondShare() {
  10271. let data = DataMgr.getShareDiamondTimes();
  10272. if (data >= xGame.common.maxShareDiamondTimes) {
  10273. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  10274. this.ui.myNode.node1.touchable = false;
  10275. }
  10276. else {
  10277. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  10278. this.ui.myNode.node1.touchable = true;
  10279. }
  10280. }
  10281. switchBtn(type) {
  10282. if (type == "")
  10283. type = this.curType;
  10284. else {
  10285. if (this.curType == type) {
  10286. return;
  10287. }
  10288. else {
  10289. this.curType = type;
  10290. }
  10291. }
  10292. if (type == "coin") {
  10293. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  10294. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  10295. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  10296. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  10297. this.ui.myNode.c1.selectedIndex = 0;
  10298. }
  10299. else {
  10300. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  10301. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  10302. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  10303. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  10304. this.ui.myNode.c1.selectedIndex = 1;
  10305. }
  10306. }
  10307. convertCoin(index) {
  10308. let data = cfgTable.moneyData[index];
  10309. let coinNum = data.num;
  10310. let str = data.get.split('_')[1];
  10311. let needDiamond = parseInt(str);
  10312. if (DataMgr.diamondEnough(needDiamond)) {
  10313. DataMgr.setDiamond(-needDiamond);
  10314. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  10315. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  10316. }
  10317. else {
  10318. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  10319. this.switchBtn("diamond");
  10320. }
  10321. }
  10322. videoGetDiamond() {
  10323. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  10324. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  10325. }
  10326. else {
  10327. console.log('zh:AD 失败,直接发放奖励');
  10328. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  10329. }
  10330. }
  10331. qjff_AD_for_uiAddProp_videoGetDiamond() {
  10332. let num = cfgTable.moneyData[2].num;
  10333. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10334. this.closeSelf();
  10335. }
  10336. videoGetCoin() {
  10337. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  10338. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  10339. }
  10340. else {
  10341. console.log('zh:AD 失败,直接发放奖励');
  10342. this.qjff_AD_for_uiAddProp_videoGetCoin();
  10343. }
  10344. }
  10345. qjff_AD_for_uiAddProp_videoGetCoin() {
  10346. xGame.common.playObjFlyAnim(2000, Prop.coin);
  10347. this.closeSelf();
  10348. }
  10349. shareGetDiamond() {
  10350. let times = DataMgr.getShareDiamondTimes();
  10351. if (times >= xGame.common.maxShareDiamondTimes) {
  10352. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10353. }
  10354. else {
  10355. if (Moyu.isTT) {
  10356. let num = cfgTable.moneyData[1].num;
  10357. Moyu.shareVideo = '';
  10358. Moyu.shareGame((success) => {
  10359. if (success) {
  10360. xGame.uiMgr.Show(UIMsg, "分享成功!");
  10361. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10362. DataMgr.setShareDiamondTimes(1);
  10363. this.updateDiamondShare();
  10364. }
  10365. else {
  10366. xGame.uiMgr.Show(UIMsg, "分享失败!");
  10367. }
  10368. });
  10369. }
  10370. else {
  10371. Moyu.showVideoAd(() => {
  10372. let diamond = xGame.common.randomNum(50, 100);
  10373. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  10374. DataMgr.setShareDiamondTimes(1);
  10375. this.updateDiamondShare();
  10376. }, EAdType.randomDiamond);
  10377. }
  10378. }
  10379. }
  10380. qjff_AD_for_uiAddProp_shareGetDiamond() {
  10381. }
  10382. openPutBallView() {
  10383. let end = xGame.uiMgr.getUI(UIGameEnd);
  10384. let skill = xGame.uiMgr.getUI(UISkill);
  10385. let level = xGame.uiMgr.getUI(UILevelDisplay);
  10386. let uigame = xGame.uiMgr.getUI(UIGame);
  10387. if (end && !end.isHide) {
  10388. xGame.uiMgr.Hide(UIGameEnd);
  10389. xGame.uiMgr.Show(UIMain);
  10390. }
  10391. if (skill && !skill.isHide)
  10392. xGame.uiMgr.Hide(UISkill);
  10393. if (uigame && !uigame.isHide)
  10394. xGame.uiMgr.Hide(UIGame);
  10395. if (level && !level.isHide) {
  10396. }
  10397. else {
  10398. xGame.uiMgr.Show(UILevelDisplay);
  10399. }
  10400. this.closeSelf();
  10401. }
  10402. }
  10403. UIAddProp.uiName = "UIAddProp";
  10404. class MoneyNode {
  10405. constructor(ui) {
  10406. this.leftTime = 0;
  10407. this.ui = ui;
  10408. this.ui.addCoinBtn.onClick(this, this.addCoin);
  10409. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  10410. this.ui.addPowerBtn.onClick(this, this.addPower);
  10411. this.ui.c1.selectedIndex = 1;
  10412. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  10413. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  10414. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  10415. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10416. this.coinChange();
  10417. this.diamondChange();
  10418. this.powerChange();
  10419. }
  10420. addPower() {
  10421. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10422. xGame.uiMgr.Show(UIPower);
  10423. }
  10424. powerChange() {
  10425. let powerNum = DataMgr.getPower();
  10426. this.ui.powerTxt.text = powerNum + "";
  10427. }
  10428. checkPowerTime() {
  10429. let cur = new Date().getTime();
  10430. let last = DataMgr.getPowerTime();
  10431. if (last == 0) {
  10432. last = cur;
  10433. DataMgr.setPowerTime(cur);
  10434. }
  10435. let power = DataMgr.getPower();
  10436. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10437. Laya.timer.clearAll(this);
  10438. if (power >= xGame.common.natureMaxPower) {
  10439. this.ui.powerTimeTxt.text = "";
  10440. DataMgr.setPowerTime(cur);
  10441. return;
  10442. }
  10443. if (power + offset >= xGame.common.natureMaxPower) {
  10444. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10445. this.ui.powerTimeTxt.text = "";
  10446. DataMgr.setPowerTime(cur);
  10447. }
  10448. else {
  10449. if (offset > 0) {
  10450. DataMgr.setPower(offset);
  10451. DataMgr.setPowerTime(cur);
  10452. }
  10453. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10454. this.leftTime = xGame.common.powerRecoverNum - time;
  10455. if (this.leftTime <= 0)
  10456. this.leftTime = 0;
  10457. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10458. Laya.timer.loop(1000, this, this.updatePowerTime);
  10459. }
  10460. }
  10461. updatePowerTime() {
  10462. this.leftTime -= 1;
  10463. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10464. if (this.leftTime <= 0) {
  10465. this.checkPowerTime();
  10466. }
  10467. }
  10468. coinChange() {
  10469. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10470. }
  10471. diamondChange() {
  10472. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10473. }
  10474. addCoin() {
  10475. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10476. Moyu.sendDataEvent("AddCoinBtn");
  10477. xGame.uiMgr.Show(UIAddProp, 0);
  10478. }
  10479. addDiamond() {
  10480. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10481. Moyu.sendDataEvent("AddDiamondBtn");
  10482. xGame.uiMgr.Show(UIAddProp, 1);
  10483. }
  10484. }
  10485. class UIDraw extends UIBase {
  10486. constructor() {
  10487. super();
  10488. this.curKey = 0;
  10489. }
  10490. onConstructor() {
  10491. this.ui = ui_UIDraw.createInstance();
  10492. this.contentPane = this.ui;
  10493. this.isEject = false;
  10494. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10495. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10496. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10497. this.initDraw();
  10498. this.initUI();
  10499. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10500. if (Moyu.isKs)
  10501. this.ui.closeNode.closeBtn.x += 100;
  10502. }
  10503. show() {
  10504. super.show();
  10505. this.ui.t0.play();
  10506. this.playSecretaryIdle();
  10507. this.updateDraw();
  10508. this.checkFree();
  10509. if (PlatMgr.bannerDelay > 0) {
  10510. this.ui.closeNode.closeBtn.visible = false;
  10511. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10512. this.ui.closeNode.closeBtn.visible = true;
  10513. });
  10514. }
  10515. PlatMgr.showRateBanner();
  10516. }
  10517. hide() {
  10518. Laya.timer.clearAll(this);
  10519. super.hide();
  10520. }
  10521. checkFree() {
  10522. let isFree = DataMgr.getDailyfreeDrawTimes();
  10523. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10524. }
  10525. initDraw() {
  10526. this.drawObj = [];
  10527. let data = cfgTable.drawData;
  10528. let temp;
  10529. let weight = 0;
  10530. for (const key in data) {
  10531. temp = data[key];
  10532. weight += temp.weight;
  10533. this.drawObj.push(weight);
  10534. }
  10535. this.allWeight = weight;
  10536. }
  10537. initUI() {
  10538. let data = cfgTable.drawData;
  10539. let temp;
  10540. let img;
  10541. let txt;
  10542. for (const key in data) {
  10543. temp = data[key];
  10544. img = this.ui.myNode.rotNode["img" + key];
  10545. txt = this.ui.myNode.rotNode["txt" + key];
  10546. img.url = xGame.common.getGameIconUrl(temp.icon);
  10547. txt.visible = true;
  10548. if (temp.award > 2) {
  10549. img.rotation = 0;
  10550. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10551. }
  10552. else {
  10553. img.rotation = temp.rotation;
  10554. txt.text = temp.num;
  10555. }
  10556. }
  10557. }
  10558. getCurkey() {
  10559. let rand = Math.random() * this.allWeight;
  10560. let temp;
  10561. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10562. temp = this.drawObj[index];
  10563. if (index == 0) {
  10564. if (rand < temp) {
  10565. return index + 1;
  10566. }
  10567. }
  10568. else {
  10569. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10570. return index + 1;
  10571. }
  10572. }
  10573. }
  10574. return 2;
  10575. }
  10576. startDraw() {
  10577. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10578. if (freeTimes > 0) {
  10579. this.beginDraw();
  10580. DataMgr.setDailyfreeDrawTimes(0);
  10581. this.checkFree();
  10582. }
  10583. else {
  10584. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  10585. }
  10586. else {
  10587. console.log('zh:AD 失败,直接发放奖励');
  10588. this.qjff_chouJiang();
  10589. }
  10590. }
  10591. }
  10592. qjff_chouJiang() {
  10593. this.beginDraw();
  10594. }
  10595. beginDraw() {
  10596. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10597. this.ui.drawBtn.touchable = false;
  10598. this.curKey = this.getCurkey();
  10599. console.log("当前key", this.curKey);
  10600. let cell = 60;
  10601. let lap = 3;
  10602. let angle = cell * (this.curKey - 1) + lap * 360;
  10603. let target = this.ui.myNode.rotNode;
  10604. target.rotation = 0;
  10605. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10606. console.log("旋转完成");
  10607. this.ui.drawBtn.touchable = true;
  10608. this.getAward();
  10609. }));
  10610. }
  10611. getAward() {
  10612. let data = cfgTable.drawData[this.curKey];
  10613. let temp = new AwardType();
  10614. temp.type = data.award;
  10615. temp.num = data.num;
  10616. xGame.common.getAward([temp], () => {
  10617. DataMgr.setDrawTimes(1);
  10618. this.updateDraw();
  10619. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10620. });
  10621. }
  10622. updateDraw() {
  10623. let drawTimes = DataMgr.getDrawTimes();
  10624. let awardTimes = DataMgr.getDrawAwardTimes();
  10625. if (Math.floor(drawTimes / 3) > awardTimes) {
  10626. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10627. this.ui.extraNode.boxBtn.touchable = true;
  10628. this.ui.extraNode.tipsTxt.text = "3/3";
  10629. this.ui.extraNode.barNode.width = 265;
  10630. this.getExtraAward();
  10631. }
  10632. else {
  10633. this.ui.extraNode.boxBtn.t0.stop();
  10634. this.ui.extraNode.boxBtn.touchable = false;
  10635. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10636. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10637. }
  10638. let data = cfgTable.drawData[1];
  10639. if (awardTimes == 0) {
  10640. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10641. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10642. this.ui.myNode.rotNode.img1.rotation = 0;
  10643. }
  10644. else {
  10645. let award = data.nextid;
  10646. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10647. this.ui.myNode.rotNode.txt1.text = award[1];
  10648. this.ui.myNode.rotNode.img1.rotation = 0;
  10649. }
  10650. }
  10651. getExtraAward() {
  10652. let drawTimes = DataMgr.getDrawTimes();
  10653. let awardTimes = DataMgr.getDrawAwardTimes();
  10654. let data = cfgTable.drawData[1];
  10655. let award = new AwardType();
  10656. if (awardTimes == 0) {
  10657. award.num = data.num;
  10658. award.type = data.award;
  10659. xGame.common.getAward([award], () => {
  10660. let all = Math.floor(drawTimes / 3);
  10661. DataMgr.setDrawAwardTimes(all);
  10662. this.updateDraw();
  10663. });
  10664. }
  10665. else {
  10666. award.num = parseInt(data.nextid[1]);
  10667. award.type = parseInt(data.nextid[0]);
  10668. xGame.common.getAward([award], () => {
  10669. let all = Math.floor(drawTimes / 3);
  10670. DataMgr.setDrawAwardTimes(all);
  10671. this.updateDraw();
  10672. });
  10673. }
  10674. }
  10675. closeSelf() {
  10676. this.hide();
  10677. }
  10678. playSecretaryIdle() {
  10679. let parent = this.ui.secretary.displayObject;
  10680. parent.destroyChildren();
  10681. let xx = this.ui.secretary.width / 2;
  10682. let yy = this.ui.secretary.height;
  10683. let scale = xGame.common.getSecretaryScale();
  10684. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10685. xGame.common.secretary.play(data, 0, true, parent);
  10686. }
  10687. }
  10688. UIDraw.uiName = "UIDraw";
  10689. class ui_UIFlyEft extends fgui.GComponent {
  10690. static createInstance() {
  10691. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10692. }
  10693. onConstruct() {
  10694. this.n0 = (this.getChild("n0"));
  10695. this.n1 = (this.getChild("n1"));
  10696. this.n2 = (this.getChild("n2"));
  10697. this.n3 = (this.getChild("n3"));
  10698. this.n4 = (this.getChild("n4"));
  10699. this.n5 = (this.getChild("n5"));
  10700. this.n6 = (this.getChild("n6"));
  10701. this.n7 = (this.getChild("n7"));
  10702. this.iconNode = (this.getChild("iconNode"));
  10703. this.txt = (this.getChild("txt"));
  10704. this.txtNode = (this.getChild("txtNode"));
  10705. }
  10706. }
  10707. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10708. class UIFlyEft extends UIBase {
  10709. constructor() {
  10710. super();
  10711. this.max = 8;
  10712. this.delay = 0;
  10713. }
  10714. onConstructor() {
  10715. this.ui = ui_UIFlyEft.createInstance();
  10716. this.contentPane = this.ui;
  10717. this.isEject = false;
  10718. this.isMuti = true;
  10719. this.ui.x += xGame.common.sysOffestNum;
  10720. }
  10721. getArrPos() {
  10722. if (this.iconPos && this.iconPos.length > 0)
  10723. return;
  10724. this.iconPos = [];
  10725. let temp;
  10726. for (let index = 0; index < this.max; index++) {
  10727. temp = this.ui["n" + index];
  10728. this.iconPos.push([temp.x, temp.y]);
  10729. }
  10730. }
  10731. show(stPos, edPos, num, type, callback) {
  10732. super.show();
  10733. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10734. this.getArrPos();
  10735. this.updateUI(type);
  10736. this.updatePos();
  10737. this.runFly(edPos, callback);
  10738. this.runWorlds(stPos, num);
  10739. }
  10740. updateUI(type) {
  10741. let temp;
  10742. let str;
  10743. for (let index = 0; index < this.max; index++) {
  10744. temp = this.ui["n" + index];
  10745. str = this.getIconStr(type);
  10746. temp.url = xGame.common.getGameIconUrl(str);
  10747. }
  10748. }
  10749. getIconStr(type) {
  10750. switch (type) {
  10751. case Prop.diamond:
  10752. return "ty_zs";
  10753. case Prop.coin:
  10754. return "ty_jb";
  10755. default:
  10756. break;
  10757. }
  10758. }
  10759. updatePos() {
  10760. let temp;
  10761. for (let index = 0; index < this.max; index++) {
  10762. temp = this.ui["n" + index];
  10763. temp.x = this.iconPos[index][0];
  10764. temp.y = this.iconPos[index][1];
  10765. }
  10766. }
  10767. runFly(endPos, callback) {
  10768. let all = 0;
  10769. let temp;
  10770. for (let index = 0; index < this.max; index++) {
  10771. temp = this.ui["n" + index];
  10772. temp.visible = true;
  10773. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10774. temp.visible = false;
  10775. all++;
  10776. if (all >= this.max) {
  10777. callback && callback();
  10778. }
  10779. }), 20 * index);
  10780. }
  10781. }
  10782. runWorlds(stPos, num) {
  10783. let str = "+" + num;
  10784. this.ui.txt.text = str;
  10785. let starX = stPos.x;
  10786. let starY = stPos.y + 50;
  10787. this.ui.txt.x = starX;
  10788. this.ui.txt.y = starY;
  10789. this.ui.txt.visible = true;
  10790. this.ui.txt.alpha = 1;
  10791. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10792. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10793. this.ui.txt.visible = false;
  10794. this.hide();
  10795. }));
  10796. }));
  10797. }
  10798. }
  10799. UIFlyEft.uiName = "UIFlyEft";
  10800. class Common {
  10801. constructor() {
  10802. this.convertNum = 0.025;
  10803. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10804. this.scaleV3One = new Laya.Vector3();
  10805. this.scaleV3Two = new Laya.Vector3();
  10806. this.posV4 = new Laya.Vector4();
  10807. this.showDebug = false;
  10808. this.openGuide = true;
  10809. this.rodOffest = new Laya.Vector2(0, 0);
  10810. this.rodAngle = 0;
  10811. this.gameMode = GameMode.classic;
  10812. this.bigMoveLevelIndex = 1;
  10813. this.bigMoveNeedCoin = 1000;
  10814. this.classicNiceNeddCoin = 1000;
  10815. this.passAwardCoin = 2000;
  10816. this.classicRoomType = 1;
  10817. this.maxPower = 20;
  10818. this.natureMaxPower = 5;
  10819. this.videoPower = 2;
  10820. this.powerRecoverNum = 900;
  10821. this.curPlayerSkillType = 0;
  10822. this.isNewDay = false;
  10823. this.clickedBall = false;
  10824. this.placeBallCurLevel = 0;
  10825. this.placeBallStarNum = 0;
  10826. this.longHelpLine = false;
  10827. this.maxShareDiamondTimes = 3;
  10828. this.guideStep = 0;
  10829. this.temSelfLevel = 0;
  10830. this.extraMoveNum = 0;
  10831. this.curRankID = 0;
  10832. this.rankID = {
  10833. normalStar: 12000,
  10834. wxStar: 12001
  10835. };
  10836. this.skillNameList = ["Fall from the sky", "Unstoppable Force", "Freeze Shot"];
  10837. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  10838. this.btnClickStr = "buttonclick";
  10839. this.maxSkillLevel = 10;
  10840. this.upSkillLevel = false;
  10841. this.gameStartTime = 0;
  10842. this._sysOffestNum = 0;
  10843. this.angleV2 = new Laya.Vector2();
  10844. this.rootV = new Laya.Vector2(0, 1);
  10845. this.tempDir1 = new Laya.Vector2();
  10846. this.tempDir2 = new Laya.Vector2();
  10847. this.ballSize = 33;
  10848. this.stPos = new Laya.Point();
  10849. this.edPos = new Laya.Point();
  10850. Common._instance = this;
  10851. window["common"] = this;
  10852. }
  10853. static getInstance() {
  10854. if (!this._instance) {
  10855. this._instance = new Common();
  10856. }
  10857. return this._instance;
  10858. }
  10859. get sysOffestNum() {
  10860. if (this._sysOffestNum == 0) {
  10861. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10862. }
  10863. return this._sysOffestNum;
  10864. }
  10865. testShader() {
  10866. let test = new LightShader();
  10867. test.texture = "res/d3Res/ballTexture/ball1.png";
  10868. Laya.stage.addChild(test);
  10869. }
  10870. playScale(node) {
  10871. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10872. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10873. }));
  10874. }));
  10875. }
  10876. setGroup(colli, ...group) {
  10877. let out = 0;
  10878. for (let index = 0; index < group.length; index++) {
  10879. if (index == 0) {
  10880. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10881. }
  10882. else {
  10883. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10884. }
  10885. }
  10886. colli.collisionGroup = out;
  10887. }
  10888. setCanGroupWith(colli, ...group) {
  10889. let out = 0;
  10890. for (let index = 0; index < group.length; index++) {
  10891. if (index == 0) {
  10892. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10893. }
  10894. else {
  10895. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10896. }
  10897. }
  10898. colli.canCollideWith = out;
  10899. }
  10900. loadPrefab(name, callback) {
  10901. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10902. let prefab = new Laya.Prefab();
  10903. prefab.json = obj;
  10904. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10905. callback && callback(img);
  10906. }));
  10907. }
  10908. pos2to3Convert(x, y, d3Pos) {
  10909. x = x + this.sysOffestNum;
  10910. d3Pos.setValue(x, y, 0);
  10911. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10912. if (success) {
  10913. }
  10914. else {
  10915. console.error("转换出错了。。。。。。。。");
  10916. }
  10917. }
  10918. scale2to3Convert(num) {
  10919. this.scaleV3One.setValue(0, 0, 0);
  10920. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10921. this.scaleV3Two.setValue(0, num, 0);
  10922. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10923. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10924. return outNum;
  10925. }
  10926. pos3to2Convert(d3Pos) {
  10927. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10928. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10929. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10930. d3Pos.x -= this.sysOffestNum;
  10931. }
  10932. scale3to2Convert(num) {
  10933. let scale = this.scale2to3Convert(1);
  10934. let d2Out = num / scale;
  10935. return d2Out;
  10936. }
  10937. getCollider(type, restitution = 0.9, density = 10) {
  10938. let colli;
  10939. if (type == "box")
  10940. colli = new Laya.BoxCollider();
  10941. else
  10942. colli = new Laya.CircleCollider();
  10943. colli.friction = 0;
  10944. colli.restitution = restitution;
  10945. colli.density = density;
  10946. return colli;
  10947. }
  10948. getRigbody() {
  10949. let rigy = new Laya.RigidBody();
  10950. rigy.bullet = true;
  10951. rigy.allowRotation = false;
  10952. rigy.allowSleep = false;
  10953. rigy.gravityScale = 0;
  10954. return rigy;
  10955. }
  10956. getfguiRotation(x, y) {
  10957. this.angleV2.setValue(x, y);
  10958. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10959. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10960. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10961. angle = -angle;
  10962. }
  10963. return 180 + angle;
  10964. }
  10965. getAngle(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. return angle;
  10970. }
  10971. randomNum(a, b) {
  10972. return a + Math.floor((b - a + 1) * Math.random());
  10973. }
  10974. getRandArrEle(arr) {
  10975. return arr[Math.floor(arr.length * Math.random())];
  10976. }
  10977. getSign(val) {
  10978. return val >= 0 ? 1 : -1;
  10979. }
  10980. botherArr(arr) {
  10981. let times = arr.length + 2;
  10982. let length = arr.length;
  10983. let a;
  10984. let b;
  10985. let temp;
  10986. for (let index = 0; index < times; index++) {
  10987. a = Math.floor(Math.random() * length);
  10988. b = Math.floor(Math.random() * length);
  10989. temp = arr[a];
  10990. arr[a] = arr[b];
  10991. arr[b] = temp;
  10992. }
  10993. }
  10994. getGameIconUrl(id) {
  10995. return "ui://game/" + id;
  10996. }
  10997. getComponentUrl(id) {
  10998. return "ui://game/" + id;
  10999. }
  11000. getAnimation() {
  11001. }
  11002. judgeSkillType(type = SkillType.highSpace) {
  11003. if (this.gameMode == GameMode.classic)
  11004. return;
  11005. let gameMgr = this.gameMgr;
  11006. if (gameMgr.selfTurn) {
  11007. if (gameMgr.selfCurSkill == type) {
  11008. return true;
  11009. }
  11010. }
  11011. else {
  11012. if (gameMgr.aiCurSkill == type) {
  11013. return true;
  11014. }
  11015. }
  11016. }
  11017. ballColliHole(collider) {
  11018. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11019. xGame.common.gameMgr.isFirstInGame = false;
  11020. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11021. }
  11022. collider.owner.mySrc.checkWrongBall();
  11023. }
  11024. getArrMaxEle(arr) {
  11025. let max = -Infinity;
  11026. for (let index = 0; index < arr.length; index++) {
  11027. max = Math.max(arr[index], max);
  11028. }
  11029. return max;
  11030. }
  11031. getArrMinEle(arr) {
  11032. let min = Infinity;
  11033. for (let index = 0; index < arr.length; index++) {
  11034. min = Math.min(arr[index], min);
  11035. }
  11036. return min;
  11037. }
  11038. playRandomMutiBallBigSkillSound() {
  11039. if (Math.random() <= 0.5)
  11040. return;
  11041. let rand = this.randomNum(1, 6);
  11042. let str = "ganfa0" + rand;
  11043. xGame.soundMgr.playSound(str);
  11044. }
  11045. showOneCamera(type) {
  11046. let object = xGame.common.d3World.cameraObj;
  11047. for (const key in object) {
  11048. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11049. object[key].init();
  11050. object[key].owner.active = key == type;
  11051. }
  11052. }
  11053. }
  11054. checkBallOverBorder(x, y) {
  11055. let radius = 17;
  11056. let condition = this._checkBorder(x + radius, y) ||
  11057. this._checkBorder(x - radius, y) ||
  11058. this._checkBorder(x, y + radius) ||
  11059. this._checkBorder(x, y - radius);
  11060. if (condition) {
  11061. return true;
  11062. }
  11063. }
  11064. _checkBorder(x, y) {
  11065. let borderRect = this.d2World.borderRect;
  11066. let xOffest = 20;
  11067. let yOffest = 20;
  11068. if (y <= borderRect.y - yOffest) {
  11069. return true;
  11070. }
  11071. if (y >= borderRect.y + borderRect.height + yOffest) {
  11072. return true;
  11073. }
  11074. if (x <= borderRect.x - xOffest) {
  11075. return true;
  11076. }
  11077. if (x >= borderRect.x + borderRect.width + xOffest) {
  11078. return true;
  11079. }
  11080. }
  11081. initWeight(cfg) {
  11082. let allCfgData = { data: {}, allWeightNum: 0 };
  11083. let weightCfg = allCfgData.data;
  11084. let weight = 0;
  11085. for (const key in cfg) {
  11086. weightCfg[key] = {};
  11087. weightCfg[key].id = cfg[key].id;
  11088. weightCfg[key].minWeight = weight;
  11089. weight += cfg[key].weight;
  11090. weightCfg[key].maxWeight = weight;
  11091. }
  11092. allCfgData.allWeightNum = weight;
  11093. return allCfgData;
  11094. }
  11095. getRandomWeightData(cfg) {
  11096. let weightCfg = cfg.data;
  11097. let allWeightNum = cfg.allWeightNum;
  11098. let rand = Math.floor(Math.random() * allWeightNum);
  11099. for (const key in weightCfg) {
  11100. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11101. return weightCfg[key];
  11102. }
  11103. }
  11104. return weightCfg[1];
  11105. }
  11106. showGirlTalkPop(wordsIndex, node, msgNode) {
  11107. node.visible = true;
  11108. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11109. node.t0.play(Laya.Handler.create(this, () => {
  11110. node.visible = false;
  11111. }));
  11112. }
  11113. stopGirlPop(node) {
  11114. node.t0.stop();
  11115. node.visible = false;
  11116. }
  11117. createHead(loader, url, size = 107) {
  11118. if (Laya.Browser.name == "Browser") {
  11119. loader.url = url;
  11120. return;
  11121. }
  11122. if (Moyu.isTT) {
  11123. let localImage = new Image();
  11124. localImage.src = url;
  11125. localImage.onload = () => {
  11126. let t2d = new Laya.Texture2D();
  11127. t2d.width = size;
  11128. t2d.height = size;
  11129. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  11130. t2d.loadImageSource(localImage);
  11131. };
  11132. }
  11133. else {
  11134. console.log('zh:url=', url);
  11135. loader.url = url;
  11136. }
  11137. }
  11138. addTestCoin(num) {
  11139. DataMgr.setCoin(num);
  11140. }
  11141. addTestDiamond(num) {
  11142. DataMgr.setDiamond(num);
  11143. }
  11144. addTestSkill() {
  11145. DataMgr.setBigSkill(0, 99);
  11146. DataMgr.setBigSkill(1, 99);
  11147. DataMgr.setBigSkill(2, 99);
  11148. }
  11149. playClassicEmotion(number, x, y) {
  11150. if (this.gameMode == GameMode.bigMove)
  11151. return;
  11152. let randIndex = this.randomNum(0, 2);
  11153. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11154. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11155. if (this.gameMgr.selfTurn) {
  11156. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11157. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11158. }
  11159. else {
  11160. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11161. }
  11162. else {
  11163. if (number == this.gameMgr.blackNum) {
  11164. if (this.gameMgr.selfBallArr.length == 0) {
  11165. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11166. }
  11167. else {
  11168. }
  11169. }
  11170. else {
  11171. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11172. }
  11173. }
  11174. }
  11175. }
  11176. else {
  11177. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11178. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11179. }
  11180. else {
  11181. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11182. }
  11183. else {
  11184. if (number == this.gameMgr.blackNum) {
  11185. if (this.gameMgr.aiBallArr.length == 0) {
  11186. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11187. }
  11188. else {
  11189. }
  11190. }
  11191. else {
  11192. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11193. }
  11194. }
  11195. }
  11196. }
  11197. }
  11198. playHappySound(number) {
  11199. if (this.gameMode != GameMode.classic)
  11200. return;
  11201. if (number == 8)
  11202. return;
  11203. let play = false;
  11204. if (this.gameMgr.selfTurn) {
  11205. if (this.gameMgr.ensureBallType) {
  11206. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11207. play = true;
  11208. }
  11209. }
  11210. else {
  11211. play = true;
  11212. }
  11213. }
  11214. else {
  11215. if (this.gameMgr.ensureBallType) {
  11216. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11217. play = true;
  11218. }
  11219. }
  11220. else {
  11221. play = true;
  11222. }
  11223. }
  11224. if (play)
  11225. xGame.soundMgr.playSound("applause");
  11226. }
  11227. destroyClassicEmotion() {
  11228. if (this.gameMode == GameMode.bigMove)
  11229. return;
  11230. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11231. parent.destroyChildren();
  11232. }
  11233. playAwardSpine(x, y) {
  11234. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11235. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11236. this.awardSpine.play(data, 0, false, parent);
  11237. }
  11238. destroyAwardSpine() {
  11239. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11240. parent.destroyChildren();
  11241. }
  11242. isBlock(bx, by, hx, hy, except = null) {
  11243. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  11244. let balls = xGame.common.d2World.ballArr;
  11245. let outArr = [];
  11246. for (let index = 0; index < balls.length; index++) {
  11247. let obj = balls[index];
  11248. if (obj.number == 0)
  11249. continue;
  11250. if (obj == except)
  11251. continue;
  11252. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  11253. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  11254. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  11255. if (num >= 1)
  11256. num = 1;
  11257. if (num < 0)
  11258. continue;
  11259. let gap = Math.sin(Math.acos(num)) * dis;
  11260. if (gap < this.ballSize) {
  11261. outArr.push({
  11262. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  11263. disHon: Math.cos(Math.acos(num)) * dis,
  11264. disVer: Math.sin(Math.acos(num)) * dis,
  11265. src: balls[index],
  11266. dir: this.tempDir1
  11267. });
  11268. }
  11269. }
  11270. if (outArr.length > 0) {
  11271. outArr.sort((a, b) => { return a.dis - b.dis; });
  11272. return outArr[0];
  11273. }
  11274. }
  11275. AngleBetween(vector1, vector2) {
  11276. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  11277. return rad * (180 / Math.PI);
  11278. }
  11279. getSecretaryScale() {
  11280. if (this.secretary.spineName == "mishu") {
  11281. return 1.28;
  11282. }
  11283. else {
  11284. return 1.024;
  11285. }
  11286. }
  11287. signAwardContainsRod(arr) {
  11288. let temp;
  11289. for (let index = 0; index < arr.length; index++) {
  11290. temp = arr[index].split('-')[0];
  11291. if (parseInt(temp) > 2) {
  11292. return true;
  11293. }
  11294. }
  11295. }
  11296. judgeSameDay() {
  11297. let lastTime = DataMgr.getSignTime();
  11298. let curTime = new Date().getTime();
  11299. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  11300. return true;
  11301. }
  11302. return false;
  11303. }
  11304. getAward(arr, callback) {
  11305. let showTriple = arr[0].type <= 2;
  11306. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  11307. let temp;
  11308. for (let index = 0; index < arr.length; index++) {
  11309. temp = arr[index];
  11310. switch (temp.type) {
  11311. case 1:
  11312. this.playObjFlyAnim(temp.num, temp.type);
  11313. break;
  11314. case 2:
  11315. this.playObjFlyAnim(temp.num, temp.type);
  11316. break;
  11317. case 3:
  11318. case 4:
  11319. case 5:
  11320. case 6:
  11321. DataMgr.setBallRod(temp.type - 2, 1);
  11322. DataMgr.setCurBallRod(temp.type - 2);
  11323. break;
  11324. default:
  11325. break;
  11326. }
  11327. }
  11328. callback && callback(watchVideo);
  11329. });
  11330. }
  11331. getMoneyNode() {
  11332. let moneyNode;
  11333. let sign = xGame.uiMgr.getUI(UISign);
  11334. let draw = xGame.uiMgr.getUI(UIDraw);
  11335. let end = xGame.uiMgr.getUI(UIGameEnd);
  11336. let skill = xGame.uiMgr.getUI(UISkill);
  11337. if (sign && !sign.isHide)
  11338. moneyNode = sign.ui.moneyNode;
  11339. if (draw && !draw.isHide)
  11340. moneyNode = draw.ui.moneyNode;
  11341. if (end && !end.isHide)
  11342. moneyNode = end.ui.moneyNode;
  11343. if (skill && !skill.isHide)
  11344. moneyNode = skill.ui.moneyNode;
  11345. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11346. let main = xGame.uiMgr.getUI(UIMain);
  11347. if (condition1 && main && !main.isHide) {
  11348. moneyNode = main.ui.moneyNode;
  11349. }
  11350. return moneyNode;
  11351. }
  11352. playObjFlyAnim(num, type, callback = null) {
  11353. this.stPos.x = Laya.stage.width / 2;
  11354. this.stPos.y = Laya.stage.height / 2;
  11355. let moneyNode = this.getMoneyNode();
  11356. switch (type) {
  11357. case Prop.diamond:
  11358. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11359. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11360. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11361. this.edPos.x /= 2;
  11362. this.edPos.y /= 2;
  11363. break;
  11364. case Prop.coin:
  11365. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11366. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11367. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11368. this.edPos.x /= 2;
  11369. this.edPos.y /= 2;
  11370. break;
  11371. default:
  11372. break;
  11373. }
  11374. xGame.soundMgr.playSound("coinbag");
  11375. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11376. switch (type) {
  11377. case Prop.diamond:
  11378. DataMgr.setDiamond(num);
  11379. break;
  11380. case Prop.coin:
  11381. DataMgr.setCoin(num);
  11382. break;
  11383. default:
  11384. break;
  11385. }
  11386. callback && callback();
  11387. });
  11388. }
  11389. autoPopUIView() {
  11390. let arr = [];
  11391. let sign = this.judgeSameDay() ? false : true;
  11392. if (sign)
  11393. arr.push("sign");
  11394. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11395. if (draw)
  11396. arr.push("draw");
  11397. if (arr.length <= 0)
  11398. return;
  11399. let str = this.getRandArrEle(arr);
  11400. switch (str) {
  11401. case "sign":
  11402. xGame.uiMgr.Show(UISign);
  11403. break;
  11404. case "draw":
  11405. xGame.uiMgr.Show(UIDraw);
  11406. break;
  11407. default:
  11408. break;
  11409. }
  11410. }
  11411. getMSTime(time) {
  11412. let min = Math.floor(time / 60);
  11413. let sec = Math.floor((time - min * 60));
  11414. if (sec < 10)
  11415. sec = "0" + sec;
  11416. if (min < 10)
  11417. min = "0" + min;
  11418. return `${min}:${sec}`;
  11419. }
  11420. testPower() {
  11421. DataMgr.setPower(0, false);
  11422. }
  11423. getAllStarNum() {
  11424. let data = DataMgr.getPlaceBallLevelList();
  11425. let out = 0;
  11426. for (let index = 0; index < data.length; index++) {
  11427. out += data[index].star;
  11428. }
  11429. return out;
  11430. }
  11431. recoverCameraView() {
  11432. Laya.timer.once(900, this, () => {
  11433. xGame.common.showOneCamera("mainCamera");
  11434. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11435. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11436. xGame.common.gameUI.ui.border.alpha = 0;
  11437. if (Laya.physicsTimer.scale < 1) {
  11438. Laya.physicsTimer.scale = 1;
  11439. }
  11440. }
  11441. });
  11442. }
  11443. getClassicLevel() {
  11444. let successTimes = DataMgr.getClassicTimes();
  11445. let needKey = "";
  11446. let lastKey = "";
  11447. let cfg = cfgTable.classictimesData;
  11448. let data;
  11449. for (const key in cfg) {
  11450. data = cfg[key];
  11451. if (successTimes <= data.times) {
  11452. needKey = key;
  11453. }
  11454. lastKey = key;
  11455. }
  11456. if (needKey == "")
  11457. needKey = lastKey;
  11458. return cfg[needKey];
  11459. }
  11460. }
  11461. Common._instance = null;
  11462. class ui_Component92 extends fgui.GComponent {
  11463. static createInstance() {
  11464. return (fgui.UIPackage.createObject("game", "Component92"));
  11465. }
  11466. onConstruct() {
  11467. this.n0 = (this.getChild("n0"));
  11468. }
  11469. }
  11470. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11471. class ui_Component129 extends fgui.GProgressBar {
  11472. static createInstance() {
  11473. return (fgui.UIPackage.createObject("game", "Component129"));
  11474. }
  11475. onConstruct() {
  11476. this.bar_v = (this.getChild("bar_v"));
  11477. this.n84 = (this.getChild("n84"));
  11478. }
  11479. }
  11480. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11481. class ui_Component130 extends fgui.GComponent {
  11482. static createInstance() {
  11483. return (fgui.UIPackage.createObject("game", "Component130"));
  11484. }
  11485. onConstruct() {
  11486. this.ani = (this.getChild("ani"));
  11487. this.t0 = this.getTransition("t0");
  11488. }
  11489. }
  11490. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11491. class ui_powerEft extends fgui.GComponent {
  11492. static createInstance() {
  11493. return (fgui.UIPackage.createObject("game", "powerEft"));
  11494. }
  11495. onConstruct() {
  11496. this.ani = (this.getChild("ani"));
  11497. this.n88 = (this.getChild("n88"));
  11498. this.n89 = (this.getChild("n89"));
  11499. }
  11500. }
  11501. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11502. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11503. static createInstance() {
  11504. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11505. }
  11506. onConstruct() {
  11507. this.c1 = this.getController("c1");
  11508. this.n2 = (this.getChild("n2"));
  11509. this.n22 = (this.getChild("n22"));
  11510. this.n23 = (this.getChild("n23"));
  11511. this.n15 = (this.getChild("n15"));
  11512. this.challenge = (this.getChild("challenge"));
  11513. this.n17 = (this.getChild("n17"));
  11514. this.n3 = (this.getChild("n3"));
  11515. this.starNode = (this.getChild("starNode"));
  11516. this.levelTxt = (this.getChild("levelTxt"));
  11517. this.n14 = (this.getChild("n14"));
  11518. this.n19 = (this.getChild("n19"));
  11519. this.n20 = (this.getChild("n20"));
  11520. this.n21 = (this.getChild("n21"));
  11521. this.special = (this.getChild("special"));
  11522. }
  11523. }
  11524. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11525. class ui_Component79 extends fgui.GComponent {
  11526. static createInstance() {
  11527. return (fgui.UIPackage.createObject("game", "Component79"));
  11528. }
  11529. onConstruct() {
  11530. this.c1 = this.getController("c1");
  11531. this.n7 = (this.getChild("n7"));
  11532. this.n8 = (this.getChild("n8"));
  11533. this.n9 = (this.getChild("n9"));
  11534. this.n10 = (this.getChild("n10"));
  11535. this.n11 = (this.getChild("n11"));
  11536. this.n12 = (this.getChild("n12"));
  11537. }
  11538. }
  11539. ui_Component79.URL = "ui://isxx5ak7avag477";
  11540. class ui_Component80 extends fgui.GComponent {
  11541. static createInstance() {
  11542. return (fgui.UIPackage.createObject("game", "Component80"));
  11543. }
  11544. onConstruct() {
  11545. this.n0 = (this.getChild("n0"));
  11546. this.n1 = (this.getChild("n1"));
  11547. this.myList = (this.getChild("myList"));
  11548. this.t0 = this.getTransition("t0");
  11549. }
  11550. }
  11551. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11552. class ui_SignNormal extends fgui.GComponent {
  11553. static createInstance() {
  11554. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11555. }
  11556. onConstruct() {
  11557. this.c1 = this.getController("c1");
  11558. this.n7 = (this.getChild("n7"));
  11559. this.n15 = (this.getChild("n15"));
  11560. this.titleTxt = (this.getChild("titleTxt"));
  11561. this.n8 = (this.getChild("n8"));
  11562. this.myIcon = (this.getChild("myIcon"));
  11563. this.numTxt = (this.getChild("numTxt"));
  11564. this.n12 = (this.getChild("n12"));
  11565. this.n13 = (this.getChild("n13"));
  11566. this.n17 = (this.getChild("n17"));
  11567. this.n14 = (this.getChild("n14"));
  11568. }
  11569. }
  11570. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11571. class ui_screenNode extends fgui.GComponent {
  11572. static createInstance() {
  11573. return (fgui.UIPackage.createObject("game", "screenNode"));
  11574. }
  11575. onConstruct() {
  11576. this.n9 = (this.getChild("n9"));
  11577. this.screenImg = (this.getChild("screenImg"));
  11578. }
  11579. }
  11580. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11581. class ui_GetAwrad_com1 extends fgui.GComponent {
  11582. static createInstance() {
  11583. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11584. }
  11585. onConstruct() {
  11586. this.n38 = (this.getChild("n38"));
  11587. this.n39 = (this.getChild("n39"));
  11588. this.n40 = (this.getChild("n40"));
  11589. this.t0 = this.getTransition("t0");
  11590. this.t1 = this.getTransition("t1");
  11591. }
  11592. }
  11593. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11594. class ui_GetAwrad_com2 extends fgui.GComponent {
  11595. static createInstance() {
  11596. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11597. }
  11598. onConstruct() {
  11599. this.n39 = (this.getChild("n39"));
  11600. this.n40 = (this.getChild("n40"));
  11601. this.t0 = this.getTransition("t0");
  11602. }
  11603. }
  11604. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11605. class ui_Component128 extends fgui.GComponent {
  11606. static createInstance() {
  11607. return (fgui.UIPackage.createObject("game", "Component128"));
  11608. }
  11609. onConstruct() {
  11610. this.n38 = (this.getChild("n38"));
  11611. this.n40 = (this.getChild("n40"));
  11612. }
  11613. }
  11614. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11615. class ui_Component100_1 extends fgui.GComponent {
  11616. static createInstance() {
  11617. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11618. }
  11619. onConstruct() {
  11620. this.myNode = (this.getChild("myNode"));
  11621. this.t0 = this.getTransition("t0");
  11622. }
  11623. }
  11624. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11625. class ui_Component142 extends fgui.GComponent {
  11626. static createInstance() {
  11627. return (fgui.UIPackage.createObject("game", "Component142"));
  11628. }
  11629. onConstruct() {
  11630. this.n41 = (this.getChild("n41"));
  11631. this.n42 = (this.getChild("n42"));
  11632. }
  11633. }
  11634. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11635. class ui_main_guang extends fgui.GComponent {
  11636. static createInstance() {
  11637. return (fgui.UIPackage.createObject("game", "main_guang"));
  11638. }
  11639. onConstruct() {
  11640. this.n1 = (this.getChild("n1"));
  11641. this.n2 = (this.getChild("n2"));
  11642. this.n3 = (this.getChild("n3"));
  11643. this.n4 = (this.getChild("n4"));
  11644. this.n5 = (this.getChild("n5"));
  11645. this.n6 = (this.getChild("n6"));
  11646. this.n8 = (this.getChild("n8"));
  11647. this.t0 = this.getTransition("t0");
  11648. }
  11649. }
  11650. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11651. class ui_try_com1 extends fgui.GComponent {
  11652. static createInstance() {
  11653. return (fgui.UIPackage.createObject("game", "try_com1"));
  11654. }
  11655. onConstruct() {
  11656. this.c1 = this.getController("c1");
  11657. this.n0 = (this.getChild("n0"));
  11658. this.n2 = (this.getChild("n2"));
  11659. this.cancelBtn = (this.getChild("cancelBtn"));
  11660. this.videoBtn = (this.getChild("videoBtn"));
  11661. this.n9 = (this.getChild("n9"));
  11662. this.n24 = (this.getChild("n24"));
  11663. this.titleTxt = (this.getChild("titleTxt"));
  11664. this.n32 = (this.getChild("n32"));
  11665. this.n29 = (this.getChild("n29"));
  11666. this.n36 = (this.getChild("n36"));
  11667. this.txtTime = (this.getChild("txtTime"));
  11668. this.t0 = this.getTransition("t0");
  11669. }
  11670. }
  11671. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11672. class ui_try_com2 extends fgui.GComponent {
  11673. static createInstance() {
  11674. return (fgui.UIPackage.createObject("game", "try_com2"));
  11675. }
  11676. onConstruct() {
  11677. this.skillicon = (this.getChild("skillicon"));
  11678. this.n35 = (this.getChild("n35"));
  11679. this.n31 = (this.getChild("n31"));
  11680. this.n32 = (this.getChild("n32"));
  11681. this.n33 = (this.getChild("n33"));
  11682. this.n34 = (this.getChild("n34"));
  11683. }
  11684. }
  11685. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11686. class ui_try_com3 extends fgui.GComponent {
  11687. static createInstance() {
  11688. return (fgui.UIPackage.createObject("game", "try_com3"));
  11689. }
  11690. onConstruct() {
  11691. this.n33 = (this.getChild("n33"));
  11692. this.n34 = (this.getChild("n34"));
  11693. this.n35 = (this.getChild("n35"));
  11694. this.t0 = this.getTransition("t0");
  11695. }
  11696. }
  11697. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11698. class ui_huihe1 extends fgui.GComponent {
  11699. static createInstance() {
  11700. return (fgui.UIPackage.createObject("game", "huihe1"));
  11701. }
  11702. onConstruct() {
  11703. this.n0 = (this.getChild("n0"));
  11704. this.n1 = (this.getChild("n1"));
  11705. this.t0 = this.getTransition("t0");
  11706. }
  11707. }
  11708. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11709. class ui_huihe2 extends fgui.GComponent {
  11710. static createInstance() {
  11711. return (fgui.UIPackage.createObject("game", "huihe2"));
  11712. }
  11713. onConstruct() {
  11714. this.n0 = (this.getChild("n0"));
  11715. this.n1 = (this.getChild("n1"));
  11716. this.t0 = this.getTransition("t0");
  11717. }
  11718. }
  11719. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11720. class ui_Component143 extends fgui.GComponent {
  11721. static createInstance() {
  11722. return (fgui.UIPackage.createObject("game", "Component143"));
  11723. }
  11724. onConstruct() {
  11725. this.n3 = (this.getChild("n3"));
  11726. this.n4 = (this.getChild("n4"));
  11727. this.n5 = (this.getChild("n5"));
  11728. this.n6 = (this.getChild("n6"));
  11729. this.n7 = (this.getChild("n7"));
  11730. this.n8 = (this.getChild("n8"));
  11731. this.n9 = (this.getChild("n9"));
  11732. this.n10 = (this.getChild("n10"));
  11733. this.t0 = this.getTransition("t0");
  11734. }
  11735. }
  11736. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11737. class ui_dh_jingbi2 extends fgui.GComponent {
  11738. static createInstance() {
  11739. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11740. }
  11741. onConstruct() {
  11742. this.n0 = (this.getChild("n0"));
  11743. this.n1 = (this.getChild("n1"));
  11744. this.n2 = (this.getChild("n2"));
  11745. this.n3 = (this.getChild("n3"));
  11746. this.n4 = (this.getChild("n4"));
  11747. this.n5 = (this.getChild("n5"));
  11748. this.n6 = (this.getChild("n6"));
  11749. this.n8 = (this.getChild("n8"));
  11750. this.n10 = (this.getChild("n10"));
  11751. this.t0 = this.getTransition("t0");
  11752. }
  11753. }
  11754. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11755. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11756. static createInstance() {
  11757. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11758. }
  11759. onConstruct() {
  11760. this.n1 = (this.getChild("n1"));
  11761. this.n4 = (this.getChild("n4"));
  11762. this.t0 = this.getTransition("t0");
  11763. }
  11764. }
  11765. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11766. class ui_dh_jingbi3 extends fgui.GComponent {
  11767. static createInstance() {
  11768. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11769. }
  11770. onConstruct() {
  11771. this.n0 = (this.getChild("n0"));
  11772. this.n1 = (this.getChild("n1"));
  11773. this.n2 = (this.getChild("n2"));
  11774. this.n3 = (this.getChild("n3"));
  11775. this.n4 = (this.getChild("n4"));
  11776. this.n5 = (this.getChild("n5"));
  11777. this.n6 = (this.getChild("n6"));
  11778. this.n8 = (this.getChild("n8"));
  11779. this.n10 = (this.getChild("n10"));
  11780. this.t0 = this.getTransition("t0");
  11781. }
  11782. }
  11783. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11784. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11785. static createInstance() {
  11786. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11787. }
  11788. onConstruct() {
  11789. this.n3 = (this.getChild("n3"));
  11790. this.n1 = (this.getChild("n1"));
  11791. this.t0 = this.getTransition("t0");
  11792. }
  11793. }
  11794. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11795. class ui_hb_jinbi1 extends fgui.GButton {
  11796. static createInstance() {
  11797. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11798. }
  11799. onConstruct() {
  11800. this.n20 = (this.getChild("n20"));
  11801. this.n25 = (this.getChild("n25"));
  11802. this.coinTxt = (this.getChild("coinTxt"));
  11803. this.n28 = (this.getChild("n28"));
  11804. this.n32 = (this.getChild("n32"));
  11805. this.n38 = (this.getChild("n38"));
  11806. this.n45 = (this.getChild("n45"));
  11807. this.getTips = (this.getChild("getTips"));
  11808. this.n39 = (this.getChild("n39"));
  11809. this.diamondTxt = (this.getChild("diamondTxt"));
  11810. this.n41 = (this.getChild("n41"));
  11811. this.n42 = (this.getChild("n42"));
  11812. this.n46 = (this.getChild("n46"));
  11813. this.n47 = (this.getChild("n47"));
  11814. this.n48 = (this.getChild("n48"));
  11815. this.t0 = this.getTransition("t0");
  11816. }
  11817. }
  11818. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11819. class ui_hb_jinbi2 extends fgui.GButton {
  11820. static createInstance() {
  11821. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11822. }
  11823. onConstruct() {
  11824. this.n20 = (this.getChild("n20"));
  11825. this.n25 = (this.getChild("n25"));
  11826. this.coinTxt = (this.getChild("coinTxt"));
  11827. this.n28 = (this.getChild("n28"));
  11828. this.n32 = (this.getChild("n32"));
  11829. this.n38 = (this.getChild("n38"));
  11830. this.n39 = (this.getChild("n39"));
  11831. this.diamondTxt = (this.getChild("diamondTxt"));
  11832. this.n41 = (this.getChild("n41"));
  11833. this.n42 = (this.getChild("n42"));
  11834. this.n43 = (this.getChild("n43"));
  11835. this.n44 = (this.getChild("n44"));
  11836. this.n45 = (this.getChild("n45"));
  11837. this.t0 = this.getTransition("t0");
  11838. }
  11839. }
  11840. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11841. class ui_hb_jinbi3 extends fgui.GButton {
  11842. static createInstance() {
  11843. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11844. }
  11845. onConstruct() {
  11846. this.n20 = (this.getChild("n20"));
  11847. this.n25 = (this.getChild("n25"));
  11848. this.coinTxt = (this.getChild("coinTxt"));
  11849. this.n28 = (this.getChild("n28"));
  11850. this.n32 = (this.getChild("n32"));
  11851. this.n38 = (this.getChild("n38"));
  11852. this.n39 = (this.getChild("n39"));
  11853. this.diamondTxt = (this.getChild("diamondTxt"));
  11854. this.n41 = (this.getChild("n41"));
  11855. this.n42 = (this.getChild("n42"));
  11856. this.n43 = (this.getChild("n43"));
  11857. this.n44 = (this.getChild("n44"));
  11858. this.n45 = (this.getChild("n45"));
  11859. this.t0 = this.getTransition("t0");
  11860. }
  11861. }
  11862. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11863. class ui_Component104 extends fgui.GComponent {
  11864. static createInstance() {
  11865. return (fgui.UIPackage.createObject("game", "Component104"));
  11866. }
  11867. onConstruct() {
  11868. this.c1 = this.getController("c1");
  11869. this.n12 = (this.getChild("n12"));
  11870. this.coinBtn = (this.getChild("coinBtn"));
  11871. this.diamondBtn = (this.getChild("diamondBtn"));
  11872. this.node3 = (this.getChild("node3"));
  11873. this.node4 = (this.getChild("node4"));
  11874. this.node5 = (this.getChild("node5"));
  11875. this.node1 = (this.getChild("node1"));
  11876. this.node2 = (this.getChild("node2"));
  11877. this.node6 = (this.getChild("node6"));
  11878. this.t0 = this.getTransition("t0");
  11879. }
  11880. }
  11881. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11882. class ui_Component105 extends fgui.GButton {
  11883. static createInstance() {
  11884. return (fgui.UIPackage.createObject("game", "Component105"));
  11885. }
  11886. onConstruct() {
  11887. this.c1 = this.getController("c1");
  11888. this.n49 = (this.getChild("n49"));
  11889. this.n18 = (this.getChild("n18"));
  11890. this.n46 = (this.getChild("n46"));
  11891. this.n48 = (this.getChild("n48"));
  11892. }
  11893. }
  11894. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11895. class ui_Component106 extends fgui.GButton {
  11896. static createInstance() {
  11897. return (fgui.UIPackage.createObject("game", "Component106"));
  11898. }
  11899. onConstruct() {
  11900. this.c1 = this.getController("c1");
  11901. this.n49 = (this.getChild("n49"));
  11902. this.n18 = (this.getChild("n18"));
  11903. this.n46 = (this.getChild("n46"));
  11904. this.n48 = (this.getChild("n48"));
  11905. }
  11906. }
  11907. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11908. class ui_hb_zs1 extends fgui.GButton {
  11909. static createInstance() {
  11910. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11911. }
  11912. onConstruct() {
  11913. this.c1 = this.getController("c1");
  11914. this.n20 = (this.getChild("n20"));
  11915. this.n21 = (this.getChild("n21"));
  11916. this.n26 = (this.getChild("n26"));
  11917. this.n27 = (this.getChild("n27"));
  11918. this.shareTxt = (this.getChild("shareTxt"));
  11919. this.n32 = (this.getChild("n32"));
  11920. this.n38 = (this.getChild("n38"));
  11921. this.n39 = (this.getChild("n39"));
  11922. this.n44 = (this.getChild("n44"));
  11923. this.diamondTxt = (this.getChild("diamondTxt"));
  11924. this.n41 = (this.getChild("n41"));
  11925. this.n45 = (this.getChild("n45"));
  11926. this.n47 = (this.getChild("n47"));
  11927. this.n48 = (this.getChild("n48"));
  11928. this.randTxt = (this.getChild("randTxt"));
  11929. this.n50 = (this.getChild("n50"));
  11930. this.t0 = this.getTransition("t0");
  11931. }
  11932. }
  11933. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11934. class ui_dh_zs1 extends fgui.GComponent {
  11935. static createInstance() {
  11936. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11937. }
  11938. onConstruct() {
  11939. this.n10 = (this.getChild("n10"));
  11940. this.n9 = (this.getChild("n9"));
  11941. this.n1 = (this.getChild("n1"));
  11942. this.n2 = (this.getChild("n2"));
  11943. this.n3 = (this.getChild("n3"));
  11944. this.n4 = (this.getChild("n4"));
  11945. this.n5 = (this.getChild("n5"));
  11946. this.n6 = (this.getChild("n6"));
  11947. this.n8 = (this.getChild("n8"));
  11948. this.n11 = (this.getChild("n11"));
  11949. this.t0 = this.getTransition("t0");
  11950. }
  11951. }
  11952. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11953. class ui_dh_zs1_1 extends fgui.GComponent {
  11954. static createInstance() {
  11955. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11956. }
  11957. onConstruct() {
  11958. this.n3 = (this.getChild("n3"));
  11959. this.n1 = (this.getChild("n1"));
  11960. this.t0 = this.getTransition("t0");
  11961. }
  11962. }
  11963. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11964. class ui_hb_zs2 extends fgui.GButton {
  11965. static createInstance() {
  11966. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11967. }
  11968. onConstruct() {
  11969. this.n20 = (this.getChild("n20"));
  11970. this.n21 = (this.getChild("n21"));
  11971. this.n26 = (this.getChild("n26"));
  11972. this.n27 = (this.getChild("n27"));
  11973. this.n32 = (this.getChild("n32"));
  11974. this.n38 = (this.getChild("n38"));
  11975. this.n39 = (this.getChild("n39"));
  11976. this.n44 = (this.getChild("n44"));
  11977. this.diamondTxt = (this.getChild("diamondTxt"));
  11978. this.n41 = (this.getChild("n41"));
  11979. this.n45 = (this.getChild("n45"));
  11980. this.t0 = this.getTransition("t0");
  11981. }
  11982. }
  11983. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11984. class ui_hb_zs3 extends fgui.GButton {
  11985. static createInstance() {
  11986. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11987. }
  11988. onConstruct() {
  11989. this.n20 = (this.getChild("n20"));
  11990. this.n21 = (this.getChild("n21"));
  11991. this.n26 = (this.getChild("n26"));
  11992. this.n27 = (this.getChild("n27"));
  11993. this.n32 = (this.getChild("n32"));
  11994. this.n38 = (this.getChild("n38"));
  11995. this.n47 = (this.getChild("n47"));
  11996. this.t0 = this.getTransition("t0");
  11997. }
  11998. }
  11999. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12000. class ui_dh_zs2 extends fgui.GComponent {
  12001. static createInstance() {
  12002. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12003. }
  12004. onConstruct() {
  12005. this.n10 = (this.getChild("n10"));
  12006. this.n9 = (this.getChild("n9"));
  12007. this.n1 = (this.getChild("n1"));
  12008. this.n2 = (this.getChild("n2"));
  12009. this.n3 = (this.getChild("n3"));
  12010. this.n4 = (this.getChild("n4"));
  12011. this.n5 = (this.getChild("n5"));
  12012. this.n6 = (this.getChild("n6"));
  12013. this.n8 = (this.getChild("n8"));
  12014. this.n11 = (this.getChild("n11"));
  12015. this.t0 = this.getTransition("t0");
  12016. }
  12017. }
  12018. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12019. class ui_dh_zs2_1 extends fgui.GComponent {
  12020. static createInstance() {
  12021. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12022. }
  12023. onConstruct() {
  12024. this.n3 = (this.getChild("n3"));
  12025. this.n1 = (this.getChild("n1"));
  12026. this.t0 = this.getTransition("t0");
  12027. }
  12028. }
  12029. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12030. class ui_dh_zs3 extends fgui.GComponent {
  12031. static createInstance() {
  12032. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12033. }
  12034. onConstruct() {
  12035. this.n10 = (this.getChild("n10"));
  12036. this.n9 = (this.getChild("n9"));
  12037. this.n1 = (this.getChild("n1"));
  12038. this.n2 = (this.getChild("n2"));
  12039. this.n3 = (this.getChild("n3"));
  12040. this.n4 = (this.getChild("n4"));
  12041. this.n5 = (this.getChild("n5"));
  12042. this.n6 = (this.getChild("n6"));
  12043. this.n8 = (this.getChild("n8"));
  12044. this.n11 = (this.getChild("n11"));
  12045. this.t0 = this.getTransition("t0");
  12046. }
  12047. }
  12048. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12049. class ui_dh_zs3_1 extends fgui.GComponent {
  12050. static createInstance() {
  12051. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12052. }
  12053. onConstruct() {
  12054. this.n3 = (this.getChild("n3"));
  12055. this.n1 = (this.getChild("n1"));
  12056. this.t0 = this.getTransition("t0");
  12057. }
  12058. }
  12059. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12060. class ui_Component107 extends fgui.GComponent {
  12061. static createInstance() {
  12062. return (fgui.UIPackage.createObject("game", "Component107"));
  12063. }
  12064. onConstruct() {
  12065. this.n18 = (this.getChild("n18"));
  12066. this.n19 = (this.getChild("n19"));
  12067. this.n20 = (this.getChild("n20"));
  12068. this.n21 = (this.getChild("n21"));
  12069. this.n22 = (this.getChild("n22"));
  12070. this.levelTxt = (this.getChild("levelTxt"));
  12071. this.t0 = this.getTransition("t0");
  12072. }
  12073. }
  12074. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12075. class ui_box_com1 extends fgui.GComponent {
  12076. static createInstance() {
  12077. return (fgui.UIPackage.createObject("game", "box_com1"));
  12078. }
  12079. onConstruct() {
  12080. this.n14 = (this.getChild("n14"));
  12081. this.n6 = (this.getChild("n6"));
  12082. this.t0 = this.getTransition("t0");
  12083. }
  12084. }
  12085. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12086. class ui_box_com2 extends fgui.GProgressBar {
  12087. static createInstance() {
  12088. return (fgui.UIPackage.createObject("game", "box_com2"));
  12089. }
  12090. onConstruct() {
  12091. this.bg0 = (this.getChild("bg0"));
  12092. this.bg = (this.getChild("bg"));
  12093. this.bar = (this.getChild("bar"));
  12094. this.n7 = (this.getChild("n7"));
  12095. this.n8 = (this.getChild("n8"));
  12096. this.n10 = (this.getChild("n10"));
  12097. this.n11 = (this.getChild("n11"));
  12098. this.n12 = (this.getChild("n12"));
  12099. }
  12100. }
  12101. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12102. class ui_box_com4 extends fgui.GComponent {
  12103. static createInstance() {
  12104. return (fgui.UIPackage.createObject("game", "box_com4"));
  12105. }
  12106. onConstruct() {
  12107. this.n8 = (this.getChild("n8"));
  12108. this.t0 = this.getTransition("t0");
  12109. }
  12110. }
  12111. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12112. class ui_box_com3 extends fgui.GComponent {
  12113. static createInstance() {
  12114. return (fgui.UIPackage.createObject("game", "box_com3"));
  12115. }
  12116. onConstruct() {
  12117. this.n2 = (this.getChild("n2"));
  12118. this.n3 = (this.getChild("n3"));
  12119. this.n4 = (this.getChild("n4"));
  12120. this.n5 = (this.getChild("n5"));
  12121. this.t0 = this.getTransition("t0");
  12122. this.t1 = this.getTransition("t1");
  12123. }
  12124. }
  12125. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12126. class ui_Component97 extends fgui.GComponent {
  12127. static createInstance() {
  12128. return (fgui.UIPackage.createObject("game", "Component97"));
  12129. }
  12130. onConstruct() {
  12131. this.c1 = this.getController("c1");
  12132. this.n46 = (this.getChild("n46"));
  12133. this.diamondNode = (this.getChild("diamondNode"));
  12134. this.coinNode = (this.getChild("coinNode"));
  12135. this.t0 = this.getTransition("t0");
  12136. }
  12137. }
  12138. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12139. class ui_Component98 extends fgui.GButton {
  12140. static createInstance() {
  12141. return (fgui.UIPackage.createObject("game", "Component98"));
  12142. }
  12143. onConstruct() {
  12144. this.n8 = (this.getChild("n8"));
  12145. this.n40 = (this.getChild("n40"));
  12146. }
  12147. }
  12148. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12149. class ui_Component28_11 extends fgui.GButton {
  12150. static createInstance() {
  12151. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12152. }
  12153. onConstruct() {
  12154. this.c1 = this.getController("c1");
  12155. this.n12 = (this.getChild("n12"));
  12156. this.n17 = (this.getChild("n17"));
  12157. this.n13 = (this.getChild("n13"));
  12158. this.diamondTxt = (this.getChild("diamondTxt"));
  12159. this.n15 = (this.getChild("n15"));
  12160. this.n16 = (this.getChild("n16"));
  12161. }
  12162. }
  12163. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12164. class ui_Component58_11 extends fgui.GComponent {
  12165. static createInstance() {
  12166. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12167. }
  12168. onConstruct() {
  12169. this.n23 = (this.getChild("n23"));
  12170. this.n41 = (this.getChild("n41"));
  12171. this.myList = (this.getChild("myList"));
  12172. this.n45 = (this.getChild("n45"));
  12173. this.n44 = (this.getChild("n44"));
  12174. this.t0 = this.getTransition("t0");
  12175. }
  12176. }
  12177. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12178. class ui_Component100 extends fgui.GComponent {
  12179. static createInstance() {
  12180. return (fgui.UIPackage.createObject("game", "Component100"));
  12181. }
  12182. onConstruct() {
  12183. this.c1 = this.getController("c1");
  12184. this.n75 = (this.getChild("n75"));
  12185. this.n76 = (this.getChild("n76"));
  12186. this.n80 = (this.getChild("n80"));
  12187. this.txt = (this.getChild("txt"));
  12188. this.spineRoot = (this.getChild("spineRoot"));
  12189. }
  12190. }
  12191. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12192. class ui_Component101 extends fgui.GComponent {
  12193. static createInstance() {
  12194. return (fgui.UIPackage.createObject("game", "Component101"));
  12195. }
  12196. onConstruct() {
  12197. this.c1 = this.getController("c1");
  12198. this.n36 = (this.getChild("n36"));
  12199. this.n35 = (this.getChild("n35"));
  12200. this.n33 = (this.getChild("n33"));
  12201. this.n34 = (this.getChild("n34"));
  12202. }
  12203. }
  12204. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12205. class ui_Component53 extends fgui.GComponent {
  12206. static createInstance() {
  12207. return (fgui.UIPackage.createObject("game", "Component53"));
  12208. }
  12209. onConstruct() {
  12210. this.n0 = (this.getChild("n0"));
  12211. this.n1 = (this.getChild("n1"));
  12212. this.n2 = (this.getChild("n2"));
  12213. this.n3 = (this.getChild("n3"));
  12214. this.n4 = (this.getChild("n4"));
  12215. this.n5 = (this.getChild("n5"));
  12216. this.n6 = (this.getChild("n6"));
  12217. this.n7 = (this.getChild("n7"));
  12218. this.n8 = (this.getChild("n8"));
  12219. this.n9 = (this.getChild("n9"));
  12220. this.n10 = (this.getChild("n10"));
  12221. this.n11 = (this.getChild("n11"));
  12222. this.n12 = (this.getChild("n12"));
  12223. this.n13 = (this.getChild("n13"));
  12224. this.n14 = (this.getChild("n14"));
  12225. this.n15 = (this.getChild("n15"));
  12226. this.n16 = (this.getChild("n16"));
  12227. this.n19 = (this.getChild("n19"));
  12228. this.n20 = (this.getChild("n20"));
  12229. this.n21 = (this.getChild("n21"));
  12230. this.n22 = (this.getChild("n22"));
  12231. this.n23 = (this.getChild("n23"));
  12232. this.n24 = (this.getChild("n24"));
  12233. this.n25 = (this.getChild("n25"));
  12234. this.n26 = (this.getChild("n26"));
  12235. this.n27 = (this.getChild("n27"));
  12236. this.n28 = (this.getChild("n28"));
  12237. this.n29 = (this.getChild("n29"));
  12238. this.n30 = (this.getChild("n30"));
  12239. this.n31 = (this.getChild("n31"));
  12240. this.n32 = (this.getChild("n32"));
  12241. this.n33 = (this.getChild("n33"));
  12242. this.n34 = (this.getChild("n34"));
  12243. this.n35 = (this.getChild("n35"));
  12244. this.t0 = this.getTransition("t0");
  12245. }
  12246. }
  12247. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12248. class ui_Component58 extends fgui.GComponent {
  12249. static createInstance() {
  12250. return (fgui.UIPackage.createObject("game", "Component58"));
  12251. }
  12252. onConstruct() {
  12253. this.n23 = (this.getChild("n23"));
  12254. this.n41 = (this.getChild("n41"));
  12255. this.n8 = (this.getChild("n8"));
  12256. this.skillList = (this.getChild("skillList"));
  12257. this.t0 = this.getTransition("t0");
  12258. }
  12259. }
  12260. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12261. class ui_Component59 extends fgui.GComponent {
  12262. static createInstance() {
  12263. return (fgui.UIPackage.createObject("game", "Component59"));
  12264. }
  12265. onConstruct() {
  12266. this.n3 = (this.getChild("n3"));
  12267. this.msgTxt = (this.getChild("msgTxt"));
  12268. this.t0 = this.getTransition("t0");
  12269. }
  12270. }
  12271. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12272. class ui_RulerNode extends fgui.GComponent {
  12273. static createInstance() {
  12274. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12275. }
  12276. onConstruct() {
  12277. this.n6 = (this.getChild("n6"));
  12278. this.n4 = (this.getChild("n4"));
  12279. this.img1 = (this.getChild("img1"));
  12280. this.img2 = (this.getChild("img2"));
  12281. }
  12282. }
  12283. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12284. class ui_Component108 extends fgui.GComponent {
  12285. static createInstance() {
  12286. return (fgui.UIPackage.createObject("game", "Component108"));
  12287. }
  12288. onConstruct() {
  12289. this.n19 = (this.getChild("n19"));
  12290. this.t0 = this.getTransition("t0");
  12291. }
  12292. }
  12293. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12294. class ui_Component63 extends fgui.GComponent {
  12295. static createInstance() {
  12296. return (fgui.UIPackage.createObject("game", "Component63"));
  12297. }
  12298. onConstruct() {
  12299. this.n66 = (this.getChild("n66"));
  12300. this.n56 = (this.getChild("n56"));
  12301. this.n63 = (this.getChild("n63"));
  12302. this.n65 = (this.getChild("n65"));
  12303. this.t0 = this.getTransition("t0");
  12304. }
  12305. }
  12306. ui_Component63.URL = "ui://isxx5ak7h657452";
  12307. class ui_topNode extends fgui.GComponent {
  12308. static createInstance() {
  12309. return (fgui.UIPackage.createObject("game", "topNode"));
  12310. }
  12311. onConstruct() {
  12312. this.selfProgress = (this.getChild("selfProgress"));
  12313. this.aiProgress = (this.getChild("aiProgress"));
  12314. this.selfKuang = (this.getChild("selfKuang"));
  12315. this.aiKuang = (this.getChild("aiKuang"));
  12316. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12317. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12318. this.n33 = (this.getChild("n33"));
  12319. this.n34 = (this.getChild("n34"));
  12320. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12321. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12322. this.selfBallList = (this.getChild("selfBallList"));
  12323. this.aiBallList = (this.getChild("aiBallList"));
  12324. this.middleNode = (this.getChild("middleNode"));
  12325. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12326. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12327. this.scoreNode = (this.getChild("scoreNode"));
  12328. this.selfTips = (this.getChild("selfTips"));
  12329. this.aiTips = (this.getChild("aiTips"));
  12330. }
  12331. }
  12332. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12333. class ui_selfProgress extends fgui.GProgressBar {
  12334. static createInstance() {
  12335. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12336. }
  12337. onConstruct() {
  12338. this.n3 = (this.getChild("n3"));
  12339. this.bar = (this.getChild("bar"));
  12340. }
  12341. }
  12342. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12343. class ui_aiProgress extends fgui.GProgressBar {
  12344. static createInstance() {
  12345. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12346. }
  12347. onConstruct() {
  12348. this.n3 = (this.getChild("n3"));
  12349. this.bar = (this.getChild("bar"));
  12350. }
  12351. }
  12352. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12353. class ui_ballDisplay extends fgui.GComponent {
  12354. static createInstance() {
  12355. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12356. }
  12357. onConstruct() {
  12358. this.myImg = (this.getChild("myImg"));
  12359. }
  12360. }
  12361. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12362. class ui_moveNode extends fgui.GComponent {
  12363. static createInstance() {
  12364. return (fgui.UIPackage.createObject("game", "moveNode"));
  12365. }
  12366. onConstruct() {
  12367. this.n8 = (this.getChild("n8"));
  12368. this.finger = (this.getChild("finger"));
  12369. }
  12370. }
  12371. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12372. class ui_cancelBtn extends fgui.GButton {
  12373. static createInstance() {
  12374. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12375. }
  12376. onConstruct() {
  12377. this.c1 = this.getController("c1");
  12378. this.n0 = (this.getChild("n0"));
  12379. this.n1 = (this.getChild("n1"));
  12380. }
  12381. }
  12382. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12383. class ui_shareBtn extends fgui.GButton {
  12384. static createInstance() {
  12385. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12386. }
  12387. onConstruct() {
  12388. this.c1 = this.getController("c1");
  12389. this.n2 = (this.getChild("n2"));
  12390. this.n1 = (this.getChild("n1"));
  12391. this.n3 = (this.getChild("n3"));
  12392. this.n4 = (this.getChild("n4"));
  12393. this.n5 = (this.getChild("n5"));
  12394. this.n6 = (this.getChild("n6"));
  12395. }
  12396. }
  12397. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12398. class ui_share2Btn extends fgui.GButton {
  12399. static createInstance() {
  12400. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12401. }
  12402. onConstruct() {
  12403. this.n3 = (this.getChild("n3"));
  12404. }
  12405. }
  12406. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12407. class ui_rodMethodNode extends fgui.GComponent {
  12408. static createInstance() {
  12409. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12410. }
  12411. onConstruct() {
  12412. this.bg = (this.getChild("bg"));
  12413. this.dot = (this.getChild("dot"));
  12414. }
  12415. }
  12416. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12417. class ui_sureBtn extends fgui.GButton {
  12418. static createInstance() {
  12419. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12420. }
  12421. onConstruct() {
  12422. this.n2 = (this.getChild("n2"));
  12423. this.n1 = (this.getChild("n1"));
  12424. }
  12425. }
  12426. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12427. class ui_Component18 extends fgui.GComponent {
  12428. static createInstance() {
  12429. return (fgui.UIPackage.createObject("game", "Component18"));
  12430. }
  12431. onConstruct() {
  12432. this.c1 = this.getController("c1");
  12433. this.nameTxt = (this.getChild("nameTxt"));
  12434. this.headImg = (this.getChild("headImg"));
  12435. this.n24 = (this.getChild("n24"));
  12436. this.skillImg = (this.getChild("skillImg"));
  12437. this.skillTxt = (this.getChild("skillTxt"));
  12438. }
  12439. }
  12440. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12441. class ui_Component45 extends fgui.GComponent {
  12442. static createInstance() {
  12443. return (fgui.UIPackage.createObject("game", "Component45"));
  12444. }
  12445. onConstruct() {
  12446. this.c1 = this.getController("c1");
  12447. this.n40 = (this.getChild("n40"));
  12448. this.n41 = (this.getChild("n41"));
  12449. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12450. this.n42 = (this.getChild("n42"));
  12451. this.awardTxt = (this.getChild("awardTxt"));
  12452. this.n44 = (this.getChild("n44"));
  12453. this.t0 = this.getTransition("t0");
  12454. }
  12455. }
  12456. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12457. class ui_emotionDisplay extends fgui.GButton {
  12458. static createInstance() {
  12459. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12460. }
  12461. onConstruct() {
  12462. this.myIcon = (this.getChild("myIcon"));
  12463. }
  12464. }
  12465. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12466. class ui_Component49 extends fgui.GButton {
  12467. static createInstance() {
  12468. return (fgui.UIPackage.createObject("game", "Component49"));
  12469. }
  12470. onConstruct() {
  12471. this.n69 = (this.getChild("n69"));
  12472. this.n56 = (this.getChild("n56"));
  12473. }
  12474. }
  12475. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12476. class ui_Component50 extends fgui.GButton {
  12477. static createInstance() {
  12478. return (fgui.UIPackage.createObject("game", "Component50"));
  12479. }
  12480. onConstruct() {
  12481. this.n54 = (this.getChild("n54"));
  12482. this.n65 = (this.getChild("n65"));
  12483. }
  12484. }
  12485. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12486. class ui_Component51 extends fgui.GButton {
  12487. static createInstance() {
  12488. return (fgui.UIPackage.createObject("game", "Component51"));
  12489. }
  12490. onConstruct() {
  12491. this.c1 = this.getController("c1");
  12492. this.n51 = (this.getChild("n51"));
  12493. this.n54 = (this.getChild("n54"));
  12494. }
  12495. }
  12496. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12497. class ui_Button5 extends fgui.GButton {
  12498. static createInstance() {
  12499. return (fgui.UIPackage.createObject("game", "Button5"));
  12500. }
  12501. onConstruct() {
  12502. this.c1 = this.getController("c1");
  12503. this.n0 = (this.getChild("n0"));
  12504. this.n2 = (this.getChild("n2"));
  12505. }
  12506. }
  12507. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12508. class ui_Component124 extends fgui.GComponent {
  12509. static createInstance() {
  12510. return (fgui.UIPackage.createObject("game", "Component124"));
  12511. }
  12512. onConstruct() {
  12513. this.n22 = (this.getChild("n22"));
  12514. this.shareNode = (this.getChild("shareNode"));
  12515. }
  12516. }
  12517. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12518. class ui_Component125 extends fgui.GComponent {
  12519. static createInstance() {
  12520. return (fgui.UIPackage.createObject("game", "Component125"));
  12521. }
  12522. onConstruct() {
  12523. this.n29 = (this.getChild("n29"));
  12524. this.coinTxt = (this.getChild("coinTxt"));
  12525. }
  12526. }
  12527. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12528. class ui_Component52 extends fgui.GButton {
  12529. static createInstance() {
  12530. return (fgui.UIPackage.createObject("game", "Component52"));
  12531. }
  12532. onConstruct() {
  12533. this.n35 = (this.getChild("n35"));
  12534. this.n36 = (this.getChild("n36"));
  12535. }
  12536. }
  12537. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12538. class ui_drawBtn extends fgui.GButton {
  12539. static createInstance() {
  12540. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12541. }
  12542. onConstruct() {
  12543. this.c1 = this.getController("c1");
  12544. this.n2 = (this.getChild("n2"));
  12545. this.n1 = (this.getChild("n1"));
  12546. this.n5 = (this.getChild("n5"));
  12547. }
  12548. }
  12549. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12550. class ui_Component43 extends fgui.GButton {
  12551. static createInstance() {
  12552. return (fgui.UIPackage.createObject("game", "Component43"));
  12553. }
  12554. onConstruct() {
  12555. this.n49 = (this.getChild("n49"));
  12556. }
  12557. }
  12558. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12559. class ui_wordsDisplay extends fgui.GComponent {
  12560. static createInstance() {
  12561. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12562. }
  12563. onConstruct() {
  12564. this.txt = (this.getChild("txt"));
  12565. this.n63 = (this.getChild("n63"));
  12566. }
  12567. }
  12568. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12569. class ui_Component3 extends fgui.GComponent {
  12570. static createInstance() {
  12571. return (fgui.UIPackage.createObject("game", "Component3"));
  12572. }
  12573. onConstruct() {
  12574. this.n26 = (this.getChild("n26"));
  12575. this.n24 = (this.getChild("n24"));
  12576. this.nameTxt = (this.getChild("nameTxt"));
  12577. this.headRoot = (this.getChild("headRoot"));
  12578. }
  12579. }
  12580. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12581. class ui_Component4 extends fgui.GComponent {
  12582. static createInstance() {
  12583. return (fgui.UIPackage.createObject("game", "Component4"));
  12584. }
  12585. onConstruct() {
  12586. this.headImg = (this.getChild("headImg"));
  12587. }
  12588. }
  12589. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12590. class ui_Component7 extends fgui.GButton {
  12591. static createInstance() {
  12592. return (fgui.UIPackage.createObject("game", "Component7"));
  12593. }
  12594. onConstruct() {
  12595. this.n17 = (this.getChild("n17"));
  12596. }
  12597. }
  12598. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12599. class ui_Component8 extends fgui.GButton {
  12600. static createInstance() {
  12601. return (fgui.UIPackage.createObject("game", "Component8"));
  12602. }
  12603. onConstruct() {
  12604. this.n19 = (this.getChild("n19"));
  12605. }
  12606. }
  12607. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12608. class ui_Component9 extends fgui.GButton {
  12609. static createInstance() {
  12610. return (fgui.UIPackage.createObject("game", "Component9"));
  12611. }
  12612. onConstruct() {
  12613. this.n18 = (this.getChild("n18"));
  12614. }
  12615. }
  12616. ui_Component9.URL = "ui://isxx5ak7ixm43xs";
  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_Component9.URL, ui_Component9);
  14742. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14743. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14744. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14745. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14746. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14747. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14748. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14749. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14750. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14751. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14752. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14753. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14754. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14755. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14756. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14757. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14758. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14759. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14760. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14761. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14762. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14763. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14764. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14765. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14766. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14767. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14768. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14769. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14770. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14771. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14772. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14773. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14774. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14775. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14776. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14777. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14778. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14779. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14780. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14781. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14782. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14783. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14784. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14785. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14786. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14787. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14788. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14789. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14790. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14791. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14792. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14793. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14794. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14795. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14796. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14797. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14798. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14799. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14800. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14801. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14802. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14803. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14804. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14805. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14806. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14807. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14808. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14809. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14810. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14811. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14812. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14813. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14814. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14815. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14816. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14817. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14818. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14819. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14820. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14821. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14822. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14823. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14824. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14825. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14826. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14827. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14828. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14829. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14830. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14831. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14832. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14833. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14834. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14835. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14836. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14837. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14838. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14839. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14840. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14841. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14842. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14843. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14844. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14845. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14846. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14847. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14848. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14849. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14850. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14851. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14852. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14853. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14854. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14855. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14856. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14857. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14858. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14859. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14860. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14861. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14862. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14863. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14864. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14865. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14866. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14867. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14868. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14869. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14870. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14871. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14872. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14873. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14874. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14875. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14876. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14877. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14878. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14879. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14880. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14881. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14882. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14883. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14884. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14885. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14886. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14887. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14888. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14889. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14890. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14891. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14892. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14893. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14894. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14895. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14896. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14897. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14898. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14899. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14900. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14901. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14902. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14903. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14904. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14905. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14906. }
  14907. }
  14908. class ui_btn6 extends fgui.GButton {
  14909. static createInstance() {
  14910. return (fgui.UIPackage.createObject("loading", "btn6"));
  14911. }
  14912. onConstruct() {
  14913. this.n6 = (this.getChild("n6"));
  14914. this.n1 = (this.getChild("n1"));
  14915. }
  14916. }
  14917. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14918. class ui_xyItem extends fgui.GComponent {
  14919. static createInstance() {
  14920. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14921. }
  14922. onConstruct() {
  14923. this.xyItem = (this.getChild("xyItem"));
  14924. }
  14925. }
  14926. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14927. class ui_loadinfo extends fgui.GProgressBar {
  14928. static createInstance() {
  14929. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14930. }
  14931. onConstruct() {
  14932. this.bg = (this.getChild("bg"));
  14933. this.bar = (this.getChild("bar"));
  14934. this.title = (this.getChild("title"));
  14935. this.ani = (this.getChild("ani"));
  14936. }
  14937. }
  14938. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14939. class ui_xyNode extends fgui.GComponent {
  14940. static createInstance() {
  14941. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14942. }
  14943. onConstruct() {
  14944. this.n0 = (this.getChild("n0"));
  14945. this.btnYes = (this.getChild("btnYes"));
  14946. this.btnNo = (this.getChild("btnNo"));
  14947. this.btnKnown = (this.getChild("btnKnown"));
  14948. this.btnSure = (this.getChild("btnSure"));
  14949. this.txtWelcom = (this.getChild("txtWelcom"));
  14950. this.txtXy = (this.getChild("txtXy"));
  14951. this.n75 = (this.getChild("n75"));
  14952. this.btnXy1 = (this.getChild("btnXy1"));
  14953. this.btnXy3 = (this.getChild("btnXy3"));
  14954. this.btnXy2 = (this.getChild("btnXy2"));
  14955. this.n74 = (this.getChild("n74"));
  14956. this.xy1 = (this.getChild("xy1"));
  14957. this.txtTitle = (this.getChild("txtTitle"));
  14958. this.btnBack = (this.getChild("btnBack"));
  14959. this.xyList = (this.getChild("xyList"));
  14960. this.xy2 = (this.getChild("xy2"));
  14961. this.xyNode = (this.getChild("xyNode"));
  14962. }
  14963. }
  14964. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14965. class ui_ageNode extends fgui.GComponent {
  14966. static createInstance() {
  14967. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14968. }
  14969. onConstruct() {
  14970. this.n3 = (this.getChild("n3"));
  14971. this.n7 = (this.getChild("n7"));
  14972. this.n4 = (this.getChild("n4"));
  14973. this.btnAge = (this.getChild("btnAge"));
  14974. this.ageNode = (this.getChild("ageNode"));
  14975. }
  14976. }
  14977. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14978. class ui_rnNode extends fgui.GComponent {
  14979. static createInstance() {
  14980. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14981. }
  14982. onConstruct() {
  14983. this.n28 = (this.getChild("n28"));
  14984. this.n30 = (this.getChild("n30"));
  14985. this.n33 = (this.getChild("n33"));
  14986. this.rn1 = (this.getChild("rn1"));
  14987. this.n40 = (this.getChild("n40"));
  14988. this.n41 = (this.getChild("n41"));
  14989. this.rn3 = (this.getChild("rn3"));
  14990. this.n37 = (this.getChild("n37"));
  14991. this.n39 = (this.getChild("n39"));
  14992. this.rn2 = (this.getChild("rn2"));
  14993. this.n47 = (this.getChild("n47"));
  14994. this.n49 = (this.getChild("n49"));
  14995. this.n44 = (this.getChild("n44"));
  14996. this.inputCode = (this.getChild("inputCode"));
  14997. this.inputName = (this.getChild("inputName"));
  14998. this.n48 = (this.getChild("n48"));
  14999. this.n50 = (this.getChild("n50"));
  15000. this.rn4 = (this.getChild("rn4"));
  15001. this.btnCheck = (this.getChild("btnCheck"));
  15002. this.btnExit = (this.getChild("btnExit"));
  15003. this.btnDone = (this.getChild("btnDone"));
  15004. this.rnNode = (this.getChild("rnNode"));
  15005. }
  15006. }
  15007. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  15008. class ui_tipNode extends fgui.GComponent {
  15009. static createInstance() {
  15010. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15011. }
  15012. onConstruct() {
  15013. this.bg = (this.getChild("bg"));
  15014. this.n55 = (this.getChild("n55"));
  15015. this.n56 = (this.getChild("n56"));
  15016. this.tipNode = (this.getChild("tipNode"));
  15017. }
  15018. }
  15019. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15020. class ui_fcmNode extends fgui.GComponent {
  15021. static createInstance() {
  15022. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15023. }
  15024. onConstruct() {
  15025. this.n63 = (this.getChild("n63"));
  15026. this.n62 = (this.getChild("n62"));
  15027. this.btnRn = (this.getChild("btnRn"));
  15028. this.n61 = (this.getChild("n61"));
  15029. this.n58 = (this.getChild("n58"));
  15030. this.fcmNode = (this.getChild("fcmNode"));
  15031. }
  15032. }
  15033. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15034. class ui_msgNode extends fgui.GComponent {
  15035. static createInstance() {
  15036. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15037. }
  15038. onConstruct() {
  15039. this.n69 = (this.getChild("n69"));
  15040. this.txtMsg = (this.getChild("txtMsg"));
  15041. this.msgNode = (this.getChild("msgNode"));
  15042. }
  15043. }
  15044. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15045. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15046. static createInstance() {
  15047. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15048. }
  15049. onConstruct() {
  15050. this.n1 = (this.getChild("n1"));
  15051. this.n13 = (this.getChild("n13"));
  15052. this.n14 = (this.getChild("n14"));
  15053. this.n15 = (this.getChild("n15"));
  15054. this.n3 = (this.getChild("n3"));
  15055. this.n4 = (this.getChild("n4"));
  15056. this.n5 = (this.getChild("n5"));
  15057. this.n6 = (this.getChild("n6"));
  15058. this.n7 = (this.getChild("n7"));
  15059. this.n8 = (this.getChild("n8"));
  15060. this.n9 = (this.getChild("n9"));
  15061. this.n10 = (this.getChild("n10"));
  15062. this.n12 = (this.getChild("n12"));
  15063. this.n11 = (this.getChild("n11"));
  15064. this.n16 = (this.getChild("n16"));
  15065. this.n17 = (this.getChild("n17"));
  15066. this.n18 = (this.getChild("n18"));
  15067. this.n20 = (this.getChild("n20"));
  15068. this.n21 = (this.getChild("n21"));
  15069. this.t0 = this.getTransition("t0");
  15070. }
  15071. }
  15072. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15073. class ui_btn5 extends fgui.GButton {
  15074. static createInstance() {
  15075. return (fgui.UIPackage.createObject("loading", "btn5"));
  15076. }
  15077. onConstruct() {
  15078. this.n9 = (this.getChild("n9"));
  15079. this.n1 = (this.getChild("n1"));
  15080. }
  15081. }
  15082. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15083. class ui_UILoading extends fgui.GComponent {
  15084. static createInstance() {
  15085. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15086. }
  15087. onConstruct() {
  15088. this.n12 = (this.getChild("n12"));
  15089. this.loadinfo = (this.getChild("loadinfo"));
  15090. this.n13 = (this.getChild("n13"));
  15091. this.txtLoad = (this.getChild("txtLoad"));
  15092. this.n18 = (this.getChild("n18"));
  15093. }
  15094. }
  15095. ui_UILoading.URL = "ui://37nctnhwphc33";
  15096. class ui_AgeItem extends fgui.GComponent {
  15097. static createInstance() {
  15098. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15099. }
  15100. onConstruct() {
  15101. this.txtAge = (this.getChild("txtAge"));
  15102. }
  15103. }
  15104. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15105. class ui_btn1 extends fgui.GButton {
  15106. static createInstance() {
  15107. return (fgui.UIPackage.createObject("loading", "btn1"));
  15108. }
  15109. onConstruct() {
  15110. this.n6 = (this.getChild("n6"));
  15111. this.n1 = (this.getChild("n1"));
  15112. }
  15113. }
  15114. ui_btn1.URL = "ui://37nctnhwxe622p";
  15115. class ui_btn3 extends fgui.GButton {
  15116. static createInstance() {
  15117. return (fgui.UIPackage.createObject("loading", "btn3"));
  15118. }
  15119. onConstruct() {
  15120. this.n9 = (this.getChild("n9"));
  15121. this.n1 = (this.getChild("n1"));
  15122. }
  15123. }
  15124. ui_btn3.URL = "ui://37nctnhwxe622s";
  15125. class ui_btn2 extends fgui.GButton {
  15126. static createInstance() {
  15127. return (fgui.UIPackage.createObject("loading", "btn2"));
  15128. }
  15129. onConstruct() {
  15130. this.n6 = (this.getChild("n6"));
  15131. this.n1 = (this.getChild("n1"));
  15132. }
  15133. }
  15134. ui_btn2.URL = "ui://37nctnhwxe622t";
  15135. class ui_btnBack extends fgui.GButton {
  15136. static createInstance() {
  15137. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15138. }
  15139. onConstruct() {
  15140. this.n6 = (this.getChild("n6"));
  15141. this.n7 = (this.getChild("n7"));
  15142. }
  15143. }
  15144. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15145. class ui_btnXy1 extends fgui.GButton {
  15146. static createInstance() {
  15147. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15148. }
  15149. onConstruct() {
  15150. this.n1 = (this.getChild("n1"));
  15151. }
  15152. }
  15153. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15154. class ui_btnXy2 extends fgui.GButton {
  15155. static createInstance() {
  15156. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15157. }
  15158. onConstruct() {
  15159. this.n1 = (this.getChild("n1"));
  15160. }
  15161. }
  15162. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  15163. class ui_btnXy3 extends fgui.GButton {
  15164. static createInstance() {
  15165. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15166. }
  15167. onConstruct() {
  15168. this.n1 = (this.getChild("n1"));
  15169. }
  15170. }
  15171. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15172. class ui_btn4 extends fgui.GButton {
  15173. static createInstance() {
  15174. return (fgui.UIPackage.createObject("loading", "btn4"));
  15175. }
  15176. onConstruct() {
  15177. this.n9 = (this.getChild("n9"));
  15178. this.n1 = (this.getChild("n1"));
  15179. }
  15180. }
  15181. ui_btn4.URL = "ui://37nctnhwxe622z";
  15182. class loadingBinder {
  15183. static bindAll() {
  15184. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15185. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15186. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15187. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15188. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15189. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15190. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15191. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15192. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15193. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15194. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15195. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15196. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15197. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15198. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15199. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15200. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15201. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15202. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15203. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15204. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15205. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15206. }
  15207. }
  15208. class UIMgr {
  15209. constructor() {
  15210. this._stage = null;
  15211. this._uiList = [];
  15212. this._showList = [];
  15213. this._bindPkgList = [];
  15214. this.uiIndex = 0;
  15215. }
  15216. static get inst() {
  15217. if (UIMgr._inst == null) {
  15218. UIMgr._inst = new UIMgr();
  15219. }
  15220. return UIMgr._inst;
  15221. }
  15222. setStage(s) {
  15223. if (this._stage) {
  15224. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15225. return;
  15226. }
  15227. this._stage = s;
  15228. }
  15229. clearTempData() {
  15230. console.log('zh:clearTempData start');
  15231. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  15232. console.log('zh:clearTempData end');
  15233. }
  15234. init() {
  15235. this.setStage(Laya.stage);
  15236. fairygui.UIConfig.defaultFont = "微软雅黑";
  15237. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15238. fairygui.UIConfig.packageFileExtension = "obj";
  15239. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15240. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15241. fairygui.GRoot.inst.width = Laya.stage.width;
  15242. fairygui.GRoot.inst.height = Laya.stage.height;
  15243. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15244. }
  15245. addAllUpdate() {
  15246. this.uiIndex = 0;
  15247. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15248. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15249. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15250. }
  15251. }
  15252. }
  15253. bindFUI(pkgname) {
  15254. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15255. return;
  15256. }
  15257. switch (pkgname) {
  15258. case fguiRes.loading:
  15259. fairygui.UIPackage.addPackage(pkgname);
  15260. loadingBinder.bindAll();
  15261. this._bindPkgList.push(pkgname);
  15262. break;
  15263. case fguiRes.game:
  15264. fairygui.UIPackage.addPackage(pkgname);
  15265. gameBinder.bindAll();
  15266. this._bindPkgList.push(pkgname);
  15267. break;
  15268. default:
  15269. break;
  15270. }
  15271. }
  15272. Show(cls, ...param) {
  15273. let nameStr = cls.uiName;
  15274. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15275. let temp = this._uiList[i];
  15276. let str = temp.className;
  15277. if (str == nameStr) {
  15278. if (temp.isMuti) {
  15279. if (temp.isHide) {
  15280. temp.show(...param);
  15281. this._uiList.splice(i, 1);
  15282. this._uiList.push(temp);
  15283. return temp;
  15284. }
  15285. }
  15286. else {
  15287. temp.show(...param);
  15288. this._uiList.splice(i, 1);
  15289. this._uiList.push(temp);
  15290. return temp;
  15291. }
  15292. }
  15293. }
  15294. let ui = new cls();
  15295. ui.className = nameStr;
  15296. this._showUI(ui, param);
  15297. return ui;
  15298. }
  15299. destroyUI(ui) {
  15300. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15301. let temp = this._uiList[i].className;
  15302. if (temp == ui.className) {
  15303. this._uiList.splice(i, 1);
  15304. break;
  15305. }
  15306. }
  15307. this.checkUIState();
  15308. }
  15309. _showUI(ui, param) {
  15310. this._uiList.push(ui);
  15311. ui.show(...param);
  15312. }
  15313. Hide(uiClass) {
  15314. let ui = this.getUI(uiClass);
  15315. if (ui && !ui.isHide) {
  15316. ui.hide();
  15317. }
  15318. }
  15319. getUI(ui) {
  15320. let nameStr = ui.uiName;
  15321. for (let index = 0; index < this._uiList.length; index++) {
  15322. let temp = this._uiList[index];
  15323. if (temp.className == nameStr) {
  15324. return temp;
  15325. }
  15326. }
  15327. return null;
  15328. }
  15329. isShow(cls) {
  15330. for (var i of this._uiList) {
  15331. if (i instanceof cls) {
  15332. return i.isShowing;
  15333. }
  15334. }
  15335. return false;
  15336. }
  15337. showUINum() {
  15338. let num = 0;
  15339. for (var i of this._uiList) {
  15340. if (i.isShowing) {
  15341. num++;
  15342. }
  15343. }
  15344. return num;
  15345. }
  15346. checkUIState() {
  15347. Laya.timer.clear(this, this._uiCheck);
  15348. Laya.timer.once(400, this, this._uiCheck);
  15349. }
  15350. _uiCheck() {
  15351. let showList = [];
  15352. for (var i of this._uiList) {
  15353. if (!i.isHide) {
  15354. showList.push(i);
  15355. }
  15356. }
  15357. for (let index = 0; index < showList.length; index++) {
  15358. if (index == showList.length - 1) {
  15359. showList[index].checkActive(true);
  15360. }
  15361. else {
  15362. showList[index].checkActive(false);
  15363. }
  15364. }
  15365. }
  15366. showTip(msg, time = 600, size = 30) {
  15367. }
  15368. }
  15369. class UIShowList {
  15370. }
  15371. class SoundMgr {
  15372. constructor() {
  15373. this.soundMax = 4;
  15374. this.isLoad = false;
  15375. this.soundMap = {};
  15376. this.isSound = true;
  15377. this.openShake = true;
  15378. SoundMgr._instance = this;
  15379. }
  15380. static getInstance() {
  15381. if (!this._instance) {
  15382. this._instance = new SoundMgr();
  15383. }
  15384. return this._instance;
  15385. }
  15386. init() {
  15387. console.log('zh:sm init 1');
  15388. Laya.SoundManager.autoReleaseSound = true;
  15389. Laya.SoundManager.autoStopMusic = true;
  15390. Laya.SoundManager.musicVolume = 0.3;
  15391. Laya.SoundManager.soundVolume = 0.5;
  15392. this.musicPlayed = false;
  15393. this.audioUrl = "asset/sound/ogg/";
  15394. console.log('zh:sm init 2');
  15395. console.log('zh:dev type ');
  15396. if (Laya.Browser.onAndroid) {
  15397. console.log('zh:dev type android');
  15398. this.audioUrl = "asset/sound/ogg/";
  15399. this.isLoad = true;
  15400. }
  15401. else {
  15402. console.log('zh:dev type not android');
  15403. this.audioUrl = "asset/sound/mp3/";
  15404. this.isLoad = true;
  15405. }
  15406. }
  15407. onSetting(isS) {
  15408. this.isSound = isS;
  15409. this.mute(!this.isSound);
  15410. }
  15411. clearCount() {
  15412. for (var key in this.soundMap) {
  15413. delete this.soundMap[key];
  15414. }
  15415. }
  15416. playMusic(path, loop = 0) {
  15417. console.log('zh:playMusic 1 PATH=' + path);
  15418. this.musicPath = path;
  15419. if (!this.isLoad)
  15420. console.log('zh:playMusic 2');
  15421. return;
  15422. if (!path || path == "")
  15423. console.log('zh:playMusic 3');
  15424. return;
  15425. if (!this.isSound)
  15426. console.log('zh:playMusic 4');
  15427. return;
  15428. this.musicPlayed = true;
  15429. console.log('zh:playMusic 5');
  15430. let url = this.getUrl(path);
  15431. console.log('zh:playMusic 6' + url);
  15432. if (Laya.Browser.onPC) {
  15433. console.log('zh:playMusic 7');
  15434. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15435. console.log('zh:playMusic 8');
  15436. this.play(url, loop);
  15437. }));
  15438. }
  15439. else
  15440. this.play(url, loop);
  15441. }
  15442. play(url, loop) {
  15443. Laya.SoundManager.playMusic(url, loop);
  15444. }
  15445. getUrl(path) {
  15446. let url = this.audioUrl + path;
  15447. if (Laya.Browser.onAndroid) {
  15448. url += ".ogg";
  15449. }
  15450. else {
  15451. url += ".mp3";
  15452. }
  15453. return url;
  15454. }
  15455. pauseMusic(pause) {
  15456. if (pause) {
  15457. this.mute(true);
  15458. }
  15459. else if (this.isSound)
  15460. this.mute(false);
  15461. }
  15462. stopMusic() {
  15463. Laya.SoundManager.stopMusic();
  15464. if (Moyu.isNeedPlatAudio) {
  15465. Moyu.stopMusic();
  15466. }
  15467. }
  15468. mute(mute) {
  15469. if (Moyu.isNeedPlatAudio) {
  15470. Moyu.pauseMusic(mute);
  15471. }
  15472. else {
  15473. Laya.SoundManager.musicMuted = mute;
  15474. if (!mute && !this.musicPlayed && this.musicPath) {
  15475. this.playMusic(this.musicPath);
  15476. }
  15477. }
  15478. }
  15479. stopSound(path) {
  15480. let url = this.getUrl(path);
  15481. Laya.SoundManager.stopSound(url);
  15482. }
  15483. playSound(path, loop = 1, soundMax = this.soundMax) {
  15484. if (!this.isLoad)
  15485. return;
  15486. if (!this.isSound)
  15487. return;
  15488. if (!path || path == "")
  15489. return;
  15490. let url = this.getUrl(path);
  15491. if (Moyu.isNeedPlatAudio) {
  15492. Moyu.playSound(path, loop == 0);
  15493. }
  15494. else {
  15495. let count = 1;
  15496. if (this.soundMap[path])
  15497. count = this.soundMap[path] + 1;
  15498. if (count > soundMax)
  15499. return;
  15500. this.soundMap[path] = count;
  15501. Laya.SoundManager.playSound(url, loop);
  15502. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15503. }
  15504. }
  15505. removePath(path) {
  15506. if (this.soundMap[path]) {
  15507. let count = this.soundMap[path];
  15508. count--;
  15509. if (count < 1)
  15510. delete this.soundMap[path];
  15511. else
  15512. this.soundMap[path] = count;
  15513. }
  15514. }
  15515. playBtnSound() {
  15516. this.playSound("btn");
  15517. }
  15518. playGetSound() {
  15519. }
  15520. playCloseUISound() {
  15521. }
  15522. }
  15523. SoundMgr._instance = null;
  15524. var Handler$1 = Laya.Handler;
  15525. var EResType;
  15526. (function (EResType) {
  15527. EResType[EResType["none"] = 0] = "none";
  15528. EResType[EResType["nromal"] = 1] = "nromal";
  15529. EResType[EResType["td"] = 2] = "td";
  15530. EResType[EResType["sk"] = 3] = "sk";
  15531. })(EResType || (EResType = {}));
  15532. class CResLoader {
  15533. constructor(doneCall, proCall) {
  15534. this.completrCall = doneCall;
  15535. this.progressCall = proCall;
  15536. this.progressHander = new Handler$1(this, this.onProgress);
  15537. this.tdResMap = {};
  15538. }
  15539. load(resList) {
  15540. this.resCount = 0;
  15541. this.loadCount = 0;
  15542. for (let i = 0; i < resList.length; i++) {
  15543. let path = resList[i];
  15544. if (!path)
  15545. continue;
  15546. this.resCount++;
  15547. let type = this.getResType(path);
  15548. if (type == EResType.nromal)
  15549. this.loadNromal(path);
  15550. else if (type == EResType.td)
  15551. this.loadTd(path);
  15552. }
  15553. }
  15554. getRes(path) {
  15555. let type = this.getResType(path);
  15556. if (type == EResType.nromal)
  15557. return Laya.loader.getRes(path);
  15558. else if (type == EResType.td) {
  15559. let res = this.tdResMap[path];
  15560. if (res)
  15561. return res.clone();
  15562. return null;
  15563. }
  15564. }
  15565. destroy() {
  15566. this.progressHander.clear();
  15567. this.progressHander = null;
  15568. }
  15569. clearRes(path) {
  15570. let type = this.getResType(path);
  15571. if (type == EResType.nromal)
  15572. Laya.loader.clearRes(path);
  15573. else if (type == EResType.td) {
  15574. let obj = this.tdResMap[path];
  15575. if (obj)
  15576. obj.destroy();
  15577. delete this.tdResMap[path];
  15578. }
  15579. }
  15580. getResType(path) {
  15581. let exs = this.getExtension(path);
  15582. if (exs == "sk")
  15583. return EResType.sk;
  15584. if (exs == "ls" || exs == "lh" || exs == "lm")
  15585. return EResType.td;
  15586. else
  15587. return EResType.nromal;
  15588. }
  15589. getExtension(res) {
  15590. var index = res.lastIndexOf(".");
  15591. return res.substr(index + 1);
  15592. }
  15593. loadNromal(path) {
  15594. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15595. if (res) {
  15596. this.onLoad();
  15597. }
  15598. else
  15599. console.log("load res fail:" + path);
  15600. }), this.progressHander);
  15601. }
  15602. loadSk() {
  15603. }
  15604. loadTd(path) {
  15605. if (this.tdResMap[path]) {
  15606. this.onLoad();
  15607. return;
  15608. }
  15609. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15610. if (res) {
  15611. this.tdResMap[path] = res;
  15612. this.onLoad();
  15613. }
  15614. else
  15615. console.log("load res fail:" + path);
  15616. }));
  15617. }
  15618. onLoad() {
  15619. this.loadCount++;
  15620. this.onProgress(1);
  15621. if (this.loadCount >= this.resCount) {
  15622. this.completrCall.run();
  15623. }
  15624. }
  15625. onProgress(pro) {
  15626. let progress = (this.loadCount + pro) / this.resCount;
  15627. this.progressCall.runWith(progress);
  15628. }
  15629. }
  15630. var Handler$2 = Laya.Handler;
  15631. class ResInfo {
  15632. constructor() {
  15633. this.index = 0;
  15634. }
  15635. }
  15636. class ResMgr {
  15637. constructor() {
  15638. this.resList = [];
  15639. this.doneList = [];
  15640. this.resMap = {};
  15641. this.currentLoad = null;
  15642. this.completeHandler = new Handler$2(this, this.onComplete);
  15643. this.progressHandler = new Handler$2(this, this.onProgress);
  15644. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15645. }
  15646. static getInstance() {
  15647. if (ResMgr._instance == null) {
  15648. ResMgr._instance = new ResMgr();
  15649. }
  15650. return ResMgr._instance;
  15651. }
  15652. loadList(list, completeHandler, progressHandler) {
  15653. if (list.length < 1) {
  15654. completeHandler.run();
  15655. return;
  15656. }
  15657. let info = this.getResInfo();
  15658. info.resList = list;
  15659. info.completeHandler = completeHandler;
  15660. info.progressHandler = progressHandler;
  15661. this.resList.push(info);
  15662. this.startLoad();
  15663. }
  15664. loadFguiRes(list, completeHandler, progressHandler) {
  15665. Laya.loader.load(list, completeHandler, progressHandler);
  15666. }
  15667. loadAny(list, completeHandler, progressHandler) {
  15668. Laya.loader.load(list, completeHandler, progressHandler);
  15669. }
  15670. load(path, completeHandler, progressHandler) {
  15671. let count = this.resMap[path];
  15672. if (count && count > 0) {
  15673. if (completeHandler)
  15674. completeHandler.run();
  15675. }
  15676. else
  15677. this.loadList([path], completeHandler, progressHandler);
  15678. }
  15679. getRes(path) {
  15680. let res = this.resMap[path];
  15681. if (!res)
  15682. this.showLog("资源不存在:" + path);
  15683. else
  15684. return this.loader.getRes(path);
  15685. }
  15686. clearList(list, force = false) {
  15687. if (!list || list.length < 1)
  15688. return;
  15689. let cr = () => {
  15690. for (const k in list) {
  15691. let v = list[k];
  15692. if (!v)
  15693. continue;
  15694. if (force) {
  15695. this.loader.clearRes(v);
  15696. delete this.resMap[v];
  15697. }
  15698. else {
  15699. let count = this.resMap[v];
  15700. if (count && count > 1) {
  15701. count--;
  15702. this.resMap[v] = count;
  15703. }
  15704. else {
  15705. this.loader.clearRes(v);
  15706. delete this.resMap[v];
  15707. }
  15708. }
  15709. }
  15710. if (!window.hasOwnProperty("ks"))
  15711. Laya.Resource.destroyUnusedResources();
  15712. };
  15713. Laya.timer.clearAll(this);
  15714. Laya.timer.once(2000, this, cr);
  15715. }
  15716. clear3D() {
  15717. for (const k in this.loader.tdResMap) {
  15718. this.loader.clearRes(k);
  15719. if (this.resMap[k])
  15720. delete this.resMap[k];
  15721. }
  15722. if (!window.hasOwnProperty("ks"))
  15723. Laya.Resource.destroyUnusedResources();
  15724. }
  15725. clear(path, force = false) {
  15726. this.clearList([path], force);
  15727. }
  15728. getResInfo() {
  15729. if (this.doneList.length > 0)
  15730. return this.doneList.pop();
  15731. else
  15732. return new ResInfo();
  15733. }
  15734. startLoad() {
  15735. if (this.currentLoad)
  15736. return;
  15737. this.currentLoad = this.resList.pop();
  15738. if (this.currentLoad) {
  15739. this.loader.load(this.currentLoad.resList);
  15740. }
  15741. }
  15742. onComplete() {
  15743. if (!this.currentLoad)
  15744. return;
  15745. for (const k in this.currentLoad.resList) {
  15746. let v = this.currentLoad.resList[k];
  15747. let count = this.resMap[v];
  15748. if (count)
  15749. count++;
  15750. else
  15751. count = 1;
  15752. this.resMap[v] = count;
  15753. }
  15754. if (this.currentLoad.completeHandler)
  15755. this.currentLoad.completeHandler.run();
  15756. this.doneList.push(this.currentLoad);
  15757. this.currentLoad = null;
  15758. this.startLoad();
  15759. }
  15760. onProgress(pro) {
  15761. if (!this.currentLoad)
  15762. return;
  15763. if (this.currentLoad.progressHandler)
  15764. this.currentLoad.progressHandler.runWith(pro);
  15765. }
  15766. showLog(str, ...args) {
  15767. console.log("[ResLoader] " + str);
  15768. }
  15769. }
  15770. ResMgr._instance = null;
  15771. class EventMgr extends Laya.EventDispatcher {
  15772. }
  15773. let eventMgr = new EventMgr();
  15774. class ConfigMgr {
  15775. static getInstance() {
  15776. if (!this._instance) {
  15777. this._instance = new ConfigMgr();
  15778. }
  15779. return this._instance;
  15780. }
  15781. init() {
  15782. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15783. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15784. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15785. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15786. }
  15787. getUserInfoByIndex(index) {
  15788. return this.npcJson[index];
  15789. }
  15790. getRandomUserInfo() {
  15791. let index = xGame.tools.random(0, this.npcJson.length);
  15792. return this.npcJson[index];
  15793. }
  15794. getMaxBigMoveLength() {
  15795. return Object.keys(this.levelCfg).length;
  15796. }
  15797. getBigMoveLevelByIndex(index) {
  15798. let cfg = this.levelCfg;
  15799. cfg = cfg[index];
  15800. return cfg;
  15801. }
  15802. getRandomClassicLevel() {
  15803. let cfg = this.classicCfg;
  15804. let num = Object.keys(cfg).length;
  15805. let rand = xGame.common.randomNum(1, num);
  15806. return cfg[rand];
  15807. }
  15808. getPlaceBallByLevel(level) {
  15809. return this.placeBallCfg[level];
  15810. }
  15811. getMaxPlaceBall() {
  15812. return Object.keys(this.placeBallCfg).length;
  15813. }
  15814. }
  15815. class PoolD3Mgr {
  15816. constructor() {
  15817. this.pool = {};
  15818. }
  15819. static get ins() {
  15820. return this._ins || (this._ins = new PoolD3Mgr);
  15821. }
  15822. createList(key, prefab, parent) {
  15823. if (!this.pool[key]) {
  15824. this.pool[key] = {};
  15825. this.pool[key].prefab = prefab;
  15826. this.pool[key].list = [];
  15827. this.pool[key].parent = parent;
  15828. }
  15829. }
  15830. getItem(key) {
  15831. if (!this.pool[key]) {
  15832. return;
  15833. }
  15834. let temp;
  15835. if (this.pool[key].list.length > 0) {
  15836. temp = this.pool[key].list.pop();
  15837. }
  15838. else {
  15839. temp = this.pool[key].prefab.clone();
  15840. if (this.pool[key].parent) {
  15841. this.pool[key].parent.addChild(temp);
  15842. }
  15843. }
  15844. temp.active = true;
  15845. return temp;
  15846. }
  15847. putItem(key, obj) {
  15848. if (!this.pool[key]) {
  15849. return;
  15850. }
  15851. obj.active = false;
  15852. this.pool[key].list.push(obj);
  15853. }
  15854. }
  15855. let context$1 = context;
  15856. let uiMgr = UIMgr.inst;
  15857. let soundMgr = SoundMgr.getInstance();
  15858. let resMgr = ResMgr.getInstance();
  15859. let httpMgr = HttpMgr.getInstance();
  15860. let common = Common.getInstance();
  15861. let cfgMgr = ConfigMgr.getInstance();
  15862. let poolD3Mgr = PoolD3Mgr.ins;
  15863. let d3TexUrl = "res/d3Res/";
  15864. let d3ModeUrl = "res/unityRes/";
  15865. function setStageSize(view) {
  15866. if (view.width) {
  15867. view.width = Laya.stage.width;
  15868. view.height = Laya.stage.height;
  15869. }
  15870. }
  15871. function filledBg(view) {
  15872. let wh = Laya.stage.height / Laya.stage.width;
  15873. if (wh > 16 / 9) {
  15874. view.height = Laya.stage.height;
  15875. view.width = Laya.stage.height / 1334 * 750;
  15876. }
  15877. else {
  15878. view.width = Laya.stage.width;
  15879. view.height = Laya.stage.width / 750 * 1334;
  15880. }
  15881. }
  15882. function setNotch(view) {
  15883. if (view.height) {
  15884. view.y += context$1.notchHeight;
  15885. }
  15886. }
  15887. function showTip(str) {
  15888. uiMgr.Show(UIMsg, str);
  15889. }
  15890. function log(...args) {
  15891. console.log(args);
  15892. }
  15893. let xGame = {
  15894. context: context$1,
  15895. eventMgr,
  15896. resMgr,
  15897. uiMgr,
  15898. soundMgr,
  15899. define,
  15900. tools,
  15901. httpMgr,
  15902. d3TexUrl,
  15903. d3ModeUrl,
  15904. common,
  15905. cfgMgr,
  15906. poolD3Mgr,
  15907. setStageSize,
  15908. filledBg,
  15909. setNotch,
  15910. showTip,
  15911. log,
  15912. };
  15913. window["xGame"] = xGame;
  15914. let dataName = 'tBall_';
  15915. class UserData {
  15916. constructor() {
  15917. this.userId = "";
  15918. this.isAgree = false;
  15919. this.coinNum = 0;
  15920. this.gemNum = 0;
  15921. this.sound = true;
  15922. this.vibration = true;
  15923. this.currentDate = 0;
  15924. this.createTime = 0;
  15925. this.awardTime = 0;
  15926. this.roleId = 1;
  15927. this.roleList = [];
  15928. this.roleAds = [];
  15929. this.dressId = 101;
  15930. this.itemId = 201;
  15931. this.bigSkills = [1, 1, 1, 1, 1];
  15932. this.coin = 4000;
  15933. this.diamond = 0;
  15934. this.skillSuccessTimes = 0;
  15935. this.skillGuide = 0;
  15936. this.skillAccTimes = 0;
  15937. this.placeBallData = [];
  15938. this.shareDiamondTimes = 0;
  15939. this.dailyVideoShareTimes = 0;
  15940. this.secretary = [1, 0];
  15941. this.curSecretary = 0;
  15942. this.ballRod = [1, 0, 0, 0, 0, 1];
  15943. this.curBallRod = 5;
  15944. this.signData = 0;
  15945. this.signTime = 0;
  15946. this.drawTimes = 0;
  15947. this.drawAwardTimes = 0;
  15948. this.dailyfreeDrawTimes = 1;
  15949. this.power = 5;
  15950. this.powerTime = 0;
  15951. this.challengeTimes = 0;
  15952. this.extraSign = 0;
  15953. this.classicTimes = 0;
  15954. this.guideHelpLine = 0;
  15955. this.newUser = true;
  15956. this.rootBallFoul = 0;
  15957. this.timeoutFoul = 0;
  15958. this.roleList = [1];
  15959. }
  15960. saveData() {
  15961. let data = {};
  15962. for (let k in this) {
  15963. data[k.toString()] = this[k];
  15964. }
  15965. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15966. }
  15967. getData() {
  15968. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15969. if (ld) {
  15970. let localData = JSON.parse(ld);
  15971. if (localData) {
  15972. for (let k in this) {
  15973. let key = k.toString();
  15974. let data = localData[key];
  15975. if (data != undefined) {
  15976. this[k] = data;
  15977. }
  15978. }
  15979. }
  15980. }
  15981. }
  15982. }
  15983. class ItemData {
  15984. constructor() {
  15985. this.itemList = {};
  15986. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15987. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15988. }
  15989. saveData() {
  15990. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15991. }
  15992. getData() {
  15993. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15994. if (ld) {
  15995. let localData = JSON.parse(ld);
  15996. if (localData) {
  15997. this.itemList = localData;
  15998. }
  15999. }
  16000. }
  16001. }
  16002. class GameData {
  16003. constructor() {
  16004. this.curLevel = 0;
  16005. this.gameType = 1;
  16006. this.signIdx = 0;
  16007. this.signMax = 0;
  16008. this.rotaryTime = 0;
  16009. this.rotaryCount = 0;
  16010. this.rotaryList = [];
  16011. this.diyCount = 3;
  16012. this.awardIdx = 0;
  16013. this.shareNum = 2;
  16014. this.rankWeek = 0;
  16015. this.rankScore = 0;
  16016. this.gameCount = 0;
  16017. this.trySkill = -1;
  16018. this.tryTime = 0;
  16019. }
  16020. saveData() {
  16021. let data = {};
  16022. for (let k in this) {
  16023. data[k.toString()] = this[k];
  16024. }
  16025. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  16026. }
  16027. getData() {
  16028. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  16029. if (ld) {
  16030. let localData = JSON.parse(ld);
  16031. if (localData) {
  16032. for (let k in this) {
  16033. let key = k.toString();
  16034. let data = localData[key];
  16035. if (data != undefined) {
  16036. this[k] = data;
  16037. }
  16038. }
  16039. }
  16040. }
  16041. }
  16042. }
  16043. class DataMgr {
  16044. static Init() {
  16045. this.userData = new UserData();
  16046. this.gameData = new GameData();
  16047. this.itemData = new ItemData();
  16048. this.userData.getData();
  16049. this.gameData.getData();
  16050. this.itemData.getData();
  16051. this.roleId = this.userData.roleId;
  16052. this.resetUse();
  16053. }
  16054. static isNewDay() {
  16055. Moyu.isNewDay(this, (isnew) => {
  16056. xGame.common.isNewDay = isnew;
  16057. if (!isnew)
  16058. return;
  16059. DataMgr.setShareDiamondTimes(0, false);
  16060. DataMgr.setDailyVideoShareTimes(0, false);
  16061. DataMgr.setDailyfreeDrawTimes(1);
  16062. DataMgr.setExtraSign(0);
  16063. });
  16064. }
  16065. static deletData() {
  16066. Laya.LocalStorage.clear();
  16067. }
  16068. static upRankData() {
  16069. let num = xGame.common.getAllStarNum();
  16070. if (num > 0)
  16071. Moyu.upRankData(xGame.common.curRankID, num);
  16072. }
  16073. static addItem(id, count = 1) {
  16074. let v = this.itemData.itemList[id];
  16075. if (!v)
  16076. v = { id: id, count: count, adnum: 0, active: true };
  16077. else {
  16078. if (v.active) {
  16079. v.count += count;
  16080. }
  16081. else {
  16082. v.count = count;
  16083. v.active = true;
  16084. }
  16085. }
  16086. this.itemData.itemList[id] = v;
  16087. xGame.soundMgr.playGetSound();
  16088. this.saveItemData();
  16089. }
  16090. static hasItem(id) {
  16091. let v = this.itemData.itemList[id];
  16092. if (v && v.active)
  16093. return true;
  16094. return false;
  16095. }
  16096. static getItem(id) {
  16097. let v = this.itemData.itemList[id];
  16098. return v;
  16099. }
  16100. static getItemCount(id) {
  16101. let v = this.itemData.itemList[id];
  16102. if (v && v.active)
  16103. return v.count;
  16104. return 0;
  16105. }
  16106. static getItemAd(id) {
  16107. let v = this.itemData.itemList[id];
  16108. if (v) {
  16109. return v.adnum;
  16110. }
  16111. return 0;
  16112. }
  16113. static onItemAd(id, num = 1) {
  16114. let v = this.itemData.itemList[id];
  16115. if (!v)
  16116. v = { id: id, count: 1, adnum: num, active: false };
  16117. else
  16118. v.adnum += num;
  16119. this.itemData.itemList[id] = v;
  16120. this.saveItemData();
  16121. }
  16122. static costItem(id, count) {
  16123. let v = this.itemData.itemList[id];
  16124. if (v && v.active) {
  16125. if (v.count < count)
  16126. return false;
  16127. else {
  16128. v.count -= count;
  16129. this.itemData.itemList[id] = v;
  16130. return true;
  16131. }
  16132. }
  16133. return false;
  16134. }
  16135. static resetUse() {
  16136. this.dressId = this.userData.dressId;
  16137. this.itemId = this.userData.itemId;
  16138. }
  16139. static passLevel() {
  16140. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  16141. this.gameData.curLevel++;
  16142. this.curLevel = this.gameData.curLevel;
  16143. this.saveGameData();
  16144. }
  16145. static useRole(id) {
  16146. this.roleId = id;
  16147. if (this.hasRole(id)) {
  16148. this.userData.roleId = id;
  16149. this.saveUserData();
  16150. }
  16151. }
  16152. static addRole(id) {
  16153. if (this.hasRole(id))
  16154. return;
  16155. this.userData.roleList.push(id);
  16156. this.saveUserData();
  16157. }
  16158. static hasRole(id) {
  16159. return this.userData.roleList.indexOf(id) >= 0;
  16160. }
  16161. static gemEnough(num) {
  16162. return this.userData.gemNum >= num;
  16163. }
  16164. static roleHasAd(id) {
  16165. let count = this.userData.roleAds[id];
  16166. if (count != undefined && count >= 0)
  16167. return true;
  16168. else
  16169. return false;
  16170. }
  16171. static saveUserData(time = 1000, event, arg) {
  16172. if (this.userSaving)
  16173. return;
  16174. this.userSaving = true;
  16175. Laya.timer.once(time, this, () => {
  16176. this.userSaving = false;
  16177. this.userData.saveData();
  16178. if (event)
  16179. xGame.eventMgr.event(event, arg);
  16180. });
  16181. }
  16182. static saveGameData() {
  16183. if (this.gameSaving)
  16184. return;
  16185. this.gameSaving = true;
  16186. Laya.timer.once(1000, this, () => {
  16187. this.gameSaving = false;
  16188. this.gameData.saveData();
  16189. });
  16190. }
  16191. static saveItemData() {
  16192. let fun = () => {
  16193. this.itemData.saveData();
  16194. };
  16195. Laya.timer.clear(this, fun);
  16196. Laya.timer.once(500, this, fun);
  16197. }
  16198. static saveData() {
  16199. this.saveUserData();
  16200. this.saveGameData();
  16201. }
  16202. static getBigSkillList() {
  16203. return this.userData.bigSkills;
  16204. }
  16205. static getBigSkillByIndex(index) {
  16206. return this.userData.bigSkills[index];
  16207. }
  16208. static setBigSkill(index, val, addUp = true) {
  16209. if (addUp) {
  16210. this.userData.bigSkills[index] += val;
  16211. }
  16212. else {
  16213. this.userData.bigSkills[index] = val;
  16214. }
  16215. this.saveUserData();
  16216. }
  16217. static coinEnough(need) {
  16218. if (typeof need != "number") {
  16219. console.error("金币格式错误");
  16220. return;
  16221. }
  16222. return this.userData.coin >= need;
  16223. }
  16224. static setCoin(val) {
  16225. if (typeof val != "number") {
  16226. return;
  16227. }
  16228. this.userData.coin += val;
  16229. this.saveUserData();
  16230. xGame.eventMgr.event(COIN_CHANGE);
  16231. }
  16232. static getCoin() {
  16233. return this.userData.coin;
  16234. }
  16235. static diamondEnough(need) {
  16236. if (typeof need != "number") {
  16237. console.error("金币格式错误");
  16238. return;
  16239. }
  16240. return this.userData.diamond >= need;
  16241. }
  16242. static setDiamond(val) {
  16243. if (typeof val != "number") {
  16244. return;
  16245. }
  16246. this.userData.diamond += val;
  16247. this.saveUserData();
  16248. xGame.eventMgr.event(DIAMOND_CHANGE);
  16249. }
  16250. static getDiamond() {
  16251. return this.userData.diamond;
  16252. }
  16253. static getSkillSuccessTimes() {
  16254. return this.userData.skillSuccessTimes;
  16255. }
  16256. static setSkillSuccessTimes(val, addUp = true) {
  16257. if (addUp)
  16258. this.userData.skillSuccessTimes += val;
  16259. else
  16260. this.userData.skillSuccessTimes = val;
  16261. this.saveUserData();
  16262. }
  16263. static getSkillAccTimes() {
  16264. return this.userData.skillAccTimes;
  16265. }
  16266. static setSkillAccTimes(val) {
  16267. this.userData.skillAccTimes += val;
  16268. this.saveUserData();
  16269. }
  16270. static getSkillGuide() {
  16271. if (!xGame.common.openGuide) {
  16272. return 1;
  16273. }
  16274. return this.userData.skillGuide;
  16275. }
  16276. static setSkillGuide(val) {
  16277. this.userData.skillGuide = val;
  16278. this.saveUserData();
  16279. }
  16280. static getPlaceBallLevelList() {
  16281. return this.userData.placeBallData;
  16282. }
  16283. static getPlaceBallLevel(level) {
  16284. let arr = this.userData.placeBallData;
  16285. let index = level - 1;
  16286. let out;
  16287. if (arr[index]) {
  16288. out = arr[index];
  16289. }
  16290. else {
  16291. let max = arr.length;
  16292. if (max == index) {
  16293. out = {
  16294. star: 0,
  16295. play: true,
  16296. isCur: true,
  16297. getAward: false
  16298. };
  16299. }
  16300. else {
  16301. out = {
  16302. star: 0,
  16303. play: false,
  16304. getAward: false
  16305. };
  16306. }
  16307. }
  16308. return out;
  16309. }
  16310. static setPlaceBallLevel(level, star) {
  16311. let arr = this.userData.placeBallData;
  16312. let index = level - 1;
  16313. if (arr[index]) {
  16314. arr[index].star = Math.max(arr[index].star, star);
  16315. }
  16316. else {
  16317. let max = arr.length;
  16318. if (max == index) {
  16319. arr.push({
  16320. star: star,
  16321. play: true,
  16322. getAward: false
  16323. });
  16324. }
  16325. else {
  16326. console.error("关卡存储出错");
  16327. }
  16328. }
  16329. this.saveUserData();
  16330. }
  16331. static setPlaceBallAward(level) {
  16332. let arr = this.userData.placeBallData;
  16333. let index = level - 1;
  16334. if (arr[index]) {
  16335. arr[index].getAward = true;
  16336. }
  16337. this.saveUserData();
  16338. }
  16339. static getShareDiamondTimes() {
  16340. return this.userData.shareDiamondTimes;
  16341. }
  16342. static setShareDiamondTimes(val, addUp = true) {
  16343. if (addUp) {
  16344. this.userData.shareDiamondTimes += val;
  16345. }
  16346. else {
  16347. this.userData.shareDiamondTimes = val;
  16348. }
  16349. this.saveUserData();
  16350. }
  16351. static getDailyVideoShareTimes() {
  16352. return this.userData.dailyVideoShareTimes;
  16353. }
  16354. static setDailyVideoShareTimes(val, addUp = true) {
  16355. if (addUp) {
  16356. this.userData.dailyVideoShareTimes += val;
  16357. }
  16358. else {
  16359. this.userData.dailyVideoShareTimes = val;
  16360. }
  16361. this.saveUserData();
  16362. }
  16363. static getSecretary(index) {
  16364. return this.userData.secretary[index];
  16365. }
  16366. static setSecretary(index, val) {
  16367. this.userData.secretary[index] = val;
  16368. this.saveUserData();
  16369. }
  16370. static getCurSecretary() {
  16371. return this.userData.curSecretary;
  16372. }
  16373. static setCurSecretary(index) {
  16374. this.userData.curSecretary = index;
  16375. this.saveUserData();
  16376. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16377. }
  16378. static getBallRod(index) {
  16379. return this.userData.ballRod[index];
  16380. }
  16381. static setBallRod(index, val) {
  16382. this.userData.ballRod[index] = val;
  16383. this.saveUserData();
  16384. }
  16385. static getCurBallRod() {
  16386. return this.userData.curBallRod;
  16387. }
  16388. static setCurBallRod(index) {
  16389. this.userData.curBallRod = index;
  16390. this.saveUserData();
  16391. }
  16392. static setSignData(val) {
  16393. this.userData.signData = val;
  16394. this.saveUserData();
  16395. }
  16396. static getSignData() {
  16397. return this.userData.signData;
  16398. }
  16399. static setSignTime(val) {
  16400. this.userData.signTime = val;
  16401. this.saveUserData();
  16402. }
  16403. static getSignTime() {
  16404. return this.userData.signTime;
  16405. }
  16406. static getDrawTimes() {
  16407. return this.userData.drawTimes;
  16408. }
  16409. static setDrawTimes(val, addUp = true) {
  16410. if (addUp) {
  16411. this.userData.drawTimes += val;
  16412. }
  16413. else {
  16414. this.userData.drawTimes = val;
  16415. }
  16416. this.saveUserData();
  16417. }
  16418. static getDrawAwardTimes() {
  16419. return this.userData.drawAwardTimes;
  16420. }
  16421. static setDrawAwardTimes(val) {
  16422. this.userData.drawAwardTimes = val;
  16423. this.saveUserData();
  16424. }
  16425. static getDailyfreeDrawTimes() {
  16426. return this.userData.dailyfreeDrawTimes;
  16427. }
  16428. static setDailyfreeDrawTimes(val) {
  16429. this.userData.dailyfreeDrawTimes = val;
  16430. this.saveUserData();
  16431. }
  16432. static setPower(val, addUp = true) {
  16433. if (addUp)
  16434. this.userData.power += val;
  16435. else
  16436. this.userData.power = val;
  16437. if (this.userData.power >= xGame.common.maxPower) {
  16438. this.userData.power = xGame.common.maxPower;
  16439. }
  16440. xGame.eventMgr.event(POWER_CHANGE, val);
  16441. this.saveUserData();
  16442. }
  16443. static getPower() {
  16444. return this.userData.power;
  16445. }
  16446. static setPowerTime(val) {
  16447. this.userData.powerTime = val;
  16448. this.saveUserData();
  16449. }
  16450. static getPowerTime() {
  16451. return this.userData.powerTime;
  16452. }
  16453. static powerEnough() {
  16454. return this.getPower() > 0;
  16455. }
  16456. static getChallengeTimes() {
  16457. return this.userData.challengeTimes;
  16458. }
  16459. static setChallengeTimes(val) {
  16460. this.userData.challengeTimes += val;
  16461. this.saveUserData();
  16462. }
  16463. static getExtraSign() {
  16464. return this.userData.extraSign;
  16465. }
  16466. static setExtraSign(val) {
  16467. this.userData.extraSign = val;
  16468. this.saveUserData();
  16469. }
  16470. static getClassicTimes() {
  16471. return this.userData.classicTimes;
  16472. }
  16473. static setClassicTimes() {
  16474. this.userData.classicTimes += 1;
  16475. this.saveUserData();
  16476. }
  16477. static getGuideHelpLine() {
  16478. return this.userData.guideHelpLine;
  16479. }
  16480. static setGuideHelpLine() {
  16481. this.userData.guideHelpLine = 1;
  16482. this.saveUserData();
  16483. }
  16484. static getNewUser() {
  16485. return this.userData.newUser;
  16486. }
  16487. static setNewUser() {
  16488. this.userData.newUser = false;
  16489. this.saveUserData();
  16490. }
  16491. static getRootBallFoul() {
  16492. return this.userData.rootBallFoul;
  16493. }
  16494. static setRootBallFoul() {
  16495. this.userData.rootBallFoul = 1;
  16496. this.saveUserData();
  16497. }
  16498. static getTimeoutFoul() {
  16499. return this.userData.timeoutFoul;
  16500. }
  16501. static setTimeoutFoul() {
  16502. this.userData.timeoutFoul = 1;
  16503. this.saveUserData();
  16504. }
  16505. }
  16506. DataMgr.isNewUser = false;
  16507. DataMgr.fristEnter = true;
  16508. DataMgr.levelType = 0;
  16509. DataMgr.awardId = 0;
  16510. DataMgr.awardCoin = 0;
  16511. DataMgr.sceneId = -1;
  16512. DataMgr.tryId = 0;
  16513. DataMgr.curLevel = 1;
  16514. DataMgr.vipLevel = 0;
  16515. DataMgr.maxLevel = 0;
  16516. DataMgr.awardRatio = 1;
  16517. DataMgr.gameList = [];
  16518. DataMgr.rankList = [];
  16519. DataMgr.recoverTime = 480000;
  16520. DataMgr.minScore = 0;
  16521. DataMgr.rankDis = 0;
  16522. DataMgr.userSaving = false;
  16523. DataMgr.gameSaving = false;
  16524. class D3Tween extends Laya.Script3D {
  16525. constructor() {
  16526. super();
  16527. this.isInited = false;
  16528. }
  16529. ;
  16530. init() {
  16531. if (this.isInited)
  16532. return;
  16533. this.isInited = true;
  16534. this.gameObj = this.owner;
  16535. this.transform = this.gameObj.transform;
  16536. }
  16537. get rotX() {
  16538. return this.transform.localRotationEulerX;
  16539. }
  16540. set rotX(v) {
  16541. this.transform.localRotationEulerX = v;
  16542. }
  16543. get rotY() {
  16544. return this.transform.localRotationEulerY;
  16545. }
  16546. set rotY(v) {
  16547. this.transform.localRotationEulerY = v;
  16548. }
  16549. get rotZ() {
  16550. return this.transform.localRotationEulerZ;
  16551. }
  16552. set rotZ(v) {
  16553. this.transform.localRotationEulerZ = v;
  16554. }
  16555. get posX() {
  16556. return this.transform.localPositionX;
  16557. }
  16558. set posX(v) {
  16559. this.transform.localPositionX = v;
  16560. }
  16561. get posY() {
  16562. return this.transform.localPositionY;
  16563. }
  16564. set posY(v) {
  16565. this.transform.localPositionY = v;
  16566. }
  16567. get posZ() {
  16568. return this.transform.localPositionZ;
  16569. }
  16570. set posZ(v) {
  16571. this.transform.localPositionZ = v;
  16572. }
  16573. get rotation() {
  16574. return this.transform.localRotation;
  16575. }
  16576. set rotation(v) {
  16577. this.transform.localRotation = v;
  16578. }
  16579. }
  16580. class D2Hole extends Laya.Script {
  16581. constructor() { super(); }
  16582. onTriggerEnter(collider) {
  16583. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16584. return;
  16585. }
  16586. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16587. if (collider.owner["mySrc"].isRunSkillAni) {
  16588. return;
  16589. }
  16590. if (collider.owner["mySrc"].number != 0) {
  16591. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16592. }
  16593. xGame.common.ballColliHole(collider);
  16594. xGame.common.recoverCameraView();
  16595. }
  16596. }
  16597. }
  16598. class Table extends Laya.Script3D {
  16599. constructor() {
  16600. super();
  16601. this.isSetBorder = false;
  16602. this.inited = false;
  16603. }
  16604. ;
  16605. onAwake() {
  16606. this.init();
  16607. }
  16608. init() {
  16609. if (this.inited)
  16610. return;
  16611. this.inited = true;
  16612. this.gameObj = this.owner;
  16613. this.border = this.gameObj.getChildByName("border");
  16614. }
  16615. setBorderPos() {
  16616. if (this.isSetBorder)
  16617. return;
  16618. this.isSetBorder = true;
  16619. let ui = xGame.common.gameUI.ui;
  16620. let bar1 = this.border.getChildByName("bar1");
  16621. let bar2 = this.border.getChildByName("bar2");
  16622. let bar3 = this.border.getChildByName("bar3");
  16623. let bar4 = this.border.getChildByName("bar4");
  16624. let bar5 = this.border.getChildByName("bar5");
  16625. let bar6 = this.border.getChildByName("bar6");
  16626. this.setInfo(bar1, ui.border.bar1, "box");
  16627. this.setInfo(bar2, ui.border.bar2, "box");
  16628. this.setInfo(bar3, ui.border.bar3, "box");
  16629. this.setInfo(bar4, ui.border.bar4, "box");
  16630. this.setInfo(bar5, ui.border.bar5, "box");
  16631. this.setInfo(bar6, ui.border.bar6, "box");
  16632. let circle1 = this.border.getChildByName("circle1");
  16633. let circle2 = this.border.getChildByName("circle2");
  16634. let circle3 = this.border.getChildByName("circle3");
  16635. let circle4 = this.border.getChildByName("circle4");
  16636. let circle5 = this.border.getChildByName("circle5");
  16637. let circle6 = this.border.getChildByName("circle6");
  16638. this.setInfo(circle1, ui.border.circle1, "circle");
  16639. this.setInfo(circle2, ui.border.circle2, "circle");
  16640. this.setInfo(circle3, ui.border.circle3, "circle");
  16641. this.setInfo(circle4, ui.border.circle4, "circle");
  16642. this.setInfo(circle5, ui.border.circle5, "circle");
  16643. this.setInfo(circle6, ui.border.circle6, "circle");
  16644. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16645. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16646. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16647. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16648. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16649. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16650. let arr = xGame.common.gameMgr.holePosList;
  16651. xGame.common.gameMgr.posObj = {
  16652. "1": arr[0],
  16653. "3": arr[2],
  16654. "4": arr[3],
  16655. "6": arr[5]
  16656. };
  16657. }
  16658. initHolePos(x, y) {
  16659. if (x < 300)
  16660. x += 25;
  16661. else if (x > 1000)
  16662. x -= 25;
  16663. else if (y > 200)
  16664. y -= 10;
  16665. else
  16666. y += 10;
  16667. if (y < 200)
  16668. y += 30;
  16669. else if (y > 500)
  16670. y -= 30;
  16671. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16672. }
  16673. setInfo(d3Obj, d2Obj, type) {
  16674. let ui = xGame.common.gameUI.ui;
  16675. let sprite = new Laya.Sprite();
  16676. ui.border.displayObject.addChild(sprite);
  16677. let colli = xGame.common.getCollider(type);
  16678. sprite.addComponentIntance(colli);
  16679. let rigy = xGame.common.getRigbody();
  16680. rigy.type = "static";
  16681. sprite.addComponentIntance(rigy);
  16682. let d3Pos = d3Obj.transform.position;
  16683. xGame.common.pos3to2Convert(d3Pos);
  16684. let scaleX = d3Obj.transform.localScaleX;
  16685. let scaleZ = d3Obj.transform.localScaleZ;
  16686. let width = xGame.common.scale3to2Convert(scaleZ);
  16687. let height = xGame.common.scale3to2Convert(scaleX);
  16688. sprite.pivotX = width / 2;
  16689. sprite.pivotY = height / 2;
  16690. sprite.x = d3Pos.x;
  16691. sprite.y = d3Pos.y;
  16692. sprite.width = width;
  16693. sprite.height = height;
  16694. d2Obj.x = d3Pos.x;
  16695. d2Obj.y = d3Pos.y;
  16696. d2Obj.width = width;
  16697. d2Obj.height = height;
  16698. if (type == "box") {
  16699. colli.width = width;
  16700. colli.height = height;
  16701. colli.isSensor = false;
  16702. colli.label = "border";
  16703. }
  16704. else {
  16705. colli.radius = width / 2;
  16706. colli.isSensor = true;
  16707. colli.label = "hole";
  16708. sprite.addComponent(D2Hole);
  16709. }
  16710. }
  16711. }
  16712. class D3World extends Laya.Script3D {
  16713. constructor() {
  16714. super();
  16715. this.loadNum = 0;
  16716. this.setLoadNum = 7;
  16717. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16718. }
  16719. onAwake() {
  16720. }
  16721. loadScene() {
  16722. this.scene = this.owner;
  16723. let url = `res/unityRes/root.lh`;
  16724. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16725. this.scene.addChild(prefab);
  16726. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16727. this.putCameraInfo();
  16728. this.camera.enableHDR = false;
  16729. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16730. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16731. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16732. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16733. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16734. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16735. this.knife.active = false;
  16736. this.loadD3Obj();
  16737. }));
  16738. }
  16739. putCameraInfo() {
  16740. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16741. this.cameraObj = new cameraType();
  16742. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16743. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16744. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16745. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16746. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16747. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16748. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16749. this.visitAngleChild.init();
  16750. this.visitRootObj.posX = this.visitAngleChild.posX;
  16751. this.visitRootObj.posY = this.visitAngleChild.posY;
  16752. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16753. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16754. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16755. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16756. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16757. xGame.common.showOneCamera("mainCamera");
  16758. }
  16759. loadD3Obj() {
  16760. this.loadTable();
  16761. this.loadRoom();
  16762. this.loadInHoleParticial();
  16763. this.loadIceParticial();
  16764. this.loadHitParticial();
  16765. this.loadFireworksParticial();
  16766. this.loadBall();
  16767. }
  16768. loadInHoleParticial() {
  16769. this.loadD3Res("inHoleEft", "", (prefab) => {
  16770. prefab.addComponent(Partical);
  16771. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16772. });
  16773. }
  16774. loadIceParticial() {
  16775. this.loadD3Res("iceEft", "", (prefab) => {
  16776. prefab.addComponent(Partical);
  16777. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16778. });
  16779. }
  16780. loadHitParticial() {
  16781. this.loadD3Res("hitEft", "", (prefab) => {
  16782. prefab.addComponent(Partical);
  16783. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16784. });
  16785. }
  16786. loadFireworksParticial() {
  16787. this.loadD3Res("fireworksEft", "", (prefab) => {
  16788. prefab.addComponent(Partical);
  16789. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16790. });
  16791. }
  16792. loadBall(index = 1) {
  16793. this.loadD3Res("ball", index, (prefab) => {
  16794. this.ballPrefab = prefab;
  16795. this.ballPrefab.addComponent(Ball);
  16796. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16797. });
  16798. }
  16799. loadTable(index = 1) {
  16800. this.loadD3Res("table", index, (prefab) => {
  16801. this.tableSrc = prefab.addComponent(Table);
  16802. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16803. this.d3Hand.init();
  16804. this.tableRoot.addChild(prefab);
  16805. });
  16806. }
  16807. loadRoom(index = 1) {
  16808. this.loadD3Res("room", index, (prefab) => {
  16809. this.roomRoot.addChild(prefab);
  16810. });
  16811. }
  16812. loadD3Res(type, index, callback) {
  16813. let url = `res/unityRes/${type}${index}.lh`;
  16814. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16815. callback && callback(prefab);
  16816. this.checkResLoad();
  16817. }));
  16818. }
  16819. checkResLoad() {
  16820. this.loadNum++;
  16821. if (this.loadNum >= this.setLoadNum) {
  16822. xGame.eventMgr.event(D3RES_LOADED);
  16823. }
  16824. }
  16825. prePlayEft() {
  16826. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16827. eft.transform.localPositionX = 0;
  16828. eft.transform.localPositionY = -5;
  16829. eft.transform.localPositionZ = 0;
  16830. eft.active = true;
  16831. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16832. ice.transform.localPositionX = 0;
  16833. ice.transform.localPositionY = -5;
  16834. ice.transform.localPositionZ = 0;
  16835. ice.active = true;
  16836. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16837. hit.transform.localPositionX = 0;
  16838. hit.transform.localPositionY = -5;
  16839. hit.transform.localPositionZ = 0;
  16840. hit.active = true;
  16841. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16842. fireworks.transform.localPositionX = 0;
  16843. fireworks.transform.localPositionY = -5;
  16844. fireworks.transform.localPositionZ = 0;
  16845. fireworks.active = true;
  16846. }
  16847. }
  16848. class cameraType {
  16849. }
  16850. class MoyuMgr$1 {
  16851. static initMoyu() {
  16852. this.moyuView = new MoyuView$1();
  16853. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16854. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16855. this.moyuView.ui.displayObject.zOrder = 1000;
  16856. this.moyuView.init();
  16857. this.moyuView.showTip(true);
  16858. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16859. window['XApk'] = this;
  16860. }
  16861. static showAge(show) {
  16862. if (this.moyuView)
  16863. this.moyuView.showAge(show);
  16864. }
  16865. static onPlatMsg(idx) {
  16866. if (!MoyuMgr$1.moyuView)
  16867. return;
  16868. if (idx == '0') {
  16869. MoyuMgr$1.moyuView.showTip(false);
  16870. }
  16871. }
  16872. static showAgree(call) {
  16873. if (this.moyuView)
  16874. this.moyuView.showAgree(call);
  16875. else
  16876. call && call();
  16877. }
  16878. static showXy(type = 1) {
  16879. if (this.moyuView)
  16880. this.moyuView.showXy(type);
  16881. }
  16882. }
  16883. MoyuMgr$1.isAdvise = false;
  16884. class MoyuView$1 {
  16885. constructor() {
  16886. this.ysxyNum = 1;
  16887. this.ysJson = null;
  16888. this.ui = ui_UIMoyu.createInstance();
  16889. }
  16890. init() {
  16891. this.ui.mainBg.visible = false;
  16892. this.ui.xyNode.visible = false;
  16893. this.ui.ageNode.visible = false;
  16894. this.ui.tipNode.visible = false;
  16895. this.ui.rnNode.visible = false;
  16896. this.ui.fcmNode.visible = false;
  16897. this.ui.ageTip.visible = false;
  16898. this.ui.msgNode.visible = false;
  16899. this.ui.visible = false;
  16900. this.ui.xyNode.xyList.setVirtual();
  16901. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16902. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16903. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16904. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16905. this.ui.xyNode.btnKnown.visible = false;
  16906. this.ui.xyNode.xy1.visible = false;
  16907. this.ui.xyNode.xy2.visible = false;
  16908. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16909. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16910. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16911. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16912. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16913. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16914. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16915. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16916. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16917. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16918. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16919. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16920. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16921. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16922. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16923. this.ysxyNum = 2;
  16924. }
  16925. }
  16926. onClick(obj) {
  16927. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16928. switch (obj) {
  16929. case this.ui.ageTip:
  16930. if (Moyu.isTTApk) {
  16931. this.ui.ageNode.visible = true;
  16932. this.ui.mainBg.visible = true;
  16933. }
  16934. break;
  16935. case this.ui.tipNode:
  16936. this.showTip(false);
  16937. break;
  16938. case this.ui.ageNode.btnAge:
  16939. this.ui.ageNode.visible = false;
  16940. this.ui.mainBg.visible = false;
  16941. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16942. this.ui.visible = false;
  16943. break;
  16944. case this.ui.xyNode.btnXy3:
  16945. case this.ui.xyNode.btnXy1:
  16946. this.loadXy(1);
  16947. break;
  16948. case this.ui.xyNode.btnXy2:
  16949. this.loadXy(2);
  16950. break;
  16951. case this.ui.xyNode.btnBack:
  16952. this.ui.xyNode.xy1.visible = true;
  16953. this.ui.xyNode.xy2.visible = false;
  16954. break;
  16955. case this.ui.xyNode.btnKnown:
  16956. this.ui.xyNode.visible = false;
  16957. this.ui.mainBg.visible = false;
  16958. this.ui.visible = false;
  16959. break;
  16960. case this.ui.rnNode.btnCheck:
  16961. this.check();
  16962. break;
  16963. case this.ui.rnNode.btnExit:
  16964. case this.ui.xyNode.btnNo:
  16965. this.ysxyNum--;
  16966. if (this.ysxyNum > 0)
  16967. this.showMsg("Refuse to quit the game once again");
  16968. else {
  16969. Moyu.userAgree(false);
  16970. Moyu.exit();
  16971. }
  16972. break;
  16973. case this.ui.xyNode.btnSure:
  16974. case this.ui.xyNode.btnYes:
  16975. DataMgr.userData.isAgree = true;
  16976. DataMgr.saveUserData();
  16977. this.onAgree();
  16978. break;
  16979. case this.ui.rnNode.btnDone:
  16980. this.ui.rnNode.visible = false;
  16981. this.ui.visible = false;
  16982. break;
  16983. case this.ui.fcmNode.btnRn:
  16984. this.showRn();
  16985. break;
  16986. }
  16987. }
  16988. showTip(show) {
  16989. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16990. return;
  16991. if (show) {
  16992. MoyuMgr$1.isAdvise = true;
  16993. this.ui.visible = true;
  16994. this.ui.tipNode.visible = true;
  16995. this.ui.tipNode.alpha = 1;
  16996. Laya.timer.once(1000, this, this.showTip, [false]);
  16997. }
  16998. else {
  16999. this.ui.tipNode.alpha = 1;
  17000. this.ui.tipNode.visible = true;
  17001. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  17002. this.ui.tipNode.visible = false;
  17003. MoyuMgr$1.isAdvise = false;
  17004. }), 1000);
  17005. }
  17006. }
  17007. showAge(show, px = 0, py = 0) {
  17008. if (Moyu.platType > 10 && !Moyu.isIos) {
  17009. this.ui.ageTip.x = px;
  17010. this.ui.ageTip.y = py;
  17011. this.ui.ageTip.visible = show;
  17012. if (show)
  17013. this.ui.visible = true;
  17014. }
  17015. }
  17016. showAgree(call) {
  17017. this.agreeCall = call;
  17018. this.onAgree();
  17019. return;
  17020. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  17021. this.showXy(0);
  17022. }
  17023. else
  17024. this.onAgree();
  17025. }
  17026. onAgree() {
  17027. if (!this.ui.ageNode.visible)
  17028. this.ui.visible = false;
  17029. this.ui.xyNode.visible = false;
  17030. Moyu.userAgree(true);
  17031. this.showAge(false);
  17032. this.agreeCall && this.agreeCall();
  17033. this.showRn();
  17034. }
  17035. showMsg(txt) {
  17036. this.ui.msgNode.txtMsg.text = txt;
  17037. this.ui.msgNode.visible = true;
  17038. this.ui.msgNode.alpha = 1;
  17039. this.ui.visible = true;
  17040. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  17041. this.ui.msgNode.visible = false;
  17042. }), 2500, true);
  17043. }
  17044. showRn() {
  17045. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17046. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  17047. this.ui.rnNode.rn1.visible = true;
  17048. this.ui.rnNode.rn2.visible = false;
  17049. this.ui.rnNode.rn3.visible = false;
  17050. this.ui.rnNode.rn4.visible = false;
  17051. this.ui.rnNode.visible = true;
  17052. this.ui.mainBg.visible = true;
  17053. this.ui.rnNode.btnDone.visible = false;
  17054. this.ui.rnNode.btnExit.visible = true;
  17055. this.ui.rnNode.btnCheck.visible = true;
  17056. this.ui.fcmNode.visible = false;
  17057. this.ui.visible = true;
  17058. return;
  17059. }
  17060. }
  17061. this.showFcm();
  17062. }
  17063. showFcm() {
  17064. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17065. Moyu.initFCM(true);
  17066. if (Moyu.gameTime < 1)
  17067. this.fcmLoop();
  17068. else if (Moyu.gameTime < 999)
  17069. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  17070. }
  17071. }
  17072. fcmLoop() {
  17073. if (Moyu.gameTime < 1) {
  17074. this.ui.rnNode.visible = false;
  17075. this.ui.fcmNode.visible = true;
  17076. this.ui.mainBg.visible = true;
  17077. this.ui.visible = true;
  17078. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  17079. Laya.timer.clear(this.ui, this.fcmLoop);
  17080. }
  17081. }
  17082. check() {
  17083. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  17084. this.ui.rnNode.rn1.visible = false;
  17085. this.ui.rnNode.rn2.visible = false;
  17086. this.ui.rnNode.rn4.visible = true;
  17087. }
  17088. else if (this.ui.rnNode.rn4.visible) {
  17089. let name = this.ui.rnNode.inputName.text;
  17090. let code = this.ui.rnNode.inputCode.text;
  17091. if (code && code.length == 18) {
  17092. this.ui.rnNode.rn1.visible = false;
  17093. this.ui.rnNode.rn4.visible = false;
  17094. Moyu.authenticate(name, code, (res) => {
  17095. this.ui.rnNode.rn2.visible = !res;
  17096. this.ui.rnNode.rn3.visible = res;
  17097. this.ui.rnNode.btnDone.visible = res;
  17098. this.ui.rnNode.btnExit.visible = !res;
  17099. this.ui.rnNode.btnCheck.visible = !res;
  17100. if (res)
  17101. this.showFcm();
  17102. });
  17103. }
  17104. else
  17105. this.showMsg("信息填写不完整");
  17106. }
  17107. }
  17108. loadXy(type = 0) {
  17109. this.ui.xyNode.xy1.visible = false;
  17110. this.ui.xyNode.xy2.visible = true;
  17111. this.ui.xyNode.xyList.scrollToView(0);
  17112. if (type == 1) {
  17113. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  17114. }
  17115. else if (type == 2) {
  17116. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  17117. }
  17118. }
  17119. showXy(type = 0) {
  17120. this.xyBtn();
  17121. if (type == 0) {
  17122. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  17123. this.ui.xyNode.btnSure.visible = true;
  17124. }
  17125. else {
  17126. this.ui.xyNode.btnYes.visible = true;
  17127. this.ui.xyNode.btnNo.visible = true;
  17128. }
  17129. }
  17130. else {
  17131. this.ui.xyNode.btnKnown.visible = true;
  17132. this.ui.mainBg.visible = true;
  17133. }
  17134. this.ui.xyNode.xy1.visible = true;
  17135. this.ui.xyNode.xy2.visible = false;
  17136. this.ui.xyNode.visible = true;
  17137. this.ui.visible = true;
  17138. }
  17139. xyBtn() {
  17140. this.ui.xyNode.btnSure.visible = false;
  17141. this.ui.xyNode.btnYes.visible = false;
  17142. this.ui.xyNode.btnNo.visible = false;
  17143. this.ui.xyNode.btnKnown.visible = false;
  17144. {
  17145. this.ui.xyNode.btnXy3.visible = false;
  17146. this.ui.xyNode.btnXy2.visible = true;
  17147. this.ui.xyNode.btnXy1.visible = true;
  17148. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  17149. }
  17150. }
  17151. createXY(json) {
  17152. this.ysJson = json.content;
  17153. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  17154. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  17155. this.ui.xyNode.xy2.visible = true;
  17156. }
  17157. renderListItem(idx, cell) {
  17158. let xy = this.ysJson[idx];
  17159. cell.height = xy.line * 30;
  17160. cell.xyItem.text = xy.text;
  17161. }
  17162. onDestroy() {
  17163. this.agreeCall = null;
  17164. }
  17165. }
  17166. class UILoading extends UIBase {
  17167. constructor() {
  17168. super();
  17169. this.accTime = 0;
  17170. this.curNum = 0;
  17171. this.rate = 1;
  17172. this.loadSubOk = false;
  17173. this.loadResOK = false;
  17174. this.openLoading = true;
  17175. this.beginLoadRes = false;
  17176. this.finishD2 = false;
  17177. this.finishD3 = false;
  17178. }
  17179. onConstructor() {
  17180. this.ui = ui_UILoading.createInstance();
  17181. this.contentPane = this.ui;
  17182. this.isEject = false;
  17183. this._initUI();
  17184. this._addEvent();
  17185. }
  17186. _initUI() {
  17187. MoyuMgr$1.initMoyu();
  17188. }
  17189. _addEvent() {
  17190. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  17191. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  17192. }
  17193. show() {
  17194. super.show();
  17195. console.log('zh:加载分包资源');
  17196. loadSubRes(this.subResProgress.bind(this));
  17197. this.ui.txtLoad.text = "Loading...";
  17198. }
  17199. subResProgress(pro, finish) {
  17200. this.curNum = pro;
  17201. if (finish) {
  17202. this.curNum = 1;
  17203. this.loadSubOk = true;
  17204. }
  17205. }
  17206. laodD3Res() {
  17207. let scene3D = new Laya.Scene3D();
  17208. xGame.common.d3Scene = scene3D;
  17209. xGame.common.d3World = scene3D.addComponent(D3World);
  17210. xGame.common.d3World.loadScene();
  17211. }
  17212. loadD2Res() {
  17213. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  17214. this.finishD2 = true;
  17215. this.checkLoadAll();
  17216. this.curNum = 1;
  17217. }), Laya.Handler.create(this, (pro) => {
  17218. this.curNum = pro;
  17219. }, null, false));
  17220. }
  17221. d3ResFinish() {
  17222. this.finishD3 = true;
  17223. this.checkLoadAll();
  17224. }
  17225. checkLoadAll() {
  17226. if (this.finishD2 && this.finishD3) {
  17227. this.loadResOK = true;
  17228. }
  17229. }
  17230. loadRes() {
  17231. this.laodD3Res();
  17232. this.loadD2Res();
  17233. }
  17234. myUpdate(dt) {
  17235. if (!this.openLoading)
  17236. return;
  17237. this.accTime += dt * this.rate;
  17238. if (this.accTime >= this.curNum)
  17239. this.accTime = this.curNum;
  17240. this.ui.loadinfo.value = this.accTime * 100;
  17241. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  17242. if (!this.beginLoadRes) {
  17243. this.beginLoadRes = true;
  17244. this.ui.txtLoad.text = "Loading...";
  17245. this.curNum = 0;
  17246. this.accTime = 0;
  17247. this.loadRes();
  17248. }
  17249. if (this.loadResOK) {
  17250. this.openLoading = false;
  17251. Laya.timer.once(300, this, () => {
  17252. xGame.common.d3Scene.active = false;
  17253. MoyuMgr$1.showAgree(enterGame);
  17254. });
  17255. }
  17256. }
  17257. }
  17258. release() {
  17259. }
  17260. hide() {
  17261. super.hide();
  17262. this.release();
  17263. }
  17264. onClose() {
  17265. this.hide();
  17266. }
  17267. }
  17268. UILoading.uiName = "UILoading";
  17269. class UIRepentProp$1 extends UIBase {
  17270. constructor() {
  17271. super();
  17272. this.viewType = 0;
  17273. this.regretType = 0;
  17274. }
  17275. onConstructor() {
  17276. this.ui = ui_UIRepentProp.createInstance();
  17277. this.contentPane = this.ui;
  17278. this.isEject = false;
  17279. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17280. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17281. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17282. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17283. }
  17284. show(viewType, regretType, callback) {
  17285. PlatMgr.showInsert(true);
  17286. this.viewType = viewType;
  17287. this.regretType = regretType;
  17288. this.callback = callback;
  17289. super.show();
  17290. this.ui.t0.play();
  17291. this.ui.c1.selectedIndex = this.viewType;
  17292. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17293. if (this.viewType == 0) {
  17294. let guide = DataMgr.getGuideHelpLine();
  17295. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17296. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17297. }
  17298. xGame.common.gameMgr.gamePause = true;
  17299. }
  17300. hideSelf() {
  17301. xGame.common.gameMgr.gamePause = false;
  17302. this.callback && this.callback(false);
  17303. this.hide();
  17304. }
  17305. videoRegret() {
  17306. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  17307. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  17308. }
  17309. else {
  17310. console.log('zh:AD 失败,直接发放奖励');
  17311. this.qjff_AD_for_UIrepentProp_videoRegret();
  17312. }
  17313. }
  17314. qjff_AD_for_UIrepentProp_videoRegret() {
  17315. this.callback && this.callback(true);
  17316. this.hideSelf();
  17317. }
  17318. videoAddHelpLine() {
  17319. let guide = DataMgr.getGuideHelpLine();
  17320. if (guide == 0) {
  17321. this.callback && this.callback(true);
  17322. this.hideSelf();
  17323. DataMgr.setGuideHelpLine();
  17324. xGame.common.gameUI.ui.guideNode.visible = false;
  17325. }
  17326. else {
  17327. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  17328. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  17329. }
  17330. else {
  17331. console.log('zh:AD 失败,直接发放奖励');
  17332. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  17333. }
  17334. }
  17335. }
  17336. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  17337. this.callback && this.callback(true);
  17338. this.hideSelf();
  17339. }
  17340. }
  17341. UIRepentProp$1.uiName = "UIRepentProp";
  17342. class UIRodMethod$1 extends UIBase {
  17343. constructor() {
  17344. super();
  17345. this.isPressd = false;
  17346. }
  17347. onConstructor() {
  17348. this.ui = ui_UIRodMethod.createInstance();
  17349. this.contentPane = this.ui;
  17350. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17351. this.moveDir = new Laya.Vector2();
  17352. this.moveDest = new Laya.Vector2();
  17353. this.centerPos = new Laya.Vector2();
  17354. xGame.common.uiRodMethod = this;
  17355. }
  17356. show() {
  17357. super.show();
  17358. xGame.common.gameMgr.gamePause = true;
  17359. this.openPressDotEvent();
  17360. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17361. this.centerPos.x = this.ui.white.x;
  17362. this.centerPos.y = this.ui.white.y;
  17363. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17364. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17365. this.setDot();
  17366. }
  17367. setDot() {
  17368. this.ui.dot.x = this.moveDest.x;
  17369. this.ui.dot.y = this.moveDest.y;
  17370. }
  17371. closeSelf() {
  17372. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17373. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17374. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17375. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17376. xGame.common.gameMgr.gamePause = false;
  17377. this.hide();
  17378. }
  17379. openPressDotEvent() {
  17380. this.closePressDotEvent();
  17381. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17382. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17383. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17384. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17385. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17386. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17387. }
  17388. closePressDotEvent() {
  17389. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17390. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17391. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17392. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17393. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17394. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17395. }
  17396. onDown(e) {
  17397. if (e.type == Laya.Event.MOUSE_DOWN)
  17398. this.isPressd = true;
  17399. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17400. this.isPressd = false;
  17401. if (!this.isPressd)
  17402. return;
  17403. this.moveDest.x = e.stageX;
  17404. this.moveDest.y = e.stageY;
  17405. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17406. if (dis > 6724) {
  17407. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17408. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17409. }
  17410. this.setDot();
  17411. }
  17412. resetRod() {
  17413. this.ui.dot.x = this.ui.white.x;
  17414. this.ui.dot.y = this.ui.white.y;
  17415. this.gameRod.dot.x = this.gameRod.bg.x;
  17416. this.gameRod.dot.y = this.gameRod.bg.y;
  17417. xGame.common.rodOffest.x = 0;
  17418. xGame.common.rodOffest.y = 0;
  17419. }
  17420. }
  17421. UIRodMethod$1.uiName = "UIRodMethod";
  17422. class UIMsg$1 extends UIBase {
  17423. constructor() {
  17424. super();
  17425. }
  17426. onConstructor() {
  17427. this.ui = ui_UIMsg.createInstance();
  17428. this.contentPane = this.ui;
  17429. this.isEject = false;
  17430. this.isMuti = true;
  17431. }
  17432. show(msg, callback) {
  17433. super.show();
  17434. this.ui.tipsNode.msgTxt.text = msg;
  17435. this.ui.alpha = 1;
  17436. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17437. this.hide();
  17438. callback && callback();
  17439. }), 1000);
  17440. }
  17441. }
  17442. UIMsg$1.uiName = "UIMsg";
  17443. class UITips$1 extends UIBase {
  17444. constructor() {
  17445. super();
  17446. this.type = 0;
  17447. }
  17448. onConstructor() {
  17449. this.ui = ui_UITips.createInstance();
  17450. this.contentPane = this.ui;
  17451. this.isEject = false;
  17452. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17453. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17454. }
  17455. show(tipsTxt, womanTxt, type) {
  17456. super.show();
  17457. this.ui.t0.play();
  17458. this.ui.myNode.tipsTxt.text = tipsTxt;
  17459. this.ui.myNode.womanTxt.text = womanTxt;
  17460. PlatMgr.showInsert(true);
  17461. this.ui.myNode.c1.selectedIndex = type;
  17462. this.type = type;
  17463. switch (this.type) {
  17464. case TipsType.exitGame:
  17465. xGame.common.gameMgr.gamePause = true;
  17466. break;
  17467. case TipsType.foul:
  17468. Laya.timer.once(200, this, () => {
  17469. xGame.common.gameMgr.gamePause = true;
  17470. });
  17471. break;
  17472. default:
  17473. break;
  17474. }
  17475. }
  17476. clickLeftBtn() {
  17477. this.hide();
  17478. xGame.common.gameMgr.gamePause = false;
  17479. switch (this.type) {
  17480. case TipsType.exitGame:
  17481. break;
  17482. case TipsType.foul:
  17483. break;
  17484. default:
  17485. break;
  17486. }
  17487. }
  17488. clickRightBtn() {
  17489. this.hide();
  17490. switch (this.type) {
  17491. case TipsType.exitGame:
  17492. xGame.eventMgr.event(RESET_GAME);
  17493. xGame.uiMgr.Show(UIMain$1);
  17494. Moyu.recordEnd(this, null);
  17495. xGame.common.longHelpLine = false;
  17496. break;
  17497. case TipsType.foul:
  17498. xGame.common.gameMgr.gamePause = false;
  17499. Laya.timer.clearAll(this);
  17500. break;
  17501. default:
  17502. break;
  17503. }
  17504. }
  17505. }
  17506. UITips$1.uiName = "UITips";
  17507. class UIGame$1 extends UIBase {
  17508. constructor() {
  17509. super();
  17510. this.powerNum = 0;
  17511. this.isD3Inited = false;
  17512. this.isPrePlay = false;
  17513. this.isMoveRod = false;
  17514. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17515. this.rulerDis = 20;
  17516. this.rulerOffset = 0;
  17517. }
  17518. onConstructor() {
  17519. this.ui = ui_UIGame.createInstance();
  17520. this.contentPane = this.ui;
  17521. this.ui.x += xGame.common.sysOffestNum;
  17522. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17523. this.isEject = false;
  17524. xGame.common.gameUI = this;
  17525. this.initSelf();
  17526. }
  17527. isTurnSelf() {
  17528. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17529. return true;
  17530. }
  17531. }
  17532. initSelf() {
  17533. let topUI = this.ui.topNode;
  17534. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17535. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17536. this.barInfo = {};
  17537. this.barInfo.curY = 0;
  17538. this.barInfo.height = this.ui.powerNode.height;
  17539. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17540. this.barInfo.powerStartY = this.ui.powerNode.y;
  17541. xGame.common.aiPlayer = new AIPlayer();
  17542. xGame.common.gameMgr = new GameMgr();
  17543. xGame.common.skillMgr = new SkillMgr();
  17544. xGame.common.wordsMgr = new WordsMgr();
  17545. xGame.common.talkMgr = new TalkMgr();
  17546. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17547. console.log("加载经典模式表情文件chenggon !");
  17548. });
  17549. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17550. console.log("挑战模式奖励模式spine加载成功!");
  17551. });
  17552. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17553. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17554. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17555. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17556. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17557. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17558. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17559. }
  17560. returnHome() {
  17561. let tips = "Are you sure to exit the game?";
  17562. let woman = "Boss, why don't you play for a while longer?";
  17563. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17564. }
  17565. addRodMethodClick() {
  17566. if (this.isTurnSelf()) {
  17567. xGame.uiMgr.Show(UIRodMethod$1);
  17568. }
  17569. }
  17570. clickHelpLineBtn(force = false) {
  17571. if (!this.isTurnSelf())
  17572. return;
  17573. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17574. if (success) {
  17575. xGame.common.longHelpLine = true;
  17576. xGame.common.d2World.getHelpLine();
  17577. Moyu.sendDataEvent("guideNum");
  17578. }
  17579. else {
  17580. }
  17581. });
  17582. }
  17583. renderSelfDisplayBalls(index, target) {
  17584. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17585. target.myImg.url = xGame.common.getGameIconUrl(str);
  17586. }
  17587. renderAIDisplayBalls(index, target) {
  17588. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17589. target.myImg.url = xGame.common.getGameIconUrl(str);
  17590. ;
  17591. }
  17592. updateMode() {
  17593. if (xGame.common.gameMode == GameMode.classic) {
  17594. this.ui.topNode.scoreNode.visible = false;
  17595. }
  17596. else if (xGame.common.gameMode == GameMode.bigMove) {
  17597. this.ui.topNode.scoreNode.visible = true;
  17598. }
  17599. }
  17600. show() {
  17601. super.show();
  17602. console.log("zh:uigame show");
  17603. this.ui.alpha = 0;
  17604. this.updateSelf();
  17605. console.log("zh:uigame bf gamemusic01 start");
  17606. xGame.soundMgr.playMusic("gamemusic01");
  17607. console.log("zh:uigame bf gamemusic01 end");
  17608. xGame.common.gameMgr.gamePause = false;
  17609. xGame.common.gameUI.ui.blackAni.visible = false;
  17610. xGame.common.gameUI.ui.whiteAni.visible = false;
  17611. this.ui.powerEft.visible = false;
  17612. this.ui.colorNode.visible = false;
  17613. this.updateHead();
  17614. }
  17615. updateSelf() {
  17616. if (xGame.common.gameMode == GameMode.classic) {
  17617. this.ui.c1.selectedIndex = 0;
  17618. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17619. this.ui.topNode.middleNode.visible = true;
  17620. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17621. }
  17622. else if (xGame.common.gameMode == GameMode.bigMove) {
  17623. this.ui.c1.selectedIndex = 0;
  17624. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17625. this.ui.topNode.middleNode.visible = false;
  17626. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17627. let rand = xGame.common.randomNum(1, max);
  17628. let guide = DataMgr.getSkillGuide();
  17629. if (guide == 0)
  17630. rand = 1;
  17631. xGame.common.bigMoveLevelIndex = rand;
  17632. }
  17633. else if (xGame.common.gameMode == GameMode.placeBall) {
  17634. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17635. this.ui.c1.selectedIndex = 1 + data.type;
  17636. this.ui.alpha = 1;
  17637. this.startGame();
  17638. }
  17639. this.updateMode();
  17640. this.initD3world();
  17641. this.initD2world();
  17642. }
  17643. startGame() {
  17644. this.ui.snowNode.visible = Math.random() <= 0.1;
  17645. this.ui.d2Node.visible = false;
  17646. xGame.common.d3World.d3Hand.gameObj.active = false;
  17647. xGame.common.d3World.tableSrc.init();
  17648. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17649. this.cameraViewChange(() => {
  17650. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17651. switch (xGame.common.gameMode) {
  17652. case GameMode.classic:
  17653. xGame.common.d3World.d3Hand.gameObj.active = true;
  17654. this.playPutBallD3Ani();
  17655. break;
  17656. case GameMode.bigMove:
  17657. this.enterGame();
  17658. Laya.timer.once(500, this, () => {
  17659. this.ui.topNode.middleNode.visible = true;
  17660. this.ui.topNode.middleNode.t0.play();
  17661. });
  17662. break;
  17663. case GameMode.placeBall:
  17664. this.enterGame();
  17665. break;
  17666. default:
  17667. break;
  17668. }
  17669. });
  17670. PlatMgr.showBanner(false);
  17671. }
  17672. enterGame() {
  17673. this.ui.d2Node.visible = true;
  17674. xGame.common.d3World.d3Hand.gameObj.active = false;
  17675. xGame.common.showOneCamera("mainCamera");
  17676. Moyu.recordGame(30, true);
  17677. if (!this.isPrePlay) {
  17678. this.isPrePlay = true;
  17679. xGame.common.d3World.prePlayEft();
  17680. }
  17681. xGame.common.gameMgr.gameReady();
  17682. this.openAllEvent();
  17683. this.ui.snowNode.visible = false;
  17684. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17685. this.ui.helpBtn.visible = condition;
  17686. }
  17687. showHelpLineGuide() {
  17688. let longGuide = DataMgr.getGuideHelpLine();
  17689. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17690. this.ui.helpBtn.visible = true;
  17691. this.ui.guideNode.visible = true;
  17692. }
  17693. }
  17694. setTurnAlpha(alpha) {
  17695. this.ui.keduNode.alpha = alpha;
  17696. this.ui.ganNode.alpha = alpha;
  17697. this.ui.rodMethodNode.alpha = alpha;
  17698. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17699. }
  17700. cameraViewChange(callback) {
  17701. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17702. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17703. xGame.common.showOneCamera("visitAngle");
  17704. cameraSrc.localRotationEulerY = 180;
  17705. cameraSrc.localRotationEulerZ = 0;
  17706. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17707. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17708. callback && callback();
  17709. }));
  17710. }));
  17711. }
  17712. playPutBallD3Ani() {
  17713. xGame.common.showOneCamera("mainCamera");
  17714. let handSrc = xGame.common.d3World.d3Hand;
  17715. handSrc.gameObj.active = true;
  17716. handSrc.transform.localPositionZ = 3;
  17717. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17718. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17719. handSrc.gameObj.active = false;
  17720. this.enterGame();
  17721. }), 400);
  17722. }));
  17723. }
  17724. updateHead() {
  17725. let user = Moyu.getUserInfo();
  17726. this.ui.topNode.selfNameTxt.text = user.nickName;
  17727. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17728. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17729. if (DataMgr.getSkillGuide() < 1) {
  17730. this.ui.topNode.aiNameTxt.text = 'billiards';
  17731. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17732. }
  17733. else {
  17734. this.ui.topNode.aiNameTxt.text = aiData.name;
  17735. let randNo = Math.floor(Math.random() * 10) + 1;
  17736. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17737. }
  17738. }
  17739. initD2world() {
  17740. let node = this.ui.d2Root.displayObject;
  17741. let src = node.getComponent(D2World);
  17742. if (!src) {
  17743. xGame.common.d2World = node.addComponent(D2World);
  17744. }
  17745. xGame.common.d2World.initSelf();
  17746. }
  17747. initD3world() {
  17748. if (this.isD3Inited)
  17749. return;
  17750. this.isD3Inited = true;
  17751. let scene3D = xGame.common.d3Scene;
  17752. this.ui.d3Root.displayObject.addChild(scene3D);
  17753. scene3D.active = true;
  17754. xGame.common.d3World.tableSrc.setBorderPos();
  17755. }
  17756. onRootMove(e) {
  17757. let rootBall = xGame.common.d2World.rootBall;
  17758. this.ui.moveNode.x = e.x;
  17759. this.ui.moveNode.y = e.y;
  17760. rootBall.gameObj.x = e.x;
  17761. rootBall.gameObj.y = e.y;
  17762. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17763. }
  17764. aiRootMove(move) {
  17765. if (move)
  17766. this.hideBallUI();
  17767. else {
  17768. this.showBallUI();
  17769. xGame.common.d2World.getHelpLine();
  17770. }
  17771. }
  17772. aiForce(type, force = 0) {
  17773. this.pressTarget = PressType.powerNode;
  17774. if (type == 1)
  17775. this.onEventUp({ force: true });
  17776. else if (type == 2)
  17777. this.onEventMove({ stageY: force, force: true });
  17778. }
  17779. onEventPress(e) {
  17780. if (e.stopPropagation)
  17781. e.stopPropagation();
  17782. if (!this.isTurnSelf())
  17783. return;
  17784. let target = e.target;
  17785. switch (target) {
  17786. case this.ui.myPowerNode.displayObject:
  17787. this.pressTarget = PressType.powerNode;
  17788. this.barInfo.curY = e.stageY;
  17789. this.updateBarInfo();
  17790. break;
  17791. case this.ui.moveNode.displayObject:
  17792. this.pressTarget = PressType.moveNode;
  17793. this.hideBallUI();
  17794. this.eventObj.curX = this.ui.moveNode.x;
  17795. this.eventObj.curY = this.ui.moveNode.y;
  17796. this.ui.moveNode.finger.visible = false;
  17797. this.eventObj.lastX = e.stageX;
  17798. this.eventObj.lastY = e.stageY;
  17799. break;
  17800. case this.ui.rulerClickNode.displayObject:
  17801. this.pressTarget = PressType.rulerNode;
  17802. this.eventObj.lastY = e.stageY;
  17803. break;
  17804. case this.ui.d2Root.displayObject:
  17805. this.pressTarget = PressType.d2Root;
  17806. this.eventObj.lastX = e.stageX;
  17807. this.eventObj.lastY = e.stageY;
  17808. this.eventObj.starX = e.stageX;
  17809. this.eventObj.starY = e.stageY;
  17810. this.eventObj.curX = 0;
  17811. this.eventObj.curY = 0;
  17812. xGame.common.d2World.d2Gan.setGanLastInfo();
  17813. this.rulerOffset = 0;
  17814. break;
  17815. default:
  17816. break;
  17817. }
  17818. }
  17819. onEventMove(e) {
  17820. if (e.stopPropagation)
  17821. e.stopPropagation();
  17822. if (e && e.force) {
  17823. }
  17824. else {
  17825. if (!this.isTurnSelf())
  17826. return;
  17827. }
  17828. switch (this.pressTarget) {
  17829. case PressType.powerNode:
  17830. this.barInfo.curY = e.stageY;
  17831. this.updateBarInfo();
  17832. this.isMoveRod = true;
  17833. break;
  17834. case PressType.moveNode:
  17835. let rootBall = xGame.common.d2World.rootBall;
  17836. let radius = rootBall.gameObj.width / 2;
  17837. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17838. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17839. let border = xGame.common.d2World.borderRect;
  17840. if (curX <= border.x + radius)
  17841. curX = border.x + radius;
  17842. else if (curX >= border.x + border.width - radius)
  17843. curX = border.x + border.width - radius;
  17844. if (curY <= border.y + radius)
  17845. curY = border.y + radius;
  17846. else if (curY >= border.y + border.height - radius)
  17847. curY = border.y + border.height - radius;
  17848. if (xGame.common.gameMgr.isOpenBall) {
  17849. if (curX >= border.x + border.openBallW - radius)
  17850. curX = border.x + border.openBallW - radius;
  17851. }
  17852. this.ui.moveNode.x = curX;
  17853. this.ui.moveNode.y = curY;
  17854. rootBall.gameObj.x = curX;
  17855. rootBall.gameObj.y = curY;
  17856. rootBall.d3BallSrc.setTransPos(curX, curY);
  17857. this.isMoveRod = true;
  17858. break;
  17859. case PressType.rulerNode:
  17860. let yy = e.stageY - this.eventObj.lastY;
  17861. this.eventObj.lastY = e.stageY;
  17862. let ruler1 = this.ui.rulerNode.img1;
  17863. let ruler2 = this.ui.rulerNode.img2;
  17864. ruler1.y += yy;
  17865. ruler2.y += yy;
  17866. this.rulerOffset += yy;
  17867. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17868. this.rulerOffset = 0;
  17869. xGame.soundMgr.playSound("inch", 1, 10);
  17870. }
  17871. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17872. let h = ruler1.height;
  17873. this.checkGuide();
  17874. this.isMoveRod = true;
  17875. if (ruler1.y >= h) {
  17876. ruler1.y = -h;
  17877. ruler2.y = 0;
  17878. return;
  17879. }
  17880. else if (ruler1.y <= -h) {
  17881. ruler1.y = h;
  17882. ruler2.y = 0;
  17883. return;
  17884. }
  17885. if (ruler2.y >= h) {
  17886. ruler2.y = -h;
  17887. ruler1.y = 0;
  17888. return;
  17889. }
  17890. else if (ruler2.y <= -h) {
  17891. ruler2.y = h;
  17892. ruler1.y = 0;
  17893. return;
  17894. }
  17895. break;
  17896. case PressType.d2Root:
  17897. this.eventObj.curX = e.stageX;
  17898. this.eventObj.curY = e.stageY;
  17899. let offset = this.checkRodMoveDir();
  17900. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17901. this.eventObj.lastX = e.stageX;
  17902. this.eventObj.lastY = e.stageY;
  17903. break;
  17904. default:
  17905. break;
  17906. }
  17907. }
  17908. onEventUp(e) {
  17909. if (e.stopPropagation)
  17910. e.stopPropagation();
  17911. if (e && e.force) {
  17912. }
  17913. else {
  17914. if (!this.isTurnSelf())
  17915. return;
  17916. }
  17917. switch (this.pressTarget) {
  17918. case PressType.powerNode:
  17919. this.ui.powerNode.value = 0;
  17920. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17921. this.ui.powerTxt.text = "";
  17922. if (this.powerNum > 0) {
  17923. xGame.eventMgr.event(BALL_SHOOT);
  17924. xGame.common.d2World.shoot(this.powerNum);
  17925. xGame.common.d2World.d2Gan.shoot();
  17926. xGame.common.d2World.d2HelpLine.shoot();
  17927. this.finishGuide();
  17928. this.ui.powerEft.visible = false;
  17929. this.ui.colorNode.visible = false;
  17930. let ganStr = "";
  17931. if (this.powerNum <= 30) {
  17932. ganStr = "gan_30";
  17933. }
  17934. else if (this.powerNum <= 60) {
  17935. ganStr = "gan_50";
  17936. }
  17937. else {
  17938. ganStr = "gan_80";
  17939. }
  17940. xGame.soundMgr.playSound(ganStr);
  17941. }
  17942. break;
  17943. case PressType.moveNode:
  17944. let rootBall = xGame.common.d2World.rootBall;
  17945. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17946. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17947. let isIntersect = this.judgeBallIntersect();
  17948. if (isIntersect) {
  17949. this.ui.moveNode.x = lastX;
  17950. this.ui.moveNode.y = lastY;
  17951. rootBall.gameObj.x = lastX;
  17952. rootBall.gameObj.y = lastY;
  17953. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17954. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17955. }
  17956. else {
  17957. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17958. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17959. }
  17960. this.showBallUI();
  17961. this.ui.moveNode.finger.visible = true;
  17962. xGame.common.d2World.getHelpLine();
  17963. break;
  17964. case PressType.rulerNode:
  17965. break;
  17966. case PressType.d2Root:
  17967. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17968. if (dis <= 25) {
  17969. this.moveToClickDot(e);
  17970. }
  17971. break;
  17972. default:
  17973. break;
  17974. }
  17975. this.pressTarget = -1;
  17976. }
  17977. checkGuide() {
  17978. let guide = DataMgr.getSkillGuide();
  17979. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17980. xGame.common.guideStep++;
  17981. xGame.common.gameUI.ui.guide2.visible = false;
  17982. xGame.common.gameUI.ui.guide3.visible = true;
  17983. }
  17984. }
  17985. finishGuide() {
  17986. let guide = DataMgr.getSkillGuide();
  17987. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17988. xGame.common.guideStep = 10;
  17989. this.closeAllGuide();
  17990. }
  17991. }
  17992. closeAllGuide() {
  17993. xGame.common.gameUI.ui.guide1.visible = false;
  17994. xGame.common.gameUI.ui.guide2.visible = false;
  17995. xGame.common.gameUI.ui.guide3.visible = false;
  17996. }
  17997. updateBarInfo() {
  17998. let star = this.ui.powerNode.y;
  17999. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  18000. if (rate >= 1)
  18001. rate = 1;
  18002. if (rate <= 0)
  18003. rate = 0;
  18004. this.powerNum = Math.ceil(rate * 100);
  18005. this.ui.powerNode.value = this.powerNum;
  18006. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  18007. this.ui.colorNode.value = this.powerNum;
  18008. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  18009. this.ui.powerEft.visible = this.powerNum != 0;
  18010. this.ui.colorNode.visible = this.powerNum != 0;
  18011. this.ui.powerTxt.text = this.powerNum + "";
  18012. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  18013. }
  18014. forceCancel() {
  18015. this.ui.powerNode.value = 0;
  18016. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18017. this.ui.powerTxt.text = "";
  18018. }
  18019. checkRodMoveDir() {
  18020. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  18021. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  18022. if (tempX >= 0 && tempY <= 0) {
  18023. return this.checkDir();
  18024. }
  18025. else if (tempX < 0 && tempY < 0) {
  18026. return this.checkDir(1, -1);
  18027. }
  18028. else if (tempX < 0 && tempY > 0) {
  18029. return this.checkDir(-1, -1);
  18030. }
  18031. else {
  18032. return this.checkDir(-1, 1);
  18033. }
  18034. }
  18035. checkDir(flagX = 1, flagY = 1) {
  18036. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  18037. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  18038. if (offsetY == 0) {
  18039. return offsetX * flagX;
  18040. }
  18041. if (offsetX == 0) {
  18042. return offsetY * flagY;
  18043. }
  18044. let angle = offsetY / offsetX;
  18045. if (Math.abs(angle) >= 1) {
  18046. return offsetY * flagY;
  18047. }
  18048. else {
  18049. return offsetX * flagX;
  18050. }
  18051. }
  18052. judgeBallIntersect() {
  18053. let rootBall = xGame.common.d2World.rootBall;
  18054. let ballArr = xGame.common.d2World.ballArr;
  18055. let radius = rootBall.gameObj.width / 2;
  18056. let temp;
  18057. let isIntersect = false;
  18058. for (let index = 0; index < ballArr.length; index++) {
  18059. temp = ballArr[index];
  18060. if (temp.number == rootBall.number)
  18061. continue;
  18062. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  18063. if (isIntersect) {
  18064. break;
  18065. }
  18066. }
  18067. return isIntersect;
  18068. }
  18069. hideBallUI() {
  18070. let d2Gan = xGame.common.d2World.d2Gan;
  18071. if (!d2Gan.ui.isDisposed)
  18072. d2Gan.ui.visible = false;
  18073. let d2Help = xGame.common.d2World.d2HelpLine;
  18074. if (!d2Help.ui.isDisposed)
  18075. d2Help.ui.visible = false;
  18076. let rootBall = xGame.common.d2World.rootBall;
  18077. if (!rootBall.destroyed) {
  18078. rootBall.gameObj.active = false;
  18079. }
  18080. }
  18081. showBallUI() {
  18082. let d2Gan = xGame.common.d2World.d2Gan;
  18083. if (!d2Gan.ui.isDisposed)
  18084. d2Gan.ui.visible = true;
  18085. let d2Help = xGame.common.d2World.d2HelpLine;
  18086. if (!d2Help.ui.isDisposed)
  18087. d2Help.ui.visible = true;
  18088. let rootBall = xGame.common.d2World.rootBall;
  18089. if (!rootBall.destroyed) {
  18090. rootBall.gameObj.active = true;
  18091. }
  18092. }
  18093. moveToClickDot(e) {
  18094. if (!this.isMoveRod && !xGame.common.clickedBall) {
  18095. let root = xGame.common.d2World.rootBall.gameObj;
  18096. let xx = e.stageX - xGame.common.sysOffestNum;
  18097. let yy = e.stageY;
  18098. let x = xx - root.x;
  18099. let y = yy - root.y;
  18100. let angle = xGame.common.getfguiRotation(x, y);
  18101. xGame.common.d2World.d2Gan.ui.rotation = angle;
  18102. xGame.common.d2World.getHelpLine();
  18103. }
  18104. this.isMoveRod = false;
  18105. xGame.common.clickedBall = false;
  18106. }
  18107. openAllEvent() {
  18108. this.closeAllEvent();
  18109. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18110. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18111. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18112. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18113. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18114. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18115. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18116. }
  18117. closeAllEvent() {
  18118. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18119. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18120. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18121. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18122. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18123. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18124. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18125. }
  18126. resetGame() {
  18127. this.closeAllEvent();
  18128. this.hideBallUI();
  18129. xGame.common.gameMgr.gamePause = true;
  18130. }
  18131. }
  18132. UIGame$1.uiName = "UIGame";
  18133. class UIAddCoin$1 extends UIBase {
  18134. constructor() {
  18135. super();
  18136. this.coinNum = 2000;
  18137. }
  18138. onConstructor() {
  18139. this.ui = ui_UIAddCoin.createInstance();
  18140. this.contentPane = this.ui;
  18141. this.isEject = false;
  18142. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18143. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  18144. }
  18145. show() {
  18146. super.show();
  18147. this.ui.t0.play();
  18148. }
  18149. videoAddCoin() {
  18150. console.log('zh:qjff_AD_for_UIAddCoin');
  18151. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  18152. }
  18153. else {
  18154. console.log('zh:AD 失败,直接发放奖励');
  18155. this.qjff_AD_for_UIAddCoin();
  18156. }
  18157. }
  18158. qjff_AD_for_UIAddCoin() {
  18159. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  18160. this.hide();
  18161. }
  18162. }
  18163. UIAddCoin$1.uiName = "UIAddCoin";
  18164. class UIInvitation$1 extends UIBase {
  18165. constructor() {
  18166. super();
  18167. }
  18168. onConstructor() {
  18169. this.ui = ui_UIInvitation.createInstance();
  18170. this.contentPane = this.ui;
  18171. this.isEject = false;
  18172. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  18173. }
  18174. show() {
  18175. super.show();
  18176. }
  18177. enterGame() {
  18178. xGame.common.gameMode = GameMode.classic;
  18179. DataMgr.setChallengeTimes(1);
  18180. xGame.common.passAwardCoin = 2000;
  18181. let need = xGame.common.classicNiceNeddCoin;
  18182. if (DataMgr.coinEnough(need)) {
  18183. DataMgr.setCoin(-need);
  18184. xGame.eventMgr.event(RESTART_GAME, true);
  18185. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  18186. }
  18187. else {
  18188. xGame.eventMgr.event(RESTART_GAME, true);
  18189. }
  18190. this.hide();
  18191. }
  18192. hide() {
  18193. super.hide();
  18194. }
  18195. }
  18196. UIInvitation$1.uiName = "UIInvitation";
  18197. class UIPower$1 extends UIBase {
  18198. constructor() {
  18199. super();
  18200. }
  18201. onConstructor() {
  18202. this.ui = ui_UIPower.createInstance();
  18203. this.contentPane = this.ui;
  18204. this.isEject = false;
  18205. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18206. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  18207. }
  18208. show() {
  18209. super.show();
  18210. this.ui.t0.play();
  18211. }
  18212. videoGetPower() {
  18213. console.log('zh:qjff_AD_for_uipower');
  18214. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  18215. }
  18216. else {
  18217. console.log('zh:AD 失败,直接发放奖励');
  18218. this.qjff_AD_for_uipower();
  18219. }
  18220. }
  18221. qjff_AD_for_uipower() {
  18222. DataMgr.setPower(xGame.common.videoPower, true);
  18223. xGame.eventMgr.event(POWER_TIME);
  18224. this.hide();
  18225. }
  18226. }
  18227. UIPower$1.uiName = "UIPower";
  18228. class UIGameEnd$1 extends UIBase {
  18229. constructor() {
  18230. super();
  18231. this.success = false;
  18232. this.awardCoinNum = 1000;
  18233. this.awardDiamondNum = 10;
  18234. }
  18235. onConstructor() {
  18236. this.ui = ui_UIGameEnd.createInstance();
  18237. this.contentPane = this.ui;
  18238. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  18239. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  18240. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  18241. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18242. this.ui.talkNode.visible = false;
  18243. if (Moyu.isKs)
  18244. this.ui.closeNode.closeBtn.x += 100;
  18245. }
  18246. updateType() {
  18247. switch (xGame.common.gameMode) {
  18248. case GameMode.classic:
  18249. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18250. this.ui.coinNode.visible = this.success;
  18251. if (!this.success) {
  18252. Laya.timer.once(500, this, () => {
  18253. xGame.uiMgr.Show(UIAddCoin$1);
  18254. });
  18255. }
  18256. this.ui.isGetAward.visible = false;
  18257. this.ui.leftBtn.c1.selectedIndex = 3;
  18258. this.ui.rightBtn.c1.selectedIndex = 0;
  18259. this.moneyNode.ui.c1.selectedIndex = 1;
  18260. break;
  18261. case GameMode.bigMove:
  18262. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18263. this.ui.coinNode.visible = this.success;
  18264. if (xGame.common.gameMode == GameMode.bigMove) {
  18265. if (this.success) {
  18266. DataMgr.setSkillSuccessTimes(1, true);
  18267. DataMgr.setSkillAccTimes(1);
  18268. }
  18269. else {
  18270. DataMgr.setSkillSuccessTimes(0, false);
  18271. }
  18272. }
  18273. if (!this.success) {
  18274. Laya.timer.once(500, this, () => {
  18275. xGame.uiMgr.Show(UIAddCoin$1);
  18276. });
  18277. }
  18278. this.ui.isGetAward.visible = false;
  18279. this.ui.leftBtn.c1.selectedIndex = 3;
  18280. this.ui.rightBtn.c1.selectedIndex = 0;
  18281. this.moneyNode.ui.c1.selectedIndex = 1;
  18282. break;
  18283. case GameMode.placeBall:
  18284. this.ui.coinNode.visible = false;
  18285. if (this.success) {
  18286. if (xGame.common.placeBallStarNum == 3) {
  18287. this.ui.c1.selectedIndex = 2;
  18288. }
  18289. else {
  18290. this.ui.c1.selectedIndex = 3;
  18291. }
  18292. }
  18293. else {
  18294. this.ui.c1.selectedIndex = 4;
  18295. }
  18296. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18297. if (cfg.type == PlaceBallType.challenge) {
  18298. this.ui.c1.selectedIndex = 2;
  18299. }
  18300. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  18301. this.updatePlaceBallBtn();
  18302. this.updatePlaceBallStarNum();
  18303. this.updatePlaceBallAwardState();
  18304. this.moneyNode.ui.c1.selectedIndex = 2;
  18305. this.moneyNode.checkPowerTime();
  18306. this.moneyNode.powerChange();
  18307. DataMgr.upRankData();
  18308. break;
  18309. default:
  18310. break;
  18311. }
  18312. }
  18313. updatePlaceBallBtn() {
  18314. this.ui.leftBtn.c1.selectedIndex = 5;
  18315. if (this.success) {
  18316. this.ui.rightBtn.c1.selectedIndex = 14;
  18317. }
  18318. else {
  18319. if (xGame.common.placeBallStarNum == 3) {
  18320. this.ui.rightBtn.c1.selectedIndex = 14;
  18321. }
  18322. else {
  18323. this.ui.rightBtn.c1.selectedIndex = 1;
  18324. }
  18325. }
  18326. }
  18327. updatePlaceBallStarNum() {
  18328. let starNum = xGame.common.placeBallStarNum;
  18329. if (starNum == 0)
  18330. this.ui.starNumNode.c1.selectedIndex = 3;
  18331. else {
  18332. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18333. }
  18334. }
  18335. updatePlaceBallAwardState() {
  18336. let level = xGame.common.placeBallCurLevel;
  18337. let starNum = xGame.common.placeBallStarNum;
  18338. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18339. let data = cfgTable.placeballData[level].award;
  18340. let cfg = cfgTable.placeballData[level];
  18341. this.awardDiamondNum = data[1];
  18342. this.awardCoinNum = data[0];
  18343. if (cfg.type == PlaceBallType.challenge) {
  18344. this.awardDiamondNum = 0;
  18345. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18346. }
  18347. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18348. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18349. if (cfg.type == PlaceBallType.challenge) {
  18350. this.ui.awardNode.coinNode.visible = true;
  18351. }
  18352. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18353. this.ui.awardNode.diamondNode.x = 265;
  18354. this.ui.awardNode.coinNode.x = 354;
  18355. }
  18356. else {
  18357. this.ui.awardNode.diamondNode.x = 291;
  18358. this.ui.awardNode.coinNode.x = 291;
  18359. }
  18360. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18361. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18362. if (this.awardCoinNum == 0) {
  18363. this.ui.awardNode.coinNode.numTxt.text = "";
  18364. }
  18365. if (getAward) {
  18366. this.ui.isGetAward.visible = true;
  18367. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18368. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18369. }
  18370. else {
  18371. this.ui.isGetAward.visible = false;
  18372. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18373. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18374. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18375. }
  18376. else {
  18377. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18378. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18379. }
  18380. }
  18381. }
  18382. show(success) {
  18383. super.show();
  18384. xGame.eventMgr.event(RESET_GAME);
  18385. this.success = success;
  18386. Laya.timer.clearAll(this);
  18387. this.playSecretaryAni();
  18388. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18389. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18390. offsetTime = Math.floor(offsetTime / 1000);
  18391. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18392. this.updateType();
  18393. Laya.timer.once(200, this, () => {
  18394. this.addAward(() => {
  18395. this.updateType();
  18396. Laya.timer.once(500, this, () => {
  18397. this.showChallengeLevel();
  18398. });
  18399. });
  18400. });
  18401. if (this.success) {
  18402. xGame.soundMgr.playSound('slots_roll01');
  18403. xGame.soundMgr.playSound("s_win");
  18404. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18405. }
  18406. else {
  18407. xGame.soundMgr.playSound('matchwin01');
  18408. xGame.soundMgr.playSound("s_lose");
  18409. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18410. }
  18411. if (!Moyu.isLegal)
  18412. PlatMgr.showBanner(true);
  18413. let challengeNum = DataMgr.getChallengeTimes();
  18414. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18415. DataMgr.setChallengeTimes(1);
  18416. }
  18417. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18418. DataMgr.setClassicTimes();
  18419. }
  18420. }
  18421. showChallengeLevel() {
  18422. if (DataMgr.getChallengeTimes() != 0)
  18423. return;
  18424. let skill = DataMgr.getSkillAccTimes();
  18425. let put = DataMgr.getPlaceBallLevelList().length;
  18426. if (skill >= 3 || put >= 5) {
  18427. xGame.uiMgr.Show(UIInvitation$1);
  18428. this.hide();
  18429. }
  18430. }
  18431. addAward(callback) {
  18432. if (!this.success) {
  18433. callback && callback();
  18434. return;
  18435. }
  18436. switch (xGame.common.gameMode) {
  18437. case GameMode.classic:
  18438. this.awardCoinNum = xGame.common.passAwardCoin;
  18439. this.awardDiamondNum = 0;
  18440. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18441. break;
  18442. case GameMode.bigMove:
  18443. this.awardCoinNum = xGame.common.passAwardCoin;
  18444. this.awardDiamondNum = 0;
  18445. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18446. callback && callback();
  18447. break;
  18448. case GameMode.placeBall:
  18449. let level = xGame.common.placeBallCurLevel;
  18450. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18451. if (xGame.common.placeBallStarNum != 3) {
  18452. callback && callback();
  18453. return;
  18454. }
  18455. else {
  18456. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18457. if (getAward) {
  18458. callback && callback();
  18459. return;
  18460. }
  18461. }
  18462. let cfg = cfgTable.placeballData[level];
  18463. let data = cfgTable.placeballData[level].award;
  18464. this.awardCoinNum = data[0];
  18465. this.awardDiamondNum = data[1];
  18466. if (cfg.type == PlaceBallType.challenge) {
  18467. this.awardDiamondNum = 0;
  18468. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18469. }
  18470. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18471. let diamondAward;
  18472. if (this.awardDiamondNum > 0) {
  18473. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18474. xGame.common.getAward([diamondAward, coinAward], callback);
  18475. }
  18476. else {
  18477. xGame.common.getAward([coinAward], callback);
  18478. }
  18479. if (cfg.type == PlaceBallType.normal) {
  18480. DataMgr.setPlaceBallAward(level);
  18481. }
  18482. break;
  18483. default:
  18484. break;
  18485. }
  18486. }
  18487. playSecretaryAni_old() {
  18488. let parent = this.ui.secretary.displayObject;
  18489. parent.destroyChildren();
  18490. let xx = this.ui.secretary.width / 2;
  18491. let yy = this.ui.secretary.height;
  18492. let scale = xGame.common.getSecretaryScale();
  18493. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18494. if (this.success) {
  18495. let rand = Math.random() <= 0.5 ? 2 : 3;
  18496. xGame.common.secretary.play(data, rand, false, parent, () => {
  18497. xGame.common.secretary.play(data, 1, true, parent);
  18498. });
  18499. }
  18500. else {
  18501. xGame.common.secretary.play(data, 0, true, parent);
  18502. }
  18503. }
  18504. playSecretaryAni() {
  18505. let parent = this.ui.secretary.displayObject;
  18506. parent.destroyChildren();
  18507. let xx = this.ui.secretary.width / 2;
  18508. let yy = this.ui.secretary.height;
  18509. let scale = xGame.common.getSecretaryScale();
  18510. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18511. if (this.success) {
  18512. let rand = 0;
  18513. xGame.common.secretary.play(data, 0, true, parent);
  18514. }
  18515. else {
  18516. xGame.common.secretary.play(data, 0, true, parent);
  18517. }
  18518. }
  18519. restartGame() {
  18520. switch (xGame.common.gameMode) {
  18521. case GameMode.classic:
  18522. xGame.eventMgr.event(RESTART_GAME);
  18523. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18524. break;
  18525. case GameMode.bigMove:
  18526. this.hide();
  18527. xGame.eventMgr.event(RESTART_GAME);
  18528. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18529. break;
  18530. default:
  18531. break;
  18532. }
  18533. }
  18534. hide() {
  18535. super.hide();
  18536. xGame.common.stopGirlPop(this.ui.talkNode);
  18537. PlatMgr.showBanner(false);
  18538. }
  18539. returnHome() {
  18540. this.hide();
  18541. let showFailWords = !this.success;
  18542. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18543. }
  18544. clickLeftBtn() {
  18545. switch (xGame.common.gameMode) {
  18546. case GameMode.classic:
  18547. case GameMode.bigMove:
  18548. this.returnHome();
  18549. break;
  18550. case GameMode.placeBall:
  18551. let level = xGame.common.placeBallCurLevel;
  18552. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18553. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18554. break;
  18555. default:
  18556. break;
  18557. }
  18558. }
  18559. powerStartPlaceBallLevel(level, btn) {
  18560. if (DataMgr.powerEnough()) {
  18561. btn.touchable = false;
  18562. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18563. btn.touchable = true;
  18564. DataMgr.setPower(-1);
  18565. xGame.eventMgr.event(POWER_TIME);
  18566. this.startPlaceBallLevel(level);
  18567. }));
  18568. }
  18569. else {
  18570. xGame.uiMgr.Show(UIPower$1, 0);
  18571. }
  18572. }
  18573. clickRightBtn() {
  18574. switch (xGame.common.gameMode) {
  18575. case GameMode.classic:
  18576. console.log('zh:clickRightBtn 111');
  18577. case GameMode.bigMove:
  18578. console.log('zh:clickRightBtn 222');
  18579. this.restartGame();
  18580. break;
  18581. case GameMode.placeBall:
  18582. console.log('zh:clickRightBtn 333');
  18583. let level = xGame.common.placeBallCurLevel;
  18584. let data = DataMgr.getPlaceBallLevel(level);
  18585. let curPss = data.play && !data.isCur;
  18586. if (curPss) {
  18587. console.log('zh:clickRightBtn 333-111');
  18588. console.log('zh:当前LV=' + level);
  18589. if (level == 60) {
  18590. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  18591. Laya.timer.once(3000, this, () => {
  18592. this.returnHome();
  18593. });
  18594. }
  18595. else {
  18596. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18597. }
  18598. }
  18599. else {
  18600. console.log('zh:clickRightBtn 333-000');
  18601. Moyu.sendDataEvent("placeBallNextLevel");
  18602. console.log('zh:qjff_AD_for_uiGameEnd');
  18603. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  18604. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  18605. }
  18606. else {
  18607. console.log('zh:AD 失败,直接发放奖励');
  18608. this.qjff_AD_for_uiGameEnd(level);
  18609. }
  18610. }
  18611. break;
  18612. default:
  18613. console.log('zh:clickRightBtn 444');
  18614. break;
  18615. }
  18616. }
  18617. qjff_AD_for_uiGameEnd(level) {
  18618. DataMgr.setPlaceBallLevel(level, 1);
  18619. this.startPlaceBallLevel(level + 1);
  18620. }
  18621. startPlaceBallLevel(level) {
  18622. xGame.common.gameMode = GameMode.placeBall;
  18623. xGame.common.placeBallCurLevel = level;
  18624. xGame.uiMgr.Show(UIGame$1);
  18625. this.hide();
  18626. }
  18627. }
  18628. UIGameEnd$1.uiName = "UIGameEnd";
  18629. class ShowItem$1 {
  18630. constructor() {
  18631. this.ui = ui_ShowItem.createInstance();
  18632. }
  18633. destroySelf() {
  18634. if (!this.ui.isDisposed) {
  18635. this.ui.removeFromParent();
  18636. this.ui.dispose();
  18637. }
  18638. }
  18639. setParent(parent) {
  18640. parent.addChild(this.ui);
  18641. }
  18642. setPos(x, y) {
  18643. this.ui.x = x;
  18644. this.ui.y = y;
  18645. }
  18646. setUrl(index) {
  18647. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18648. }
  18649. }
  18650. class UILevelProp$1 extends UIBase {
  18651. constructor() {
  18652. super();
  18653. this.firstPos = 385;
  18654. this.secondPos = 467;
  18655. this.showItemArr = [];
  18656. }
  18657. onFontLoaded() {
  18658. try {
  18659. this.ui.myNode.conditionTxt.font = "arial";
  18660. console.log("zh: onFontLoaded 设置arial字体成功");
  18661. }
  18662. catch (error) {
  18663. console.log("zh: constructor onFontLoaded加载arial字体失败");
  18664. }
  18665. }
  18666. onConstructor() {
  18667. this.ui = ui_UILevelProp.createInstance();
  18668. this.contentPane = this.ui;
  18669. this.isEject = false;
  18670. this.addUIClick(this.ui.closeBtn, this.hide);
  18671. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18672. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18673. }
  18674. show(level) {
  18675. super.show();
  18676. this.ui.t1.play();
  18677. this.level = level;
  18678. this.data = cfgTable.placeballData[this.level];
  18679. this.updateSelf();
  18680. this.showPreView();
  18681. this.moneyNode.ui.c1.selectedIndex = 2;
  18682. this.moneyNode.checkPowerTime();
  18683. this.moneyNode.powerChange();
  18684. }
  18685. showPreView() {
  18686. let item;
  18687. let data;
  18688. for (let index = 0; index < this.showItemArr.length; index++) {
  18689. item = this.showItemArr[index];
  18690. item.destroySelf();
  18691. }
  18692. this.showItemArr = [];
  18693. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18694. for (const key in cfgData) {
  18695. data = cfgData[key];
  18696. item = new ShowItem$1();
  18697. item.setParent(this.ui.myNode.displayRoot);
  18698. item.setPos(data.x, data.y);
  18699. item.setUrl(data.value);
  18700. this.showItemArr.push(item);
  18701. }
  18702. }
  18703. updateSelf() {
  18704. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18705. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18706. if (this.data.ball == -1) {
  18707. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18708. }
  18709. else {
  18710. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  18711. }
  18712. let localData = DataMgr.getPlaceBallLevel(this.level);
  18713. let getAward = localData.getAward;
  18714. let cfg = cfgTable.placeballData[this.level];
  18715. let coin = this.data.award[0];
  18716. let diamond = this.data.award[1];
  18717. if (cfg.type == PlaceBallType.challenge) {
  18718. diamond = 0;
  18719. coin = 100;
  18720. }
  18721. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18722. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18723. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18724. if (cfg.type == PlaceBallType.challenge) {
  18725. this.ui.myNode.coinNode.numTxt.text = "";
  18726. }
  18727. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18728. if (coin > 0 && diamond > 0) {
  18729. this.ui.myNode.diamondNode.x = 385;
  18730. this.ui.myNode.coinNode.x = 467;
  18731. }
  18732. else {
  18733. this.ui.myNode.diamondNode.x = 385;
  18734. this.ui.myNode.coinNode.x = 385;
  18735. }
  18736. if (!getAward) {
  18737. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18738. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18739. }
  18740. else {
  18741. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18742. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18743. }
  18744. }
  18745. startGame() {
  18746. if (DataMgr.powerEnough()) {
  18747. this.ui.myNode.startBtn.touchable = false;
  18748. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18749. console.log('zh:startGame ');
  18750. this.ui.myNode.startBtn.touchable = true;
  18751. DataMgr.setPower(-1);
  18752. xGame.eventMgr.event(POWER_TIME);
  18753. xGame.common.gameMode = GameMode.placeBall;
  18754. xGame.common.placeBallCurLevel = this.level;
  18755. xGame.uiMgr.Show(UIGame$1);
  18756. xGame.uiMgr.Hide(UILevelDisplay$1);
  18757. xGame.uiMgr.Hide(UIMain$1);
  18758. this.hide();
  18759. }));
  18760. }
  18761. else {
  18762. console.log('zh:startGame no power');
  18763. xGame.uiMgr.Show(UIPower$1);
  18764. }
  18765. }
  18766. hide() {
  18767. super.hide();
  18768. }
  18769. }
  18770. UILevelProp$1.uiName = "UILevelProp";
  18771. class PutBallLevelDisplay$1 {
  18772. constructor(ui, index) {
  18773. this.index = 0;
  18774. this.ui = ui;
  18775. this.index = index;
  18776. this.ui.onClick(this, this.clickSelf);
  18777. this.updateSelf();
  18778. this.ui.levelTxt.text = (this.index + 1) + "";
  18779. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18780. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18781. }
  18782. updateSelf() {
  18783. let level = this.index + 1;
  18784. this.data = DataMgr.getPlaceBallLevel(level);
  18785. this.ui.starNode.c1.selectedIndex = this.data.star;
  18786. let isChallenge = cfgTable.placeballData[level].type;
  18787. if (this.data.isCur) {
  18788. if (isChallenge) {
  18789. this.ui.c1.selectedIndex = 5;
  18790. }
  18791. else {
  18792. this.ui.c1.selectedIndex = 2;
  18793. }
  18794. }
  18795. else {
  18796. if (this.data.play) {
  18797. if (this.data.star == 3) {
  18798. this.ui.c1.selectedIndex = 0;
  18799. }
  18800. else {
  18801. this.ui.c1.selectedIndex = 1;
  18802. }
  18803. }
  18804. else {
  18805. if (isChallenge) {
  18806. this.ui.c1.selectedIndex = 4;
  18807. }
  18808. else {
  18809. this.ui.c1.selectedIndex = 3;
  18810. }
  18811. }
  18812. }
  18813. }
  18814. clickSelf() {
  18815. if (!this.data.play)
  18816. return;
  18817. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18818. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18819. }
  18820. }
  18821. class UILevelDisplay$1 extends UIBase {
  18822. constructor() {
  18823. super();
  18824. }
  18825. onConstructor() {
  18826. this.ui = ui_UILevelDisplay.createInstance();
  18827. this.contentPane = this.ui;
  18828. this.isEject = false;
  18829. this.myList = this.ui.myNode.myList;
  18830. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18831. this.levelItemArr = [];
  18832. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18833. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18834. this.myList.numItems = levelNum;
  18835. if (Moyu.isKs)
  18836. this.ui.closeNode.closeBtn.x += 100;
  18837. }
  18838. levelItemRender(index, target) {
  18839. let item = new PutBallLevelDisplay$1(target, index);
  18840. this.levelItemArr.push(item);
  18841. }
  18842. show() {
  18843. super.show();
  18844. this.updateLevel();
  18845. this.scrollToPlace();
  18846. }
  18847. updateLevel() {
  18848. let temp;
  18849. for (let index = 0; index < this.levelItemArr.length; index++) {
  18850. temp = this.levelItemArr[index];
  18851. temp.updateSelf();
  18852. }
  18853. }
  18854. scrollToPlace() {
  18855. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18856. let passArr = DataMgr.getPlaceBallLevelList();
  18857. let offest = passArr.length;
  18858. if (offest >= maxNum - 1)
  18859. offest = maxNum - 1;
  18860. this.myList.scrollToView(offest, true, true);
  18861. }
  18862. hide() {
  18863. super.hide();
  18864. }
  18865. }
  18866. UILevelDisplay$1.uiName = "UILevelDisplay";
  18867. class UIMatching$1 extends UIBase {
  18868. constructor() {
  18869. super();
  18870. }
  18871. onConstructor() {
  18872. this.ui = ui_UIMatching.createInstance();
  18873. this.contentPane = this.ui;
  18874. this.isEject = false;
  18875. }
  18876. show(callback) {
  18877. super.show();
  18878. PlatMgr.showBanner(true);
  18879. this.callback = callback;
  18880. let user = Moyu.getUserInfo();
  18881. if (!this.selfPot) {
  18882. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18883. }
  18884. if (!this.aiPot) {
  18885. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18886. }
  18887. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18888. this.ui.selfHead.nameTxt.text = user.nickName;
  18889. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18890. this.ui.aiHead.nameTxt.text = "???";
  18891. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18892. this.ui.selfHead.c1.selectedIndex = 0;
  18893. this.ui.aiHead.c1.selectedIndex = 0;
  18894. this.ui.selfHead.x = this.selfPot.x;
  18895. this.ui.selfHead.y = this.selfPot.y;
  18896. this.ui.aiHead.x = this.aiPot.x;
  18897. this.ui.aiHead.y = this.aiPot.y;
  18898. switch (xGame.common.gameMode) {
  18899. case GameMode.classic:
  18900. break;
  18901. case GameMode.bigMove:
  18902. this.initSkillData();
  18903. break;
  18904. default:
  18905. break;
  18906. }
  18907. this.ui.t1.play(Laya.Handler.create(this, () => {
  18908. this.ui.t2.play(Laya.Handler.create(this, () => {
  18909. switch (xGame.common.gameMode) {
  18910. case GameMode.classic:
  18911. this.waitingPeople();
  18912. break;
  18913. case GameMode.bigMove:
  18914. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18915. break;
  18916. default:
  18917. break;
  18918. }
  18919. }));
  18920. }));
  18921. }
  18922. initSkillData() {
  18923. this.skillSelectData = [];
  18924. let skillUrl = xGame.common.skillIconList;
  18925. let skillName = xGame.common.skillNameList;
  18926. let skillLevel = DataMgr.getBigSkillList();
  18927. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18928. for (let index = 0; index < 5; index++) {
  18929. let obj = {};
  18930. obj.skillImg = skillUrl[index];
  18931. obj.skillName = skillName[index];
  18932. obj.skillType = skillType[index];
  18933. obj.skillLevel = skillLevel[index];
  18934. this.skillSelectData.push(obj);
  18935. }
  18936. }
  18937. getAISkillLevel(myLevel) {
  18938. let video = xGame.common.upSkillLevel;
  18939. let aiLevel;
  18940. let temp;
  18941. if (video) {
  18942. temp = xGame.common.randomNum(-2, -1);
  18943. }
  18944. else {
  18945. if (myLevel <= 5) {
  18946. temp = xGame.common.randomNum(1, 3);
  18947. }
  18948. else if (myLevel <= 9) {
  18949. temp = xGame.common.randomNum(-2, 1);
  18950. }
  18951. else {
  18952. temp = xGame.common.randomNum(-4, 0);
  18953. }
  18954. }
  18955. aiLevel = temp + myLevel;
  18956. if (aiLevel <= 1)
  18957. aiLevel = 1;
  18958. if (aiLevel >= 10)
  18959. aiLevel = 10;
  18960. return aiLevel;
  18961. }
  18962. getAISkillType() {
  18963. return xGame.common.randomNum(1, 4);
  18964. let successTimes = DataMgr.getSkillSuccessTimes();
  18965. let info = cfgTable.aiskillData[successTimes];
  18966. if (!info) {
  18967. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18968. info = cfgTable.aiskillData[max];
  18969. }
  18970. let dataArr = info.skillselect;
  18971. let myCfg = {};
  18972. for (let index = 0; index < dataArr.length; index++) {
  18973. let temp = dataArr[index].split('-');
  18974. myCfg[temp[0]] = {};
  18975. myCfg[temp[0]].id = parseInt(temp[0]);
  18976. myCfg[temp[0]].weight = parseInt(temp[1]);
  18977. }
  18978. let aiCfg = xGame.common.initWeight(myCfg);
  18979. let curData = xGame.common.getRandomWeightData(aiCfg);
  18980. return parseInt(curData.id);
  18981. }
  18982. getAISkillData(index) {
  18983. let myLevel = this.skillSelectData[index].skillLevel;
  18984. let aiLevel = this.getAISkillLevel(myLevel);
  18985. let aiType = this.getAISkillType() - 1;
  18986. return { aiLevel, aiType } = { aiLevel, aiType };
  18987. }
  18988. skillSelectFinish(index) {
  18989. let aiInfo = this.getAISkillData(index);
  18990. xGame.common.gameMgr.selfCurSkill = index;
  18991. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18992. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18993. this.ui.selfHead.c1.selectedIndex = 1;
  18994. this.ui.aiHead.c1.selectedIndex = 1;
  18995. let myData = this.skillSelectData[index];
  18996. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18997. let guide = DataMgr.getSkillGuide();
  18998. if (guide == 0) {
  18999. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  19000. }
  19001. else {
  19002. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  19003. }
  19004. let aiData = this.skillSelectData[aiInfo.aiType];
  19005. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  19006. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  19007. this.waitingPeople();
  19008. }
  19009. waitingPeople() {
  19010. let time = xGame.common.randomNum(1000, 3000);
  19011. time += 1000;
  19012. Laya.timer.once(time, this, () => {
  19013. this.matchingSuccess();
  19014. });
  19015. }
  19016. matchingSuccess() {
  19017. let gameUI = xGame.common.gameUI;
  19018. let name = gameUI.ui.topNode.aiNameTxt.text;
  19019. let url = gameUI.ui.topNode.aiHeadLoader.url;
  19020. this.ui.aiHead.nameTxt.text = name;
  19021. this.ui.aiHead.headImg.url = url;
  19022. name = gameUI.ui.topNode.selfNameTxt.text;
  19023. url = gameUI.ui.topNode.selfHeadLoader.url;
  19024. this.ui.selfHead.nameTxt.text = name;
  19025. this.ui.selfHead.headImg.url = url;
  19026. this.ui.t3.play(Laya.Handler.create(this, () => {
  19027. this.callback && this.callback();
  19028. this.ui.t4.play(Laya.Handler.create(this, () => {
  19029. this.destroySelf();
  19030. }));
  19031. }));
  19032. }
  19033. destroySelf() {
  19034. this.callback = null;
  19035. this.skillSelectData = null;
  19036. this.selfPot = null;
  19037. this.aiPot = null;
  19038. if (!this.ui.isDisposed) {
  19039. this.ui.removeFromParent();
  19040. this.ui.dispose();
  19041. }
  19042. xGame.uiMgr.destroyUI(this);
  19043. }
  19044. }
  19045. UIMatching$1.uiName = "UIMatching";
  19046. class SkillDisplay$1 {
  19047. constructor(ui, data, uiIndex) {
  19048. this.starX = 0;
  19049. this.starY = 0;
  19050. this.index = 0;
  19051. this.ui = ui;
  19052. this.data = data;
  19053. this.index = uiIndex;
  19054. this.initSelf();
  19055. console.log('zh:SkillDisplay constructor this.skillData=', data);
  19056. }
  19057. initSelf() {
  19058. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  19059. this.ui.nameTxt.text = this.data.name;
  19060. this.ui.describeTxt.text = this.data.describe;
  19061. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  19062. this.ui.startBtn.onClick(this, this.startGame);
  19063. this.updateSelf();
  19064. }
  19065. updateSelf() {
  19066. this.checkTry();
  19067. let level = DataMgr.getBigSkillByIndex(this.index);
  19068. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  19069. }
  19070. checkTry() {
  19071. let index = this.index;
  19072. let level = DataMgr.getBigSkillByIndex(index);
  19073. if (level == null) {
  19074. DataMgr.setBigSkill(index, 1, false);
  19075. level = 1;
  19076. }
  19077. this.ui.levelTxt.text = "LV." + level;
  19078. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  19079. this.ui.tryNode.visible = true;
  19080. else
  19081. this.ui.tryNode.visible = false;
  19082. }
  19083. clickAddLevel() {
  19084. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19085. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  19086. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  19087. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  19088. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19089. }
  19090. else {
  19091. console.log('zh:AD 失败,直接发放奖励');
  19092. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19093. }
  19094. }
  19095. qjff_AD_for_skilldisplay_clickAddLevel() {
  19096. DataMgr.setBigSkill(this.data.index, 1);
  19097. this.updateSelf();
  19098. xGame.common.upSkillLevel = true;
  19099. }
  19100. startGame() {
  19101. if (this.data.index == 3) {
  19102. alert('Coming soon!');
  19103. return;
  19104. }
  19105. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19106. let needCoin = xGame.common.bigMoveNeedCoin;
  19107. xGame.common.passAwardCoin = 2000;
  19108. let guide = DataMgr.getSkillGuide();
  19109. console.log('zh:startGame guide=' + guide);
  19110. xGame.common.temSelfLevel = 0;
  19111. if (guide == 0) {
  19112. needCoin = 0;
  19113. xGame.common.temSelfLevel = 100;
  19114. }
  19115. if (DataMgr.coinEnough(needCoin)) {
  19116. DataMgr.setCoin(-needCoin);
  19117. xGame.common.curPlayerSkillType = this.index;
  19118. if (guide == 0)
  19119. xGame.common.curPlayerSkillType = 0;
  19120. xGame.uiMgr.Show(UIGame$1);
  19121. xGame.uiMgr.Hide(UIMain$1);
  19122. xGame.uiMgr.Show(UIMatching$1, () => {
  19123. xGame.common.gameUI.ui.alpha = 1;
  19124. xGame.common.gameUI.startGame();
  19125. xGame.uiMgr.Hide(UISkill$1);
  19126. });
  19127. }
  19128. else {
  19129. xGame.uiMgr.Show(UIAddProp$1, 0);
  19130. Moyu.sendDataEvent("AddCoinVideo");
  19131. }
  19132. }
  19133. }
  19134. class UISkill$1 extends UIBase {
  19135. constructor() {
  19136. super();
  19137. this.skillData = [];
  19138. }
  19139. onConstructor() {
  19140. this.ui = ui_UISkill.createInstance();
  19141. this.contentPane = this.ui;
  19142. this.isEject = false;
  19143. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19144. this.initSkillData();
  19145. console.log('zh:aaaaaa1111111111');
  19146. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  19147. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  19148. console.log('zh:aaaaaa22222222');
  19149. this.displayList = [];
  19150. this.ui.skillNode.skillList.numItems = 3;
  19151. this.addUIClick(this.ui, this.interuptSecretary);
  19152. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  19153. this.ui.talkNode.visible = false;
  19154. if (Moyu.isKs)
  19155. this.ui.closeNode.closeBtn.x += 100;
  19156. }
  19157. show() {
  19158. super.show();
  19159. this.playSecretaryIdle();
  19160. this.moneyNode.ui.c1.selectedIndex = 1;
  19161. Laya.timer.clearAll(this);
  19162. xGame.soundMgr.playSound("s_start");
  19163. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19164. let guide = DataMgr.getSkillGuide();
  19165. this.ui.guideNode.visible = guide == 0;
  19166. let item = this.getSkillItemByUIIndex(0);
  19167. if (guide == 0) {
  19168. item.ui.c1.selectedIndex = 1;
  19169. }
  19170. else {
  19171. item.ui.c1.selectedIndex = 0;
  19172. }
  19173. this.ui.guideNode.guideBtn.visible = guide == 0;
  19174. for (let index = 0; index < this.displayList.length; index++) {
  19175. this.displayList[index].checkTry();
  19176. }
  19177. }
  19178. getSkillItemByUIIndex(cur) {
  19179. for (let index = 0; index < this.displayList.length; index++) {
  19180. if (this.displayList[index].index == cur) {
  19181. return this.displayList[index];
  19182. }
  19183. }
  19184. }
  19185. enterGuideLevel() {
  19186. let item = this.getSkillItemByUIIndex(0);
  19187. item.startGame();
  19188. if (DataMgr.getNewUser())
  19189. Moyu.sendDataEvent("gameStart1");
  19190. }
  19191. initSkillData() {
  19192. this.skillData = [];
  19193. let nameList = xGame.common.skillNameList;
  19194. let iconList = xGame.common.skillIconList;
  19195. let describeList = [
  19196. "Jump shot executed — ball bounced and pocketed an extra one!",
  19197. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  19198. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  19199. ];
  19200. console.log('zh:initSkillData 111111111');
  19201. let data;
  19202. for (let index = 0; index < nameList.length; index++) {
  19203. data = {};
  19204. data.name = nameList[index];
  19205. data.icon = iconList[index];
  19206. data.describe = describeList[index];
  19207. data.index = index;
  19208. this.skillData.push(data);
  19209. }
  19210. }
  19211. updateSkillItem(index, target) {
  19212. if (this.displayList[index] == null) {
  19213. let uiIndex;
  19214. switch (index) {
  19215. case 0:
  19216. uiIndex = 1;
  19217. break;
  19218. case 1:
  19219. uiIndex = 0;
  19220. break;
  19221. case 2:
  19222. uiIndex = 2;
  19223. break;
  19224. case 3:
  19225. uiIndex = 3;
  19226. break;
  19227. default:
  19228. break;
  19229. }
  19230. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  19231. this.displayList.push(temp);
  19232. }
  19233. }
  19234. playSecretaryIdle() {
  19235. let parent = this.ui.secretary.displayObject;
  19236. parent.destroyChildren();
  19237. let xx = this.ui.secretary.width / 2;
  19238. let yy = this.ui.secretary.height;
  19239. let scale = xGame.common.getSecretaryScale();
  19240. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19241. xGame.common.secretary.play(data, 0, true, parent);
  19242. }
  19243. returnUIMain() {
  19244. this.hide();
  19245. xGame.common.stopGirlPop(this.ui.talkNode);
  19246. xGame.uiMgr.Show(UIMain$1);
  19247. }
  19248. interuptSecretary() {
  19249. Laya.timer.clearAll(this);
  19250. this.playSecretaryRandomSound();
  19251. }
  19252. playSecretaryRandomSound() {
  19253. if (this.isHide)
  19254. return;
  19255. let time = xGame.common.randomNum(45000, 60000);
  19256. Laya.timer.once(time, this, () => {
  19257. if (this.isHide)
  19258. return;
  19259. let index = xGame.common.randomNum(4, 7);
  19260. xGame.soundMgr.playSound("s_main0" + index);
  19261. let words = 1;
  19262. switch (index) {
  19263. case 4:
  19264. words = 5;
  19265. break;
  19266. case 5:
  19267. words = 3;
  19268. break;
  19269. case 6:
  19270. words = 6;
  19271. break;
  19272. case 7:
  19273. words = 7;
  19274. break;
  19275. default:
  19276. break;
  19277. }
  19278. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19279. this.playSecretaryRandomSound();
  19280. });
  19281. }
  19282. }
  19283. UISkill$1.uiName = "UISkill";
  19284. class UIAddProp$1 extends UIBase {
  19285. constructor() {
  19286. super();
  19287. this.curType = "";
  19288. }
  19289. onConstructor() {
  19290. this.ui = ui_UIAddProp.createInstance();
  19291. this.contentPane = this.ui;
  19292. this.isEject = false;
  19293. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19294. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  19295. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  19296. this.updateUI();
  19297. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  19298. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  19299. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  19300. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  19301. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  19302. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  19303. }
  19304. show(type) {
  19305. super.show();
  19306. this.curType = type == 0 ? "coin" : "diamond";
  19307. this.switchBtn("");
  19308. this.ui.t0.play();
  19309. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  19310. PlatMgr.showInsert(true);
  19311. }
  19312. closeSelf() {
  19313. this.hide();
  19314. }
  19315. updateUI() {
  19316. let data = cfgTable.moneyData;
  19317. let temp;
  19318. let obj;
  19319. for (const key in data) {
  19320. temp = data[key];
  19321. obj = this.ui.myNode["node" + key];
  19322. if (parseInt(key) <= 2) {
  19323. obj.diamondTxt.text = "+" + temp.num;
  19324. }
  19325. else {
  19326. obj.coinTxt.text = temp.num;
  19327. obj.diamondTxt.text = temp.get.split('_')[1];
  19328. }
  19329. }
  19330. this.updateDiamondShare();
  19331. }
  19332. updateDiamondShare() {
  19333. let data = DataMgr.getShareDiamondTimes();
  19334. if (data >= xGame.common.maxShareDiamondTimes) {
  19335. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  19336. this.ui.myNode.node1.touchable = false;
  19337. }
  19338. else {
  19339. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  19340. this.ui.myNode.node1.touchable = true;
  19341. }
  19342. }
  19343. switchBtn(type) {
  19344. if (type == "")
  19345. type = this.curType;
  19346. else {
  19347. if (this.curType == type) {
  19348. return;
  19349. }
  19350. else {
  19351. this.curType = type;
  19352. }
  19353. }
  19354. if (type == "coin") {
  19355. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  19356. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  19357. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  19358. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  19359. this.ui.myNode.c1.selectedIndex = 0;
  19360. }
  19361. else {
  19362. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  19363. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  19364. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  19365. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  19366. this.ui.myNode.c1.selectedIndex = 1;
  19367. }
  19368. }
  19369. convertCoin(index) {
  19370. let data = cfgTable.moneyData[index];
  19371. let coinNum = data.num;
  19372. let str = data.get.split('_')[1];
  19373. let needDiamond = parseInt(str);
  19374. if (DataMgr.diamondEnough(needDiamond)) {
  19375. DataMgr.setDiamond(-needDiamond);
  19376. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  19377. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  19378. }
  19379. else {
  19380. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  19381. this.switchBtn("diamond");
  19382. }
  19383. }
  19384. videoGetDiamond() {
  19385. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  19386. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  19387. }
  19388. else {
  19389. console.log('zh:AD 失败,直接发放奖励');
  19390. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  19391. }
  19392. }
  19393. qjff_AD_for_uiAddProp_videoGetDiamond() {
  19394. let num = cfgTable.moneyData[2].num;
  19395. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19396. this.closeSelf();
  19397. }
  19398. videoGetCoin() {
  19399. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  19400. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  19401. }
  19402. else {
  19403. console.log('zh:AD 失败,直接发放奖励');
  19404. this.qjff_AD_for_uiAddProp_videoGetCoin();
  19405. }
  19406. }
  19407. qjff_AD_for_uiAddProp_videoGetCoin() {
  19408. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19409. this.closeSelf();
  19410. }
  19411. shareGetDiamond() {
  19412. let times = DataMgr.getShareDiamondTimes();
  19413. if (times >= xGame.common.maxShareDiamondTimes) {
  19414. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19415. }
  19416. else {
  19417. if (Moyu.isTT) {
  19418. let num = cfgTable.moneyData[1].num;
  19419. Moyu.shareVideo = '';
  19420. Moyu.shareGame((success) => {
  19421. if (success) {
  19422. xGame.uiMgr.Show(UIMsg$1, "分享成功!");
  19423. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19424. DataMgr.setShareDiamondTimes(1);
  19425. this.updateDiamondShare();
  19426. }
  19427. else {
  19428. xGame.uiMgr.Show(UIMsg$1, "分享失败!");
  19429. }
  19430. });
  19431. }
  19432. else {
  19433. Moyu.showVideoAd(() => {
  19434. let diamond = xGame.common.randomNum(50, 100);
  19435. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19436. DataMgr.setShareDiamondTimes(1);
  19437. this.updateDiamondShare();
  19438. }, EAdType.randomDiamond);
  19439. }
  19440. }
  19441. }
  19442. qjff_AD_for_uiAddProp_shareGetDiamond() {
  19443. }
  19444. openPutBallView() {
  19445. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19446. let skill = xGame.uiMgr.getUI(UISkill$1);
  19447. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19448. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19449. if (end && !end.isHide) {
  19450. xGame.uiMgr.Hide(UIGameEnd$1);
  19451. xGame.uiMgr.Show(UIMain$1);
  19452. }
  19453. if (skill && !skill.isHide)
  19454. xGame.uiMgr.Hide(UISkill$1);
  19455. if (uigame && !uigame.isHide)
  19456. xGame.uiMgr.Hide(UIGame$1);
  19457. if (level && !level.isHide) {
  19458. }
  19459. else {
  19460. xGame.uiMgr.Show(UILevelDisplay$1);
  19461. }
  19462. this.closeSelf();
  19463. }
  19464. }
  19465. UIAddProp$1.uiName = "UIAddProp";
  19466. class MoneyNode$1 {
  19467. constructor(ui) {
  19468. this.leftTime = 0;
  19469. this.ui = ui;
  19470. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19471. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19472. this.ui.addPowerBtn.onClick(this, this.addPower);
  19473. this.ui.c1.selectedIndex = 1;
  19474. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19475. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19476. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19477. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19478. this.coinChange();
  19479. this.diamondChange();
  19480. this.powerChange();
  19481. }
  19482. addPower() {
  19483. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19484. xGame.uiMgr.Show(UIPower$1);
  19485. }
  19486. powerChange() {
  19487. let powerNum = DataMgr.getPower();
  19488. this.ui.powerTxt.text = powerNum + "";
  19489. }
  19490. checkPowerTime() {
  19491. let cur = new Date().getTime();
  19492. let last = DataMgr.getPowerTime();
  19493. if (last == 0) {
  19494. last = cur;
  19495. DataMgr.setPowerTime(cur);
  19496. }
  19497. let power = DataMgr.getPower();
  19498. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19499. Laya.timer.clearAll(this);
  19500. if (power >= xGame.common.natureMaxPower) {
  19501. this.ui.powerTimeTxt.text = "";
  19502. DataMgr.setPowerTime(cur);
  19503. return;
  19504. }
  19505. if (power + offset >= xGame.common.natureMaxPower) {
  19506. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19507. this.ui.powerTimeTxt.text = "";
  19508. DataMgr.setPowerTime(cur);
  19509. }
  19510. else {
  19511. if (offset > 0) {
  19512. DataMgr.setPower(offset);
  19513. DataMgr.setPowerTime(cur);
  19514. }
  19515. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19516. this.leftTime = xGame.common.powerRecoverNum - time;
  19517. if (this.leftTime <= 0)
  19518. this.leftTime = 0;
  19519. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19520. Laya.timer.loop(1000, this, this.updatePowerTime);
  19521. }
  19522. }
  19523. updatePowerTime() {
  19524. this.leftTime -= 1;
  19525. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19526. if (this.leftTime <= 0) {
  19527. this.checkPowerTime();
  19528. }
  19529. }
  19530. coinChange() {
  19531. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19532. }
  19533. diamondChange() {
  19534. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19535. }
  19536. addCoin() {
  19537. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19538. Moyu.sendDataEvent("AddCoinBtn");
  19539. xGame.uiMgr.Show(UIAddProp$1, 0);
  19540. }
  19541. addDiamond() {
  19542. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19543. Moyu.sendDataEvent("AddDiamondBtn");
  19544. xGame.uiMgr.Show(UIAddProp$1, 1);
  19545. }
  19546. }
  19547. class SettingNode$1 {
  19548. constructor(ui) {
  19549. this.showSetting = false;
  19550. this.openSound = true;
  19551. this.openShake = true;
  19552. this.ui = ui;
  19553. this.ui.soundBtn.onClick(this, this.switchSound);
  19554. this.ui.shakeBtn.onClick(this, this.switchShake);
  19555. this.ui.xyBtn.onClick(this, this.onXy);
  19556. this.ui.clickNode.onClick(this, this.changeSetting);
  19557. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19558. this.ui.xyBtn.visible = false;
  19559. this.ui.shakeBtn.visible = false;
  19560. }
  19561. changeSetting() {
  19562. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19563. this.showSetting = !this.showSetting;
  19564. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19565. }
  19566. switchSound() {
  19567. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19568. this.openSound = !this.openSound;
  19569. Moyu.onSetting(this.openSound, this.openShake);
  19570. xGame.soundMgr.onSetting(this.openSound);
  19571. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19572. }
  19573. switchShake() {
  19574. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19575. this.openShake = !this.openShake;
  19576. Moyu.onSetting(this.openSound, this.openShake);
  19577. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19578. }
  19579. onXy() {
  19580. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19581. MoyuMgr$1.showXy(1);
  19582. }
  19583. }
  19584. class UIDraw$1 extends UIBase {
  19585. constructor() {
  19586. super();
  19587. this.curKey = 0;
  19588. }
  19589. onConstructor() {
  19590. this.ui = ui_UIDraw.createInstance();
  19591. this.contentPane = this.ui;
  19592. this.isEject = false;
  19593. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19594. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19595. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19596. this.initDraw();
  19597. this.initUI();
  19598. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19599. if (Moyu.isKs)
  19600. this.ui.closeNode.closeBtn.x += 100;
  19601. }
  19602. show() {
  19603. super.show();
  19604. this.ui.t0.play();
  19605. this.playSecretaryIdle();
  19606. this.updateDraw();
  19607. this.checkFree();
  19608. if (PlatMgr.bannerDelay > 0) {
  19609. this.ui.closeNode.closeBtn.visible = false;
  19610. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19611. this.ui.closeNode.closeBtn.visible = true;
  19612. });
  19613. }
  19614. PlatMgr.showRateBanner();
  19615. }
  19616. hide() {
  19617. Laya.timer.clearAll(this);
  19618. super.hide();
  19619. }
  19620. checkFree() {
  19621. let isFree = DataMgr.getDailyfreeDrawTimes();
  19622. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19623. }
  19624. initDraw() {
  19625. this.drawObj = [];
  19626. let data = cfgTable.drawData;
  19627. let temp;
  19628. let weight = 0;
  19629. for (const key in data) {
  19630. temp = data[key];
  19631. weight += temp.weight;
  19632. this.drawObj.push(weight);
  19633. }
  19634. this.allWeight = weight;
  19635. }
  19636. initUI() {
  19637. let data = cfgTable.drawData;
  19638. let temp;
  19639. let img;
  19640. let txt;
  19641. for (const key in data) {
  19642. temp = data[key];
  19643. img = this.ui.myNode.rotNode["img" + key];
  19644. txt = this.ui.myNode.rotNode["txt" + key];
  19645. img.url = xGame.common.getGameIconUrl(temp.icon);
  19646. txt.visible = true;
  19647. if (temp.award > 2) {
  19648. img.rotation = 0;
  19649. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19650. }
  19651. else {
  19652. img.rotation = temp.rotation;
  19653. txt.text = temp.num;
  19654. }
  19655. }
  19656. }
  19657. getCurkey() {
  19658. let rand = Math.random() * this.allWeight;
  19659. let temp;
  19660. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19661. temp = this.drawObj[index];
  19662. if (index == 0) {
  19663. if (rand < temp) {
  19664. return index + 1;
  19665. }
  19666. }
  19667. else {
  19668. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19669. return index + 1;
  19670. }
  19671. }
  19672. }
  19673. return 2;
  19674. }
  19675. startDraw() {
  19676. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19677. if (freeTimes > 0) {
  19678. this.beginDraw();
  19679. DataMgr.setDailyfreeDrawTimes(0);
  19680. this.checkFree();
  19681. }
  19682. else {
  19683. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  19684. }
  19685. else {
  19686. console.log('zh:AD 失败,直接发放奖励');
  19687. this.qjff_chouJiang();
  19688. }
  19689. }
  19690. }
  19691. qjff_chouJiang() {
  19692. this.beginDraw();
  19693. }
  19694. beginDraw() {
  19695. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19696. this.ui.drawBtn.touchable = false;
  19697. this.curKey = this.getCurkey();
  19698. console.log("当前key", this.curKey);
  19699. let cell = 60;
  19700. let lap = 3;
  19701. let angle = cell * (this.curKey - 1) + lap * 360;
  19702. let target = this.ui.myNode.rotNode;
  19703. target.rotation = 0;
  19704. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19705. console.log("旋转完成");
  19706. this.ui.drawBtn.touchable = true;
  19707. this.getAward();
  19708. }));
  19709. }
  19710. getAward() {
  19711. let data = cfgTable.drawData[this.curKey];
  19712. let temp = new AwardType();
  19713. temp.type = data.award;
  19714. temp.num = data.num;
  19715. xGame.common.getAward([temp], () => {
  19716. DataMgr.setDrawTimes(1);
  19717. this.updateDraw();
  19718. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19719. });
  19720. }
  19721. updateDraw() {
  19722. let drawTimes = DataMgr.getDrawTimes();
  19723. let awardTimes = DataMgr.getDrawAwardTimes();
  19724. if (Math.floor(drawTimes / 3) > awardTimes) {
  19725. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19726. this.ui.extraNode.boxBtn.touchable = true;
  19727. this.ui.extraNode.tipsTxt.text = "3/3";
  19728. this.ui.extraNode.barNode.width = 265;
  19729. this.getExtraAward();
  19730. }
  19731. else {
  19732. this.ui.extraNode.boxBtn.t0.stop();
  19733. this.ui.extraNode.boxBtn.touchable = false;
  19734. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19735. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19736. }
  19737. let data = cfgTable.drawData[1];
  19738. if (awardTimes == 0) {
  19739. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19740. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19741. this.ui.myNode.rotNode.img1.rotation = 0;
  19742. }
  19743. else {
  19744. let award = data.nextid;
  19745. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19746. this.ui.myNode.rotNode.txt1.text = award[1];
  19747. this.ui.myNode.rotNode.img1.rotation = 0;
  19748. }
  19749. }
  19750. getExtraAward() {
  19751. let drawTimes = DataMgr.getDrawTimes();
  19752. let awardTimes = DataMgr.getDrawAwardTimes();
  19753. let data = cfgTable.drawData[1];
  19754. let award = new AwardType();
  19755. if (awardTimes == 0) {
  19756. award.num = data.num;
  19757. award.type = data.award;
  19758. xGame.common.getAward([award], () => {
  19759. let all = Math.floor(drawTimes / 3);
  19760. DataMgr.setDrawAwardTimes(all);
  19761. this.updateDraw();
  19762. });
  19763. }
  19764. else {
  19765. award.num = parseInt(data.nextid[1]);
  19766. award.type = parseInt(data.nextid[0]);
  19767. xGame.common.getAward([award], () => {
  19768. let all = Math.floor(drawTimes / 3);
  19769. DataMgr.setDrawAwardTimes(all);
  19770. this.updateDraw();
  19771. });
  19772. }
  19773. }
  19774. closeSelf() {
  19775. this.hide();
  19776. }
  19777. playSecretaryIdle() {
  19778. let parent = this.ui.secretary.displayObject;
  19779. parent.destroyChildren();
  19780. let xx = this.ui.secretary.width / 2;
  19781. let yy = this.ui.secretary.height;
  19782. let scale = xGame.common.getSecretaryScale();
  19783. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19784. xGame.common.secretary.play(data, 0, true, parent);
  19785. }
  19786. }
  19787. UIDraw$1.uiName = "UIDraw";
  19788. class UIRanking$1 extends UIBase {
  19789. constructor() {
  19790. super();
  19791. this.showSelf = true;
  19792. this.rankType = 1;
  19793. this.rankList = [];
  19794. this.myIndex = 0;
  19795. this.myStar = 0;
  19796. }
  19797. onConstructor() {
  19798. this.ui = ui_UIRanking.createInstance();
  19799. this.contentPane = this.ui;
  19800. this.isEject = false;
  19801. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19802. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19803. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19804. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19805. this.ui.myNode.myList.setVirtual();
  19806. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19807. }
  19808. show() {
  19809. super.show();
  19810. this.myIndex = 51;
  19811. Moyu.getRankList({
  19812. rankId: xGame.common.curRankID,
  19813. type: MoyuRankType.total,
  19814. page: 1,
  19815. pageSize: 50,
  19816. }, this, this.updateItemData);
  19817. this.updateSelf();
  19818. let self = Moyu.getUserInfo();
  19819. if (!self.isAuth) {
  19820. Moyu.initUser(this, () => {
  19821. DataMgr.upRankData();
  19822. });
  19823. }
  19824. }
  19825. updateSelfItem() {
  19826. let self = Moyu.getUserInfo();
  19827. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19828. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19829. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19830. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19831. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19832. }
  19833. updateItemData(data) {
  19834. this.myStar = xGame.common.getAllStarNum();
  19835. if (this.rankList.length < 2) {
  19836. this.rankList = data;
  19837. let self = Moyu.getUserInfo();
  19838. for (let i = 0; i < data.length; i++) {
  19839. let data = this.rankList[i];
  19840. if (data.userId == self.userId) {
  19841. this.rankList.splice(i, 1);
  19842. break;
  19843. }
  19844. }
  19845. for (let i = 0; i < data.length; i++) {
  19846. let data = this.rankList[i];
  19847. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19848. this.myIndex = i + 1;
  19849. let user = { headIcon: self.headIcon, nickName: "myself" };
  19850. let ud = { user: user, data: {} };
  19851. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19852. if (Moyu.platType < 11) {
  19853. user.headIcon = self.headIcon;
  19854. user.nickName = self.nickName;
  19855. }
  19856. this.rankList.splice(i, 0, md);
  19857. break;
  19858. }
  19859. }
  19860. }
  19861. this.updateSelfItem();
  19862. this.ui.myNode.myList.numItems = this.rankList.length;
  19863. }
  19864. updateItemUI(index, obj) {
  19865. let data = this.rankList[index];
  19866. let userData = JSON.parse(data.userData).user;
  19867. obj.nameTxt.text = userData.nickName.toString();
  19868. obj.valueTxt.text = data.rankScore;
  19869. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19870. obj.rankTxt.text = index + 1;
  19871. switch (index) {
  19872. case 0:
  19873. this.setImg(obj, 1, 0, 0);
  19874. obj.rankTxt.color = "#FFC047";
  19875. break;
  19876. case 1:
  19877. this.setImg(obj, 0, 1, 0);
  19878. obj.rankTxt.color = "#ACACAC";
  19879. break;
  19880. case 2:
  19881. this.setImg(obj, 0, 0, 1);
  19882. obj.rankTxt.color = "#D09672";
  19883. break;
  19884. default:
  19885. this.setImg(obj, 0, 0, 0);
  19886. obj.rankTxt.color = "#496FAB";
  19887. break;
  19888. }
  19889. }
  19890. setImg(obj, a, b, c) {
  19891. obj.img1.visible = a ? true : false;
  19892. obj.img2.visible = b ? true : false;
  19893. obj.img3.visible = c ? true : false;
  19894. }
  19895. changeList(type) {
  19896. this.rankType = type;
  19897. this.updateSelf();
  19898. }
  19899. changeSelfNode() {
  19900. this.showSelf = !this.showSelf;
  19901. this.updateSelf();
  19902. }
  19903. updateSelf() {
  19904. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19905. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19906. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19907. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19908. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19909. }
  19910. }
  19911. UIRanking$1.uiName = "UIRanking";
  19912. class UISecretary$1 extends UIBase {
  19913. constructor() {
  19914. super();
  19915. this.curIndex = 1;
  19916. }
  19917. onConstructor() {
  19918. this.ui = ui_UISecretary.createInstance();
  19919. this.contentPane = this.ui;
  19920. this.isEject = false;
  19921. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19922. this.nodeObj = { left: null, right: null, cur: null };
  19923. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19924. }
  19925. show() {
  19926. super.show();
  19927. this.ui.t0.play();
  19928. this.updateData();
  19929. }
  19930. addSecretarySpine(node, spineName) {
  19931. if (spineName == "mishu") {
  19932. if (this.secretarySpine1) {
  19933. node.displayObject.destroyChildren();
  19934. this.playWoman(this.secretarySpine1, node.displayObject);
  19935. }
  19936. else {
  19937. let spine1 = new SpineMgr("mishu", () => {
  19938. this.secretarySpine1 = spine1;
  19939. this.playWoman(this.secretarySpine1, node.displayObject);
  19940. });
  19941. }
  19942. }
  19943. else {
  19944. if (this.secretarySpine2) {
  19945. node.displayObject.destroyChildren();
  19946. this.playWoman(this.secretarySpine2, node.displayObject);
  19947. }
  19948. else {
  19949. let spine2 = new SpineMgr("xiaomishu2", () => {
  19950. this.secretarySpine2 = spine2;
  19951. this.playWoman(this.secretarySpine2, node.displayObject);
  19952. });
  19953. }
  19954. }
  19955. }
  19956. playWoman(node, parent) {
  19957. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  19958. let yy = this.ui.myNode.gameNode3.secretary.height;
  19959. let scale = 1.5;
  19960. if (node == this.secretarySpine2) {
  19961. scale = 1.2;
  19962. }
  19963. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19964. node.play(data, 0, true, parent);
  19965. }
  19966. turnLeft() {
  19967. this.curIndex--;
  19968. if (this.curIndex < 1) {
  19969. this.curIndex = 2;
  19970. }
  19971. let left = this.nodeObj.left;
  19972. let right = this.nodeObj.right;
  19973. let cur = this.nodeObj.cur;
  19974. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19975. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19976. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19977. this.updateData();
  19978. }));
  19979. this.ui.myNode.setChildIndex(right, 2);
  19980. this.nodeObj.left = cur;
  19981. this.nodeObj.right = left;
  19982. this.nodeObj.cur = right;
  19983. }
  19984. turnRight() {
  19985. this.curIndex++;
  19986. if (this.curIndex > 2) {
  19987. this.curIndex = 1;
  19988. }
  19989. let left = this.nodeObj.left;
  19990. let right = this.nodeObj.right;
  19991. let cur = this.nodeObj.cur;
  19992. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19993. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19994. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19995. this.updateData();
  19996. }));
  19997. this.ui.myNode.setChildIndex(left, 2);
  19998. this.nodeObj.left = right;
  19999. this.nodeObj.right = cur;
  20000. this.nodeObj.cur = left;
  20001. }
  20002. updateData() {
  20003. let data = cfgTable.secretaryshopData;
  20004. let children = this.ui.myNode._children;
  20005. let temp;
  20006. let curData;
  20007. for (let index = 0; index < children.length; index++) {
  20008. temp = children[index];
  20009. curData = data[1];
  20010. temp.heightTxt.text = curData.height;
  20011. temp.foodTxt.text = curData.food;
  20012. temp.historyTxt.text = curData.history;
  20013. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  20014. this.addSecretarySpine(temp.secretary, curData.spine);
  20015. let womanIndex = curData.id - 1;
  20016. let getWoman = DataMgr.getSecretary(womanIndex);
  20017. let curUse = DataMgr.getCurSecretary();
  20018. if (getWoman) {
  20019. if (curUse == womanIndex) {
  20020. temp.purchaseBtn.c1.selectedIndex = 1;
  20021. }
  20022. else {
  20023. temp.purchaseBtn.c1.selectedIndex = 2;
  20024. }
  20025. }
  20026. else {
  20027. temp.purchaseBtn.c1.selectedIndex = 0;
  20028. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  20029. }
  20030. temp.purchaseBtn.offClick(this, this.clickSecretary);
  20031. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  20032. }
  20033. }
  20034. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  20035. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20036. if (getWoman) {
  20037. if (curUse != womanIndex) {
  20038. console.log();
  20039. DataMgr.setCurSecretary(womanIndex);
  20040. this.updateData();
  20041. }
  20042. }
  20043. else {
  20044. let need = needDiamond;
  20045. if (DataMgr.diamondEnough(need)) {
  20046. DataMgr.setDiamond(-need);
  20047. DataMgr.setSecretary(womanIndex, 1);
  20048. DataMgr.setCurSecretary(womanIndex);
  20049. this.updateData();
  20050. }
  20051. else {
  20052. xGame.uiMgr.Show(UIAddProp$1, 1);
  20053. }
  20054. }
  20055. }
  20056. closeSelf() {
  20057. this.hide();
  20058. }
  20059. }
  20060. UISecretary$1.uiName = "UISecretary";
  20061. class BallRodDisplay$1 {
  20062. constructor(ui, index) {
  20063. this.index = 0;
  20064. this.uiIndex = 0;
  20065. this.ui = ui;
  20066. this.index = index;
  20067. this.initData();
  20068. }
  20069. initData() {
  20070. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  20071. let data = cfgTable.ballrodData[this.index + 1];
  20072. this.ui.nameTxt.text = data.name;
  20073. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  20074. this.ui.levelNode.c1.selectedIndex = data.quality;
  20075. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  20076. if (data.spine) {
  20077. this.mySpine = new SpineMgr(data.spine, () => {
  20078. let xx = 150;
  20079. let yy = 70;
  20080. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  20081. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  20082. });
  20083. }
  20084. }
  20085. updateSelf() {
  20086. let get = DataMgr.getBallRod(this.index);
  20087. if (get == null)
  20088. get = 1;
  20089. let curUse = DataMgr.getCurBallRod();
  20090. if (get) {
  20091. if (curUse == this.index) {
  20092. this.ui.purchaseBtn.c1.selectedIndex = 0;
  20093. }
  20094. else {
  20095. this.ui.purchaseBtn.c1.selectedIndex = 1;
  20096. }
  20097. }
  20098. else {
  20099. this.ui.purchaseBtn.c1.selectedIndex = 2;
  20100. }
  20101. }
  20102. buyBallRod() {
  20103. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20104. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  20105. switch (selectedIndex) {
  20106. case 0:
  20107. break;
  20108. case 1:
  20109. DataMgr.setCurBallRod(this.index);
  20110. let ui = xGame.uiMgr.getUI(UIShop$1);
  20111. ui.updateBallRod();
  20112. break;
  20113. case 2:
  20114. let data = cfgTable.ballrodData[this.index + 1];
  20115. let need = data.price;
  20116. if (DataMgr.diamondEnough(need)) {
  20117. DataMgr.setDiamond(-need);
  20118. DataMgr.setBallRod(this.index, 1);
  20119. DataMgr.setCurBallRod(this.index);
  20120. let ui = xGame.uiMgr.getUI(UIShop$1);
  20121. ui.updateBallRod();
  20122. }
  20123. else {
  20124. xGame.uiMgr.Show(UIAddProp$1, 1);
  20125. }
  20126. break;
  20127. default:
  20128. break;
  20129. }
  20130. }
  20131. }
  20132. class UIShop$1 extends UIBase {
  20133. constructor() {
  20134. super();
  20135. this.itemNums = 0;
  20136. }
  20137. onConstructor() {
  20138. this.ui = ui_UIShop.createInstance();
  20139. this.contentPane = this.ui;
  20140. this.isEject = false;
  20141. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20142. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20143. this.addUIClick(this.ui, this.interuptSecretary);
  20144. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  20145. this.ballRodArr = [];
  20146. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  20147. this.ui.myNode.myList.numItems = this.itemNums;
  20148. if (Moyu.isKs)
  20149. this.ui.closeNode.closeBtn.x += 100;
  20150. }
  20151. show() {
  20152. super.show();
  20153. this.playSecretaryIdle();
  20154. this.updateBallRod();
  20155. }
  20156. updateBallRod() {
  20157. for (let index = 0; index < this.ballRodArr.length; index++) {
  20158. this.ballRodArr[index].updateSelf();
  20159. }
  20160. }
  20161. renderBallRod(sort, obj) {
  20162. let index = this.getIndexBySort(sort + 1) - 1;
  20163. let ballRod = new BallRodDisplay$1(obj, index);
  20164. this.ballRodArr.push(ballRod);
  20165. }
  20166. getIndexBySort(sort) {
  20167. let object = cfgTable.ballrodData;
  20168. for (const key in object) {
  20169. if (object[key].sort == sort) {
  20170. return parseInt(key);
  20171. }
  20172. }
  20173. }
  20174. playSecretaryIdle() {
  20175. let parent = this.ui.secretary.displayObject;
  20176. parent.destroyChildren();
  20177. let xx = this.ui.secretary.width / 2;
  20178. let yy = this.ui.secretary.height;
  20179. let scale = xGame.common.getSecretaryScale();
  20180. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20181. xGame.common.secretary.play(data, 0, true, parent);
  20182. }
  20183. interuptSecretary() {
  20184. Laya.timer.clearAll(this);
  20185. this.playSecretaryRandomSound();
  20186. }
  20187. playSecretaryRandomSound() {
  20188. if (this.isHide)
  20189. return;
  20190. let time = xGame.common.randomNum(45000, 60000);
  20191. Laya.timer.once(time, this, () => {
  20192. if (this.isHide)
  20193. return;
  20194. let index = xGame.common.randomNum(4, 7);
  20195. xGame.soundMgr.playSound("s_main0" + index);
  20196. let words = 1;
  20197. switch (index) {
  20198. case 4:
  20199. words = 5;
  20200. break;
  20201. case 5:
  20202. words = 3;
  20203. break;
  20204. case 6:
  20205. words = 6;
  20206. break;
  20207. case 7:
  20208. words = 7;
  20209. break;
  20210. default:
  20211. break;
  20212. }
  20213. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20214. this.playSecretaryRandomSound();
  20215. });
  20216. }
  20217. closeSelf() {
  20218. this.hide();
  20219. }
  20220. }
  20221. UIShop$1.uiName = "UIShop";
  20222. class SignMax$1 {
  20223. constructor(ui) {
  20224. this.ui = ui;
  20225. }
  20226. updateSelf(index, sameDay, curDayIndex) {
  20227. let data = cfgTable.signData[index + 1];
  20228. this.ui.titleTxt.text = data.title;
  20229. let arr1 = data.award[0].split('-');
  20230. let arr2 = data.award[1].split('-');
  20231. let num1 = parseInt(arr1[1]);
  20232. let num2 = parseInt(arr2[1]);
  20233. this.ui.numTxt1.text = num1 + "";
  20234. this.ui.numTxt2.text = num2 + "";
  20235. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  20236. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  20237. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  20238. this.ui.numTxt1.visible = false;
  20239. }
  20240. else {
  20241. this.ui.numTxt1.visible = true;
  20242. }
  20243. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  20244. this.ui.numTxt2.visible = false;
  20245. }
  20246. else {
  20247. this.ui.numTxt2.visible = true;
  20248. }
  20249. if (index < curDayIndex) {
  20250. this.ui.c1.selectedIndex = 1;
  20251. }
  20252. else if (index == curDayIndex) {
  20253. if (sameDay) {
  20254. this.ui.c1.selectedIndex = 2;
  20255. }
  20256. else {
  20257. this.ui.c1.selectedIndex = 2;
  20258. }
  20259. }
  20260. else {
  20261. this.ui.c1.selectedIndex = 0;
  20262. }
  20263. }
  20264. }
  20265. class SignNormal$1 {
  20266. constructor(ui) {
  20267. this.ui = ui;
  20268. }
  20269. updateSelf(index, sameDay, curDayIndex) {
  20270. let data = cfgTable.signData[index + 1];
  20271. this.ui.titleTxt.text = data.title;
  20272. let arr = data.award[0].split('-');
  20273. let type = parseInt(arr[0]);
  20274. let num = parseInt(arr[1]);
  20275. this.ui.numTxt.text = num + "";
  20276. if (type > 2) {
  20277. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  20278. this.ui.myIcon.rotation = 0;
  20279. }
  20280. else {
  20281. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  20282. this.ui.myIcon.rotation = 0;
  20283. }
  20284. if (xGame.common.signAwardContainsRod(data.award)) {
  20285. this.ui.numTxt.visible = false;
  20286. }
  20287. else {
  20288. this.ui.numTxt.visible = true;
  20289. }
  20290. if (index < curDayIndex) {
  20291. this.ui.c1.selectedIndex = 1;
  20292. }
  20293. else if (index == curDayIndex) {
  20294. if (sameDay) {
  20295. this.ui.c1.selectedIndex = 2;
  20296. }
  20297. else {
  20298. this.ui.c1.selectedIndex = 2;
  20299. }
  20300. }
  20301. else {
  20302. this.ui.c1.selectedIndex = 0;
  20303. }
  20304. }
  20305. }
  20306. class UISign$1 extends UIBase {
  20307. constructor() {
  20308. super();
  20309. this.curDayIndex = 0;
  20310. this.starX = 0;
  20311. }
  20312. onConstructor() {
  20313. this.ui = ui_UISign.createInstance();
  20314. this.contentPane = this.ui;
  20315. this.isEject = false;
  20316. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20317. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20318. this.initSignItem();
  20319. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  20320. this.addUIClick(this.ui.againBtn, this.againGetAward);
  20321. }
  20322. show() {
  20323. super.show();
  20324. this.ui.t0.play();
  20325. this.playSecretaryIdle();
  20326. this.updateSign();
  20327. }
  20328. initSignItem() {
  20329. this.signArr = [];
  20330. for (let index = 0; index < 6; index++) {
  20331. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  20332. this.signArr.push(temp);
  20333. }
  20334. this.signMax = new SignMax$1(this.ui.myNode.day7);
  20335. if (Moyu.isKs)
  20336. this.ui.closeNode.closeBtn.x += 100;
  20337. }
  20338. updateSign() {
  20339. let sameDay = xGame.common.judgeSameDay();
  20340. let max = 7;
  20341. this.curDayIndex = DataMgr.getSignData();
  20342. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  20343. this.curDayIndex = 0;
  20344. if (!sameDay) {
  20345. this.ui.normalBtn.visible = true;
  20346. this.ui.tipsNode.visible = false;
  20347. this.ui.againBtn.visible = false;
  20348. }
  20349. else {
  20350. this.ui.normalBtn.visible = false;
  20351. let again = DataMgr.getExtraSign();
  20352. let isCurrency = false;
  20353. let index = this.curDayIndex;
  20354. if (index == 0)
  20355. index = 7;
  20356. let award = cfgTable.signData[index].award;
  20357. let num = award[0].split("-")[0];
  20358. if (num == "1" || num == "2")
  20359. isCurrency = true;
  20360. let showAgain = again == 0 && isCurrency;
  20361. this.ui.againBtn.visible = showAgain;
  20362. this.ui.tipsNode.visible = !showAgain;
  20363. }
  20364. for (let index = 0; index < this.signArr.length; index++) {
  20365. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  20366. }
  20367. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  20368. }
  20369. playSecretaryIdle() {
  20370. let parent = this.ui.secretary.displayObject;
  20371. parent.destroyChildren();
  20372. let xx = this.ui.secretary.width / 2;
  20373. let yy = this.ui.secretary.height;
  20374. let scale = xGame.common.getSecretaryScale();
  20375. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20376. xGame.common.secretary.play(data, 0, true, parent);
  20377. }
  20378. closeSelf() {
  20379. this.hide();
  20380. }
  20381. normalGetAward() {
  20382. let sameDay = xGame.common.judgeSameDay();
  20383. if (!sameDay) {
  20384. let award = cfgTable.signData[this.curDayIndex + 1].award;
  20385. let temp;
  20386. let type;
  20387. let num;
  20388. let arr = [];
  20389. for (let index = 0; index < award.length; index++) {
  20390. temp = award[index].split("-");
  20391. type = parseInt(temp[0]);
  20392. num = parseInt(temp[1]);
  20393. let awardType = new AwardType();
  20394. awardType.num = num;
  20395. awardType.type = type;
  20396. arr.push(awardType);
  20397. }
  20398. xGame.common.getAward(arr, (watchVideo) => {
  20399. this.curDayIndex++;
  20400. if (this.curDayIndex > 7)
  20401. this.curDayIndex = 0;
  20402. DataMgr.setSignData(this.curDayIndex);
  20403. DataMgr.setSignTime(new Date().getTime());
  20404. if (watchVideo) {
  20405. DataMgr.setExtraSign(1);
  20406. Moyu.sendDataEvent("signIn1");
  20407. }
  20408. this.updateSign();
  20409. });
  20410. }
  20411. }
  20412. againGetAward() {
  20413. Moyu.sendDataEvent("signIn2");
  20414. console.log('zh:qjff_AD_for_uisign');
  20415. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  20416. }
  20417. else {
  20418. console.log('zh:AD 失败,直接发放奖励');
  20419. this.qjff_AD_for_uisign();
  20420. }
  20421. }
  20422. qjff_AD_for_uisign() {
  20423. let index = this.curDayIndex;
  20424. if (index == 0)
  20425. index = 7;
  20426. let award = cfgTable.signData[index].award;
  20427. let temp;
  20428. let type;
  20429. let num;
  20430. for (let index = 0; index < award.length; index++) {
  20431. temp = award[index].split("-");
  20432. type = parseInt(temp[0]);
  20433. num = parseInt(temp[1]) * 3;
  20434. xGame.common.playObjFlyAnim(num, type);
  20435. }
  20436. DataMgr.setExtraSign(1);
  20437. this.updateSign();
  20438. }
  20439. }
  20440. UISign$1.uiName = "UISign";
  20441. class UIModeSelection$1 extends UIBase {
  20442. constructor() {
  20443. super();
  20444. }
  20445. onConstructor() {
  20446. this.ui = ui_UIModeSelection.createInstance();
  20447. this.contentPane = this.ui;
  20448. this.isEject = false;
  20449. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20450. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20451. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20452. this.addUIClick(this.ui.closeBtn, this.hide);
  20453. this.peopleArr = [650, 6900, 3800];
  20454. this.peopleOffest = [50, 500, 200];
  20455. this.updateSelf();
  20456. }
  20457. show(callback) {
  20458. super.show();
  20459. this.ui.t0.play();
  20460. this.callback = callback;
  20461. }
  20462. updateSelf() {
  20463. let cfg = cfgTable.modeselectData;
  20464. for (let index = 1; index <= 3; index++) {
  20465. let node = this.ui.myNode["type" + index];
  20466. node.need.text = cfg[index].need;
  20467. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20468. node.peopleTxt.text = this.getRandPeople(index - 1);
  20469. }
  20470. }
  20471. enterGame(type) {
  20472. xGame.common.classicRoomType = type;
  20473. let cfg = cfgTable.modeselectData[type];
  20474. let need = cfg.need;
  20475. xGame.common.passAwardCoin = cfg.award;
  20476. if (DataMgr.coinEnough(need)) {
  20477. DataMgr.setCoin(-need);
  20478. this.ui.myNode["type" + type].t0.play();
  20479. Laya.timer.once(200, this, () => {
  20480. this.callback && this.callback();
  20481. });
  20482. }
  20483. else {
  20484. Moyu.sendDataEvent("AddCoinVideo");
  20485. xGame.uiMgr.Show(UIAddProp$1, 0);
  20486. }
  20487. }
  20488. getRandPeople(index) {
  20489. let rand = this.peopleOffest[index];
  20490. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20491. }
  20492. }
  20493. UIModeSelection$1.uiName = "UIModeSelection";
  20494. class UITry$1 extends UIBase {
  20495. constructor() {
  20496. super();
  20497. this.closeTime = 0;
  20498. this.closeNum = 0;
  20499. this.skillUrl = xGame.common.skillIconList;
  20500. }
  20501. onConstructor() {
  20502. this.ui = ui_UITry.createInstance();
  20503. this.contentPane = this.ui;
  20504. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  20505. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  20506. }
  20507. show() {
  20508. super.show();
  20509. this.closeNum = 0;
  20510. this.closeTime = 15;
  20511. this.ui.t0.play();
  20512. PlatMgr.showRateBanner();
  20513. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20514. Laya.timer.loop(1000, this, this.updateTime);
  20515. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  20516. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  20517. xGame.common.gameMgr.gamePause = true;
  20518. }
  20519. updateTime() {
  20520. if (this.closeTime > 1) {
  20521. this.closeTime--;
  20522. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20523. }
  20524. else
  20525. this.hide();
  20526. }
  20527. hide() {
  20528. Laya.timer.clearAll(this);
  20529. Moyu.showBannerAd(false);
  20530. super.hide();
  20531. xGame.common.gameMgr.gamePause = false;
  20532. }
  20533. onTry() {
  20534. console.log('zh:qjff_AD_for_uitry');
  20535. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  20536. }
  20537. else {
  20538. console.log('zh:AD 失败,直接发放奖励');
  20539. this.qjff_AD_for_uitry();
  20540. }
  20541. }
  20542. qjff_AD_for_uitry() {
  20543. let select = xGame.common.curPlayerSkillType;
  20544. DataMgr.gameData.trySkill = select;
  20545. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  20546. DataMgr.saveGameData();
  20547. DataMgr.setBigSkill(select, 1);
  20548. xGame.showTip("Trial Successful");
  20549. this.hide();
  20550. }
  20551. onCancel() {
  20552. if (this.closeNum > 0) {
  20553. this.closeNum--;
  20554. if (this.closeNum < 2)
  20555. this.hide();
  20556. return;
  20557. }
  20558. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  20559. this.onTry();
  20560. }
  20561. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  20562. this.closeNum = 3;
  20563. }
  20564. else
  20565. this.hide();
  20566. }
  20567. }
  20568. UITry$1.uiName = "UITry";
  20569. class UIGetAward$1 extends UIBase {
  20570. constructor() {
  20571. super();
  20572. this.showTriple = true;
  20573. }
  20574. onConstructor() {
  20575. this.ui = ui_UIGetAward.createInstance();
  20576. this.contentPane = this.ui;
  20577. this.isEject = false;
  20578. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  20579. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  20580. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  20581. }
  20582. show(arr, showTriple, callback) {
  20583. super.show();
  20584. this.ui.t0.play();
  20585. this.ui.eftNode.visible = true;
  20586. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  20587. this.ui.eftNode.visible = false;
  20588. }), 1, 0, 0, 0.9);
  20589. this.awardArr = arr;
  20590. this.showTriple = showTriple;
  20591. this.callback = callback;
  20592. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  20593. this.ui.myList.numItems = arr.length;
  20594. xGame.soundMgr.playSound("getaward");
  20595. }
  20596. updateSelf(index, obj) {
  20597. let temp = this.awardArr[index];
  20598. let icon = this.getIcon(temp.type);
  20599. let str = icon;
  20600. if (temp.type > 2) {
  20601. str = "s" + icon;
  20602. }
  20603. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  20604. obj.myIcon.rotation = 0;
  20605. obj.numTxt.text = temp.num + "";
  20606. obj.numTxt.visible = temp.type > 2 ? false : true;
  20607. obj.nameTxt.text = this.getNameStr(temp.type);
  20608. }
  20609. renderItem(index, obj) {
  20610. this.updateSelf(index, obj);
  20611. }
  20612. tripleGetAward() {
  20613. console.log('zh:qjff_AD_for_uigetAward');
  20614. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  20615. }
  20616. else {
  20617. console.log('zh:AD 失败,直接发放奖励');
  20618. this.qjff_AD_for_uigetAward();
  20619. }
  20620. }
  20621. qjff_AD_for_uigetAward() {
  20622. this.getAward(3);
  20623. }
  20624. normalGetAward() {
  20625. if (PlatMgr.isMisVideo())
  20626. this.tripleGetAward();
  20627. else
  20628. this.getAward();
  20629. }
  20630. getAward(times = 1) {
  20631. this.hide();
  20632. for (let index = 0; index < this.awardArr.length; index++) {
  20633. this.awardArr[index].num *= times;
  20634. }
  20635. this.callback && this.callback(times != 1);
  20636. }
  20637. getIcon(type) {
  20638. switch (type) {
  20639. case Prop.diamond:
  20640. return "ty_zs";
  20641. case Prop.coin:
  20642. return "ty_jb";
  20643. case Prop.gan1:
  20644. return "qg1";
  20645. case Prop.gan2:
  20646. return "qg2";
  20647. case Prop.gan3:
  20648. return "qg3";
  20649. case Prop.gan4:
  20650. return "qg4";
  20651. default:
  20652. break;
  20653. }
  20654. }
  20655. getNameStr(type) {
  20656. switch (type) {
  20657. case Prop.diamond:
  20658. return "Diamond";
  20659. case Prop.coin:
  20660. return "Coins";
  20661. case Prop.gan1:
  20662. case Prop.gan2:
  20663. case Prop.gan3:
  20664. case Prop.gan4:
  20665. return cfgTable.ballrodData[type - 1].name;
  20666. default:
  20667. break;
  20668. }
  20669. }
  20670. }
  20671. UIGetAward$1.uiName = "UIGetAward";
  20672. class UIBox$1 extends UIBase {
  20673. constructor() {
  20674. super();
  20675. this.boxNum = 0;
  20676. this.boxMax = 10;
  20677. this.inAd = false;
  20678. this.isClose = false;
  20679. }
  20680. onConstructor() {
  20681. this.ui = ui_UIBox.createInstance();
  20682. this.contentPane = this.ui;
  20683. this.isEject = false;
  20684. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  20685. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  20686. Laya.timer.loop(1000, this, this.update);
  20687. }
  20688. update() {
  20689. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  20690. this.boxNum -= 1;
  20691. this.upBar();
  20692. }
  20693. }
  20694. upBar() {
  20695. if (this.boxNum > this.boxMax)
  20696. this.boxNum = this.boxMax;
  20697. this.ui.bar.value = this.boxNum * 10;
  20698. }
  20699. show() {
  20700. super.show();
  20701. this.isClose = false;
  20702. this.boxNum = 0;
  20703. this.inAd = false;
  20704. this.upBar();
  20705. this.ui.t0.play();
  20706. this.ui.closeBtn.visible = false;
  20707. Laya.timer.once(3000, this, () => {
  20708. this.ui.closeBtn.visible = true;
  20709. this.ui.bar.alpha = 1;
  20710. });
  20711. Laya.timer.once(500, this, () => {
  20712. this.ui.t1.play();
  20713. });
  20714. }
  20715. hide() {
  20716. Laya.timer.clearAll(this);
  20717. Moyu.showBannerAd(false);
  20718. super.hide();
  20719. }
  20720. onOpenBox() {
  20721. this.boxNum++;
  20722. if (this.boxNum < this.boxMax) {
  20723. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  20724. Moyu.showInsertAd(0, PlatMgr.insertGap);
  20725. }
  20726. else if (this.boxNum == this.boxMax) {
  20727. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  20728. this.ui.openBtn.c1.selectedIndex = 13;
  20729. this.inAd = true;
  20730. }
  20731. else
  20732. this.getAward();
  20733. }
  20734. else if (this.inAd) {
  20735. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  20736. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  20737. }
  20738. else {
  20739. console.log('zh:AD 失败,直接发放奖励');
  20740. this.qjff_AD_for_UIBOX_onOpenBox();
  20741. }
  20742. }
  20743. this.upBar();
  20744. }
  20745. qjff_AD_for_UIBOX_onOpenBox() {
  20746. this.getAward();
  20747. }
  20748. onCloseBox() {
  20749. if (this.isClose)
  20750. this.hide();
  20751. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  20752. this.isClose = true;
  20753. PlatMgr.showBanner(true, 0, 3000);
  20754. }
  20755. else
  20756. this.hide();
  20757. }
  20758. getAward() {
  20759. let str = "";
  20760. if (Math.random() < 0.5) {
  20761. let max = Moyu.isLegal ? 500 : 2500;
  20762. let num = xGame.tools.random(max, 500 + max);
  20763. DataMgr.setCoin(num);
  20764. str = "金币x" + num;
  20765. }
  20766. else {
  20767. let max = Moyu.isLegal ? 10 : 30;
  20768. let num = xGame.tools.random(max, 30 + max);
  20769. DataMgr.setDiamond(num);
  20770. str = "钻石x" + num;
  20771. }
  20772. xGame.showTip("恭喜获得-" + str);
  20773. this.hide();
  20774. }
  20775. }
  20776. UIBox$1.uiName = "UIBox";
  20777. class UIMain$1 extends UIBase {
  20778. constructor() {
  20779. super();
  20780. this.firstEnter = true;
  20781. }
  20782. nativeCallJs(msg) {
  20783. let t = msg;
  20784. console.log("zh: nativeCallJs 奖励开始发放:", t);
  20785. switch (t) {
  20786. case 'qjff_chouJiang':
  20787. let dui = xGame.uiMgr.getUI(UIDraw$1);
  20788. dui.qjff_chouJiang();
  20789. break;
  20790. case 'qjff_AD_for_uisign':
  20791. let dui2 = xGame.uiMgr.getUI(UISign$1);
  20792. dui2.qjff_AD_for_uisign();
  20793. break;
  20794. case 'qjff_AD_for_uitry':
  20795. let dui3 = xGame.uiMgr.getUI(UITry$1);
  20796. dui3.qjff_AD_for_uitry();
  20797. break;
  20798. case 'qjff_AD_for_uipower':
  20799. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  20800. dui4.qjff_AD_for_uipower();
  20801. break;
  20802. case 'qjff_AD_for_uigetAward':
  20803. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  20804. dui5.qjff_AD_for_uigetAward();
  20805. break;
  20806. case 'qjff_AD_for_uiGameEnd':
  20807. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  20808. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  20809. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  20810. break;
  20811. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  20812. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  20813. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  20814. break;
  20815. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  20816. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  20817. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  20818. break;
  20819. case 'qjff_AD_for_UIrepentProp_videoRegret':
  20820. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  20821. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  20822. break;
  20823. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  20824. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  20825. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  20826. break;
  20827. case 'qjff_AD_for_UIBOX_onOpenBox':
  20828. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  20829. dui11.qjff_AD_for_UIBOX_onOpenBox();
  20830. break;
  20831. case 'qjff_AD_for_UIAddCoin':
  20832. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  20833. dui12.qjff_AD_for_UIAddCoin();
  20834. break;
  20835. case '111a':
  20836. let dui14 = xGame.uiMgr.getUI(UISign$1);
  20837. dui14.qjff_AD_for_uisign();
  20838. break;
  20839. case '222a':
  20840. let dui15 = xGame.uiMgr.getUI(UISign$1);
  20841. dui15.qjff_AD_for_uisign();
  20842. break;
  20843. case '333a':
  20844. let dui16 = xGame.uiMgr.getUI(UISign$1);
  20845. dui16.qjff_AD_for_uisign();
  20846. break;
  20847. default:
  20848. console.log('zh:未知的方法名字' + t);
  20849. break;
  20850. }
  20851. }
  20852. onConstructor() {
  20853. console.log('zh: UIMain onConstructor');
  20854. this.ui = ui_UIMain.createInstance();
  20855. this.contentPane = this.ui;
  20856. this.isEject = false;
  20857. this.addEvent();
  20858. this.addClickSpine();
  20859. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20860. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20861. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20862. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20863. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20864. let curUse = DataMgr.getCurSecretary();
  20865. this.changeSecretary(curUse);
  20866. this.ui.talkNode.visible = false;
  20867. let guide = DataMgr.getSkillGuide();
  20868. if (xGame.common.isNewDay && guide == 1) {
  20869. xGame.common.isNewDay = false;
  20870. xGame.soundMgr.playSound("s_main01");
  20871. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20872. console.log("播放小秘书每天语音");
  20873. }
  20874. this.onGetUserInfo();
  20875. this.ui.n83.visible = false;
  20876. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20877. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  20878. }
  20879. changeSecretary(curUse) {
  20880. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20881. xGame.common.secretary && xGame.common.secretary.dispose();
  20882. this.addSecretarySpine(name);
  20883. }
  20884. addSecretarySpine(name) {
  20885. let spine = new SpineMgr(name, () => {
  20886. this.playSecretaryIdle();
  20887. });
  20888. xGame.common.secretary = spine;
  20889. }
  20890. addClickSpine() {
  20891. let clickSpine = new SpineMgr("dianji", () => {
  20892. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20893. let parent = Laya.stage;
  20894. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20895. clickSpine.play(data, 0, false, parent, (spine) => {
  20896. spine.destroy(true);
  20897. });
  20898. });
  20899. });
  20900. }
  20901. addEvent() {
  20902. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20903. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20904. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  20905. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20906. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  20907. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20908. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20909. this.addUIClick(this.ui, this.interuptSecretary);
  20910. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20911. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20912. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20913. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20914. this.addUIClick(this.ui.signBtn, this.openSignView);
  20915. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20916. }
  20917. show(showFailWords) {
  20918. super.show();
  20919. this.moneyNode.ui.c1.selectedIndex = 1;
  20920. this.playSecretaryIdle();
  20921. xGame.soundMgr.playMusic("caromhall01");
  20922. Laya.timer.clearAll(this);
  20923. this.playSecretaryRandomSound();
  20924. if (showFailWords) {
  20925. setTimeout(() => {
  20926. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20927. let words = -1;
  20928. if (str == "s_main02") {
  20929. words = 2;
  20930. }
  20931. else {
  20932. words = 3;
  20933. }
  20934. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20935. xGame.soundMgr.playSound(str);
  20936. }, 300);
  20937. }
  20938. this.showGuide();
  20939. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20940. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20941. let guide = DataMgr.getSkillGuide();
  20942. if (guide == 1) {
  20943. let randTime = xGame.common.randomNum(300, 800);
  20944. if (this.firstEnter) {
  20945. this.firstEnter = false;
  20946. randTime += 900;
  20947. }
  20948. Laya.timer.once(randTime, this, () => {
  20949. xGame.common.autoPopUIView();
  20950. });
  20951. }
  20952. }
  20953. checkActive(show) {
  20954. }
  20955. showGuide() {
  20956. let guide = DataMgr.getSkillGuide();
  20957. this.ui.guideBtn.visible = guide == 0;
  20958. this.ui.enterGuide.visible = false;
  20959. this.ui.secretaryGuide.visible = guide == 0;
  20960. if (guide == 0) {
  20961. xGame.soundMgr.playSound("s_guide");
  20962. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20963. }
  20964. }
  20965. ensureSecretary() {
  20966. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  20967. this.ui.secretaryGuide.visible = false;
  20968. this.ui.enterGuide.visible = true;
  20969. this.ui.wordsNode.t0.play();
  20970. if (DataMgr.getNewUser())
  20971. Moyu.sendDataEvent("gameReady");
  20972. }
  20973. playSecretaryIdle() {
  20974. let parent = this.ui.secretary.displayObject;
  20975. parent.destroyChildren();
  20976. let xx = this.ui.secretary.width / 2;
  20977. let yy = this.ui.secretary.height;
  20978. let scale = xGame.common.getSecretaryScale();
  20979. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20980. console.log("zh:playSecretaryIdle", data);
  20981. xGame.common.secretary.play(data, 0, true, parent);
  20982. }
  20983. startGame(type) {
  20984. xGame.common.gameMode = type;
  20985. Moyu.sendDataEvent("PlayGame", { type: type });
  20986. switch (xGame.common.gameMode) {
  20987. case GameMode.classic:
  20988. let challengeTimes = DataMgr.getChallengeTimes();
  20989. if (challengeTimes == 0) {
  20990. xGame.uiMgr.Show(UIInvitation$1);
  20991. }
  20992. else {
  20993. this.beginGame();
  20994. }
  20995. break;
  20996. case GameMode.bigMove:
  20997. this.beginGame();
  20998. if (DataMgr.getNewUser())
  20999. Moyu.sendDataEvent("gameStart0");
  21000. break;
  21001. default:
  21002. break;
  21003. }
  21004. }
  21005. beginGame(isNice = false) {
  21006. if (xGame.common.gameMode == GameMode.classic) {
  21007. if (isNice) {
  21008. this.enterClassic();
  21009. }
  21010. else {
  21011. xGame.uiMgr.Show(UIModeSelection$1, () => {
  21012. this.enterClassic();
  21013. });
  21014. }
  21015. }
  21016. else if (xGame.common.gameMode == GameMode.bigMove) {
  21017. this.ui.enterGuide.visible = false;
  21018. xGame.uiMgr.Show(UISkill$1);
  21019. }
  21020. }
  21021. enterClassic() {
  21022. xGame.uiMgr.Show(UIGame$1);
  21023. xGame.uiMgr.Show(UIMatching$1, () => {
  21024. if (!this.isHide)
  21025. this.hide();
  21026. xGame.common.gameUI.ui.alpha = 1;
  21027. xGame.common.gameUI.startGame();
  21028. xGame.uiMgr.Hide(UIGameEnd$1);
  21029. });
  21030. }
  21031. startGlobal() {
  21032. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21033. }
  21034. startWeekly() {
  21035. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21036. }
  21037. zhouSaiMonth() {
  21038. console.log('zh: zhouSaiMonth 被调用');
  21039. }
  21040. startPlaceBall() {
  21041. xGame.uiMgr.Show(UILevelDisplay$1);
  21042. }
  21043. hide() {
  21044. super.hide();
  21045. xGame.common.stopGirlPop(this.ui.talkNode);
  21046. }
  21047. onGetUserInfo(force = false) {
  21048. if (Moyu.isWx) {
  21049. let info = Moyu.getSystemInfo();
  21050. if (info)
  21051. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  21052. }
  21053. else {
  21054. Moyu.initUser(this, this.freshUser, force);
  21055. }
  21056. if (!Moyu.hasUserInfo) {
  21057. let user = Moyu.getUserInfo();
  21058. user.headIcon = 'res/ty_touxiang.png';
  21059. }
  21060. this.freshUser();
  21061. }
  21062. freshUser() {
  21063. let user = Moyu.getUserInfo();
  21064. if (!user.isAuth) {
  21065. user.headIcon = 'res/ty_touxiang.png';
  21066. }
  21067. else
  21068. DataMgr.upRankData();
  21069. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  21070. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  21071. }
  21072. interuptSecretary() {
  21073. Laya.timer.clearAll(this);
  21074. this.playSecretaryRandomSound();
  21075. }
  21076. playSecretaryRandomSound() {
  21077. if (this.isHide)
  21078. return;
  21079. let time = xGame.common.randomNum(45000, 60000);
  21080. Laya.timer.once(time, this, () => {
  21081. if (this.isHide)
  21082. return;
  21083. let index = xGame.common.randomNum(4, 7);
  21084. xGame.soundMgr.playSound("s_main0" + index);
  21085. let words = 1;
  21086. switch (index) {
  21087. case 4:
  21088. words = 5;
  21089. break;
  21090. case 5:
  21091. words = 3;
  21092. break;
  21093. case 6:
  21094. words = 6;
  21095. break;
  21096. case 7:
  21097. words = 7;
  21098. break;
  21099. default:
  21100. break;
  21101. }
  21102. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21103. this.playSecretaryRandomSound();
  21104. });
  21105. }
  21106. openSecretaryView() {
  21107. xGame.uiMgr.Show(UISecretary$1);
  21108. Moyu.sendDataEvent("secretary");
  21109. }
  21110. openShopView() {
  21111. xGame.uiMgr.Show(UIShop$1);
  21112. }
  21113. openSignView() {
  21114. xGame.uiMgr.Show(UISign$1);
  21115. }
  21116. openDrawView() {
  21117. xGame.uiMgr.Show(UIDraw$1);
  21118. }
  21119. openRanking() {
  21120. xGame.uiMgr.Show(UIRanking$1);
  21121. Moyu.sendDataEvent("rankingList");
  21122. }
  21123. }
  21124. UIMain$1.uiName = "UIMain";
  21125. function InitShader() {
  21126. }
  21127. function appInit() {
  21128. xGame.context.init(getLoadingResList(), initCallback);
  21129. }
  21130. function getLoadingResList() {
  21131. return [
  21132. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  21133. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  21134. ];
  21135. }
  21136. function getGameResList() {
  21137. return [
  21138. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  21139. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  21140. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  21141. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  21142. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  21143. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  21144. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  21145. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  21146. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  21147. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  21148. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  21149. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  21150. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  21151. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  21152. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  21153. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  21154. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  21155. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  21156. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  21157. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  21158. ];
  21159. }
  21160. function initCallback() {
  21161. window["DataMgr"] = DataMgr;
  21162. DataMgr.Init();
  21163. Moyu.init(getPlat(), this, () => {
  21164. DataMgr.isNewDay();
  21165. PlatMgr.initConfig();
  21166. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  21167. }, true);
  21168. console.log('zh:开始sm init1 start');
  21169. xGame.soundMgr.init();
  21170. console.log('zh:开始sm init1 end');
  21171. xGame.uiMgr.init();
  21172. xGame.uiMgr.clearTempData();
  21173. xGame.uiMgr.bindFUI(fguiRes.loading);
  21174. xGame.uiMgr.Show(UILoading);
  21175. }
  21176. function loadSubRes(callback) {
  21177. var tab = ["asset", "res", "spine"];
  21178. let subDone = 0;
  21179. for (var i = 0; i < tab.length; i++) {
  21180. let sub = tab[i];
  21181. Moyu.loadSubRes(sub, (pro) => {
  21182. callback && callback(pro, false);
  21183. }).then(() => {
  21184. subDone++;
  21185. if (subDone >= tab.length)
  21186. callback && callback(1, true);
  21187. });
  21188. }
  21189. }
  21190. function enterGame() {
  21191. xGame.cfgMgr.init();
  21192. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  21193. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  21194. xGame.uiMgr.Hide(UILoading);
  21195. fgui.UIPackage.removePackage(fguiRes.loading);
  21196. xGame.uiMgr.bindFUI(fguiRes.game);
  21197. xGame.uiMgr.Show(UIMain$1);
  21198. if (DataMgr.getNewUser())
  21199. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  21200. }
  21201. function getPlat() {
  21202. let cfg = new MoyuCfg();
  21203. cfg.plat = MoyuPlat.web;
  21204. cfg.myId = 120;
  21205. cfg.myKey = '8848a885774230a4';
  21206. cfg.version = 0;
  21207. if (window.hasOwnProperty("gamebox")) {
  21208. cfg.plat = MoyuPlat.f399;
  21209. cfg.version = 0;
  21210. }
  21211. else if (window.hasOwnProperty("ks")) {
  21212. cfg.plat = MoyuPlat.ks;
  21213. cfg.version = 0;
  21214. cfg.ads.ksVideoId = '2300002254_01';
  21215. cfg.ads.ksInsertId = '2300002254_02';
  21216. }
  21217. else if (Laya.Browser.onTTMiniGame) {
  21218. cfg.plat = MoyuPlat.tt;
  21219. cfg.version = 0;
  21220. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  21221. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  21222. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  21223. }
  21224. else if (Laya.Browser.onMiniGame) {
  21225. cfg.plat = MoyuPlat.wx;
  21226. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  21227. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  21228. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  21229. }
  21230. else if (Laya.Browser.onQQMiniGame) {
  21231. cfg.plat = MoyuPlat.qq;
  21232. }
  21233. else if (Laya.Browser.onQGMiniGame) {
  21234. cfg.plat = MoyuPlat.op;
  21235. cfg.ads.opVideoId = '455502';
  21236. cfg.ads.opBannerId = '455507';
  21237. }
  21238. else if (Laya.Browser.onVVMiniGame) {
  21239. cfg.plat = MoyuPlat.vv;
  21240. cfg.version = 0;
  21241. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  21242. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  21243. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  21244. }
  21245. else if (Laya.Browser.onHWMiniGame) {
  21246. cfg.plat = MoyuPlat.hw;
  21247. }
  21248. else if (window["mz"]) {
  21249. cfg.plat = MoyuPlat.mz;
  21250. }
  21251. else {
  21252. let cfg = window['conchConfig'];
  21253. if (cfg) {
  21254. var os = cfg.getOS();
  21255. if (os == "Conch-ios") {
  21256. cfg.plat = MoyuPlat.ios;
  21257. }
  21258. else if (os == "Conch-android") {
  21259. }
  21260. }
  21261. }
  21262. return cfg;
  21263. }
  21264. class Main {
  21265. constructor() {
  21266. if (window["Laya3D"])
  21267. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  21268. else {
  21269. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  21270. this.initMain();
  21271. }
  21272. }
  21273. initMain() {
  21274. Laya["Physics"] && Laya["Physics"].enable();
  21275. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  21276. Laya.stage.scaleMode = GameConfig.scaleMode;
  21277. Laya.stage.screenMode = GameConfig.screenMode;
  21278. Laya.stage.alignV = GameConfig.alignV;
  21279. Laya.stage.alignH = GameConfig.alignH;
  21280. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  21281. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  21282. Laya.enableDebugPanel();
  21283. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  21284. Laya["PhysicsDebugDraw"].enable();
  21285. if (GameConfig.stat)
  21286. Laya.Stat.show();
  21287. Laya.alertGlobalError(true);
  21288. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  21289. }
  21290. onVersionLoaded() {
  21291. appInit();
  21292. }
  21293. }
  21294. new Main();
  21295. }());
  21296. //# sourceMappingURL=bundle.js.map