bundle.js 828 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  52. let poolKey = {
  53. inHoleEft: "inHoleEft",
  54. d3ball: "d3ball",
  55. iceEft: "iceEft",
  56. hitEft: "hitEft",
  57. fireworksEft: "fireworksEft",
  58. };
  59. var GameMode;
  60. (function (GameMode) {
  61. GameMode[GameMode["classic"] = 0] = "classic";
  62. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  63. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  64. })(GameMode || (GameMode = {}));
  65. var SkillType;
  66. (function (SkillType) {
  67. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  68. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  69. SkillType[SkillType["ice"] = 2] = "ice";
  70. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  71. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  72. })(SkillType || (SkillType = {}));
  73. var ClassicWordsType;
  74. (function (ClassicWordsType) {
  75. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  76. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  77. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  78. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  79. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  80. })(ClassicWordsType || (ClassicWordsType = {}));
  81. var PressType;
  82. (function (PressType) {
  83. PressType[PressType["powerNode"] = 0] = "powerNode";
  84. PressType[PressType["d2Root"] = 1] = "d2Root";
  85. PressType[PressType["moveNode"] = 2] = "moveNode";
  86. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  87. })(PressType || (PressType = {}));
  88. var PlaceBallType;
  89. (function (PlaceBallType) {
  90. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  91. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  92. })(PlaceBallType || (PlaceBallType = {}));
  93. var EAdType;
  94. (function (EAdType) {
  95. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  96. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  97. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  98. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  99. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  100. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  101. EAdType[EAdType["sign"] = 6] = "sign";
  102. EAdType[EAdType["draw"] = 7] = "draw";
  103. EAdType[EAdType["triple"] = 8] = "triple";
  104. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  105. EAdType[EAdType["getPower"] = 10] = "getPower";
  106. EAdType[EAdType["box"] = 11] = "box";
  107. EAdType[EAdType["try"] = 12] = "try";
  108. EAdType[EAdType["againSign"] = 13] = "againSign";
  109. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  110. })(EAdType || (EAdType = {}));
  111. var Prop;
  112. (function (Prop) {
  113. Prop[Prop["diamond"] = 1] = "diamond";
  114. Prop[Prop["coin"] = 2] = "coin";
  115. Prop[Prop["gan1"] = 3] = "gan1";
  116. Prop[Prop["gan2"] = 4] = "gan2";
  117. Prop[Prop["gan3"] = 5] = "gan3";
  118. Prop[Prop["gan4"] = 6] = "gan4";
  119. })(Prop || (Prop = {}));
  120. var TipsType;
  121. (function (TipsType) {
  122. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  123. TipsType[TipsType["foul"] = 1] = "foul";
  124. })(TipsType || (TipsType = {}));
  125. class AwardType {
  126. constructor(type, num) {
  127. this.type = type;
  128. this.num = num;
  129. }
  130. }
  131. var define = /*#__PURE__*/Object.freeze({
  132. fguiRes: fguiRes,
  133. ballCamp: ballCamp,
  134. FoulType: FoulType,
  135. ALL_BALL_STOP: ALL_BALL_STOP,
  136. WAIT_SHOOT: WAIT_SHOOT,
  137. D3RES_LOADED: D3RES_LOADED,
  138. BALL_SHOOT: BALL_SHOOT,
  139. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  140. RESET_GAME: RESET_GAME,
  141. COIN_CHANGE: COIN_CHANGE,
  142. DIAMOND_CHANGE: DIAMOND_CHANGE,
  143. RESTART_GAME: RESTART_GAME,
  144. GET_USER_INFO: GET_USER_INFO,
  145. CHANGE_SECRETARY: CHANGE_SECRETARY,
  146. POWER_CHANGE: POWER_CHANGE,
  147. POWER_TIME: POWER_TIME,
  148. baseHeadUrl: baseHeadUrl,
  149. poolKey: poolKey,
  150. get GameMode () { return GameMode; },
  151. get SkillType () { return SkillType; },
  152. get ClassicWordsType () { return ClassicWordsType; },
  153. get PressType () { return PressType; },
  154. get PlaceBallType () { return PlaceBallType; },
  155. get EAdType () { return EAdType; },
  156. get Prop () { return Prop; },
  157. get TipsType () { return TipsType; },
  158. AwardType: AwardType
  159. });
  160. class CContext {
  161. constructor() {
  162. this.winSize = { width: 0, height: 0 };
  163. this.notchHeight = 0;
  164. this.bannerHeight = 0;
  165. }
  166. init(resList, callback) {
  167. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  168. this.notchHeight = this.getNotchHeight();
  169. this.bannerHeight = this.getBannerHeight();
  170. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  171. callback && callback();
  172. }));
  173. }
  174. getNotchHeight() {
  175. let notchHeight = 50;
  176. if (Laya.Browser.onMiniGame) {
  177. let deviceInfo = wx.getSystemInfoSync();
  178. if (Laya.Browser.onIOS) {
  179. if (deviceInfo.model.search('iPhone X') != -1) {
  180. notchHeight = deviceInfo.statusBarHeight - 10;
  181. }
  182. else {
  183. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  184. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  185. notchHeight = deviceInfo.statusBarHeight - 10;
  186. }
  187. }
  188. }
  189. else if (Laya.Browser.onAndroid) {
  190. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  191. notchHeight = deviceInfo.statusBarHeight;
  192. }
  193. }
  194. }
  195. return notchHeight;
  196. }
  197. getBannerHeight() {
  198. return 0;
  199. }
  200. }
  201. let context = new CContext();
  202. var Handler = Laya.Handler;
  203. var Tween = Laya.Tween;
  204. function playClickEffect(btn) {
  205. if (!btn)
  206. return;
  207. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  208. if (!btn)
  209. return;
  210. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  211. if (!btn)
  212. return;
  213. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  214. }), 0, true);
  215. }), 0, true);
  216. }
  217. function getNumList(strList) {
  218. let dataList = [];
  219. if (strList) {
  220. let list = strList;
  221. let array = list.split(',');
  222. for (var v in array) {
  223. dataList.push(Number(array[v]));
  224. }
  225. }
  226. return dataList;
  227. }
  228. function getStrList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split('|');
  233. for (var v in array) {
  234. dataList.push(String(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getRandStr(len) {
  240. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  241. let str = "";
  242. for (let i = 0; i < len; i++) {
  243. let rand = random(0, list.length);
  244. str += list[rand];
  245. }
  246. return str;
  247. }
  248. function getUserId() {
  249. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  250. return str;
  251. }
  252. function formatPos(pos, len = 2) {
  253. let v = Math.pow(10, len);
  254. pos.x = Math.floor(pos.x * v) / v;
  255. pos.y = Math.floor(pos.y * v) / v;
  256. if (pos.z)
  257. pos.z = Math.floor(pos.z * v) / v;
  258. return pos;
  259. }
  260. function setPosInt(pos) {
  261. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  262. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  263. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  264. return pos;
  265. }
  266. function random(min, max) {
  267. var rang = max - min;
  268. var rand = Math.random() * rang;
  269. return Math.floor(rand) + min;
  270. }
  271. function randomList(list, num) {
  272. if (list.length <= num)
  273. return list;
  274. let arry = [];
  275. list.forEach(item => {
  276. arry.push(item);
  277. });
  278. let nums = [];
  279. for (let i = 0; i < num; i++) {
  280. let rand = random(0, arry.length);
  281. let v = arry[rand];
  282. nums.push(v);
  283. arry.splice(rand, 1);
  284. }
  285. return nums;
  286. }
  287. function worldToScreen(camera, point, pos) {
  288. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  289. pos.x = pos.x / Laya.stage.clientScaleX;
  290. pos.y = pos.y / Laya.stage.clientScaleY;
  291. }
  292. function getStringLenght(str) {
  293. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  294. }
  295. function reviseString(str, len) {
  296. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  297. if (ld > len) {
  298. let sl = Math.floor(len / 2);
  299. let rs = str.substring(0, sl);
  300. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  301. while (d + 2 < len) {
  302. sl++;
  303. rs = str.substring(0, sl);
  304. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. return rs + "...";
  307. }
  308. return str;
  309. }
  310. function getCoinString(coin) {
  311. if (coin < 10000)
  312. return coin.toString();
  313. else if (coin < 1000000) {
  314. let vh = Math.ceil(coin / 100);
  315. return (vh / 10) + "k";
  316. }
  317. else if (coin < 1000000000) {
  318. var vh = Math.ceil(coin / 100000);
  319. return (vh / 10) + "m";
  320. }
  321. else if (coin < 1000000000000) {
  322. var vh = Math.ceil(coin / 100000000);
  323. return (vh / 10) + "b";
  324. }
  325. else if (coin < 1000000000000000) {
  326. var vh = Math.ceil(coin / 100000000000);
  327. return (vh / 10) + "t";
  328. }
  329. }
  330. function getV3Dest(pos, dir, dis, dest) {
  331. dir.x *= dis;
  332. dir.y *= dis;
  333. dir.z *= dis;
  334. Laya.Vector3.add(pos, dir, dest);
  335. return dest;
  336. }
  337. function getV2Dest(x1, y1, dir, dis, dest) {
  338. dest.x = x1 + dir.x * dis;
  339. dest.y = y1 + dir.y * dis;
  340. return dest;
  341. }
  342. function getV2Dir(x1, y1, x2, y2, dir) {
  343. dir.x = x2 - x1;
  344. dir.y = y2 - y1;
  345. Laya.Vector2.normalize(dir, dir);
  346. return dir;
  347. }
  348. function getV3Dir(p1, p2, dir) {
  349. Laya.Vector3.subtract(p1, p2, dir);
  350. Laya.Vector3.normalize(dir, dir);
  351. return dir;
  352. }
  353. function copyPos(ip, op) {
  354. op.x = ip.x;
  355. op.y = ip.y;
  356. if (ip.z)
  357. op.z = ip.z;
  358. return op;
  359. }
  360. function getScreenImg() {
  361. let gl = Laya.WebGLContext.mainContext;
  362. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  363. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  364. let w = gl.drawingBufferWidth;
  365. let h = gl.drawingBufferHeight;
  366. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  367. texture2d.setPixels(pixels);
  368. return new Laya.Texture(texture2d);
  369. }
  370. function playMoveByPositions(sp, positions, v, completeCallback) {
  371. let p;
  372. let play = () => {
  373. if (positions.length == 0) {
  374. completeCallback();
  375. return;
  376. }
  377. p = positions[0];
  378. positions.splice(0, 1);
  379. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  380. play();
  381. }));
  382. };
  383. play();
  384. }
  385. function setStarPos(node, num, max) {
  386. for (let i = 1; i <= 5; i++) {
  387. let img = node.getChildAt(i - 1);
  388. img.width = img.height = 30;
  389. img.pivotX = img.pivotY = 0.5;
  390. img.gray = i > num;
  391. img.visible = i <= max;
  392. if (max == 3) {
  393. img.x = node.width / 2 + (i - 2) * 30 - 15;
  394. img.y = node.height - 40;
  395. if (i == 2)
  396. img.y = node.height - 30;
  397. }
  398. else if (max == 5) {
  399. let ly = Math.abs(i - 3);
  400. img.x = node.width / 2 + (i - 3) * 20 - 15;
  401. img.y = node.height - ly * 8 - 30;
  402. }
  403. }
  404. }
  405. function playLoopAnimRotate(sp, time, clockwise = true) {
  406. let rotation;
  407. sp.rotation = sp.rotation % 360;
  408. if (clockwise) {
  409. rotation = -360;
  410. }
  411. else {
  412. rotation = 360;
  413. }
  414. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  415. this.playLoopAnimRotate(sp, time, clockwise);
  416. }));
  417. }
  418. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  419. let x, y;
  420. if (isBig) {
  421. x = valueXMin;
  422. y = valueYMin;
  423. }
  424. else {
  425. x = valueXMax;
  426. y = valueYMax;
  427. }
  428. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  429. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  430. }));
  431. }
  432. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  433. let scale;
  434. if (isBig) {
  435. scale = valueMin;
  436. }
  437. else {
  438. scale = valueMax;
  439. }
  440. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  441. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  442. }));
  443. }
  444. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  445. let value;
  446. if (isBig) {
  447. value = valueMin;
  448. }
  449. else {
  450. value = valueMax;
  451. }
  452. if (count) {
  453. count--;
  454. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  455. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  456. }));
  457. }
  458. else {
  459. sp.rotation = 0;
  460. }
  461. }
  462. function inRect(rect, p) {
  463. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  464. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  465. return true;
  466. }
  467. }
  468. return false;
  469. }
  470. function getNumberK(number) {
  471. if (number < 1000) {
  472. return number.toString();
  473. }
  474. else {
  475. return (number / 1000).toFixed(1) + "k";
  476. }
  477. }
  478. function pointInsideCircle(point, circle, r) {
  479. if (r === 0)
  480. return false;
  481. var dx = circle.x - point.x;
  482. var dy = circle.y - point.y;
  483. return dx * dx + dy * dy <= r * r;
  484. }
  485. function formatString(str, data) {
  486. if (!str || data == undefined) {
  487. return str;
  488. }
  489. if (typeof data === "object") {
  490. for (var key in data) {
  491. if (data.hasOwnProperty(key)) {
  492. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  493. }
  494. }
  495. }
  496. else {
  497. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  498. return str.replace(reg, function (match, index) {
  499. return args[index - (-1)];
  500. });
  501. }
  502. return str;
  503. }
  504. function getIntersection(a, b) {
  505. let t = [];
  506. for (var i = 0; i < a.length; i++) {
  507. for (var j = 0; j < b.length; j++) {
  508. if (a[i] == b[j]) {
  509. t.push(a[i]);
  510. }
  511. }
  512. }
  513. return t;
  514. }
  515. function getComplement(a, b) {
  516. let t = [];
  517. let count = false;
  518. for (var i = 0; i < a.length; i++) {
  519. count = false;
  520. for (var j = 0; j < b.length; j++) {
  521. if (a[i] == b[j]) {
  522. count = true;
  523. break;
  524. }
  525. }
  526. if (!count) {
  527. t.push(a[i]);
  528. }
  529. }
  530. return t;
  531. }
  532. function geSpriteStageRect(sp) {
  533. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  534. let rect = {
  535. x: point.x,
  536. y: point.y,
  537. width: sp.width * sp.globalScaleX,
  538. height: sp.height * sp.globalScaleY
  539. };
  540. return rect;
  541. }
  542. function touchButton(button) {
  543. let event = new Laya.Event();
  544. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  545. }
  546. function setColor(sprite, r, g, b) {
  547. var redMat = [
  548. r / 255, 0, 0, 0, 0,
  549. g / 255, 0, 0, 0, 0,
  550. b / 255, 0, 0, 0, 0,
  551. 0, 0, 0, 1, 0,
  552. ];
  553. var filter = new Laya.ColorFilter(redMat);
  554. sprite.filters = [filter];
  555. }
  556. function clone(obj, newobj = {}) {
  557. for (var attr in obj) {
  558. if (typeof obj[attr] == "object") {
  559. newobj[attr] = clone(obj[attr], newobj[attr]);
  560. }
  561. else {
  562. newobj[attr] = obj[attr];
  563. }
  564. }
  565. return newobj;
  566. }
  567. function _ms(arr, compare, begin, end) {
  568. const size = end - begin;
  569. if (size <= 1) {
  570. return;
  571. }
  572. const middle = (end + begin) >> 1;
  573. _ms(arr, compare, begin, middle);
  574. _ms(arr, compare, middle, end);
  575. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  576. return;
  577. }
  578. const merged = [];
  579. let leftIndex = begin, rightIndex = middle;
  580. while (merged.length < size) {
  581. if (leftIndex === middle) {
  582. merged.push(arr[rightIndex++]);
  583. }
  584. else if (rightIndex === end) {
  585. merged.push(arr[leftIndex++]);
  586. }
  587. else {
  588. const c = compare(arr[leftIndex], arr[rightIndex]);
  589. if (c <= 0) {
  590. merged.push(arr[leftIndex++]);
  591. }
  592. else {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. }
  596. }
  597. arr.splice(begin, size, ...merged);
  598. }
  599. function sort(arr, compare) {
  600. if (!Array.isArray(arr)) {
  601. throw new Error('sort的参数必须为数组');
  602. }
  603. _ms(arr, compare, 0, arr.length);
  604. return arr;
  605. }
  606. function getLanguage(id) {
  607. }
  608. function getLanguageByTip(id) {
  609. }
  610. function toWeights(array) {
  611. let max = 0;
  612. for (var i = 0; i < array.length; i++) {
  613. max = max + array[i];
  614. if (array[i] == 0) {
  615. array[i] = 0;
  616. }
  617. else {
  618. array[i] = max;
  619. }
  620. }
  621. return array;
  622. }
  623. function unique(array) {
  624. var n = {}, r = [], len = array.length, val, type;
  625. for (var i = 0; i < array.length; i++) {
  626. val = array[i];
  627. type = typeof val;
  628. if (!n[val]) {
  629. n[val] = [type];
  630. r.push(val);
  631. }
  632. else if (n[val].indexOf(type) < 0) {
  633. n[val].push(type);
  634. r.push(val);
  635. }
  636. }
  637. return r;
  638. }
  639. function unique1(array) {
  640. var r = [];
  641. for (var i = 0, l = array.length; i < l; i++) {
  642. for (var j = i + 1; j < l; j++)
  643. if (array[i] == array[j])
  644. j == ++i;
  645. r.push(array[i]);
  646. }
  647. return r;
  648. }
  649. function getDistance(x1, y1, x2, y2) {
  650. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  651. }
  652. function getV2Dis(pos1, pos2) {
  653. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  654. }
  655. function getV2SqDis(pos1, pos2) {
  656. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  657. }
  658. function getDis(x1, y1, x2, y2) {
  659. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  660. }
  661. function getDeltaxy(x1, y1, x2, y2) {
  662. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  663. }
  664. function getSymbolNumber(num) {
  665. if (num > 0) {
  666. return "+" + num;
  667. }
  668. else if (num < 0) {
  669. return num.toString();
  670. }
  671. return num.toString();
  672. }
  673. function fixNumber(num, length) {
  674. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  675. }
  676. function toThousands(num) {
  677. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  678. }
  679. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  680. function fmtMoney(money) {
  681. money = toThousands(money.replace(/^0+/, ''));
  682. if (money.length == 0) {
  683. money = "0";
  684. }
  685. let unit = 0;
  686. for (var i = 0; i < money.length; i++) {
  687. if (money.charAt(i) == ",") {
  688. unit++;
  689. }
  690. }
  691. if (unit == 0) {
  692. return money;
  693. }
  694. else {
  695. let idx = money.indexOf(",");
  696. if (idx) {
  697. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  698. }
  699. return money.replace(",", ".");
  700. }
  701. }
  702. function flatten(arr) {
  703. while (arr.some(item => Array.isArray(item))) {
  704. arr = [].concat(...arr);
  705. }
  706. return arr;
  707. }
  708. function getDistanceByPoint(p1, p2) {
  709. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  710. }
  711. function getAngleByPoint(p1, p2) {
  712. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  713. }
  714. function toIntByArray(array) {
  715. for (var index = 0; index < array.length; index++) {
  716. array[index] = parseInt(array[index]);
  717. }
  718. return array;
  719. }
  720. function getAngle0To360(angle) {
  721. while (angle < 0) {
  722. angle += 360;
  723. }
  724. while (angle >= 360) {
  725. angle -= 360;
  726. }
  727. return angle;
  728. }
  729. function toAngle(radian) {
  730. return radian * 180 / Math.PI;
  731. }
  732. function toRadian(angle) {
  733. return angle * Math.PI / 180;
  734. }
  735. function getArrayValueRandom(array) {
  736. return array[random(0, array.length - 1)];
  737. }
  738. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  739. }
  740. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function fmtTimeMMSS(time) {
  743. if (time < 0) {
  744. time = 0;
  745. }
  746. else
  747. time = Math.floor(time);
  748. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  749. }
  750. function fmtTimeMS(time) {
  751. if (time < 0) {
  752. time = 0;
  753. }
  754. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  755. }
  756. function fmtTimeHHMM(time) {
  757. if (time < 0) {
  758. time = 0;
  759. }
  760. time = Math.floor(time / 1000);
  761. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  762. }
  763. let severTime = 0;
  764. function getServerTime() {
  765. return new Date(new Date().getTime() - severTime);
  766. }
  767. function setServerTime(data) {
  768. severTime = (new Date().getTime() - data);
  769. }
  770. var tools = /*#__PURE__*/Object.freeze({
  771. playClickEffect: playClickEffect,
  772. getNumList: getNumList,
  773. getStrList: getStrList,
  774. getRandStr: getRandStr,
  775. getUserId: getUserId,
  776. formatPos: formatPos,
  777. setPosInt: setPosInt,
  778. random: random,
  779. randomList: randomList,
  780. worldToScreen: worldToScreen,
  781. getStringLenght: getStringLenght,
  782. reviseString: reviseString,
  783. getCoinString: getCoinString,
  784. getV3Dest: getV3Dest,
  785. getV2Dest: getV2Dest,
  786. getV2Dir: getV2Dir,
  787. getV3Dir: getV3Dir,
  788. copyPos: copyPos,
  789. getScreenImg: getScreenImg,
  790. playMoveByPositions: playMoveByPositions,
  791. setStarPos: setStarPos,
  792. playLoopAnimRotate: playLoopAnimRotate,
  793. playLoopAnimPosition: playLoopAnimPosition,
  794. playLoopAnimScale: playLoopAnimScale,
  795. playLoopAnimRotation: playLoopAnimRotation,
  796. inRect: inRect,
  797. getNumberK: getNumberK,
  798. pointInsideCircle: pointInsideCircle,
  799. formatString: formatString,
  800. getIntersection: getIntersection,
  801. getComplement: getComplement,
  802. geSpriteStageRect: geSpriteStageRect,
  803. touchButton: touchButton,
  804. setColor: setColor,
  805. clone: clone,
  806. sort: sort,
  807. getLanguage: getLanguage,
  808. getLanguageByTip: getLanguageByTip,
  809. toWeights: toWeights,
  810. unique: unique,
  811. unique1: unique1,
  812. getDistance: getDistance,
  813. getV2Dis: getV2Dis,
  814. getV2SqDis: getV2SqDis,
  815. getDis: getDis,
  816. getDeltaxy: getDeltaxy,
  817. getSymbolNumber: getSymbolNumber,
  818. fixNumber: fixNumber,
  819. toThousands: toThousands,
  820. fmtMoney: fmtMoney,
  821. flatten: flatten,
  822. getDistanceByPoint: getDistanceByPoint,
  823. getAngleByPoint: getAngleByPoint,
  824. toIntByArray: toIntByArray,
  825. getAngle0To360: getAngle0To360,
  826. toAngle: toAngle,
  827. toRadian: toRadian,
  828. getArrayValueRandom: getArrayValueRandom,
  829. promptByTip: promptByTip,
  830. promptByErrorCode: promptByErrorCode,
  831. fmtTimeMMSS: fmtTimeMMSS,
  832. fmtTimeMS: fmtTimeMS,
  833. fmtTimeHHMM: fmtTimeHHMM,
  834. getServerTime: getServerTime,
  835. setServerTime: setServerTime
  836. });
  837. class HttpMgr {
  838. constructor() {
  839. HttpMgr._instance = this;
  840. }
  841. static getInstance() {
  842. if (!this._instance) {
  843. this._instance = new HttpMgr();
  844. }
  845. return this._instance;
  846. }
  847. sendPost(url, data, call) {
  848. let httpObj = new Laya.HttpRequest();
  849. httpObj.http.timeout = 5000;
  850. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  851. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  852. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  853. function errorHandler(error) {
  854. console.log("errorHandler:" + error);
  855. }
  856. function completeHandler(data) {
  857. if (data && data.length > 0) {
  858. let jsonData = JSON.parse(data);
  859. if (call)
  860. call(jsonData);
  861. }
  862. }
  863. }
  864. sendGet(url, call) {
  865. let httpObj = new Laya.HttpRequest();
  866. httpObj.http.timeout = 5000;
  867. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  868. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  869. httpObj.send(url, '', 'get');
  870. function errorHandler(error) {
  871. console.log("errorHandler:" + error);
  872. }
  873. function completeHandler(data) {
  874. if (data && data.length > 0) {
  875. if (call)
  876. call(data);
  877. }
  878. }
  879. }
  880. }
  881. HttpMgr._instance = null;
  882. class LightShader extends Laya.Sprite {
  883. constructor() {
  884. super();
  885. this._time = 0;
  886. this._sin = 0;
  887. this.initShader();
  888. }
  889. initShader() {
  890. var vs = `
  891. #define FSHIGHPRECISION
  892. attribute vec4 posuv;
  893. uniform vec2 size;
  894. varying vec4 v_texcoord;
  895. void main() {
  896. vec4 pos = vec4(posuv.xy,0.,1.);
  897. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  898. gl_Position=pos1;
  899. v_texcoord.xy = posuv.xy;
  900. }
  901. `;
  902. var ps = `
  903. #define FSHIGHPRECISION
  904. precision highp float;
  905. varying vec4 v_texcoord;
  906. uniform vec2 size;
  907. uniform sampler2D texture;
  908. uniform float u_Time;
  909. void main() {
  910. vec4 color= texture2D(texture, v_texcoord.xy);
  911. float width = 0.2;
  912. float start = u_Time;
  913. float offset = 1.0;
  914. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  915. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  916. {
  917. color.r=1.1;
  918. color.g=1.1;
  919. color.b=1.1;
  920. gl_FragColor = color;
  921. } else {
  922. gl_FragColor = color;
  923. }
  924. }
  925. `;
  926. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  927. this.customRenderEnable = true;
  928. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  929. }
  930. customRender(context, x, y) {
  931. this.onUpdate();
  932. if (!this.texture)
  933. return;
  934. let xx = x - this.pivotX;
  935. let yy = y - this.pivotY;
  936. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  937. }
  938. onUpdate() {
  939. this._time += 2 * Laya.timer.delta * 0.001;
  940. this._sin = Math.sin(this._time);
  941. if (this._sin > 0.99) {
  942. this._sin = 0;
  943. this._time = 0;
  944. }
  945. this.shaderValue['u_Time'] = this._sin;
  946. }
  947. }
  948. LightShader.DissolveSurfaceSaveName = 9997;
  949. class UIBase extends fairygui.Window {
  950. constructor() {
  951. super();
  952. this.isEject = true;
  953. this.isHide = true;
  954. this.showbanner = true;
  955. this.className = "";
  956. this.isMuti = false;
  957. this.showbanner = false;
  958. this.onConstructor();
  959. }
  960. checkActive(show) {
  961. }
  962. getUIName() {
  963. return UIBase.uiName;
  964. }
  965. onConstructor() {
  966. }
  967. onInit() {
  968. if (!!this.contentPane) {
  969. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  970. }
  971. this.setPivot(0.5, 0.5, false);
  972. }
  973. doShowAnimation() {
  974. if (!this.isEject)
  975. return;
  976. super.doShowAnimation();
  977. Laya.Tween.clearTween(this);
  978. this.scaleX = this.scaleY = 0.8;
  979. let tweenFunc1 = (func) => {
  980. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  981. };
  982. let tweenFunc2 = (func) => {
  983. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  984. };
  985. tweenFunc1(tweenFunc2);
  986. }
  987. show(...args) {
  988. super.show();
  989. this._openParam = args;
  990. this.isHide = false;
  991. xGame.uiMgr.checkUIState();
  992. }
  993. moveBannerButton() {
  994. }
  995. showBannerButton() {
  996. this.bannerButton.visible = true;
  997. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  998. this.bannerButton.touchable = true;
  999. }));
  1000. }
  1001. hide() {
  1002. super.hide();
  1003. this.isHide = true;
  1004. xGame.uiMgr.checkUIState();
  1005. }
  1006. Dispose() {
  1007. super.dispose();
  1008. }
  1009. myUpdate(delay) {
  1010. }
  1011. refresh() { }
  1012. addUIClick(obj, func, arr = null) {
  1013. obj.onClick(this, func, arr);
  1014. obj.onClick(this, this.playBtnSound);
  1015. }
  1016. offUIClick(obj, func) {
  1017. obj.offClick(this, func);
  1018. }
  1019. playBtnSound() {
  1020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1021. }
  1022. }
  1023. UIBase.lastShowBanner = 0;
  1024. UIBase.showBannerNum = 0;
  1025. UIBase.uiName = "";
  1026. class ui_UIDraw extends fgui.GComponent {
  1027. static createInstance() {
  1028. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1029. }
  1030. onConstruct() {
  1031. this.n1 = (this.getChild("n1"));
  1032. this.extraNode = (this.getChild("extraNode"));
  1033. this.myNode = (this.getChild("myNode"));
  1034. this.closeNode = (this.getChild("closeNode"));
  1035. this.moneyNode = (this.getChild("moneyNode"));
  1036. this.n38 = (this.getChild("n38"));
  1037. this.secretary = (this.getChild("secretary"));
  1038. this.drawBtn = (this.getChild("drawBtn"));
  1039. this.talkNode = (this.getChild("talkNode"));
  1040. this.t0 = this.getTransition("t0");
  1041. }
  1042. }
  1043. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1044. class ui_UIBox extends fgui.GComponent {
  1045. static createInstance() {
  1046. return (fgui.UIPackage.createObject("game", "UIBox"));
  1047. }
  1048. onConstruct() {
  1049. this.n0 = (this.getChild("n0"));
  1050. this.n12 = (this.getChild("n12"));
  1051. this.n1 = (this.getChild("n1"));
  1052. this.n2 = (this.getChild("n2"));
  1053. this.bar = (this.getChild("bar"));
  1054. this.closeBtn = (this.getChild("closeBtn"));
  1055. this.openBtn = (this.getChild("openBtn"));
  1056. this.t0 = this.getTransition("t0");
  1057. this.t1 = this.getTransition("t1");
  1058. }
  1059. }
  1060. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1061. class GlobalManager {
  1062. constructor() {
  1063. }
  1064. registerMethod(name, method) {
  1065. console.log('zh: 注册全局方法', name);
  1066. this[name] = method;
  1067. }
  1068. callMethod(name, ...args) {
  1069. console.log('zh: 调用全局方法', name);
  1070. if (this[name]) {
  1071. return this[name](...args);
  1072. }
  1073. else {
  1074. console.error(`zh: 全局方法 Method ${name} not found`);
  1075. }
  1076. }
  1077. }
  1078. GlobalManager.instance = new GlobalManager();
  1079. class JSBridgeUtils {
  1080. constructor() { }
  1081. static get instance() {
  1082. if (!this._instance) {
  1083. this._instance = new JSBridgeUtils();
  1084. }
  1085. return this._instance;
  1086. }
  1087. initBridge() {
  1088. if (!Laya.Browser.onAndroid) {
  1089. console.log('zh:非android dev');
  1090. return;
  1091. }
  1092. let cfg = window['conchConfig'];
  1093. if (cfg) {
  1094. var os = cfg.getOS();
  1095. if (os == "Conch-android") {
  1096. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1097. if (this.bridge) {
  1098. return true;
  1099. }
  1100. else {
  1101. return false;
  1102. }
  1103. }
  1104. else {
  1105. return false;
  1106. }
  1107. }
  1108. else {
  1109. return false;
  1110. }
  1111. }
  1112. testAd1() {
  1113. if (!Laya.Browser.onAndroid) {
  1114. console.log('zh:非android dev');
  1115. return;
  1116. }
  1117. if (!this.initBridge()) {
  1118. return;
  1119. }
  1120. let rs = this.bridge.call("testString", "hello");
  1121. console.log('zh:testString rs=' + rs);
  1122. }
  1123. testAdCallBack() {
  1124. if (!this.initBridge()) {
  1125. return;
  1126. }
  1127. console.log("zh:testAdCallBack start");
  1128. const defaultObj = { code: 200, msg: "req update Ui" };
  1129. const reqObj = { code: 300, msg: "hello java ui" };
  1130. this.bridge.callWithBack((rsStr) => {
  1131. const rsObj = JSON.parse(rsStr);
  1132. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1133. }, "testAsyncCallback", JSON.stringify(reqObj));
  1134. }
  1135. showInternAd(mark) {
  1136. if (!Laya.Browser.onAndroid) {
  1137. console.log('zh:非android dev');
  1138. return false;
  1139. }
  1140. if (!this.initBridge()) {
  1141. return false;
  1142. }
  1143. let rs = this.bridge.call("showInternAd", mark);
  1144. console.log('zh:showInternAd rs= ' + rs + ' ,mark=' + mark);
  1145. try {
  1146. const result = JSON.parse(rs);
  1147. if (result.code === 200) {
  1148. console.log("zh:广告显示成功");
  1149. return true;
  1150. }
  1151. else {
  1152. console.warn("zh:广告显示失败:", result.msg);
  1153. return false;
  1154. }
  1155. }
  1156. catch (e) {
  1157. console.error("zh:解析桥接返回值失败:", e);
  1158. return false;
  1159. }
  1160. }
  1161. showRewardAd(mark) {
  1162. if (!Laya.Browser.onAndroid) {
  1163. console.log('zh:非android dev');
  1164. return false;
  1165. }
  1166. if (!this.initBridge()) {
  1167. return false;
  1168. }
  1169. let rs = this.bridge.call("showRewardAd", mark);
  1170. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1171. try {
  1172. const result = JSON.parse(rs);
  1173. if (result.code === 200) {
  1174. console.log("zh:广告显示成功");
  1175. return true;
  1176. }
  1177. else {
  1178. console.warn("zh:广告显示失败:", result.msg);
  1179. return false;
  1180. }
  1181. }
  1182. catch (e) {
  1183. console.error("zh:解析桥接返回值失败:", e);
  1184. return false;
  1185. }
  1186. }
  1187. nativeCallJs(msg) {
  1188. console.log("zh:nativeCallJs received data: 1111", msg);
  1189. if (msg === 'Ad1') {
  1190. GlobalManager.instance.callMethod('Ad1');
  1191. console.log("zh: Ad1 奖励发送成功");
  1192. }
  1193. else if (msg === 'Ad2') {
  1194. GlobalManager.instance.callMethod('Ad2');
  1195. console.log("zh: Ad2 奖励发送成功");
  1196. }
  1197. else if (msg === 'Ad3') {
  1198. GlobalManager.instance.callMethod('Ad3');
  1199. console.log("zh: Ad3 奖励发送成功");
  1200. }
  1201. else if (msg === 'Ad4') {
  1202. GlobalManager.instance.callMethod('Ad4');
  1203. console.log("zh: Ad4 奖励发送成功");
  1204. }
  1205. else if (msg === 'Ad5') {
  1206. console.log("zh: Ad5 奖励发送成功");
  1207. GlobalManager.instance.callMethod('Ad5');
  1208. }
  1209. }
  1210. }
  1211. class UIBox extends UIBase {
  1212. constructor() {
  1213. super();
  1214. this.boxNum = 0;
  1215. this.boxMax = 10;
  1216. this.inAd = false;
  1217. this.isClose = false;
  1218. }
  1219. onConstructor() {
  1220. this.ui = ui_UIBox.createInstance();
  1221. this.contentPane = this.ui;
  1222. this.isEject = false;
  1223. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1224. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1225. Laya.timer.loop(1000, this, this.update);
  1226. }
  1227. update() {
  1228. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1229. this.boxNum -= 1;
  1230. this.upBar();
  1231. }
  1232. }
  1233. upBar() {
  1234. if (this.boxNum > this.boxMax)
  1235. this.boxNum = this.boxMax;
  1236. this.ui.bar.value = this.boxNum * 10;
  1237. }
  1238. show() {
  1239. super.show();
  1240. this.isClose = false;
  1241. this.boxNum = 0;
  1242. this.inAd = false;
  1243. this.upBar();
  1244. this.ui.t0.play();
  1245. this.ui.closeBtn.visible = false;
  1246. Laya.timer.once(3000, this, () => {
  1247. this.ui.closeBtn.visible = true;
  1248. this.ui.bar.alpha = 1;
  1249. });
  1250. Laya.timer.once(500, this, () => {
  1251. this.ui.t1.play();
  1252. });
  1253. }
  1254. hide() {
  1255. Laya.timer.clearAll(this);
  1256. Moyu.showBannerAd(false);
  1257. super.hide();
  1258. }
  1259. onOpenBox() {
  1260. this.boxNum++;
  1261. if (this.boxNum < this.boxMax) {
  1262. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  1263. Moyu.showInsertAd(0, PlatMgr.insertGap);
  1264. }
  1265. else if (this.boxNum == this.boxMax) {
  1266. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1267. this.ui.openBtn.c1.selectedIndex = 13;
  1268. this.inAd = true;
  1269. }
  1270. else
  1271. this.getAward();
  1272. }
  1273. else if (this.inAd) {
  1274. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1275. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1276. }
  1277. else {
  1278. console.log('zh:AD 失败,直接发放奖励');
  1279. this.qjff_AD_for_UIBOX_onOpenBox();
  1280. }
  1281. }
  1282. this.upBar();
  1283. }
  1284. qjff_AD_for_UIBOX_onOpenBox() {
  1285. this.getAward();
  1286. }
  1287. onCloseBox() {
  1288. if (this.isClose)
  1289. this.hide();
  1290. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1291. this.isClose = true;
  1292. PlatMgr.showBanner(true, 0, 3000);
  1293. }
  1294. else
  1295. this.hide();
  1296. }
  1297. getAward() {
  1298. let str = "";
  1299. if (Math.random() < 0.5) {
  1300. let max = Moyu.isLegal ? 500 : 2500;
  1301. let num = xGame.tools.random(max, 500 + max);
  1302. DataMgr.setCoin(num);
  1303. str = "金币x" + num;
  1304. }
  1305. else {
  1306. let max = Moyu.isLegal ? 10 : 30;
  1307. let num = xGame.tools.random(max, 30 + max);
  1308. DataMgr.setDiamond(num);
  1309. str = "钻石x" + num;
  1310. }
  1311. xGame.showTip("恭喜获得-" + str);
  1312. this.hide();
  1313. }
  1314. }
  1315. UIBox.uiName = "UIBox";
  1316. class ui_UITry extends fgui.GComponent {
  1317. static createInstance() {
  1318. return (fgui.UIPackage.createObject("game", "UITry"));
  1319. }
  1320. onConstruct() {
  1321. this.n11 = (this.getChild("n11"));
  1322. this.myNode = (this.getChild("myNode"));
  1323. this.t0 = this.getTransition("t0");
  1324. }
  1325. }
  1326. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1327. class UITry extends UIBase {
  1328. constructor() {
  1329. super();
  1330. this.closeTime = 0;
  1331. this.closeNum = 0;
  1332. this.skillUrl = xGame.common.skillIconList;
  1333. }
  1334. onConstructor() {
  1335. this.ui = ui_UITry.createInstance();
  1336. this.contentPane = this.ui;
  1337. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1338. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1339. }
  1340. show() {
  1341. super.show();
  1342. this.closeNum = 0;
  1343. this.closeTime = 15;
  1344. this.ui.t0.play();
  1345. PlatMgr.showRateBanner();
  1346. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1347. Laya.timer.loop(1000, this, this.updateTime);
  1348. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1349. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1350. xGame.common.gameMgr.gamePause = true;
  1351. }
  1352. updateTime() {
  1353. if (this.closeTime > 1) {
  1354. this.closeTime--;
  1355. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1356. }
  1357. else
  1358. this.hide();
  1359. }
  1360. hide() {
  1361. Laya.timer.clearAll(this);
  1362. Moyu.showBannerAd(false);
  1363. super.hide();
  1364. xGame.common.gameMgr.gamePause = false;
  1365. }
  1366. onTry() {
  1367. console.log('zh:qjff_AD_for_uitry');
  1368. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1369. }
  1370. else {
  1371. console.log('zh:AD 失败,直接发放奖励');
  1372. this.qjff_AD_for_uitry();
  1373. }
  1374. }
  1375. qjff_AD_for_uitry() {
  1376. let select = xGame.common.curPlayerSkillType;
  1377. DataMgr.gameData.trySkill = select;
  1378. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1379. DataMgr.saveGameData();
  1380. DataMgr.setBigSkill(select, 1);
  1381. xGame.showTip("Trial Successful");
  1382. this.hide();
  1383. }
  1384. onCancel() {
  1385. if (this.closeNum > 0) {
  1386. this.closeNum--;
  1387. if (this.closeNum < 2)
  1388. this.hide();
  1389. return;
  1390. }
  1391. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1392. this.onTry();
  1393. }
  1394. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1395. this.closeNum = 3;
  1396. }
  1397. else
  1398. this.hide();
  1399. }
  1400. }
  1401. UITry.uiName = "UITry";
  1402. class PlatMgr {
  1403. static initConfig() {
  1404. this.lastVt = 0;
  1405. if (!Moyu.platConfig)
  1406. return;
  1407. for (let k in Moyu.platConfig) {
  1408. let pd = this[k];
  1409. let pc = Moyu.platConfig[k];
  1410. if (pd != undefined && pc != undefined)
  1411. this[k] = pc;
  1412. }
  1413. Moyu.setBannerPos(0.5, 1);
  1414. }
  1415. static rand100(num) {
  1416. return xGame.tools.random(0, 100) < num;
  1417. }
  1418. static isMisVideo() {
  1419. let dt = Laya.timer.currTimer - this.lastVt;
  1420. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1421. this.lastVt = Laya.timer.currTimer;
  1422. return true;
  1423. }
  1424. else {
  1425. if (this.rand100(this.fullVideoRate))
  1426. Moyu.showInsertAd(0, 0, 'full');
  1427. return false;
  1428. }
  1429. }
  1430. static showVideo(call, type) {
  1431. Moyu.showVideoAd(() => {
  1432. this.lastVt = Laya.timer.currTimer;
  1433. call && call();
  1434. }, type);
  1435. }
  1436. static showInsert(delay = false) {
  1437. if (this.getRand() < this.insertRate) {
  1438. let dt = delay ? this.insertDelay : 0;
  1439. Moyu.showInsertAd(dt, this.insertGap);
  1440. }
  1441. }
  1442. static gameInsert() {
  1443. if (this.getRand() < this.gameInsertRate) {
  1444. console.log('zh: 游戏中插屏 hhhhhhhhhhhhhhhhhh');
  1445. Moyu.showInsertAd(xGame.tools.random(2000, 5100), this.insertGap);
  1446. }
  1447. }
  1448. static showRateBanner() {
  1449. if (this.getRand() < this.bannerRate)
  1450. this.showBanner(true, this.bannerDelay, 3000);
  1451. }
  1452. static showBanner(show, delay = 0, hide = 0) {
  1453. if (!show)
  1454. Moyu.showBannerAd(false);
  1455. else {
  1456. Laya.timer.clear(this, this.bannerShow);
  1457. if (delay > 0)
  1458. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1459. else
  1460. this.bannerShow(true);
  1461. if (hide > 0)
  1462. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1463. }
  1464. }
  1465. static bannerShow(show) {
  1466. Moyu.showBannerAd(show);
  1467. console.log("showBanner" + show);
  1468. }
  1469. static getRand() {
  1470. return xGame.tools.random(0, 100);
  1471. }
  1472. static openBox() {
  1473. if (this.getRand() < this.boxRate)
  1474. xGame.uiMgr.Show(UIBox);
  1475. }
  1476. static openTry() {
  1477. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1478. return;
  1479. if (this.getRand() < this.tryRate)
  1480. xGame.uiMgr.Show(UITry);
  1481. else if (DataMgr.gameData.gameCount == 1)
  1482. xGame.uiMgr.Show(UITry);
  1483. }
  1484. }
  1485. PlatMgr.forceShare = 0;
  1486. PlatMgr.signAdRate = 0;
  1487. PlatMgr.forceVideoRate = 0;
  1488. PlatMgr.forceVideoGap = 0;
  1489. PlatMgr.fullVideoRate = 0;
  1490. PlatMgr.gameInsertRate = 0;
  1491. PlatMgr.insertGap = 0;
  1492. PlatMgr.insertDelay = 0;
  1493. PlatMgr.insertRate = 0;
  1494. PlatMgr.boxRate = 0;
  1495. PlatMgr.boxVideoRate = 0;
  1496. PlatMgr.boxInsertRate = 0;
  1497. PlatMgr.boxBannerRate = 0;
  1498. PlatMgr.tryRate = 0;
  1499. PlatMgr.tryClose3Rate = 0;
  1500. PlatMgr.tryVideoRate = 0;
  1501. PlatMgr.bannerRate = 0;
  1502. PlatMgr.lastVt = 0;
  1503. class ui_UIAddProp extends fgui.GComponent {
  1504. static createInstance() {
  1505. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1506. }
  1507. onConstruct() {
  1508. this.n11 = (this.getChild("n11"));
  1509. this.myNode = (this.getChild("myNode"));
  1510. this.closeBtn = (this.getChild("closeBtn"));
  1511. this.t0 = this.getTransition("t0");
  1512. }
  1513. }
  1514. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1515. class SpineMgr {
  1516. constructor(name, loadCb = null) {
  1517. this.loaded = false;
  1518. this.spineName = '';
  1519. this.loadedCallback = loadCb;
  1520. this.templet = new Laya.Templet();
  1521. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1522. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1523. if (name === 'mishu') {
  1524. this.templet.loadAni('spine/nvmishu.sk');
  1525. }
  1526. else {
  1527. this.templet.loadAni(`spine/${name}.sk`);
  1528. }
  1529. this.templet.lock = true;
  1530. this.spineName = name;
  1531. }
  1532. onError() {
  1533. console.log("zh:spine加载出错");
  1534. }
  1535. parseComplete() {
  1536. this.loaded = true;
  1537. this.loadedCallback && this.loadedCallback();
  1538. }
  1539. dispose() {
  1540. if (this.templet && !this.templet.destroyed) {
  1541. this.templet.destroy();
  1542. }
  1543. this.templet = null;
  1544. }
  1545. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1546. if (!this.loaded) {
  1547. return;
  1548. }
  1549. let spine;
  1550. if (mySpine) {
  1551. spine = mySpine;
  1552. }
  1553. else {
  1554. spine = this.createSpine(data, parent);
  1555. }
  1556. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1557. if (!isLoop) {
  1558. spine.on(Laya.Event.STOPPED, this, () => {
  1559. spine.offAll(Laya.Event.STOPPED);
  1560. callback && callback(spine);
  1561. });
  1562. }
  1563. return spine;
  1564. }
  1565. createSpine(data, parent, type = 1) {
  1566. let spine;
  1567. spine = this.templet.buildArmature(type);
  1568. spine.showSkinByIndex(0);
  1569. parent.addChild(spine);
  1570. spine.pos(data.x, data.y);
  1571. spine.scale(data.scaleX, data.scaleY, true);
  1572. return spine;
  1573. }
  1574. }
  1575. var AIState;
  1576. (function (AIState) {
  1577. AIState[AIState["none"] = 0] = "none";
  1578. AIState[AIState["idle"] = 1] = "idle";
  1579. AIState[AIState["reset"] = 2] = "reset";
  1580. AIState[AIState["move"] = 3] = "move";
  1581. AIState[AIState["wait"] = 4] = "wait";
  1582. AIState[AIState["select"] = 5] = "select";
  1583. AIState[AIState["turn"] = 6] = "turn";
  1584. AIState[AIState["shoot"] = 7] = "shoot";
  1585. AIState[AIState["leave"] = 8] = "leave";
  1586. })(AIState || (AIState = {}));
  1587. class AIPlayer {
  1588. constructor() {
  1589. this.dtime = 30;
  1590. this.awayTime = 0;
  1591. this.awayNum = 0;
  1592. this.hideTime = 0;
  1593. this.rootMoveTime = 0;
  1594. this.isGuide = false;
  1595. this.state = AIState.none;
  1596. this.waitTime = 0;
  1597. this.forceNum = 0;
  1598. this.forceMax = 0;
  1599. this.ballSize = 33;
  1600. this.selectNum = 0;
  1601. this.destRot = 0;
  1602. this.aiLv = 10;
  1603. this.kickBall = [];
  1604. this.lineBall = [];
  1605. this.scoreBall = [];
  1606. this.holeBall = [];
  1607. this.turnNum = 0;
  1608. this.setNum = 0;
  1609. this.setMax = 0;
  1610. this.setRate = 0;
  1611. this.rectL = 0;
  1612. this.rectR = 0;
  1613. this.rectT = 0;
  1614. this.rectB = 0;
  1615. this.rootPos = { x: 0, y: 0 };
  1616. this.bestForce = 0;
  1617. this.bestAngle = 180;
  1618. this.bestPos = { x: 0, y: 0 };
  1619. this.bestKick = { x: 0, y: 0 };
  1620. this.posList = [];
  1621. this.posIdx = 0;
  1622. this.chatTime = 3000;
  1623. this.tempDir1 = new Laya.Vector2();
  1624. this.tempDir2 = new Laya.Vector2();
  1625. this.tempDir3 = new Laya.Vector2();
  1626. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1627. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1628. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1629. this.gameSrc = xGame.common.gameUI;
  1630. this.hideTime = Laya.timer.currTimer;
  1631. Moyu.setOnTipCall((id) => {
  1632. if (id == 20012)
  1633. this.hideTime = Laya.timer.currTimer;
  1634. else
  1635. (id == 20011);
  1636. {
  1637. let dt = Laya.timer.currTimer - this.hideTime;
  1638. console.log("onshow" + dt);
  1639. if (dt > 30000 && this.state > AIState.none)
  1640. xGame.common.gameMgr.aiGameEnd(false);
  1641. }
  1642. }, this);
  1643. }
  1644. init() {
  1645. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1646. this.awayTime = xGame.tools.random(5000, 10000);
  1647. this.awayNum = 0;
  1648. this.hideTime = Laya.timer.currTimer;
  1649. let rect = xGame.common.d2World.borderRect;
  1650. this.rectL = Math.ceil(rect.x) + 17;
  1651. this.rectT = Math.ceil(rect.y) + 17;
  1652. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1653. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1654. this.wBall = xGame.common.d2World.rootBall;
  1655. this.ballSize = this.wBall.gameObj.width - 1;
  1656. if (this.posList.length < 1) {
  1657. let dp = 40;
  1658. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1659. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1660. let dx = i < this.rectR ? i : this.rectR;
  1661. let dy = j < this.rectB ? j : this.rectB;
  1662. let order = xGame.tools.random(0, 1000);
  1663. this.posList.push({ x: dx, y: dy, order: order });
  1664. }
  1665. }
  1666. this.posList.sort(function (a, b) {
  1667. return a.order - b.order;
  1668. });
  1669. this.setMax = this.posList.length;
  1670. }
  1671. this.state = AIState.idle;
  1672. }
  1673. setAiLevel(num) {
  1674. this.aiLv = num;
  1675. }
  1676. initBall() {
  1677. this.rootPos.x = this.wBall.gameObj.x;
  1678. this.rootPos.y = this.wBall.gameObj.y;
  1679. this.initHoleBall();
  1680. }
  1681. initHoleBall() {
  1682. this.kickBall = [];
  1683. this.lineBall = [];
  1684. this.scoreBall = [];
  1685. this.holeBall = [];
  1686. this.selectNum = 0;
  1687. this.forceNum = 0;
  1688. this.forceMax = 0;
  1689. this.turnNum = 0;
  1690. let list = xGame.common.d2World.ballArr;
  1691. if (list.length < 20 && !this.isGuide) {
  1692. let holes = xGame.common.gameMgr.holePosList;
  1693. for (let i = 0; i < list.length; i++) {
  1694. let obj = list[i];
  1695. if (!obj)
  1696. continue;
  1697. obj.kickPos.x = 0;
  1698. obj.kickPos.y = 0;
  1699. obj.poleAngle = 0;
  1700. obj.hard = 0;
  1701. obj.borderDis = 0;
  1702. obj.kickAngle = 180;
  1703. if (obj.number == 0)
  1704. continue;
  1705. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1706. continue;
  1707. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1708. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1709. continue;
  1710. }
  1711. let b = obj.gameObj;
  1712. let wbp = this.rootPos;
  1713. let bx = wbp.x - b.x;
  1714. let by = wbp.y - b.y;
  1715. obj.borderDis = xGame.tools.random(0, 100);
  1716. this.kickBall.push(obj);
  1717. if (!this.isLine(wbp, obj))
  1718. continue;
  1719. obj.kickAngle = xGame.tools.random(90, 180);
  1720. obj.kickPos.x = b.x;
  1721. obj.kickPos.y = b.y;
  1722. this.lineBall.push(obj);
  1723. let minDis = 999999;
  1724. let hole = false;
  1725. for (let j = 0; j < holes.length; j++) {
  1726. let hp = holes[j];
  1727. if (bx >= 0 && hp.x > b.x + 100)
  1728. continue;
  1729. if (bx <= 0 && hp.x < b.x - 100)
  1730. continue;
  1731. if (by < -10 && hp.y < wbp.y)
  1732. continue;
  1733. if (by > 10 && hp.y > wbp.y)
  1734. continue;
  1735. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1736. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1737. if (dis < minDis) {
  1738. let dx = b.x - this.tempDir1.x * this.ballSize;
  1739. let dy = b.y - this.tempDir1.y * this.ballSize;
  1740. this.tempDir3.x = this.tempDir1.x;
  1741. this.tempDir3.y = this.tempDir1.y;
  1742. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1743. obj.kickPos.x = dx;
  1744. obj.kickPos.y = dy;
  1745. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1746. if (num > 1)
  1747. num = 1;
  1748. obj.kickAngle = Math.acos(num) * 57.3;
  1749. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1750. dis = dis * 2;
  1751. if (Math.abs(hp.x - 600) < 100)
  1752. dis += 50;
  1753. obj.hard = dis + obj.kickAngle * 3;
  1754. hole = true;
  1755. }
  1756. }
  1757. }
  1758. }
  1759. if (hole) {
  1760. this.scoreBall.push(obj);
  1761. this.holeBall.push(obj);
  1762. }
  1763. }
  1764. this.scoreBall.sort(function (a, b) {
  1765. return a.hard - b.hard;
  1766. });
  1767. this.holeBall.sort(function (a, b) {
  1768. return a.kickAngle - b.kickAngle;
  1769. });
  1770. this.kickBall.sort(function (a, b) {
  1771. return a.borderDis - b.borderDis;
  1772. });
  1773. }
  1774. else {
  1775. let max = list.length - 1;
  1776. let i = xGame.tools.random(0, max);
  1777. for (i; i <= max; i++) {
  1778. let idx = i >= max ? i -= max : i;
  1779. let obj = list[idx];
  1780. if (obj && obj.number != 0) {
  1781. obj.kickAngle = xGame.tools.random(90, 180);
  1782. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1783. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1784. this.lineBall.push(obj);
  1785. break;
  1786. }
  1787. }
  1788. }
  1789. }
  1790. selectBall() {
  1791. let ball = null;
  1792. this.destRot = 0;
  1793. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1794. let ai = 110 - this.aiLv * 10;
  1795. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1796. let score = false;
  1797. if (this.scoreBall.length < 1) {
  1798. if (this.lineBall.length < 1) {
  1799. for (let i = 0; i < this.kickBall.length; i++) {
  1800. let list = [];
  1801. let bo = this.kickBall[i];
  1802. let bobj = bo.gameObj;
  1803. let rect = xGame.common.d2World.borderRect;
  1804. let mobj = this.wBall.gameObj;
  1805. let minb = bobj.y - rect.y - 20;
  1806. let minw = mobj.y - rect.y - 50;
  1807. if (minb > 0 && minw > 0) {
  1808. let dlenx = 0;
  1809. let dleny = mobj.y - rect.y;
  1810. let spx = mobj.x;
  1811. let spy = rect.y - dleny;
  1812. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1813. }
  1814. minb = rect.y + rect.height - bobj.y - 20;
  1815. minw = rect.y + rect.height - mobj.y - 50;
  1816. if (minb > 0 && minw > 0) {
  1817. let dlenx = 0;
  1818. let dleny = rect.y + rect.height - mobj.y;
  1819. let spx = mobj.x;
  1820. let spy = rect.y + rect.height + dleny;
  1821. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1822. }
  1823. minb = bobj.x - rect.x - 20;
  1824. minw = mobj.x - rect.x - 50;
  1825. if (minb > 0 && minw > 0) {
  1826. let dlenx = mobj.x - rect.x;
  1827. let dleny = 0;
  1828. let spx = rect.x - dlenx;
  1829. let spy = mobj.y;
  1830. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1831. }
  1832. minb = rect.x + rect.width - bobj.x - 20;
  1833. minw = rect.x + rect.width - mobj.x - 50;
  1834. if (minb > 0 && minw > 0) {
  1835. let dlenx = rect.x + rect.width - mobj.x;
  1836. let dleny = 0;
  1837. let spx = rect.x + rect.width + dlenx;
  1838. let spy = mobj.y;
  1839. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1840. }
  1841. list.sort(function (a, b) {
  1842. return a.order - b.order;
  1843. });
  1844. for (let i = 0; i < list.length; i++) {
  1845. let data = list[i];
  1846. let mx = mobj.x - bobj.x;
  1847. let my = mobj.y - bobj.y;
  1848. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1849. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1850. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1851. if (num > 1)
  1852. num = 1;
  1853. let cos = Math.acos(num);
  1854. if (cos > 1.57)
  1855. cos = 1.57;
  1856. else if (cos < 0.01)
  1857. cos = 0.01;
  1858. let tan = Math.tan(cos);
  1859. let dx = tan * data.dleny;
  1860. let dy = tan * data.dlenx;
  1861. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1862. if (Math.abs(bx - 667) < 40)
  1863. continue;
  1864. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1865. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1866. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1867. this.forceMax = dis * 0.08;
  1868. this.destRot += mis * 0.1;
  1869. this.setKick(bx, by);
  1870. return true;
  1871. }
  1872. }
  1873. }
  1874. }
  1875. else {
  1876. ball = xGame.common.getRandArrEle(this.lineBall);
  1877. }
  1878. }
  1879. else {
  1880. for (let i = 0; i < this.scoreBall.length; i++) {
  1881. if (i < this.scoreBall.length - 1) {
  1882. let rand = 70 + this.aiLv * 10 + i * 10;
  1883. if (xGame.tools.random(0, 100) < rand) {
  1884. ball = this.scoreBall[i];
  1885. break;
  1886. }
  1887. }
  1888. else {
  1889. ball = this.scoreBall[i];
  1890. break;
  1891. }
  1892. }
  1893. score = true;
  1894. this.selectNum++;
  1895. }
  1896. if (!ball)
  1897. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1898. if (this.selectNum >= max) {
  1899. let dx = ball.gameObj.x;
  1900. let dy = ball.gameObj.y;
  1901. let kickAngle = 0;
  1902. if (score) {
  1903. dx = ball.kickPos.x;
  1904. dy = ball.kickPos.y;
  1905. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1906. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1907. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1908. if (adot > 1)
  1909. adot = 1;
  1910. kickAngle = Math.acos(adot) * 57.3;
  1911. if (kickAngle > 45) {
  1912. let kdx = ball.kickPos.x - ball.gameObj.x;
  1913. let kdy = ball.kickPos.y - ball.gameObj.y;
  1914. dx = ball.kickPos.x - kdx * mis * 0.3;
  1915. dy = ball.kickPos.y - kdy * mis * 0.3;
  1916. }
  1917. else
  1918. this.destRot += mis;
  1919. }
  1920. else if (ball.poleAngle != 0) {
  1921. this.destRot += ball.poleAngle;
  1922. }
  1923. if (xGame.common.gameMode == 0) {
  1924. let af = kickAngle * 0.08;
  1925. this.forceMax = ball.hard * 0.1 + af * af;
  1926. }
  1927. this.setKick(dx, dy);
  1928. }
  1929. else {
  1930. let rand = this.aiLv * 5 + 40;
  1931. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1932. ball = xGame.common.getRandArrEle(this.scoreBall);
  1933. else
  1934. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1935. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1936. if (xGame.tools.random(0, 100) > rand) {
  1937. this.selectNum = max;
  1938. }
  1939. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1940. this.selectNum++;
  1941. }
  1942. ball.onClick(0, true);
  1943. }
  1944. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1945. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1946. let balls = xGame.common.d2World.ballArr;
  1947. let max = xGame.tools.getDis(hx, hy, bx, by);
  1948. for (let index = 0; index < balls.length; index++) {
  1949. let obj = balls[index];
  1950. if (obj.number == 0)
  1951. continue;
  1952. if (obj.number == bn || obj.number == dn)
  1953. continue;
  1954. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  1955. if (dis * dis > max)
  1956. continue;
  1957. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  1958. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1959. if (num > 1)
  1960. num = 1;
  1961. if (num < 0)
  1962. continue;
  1963. let gap = Math.sin(Math.acos(num)) * dis;
  1964. if (gap < this.ballSize)
  1965. return true;
  1966. }
  1967. return false;
  1968. }
  1969. isLine(xy, ball) {
  1970. let bx = xy.x;
  1971. let by = xy.y;
  1972. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  1973. let dis = ball.getDestDis(xy);
  1974. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  1975. let sin = Math.sin(angle);
  1976. let cos = Math.cos(angle);
  1977. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1978. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1979. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1980. let dx = bx + this.tempDir2.x * dis;
  1981. let dy = by + this.tempDir2.y * dis;
  1982. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  1983. sin = Math.sin(-angle);
  1984. cos = Math.cos(-angle);
  1985. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1986. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1987. dx = bx + this.tempDir2.x * dis;
  1988. dy = by + this.tempDir2.y * dis;
  1989. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  1990. if (isr && isl)
  1991. return false;
  1992. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  1993. }
  1994. return true;
  1995. }
  1996. turnPole() {
  1997. this.turnNum++;
  1998. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  1999. let dr = rot - this.destRot;
  2000. let abs = Math.abs(dr) % 360;
  2001. if (abs > 180) {
  2002. if (rot > 180)
  2003. rot -= 360;
  2004. if (this.destRot > 180)
  2005. this.destRot -= 360;
  2006. }
  2007. let max = this.turnNum * 5 + this.aiLv * 5;
  2008. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2009. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2010. let at = xGame.tools.random(1000, 2000);
  2011. if (!this.onAway(3))
  2012. at += xGame.tools.random(10000, 15000);
  2013. this.setState(AIState.shoot, at);
  2014. }
  2015. else {
  2016. let mr = 0;
  2017. if (abs > 3)
  2018. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2019. else if (Math.random() > 0.6)
  2020. mr = xGame.tools.random(1, 10) * 0.1;
  2021. mr = dr > 0 ? -mr : mr;
  2022. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2023. }
  2024. }
  2025. setKick(dx, dy) {
  2026. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2027. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2028. this.tempDir1.x = 0;
  2029. this.tempDir1.y = 1;
  2030. this.tempDir2.y = -this.tempDir2.y;
  2031. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2032. if (num > 1)
  2033. num = 1;
  2034. let rot = Math.acos(num) * 57.3;
  2035. if (this.tempDir2.x < 0)
  2036. rot = 360 - rot;
  2037. this.destRot += rot;
  2038. if (!xGame.common.gameMgr.finishOneShoot) {
  2039. this.forceMax += xGame.tools.random(10, 50);
  2040. this.forceMax -= this.aiLv * 2;
  2041. if (this.forceMax < 20)
  2042. this.forceMax = 20;
  2043. }
  2044. if (this.forceMax > 100)
  2045. this.forceMax = 101;
  2046. else if (this.forceMax < 10)
  2047. this.forceMax += xGame.tools.random(0, 10);
  2048. if (xGame.common.gameMode == 1)
  2049. this.forceMax = xGame.tools.random(80, 100);
  2050. else
  2051. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2052. let max = 2000 - this.aiLv * 100;
  2053. if (Math.random() > 0.8)
  2054. max += xGame.tools.random(100, 2000);
  2055. this.setState(AIState.turn, xGame.tools.random(500, max));
  2056. }
  2057. shoot() {
  2058. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2059. if (Math.random() > 0.8) {
  2060. this.gameSrc.aiForce(1);
  2061. this.setState(AIState.wait);
  2062. }
  2063. }
  2064. else {
  2065. let df = xGame.tools.random(3, 8);
  2066. if (this.forceNum < this.forceMax)
  2067. this.forceNum += df;
  2068. else
  2069. this.forceNum -= df;
  2070. let startY = this.gameSrc.ui.powerNode.y;
  2071. let height = this.gameSrc.ui.powerNode.height;
  2072. let force = startY + height * this.forceNum * 0.01;
  2073. this.gameSrc.aiForce(2, force);
  2074. }
  2075. }
  2076. reset() {
  2077. for (let i = 0; i < 4; i++) {
  2078. this.setRate--;
  2079. this.setNum++;
  2080. let pos = this.posList[this.posIdx];
  2081. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2082. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2083. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2084. this.rootPos.x = 387;
  2085. if (this.rootPos.x < this.rectL)
  2086. this.rootPos.x = this.rectL;
  2087. else if (this.rootPos.x > this.rectR)
  2088. this.rootPos.x = this.rectR;
  2089. if (this.rootPos.y < this.rectT)
  2090. this.rootPos.y = this.rectT;
  2091. else if (this.rootPos.y > this.rectB)
  2092. this.rootPos.y = this.rectB;
  2093. this.posIdx++;
  2094. let max = this.posList.length;
  2095. if (this.posIdx >= max)
  2096. this.posIdx -= max;
  2097. this.initHoleBall();
  2098. let ball = null;
  2099. if (this.scoreBall.length > 0)
  2100. ball = this.scoreBall[0];
  2101. else if (this.lineBall.length > 0)
  2102. ball = xGame.common.getRandArrEle(this.lineBall);
  2103. if (ball && ball.kickAngle < this.bestAngle) {
  2104. this.bestAngle = ball.kickAngle;
  2105. this.bestKick.x = ball.kickPos.x;
  2106. this.bestKick.y = ball.kickPos.y;
  2107. this.bestPos.x = this.rootPos.x;
  2108. this.bestPos.y = this.rootPos.y;
  2109. this.bestForce = ball.hard * 0.08;
  2110. }
  2111. }
  2112. if (this.setNum >= this.setMax)
  2113. this.setMax = 0;
  2114. if (this.setRate < 1) {
  2115. this.setState(AIState.move, 0);
  2116. this.rootMoveTime = Laya.timer.currTimer;
  2117. this.gameSrc.aiRootMove(true);
  2118. }
  2119. }
  2120. delayLine() {
  2121. this.gameSrc.aiRootMove(false);
  2122. }
  2123. move() {
  2124. if (this.bestPos.x < 1)
  2125. this.bestPos = this.rootPos;
  2126. let wObj = this.wBall.gameObj;
  2127. let destx = wObj.x;
  2128. let desty = wObj.y;
  2129. let dx = Math.abs(destx - this.bestPos.x);
  2130. let dy = Math.abs(desty - this.bestPos.y);
  2131. let mx = 3 + dx * 0.03;
  2132. let my = 3 + dy * 0.03;
  2133. if (dx < 4 && dy < 4) {
  2134. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2135. dt = dt < 1000 ? 1000 - dt : 0;
  2136. if (this.setMax > 0) {
  2137. let min = this.setMax * 0.3 + this.aiLv * 5;
  2138. this.setRate = xGame.tools.random(min, this.setMax);
  2139. this.setState(AIState.reset, 0);
  2140. }
  2141. else {
  2142. this.destRot = 0;
  2143. this.forceMax = this.bestForce;
  2144. this.setKick(this.bestKick.x, this.bestKick.y);
  2145. }
  2146. if (dt > 100) {
  2147. Laya.timer.clear(this, this.delayLine);
  2148. Laya.timer.once(dt, this, this.delayLine);
  2149. }
  2150. else
  2151. this.gameSrc.aiRootMove(false);
  2152. }
  2153. else {
  2154. if (dx > 4)
  2155. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2156. if (dy > 4)
  2157. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2158. this.gameSrc.onRootMove({ x: destx, y: desty });
  2159. }
  2160. }
  2161. resetRoot() {
  2162. this.bestAngle = 180;
  2163. this.bestForce = 0;
  2164. this.setMax = this.posList.length;
  2165. this.posIdx = xGame.tools.random(0, this.setMax);
  2166. let min = this.setMax * 0.3 + this.aiLv * 5;
  2167. this.setRate = xGame.tools.random(min, this.setMax);
  2168. let max = 2000 - this.aiLv * 100;
  2169. if (Math.random() > 0.8)
  2170. max += xGame.tools.random(100, 1000);
  2171. if (this.isGuide)
  2172. this.setState(AIState.select, 500);
  2173. else if (this.onAway(2))
  2174. this.setState(AIState.reset, xGame.tools.random(400, max));
  2175. else
  2176. this.setState(AIState.none);
  2177. if (xGame.common.gameMgr.finishOneShoot)
  2178. this.chat();
  2179. }
  2180. runAI() {
  2181. if (this.state > AIState.idle)
  2182. return;
  2183. this.initBall();
  2184. this.onGame(2500);
  2185. if (Math.random() > 0.6)
  2186. this.chat();
  2187. }
  2188. stopRun() {
  2189. this.setState(AIState.idle);
  2190. }
  2191. onGame(base) {
  2192. let max = base - this.aiLv * 100;
  2193. if (Math.random() > 0.8)
  2194. max += xGame.tools.random(100, 1000);
  2195. if (this.onAway(2))
  2196. this.setState(AIState.select, xGame.tools.random(500, max));
  2197. else
  2198. this.setState(AIState.none);
  2199. }
  2200. setState(sta, wt = 0) {
  2201. if (this.state == AIState.none)
  2202. return;
  2203. this.state = sta;
  2204. this.waitTime = wt;
  2205. }
  2206. onUpdate() {
  2207. if (this.state == AIState.none)
  2208. return;
  2209. this.awayTime -= this.dtime;
  2210. if (this.awayTime < 1) {
  2211. this.awayTime = xGame.tools.random(6000, 10000);
  2212. this.awayNum += (11 - this.aiLv);
  2213. this.onAway(1);
  2214. }
  2215. if (this.waitTime >= 0) {
  2216. this.waitTime -= this.dtime;
  2217. return;
  2218. }
  2219. switch (this.state) {
  2220. case AIState.idle:
  2221. this.chat();
  2222. break;
  2223. case AIState.reset:
  2224. this.reset();
  2225. break;
  2226. case AIState.move:
  2227. this.move();
  2228. break;
  2229. case AIState.leave:
  2230. this.state = AIState.none;
  2231. xGame.common.gameMgr.aiGameEnd(true);
  2232. break;
  2233. case AIState.select:
  2234. this.selectBall();
  2235. break;
  2236. case AIState.turn:
  2237. this.turnPole();
  2238. break;
  2239. case AIState.shoot:
  2240. this.shoot();
  2241. break;
  2242. }
  2243. }
  2244. onAway(type) {
  2245. if (type == 1) {
  2246. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2247. let num = this.awayNum + db * 20;
  2248. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2249. xGame.common.gameMgr.aiLeave();
  2250. this.setState(AIState.leave, 6666);
  2251. }
  2252. }
  2253. else if (type == 2) {
  2254. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2255. let num = this.awayNum + db * 30;
  2256. if (xGame.tools.random(0, 10000) < num)
  2257. return false;
  2258. }
  2259. else if (type == 3) {
  2260. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2261. let num = this.awayNum + db * 10;
  2262. if (xGame.tools.random(0, 4000) < num)
  2263. return false;
  2264. }
  2265. return true;
  2266. }
  2267. chat() {
  2268. if (this.chatTime > 0) {
  2269. this.chatTime -= this.dtime;
  2270. return;
  2271. }
  2272. this.chatTime = xGame.tools.random(2000, 10000);
  2273. let rand = xGame.tools.random(0, 100);
  2274. if (rand < 15)
  2275. this.talk();
  2276. else if (rand < 35)
  2277. this.emotion();
  2278. }
  2279. talk() {
  2280. xGame.common.talkMgr.showAITalk(0);
  2281. }
  2282. emotion() {
  2283. xGame.common.talkMgr.showAIEmotion(0);
  2284. }
  2285. resetAI() {
  2286. this.stopRun();
  2287. this.state = AIState.none;
  2288. }
  2289. }
  2290. class Partical extends Laya.Script3D {
  2291. constructor() {
  2292. super();
  2293. this.duration = 2000;
  2294. }
  2295. ;
  2296. onAwake() {
  2297. this.gameObj = this.owner;
  2298. }
  2299. onEnable() {
  2300. this.openTimer();
  2301. }
  2302. openTimer() {
  2303. Laya.timer.once(this.duration, this, this.disappear);
  2304. }
  2305. setCallback(obj, callback) {
  2306. this.obj = obj;
  2307. this.callback = callback;
  2308. Laya.timer.clearAll(this);
  2309. Laya.timer.once(this.duration, this, this.disappear);
  2310. }
  2311. disappear() {
  2312. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2313. this.callback && this.callback(this.obj);
  2314. }
  2315. }
  2316. class Ball extends Laya.Script3D {
  2317. constructor() {
  2318. super();
  2319. this.posV3 = new Laya.Vector3();
  2320. this.rotRate = 2.1;
  2321. this.rotSpeed = new Laya.Vector3();
  2322. this.myIndex = 0;
  2323. }
  2324. onAwake() {
  2325. this.gameObj = this.owner;
  2326. this.transform = this.gameObj.transform;
  2327. this.ballNode = this.gameObj.getChildByName("Ball");
  2328. this.shadowNode = this.gameObj.getChildByName("shadow");
  2329. }
  2330. initSelf(index, x, y, owner) {
  2331. this.d2BallSrc = owner;
  2332. this.myIndex = index;
  2333. this.setAlbedoTexture();
  2334. this.setTransPos(x, y);
  2335. this.setScale();
  2336. this.ballNode.transform.localRotationEulerX = 90;
  2337. if (index == 0) {
  2338. }
  2339. }
  2340. setAlbedoTexture(isIce = false) {
  2341. let url;
  2342. if (isIce) {
  2343. url = `res/d3Res/ballTexture/ice.jpg`;
  2344. }
  2345. else {
  2346. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2347. }
  2348. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2349. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2350. }));
  2351. }
  2352. runFireworks(obj, delay, callback) {
  2353. Laya.timer.clearAll(this);
  2354. Laya.timer.once(delay + 1, this, () => {
  2355. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2356. fire.transform.localPositionX = this.transform.localPositionX;
  2357. fire.transform.localPositionY = this.transform.localPositionY;
  2358. fire.transform.localPositionZ = this.transform.localPositionZ;
  2359. let src = fire.getComponent(Partical);
  2360. src.duration = 1000;
  2361. src.setCallback(obj, callback);
  2362. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2363. eft.transform.localPositionX = this.transform.localPositionX;
  2364. eft.transform.localPositionY = this.transform.localPositionY;
  2365. eft.transform.localPositionZ = this.transform.localPositionZ;
  2366. });
  2367. }
  2368. setTransPos(x, y) {
  2369. this.setRotation();
  2370. xGame.common.pos2to3Convert(x, y, this.posV3);
  2371. this.transform.localPositionX = this.posV3.x;
  2372. this.transform.localPositionY = 0;
  2373. this.transform.localPositionZ = this.posV3.z;
  2374. this.transform.localRotationEulerX = 0;
  2375. this.transform.localRotationEulerY = 0;
  2376. this.transform.localRotationEulerZ = 0;
  2377. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2378. this.shadowNode.transform.localPositionY = 0.1;
  2379. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2380. }
  2381. setRotation() {
  2382. if (this.d2BallSrc.canRot) {
  2383. let speed = this.d2BallSrc.rigy.linearVelocity;
  2384. this.rotSpeed.x = speed.x * this.rotRate;
  2385. this.rotSpeed.z = speed.y * this.rotRate;
  2386. this.rotSpeed.y = this.d2BallSrc.rotY;
  2387. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2388. }
  2389. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2390. this.rotSpeed.x = this.rotSpeed.y = 0;
  2391. this.rotSpeed.y = this.d2BallSrc.rotY;
  2392. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2393. }
  2394. }
  2395. setScale() {
  2396. let radius = xGame.common.d2World.rootBall.ui.width;
  2397. let scale = xGame.common.scale2to3Convert(radius);
  2398. this.transform.localScaleX = scale;
  2399. this.transform.localScaleY = scale;
  2400. this.transform.localScaleZ = scale;
  2401. }
  2402. playInHoleEft() {
  2403. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2404. eft.transform.position = this.transform.position;
  2405. }
  2406. playIceEft() {
  2407. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2408. eft.transform.position = this.transform.position;
  2409. }
  2410. get scaleXYZ() {
  2411. return this.transform.localScaleX;
  2412. }
  2413. set scaleXYZ(val) {
  2414. this.transform.localScaleX = val;
  2415. this.transform.localScaleY = val;
  2416. this.transform.localScaleZ = val;
  2417. }
  2418. get posX() {
  2419. return this.transform.localPositionX;
  2420. }
  2421. set posX(val) {
  2422. this.transform.localPositionX = val;
  2423. }
  2424. get posY() {
  2425. return this.transform.localPositionY;
  2426. }
  2427. set posY(val) {
  2428. this.transform.localPositionY = val;
  2429. }
  2430. get posZ() {
  2431. return this.transform.localPositionZ;
  2432. }
  2433. set posZ(val) {
  2434. this.transform.localPositionZ = val;
  2435. }
  2436. destroySelf() {
  2437. this.posV3 = null;
  2438. this.rotSpeed = null;
  2439. this.d2BallSrc = null;
  2440. this.ballNode = null;
  2441. this.gameObj.destroy(true);
  2442. this.transform = null;
  2443. this.destroy();
  2444. }
  2445. }
  2446. class ui_D2Ball extends fgui.GComponent {
  2447. static createInstance() {
  2448. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2449. }
  2450. onConstruct() {
  2451. this.myIcon = (this.getChild("myIcon"));
  2452. this.inner = (this.getChild("inner"));
  2453. this.n8 = (this.getChild("n8"));
  2454. this.n4 = (this.getChild("n4"));
  2455. this.wrongTips = (this.getChild("wrongTips"));
  2456. this.rightTips = (this.getChild("rightTips"));
  2457. this.breathAni = this.getTransition("breathAni");
  2458. }
  2459. }
  2460. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2461. class D2BallSrc extends Laya.Script {
  2462. constructor() {
  2463. super();
  2464. this.number = 0;
  2465. this.startX = 0;
  2466. this.startY = 0;
  2467. this.angleV2 = new Laya.Vector2();
  2468. this.isRootBall = false;
  2469. this.isBlackBall = false;
  2470. this.ballType = "";
  2471. this.canRot = true;
  2472. this.rotY = 0;
  2473. this.poleAngle = 0;
  2474. this.kickPos = { x: 0, y: 0 };
  2475. this.hard = 0;
  2476. this.kickAngle = 0;
  2477. this.borderDis = 0;
  2478. this.speedP10 = 5.6;
  2479. this.lastSpeed = { x: 0, y: 0 };
  2480. this.stillSpeed = 0.12;
  2481. this.ballFunc = "normal";
  2482. this.isRunSkillAni = false;
  2483. this.isInHole = false;
  2484. this.iceOwner = "";
  2485. this.forceRun = false;
  2486. this.myUNID = "";
  2487. this.rectL = 0;
  2488. this.rectR = 0;
  2489. this.rectT = 0;
  2490. this.rectB = 0;
  2491. this.forceVec = new Laya.Vector2();
  2492. this.lastDis = 0;
  2493. this.helpOut = { type: "", x: 0, y: 0 };
  2494. }
  2495. initSelf(number, x, y, d3Ball) {
  2496. if (!this.gameObj)
  2497. this.gameObj = this.owner;
  2498. this.number = number;
  2499. this.startX = x;
  2500. this.startY = y;
  2501. this.d3Ball = d3Ball;
  2502. this.isRootBall = false;
  2503. this.isBlackBall = false;
  2504. this.ballType = "";
  2505. if (number == 0) {
  2506. this.isRootBall = true;
  2507. }
  2508. else if (number == 8) {
  2509. this.isBlackBall = true;
  2510. }
  2511. else {
  2512. if (number <= 7) {
  2513. this.ballType = ballCamp.full;
  2514. }
  2515. else {
  2516. this.ballType = ballCamp.flower;
  2517. }
  2518. }
  2519. this.setInfo();
  2520. this.setD3Ball();
  2521. this.owner["mySrc"] = this;
  2522. this.rigy.linearDamping = 1;
  2523. D2BallSrc._unid++;
  2524. this.myUNID = "d2ball" + D2BallSrc._unid;
  2525. let rect = xGame.common.d2World.borderRect;
  2526. this.rectL = Math.ceil(rect.x) + 20;
  2527. this.rectT = Math.ceil(rect.y) + 20;
  2528. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2529. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2530. }
  2531. setInfo() {
  2532. this.gameObj.x = this.startX;
  2533. this.gameObj.y = this.startY;
  2534. let radius = this.ui.width / 2;
  2535. this.gameObj.width = radius * 2;
  2536. this.gameObj.height = radius * 2;
  2537. if (xGame.common.showDebug) {
  2538. this.ui.myIcon.alpha = 1;
  2539. this.ui.inner.alpha = 1;
  2540. }
  2541. else {
  2542. this.ui.myIcon.alpha = 0;
  2543. this.ui.inner.alpha = 0;
  2544. }
  2545. }
  2546. setD3Ball() {
  2547. this.d3Ball = this.d3Ball;
  2548. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2549. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2550. }
  2551. onUpdate() {
  2552. if (xGame.common.gameMgr.gamePause)
  2553. return;
  2554. if (this.isInHole)
  2555. return;
  2556. if (!xGame.common.d2World.openCheckStill)
  2557. return;
  2558. this.runBall();
  2559. }
  2560. runBall() {
  2561. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2562. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2563. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2564. this.judgeBorder();
  2565. }
  2566. getDestDis(dest) {
  2567. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2568. }
  2569. setmyXY(x, y) {
  2570. this.d3BallSrc.setTransPos(x, y);
  2571. }
  2572. getSpeed() {
  2573. let speed = this.rigy.linearVelocity;
  2574. return speed.x * speed.x + speed.y * speed.y;
  2575. }
  2576. onTriggerEnter(collider) {
  2577. if (!collider || !collider.owner)
  2578. return;
  2579. let coll = "collide";
  2580. let speed = this.getSpeed();
  2581. let sv2 = this.speedP10 * this.speedP10;
  2582. if (collider.label == "ball") {
  2583. if (speed < 9 && this.number != 0)
  2584. coll = "";
  2585. else if (speed < sv2)
  2586. coll = "collide_4";
  2587. else if (speed < sv2 * 6.2)
  2588. coll = "collide_3";
  2589. else if (speed < sv2 * 25)
  2590. coll = "collide_2";
  2591. else if (speed < sv2 * 56)
  2592. coll = "collide_1";
  2593. xGame.soundMgr.playSound(coll);
  2594. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2595. if (collider.owner) {
  2596. let rig = collider.owner.getComponent(D2BallSrc);
  2597. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2598. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2599. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2600. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2601. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2602. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2603. let rx = 0;
  2604. let ry = 0;
  2605. if (this.gameObj.x < this.rectL)
  2606. rx = vx;
  2607. else if (this.gameObj.x > this.rectR)
  2608. rx = -vx;
  2609. else if (this.gameObj.y < this.rectT)
  2610. ry = vy;
  2611. else if (this.gameObj.y > this.rectB)
  2612. ry = -vy;
  2613. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2614. }
  2615. }
  2616. if (this.number != 0) {
  2617. return;
  2618. }
  2619. else {
  2620. if (this.forceRun) {
  2621. console.log("randon force");
  2622. this.applyForce(collider);
  2623. }
  2624. }
  2625. if (xGame.common.d2World.isOnSameLine) {
  2626. xGame.common.d2World.isOnSameLine = false;
  2627. this.rigy.linearVelocity = { x: 0, y: 0 };
  2628. }
  2629. if (xGame.common.gameMgr.firstColliObj == null) {
  2630. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2631. xGame.common.gameMgr.isTouchedBall = true;
  2632. }
  2633. }
  2634. else {
  2635. xGame.common.recoverCameraView();
  2636. let wallStr = "";
  2637. if (speed < 9) { }
  2638. else if (speed < sv2) { }
  2639. else if (speed < sv2 * 6.2)
  2640. wallStr = "wall_30";
  2641. else if (speed < sv2 * 25)
  2642. wallStr = "wall_50";
  2643. else if (speed < sv2 * 56)
  2644. wallStr = "wall_80";
  2645. xGame.soundMgr.playSound(wallStr);
  2646. }
  2647. }
  2648. applyForce(collider) {
  2649. let src = collider.owner.mySrc;
  2650. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2651. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2652. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2653. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2654. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2655. }
  2656. checkWrongBall(playEft = true) {
  2657. if (this.isInHole)
  2658. return;
  2659. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2660. if (this.number != 0 && playEft)
  2661. this.d3BallSrc.playInHoleEft();
  2662. let coll = "inpocket_1";
  2663. let speed = this.getSpeed();
  2664. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2665. if (speed < 9 && this.number != 0)
  2666. coll = "";
  2667. else if (speed < sv2 * 6.2)
  2668. coll = "inpocket_4";
  2669. else if (speed < sv2 * 25)
  2670. coll = "collide_3";
  2671. else if (speed < sv2 * 56)
  2672. coll = "collide_2";
  2673. xGame.soundMgr.playSound(coll);
  2674. this.isInHole = true;
  2675. if (this.number == 0) {
  2676. console.log("白球进了。。");
  2677. this.reset();
  2678. this.rigy.linearVelocity = { x: 0, y: 0 };
  2679. this.hideSelf();
  2680. xGame.common.gameUI.ui.whiteAni.visible = true;
  2681. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2682. xGame.common.gameUI.ui.whiteAni.visible = false;
  2683. }));
  2684. }
  2685. else {
  2686. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2687. xGame.common.d2World.removeOneBall(this);
  2688. this.destroySelf();
  2689. xGame.common.playHappySound(this.number);
  2690. this.runFlyEft();
  2691. }
  2692. }
  2693. runFlyEft() {
  2694. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2695. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2696. }
  2697. }
  2698. hideSelf() {
  2699. if (this.d3Ball)
  2700. this.d3Ball.active = false;
  2701. }
  2702. showSelf() {
  2703. this.isInHole = false;
  2704. if (this.d3Ball && !this.d3Ball.active)
  2705. this.d3Ball.active = true;
  2706. }
  2707. isStill() {
  2708. let speed = this.rigy.linearVelocity;
  2709. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2710. this.rigy.linearVelocity = { x: 0, y: 0 };
  2711. return true;
  2712. }
  2713. return false;
  2714. }
  2715. reset() {
  2716. }
  2717. destroySelf() {
  2718. this.d3BallSrc.destroySelf();
  2719. if (!this.ui.isDisposed) {
  2720. this.ui.removeFromParent();
  2721. this.ui.dispose();
  2722. this.ui = null;
  2723. }
  2724. this.outColli = null;
  2725. this.innerColli = null;
  2726. this.rigy = null;
  2727. this.d3Ball = null;
  2728. this.d3BallSrc = null;
  2729. this.angleV2 = null;
  2730. this.gameObj.destroy(true);
  2731. this.destroy();
  2732. }
  2733. judgeBorder() {
  2734. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2735. return;
  2736. }
  2737. if (this.destroyed)
  2738. return;
  2739. if (xGame.common.gameMode == GameMode.classic)
  2740. return;
  2741. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2742. if (isOver) {
  2743. this.checkWrongBall();
  2744. }
  2745. }
  2746. onClick(e, force = false) {
  2747. if (this.number == 0)
  2748. return;
  2749. if (force) {
  2750. }
  2751. else {
  2752. if (xGame.common.d2World.openCheckStill)
  2753. return;
  2754. if (!xGame.common.gameMgr.selfTurn) {
  2755. return;
  2756. }
  2757. }
  2758. if (!xGame.common.gameMgr.finishOneShoot)
  2759. return;
  2760. let root = xGame.common.d2World.rootBall.gameObj;
  2761. let x = this.gameObj.x - root.x;
  2762. let y = this.gameObj.y - root.y;
  2763. let angle = xGame.common.getfguiRotation(x, y);
  2764. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2765. xGame.common.d2World.getHelpLine();
  2766. xGame.common.clickedBall = true;
  2767. this.checkGuide();
  2768. }
  2769. checkGuide() {
  2770. let guide = DataMgr.getSkillGuide();
  2771. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2772. xGame.common.guideStep++;
  2773. xGame.common.gameUI.ui.guide1.visible = false;
  2774. xGame.common.gameUI.ui.guide2.visible = true;
  2775. }
  2776. }
  2777. checkDistance(disX, disY, angle) {
  2778. let diameter = this.gameObj.width - 1;
  2779. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2780. if (!this.lastDis)
  2781. this.lastDis = dis;
  2782. else {
  2783. if (dis > this.lastDis) {
  2784. this.helpOut.type = "remove";
  2785. return this.helpOut;
  2786. }
  2787. }
  2788. if (dis <= Math.pow(diameter, 2)) {
  2789. let del = 0.01;
  2790. let offest = 0;
  2791. let realX = disX - this.gameObj.x;
  2792. let realY = disY - this.gameObj.y;
  2793. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2794. offest += del;
  2795. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2796. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2797. }
  2798. this.helpOut.type = "ok";
  2799. this.helpOut.x = realX + this.gameObj.x;
  2800. this.helpOut.y = realY + this.gameObj.y;
  2801. return this.helpOut;
  2802. }
  2803. else {
  2804. this.helpOut.type = "no";
  2805. return this.helpOut;
  2806. }
  2807. }
  2808. clearBallEft() {
  2809. this.clearBallRightEft();
  2810. this.clearBallWrongEft();
  2811. }
  2812. clearBallRightEft() {
  2813. this.ui.breathAni.stop();
  2814. this.ui.rightTips.visible = false;
  2815. }
  2816. clearBallWrongEft() {
  2817. this.ui.wrongTips.visible = false;
  2818. }
  2819. showWrongEft() {
  2820. if (!xGame.common.gameMgr.selfTurn)
  2821. return;
  2822. this.ui.wrongTips.visible = true;
  2823. }
  2824. showRightEft() {
  2825. if (!xGame.common.gameMgr.selfTurn)
  2826. return;
  2827. this.ui.rightTips.visible = true;
  2828. this.ui.rightTips.scaleX = 1;
  2829. this.ui.rightTips.scaleY = 1;
  2830. this.ui.breathAni.play();
  2831. }
  2832. setBallFunc(type, owner) {
  2833. if (type == "ice") {
  2834. this.ballFunc = type;
  2835. this.d3BallSrc.setAlbedoTexture(true);
  2836. this.rigy.type = "static";
  2837. this.iceOwner = owner;
  2838. }
  2839. else {
  2840. if (owner == this.iceOwner) {
  2841. this.ballFunc = type;
  2842. this.d3BallSrc.setAlbedoTexture(false);
  2843. this.rigy.type = "dynamic";
  2844. }
  2845. }
  2846. }
  2847. }
  2848. D2BallSrc._unid = 0;
  2849. class D2RootBallSrc extends D2BallSrc {
  2850. constructor() {
  2851. super();
  2852. this.maxSpeed = 0;
  2853. this.classicMaxSpeed = 2.2;
  2854. this.bigSkillMaxSpeed = 4;
  2855. this.angle = 0;
  2856. this.allPercent = 0;
  2857. this.linearPercent = 0;
  2858. this.anglePercent = 0;
  2859. this.maxAngleRate = 0.6;
  2860. this.baseRot = 7;
  2861. this.angleMax = 0;
  2862. this.speed = new Laya.Vector2();
  2863. this.rotSpeed = new Laya.Vector2();
  2864. }
  2865. isStill() {
  2866. let speed = this.rigy.linearVelocity;
  2867. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2868. if (this.anglePercent <= 0.1) {
  2869. this.rigy.linearVelocity = { x: 0, y: 0 };
  2870. return true;
  2871. }
  2872. }
  2873. return false;
  2874. }
  2875. reset() {
  2876. this.linearPercent = 0;
  2877. this.anglePercent = 0;
  2878. }
  2879. setSpeed(percent, angle) {
  2880. this.allPercent = percent;
  2881. this.angle = angle;
  2882. this.setAngleSpeed();
  2883. this.setLinearSpeed();
  2884. let hit = "hit";
  2885. if (percent < 25)
  2886. hit = "hit03";
  2887. else if (percent < 50)
  2888. hit = "hit02";
  2889. else if (percent < 75)
  2890. hit = "hit01";
  2891. xGame.soundMgr.playSound(hit);
  2892. }
  2893. setAngleSpeed() {
  2894. let offest = xGame.common.rodOffest;
  2895. let radius = 82;
  2896. let rate = Math.abs(offest.y / radius) * 0.5;
  2897. if (offest.y > 0)
  2898. this.angleMax = -this.baseRot * 2;
  2899. else
  2900. this.angleMax = this.baseRot;
  2901. this.rotY = -offest.x / radius * 100;
  2902. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2903. this.linearPercent = this.allPercent - this.anglePercent;
  2904. }
  2905. setLinearSpeed() {
  2906. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2907. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2908. if (!xGame.common.longHelpLine) {
  2909. let offset = -150 + xGame.common.randomNum(0, 300);
  2910. offset /= 100;
  2911. this.angle += offset;
  2912. }
  2913. }
  2914. }
  2915. let sin = Math.sin(this.angle * Math.PI / 180);
  2916. let cos = Math.cos(this.angle * Math.PI / 180);
  2917. switch (xGame.common.gameMode) {
  2918. case GameMode.classic:
  2919. this.maxSpeed = this.classicMaxSpeed;
  2920. break;
  2921. case GameMode.bigMove:
  2922. this.maxSpeed = this.bigSkillMaxSpeed;
  2923. break;
  2924. case GameMode.placeBall:
  2925. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2926. if (data.type == 1) {
  2927. this.maxSpeed = this.bigSkillMaxSpeed;
  2928. }
  2929. else {
  2930. this.maxSpeed = this.classicMaxSpeed;
  2931. }
  2932. break;
  2933. default:
  2934. break;
  2935. }
  2936. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2937. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2938. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2939. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2940. this.rigy.applyLinearImpulseToCenter(this.speed);
  2941. }
  2942. onUpdate() {
  2943. if (this.anglePercent > 0.1) {
  2944. this.anglePercent *= 0.97;
  2945. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2946. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2947. this.rigy.applyForceToCenter(this.rotSpeed);
  2948. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  2949. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  2950. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  2951. if (num > 0.9)
  2952. this.canRot = true;
  2953. }
  2954. else
  2955. this.canRot = true;
  2956. if (Math.abs(this.rotY) > 0.1)
  2957. this.rotY *= 0.98;
  2958. super.onUpdate();
  2959. }
  2960. destroySelf() {
  2961. super.destroySelf();
  2962. this.speed = null;
  2963. }
  2964. }
  2965. class D2Ball extends Laya.Sprite {
  2966. constructor(isRootBall = false) {
  2967. super();
  2968. this.ui = ui_D2Ball.createInstance();
  2969. this.pivotX = this.ui.width / 2;
  2970. this.pivotY = this.ui.width / 2;
  2971. this.x = 0;
  2972. this.y = 0;
  2973. this.addChild(this.ui.displayObject);
  2974. this.ui.displayObject.x += this.ui.width / 2;
  2975. this.ui.displayObject.y += this.ui.width / 2;
  2976. if (isRootBall) {
  2977. this.d2Src = this.addComponent(D2RootBallSrc);
  2978. }
  2979. else {
  2980. this.d2Src = this.addComponent(D2BallSrc);
  2981. }
  2982. this.d2Src.ui = this.ui;
  2983. this.addCircleCollider();
  2984. this.addInnerCircleCollider();
  2985. this.addRigyBody();
  2986. }
  2987. addCircleCollider() {
  2988. let colli = xGame.common.getCollider("circle");
  2989. colli.radius = this.ui.width / 2;
  2990. this.addComponentIntance(colli);
  2991. this.d2Src.outColli = colli;
  2992. colli.label = "ball";
  2993. }
  2994. addInnerCircleCollider() {
  2995. let colli = xGame.common.getCollider("circle");
  2996. colli.radius = this.ui.inner.width / 2;
  2997. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  2998. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  2999. this.addComponentIntance(colli);
  3000. this.d2Src.innerColli = colli;
  3001. colli.label = "inner";
  3002. }
  3003. addRigyBody() {
  3004. let rigy = xGame.common.getRigbody();
  3005. rigy.type = "dynamic";
  3006. this.addComponentIntance(rigy);
  3007. this.d2Src.rigy = rigy;
  3008. }
  3009. disposeSelf() {
  3010. if (!this.ui.isDisposed) {
  3011. this.ui.dispose();
  3012. this.ui.removeFromParent();
  3013. this.ui = null;
  3014. }
  3015. }
  3016. }
  3017. class ui_D2Gan extends fgui.GComponent {
  3018. static createInstance() {
  3019. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3020. }
  3021. onConstruct() {
  3022. this.myIcon = (this.getChild("myIcon"));
  3023. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3024. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3025. this.self = (this.getChild("self"));
  3026. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3027. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3028. this.ai = (this.getChild("ai"));
  3029. }
  3030. }
  3031. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3032. class D2Gan {
  3033. constructor() {
  3034. this.offset = 0.15;
  3035. this.cell = 1.5;
  3036. this.onBallCell = 0.4;
  3037. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3038. this.moveNum = 70;
  3039. this.rulerRate = 0.1;
  3040. this.ui = ui_D2Gan.createInstance();
  3041. this.changeSelfRod();
  3042. this.changeAIRod();
  3043. }
  3044. changeSelfRod() {
  3045. let index = DataMgr.getCurBallRod();
  3046. let data = cfgTable.ballrodData[index + 1];
  3047. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3048. this.selfMySpine && this.selfMySpine.dispose();
  3049. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3050. if (data.spine) {
  3051. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3052. this.selfMySpine = new SpineMgr(data.spine, () => {
  3053. let xx = this.ui.selfEftRoot.width / 2;
  3054. let yy = this.ui.selfEftRoot.height / 2;
  3055. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3056. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3057. outSpine.rotation = -90;
  3058. });
  3059. }
  3060. }
  3061. changeAIRod() {
  3062. let length = Object.keys(cfgTable.ballrodData).length;
  3063. let rand = Math.floor(length * Math.random()) + 1;
  3064. let data = cfgTable.ballrodData[rand];
  3065. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3066. this.aiMySpine && this.aiMySpine.dispose();
  3067. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3068. if (data.spine) {
  3069. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3070. this.aiMySpine = new SpineMgr(data.spine, () => {
  3071. let xx = this.ui.aiEftRoot.width / 2;
  3072. let yy = this.ui.aiEftRoot.height / 2;
  3073. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3074. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3075. outSpine.rotation = -90;
  3076. });
  3077. }
  3078. }
  3079. setGanLastInfo() {
  3080. this.lastInfo.rotation = this.ui.rotation;
  3081. this.lastInfo.x = this.ui.x;
  3082. this.lastInfo.y = this.ui.y;
  3083. }
  3084. rotateSelf(flag, isRuler = false) {
  3085. let angle;
  3086. flag = flag * this.offset;
  3087. if (xGame.common.d2World.isHelpLineOnBall) {
  3088. angle = flag * this.onBallCell;
  3089. }
  3090. else {
  3091. angle = flag * this.cell;
  3092. }
  3093. if (isRuler) {
  3094. angle *= this.rulerRate;
  3095. }
  3096. this.ui.rotation += angle;
  3097. xGame.common.d2World.getHelpLine();
  3098. }
  3099. checkDistance() {
  3100. let target = xGame.common.d2World.targetBall;
  3101. let root = xGame.common.d2World.rootBall;
  3102. if (target == null) {
  3103. return 1;
  3104. }
  3105. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3106. if (dis <= 2500) {
  3107. return 5;
  3108. }
  3109. return 1;
  3110. }
  3111. rotDest(rot) {
  3112. this.ui.rotation = rot;
  3113. xGame.common.d2World.getHelpLine();
  3114. }
  3115. storagePower(powerNum) {
  3116. let pos = (powerNum / 100) * this.moveNum;
  3117. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3118. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3119. this.ui.x = this.lastInfo.x + xx;
  3120. this.ui.y = this.lastInfo.y + yy;
  3121. }
  3122. shoot() {
  3123. this.storagePower(0);
  3124. this.ui.visible = false;
  3125. }
  3126. destroySelf() {
  3127. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3128. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3129. this.selfMySpine && this.selfMySpine.dispose();
  3130. this.aiMySpine && this.aiMySpine.dispose();
  3131. this.lastInfo = null;
  3132. if (!this.ui.isDisposed) {
  3133. this.ui.removeFromParent();
  3134. this.ui.dispose();
  3135. }
  3136. }
  3137. }
  3138. class ui_HelpLine extends fgui.GComponent {
  3139. static createInstance() {
  3140. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3141. }
  3142. onConstruct() {
  3143. this.n10 = (this.getChild("n10"));
  3144. this.rect = (this.getChild("rect"));
  3145. this.dir11 = (this.getChild("dir11"));
  3146. this.dir = (this.getChild("dir"));
  3147. this.rootDir = (this.getChild("rootDir"));
  3148. this.dirDot = (this.getChild("dirDot"));
  3149. }
  3150. }
  3151. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3152. class D2HelpLine {
  3153. constructor() {
  3154. this.starX = 0;
  3155. this.starY = 0;
  3156. this.ui = ui_HelpLine.createInstance();
  3157. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3158. this.starX = this.ui.rect.x;
  3159. this.starY = this.ui.rect.y;
  3160. }
  3161. shoot() {
  3162. this.ui.visible = false;
  3163. }
  3164. destroySelf() {
  3165. if (this.ui.isDisposed) {
  3166. this.ui.removeFromParent();
  3167. this.ui.dispose();
  3168. }
  3169. }
  3170. }
  3171. class D2World extends Laya.Script {
  3172. constructor() {
  3173. super();
  3174. this.ballArr = [];
  3175. this.openCheckStill = false;
  3176. this.checkArr = [];
  3177. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3178. this.isHelpLineOnBall = false;
  3179. this.isOnSameLine = false;
  3180. this.reflectAngle = 0;
  3181. this.powerPercent = 0;
  3182. this.inHolesSpeed = [];
  3183. this.outDir = new Laya.Vector2();
  3184. this.rootDir = new Laya.Vector2();
  3185. this.aiLv = 0;
  3186. this.rootPos = new Laya.Vector2();
  3187. this.tempDir1 = new Laya.Vector2();
  3188. this.tempDir2 = new Laya.Vector2();
  3189. this.tempDir3 = new Laya.Vector2();
  3190. this.ballSize = 33;
  3191. this.destRot = 0;
  3192. }
  3193. initSelf() {
  3194. this.createBalls();
  3195. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3196. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3197. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3198. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3199. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3200. }
  3201. setBorderRect() {
  3202. let ui = xGame.common.gameUI.ui;
  3203. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3204. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3205. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3206. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3207. this.borderRect.x = starX;
  3208. this.borderRect.y = starY;
  3209. this.borderRect.width = width;
  3210. this.borderRect.height = height;
  3211. }
  3212. resetGame() {
  3213. this.openCheckStill = false;
  3214. let temp;
  3215. for (let index = 0; index < this.ballArr.length; index++) {
  3216. temp = this.ballArr[index];
  3217. temp.destroySelf();
  3218. }
  3219. xGame.common.d3World.ballRoot.destroyChildren();
  3220. xGame.common.gameUI.ui.ballNode.removeChildren();
  3221. console.log("进入摧毁逻辑");
  3222. this.d2Gan.destroySelf();
  3223. this.d2HelpLine.destroySelf();
  3224. this.ballArr = [];
  3225. }
  3226. setD2Gan() {
  3227. let ballNode = this.rootBall.ui;
  3228. let d2Gan = new D2Gan();
  3229. this.d2Gan = d2Gan;
  3230. let ganNode = d2Gan.ui;
  3231. ballNode.addChild(ganNode);
  3232. ganNode.pivotX = ganNode.pivotX;
  3233. ganNode.pivotY = ganNode.pivotY;
  3234. ganNode.x = ganNode.myIcon.width / 2;
  3235. ganNode.y = this.rootBall.gameObj.width;
  3236. d2Gan.setGanLastInfo();
  3237. }
  3238. setHelpLine() {
  3239. let d2Help = new D2HelpLine();
  3240. this.d2HelpLine = d2Help;
  3241. }
  3242. createBalls() {
  3243. let cfg;
  3244. switch (xGame.common.gameMode) {
  3245. case GameMode.classic:
  3246. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3247. break;
  3248. case GameMode.bigMove:
  3249. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3250. break;
  3251. case GameMode.placeBall:
  3252. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3253. break;
  3254. default:
  3255. break;
  3256. }
  3257. cfg = JSON.parse(JSON.stringify(cfg));
  3258. for (const key in cfg) {
  3259. if (cfg[key].value == 0) {
  3260. this.createRootBall(cfg[key]);
  3261. delete cfg[key];
  3262. break;
  3263. }
  3264. }
  3265. this.createOtherBalls(cfg);
  3266. }
  3267. createRootBall(data) {
  3268. let root = new D2Ball(true);
  3269. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3270. this.rootBall = root.d2Src;
  3271. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3272. let d3BallSrc = d3Ball.getComponent(Ball);
  3273. xGame.common.d3World.rootBall = d3Ball;
  3274. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3275. let xx = data.x;
  3276. let yy = data.y;
  3277. let numer = data.value;
  3278. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3279. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3280. this.ballArr.push(this.rootBall);
  3281. this.setD2Gan();
  3282. this.setHelpLine();
  3283. }
  3284. createOtherBalls(cfg) {
  3285. let temp;
  3286. let src;
  3287. let data;
  3288. for (const key in cfg) {
  3289. data = cfg[key];
  3290. temp = new D2Ball();
  3291. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3292. src = temp.d2Src;
  3293. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3294. src.initSelf(data.value, data.x, data.y, d3Ball);
  3295. this.ballArr.push(src);
  3296. }
  3297. }
  3298. shoot(percent) {
  3299. this.powerPercent = percent;
  3300. this.openCheckStill = true;
  3301. let d2Angle = this.d2Gan.ui.rotation;
  3302. this.rootBall.setSpeed(percent, d2Angle);
  3303. this.clearBallAllEft();
  3304. this.changePlayerView();
  3305. }
  3306. onUpdate() {
  3307. if (!this.openCheckStill)
  3308. return;
  3309. this.checkStill();
  3310. }
  3311. checkStill() {
  3312. for (let index = 0; index < this.ballArr.length; index++) {
  3313. if (!this.ballArr[index].isStill()) {
  3314. return;
  3315. }
  3316. }
  3317. xGame.eventMgr.event(ALL_BALL_STOP);
  3318. }
  3319. allBallStop() {
  3320. this.openCheckStill = false;
  3321. xGame.common.recoverCameraView();
  3322. }
  3323. waitShoot() {
  3324. if (!this.d2Gan.ui.isDisposed) {
  3325. this.d2Gan.ui.visible = true;
  3326. }
  3327. if (!this.d2HelpLine.ui.isDisposed) {
  3328. this.d2HelpLine.ui.visible = true;
  3329. }
  3330. this.clearBallAllEft();
  3331. this.showBallRightEft();
  3332. this.getHelpLine();
  3333. this.inHolesSpeed = [];
  3334. this.selectOneBall();
  3335. }
  3336. _getAllBallArr() {
  3337. let arr = this.ballArr;
  3338. let outArr = [];
  3339. for (let index = 0; index < arr.length; index++) {
  3340. if (arr[index] instanceof D2RootBallSrc)
  3341. continue;
  3342. if (arr[index].ballFunc == "ice")
  3343. continue;
  3344. if (arr[index].destroyed)
  3345. continue;
  3346. outArr.push(arr[index]);
  3347. }
  3348. return outArr;
  3349. }
  3350. _getBlackObj() {
  3351. let arr = this.ballArr;
  3352. for (let index = 0; index < arr.length; index++) {
  3353. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3354. return arr[index];
  3355. }
  3356. }
  3357. }
  3358. selectOneBall() {
  3359. let all = this._getAllBallArr();
  3360. let target;
  3361. switch (xGame.common.gameMode) {
  3362. case GameMode.classic:
  3363. if (xGame.common.gameMgr.selfTurn) {
  3364. let self = xGame.common.gameMgr.selfBallArr;
  3365. let black = this._getBlackObj();
  3366. if (xGame.common.gameMgr.ensureBallType) {
  3367. if (self.length > 0) {
  3368. let out = [];
  3369. for (let j = 0; j < all.length; j++) {
  3370. if (self.indexOf(all[j].number) > -1) {
  3371. out.push(all[j]);
  3372. }
  3373. }
  3374. target = this.selectBestEnterOne(out);
  3375. }
  3376. else {
  3377. target = this.selectBestEnterOne([black]);
  3378. }
  3379. }
  3380. else {
  3381. target = this.selectBestEnterOne(all);
  3382. }
  3383. }
  3384. else {
  3385. target = this.selectBestEnterOne(all);
  3386. }
  3387. break;
  3388. case GameMode.bigMove:
  3389. target = this.selectBestEnterOne(all);
  3390. break;
  3391. case GameMode.placeBall:
  3392. if (all.length > 0) {
  3393. target = this.selectBestEnterOne(all);
  3394. }
  3395. break;
  3396. default:
  3397. break;
  3398. }
  3399. if (target && !target.destroyed && target.onClick) {
  3400. target.onClick(0, true);
  3401. let num = -200 + xGame.common.randomNum(0, 400);
  3402. num /= 150;
  3403. if (xGame.common.longHelpLine) {
  3404. num = 0;
  3405. }
  3406. this.destRot += num;
  3407. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3408. }
  3409. }
  3410. removeOneBall(ball) {
  3411. for (let index = 0; index < this.ballArr.length; index++) {
  3412. if (this.ballArr[index].id == ball.id) {
  3413. this.ballArr.splice(index, 1);
  3414. break;
  3415. }
  3416. }
  3417. }
  3418. getHelpLine() {
  3419. this.d2HelpLine.ui.dirDot.visible = false;
  3420. this.isOnSameLine = false;
  3421. let startX = this.rootBall.gameObj.x;
  3422. let startY = this.rootBall.gameObj.y;
  3423. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3424. if (dis == null) {
  3425. this.d2HelpLine.ui.visible = false;
  3426. console.error("辅助线异常");
  3427. return;
  3428. }
  3429. this.d2HelpLine.ui.visible = true;
  3430. let angle = this.d2Gan.ui.rotation;
  3431. let radius = 16.5;
  3432. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3433. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3434. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3435. if (colliObj == null) {
  3436. this.getColliPos(disX, disY, radius, angle);
  3437. xGame.common.d2World.isHelpLineOnBall = false;
  3438. this.targetBall = null;
  3439. this.reflectAngle = 0;
  3440. this.showBallWrongEft();
  3441. }
  3442. else {
  3443. let target = colliObj.src;
  3444. let radius = 16.5;
  3445. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3446. dis1 = Math.sqrt(dis1);
  3447. let realDis = colliObj.disHon - dis1;
  3448. let dir = colliObj.dir;
  3449. let xx = startX + dir.x * realDis;
  3450. let yy = startY + dir.y * realDis;
  3451. this.getColliPos(xx, yy, radius, angle);
  3452. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3453. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3454. let offset = xGame.common.rodOffest;
  3455. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3456. this.isOnSameLine = true;
  3457. }
  3458. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3459. xGame.common.d2World.isHelpLineOnBall = true;
  3460. this.targetBall = target;
  3461. this.reflectAngle = reflectAngle;
  3462. this.showBallWrongEft();
  3463. if (xGame.common.longHelpLine) {
  3464. this.delayReflectLine(target, reflectAngle);
  3465. }
  3466. }
  3467. }
  3468. getBorderDot(startX, startY, angle) {
  3469. let radius = 17;
  3470. let distance;
  3471. let isDone;
  3472. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3473. isDone = this.judgeUpDown(distance, angle, startX);
  3474. if (isDone != null) {
  3475. return isDone;
  3476. }
  3477. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3478. isDone = this.judgeUpDown(distance, angle, startX);
  3479. if (isDone != null) {
  3480. return isDone;
  3481. }
  3482. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3483. isDone = this.judgeLeftRight(distance, angle, startY);
  3484. if (isDone != null) {
  3485. return isDone;
  3486. }
  3487. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3488. isDone = this.judgeLeftRight(distance, angle, startY);
  3489. if (isDone != null) {
  3490. return isDone;
  3491. }
  3492. }
  3493. judgeUpDown(distance, angle, startX) {
  3494. let flag = Math.sin(angle * Math.PI / 180);
  3495. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3496. if (distance >= 0) {
  3497. if (flag > 0) {
  3498. if (temp < this.borderRect.x + this.borderRect.width) {
  3499. return distance;
  3500. }
  3501. }
  3502. else {
  3503. if (temp > this.borderRect.x) {
  3504. return distance;
  3505. }
  3506. }
  3507. }
  3508. }
  3509. judgeLeftRight(distance, angle, starY) {
  3510. let flag = -Math.cos(angle * Math.PI / 180);
  3511. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3512. if (distance >= 0) {
  3513. if (flag > 0) {
  3514. if (temp < this.borderRect.y + this.borderRect.height) {
  3515. return distance;
  3516. }
  3517. }
  3518. else {
  3519. if (temp > this.borderRect.y) {
  3520. return distance;
  3521. }
  3522. }
  3523. }
  3524. }
  3525. clearBallAllEft() {
  3526. let temp;
  3527. for (let index = 0; index < this.ballArr.length; index++) {
  3528. temp = this.ballArr[index];
  3529. temp.clearBallEft();
  3530. }
  3531. }
  3532. showBallRightEft() {
  3533. let gameMgr = xGame.common.gameMgr;
  3534. let temp;
  3535. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3536. if (targetArr.length <= 0)
  3537. return;
  3538. for (let index = 0; index < this.ballArr.length; index++) {
  3539. temp = this.ballArr[index];
  3540. if (targetArr.indexOf(temp.number) > -1) {
  3541. temp.showRightEft();
  3542. }
  3543. }
  3544. }
  3545. showBallWrongEft() {
  3546. let gameMgr = xGame.common.gameMgr;
  3547. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3548. if (targetArr.length <= 0)
  3549. return;
  3550. let temp;
  3551. for (let index = 0; index < this.ballArr.length; index++) {
  3552. temp = this.ballArr[index];
  3553. if (this.targetBall && this.targetBall.number == temp.number) {
  3554. if (targetArr.indexOf(temp.number) <= -1) {
  3555. temp.showWrongEft();
  3556. }
  3557. else {
  3558. temp.clearBallWrongEft();
  3559. }
  3560. }
  3561. else {
  3562. temp.clearBallWrongEft();
  3563. }
  3564. }
  3565. }
  3566. getColliPos(x, y, radius, angle) {
  3567. this.d2HelpLine.ui.x = x;
  3568. this.d2HelpLine.ui.y = y;
  3569. let dirX = x - this.rootBall.gameObj.x;
  3570. let dirY = y - this.rootBall.gameObj.y;
  3571. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3572. if (rectH <= 0)
  3573. rectH = 0;
  3574. this.d2HelpLine.ui.rect.height = 0;
  3575. this.d2HelpLine.ui.rect.height = rectH;
  3576. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3577. if (rectH < this.rootBall.gameObj.width) {
  3578. this.d2HelpLine.ui.rect.visible = false;
  3579. }
  3580. else {
  3581. this.d2HelpLine.ui.rect.visible = true;
  3582. }
  3583. this.d2HelpLine.ui.dir.visible = false;
  3584. this.d2HelpLine.ui.rootDir.visible = false;
  3585. }
  3586. getReflectLine(x, y, radius, target) {
  3587. this.d2HelpLine.ui.dir.visible = true;
  3588. let dirX = target.x - x;
  3589. let dirY = target.y - y;
  3590. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3591. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3592. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3593. this.d2HelpLine.ui.dir.height = 48;
  3594. this.d2HelpLine.ui.dir.rotation = angle;
  3595. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3596. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3597. return angle;
  3598. }
  3599. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3600. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3601. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3602. let targetX = target.gameObj.x;
  3603. let targetY = target.gameObj.y;
  3604. this.outDir.setValue(targetX - xx, targetY - yy);
  3605. this.rootDir.setValue(rtX - xx, rtY - yy);
  3606. let ver = Math.PI / 2;
  3607. let sin = Math.sin(ver);
  3608. let cos = Math.cos(ver);
  3609. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3610. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3611. this.outDir.setValue(outX, outY);
  3612. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3613. Laya.Vector2.normalize(this.outDir, this.outDir);
  3614. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3615. if (Math.abs(result) <= 0.08) {
  3616. this.d2HelpLine.ui.rootDir.visible = false;
  3617. return;
  3618. }
  3619. if (result > 0) {
  3620. angle += 90;
  3621. }
  3622. else if (result < 0) {
  3623. angle -= 90;
  3624. }
  3625. this.d2HelpLine.ui.rootDir.visible = true;
  3626. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3627. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3628. this.d2HelpLine.ui.rootDir.rotation = angle;
  3629. }
  3630. delayReflectLine(obj, angle) {
  3631. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3632. return;
  3633. }
  3634. this.isOnSameLine = false;
  3635. let startX = obj.gameObj.x;
  3636. let startY = obj.gameObj.y;
  3637. let dis = this.getBorderDot(startX, startY, angle);
  3638. if (dis == null) {
  3639. this.d2HelpLine.ui.dirDot.visible = false;
  3640. return;
  3641. }
  3642. this.d2HelpLine.ui.visible = true;
  3643. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3644. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3645. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3646. if (colliObj == null) {
  3647. this.setDelayLine(disX, disY, obj, angle);
  3648. }
  3649. else {
  3650. let radius = 16;
  3651. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3652. dis1 = Math.sqrt(dis1);
  3653. let realDis = colliObj.disHon - dis1;
  3654. let dir = colliObj.dir;
  3655. let xx = startX + dir.x * realDis;
  3656. let yy = startY + dir.y * realDis;
  3657. this.setDelayLine(xx, yy, obj, angle);
  3658. }
  3659. }
  3660. setDelayLine(x, y, obj, angle) {
  3661. let dirX = x - obj.gameObj.x;
  3662. let dirY = y - obj.gameObj.y;
  3663. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3664. if (rectH <= 0)
  3665. rectH = 0;
  3666. this.d2HelpLine.ui.dir.height = rectH;
  3667. this.d2HelpLine.ui.dirDot.visible = true;
  3668. this.d2HelpLine.ui.dirDot.x = 17;
  3669. this.d2HelpLine.ui.dirDot.y = 17;
  3670. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3671. ;
  3672. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3673. }
  3674. changePlayerView() {
  3675. if (Math.random() >= 0.7)
  3676. return;
  3677. if (!this.targetBall) {
  3678. return;
  3679. }
  3680. if (!xGame.common.gameMgr.selfTurn)
  3681. return;
  3682. switch (xGame.common.gameMode) {
  3683. case GameMode.classic:
  3684. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3685. if (this.targetBall.number != 8) {
  3686. return;
  3687. }
  3688. }
  3689. break;
  3690. case GameMode.bigMove:
  3691. return;
  3692. case GameMode.placeBall:
  3693. break;
  3694. default:
  3695. break;
  3696. }
  3697. let startX = this.targetBall.gameObj.x;
  3698. let startY = this.targetBall.gameObj.y;
  3699. let angle = this.reflectAngle;
  3700. let dis = this.getBorderDot(startX, startY, angle);
  3701. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3702. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3703. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3704. if (colliObj) {
  3705. return;
  3706. }
  3707. let offset = 40;
  3708. let posObj = xGame.common.gameMgr.posObj;
  3709. let temp;
  3710. let radius;
  3711. let tarX, tarY;
  3712. for (const key in posObj) {
  3713. temp = posObj[key];
  3714. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3715. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3716. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3717. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3718. xGame.common.showOneCamera("angle" + key);
  3719. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3720. Laya.physicsTimer.scale = 0.7;
  3721. break;
  3722. }
  3723. }
  3724. }
  3725. selectBestEnterOne(arr) {
  3726. this.aiLv = xGame.tools.random(1, 11);
  3727. this.aiLv = 10;
  3728. this.wBall = xGame.common.d2World.rootBall;
  3729. this.rootPos.x = this.wBall.gameObj.x;
  3730. this.rootPos.y = this.wBall.gameObj.y;
  3731. this.initHoleBall(arr);
  3732. return this.selectBall();
  3733. }
  3734. selectBall() {
  3735. let ball = null;
  3736. this.destRot = 0;
  3737. let ai = 110 - this.aiLv * 10;
  3738. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3739. let score = false;
  3740. if (this.scoreBall.length < 1) {
  3741. if (this.lineBall.length < 1) {
  3742. for (let i = 0; i < this.kickBall.length; i++) {
  3743. let list = [];
  3744. let bo = this.kickBall[i];
  3745. let bobj = bo.gameObj;
  3746. let rect = xGame.common.d2World.borderRect;
  3747. let mobj = this.wBall.gameObj;
  3748. let minb = bobj.y - rect.y - 20;
  3749. let minw = mobj.y - rect.y - 50;
  3750. if (minb > 0 && minw > 0) {
  3751. let dlenx = 0;
  3752. let dleny = mobj.y - rect.y;
  3753. let spx = mobj.x;
  3754. let spy = rect.y - dleny;
  3755. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3756. }
  3757. minb = rect.y + rect.height - bobj.y - 20;
  3758. minw = rect.y + rect.height - mobj.y - 50;
  3759. if (minb > 0 && minw > 0) {
  3760. let dlenx = 0;
  3761. let dleny = rect.y + rect.height - mobj.y;
  3762. let spx = mobj.x;
  3763. let spy = rect.y + rect.height + dleny;
  3764. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3765. }
  3766. minb = bobj.x - rect.x - 20;
  3767. minw = mobj.x - rect.x - 50;
  3768. if (minb > 0 && minw > 0) {
  3769. let dlenx = mobj.x - rect.x;
  3770. let dleny = 0;
  3771. let spx = rect.x - dlenx;
  3772. let spy = mobj.y;
  3773. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3774. }
  3775. minb = rect.x + rect.width - bobj.x - 20;
  3776. minw = rect.x + rect.width - mobj.x - 50;
  3777. if (minb > 0 && minw > 0) {
  3778. let dlenx = rect.x + rect.width - mobj.x;
  3779. let dleny = 0;
  3780. let spx = rect.x + rect.width + dlenx;
  3781. let spy = mobj.y;
  3782. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3783. }
  3784. list.sort(function (a, b) {
  3785. return a.order - b.order;
  3786. });
  3787. for (let i = 0; i < list.length; i++) {
  3788. let data = list[i];
  3789. let mx = mobj.x - bobj.x;
  3790. let my = mobj.y - bobj.y;
  3791. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3792. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3793. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3794. if (num > 1)
  3795. num = 1;
  3796. let cos = Math.acos(num);
  3797. if (cos > 1.57)
  3798. cos = 1.57;
  3799. else if (cos < 0.01)
  3800. cos = 0.01;
  3801. let tan = Math.tan(cos);
  3802. let dx = tan * data.dleny;
  3803. let dy = tan * data.dlenx;
  3804. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3805. if (Math.abs(bx - 667) < 40)
  3806. continue;
  3807. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3808. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3809. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3810. this.forceMax = dis * 0.08;
  3811. this.destRot += mis * 0.1;
  3812. this.setKick(bx, by);
  3813. return true;
  3814. }
  3815. }
  3816. }
  3817. }
  3818. else {
  3819. ball = xGame.common.getRandArrEle(this.lineBall);
  3820. }
  3821. }
  3822. else {
  3823. for (let i = 0; i < this.scoreBall.length; i++) {
  3824. if (i < this.scoreBall.length - 1) {
  3825. let rand = 70 + this.aiLv * 10 + i * 10;
  3826. if (xGame.tools.random(0, 100) < rand) {
  3827. ball = this.scoreBall[i];
  3828. break;
  3829. }
  3830. }
  3831. else {
  3832. ball = this.scoreBall[i];
  3833. break;
  3834. }
  3835. }
  3836. score = true;
  3837. this.selectNum++;
  3838. }
  3839. if (!ball)
  3840. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3841. let dx = ball.gameObj.x;
  3842. let dy = ball.gameObj.y;
  3843. let kickAngle = 0;
  3844. if (score) {
  3845. dx = ball.kickPos.x;
  3846. dy = ball.kickPos.y;
  3847. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3848. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3849. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3850. if (adot > 1)
  3851. adot = 1;
  3852. kickAngle = Math.acos(adot) * 57.3;
  3853. if (kickAngle > 45) {
  3854. let kdx = ball.kickPos.x - ball.gameObj.x;
  3855. let kdy = ball.kickPos.y - ball.gameObj.y;
  3856. dx = ball.kickPos.x - kdx * mis * 0.3;
  3857. dy = ball.kickPos.y - kdy * mis * 0.3;
  3858. }
  3859. else
  3860. this.destRot += mis;
  3861. }
  3862. else if (ball.poleAngle != 0) {
  3863. this.destRot += ball.poleAngle;
  3864. }
  3865. if (xGame.common.gameMode == 0) {
  3866. let af = kickAngle * 0.08;
  3867. this.forceMax = ball.hard * 0.1 + af * af;
  3868. }
  3869. this.setKick(dx, dy);
  3870. return ball;
  3871. }
  3872. initHoleBall(arr) {
  3873. this.kickBall = [];
  3874. this.lineBall = [];
  3875. this.scoreBall = [];
  3876. this.holeBall = [];
  3877. this.selectNum = 0;
  3878. this.forceNum = 0;
  3879. this.forceMax = 0;
  3880. this.turnNum = 0;
  3881. let list = arr;
  3882. let holes = xGame.common.gameMgr.holePosList;
  3883. let self = xGame.common.aiPlayer;
  3884. for (let i = 0; i < list.length; i++) {
  3885. let obj = list[i];
  3886. if (!obj)
  3887. continue;
  3888. obj.kickPos.x = 0;
  3889. obj.kickPos.y = 0;
  3890. obj.poleAngle = 0;
  3891. obj.hard = 0;
  3892. obj.borderDis = 0;
  3893. obj.kickAngle = 180;
  3894. let b = obj.gameObj;
  3895. let wbp = this.rootPos;
  3896. let bx = wbp.x - b.x;
  3897. let by = wbp.y - b.y;
  3898. obj.borderDis = xGame.tools.random(0, 100);
  3899. this.kickBall.push(obj);
  3900. if (!this.isLine(wbp, obj))
  3901. continue;
  3902. obj.kickAngle = xGame.tools.random(90, 180);
  3903. obj.kickPos.x = b.x;
  3904. obj.kickPos.y = b.y;
  3905. this.lineBall.push(obj);
  3906. let minDis = 999999;
  3907. let hole = false;
  3908. for (let j = 0; j < holes.length; j++) {
  3909. let hp = holes[j];
  3910. if (bx >= 0 && hp.x > b.x + 100)
  3911. continue;
  3912. if (bx <= 0 && hp.x < b.x - 100)
  3913. continue;
  3914. if (by < -10 && hp.y < wbp.y)
  3915. continue;
  3916. if (by > 10 && hp.y > wbp.y)
  3917. continue;
  3918. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3919. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3920. if (dis < minDis) {
  3921. let dx = b.x - this.tempDir1.x * this.ballSize;
  3922. let dy = b.y - this.tempDir1.y * this.ballSize;
  3923. this.tempDir3.x = this.tempDir1.x;
  3924. this.tempDir3.y = this.tempDir1.y;
  3925. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3926. obj.kickPos.x = dx;
  3927. obj.kickPos.y = dy;
  3928. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3929. if (num > 1)
  3930. num = 1;
  3931. obj.kickAngle = Math.acos(num) * 57.3;
  3932. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3933. dis = dis * 2;
  3934. if (Math.abs(hp.x - 600) < 100)
  3935. dis += 50;
  3936. obj.hard = dis + obj.kickAngle * 3;
  3937. hole = true;
  3938. }
  3939. }
  3940. }
  3941. }
  3942. if (hole) {
  3943. this.scoreBall.push(obj);
  3944. this.holeBall.push(obj);
  3945. }
  3946. }
  3947. this.scoreBall.sort(function (a, b) {
  3948. return a.hard - b.hard;
  3949. });
  3950. this.holeBall.sort(function (a, b) {
  3951. return a.kickAngle - b.kickAngle;
  3952. });
  3953. this.kickBall.sort(function (a, b) {
  3954. return a.borderDis - b.borderDis;
  3955. });
  3956. }
  3957. isBlock(bn, bx, by, hx, hy, dn = -1) {
  3958. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  3959. let balls = xGame.common.d2World.ballArr;
  3960. let max = xGame.tools.getDis(hx, hy, bx, by);
  3961. for (let index = 0; index < balls.length; index++) {
  3962. let obj = balls[index];
  3963. if (obj.number == 0)
  3964. continue;
  3965. if (obj.number == bn || obj.number == dn)
  3966. continue;
  3967. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  3968. if (dis * dis > max)
  3969. continue;
  3970. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  3971. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3972. if (num > 1)
  3973. num = 1;
  3974. if (num < 0)
  3975. continue;
  3976. let gap = Math.sin(Math.acos(num)) * dis;
  3977. if (gap < this.ballSize)
  3978. return true;
  3979. }
  3980. return false;
  3981. }
  3982. isLine(xy, ball) {
  3983. let bx = xy.x;
  3984. let by = xy.y;
  3985. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  3986. let dis = ball.getDestDis(xy);
  3987. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  3988. let sin = Math.sin(angle);
  3989. let cos = Math.cos(angle);
  3990. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3991. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3992. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3993. let dx = bx + this.tempDir2.x * dis;
  3994. let dy = by + this.tempDir2.y * dis;
  3995. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  3996. sin = Math.sin(-angle);
  3997. cos = Math.cos(-angle);
  3998. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3999. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4000. dx = bx + this.tempDir2.x * dis;
  4001. dy = by + this.tempDir2.y * dis;
  4002. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4003. if (isr && isl)
  4004. return false;
  4005. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4006. }
  4007. return true;
  4008. }
  4009. setKick(dx, dy) {
  4010. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4011. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4012. this.tempDir1.x = 0;
  4013. this.tempDir1.y = 1;
  4014. this.tempDir2.y = -this.tempDir2.y;
  4015. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4016. if (num > 1)
  4017. num = 1;
  4018. let rot = Math.acos(num) * 57.3;
  4019. if (this.tempDir2.x < 0)
  4020. rot = 360 - rot;
  4021. this.destRot += rot;
  4022. }
  4023. }
  4024. class ui_UIGame extends fgui.GComponent {
  4025. static createInstance() {
  4026. return (fgui.UIPackage.createObject("game", "UIGame"));
  4027. }
  4028. onConstruct() {
  4029. this.c1 = this.getController("c1");
  4030. this.d3Root = (this.getChild("d3Root"));
  4031. this.clickNode = (this.getChild("clickNode"));
  4032. this.d2Root = (this.getChild("d2Root"));
  4033. this.topNode = (this.getChild("topNode"));
  4034. this.n72 = (this.getChild("n72"));
  4035. this.n40 = (this.getChild("n40"));
  4036. this.rulerNode = (this.getChild("rulerNode"));
  4037. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4038. this.n50 = (this.getChild("n50"));
  4039. this.keduNode = (this.getChild("keduNode"));
  4040. this.powerTxt = (this.getChild("powerTxt"));
  4041. this.powerNode = (this.getChild("powerNode"));
  4042. this.colorNode = (this.getChild("colorNode"));
  4043. this.powerEft = (this.getChild("powerEft"));
  4044. this.myPowerNode = (this.getChild("myPowerNode"));
  4045. this.ganNode = (this.getChild("ganNode"));
  4046. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4047. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4048. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4049. this.skillRod = (this.getChild("skillRod"));
  4050. this.border = (this.getChild("border"));
  4051. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4052. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4053. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4054. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4055. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4056. this.guanyuNode = (this.getChild("guanyuNode"));
  4057. this.helpBtn = (this.getChild("helpBtn"));
  4058. this.wordsBtn = (this.getChild("wordsBtn"));
  4059. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4060. this.returnBtn = (this.getChild("returnBtn"));
  4061. this.ballNode = (this.getChild("ballNode"));
  4062. this.whiteAni = (this.getChild("whiteAni"));
  4063. this.blackAni = (this.getChild("blackAni"));
  4064. this.selfTurn = (this.getChild("selfTurn"));
  4065. this.aiTurn = (this.getChild("aiTurn"));
  4066. this.deskNode = (this.getChild("deskNode"));
  4067. this.moveNode = (this.getChild("moveNode"));
  4068. this.selfTalk = (this.getChild("selfTalk"));
  4069. this.aiTalk = (this.getChild("aiTalk"));
  4070. this.d2Node = (this.getChild("d2Node"));
  4071. this.snowNode = (this.getChild("snowNode"));
  4072. this.guide2 = (this.getChild("guide2"));
  4073. this.guide1 = (this.getChild("guide1"));
  4074. this.guide3 = (this.getChild("guide3"));
  4075. this.guideNode = (this.getChild("guideNode"));
  4076. }
  4077. }
  4078. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4079. class ui_UIGameEnd extends fgui.GComponent {
  4080. static createInstance() {
  4081. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4082. }
  4083. onConstruct() {
  4084. this.c1 = this.getController("c1");
  4085. this.n22 = (this.getChild("n22"));
  4086. this.n2 = (this.getChild("n2"));
  4087. this.n52 = (this.getChild("n52"));
  4088. this.n53 = (this.getChild("n53"));
  4089. this.coinNode = (this.getChild("coinNode"));
  4090. this.closeNode = (this.getChild("closeNode"));
  4091. this.moneyNode = (this.getChild("moneyNode"));
  4092. this.secretary = (this.getChild("secretary"));
  4093. this.n27 = (this.getChild("n27"));
  4094. this.n29 = (this.getChild("n29"));
  4095. this.talkNode = (this.getChild("talkNode"));
  4096. this.n38 = (this.getChild("n38"));
  4097. this.n39 = (this.getChild("n39"));
  4098. this.n40 = (this.getChild("n40"));
  4099. this.awardNode = (this.getChild("awardNode"));
  4100. this.starNumNode = (this.getChild("starNumNode"));
  4101. this.n47 = (this.getChild("n47"));
  4102. this.conditionNode = (this.getChild("conditionNode"));
  4103. this.isGetAward = (this.getChild("isGetAward"));
  4104. this.leftBtn = (this.getChild("leftBtn"));
  4105. this.rightBtn = (this.getChild("rightBtn"));
  4106. this.btnNode = (this.getChild("btnNode"));
  4107. }
  4108. }
  4109. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4110. class ui_UIAddCoin extends fgui.GComponent {
  4111. static createInstance() {
  4112. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4113. }
  4114. onConstruct() {
  4115. this.n11 = (this.getChild("n11"));
  4116. this.myNode = (this.getChild("myNode"));
  4117. this.t0 = this.getTransition("t0");
  4118. }
  4119. }
  4120. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4121. class UIAddCoin extends UIBase {
  4122. constructor() {
  4123. super();
  4124. this.coinNum = 2000;
  4125. }
  4126. onConstructor() {
  4127. this.ui = ui_UIAddCoin.createInstance();
  4128. this.contentPane = this.ui;
  4129. this.isEject = false;
  4130. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4131. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4132. }
  4133. show() {
  4134. super.show();
  4135. this.ui.t0.play();
  4136. }
  4137. videoAddCoin() {
  4138. console.log('zh:qjff_AD_for_UIAddCoin');
  4139. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4140. }
  4141. else {
  4142. console.log('zh:AD 失败,直接发放奖励');
  4143. this.qjff_AD_for_UIAddCoin();
  4144. }
  4145. }
  4146. qjff_AD_for_UIAddCoin() {
  4147. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4148. this.hide();
  4149. }
  4150. }
  4151. UIAddCoin.uiName = "UIAddCoin";
  4152. class ui_UIInvitation extends fgui.GComponent {
  4153. static createInstance() {
  4154. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4155. }
  4156. onConstruct() {
  4157. this.n14 = (this.getChild("n14"));
  4158. this.myNode = (this.getChild("myNode"));
  4159. this.t0 = this.getTransition("t0");
  4160. }
  4161. }
  4162. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4163. class UIInvitation extends UIBase {
  4164. constructor() {
  4165. super();
  4166. }
  4167. onConstructor() {
  4168. this.ui = ui_UIInvitation.createInstance();
  4169. this.contentPane = this.ui;
  4170. this.isEject = false;
  4171. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4172. }
  4173. show() {
  4174. super.show();
  4175. }
  4176. enterGame() {
  4177. xGame.common.gameMode = GameMode.classic;
  4178. DataMgr.setChallengeTimes(1);
  4179. xGame.common.passAwardCoin = 2000;
  4180. let need = xGame.common.classicNiceNeddCoin;
  4181. if (DataMgr.coinEnough(need)) {
  4182. DataMgr.setCoin(-need);
  4183. xGame.eventMgr.event(RESTART_GAME, true);
  4184. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4185. }
  4186. else {
  4187. xGame.eventMgr.event(RESTART_GAME, true);
  4188. }
  4189. this.hide();
  4190. }
  4191. hide() {
  4192. super.hide();
  4193. }
  4194. }
  4195. UIInvitation.uiName = "UIInvitation";
  4196. class ui_UIMain extends fgui.GComponent {
  4197. static createInstance() {
  4198. return (fgui.UIPackage.createObject("game", "UIMain"));
  4199. }
  4200. onConstruct() {
  4201. this.n47 = (this.getChild("n47"));
  4202. this.n10 = (this.getChild("n10"));
  4203. this.secretary = (this.getChild("secretary"));
  4204. this.shopBtn = (this.getChild("shopBtn"));
  4205. this.moneyNode = (this.getChild("moneyNode"));
  4206. this.headNode = (this.getChild("headNode"));
  4207. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4208. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4209. this.classicBtn = (this.getChild("classicBtn"));
  4210. this.globalBtn = (this.getChild("globalBtn"));
  4211. this.n44 = (this.getChild("n44"));
  4212. this.signBtn = (this.getChild("signBtn"));
  4213. this.drawBtn = (this.getChild("drawBtn"));
  4214. this.settingNode = (this.getChild("settingNode"));
  4215. this.n45 = (this.getChild("n45"));
  4216. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4217. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4218. this.rankBtn = (this.getChild("rankBtn"));
  4219. this.n46 = (this.getChild("n46"));
  4220. this.liucheng1 = (this.getChild("liucheng1"));
  4221. this.rightBtn = (this.getChild("rightBtn"));
  4222. this.n75 = (this.getChild("n75"));
  4223. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4224. this.liucheng2 = (this.getChild("liucheng2"));
  4225. this.guideBtn = (this.getChild("guideBtn"));
  4226. this.n73 = (this.getChild("n73"));
  4227. this.wordsNode = (this.getChild("wordsNode"));
  4228. this.enterGuide = (this.getChild("enterGuide"));
  4229. this.talkNode = (this.getChild("talkNode"));
  4230. this.n83 = (this.getChild("n83"));
  4231. this.n84 = (this.getChild("n84"));
  4232. }
  4233. }
  4234. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4235. class ui_UIMoyu extends fgui.GComponent {
  4236. static createInstance() {
  4237. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4238. }
  4239. onConstruct() {
  4240. this.ageTip = (this.getChild("ageTip"));
  4241. this.mainBg = (this.getChild("mainBg"));
  4242. this.xyNode = (this.getChild("xyNode"));
  4243. this.rnNode = (this.getChild("rnNode"));
  4244. this.fcmNode = (this.getChild("fcmNode"));
  4245. this.ageNode = (this.getChild("ageNode"));
  4246. this.tipNode = (this.getChild("tipNode"));
  4247. this.msgNode = (this.getChild("msgNode"));
  4248. }
  4249. }
  4250. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4251. class MoyuMgr {
  4252. static initMoyu() {
  4253. this.moyuView = new MoyuView();
  4254. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4255. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4256. this.moyuView.ui.displayObject.zOrder = 1000;
  4257. this.moyuView.init();
  4258. this.moyuView.showTip(true);
  4259. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4260. window['XApk'] = this;
  4261. }
  4262. static showAge(show) {
  4263. if (this.moyuView)
  4264. this.moyuView.showAge(show);
  4265. }
  4266. static onPlatMsg(idx) {
  4267. if (!MoyuMgr.moyuView)
  4268. return;
  4269. if (idx == '0') {
  4270. MoyuMgr.moyuView.showTip(false);
  4271. }
  4272. }
  4273. static showAgree(call) {
  4274. if (this.moyuView)
  4275. this.moyuView.showAgree(call);
  4276. else
  4277. call && call();
  4278. }
  4279. static showXy(type = 1) {
  4280. if (this.moyuView)
  4281. this.moyuView.showXy(type);
  4282. }
  4283. }
  4284. MoyuMgr.isAdvise = false;
  4285. class MoyuView {
  4286. constructor() {
  4287. this.ysxyNum = 1;
  4288. this.ysJson = null;
  4289. this.ui = ui_UIMoyu.createInstance();
  4290. }
  4291. init() {
  4292. this.ui.mainBg.visible = false;
  4293. this.ui.xyNode.visible = false;
  4294. this.ui.ageNode.visible = false;
  4295. this.ui.tipNode.visible = false;
  4296. this.ui.rnNode.visible = false;
  4297. this.ui.fcmNode.visible = false;
  4298. this.ui.ageTip.visible = false;
  4299. this.ui.msgNode.visible = false;
  4300. this.ui.visible = false;
  4301. this.ui.xyNode.xyList.setVirtual();
  4302. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4303. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4304. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4305. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4306. this.ui.xyNode.btnKnown.visible = false;
  4307. this.ui.xyNode.xy1.visible = false;
  4308. this.ui.xyNode.xy2.visible = false;
  4309. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4310. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4311. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4312. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4313. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4314. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4315. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4316. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4317. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4318. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4319. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4320. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4321. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4322. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4323. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4324. this.ysxyNum = 2;
  4325. }
  4326. }
  4327. onClick(obj) {
  4328. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4329. switch (obj) {
  4330. case this.ui.ageTip:
  4331. if (Moyu.isTTApk) {
  4332. this.ui.ageNode.visible = true;
  4333. this.ui.mainBg.visible = true;
  4334. }
  4335. break;
  4336. case this.ui.tipNode:
  4337. this.showTip(false);
  4338. break;
  4339. case this.ui.ageNode.btnAge:
  4340. this.ui.ageNode.visible = false;
  4341. this.ui.mainBg.visible = false;
  4342. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4343. this.ui.visible = false;
  4344. break;
  4345. case this.ui.xyNode.btnXy3:
  4346. case this.ui.xyNode.btnXy1:
  4347. this.loadXy(1);
  4348. break;
  4349. case this.ui.xyNode.btnXy2:
  4350. this.loadXy(2);
  4351. break;
  4352. case this.ui.xyNode.btnBack:
  4353. this.ui.xyNode.xy1.visible = true;
  4354. this.ui.xyNode.xy2.visible = false;
  4355. break;
  4356. case this.ui.xyNode.btnKnown:
  4357. this.ui.xyNode.visible = false;
  4358. this.ui.mainBg.visible = false;
  4359. this.ui.visible = false;
  4360. break;
  4361. case this.ui.rnNode.btnCheck:
  4362. this.check();
  4363. break;
  4364. case this.ui.rnNode.btnExit:
  4365. case this.ui.xyNode.btnNo:
  4366. this.ysxyNum--;
  4367. if (this.ysxyNum > 0)
  4368. this.showMsg("Refuse to quit the game once again");
  4369. else {
  4370. Moyu.userAgree(false);
  4371. Moyu.exit();
  4372. }
  4373. break;
  4374. case this.ui.xyNode.btnSure:
  4375. case this.ui.xyNode.btnYes:
  4376. DataMgr.userData.isAgree = true;
  4377. DataMgr.saveUserData();
  4378. this.onAgree();
  4379. break;
  4380. case this.ui.rnNode.btnDone:
  4381. this.ui.rnNode.visible = false;
  4382. this.ui.visible = false;
  4383. break;
  4384. case this.ui.fcmNode.btnRn:
  4385. this.showRn();
  4386. break;
  4387. }
  4388. }
  4389. showTip(show) {
  4390. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4391. return;
  4392. if (show) {
  4393. MoyuMgr.isAdvise = true;
  4394. this.ui.visible = true;
  4395. this.ui.tipNode.visible = true;
  4396. this.ui.tipNode.alpha = 1;
  4397. Laya.timer.once(1000, this, this.showTip, [false]);
  4398. }
  4399. else {
  4400. this.ui.tipNode.alpha = 1;
  4401. this.ui.tipNode.visible = true;
  4402. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4403. this.ui.tipNode.visible = false;
  4404. MoyuMgr.isAdvise = false;
  4405. }), 1000);
  4406. }
  4407. }
  4408. showAge(show, px = 0, py = 0) {
  4409. if (Moyu.platType > 10 && !Moyu.isIos) {
  4410. this.ui.ageTip.x = px;
  4411. this.ui.ageTip.y = py;
  4412. this.ui.ageTip.visible = show;
  4413. if (show)
  4414. this.ui.visible = true;
  4415. }
  4416. }
  4417. showAgree(call) {
  4418. this.agreeCall = call;
  4419. this.onAgree();
  4420. return;
  4421. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4422. this.showXy(0);
  4423. }
  4424. else
  4425. this.onAgree();
  4426. }
  4427. onAgree() {
  4428. if (!this.ui.ageNode.visible)
  4429. this.ui.visible = false;
  4430. this.ui.xyNode.visible = false;
  4431. Moyu.userAgree(true);
  4432. this.showAge(false);
  4433. this.agreeCall && this.agreeCall();
  4434. this.showRn();
  4435. }
  4436. showMsg(txt) {
  4437. this.ui.msgNode.txtMsg.text = txt;
  4438. this.ui.msgNode.visible = true;
  4439. this.ui.msgNode.alpha = 1;
  4440. this.ui.visible = true;
  4441. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4442. this.ui.msgNode.visible = false;
  4443. }), 2500, true);
  4444. }
  4445. showRn() {
  4446. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4447. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4448. this.ui.rnNode.rn1.visible = true;
  4449. this.ui.rnNode.rn2.visible = false;
  4450. this.ui.rnNode.rn3.visible = false;
  4451. this.ui.rnNode.rn4.visible = false;
  4452. this.ui.rnNode.visible = true;
  4453. this.ui.mainBg.visible = true;
  4454. this.ui.rnNode.btnDone.visible = false;
  4455. this.ui.rnNode.btnExit.visible = true;
  4456. this.ui.rnNode.btnCheck.visible = true;
  4457. this.ui.fcmNode.visible = false;
  4458. this.ui.visible = true;
  4459. return;
  4460. }
  4461. }
  4462. this.showFcm();
  4463. }
  4464. showFcm() {
  4465. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4466. Moyu.initFCM(true);
  4467. if (Moyu.gameTime < 1)
  4468. this.fcmLoop();
  4469. else if (Moyu.gameTime < 999)
  4470. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4471. }
  4472. }
  4473. fcmLoop() {
  4474. if (Moyu.gameTime < 1) {
  4475. this.ui.rnNode.visible = false;
  4476. this.ui.fcmNode.visible = true;
  4477. this.ui.mainBg.visible = true;
  4478. this.ui.visible = true;
  4479. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4480. Laya.timer.clear(this.ui, this.fcmLoop);
  4481. }
  4482. }
  4483. check() {
  4484. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4485. this.ui.rnNode.rn1.visible = false;
  4486. this.ui.rnNode.rn2.visible = false;
  4487. this.ui.rnNode.rn4.visible = true;
  4488. }
  4489. else if (this.ui.rnNode.rn4.visible) {
  4490. let name = this.ui.rnNode.inputName.text;
  4491. let code = this.ui.rnNode.inputCode.text;
  4492. if (code && code.length == 18) {
  4493. this.ui.rnNode.rn1.visible = false;
  4494. this.ui.rnNode.rn4.visible = false;
  4495. Moyu.authenticate(name, code, (res) => {
  4496. this.ui.rnNode.rn2.visible = !res;
  4497. this.ui.rnNode.rn3.visible = res;
  4498. this.ui.rnNode.btnDone.visible = res;
  4499. this.ui.rnNode.btnExit.visible = !res;
  4500. this.ui.rnNode.btnCheck.visible = !res;
  4501. if (res)
  4502. this.showFcm();
  4503. });
  4504. }
  4505. else
  4506. this.showMsg("信息填写不完整");
  4507. }
  4508. }
  4509. loadXy(type = 0) {
  4510. this.ui.xyNode.xy1.visible = false;
  4511. this.ui.xyNode.xy2.visible = true;
  4512. this.ui.xyNode.xyList.scrollToView(0);
  4513. if (type == 1) {
  4514. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4515. }
  4516. else if (type == 2) {
  4517. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4518. }
  4519. }
  4520. showXy(type = 0) {
  4521. this.xyBtn();
  4522. if (type == 0) {
  4523. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4524. this.ui.xyNode.btnSure.visible = true;
  4525. }
  4526. else {
  4527. this.ui.xyNode.btnYes.visible = true;
  4528. this.ui.xyNode.btnNo.visible = true;
  4529. }
  4530. }
  4531. else {
  4532. this.ui.xyNode.btnKnown.visible = true;
  4533. this.ui.mainBg.visible = true;
  4534. }
  4535. this.ui.xyNode.xy1.visible = true;
  4536. this.ui.xyNode.xy2.visible = false;
  4537. this.ui.xyNode.visible = true;
  4538. this.ui.visible = true;
  4539. }
  4540. xyBtn() {
  4541. this.ui.xyNode.btnSure.visible = false;
  4542. this.ui.xyNode.btnYes.visible = false;
  4543. this.ui.xyNode.btnNo.visible = false;
  4544. this.ui.xyNode.btnKnown.visible = false;
  4545. {
  4546. this.ui.xyNode.btnXy3.visible = false;
  4547. this.ui.xyNode.btnXy2.visible = true;
  4548. this.ui.xyNode.btnXy1.visible = true;
  4549. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4550. }
  4551. }
  4552. createXY(json) {
  4553. this.ysJson = json.content;
  4554. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4555. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4556. this.ui.xyNode.xy2.visible = true;
  4557. }
  4558. renderListItem(idx, cell) {
  4559. let xy = this.ysJson[idx];
  4560. cell.height = xy.line * 30;
  4561. cell.xyItem.text = xy.text;
  4562. }
  4563. onDestroy() {
  4564. this.agreeCall = null;
  4565. }
  4566. }
  4567. class SettingNode {
  4568. constructor(ui) {
  4569. this.showSetting = false;
  4570. this.openSound = true;
  4571. this.openShake = true;
  4572. this.ui = ui;
  4573. this.ui.soundBtn.onClick(this, this.switchSound);
  4574. this.ui.shakeBtn.onClick(this, this.switchShake);
  4575. this.ui.xyBtn.onClick(this, this.onXy);
  4576. this.ui.clickNode.onClick(this, this.changeSetting);
  4577. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4578. this.ui.xyBtn.visible = false;
  4579. this.ui.shakeBtn.visible = false;
  4580. }
  4581. changeSetting() {
  4582. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4583. this.showSetting = !this.showSetting;
  4584. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4585. }
  4586. switchSound() {
  4587. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4588. this.openSound = !this.openSound;
  4589. Moyu.onSetting(this.openSound, this.openShake);
  4590. xGame.soundMgr.onSetting(this.openSound);
  4591. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4592. }
  4593. switchShake() {
  4594. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4595. this.openShake = !this.openShake;
  4596. Moyu.onSetting(this.openSound, this.openShake);
  4597. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4598. }
  4599. onXy() {
  4600. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4601. MoyuMgr.showXy(1);
  4602. }
  4603. }
  4604. class ui_UILevelDisplay extends fgui.GComponent {
  4605. static createInstance() {
  4606. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4607. }
  4608. onConstruct() {
  4609. this.n9 = (this.getChild("n9"));
  4610. this.myNode = (this.getChild("myNode"));
  4611. this.closeNode = (this.getChild("closeNode"));
  4612. }
  4613. }
  4614. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4615. class ui_UILevelProp extends fgui.GComponent {
  4616. static createInstance() {
  4617. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4618. }
  4619. onConstruct() {
  4620. this.n16 = (this.getChild("n16"));
  4621. this.myNode = (this.getChild("myNode"));
  4622. this.closeBtn = (this.getChild("closeBtn"));
  4623. this.moneyNode = (this.getChild("moneyNode"));
  4624. this.t1 = this.getTransition("t1");
  4625. }
  4626. }
  4627. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4628. class ui_ShowItem extends fgui.GComponent {
  4629. static createInstance() {
  4630. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4631. }
  4632. onConstruct() {
  4633. this.myImg = (this.getChild("myImg"));
  4634. }
  4635. }
  4636. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4637. class ShowItem {
  4638. constructor() {
  4639. this.ui = ui_ShowItem.createInstance();
  4640. }
  4641. destroySelf() {
  4642. if (!this.ui.isDisposed) {
  4643. this.ui.removeFromParent();
  4644. this.ui.dispose();
  4645. }
  4646. }
  4647. setParent(parent) {
  4648. parent.addChild(this.ui);
  4649. }
  4650. setPos(x, y) {
  4651. this.ui.x = x;
  4652. this.ui.y = y;
  4653. }
  4654. setUrl(index) {
  4655. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4656. }
  4657. }
  4658. class ui_UIPower extends fgui.GComponent {
  4659. static createInstance() {
  4660. return (fgui.UIPackage.createObject("game", "UIPower"));
  4661. }
  4662. onConstruct() {
  4663. this.n11 = (this.getChild("n11"));
  4664. this.myNode = (this.getChild("myNode"));
  4665. this.t0 = this.getTransition("t0");
  4666. }
  4667. }
  4668. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4669. class UIPower extends UIBase {
  4670. constructor() {
  4671. super();
  4672. }
  4673. onConstructor() {
  4674. this.ui = ui_UIPower.createInstance();
  4675. this.contentPane = this.ui;
  4676. this.isEject = false;
  4677. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4678. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4679. }
  4680. show() {
  4681. super.show();
  4682. this.ui.t0.play();
  4683. }
  4684. videoGetPower() {
  4685. console.log('zh:qjff_AD_for_uipower');
  4686. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4687. }
  4688. else {
  4689. console.log('zh:AD 失败,直接发放奖励');
  4690. this.qjff_AD_for_uipower();
  4691. }
  4692. }
  4693. qjff_AD_for_uipower() {
  4694. DataMgr.setPower(xGame.common.videoPower, true);
  4695. xGame.eventMgr.event(POWER_TIME);
  4696. this.hide();
  4697. }
  4698. }
  4699. UIPower.uiName = "UIPower";
  4700. class UILevelProp extends UIBase {
  4701. constructor() {
  4702. super();
  4703. this.firstPos = 385;
  4704. this.secondPos = 467;
  4705. this.showItemArr = [];
  4706. }
  4707. onFontLoaded() {
  4708. try {
  4709. this.ui.myNode.conditionTxt.font = "arial";
  4710. console.log("zh: onFontLoaded 设置arial字体成功");
  4711. }
  4712. catch (error) {
  4713. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4714. }
  4715. }
  4716. onConstructor() {
  4717. this.ui = ui_UILevelProp.createInstance();
  4718. this.contentPane = this.ui;
  4719. this.isEject = false;
  4720. this.addUIClick(this.ui.closeBtn, this.hide);
  4721. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4722. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4723. }
  4724. show(level) {
  4725. super.show();
  4726. this.ui.t1.play();
  4727. this.level = level;
  4728. this.data = cfgTable.placeballData[this.level];
  4729. this.updateSelf();
  4730. this.showPreView();
  4731. this.moneyNode.ui.c1.selectedIndex = 2;
  4732. this.moneyNode.checkPowerTime();
  4733. this.moneyNode.powerChange();
  4734. }
  4735. showPreView() {
  4736. let item;
  4737. let data;
  4738. for (let index = 0; index < this.showItemArr.length; index++) {
  4739. item = this.showItemArr[index];
  4740. item.destroySelf();
  4741. }
  4742. this.showItemArr = [];
  4743. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4744. for (const key in cfgData) {
  4745. data = cfgData[key];
  4746. item = new ShowItem();
  4747. item.setParent(this.ui.myNode.displayRoot);
  4748. item.setPos(data.x, data.y);
  4749. item.setUrl(data.value);
  4750. this.showItemArr.push(item);
  4751. }
  4752. }
  4753. updateSelf() {
  4754. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4755. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4756. if (this.data.ball == -1) {
  4757. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4758. }
  4759. else {
  4760. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4761. }
  4762. let localData = DataMgr.getPlaceBallLevel(this.level);
  4763. let getAward = localData.getAward;
  4764. let cfg = cfgTable.placeballData[this.level];
  4765. let coin = this.data.award[0];
  4766. let diamond = this.data.award[1];
  4767. if (cfg.type == PlaceBallType.challenge) {
  4768. diamond = 0;
  4769. coin = 100;
  4770. }
  4771. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4772. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4773. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4774. if (cfg.type == PlaceBallType.challenge) {
  4775. this.ui.myNode.coinNode.numTxt.text = "";
  4776. }
  4777. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4778. if (coin > 0 && diamond > 0) {
  4779. this.ui.myNode.diamondNode.x = 385;
  4780. this.ui.myNode.coinNode.x = 467;
  4781. }
  4782. else {
  4783. this.ui.myNode.diamondNode.x = 385;
  4784. this.ui.myNode.coinNode.x = 385;
  4785. }
  4786. if (!getAward) {
  4787. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4788. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4789. }
  4790. else {
  4791. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4792. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4793. }
  4794. }
  4795. startGame() {
  4796. if (DataMgr.powerEnough()) {
  4797. this.ui.myNode.startBtn.touchable = false;
  4798. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4799. console.log('zh:startGame ');
  4800. this.ui.myNode.startBtn.touchable = true;
  4801. DataMgr.setPower(-1);
  4802. xGame.eventMgr.event(POWER_TIME);
  4803. xGame.common.gameMode = GameMode.placeBall;
  4804. xGame.common.placeBallCurLevel = this.level;
  4805. xGame.uiMgr.Show(UIGame);
  4806. xGame.uiMgr.Hide(UILevelDisplay);
  4807. xGame.uiMgr.Hide(UIMain);
  4808. this.hide();
  4809. }));
  4810. }
  4811. else {
  4812. console.log('zh:startGame no power');
  4813. xGame.uiMgr.Show(UIPower);
  4814. }
  4815. }
  4816. hide() {
  4817. super.hide();
  4818. }
  4819. }
  4820. UILevelProp.uiName = "UILevelProp";
  4821. class PutBallLevelDisplay {
  4822. constructor(ui, index) {
  4823. this.index = 0;
  4824. this.ui = ui;
  4825. this.index = index;
  4826. this.ui.onClick(this, this.clickSelf);
  4827. this.updateSelf();
  4828. this.ui.levelTxt.text = (this.index + 1) + "";
  4829. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4830. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4831. }
  4832. updateSelf() {
  4833. let level = this.index + 1;
  4834. this.data = DataMgr.getPlaceBallLevel(level);
  4835. this.ui.starNode.c1.selectedIndex = this.data.star;
  4836. let isChallenge = cfgTable.placeballData[level].type;
  4837. if (this.data.isCur) {
  4838. if (isChallenge) {
  4839. this.ui.c1.selectedIndex = 5;
  4840. }
  4841. else {
  4842. this.ui.c1.selectedIndex = 2;
  4843. }
  4844. }
  4845. else {
  4846. if (this.data.play) {
  4847. if (this.data.star == 3) {
  4848. this.ui.c1.selectedIndex = 0;
  4849. }
  4850. else {
  4851. this.ui.c1.selectedIndex = 1;
  4852. }
  4853. }
  4854. else {
  4855. if (isChallenge) {
  4856. this.ui.c1.selectedIndex = 4;
  4857. }
  4858. else {
  4859. this.ui.c1.selectedIndex = 3;
  4860. }
  4861. }
  4862. }
  4863. }
  4864. clickSelf() {
  4865. if (!this.data.play)
  4866. return;
  4867. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4868. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4869. }
  4870. }
  4871. class UILevelDisplay extends UIBase {
  4872. constructor() {
  4873. super();
  4874. }
  4875. onConstructor() {
  4876. this.ui = ui_UILevelDisplay.createInstance();
  4877. this.contentPane = this.ui;
  4878. this.isEject = false;
  4879. this.myList = this.ui.myNode.myList;
  4880. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4881. this.levelItemArr = [];
  4882. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4883. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4884. this.myList.numItems = levelNum;
  4885. if (Moyu.isKs)
  4886. this.ui.closeNode.closeBtn.x += 100;
  4887. }
  4888. levelItemRender(index, target) {
  4889. let item = new PutBallLevelDisplay(target, index);
  4890. this.levelItemArr.push(item);
  4891. }
  4892. show() {
  4893. super.show();
  4894. this.updateLevel();
  4895. this.scrollToPlace();
  4896. }
  4897. updateLevel() {
  4898. let temp;
  4899. for (let index = 0; index < this.levelItemArr.length; index++) {
  4900. temp = this.levelItemArr[index];
  4901. temp.updateSelf();
  4902. }
  4903. }
  4904. scrollToPlace() {
  4905. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4906. let passArr = DataMgr.getPlaceBallLevelList();
  4907. let offest = passArr.length;
  4908. if (offest >= maxNum - 1)
  4909. offest = maxNum - 1;
  4910. this.myList.scrollToView(offest, true, true);
  4911. }
  4912. hide() {
  4913. super.hide();
  4914. }
  4915. }
  4916. UILevelDisplay.uiName = "UILevelDisplay";
  4917. class ui_UIMatching extends fgui.GComponent {
  4918. static createInstance() {
  4919. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4920. }
  4921. onConstruct() {
  4922. this.n5 = (this.getChild("n5"));
  4923. this.n49 = (this.getChild("n49"));
  4924. this.n51 = (this.getChild("n51"));
  4925. this.n64 = (this.getChild("n64"));
  4926. this.n2 = (this.getChild("n2"));
  4927. this.n53 = (this.getChild("n53"));
  4928. this.n54 = (this.getChild("n54"));
  4929. this.n56 = (this.getChild("n56"));
  4930. this.n58 = (this.getChild("n58"));
  4931. this.n59 = (this.getChild("n59"));
  4932. this.n57 = (this.getChild("n57"));
  4933. this.n60 = (this.getChild("n60"));
  4934. this.n62 = (this.getChild("n62"));
  4935. this.awardTxt = (this.getChild("awardTxt"));
  4936. this.n61 = (this.getChild("n61"));
  4937. this.selfHead = (this.getChild("selfHead"));
  4938. this.aiHead = (this.getChild("aiHead"));
  4939. this.n82 = (this.getChild("n82"));
  4940. this.n84 = (this.getChild("n84"));
  4941. this.n83 = (this.getChild("n83"));
  4942. this.t1 = this.getTransition("t1");
  4943. this.t2 = this.getTransition("t2");
  4944. this.t3 = this.getTransition("t3");
  4945. this.t4 = this.getTransition("t4");
  4946. }
  4947. }
  4948. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4949. class UIMatching extends UIBase {
  4950. constructor() {
  4951. super();
  4952. }
  4953. onConstructor() {
  4954. this.ui = ui_UIMatching.createInstance();
  4955. this.contentPane = this.ui;
  4956. this.isEject = false;
  4957. }
  4958. show(callback) {
  4959. super.show();
  4960. PlatMgr.showBanner(true);
  4961. this.callback = callback;
  4962. let user = Moyu.getUserInfo();
  4963. if (!this.selfPot) {
  4964. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4965. }
  4966. if (!this.aiPot) {
  4967. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4968. }
  4969. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4970. this.ui.selfHead.nameTxt.text = user.nickName;
  4971. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4972. this.ui.aiHead.nameTxt.text = "???";
  4973. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4974. this.ui.selfHead.c1.selectedIndex = 0;
  4975. this.ui.aiHead.c1.selectedIndex = 0;
  4976. this.ui.selfHead.x = this.selfPot.x;
  4977. this.ui.selfHead.y = this.selfPot.y;
  4978. this.ui.aiHead.x = this.aiPot.x;
  4979. this.ui.aiHead.y = this.aiPot.y;
  4980. switch (xGame.common.gameMode) {
  4981. case GameMode.classic:
  4982. break;
  4983. case GameMode.bigMove:
  4984. this.initSkillData();
  4985. break;
  4986. default:
  4987. break;
  4988. }
  4989. this.ui.t1.play(Laya.Handler.create(this, () => {
  4990. this.ui.t2.play(Laya.Handler.create(this, () => {
  4991. switch (xGame.common.gameMode) {
  4992. case GameMode.classic:
  4993. this.waitingPeople();
  4994. break;
  4995. case GameMode.bigMove:
  4996. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4997. break;
  4998. default:
  4999. break;
  5000. }
  5001. }));
  5002. }));
  5003. }
  5004. initSkillData() {
  5005. this.skillSelectData = [];
  5006. let skillUrl = xGame.common.skillIconList;
  5007. let skillName = xGame.common.skillNameList;
  5008. let skillLevel = DataMgr.getBigSkillList();
  5009. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5010. for (let index = 0; index < 5; index++) {
  5011. let obj = {};
  5012. obj.skillImg = skillUrl[index];
  5013. obj.skillName = skillName[index];
  5014. obj.skillType = skillType[index];
  5015. obj.skillLevel = skillLevel[index];
  5016. this.skillSelectData.push(obj);
  5017. }
  5018. }
  5019. getAISkillLevel(myLevel) {
  5020. let video = xGame.common.upSkillLevel;
  5021. let aiLevel;
  5022. let temp;
  5023. if (video) {
  5024. temp = xGame.common.randomNum(-2, -1);
  5025. }
  5026. else {
  5027. if (myLevel <= 5) {
  5028. temp = xGame.common.randomNum(1, 3);
  5029. }
  5030. else if (myLevel <= 9) {
  5031. temp = xGame.common.randomNum(-2, 1);
  5032. }
  5033. else {
  5034. temp = xGame.common.randomNum(-4, 0);
  5035. }
  5036. }
  5037. aiLevel = temp + myLevel;
  5038. if (aiLevel <= 1)
  5039. aiLevel = 1;
  5040. if (aiLevel >= 10)
  5041. aiLevel = 10;
  5042. return aiLevel;
  5043. }
  5044. getAISkillType() {
  5045. return xGame.common.randomNum(1, 4);
  5046. let successTimes = DataMgr.getSkillSuccessTimes();
  5047. let info = cfgTable.aiskillData[successTimes];
  5048. if (!info) {
  5049. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5050. info = cfgTable.aiskillData[max];
  5051. }
  5052. let dataArr = info.skillselect;
  5053. let myCfg = {};
  5054. for (let index = 0; index < dataArr.length; index++) {
  5055. let temp = dataArr[index].split('-');
  5056. myCfg[temp[0]] = {};
  5057. myCfg[temp[0]].id = parseInt(temp[0]);
  5058. myCfg[temp[0]].weight = parseInt(temp[1]);
  5059. }
  5060. let aiCfg = xGame.common.initWeight(myCfg);
  5061. let curData = xGame.common.getRandomWeightData(aiCfg);
  5062. return parseInt(curData.id);
  5063. }
  5064. getAISkillData(index) {
  5065. let myLevel = this.skillSelectData[index].skillLevel;
  5066. let aiLevel = this.getAISkillLevel(myLevel);
  5067. let aiType = this.getAISkillType() - 1;
  5068. return { aiLevel, aiType } = { aiLevel, aiType };
  5069. }
  5070. skillSelectFinish(index) {
  5071. let aiInfo = this.getAISkillData(index);
  5072. xGame.common.gameMgr.selfCurSkill = index;
  5073. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5074. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5075. this.ui.selfHead.c1.selectedIndex = 1;
  5076. this.ui.aiHead.c1.selectedIndex = 1;
  5077. let myData = this.skillSelectData[index];
  5078. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5079. let guide = DataMgr.getSkillGuide();
  5080. if (guide == 0) {
  5081. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5082. }
  5083. else {
  5084. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5085. }
  5086. let aiData = this.skillSelectData[aiInfo.aiType];
  5087. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5088. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5089. this.waitingPeople();
  5090. }
  5091. waitingPeople() {
  5092. let time = xGame.common.randomNum(1000, 3000);
  5093. time += 1000;
  5094. Laya.timer.once(time, this, () => {
  5095. this.matchingSuccess();
  5096. });
  5097. }
  5098. matchingSuccess() {
  5099. let gameUI = xGame.common.gameUI;
  5100. let name = gameUI.ui.topNode.aiNameTxt.text;
  5101. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5102. this.ui.aiHead.nameTxt.text = name;
  5103. this.ui.aiHead.headImg.url = url;
  5104. name = gameUI.ui.topNode.selfNameTxt.text;
  5105. url = gameUI.ui.topNode.selfHeadLoader.url;
  5106. this.ui.selfHead.nameTxt.text = name;
  5107. this.ui.selfHead.headImg.url = url;
  5108. this.ui.t3.play(Laya.Handler.create(this, () => {
  5109. this.callback && this.callback();
  5110. this.ui.t4.play(Laya.Handler.create(this, () => {
  5111. this.destroySelf();
  5112. }));
  5113. }));
  5114. }
  5115. destroySelf() {
  5116. this.callback = null;
  5117. this.skillSelectData = null;
  5118. this.selfPot = null;
  5119. this.aiPot = null;
  5120. if (!this.ui.isDisposed) {
  5121. this.ui.removeFromParent();
  5122. this.ui.dispose();
  5123. }
  5124. xGame.uiMgr.destroyUI(this);
  5125. }
  5126. }
  5127. UIMatching.uiName = "UIMatching";
  5128. class ui_UIRanking extends fgui.GComponent {
  5129. static createInstance() {
  5130. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5131. }
  5132. onConstruct() {
  5133. this.n26 = (this.getChild("n26"));
  5134. this.myNode = (this.getChild("myNode"));
  5135. }
  5136. }
  5137. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5138. class UIRanking extends UIBase {
  5139. constructor() {
  5140. super();
  5141. this.showSelf = true;
  5142. this.rankType = 1;
  5143. this.rankList = [];
  5144. this.myIndex = 0;
  5145. this.myStar = 0;
  5146. }
  5147. onConstructor() {
  5148. this.ui = ui_UIRanking.createInstance();
  5149. this.contentPane = this.ui;
  5150. this.isEject = false;
  5151. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5152. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5153. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5154. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5155. this.ui.myNode.myList.setVirtual();
  5156. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5157. }
  5158. show() {
  5159. super.show();
  5160. this.myIndex = 51;
  5161. Moyu.getRankList({
  5162. rankId: xGame.common.curRankID,
  5163. type: MoyuRankType.total,
  5164. page: 1,
  5165. pageSize: 50,
  5166. }, this, this.updateItemData);
  5167. this.updateSelf();
  5168. let self = Moyu.getUserInfo();
  5169. if (!self.isAuth) {
  5170. Moyu.initUser(this, () => {
  5171. DataMgr.upRankData();
  5172. });
  5173. }
  5174. }
  5175. updateSelfItem() {
  5176. let self = Moyu.getUserInfo();
  5177. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5178. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  5179. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5180. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  5181. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5182. }
  5183. updateItemData(data) {
  5184. this.myStar = xGame.common.getAllStarNum();
  5185. if (this.rankList.length < 2) {
  5186. this.rankList = data;
  5187. let self = Moyu.getUserInfo();
  5188. for (let i = 0; i < data.length; i++) {
  5189. let data = this.rankList[i];
  5190. if (data.userId == self.userId) {
  5191. this.rankList.splice(i, 1);
  5192. break;
  5193. }
  5194. }
  5195. for (let i = 0; i < data.length; i++) {
  5196. let data = this.rankList[i];
  5197. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5198. this.myIndex = i + 1;
  5199. let user = { headIcon: self.headIcon, nickName: "myself" };
  5200. let ud = { user: user, data: {} };
  5201. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5202. if (Moyu.platType < 11) {
  5203. user.headIcon = self.headIcon;
  5204. user.nickName = self.nickName;
  5205. }
  5206. this.rankList.splice(i, 0, md);
  5207. break;
  5208. }
  5209. }
  5210. }
  5211. this.updateSelfItem();
  5212. this.ui.myNode.myList.numItems = this.rankList.length;
  5213. }
  5214. updateItemUI(index, obj) {
  5215. let data = this.rankList[index];
  5216. let userData = JSON.parse(data.userData).user;
  5217. obj.nameTxt.text = userData.nickName.toString();
  5218. obj.valueTxt.text = data.rankScore;
  5219. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5220. obj.rankTxt.text = index + 1;
  5221. switch (index) {
  5222. case 0:
  5223. this.setImg(obj, 1, 0, 0);
  5224. obj.rankTxt.color = "#FFC047";
  5225. break;
  5226. case 1:
  5227. this.setImg(obj, 0, 1, 0);
  5228. obj.rankTxt.color = "#ACACAC";
  5229. break;
  5230. case 2:
  5231. this.setImg(obj, 0, 0, 1);
  5232. obj.rankTxt.color = "#D09672";
  5233. break;
  5234. default:
  5235. this.setImg(obj, 0, 0, 0);
  5236. obj.rankTxt.color = "#496FAB";
  5237. break;
  5238. }
  5239. }
  5240. setImg(obj, a, b, c) {
  5241. obj.img1.visible = a ? true : false;
  5242. obj.img2.visible = b ? true : false;
  5243. obj.img3.visible = c ? true : false;
  5244. }
  5245. changeList(type) {
  5246. this.rankType = type;
  5247. this.updateSelf();
  5248. }
  5249. changeSelfNode() {
  5250. this.showSelf = !this.showSelf;
  5251. this.updateSelf();
  5252. }
  5253. updateSelf() {
  5254. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5255. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5256. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5257. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5258. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5259. }
  5260. }
  5261. UIRanking.uiName = "UIRanking";
  5262. class ui_UISecretary extends fgui.GComponent {
  5263. static createInstance() {
  5264. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5265. }
  5266. onConstruct() {
  5267. this.n0 = (this.getChild("n0"));
  5268. this.myNode = (this.getChild("myNode"));
  5269. this.closeBtn = (this.getChild("closeBtn"));
  5270. this.t0 = this.getTransition("t0");
  5271. }
  5272. }
  5273. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5274. class UISecretary extends UIBase {
  5275. constructor() {
  5276. super();
  5277. this.curIndex = 1;
  5278. }
  5279. onConstructor() {
  5280. this.ui = ui_UISecretary.createInstance();
  5281. this.contentPane = this.ui;
  5282. this.isEject = false;
  5283. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5284. this.nodeObj = { left: null, right: null, cur: null };
  5285. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5286. }
  5287. show() {
  5288. super.show();
  5289. this.ui.t0.play();
  5290. this.updateData();
  5291. }
  5292. addSecretarySpine(node, spineName) {
  5293. if (spineName == "mishu") {
  5294. if (this.secretarySpine1) {
  5295. node.displayObject.destroyChildren();
  5296. this.playWoman(this.secretarySpine1, node.displayObject);
  5297. }
  5298. else {
  5299. let spine1 = new SpineMgr("mishu", () => {
  5300. this.secretarySpine1 = spine1;
  5301. this.playWoman(this.secretarySpine1, node.displayObject);
  5302. });
  5303. }
  5304. }
  5305. else {
  5306. if (this.secretarySpine2) {
  5307. node.displayObject.destroyChildren();
  5308. this.playWoman(this.secretarySpine2, node.displayObject);
  5309. }
  5310. else {
  5311. let spine2 = new SpineMgr("xiaomishu2", () => {
  5312. this.secretarySpine2 = spine2;
  5313. this.playWoman(this.secretarySpine2, node.displayObject);
  5314. });
  5315. }
  5316. }
  5317. }
  5318. playWoman(node, parent) {
  5319. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5320. let yy = this.ui.myNode.gameNode3.secretary.height;
  5321. let scale = 1.5;
  5322. if (node == this.secretarySpine2) {
  5323. scale = 1.2;
  5324. }
  5325. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5326. node.play(data, 0, true, parent);
  5327. }
  5328. turnLeft() {
  5329. this.curIndex--;
  5330. if (this.curIndex < 1) {
  5331. this.curIndex = 2;
  5332. }
  5333. let left = this.nodeObj.left;
  5334. let right = this.nodeObj.right;
  5335. let cur = this.nodeObj.cur;
  5336. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5337. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5338. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5339. this.updateData();
  5340. }));
  5341. this.ui.myNode.setChildIndex(right, 2);
  5342. this.nodeObj.left = cur;
  5343. this.nodeObj.right = left;
  5344. this.nodeObj.cur = right;
  5345. }
  5346. turnRight() {
  5347. this.curIndex++;
  5348. if (this.curIndex > 2) {
  5349. this.curIndex = 1;
  5350. }
  5351. let left = this.nodeObj.left;
  5352. let right = this.nodeObj.right;
  5353. let cur = this.nodeObj.cur;
  5354. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5355. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5356. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5357. this.updateData();
  5358. }));
  5359. this.ui.myNode.setChildIndex(left, 2);
  5360. this.nodeObj.left = right;
  5361. this.nodeObj.right = cur;
  5362. this.nodeObj.cur = left;
  5363. }
  5364. updateData() {
  5365. console.log('zh: updateData FFFFFFFFFF');
  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.visible = false;
  5394. }
  5395. }
  5396. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5397. console.log('zh: 点击了clickSecretary ');
  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. console.log('zh:点击购买了');
  5408. let need = needDiamond;
  5409. if (DataMgr.diamondEnough(need)) {
  5410. DataMgr.setDiamond(-need);
  5411. DataMgr.setSecretary(womanIndex, 1);
  5412. DataMgr.setCurSecretary(womanIndex);
  5413. this.updateData();
  5414. }
  5415. else {
  5416. xGame.uiMgr.Show(UIAddProp, 1);
  5417. }
  5418. }
  5419. }
  5420. closeSelf() {
  5421. this.hide();
  5422. }
  5423. }
  5424. UISecretary.uiName = "UISecretary";
  5425. class ui_UIShop extends fgui.GComponent {
  5426. static createInstance() {
  5427. return (fgui.UIPackage.createObject("game", "UIShop"));
  5428. }
  5429. onConstruct() {
  5430. this.n48 = (this.getChild("n48"));
  5431. this.n0 = (this.getChild("n0"));
  5432. this.secretary = (this.getChild("secretary"));
  5433. this.talkNode = (this.getChild("talkNode"));
  5434. this.closeNode = (this.getChild("closeNode"));
  5435. this.moneyNode = (this.getChild("moneyNode"));
  5436. this.myNode = (this.getChild("myNode"));
  5437. }
  5438. }
  5439. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5440. class BallRodDisplay {
  5441. constructor(ui, index) {
  5442. this.index = 0;
  5443. this.uiIndex = 0;
  5444. this.ui = ui;
  5445. this.index = index;
  5446. this.initData();
  5447. }
  5448. initData() {
  5449. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5450. let data = cfgTable.ballrodData[this.index + 1];
  5451. this.ui.nameTxt.text = data.name;
  5452. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5453. this.ui.levelNode.c1.selectedIndex = data.quality;
  5454. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5455. if (data.spine) {
  5456. this.mySpine = new SpineMgr(data.spine, () => {
  5457. let xx = 150;
  5458. let yy = 70;
  5459. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5460. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5461. });
  5462. }
  5463. }
  5464. updateSelf() {
  5465. console.log('zh:updateSelf -------------- ');
  5466. let get = DataMgr.getBallRod(this.index);
  5467. if (get == null)
  5468. get = 1;
  5469. let curUse = DataMgr.getCurBallRod();
  5470. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5471. if (get) {
  5472. if (curUse == this.index) {
  5473. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5474. }
  5475. else {
  5476. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5477. }
  5478. }
  5479. else {
  5480. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5481. }
  5482. }
  5483. buyBallRod() {
  5484. console.log('zh:buyBallRod eeeeee');
  5485. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5486. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5487. switch (selectedIndex) {
  5488. case 0:
  5489. break;
  5490. case 1:
  5491. console.log('zh:点击了 USE THIS');
  5492. DataMgr.setCurBallRod(this.index);
  5493. let curUse = DataMgr.getCurBallRod();
  5494. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5495. let ui = xGame.uiMgr.getUI(UIShop);
  5496. ui.updateBallRod();
  5497. break;
  5498. case 2:
  5499. let data = cfgTable.ballrodData[this.index + 1];
  5500. let need = data.price;
  5501. if (DataMgr.diamondEnough(need)) {
  5502. DataMgr.setDiamond(-need);
  5503. DataMgr.setBallRod(this.index, 1);
  5504. DataMgr.setCurBallRod(this.index);
  5505. let ui = xGame.uiMgr.getUI(UIShop);
  5506. ui.updateBallRod();
  5507. }
  5508. else {
  5509. xGame.uiMgr.Show(UIAddProp, 1);
  5510. }
  5511. break;
  5512. default:
  5513. break;
  5514. }
  5515. }
  5516. }
  5517. class UIShop extends UIBase {
  5518. constructor() {
  5519. super();
  5520. this.itemNums = 0;
  5521. }
  5522. onConstructor() {
  5523. this.ui = ui_UIShop.createInstance();
  5524. this.contentPane = this.ui;
  5525. this.isEject = false;
  5526. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5527. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5528. this.addUIClick(this.ui, this.interuptSecretary);
  5529. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5530. this.ballRodArr = [];
  5531. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5532. this.ui.myNode.myList.numItems = this.itemNums;
  5533. if (Moyu.isKs)
  5534. this.ui.closeNode.closeBtn.x += 100;
  5535. }
  5536. show() {
  5537. super.show();
  5538. this.playSecretaryIdle();
  5539. this.updateBallRod();
  5540. }
  5541. updateBallRod() {
  5542. for (let index = 0; index < this.ballRodArr.length; index++) {
  5543. this.ballRodArr[index].updateSelf();
  5544. }
  5545. }
  5546. renderBallRod(sort, obj) {
  5547. let index = this.getIndexBySort(sort + 1) - 1;
  5548. let ballRod = new BallRodDisplay(obj, index);
  5549. this.ballRodArr.push(ballRod);
  5550. }
  5551. getIndexBySort(sort) {
  5552. let object = cfgTable.ballrodData;
  5553. for (const key in object) {
  5554. if (object[key].sort == sort) {
  5555. return parseInt(key);
  5556. }
  5557. }
  5558. }
  5559. playSecretaryIdle() {
  5560. let parent = this.ui.secretary.displayObject;
  5561. parent.destroyChildren();
  5562. let xx = this.ui.secretary.width / 2;
  5563. let yy = this.ui.secretary.height;
  5564. let scale = xGame.common.getSecretaryScale();
  5565. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5566. xGame.common.secretary.play(data, 0, true, parent);
  5567. }
  5568. interuptSecretary() {
  5569. Laya.timer.clearAll(this);
  5570. this.playSecretaryRandomSound();
  5571. }
  5572. playSecretaryRandomSound() {
  5573. if (this.isHide)
  5574. return;
  5575. let time = xGame.common.randomNum(45000, 60000);
  5576. Laya.timer.once(time, this, () => {
  5577. if (this.isHide)
  5578. return;
  5579. let index = xGame.common.randomNum(4, 7);
  5580. xGame.soundMgr.playSound("s_main0" + index);
  5581. let words = 1;
  5582. switch (index) {
  5583. case 4:
  5584. words = 5;
  5585. break;
  5586. case 5:
  5587. words = 3;
  5588. break;
  5589. case 6:
  5590. words = 6;
  5591. break;
  5592. case 7:
  5593. words = 7;
  5594. break;
  5595. default:
  5596. break;
  5597. }
  5598. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5599. this.playSecretaryRandomSound();
  5600. });
  5601. }
  5602. closeSelf() {
  5603. this.hide();
  5604. }
  5605. }
  5606. UIShop.uiName = "UIShop";
  5607. class ui_UISign extends fgui.GComponent {
  5608. static createInstance() {
  5609. return (fgui.UIPackage.createObject("game", "UISign"));
  5610. }
  5611. onConstruct() {
  5612. this.n6 = (this.getChild("n6"));
  5613. this.closeNode = (this.getChild("closeNode"));
  5614. this.myNode = (this.getChild("myNode"));
  5615. this.moneyNode = (this.getChild("moneyNode"));
  5616. this.secretary = (this.getChild("secretary"));
  5617. this.talkNode = (this.getChild("talkNode"));
  5618. this.tripleBtn = (this.getChild("tripleBtn"));
  5619. this.normalBtn = (this.getChild("normalBtn"));
  5620. this.tipsNode = (this.getChild("tipsNode"));
  5621. this.againBtn = (this.getChild("againBtn"));
  5622. this.t0 = this.getTransition("t0");
  5623. }
  5624. }
  5625. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5626. class SignMax {
  5627. constructor(ui) {
  5628. this.ui = ui;
  5629. }
  5630. updateSelf(index, sameDay, curDayIndex) {
  5631. let data = cfgTable.signData[index + 1];
  5632. this.ui.titleTxt.text = data.title;
  5633. let arr1 = data.award[0].split('-');
  5634. let arr2 = data.award[1].split('-');
  5635. let num1 = parseInt(arr1[1]);
  5636. let num2 = parseInt(arr2[1]);
  5637. this.ui.numTxt1.text = num1 + "";
  5638. this.ui.numTxt2.text = num2 + "";
  5639. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5640. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5641. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5642. this.ui.numTxt1.visible = false;
  5643. }
  5644. else {
  5645. this.ui.numTxt1.visible = true;
  5646. }
  5647. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5648. this.ui.numTxt2.visible = false;
  5649. }
  5650. else {
  5651. this.ui.numTxt2.visible = true;
  5652. }
  5653. if (index < curDayIndex) {
  5654. this.ui.c1.selectedIndex = 1;
  5655. }
  5656. else if (index == curDayIndex) {
  5657. if (sameDay) {
  5658. this.ui.c1.selectedIndex = 2;
  5659. }
  5660. else {
  5661. this.ui.c1.selectedIndex = 2;
  5662. }
  5663. }
  5664. else {
  5665. this.ui.c1.selectedIndex = 0;
  5666. }
  5667. }
  5668. }
  5669. class SignNormal {
  5670. constructor(ui) {
  5671. this.ui = ui;
  5672. }
  5673. updateSelf(index, sameDay, curDayIndex) {
  5674. let data = cfgTable.signData[index + 1];
  5675. this.ui.titleTxt.text = data.title;
  5676. let arr = data.award[0].split('-');
  5677. let type = parseInt(arr[0]);
  5678. let num = parseInt(arr[1]);
  5679. this.ui.numTxt.text = num + "";
  5680. if (type > 2) {
  5681. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5682. this.ui.myIcon.rotation = 0;
  5683. }
  5684. else {
  5685. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5686. this.ui.myIcon.rotation = 0;
  5687. }
  5688. if (xGame.common.signAwardContainsRod(data.award)) {
  5689. this.ui.numTxt.visible = false;
  5690. }
  5691. else {
  5692. this.ui.numTxt.visible = true;
  5693. }
  5694. if (index < curDayIndex) {
  5695. this.ui.c1.selectedIndex = 1;
  5696. }
  5697. else if (index == curDayIndex) {
  5698. if (sameDay) {
  5699. this.ui.c1.selectedIndex = 2;
  5700. }
  5701. else {
  5702. this.ui.c1.selectedIndex = 2;
  5703. }
  5704. }
  5705. else {
  5706. this.ui.c1.selectedIndex = 0;
  5707. }
  5708. }
  5709. }
  5710. class UISign extends UIBase {
  5711. constructor() {
  5712. super();
  5713. this.curDayIndex = 0;
  5714. this.starX = 0;
  5715. }
  5716. onConstructor() {
  5717. this.ui = ui_UISign.createInstance();
  5718. this.contentPane = this.ui;
  5719. this.isEject = false;
  5720. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5721. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5722. this.initSignItem();
  5723. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5724. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5725. }
  5726. show() {
  5727. super.show();
  5728. this.ui.t0.play();
  5729. this.playSecretaryIdle();
  5730. this.updateSign();
  5731. }
  5732. initSignItem() {
  5733. this.signArr = [];
  5734. for (let index = 0; index < 6; index++) {
  5735. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5736. this.signArr.push(temp);
  5737. }
  5738. this.signMax = new SignMax(this.ui.myNode.day7);
  5739. if (Moyu.isKs)
  5740. this.ui.closeNode.closeBtn.x += 100;
  5741. }
  5742. updateSign() {
  5743. let sameDay = xGame.common.judgeSameDay();
  5744. let max = 7;
  5745. this.curDayIndex = DataMgr.getSignData();
  5746. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5747. this.curDayIndex = 0;
  5748. if (!sameDay) {
  5749. this.ui.normalBtn.visible = true;
  5750. this.ui.tipsNode.visible = false;
  5751. this.ui.againBtn.visible = false;
  5752. }
  5753. else {
  5754. this.ui.normalBtn.visible = false;
  5755. let again = DataMgr.getExtraSign();
  5756. let isCurrency = false;
  5757. let index = this.curDayIndex;
  5758. if (index == 0)
  5759. index = 7;
  5760. let award = cfgTable.signData[index].award;
  5761. let num = award[0].split("-")[0];
  5762. if (num == "1" || num == "2")
  5763. isCurrency = true;
  5764. let showAgain = again == 0 && isCurrency;
  5765. this.ui.againBtn.visible = showAgain;
  5766. this.ui.tipsNode.visible = !showAgain;
  5767. }
  5768. for (let index = 0; index < this.signArr.length; index++) {
  5769. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5770. }
  5771. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5772. }
  5773. playSecretaryIdle() {
  5774. let parent = this.ui.secretary.displayObject;
  5775. parent.destroyChildren();
  5776. let xx = this.ui.secretary.width / 2;
  5777. let yy = this.ui.secretary.height;
  5778. let scale = xGame.common.getSecretaryScale();
  5779. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5780. xGame.common.secretary.play(data, 0, true, parent);
  5781. }
  5782. closeSelf() {
  5783. this.hide();
  5784. }
  5785. normalGetAward() {
  5786. let sameDay = xGame.common.judgeSameDay();
  5787. if (!sameDay) {
  5788. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5789. let temp;
  5790. let type;
  5791. let num;
  5792. let arr = [];
  5793. for (let index = 0; index < award.length; index++) {
  5794. temp = award[index].split("-");
  5795. type = parseInt(temp[0]);
  5796. num = parseInt(temp[1]);
  5797. let awardType = new AwardType();
  5798. awardType.num = num;
  5799. awardType.type = type;
  5800. arr.push(awardType);
  5801. }
  5802. xGame.common.getAward(arr, (watchVideo) => {
  5803. this.curDayIndex++;
  5804. if (this.curDayIndex > 7)
  5805. this.curDayIndex = 0;
  5806. DataMgr.setSignData(this.curDayIndex);
  5807. DataMgr.setSignTime(new Date().getTime());
  5808. if (watchVideo) {
  5809. DataMgr.setExtraSign(1);
  5810. Moyu.sendDataEvent("signIn1");
  5811. }
  5812. this.updateSign();
  5813. });
  5814. }
  5815. }
  5816. againGetAward() {
  5817. Moyu.sendDataEvent("signIn2");
  5818. console.log('zh:qjff_AD_for_uisign');
  5819. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  5820. }
  5821. else {
  5822. console.log('zh:AD 失败,直接发放奖励');
  5823. this.qjff_AD_for_uisign();
  5824. }
  5825. }
  5826. qjff_AD_for_uisign() {
  5827. let index = this.curDayIndex;
  5828. if (index == 0)
  5829. index = 7;
  5830. let award = cfgTable.signData[index].award;
  5831. let temp;
  5832. let type;
  5833. let num;
  5834. for (let index = 0; index < award.length; index++) {
  5835. temp = award[index].split("-");
  5836. type = parseInt(temp[0]);
  5837. num = parseInt(temp[1]) * 3;
  5838. xGame.common.playObjFlyAnim(num, type);
  5839. }
  5840. DataMgr.setExtraSign(1);
  5841. this.updateSign();
  5842. }
  5843. }
  5844. UISign.uiName = "UISign";
  5845. class ui_UISkill extends fgui.GComponent {
  5846. static createInstance() {
  5847. return (fgui.UIPackage.createObject("game", "UISkill"));
  5848. }
  5849. onConstruct() {
  5850. this.n48 = (this.getChild("n48"));
  5851. this.n0 = (this.getChild("n0"));
  5852. this.secretary = (this.getChild("secretary"));
  5853. this.talkNode = (this.getChild("talkNode"));
  5854. this.closeNode = (this.getChild("closeNode"));
  5855. this.moneyNode = (this.getChild("moneyNode"));
  5856. this.skillNode = (this.getChild("skillNode"));
  5857. this.guideNode = (this.getChild("guideNode"));
  5858. }
  5859. }
  5860. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5861. class SkillDisplay {
  5862. constructor(ui, data, uiIndex) {
  5863. this.starX = 0;
  5864. this.starY = 0;
  5865. this.index = 0;
  5866. this.ui = ui;
  5867. this.data = data;
  5868. this.index = uiIndex;
  5869. this.initSelf();
  5870. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5871. }
  5872. initSelf() {
  5873. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5874. this.ui.nameTxt.text = this.data.name;
  5875. this.ui.describeTxt.text = this.data.describe;
  5876. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5877. this.ui.startBtn.onClick(this, this.startGame);
  5878. this.updateSelf();
  5879. }
  5880. updateSelf() {
  5881. this.checkTry();
  5882. let level = DataMgr.getBigSkillByIndex(this.index);
  5883. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5884. }
  5885. checkTry() {
  5886. let index = this.index;
  5887. let level = DataMgr.getBigSkillByIndex(index);
  5888. if (level == null) {
  5889. DataMgr.setBigSkill(index, 1, false);
  5890. level = 1;
  5891. }
  5892. this.ui.levelTxt.text = "LV." + level;
  5893. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5894. this.ui.tryNode.visible = true;
  5895. else
  5896. this.ui.tryNode.visible = false;
  5897. }
  5898. clickAddLevel() {
  5899. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5900. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5901. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  5902. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  5903. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5904. }
  5905. else {
  5906. console.log('zh:AD 失败,直接发放奖励');
  5907. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5908. }
  5909. }
  5910. qjff_AD_for_skilldisplay_clickAddLevel() {
  5911. DataMgr.setBigSkill(this.data.index, 1);
  5912. this.updateSelf();
  5913. xGame.common.upSkillLevel = true;
  5914. }
  5915. startGame() {
  5916. if (this.data.index == 3) {
  5917. alert('Coming soon!');
  5918. return;
  5919. }
  5920. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5921. let needCoin = xGame.common.bigMoveNeedCoin;
  5922. xGame.common.passAwardCoin = 2000;
  5923. let guide = DataMgr.getSkillGuide();
  5924. console.log('zh:startGame guide=' + guide);
  5925. xGame.common.temSelfLevel = 0;
  5926. if (guide == 0) {
  5927. needCoin = 0;
  5928. xGame.common.temSelfLevel = 100;
  5929. }
  5930. if (DataMgr.coinEnough(needCoin)) {
  5931. DataMgr.setCoin(-needCoin);
  5932. xGame.common.curPlayerSkillType = this.index;
  5933. if (guide == 0)
  5934. xGame.common.curPlayerSkillType = 0;
  5935. xGame.uiMgr.Show(UIGame);
  5936. xGame.uiMgr.Hide(UIMain);
  5937. xGame.uiMgr.Show(UIMatching, () => {
  5938. xGame.common.gameUI.ui.alpha = 1;
  5939. xGame.common.gameUI.startGame();
  5940. xGame.uiMgr.Hide(UISkill);
  5941. });
  5942. }
  5943. else {
  5944. xGame.uiMgr.Show(UIAddProp, 0);
  5945. Moyu.sendDataEvent("AddCoinVideo");
  5946. }
  5947. }
  5948. }
  5949. class UISkill extends UIBase {
  5950. constructor() {
  5951. super();
  5952. this.skillData = [];
  5953. }
  5954. onConstructor() {
  5955. this.ui = ui_UISkill.createInstance();
  5956. this.contentPane = this.ui;
  5957. this.isEject = false;
  5958. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5959. this.initSkillData();
  5960. console.log('zh:aaaaaa1111111111');
  5961. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5962. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5963. console.log('zh:aaaaaa22222222');
  5964. this.displayList = [];
  5965. this.ui.skillNode.skillList.numItems = 3;
  5966. this.addUIClick(this.ui, this.interuptSecretary);
  5967. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5968. this.ui.talkNode.visible = false;
  5969. if (Moyu.isKs)
  5970. this.ui.closeNode.closeBtn.x += 100;
  5971. }
  5972. show() {
  5973. super.show();
  5974. this.playSecretaryIdle();
  5975. this.moneyNode.ui.c1.selectedIndex = 1;
  5976. Laya.timer.clearAll(this);
  5977. xGame.soundMgr.playSound("s_start");
  5978. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5979. let guide = DataMgr.getSkillGuide();
  5980. this.ui.guideNode.visible = guide == 0;
  5981. let item = this.getSkillItemByUIIndex(0);
  5982. if (guide == 0) {
  5983. item.ui.c1.selectedIndex = 1;
  5984. }
  5985. else {
  5986. item.ui.c1.selectedIndex = 0;
  5987. }
  5988. this.ui.guideNode.guideBtn.visible = guide == 0;
  5989. for (let index = 0; index < this.displayList.length; index++) {
  5990. this.displayList[index].checkTry();
  5991. }
  5992. }
  5993. getSkillItemByUIIndex(cur) {
  5994. for (let index = 0; index < this.displayList.length; index++) {
  5995. if (this.displayList[index].index == cur) {
  5996. return this.displayList[index];
  5997. }
  5998. }
  5999. }
  6000. enterGuideLevel() {
  6001. let item = this.getSkillItemByUIIndex(0);
  6002. item.startGame();
  6003. if (DataMgr.getNewUser())
  6004. Moyu.sendDataEvent("gameStart1");
  6005. }
  6006. initSkillData() {
  6007. this.skillData = [];
  6008. let nameList = xGame.common.skillNameList;
  6009. let iconList = xGame.common.skillIconList;
  6010. let describeList = [
  6011. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6012. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
  6013. "The power of frost descends—freezing the flow and taking full control of the game!"
  6014. ];
  6015. console.log('zh:initSkillData 111111111');
  6016. let data;
  6017. for (let index = 0; index < nameList.length; index++) {
  6018. data = {};
  6019. data.name = nameList[index];
  6020. data.icon = iconList[index];
  6021. data.describe = describeList[index];
  6022. data.index = index;
  6023. this.skillData.push(data);
  6024. }
  6025. }
  6026. updateSkillItem(index, target) {
  6027. if (this.displayList[index] == null) {
  6028. let uiIndex;
  6029. switch (index) {
  6030. case 0:
  6031. uiIndex = 1;
  6032. break;
  6033. case 1:
  6034. uiIndex = 0;
  6035. break;
  6036. case 2:
  6037. uiIndex = 2;
  6038. break;
  6039. case 3:
  6040. uiIndex = 3;
  6041. break;
  6042. default:
  6043. break;
  6044. }
  6045. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6046. this.displayList.push(temp);
  6047. }
  6048. }
  6049. playSecretaryIdle() {
  6050. let parent = this.ui.secretary.displayObject;
  6051. parent.destroyChildren();
  6052. let xx = this.ui.secretary.width / 2;
  6053. let yy = this.ui.secretary.height;
  6054. let scale = xGame.common.getSecretaryScale();
  6055. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6056. xGame.common.secretary.play(data, 0, true, parent);
  6057. }
  6058. returnUIMain() {
  6059. this.hide();
  6060. xGame.common.stopGirlPop(this.ui.talkNode);
  6061. xGame.uiMgr.Show(UIMain);
  6062. }
  6063. interuptSecretary() {
  6064. Laya.timer.clearAll(this);
  6065. this.playSecretaryRandomSound();
  6066. }
  6067. playSecretaryRandomSound() {
  6068. if (this.isHide)
  6069. return;
  6070. let time = xGame.common.randomNum(45000, 60000);
  6071. Laya.timer.once(time, this, () => {
  6072. if (this.isHide)
  6073. return;
  6074. let index = xGame.common.randomNum(4, 7);
  6075. xGame.soundMgr.playSound("s_main0" + index);
  6076. let words = 1;
  6077. switch (index) {
  6078. case 4:
  6079. words = 5;
  6080. break;
  6081. case 5:
  6082. words = 3;
  6083. break;
  6084. case 6:
  6085. words = 6;
  6086. break;
  6087. case 7:
  6088. words = 7;
  6089. break;
  6090. default:
  6091. break;
  6092. }
  6093. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6094. this.playSecretaryRandomSound();
  6095. });
  6096. }
  6097. }
  6098. UISkill.uiName = "UISkill";
  6099. class ui_UIMsg extends fgui.GComponent {
  6100. static createInstance() {
  6101. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6102. }
  6103. onConstruct() {
  6104. this.tipsNode = (this.getChild("tipsNode"));
  6105. }
  6106. }
  6107. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6108. class UIMsg extends UIBase {
  6109. constructor() {
  6110. super();
  6111. }
  6112. onConstructor() {
  6113. this.ui = ui_UIMsg.createInstance();
  6114. this.contentPane = this.ui;
  6115. this.isEject = false;
  6116. this.isMuti = true;
  6117. }
  6118. show(msg, callback) {
  6119. super.show();
  6120. this.ui.tipsNode.msgTxt.text = msg;
  6121. this.ui.alpha = 1;
  6122. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6123. this.hide();
  6124. callback && callback();
  6125. }), 1000);
  6126. }
  6127. }
  6128. UIMsg.uiName = "UIMsg";
  6129. class ui_UIModeSelection extends fgui.GComponent {
  6130. static createInstance() {
  6131. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6132. }
  6133. onConstruct() {
  6134. this.n19 = (this.getChild("n19"));
  6135. this.closeBtn = (this.getChild("closeBtn"));
  6136. this.myNode = (this.getChild("myNode"));
  6137. this.t0 = this.getTransition("t0");
  6138. }
  6139. }
  6140. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6141. class UIModeSelection extends UIBase {
  6142. constructor() {
  6143. super();
  6144. }
  6145. onConstructor() {
  6146. this.ui = ui_UIModeSelection.createInstance();
  6147. this.contentPane = this.ui;
  6148. this.isEject = false;
  6149. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6150. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6151. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6152. this.addUIClick(this.ui.closeBtn, this.hide);
  6153. this.peopleArr = [650, 6900, 3800];
  6154. this.peopleOffest = [50, 500, 200];
  6155. this.updateSelf();
  6156. }
  6157. show(callback) {
  6158. super.show();
  6159. this.ui.t0.play();
  6160. this.callback = callback;
  6161. }
  6162. updateSelf() {
  6163. let cfg = cfgTable.modeselectData;
  6164. for (let index = 1; index <= 3; index++) {
  6165. let node = this.ui.myNode["type" + index];
  6166. node.need.text = cfg[index].need;
  6167. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6168. node.peopleTxt.text = this.getRandPeople(index - 1);
  6169. }
  6170. }
  6171. enterGame(type) {
  6172. xGame.common.classicRoomType = type;
  6173. let cfg = cfgTable.modeselectData[type];
  6174. let need = cfg.need;
  6175. xGame.common.passAwardCoin = cfg.award;
  6176. if (DataMgr.coinEnough(need)) {
  6177. DataMgr.setCoin(-need);
  6178. this.ui.myNode["type" + type].t0.play();
  6179. Laya.timer.once(200, this, () => {
  6180. this.callback && this.callback();
  6181. });
  6182. }
  6183. else {
  6184. Moyu.sendDataEvent("AddCoinVideo");
  6185. xGame.uiMgr.Show(UIAddProp, 0);
  6186. }
  6187. }
  6188. getRandPeople(index) {
  6189. let rand = this.peopleOffest[index];
  6190. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6191. }
  6192. }
  6193. UIModeSelection.uiName = "UIModeSelection";
  6194. class ui_UIGetAward extends fgui.GComponent {
  6195. static createInstance() {
  6196. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6197. }
  6198. onConstruct() {
  6199. this.n4 = (this.getChild("n4"));
  6200. this.n0 = (this.getChild("n0"));
  6201. this.myList = (this.getChild("myList"));
  6202. this.n1 = (this.getChild("n1"));
  6203. this.eftNode = (this.getChild("eftNode"));
  6204. this.btnNode = (this.getChild("btnNode"));
  6205. this.t0 = this.getTransition("t0");
  6206. }
  6207. }
  6208. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6209. class UIGetAward extends UIBase {
  6210. constructor() {
  6211. super();
  6212. this.showTriple = true;
  6213. }
  6214. onConstructor() {
  6215. this.ui = ui_UIGetAward.createInstance();
  6216. this.contentPane = this.ui;
  6217. this.isEject = false;
  6218. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6219. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6220. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6221. }
  6222. show(arr, showTriple, callback) {
  6223. super.show();
  6224. this.ui.t0.play();
  6225. this.ui.eftNode.visible = true;
  6226. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6227. this.ui.eftNode.visible = false;
  6228. }), 1, 0, 0, 0.9);
  6229. this.awardArr = arr;
  6230. this.showTriple = showTriple;
  6231. this.callback = callback;
  6232. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6233. this.ui.myList.numItems = arr.length;
  6234. xGame.soundMgr.playSound("getaward");
  6235. }
  6236. updateSelf(index, obj) {
  6237. let temp = this.awardArr[index];
  6238. let icon = this.getIcon(temp.type);
  6239. let str = icon;
  6240. if (temp.type > 2) {
  6241. str = "s" + icon;
  6242. }
  6243. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6244. obj.myIcon.rotation = 0;
  6245. obj.numTxt.text = temp.num + "";
  6246. obj.numTxt.visible = temp.type > 2 ? false : true;
  6247. obj.nameTxt.text = this.getNameStr(temp.type);
  6248. }
  6249. renderItem(index, obj) {
  6250. this.updateSelf(index, obj);
  6251. }
  6252. tripleGetAward() {
  6253. console.log('zh:qjff_AD_for_uigetAward');
  6254. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6255. }
  6256. else {
  6257. console.log('zh:AD 失败,直接发放奖励');
  6258. this.qjff_AD_for_uigetAward();
  6259. }
  6260. }
  6261. qjff_AD_for_uigetAward() {
  6262. this.getAward(3);
  6263. }
  6264. normalGetAward() {
  6265. if (PlatMgr.isMisVideo())
  6266. this.tripleGetAward();
  6267. else
  6268. this.getAward();
  6269. }
  6270. getAward(times = 1) {
  6271. this.hide();
  6272. for (let index = 0; index < this.awardArr.length; index++) {
  6273. this.awardArr[index].num *= times;
  6274. }
  6275. this.callback && this.callback(times != 1);
  6276. }
  6277. getIcon(type) {
  6278. switch (type) {
  6279. case Prop.diamond:
  6280. return "ty_zs";
  6281. case Prop.coin:
  6282. return "ty_jb";
  6283. case Prop.gan1:
  6284. return "qg1";
  6285. case Prop.gan2:
  6286. return "qg2";
  6287. case Prop.gan3:
  6288. return "qg3";
  6289. case Prop.gan4:
  6290. return "qg4";
  6291. default:
  6292. break;
  6293. }
  6294. }
  6295. getNameStr(type) {
  6296. switch (type) {
  6297. case Prop.diamond:
  6298. return "Diamond";
  6299. case Prop.coin:
  6300. return "Coins";
  6301. case Prop.gan1:
  6302. case Prop.gan2:
  6303. case Prop.gan3:
  6304. case Prop.gan4:
  6305. return cfgTable.ballrodData[type - 1].name;
  6306. default:
  6307. break;
  6308. }
  6309. }
  6310. }
  6311. UIGetAward.uiName = "UIGetAward";
  6312. class ui_UIRepentProp extends fgui.GComponent {
  6313. static createInstance() {
  6314. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6315. }
  6316. onConstruct() {
  6317. this.c1 = this.getController("c1");
  6318. this.n11 = (this.getChild("n11"));
  6319. this.regretNode = (this.getChild("regretNode"));
  6320. this.helpLineNode = (this.getChild("helpLineNode"));
  6321. this.t0 = this.getTransition("t0");
  6322. }
  6323. }
  6324. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6325. class UIRepentProp extends UIBase {
  6326. constructor() {
  6327. super();
  6328. this.viewType = 0;
  6329. this.regretType = 0;
  6330. }
  6331. onConstructor() {
  6332. this.ui = ui_UIRepentProp.createInstance();
  6333. this.contentPane = this.ui;
  6334. this.isEject = false;
  6335. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6336. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6337. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6338. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6339. }
  6340. show(viewType, regretType, callback) {
  6341. PlatMgr.showInsert(true);
  6342. this.viewType = viewType;
  6343. this.regretType = regretType;
  6344. this.callback = callback;
  6345. super.show();
  6346. this.ui.t0.play();
  6347. this.ui.c1.selectedIndex = this.viewType;
  6348. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6349. if (this.viewType == 0) {
  6350. let guide = DataMgr.getGuideHelpLine();
  6351. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6352. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6353. }
  6354. xGame.common.gameMgr.gamePause = true;
  6355. }
  6356. hideSelf() {
  6357. xGame.common.gameMgr.gamePause = false;
  6358. this.callback && this.callback(false);
  6359. this.hide();
  6360. }
  6361. videoRegret() {
  6362. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6363. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6364. }
  6365. else {
  6366. console.log('zh:AD 失败,直接发放奖励');
  6367. this.qjff_AD_for_UIrepentProp_videoRegret();
  6368. }
  6369. }
  6370. qjff_AD_for_UIrepentProp_videoRegret() {
  6371. this.callback && this.callback(true);
  6372. this.hideSelf();
  6373. }
  6374. videoAddHelpLine() {
  6375. let guide = DataMgr.getGuideHelpLine();
  6376. if (guide == 0) {
  6377. this.callback && this.callback(true);
  6378. this.hideSelf();
  6379. DataMgr.setGuideHelpLine();
  6380. xGame.common.gameUI.ui.guideNode.visible = false;
  6381. }
  6382. else {
  6383. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6384. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6385. }
  6386. else {
  6387. console.log('zh:AD 失败,直接发放奖励');
  6388. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6389. }
  6390. }
  6391. }
  6392. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6393. this.callback && this.callback(true);
  6394. this.hideSelf();
  6395. }
  6396. }
  6397. UIRepentProp.uiName = "UIRepentProp";
  6398. class UIMain extends UIBase {
  6399. constructor() {
  6400. super();
  6401. this.firstEnter = true;
  6402. }
  6403. nativeCallJs(msg) {
  6404. let t = msg;
  6405. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6406. switch (t) {
  6407. case 'qjff_chouJiang':
  6408. let dui = xGame.uiMgr.getUI(UIDraw);
  6409. dui.qjff_chouJiang();
  6410. break;
  6411. case 'qjff_AD_for_uisign':
  6412. let dui2 = xGame.uiMgr.getUI(UISign);
  6413. dui2.qjff_AD_for_uisign();
  6414. break;
  6415. case 'qjff_AD_for_uitry':
  6416. let dui3 = xGame.uiMgr.getUI(UITry);
  6417. dui3.qjff_AD_for_uitry();
  6418. break;
  6419. case 'qjff_AD_for_uipower':
  6420. let dui4 = xGame.uiMgr.getUI(UIPower);
  6421. dui4.qjff_AD_for_uipower();
  6422. break;
  6423. case 'qjff_AD_for_uigetAward':
  6424. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6425. dui5.qjff_AD_for_uigetAward();
  6426. break;
  6427. case 'qjff_AD_for_uiGameEnd':
  6428. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6429. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6430. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6431. break;
  6432. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6433. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6434. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6435. break;
  6436. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6437. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6438. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6439. break;
  6440. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6441. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6442. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6443. break;
  6444. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6445. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6446. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6447. break;
  6448. case 'qjff_AD_for_UIBOX_onOpenBox':
  6449. let dui11 = xGame.uiMgr.getUI(UIBox);
  6450. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6451. break;
  6452. case 'qjff_AD_for_UIAddCoin':
  6453. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6454. dui12.qjff_AD_for_UIAddCoin();
  6455. break;
  6456. case '111a':
  6457. let dui14 = xGame.uiMgr.getUI(UISign);
  6458. dui14.qjff_AD_for_uisign();
  6459. break;
  6460. case '222a':
  6461. let dui15 = xGame.uiMgr.getUI(UISign);
  6462. dui15.qjff_AD_for_uisign();
  6463. break;
  6464. case '333a':
  6465. let dui16 = xGame.uiMgr.getUI(UISign);
  6466. dui16.qjff_AD_for_uisign();
  6467. break;
  6468. default:
  6469. console.log('zh:未知的方法名字' + t);
  6470. break;
  6471. }
  6472. }
  6473. onConstructor() {
  6474. console.log('zh: UIMain onConstructor');
  6475. this.ui = ui_UIMain.createInstance();
  6476. this.contentPane = this.ui;
  6477. this.isEject = false;
  6478. this.addEvent();
  6479. this.addClickSpine();
  6480. this.settingNode = new SettingNode(this.ui.settingNode);
  6481. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6482. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6483. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6484. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6485. let curUse = DataMgr.getCurSecretary();
  6486. this.changeSecretary(curUse);
  6487. this.ui.talkNode.visible = false;
  6488. let guide = DataMgr.getSkillGuide();
  6489. if (xGame.common.isNewDay && guide == 1) {
  6490. xGame.common.isNewDay = false;
  6491. xGame.soundMgr.playSound("s_main01");
  6492. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6493. console.log("zh:播放小秘书每天语音");
  6494. }
  6495. this.ui.n83.visible = false;
  6496. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6497. }
  6498. changeSecretary(curUse) {
  6499. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6500. xGame.common.secretary && xGame.common.secretary.dispose();
  6501. this.addSecretarySpine(name);
  6502. }
  6503. addSecretarySpine(name) {
  6504. let spine = new SpineMgr(name, () => {
  6505. this.playSecretaryIdle();
  6506. });
  6507. xGame.common.secretary = spine;
  6508. }
  6509. addClickSpine() {
  6510. let clickSpine = new SpineMgr("dianji", () => {
  6511. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6512. let parent = Laya.stage;
  6513. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6514. clickSpine.play(data, 0, false, parent, (spine) => {
  6515. spine.destroy(true);
  6516. });
  6517. });
  6518. });
  6519. }
  6520. addEvent() {
  6521. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6522. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6523. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6524. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6525. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6526. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6527. this.addUIClick(this.ui, this.interuptSecretary);
  6528. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6529. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6530. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6531. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6532. this.addUIClick(this.ui.signBtn, this.openSignView);
  6533. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6534. this.addUIClick(this.ui.rankBtn, this.openRanking);
  6535. }
  6536. show(showFailWords) {
  6537. super.show();
  6538. this.moneyNode.ui.c1.selectedIndex = 1;
  6539. this.playSecretaryIdle();
  6540. xGame.soundMgr.playMusic("caromhall01", 0);
  6541. Laya.timer.clearAll(this);
  6542. this.playSecretaryRandomSound();
  6543. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  6544. if (showFailWords) {
  6545. console.log('zh:uimain.ts ');
  6546. setTimeout(() => {
  6547. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6548. let words = -1;
  6549. if (str == "s_main02") {
  6550. words = 2;
  6551. }
  6552. else {
  6553. words = 3;
  6554. }
  6555. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6556. xGame.soundMgr.playSound(str);
  6557. }, 300);
  6558. }
  6559. this.showGuide();
  6560. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6561. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6562. let guide = DataMgr.getSkillGuide();
  6563. if (guide == 1) {
  6564. let randTime = xGame.common.randomNum(300, 800);
  6565. if (this.firstEnter) {
  6566. this.firstEnter = false;
  6567. randTime += 900;
  6568. }
  6569. Laya.timer.once(randTime, this, () => {
  6570. xGame.common.autoPopUIView();
  6571. });
  6572. }
  6573. }
  6574. checkActive(show) {
  6575. }
  6576. showGuide() {
  6577. let guide = DataMgr.getSkillGuide();
  6578. this.ui.guideBtn.visible = guide == 0;
  6579. this.ui.enterGuide.visible = false;
  6580. this.ui.secretaryGuide.visible = guide == 0;
  6581. if (guide == 0) {
  6582. xGame.soundMgr.playSound("s_guide");
  6583. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6584. }
  6585. }
  6586. ensureSecretary() {
  6587. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6588. this.ui.secretaryGuide.visible = false;
  6589. this.ui.enterGuide.visible = true;
  6590. this.ui.wordsNode.t0.play();
  6591. if (DataMgr.getNewUser())
  6592. Moyu.sendDataEvent("gameReady");
  6593. }
  6594. playSecretaryIdle() {
  6595. let parent = this.ui.secretary.displayObject;
  6596. parent.destroyChildren();
  6597. let xx = this.ui.secretary.width / 2;
  6598. let yy = this.ui.secretary.height;
  6599. let scale = xGame.common.getSecretaryScale();
  6600. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6601. console.log("zh:playSecretaryIdle", data);
  6602. xGame.common.secretary.play(data, 0, true, parent);
  6603. }
  6604. startGame(type) {
  6605. xGame.common.gameMode = type;
  6606. Moyu.sendDataEvent("PlayGame", { type: type });
  6607. switch (xGame.common.gameMode) {
  6608. case GameMode.classic:
  6609. let challengeTimes = DataMgr.getChallengeTimes();
  6610. if (challengeTimes == 0) {
  6611. xGame.uiMgr.Show(UIInvitation);
  6612. }
  6613. else {
  6614. this.beginGame();
  6615. }
  6616. break;
  6617. case GameMode.bigMove:
  6618. this.beginGame();
  6619. if (DataMgr.getNewUser())
  6620. Moyu.sendDataEvent("gameStart0");
  6621. break;
  6622. default:
  6623. break;
  6624. }
  6625. }
  6626. beginGame(isNice = false) {
  6627. console.log('zh:beginGame beginGame beginGame');
  6628. if (xGame.common.gameMode == GameMode.classic) {
  6629. if (isNice) {
  6630. this.enterClassic();
  6631. }
  6632. else {
  6633. xGame.uiMgr.Show(UIModeSelection, () => {
  6634. this.enterClassic();
  6635. });
  6636. }
  6637. }
  6638. else if (xGame.common.gameMode == GameMode.bigMove) {
  6639. this.ui.enterGuide.visible = false;
  6640. xGame.uiMgr.Show(UISkill);
  6641. }
  6642. }
  6643. enterClassic() {
  6644. xGame.uiMgr.Show(UIGame);
  6645. xGame.uiMgr.Show(UIMatching, () => {
  6646. if (!this.isHide)
  6647. this.hide();
  6648. xGame.common.gameUI.ui.alpha = 1;
  6649. xGame.common.gameUI.startGame();
  6650. xGame.uiMgr.Hide(UIGameEnd);
  6651. });
  6652. }
  6653. startGlobal() {
  6654. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6655. }
  6656. startWeekly() {
  6657. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6658. }
  6659. zhouSaiMonth() {
  6660. console.log('zh: zhouSaiMonth 被调用');
  6661. }
  6662. startPlaceBall() {
  6663. xGame.uiMgr.Show(UILevelDisplay);
  6664. }
  6665. hide() {
  6666. console.log('zh:uimain hide ...');
  6667. super.hide();
  6668. xGame.common.stopGirlPop(this.ui.talkNode);
  6669. }
  6670. onGetUserInfo(force = false) {
  6671. if (Moyu.isWx) {
  6672. let info = Moyu.getSystemInfo();
  6673. if (info)
  6674. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6675. }
  6676. else {
  6677. Moyu.initUser(this, this.freshUser, force);
  6678. }
  6679. if (!Moyu.hasUserInfo) {
  6680. let user = Moyu.getUserInfo();
  6681. user.headIcon = 'res/ty_touxiang.png';
  6682. }
  6683. this.freshUser();
  6684. }
  6685. freshUser() {
  6686. let user = Moyu.getUserInfo();
  6687. if (!user.isAuth) {
  6688. user.headIcon = 'res/ty_touxiang.png';
  6689. }
  6690. else
  6691. DataMgr.upRankData();
  6692. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6693. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6694. }
  6695. interuptSecretary() {
  6696. Laya.timer.clearAll(this);
  6697. this.playSecretaryRandomSound();
  6698. }
  6699. playSecretaryRandomSound() {
  6700. if (this.isHide)
  6701. return;
  6702. let time = xGame.common.randomNum(45000, 60000);
  6703. Laya.timer.once(time, this, () => {
  6704. if (this.isHide)
  6705. return;
  6706. let index = xGame.common.randomNum(4, 7);
  6707. xGame.soundMgr.playSound("s_main0" + index);
  6708. let words = 1;
  6709. switch (index) {
  6710. case 4:
  6711. words = 5;
  6712. break;
  6713. case 5:
  6714. words = 3;
  6715. break;
  6716. case 6:
  6717. words = 6;
  6718. break;
  6719. case 7:
  6720. words = 7;
  6721. break;
  6722. default:
  6723. break;
  6724. }
  6725. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6726. this.playSecretaryRandomSound();
  6727. });
  6728. }
  6729. openSecretaryView() {
  6730. xGame.uiMgr.Show(UISecretary);
  6731. Moyu.sendDataEvent("secretary");
  6732. }
  6733. openShopView() {
  6734. xGame.uiMgr.Show(UIShop);
  6735. }
  6736. openSignView() {
  6737. xGame.uiMgr.Show(UISign);
  6738. }
  6739. openDrawView() {
  6740. xGame.uiMgr.Show(UIDraw);
  6741. }
  6742. openRanking() {
  6743. console.log('zh:phb openRanking');
  6744. xGame.uiMgr.Show(UIRanking);
  6745. Moyu.sendDataEvent("rankingList");
  6746. }
  6747. }
  6748. UIMain.uiName = "UIMain";
  6749. class UIGameEnd extends UIBase {
  6750. constructor() {
  6751. super();
  6752. this.success = false;
  6753. this.awardCoinNum = 1000;
  6754. this.awardDiamondNum = 10;
  6755. }
  6756. onConstructor() {
  6757. this.ui = ui_UIGameEnd.createInstance();
  6758. this.contentPane = this.ui;
  6759. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6760. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6761. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6762. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6763. this.ui.talkNode.visible = false;
  6764. if (Moyu.isKs)
  6765. this.ui.closeNode.closeBtn.x += 100;
  6766. }
  6767. updateType() {
  6768. switch (xGame.common.gameMode) {
  6769. case GameMode.classic:
  6770. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6771. this.ui.coinNode.visible = this.success;
  6772. if (!this.success) {
  6773. Laya.timer.once(500, this, () => {
  6774. xGame.uiMgr.Show(UIAddCoin);
  6775. });
  6776. }
  6777. this.ui.isGetAward.visible = false;
  6778. this.ui.leftBtn.c1.selectedIndex = 3;
  6779. this.ui.rightBtn.c1.selectedIndex = 0;
  6780. this.moneyNode.ui.c1.selectedIndex = 1;
  6781. break;
  6782. case GameMode.bigMove:
  6783. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6784. this.ui.coinNode.visible = this.success;
  6785. if (xGame.common.gameMode == GameMode.bigMove) {
  6786. if (this.success) {
  6787. DataMgr.setSkillSuccessTimes(1, true);
  6788. DataMgr.setSkillAccTimes(1);
  6789. }
  6790. else {
  6791. DataMgr.setSkillSuccessTimes(0, false);
  6792. }
  6793. }
  6794. if (!this.success) {
  6795. Laya.timer.once(500, this, () => {
  6796. xGame.uiMgr.Show(UIAddCoin);
  6797. });
  6798. }
  6799. this.ui.isGetAward.visible = false;
  6800. this.ui.leftBtn.c1.selectedIndex = 3;
  6801. this.ui.rightBtn.c1.selectedIndex = 0;
  6802. this.moneyNode.ui.c1.selectedIndex = 1;
  6803. break;
  6804. case GameMode.placeBall:
  6805. this.ui.coinNode.visible = false;
  6806. if (this.success) {
  6807. if (xGame.common.placeBallStarNum == 3) {
  6808. this.ui.c1.selectedIndex = 2;
  6809. }
  6810. else {
  6811. this.ui.c1.selectedIndex = 3;
  6812. }
  6813. }
  6814. else {
  6815. this.ui.c1.selectedIndex = 4;
  6816. }
  6817. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6818. if (cfg.type == PlaceBallType.challenge) {
  6819. this.ui.c1.selectedIndex = 2;
  6820. }
  6821. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6822. this.updatePlaceBallBtn();
  6823. this.updatePlaceBallStarNum();
  6824. this.updatePlaceBallAwardState();
  6825. this.moneyNode.ui.c1.selectedIndex = 2;
  6826. this.moneyNode.checkPowerTime();
  6827. this.moneyNode.powerChange();
  6828. DataMgr.upRankData();
  6829. break;
  6830. default:
  6831. break;
  6832. }
  6833. }
  6834. updatePlaceBallBtn() {
  6835. this.ui.leftBtn.c1.selectedIndex = 5;
  6836. if (this.success) {
  6837. this.ui.rightBtn.c1.selectedIndex = 14;
  6838. }
  6839. else {
  6840. if (xGame.common.placeBallStarNum == 3) {
  6841. this.ui.rightBtn.c1.selectedIndex = 14;
  6842. }
  6843. else {
  6844. this.ui.rightBtn.c1.selectedIndex = 1;
  6845. }
  6846. }
  6847. }
  6848. updatePlaceBallStarNum() {
  6849. let starNum = xGame.common.placeBallStarNum;
  6850. if (starNum == 0)
  6851. this.ui.starNumNode.c1.selectedIndex = 3;
  6852. else {
  6853. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6854. }
  6855. }
  6856. updatePlaceBallAwardState() {
  6857. let level = xGame.common.placeBallCurLevel;
  6858. let starNum = xGame.common.placeBallStarNum;
  6859. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6860. let data = cfgTable.placeballData[level].award;
  6861. let cfg = cfgTable.placeballData[level];
  6862. this.awardDiamondNum = data[1];
  6863. this.awardCoinNum = data[0];
  6864. if (cfg.type == PlaceBallType.challenge) {
  6865. this.awardDiamondNum = 0;
  6866. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6867. }
  6868. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6869. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6870. if (cfg.type == PlaceBallType.challenge) {
  6871. this.ui.awardNode.coinNode.visible = true;
  6872. }
  6873. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6874. this.ui.awardNode.diamondNode.x = 265;
  6875. this.ui.awardNode.coinNode.x = 354;
  6876. }
  6877. else {
  6878. this.ui.awardNode.diamondNode.x = 291;
  6879. this.ui.awardNode.coinNode.x = 291;
  6880. }
  6881. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6882. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6883. if (this.awardCoinNum == 0) {
  6884. this.ui.awardNode.coinNode.numTxt.text = "";
  6885. }
  6886. if (getAward) {
  6887. this.ui.isGetAward.visible = true;
  6888. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6889. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6890. }
  6891. else {
  6892. this.ui.isGetAward.visible = false;
  6893. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6894. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6895. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6896. }
  6897. else {
  6898. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6899. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6900. }
  6901. }
  6902. }
  6903. show(success) {
  6904. super.show();
  6905. xGame.eventMgr.event(RESET_GAME);
  6906. this.success = success;
  6907. Laya.timer.clearAll(this);
  6908. this.playSecretaryAni();
  6909. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6910. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6911. offsetTime = Math.floor(offsetTime / 1000);
  6912. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6913. this.updateType();
  6914. Laya.timer.once(200, this, () => {
  6915. this.addAward(() => {
  6916. this.updateType();
  6917. Laya.timer.once(500, this, () => {
  6918. this.showChallengeLevel();
  6919. });
  6920. });
  6921. });
  6922. if (this.success) {
  6923. xGame.soundMgr.playSound('slots_roll01');
  6924. xGame.soundMgr.playSound("s_win");
  6925. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6926. }
  6927. else {
  6928. xGame.soundMgr.playSound('matchwin01');
  6929. xGame.soundMgr.playSound("s_lose");
  6930. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6931. }
  6932. if (!Moyu.isLegal)
  6933. PlatMgr.showBanner(true);
  6934. let challengeNum = DataMgr.getChallengeTimes();
  6935. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6936. DataMgr.setChallengeTimes(1);
  6937. }
  6938. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6939. DataMgr.setClassicTimes();
  6940. }
  6941. }
  6942. showChallengeLevel() {
  6943. if (DataMgr.getChallengeTimes() != 0)
  6944. return;
  6945. let skill = DataMgr.getSkillAccTimes();
  6946. let put = DataMgr.getPlaceBallLevelList().length;
  6947. if (skill >= 3 || put >= 5) {
  6948. xGame.uiMgr.Show(UIInvitation);
  6949. this.hide();
  6950. }
  6951. }
  6952. addAward(callback) {
  6953. if (!this.success) {
  6954. callback && callback();
  6955. return;
  6956. }
  6957. switch (xGame.common.gameMode) {
  6958. case GameMode.classic:
  6959. this.awardCoinNum = xGame.common.passAwardCoin;
  6960. this.awardDiamondNum = 0;
  6961. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6962. break;
  6963. case GameMode.bigMove:
  6964. this.awardCoinNum = xGame.common.passAwardCoin;
  6965. this.awardDiamondNum = 0;
  6966. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6967. callback && callback();
  6968. break;
  6969. case GameMode.placeBall:
  6970. let level = xGame.common.placeBallCurLevel;
  6971. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6972. if (xGame.common.placeBallStarNum != 3) {
  6973. callback && callback();
  6974. return;
  6975. }
  6976. else {
  6977. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6978. if (getAward) {
  6979. callback && callback();
  6980. return;
  6981. }
  6982. }
  6983. let cfg = cfgTable.placeballData[level];
  6984. let data = cfgTable.placeballData[level].award;
  6985. this.awardCoinNum = data[0];
  6986. this.awardDiamondNum = data[1];
  6987. if (cfg.type == PlaceBallType.challenge) {
  6988. this.awardDiamondNum = 0;
  6989. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6990. }
  6991. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6992. let diamondAward;
  6993. if (this.awardDiamondNum > 0) {
  6994. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6995. xGame.common.getAward([diamondAward, coinAward], callback);
  6996. }
  6997. else {
  6998. xGame.common.getAward([coinAward], callback);
  6999. }
  7000. if (cfg.type == PlaceBallType.normal) {
  7001. DataMgr.setPlaceBallAward(level);
  7002. }
  7003. break;
  7004. default:
  7005. break;
  7006. }
  7007. }
  7008. playSecretaryAni_old() {
  7009. let parent = this.ui.secretary.displayObject;
  7010. parent.destroyChildren();
  7011. let xx = this.ui.secretary.width / 2;
  7012. let yy = this.ui.secretary.height;
  7013. let scale = xGame.common.getSecretaryScale();
  7014. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7015. if (this.success) {
  7016. let rand = Math.random() <= 0.5 ? 2 : 3;
  7017. xGame.common.secretary.play(data, rand, false, parent, () => {
  7018. xGame.common.secretary.play(data, 1, true, parent);
  7019. });
  7020. }
  7021. else {
  7022. xGame.common.secretary.play(data, 0, true, parent);
  7023. }
  7024. }
  7025. playSecretaryAni() {
  7026. let parent = this.ui.secretary.displayObject;
  7027. parent.destroyChildren();
  7028. let xx = this.ui.secretary.width / 2;
  7029. let yy = this.ui.secretary.height;
  7030. let scale = xGame.common.getSecretaryScale();
  7031. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7032. if (this.success) {
  7033. let rand = 0;
  7034. xGame.common.secretary.play(data, 0, true, parent);
  7035. }
  7036. else {
  7037. xGame.common.secretary.play(data, 0, true, parent);
  7038. }
  7039. }
  7040. restartGame() {
  7041. switch (xGame.common.gameMode) {
  7042. case GameMode.classic:
  7043. xGame.eventMgr.event(RESTART_GAME);
  7044. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7045. break;
  7046. case GameMode.bigMove:
  7047. this.hide();
  7048. xGame.eventMgr.event(RESTART_GAME);
  7049. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7050. break;
  7051. default:
  7052. break;
  7053. }
  7054. }
  7055. hide() {
  7056. super.hide();
  7057. xGame.common.stopGirlPop(this.ui.talkNode);
  7058. PlatMgr.showBanner(false);
  7059. }
  7060. returnHome() {
  7061. this.hide();
  7062. let showFailWords = !this.success;
  7063. xGame.uiMgr.Show(UIMain, showFailWords);
  7064. }
  7065. clickLeftBtn() {
  7066. switch (xGame.common.gameMode) {
  7067. case GameMode.classic:
  7068. case GameMode.bigMove:
  7069. this.returnHome();
  7070. break;
  7071. case GameMode.placeBall:
  7072. let level = xGame.common.placeBallCurLevel;
  7073. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7074. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7075. break;
  7076. default:
  7077. break;
  7078. }
  7079. }
  7080. powerStartPlaceBallLevel(level, btn) {
  7081. if (DataMgr.powerEnough()) {
  7082. btn.touchable = false;
  7083. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7084. btn.touchable = true;
  7085. DataMgr.setPower(-1);
  7086. xGame.eventMgr.event(POWER_TIME);
  7087. this.startPlaceBallLevel(level);
  7088. }));
  7089. }
  7090. else {
  7091. xGame.uiMgr.Show(UIPower, 0);
  7092. }
  7093. }
  7094. clickRightBtn() {
  7095. switch (xGame.common.gameMode) {
  7096. case GameMode.classic:
  7097. console.log('zh:clickRightBtn 111');
  7098. case GameMode.bigMove:
  7099. console.log('zh:clickRightBtn 222');
  7100. this.restartGame();
  7101. break;
  7102. case GameMode.placeBall:
  7103. console.log('zh:clickRightBtn 333');
  7104. let level = xGame.common.placeBallCurLevel;
  7105. let data = DataMgr.getPlaceBallLevel(level);
  7106. let curPss = data.play && !data.isCur;
  7107. if (curPss) {
  7108. console.log('zh:clickRightBtn 333-111');
  7109. console.log('zh:当前LV=' + level);
  7110. if (level == 60) {
  7111. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7112. Laya.timer.once(3000, this, () => {
  7113. this.returnHome();
  7114. });
  7115. }
  7116. else {
  7117. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  7118. }
  7119. }
  7120. else {
  7121. console.log('zh:clickRightBtn 333-000');
  7122. Moyu.sendDataEvent("placeBallNextLevel");
  7123. console.log('zh:qjff_AD_for_uiGameEnd');
  7124. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7125. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7126. }
  7127. else {
  7128. console.log('zh:AD 失败,直接发放奖励');
  7129. this.qjff_AD_for_uiGameEnd(level);
  7130. }
  7131. }
  7132. break;
  7133. default:
  7134. console.log('zh:clickRightBtn 444');
  7135. break;
  7136. }
  7137. }
  7138. qjff_AD_for_uiGameEnd(level) {
  7139. DataMgr.setPlaceBallLevel(level, 1);
  7140. this.startPlaceBallLevel(level + 1);
  7141. }
  7142. startPlaceBallLevel(level) {
  7143. xGame.common.gameMode = GameMode.placeBall;
  7144. xGame.common.placeBallCurLevel = level;
  7145. xGame.uiMgr.Show(UIGame);
  7146. this.hide();
  7147. }
  7148. }
  7149. UIGameEnd.uiName = "UIGameEnd";
  7150. class ui_UIVideoShare extends fgui.GComponent {
  7151. static createInstance() {
  7152. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7153. }
  7154. onConstruct() {
  7155. this.n10 = (this.getChild("n10"));
  7156. this.myNode = (this.getChild("myNode"));
  7157. this.t0 = this.getTransition("t0");
  7158. }
  7159. }
  7160. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7161. class UIVideoShare extends UIBase {
  7162. constructor() {
  7163. super();
  7164. this.success = false;
  7165. this.awardNum = 0;
  7166. this.isShared = true;
  7167. }
  7168. onConstructor() {
  7169. this.ui = ui_UIVideoShare.createInstance();
  7170. this.contentPane = this.ui;
  7171. this.isEject = false;
  7172. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7173. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7174. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7175. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7176. }
  7177. show(success) {
  7178. super.show();
  7179. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7180. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7181. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7182. this.success = success;
  7183. let time = xGame.common.randomNum(600, 1500);
  7184. Moyu.showInsertAd(time, 60000);
  7185. if (success)
  7186. xGame.soundMgr.playSound("applause");
  7187. this.ui.t0.play();
  7188. this.checkShareState();
  7189. let times = DataMgr.getDailyVideoShareTimes();
  7190. this.awardNum = times == 0 ? 2000 : 200;
  7191. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  7192. }
  7193. checkShareState() {
  7194. if (PlatMgr.forceShare == 0) {
  7195. this.ui.myNode.closeBtn.visible = true;
  7196. this.ui.myNode.tipsNode.visible = false;
  7197. this.ui.myNode.closeBtn.x = 90;
  7198. this.ui.myNode.shareBtn.x = 342;
  7199. }
  7200. else if (PlatMgr.forceShare == 1) {
  7201. this.ui.myNode.closeBtn.visible = false;
  7202. this.ui.myNode.tipsNode.visible = true;
  7203. this.ui.myNode.shareBtn.x = 218;
  7204. this.isShared = true;
  7205. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7206. }
  7207. }
  7208. checkForceShare() {
  7209. this.isShared = !this.isShared;
  7210. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7211. }
  7212. videoShare() {
  7213. if (PlatMgr.forceShare == 1) {
  7214. if (this.isShared) {
  7215. this.shareGame();
  7216. }
  7217. else {
  7218. this.hideSelf();
  7219. }
  7220. }
  7221. else {
  7222. this.shareGame();
  7223. }
  7224. }
  7225. shareGame() {
  7226. Moyu.sendDataEvent("VideoShare");
  7227. if (Moyu.canShare() > 100) {
  7228. Moyu.shareGame((success) => {
  7229. if (success) {
  7230. DataMgr.setDailyVideoShareTimes(1);
  7231. DataMgr.setCoin(this.awardNum);
  7232. }
  7233. this.hideSelf();
  7234. }, this);
  7235. }
  7236. else {
  7237. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  7238. this.hideSelf();
  7239. }
  7240. }
  7241. hideSelf() {
  7242. this.hide();
  7243. xGame.uiMgr.Show(UIGameEnd, this.success);
  7244. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  7245. xGame.common.screenImg.destroy();
  7246. xGame.common.screenImg = null;
  7247. }
  7248. }
  7249. }
  7250. UIVideoShare.uiName = "UIVideoShare";
  7251. class ui_UITips extends fgui.GComponent {
  7252. static createInstance() {
  7253. return (fgui.UIPackage.createObject("game", "UITips"));
  7254. }
  7255. onConstruct() {
  7256. this.n0 = (this.getChild("n0"));
  7257. this.myNode = (this.getChild("myNode"));
  7258. this.t0 = this.getTransition("t0");
  7259. }
  7260. }
  7261. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7262. class UITips extends UIBase {
  7263. constructor() {
  7264. super();
  7265. this.type = 0;
  7266. }
  7267. onConstructor() {
  7268. this.ui = ui_UITips.createInstance();
  7269. this.contentPane = this.ui;
  7270. this.isEject = false;
  7271. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7272. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7273. }
  7274. show(tipsTxt, womanTxt, type) {
  7275. super.show();
  7276. this.ui.t0.play();
  7277. this.ui.myNode.tipsTxt.text = tipsTxt;
  7278. this.ui.myNode.womanTxt.text = womanTxt;
  7279. PlatMgr.showInsert(true);
  7280. this.ui.myNode.c1.selectedIndex = type;
  7281. this.type = type;
  7282. switch (this.type) {
  7283. case TipsType.exitGame:
  7284. xGame.common.gameMgr.gamePause = true;
  7285. break;
  7286. case TipsType.foul:
  7287. Laya.timer.once(200, this, () => {
  7288. xGame.common.gameMgr.gamePause = true;
  7289. });
  7290. break;
  7291. default:
  7292. break;
  7293. }
  7294. }
  7295. clickLeftBtn() {
  7296. this.hide();
  7297. xGame.common.gameMgr.gamePause = false;
  7298. switch (this.type) {
  7299. case TipsType.exitGame:
  7300. break;
  7301. case TipsType.foul:
  7302. break;
  7303. default:
  7304. break;
  7305. }
  7306. }
  7307. clickRightBtn() {
  7308. this.hide();
  7309. switch (this.type) {
  7310. case TipsType.exitGame:
  7311. xGame.eventMgr.event(RESET_GAME);
  7312. xGame.uiMgr.Show(UIMain);
  7313. Moyu.recordEnd(this, null);
  7314. xGame.common.longHelpLine = false;
  7315. break;
  7316. case TipsType.foul:
  7317. xGame.common.gameMgr.gamePause = false;
  7318. Laya.timer.clearAll(this);
  7319. break;
  7320. default:
  7321. break;
  7322. }
  7323. }
  7324. }
  7325. UITips.uiName = "UITips";
  7326. class GameMgr {
  7327. constructor() {
  7328. this.selfCamp = "";
  7329. this.selfFoulNum = 0;
  7330. this.selfBallArr = [];
  7331. this.selfTimer = 0;
  7332. this.selfScore = 0;
  7333. this.aiCamp = "";
  7334. this.aiFoulNum = 0;
  7335. this.aiBallArr = [];
  7336. this.aiTimer = 0;
  7337. this.aiScore = 0;
  7338. this.aiSkillLevelNum = 1;
  7339. this.targertScore = 0;
  7340. this.setTime = 30;
  7341. this.selfTurnRate = 0.5;
  7342. this.accTime = 0;
  7343. this.curFoul = "";
  7344. this.maxFoulTimes = 3;
  7345. this.isFirstInGame = true;
  7346. this.firstColliObj = null;
  7347. this.inHoleBalls = [];
  7348. this.blackNum = 8;
  7349. this.success = false;
  7350. this.holePosList = [];
  7351. this.posObj = {};
  7352. this._selfTurn = false;
  7353. this.lastRootBallPos = new Laya.Vector2(311, 430);
  7354. this.ensureBallType = false;
  7355. this.isOpenBall = true;
  7356. this.finishOneShoot = true;
  7357. this.isEnd = false;
  7358. this.isChangeTurn = false;
  7359. this.isInterrupt = false;
  7360. this.aiPlayedBreakArmy = false;
  7361. this.isTouchedBall = false;
  7362. this.finishBalls = 0;
  7363. this.needBalls = 0;
  7364. this.allBallNum = 0;
  7365. this.placeBallPosData = {};
  7366. this.curHP = 0;
  7367. this.showLongView = false;
  7368. this.firstShoot = true;
  7369. this._gamePause = false;
  7370. this.trunCount = 0;
  7371. this.isBlackInHole = false;
  7372. this.isEnter = true;
  7373. xGame.eventMgr.offAll(ALL_BALL_STOP);
  7374. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  7375. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  7376. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  7377. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  7378. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  7379. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  7380. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  7381. }
  7382. get gamePause() {
  7383. return this._gamePause;
  7384. }
  7385. set gamePause(v) {
  7386. if (v) {
  7387. Laya.physicsTimer.pause();
  7388. }
  7389. else {
  7390. Laya.physicsTimer.resume();
  7391. }
  7392. this._gamePause = v;
  7393. }
  7394. get selfTurn() {
  7395. return this._selfTurn;
  7396. }
  7397. set selfTurn(val) {
  7398. this.trunCount++;
  7399. this._selfTurn = val;
  7400. if (val) {
  7401. xGame.common.d2World.d2Gan.ui.self.visible = true;
  7402. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7403. }
  7404. else {
  7405. xGame.common.d2World.d2Gan.ui.self.visible = false;
  7406. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  7407. if (this.trunCount > 1)
  7408. PlatMgr.openBox();
  7409. }
  7410. }
  7411. resetGame() {
  7412. this.inHoleBalls = [];
  7413. this.isFirstInGame = true;
  7414. this.firstColliObj = null;
  7415. this.aiCamp = "";
  7416. this.selfCamp = "";
  7417. this.aiFoulNum = 0;
  7418. this.selfFoulNum = 0;
  7419. this.selfBallArr = [];
  7420. this.aiBallArr = [];
  7421. this.gamePause = false;
  7422. this.ensureBallType = false;
  7423. this.isInterrupt = false;
  7424. this.updateLeftBall();
  7425. this.clearTime();
  7426. this.aiPlayedBreakArmy = false;
  7427. this.isBlackInHole = false;
  7428. this.placeBallPosData = {};
  7429. if (xGame.common.d3World.knifeRoot) {
  7430. xGame.common.d3World.knifeRoot.destroyChildren();
  7431. }
  7432. }
  7433. gameReady() {
  7434. this.trunCount = 0;
  7435. this.firstColliObj = null;
  7436. this.isFirstInGame = true;
  7437. this.selfTurn = Math.random() <= this.selfTurnRate;
  7438. let challengeNum = DataMgr.getChallengeTimes();
  7439. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7440. this.selfTurn = true;
  7441. }
  7442. if (xGame.common.gameMode == GameMode.placeBall)
  7443. this.selfTurn = true;
  7444. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7445. this.selfTurn = true;
  7446. }
  7447. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7448. this.checkGuide();
  7449. if (xGame.common.uiRodMethod)
  7450. xGame.common.uiRodMethod.resetRod();
  7451. xGame.common.d2World.getHelpLine();
  7452. this.isOpenBall = true;
  7453. this.isTouchedBall = false;
  7454. xGame.common.aiPlayer.stopRun();
  7455. this.setTime = 30;
  7456. let ui = xGame.common.gameUI.ui;
  7457. switch (xGame.common.gameMode) {
  7458. case GameMode.classic:
  7459. xGame.common.aiPlayer.init();
  7460. this.blackNum = 8;
  7461. this.placeRootBall();
  7462. this.peoplePlay(9, 10);
  7463. ui.wordsBtn.visible = true;
  7464. ui.aiWordsBtn.visible = true;
  7465. xGame.common.talkMgr.changeAIState(true);
  7466. DataMgr.gameData.gameCount++;
  7467. DataMgr.saveGameData();
  7468. break;
  7469. case GameMode.bigMove:
  7470. this.blackNum = -1;
  7471. this.selfScore = 0;
  7472. this.aiScore = 0;
  7473. xGame.common.aiPlayer.init();
  7474. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7475. this.updateSelfScore();
  7476. this.updateAIScore();
  7477. this.updateTargetSroce();
  7478. this.placeRootBall();
  7479. this.peoplePlay(9, 10);
  7480. ui.wordsBtn.visible = true;
  7481. ui.aiWordsBtn.visible = true;
  7482. xGame.common.talkMgr.changeAIState(true);
  7483. if (DataMgr.getSkillGuide() < 1)
  7484. DataMgr.gameData.gameCount = 0;
  7485. else {
  7486. DataMgr.gameData.gameCount++;
  7487. DataMgr.saveGameData();
  7488. PlatMgr.openTry();
  7489. }
  7490. if (xGame.common.d3World.knifeRoot) {
  7491. xGame.common.d3World.knifeRoot.destroyChildren();
  7492. }
  7493. break;
  7494. case GameMode.placeBall:
  7495. this.blackNum = -1;
  7496. this.selfTurn = true;
  7497. this.setTime = 10000;
  7498. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7499. this.curHP = this.placeBallData.hp;
  7500. if (this.placeBallData.ball == -1)
  7501. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7502. else
  7503. this.needBalls = this.placeBallData.ball;
  7504. console.log("需要的进球数目", this.needBalls);
  7505. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7506. this.finishBalls = 0;
  7507. this.placeBallPosData = {};
  7508. this.updatePlaceBallPos();
  7509. this.updatePlaceBallState();
  7510. this.finishOneShoot = true;
  7511. xGame.common.gameUI.ui.moveNode.visible = false;
  7512. this.isOpenBall = false;
  7513. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7514. ui.wordsBtn.visible = false;
  7515. ui.aiWordsBtn.visible = false;
  7516. xGame.common.talkMgr.changeAIState(false);
  7517. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7518. PlatMgr.openBox();
  7519. });
  7520. break;
  7521. default:
  7522. break;
  7523. }
  7524. this.showLongView = false;
  7525. xGame.common.wordsMgr.comboTimes = 1;
  7526. let guide = DataMgr.getSkillGuide();
  7527. if (guide)
  7528. xGame.eventMgr.event(WAIT_SHOOT);
  7529. xGame.common.upSkillLevel = false;
  7530. xGame.common.gameStartTime = new Date().getTime();
  7531. this.firstShoot = true;
  7532. }
  7533. checkGuide() {
  7534. let guide = DataMgr.getSkillGuide();
  7535. let gameUI = xGame.common.gameUI.ui;
  7536. gameUI.guide1.visible = false;
  7537. gameUI.guide2.visible = false;
  7538. gameUI.guide3.visible = false;
  7539. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7540. this.selfTurn = true;
  7541. }
  7542. else {
  7543. return;
  7544. }
  7545. let oneBall = this.getOneBall();
  7546. gameUI.guide1.visible = true;
  7547. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7548. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7549. }
  7550. getOneBall() {
  7551. let arr = xGame.common.d2World.ballArr;
  7552. for (let index = 0; index < arr.length; index++) {
  7553. if (arr[index].number == 0)
  7554. continue;
  7555. return arr[index];
  7556. }
  7557. }
  7558. updateSelfScore() {
  7559. let ui = xGame.common.gameUI.ui.topNode;
  7560. ui.selfScoreTxt.text = this.selfScore + "";
  7561. }
  7562. updateAIScore() {
  7563. let ui = xGame.common.gameUI.ui.topNode;
  7564. ui.aiScoreTxt.text = this.aiScore + "";
  7565. }
  7566. updateTargetSroce() {
  7567. let ui = xGame.common.gameUI.ui.topNode;
  7568. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7569. }
  7570. updateLeftBall() {
  7571. let topUI = xGame.common.gameUI.ui.topNode;
  7572. topUI.selfBallList.numItems = this.selfBallArr.length;
  7573. topUI.aiBallList.numItems = this.aiBallArr.length;
  7574. }
  7575. ballShoot() {
  7576. this.clearTime();
  7577. this.finishOneShoot = false;
  7578. xGame.common.gameUI.ui.moveNode.visible = false;
  7579. if (xGame.common.gameUI.ui.guideNode.visible) {
  7580. xGame.common.gameUI.ui.guideNode.visible = false;
  7581. }
  7582. if (this.firstShoot) {
  7583. this.firstShoot = false;
  7584. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7585. }
  7586. }
  7587. ensureCamp(number) {
  7588. this.ensureBallType = true;
  7589. this.isOpenBall = false;
  7590. if (xGame.common.gameMode != GameMode.classic)
  7591. return;
  7592. let full = [1, 2, 3, 4, 5, 6, 7];
  7593. let flower = [9, 10, 11, 12, 13, 14, 15];
  7594. let sayWords = "";
  7595. if (this.selfTurn) {
  7596. if (number <= 7) {
  7597. this.selfCamp = ballCamp.full;
  7598. this.selfBallArr = full;
  7599. this.aiCamp = ballCamp.flower;
  7600. this.aiBallArr = flower;
  7601. sayWords = cfgTable.wordsData[3].msg;
  7602. }
  7603. else {
  7604. this.selfCamp = ballCamp.flower;
  7605. this.selfBallArr = flower;
  7606. this.aiCamp = ballCamp.full;
  7607. this.aiBallArr = full;
  7608. sayWords = cfgTable.wordsData[4].msg;
  7609. }
  7610. }
  7611. else {
  7612. if (number <= 7) {
  7613. this.selfCamp = ballCamp.flower;
  7614. this.selfBallArr = flower;
  7615. this.aiCamp = ballCamp.full;
  7616. this.aiBallArr = full;
  7617. sayWords = cfgTable.wordsData[2].msg;
  7618. }
  7619. else {
  7620. this.selfCamp = ballCamp.full;
  7621. this.selfBallArr = full;
  7622. this.aiCamp = ballCamp.flower;
  7623. this.aiBallArr = flower;
  7624. sayWords = cfgTable.wordsData[1].msg;
  7625. }
  7626. }
  7627. this.updateLeftBall();
  7628. xGame.uiMgr.Show(UIMsg, sayWords);
  7629. }
  7630. updatePlaceBallState() {
  7631. let ui = xGame.common.gameUI.ui;
  7632. switch (this.placeBallData.type) {
  7633. case PlaceBallType.normal:
  7634. let normal = ui.placeNormalNode;
  7635. normal.hpTxt.text = this.curHP + "";
  7636. this.updatePlaceBallStar(normal);
  7637. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7638. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7639. break;
  7640. case PlaceBallType.challenge:
  7641. let challenge = ui.placeChallengeNode;
  7642. challenge.hpTxt.text = "Shots:" + this.curHP;
  7643. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7644. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7645. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7646. break;
  7647. default:
  7648. break;
  7649. }
  7650. }
  7651. playSubHpAni() {
  7652. let ui = xGame.common.gameUI.ui;
  7653. switch (this.placeBallData.type) {
  7654. case PlaceBallType.normal:
  7655. let normal = ui.placeNormalNode;
  7656. normal.hpTxt.visible = false;
  7657. normal.starAni.c1.selectedIndex = 1;
  7658. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7659. normal.hpTxt.visible = true;
  7660. normal.starAni.c1.selectedIndex = 0;
  7661. }));
  7662. break;
  7663. default:
  7664. break;
  7665. }
  7666. }
  7667. getEndStarNum() {
  7668. let num;
  7669. let level = xGame.common.placeBallCurLevel;
  7670. if (this.curHP == this.placeBallData.hp) {
  7671. num = 3;
  7672. }
  7673. else if (this.curHP <= 1) {
  7674. num = 1;
  7675. }
  7676. else {
  7677. num = 2;
  7678. }
  7679. if (!this.success) {
  7680. num = 0;
  7681. }
  7682. else {
  7683. DataMgr.setPlaceBallLevel(level, num);
  7684. }
  7685. let myType = cfgTable.placeballData[level].type;
  7686. if (this.success && myType == 1) {
  7687. num = 3;
  7688. }
  7689. xGame.common.placeBallStarNum = num;
  7690. }
  7691. updatePlaceBallStar(node) {
  7692. let star = 0;
  7693. if (this.curHP == this.placeBallData.hp) {
  7694. star = 3;
  7695. }
  7696. else if (this.curHP >= 2) {
  7697. star = 2;
  7698. }
  7699. else if (this.curHP == 1) {
  7700. star = 1;
  7701. }
  7702. else {
  7703. star = 0;
  7704. }
  7705. let temp;
  7706. for (let index = 1; index <= 3; index++) {
  7707. temp = node["star" + index];
  7708. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7709. }
  7710. node.myProgress.value = (star / 3) * 100;
  7711. }
  7712. openRegretView(isFoul, GoalNum, challenge = false) {
  7713. let regretType = -1;
  7714. if (isFoul) {
  7715. regretType = 1;
  7716. }
  7717. else {
  7718. if (GoalNum <= 0) {
  7719. regretType = 0;
  7720. }
  7721. }
  7722. if (challenge) {
  7723. regretType = 1;
  7724. }
  7725. if (regretType != -1) {
  7726. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7727. if (success) {
  7728. this.curHP++;
  7729. this.updatePlaceBallState();
  7730. this.setPlaceBallAllPos();
  7731. xGame.common.gameUI.ui.moveNode.visible = false;
  7732. }
  7733. else {
  7734. if (this.curHP <= 0) {
  7735. this.success = false;
  7736. this.gameEnd();
  7737. }
  7738. this.playSubHpAni();
  7739. }
  7740. this.updatePlaceBallState();
  7741. this.updatePlaceBallPos();
  7742. });
  7743. }
  7744. }
  7745. setPlaceBallAllPos() {
  7746. let allBall = xGame.common.d2World.ballArr;
  7747. let cfgArr = this.placeBallPosData;
  7748. let temp;
  7749. let obj;
  7750. for (let index = 0; index < allBall.length; index++) {
  7751. temp = allBall[index];
  7752. if (temp.destroyed)
  7753. continue;
  7754. obj = cfgArr[temp.myUNID];
  7755. if (obj && obj.src && !obj.src.destroyed) {
  7756. temp.gameObj.x = obj.posX;
  7757. temp.gameObj.y = obj.posY;
  7758. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7759. }
  7760. }
  7761. xGame.common.d2World.getHelpLine();
  7762. }
  7763. updatePlaceBallPos() {
  7764. let arr = xGame.common.d2World.ballArr;
  7765. let temp;
  7766. for (let index = 0; index < arr.length; index++) {
  7767. temp = arr[index];
  7768. if (!this.placeBallPosData[temp.myUNID]) {
  7769. this.placeBallPosData[temp.myUNID] = {
  7770. src: temp,
  7771. posX: temp.gameObj.x,
  7772. posY: temp.gameObj.y
  7773. };
  7774. }
  7775. else {
  7776. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7777. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7778. }
  7779. }
  7780. let check;
  7781. for (const key in this.placeBallPosData) {
  7782. check = this.placeBallPosData[key];
  7783. if (check.src.destroyed) {
  7784. delete this.placeBallPosData[key];
  7785. }
  7786. }
  7787. }
  7788. gameRun(type) {
  7789. if (this.gamePause)
  7790. return;
  7791. this.curFoul = this.getFoulType();
  7792. if (type) {
  7793. xGame.common.d2World.d2Gan.shoot();
  7794. xGame.common.gameUI.forceCancel();
  7795. this.curFoul = type;
  7796. }
  7797. this.isEnd = false;
  7798. this.isChangeTurn = true;
  7799. if (xGame.common.gameMode == GameMode.classic) {
  7800. this.judgeClassic(this.curFoul);
  7801. this.checkClassicWords(() => {
  7802. xGame.common.destroyClassicEmotion();
  7803. if (this.isEnd) {
  7804. if (this.isBlackInHole) {
  7805. xGame.common.gameUI.ui.blackAni.visible = true;
  7806. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7807. xGame.common.gameUI.ui.blackAni.visible = false;
  7808. this.gameEnd();
  7809. }));
  7810. }
  7811. else {
  7812. this.gameEnd();
  7813. }
  7814. }
  7815. else {
  7816. this.waitShoot();
  7817. xGame.eventMgr.event(WAIT_SHOOT);
  7818. }
  7819. });
  7820. }
  7821. else if (xGame.common.gameMode == GameMode.bigMove) {
  7822. xGame.common.aiPlayer.stopRun();
  7823. let scoreArr = this.getScore(this.curFoul);
  7824. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7825. this.isEnd = true;
  7826. }
  7827. this.checkBigSkillWords(() => {
  7828. if (this.isEnd) {
  7829. this.gameEnd();
  7830. }
  7831. else {
  7832. this.waitShoot();
  7833. xGame.eventMgr.event(WAIT_SHOOT);
  7834. }
  7835. });
  7836. }
  7837. else if (xGame.common.gameMode == GameMode.placeBall) {
  7838. xGame.common.destroyAwardSpine();
  7839. let isFoul = this.curFoul == FoulType.rootHole;
  7840. let GoalNum = this.inHoleBalls.length;
  7841. if (this.inHoleBalls.indexOf(0) > -1)
  7842. GoalNum -= 1;
  7843. if (isFoul) {
  7844. this.placeRootBall();
  7845. }
  7846. console.log("neeballs", this.needBalls);
  7847. console.log("当前完成的goalNum", GoalNum);
  7848. this.finishBalls += GoalNum;
  7849. console.log("当前完成的finishballs", this.finishBalls);
  7850. let need = this.needBalls;
  7851. if (this.placeBallData.type == PlaceBallType.challenge) {
  7852. need += 100;
  7853. }
  7854. if (this.finishBalls >= need) {
  7855. this.success = true;
  7856. this.gameEnd();
  7857. }
  7858. else {
  7859. switch (this.placeBallData.type) {
  7860. case PlaceBallType.normal:
  7861. if (!isFoul && GoalNum > 0) {
  7862. this.updatePlaceBallPos();
  7863. this.updatePlaceBallState();
  7864. }
  7865. else {
  7866. this.curHP--;
  7867. this.openRegretView(isFoul, GoalNum);
  7868. }
  7869. this.waitShoot();
  7870. xGame.eventMgr.event(WAIT_SHOOT);
  7871. break;
  7872. case PlaceBallType.challenge:
  7873. this.curHP--;
  7874. this.updatePlaceBallState();
  7875. if (isFoul) {
  7876. this.openRegretView(isFoul, GoalNum, true);
  7877. }
  7878. else {
  7879. this.updatePlaceBallPos();
  7880. if (this.curHP <= 0) {
  7881. this.success = true;
  7882. this.gameEnd();
  7883. }
  7884. }
  7885. this.waitShoot();
  7886. xGame.eventMgr.event(WAIT_SHOOT);
  7887. break;
  7888. default:
  7889. break;
  7890. }
  7891. }
  7892. }
  7893. }
  7894. checkClassicWords(callback) {
  7895. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7896. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7897. let type = this.getClassicWordsType();
  7898. if (condition && type != -1) {
  7899. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7900. xGame.soundMgr.playSound(str);
  7901. xGame.common.wordsMgr.playClassicWords(type, callback);
  7902. }
  7903. else {
  7904. Laya.timer.once(300, this, () => {
  7905. callback && callback();
  7906. });
  7907. }
  7908. }
  7909. getClassicWordsType() {
  7910. let d2world = xGame.common.d2World;
  7911. let type = -1;
  7912. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7913. type = ClassicWordsType.perfectShow;
  7914. return type;
  7915. }
  7916. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7917. type = ClassicWordsType.directShoot;
  7918. return type;
  7919. }
  7920. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7921. type = ClassicWordsType.anotherShoot;
  7922. return type;
  7923. }
  7924. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7925. type = ClassicWordsType.bigPower;
  7926. return type;
  7927. }
  7928. let minSpeed = 1;
  7929. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7930. type = ClassicWordsType.hardShoot;
  7931. return type;
  7932. }
  7933. if (this.inHoleBalls.length > 0) {
  7934. type = ClassicWordsType.directShoot;
  7935. return type;
  7936. }
  7937. return type;
  7938. }
  7939. checkBigSkillWords(callback) {
  7940. if (this.curFoul == FoulType.timeOut) {
  7941. callback && callback();
  7942. }
  7943. else {
  7944. let playSkill = false;
  7945. if (this.selfTurn) {
  7946. playSkill = true;
  7947. }
  7948. else {
  7949. if (!this.aiPlayedBreakArmy) {
  7950. this.aiPlayedBreakArmy = true;
  7951. playSkill = true;
  7952. }
  7953. if (this.aiCurSkill != SkillType.breakArmy) {
  7954. playSkill = true;
  7955. }
  7956. }
  7957. if (xGame.common.skillMgr.playedLastSkill) {
  7958. xGame.common.skillMgr.playedLastSkill = false;
  7959. playSkill = false;
  7960. }
  7961. if (playSkill) {
  7962. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7963. let selfExtra = 0;
  7964. let aiExtra = 0;
  7965. if (this.selfTurn)
  7966. selfExtra += extraScore;
  7967. else
  7968. aiExtra += extraScore;
  7969. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7970. this.isEnd = true;
  7971. }
  7972. this.playBigSkillTimes(callback);
  7973. });
  7974. }
  7975. else {
  7976. this.playBigSkillTimes(callback);
  7977. }
  7978. }
  7979. }
  7980. playBigSkillTimes(callback) {
  7981. let length = this.inHoleBalls.length;
  7982. if (this.inHoleBalls.indexOf(0) > -1) {
  7983. length = this.inHoleBalls.length - 1;
  7984. }
  7985. if (length <= 0) {
  7986. callback && callback();
  7987. return;
  7988. }
  7989. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7990. callback && callback();
  7991. });
  7992. }
  7993. playSkillTips() {
  7994. let levelNum = 0;
  7995. let curType;
  7996. if (this.selfTurn) {
  7997. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7998. curType = this.selfCurSkill;
  7999. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8000. levelNum += 5;
  8001. }
  8002. }
  8003. else {
  8004. levelNum = this.aiSkillLevelNum;
  8005. curType = this.aiCurSkill;
  8006. }
  8007. let str = ``;
  8008. switch (curType) {
  8009. case SkillType.highSpace:
  8010. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8011. break;
  8012. case SkillType.breakArmy:
  8013. str = `You pocketed ${levelNum} extra balls`;
  8014. break;
  8015. case SkillType.ice:
  8016. str = `${levelNum * 2} extra balls were frozen`;
  8017. break;
  8018. case SkillType.fireworks:
  8019. str = `${levelNum} extra balls exploded `;
  8020. break;
  8021. case SkillType.GuanYu:
  8022. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8023. break;
  8024. default:
  8025. break;
  8026. }
  8027. xGame.uiMgr.Show(UIMsg, str);
  8028. }
  8029. getFoulType() {
  8030. let foulType = "";
  8031. if (this.firstColliObj == null) {
  8032. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8033. return FoulType.rootHole;
  8034. }
  8035. return FoulType.notTouch;
  8036. }
  8037. else {
  8038. if (this.selfTurn) {
  8039. if (this.selfBallArr.length > 0) {
  8040. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8041. foulType = FoulType.wrongTouch;
  8042. }
  8043. }
  8044. else {
  8045. if (this.ensureBallType) {
  8046. }
  8047. else {
  8048. if (this.firstColliObj == this.blackNum) {
  8049. foulType = FoulType.wrongTouch;
  8050. }
  8051. }
  8052. }
  8053. }
  8054. else {
  8055. if (this.aiBallArr.length > 0) {
  8056. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8057. foulType = FoulType.wrongTouch;
  8058. }
  8059. }
  8060. else {
  8061. if (this.ensureBallType) {
  8062. }
  8063. else {
  8064. if (this.firstColliObj == this.blackNum) {
  8065. foulType = FoulType.wrongTouch;
  8066. }
  8067. }
  8068. }
  8069. }
  8070. if (this.inHoleBalls.length <= 0) {
  8071. return foulType;
  8072. }
  8073. let temp;
  8074. if (this.inHoleBalls.indexOf(0) > -1) {
  8075. foulType = FoulType.rootHole;
  8076. }
  8077. else {
  8078. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8079. temp = this.inHoleBalls[index];
  8080. if (this.selfTurn) {
  8081. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8082. foulType = FoulType.wrongHole;
  8083. break;
  8084. }
  8085. }
  8086. else {
  8087. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8088. foulType = FoulType.wrongHole;
  8089. break;
  8090. }
  8091. }
  8092. }
  8093. }
  8094. let foo;
  8095. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8096. temp = this.inHoleBalls[index];
  8097. foo = this.selfBallArr.indexOf(temp);
  8098. if (foo > -1) {
  8099. this.selfBallArr.splice(foo, 1);
  8100. }
  8101. foo = this.aiBallArr.indexOf(temp);
  8102. if (foo > -1) {
  8103. this.aiBallArr.splice(foo, 1);
  8104. }
  8105. }
  8106. this.updateLeftBall();
  8107. }
  8108. return foulType;
  8109. }
  8110. judgeGameEndByBlack(arr) {
  8111. if (this.selfTurn) {
  8112. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8113. this.selfFoulNum = this.maxFoulTimes;
  8114. return true;
  8115. }
  8116. }
  8117. else {
  8118. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8119. this.aiFoulNum = this.maxFoulTimes;
  8120. return true;
  8121. }
  8122. }
  8123. }
  8124. judgeClassic(type) {
  8125. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8126. xGame.common.aiPlayer.stopRun();
  8127. if (this.judgeNormalSuccess()) {
  8128. this.isEnd = true;
  8129. return;
  8130. }
  8131. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8132. if (this.selfTurn) {
  8133. if (isFoul) {
  8134. this.selfFoulNum++;
  8135. }
  8136. if (this.selfFoulNum >= this.maxFoulTimes) {
  8137. this.success = false;
  8138. this.isEnd = true;
  8139. return;
  8140. }
  8141. }
  8142. else {
  8143. if (isFoul)
  8144. this.aiFoulNum++;
  8145. if (this.aiFoulNum >= this.maxFoulTimes) {
  8146. this.success = true;
  8147. this.isEnd = true;
  8148. return;
  8149. }
  8150. }
  8151. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8152. this.isChangeTurn = false;
  8153. }
  8154. else {
  8155. this.isInterrupt = true;
  8156. }
  8157. }
  8158. waitShoot() {
  8159. if (xGame.common.gameMode == GameMode.classic) {
  8160. switch (this.curFoul) {
  8161. case FoulType.timeOut:
  8162. case FoulType.rootHole:
  8163. this.selfTurn = !this.selfTurn;
  8164. this.peoplePlay(5, 6, true);
  8165. break;
  8166. case FoulType.notTouch:
  8167. this.selfTurn = !this.selfTurn;
  8168. this.peoplePlay(7, 7);
  8169. break;
  8170. case FoulType.wrongHole:
  8171. this.selfTurn = !this.selfTurn;
  8172. this.peoplePlay(11, 11);
  8173. break;
  8174. default:
  8175. if (this.inHoleBalls.length > 0) {
  8176. this.peoplePlay(0, 0, false, false);
  8177. }
  8178. else {
  8179. this.selfTurn = !this.selfTurn;
  8180. this.peoplePlay(7, 7);
  8181. }
  8182. break;
  8183. }
  8184. }
  8185. else if (xGame.common.gameMode == GameMode.bigMove) {
  8186. if (this.curFoul == FoulType.timeOut) {
  8187. this.selfTurn = !this.selfTurn;
  8188. this.peoplePlay(14, 15);
  8189. this.placeRootBall();
  8190. }
  8191. else {
  8192. this.selfTurn = !this.selfTurn;
  8193. if (this.curFoul == FoulType.rootHole) {
  8194. this.peoplePlay(12, 13);
  8195. this.placeRootBall();
  8196. }
  8197. else {
  8198. this.peoplePlay(0, 0, false, false);
  8199. }
  8200. }
  8201. }
  8202. else if (xGame.common.gameMode == GameMode.placeBall) {
  8203. this.finishOneShoot = true;
  8204. }
  8205. this.gameResult();
  8206. }
  8207. gameResult() {
  8208. this.firstColliObj = null;
  8209. this.inHoleBalls = [];
  8210. let curX = xGame.common.d2World.rootBall.gameObj.x;
  8211. let curY = xGame.common.d2World.rootBall.gameObj.y;
  8212. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  8213. if (xGame.common.uiRodMethod)
  8214. xGame.common.uiRodMethod.resetRod();
  8215. xGame.common.d2World.rootBall.showSelf();
  8216. this.clearIceSkill();
  8217. if (this.selfTurn) {
  8218. console.log("gameResult");
  8219. PlatMgr.gameInsert();
  8220. }
  8221. xGame.common.d3World.knifeRoot.destroyChildren();
  8222. if (this.selfTurn) {
  8223. xGame.common.gameUI.showHelpLineGuide();
  8224. xGame.common.gameUI.setTurnAlpha(true);
  8225. }
  8226. else {
  8227. xGame.common.gameUI.setTurnAlpha(false);
  8228. }
  8229. }
  8230. getScore(type) {
  8231. let selfAdd = 0;
  8232. let aiAdd = 0;
  8233. if (type == FoulType.timeOut) {
  8234. if (this.selfTurn)
  8235. aiAdd += 3;
  8236. else
  8237. selfAdd += 3;
  8238. }
  8239. else {
  8240. if (this.inHoleBalls.length > 0) {
  8241. if (this.selfTurn) {
  8242. if (type == FoulType.rootHole) {
  8243. aiAdd += 3;
  8244. if (this.inHoleBalls.length - 1 > 0) {
  8245. selfAdd += this.inHoleBalls.length - 1;
  8246. }
  8247. }
  8248. else {
  8249. selfAdd += this.inHoleBalls.length;
  8250. }
  8251. }
  8252. else {
  8253. if (type == FoulType.rootHole) {
  8254. selfAdd += 3;
  8255. if (this.inHoleBalls.length - 1 > 0) {
  8256. aiAdd += this.inHoleBalls.length - 1;
  8257. }
  8258. }
  8259. else {
  8260. aiAdd += this.inHoleBalls.length;
  8261. }
  8262. }
  8263. }
  8264. }
  8265. return [selfAdd, aiAdd];
  8266. }
  8267. judgeScoreEnd(selfAdd, aiAdd) {
  8268. this.selfScore += selfAdd;
  8269. this.aiScore += aiAdd;
  8270. this.updateAIScore();
  8271. this.updateSelfScore();
  8272. if (this.selfScore >= this.targertScore) {
  8273. this.success = true;
  8274. return true;
  8275. }
  8276. if (this.aiScore >= this.targertScore) {
  8277. this.success = false;
  8278. return true;
  8279. }
  8280. let ballArr = xGame.common.d2World.ballArr;
  8281. if (ballArr.length == 1 && ballArr[0].number == 0) {
  8282. if (this.selfScore > this.aiScore) {
  8283. this.success = true;
  8284. return true;
  8285. }
  8286. else if (this.selfScore < this.aiScore) {
  8287. this.success = false;
  8288. return true;
  8289. }
  8290. else {
  8291. if (this.selfTurn) {
  8292. this.success = false;
  8293. }
  8294. else {
  8295. this.success = true;
  8296. }
  8297. return true;
  8298. }
  8299. }
  8300. }
  8301. clearIceSkill() {
  8302. let arr = xGame.common.d2World.ballArr;
  8303. let temp;
  8304. if (this.selfTurn) {
  8305. if (this.selfCurSkill == SkillType.ice) {
  8306. for (let index = 0; index < arr.length; index++) {
  8307. temp = arr[index];
  8308. if (temp.ballFunc == "ice") {
  8309. temp.setBallFunc("normal", "self");
  8310. }
  8311. }
  8312. }
  8313. }
  8314. else {
  8315. if (this.aiCurSkill == SkillType.ice) {
  8316. for (let index = 0; index < arr.length; index++) {
  8317. temp = arr[index];
  8318. if (temp.ballFunc == "ice") {
  8319. temp.setBallFunc("normal", "ai");
  8320. }
  8321. }
  8322. }
  8323. }
  8324. }
  8325. judgeNormalSuccess() {
  8326. if (this.selfTurn) {
  8327. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8328. this.success = true;
  8329. return true;
  8330. }
  8331. }
  8332. else {
  8333. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8334. this.success = false;
  8335. return true;
  8336. }
  8337. }
  8338. }
  8339. gameEnd() {
  8340. if (Moyu.isTT) {
  8341. xGame.common.screenImg = getScreenImg();
  8342. }
  8343. console.log("游戏结束", this.success);
  8344. xGame.common.aiPlayer.stopRun();
  8345. if (xGame.common.gameMode == GameMode.placeBall) {
  8346. this.getEndStarNum();
  8347. this.updatePlaceBallState();
  8348. }
  8349. this.isEnter = false;
  8350. Moyu.recordEnd(this, () => {
  8351. if (this.isEnter)
  8352. return;
  8353. this.isEnter = true;
  8354. console.log("进入录结束回调");
  8355. this.enterNext();
  8356. });
  8357. Laya.timer.once(1000, this, () => {
  8358. if (this.isEnter)
  8359. return;
  8360. this.isEnter = true;
  8361. this.enterNext();
  8362. });
  8363. xGame.common.longHelpLine = false;
  8364. }
  8365. enterNext() {
  8366. Laya.timer.clearAll(this);
  8367. if (Moyu.canShare() > 100 || Moyu.isKs) {
  8368. xGame.uiMgr.Show(UIVideoShare, this.success);
  8369. }
  8370. else {
  8371. xGame.uiMgr.Show(UIGameEnd, this.success);
  8372. }
  8373. }
  8374. aiLeave() {
  8375. let ui = xGame.common.gameUI.ui;
  8376. ui.topNode.aiNameTxt.text = "offline";
  8377. }
  8378. aiGameEnd(suc) {
  8379. this.success = suc;
  8380. xGame.common.aiPlayer.stopRun();
  8381. if (this.success) {
  8382. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  8383. Laya.timer.once(1000, this, () => {
  8384. this.clearTime();
  8385. this.gameEnd();
  8386. });
  8387. }
  8388. }
  8389. openTimer() {
  8390. let src = xGame.common.gameUI;
  8391. if (this.selfTurn) {
  8392. src.ui.topNode.selfProgress.visible = true;
  8393. src.ui.topNode.aiProgress.visible = false;
  8394. this.curTimer = src.ui.topNode.selfProgress;
  8395. }
  8396. else {
  8397. src.ui.topNode.selfProgress.visible = false;
  8398. src.ui.topNode.aiProgress.visible = true;
  8399. this.curTimer = src.ui.topNode.aiProgress;
  8400. }
  8401. this.accTime = 0;
  8402. Laya.timer.clearAll(this);
  8403. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  8404. this.curTimer.value = 100;
  8405. }
  8406. updateTime(dt) {
  8407. if (this.gamePause)
  8408. return;
  8409. this.accTime += dt;
  8410. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8411. if (this.accTime >= this.setTime) {
  8412. this.clearTime();
  8413. console.log("时钟进入了gameRun");
  8414. this.gameRun(FoulType.timeOut);
  8415. }
  8416. }
  8417. clearTime() {
  8418. let src = xGame.common.gameUI;
  8419. src.ui.topNode.selfProgress.visible = false;
  8420. src.ui.topNode.aiProgress.visible = false;
  8421. Laya.timer.clearAll(this);
  8422. }
  8423. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8424. let ui = xGame.common.gameUI.ui;
  8425. let selfMsg, aiMsg;
  8426. if (sayWords) {
  8427. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8428. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8429. if (Foul) {
  8430. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8431. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8432. this.placeRootBall();
  8433. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8434. if (this.curFoul == FoulType.rootHole) {
  8435. if (!DataMgr.getRootBallFoul()) {
  8436. DataMgr.setRootBallFoul();
  8437. aiMsg = "";
  8438. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8439. let woman = "Boss, pay attention next time~";
  8440. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8441. }
  8442. }
  8443. else if (this.curFoul == FoulType.timeOut) {
  8444. if (!DataMgr.getTimeoutFoul()) {
  8445. DataMgr.setTimeoutFoul();
  8446. aiMsg = "";
  8447. let tips = "Game timeout, 3 fouls, this game failed.";
  8448. let woman = "Boss, pay attention to the timeline~";
  8449. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8450. }
  8451. }
  8452. }
  8453. }
  8454. }
  8455. if (this.selfTurn) {
  8456. if (sayWords) {
  8457. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8458. ui.selfTurn.visible = true;
  8459. ui.aiTurn.visible = false;
  8460. ui.selfTurn.t0.play();
  8461. Moyu.vibration();
  8462. });
  8463. }
  8464. }
  8465. else {
  8466. let aiNum = xGame.tools.random(1, 11);
  8467. let challengeNum = DataMgr.getChallengeTimes();
  8468. let delay = false;
  8469. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8470. aiNum = 9;
  8471. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8472. aiNum = 3;
  8473. if (challengeNum == 3) {
  8474. if (!this.showLongView) {
  8475. this.showLongView = true;
  8476. delay = true;
  8477. }
  8478. }
  8479. }
  8480. }
  8481. if (delay) {
  8482. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8483. if (success) {
  8484. xGame.common.longHelpLine = true;
  8485. xGame.common.d2World.getHelpLine();
  8486. }
  8487. else {
  8488. aiNum = 10;
  8489. }
  8490. xGame.common.aiPlayer.setAiLevel(aiNum);
  8491. if (sayWords) {
  8492. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8493. xGame.common.aiPlayer.runAI();
  8494. ui.selfTurn.visible = false;
  8495. ui.aiTurn.visible = true;
  8496. ui.aiTurn.t0.play();
  8497. });
  8498. }
  8499. else {
  8500. xGame.common.aiPlayer.runAI();
  8501. }
  8502. this.openTimer();
  8503. this.finishOneShoot = true;
  8504. if (this.selfTurn) {
  8505. ui.topNode.selfKuang.visible = true;
  8506. ui.topNode.aiKuang.visible = false;
  8507. ui.topNode.selfTips.visible = true;
  8508. ui.topNode.aiTips.visible = false;
  8509. }
  8510. else {
  8511. ui.topNode.selfKuang.visible = false;
  8512. ui.topNode.aiKuang.visible = true;
  8513. ui.topNode.selfTips.visible = false;
  8514. ui.topNode.aiTips.visible = true;
  8515. }
  8516. });
  8517. return;
  8518. }
  8519. if (xGame.common.gameMode == GameMode.classic) {
  8520. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8521. if (cfg) {
  8522. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8523. aiNum = aiLevel;
  8524. }
  8525. }
  8526. xGame.common.aiPlayer.setAiLevel(aiNum);
  8527. if (sayWords) {
  8528. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8529. xGame.common.aiPlayer.runAI();
  8530. ui.selfTurn.visible = false;
  8531. ui.aiTurn.visible = true;
  8532. ui.aiTurn.t0.play();
  8533. });
  8534. }
  8535. else {
  8536. xGame.common.aiPlayer.runAI();
  8537. }
  8538. }
  8539. this.openTimer();
  8540. this.finishOneShoot = true;
  8541. if (this.selfTurn) {
  8542. ui.topNode.selfKuang.visible = true;
  8543. ui.topNode.aiKuang.visible = false;
  8544. ui.topNode.selfTips.visible = true;
  8545. ui.topNode.aiTips.visible = false;
  8546. }
  8547. else {
  8548. ui.topNode.selfKuang.visible = false;
  8549. ui.topNode.aiKuang.visible = true;
  8550. ui.topNode.selfTips.visible = false;
  8551. ui.topNode.aiTips.visible = true;
  8552. }
  8553. }
  8554. placeRootBall() {
  8555. let rootBall = xGame.common.d2World.rootBall;
  8556. if (!rootBall)
  8557. return;
  8558. rootBall.gameObj.x = this.lastRootBallPos.x;
  8559. rootBall.gameObj.y = this.lastRootBallPos.y;
  8560. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8561. let moveNode = xGame.common.gameUI.ui.moveNode;
  8562. moveNode.visible = true;
  8563. moveNode.x = this.lastRootBallPos.x;
  8564. moveNode.y = this.lastRootBallPos.y;
  8565. if (!this.selfTurn) {
  8566. xGame.common.aiPlayer.resetRoot();
  8567. }
  8568. }
  8569. }
  8570. class ui_guanyuAni extends fgui.GComponent {
  8571. static createInstance() {
  8572. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8573. }
  8574. onConstruct() {
  8575. this.n0 = (this.getChild("n0"));
  8576. }
  8577. }
  8578. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8579. class UIFireworks extends UIBase {
  8580. constructor() {
  8581. super();
  8582. }
  8583. onConstructor() {
  8584. this.isEject = false;
  8585. }
  8586. show(callback) {
  8587. super.show();
  8588. }
  8589. }
  8590. UIFireworks.uiName = "UIFireworks";
  8591. class ui_UIGuanYu extends fgui.GComponent {
  8592. static createInstance() {
  8593. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8594. }
  8595. onConstruct() {
  8596. this.n2 = (this.getChild("n2"));
  8597. this.n1 = (this.getChild("n1"));
  8598. this.n3 = (this.getChild("n3"));
  8599. this.n4 = (this.getChild("n4"));
  8600. this.n5 = (this.getChild("n5"));
  8601. this.n6 = (this.getChild("n6"));
  8602. this.n8 = (this.getChild("n8"));
  8603. this.n7 = (this.getChild("n7"));
  8604. this.t0 = this.getTransition("t0");
  8605. }
  8606. }
  8607. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8608. class UIGuanYu extends UIBase {
  8609. constructor() {
  8610. super();
  8611. }
  8612. onConstructor() {
  8613. this.ui = ui_UIGuanYu.createInstance();
  8614. this.contentPane = this.ui;
  8615. this.isEject = false;
  8616. }
  8617. show(callback) {
  8618. super.show();
  8619. this.ui.t0.play(Laya.Handler.create(this, () => {
  8620. callback && callback();
  8621. this.hide();
  8622. }));
  8623. }
  8624. }
  8625. UIGuanYu.uiName = "UIGuanYu";
  8626. class SkillMgr {
  8627. constructor() {
  8628. this.leveNum = 0;
  8629. this.extraScore = 0;
  8630. this.selfTurn = false;
  8631. this.playedLastSkill = false;
  8632. this.tweenArr = [];
  8633. this._finishNum = 0;
  8634. this._curFinish = 0;
  8635. this._rootX = 0;
  8636. this._rootY = 0;
  8637. this.knifeTimes = 0;
  8638. this.knifeV2 = new Laya.Vector2();
  8639. this.knifeV3 = new Laya.Vector3();
  8640. this.rtStarX = 0;
  8641. this.rtStarY = 0;
  8642. this.addBigSkillSpine();
  8643. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8644. }
  8645. addBigSkillSpine() {
  8646. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8647. console.log("extra2 success");
  8648. });
  8649. }
  8650. runBigSkill(callback) {
  8651. this.tweenArr = [];
  8652. this.callback = callback;
  8653. this.judgeSkill();
  8654. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8655. let guide = DataMgr.getSkillGuide();
  8656. if (!xGame.common.gameMgr.selfTurn) {
  8657. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8658. }
  8659. else {
  8660. if (xGame.common.temSelfLevel != 0) {
  8661. this.leveNum = xGame.common.temSelfLevel;
  8662. }
  8663. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8664. this.leveNum += 5;
  8665. }
  8666. }
  8667. if (guide == 0) {
  8668. DataMgr.setSkillGuide(1);
  8669. if (DataMgr.getNewUser()) {
  8670. Moyu.sendDataEvent("gameFirstPlay");
  8671. DataMgr.setNewUser();
  8672. }
  8673. }
  8674. this.playSpineAni(() => {
  8675. switch (this.curSkill) {
  8676. case SkillType.highSpace:
  8677. this.runHighSpace();
  8678. break;
  8679. case SkillType.breakArmy:
  8680. this.runBreakArmy();
  8681. break;
  8682. case SkillType.ice:
  8683. this.runIce();
  8684. break;
  8685. case SkillType.fireworks:
  8686. this.runFireworks();
  8687. break;
  8688. case SkillType.GuanYu:
  8689. this.runGuanYu();
  8690. break;
  8691. default:
  8692. break;
  8693. }
  8694. });
  8695. }
  8696. judgeSkill() {
  8697. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8698. let gameMgr = xGame.common.gameMgr;
  8699. let type;
  8700. for (let index = 0; index < typeArr.length; index++) {
  8701. type = typeArr[index];
  8702. if (gameMgr.selfTurn) {
  8703. if (gameMgr.selfCurSkill == type) {
  8704. this.selfTurn = true;
  8705. this.curSkill = type;
  8706. return;
  8707. }
  8708. }
  8709. else {
  8710. if (gameMgr.aiCurSkill == type) {
  8711. this.selfTurn = false;
  8712. this.curSkill = type;
  8713. return;
  8714. }
  8715. }
  8716. }
  8717. }
  8718. playSpineAni(callback) {
  8719. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8720. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8721. parent.destroyChildren();
  8722. let aniIndex = 0;
  8723. let skillSpine;
  8724. switch (this.curSkill) {
  8725. case SkillType.highSpace:
  8726. aniIndex = 1;
  8727. xGame.soundMgr.playSound("skill01");
  8728. skillSpine = this.skillSpine2;
  8729. data.scaleX = 0.5;
  8730. data.scaleY = 0.5;
  8731. skillSpine.play(data, 1, false, parent, () => {
  8732. callback && callback();
  8733. });
  8734. break;
  8735. case SkillType.breakArmy:
  8736. aniIndex = 2;
  8737. xGame.soundMgr.playSound("skill02");
  8738. skillSpine = this.skillSpine2;
  8739. data.scaleX = 0.5;
  8740. data.scaleY = 0.5;
  8741. skillSpine.play(data, 2, false, parent, () => {
  8742. callback && callback();
  8743. });
  8744. break;
  8745. case SkillType.ice:
  8746. aniIndex = 0;
  8747. xGame.soundMgr.playSound("skill03");
  8748. skillSpine = this.skillSpine2;
  8749. data.scaleX = 0.5;
  8750. data.scaleY = 0.5;
  8751. skillSpine.play(data, 0, false, parent, () => {
  8752. callback && callback();
  8753. });
  8754. break;
  8755. case SkillType.fireworks:
  8756. xGame.soundMgr.playSound("skill_04_01");
  8757. xGame.soundMgr.playSound("skill04");
  8758. xGame.uiMgr.Show(UIFireworks, callback);
  8759. break;
  8760. case SkillType.GuanYu:
  8761. xGame.soundMgr.playSound("skill05_1");
  8762. xGame.soundMgr.playSound("skill05");
  8763. xGame.uiMgr.Show(UIGuanYu, callback);
  8764. break;
  8765. default:
  8766. break;
  8767. }
  8768. }
  8769. getAllBallArr() {
  8770. let arr = xGame.common.d2World.ballArr;
  8771. let outArr = [];
  8772. for (let index = 0; index < arr.length; index++) {
  8773. if (arr[index] instanceof D2RootBallSrc)
  8774. continue;
  8775. if (arr[index].ballFunc == "ice")
  8776. continue;
  8777. if (arr[index].destroyed)
  8778. continue;
  8779. outArr.push(arr[index]);
  8780. }
  8781. return outArr;
  8782. }
  8783. getOneArr(deletObj) {
  8784. let allArr = this.getAllBallArr();
  8785. let temp;
  8786. for (let index = 0; index < allArr.length; index++) {
  8787. temp = allArr[index];
  8788. if (temp.id == deletObj.id) {
  8789. allArr.splice(index, 1);
  8790. break;
  8791. }
  8792. }
  8793. return allArr;
  8794. }
  8795. getNearBallBag(ball) {
  8796. let ui = xGame.common.gameUI.ui;
  8797. let circleArr = [];
  8798. for (let index = 1; index <= 6; index++) {
  8799. circleArr.push(ui.border["circle" + index]);
  8800. }
  8801. let outIndex = 0;
  8802. let temp;
  8803. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8804. ;
  8805. let dis = 0;
  8806. for (let index = 1; index < circleArr.length; index++) {
  8807. temp = circleArr[index];
  8808. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8809. if (dis < min) {
  8810. min = dis;
  8811. outIndex = index;
  8812. }
  8813. }
  8814. return [circleArr[outIndex], outIndex];
  8815. }
  8816. ballFlyToBag(ballArr, time = 300) {
  8817. let temp;
  8818. let hole;
  8819. this._finishNum = ballArr.length;
  8820. this._curFinish = 0;
  8821. let holeObj = {};
  8822. let holeCfg = {
  8823. "1": 0,
  8824. "2": 0,
  8825. "3": 0,
  8826. "4": 0,
  8827. "5": 0,
  8828. "6": 0
  8829. };
  8830. for (let index = 0; index < ballArr.length; index++) {
  8831. temp = ballArr[index];
  8832. temp.outColli.isSensor = true;
  8833. temp.innerColli.isSensor = true;
  8834. temp.isRunSkillAni = true;
  8835. let holeArr = this.getNearBallBag(temp);
  8836. hole = holeArr[0];
  8837. holeObj[index] = holeArr[1];
  8838. temp.d3BallSrc.scaleXYZ = 0.5;
  8839. this.tweenArr.push(temp.d3BallSrc, temp);
  8840. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8841. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8842. }));
  8843. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8844. let mIndex = holeObj[this._curFinish];
  8845. let isDone = holeCfg[mIndex];
  8846. if (isDone) {
  8847. ballArr[this._curFinish].checkWrongBall(false);
  8848. }
  8849. else {
  8850. holeCfg[mIndex] = 1;
  8851. ballArr[this._curFinish].checkWrongBall();
  8852. }
  8853. this._curFinish++;
  8854. if (this._curFinish >= this._finishNum) {
  8855. if (this.curSkill == SkillType.highSpace) {
  8856. }
  8857. else if (this.curSkill == SkillType.breakArmy) {
  8858. let rootBall = xGame.common.d2World.rootBall;
  8859. rootBall.gameObj.x = this._rootX;
  8860. rootBall.gameObj.y = this._rootY;
  8861. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8862. xGame.common.d2World.d2Gan.ui.visible = true;
  8863. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8864. xGame.common.d2World.getHelpLine();
  8865. this.callback && this.callback(this.extraScore);
  8866. }
  8867. }
  8868. }));
  8869. }
  8870. }
  8871. runHighSpace() {
  8872. let rootBall = xGame.common.d2World.rootBall;
  8873. rootBall.showSelf();
  8874. let d3Src = rootBall.d3BallSrc;
  8875. let allArr = this.getAllBallArr();
  8876. if (allArr.length <= 0) {
  8877. this.callback && this.callback(0);
  8878. return;
  8879. }
  8880. let selectBall = xGame.common.d2World.targetBall;
  8881. let wrong = selectBall && selectBall.destroyed;
  8882. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8883. selectBall = xGame.common.getRandArrEle(allArr);
  8884. }
  8885. let targetD3Src = selectBall.d3BallSrc;
  8886. xGame.common.d2World.d2Gan.ui.visible = false;
  8887. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8888. d3Src.scaleXYZ = 0.5;
  8889. this.tweenArr.push(d3Src);
  8890. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8891. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8892. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8893. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8894. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8895. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8896. let outArr = [selectBall];
  8897. let other = this.leveNum - 1;
  8898. if (other > 0) {
  8899. let nearArr = this.getOneArr(selectBall);
  8900. if (nearArr.length > 0) {
  8901. xGame.common.botherArr(nearArr);
  8902. if (other >= nearArr.length)
  8903. other = nearArr.length;
  8904. for (let index = 0; index < other; index++) {
  8905. outArr.push(nearArr[index]);
  8906. }
  8907. }
  8908. }
  8909. xGame.common.extraMoveNum = other + 1;
  8910. this.extraScore = other + 1;
  8911. this._rootX = selectBall.gameObj.x;
  8912. this._rootY = selectBall.gameObj.y;
  8913. rootBall.gameObj.x = this._rootX;
  8914. rootBall.gameObj.y = this._rootY;
  8915. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8916. Laya.Tween.clearAll(d3Src);
  8917. this.addRandomForce(outArr);
  8918. }));
  8919. }));
  8920. }
  8921. addRandomForce(outArr) {
  8922. if (outArr.length > 0) {
  8923. xGame.common.d2World.openCheckStill = true;
  8924. this.playedLastSkill = true;
  8925. }
  8926. let temp;
  8927. for (let index = 0; index < outArr.length; index++) {
  8928. let angle = xGame.common.randomNum(0, 360);
  8929. let linearPercent = xGame.common.randomNum(65, 100);
  8930. temp = outArr[index];
  8931. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8932. }
  8933. }
  8934. setLinearSpeed(angle, rigy, linearPercent) {
  8935. let sin = Math.sin(angle * Math.PI / 180);
  8936. let cos = Math.cos(angle * Math.PI / 180);
  8937. let maxSpeed = 4;
  8938. let speed = new Laya.Vector2();
  8939. speed.x = maxSpeed * linearPercent * sin;
  8940. speed.y = -maxSpeed * linearPercent * cos;
  8941. rigy.applyLinearImpulseToCenter(speed);
  8942. }
  8943. runBreakArmy() {
  8944. xGame.common.d2World.d2Gan.ui.visible = false;
  8945. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8946. let gameUI = xGame.common.gameUI.ui;
  8947. gameUI.skillRod.visible = true;
  8948. gameUI.skillRod.rotation = 110;
  8949. let outArr = this.getAllBallArr();
  8950. if (outArr.length <= 0) {
  8951. gameUI.skillRod.visible = false;
  8952. this.callback && this.callback(0);
  8953. return;
  8954. }
  8955. xGame.common.botherArr(outArr);
  8956. if (this.leveNum >= outArr.length)
  8957. this.leveNum = outArr.length;
  8958. let deleteNum = outArr.length - this.leveNum;
  8959. outArr.splice(0, deleteNum);
  8960. this.extraScore = this.leveNum;
  8961. let potX = gameUI.skillRod.x;
  8962. let potY = gameUI.skillRod.y;
  8963. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8964. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8965. let disArr = [];
  8966. for (let index = 0; index < outArr.length; index++) {
  8967. let obj = outArr[index];
  8968. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8969. dis = Math.pow(dis, 0.5);
  8970. disArr.push(dis);
  8971. }
  8972. this.tweenArr.push(gameUI.skillRod);
  8973. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8974. })).update = Laya.Handler.create(this, (e, t, c) => {
  8975. let angle = gameUI.skillRod.rotation;
  8976. let xx;
  8977. let yy;
  8978. let temp;
  8979. for (let index = 0; index < outArr.length; index++) {
  8980. temp = outArr[index];
  8981. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8982. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8983. yy -= 20;
  8984. temp.gameObj.x = xx;
  8985. temp.gameObj.y = yy;
  8986. temp.d3BallSrc.setTransPos(xx, yy);
  8987. }
  8988. if (angle <= 60) {
  8989. Laya.Tween.clearAll(gameUI.skillRod);
  8990. this.ballFlyToBag(outArr, 150);
  8991. gameUI.skillRod.visible = false;
  8992. }
  8993. }, null, false);
  8994. }
  8995. runIce() {
  8996. let ballArr = xGame.common.d2World.ballArr;
  8997. this.leveNum *= 2;
  8998. if (this.leveNum >= ballArr.length - 1)
  8999. this.leveNum = ballArr.length - 1;
  9000. let tempArr = [];
  9001. let outArr = [];
  9002. for (let index = 0; index < ballArr.length; index++) {
  9003. if (ballArr[index] instanceof D2RootBallSrc)
  9004. continue;
  9005. tempArr.push(ballArr[index]);
  9006. }
  9007. if (tempArr.length <= 0) {
  9008. this.callback && this.callback(0);
  9009. return;
  9010. }
  9011. xGame.common.botherArr(tempArr);
  9012. for (let index = 0; index < this.leveNum; index++) {
  9013. outArr.push(tempArr[index]);
  9014. }
  9015. this.extraScore = this.leveNum;
  9016. let temp;
  9017. for (let index = 0; index < outArr.length; index++) {
  9018. temp = outArr[index];
  9019. temp.d3BallSrc.playIceEft();
  9020. }
  9021. Laya.timer.once(2000, this, () => {
  9022. for (let index = 0; index < outArr.length; index++) {
  9023. temp = outArr[index];
  9024. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9025. temp.setBallFunc("ice", str);
  9026. }
  9027. this.callback && this.callback(0);
  9028. });
  9029. }
  9030. runFireworks() {
  9031. let allArr = this.getAllBallArr();
  9032. if (allArr.length <= 0) {
  9033. this.callback && this.callback(0);
  9034. return;
  9035. }
  9036. xGame.common.d2World.d2Gan.ui.visible = false;
  9037. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9038. let outArr = [];
  9039. let other = this.leveNum;
  9040. if (other > 0) {
  9041. if (allArr.length > 0) {
  9042. xGame.common.botherArr(allArr);
  9043. if (other >= allArr.length)
  9044. other = allArr.length;
  9045. for (let index = 0; index < other; index++) {
  9046. outArr.push(allArr[index]);
  9047. }
  9048. }
  9049. }
  9050. xGame.common.extraMoveNum = other;
  9051. this.extraScore = other;
  9052. this.addRandmomFireworks(outArr);
  9053. }
  9054. addRandmomFireworks(outArr) {
  9055. Laya.timer.once(1100, this, () => {
  9056. if (outArr.length > 0) {
  9057. xGame.common.d2World.openCheckStill = true;
  9058. this.playedLastSkill = true;
  9059. }
  9060. });
  9061. xGame.soundMgr.playSound("skill_04_02");
  9062. let temp;
  9063. let delay = -200;
  9064. for (let index = 0; index < outArr.length; index++) {
  9065. temp = outArr[index];
  9066. delay += 200;
  9067. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9068. let angle = xGame.common.randomNum(0, 360);
  9069. angle = this.getFireworksAngle(obj);
  9070. let linearPercent = xGame.common.randomNum(45, 80);
  9071. if (!obj.destroyed)
  9072. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9073. });
  9074. }
  9075. }
  9076. getFireworksAngle(obj) {
  9077. let rootBall = xGame.common.d2World.rootBall;
  9078. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9079. }
  9080. resetGame() {
  9081. Laya.timer.clearAll(this);
  9082. if (this.tweenArr) {
  9083. for (let index = 0; index < this.tweenArr.length; index++) {
  9084. Laya.Tween.clearAll(this.tweenArr[index]);
  9085. }
  9086. }
  9087. this.tweenArr = null;
  9088. }
  9089. runGuanYu() {
  9090. xGame.common.d2World.d2Gan.ui.visible = false;
  9091. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9092. let rootBall = xGame.common.d2World.rootBall;
  9093. if (rootBall.isInHole) {
  9094. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9095. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9096. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9097. rootBall.showSelf();
  9098. }
  9099. this.rtStarX = rootBall.gameObj.x;
  9100. this.rtStarY = rootBall.gameObj.y;
  9101. this.knifeTimes = 0;
  9102. this.playedLastSkill = true;
  9103. rootBall.forceRun = true;
  9104. rootBall.rigy.type = "static";
  9105. xGame.common.d2World.openCheckStill = true;
  9106. this.guanyuRandomKnife();
  9107. }
  9108. guanyuRandomKnife() {
  9109. let rootBall = xGame.common.d2World.rootBall;
  9110. let dir = this.getRandDir();
  9111. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9112. console.log("当前angle", angle);
  9113. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9114. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9115. let dis = 324;
  9116. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9117. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9118. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9119. this.rtStarX = rootBall.gameObj.x;
  9120. this.rtStarY = rootBall.gameObj.y;
  9121. this.knifeTimes++;
  9122. let skillLevel;
  9123. if (xGame.common.gameMgr.selfTurn) {
  9124. skillLevel = DataMgr.getBigSkillByIndex(4);
  9125. }
  9126. else {
  9127. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9128. }
  9129. if (!skillLevel)
  9130. skillLevel = 1;
  9131. skillLevel += 2;
  9132. if (this.knifeTimes < skillLevel) {
  9133. Laya.timer.once(400, this, () => {
  9134. this.guanyuRandomKnife();
  9135. });
  9136. }
  9137. else {
  9138. rootBall.forceRun = false;
  9139. rootBall.rigy.type = "dynamic";
  9140. xGame.common.extraMoveNum = skillLevel;
  9141. }
  9142. }));
  9143. }
  9144. getRandDir() {
  9145. let rootBall = xGame.common.d2World.rootBall;
  9146. let allBall = this.getAllBallArr();
  9147. let target = xGame.common.getRandArrEle(allBall);
  9148. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9149. return this.knifeV2;
  9150. }
  9151. cloneKnife(x, y, rotation) {
  9152. let parent = xGame.common.d3World.knifeRoot;
  9153. let prefab = xGame.common.d3World.knife;
  9154. let clone = prefab.clone();
  9155. parent.addChild(clone);
  9156. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9157. clone.transform.localPositionX = this.knifeV3.x;
  9158. clone.transform.localPositionY = 0;
  9159. clone.transform.localPositionZ = this.knifeV3.z;
  9160. clone.transform.localRotationEulerX = 0;
  9161. clone.transform.localRotationEulerY = rotation;
  9162. clone.transform.localRotationEulerZ = 0;
  9163. clone.active = true;
  9164. return clone;
  9165. }
  9166. cloneGuanYuEft(x, y, angle) {
  9167. return;
  9168. let parent = xGame.common.gameUI.ui.guanyuNode;
  9169. let eft = new ui_guanyuAni();
  9170. eft.parent = parent;
  9171. eft.x = x;
  9172. eft.y = y;
  9173. eft.rotation = angle;
  9174. }
  9175. }
  9176. class ui_UIWordsList extends fgui.GComponent {
  9177. static createInstance() {
  9178. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9179. }
  9180. onConstruct() {
  9181. this.c1 = this.getController("c1");
  9182. this.n74 = (this.getChild("n74"));
  9183. this.clickNode = (this.getChild("clickNode"));
  9184. this.myNode = (this.getChild("myNode"));
  9185. this.n68 = (this.getChild("n68"));
  9186. this.n66 = (this.getChild("n66"));
  9187. this.n55 = (this.getChild("n55"));
  9188. this.wordsBtn = (this.getChild("wordsBtn"));
  9189. this.emotionBtn = (this.getChild("emotionBtn"));
  9190. this.mybggg = (this.getChild("mybggg"));
  9191. this.wordsList = (this.getChild("wordsList"));
  9192. this.emotionList = (this.getChild("emotionList"));
  9193. this.myRoot = (this.getChild("myRoot"));
  9194. }
  9195. }
  9196. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  9197. class EmotionDisplay {
  9198. constructor(index, ui) {
  9199. this.ui = ui;
  9200. this.index = index;
  9201. this.ui.onClick(this, this.clickSelf);
  9202. this.updateSelf();
  9203. }
  9204. updateSelf() {
  9205. let data = cfgTable.emotionData[this.index + 1];
  9206. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  9207. }
  9208. clickSelf() {
  9209. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9210. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  9211. xGame.common.talkMgr.closeTalkView();
  9212. }
  9213. }
  9214. class WordsDisplay {
  9215. constructor(index, ui) {
  9216. this.ui = ui;
  9217. this.index = index;
  9218. this.ui.onClick(this, this.clickSelf);
  9219. this.updateSelf();
  9220. }
  9221. updateSelf() {
  9222. let data = cfgTable.talkwordsData[this.index + 1];
  9223. this.ui.txt.text = data.msg;
  9224. }
  9225. clickSelf() {
  9226. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9227. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  9228. xGame.common.talkMgr.closeTalkView();
  9229. }
  9230. }
  9231. class UIWordsList extends UIBase {
  9232. constructor() {
  9233. super();
  9234. }
  9235. onConstructor() {
  9236. this.ui = ui_UIWordsList.createInstance();
  9237. this.contentPane = this.ui;
  9238. this.isEject = false;
  9239. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  9240. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  9241. this.addUIClick(this.ui.clickNode, this.hide);
  9242. this.initTalkList();
  9243. this.initEmotionList();
  9244. }
  9245. show() {
  9246. super.show();
  9247. }
  9248. initTalkList() {
  9249. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  9250. let data = cfgTable.talkwordsData;
  9251. let length = Object.keys(data).length;
  9252. this.ui.wordsList.numItems = length;
  9253. }
  9254. initEmotionList() {
  9255. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  9256. let data = cfgTable.emotionData;
  9257. let length = Object.keys(data).length;
  9258. this.ui.emotionList.numItems = length;
  9259. }
  9260. renderTalkItem(index, obj) {
  9261. let temp = new WordsDisplay(index, obj);
  9262. }
  9263. renderEmotionItem(index, obj) {
  9264. let temp = new EmotionDisplay(index, obj);
  9265. }
  9266. openTalkList() {
  9267. this.ui.c1.selectedIndex = 0;
  9268. }
  9269. openEmotionList() {
  9270. this.ui.c1.selectedIndex = 1;
  9271. }
  9272. }
  9273. UIWordsList.uiName = "UIWordsList";
  9274. class TalkMgr {
  9275. constructor() {
  9276. this.aiSpeak = true;
  9277. this.emotionList = [];
  9278. this.talkList = [];
  9279. this.addEvent();
  9280. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9281. this.emotionList = [];
  9282. this.talkList = [];
  9283. for (let k in cfgTable.emotionData) {
  9284. this.emotionList.push(cfgTable.emotionData[k].id);
  9285. }
  9286. for (let k in cfgTable.talkwordsData) {
  9287. this.talkList.push(cfgTable.talkwordsData[k].id);
  9288. }
  9289. }
  9290. addEvent() {
  9291. let ui = xGame.common.gameUI.ui;
  9292. ui.wordsBtn.visible = true;
  9293. ui.wordsBtn.onClick(this, this.openTalkView);
  9294. ui.aiWordsBtn.visible = true;
  9295. ui.aiWordsBtn.onClick(this, this.clickAIState);
  9296. }
  9297. openTalkView() {
  9298. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9299. xGame.uiMgr.Show(UIWordsList);
  9300. }
  9301. closeTalkView() {
  9302. xGame.uiMgr.Hide(UIWordsList);
  9303. }
  9304. clickAIState() {
  9305. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9306. this.aiSpeak = !this.aiSpeak;
  9307. this.changeAIState(this.aiSpeak);
  9308. }
  9309. changeAIState(speak) {
  9310. this.aiSpeak = speak;
  9311. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  9312. if (speak) {
  9313. btn.c1.selectedIndex = 0;
  9314. }
  9315. else {
  9316. btn.c1.selectedIndex = 1;
  9317. }
  9318. }
  9319. showSelfTalk(wordsId) {
  9320. let ui = xGame.common.gameUI.ui;
  9321. ui.selfTalk.visible = true;
  9322. ui.selfTalk.myNode.c1.selectedIndex = 1;
  9323. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9324. ui.selfTalk.t0.play();
  9325. }
  9326. showSelfEmotion(emotionId) {
  9327. let ui = xGame.common.gameUI.ui;
  9328. ui.selfTalk.visible = true;
  9329. ui.selfTalk.myNode.c1.selectedIndex = 0;
  9330. this.selfSpine && this.selfSpine.dispose();
  9331. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9332. let spineData = cfgTable.emotionData[emotionId].spine;
  9333. this.selfSpine = new SpineMgr(spineData, () => {
  9334. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  9335. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  9336. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9337. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  9338. });
  9339. ui.selfTalk.t0.play();
  9340. }
  9341. showAITalk(wordsId) {
  9342. if (!this.aiSpeak)
  9343. return;
  9344. if (DataMgr.gameData.gameCount < 2)
  9345. return;
  9346. if (wordsId < 1)
  9347. wordsId = this.getRandTalk();
  9348. let ui = xGame.common.gameUI.ui;
  9349. ui.aiTalk.visible = true;
  9350. ui.aiTalk.myNode.c1.selectedIndex = 1;
  9351. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9352. ui.aiTalk.t0.play();
  9353. }
  9354. getRandTalk() {
  9355. let rand = xGame.tools.random(0, this.talkList.length);
  9356. return this.emotionList[rand];
  9357. }
  9358. getRandEmotion() {
  9359. let rand = xGame.tools.random(0, this.emotionList.length);
  9360. return this.emotionList[rand];
  9361. }
  9362. showAIEmotion(emotionId) {
  9363. if (!this.aiSpeak)
  9364. return;
  9365. if (DataMgr.gameData.gameCount < 2)
  9366. return;
  9367. if (emotionId < 1)
  9368. emotionId = this.getRandEmotion();
  9369. let ui = xGame.common.gameUI.ui;
  9370. ui.aiTalk.visible = true;
  9371. ui.aiTalk.myNode.c1.selectedIndex = 0;
  9372. this.aiSpine && this.aiSpine.dispose();
  9373. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9374. let spineData = cfgTable.emotionData[emotionId].spine;
  9375. this.aiSpine = new SpineMgr(spineData, () => {
  9376. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  9377. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  9378. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9379. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  9380. });
  9381. ui.aiTalk.t0.play();
  9382. }
  9383. resetGame() {
  9384. let ui = xGame.common.gameUI.ui;
  9385. ui.aiTalk.visible = false;
  9386. ui.selfTalk.visible = false;
  9387. this.aiSpine && this.aiSpine.dispose();
  9388. this.selfSpine && this.selfSpine.dispose();
  9389. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9390. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9391. this.closeTalkView();
  9392. }
  9393. }
  9394. class WordsMgr {
  9395. constructor() {
  9396. this.comboTimes = 1;
  9397. this.skillTimes = 0;
  9398. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  9399. this.comboSpine = new SpineMgr("yxz_liangan");
  9400. this.skillSpine = new SpineMgr("yiganxqiu");
  9401. this.scoreSpine = new SpineMgr("defen");
  9402. }
  9403. setClassicCombo(isInterrupt) {
  9404. if (isInterrupt) {
  9405. this.comboTimes = 0;
  9406. }
  9407. }
  9408. playClassicWords(type, callback) {
  9409. this.callback = callback;
  9410. let aniIndex = type;
  9411. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9412. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9413. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9414. mySpine.destroy(true);
  9415. this.playClassicTimes();
  9416. });
  9417. }
  9418. playClassicTimes() {
  9419. this.comboTimes++;
  9420. if (this.comboTimes <= 1) {
  9421. this.callback && this.callback();
  9422. }
  9423. else {
  9424. let aniIndex = this.comboTimes - 1;
  9425. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9426. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9427. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9428. mySpine.destroy(true);
  9429. this.callback && this.callback();
  9430. });
  9431. }
  9432. }
  9433. playBigSkillTimes(times, callback) {
  9434. if (times <= 0) {
  9435. callback && callback();
  9436. return;
  9437. }
  9438. this.callback = callback;
  9439. let pre = "sz_0";
  9440. let aniIndex = 0;
  9441. this.getWordsImg(times, pre, () => {
  9442. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9443. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9444. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9445. let r1 = ``;
  9446. let r2 = ``;
  9447. if (times <= 9) {
  9448. r1 = `res/d2Res/${pre}${times}.png`;
  9449. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9450. aniIndex = 0;
  9451. }
  9452. else {
  9453. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9454. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9455. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9456. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9457. aniIndex = 1;
  9458. }
  9459. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9460. mySpine.destroy(true);
  9461. xGame.common.gameMgr.playSkillTips();
  9462. this.playScore(times);
  9463. xGame.common.playRandomMutiBallBigSkillSound();
  9464. }, mySpine);
  9465. });
  9466. }
  9467. playScore(score) {
  9468. let pre = "sz_";
  9469. let aniIndex = 0;
  9470. this.getWordsImg(score, pre, () => {
  9471. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9472. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9473. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9474. let r1 = ``;
  9475. let r2 = ``;
  9476. if (score <= 9) {
  9477. r1 = `res/d2Res/${pre}${score}.png`;
  9478. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9479. aniIndex = 0;
  9480. }
  9481. else {
  9482. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9483. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9484. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9485. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9486. aniIndex = 1;
  9487. }
  9488. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9489. mySpine.destroy(true);
  9490. this.callback && this.callback();
  9491. }, mySpine);
  9492. });
  9493. }
  9494. getWordsImg(number, pre = "", callback) {
  9495. let arr = [];
  9496. if (number <= 9) {
  9497. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9498. }
  9499. else {
  9500. 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 });
  9501. }
  9502. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9503. callback && callback();
  9504. }));
  9505. }
  9506. }
  9507. class ui_UIRodMethod extends fgui.GComponent {
  9508. static createInstance() {
  9509. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9510. }
  9511. onConstruct() {
  9512. this.n24 = (this.getChild("n24"));
  9513. this.white = (this.getChild("white"));
  9514. this.dot = (this.getChild("dot"));
  9515. this.sureBtn = (this.getChild("sureBtn"));
  9516. this.n20 = (this.getChild("n20"));
  9517. this.n21 = (this.getChild("n21"));
  9518. this.n22 = (this.getChild("n22"));
  9519. this.n23 = (this.getChild("n23"));
  9520. this.n5 = (this.getChild("n5"));
  9521. this.n14 = (this.getChild("n14"));
  9522. this.t0 = this.getTransition("t0");
  9523. }
  9524. }
  9525. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9526. class UIRodMethod extends UIBase {
  9527. constructor() {
  9528. super();
  9529. this.isPressd = false;
  9530. }
  9531. onConstructor() {
  9532. this.ui = ui_UIRodMethod.createInstance();
  9533. this.contentPane = this.ui;
  9534. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9535. this.moveDir = new Laya.Vector2();
  9536. this.moveDest = new Laya.Vector2();
  9537. this.centerPos = new Laya.Vector2();
  9538. xGame.common.uiRodMethod = this;
  9539. }
  9540. show() {
  9541. super.show();
  9542. xGame.common.gameMgr.gamePause = true;
  9543. this.openPressDotEvent();
  9544. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9545. this.centerPos.x = this.ui.white.x;
  9546. this.centerPos.y = this.ui.white.y;
  9547. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9548. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9549. this.setDot();
  9550. }
  9551. setDot() {
  9552. this.ui.dot.x = this.moveDest.x;
  9553. this.ui.dot.y = this.moveDest.y;
  9554. }
  9555. closeSelf() {
  9556. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9557. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9558. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9559. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9560. xGame.common.gameMgr.gamePause = false;
  9561. this.hide();
  9562. }
  9563. openPressDotEvent() {
  9564. this.closePressDotEvent();
  9565. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9566. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9567. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9568. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9569. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9570. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9571. }
  9572. closePressDotEvent() {
  9573. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9574. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9575. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9576. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9577. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9578. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9579. }
  9580. onDown(e) {
  9581. if (e.type == Laya.Event.MOUSE_DOWN)
  9582. this.isPressd = true;
  9583. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9584. this.isPressd = false;
  9585. if (!this.isPressd)
  9586. return;
  9587. this.moveDest.x = e.stageX;
  9588. this.moveDest.y = e.stageY;
  9589. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9590. if (dis > 6724) {
  9591. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9592. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9593. }
  9594. this.setDot();
  9595. }
  9596. resetRod() {
  9597. this.ui.dot.x = this.ui.white.x;
  9598. this.ui.dot.y = this.ui.white.y;
  9599. this.gameRod.dot.x = this.gameRod.bg.x;
  9600. this.gameRod.dot.y = this.gameRod.bg.y;
  9601. xGame.common.rodOffest.x = 0;
  9602. xGame.common.rodOffest.y = 0;
  9603. }
  9604. }
  9605. UIRodMethod.uiName = "UIRodMethod";
  9606. class UIGame extends UIBase {
  9607. constructor() {
  9608. super();
  9609. this.powerNum = 0;
  9610. this.isD3Inited = false;
  9611. this.isPrePlay = false;
  9612. this.isMoveRod = false;
  9613. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9614. this.rulerDis = 20;
  9615. this.rulerOffset = 0;
  9616. }
  9617. onConstructor() {
  9618. this.ui = ui_UIGame.createInstance();
  9619. this.contentPane = this.ui;
  9620. this.ui.x += xGame.common.sysOffestNum;
  9621. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9622. this.isEject = false;
  9623. xGame.common.gameUI = this;
  9624. this.initSelf();
  9625. }
  9626. isTurnSelf() {
  9627. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9628. return true;
  9629. }
  9630. }
  9631. initSelf() {
  9632. let topUI = this.ui.topNode;
  9633. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9634. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9635. this.barInfo = {};
  9636. this.barInfo.curY = 0;
  9637. this.barInfo.height = this.ui.powerNode.height;
  9638. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9639. this.barInfo.powerStartY = this.ui.powerNode.y;
  9640. xGame.common.aiPlayer = new AIPlayer();
  9641. xGame.common.gameMgr = new GameMgr();
  9642. xGame.common.skillMgr = new SkillMgr();
  9643. xGame.common.wordsMgr = new WordsMgr();
  9644. xGame.common.talkMgr = new TalkMgr();
  9645. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9646. console.log("加载经典模式表情文件chenggon !");
  9647. });
  9648. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9649. console.log("挑战模式奖励模式spine加载成功!");
  9650. });
  9651. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9652. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9653. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9654. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9655. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9656. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9657. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9658. }
  9659. getGanZiImg() {
  9660. let index = DataMgr.getCurBallRod();
  9661. let data = cfgTable.ballrodData[index + 1];
  9662. let gan_url = xGame.common.getGameIconUrl(data.img);
  9663. console.log('zh:getGanZiImg gan_url==' + gan_url);
  9664. this.ui.powerNode.showImg.url = gan_url;
  9665. console.log('zh:修改杆子图标O K');
  9666. }
  9667. returnHome() {
  9668. let tips = "Are you sure to exit the game?";
  9669. let woman = "Boss, why don't you play for a while longer?";
  9670. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9671. }
  9672. addRodMethodClick() {
  9673. if (this.isTurnSelf()) {
  9674. xGame.uiMgr.Show(UIRodMethod);
  9675. }
  9676. }
  9677. clickHelpLineBtn(force = false) {
  9678. if (!this.isTurnSelf())
  9679. return;
  9680. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9681. if (success) {
  9682. xGame.common.longHelpLine = true;
  9683. xGame.common.d2World.getHelpLine();
  9684. Moyu.sendDataEvent("guideNum");
  9685. }
  9686. else {
  9687. }
  9688. });
  9689. }
  9690. renderSelfDisplayBalls(index, target) {
  9691. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9692. target.myImg.url = xGame.common.getGameIconUrl(str);
  9693. }
  9694. renderAIDisplayBalls(index, target) {
  9695. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9696. target.myImg.url = xGame.common.getGameIconUrl(str);
  9697. ;
  9698. }
  9699. updateMode() {
  9700. if (xGame.common.gameMode == GameMode.classic) {
  9701. this.ui.topNode.scoreNode.visible = false;
  9702. }
  9703. else if (xGame.common.gameMode == GameMode.bigMove) {
  9704. this.ui.topNode.scoreNode.visible = true;
  9705. }
  9706. }
  9707. show() {
  9708. super.show();
  9709. console.log("zh:uigame show AADD");
  9710. this.ui.alpha = 0;
  9711. this.updateSelf();
  9712. xGame.common.gameMgr.gamePause = false;
  9713. xGame.common.gameUI.ui.blackAni.visible = false;
  9714. xGame.common.gameUI.ui.whiteAni.visible = false;
  9715. this.ui.powerEft.visible = false;
  9716. this.ui.colorNode.visible = false;
  9717. this.updateHead();
  9718. let curUse = DataMgr.getCurBallRod();
  9719. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  9720. this.getGanZiImg();
  9721. }
  9722. updateSelf() {
  9723. if (xGame.common.gameMode == GameMode.classic) {
  9724. this.ui.c1.selectedIndex = 0;
  9725. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9726. this.ui.topNode.middleNode.visible = true;
  9727. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9728. }
  9729. else if (xGame.common.gameMode == GameMode.bigMove) {
  9730. this.ui.c1.selectedIndex = 0;
  9731. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9732. this.ui.topNode.middleNode.visible = false;
  9733. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9734. let rand = xGame.common.randomNum(1, max);
  9735. let guide = DataMgr.getSkillGuide();
  9736. if (guide == 0)
  9737. rand = 1;
  9738. xGame.common.bigMoveLevelIndex = rand;
  9739. }
  9740. else if (xGame.common.gameMode == GameMode.placeBall) {
  9741. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9742. this.ui.c1.selectedIndex = 1 + data.type;
  9743. this.ui.alpha = 1;
  9744. this.startGame();
  9745. }
  9746. this.updateMode();
  9747. this.initD3world();
  9748. this.initD2world();
  9749. }
  9750. startGame() {
  9751. this.ui.snowNode.visible = Math.random() <= 0.1;
  9752. this.ui.d2Node.visible = false;
  9753. xGame.common.d3World.d3Hand.gameObj.active = false;
  9754. xGame.common.d3World.tableSrc.init();
  9755. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9756. this.cameraViewChange(() => {
  9757. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9758. switch (xGame.common.gameMode) {
  9759. case GameMode.classic:
  9760. xGame.common.d3World.d3Hand.gameObj.active = true;
  9761. this.playPutBallD3Ani();
  9762. break;
  9763. case GameMode.bigMove:
  9764. this.enterGame();
  9765. Laya.timer.once(500, this, () => {
  9766. this.ui.topNode.middleNode.visible = true;
  9767. this.ui.topNode.middleNode.t0.play();
  9768. });
  9769. break;
  9770. case GameMode.placeBall:
  9771. this.enterGame();
  9772. break;
  9773. default:
  9774. break;
  9775. }
  9776. });
  9777. PlatMgr.showBanner(false);
  9778. }
  9779. enterGame() {
  9780. this.ui.d2Node.visible = true;
  9781. xGame.common.d3World.d3Hand.gameObj.active = false;
  9782. xGame.common.showOneCamera("mainCamera");
  9783. Moyu.recordGame(30, true);
  9784. if (!this.isPrePlay) {
  9785. this.isPrePlay = true;
  9786. xGame.common.d3World.prePlayEft();
  9787. }
  9788. xGame.common.gameMgr.gameReady();
  9789. this.openAllEvent();
  9790. this.ui.snowNode.visible = false;
  9791. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9792. this.ui.helpBtn.visible = condition;
  9793. }
  9794. showHelpLineGuide() {
  9795. let longGuide = DataMgr.getGuideHelpLine();
  9796. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9797. this.ui.helpBtn.visible = true;
  9798. this.ui.guideNode.visible = true;
  9799. }
  9800. }
  9801. setTurnAlpha(alpha) {
  9802. this.ui.keduNode.alpha = alpha;
  9803. this.ui.ganNode.alpha = alpha;
  9804. this.ui.rodMethodNode.alpha = alpha;
  9805. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9806. }
  9807. cameraViewChange(callback) {
  9808. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9809. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9810. xGame.common.showOneCamera("visitAngle");
  9811. cameraSrc.localRotationEulerY = 180;
  9812. cameraSrc.localRotationEulerZ = 0;
  9813. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9814. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9815. callback && callback();
  9816. }));
  9817. }));
  9818. }
  9819. playPutBallD3Ani() {
  9820. xGame.common.showOneCamera("mainCamera");
  9821. let handSrc = xGame.common.d3World.d3Hand;
  9822. handSrc.gameObj.active = true;
  9823. handSrc.transform.localPositionZ = 3;
  9824. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9825. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9826. handSrc.gameObj.active = false;
  9827. this.enterGame();
  9828. }), 400);
  9829. }));
  9830. }
  9831. updateHead() {
  9832. let user = Moyu.getUserInfo();
  9833. this.ui.topNode.selfNameTxt.text = user.nickName;
  9834. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9835. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9836. if (DataMgr.getSkillGuide() < 1) {
  9837. this.ui.topNode.aiNameTxt.text = 'billiards';
  9838. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9839. }
  9840. else {
  9841. this.ui.topNode.aiNameTxt.text = aiData.name;
  9842. let randNo = Math.floor(Math.random() * 10) + 1;
  9843. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9844. }
  9845. }
  9846. initD2world() {
  9847. let node = this.ui.d2Root.displayObject;
  9848. let src = node.getComponent(D2World);
  9849. if (!src) {
  9850. xGame.common.d2World = node.addComponent(D2World);
  9851. }
  9852. xGame.common.d2World.initSelf();
  9853. }
  9854. initD3world() {
  9855. if (this.isD3Inited)
  9856. return;
  9857. this.isD3Inited = true;
  9858. let scene3D = xGame.common.d3Scene;
  9859. this.ui.d3Root.displayObject.addChild(scene3D);
  9860. scene3D.active = true;
  9861. xGame.common.d3World.tableSrc.setBorderPos();
  9862. }
  9863. onRootMove(e) {
  9864. let rootBall = xGame.common.d2World.rootBall;
  9865. this.ui.moveNode.x = e.x;
  9866. this.ui.moveNode.y = e.y;
  9867. rootBall.gameObj.x = e.x;
  9868. rootBall.gameObj.y = e.y;
  9869. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9870. }
  9871. aiRootMove(move) {
  9872. if (move)
  9873. this.hideBallUI();
  9874. else {
  9875. this.showBallUI();
  9876. xGame.common.d2World.getHelpLine();
  9877. }
  9878. }
  9879. aiForce(type, force = 0) {
  9880. this.pressTarget = PressType.powerNode;
  9881. if (type == 1)
  9882. this.onEventUp({ force: true });
  9883. else if (type == 2)
  9884. this.onEventMove({ stageY: force, force: true });
  9885. }
  9886. onEventPress(e) {
  9887. if (e.stopPropagation)
  9888. e.stopPropagation();
  9889. if (!this.isTurnSelf())
  9890. return;
  9891. let target = e.target;
  9892. switch (target) {
  9893. case this.ui.myPowerNode.displayObject:
  9894. this.pressTarget = PressType.powerNode;
  9895. this.barInfo.curY = e.stageY;
  9896. this.updateBarInfo();
  9897. break;
  9898. case this.ui.moveNode.displayObject:
  9899. this.pressTarget = PressType.moveNode;
  9900. this.hideBallUI();
  9901. this.eventObj.curX = this.ui.moveNode.x;
  9902. this.eventObj.curY = this.ui.moveNode.y;
  9903. this.ui.moveNode.finger.visible = false;
  9904. this.eventObj.lastX = e.stageX;
  9905. this.eventObj.lastY = e.stageY;
  9906. break;
  9907. case this.ui.rulerClickNode.displayObject:
  9908. this.pressTarget = PressType.rulerNode;
  9909. this.eventObj.lastY = e.stageY;
  9910. break;
  9911. case this.ui.d2Root.displayObject:
  9912. this.pressTarget = PressType.d2Root;
  9913. this.eventObj.lastX = e.stageX;
  9914. this.eventObj.lastY = e.stageY;
  9915. this.eventObj.starX = e.stageX;
  9916. this.eventObj.starY = e.stageY;
  9917. this.eventObj.curX = 0;
  9918. this.eventObj.curY = 0;
  9919. xGame.common.d2World.d2Gan.setGanLastInfo();
  9920. this.rulerOffset = 0;
  9921. break;
  9922. default:
  9923. break;
  9924. }
  9925. }
  9926. onEventMove(e) {
  9927. if (e.stopPropagation)
  9928. e.stopPropagation();
  9929. if (e && e.force) {
  9930. }
  9931. else {
  9932. if (!this.isTurnSelf())
  9933. return;
  9934. }
  9935. switch (this.pressTarget) {
  9936. case PressType.powerNode:
  9937. this.barInfo.curY = e.stageY;
  9938. this.updateBarInfo();
  9939. this.isMoveRod = true;
  9940. break;
  9941. case PressType.moveNode:
  9942. let rootBall = xGame.common.d2World.rootBall;
  9943. let radius = rootBall.gameObj.width / 2;
  9944. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9945. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9946. let border = xGame.common.d2World.borderRect;
  9947. if (curX <= border.x + radius)
  9948. curX = border.x + radius;
  9949. else if (curX >= border.x + border.width - radius)
  9950. curX = border.x + border.width - radius;
  9951. if (curY <= border.y + radius)
  9952. curY = border.y + radius;
  9953. else if (curY >= border.y + border.height - radius)
  9954. curY = border.y + border.height - radius;
  9955. if (xGame.common.gameMgr.isOpenBall) {
  9956. if (curX >= border.x + border.openBallW - radius)
  9957. curX = border.x + border.openBallW - radius;
  9958. }
  9959. this.ui.moveNode.x = curX;
  9960. this.ui.moveNode.y = curY;
  9961. rootBall.gameObj.x = curX;
  9962. rootBall.gameObj.y = curY;
  9963. rootBall.d3BallSrc.setTransPos(curX, curY);
  9964. this.isMoveRod = true;
  9965. break;
  9966. case PressType.rulerNode:
  9967. let yy = e.stageY - this.eventObj.lastY;
  9968. this.eventObj.lastY = e.stageY;
  9969. let ruler1 = this.ui.rulerNode.img1;
  9970. let ruler2 = this.ui.rulerNode.img2;
  9971. ruler1.y += yy;
  9972. ruler2.y += yy;
  9973. this.rulerOffset += yy;
  9974. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9975. this.rulerOffset = 0;
  9976. xGame.soundMgr.playSound("inch", 1, 10);
  9977. }
  9978. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9979. let h = ruler1.height;
  9980. this.checkGuide();
  9981. this.isMoveRod = true;
  9982. if (ruler1.y >= h) {
  9983. ruler1.y = -h;
  9984. ruler2.y = 0;
  9985. return;
  9986. }
  9987. else if (ruler1.y <= -h) {
  9988. ruler1.y = h;
  9989. ruler2.y = 0;
  9990. return;
  9991. }
  9992. if (ruler2.y >= h) {
  9993. ruler2.y = -h;
  9994. ruler1.y = 0;
  9995. return;
  9996. }
  9997. else if (ruler2.y <= -h) {
  9998. ruler2.y = h;
  9999. ruler1.y = 0;
  10000. return;
  10001. }
  10002. break;
  10003. case PressType.d2Root:
  10004. this.eventObj.curX = e.stageX;
  10005. this.eventObj.curY = e.stageY;
  10006. let offset = this.checkRodMoveDir();
  10007. xGame.common.d2World.d2Gan.rotateSelf(offset);
  10008. this.eventObj.lastX = e.stageX;
  10009. this.eventObj.lastY = e.stageY;
  10010. break;
  10011. default:
  10012. break;
  10013. }
  10014. }
  10015. onEventUp(e) {
  10016. if (e.stopPropagation)
  10017. e.stopPropagation();
  10018. if (e && e.force) {
  10019. }
  10020. else {
  10021. if (!this.isTurnSelf())
  10022. return;
  10023. }
  10024. switch (this.pressTarget) {
  10025. case PressType.powerNode:
  10026. this.ui.powerNode.value = 0;
  10027. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10028. this.ui.powerTxt.text = "";
  10029. if (this.powerNum > 0) {
  10030. xGame.eventMgr.event(BALL_SHOOT);
  10031. xGame.common.d2World.shoot(this.powerNum);
  10032. xGame.common.d2World.d2Gan.shoot();
  10033. xGame.common.d2World.d2HelpLine.shoot();
  10034. this.finishGuide();
  10035. this.ui.powerEft.visible = false;
  10036. this.ui.colorNode.visible = false;
  10037. let ganStr = "";
  10038. if (this.powerNum <= 30) {
  10039. ganStr = "gan_30";
  10040. }
  10041. else if (this.powerNum <= 60) {
  10042. ganStr = "gan_50";
  10043. }
  10044. else {
  10045. ganStr = "gan_80";
  10046. }
  10047. xGame.soundMgr.playSound(ganStr);
  10048. }
  10049. break;
  10050. case PressType.moveNode:
  10051. let rootBall = xGame.common.d2World.rootBall;
  10052. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10053. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10054. let isIntersect = this.judgeBallIntersect();
  10055. if (isIntersect) {
  10056. this.ui.moveNode.x = lastX;
  10057. this.ui.moveNode.y = lastY;
  10058. rootBall.gameObj.x = lastX;
  10059. rootBall.gameObj.y = lastY;
  10060. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10061. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10062. }
  10063. else {
  10064. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10065. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10066. }
  10067. this.showBallUI();
  10068. this.ui.moveNode.finger.visible = true;
  10069. xGame.common.d2World.getHelpLine();
  10070. break;
  10071. case PressType.rulerNode:
  10072. break;
  10073. case PressType.d2Root:
  10074. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10075. if (dis <= 25) {
  10076. this.moveToClickDot(e);
  10077. }
  10078. break;
  10079. default:
  10080. break;
  10081. }
  10082. this.pressTarget = -1;
  10083. }
  10084. checkGuide() {
  10085. let guide = DataMgr.getSkillGuide();
  10086. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10087. xGame.common.guideStep++;
  10088. xGame.common.gameUI.ui.guide2.visible = false;
  10089. xGame.common.gameUI.ui.guide3.visible = true;
  10090. }
  10091. }
  10092. finishGuide() {
  10093. let guide = DataMgr.getSkillGuide();
  10094. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10095. xGame.common.guideStep = 10;
  10096. this.closeAllGuide();
  10097. }
  10098. }
  10099. closeAllGuide() {
  10100. xGame.common.gameUI.ui.guide1.visible = false;
  10101. xGame.common.gameUI.ui.guide2.visible = false;
  10102. xGame.common.gameUI.ui.guide3.visible = false;
  10103. }
  10104. updateBarInfo() {
  10105. let star = this.ui.powerNode.y;
  10106. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10107. if (rate >= 1)
  10108. rate = 1;
  10109. if (rate <= 0)
  10110. rate = 0;
  10111. this.powerNum = Math.ceil(rate * 100);
  10112. this.ui.powerNode.value = this.powerNum;
  10113. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10114. this.ui.colorNode.value = this.powerNum;
  10115. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10116. this.ui.powerEft.visible = this.powerNum != 0;
  10117. this.ui.colorNode.visible = this.powerNum != 0;
  10118. this.ui.powerTxt.text = this.powerNum + "";
  10119. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10120. }
  10121. forceCancel() {
  10122. this.ui.powerNode.value = 0;
  10123. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10124. this.ui.powerTxt.text = "";
  10125. }
  10126. checkRodMoveDir() {
  10127. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10128. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10129. if (tempX >= 0 && tempY <= 0) {
  10130. return this.checkDir();
  10131. }
  10132. else if (tempX < 0 && tempY < 0) {
  10133. return this.checkDir(1, -1);
  10134. }
  10135. else if (tempX < 0 && tempY > 0) {
  10136. return this.checkDir(-1, -1);
  10137. }
  10138. else {
  10139. return this.checkDir(-1, 1);
  10140. }
  10141. }
  10142. checkDir(flagX = 1, flagY = 1) {
  10143. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10144. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10145. if (offsetY == 0) {
  10146. return offsetX * flagX;
  10147. }
  10148. if (offsetX == 0) {
  10149. return offsetY * flagY;
  10150. }
  10151. let angle = offsetY / offsetX;
  10152. if (Math.abs(angle) >= 1) {
  10153. return offsetY * flagY;
  10154. }
  10155. else {
  10156. return offsetX * flagX;
  10157. }
  10158. }
  10159. judgeBallIntersect() {
  10160. let rootBall = xGame.common.d2World.rootBall;
  10161. let ballArr = xGame.common.d2World.ballArr;
  10162. let radius = rootBall.gameObj.width / 2;
  10163. let temp;
  10164. let isIntersect = false;
  10165. for (let index = 0; index < ballArr.length; index++) {
  10166. temp = ballArr[index];
  10167. if (temp.number == rootBall.number)
  10168. continue;
  10169. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10170. if (isIntersect) {
  10171. break;
  10172. }
  10173. }
  10174. return isIntersect;
  10175. }
  10176. hideBallUI() {
  10177. let d2Gan = xGame.common.d2World.d2Gan;
  10178. if (!d2Gan.ui.isDisposed)
  10179. d2Gan.ui.visible = false;
  10180. let d2Help = xGame.common.d2World.d2HelpLine;
  10181. if (!d2Help.ui.isDisposed)
  10182. d2Help.ui.visible = false;
  10183. let rootBall = xGame.common.d2World.rootBall;
  10184. if (!rootBall.destroyed) {
  10185. rootBall.gameObj.active = false;
  10186. }
  10187. }
  10188. showBallUI() {
  10189. let d2Gan = xGame.common.d2World.d2Gan;
  10190. if (!d2Gan.ui.isDisposed)
  10191. d2Gan.ui.visible = true;
  10192. let d2Help = xGame.common.d2World.d2HelpLine;
  10193. if (!d2Help.ui.isDisposed)
  10194. d2Help.ui.visible = true;
  10195. let rootBall = xGame.common.d2World.rootBall;
  10196. if (!rootBall.destroyed) {
  10197. rootBall.gameObj.active = true;
  10198. }
  10199. }
  10200. moveToClickDot(e) {
  10201. if (!this.isMoveRod && !xGame.common.clickedBall) {
  10202. let root = xGame.common.d2World.rootBall.gameObj;
  10203. let xx = e.stageX - xGame.common.sysOffestNum;
  10204. let yy = e.stageY;
  10205. let x = xx - root.x;
  10206. let y = yy - root.y;
  10207. let angle = xGame.common.getfguiRotation(x, y);
  10208. xGame.common.d2World.d2Gan.ui.rotation = angle;
  10209. xGame.common.d2World.getHelpLine();
  10210. }
  10211. this.isMoveRod = false;
  10212. xGame.common.clickedBall = false;
  10213. }
  10214. openAllEvent() {
  10215. this.closeAllEvent();
  10216. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10217. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10218. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10219. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10220. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10221. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10222. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10223. }
  10224. closeAllEvent() {
  10225. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10226. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10227. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10228. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10229. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10230. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10231. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10232. }
  10233. resetGame() {
  10234. this.closeAllEvent();
  10235. this.hideBallUI();
  10236. xGame.common.gameMgr.gamePause = true;
  10237. }
  10238. }
  10239. UIGame.uiName = "UIGame";
  10240. class UIAddProp extends UIBase {
  10241. constructor() {
  10242. super();
  10243. this.curType = "";
  10244. }
  10245. onConstructor() {
  10246. this.ui = ui_UIAddProp.createInstance();
  10247. this.contentPane = this.ui;
  10248. this.isEject = false;
  10249. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  10250. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  10251. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  10252. this.updateUI();
  10253. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  10254. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  10255. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  10256. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  10257. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  10258. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  10259. }
  10260. show(type) {
  10261. super.show();
  10262. this.curType = type == 0 ? "coin" : "diamond";
  10263. this.switchBtn("");
  10264. this.ui.t0.play();
  10265. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  10266. PlatMgr.showInsert(true);
  10267. }
  10268. closeSelf() {
  10269. this.hide();
  10270. }
  10271. updateUI() {
  10272. let data = cfgTable.moneyData;
  10273. let temp;
  10274. let obj;
  10275. for (const key in data) {
  10276. temp = data[key];
  10277. obj = this.ui.myNode["node" + key];
  10278. if (parseInt(key) <= 2) {
  10279. obj.diamondTxt.text = "+" + temp.num;
  10280. }
  10281. else {
  10282. obj.coinTxt.text = temp.num;
  10283. obj.diamondTxt.text = temp.get.split('_')[1];
  10284. }
  10285. }
  10286. this.updateDiamondShare();
  10287. }
  10288. updateDiamondShare() {
  10289. let data = DataMgr.getShareDiamondTimes();
  10290. if (data >= xGame.common.maxShareDiamondTimes) {
  10291. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  10292. this.ui.myNode.node1.touchable = false;
  10293. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10294. }
  10295. else {
  10296. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  10297. this.ui.myNode.node1.touchable = true;
  10298. }
  10299. }
  10300. switchBtn(type) {
  10301. if (type == "")
  10302. type = this.curType;
  10303. else {
  10304. if (this.curType == type) {
  10305. return;
  10306. }
  10307. else {
  10308. this.curType = type;
  10309. }
  10310. }
  10311. if (type == "coin") {
  10312. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  10313. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  10314. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  10315. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  10316. this.ui.myNode.c1.selectedIndex = 0;
  10317. }
  10318. else {
  10319. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  10320. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  10321. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  10322. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  10323. this.ui.myNode.c1.selectedIndex = 1;
  10324. }
  10325. }
  10326. convertCoin(index) {
  10327. let data = cfgTable.moneyData[index];
  10328. let coinNum = data.num;
  10329. let str = data.get.split('_')[1];
  10330. let needDiamond = parseInt(str);
  10331. if (DataMgr.diamondEnough(needDiamond)) {
  10332. DataMgr.setDiamond(-needDiamond);
  10333. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  10334. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  10335. }
  10336. else {
  10337. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  10338. this.switchBtn("diamond");
  10339. }
  10340. }
  10341. videoGetDiamond() {
  10342. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  10343. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  10344. }
  10345. else {
  10346. console.log('zh:AD 失败,直接发放奖励');
  10347. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  10348. }
  10349. }
  10350. qjff_AD_for_uiAddProp_videoGetDiamond() {
  10351. let num = cfgTable.moneyData[2].num;
  10352. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10353. this.closeSelf();
  10354. }
  10355. videoGetCoin() {
  10356. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  10357. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  10358. }
  10359. else {
  10360. console.log('zh:AD 失败,直接发放奖励');
  10361. this.qjff_AD_for_uiAddProp_videoGetCoin();
  10362. }
  10363. }
  10364. qjff_AD_for_uiAddProp_videoGetCoin() {
  10365. xGame.common.playObjFlyAnim(2000, Prop.coin);
  10366. this.closeSelf();
  10367. }
  10368. shareGetDiamond() {
  10369. let times = DataMgr.getShareDiamondTimes();
  10370. if (times >= xGame.common.maxShareDiamondTimes) {
  10371. console.log('zh: 233333333333 maxShareDiamondTimes');
  10372. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10373. }
  10374. else {
  10375. console.log('zh:33333333333333ad');
  10376. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  10377. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  10378. }
  10379. else {
  10380. console.log('zh:AD 失败,直接发放奖励');
  10381. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  10382. }
  10383. }
  10384. }
  10385. qjff_AD_for_uiAddProp_shareGetDiamond() {
  10386. let diamond = xGame.common.randomNum(50, 100);
  10387. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  10388. DataMgr.setShareDiamondTimes(1);
  10389. this.updateDiamondShare();
  10390. }
  10391. openPutBallView() {
  10392. let end = xGame.uiMgr.getUI(UIGameEnd);
  10393. let skill = xGame.uiMgr.getUI(UISkill);
  10394. let level = xGame.uiMgr.getUI(UILevelDisplay);
  10395. let uigame = xGame.uiMgr.getUI(UIGame);
  10396. if (end && !end.isHide) {
  10397. xGame.uiMgr.Hide(UIGameEnd);
  10398. xGame.uiMgr.Show(UIMain);
  10399. }
  10400. if (skill && !skill.isHide)
  10401. xGame.uiMgr.Hide(UISkill);
  10402. if (uigame && !uigame.isHide)
  10403. xGame.uiMgr.Hide(UIGame);
  10404. if (level && !level.isHide) {
  10405. }
  10406. else {
  10407. xGame.uiMgr.Show(UILevelDisplay);
  10408. }
  10409. this.closeSelf();
  10410. }
  10411. }
  10412. UIAddProp.uiName = "UIAddProp";
  10413. class MoneyNode {
  10414. constructor(ui) {
  10415. this.leftTime = 0;
  10416. this.ui = ui;
  10417. this.ui.addCoinBtn.onClick(this, this.addCoin);
  10418. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  10419. this.ui.addPowerBtn.onClick(this, this.addPower);
  10420. this.ui.c1.selectedIndex = 1;
  10421. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  10422. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  10423. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  10424. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10425. this.coinChange();
  10426. this.diamondChange();
  10427. this.powerChange();
  10428. }
  10429. addPower() {
  10430. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10431. xGame.uiMgr.Show(UIPower);
  10432. }
  10433. powerChange() {
  10434. let powerNum = DataMgr.getPower();
  10435. this.ui.powerTxt.text = powerNum + "";
  10436. }
  10437. checkPowerTime() {
  10438. let cur = new Date().getTime();
  10439. let last = DataMgr.getPowerTime();
  10440. if (last == 0) {
  10441. last = cur;
  10442. DataMgr.setPowerTime(cur);
  10443. }
  10444. let power = DataMgr.getPower();
  10445. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10446. Laya.timer.clearAll(this);
  10447. if (power >= xGame.common.natureMaxPower) {
  10448. this.ui.powerTimeTxt.text = "";
  10449. DataMgr.setPowerTime(cur);
  10450. return;
  10451. }
  10452. if (power + offset >= xGame.common.natureMaxPower) {
  10453. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10454. this.ui.powerTimeTxt.text = "";
  10455. DataMgr.setPowerTime(cur);
  10456. }
  10457. else {
  10458. if (offset > 0) {
  10459. DataMgr.setPower(offset);
  10460. DataMgr.setPowerTime(cur);
  10461. }
  10462. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10463. this.leftTime = xGame.common.powerRecoverNum - time;
  10464. if (this.leftTime <= 0)
  10465. this.leftTime = 0;
  10466. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10467. Laya.timer.loop(1000, this, this.updatePowerTime);
  10468. }
  10469. }
  10470. updatePowerTime() {
  10471. this.leftTime -= 1;
  10472. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10473. if (this.leftTime <= 0) {
  10474. this.checkPowerTime();
  10475. }
  10476. }
  10477. coinChange() {
  10478. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10479. }
  10480. diamondChange() {
  10481. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10482. }
  10483. addCoin() {
  10484. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10485. Moyu.sendDataEvent("AddCoinBtn");
  10486. xGame.uiMgr.Show(UIAddProp, 0);
  10487. }
  10488. addDiamond() {
  10489. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10490. Moyu.sendDataEvent("AddDiamondBtn");
  10491. xGame.uiMgr.Show(UIAddProp, 1);
  10492. }
  10493. }
  10494. class UIDraw extends UIBase {
  10495. constructor() {
  10496. super();
  10497. this.curKey = 0;
  10498. }
  10499. onConstructor() {
  10500. this.ui = ui_UIDraw.createInstance();
  10501. this.contentPane = this.ui;
  10502. this.isEject = false;
  10503. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10504. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10505. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10506. this.initDraw();
  10507. this.initUI();
  10508. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10509. if (Moyu.isKs)
  10510. this.ui.closeNode.closeBtn.x += 100;
  10511. }
  10512. show() {
  10513. super.show();
  10514. this.ui.t0.play();
  10515. this.playSecretaryIdle();
  10516. this.updateDraw();
  10517. this.checkFree();
  10518. if (PlatMgr.bannerDelay > 0) {
  10519. this.ui.closeNode.closeBtn.visible = false;
  10520. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10521. this.ui.closeNode.closeBtn.visible = true;
  10522. });
  10523. }
  10524. PlatMgr.showRateBanner();
  10525. }
  10526. hide() {
  10527. Laya.timer.clearAll(this);
  10528. super.hide();
  10529. }
  10530. checkFree() {
  10531. let isFree = DataMgr.getDailyfreeDrawTimes();
  10532. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10533. }
  10534. initDraw() {
  10535. this.drawObj = [];
  10536. let data = cfgTable.drawData;
  10537. let temp;
  10538. let weight = 0;
  10539. for (const key in data) {
  10540. temp = data[key];
  10541. weight += temp.weight;
  10542. this.drawObj.push(weight);
  10543. }
  10544. this.allWeight = weight;
  10545. }
  10546. initUI() {
  10547. let data = cfgTable.drawData;
  10548. let temp;
  10549. let img;
  10550. let txt;
  10551. for (const key in data) {
  10552. temp = data[key];
  10553. img = this.ui.myNode.rotNode["img" + key];
  10554. txt = this.ui.myNode.rotNode["txt" + key];
  10555. img.url = xGame.common.getGameIconUrl(temp.icon);
  10556. txt.visible = true;
  10557. if (temp.award > 2) {
  10558. img.rotation = 0;
  10559. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10560. }
  10561. else {
  10562. img.rotation = temp.rotation;
  10563. txt.text = temp.num;
  10564. }
  10565. }
  10566. }
  10567. getCurkey() {
  10568. let rand = Math.random() * this.allWeight;
  10569. let temp;
  10570. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10571. temp = this.drawObj[index];
  10572. if (index == 0) {
  10573. if (rand < temp) {
  10574. return index + 1;
  10575. }
  10576. }
  10577. else {
  10578. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10579. return index + 1;
  10580. }
  10581. }
  10582. }
  10583. return 2;
  10584. }
  10585. startDraw() {
  10586. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10587. if (freeTimes > 0) {
  10588. this.beginDraw();
  10589. DataMgr.setDailyfreeDrawTimes(0);
  10590. this.checkFree();
  10591. }
  10592. else {
  10593. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  10594. }
  10595. else {
  10596. console.log('zh:AD 失败,直接发放奖励');
  10597. this.qjff_chouJiang();
  10598. }
  10599. }
  10600. }
  10601. qjff_chouJiang() {
  10602. this.beginDraw();
  10603. }
  10604. beginDraw() {
  10605. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10606. this.ui.drawBtn.touchable = false;
  10607. this.curKey = this.getCurkey();
  10608. console.log("当前key", this.curKey);
  10609. let cell = 60;
  10610. let lap = 3;
  10611. let angle = cell * (this.curKey - 1) + lap * 360;
  10612. let target = this.ui.myNode.rotNode;
  10613. target.rotation = 0;
  10614. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10615. console.log("旋转完成");
  10616. this.ui.drawBtn.touchable = true;
  10617. this.getAward();
  10618. }));
  10619. }
  10620. getAward() {
  10621. let data = cfgTable.drawData[this.curKey];
  10622. let temp = new AwardType();
  10623. temp.type = data.award;
  10624. temp.num = data.num;
  10625. xGame.common.getAward([temp], () => {
  10626. DataMgr.setDrawTimes(1);
  10627. this.updateDraw();
  10628. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10629. });
  10630. }
  10631. updateDraw() {
  10632. let drawTimes = DataMgr.getDrawTimes();
  10633. let awardTimes = DataMgr.getDrawAwardTimes();
  10634. if (Math.floor(drawTimes / 3) > awardTimes) {
  10635. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10636. this.ui.extraNode.boxBtn.touchable = true;
  10637. this.ui.extraNode.tipsTxt.text = "3/3";
  10638. this.ui.extraNode.barNode.width = 265;
  10639. this.getExtraAward();
  10640. }
  10641. else {
  10642. this.ui.extraNode.boxBtn.t0.stop();
  10643. this.ui.extraNode.boxBtn.touchable = false;
  10644. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10645. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10646. }
  10647. let data = cfgTable.drawData[1];
  10648. if (awardTimes == 0) {
  10649. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10650. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10651. this.ui.myNode.rotNode.img1.rotation = 0;
  10652. }
  10653. else {
  10654. let award = data.nextid;
  10655. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10656. this.ui.myNode.rotNode.txt1.text = award[1];
  10657. this.ui.myNode.rotNode.img1.rotation = 0;
  10658. }
  10659. }
  10660. getExtraAward() {
  10661. let drawTimes = DataMgr.getDrawTimes();
  10662. let awardTimes = DataMgr.getDrawAwardTimes();
  10663. let data = cfgTable.drawData[1];
  10664. let award = new AwardType();
  10665. if (awardTimes == 0) {
  10666. award.num = data.num;
  10667. award.type = data.award;
  10668. xGame.common.getAward([award], () => {
  10669. let all = Math.floor(drawTimes / 3);
  10670. DataMgr.setDrawAwardTimes(all);
  10671. this.updateDraw();
  10672. });
  10673. }
  10674. else {
  10675. award.num = parseInt(data.nextid[1]);
  10676. award.type = parseInt(data.nextid[0]);
  10677. xGame.common.getAward([award], () => {
  10678. let all = Math.floor(drawTimes / 3);
  10679. DataMgr.setDrawAwardTimes(all);
  10680. this.updateDraw();
  10681. });
  10682. }
  10683. }
  10684. closeSelf() {
  10685. this.hide();
  10686. }
  10687. playSecretaryIdle() {
  10688. let parent = this.ui.secretary.displayObject;
  10689. parent.destroyChildren();
  10690. let xx = this.ui.secretary.width / 2;
  10691. let yy = this.ui.secretary.height;
  10692. let scale = xGame.common.getSecretaryScale();
  10693. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10694. xGame.common.secretary.play(data, 0, true, parent);
  10695. }
  10696. }
  10697. UIDraw.uiName = "UIDraw";
  10698. class ui_UIFlyEft extends fgui.GComponent {
  10699. static createInstance() {
  10700. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10701. }
  10702. onConstruct() {
  10703. this.n0 = (this.getChild("n0"));
  10704. this.n1 = (this.getChild("n1"));
  10705. this.n2 = (this.getChild("n2"));
  10706. this.n3 = (this.getChild("n3"));
  10707. this.n4 = (this.getChild("n4"));
  10708. this.n5 = (this.getChild("n5"));
  10709. this.n6 = (this.getChild("n6"));
  10710. this.n7 = (this.getChild("n7"));
  10711. this.iconNode = (this.getChild("iconNode"));
  10712. this.txt = (this.getChild("txt"));
  10713. this.txtNode = (this.getChild("txtNode"));
  10714. }
  10715. }
  10716. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10717. class UIFlyEft extends UIBase {
  10718. constructor() {
  10719. super();
  10720. this.max = 8;
  10721. this.delay = 0;
  10722. }
  10723. onConstructor() {
  10724. this.ui = ui_UIFlyEft.createInstance();
  10725. this.contentPane = this.ui;
  10726. this.isEject = false;
  10727. this.isMuti = true;
  10728. this.ui.x += xGame.common.sysOffestNum;
  10729. }
  10730. getArrPos() {
  10731. if (this.iconPos && this.iconPos.length > 0)
  10732. return;
  10733. this.iconPos = [];
  10734. let temp;
  10735. for (let index = 0; index < this.max; index++) {
  10736. temp = this.ui["n" + index];
  10737. this.iconPos.push([temp.x, temp.y]);
  10738. }
  10739. }
  10740. show(stPos, edPos, num, type, callback) {
  10741. super.show();
  10742. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10743. this.getArrPos();
  10744. this.updateUI(type);
  10745. this.updatePos();
  10746. this.runFly(edPos, callback);
  10747. this.runWorlds(stPos, num);
  10748. }
  10749. updateUI(type) {
  10750. let temp;
  10751. let str;
  10752. for (let index = 0; index < this.max; index++) {
  10753. temp = this.ui["n" + index];
  10754. str = this.getIconStr(type);
  10755. temp.url = xGame.common.getGameIconUrl(str);
  10756. }
  10757. }
  10758. getIconStr(type) {
  10759. switch (type) {
  10760. case Prop.diamond:
  10761. return "ty_zs";
  10762. case Prop.coin:
  10763. return "ty_jb";
  10764. default:
  10765. break;
  10766. }
  10767. }
  10768. updatePos() {
  10769. let temp;
  10770. for (let index = 0; index < this.max; index++) {
  10771. temp = this.ui["n" + index];
  10772. temp.x = this.iconPos[index][0];
  10773. temp.y = this.iconPos[index][1];
  10774. }
  10775. }
  10776. runFly(endPos, callback) {
  10777. let all = 0;
  10778. let temp;
  10779. for (let index = 0; index < this.max; index++) {
  10780. temp = this.ui["n" + index];
  10781. temp.visible = true;
  10782. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10783. temp.visible = false;
  10784. all++;
  10785. if (all >= this.max) {
  10786. callback && callback();
  10787. }
  10788. }), 20 * index);
  10789. }
  10790. }
  10791. runWorlds(stPos, num) {
  10792. let str = "+" + num;
  10793. this.ui.txt.text = str;
  10794. let starX = stPos.x;
  10795. let starY = stPos.y + 50;
  10796. this.ui.txt.x = starX;
  10797. this.ui.txt.y = starY;
  10798. this.ui.txt.visible = true;
  10799. this.ui.txt.alpha = 1;
  10800. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10801. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10802. this.ui.txt.visible = false;
  10803. this.hide();
  10804. }));
  10805. }));
  10806. }
  10807. }
  10808. UIFlyEft.uiName = "UIFlyEft";
  10809. class Common {
  10810. constructor() {
  10811. this.convertNum = 0.025;
  10812. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10813. this.scaleV3One = new Laya.Vector3();
  10814. this.scaleV3Two = new Laya.Vector3();
  10815. this.posV4 = new Laya.Vector4();
  10816. this.showDebug = false;
  10817. this.openGuide = true;
  10818. this.rodOffest = new Laya.Vector2(0, 0);
  10819. this.rodAngle = 0;
  10820. this.gameMode = GameMode.classic;
  10821. this.bigMoveLevelIndex = 1;
  10822. this.bigMoveNeedCoin = 1000;
  10823. this.classicNiceNeddCoin = 1000;
  10824. this.passAwardCoin = 2000;
  10825. this.classicRoomType = 1;
  10826. this.maxPower = 20;
  10827. this.natureMaxPower = 5;
  10828. this.videoPower = 2;
  10829. this.powerRecoverNum = 900;
  10830. this.curPlayerSkillType = 0;
  10831. this.isNewDay = false;
  10832. this.clickedBall = false;
  10833. this.placeBallCurLevel = 0;
  10834. this.placeBallStarNum = 0;
  10835. this.longHelpLine = false;
  10836. this.maxShareDiamondTimes = 3;
  10837. this.guideStep = 0;
  10838. this.temSelfLevel = 0;
  10839. this.extraMoveNum = 0;
  10840. this.curRankID = 0;
  10841. this.rankID = {
  10842. normalStar: 12000,
  10843. wxStar: 12001
  10844. };
  10845. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  10846. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  10847. this.btnClickStr = "buttonclick";
  10848. this.maxSkillLevel = 10;
  10849. this.upSkillLevel = false;
  10850. this.gameStartTime = 0;
  10851. this._sysOffestNum = 0;
  10852. this.angleV2 = new Laya.Vector2();
  10853. this.rootV = new Laya.Vector2(0, 1);
  10854. this.tempDir1 = new Laya.Vector2();
  10855. this.tempDir2 = new Laya.Vector2();
  10856. this.ballSize = 33;
  10857. this.stPos = new Laya.Point();
  10858. this.edPos = new Laya.Point();
  10859. Common._instance = this;
  10860. window["common"] = this;
  10861. }
  10862. static getInstance() {
  10863. if (!this._instance) {
  10864. this._instance = new Common();
  10865. }
  10866. return this._instance;
  10867. }
  10868. get sysOffestNum() {
  10869. if (this._sysOffestNum == 0) {
  10870. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10871. }
  10872. return this._sysOffestNum;
  10873. }
  10874. testShader() {
  10875. let test = new LightShader();
  10876. test.texture = "res/d3Res/ballTexture/ball1.png";
  10877. Laya.stage.addChild(test);
  10878. }
  10879. playScale(node) {
  10880. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10881. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10882. }));
  10883. }));
  10884. }
  10885. setGroup(colli, ...group) {
  10886. let out = 0;
  10887. for (let index = 0; index < group.length; index++) {
  10888. if (index == 0) {
  10889. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10890. }
  10891. else {
  10892. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10893. }
  10894. }
  10895. colli.collisionGroup = out;
  10896. }
  10897. setCanGroupWith(colli, ...group) {
  10898. let out = 0;
  10899. for (let index = 0; index < group.length; index++) {
  10900. if (index == 0) {
  10901. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10902. }
  10903. else {
  10904. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10905. }
  10906. }
  10907. colli.canCollideWith = out;
  10908. }
  10909. loadPrefab(name, callback) {
  10910. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10911. let prefab = new Laya.Prefab();
  10912. prefab.json = obj;
  10913. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10914. callback && callback(img);
  10915. }));
  10916. }
  10917. pos2to3Convert(x, y, d3Pos) {
  10918. x = x + this.sysOffestNum;
  10919. d3Pos.setValue(x, y, 0);
  10920. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10921. if (success) {
  10922. }
  10923. else {
  10924. console.error("转换出错了。。。。。。。。");
  10925. }
  10926. }
  10927. scale2to3Convert(num) {
  10928. this.scaleV3One.setValue(0, 0, 0);
  10929. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10930. this.scaleV3Two.setValue(0, num, 0);
  10931. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10932. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10933. return outNum;
  10934. }
  10935. pos3to2Convert(d3Pos) {
  10936. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10937. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10938. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10939. d3Pos.x -= this.sysOffestNum;
  10940. }
  10941. scale3to2Convert(num) {
  10942. let scale = this.scale2to3Convert(1);
  10943. let d2Out = num / scale;
  10944. return d2Out;
  10945. }
  10946. getCollider(type, restitution = 0.9, density = 10) {
  10947. let colli;
  10948. if (type == "box")
  10949. colli = new Laya.BoxCollider();
  10950. else
  10951. colli = new Laya.CircleCollider();
  10952. colli.friction = 0;
  10953. colli.restitution = restitution;
  10954. colli.density = density;
  10955. return colli;
  10956. }
  10957. getRigbody() {
  10958. let rigy = new Laya.RigidBody();
  10959. rigy.bullet = true;
  10960. rigy.allowRotation = false;
  10961. rigy.allowSleep = false;
  10962. rigy.gravityScale = 0;
  10963. return rigy;
  10964. }
  10965. getfguiRotation(x, y) {
  10966. this.angleV2.setValue(x, y);
  10967. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10968. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10969. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10970. angle = -angle;
  10971. }
  10972. return 180 + angle;
  10973. }
  10974. getAngle(x, y) {
  10975. this.angleV2.setValue(x, y);
  10976. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10977. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10978. return angle;
  10979. }
  10980. randomNum(a, b) {
  10981. return a + Math.floor((b - a + 1) * Math.random());
  10982. }
  10983. getRandArrEle(arr) {
  10984. return arr[Math.floor(arr.length * Math.random())];
  10985. }
  10986. getSign(val) {
  10987. return val >= 0 ? 1 : -1;
  10988. }
  10989. botherArr(arr) {
  10990. let times = arr.length + 2;
  10991. let length = arr.length;
  10992. let a;
  10993. let b;
  10994. let temp;
  10995. for (let index = 0; index < times; index++) {
  10996. a = Math.floor(Math.random() * length);
  10997. b = Math.floor(Math.random() * length);
  10998. temp = arr[a];
  10999. arr[a] = arr[b];
  11000. arr[b] = temp;
  11001. }
  11002. }
  11003. getGameIconUrl(id) {
  11004. return "ui://game/" + id;
  11005. }
  11006. getComponentUrl(id) {
  11007. return "ui://game/" + id;
  11008. }
  11009. getAnimation() {
  11010. }
  11011. judgeSkillType(type = SkillType.highSpace) {
  11012. if (this.gameMode == GameMode.classic)
  11013. return;
  11014. let gameMgr = this.gameMgr;
  11015. if (gameMgr.selfTurn) {
  11016. if (gameMgr.selfCurSkill == type) {
  11017. return true;
  11018. }
  11019. }
  11020. else {
  11021. if (gameMgr.aiCurSkill == type) {
  11022. return true;
  11023. }
  11024. }
  11025. }
  11026. ballColliHole(collider) {
  11027. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11028. xGame.common.gameMgr.isFirstInGame = false;
  11029. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11030. }
  11031. collider.owner.mySrc.checkWrongBall();
  11032. }
  11033. getArrMaxEle(arr) {
  11034. let max = -Infinity;
  11035. for (let index = 0; index < arr.length; index++) {
  11036. max = Math.max(arr[index], max);
  11037. }
  11038. return max;
  11039. }
  11040. getArrMinEle(arr) {
  11041. let min = Infinity;
  11042. for (let index = 0; index < arr.length; index++) {
  11043. min = Math.min(arr[index], min);
  11044. }
  11045. return min;
  11046. }
  11047. playRandomMutiBallBigSkillSound() {
  11048. if (Math.random() <= 0.5)
  11049. return;
  11050. let rand = this.randomNum(1, 6);
  11051. let str = "ganfa0" + rand;
  11052. xGame.soundMgr.playSound(str);
  11053. }
  11054. showOneCamera(type) {
  11055. let object = xGame.common.d3World.cameraObj;
  11056. for (const key in object) {
  11057. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11058. object[key].init();
  11059. object[key].owner.active = key == type;
  11060. }
  11061. }
  11062. }
  11063. checkBallOverBorder(x, y) {
  11064. let radius = 17;
  11065. let condition = this._checkBorder(x + radius, y) ||
  11066. this._checkBorder(x - radius, y) ||
  11067. this._checkBorder(x, y + radius) ||
  11068. this._checkBorder(x, y - radius);
  11069. if (condition) {
  11070. return true;
  11071. }
  11072. }
  11073. _checkBorder(x, y) {
  11074. let borderRect = this.d2World.borderRect;
  11075. let xOffest = 20;
  11076. let yOffest = 20;
  11077. if (y <= borderRect.y - yOffest) {
  11078. return true;
  11079. }
  11080. if (y >= borderRect.y + borderRect.height + yOffest) {
  11081. return true;
  11082. }
  11083. if (x <= borderRect.x - xOffest) {
  11084. return true;
  11085. }
  11086. if (x >= borderRect.x + borderRect.width + xOffest) {
  11087. return true;
  11088. }
  11089. }
  11090. initWeight(cfg) {
  11091. let allCfgData = { data: {}, allWeightNum: 0 };
  11092. let weightCfg = allCfgData.data;
  11093. let weight = 0;
  11094. for (const key in cfg) {
  11095. weightCfg[key] = {};
  11096. weightCfg[key].id = cfg[key].id;
  11097. weightCfg[key].minWeight = weight;
  11098. weight += cfg[key].weight;
  11099. weightCfg[key].maxWeight = weight;
  11100. }
  11101. allCfgData.allWeightNum = weight;
  11102. return allCfgData;
  11103. }
  11104. getRandomWeightData(cfg) {
  11105. let weightCfg = cfg.data;
  11106. let allWeightNum = cfg.allWeightNum;
  11107. let rand = Math.floor(Math.random() * allWeightNum);
  11108. for (const key in weightCfg) {
  11109. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11110. return weightCfg[key];
  11111. }
  11112. }
  11113. return weightCfg[1];
  11114. }
  11115. showGirlTalkPop(wordsIndex, node, msgNode) {
  11116. node.visible = true;
  11117. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11118. node.t0.play(Laya.Handler.create(this, () => {
  11119. node.visible = false;
  11120. }));
  11121. }
  11122. stopGirlPop(node) {
  11123. node.t0.stop();
  11124. node.visible = false;
  11125. }
  11126. createHead(loader, url, size = 107) {
  11127. if (Laya.Browser.name == "Browser") {
  11128. loader.url = url;
  11129. return;
  11130. }
  11131. if (Moyu.isTT) {
  11132. let localImage = new Image();
  11133. localImage.src = url;
  11134. localImage.onload = () => {
  11135. let t2d = new Laya.Texture2D();
  11136. t2d.width = size;
  11137. t2d.height = size;
  11138. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  11139. t2d.loadImageSource(localImage);
  11140. };
  11141. }
  11142. else {
  11143. console.log('zh:url=', url);
  11144. loader.url = url;
  11145. }
  11146. }
  11147. addTestCoin(num) {
  11148. DataMgr.setCoin(num);
  11149. }
  11150. addTestDiamond(num) {
  11151. DataMgr.setDiamond(num);
  11152. }
  11153. addTestSkill() {
  11154. DataMgr.setBigSkill(0, 99);
  11155. DataMgr.setBigSkill(1, 99);
  11156. DataMgr.setBigSkill(2, 99);
  11157. }
  11158. playClassicEmotion(number, x, y) {
  11159. if (this.gameMode == GameMode.bigMove)
  11160. return;
  11161. let randIndex = this.randomNum(0, 2);
  11162. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11163. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11164. if (this.gameMgr.selfTurn) {
  11165. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11166. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11167. }
  11168. else {
  11169. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11170. }
  11171. else {
  11172. if (number == this.gameMgr.blackNum) {
  11173. if (this.gameMgr.selfBallArr.length == 0) {
  11174. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11175. }
  11176. else {
  11177. }
  11178. }
  11179. else {
  11180. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11181. }
  11182. }
  11183. }
  11184. }
  11185. else {
  11186. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11187. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11188. }
  11189. else {
  11190. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11191. }
  11192. else {
  11193. if (number == this.gameMgr.blackNum) {
  11194. if (this.gameMgr.aiBallArr.length == 0) {
  11195. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11196. }
  11197. else {
  11198. }
  11199. }
  11200. else {
  11201. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11202. }
  11203. }
  11204. }
  11205. }
  11206. }
  11207. playHappySound(number) {
  11208. if (this.gameMode != GameMode.classic)
  11209. return;
  11210. if (number == 8)
  11211. return;
  11212. let play = false;
  11213. if (this.gameMgr.selfTurn) {
  11214. if (this.gameMgr.ensureBallType) {
  11215. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11216. play = true;
  11217. }
  11218. }
  11219. else {
  11220. play = true;
  11221. }
  11222. }
  11223. else {
  11224. if (this.gameMgr.ensureBallType) {
  11225. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11226. play = true;
  11227. }
  11228. }
  11229. else {
  11230. play = true;
  11231. }
  11232. }
  11233. if (play)
  11234. xGame.soundMgr.playSound("applause");
  11235. }
  11236. destroyClassicEmotion() {
  11237. if (this.gameMode == GameMode.bigMove)
  11238. return;
  11239. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11240. parent.destroyChildren();
  11241. }
  11242. playAwardSpine(x, y) {
  11243. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11244. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11245. this.awardSpine.play(data, 0, false, parent);
  11246. }
  11247. destroyAwardSpine() {
  11248. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11249. parent.destroyChildren();
  11250. }
  11251. isBlock(bx, by, hx, hy, except = null) {
  11252. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  11253. let balls = xGame.common.d2World.ballArr;
  11254. let outArr = [];
  11255. for (let index = 0; index < balls.length; index++) {
  11256. let obj = balls[index];
  11257. if (obj.number == 0)
  11258. continue;
  11259. if (obj == except)
  11260. continue;
  11261. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  11262. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  11263. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  11264. if (num >= 1)
  11265. num = 1;
  11266. if (num < 0)
  11267. continue;
  11268. let gap = Math.sin(Math.acos(num)) * dis;
  11269. if (gap < this.ballSize) {
  11270. outArr.push({
  11271. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  11272. disHon: Math.cos(Math.acos(num)) * dis,
  11273. disVer: Math.sin(Math.acos(num)) * dis,
  11274. src: balls[index],
  11275. dir: this.tempDir1
  11276. });
  11277. }
  11278. }
  11279. if (outArr.length > 0) {
  11280. outArr.sort((a, b) => { return a.dis - b.dis; });
  11281. return outArr[0];
  11282. }
  11283. }
  11284. AngleBetween(vector1, vector2) {
  11285. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  11286. return rad * (180 / Math.PI);
  11287. }
  11288. getSecretaryScale() {
  11289. if (this.secretary.spineName == "mishu") {
  11290. return 1.28;
  11291. }
  11292. else {
  11293. return 1.024;
  11294. }
  11295. }
  11296. signAwardContainsRod(arr) {
  11297. let temp;
  11298. for (let index = 0; index < arr.length; index++) {
  11299. temp = arr[index].split('-')[0];
  11300. if (parseInt(temp) > 2) {
  11301. return true;
  11302. }
  11303. }
  11304. }
  11305. judgeSameDay() {
  11306. let lastTime = DataMgr.getSignTime();
  11307. let curTime = new Date().getTime();
  11308. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  11309. return true;
  11310. }
  11311. return false;
  11312. }
  11313. getAward(arr, callback) {
  11314. let showTriple = arr[0].type <= 2;
  11315. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  11316. let temp;
  11317. for (let index = 0; index < arr.length; index++) {
  11318. temp = arr[index];
  11319. switch (temp.type) {
  11320. case 1:
  11321. this.playObjFlyAnim(temp.num, temp.type);
  11322. break;
  11323. case 2:
  11324. this.playObjFlyAnim(temp.num, temp.type);
  11325. break;
  11326. case 3:
  11327. case 4:
  11328. case 5:
  11329. case 6:
  11330. DataMgr.setBallRod(temp.type - 2, 1);
  11331. DataMgr.setCurBallRod(temp.type - 2);
  11332. break;
  11333. default:
  11334. break;
  11335. }
  11336. }
  11337. callback && callback(watchVideo);
  11338. });
  11339. }
  11340. getMoneyNode() {
  11341. let moneyNode;
  11342. let sign = xGame.uiMgr.getUI(UISign);
  11343. let draw = xGame.uiMgr.getUI(UIDraw);
  11344. let end = xGame.uiMgr.getUI(UIGameEnd);
  11345. let skill = xGame.uiMgr.getUI(UISkill);
  11346. if (sign && !sign.isHide)
  11347. moneyNode = sign.ui.moneyNode;
  11348. if (draw && !draw.isHide)
  11349. moneyNode = draw.ui.moneyNode;
  11350. if (end && !end.isHide)
  11351. moneyNode = end.ui.moneyNode;
  11352. if (skill && !skill.isHide)
  11353. moneyNode = skill.ui.moneyNode;
  11354. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11355. let main = xGame.uiMgr.getUI(UIMain);
  11356. if (condition1 && main && !main.isHide) {
  11357. moneyNode = main.ui.moneyNode;
  11358. }
  11359. return moneyNode;
  11360. }
  11361. playObjFlyAnim(num, type, callback = null) {
  11362. this.stPos.x = Laya.stage.width / 2;
  11363. this.stPos.y = Laya.stage.height / 2;
  11364. let moneyNode = this.getMoneyNode();
  11365. switch (type) {
  11366. case Prop.diamond:
  11367. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11368. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11369. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11370. this.edPos.x /= 2;
  11371. this.edPos.y /= 2;
  11372. break;
  11373. case Prop.coin:
  11374. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11375. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11376. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11377. this.edPos.x /= 2;
  11378. this.edPos.y /= 2;
  11379. break;
  11380. default:
  11381. break;
  11382. }
  11383. xGame.soundMgr.playSound("coinbag");
  11384. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11385. switch (type) {
  11386. case Prop.diamond:
  11387. DataMgr.setDiamond(num);
  11388. break;
  11389. case Prop.coin:
  11390. DataMgr.setCoin(num);
  11391. break;
  11392. default:
  11393. break;
  11394. }
  11395. callback && callback();
  11396. });
  11397. }
  11398. autoPopUIView() {
  11399. let arr = [];
  11400. let sign = this.judgeSameDay() ? false : true;
  11401. if (sign)
  11402. arr.push("sign");
  11403. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11404. if (draw)
  11405. arr.push("draw");
  11406. if (arr.length <= 0)
  11407. return;
  11408. let str = this.getRandArrEle(arr);
  11409. switch (str) {
  11410. case "sign":
  11411. xGame.uiMgr.Show(UISign);
  11412. break;
  11413. case "draw":
  11414. xGame.uiMgr.Show(UIDraw);
  11415. break;
  11416. default:
  11417. break;
  11418. }
  11419. }
  11420. getMSTime(time) {
  11421. let min = Math.floor(time / 60);
  11422. let sec = Math.floor((time - min * 60));
  11423. if (sec < 10)
  11424. sec = "0" + sec;
  11425. if (min < 10)
  11426. min = "0" + min;
  11427. return `${min}:${sec}`;
  11428. }
  11429. testPower() {
  11430. DataMgr.setPower(0, false);
  11431. }
  11432. getAllStarNum() {
  11433. let data = DataMgr.getPlaceBallLevelList();
  11434. let out = 0;
  11435. for (let index = 0; index < data.length; index++) {
  11436. out += data[index].star;
  11437. }
  11438. return out;
  11439. }
  11440. recoverCameraView() {
  11441. Laya.timer.once(900, this, () => {
  11442. xGame.common.showOneCamera("mainCamera");
  11443. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11444. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11445. xGame.common.gameUI.ui.border.alpha = 0;
  11446. if (Laya.physicsTimer.scale < 1) {
  11447. Laya.physicsTimer.scale = 1;
  11448. }
  11449. }
  11450. });
  11451. }
  11452. getClassicLevel() {
  11453. let successTimes = DataMgr.getClassicTimes();
  11454. let needKey = "";
  11455. let lastKey = "";
  11456. let cfg = cfgTable.classictimesData;
  11457. let data;
  11458. for (const key in cfg) {
  11459. data = cfg[key];
  11460. if (successTimes <= data.times) {
  11461. needKey = key;
  11462. }
  11463. lastKey = key;
  11464. }
  11465. if (needKey == "")
  11466. needKey = lastKey;
  11467. return cfg[needKey];
  11468. }
  11469. }
  11470. Common._instance = null;
  11471. class ui_Component92 extends fgui.GComponent {
  11472. static createInstance() {
  11473. return (fgui.UIPackage.createObject("game", "Component92"));
  11474. }
  11475. onConstruct() {
  11476. this.n0 = (this.getChild("n0"));
  11477. }
  11478. }
  11479. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11480. class ui_Component129 extends fgui.GProgressBar {
  11481. static createInstance() {
  11482. return (fgui.UIPackage.createObject("game", "Component129"));
  11483. }
  11484. onConstruct() {
  11485. this.bar_v = (this.getChild("bar_v"));
  11486. this.n84 = (this.getChild("n84"));
  11487. }
  11488. }
  11489. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11490. class ui_Component130 extends fgui.GComponent {
  11491. static createInstance() {
  11492. return (fgui.UIPackage.createObject("game", "Component130"));
  11493. }
  11494. onConstruct() {
  11495. this.ani = (this.getChild("ani"));
  11496. this.t0 = this.getTransition("t0");
  11497. }
  11498. }
  11499. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11500. class ui_powerEft extends fgui.GComponent {
  11501. static createInstance() {
  11502. return (fgui.UIPackage.createObject("game", "powerEft"));
  11503. }
  11504. onConstruct() {
  11505. this.ani = (this.getChild("ani"));
  11506. this.n88 = (this.getChild("n88"));
  11507. this.n89 = (this.getChild("n89"));
  11508. }
  11509. }
  11510. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11511. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11512. static createInstance() {
  11513. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11514. }
  11515. onConstruct() {
  11516. this.c1 = this.getController("c1");
  11517. this.n2 = (this.getChild("n2"));
  11518. this.n22 = (this.getChild("n22"));
  11519. this.n23 = (this.getChild("n23"));
  11520. this.n15 = (this.getChild("n15"));
  11521. this.challenge = (this.getChild("challenge"));
  11522. this.n17 = (this.getChild("n17"));
  11523. this.n3 = (this.getChild("n3"));
  11524. this.starNode = (this.getChild("starNode"));
  11525. this.levelTxt = (this.getChild("levelTxt"));
  11526. this.n14 = (this.getChild("n14"));
  11527. this.n19 = (this.getChild("n19"));
  11528. this.n20 = (this.getChild("n20"));
  11529. this.n21 = (this.getChild("n21"));
  11530. this.special = (this.getChild("special"));
  11531. }
  11532. }
  11533. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11534. class ui_Component79 extends fgui.GComponent {
  11535. static createInstance() {
  11536. return (fgui.UIPackage.createObject("game", "Component79"));
  11537. }
  11538. onConstruct() {
  11539. this.c1 = this.getController("c1");
  11540. this.n7 = (this.getChild("n7"));
  11541. this.n8 = (this.getChild("n8"));
  11542. this.n9 = (this.getChild("n9"));
  11543. this.n10 = (this.getChild("n10"));
  11544. this.n11 = (this.getChild("n11"));
  11545. this.n12 = (this.getChild("n12"));
  11546. }
  11547. }
  11548. ui_Component79.URL = "ui://isxx5ak7avag477";
  11549. class ui_Component80 extends fgui.GComponent {
  11550. static createInstance() {
  11551. return (fgui.UIPackage.createObject("game", "Component80"));
  11552. }
  11553. onConstruct() {
  11554. this.n0 = (this.getChild("n0"));
  11555. this.n1 = (this.getChild("n1"));
  11556. this.myList = (this.getChild("myList"));
  11557. this.t0 = this.getTransition("t0");
  11558. }
  11559. }
  11560. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11561. class ui_SignNormal extends fgui.GComponent {
  11562. static createInstance() {
  11563. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11564. }
  11565. onConstruct() {
  11566. this.c1 = this.getController("c1");
  11567. this.n7 = (this.getChild("n7"));
  11568. this.n15 = (this.getChild("n15"));
  11569. this.titleTxt = (this.getChild("titleTxt"));
  11570. this.n8 = (this.getChild("n8"));
  11571. this.myIcon = (this.getChild("myIcon"));
  11572. this.numTxt = (this.getChild("numTxt"));
  11573. this.n12 = (this.getChild("n12"));
  11574. this.n13 = (this.getChild("n13"));
  11575. this.n17 = (this.getChild("n17"));
  11576. this.n14 = (this.getChild("n14"));
  11577. }
  11578. }
  11579. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11580. class ui_screenNode extends fgui.GComponent {
  11581. static createInstance() {
  11582. return (fgui.UIPackage.createObject("game", "screenNode"));
  11583. }
  11584. onConstruct() {
  11585. this.n9 = (this.getChild("n9"));
  11586. this.screenImg = (this.getChild("screenImg"));
  11587. }
  11588. }
  11589. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11590. class ui_GetAwrad_com1 extends fgui.GComponent {
  11591. static createInstance() {
  11592. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11593. }
  11594. onConstruct() {
  11595. this.n38 = (this.getChild("n38"));
  11596. this.n39 = (this.getChild("n39"));
  11597. this.n40 = (this.getChild("n40"));
  11598. this.t0 = this.getTransition("t0");
  11599. this.t1 = this.getTransition("t1");
  11600. }
  11601. }
  11602. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11603. class ui_GetAwrad_com2 extends fgui.GComponent {
  11604. static createInstance() {
  11605. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11606. }
  11607. onConstruct() {
  11608. this.n39 = (this.getChild("n39"));
  11609. this.n40 = (this.getChild("n40"));
  11610. this.t0 = this.getTransition("t0");
  11611. }
  11612. }
  11613. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11614. class ui_Component128 extends fgui.GComponent {
  11615. static createInstance() {
  11616. return (fgui.UIPackage.createObject("game", "Component128"));
  11617. }
  11618. onConstruct() {
  11619. this.n38 = (this.getChild("n38"));
  11620. this.n40 = (this.getChild("n40"));
  11621. }
  11622. }
  11623. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11624. class ui_Component100_1 extends fgui.GComponent {
  11625. static createInstance() {
  11626. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11627. }
  11628. onConstruct() {
  11629. this.myNode = (this.getChild("myNode"));
  11630. this.t0 = this.getTransition("t0");
  11631. }
  11632. }
  11633. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11634. class ui_Component142 extends fgui.GComponent {
  11635. static createInstance() {
  11636. return (fgui.UIPackage.createObject("game", "Component142"));
  11637. }
  11638. onConstruct() {
  11639. this.n41 = (this.getChild("n41"));
  11640. this.n42 = (this.getChild("n42"));
  11641. }
  11642. }
  11643. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11644. class ui_main_guang extends fgui.GComponent {
  11645. static createInstance() {
  11646. return (fgui.UIPackage.createObject("game", "main_guang"));
  11647. }
  11648. onConstruct() {
  11649. this.n1 = (this.getChild("n1"));
  11650. this.n2 = (this.getChild("n2"));
  11651. this.n3 = (this.getChild("n3"));
  11652. this.n4 = (this.getChild("n4"));
  11653. this.n5 = (this.getChild("n5"));
  11654. this.n6 = (this.getChild("n6"));
  11655. this.n8 = (this.getChild("n8"));
  11656. this.t0 = this.getTransition("t0");
  11657. }
  11658. }
  11659. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11660. class ui_try_com1 extends fgui.GComponent {
  11661. static createInstance() {
  11662. return (fgui.UIPackage.createObject("game", "try_com1"));
  11663. }
  11664. onConstruct() {
  11665. this.c1 = this.getController("c1");
  11666. this.n0 = (this.getChild("n0"));
  11667. this.n2 = (this.getChild("n2"));
  11668. this.cancelBtn = (this.getChild("cancelBtn"));
  11669. this.videoBtn = (this.getChild("videoBtn"));
  11670. this.n9 = (this.getChild("n9"));
  11671. this.n24 = (this.getChild("n24"));
  11672. this.titleTxt = (this.getChild("titleTxt"));
  11673. this.n32 = (this.getChild("n32"));
  11674. this.n29 = (this.getChild("n29"));
  11675. this.n36 = (this.getChild("n36"));
  11676. this.txtTime = (this.getChild("txtTime"));
  11677. this.t0 = this.getTransition("t0");
  11678. }
  11679. }
  11680. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11681. class ui_try_com2 extends fgui.GComponent {
  11682. static createInstance() {
  11683. return (fgui.UIPackage.createObject("game", "try_com2"));
  11684. }
  11685. onConstruct() {
  11686. this.skillicon = (this.getChild("skillicon"));
  11687. this.n35 = (this.getChild("n35"));
  11688. this.n31 = (this.getChild("n31"));
  11689. this.n32 = (this.getChild("n32"));
  11690. this.n33 = (this.getChild("n33"));
  11691. this.n34 = (this.getChild("n34"));
  11692. }
  11693. }
  11694. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11695. class ui_try_com3 extends fgui.GComponent {
  11696. static createInstance() {
  11697. return (fgui.UIPackage.createObject("game", "try_com3"));
  11698. }
  11699. onConstruct() {
  11700. this.n33 = (this.getChild("n33"));
  11701. this.n34 = (this.getChild("n34"));
  11702. this.n35 = (this.getChild("n35"));
  11703. this.t0 = this.getTransition("t0");
  11704. }
  11705. }
  11706. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11707. class ui_huihe1 extends fgui.GComponent {
  11708. static createInstance() {
  11709. return (fgui.UIPackage.createObject("game", "huihe1"));
  11710. }
  11711. onConstruct() {
  11712. this.n0 = (this.getChild("n0"));
  11713. this.n1 = (this.getChild("n1"));
  11714. this.t0 = this.getTransition("t0");
  11715. }
  11716. }
  11717. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11718. class ui_huihe2 extends fgui.GComponent {
  11719. static createInstance() {
  11720. return (fgui.UIPackage.createObject("game", "huihe2"));
  11721. }
  11722. onConstruct() {
  11723. this.n0 = (this.getChild("n0"));
  11724. this.n1 = (this.getChild("n1"));
  11725. this.t0 = this.getTransition("t0");
  11726. }
  11727. }
  11728. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11729. class ui_Component143 extends fgui.GComponent {
  11730. static createInstance() {
  11731. return (fgui.UIPackage.createObject("game", "Component143"));
  11732. }
  11733. onConstruct() {
  11734. this.n3 = (this.getChild("n3"));
  11735. this.n4 = (this.getChild("n4"));
  11736. this.n5 = (this.getChild("n5"));
  11737. this.n6 = (this.getChild("n6"));
  11738. this.n7 = (this.getChild("n7"));
  11739. this.n8 = (this.getChild("n8"));
  11740. this.n9 = (this.getChild("n9"));
  11741. this.n10 = (this.getChild("n10"));
  11742. this.t0 = this.getTransition("t0");
  11743. }
  11744. }
  11745. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11746. class ui_dh_jingbi2 extends fgui.GComponent {
  11747. static createInstance() {
  11748. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11749. }
  11750. onConstruct() {
  11751. this.n0 = (this.getChild("n0"));
  11752. this.n1 = (this.getChild("n1"));
  11753. this.n2 = (this.getChild("n2"));
  11754. this.n3 = (this.getChild("n3"));
  11755. this.n4 = (this.getChild("n4"));
  11756. this.n5 = (this.getChild("n5"));
  11757. this.n6 = (this.getChild("n6"));
  11758. this.n8 = (this.getChild("n8"));
  11759. this.n10 = (this.getChild("n10"));
  11760. this.t0 = this.getTransition("t0");
  11761. }
  11762. }
  11763. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11764. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11765. static createInstance() {
  11766. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11767. }
  11768. onConstruct() {
  11769. this.n1 = (this.getChild("n1"));
  11770. this.n4 = (this.getChild("n4"));
  11771. this.t0 = this.getTransition("t0");
  11772. }
  11773. }
  11774. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11775. class ui_dh_jingbi3 extends fgui.GComponent {
  11776. static createInstance() {
  11777. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11778. }
  11779. onConstruct() {
  11780. this.n0 = (this.getChild("n0"));
  11781. this.n1 = (this.getChild("n1"));
  11782. this.n2 = (this.getChild("n2"));
  11783. this.n3 = (this.getChild("n3"));
  11784. this.n4 = (this.getChild("n4"));
  11785. this.n5 = (this.getChild("n5"));
  11786. this.n6 = (this.getChild("n6"));
  11787. this.n8 = (this.getChild("n8"));
  11788. this.n10 = (this.getChild("n10"));
  11789. this.t0 = this.getTransition("t0");
  11790. }
  11791. }
  11792. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11793. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11794. static createInstance() {
  11795. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11796. }
  11797. onConstruct() {
  11798. this.n3 = (this.getChild("n3"));
  11799. this.n1 = (this.getChild("n1"));
  11800. this.t0 = this.getTransition("t0");
  11801. }
  11802. }
  11803. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11804. class ui_hb_jinbi1 extends fgui.GButton {
  11805. static createInstance() {
  11806. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11807. }
  11808. onConstruct() {
  11809. this.n20 = (this.getChild("n20"));
  11810. this.n25 = (this.getChild("n25"));
  11811. this.coinTxt = (this.getChild("coinTxt"));
  11812. this.n28 = (this.getChild("n28"));
  11813. this.n32 = (this.getChild("n32"));
  11814. this.n38 = (this.getChild("n38"));
  11815. this.n45 = (this.getChild("n45"));
  11816. this.getTips = (this.getChild("getTips"));
  11817. this.n39 = (this.getChild("n39"));
  11818. this.diamondTxt = (this.getChild("diamondTxt"));
  11819. this.n41 = (this.getChild("n41"));
  11820. this.n42 = (this.getChild("n42"));
  11821. this.n46 = (this.getChild("n46"));
  11822. this.n47 = (this.getChild("n47"));
  11823. this.n48 = (this.getChild("n48"));
  11824. this.t0 = this.getTransition("t0");
  11825. }
  11826. }
  11827. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11828. class ui_hb_jinbi2 extends fgui.GButton {
  11829. static createInstance() {
  11830. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11831. }
  11832. onConstruct() {
  11833. this.n20 = (this.getChild("n20"));
  11834. this.n25 = (this.getChild("n25"));
  11835. this.coinTxt = (this.getChild("coinTxt"));
  11836. this.n28 = (this.getChild("n28"));
  11837. this.n32 = (this.getChild("n32"));
  11838. this.n38 = (this.getChild("n38"));
  11839. this.n39 = (this.getChild("n39"));
  11840. this.diamondTxt = (this.getChild("diamondTxt"));
  11841. this.n41 = (this.getChild("n41"));
  11842. this.n42 = (this.getChild("n42"));
  11843. this.n43 = (this.getChild("n43"));
  11844. this.n44 = (this.getChild("n44"));
  11845. this.n45 = (this.getChild("n45"));
  11846. this.t0 = this.getTransition("t0");
  11847. }
  11848. }
  11849. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11850. class ui_hb_jinbi3 extends fgui.GButton {
  11851. static createInstance() {
  11852. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11853. }
  11854. onConstruct() {
  11855. this.n20 = (this.getChild("n20"));
  11856. this.n25 = (this.getChild("n25"));
  11857. this.coinTxt = (this.getChild("coinTxt"));
  11858. this.n28 = (this.getChild("n28"));
  11859. this.n32 = (this.getChild("n32"));
  11860. this.n38 = (this.getChild("n38"));
  11861. this.n39 = (this.getChild("n39"));
  11862. this.diamondTxt = (this.getChild("diamondTxt"));
  11863. this.n41 = (this.getChild("n41"));
  11864. this.n42 = (this.getChild("n42"));
  11865. this.n43 = (this.getChild("n43"));
  11866. this.n44 = (this.getChild("n44"));
  11867. this.n45 = (this.getChild("n45"));
  11868. this.t0 = this.getTransition("t0");
  11869. }
  11870. }
  11871. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11872. class ui_Component104 extends fgui.GComponent {
  11873. static createInstance() {
  11874. return (fgui.UIPackage.createObject("game", "Component104"));
  11875. }
  11876. onConstruct() {
  11877. this.c1 = this.getController("c1");
  11878. this.n12 = (this.getChild("n12"));
  11879. this.coinBtn = (this.getChild("coinBtn"));
  11880. this.diamondBtn = (this.getChild("diamondBtn"));
  11881. this.node3 = (this.getChild("node3"));
  11882. this.node4 = (this.getChild("node4"));
  11883. this.node5 = (this.getChild("node5"));
  11884. this.node1 = (this.getChild("node1"));
  11885. this.node2 = (this.getChild("node2"));
  11886. this.node6 = (this.getChild("node6"));
  11887. this.t0 = this.getTransition("t0");
  11888. }
  11889. }
  11890. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11891. class ui_Component105 extends fgui.GButton {
  11892. static createInstance() {
  11893. return (fgui.UIPackage.createObject("game", "Component105"));
  11894. }
  11895. onConstruct() {
  11896. this.c1 = this.getController("c1");
  11897. this.n49 = (this.getChild("n49"));
  11898. this.n18 = (this.getChild("n18"));
  11899. this.n46 = (this.getChild("n46"));
  11900. this.n48 = (this.getChild("n48"));
  11901. }
  11902. }
  11903. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11904. class ui_Component106 extends fgui.GButton {
  11905. static createInstance() {
  11906. return (fgui.UIPackage.createObject("game", "Component106"));
  11907. }
  11908. onConstruct() {
  11909. this.c1 = this.getController("c1");
  11910. this.n49 = (this.getChild("n49"));
  11911. this.n18 = (this.getChild("n18"));
  11912. this.n46 = (this.getChild("n46"));
  11913. this.n48 = (this.getChild("n48"));
  11914. }
  11915. }
  11916. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11917. class ui_hb_zs1 extends fgui.GButton {
  11918. static createInstance() {
  11919. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11920. }
  11921. onConstruct() {
  11922. this.c1 = this.getController("c1");
  11923. this.n20 = (this.getChild("n20"));
  11924. this.n21 = (this.getChild("n21"));
  11925. this.n26 = (this.getChild("n26"));
  11926. this.n27 = (this.getChild("n27"));
  11927. this.shareTxt = (this.getChild("shareTxt"));
  11928. this.n32 = (this.getChild("n32"));
  11929. this.n38 = (this.getChild("n38"));
  11930. this.n39 = (this.getChild("n39"));
  11931. this.n44 = (this.getChild("n44"));
  11932. this.diamondTxt = (this.getChild("diamondTxt"));
  11933. this.n41 = (this.getChild("n41"));
  11934. this.n45 = (this.getChild("n45"));
  11935. this.n47 = (this.getChild("n47"));
  11936. this.n48 = (this.getChild("n48"));
  11937. this.randTxt = (this.getChild("randTxt"));
  11938. this.n50 = (this.getChild("n50"));
  11939. this.t0 = this.getTransition("t0");
  11940. }
  11941. }
  11942. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11943. class ui_dh_zs1 extends fgui.GComponent {
  11944. static createInstance() {
  11945. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11946. }
  11947. onConstruct() {
  11948. this.n10 = (this.getChild("n10"));
  11949. this.n9 = (this.getChild("n9"));
  11950. this.n1 = (this.getChild("n1"));
  11951. this.n2 = (this.getChild("n2"));
  11952. this.n3 = (this.getChild("n3"));
  11953. this.n4 = (this.getChild("n4"));
  11954. this.n5 = (this.getChild("n5"));
  11955. this.n6 = (this.getChild("n6"));
  11956. this.n8 = (this.getChild("n8"));
  11957. this.n11 = (this.getChild("n11"));
  11958. this.t0 = this.getTransition("t0");
  11959. }
  11960. }
  11961. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11962. class ui_dh_zs1_1 extends fgui.GComponent {
  11963. static createInstance() {
  11964. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11965. }
  11966. onConstruct() {
  11967. this.n3 = (this.getChild("n3"));
  11968. this.n1 = (this.getChild("n1"));
  11969. this.t0 = this.getTransition("t0");
  11970. }
  11971. }
  11972. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11973. class ui_hb_zs2 extends fgui.GButton {
  11974. static createInstance() {
  11975. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11976. }
  11977. onConstruct() {
  11978. this.n20 = (this.getChild("n20"));
  11979. this.n21 = (this.getChild("n21"));
  11980. this.n26 = (this.getChild("n26"));
  11981. this.n27 = (this.getChild("n27"));
  11982. this.n32 = (this.getChild("n32"));
  11983. this.n38 = (this.getChild("n38"));
  11984. this.n39 = (this.getChild("n39"));
  11985. this.n44 = (this.getChild("n44"));
  11986. this.diamondTxt = (this.getChild("diamondTxt"));
  11987. this.n41 = (this.getChild("n41"));
  11988. this.n45 = (this.getChild("n45"));
  11989. this.t0 = this.getTransition("t0");
  11990. }
  11991. }
  11992. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11993. class ui_hb_zs3 extends fgui.GButton {
  11994. static createInstance() {
  11995. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11996. }
  11997. onConstruct() {
  11998. this.n20 = (this.getChild("n20"));
  11999. this.n21 = (this.getChild("n21"));
  12000. this.n26 = (this.getChild("n26"));
  12001. this.n27 = (this.getChild("n27"));
  12002. this.n32 = (this.getChild("n32"));
  12003. this.n38 = (this.getChild("n38"));
  12004. this.n47 = (this.getChild("n47"));
  12005. this.t0 = this.getTransition("t0");
  12006. }
  12007. }
  12008. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12009. class ui_dh_zs2 extends fgui.GComponent {
  12010. static createInstance() {
  12011. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12012. }
  12013. onConstruct() {
  12014. this.n10 = (this.getChild("n10"));
  12015. this.n9 = (this.getChild("n9"));
  12016. this.n1 = (this.getChild("n1"));
  12017. this.n2 = (this.getChild("n2"));
  12018. this.n3 = (this.getChild("n3"));
  12019. this.n4 = (this.getChild("n4"));
  12020. this.n5 = (this.getChild("n5"));
  12021. this.n6 = (this.getChild("n6"));
  12022. this.n8 = (this.getChild("n8"));
  12023. this.n11 = (this.getChild("n11"));
  12024. this.t0 = this.getTransition("t0");
  12025. }
  12026. }
  12027. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12028. class ui_dh_zs2_1 extends fgui.GComponent {
  12029. static createInstance() {
  12030. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12031. }
  12032. onConstruct() {
  12033. this.n3 = (this.getChild("n3"));
  12034. this.n1 = (this.getChild("n1"));
  12035. this.t0 = this.getTransition("t0");
  12036. }
  12037. }
  12038. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12039. class ui_dh_zs3 extends fgui.GComponent {
  12040. static createInstance() {
  12041. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12042. }
  12043. onConstruct() {
  12044. this.n10 = (this.getChild("n10"));
  12045. this.n9 = (this.getChild("n9"));
  12046. this.n1 = (this.getChild("n1"));
  12047. this.n2 = (this.getChild("n2"));
  12048. this.n3 = (this.getChild("n3"));
  12049. this.n4 = (this.getChild("n4"));
  12050. this.n5 = (this.getChild("n5"));
  12051. this.n6 = (this.getChild("n6"));
  12052. this.n8 = (this.getChild("n8"));
  12053. this.n11 = (this.getChild("n11"));
  12054. this.t0 = this.getTransition("t0");
  12055. }
  12056. }
  12057. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12058. class ui_dh_zs3_1 extends fgui.GComponent {
  12059. static createInstance() {
  12060. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12061. }
  12062. onConstruct() {
  12063. this.n3 = (this.getChild("n3"));
  12064. this.n1 = (this.getChild("n1"));
  12065. this.t0 = this.getTransition("t0");
  12066. }
  12067. }
  12068. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12069. class ui_Component107 extends fgui.GComponent {
  12070. static createInstance() {
  12071. return (fgui.UIPackage.createObject("game", "Component107"));
  12072. }
  12073. onConstruct() {
  12074. this.n18 = (this.getChild("n18"));
  12075. this.n19 = (this.getChild("n19"));
  12076. this.n20 = (this.getChild("n20"));
  12077. this.n21 = (this.getChild("n21"));
  12078. this.n22 = (this.getChild("n22"));
  12079. this.levelTxt = (this.getChild("levelTxt"));
  12080. this.t0 = this.getTransition("t0");
  12081. }
  12082. }
  12083. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12084. class ui_box_com1 extends fgui.GComponent {
  12085. static createInstance() {
  12086. return (fgui.UIPackage.createObject("game", "box_com1"));
  12087. }
  12088. onConstruct() {
  12089. this.n14 = (this.getChild("n14"));
  12090. this.n6 = (this.getChild("n6"));
  12091. this.t0 = this.getTransition("t0");
  12092. }
  12093. }
  12094. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12095. class ui_box_com2 extends fgui.GProgressBar {
  12096. static createInstance() {
  12097. return (fgui.UIPackage.createObject("game", "box_com2"));
  12098. }
  12099. onConstruct() {
  12100. this.bg0 = (this.getChild("bg0"));
  12101. this.bg = (this.getChild("bg"));
  12102. this.bar = (this.getChild("bar"));
  12103. this.n7 = (this.getChild("n7"));
  12104. this.n8 = (this.getChild("n8"));
  12105. this.n10 = (this.getChild("n10"));
  12106. this.n11 = (this.getChild("n11"));
  12107. this.n12 = (this.getChild("n12"));
  12108. }
  12109. }
  12110. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12111. class ui_box_com4 extends fgui.GComponent {
  12112. static createInstance() {
  12113. return (fgui.UIPackage.createObject("game", "box_com4"));
  12114. }
  12115. onConstruct() {
  12116. this.n8 = (this.getChild("n8"));
  12117. this.t0 = this.getTransition("t0");
  12118. }
  12119. }
  12120. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12121. class ui_box_com3 extends fgui.GComponent {
  12122. static createInstance() {
  12123. return (fgui.UIPackage.createObject("game", "box_com3"));
  12124. }
  12125. onConstruct() {
  12126. this.n2 = (this.getChild("n2"));
  12127. this.n3 = (this.getChild("n3"));
  12128. this.n4 = (this.getChild("n4"));
  12129. this.n5 = (this.getChild("n5"));
  12130. this.t0 = this.getTransition("t0");
  12131. this.t1 = this.getTransition("t1");
  12132. }
  12133. }
  12134. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12135. class ui_Component97 extends fgui.GComponent {
  12136. static createInstance() {
  12137. return (fgui.UIPackage.createObject("game", "Component97"));
  12138. }
  12139. onConstruct() {
  12140. this.c1 = this.getController("c1");
  12141. this.n46 = (this.getChild("n46"));
  12142. this.diamondNode = (this.getChild("diamondNode"));
  12143. this.coinNode = (this.getChild("coinNode"));
  12144. this.t0 = this.getTransition("t0");
  12145. }
  12146. }
  12147. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12148. class ui_Component98 extends fgui.GButton {
  12149. static createInstance() {
  12150. return (fgui.UIPackage.createObject("game", "Component98"));
  12151. }
  12152. onConstruct() {
  12153. this.n8 = (this.getChild("n8"));
  12154. this.n40 = (this.getChild("n40"));
  12155. }
  12156. }
  12157. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12158. class ui_Component28_11 extends fgui.GButton {
  12159. static createInstance() {
  12160. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12161. }
  12162. onConstruct() {
  12163. this.c1 = this.getController("c1");
  12164. this.n12 = (this.getChild("n12"));
  12165. this.n17 = (this.getChild("n17"));
  12166. this.n13 = (this.getChild("n13"));
  12167. this.diamondTxt = (this.getChild("diamondTxt"));
  12168. this.n15 = (this.getChild("n15"));
  12169. this.n16 = (this.getChild("n16"));
  12170. }
  12171. }
  12172. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12173. class ui_Component58_11 extends fgui.GComponent {
  12174. static createInstance() {
  12175. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12176. }
  12177. onConstruct() {
  12178. this.n23 = (this.getChild("n23"));
  12179. this.n41 = (this.getChild("n41"));
  12180. this.myList = (this.getChild("myList"));
  12181. this.n45 = (this.getChild("n45"));
  12182. this.n44 = (this.getChild("n44"));
  12183. this.t0 = this.getTransition("t0");
  12184. }
  12185. }
  12186. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12187. class ui_Component100 extends fgui.GComponent {
  12188. static createInstance() {
  12189. return (fgui.UIPackage.createObject("game", "Component100"));
  12190. }
  12191. onConstruct() {
  12192. this.c1 = this.getController("c1");
  12193. this.n75 = (this.getChild("n75"));
  12194. this.n76 = (this.getChild("n76"));
  12195. this.n80 = (this.getChild("n80"));
  12196. this.txt = (this.getChild("txt"));
  12197. this.spineRoot = (this.getChild("spineRoot"));
  12198. }
  12199. }
  12200. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12201. class ui_Component101 extends fgui.GComponent {
  12202. static createInstance() {
  12203. return (fgui.UIPackage.createObject("game", "Component101"));
  12204. }
  12205. onConstruct() {
  12206. this.c1 = this.getController("c1");
  12207. this.n36 = (this.getChild("n36"));
  12208. this.n35 = (this.getChild("n35"));
  12209. this.n33 = (this.getChild("n33"));
  12210. this.n34 = (this.getChild("n34"));
  12211. }
  12212. }
  12213. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12214. class ui_Component53 extends fgui.GComponent {
  12215. static createInstance() {
  12216. return (fgui.UIPackage.createObject("game", "Component53"));
  12217. }
  12218. onConstruct() {
  12219. this.n0 = (this.getChild("n0"));
  12220. this.n1 = (this.getChild("n1"));
  12221. this.n2 = (this.getChild("n2"));
  12222. this.n3 = (this.getChild("n3"));
  12223. this.n4 = (this.getChild("n4"));
  12224. this.n5 = (this.getChild("n5"));
  12225. this.n6 = (this.getChild("n6"));
  12226. this.n7 = (this.getChild("n7"));
  12227. this.n8 = (this.getChild("n8"));
  12228. this.n9 = (this.getChild("n9"));
  12229. this.n10 = (this.getChild("n10"));
  12230. this.n11 = (this.getChild("n11"));
  12231. this.n12 = (this.getChild("n12"));
  12232. this.n13 = (this.getChild("n13"));
  12233. this.n14 = (this.getChild("n14"));
  12234. this.n15 = (this.getChild("n15"));
  12235. this.n16 = (this.getChild("n16"));
  12236. this.n19 = (this.getChild("n19"));
  12237. this.n20 = (this.getChild("n20"));
  12238. this.n21 = (this.getChild("n21"));
  12239. this.n22 = (this.getChild("n22"));
  12240. this.n23 = (this.getChild("n23"));
  12241. this.n24 = (this.getChild("n24"));
  12242. this.n25 = (this.getChild("n25"));
  12243. this.n26 = (this.getChild("n26"));
  12244. this.n27 = (this.getChild("n27"));
  12245. this.n28 = (this.getChild("n28"));
  12246. this.n29 = (this.getChild("n29"));
  12247. this.n30 = (this.getChild("n30"));
  12248. this.n31 = (this.getChild("n31"));
  12249. this.n32 = (this.getChild("n32"));
  12250. this.n33 = (this.getChild("n33"));
  12251. this.n34 = (this.getChild("n34"));
  12252. this.n35 = (this.getChild("n35"));
  12253. this.t0 = this.getTransition("t0");
  12254. }
  12255. }
  12256. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12257. class ui_Component58 extends fgui.GComponent {
  12258. static createInstance() {
  12259. return (fgui.UIPackage.createObject("game", "Component58"));
  12260. }
  12261. onConstruct() {
  12262. this.n23 = (this.getChild("n23"));
  12263. this.n41 = (this.getChild("n41"));
  12264. this.n8 = (this.getChild("n8"));
  12265. this.skillList = (this.getChild("skillList"));
  12266. this.t0 = this.getTransition("t0");
  12267. }
  12268. }
  12269. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12270. class ui_Component59 extends fgui.GComponent {
  12271. static createInstance() {
  12272. return (fgui.UIPackage.createObject("game", "Component59"));
  12273. }
  12274. onConstruct() {
  12275. this.n3 = (this.getChild("n3"));
  12276. this.msgTxt = (this.getChild("msgTxt"));
  12277. this.t0 = this.getTransition("t0");
  12278. }
  12279. }
  12280. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12281. class ui_RulerNode extends fgui.GComponent {
  12282. static createInstance() {
  12283. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12284. }
  12285. onConstruct() {
  12286. this.n6 = (this.getChild("n6"));
  12287. this.n4 = (this.getChild("n4"));
  12288. this.img1 = (this.getChild("img1"));
  12289. this.img2 = (this.getChild("img2"));
  12290. }
  12291. }
  12292. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12293. class ui_Component108 extends fgui.GComponent {
  12294. static createInstance() {
  12295. return (fgui.UIPackage.createObject("game", "Component108"));
  12296. }
  12297. onConstruct() {
  12298. this.n19 = (this.getChild("n19"));
  12299. this.t0 = this.getTransition("t0");
  12300. }
  12301. }
  12302. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12303. class ui_Component63 extends fgui.GComponent {
  12304. static createInstance() {
  12305. return (fgui.UIPackage.createObject("game", "Component63"));
  12306. }
  12307. onConstruct() {
  12308. this.n66 = (this.getChild("n66"));
  12309. this.n56 = (this.getChild("n56"));
  12310. this.n63 = (this.getChild("n63"));
  12311. this.n65 = (this.getChild("n65"));
  12312. this.t0 = this.getTransition("t0");
  12313. }
  12314. }
  12315. ui_Component63.URL = "ui://isxx5ak7h657452";
  12316. class ui_topNode extends fgui.GComponent {
  12317. static createInstance() {
  12318. return (fgui.UIPackage.createObject("game", "topNode"));
  12319. }
  12320. onConstruct() {
  12321. this.selfProgress = (this.getChild("selfProgress"));
  12322. this.aiProgress = (this.getChild("aiProgress"));
  12323. this.selfKuang = (this.getChild("selfKuang"));
  12324. this.aiKuang = (this.getChild("aiKuang"));
  12325. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12326. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12327. this.n33 = (this.getChild("n33"));
  12328. this.n34 = (this.getChild("n34"));
  12329. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12330. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12331. this.selfBallList = (this.getChild("selfBallList"));
  12332. this.aiBallList = (this.getChild("aiBallList"));
  12333. this.middleNode = (this.getChild("middleNode"));
  12334. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12335. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12336. this.scoreNode = (this.getChild("scoreNode"));
  12337. this.selfTips = (this.getChild("selfTips"));
  12338. this.aiTips = (this.getChild("aiTips"));
  12339. }
  12340. }
  12341. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12342. class ui_selfProgress extends fgui.GProgressBar {
  12343. static createInstance() {
  12344. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12345. }
  12346. onConstruct() {
  12347. this.n3 = (this.getChild("n3"));
  12348. this.bar = (this.getChild("bar"));
  12349. }
  12350. }
  12351. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12352. class ui_aiProgress extends fgui.GProgressBar {
  12353. static createInstance() {
  12354. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12355. }
  12356. onConstruct() {
  12357. this.n3 = (this.getChild("n3"));
  12358. this.bar = (this.getChild("bar"));
  12359. }
  12360. }
  12361. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12362. class ui_ballDisplay extends fgui.GComponent {
  12363. static createInstance() {
  12364. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12365. }
  12366. onConstruct() {
  12367. this.myImg = (this.getChild("myImg"));
  12368. }
  12369. }
  12370. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12371. class ui_moveNode extends fgui.GComponent {
  12372. static createInstance() {
  12373. return (fgui.UIPackage.createObject("game", "moveNode"));
  12374. }
  12375. onConstruct() {
  12376. this.n8 = (this.getChild("n8"));
  12377. this.finger = (this.getChild("finger"));
  12378. }
  12379. }
  12380. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12381. class ui_cancelBtn extends fgui.GButton {
  12382. static createInstance() {
  12383. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12384. }
  12385. onConstruct() {
  12386. this.c1 = this.getController("c1");
  12387. this.n0 = (this.getChild("n0"));
  12388. this.n1 = (this.getChild("n1"));
  12389. }
  12390. }
  12391. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12392. class ui_shareBtn extends fgui.GButton {
  12393. static createInstance() {
  12394. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12395. }
  12396. onConstruct() {
  12397. this.c1 = this.getController("c1");
  12398. this.n2 = (this.getChild("n2"));
  12399. this.n1 = (this.getChild("n1"));
  12400. this.n3 = (this.getChild("n3"));
  12401. this.n4 = (this.getChild("n4"));
  12402. this.n5 = (this.getChild("n5"));
  12403. this.n6 = (this.getChild("n6"));
  12404. }
  12405. }
  12406. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12407. class ui_share2Btn extends fgui.GButton {
  12408. static createInstance() {
  12409. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12410. }
  12411. onConstruct() {
  12412. this.n3 = (this.getChild("n3"));
  12413. }
  12414. }
  12415. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12416. class ui_rodMethodNode extends fgui.GComponent {
  12417. static createInstance() {
  12418. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12419. }
  12420. onConstruct() {
  12421. this.bg = (this.getChild("bg"));
  12422. this.dot = (this.getChild("dot"));
  12423. }
  12424. }
  12425. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12426. class ui_sureBtn extends fgui.GButton {
  12427. static createInstance() {
  12428. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12429. }
  12430. onConstruct() {
  12431. this.n2 = (this.getChild("n2"));
  12432. this.n1 = (this.getChild("n1"));
  12433. }
  12434. }
  12435. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12436. class ui_Component18 extends fgui.GComponent {
  12437. static createInstance() {
  12438. return (fgui.UIPackage.createObject("game", "Component18"));
  12439. }
  12440. onConstruct() {
  12441. this.c1 = this.getController("c1");
  12442. this.nameTxt = (this.getChild("nameTxt"));
  12443. this.headImg = (this.getChild("headImg"));
  12444. this.n24 = (this.getChild("n24"));
  12445. this.skillImg = (this.getChild("skillImg"));
  12446. this.skillTxt = (this.getChild("skillTxt"));
  12447. }
  12448. }
  12449. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12450. class ui_Component45 extends fgui.GComponent {
  12451. static createInstance() {
  12452. return (fgui.UIPackage.createObject("game", "Component45"));
  12453. }
  12454. onConstruct() {
  12455. this.c1 = this.getController("c1");
  12456. this.n40 = (this.getChild("n40"));
  12457. this.n41 = (this.getChild("n41"));
  12458. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12459. this.n42 = (this.getChild("n42"));
  12460. this.awardTxt = (this.getChild("awardTxt"));
  12461. this.n44 = (this.getChild("n44"));
  12462. this.t0 = this.getTransition("t0");
  12463. }
  12464. }
  12465. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12466. class ui_emotionDisplay extends fgui.GButton {
  12467. static createInstance() {
  12468. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12469. }
  12470. onConstruct() {
  12471. this.myIcon = (this.getChild("myIcon"));
  12472. }
  12473. }
  12474. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12475. class ui_Component49 extends fgui.GButton {
  12476. static createInstance() {
  12477. return (fgui.UIPackage.createObject("game", "Component49"));
  12478. }
  12479. onConstruct() {
  12480. this.n69 = (this.getChild("n69"));
  12481. this.n56 = (this.getChild("n56"));
  12482. }
  12483. }
  12484. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12485. class ui_Component50 extends fgui.GButton {
  12486. static createInstance() {
  12487. return (fgui.UIPackage.createObject("game", "Component50"));
  12488. }
  12489. onConstruct() {
  12490. this.n54 = (this.getChild("n54"));
  12491. this.n65 = (this.getChild("n65"));
  12492. }
  12493. }
  12494. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12495. class ui_Component51 extends fgui.GButton {
  12496. static createInstance() {
  12497. return (fgui.UIPackage.createObject("game", "Component51"));
  12498. }
  12499. onConstruct() {
  12500. this.c1 = this.getController("c1");
  12501. this.n51 = (this.getChild("n51"));
  12502. this.n54 = (this.getChild("n54"));
  12503. }
  12504. }
  12505. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12506. class ui_Button5 extends fgui.GButton {
  12507. static createInstance() {
  12508. return (fgui.UIPackage.createObject("game", "Button5"));
  12509. }
  12510. onConstruct() {
  12511. this.c1 = this.getController("c1");
  12512. this.n0 = (this.getChild("n0"));
  12513. this.n2 = (this.getChild("n2"));
  12514. }
  12515. }
  12516. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12517. class ui_Component124 extends fgui.GComponent {
  12518. static createInstance() {
  12519. return (fgui.UIPackage.createObject("game", "Component124"));
  12520. }
  12521. onConstruct() {
  12522. this.n22 = (this.getChild("n22"));
  12523. this.shareNode = (this.getChild("shareNode"));
  12524. }
  12525. }
  12526. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12527. class ui_Component125 extends fgui.GComponent {
  12528. static createInstance() {
  12529. return (fgui.UIPackage.createObject("game", "Component125"));
  12530. }
  12531. onConstruct() {
  12532. this.n29 = (this.getChild("n29"));
  12533. this.coinTxt = (this.getChild("coinTxt"));
  12534. }
  12535. }
  12536. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12537. class ui_Component52 extends fgui.GButton {
  12538. static createInstance() {
  12539. return (fgui.UIPackage.createObject("game", "Component52"));
  12540. }
  12541. onConstruct() {
  12542. this.n35 = (this.getChild("n35"));
  12543. this.n36 = (this.getChild("n36"));
  12544. }
  12545. }
  12546. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12547. class ui_drawBtn extends fgui.GButton {
  12548. static createInstance() {
  12549. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12550. }
  12551. onConstruct() {
  12552. this.c1 = this.getController("c1");
  12553. this.n2 = (this.getChild("n2"));
  12554. this.n1 = (this.getChild("n1"));
  12555. this.n5 = (this.getChild("n5"));
  12556. }
  12557. }
  12558. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12559. class ui_Component43 extends fgui.GButton {
  12560. static createInstance() {
  12561. return (fgui.UIPackage.createObject("game", "Component43"));
  12562. }
  12563. onConstruct() {
  12564. this.n49 = (this.getChild("n49"));
  12565. }
  12566. }
  12567. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12568. class ui_wordsDisplay extends fgui.GComponent {
  12569. static createInstance() {
  12570. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12571. }
  12572. onConstruct() {
  12573. this.txt = (this.getChild("txt"));
  12574. this.n63 = (this.getChild("n63"));
  12575. }
  12576. }
  12577. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12578. class ui_Component_phb extends fgui.GComponent {
  12579. static createInstance() {
  12580. return (fgui.UIPackage.createObject("game", "Component_phb"));
  12581. }
  12582. onConstruct() {
  12583. this.n3 = (this.getChild("n3"));
  12584. this.n4 = (this.getChild("n4"));
  12585. }
  12586. }
  12587. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  12588. class ui_Component3 extends fgui.GComponent {
  12589. static createInstance() {
  12590. return (fgui.UIPackage.createObject("game", "Component3"));
  12591. }
  12592. onConstruct() {
  12593. this.n26 = (this.getChild("n26"));
  12594. this.n24 = (this.getChild("n24"));
  12595. this.nameTxt = (this.getChild("nameTxt"));
  12596. this.headRoot = (this.getChild("headRoot"));
  12597. }
  12598. }
  12599. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12600. class ui_Component4 extends fgui.GComponent {
  12601. static createInstance() {
  12602. return (fgui.UIPackage.createObject("game", "Component4"));
  12603. }
  12604. onConstruct() {
  12605. this.headImg = (this.getChild("headImg"));
  12606. }
  12607. }
  12608. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12609. class ui_Component7 extends fgui.GButton {
  12610. static createInstance() {
  12611. return (fgui.UIPackage.createObject("game", "Component7"));
  12612. }
  12613. onConstruct() {
  12614. this.n17 = (this.getChild("n17"));
  12615. }
  12616. }
  12617. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12618. class ui_Component8 extends fgui.GButton {
  12619. static createInstance() {
  12620. return (fgui.UIPackage.createObject("game", "Component8"));
  12621. }
  12622. onConstruct() {
  12623. this.n19 = (this.getChild("n19"));
  12624. }
  12625. }
  12626. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12627. class ui_Component10 extends fgui.GButton {
  12628. static createInstance() {
  12629. return (fgui.UIPackage.createObject("game", "Component10"));
  12630. }
  12631. onConstruct() {
  12632. this.c1 = this.getController("c1");
  12633. this.n40 = (this.getChild("n40"));
  12634. }
  12635. }
  12636. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12637. class ui_Component11 extends fgui.GButton {
  12638. static createInstance() {
  12639. return (fgui.UIPackage.createObject("game", "Component11"));
  12640. }
  12641. onConstruct() {
  12642. this.n34 = (this.getChild("n34"));
  12643. }
  12644. }
  12645. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12646. class ui_Component12 extends fgui.GButton {
  12647. static createInstance() {
  12648. return (fgui.UIPackage.createObject("game", "Component12"));
  12649. }
  12650. onConstruct() {
  12651. this.n35 = (this.getChild("n35"));
  12652. }
  12653. }
  12654. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12655. class ui_Component13 extends fgui.GButton {
  12656. static createInstance() {
  12657. return (fgui.UIPackage.createObject("game", "Component13"));
  12658. }
  12659. onConstruct() {
  12660. this.n27 = (this.getChild("n27"));
  12661. this.n36 = (this.getChild("n36"));
  12662. }
  12663. }
  12664. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12665. class ui_dh_js_tuowei extends fgui.GComponent {
  12666. static createInstance() {
  12667. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12668. }
  12669. onConstruct() {
  12670. this.n19 = (this.getChild("n19"));
  12671. this.n18 = (this.getChild("n18"));
  12672. this.n0 = (this.getChild("n0"));
  12673. this.n3 = (this.getChild("n3"));
  12674. this.n4 = (this.getChild("n4"));
  12675. this.n5 = (this.getChild("n5"));
  12676. this.n6 = (this.getChild("n6"));
  12677. this.n8 = (this.getChild("n8"));
  12678. this.n9 = (this.getChild("n9"));
  12679. this.n10 = (this.getChild("n10"));
  12680. this.n11 = (this.getChild("n11"));
  12681. this.n12 = (this.getChild("n12"));
  12682. this.n13 = (this.getChild("n13"));
  12683. this.n14 = (this.getChild("n14"));
  12684. this.n15 = (this.getChild("n15"));
  12685. this.n20 = (this.getChild("n20"));
  12686. this.t0 = this.getTransition("t0");
  12687. this.t1 = this.getTransition("t1");
  12688. }
  12689. }
  12690. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12691. class ui_dh_js_tw_g extends fgui.GComponent {
  12692. static createInstance() {
  12693. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12694. }
  12695. onConstruct() {
  12696. this.n0 = (this.getChild("n0"));
  12697. this.n1 = (this.getChild("n1"));
  12698. this.t0 = this.getTransition("t0");
  12699. }
  12700. }
  12701. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12702. class ui_dh_js_xingxing extends fgui.GComponent {
  12703. static createInstance() {
  12704. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12705. }
  12706. onConstruct() {
  12707. this.n1 = (this.getChild("n1"));
  12708. this.n2 = (this.getChild("n2"));
  12709. this.n3 = (this.getChild("n3"));
  12710. this.n4 = (this.getChild("n4"));
  12711. this.n0 = (this.getChild("n0"));
  12712. this.t2 = this.getTransition("t2");
  12713. this.t1 = this.getTransition("t1");
  12714. }
  12715. }
  12716. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12717. class ui_dh_zy_jiazai extends fgui.GComponent {
  12718. static createInstance() {
  12719. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12720. }
  12721. onConstruct() {
  12722. this.c1 = this.getController("c1");
  12723. this.n0 = (this.getChild("n0"));
  12724. this.n1 = (this.getChild("n1"));
  12725. this.n2 = (this.getChild("n2"));
  12726. this.n4 = (this.getChild("n4"));
  12727. this.n5 = (this.getChild("n5"));
  12728. this.n6 = (this.getChild("n6"));
  12729. this.n8 = (this.getChild("n8"));
  12730. this.n7 = (this.getChild("n7"));
  12731. this.t0 = this.getTransition("t0");
  12732. }
  12733. }
  12734. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12735. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12736. static createInstance() {
  12737. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12738. }
  12739. onConstruct() {
  12740. this.c1 = this.getController("c1");
  12741. this.n3 = (this.getChild("n3"));
  12742. this.n5 = (this.getChild("n5"));
  12743. this.n4 = (this.getChild("n4"));
  12744. this.n0 = (this.getChild("n0"));
  12745. this.n1 = (this.getChild("n1"));
  12746. this.n2 = (this.getChild("n2"));
  12747. }
  12748. }
  12749. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12750. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12751. static createInstance() {
  12752. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12753. }
  12754. onConstruct() {
  12755. this.n19 = (this.getChild("n19"));
  12756. this.n21 = (this.getChild("n21"));
  12757. this.n0 = (this.getChild("n0"));
  12758. this.n3 = (this.getChild("n3"));
  12759. this.n4 = (this.getChild("n4"));
  12760. this.n5 = (this.getChild("n5"));
  12761. this.n6 = (this.getChild("n6"));
  12762. this.n8 = (this.getChild("n8"));
  12763. this.n9 = (this.getChild("n9"));
  12764. this.n10 = (this.getChild("n10"));
  12765. this.n11 = (this.getChild("n11"));
  12766. this.n12 = (this.getChild("n12"));
  12767. this.n13 = (this.getChild("n13"));
  12768. this.n14 = (this.getChild("n14"));
  12769. this.n15 = (this.getChild("n15"));
  12770. this.n23 = (this.getChild("n23"));
  12771. this.t0 = this.getTransition("t0");
  12772. this.t1 = this.getTransition("t1");
  12773. }
  12774. }
  12775. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12776. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12777. static createInstance() {
  12778. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12779. }
  12780. onConstruct() {
  12781. this.n1 = (this.getChild("n1"));
  12782. this.n2 = (this.getChild("n2"));
  12783. this.t0 = this.getTransition("t0");
  12784. }
  12785. }
  12786. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12787. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12788. static createInstance() {
  12789. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12790. }
  12791. onConstruct() {
  12792. this.n4 = (this.getChild("n4"));
  12793. this.n2 = (this.getChild("n2"));
  12794. this.n3 = (this.getChild("n3"));
  12795. this.idle = this.getTransition("idle");
  12796. this.attack = this.getTransition("attack");
  12797. }
  12798. }
  12799. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12800. class ui_special extends fgui.GComponent {
  12801. static createInstance() {
  12802. return (fgui.UIPackage.createObject("game", "special"));
  12803. }
  12804. onConstruct() {
  12805. this.n18 = (this.getChild("n18"));
  12806. this.n19 = (this.getChild("n19"));
  12807. this.n20 = (this.getChild("n20"));
  12808. this.n21 = (this.getChild("n21"));
  12809. this.n22 = (this.getChild("n22"));
  12810. this.levelTxt = (this.getChild("levelTxt"));
  12811. this.n24 = (this.getChild("n24"));
  12812. this.n25 = (this.getChild("n25"));
  12813. this.t0 = this.getTransition("t0");
  12814. }
  12815. }
  12816. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12817. class ui_Component145 extends fgui.GComponent {
  12818. static createInstance() {
  12819. return (fgui.UIPackage.createObject("game", "Component145"));
  12820. }
  12821. onConstruct() {
  12822. this.guanyuNode = (this.getChild("guanyuNode"));
  12823. }
  12824. }
  12825. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12826. class ui_longBtn extends fgui.GButton {
  12827. static createInstance() {
  12828. return (fgui.UIPackage.createObject("game", "longBtn"));
  12829. }
  12830. onConstruct() {
  12831. this.c1 = this.getController("c1");
  12832. this.n2 = (this.getChild("n2"));
  12833. this.n1 = (this.getChild("n1"));
  12834. this.n4 = (this.getChild("n4"));
  12835. }
  12836. }
  12837. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12838. class ui_Component146 extends fgui.GComponent {
  12839. static createInstance() {
  12840. return (fgui.UIPackage.createObject("game", "Component146"));
  12841. }
  12842. onConstruct() {
  12843. this.n89 = (this.getChild("n89"));
  12844. this.n90 = (this.getChild("n90"));
  12845. this.guideBtn = (this.getChild("guideBtn"));
  12846. }
  12847. }
  12848. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12849. class ui_Component146_11 extends fgui.GComponent {
  12850. static createInstance() {
  12851. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12852. }
  12853. onConstruct() {
  12854. this.n89 = (this.getChild("n89"));
  12855. this.n90 = (this.getChild("n90"));
  12856. this.guideBtn = (this.getChild("guideBtn"));
  12857. }
  12858. }
  12859. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12860. class ui_Component111_1 extends fgui.GComponent {
  12861. static createInstance() {
  12862. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12863. }
  12864. onConstruct() {
  12865. this.n68 = (this.getChild("n68"));
  12866. this.myMask = (this.getChild("myMask"));
  12867. }
  12868. }
  12869. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12870. class ui_Component64_1 extends fgui.GComponent {
  12871. static createInstance() {
  12872. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12873. }
  12874. onConstruct() {
  12875. this.n57 = (this.getChild("n57"));
  12876. this.n54 = (this.getChild("n54"));
  12877. this.n55 = (this.getChild("n55"));
  12878. this.n56 = (this.getChild("n56"));
  12879. this.t1 = this.getTransition("t1");
  12880. }
  12881. }
  12882. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12883. class ui_ModeSelection_com123 extends fgui.GComponent {
  12884. static createInstance() {
  12885. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12886. }
  12887. onConstruct() {
  12888. this.type1 = (this.getChild("type1"));
  12889. this.type2 = (this.getChild("type2"));
  12890. this.type3 = (this.getChild("type3"));
  12891. this.n38 = (this.getChild("n38"));
  12892. this.t0 = this.getTransition("t0");
  12893. }
  12894. }
  12895. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12896. class ui_Component132_2 extends fgui.GComponent {
  12897. static createInstance() {
  12898. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12899. }
  12900. onConstruct() {
  12901. this.n25 = (this.getChild("n25"));
  12902. this.n26 = (this.getChild("n26"));
  12903. this.n27 = (this.getChild("n27"));
  12904. this.t0 = this.getTransition("t0");
  12905. }
  12906. }
  12907. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12908. class ui_UIPower$1 extends fgui.GComponent {
  12909. static createInstance() {
  12910. return (fgui.UIPackage.createObject("game", "UIPower"));
  12911. }
  12912. onConstruct() {
  12913. this.n11 = (this.getChild("n11"));
  12914. this.myNode = (this.getChild("myNode"));
  12915. this.t0 = this.getTransition("t0");
  12916. }
  12917. }
  12918. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12919. class ui_Component133 extends fgui.GComponent {
  12920. static createInstance() {
  12921. return (fgui.UIPackage.createObject("game", "Component133"));
  12922. }
  12923. onConstruct() {
  12924. this.n29 = (this.getChild("n29"));
  12925. this.n30 = (this.getChild("n30"));
  12926. }
  12927. }
  12928. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12929. class ui_Component134 extends fgui.GComponent {
  12930. static createInstance() {
  12931. return (fgui.UIPackage.createObject("game", "Component134"));
  12932. }
  12933. onConstruct() {
  12934. this.n30 = (this.getChild("n30"));
  12935. this.n31 = (this.getChild("n31"));
  12936. this.t0 = this.getTransition("t0");
  12937. }
  12938. }
  12939. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12940. class ui_Component135 extends fgui.GComponent {
  12941. static createInstance() {
  12942. return (fgui.UIPackage.createObject("game", "Component135"));
  12943. }
  12944. onConstruct() {
  12945. this.n30 = (this.getChild("n30"));
  12946. this.t0 = this.getTransition("t0");
  12947. }
  12948. }
  12949. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12950. class ui_Component137 extends fgui.GComponent {
  12951. static createInstance() {
  12952. return (fgui.UIPackage.createObject("game", "Component137"));
  12953. }
  12954. onConstruct() {
  12955. this.n28 = (this.getChild("n28"));
  12956. this.n29 = (this.getChild("n29"));
  12957. this.n30 = (this.getChild("n30"));
  12958. this.n32 = (this.getChild("n32"));
  12959. }
  12960. }
  12961. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12962. class ui_dh_zuanshi extends fgui.GButton {
  12963. static createInstance() {
  12964. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12965. }
  12966. onConstruct() {
  12967. this.n1 = (this.getChild("n1"));
  12968. this.n2 = (this.getChild("n2"));
  12969. this.n0 = (this.getChild("n0"));
  12970. this.n3 = (this.getChild("n3"));
  12971. this.n4 = (this.getChild("n4"));
  12972. }
  12973. }
  12974. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12975. class ui_Component138 extends fgui.GComponent {
  12976. static createInstance() {
  12977. return (fgui.UIPackage.createObject("game", "Component138"));
  12978. }
  12979. onConstruct() {
  12980. this.n1 = (this.getChild("n1"));
  12981. this.n2 = (this.getChild("n2"));
  12982. this.t0 = this.getTransition("t0");
  12983. }
  12984. }
  12985. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12986. class ui_Component139 extends fgui.GComponent {
  12987. static createInstance() {
  12988. return (fgui.UIPackage.createObject("game", "Component139"));
  12989. }
  12990. onConstruct() {
  12991. this.n0 = (this.getChild("n0"));
  12992. this.t0 = this.getTransition("t0");
  12993. }
  12994. }
  12995. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12996. class ui_Component140 extends fgui.GComponent {
  12997. static createInstance() {
  12998. return (fgui.UIPackage.createObject("game", "Component140"));
  12999. }
  13000. onConstruct() {
  13001. this.n2 = (this.getChild("n2"));
  13002. this.n3 = (this.getChild("n3"));
  13003. this.t0 = this.getTransition("t0");
  13004. }
  13005. }
  13006. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  13007. class ui_Component141 extends fgui.GComponent {
  13008. static createInstance() {
  13009. return (fgui.UIPackage.createObject("game", "Component141"));
  13010. }
  13011. onConstruct() {
  13012. this.n0 = (this.getChild("n0"));
  13013. this.t0 = this.getTransition("t0");
  13014. }
  13015. }
  13016. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  13017. class ui_powerNode extends fgui.GProgressBar {
  13018. static createInstance() {
  13019. return (fgui.UIPackage.createObject("game", "powerNode"));
  13020. }
  13021. onConstruct() {
  13022. this.n2 = (this.getChild("n2"));
  13023. this.bar_v = (this.getChild("bar_v"));
  13024. this.showImg = (this.getChild("showImg"));
  13025. this.n12 = (this.getChild("n12"));
  13026. }
  13027. }
  13028. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13029. class ui_dh_jingbi1 extends fgui.GComponent {
  13030. static createInstance() {
  13031. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13032. }
  13033. onConstruct() {
  13034. this.n0 = (this.getChild("n0"));
  13035. this.n1 = (this.getChild("n1"));
  13036. this.n2 = (this.getChild("n2"));
  13037. this.n3 = (this.getChild("n3"));
  13038. this.n4 = (this.getChild("n4"));
  13039. this.n5 = (this.getChild("n5"));
  13040. this.n6 = (this.getChild("n6"));
  13041. this.n8 = (this.getChild("n8"));
  13042. this.t0 = this.getTransition("t0");
  13043. }
  13044. }
  13045. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13046. class ui_Component94 extends fgui.GButton {
  13047. static createInstance() {
  13048. return (fgui.UIPackage.createObject("game", "Component94"));
  13049. }
  13050. onConstruct() {
  13051. this.n77 = (this.getChild("n77"));
  13052. }
  13053. }
  13054. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13055. class ui_Component95 extends fgui.GButton {
  13056. static createInstance() {
  13057. return (fgui.UIPackage.createObject("game", "Component95"));
  13058. }
  13059. onConstruct() {
  13060. this.n77 = (this.getChild("n77"));
  13061. }
  13062. }
  13063. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13064. class ui_Component126 extends fgui.GComponent {
  13065. static createInstance() {
  13066. return (fgui.UIPackage.createObject("game", "Component126"));
  13067. }
  13068. onConstruct() {
  13069. this.c1 = this.getController("c1");
  13070. this.normalBtn = (this.getChild("normalBtn"));
  13071. this.tripleBtn = (this.getChild("tripleBtn"));
  13072. }
  13073. }
  13074. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13075. class ui_Component60 extends fgui.GComponent {
  13076. static createInstance() {
  13077. return (fgui.UIPackage.createObject("game", "Component60"));
  13078. }
  13079. onConstruct() {
  13080. this.c1 = this.getController("c1");
  13081. this.n48 = (this.getChild("n48"));
  13082. this.womanTxt = (this.getChild("womanTxt"));
  13083. this.t0 = this.getTransition("t0");
  13084. }
  13085. }
  13086. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13087. class ui_Component98_3 extends fgui.GButton {
  13088. static createInstance() {
  13089. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13090. }
  13091. onConstruct() {
  13092. this.c1 = this.getController("c1");
  13093. this.n8 = (this.getChild("n8"));
  13094. this.n41 = (this.getChild("n41"));
  13095. this.n40 = (this.getChild("n40"));
  13096. }
  13097. }
  13098. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13099. class ui_ModeSelection_com1 extends fgui.GButton {
  13100. static createInstance() {
  13101. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13102. }
  13103. onConstruct() {
  13104. this.n34 = (this.getChild("n34"));
  13105. this.n36 = (this.getChild("n36"));
  13106. this.n22 = (this.getChild("n22"));
  13107. this.n20 = (this.getChild("n20"));
  13108. this.n23 = (this.getChild("n23"));
  13109. this.n24 = (this.getChild("n24"));
  13110. this.n26 = (this.getChild("n26"));
  13111. this.n33 = (this.getChild("n33"));
  13112. this.coinImg = (this.getChild("coinImg"));
  13113. this.need = (this.getChild("need"));
  13114. this.n35 = (this.getChild("n35"));
  13115. this.n29 = (this.getChild("n29"));
  13116. this.tipsTxt = (this.getChild("tipsTxt"));
  13117. this.n30 = (this.getChild("n30"));
  13118. this.peopleTxt = (this.getChild("peopleTxt"));
  13119. this.t0 = this.getTransition("t0");
  13120. }
  13121. }
  13122. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13123. class ui_ModeSelection_com2 extends fgui.GButton {
  13124. static createInstance() {
  13125. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13126. }
  13127. onConstruct() {
  13128. this.n36 = (this.getChild("n36"));
  13129. this.n34 = (this.getChild("n34"));
  13130. this.n22 = (this.getChild("n22"));
  13131. this.n20 = (this.getChild("n20"));
  13132. this.n23 = (this.getChild("n23"));
  13133. this.n24 = (this.getChild("n24"));
  13134. this.n26 = (this.getChild("n26"));
  13135. this.n33 = (this.getChild("n33"));
  13136. this.coinImg = (this.getChild("coinImg"));
  13137. this.need = (this.getChild("need"));
  13138. this.n35 = (this.getChild("n35"));
  13139. this.n29 = (this.getChild("n29"));
  13140. this.tipsTxt = (this.getChild("tipsTxt"));
  13141. this.n30 = (this.getChild("n30"));
  13142. this.peopleTxt = (this.getChild("peopleTxt"));
  13143. this.t0 = this.getTransition("t0");
  13144. }
  13145. }
  13146. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13147. class ui_ModeSelection_com3 extends fgui.GButton {
  13148. static createInstance() {
  13149. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13150. }
  13151. onConstruct() {
  13152. this.n34 = (this.getChild("n34"));
  13153. this.n36 = (this.getChild("n36"));
  13154. this.n22 = (this.getChild("n22"));
  13155. this.n20 = (this.getChild("n20"));
  13156. this.n23 = (this.getChild("n23"));
  13157. this.n24 = (this.getChild("n24"));
  13158. this.n26 = (this.getChild("n26"));
  13159. this.n33 = (this.getChild("n33"));
  13160. this.coinImg = (this.getChild("coinImg"));
  13161. this.need = (this.getChild("need"));
  13162. this.n35 = (this.getChild("n35"));
  13163. this.n29 = (this.getChild("n29"));
  13164. this.tipsTxt = (this.getChild("tipsTxt"));
  13165. this.n30 = (this.getChild("n30"));
  13166. this.peopleTxt = (this.getChild("peopleTxt"));
  13167. this.t0 = this.getTransition("t0");
  13168. }
  13169. }
  13170. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13171. class ui_Invitation_com1 extends fgui.GComponent {
  13172. static createInstance() {
  13173. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13174. }
  13175. onConstruct() {
  13176. this.n14 = (this.getChild("n14"));
  13177. this.n13 = (this.getChild("n13"));
  13178. this.n3 = (this.getChild("n3"));
  13179. this.n1 = (this.getChild("n1"));
  13180. this.n6 = (this.getChild("n6"));
  13181. this.n7 = (this.getChild("n7"));
  13182. this.enterBtn = (this.getChild("enterBtn"));
  13183. this.n11 = (this.getChild("n11"));
  13184. this.n12 = (this.getChild("n12"));
  13185. this.n15 = (this.getChild("n15"));
  13186. this.t0 = this.getTransition("t0");
  13187. this.t1 = this.getTransition("t1");
  13188. }
  13189. }
  13190. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13191. class ui_Component87_1 extends fgui.GComponent {
  13192. static createInstance() {
  13193. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13194. }
  13195. onConstruct() {
  13196. this.n74 = (this.getChild("n74"));
  13197. this.n73 = (this.getChild("n73"));
  13198. this.ballTxt = (this.getChild("ballTxt"));
  13199. this.n76 = (this.getChild("n76"));
  13200. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13201. this.levelTxt = (this.getChild("levelTxt"));
  13202. this.n87 = (this.getChild("n87"));
  13203. this.n84 = (this.getChild("n84"));
  13204. this.hpTxt = (this.getChild("hpTxt"));
  13205. this.n89 = (this.getChild("n89"));
  13206. this.tipsTxt = (this.getChild("tipsTxt"));
  13207. }
  13208. }
  13209. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13210. class ui_sqg1 extends fgui.GComponent {
  13211. static createInstance() {
  13212. return (fgui.UIPackage.createObject("game", "sqg1"));
  13213. }
  13214. onConstruct() {
  13215. this.n1 = (this.getChild("n1"));
  13216. this.n0 = (this.getChild("n0"));
  13217. }
  13218. }
  13219. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  13220. class ui_sqg2 extends fgui.GComponent {
  13221. static createInstance() {
  13222. return (fgui.UIPackage.createObject("game", "sqg2"));
  13223. }
  13224. onConstruct() {
  13225. this.n1 = (this.getChild("n1"));
  13226. this.n0 = (this.getChild("n0"));
  13227. }
  13228. }
  13229. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  13230. class ui_sqg3 extends fgui.GComponent {
  13231. static createInstance() {
  13232. return (fgui.UIPackage.createObject("game", "sqg3"));
  13233. }
  13234. onConstruct() {
  13235. this.n1 = (this.getChild("n1"));
  13236. this.n0 = (this.getChild("n0"));
  13237. }
  13238. }
  13239. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  13240. class ui_sqg4 extends fgui.GComponent {
  13241. static createInstance() {
  13242. return (fgui.UIPackage.createObject("game", "sqg4"));
  13243. }
  13244. onConstruct() {
  13245. this.n1 = (this.getChild("n1"));
  13246. this.n0 = (this.getChild("n0"));
  13247. }
  13248. }
  13249. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  13250. class ui_Component36 extends fgui.GButton {
  13251. static createInstance() {
  13252. return (fgui.UIPackage.createObject("game", "Component36"));
  13253. }
  13254. onConstruct() {
  13255. this.c1 = this.getController("c1");
  13256. this.n53 = (this.getChild("n53"));
  13257. this.n56 = (this.getChild("n56"));
  13258. }
  13259. }
  13260. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  13261. class ui_Component37 extends fgui.GButton {
  13262. static createInstance() {
  13263. return (fgui.UIPackage.createObject("game", "Component37"));
  13264. }
  13265. onConstruct() {
  13266. this.c1 = this.getController("c1");
  13267. this.n52 = (this.getChild("n52"));
  13268. this.n54 = (this.getChild("n54"));
  13269. }
  13270. }
  13271. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  13272. class ui_UISetting extends fgui.GComponent {
  13273. static createInstance() {
  13274. return (fgui.UIPackage.createObject("game", "UISetting"));
  13275. }
  13276. onConstruct() {
  13277. this.c1 = this.getController("c1");
  13278. this.n4 = (this.getChild("n4"));
  13279. this.soundBtn = (this.getChild("soundBtn"));
  13280. this.shakeBtn = (this.getChild("shakeBtn"));
  13281. this.clickNode = (this.getChild("clickNode"));
  13282. this.xyBtn = (this.getChild("xyBtn"));
  13283. }
  13284. }
  13285. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  13286. class ui_Component39 extends fgui.GComponent {
  13287. static createInstance() {
  13288. return (fgui.UIPackage.createObject("game", "Component39"));
  13289. }
  13290. onConstruct() {
  13291. this.n5 = (this.getChild("n5"));
  13292. this.n6 = (this.getChild("n6"));
  13293. this.n7 = (this.getChild("n7"));
  13294. this.t0 = this.getTransition("t0");
  13295. }
  13296. }
  13297. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  13298. class ui_Component40 extends fgui.GButton {
  13299. static createInstance() {
  13300. return (fgui.UIPackage.createObject("game", "Component40"));
  13301. }
  13302. onConstruct() {
  13303. this.n46 = (this.getChild("n46"));
  13304. this.n47 = (this.getChild("n47"));
  13305. }
  13306. }
  13307. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13308. class ui_Component41 extends fgui.GComponent {
  13309. static createInstance() {
  13310. return (fgui.UIPackage.createObject("game", "Component41"));
  13311. }
  13312. onConstruct() {
  13313. this.c1 = this.getController("c1");
  13314. this.n0 = (this.getChild("n0"));
  13315. this.titleTxt = (this.getChild("titleTxt"));
  13316. this.n2 = (this.getChild("n2"));
  13317. this.msgTips = (this.getChild("msgTips"));
  13318. this.numTxt = (this.getChild("numTxt"));
  13319. this.n18 = (this.getChild("n18"));
  13320. this.cancelBtn = (this.getChild("cancelBtn"));
  13321. this.videoBtn = (this.getChild("videoBtn"));
  13322. this.n10 = (this.getChild("n10"));
  13323. }
  13324. }
  13325. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13326. class ui_Component42 extends fgui.GComponent {
  13327. static createInstance() {
  13328. return (fgui.UIPackage.createObject("game", "Component42"));
  13329. }
  13330. onConstruct() {
  13331. this.c1 = this.getController("c1");
  13332. this.n1 = (this.getChild("n1"));
  13333. this.n2 = (this.getChild("n2"));
  13334. this.n3 = (this.getChild("n3"));
  13335. this.tipsTxt = (this.getChild("tipsTxt"));
  13336. this.cancelBtn = (this.getChild("cancelBtn"));
  13337. this.sureBtn = (this.getChild("sureBtn"));
  13338. this.n11 = (this.getChild("n11"));
  13339. this.n13 = (this.getChild("n13"));
  13340. this.n14 = (this.getChild("n14"));
  13341. this.womanTxt = (this.getChild("womanTxt"));
  13342. this.t0 = this.getTransition("t0");
  13343. }
  13344. }
  13345. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13346. class ui_dh_js_shengli extends fgui.GComponent {
  13347. static createInstance() {
  13348. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13349. }
  13350. onConstruct() {
  13351. this.n3 = (this.getChild("n3"));
  13352. this.n4 = (this.getChild("n4"));
  13353. this.n1 = (this.getChild("n1"));
  13354. this.n2 = (this.getChild("n2"));
  13355. this.n5 = (this.getChild("n5"));
  13356. this.n6 = (this.getChild("n6"));
  13357. this.n7 = (this.getChild("n7"));
  13358. this.n8 = (this.getChild("n8"));
  13359. this.attack = this.getTransition("attack");
  13360. this.idle = this.getTransition("idle");
  13361. }
  13362. }
  13363. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13364. class ui_dh_js_shengli_g extends fgui.GComponent {
  13365. static createInstance() {
  13366. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13367. }
  13368. onConstruct() {
  13369. this.n3 = (this.getChild("n3"));
  13370. this.n1 = (this.getChild("n1"));
  13371. this.t0 = this.getTransition("t0");
  13372. }
  13373. }
  13374. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13375. class ui_dh_js_shibai extends fgui.GComponent {
  13376. static createInstance() {
  13377. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13378. }
  13379. onConstruct() {
  13380. this.n0 = (this.getChild("n0"));
  13381. this.n1 = (this.getChild("n1"));
  13382. this.n2 = (this.getChild("n2"));
  13383. this.n3 = (this.getChild("n3"));
  13384. this.idle = this.getTransition("idle");
  13385. this.attack = this.getTransition("attack");
  13386. }
  13387. }
  13388. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13389. class ui_dh_zy_ganfa extends fgui.GButton {
  13390. static createInstance() {
  13391. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13392. }
  13393. onConstruct() {
  13394. this.n0 = (this.getChild("n0"));
  13395. }
  13396. }
  13397. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13398. class ui_dh_zy_sc_guang extends fgui.GButton {
  13399. static createInstance() {
  13400. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13401. }
  13402. onConstruct() {
  13403. this.n0 = (this.getChild("n0"));
  13404. this.n2 = (this.getChild("n2"));
  13405. }
  13406. }
  13407. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13408. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13409. static createInstance() {
  13410. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13411. }
  13412. onConstruct() {
  13413. this.n0 = (this.getChild("n0"));
  13414. this.n3 = (this.getChild("n3"));
  13415. this.t0 = this.getTransition("t0");
  13416. }
  13417. }
  13418. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13419. class ui_dh_zy_wanfa extends fgui.GButton {
  13420. static createInstance() {
  13421. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13422. }
  13423. onConstruct() {
  13424. this.n0 = (this.getChild("n0"));
  13425. }
  13426. }
  13427. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13428. class ui_Component53_1 extends fgui.GComponent {
  13429. static createInstance() {
  13430. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13431. }
  13432. onConstruct() {
  13433. this.n0 = (this.getChild("n0"));
  13434. this.n1 = (this.getChild("n1"));
  13435. this.n2 = (this.getChild("n2"));
  13436. this.n3 = (this.getChild("n3"));
  13437. this.n4 = (this.getChild("n4"));
  13438. this.n5 = (this.getChild("n5"));
  13439. this.n6 = (this.getChild("n6"));
  13440. this.n7 = (this.getChild("n7"));
  13441. this.n8 = (this.getChild("n8"));
  13442. this.n9 = (this.getChild("n9"));
  13443. this.n10 = (this.getChild("n10"));
  13444. this.n11 = (this.getChild("n11"));
  13445. this.n12 = (this.getChild("n12"));
  13446. this.n13 = (this.getChild("n13"));
  13447. this.n14 = (this.getChild("n14"));
  13448. this.n15 = (this.getChild("n15"));
  13449. this.n16 = (this.getChild("n16"));
  13450. this.n19 = (this.getChild("n19"));
  13451. this.n20 = (this.getChild("n20"));
  13452. this.n21 = (this.getChild("n21"));
  13453. this.n22 = (this.getChild("n22"));
  13454. this.n23 = (this.getChild("n23"));
  13455. this.n24 = (this.getChild("n24"));
  13456. this.n25 = (this.getChild("n25"));
  13457. this.n26 = (this.getChild("n26"));
  13458. this.n27 = (this.getChild("n27"));
  13459. this.n28 = (this.getChild("n28"));
  13460. this.n29 = (this.getChild("n29"));
  13461. this.n30 = (this.getChild("n30"));
  13462. this.n31 = (this.getChild("n31"));
  13463. this.n32 = (this.getChild("n32"));
  13464. this.n33 = (this.getChild("n33"));
  13465. this.n34 = (this.getChild("n34"));
  13466. this.n35 = (this.getChild("n35"));
  13467. this.t0 = this.getTransition("t0");
  13468. }
  13469. }
  13470. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13471. class ui_Component30 extends fgui.GComponent {
  13472. static createInstance() {
  13473. return (fgui.UIPackage.createObject("game", "Component30"));
  13474. }
  13475. onConstruct() {
  13476. this.c1 = this.getController("c1");
  13477. this.n46 = (this.getChild("n46"));
  13478. this.n47 = (this.getChild("n47"));
  13479. this.numTxt = (this.getChild("numTxt"));
  13480. this.n50 = (this.getChild("n50"));
  13481. this.n53 = (this.getChild("n53"));
  13482. this.n54 = (this.getChild("n54"));
  13483. this.n55 = (this.getChild("n55"));
  13484. this.n56 = (this.getChild("n56"));
  13485. }
  13486. }
  13487. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13488. class ui_Component30_1 extends fgui.GComponent {
  13489. static createInstance() {
  13490. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13491. }
  13492. onConstruct() {
  13493. this.c1 = this.getController("c1");
  13494. this.n46 = (this.getChild("n46"));
  13495. this.n47 = (this.getChild("n47"));
  13496. this.numTxt = (this.getChild("numTxt"));
  13497. this.n50 = (this.getChild("n50"));
  13498. this.n51 = (this.getChild("n51"));
  13499. this.n52 = (this.getChild("n52"));
  13500. this.n53 = (this.getChild("n53"));
  13501. this.n54 = (this.getChild("n54"));
  13502. }
  13503. }
  13504. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13505. class ui_Component31 extends fgui.GComponent {
  13506. static createInstance() {
  13507. return (fgui.UIPackage.createObject("game", "Component31"));
  13508. }
  13509. onConstruct() {
  13510. this.n55 = (this.getChild("n55"));
  13511. this.n54 = (this.getChild("n54"));
  13512. this.conditionTxt = (this.getChild("conditionTxt"));
  13513. this.n57 = (this.getChild("n57"));
  13514. this.t0 = this.getTransition("t0");
  13515. }
  13516. }
  13517. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13518. class ui_Component32 extends fgui.GComponent {
  13519. static createInstance() {
  13520. return (fgui.UIPackage.createObject("game", "Component32"));
  13521. }
  13522. onConstruct() {
  13523. this.n5 = (this.getChild("n5"));
  13524. this.n6 = (this.getChild("n6"));
  13525. this.n7 = (this.getChild("n7"));
  13526. this.t0 = this.getTransition("t0");
  13527. }
  13528. }
  13529. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13530. class ui_AwardItem extends fgui.GComponent {
  13531. static createInstance() {
  13532. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13533. }
  13534. onConstruct() {
  13535. this.n9 = (this.getChild("n9"));
  13536. this.myIcon = (this.getChild("myIcon"));
  13537. this.numTxt = (this.getChild("numTxt"));
  13538. this.nameTxt = (this.getChild("nameTxt"));
  13539. this.n16 = (this.getChild("n16"));
  13540. this.n17 = (this.getChild("n17"));
  13541. }
  13542. }
  13543. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13544. class ui_ranking_com1 extends fgui.GButton {
  13545. static createInstance() {
  13546. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13547. }
  13548. onConstruct() {
  13549. this.c1 = this.getController("c1");
  13550. this.n49 = (this.getChild("n49"));
  13551. this.n18 = (this.getChild("n18"));
  13552. this.n46 = (this.getChild("n46"));
  13553. this.n48 = (this.getChild("n48"));
  13554. this.n50 = (this.getChild("n50"));
  13555. }
  13556. }
  13557. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13558. class ui_ranking_com2 extends fgui.GButton {
  13559. static createInstance() {
  13560. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13561. }
  13562. onConstruct() {
  13563. this.c1 = this.getController("c1");
  13564. this.n49 = (this.getChild("n49"));
  13565. this.n18 = (this.getChild("n18"));
  13566. this.n46 = (this.getChild("n46"));
  13567. this.n48 = (this.getChild("n48"));
  13568. this.n50 = (this.getChild("n50"));
  13569. }
  13570. }
  13571. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13572. class ui_ranking_com3 extends fgui.GComponent {
  13573. static createInstance() {
  13574. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13575. }
  13576. onConstruct() {
  13577. this.n17 = (this.getChild("n17"));
  13578. this.myIcon = (this.getChild("myIcon"));
  13579. }
  13580. }
  13581. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13582. class ui_ranking_com4 extends fgui.GComponent {
  13583. static createInstance() {
  13584. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13585. }
  13586. onConstruct() {
  13587. this.n16 = (this.getChild("n16"));
  13588. this.head = (this.getChild("head"));
  13589. }
  13590. }
  13591. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13592. class ui_ranking_com5 extends fgui.GComponent {
  13593. static createInstance() {
  13594. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13595. }
  13596. onConstruct() {
  13597. this.c1 = this.getController("c1");
  13598. this.c2 = this.getController("c2");
  13599. this.n2 = (this.getChild("n2"));
  13600. this.n3 = (this.getChild("n3"));
  13601. this.levelBtn = (this.getChild("levelBtn"));
  13602. this.starBtn = (this.getChild("starBtn"));
  13603. this.n23 = (this.getChild("n23"));
  13604. this.n24 = (this.getChild("n24"));
  13605. this.n25 = (this.getChild("n25"));
  13606. this.myList = (this.getChild("myList"));
  13607. this.selfNode = (this.getChild("selfNode"));
  13608. this.n9 = (this.getChild("n9"));
  13609. this.n12 = (this.getChild("n12"));
  13610. this.n13 = (this.getChild("n13"));
  13611. this.n14 = (this.getChild("n14"));
  13612. this.n39 = (this.getChild("n39"));
  13613. this.n41 = (this.getChild("n41"));
  13614. this.n42 = (this.getChild("n42"));
  13615. this.n45 = (this.getChild("n45"));
  13616. this.changeBtn = (this.getChild("changeBtn"));
  13617. this.closeBtn = (this.getChild("closeBtn"));
  13618. this.t0 = this.getTransition("t0");
  13619. }
  13620. }
  13621. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13622. class ui_RankItem extends fgui.GComponent {
  13623. static createInstance() {
  13624. return (fgui.UIPackage.createObject("game", "RankItem"));
  13625. }
  13626. onConstruct() {
  13627. this.n10 = (this.getChild("n10"));
  13628. this.n11 = (this.getChild("n11"));
  13629. this.rankTxt = (this.getChild("rankTxt"));
  13630. this.headNode = (this.getChild("headNode"));
  13631. this.nameTxt = (this.getChild("nameTxt"));
  13632. this.n19 = (this.getChild("n19"));
  13633. this.valueTxt = (this.getChild("valueTxt"));
  13634. this.img1 = (this.getChild("img1"));
  13635. this.img2 = (this.getChild("img2"));
  13636. this.img3 = (this.getChild("img3"));
  13637. }
  13638. }
  13639. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13640. class ui_ranking_com9 extends fgui.GComponent {
  13641. static createInstance() {
  13642. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13643. }
  13644. onConstruct() {
  13645. this.c1 = this.getController("c1");
  13646. this.n27 = (this.getChild("n27"));
  13647. this.n28 = (this.getChild("n28"));
  13648. this.headNode = (this.getChild("headNode"));
  13649. this.rankTxt = (this.getChild("rankTxt"));
  13650. this.nameTxt = (this.getChild("nameTxt"));
  13651. this.n34 = (this.getChild("n34"));
  13652. this.valueTxt = (this.getChild("valueTxt"));
  13653. this.n36 = (this.getChild("n36"));
  13654. this.n37 = (this.getChild("n37"));
  13655. this.n38 = (this.getChild("n38"));
  13656. this.n39 = (this.getChild("n39"));
  13657. this.n40 = (this.getChild("n40"));
  13658. }
  13659. }
  13660. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13661. class ui_ranking_com10 extends fgui.GComponent {
  13662. static createInstance() {
  13663. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13664. }
  13665. onConstruct() {
  13666. this.n23 = (this.getChild("n23"));
  13667. this.n24 = (this.getChild("n24"));
  13668. }
  13669. }
  13670. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13671. class ui_ranking_com11 extends fgui.GComponent {
  13672. static createInstance() {
  13673. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13674. }
  13675. onConstruct() {
  13676. this.n24 = (this.getChild("n24"));
  13677. this.n25 = (this.getChild("n25"));
  13678. this.t0 = this.getTransition("t0");
  13679. }
  13680. }
  13681. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13682. class ui_ranking_com13 extends fgui.GButton {
  13683. static createInstance() {
  13684. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13685. }
  13686. onConstruct() {
  13687. this.c1 = this.getController("c1");
  13688. this.n44 = (this.getChild("n44"));
  13689. this.n45 = (this.getChild("n45"));
  13690. this.n46 = (this.getChild("n46"));
  13691. }
  13692. }
  13693. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13694. class ui_Component122 extends fgui.GComponent {
  13695. static createInstance() {
  13696. return (fgui.UIPackage.createObject("game", "Component122"));
  13697. }
  13698. onConstruct() {
  13699. this.gameNode3 = (this.getChild("gameNode3"));
  13700. }
  13701. }
  13702. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13703. class ui_skillItem extends fgui.GComponent {
  13704. static createInstance() {
  13705. return (fgui.UIPackage.createObject("game", "skillItem"));
  13706. }
  13707. onConstruct() {
  13708. this.c1 = this.getController("c1");
  13709. this.n31 = (this.getChild("n31"));
  13710. this.n6 = (this.getChild("n6"));
  13711. this.skillImg = (this.getChild("skillImg"));
  13712. this.nameTxt = (this.getChild("nameTxt"));
  13713. this.levelTxt = (this.getChild("levelTxt"));
  13714. this.n28 = (this.getChild("n28"));
  13715. this.describeTxt = (this.getChild("describeTxt"));
  13716. this.n32 = (this.getChild("n32"));
  13717. this.mutiBtn = (this.getChild("mutiBtn"));
  13718. this.tryNode = (this.getChild("tryNode"));
  13719. this.normalBtn = (this.getChild("normalBtn"));
  13720. this.startBtn = (this.getChild("startBtn"));
  13721. this.n42 = (this.getChild("n42"));
  13722. this.n43 = (this.getChild("n43"));
  13723. this.n44 = (this.getChild("n44"));
  13724. }
  13725. }
  13726. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13727. class ui_Component26 extends fgui.GButton {
  13728. static createInstance() {
  13729. return (fgui.UIPackage.createObject("game", "Component26"));
  13730. }
  13731. onConstruct() {
  13732. this.n11 = (this.getChild("n11"));
  13733. this.n30 = (this.getChild("n30"));
  13734. this.n34 = (this.getChild("n34"));
  13735. }
  13736. }
  13737. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13738. class ui_Component28 extends fgui.GButton {
  13739. static createInstance() {
  13740. return (fgui.UIPackage.createObject("game", "Component28"));
  13741. }
  13742. onConstruct() {
  13743. this.n12 = (this.getChild("n12"));
  13744. this.n31 = (this.getChild("n31"));
  13745. this.curTxt = (this.getChild("curTxt"));
  13746. this.n33 = (this.getChild("n33"));
  13747. }
  13748. }
  13749. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13750. class ui_Component1302 extends fgui.GComponent {
  13751. static createInstance() {
  13752. return (fgui.UIPackage.createObject("game", "Component1302"));
  13753. }
  13754. onConstruct() {
  13755. this.n2 = (this.getChild("n2"));
  13756. this.n3 = (this.getChild("n3"));
  13757. }
  13758. }
  13759. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13760. class ui_Component113 extends fgui.GComponent {
  13761. static createInstance() {
  13762. return (fgui.UIPackage.createObject("game", "Component113"));
  13763. }
  13764. onConstruct() {
  13765. this.n85 = (this.getChild("n85"));
  13766. this.n86 = (this.getChild("n86"));
  13767. this.n77 = (this.getChild("n77"));
  13768. this.n79 = (this.getChild("n79"));
  13769. this.n80 = (this.getChild("n80"));
  13770. this.n81 = (this.getChild("n81"));
  13771. this.n82 = (this.getChild("n82"));
  13772. this.n84 = (this.getChild("n84"));
  13773. this.n87 = (this.getChild("n87"));
  13774. this.t0 = this.getTransition("t0");
  13775. }
  13776. }
  13777. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13778. class ui_Component114 extends fgui.GComponent {
  13779. static createInstance() {
  13780. return (fgui.UIPackage.createObject("game", "Component114"));
  13781. }
  13782. onConstruct() {
  13783. this.n77 = (this.getChild("n77"));
  13784. this.t0 = this.getTransition("t0");
  13785. }
  13786. }
  13787. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13788. class ui_Component115 extends fgui.GComponent {
  13789. static createInstance() {
  13790. return (fgui.UIPackage.createObject("game", "Component115"));
  13791. }
  13792. onConstruct() {
  13793. this.n83 = (this.getChild("n83"));
  13794. this.fingerNode = (this.getChild("fingerNode"));
  13795. this.n84 = (this.getChild("n84"));
  13796. }
  13797. }
  13798. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13799. class ui_Component117 extends fgui.GComponent {
  13800. static createInstance() {
  13801. return (fgui.UIPackage.createObject("game", "Component117"));
  13802. }
  13803. onConstruct() {
  13804. this.n87 = (this.getChild("n87"));
  13805. this.n88 = (this.getChild("n88"));
  13806. this.n84 = (this.getChild("n84"));
  13807. this.n85 = (this.getChild("n85"));
  13808. this.n86 = (this.getChild("n86"));
  13809. this.t0 = this.getTransition("t0");
  13810. }
  13811. }
  13812. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13813. class ui_Component98_1 extends fgui.GButton {
  13814. static createInstance() {
  13815. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13816. }
  13817. onConstruct() {
  13818. this.c1 = this.getController("c1");
  13819. this.n8 = (this.getChild("n8"));
  13820. this.n41 = (this.getChild("n41"));
  13821. this.n40 = (this.getChild("n40"));
  13822. }
  13823. }
  13824. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13825. class ui_Component61 extends fgui.GComponent {
  13826. static createInstance() {
  13827. return (fgui.UIPackage.createObject("game", "Component61"));
  13828. }
  13829. onConstruct() {
  13830. this.n14 = (this.getChild("n14"));
  13831. this.n6 = (this.getChild("n6"));
  13832. this.t0 = this.getTransition("t0");
  13833. }
  13834. }
  13835. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13836. class ui_Component62 extends fgui.GComponent {
  13837. static createInstance() {
  13838. return (fgui.UIPackage.createObject("game", "Component62"));
  13839. }
  13840. onConstruct() {
  13841. this.n66 = (this.getChild("n66"));
  13842. this.n56 = (this.getChild("n56"));
  13843. this.n63 = (this.getChild("n63"));
  13844. this.n65 = (this.getChild("n65"));
  13845. this.t0 = this.getTransition("t0");
  13846. }
  13847. }
  13848. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13849. class ui_d3Root extends fgui.GComponent {
  13850. static createInstance() {
  13851. return (fgui.UIPackage.createObject("game", "d3Root"));
  13852. }
  13853. onConstruct() {
  13854. }
  13855. }
  13856. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13857. class ui_d2Root extends fgui.GComponent {
  13858. static createInstance() {
  13859. return (fgui.UIPackage.createObject("game", "d2Root"));
  13860. }
  13861. onConstruct() {
  13862. }
  13863. }
  13864. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13865. class ui_ballNode extends fgui.GComponent {
  13866. static createInstance() {
  13867. return (fgui.UIPackage.createObject("game", "ballNode"));
  13868. }
  13869. onConstruct() {
  13870. }
  13871. }
  13872. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13873. class ui_border extends fgui.GComponent {
  13874. static createInstance() {
  13875. return (fgui.UIPackage.createObject("game", "border"));
  13876. }
  13877. onConstruct() {
  13878. this.bar1 = (this.getChild("bar1"));
  13879. this.bar2 = (this.getChild("bar2"));
  13880. this.bar3 = (this.getChild("bar3"));
  13881. this.bar4 = (this.getChild("bar4"));
  13882. this.bar5 = (this.getChild("bar5"));
  13883. this.bar6 = (this.getChild("bar6"));
  13884. this.circle1 = (this.getChild("circle1"));
  13885. this.circle2 = (this.getChild("circle2"));
  13886. this.circle3 = (this.getChild("circle3"));
  13887. this.circle4 = (this.getChild("circle4"));
  13888. this.circle5 = (this.getChild("circle5"));
  13889. this.circle6 = (this.getChild("circle6"));
  13890. this.n28 = (this.getChild("n28"));
  13891. }
  13892. }
  13893. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13894. class ui_Component41_2 extends fgui.GComponent {
  13895. static createInstance() {
  13896. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13897. }
  13898. onConstruct() {
  13899. this.c1 = this.getController("c1");
  13900. this.n0 = (this.getChild("n0"));
  13901. this.n2 = (this.getChild("n2"));
  13902. this.n19 = (this.getChild("n19"));
  13903. this.cancelBtn = (this.getChild("cancelBtn"));
  13904. this.videoBtn = (this.getChild("videoBtn"));
  13905. this.n9 = (this.getChild("n9"));
  13906. this.n22 = (this.getChild("n22"));
  13907. this.tipsTxt = (this.getChild("tipsTxt"));
  13908. this.n23 = (this.getChild("n23"));
  13909. this.n24 = (this.getChild("n24"));
  13910. this.n26 = (this.getChild("n26"));
  13911. this.n27 = (this.getChild("n27"));
  13912. this.titleTxt = (this.getChild("titleTxt"));
  13913. }
  13914. }
  13915. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13916. class ui_Component41_1 extends fgui.GComponent {
  13917. static createInstance() {
  13918. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13919. }
  13920. onConstruct() {
  13921. this.c1 = this.getController("c1");
  13922. this.n0 = (this.getChild("n0"));
  13923. this.n2 = (this.getChild("n2"));
  13924. this.cancelBtn = (this.getChild("cancelBtn"));
  13925. this.videoBtn = (this.getChild("videoBtn"));
  13926. this.n27 = (this.getChild("n27"));
  13927. this.n30 = (this.getChild("n30"));
  13928. this.n31 = (this.getChild("n31"));
  13929. this.n32 = (this.getChild("n32"));
  13930. this.n33 = (this.getChild("n33"));
  13931. this.n34 = (this.getChild("n34"));
  13932. this.n35 = (this.getChild("n35"));
  13933. this.n36 = (this.getChild("n36"));
  13934. this.n1 = (this.getChild("n1"));
  13935. this.n37 = (this.getChild("n37"));
  13936. this.t0 = this.getTransition("t0");
  13937. this.t1 = this.getTransition("t1");
  13938. this.t2 = this.getTransition("t2");
  13939. this.t3 = this.getTransition("t3");
  13940. }
  13941. }
  13942. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13943. class ui_againBtn extends fgui.GButton {
  13944. static createInstance() {
  13945. return (fgui.UIPackage.createObject("game", "againBtn"));
  13946. }
  13947. onConstruct() {
  13948. this.n2 = (this.getChild("n2"));
  13949. this.n1 = (this.getChild("n1"));
  13950. this.n5 = (this.getChild("n5"));
  13951. }
  13952. }
  13953. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13954. class ui_Component118 extends fgui.GButton {
  13955. static createInstance() {
  13956. return (fgui.UIPackage.createObject("game", "Component118"));
  13957. }
  13958. onConstruct() {
  13959. this.c1 = this.getController("c1");
  13960. this.n14 = (this.getChild("n14"));
  13961. this.n9 = (this.getChild("n9"));
  13962. this.n10 = (this.getChild("n10"));
  13963. this.diamondTxt = (this.getChild("diamondTxt"));
  13964. this.n13 = (this.getChild("n13"));
  13965. this.n15 = (this.getChild("n15"));
  13966. }
  13967. }
  13968. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13969. class ui_Component119 extends fgui.GComponent {
  13970. static createInstance() {
  13971. return (fgui.UIPackage.createObject("game", "Component119"));
  13972. }
  13973. onConstruct() {
  13974. this.n1 = (this.getChild("n1"));
  13975. this.n2 = (this.getChild("n2"));
  13976. this.n13 = (this.getChild("n13"));
  13977. this.n6 = (this.getChild("n6"));
  13978. this.screenNode = (this.getChild("screenNode"));
  13979. this.n15 = (this.getChild("n15"));
  13980. this.closeBtn = (this.getChild("closeBtn"));
  13981. this.share2Btn = (this.getChild("share2Btn"));
  13982. this.shareBtn = (this.getChild("shareBtn"));
  13983. this.tipsNode = (this.getChild("tipsNode"));
  13984. this.awardNode = (this.getChild("awardNode"));
  13985. }
  13986. }
  13987. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13988. class ui_Component132_1 extends fgui.GComponent {
  13989. static createInstance() {
  13990. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13991. }
  13992. onConstruct() {
  13993. this.n25 = (this.getChild("n25"));
  13994. this.n26 = (this.getChild("n26"));
  13995. this.n27 = (this.getChild("n27"));
  13996. this.t0 = this.getTransition("t0");
  13997. }
  13998. }
  13999. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  14000. class ui_SecretaryDisplay extends fgui.GComponent {
  14001. static createInstance() {
  14002. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  14003. }
  14004. onConstruct() {
  14005. this.n2 = (this.getChild("n2"));
  14006. this.levelTxt = (this.getChild("levelTxt"));
  14007. this.n4 = (this.getChild("n4"));
  14008. this.secretary = (this.getChild("secretary"));
  14009. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14010. this.n16 = (this.getChild("n16"));
  14011. this.n37 = (this.getChild("n37"));
  14012. this.n41 = (this.getChild("n41"));
  14013. this.n14 = (this.getChild("n14"));
  14014. this.n17 = (this.getChild("n17"));
  14015. this.heightTxt = (this.getChild("heightTxt"));
  14016. this.n46 = (this.getChild("n46"));
  14017. this.n36 = (this.getChild("n36"));
  14018. this.n38 = (this.getChild("n38"));
  14019. this.foodTxt = (this.getChild("foodTxt"));
  14020. this.n47 = (this.getChild("n47"));
  14021. this.n40 = (this.getChild("n40"));
  14022. this.n42 = (this.getChild("n42"));
  14023. this.historyTxt = (this.getChild("historyTxt"));
  14024. this.n48 = (this.getChild("n48"));
  14025. this.nameImg = (this.getChild("nameImg"));
  14026. this.n12 = (this.getChild("n12"));
  14027. this.n49 = (this.getChild("n49"));
  14028. this.t0 = this.getTransition("t0");
  14029. }
  14030. }
  14031. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14032. class ui_BallRodDisplay extends fgui.GComponent {
  14033. static createInstance() {
  14034. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14035. }
  14036. onConstruct() {
  14037. this.c1 = this.getController("c1");
  14038. this.n31 = (this.getChild("n31"));
  14039. this.n6 = (this.getChild("n6"));
  14040. this.nameTxt = (this.getChild("nameTxt"));
  14041. this.rodImg = (this.getChild("rodImg"));
  14042. this.levelNode = (this.getChild("levelNode"));
  14043. this.eftRod = (this.getChild("eftRod"));
  14044. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14045. }
  14046. }
  14047. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14048. class ui_Component111_11 extends fgui.GComponent {
  14049. static createInstance() {
  14050. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14051. }
  14052. onConstruct() {
  14053. this.n68 = (this.getChild("n68"));
  14054. this.n69 = (this.getChild("n69"));
  14055. }
  14056. }
  14057. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14058. class ui_Component112 extends fgui.GComponent {
  14059. static createInstance() {
  14060. return (fgui.UIPackage.createObject("game", "Component112"));
  14061. }
  14062. onConstruct() {
  14063. this.n68 = (this.getChild("n68"));
  14064. this.n70 = (this.getChild("n70"));
  14065. this.myMask = (this.getChild("myMask"));
  14066. }
  14067. }
  14068. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14069. class ui_Component111 extends fgui.GComponent {
  14070. static createInstance() {
  14071. return (fgui.UIPackage.createObject("game", "Component111"));
  14072. }
  14073. onConstruct() {
  14074. this.n68 = (this.getChild("n68"));
  14075. this.myMask = (this.getChild("myMask"));
  14076. }
  14077. }
  14078. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14079. class ui_Component144 extends fgui.GButton {
  14080. static createInstance() {
  14081. return (fgui.UIPackage.createObject("game", "Component144"));
  14082. }
  14083. onConstruct() {
  14084. this.n8 = (this.getChild("n8"));
  14085. }
  14086. }
  14087. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14088. class ui_Sign_com2 extends fgui.GComponent {
  14089. static createInstance() {
  14090. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14091. }
  14092. onConstruct() {
  14093. this.n0 = (this.getChild("n0"));
  14094. this.n1 = (this.getChild("n1"));
  14095. this.t0 = this.getTransition("t0");
  14096. }
  14097. }
  14098. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14099. class ui_Sign_guang extends fgui.GComponent {
  14100. static createInstance() {
  14101. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14102. }
  14103. onConstruct() {
  14104. this.n1 = (this.getChild("n1"));
  14105. this.n2 = (this.getChild("n2"));
  14106. this.n3 = (this.getChild("n3"));
  14107. this.n4 = (this.getChild("n4"));
  14108. this.n5 = (this.getChild("n5"));
  14109. this.n6 = (this.getChild("n6"));
  14110. this.n8 = (this.getChild("n8"));
  14111. }
  14112. }
  14113. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14114. class ui_SignMax extends fgui.GComponent {
  14115. static createInstance() {
  14116. return (fgui.UIPackage.createObject("game", "SignMax"));
  14117. }
  14118. onConstruct() {
  14119. this.c1 = this.getController("c1");
  14120. this.n7 = (this.getChild("n7"));
  14121. this.n15 = (this.getChild("n15"));
  14122. this.n8 = (this.getChild("n8"));
  14123. this.titleTxt = (this.getChild("titleTxt"));
  14124. this.myIcon1 = (this.getChild("myIcon1"));
  14125. this.numTxt1 = (this.getChild("numTxt1"));
  14126. this.myIcon2 = (this.getChild("myIcon2"));
  14127. this.n20 = (this.getChild("n20"));
  14128. this.n17 = (this.getChild("n17"));
  14129. this.numTxt2 = (this.getChild("numTxt2"));
  14130. this.n12 = (this.getChild("n12"));
  14131. this.n13 = (this.getChild("n13"));
  14132. this.n21 = (this.getChild("n21"));
  14133. this.n14 = (this.getChild("n14"));
  14134. }
  14135. }
  14136. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14137. class ui_Sign_com2_1 extends fgui.GComponent {
  14138. static createInstance() {
  14139. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14140. }
  14141. onConstruct() {
  14142. this.n0 = (this.getChild("n0"));
  14143. this.n1 = (this.getChild("n1"));
  14144. this.t0 = this.getTransition("t0");
  14145. }
  14146. }
  14147. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14148. class ui_Sign_com5 extends fgui.GComponent {
  14149. static createInstance() {
  14150. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14151. }
  14152. onConstruct() {
  14153. this.n3 = (this.getChild("n3"));
  14154. this.n29 = (this.getChild("n29"));
  14155. this.n4 = (this.getChild("n4"));
  14156. this.day1 = (this.getChild("day1"));
  14157. this.day2 = (this.getChild("day2"));
  14158. this.day3 = (this.getChild("day3"));
  14159. this.day4 = (this.getChild("day4"));
  14160. this.day5 = (this.getChild("day5"));
  14161. this.day6 = (this.getChild("day6"));
  14162. this.day7 = (this.getChild("day7"));
  14163. this.t0 = this.getTransition("t0");
  14164. }
  14165. }
  14166. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  14167. class ui_Sign_com8 extends fgui.GComponent {
  14168. static createInstance() {
  14169. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  14170. }
  14171. onConstruct() {
  14172. this.n48 = (this.getChild("n48"));
  14173. this.womanTxt = (this.getChild("womanTxt"));
  14174. this.t0 = this.getTransition("t0");
  14175. }
  14176. }
  14177. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  14178. class ui_Sign_com6 extends fgui.GComponent {
  14179. static createInstance() {
  14180. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  14181. }
  14182. onConstruct() {
  14183. this.n2 = (this.getChild("n2"));
  14184. this.n3 = (this.getChild("n3"));
  14185. this.t0 = this.getTransition("t0");
  14186. }
  14187. }
  14188. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  14189. class ui_Sign_com7 extends fgui.GComponent {
  14190. static createInstance() {
  14191. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  14192. }
  14193. onConstruct() {
  14194. this.n29 = (this.getChild("n29"));
  14195. this.n2 = (this.getChild("n2"));
  14196. }
  14197. }
  14198. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  14199. class ui_UITurntable_com1_2 extends fgui.GComponent {
  14200. static createInstance() {
  14201. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  14202. }
  14203. onConstruct() {
  14204. this.n5 = (this.getChild("n5"));
  14205. this.n4 = (this.getChild("n4"));
  14206. this.t0 = this.getTransition("t0");
  14207. }
  14208. }
  14209. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  14210. class ui_UITurntable_com2 extends fgui.GComponent {
  14211. static createInstance() {
  14212. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  14213. }
  14214. onConstruct() {
  14215. this.c1 = this.getController("c1");
  14216. this.n4 = (this.getChild("n4"));
  14217. this.n6 = (this.getChild("n6"));
  14218. this.n10 = (this.getChild("n10"));
  14219. this.n11 = (this.getChild("n11"));
  14220. this.n12 = (this.getChild("n12"));
  14221. this.n13 = (this.getChild("n13"));
  14222. this.n14 = (this.getChild("n14"));
  14223. this.n15 = (this.getChild("n15"));
  14224. this.n16 = (this.getChild("n16"));
  14225. this.n17 = (this.getChild("n17"));
  14226. this.n18 = (this.getChild("n18"));
  14227. this.n19 = (this.getChild("n19"));
  14228. this.n20 = (this.getChild("n20"));
  14229. this.n21 = (this.getChild("n21"));
  14230. this.n22 = (this.getChild("n22"));
  14231. this.n23 = (this.getChild("n23"));
  14232. this.n24 = (this.getChild("n24"));
  14233. this.n25 = (this.getChild("n25"));
  14234. this.n26 = (this.getChild("n26"));
  14235. this.n27 = (this.getChild("n27"));
  14236. this.n28 = (this.getChild("n28"));
  14237. this.n29 = (this.getChild("n29"));
  14238. this.n30 = (this.getChild("n30"));
  14239. this.n31 = (this.getChild("n31"));
  14240. this.n32 = (this.getChild("n32"));
  14241. this.n33 = (this.getChild("n33"));
  14242. }
  14243. }
  14244. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  14245. class ui_UITurntable_com1_1 extends fgui.GComponent {
  14246. static createInstance() {
  14247. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  14248. }
  14249. onConstruct() {
  14250. this.n5 = (this.getChild("n5"));
  14251. this.n4 = (this.getChild("n4"));
  14252. this.t0 = this.getTransition("t0");
  14253. }
  14254. }
  14255. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  14256. class ui_UITurntable_com5 extends fgui.GComponent {
  14257. static createInstance() {
  14258. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  14259. }
  14260. onConstruct() {
  14261. this.flashNode = (this.getChild("flashNode"));
  14262. this.rotNode = (this.getChild("rotNode"));
  14263. this.n3 = (this.getChild("n3"));
  14264. this.n21 = (this.getChild("n21"));
  14265. this.t0 = this.getTransition("t0");
  14266. }
  14267. }
  14268. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14269. class ui_UITurntable_com7 extends fgui.GComponent {
  14270. static createInstance() {
  14271. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14272. }
  14273. onConstruct() {
  14274. this.n2 = (this.getChild("n2"));
  14275. this.n35 = (this.getChild("n35"));
  14276. this.img1 = (this.getChild("img1"));
  14277. this.img2 = (this.getChild("img2"));
  14278. this.img3 = (this.getChild("img3"));
  14279. this.img4 = (this.getChild("img4"));
  14280. this.img6 = (this.getChild("img6"));
  14281. this.img5 = (this.getChild("img5"));
  14282. this.txt1 = (this.getChild("txt1"));
  14283. this.txt2 = (this.getChild("txt2"));
  14284. this.txt3 = (this.getChild("txt3"));
  14285. this.txt4 = (this.getChild("txt4"));
  14286. this.txt5 = (this.getChild("txt5"));
  14287. this.txt6 = (this.getChild("txt6"));
  14288. }
  14289. }
  14290. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14291. class ui_UITurntable_com9 extends fgui.GComponent {
  14292. static createInstance() {
  14293. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14294. }
  14295. onConstruct() {
  14296. this.n38 = (this.getChild("n38"));
  14297. this.n39 = (this.getChild("n39"));
  14298. }
  14299. }
  14300. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14301. class ui_UITurntable_com10 extends fgui.GComponent {
  14302. static createInstance() {
  14303. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14304. }
  14305. onConstruct() {
  14306. this.n39 = (this.getChild("n39"));
  14307. this.n40 = (this.getChild("n40"));
  14308. this.t0 = this.getTransition("t0");
  14309. }
  14310. }
  14311. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14312. class ui_UITurntable_com11 extends fgui.GComponent {
  14313. static createInstance() {
  14314. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14315. }
  14316. onConstruct() {
  14317. this.n38 = (this.getChild("n38"));
  14318. this.n39 = (this.getChild("n39"));
  14319. this.n40 = (this.getChild("n40"));
  14320. this.t0 = this.getTransition("t0");
  14321. }
  14322. }
  14323. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14324. class ui_UITurntable_com12 extends fgui.GComponent {
  14325. static createInstance() {
  14326. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14327. }
  14328. onConstruct() {
  14329. this.n43 = (this.getChild("n43"));
  14330. this.barNode = (this.getChild("barNode"));
  14331. this.tipsTxt = (this.getChild("tipsTxt"));
  14332. this.n45 = (this.getChild("n45"));
  14333. this.boxBtn = (this.getChild("boxBtn"));
  14334. }
  14335. }
  14336. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14337. class ui_UITurntable_com1 extends fgui.GButton {
  14338. static createInstance() {
  14339. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14340. }
  14341. onConstruct() {
  14342. this.n41 = (this.getChild("n41"));
  14343. this.n42 = (this.getChild("n42"));
  14344. this.t0 = this.getTransition("t0");
  14345. }
  14346. }
  14347. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14348. class ui_UITurntable_com3 extends fgui.GComponent {
  14349. static createInstance() {
  14350. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14351. }
  14352. onConstruct() {
  14353. this.n48 = (this.getChild("n48"));
  14354. this.womanTxt = (this.getChild("womanTxt"));
  14355. this.t0 = this.getTransition("t0");
  14356. }
  14357. }
  14358. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14359. class ui_cancelBtn2 extends fgui.GButton {
  14360. static createInstance() {
  14361. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14362. }
  14363. onConstruct() {
  14364. this.c1 = this.getController("c1");
  14365. this.n0 = (this.getChild("n0"));
  14366. this.n1 = (this.getChild("n1"));
  14367. this.n2 = (this.getChild("n2"));
  14368. this.n3 = (this.getChild("n3"));
  14369. this.n4 = (this.getChild("n4"));
  14370. this.n5 = (this.getChild("n5"));
  14371. this.n6 = (this.getChild("n6"));
  14372. this.n7 = (this.getChild("n7"));
  14373. this.n8 = (this.getChild("n8"));
  14374. this.powerEft = (this.getChild("powerEft"));
  14375. }
  14376. }
  14377. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14378. class ui_shareBtn2 extends fgui.GButton {
  14379. static createInstance() {
  14380. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14381. }
  14382. onConstruct() {
  14383. this.c1 = this.getController("c1");
  14384. this.n2 = (this.getChild("n2"));
  14385. this.n24 = (this.getChild("n24"));
  14386. this.n1 = (this.getChild("n1"));
  14387. this.n3 = (this.getChild("n3"));
  14388. this.n23 = (this.getChild("n23"));
  14389. this.n4 = (this.getChild("n4"));
  14390. this.n5 = (this.getChild("n5"));
  14391. this.n6 = (this.getChild("n6"));
  14392. this.n20 = (this.getChild("n20"));
  14393. this.n21 = (this.getChild("n21"));
  14394. this.n22 = (this.getChild("n22"));
  14395. this.powerEft = (this.getChild("powerEft"));
  14396. }
  14397. }
  14398. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14399. class ui_UIMoney extends fgui.GComponent {
  14400. static createInstance() {
  14401. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14402. }
  14403. onConstruct() {
  14404. this.c1 = this.getController("c1");
  14405. this.n4 = (this.getChild("n4"));
  14406. this.coinImg = (this.getChild("coinImg"));
  14407. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14408. this.coinTxt = (this.getChild("coinTxt"));
  14409. this.n7 = (this.getChild("n7"));
  14410. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14411. this.diamondTxt = (this.getChild("diamondTxt"));
  14412. this.diamondImg = (this.getChild("diamondImg"));
  14413. this.n12 = (this.getChild("n12"));
  14414. this.powerImg = (this.getChild("powerImg"));
  14415. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14416. this.powerTxt = (this.getChild("powerTxt"));
  14417. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14418. }
  14419. }
  14420. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14421. class ui_backBtn extends fgui.GButton {
  14422. static createInstance() {
  14423. return (fgui.UIPackage.createObject("game", "backBtn"));
  14424. }
  14425. onConstruct() {
  14426. this.n0 = (this.getChild("n0"));
  14427. this.t0 = this.getTransition("t0");
  14428. this.t1 = this.getTransition("t1");
  14429. }
  14430. }
  14431. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14432. class ui_MoneyBtn extends fgui.GButton {
  14433. static createInstance() {
  14434. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14435. }
  14436. onConstruct() {
  14437. this.button = this.getController("button");
  14438. this.n0 = (this.getChild("n0"));
  14439. }
  14440. }
  14441. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14442. class ui_UIMoneyBtn extends fgui.GComponent {
  14443. static createInstance() {
  14444. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14445. }
  14446. onConstruct() {
  14447. this.n1 = (this.getChild("n1"));
  14448. this.closeBtn = (this.getChild("closeBtn"));
  14449. }
  14450. }
  14451. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14452. class ui_Component64 extends fgui.GComponent {
  14453. static createInstance() {
  14454. return (fgui.UIPackage.createObject("game", "Component64"));
  14455. }
  14456. onConstruct() {
  14457. this.n57 = (this.getChild("n57"));
  14458. this.n54 = (this.getChild("n54"));
  14459. this.n55 = (this.getChild("n55"));
  14460. this.n56 = (this.getChild("n56"));
  14461. this.t1 = this.getTransition("t1");
  14462. }
  14463. }
  14464. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14465. class ui_Component41_3 extends fgui.GComponent {
  14466. static createInstance() {
  14467. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14468. }
  14469. onConstruct() {
  14470. this.c1 = this.getController("c1");
  14471. this.n0 = (this.getChild("n0"));
  14472. this.n2 = (this.getChild("n2"));
  14473. this.cancelBtn = (this.getChild("cancelBtn"));
  14474. this.videoBtn = (this.getChild("videoBtn"));
  14475. this.n9 = (this.getChild("n9"));
  14476. this.n24 = (this.getChild("n24"));
  14477. this.n27 = (this.getChild("n27"));
  14478. this.titleTxt = (this.getChild("titleTxt"));
  14479. this.n28 = (this.getChild("n28"));
  14480. this.t0 = this.getTransition("t0");
  14481. }
  14482. }
  14483. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14484. class ui_dh_zs_4 extends fgui.GComponent {
  14485. static createInstance() {
  14486. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14487. }
  14488. onConstruct() {
  14489. this.n1 = (this.getChild("n1"));
  14490. this.n2 = (this.getChild("n2"));
  14491. this.n3 = (this.getChild("n3"));
  14492. this.n4 = (this.getChild("n4"));
  14493. this.n5 = (this.getChild("n5"));
  14494. this.n6 = (this.getChild("n6"));
  14495. this.n8 = (this.getChild("n8"));
  14496. this.t0 = this.getTransition("t0");
  14497. }
  14498. }
  14499. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14500. class ui_Component71_1 extends fgui.GButton {
  14501. static createInstance() {
  14502. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14503. }
  14504. onConstruct() {
  14505. this.n17 = (this.getChild("n17"));
  14506. this.t0 = this.getTransition("t0");
  14507. }
  14508. }
  14509. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14510. class ui_Component83 extends fgui.GComponent {
  14511. static createInstance() {
  14512. return (fgui.UIPackage.createObject("game", "Component83"));
  14513. }
  14514. onConstruct() {
  14515. this.c1 = this.getController("c1");
  14516. this.n17 = (this.getChild("n17"));
  14517. this.n19 = (this.getChild("n19"));
  14518. this.n20 = (this.getChild("n20"));
  14519. }
  14520. }
  14521. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14522. class ui_Component84 extends fgui.GComponent {
  14523. static createInstance() {
  14524. return (fgui.UIPackage.createObject("game", "Component84"));
  14525. }
  14526. onConstruct() {
  14527. this.c1 = this.getController("c1");
  14528. this.n4 = (this.getChild("n4"));
  14529. this.n22 = (this.getChild("n22"));
  14530. this.n23 = (this.getChild("n23"));
  14531. this.numTxt = (this.getChild("numTxt"));
  14532. this.n25 = (this.getChild("n25"));
  14533. this.n26 = (this.getChild("n26"));
  14534. }
  14535. }
  14536. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14537. class ui_Component84_1 extends fgui.GComponent {
  14538. static createInstance() {
  14539. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14540. }
  14541. onConstruct() {
  14542. this.c1 = this.getController("c1");
  14543. this.n4 = (this.getChild("n4"));
  14544. this.n22 = (this.getChild("n22"));
  14545. this.n23 = (this.getChild("n23"));
  14546. this.numTxt = (this.getChild("numTxt"));
  14547. this.n25 = (this.getChild("n25"));
  14548. this.n26 = (this.getChild("n26"));
  14549. }
  14550. }
  14551. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14552. class ui_Component85 extends fgui.GComponent {
  14553. static createInstance() {
  14554. return (fgui.UIPackage.createObject("game", "Component85"));
  14555. }
  14556. onConstruct() {
  14557. this.n1 = (this.getChild("n1"));
  14558. this.n6 = (this.getChild("n6"));
  14559. this.n2 = (this.getChild("n2"));
  14560. this.n3 = (this.getChild("n3"));
  14561. this.levelTxt = (this.getChild("levelTxt"));
  14562. this.n10 = (this.getChild("n10"));
  14563. this.n11 = (this.getChild("n11"));
  14564. this.n12 = (this.getChild("n12"));
  14565. this.n13 = (this.getChild("n13"));
  14566. this.n14 = (this.getChild("n14"));
  14567. this.modeNode = (this.getChild("modeNode"));
  14568. this.n18 = (this.getChild("n18"));
  14569. this.conditionTxt = (this.getChild("conditionTxt"));
  14570. this.diamondNode = (this.getChild("diamondNode"));
  14571. this.coinNode = (this.getChild("coinNode"));
  14572. this.startBtn = (this.getChild("startBtn"));
  14573. this.n28 = (this.getChild("n28"));
  14574. this.displayRoot = (this.getChild("displayRoot"));
  14575. this.t0 = this.getTransition("t0");
  14576. }
  14577. }
  14578. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14579. class ui_Component86 extends fgui.GButton {
  14580. static createInstance() {
  14581. return (fgui.UIPackage.createObject("game", "Component86"));
  14582. }
  14583. onConstruct() {
  14584. this.n15 = (this.getChild("n15"));
  14585. this.t0 = this.getTransition("t0");
  14586. }
  14587. }
  14588. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14589. class ui_Component87 extends fgui.GComponent {
  14590. static createInstance() {
  14591. return (fgui.UIPackage.createObject("game", "Component87"));
  14592. }
  14593. onConstruct() {
  14594. this.n66 = (this.getChild("n66"));
  14595. this.myProgress = (this.getChild("myProgress"));
  14596. this.starAni = (this.getChild("starAni"));
  14597. this.hpTxt = (this.getChild("hpTxt"));
  14598. this.n74 = (this.getChild("n74"));
  14599. this.n73 = (this.getChild("n73"));
  14600. this.ballTxt = (this.getChild("ballTxt"));
  14601. this.n76 = (this.getChild("n76"));
  14602. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14603. this.levelTxt = (this.getChild("levelTxt"));
  14604. this.star1 = (this.getChild("star1"));
  14605. this.star2 = (this.getChild("star2"));
  14606. this.star3 = (this.getChild("star3"));
  14607. }
  14608. }
  14609. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14610. class ui_Component88 extends fgui.GProgressBar {
  14611. static createInstance() {
  14612. return (fgui.UIPackage.createObject("game", "Component88"));
  14613. }
  14614. onConstruct() {
  14615. this.n68 = (this.getChild("n68"));
  14616. this.bar = (this.getChild("bar"));
  14617. }
  14618. }
  14619. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14620. class ui_Component89 extends fgui.GComponent {
  14621. static createInstance() {
  14622. return (fgui.UIPackage.createObject("game", "Component89"));
  14623. }
  14624. onConstruct() {
  14625. this.c1 = this.getController("c1");
  14626. this.n71 = (this.getChild("n71"));
  14627. this.n72 = (this.getChild("n72"));
  14628. }
  14629. }
  14630. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14631. class ui_Component90 extends fgui.GComponent {
  14632. static createInstance() {
  14633. return (fgui.UIPackage.createObject("game", "Component90"));
  14634. }
  14635. onConstruct() {
  14636. this.c1 = this.getController("c1");
  14637. this.n64 = (this.getChild("n64"));
  14638. this.n65 = (this.getChild("n65"));
  14639. this.n66 = (this.getChild("n66"));
  14640. this.t0 = this.getTransition("t0");
  14641. }
  14642. }
  14643. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14644. class ui_Component127 extends fgui.GButton {
  14645. static createInstance() {
  14646. return (fgui.UIPackage.createObject("game", "Component127"));
  14647. }
  14648. onConstruct() {
  14649. this.n5 = (this.getChild("n5"));
  14650. }
  14651. }
  14652. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14653. class gameBinder {
  14654. static bindAll() {
  14655. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14656. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14657. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14658. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14659. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14660. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14661. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14662. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14663. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14664. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14665. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14666. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14667. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14668. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14669. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14670. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14671. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14672. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14673. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14674. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14675. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14676. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14677. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14678. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14679. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14680. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14681. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14682. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14683. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14684. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14685. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14686. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14687. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14688. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14689. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14690. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14691. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14692. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14693. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14694. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14695. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14696. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14697. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14698. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14699. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14700. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14701. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14702. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14703. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14704. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14705. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14706. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14707. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14708. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14709. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14710. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14711. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14712. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14713. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14714. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14715. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14716. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14717. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14718. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14719. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14720. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14721. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14722. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14723. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14724. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14725. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14726. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14727. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14728. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14729. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14730. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14731. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14732. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14733. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14734. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14735. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14736. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14737. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14738. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14739. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14740. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14741. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14742. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14743. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14744. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14745. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14746. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14747. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  14748. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14749. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14750. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14751. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14752. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14753. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14754. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14755. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14756. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14757. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14758. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14759. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14760. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14761. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14762. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14763. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14764. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14765. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14766. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14767. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14768. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14769. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14770. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14771. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14772. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14773. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14774. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14775. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14776. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14777. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14778. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14779. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14780. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14781. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14782. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14783. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14784. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14785. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14786. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14787. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14788. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14789. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14790. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14791. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14792. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14793. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14794. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14795. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14796. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14797. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14798. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14799. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14800. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14801. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14802. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14803. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14804. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14805. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14806. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14807. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14808. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14809. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14810. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14811. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14812. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14813. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14814. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14815. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14816. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14817. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14818. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14819. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14820. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14821. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14822. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14823. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14824. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14825. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14826. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14827. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14828. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14829. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14830. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14831. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14832. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14833. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14834. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14835. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14836. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14837. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14838. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14839. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14840. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14841. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14842. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14843. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14844. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14845. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14846. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14847. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14848. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14849. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14850. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14851. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14852. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14853. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14854. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14855. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14856. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14857. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14858. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14859. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14860. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14861. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14862. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14863. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14864. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14865. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14866. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14867. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14868. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14869. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14870. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14871. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14872. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14873. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14874. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14875. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14876. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14877. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14878. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14879. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14880. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14881. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14882. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14883. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14884. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14885. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14886. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14887. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14888. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14889. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14890. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14891. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14892. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14893. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14894. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14895. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14896. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14897. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14898. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14899. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14900. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14901. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14902. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14903. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14904. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14905. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14906. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14907. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14908. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14909. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14910. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14911. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14912. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14913. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14914. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14915. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14916. }
  14917. }
  14918. class ui_btn6 extends fgui.GButton {
  14919. static createInstance() {
  14920. return (fgui.UIPackage.createObject("loading", "btn6"));
  14921. }
  14922. onConstruct() {
  14923. this.n6 = (this.getChild("n6"));
  14924. this.n1 = (this.getChild("n1"));
  14925. }
  14926. }
  14927. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14928. class ui_xyItem extends fgui.GComponent {
  14929. static createInstance() {
  14930. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14931. }
  14932. onConstruct() {
  14933. this.xyItem = (this.getChild("xyItem"));
  14934. }
  14935. }
  14936. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14937. class ui_loadinfo extends fgui.GProgressBar {
  14938. static createInstance() {
  14939. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14940. }
  14941. onConstruct() {
  14942. this.bg = (this.getChild("bg"));
  14943. this.bar = (this.getChild("bar"));
  14944. this.title = (this.getChild("title"));
  14945. this.ani = (this.getChild("ani"));
  14946. }
  14947. }
  14948. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14949. class ui_xyNode extends fgui.GComponent {
  14950. static createInstance() {
  14951. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14952. }
  14953. onConstruct() {
  14954. this.n0 = (this.getChild("n0"));
  14955. this.btnYes = (this.getChild("btnYes"));
  14956. this.btnNo = (this.getChild("btnNo"));
  14957. this.btnKnown = (this.getChild("btnKnown"));
  14958. this.btnSure = (this.getChild("btnSure"));
  14959. this.txtWelcom = (this.getChild("txtWelcom"));
  14960. this.txtXy = (this.getChild("txtXy"));
  14961. this.n75 = (this.getChild("n75"));
  14962. this.btnXy1 = (this.getChild("btnXy1"));
  14963. this.btnXy3 = (this.getChild("btnXy3"));
  14964. this.btnXy2 = (this.getChild("btnXy2"));
  14965. this.n74 = (this.getChild("n74"));
  14966. this.xy1 = (this.getChild("xy1"));
  14967. this.txtTitle = (this.getChild("txtTitle"));
  14968. this.btnBack = (this.getChild("btnBack"));
  14969. this.xyList = (this.getChild("xyList"));
  14970. this.xy2 = (this.getChild("xy2"));
  14971. this.xyNode = (this.getChild("xyNode"));
  14972. }
  14973. }
  14974. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14975. class ui_ageNode extends fgui.GComponent {
  14976. static createInstance() {
  14977. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14978. }
  14979. onConstruct() {
  14980. this.n3 = (this.getChild("n3"));
  14981. this.n7 = (this.getChild("n7"));
  14982. this.n4 = (this.getChild("n4"));
  14983. this.btnAge = (this.getChild("btnAge"));
  14984. this.ageNode = (this.getChild("ageNode"));
  14985. }
  14986. }
  14987. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14988. class ui_rnNode extends fgui.GComponent {
  14989. static createInstance() {
  14990. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14991. }
  14992. onConstruct() {
  14993. this.n28 = (this.getChild("n28"));
  14994. this.n30 = (this.getChild("n30"));
  14995. this.n33 = (this.getChild("n33"));
  14996. this.rn1 = (this.getChild("rn1"));
  14997. this.n40 = (this.getChild("n40"));
  14998. this.n41 = (this.getChild("n41"));
  14999. this.rn3 = (this.getChild("rn3"));
  15000. this.n37 = (this.getChild("n37"));
  15001. this.n39 = (this.getChild("n39"));
  15002. this.rn2 = (this.getChild("rn2"));
  15003. this.n47 = (this.getChild("n47"));
  15004. this.n49 = (this.getChild("n49"));
  15005. this.n44 = (this.getChild("n44"));
  15006. this.inputCode = (this.getChild("inputCode"));
  15007. this.inputName = (this.getChild("inputName"));
  15008. this.n48 = (this.getChild("n48"));
  15009. this.n50 = (this.getChild("n50"));
  15010. this.rn4 = (this.getChild("rn4"));
  15011. this.btnCheck = (this.getChild("btnCheck"));
  15012. this.btnExit = (this.getChild("btnExit"));
  15013. this.btnDone = (this.getChild("btnDone"));
  15014. this.rnNode = (this.getChild("rnNode"));
  15015. }
  15016. }
  15017. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  15018. class ui_tipNode extends fgui.GComponent {
  15019. static createInstance() {
  15020. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15021. }
  15022. onConstruct() {
  15023. this.bg = (this.getChild("bg"));
  15024. this.n55 = (this.getChild("n55"));
  15025. this.n56 = (this.getChild("n56"));
  15026. this.tipNode = (this.getChild("tipNode"));
  15027. }
  15028. }
  15029. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15030. class ui_fcmNode extends fgui.GComponent {
  15031. static createInstance() {
  15032. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15033. }
  15034. onConstruct() {
  15035. this.n63 = (this.getChild("n63"));
  15036. this.n62 = (this.getChild("n62"));
  15037. this.btnRn = (this.getChild("btnRn"));
  15038. this.n61 = (this.getChild("n61"));
  15039. this.n58 = (this.getChild("n58"));
  15040. this.fcmNode = (this.getChild("fcmNode"));
  15041. }
  15042. }
  15043. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15044. class ui_msgNode extends fgui.GComponent {
  15045. static createInstance() {
  15046. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15047. }
  15048. onConstruct() {
  15049. this.n69 = (this.getChild("n69"));
  15050. this.txtMsg = (this.getChild("txtMsg"));
  15051. this.msgNode = (this.getChild("msgNode"));
  15052. }
  15053. }
  15054. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15055. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15056. static createInstance() {
  15057. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15058. }
  15059. onConstruct() {
  15060. this.n1 = (this.getChild("n1"));
  15061. this.n13 = (this.getChild("n13"));
  15062. this.n14 = (this.getChild("n14"));
  15063. this.n15 = (this.getChild("n15"));
  15064. this.n3 = (this.getChild("n3"));
  15065. this.n4 = (this.getChild("n4"));
  15066. this.n5 = (this.getChild("n5"));
  15067. this.n6 = (this.getChild("n6"));
  15068. this.n7 = (this.getChild("n7"));
  15069. this.n8 = (this.getChild("n8"));
  15070. this.n9 = (this.getChild("n9"));
  15071. this.n10 = (this.getChild("n10"));
  15072. this.n12 = (this.getChild("n12"));
  15073. this.n11 = (this.getChild("n11"));
  15074. this.n16 = (this.getChild("n16"));
  15075. this.n17 = (this.getChild("n17"));
  15076. this.n18 = (this.getChild("n18"));
  15077. this.n20 = (this.getChild("n20"));
  15078. this.n21 = (this.getChild("n21"));
  15079. this.t0 = this.getTransition("t0");
  15080. }
  15081. }
  15082. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15083. class ui_btn5 extends fgui.GButton {
  15084. static createInstance() {
  15085. return (fgui.UIPackage.createObject("loading", "btn5"));
  15086. }
  15087. onConstruct() {
  15088. this.n9 = (this.getChild("n9"));
  15089. this.n1 = (this.getChild("n1"));
  15090. }
  15091. }
  15092. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15093. class ui_UILoading extends fgui.GComponent {
  15094. static createInstance() {
  15095. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15096. }
  15097. onConstruct() {
  15098. this.n12 = (this.getChild("n12"));
  15099. this.loadinfo = (this.getChild("loadinfo"));
  15100. this.n13 = (this.getChild("n13"));
  15101. this.txtLoad = (this.getChild("txtLoad"));
  15102. this.n18 = (this.getChild("n18"));
  15103. }
  15104. }
  15105. ui_UILoading.URL = "ui://37nctnhwphc33";
  15106. class ui_AgeItem extends fgui.GComponent {
  15107. static createInstance() {
  15108. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15109. }
  15110. onConstruct() {
  15111. this.txtAge = (this.getChild("txtAge"));
  15112. }
  15113. }
  15114. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15115. class ui_btn1 extends fgui.GButton {
  15116. static createInstance() {
  15117. return (fgui.UIPackage.createObject("loading", "btn1"));
  15118. }
  15119. onConstruct() {
  15120. this.n6 = (this.getChild("n6"));
  15121. this.n1 = (this.getChild("n1"));
  15122. }
  15123. }
  15124. ui_btn1.URL = "ui://37nctnhwxe622p";
  15125. class ui_btn3 extends fgui.GButton {
  15126. static createInstance() {
  15127. return (fgui.UIPackage.createObject("loading", "btn3"));
  15128. }
  15129. onConstruct() {
  15130. this.n9 = (this.getChild("n9"));
  15131. this.n1 = (this.getChild("n1"));
  15132. }
  15133. }
  15134. ui_btn3.URL = "ui://37nctnhwxe622s";
  15135. class ui_btn2 extends fgui.GButton {
  15136. static createInstance() {
  15137. return (fgui.UIPackage.createObject("loading", "btn2"));
  15138. }
  15139. onConstruct() {
  15140. this.n6 = (this.getChild("n6"));
  15141. this.n1 = (this.getChild("n1"));
  15142. }
  15143. }
  15144. ui_btn2.URL = "ui://37nctnhwxe622t";
  15145. class ui_btnBack extends fgui.GButton {
  15146. static createInstance() {
  15147. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15148. }
  15149. onConstruct() {
  15150. this.n6 = (this.getChild("n6"));
  15151. this.n7 = (this.getChild("n7"));
  15152. }
  15153. }
  15154. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15155. class ui_btnXy1 extends fgui.GButton {
  15156. static createInstance() {
  15157. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15158. }
  15159. onConstruct() {
  15160. this.n1 = (this.getChild("n1"));
  15161. }
  15162. }
  15163. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15164. class ui_btnXy2 extends fgui.GButton {
  15165. static createInstance() {
  15166. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15167. }
  15168. onConstruct() {
  15169. this.n1 = (this.getChild("n1"));
  15170. }
  15171. }
  15172. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  15173. class ui_btnXy3 extends fgui.GButton {
  15174. static createInstance() {
  15175. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15176. }
  15177. onConstruct() {
  15178. this.n1 = (this.getChild("n1"));
  15179. }
  15180. }
  15181. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15182. class ui_btn4 extends fgui.GButton {
  15183. static createInstance() {
  15184. return (fgui.UIPackage.createObject("loading", "btn4"));
  15185. }
  15186. onConstruct() {
  15187. this.n9 = (this.getChild("n9"));
  15188. this.n1 = (this.getChild("n1"));
  15189. }
  15190. }
  15191. ui_btn4.URL = "ui://37nctnhwxe622z";
  15192. class loadingBinder {
  15193. static bindAll() {
  15194. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15195. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15196. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15197. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15198. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15199. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15200. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15201. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15202. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15203. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15204. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15205. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15206. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15207. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15208. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15209. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15210. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15211. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15212. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15213. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15214. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15215. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15216. }
  15217. }
  15218. class UIMgr {
  15219. constructor() {
  15220. this._stage = null;
  15221. this._uiList = [];
  15222. this._showList = [];
  15223. this._bindPkgList = [];
  15224. this.uiIndex = 0;
  15225. }
  15226. static get inst() {
  15227. if (UIMgr._inst == null) {
  15228. UIMgr._inst = new UIMgr();
  15229. }
  15230. return UIMgr._inst;
  15231. }
  15232. setStage(s) {
  15233. if (this._stage) {
  15234. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15235. return;
  15236. }
  15237. this._stage = s;
  15238. }
  15239. clearTempData() {
  15240. console.log('zh:clearTempData start');
  15241. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  15242. console.log('zh:clearTempData end');
  15243. }
  15244. init() {
  15245. this.setStage(Laya.stage);
  15246. fairygui.UIConfig.defaultFont = "微软雅黑";
  15247. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15248. fairygui.UIConfig.packageFileExtension = "obj";
  15249. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15250. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15251. fairygui.GRoot.inst.width = Laya.stage.width;
  15252. fairygui.GRoot.inst.height = Laya.stage.height;
  15253. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15254. }
  15255. addAllUpdate() {
  15256. this.uiIndex = 0;
  15257. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15258. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15259. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15260. }
  15261. }
  15262. }
  15263. bindFUI(pkgname) {
  15264. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15265. return;
  15266. }
  15267. switch (pkgname) {
  15268. case fguiRes.loading:
  15269. fairygui.UIPackage.addPackage(pkgname);
  15270. loadingBinder.bindAll();
  15271. this._bindPkgList.push(pkgname);
  15272. break;
  15273. case fguiRes.game:
  15274. fairygui.UIPackage.addPackage(pkgname);
  15275. gameBinder.bindAll();
  15276. this._bindPkgList.push(pkgname);
  15277. break;
  15278. default:
  15279. break;
  15280. }
  15281. }
  15282. Show(cls, ...param) {
  15283. let nameStr = cls.uiName;
  15284. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15285. let temp = this._uiList[i];
  15286. let str = temp.className;
  15287. if (str == nameStr) {
  15288. if (temp.isMuti) {
  15289. if (temp.isHide) {
  15290. temp.show(...param);
  15291. this._uiList.splice(i, 1);
  15292. this._uiList.push(temp);
  15293. return temp;
  15294. }
  15295. }
  15296. else {
  15297. temp.show(...param);
  15298. this._uiList.splice(i, 1);
  15299. this._uiList.push(temp);
  15300. return temp;
  15301. }
  15302. }
  15303. }
  15304. let ui = new cls();
  15305. ui.className = nameStr;
  15306. this._showUI(ui, param);
  15307. return ui;
  15308. }
  15309. destroyUI(ui) {
  15310. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15311. let temp = this._uiList[i].className;
  15312. if (temp == ui.className) {
  15313. this._uiList.splice(i, 1);
  15314. break;
  15315. }
  15316. }
  15317. this.checkUIState();
  15318. }
  15319. _showUI(ui, param) {
  15320. this._uiList.push(ui);
  15321. ui.show(...param);
  15322. }
  15323. Hide(uiClass) {
  15324. let ui = this.getUI(uiClass);
  15325. if (ui && !ui.isHide) {
  15326. ui.hide();
  15327. }
  15328. }
  15329. getUI(ui) {
  15330. let nameStr = ui.uiName;
  15331. for (let index = 0; index < this._uiList.length; index++) {
  15332. let temp = this._uiList[index];
  15333. if (temp.className == nameStr) {
  15334. return temp;
  15335. }
  15336. }
  15337. return null;
  15338. }
  15339. isShow(cls) {
  15340. for (var i of this._uiList) {
  15341. if (i instanceof cls) {
  15342. return i.isShowing;
  15343. }
  15344. }
  15345. return false;
  15346. }
  15347. showUINum() {
  15348. let num = 0;
  15349. for (var i of this._uiList) {
  15350. if (i.isShowing) {
  15351. num++;
  15352. }
  15353. }
  15354. return num;
  15355. }
  15356. checkUIState() {
  15357. Laya.timer.clear(this, this._uiCheck);
  15358. Laya.timer.once(400, this, this._uiCheck);
  15359. }
  15360. _uiCheck() {
  15361. let showList = [];
  15362. for (var i of this._uiList) {
  15363. if (!i.isHide) {
  15364. showList.push(i);
  15365. }
  15366. }
  15367. for (let index = 0; index < showList.length; index++) {
  15368. if (index == showList.length - 1) {
  15369. showList[index].checkActive(true);
  15370. }
  15371. else {
  15372. showList[index].checkActive(false);
  15373. }
  15374. }
  15375. }
  15376. showTip(msg, time = 600, size = 30) {
  15377. }
  15378. }
  15379. class UIShowList {
  15380. }
  15381. class SoundMgr {
  15382. constructor() {
  15383. this.soundMax = 4;
  15384. this.isLoad = false;
  15385. this.soundMap = {};
  15386. this.isSound = true;
  15387. this.openShake = true;
  15388. SoundMgr._instance = this;
  15389. }
  15390. static getInstance() {
  15391. if (!this._instance) {
  15392. this._instance = new SoundMgr();
  15393. }
  15394. return this._instance;
  15395. }
  15396. init() {
  15397. console.log('zh:sm init 1');
  15398. Laya.SoundManager.autoReleaseSound = true;
  15399. Laya.SoundManager.autoStopMusic = true;
  15400. Laya.SoundManager.musicVolume = 0.3;
  15401. Laya.SoundManager.soundVolume = 0.5;
  15402. this.musicPlayed = false;
  15403. this.audioUrl = "asset/sound/ogg/";
  15404. console.log('zh:sm init 2');
  15405. console.log('zh:dev type ');
  15406. if (Laya.Browser.onAndroid) {
  15407. console.log('zh:dev type android');
  15408. this.audioUrl = "asset/sound/ogg/";
  15409. this.isLoad = true;
  15410. }
  15411. else {
  15412. console.log('zh:dev type not android');
  15413. this.audioUrl = "asset/sound/mp3/";
  15414. this.isLoad = true;
  15415. }
  15416. }
  15417. onSetting(isS) {
  15418. this.isSound = isS;
  15419. this.mute(!this.isSound);
  15420. }
  15421. clearCount() {
  15422. for (var key in this.soundMap) {
  15423. delete this.soundMap[key];
  15424. }
  15425. }
  15426. playMusic(path, loop = 0) {
  15427. console.log('zh:playMusic 1 PATH=' + path);
  15428. this.musicPath = path;
  15429. if (!this.isLoad) {
  15430. return;
  15431. }
  15432. if (!path || path == "") {
  15433. return;
  15434. }
  15435. if (!this.isSound) {
  15436. return;
  15437. }
  15438. this.musicPlayed = true;
  15439. let url = this.getUrl(path);
  15440. if (!Laya.Browser.onAndroid) {
  15441. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15442. this.play(url, loop);
  15443. }));
  15444. }
  15445. else {
  15446. this.play(url, loop);
  15447. }
  15448. }
  15449. play(url, loop) {
  15450. Laya.SoundManager.playMusic(url, loop);
  15451. }
  15452. getUrl(path) {
  15453. let url = this.audioUrl + path;
  15454. if (Laya.Browser.onAndroid) {
  15455. url += ".ogg";
  15456. }
  15457. else {
  15458. url += ".mp3";
  15459. }
  15460. return url;
  15461. }
  15462. pauseMusic(pause) {
  15463. if (pause) {
  15464. this.mute(true);
  15465. }
  15466. else if (this.isSound)
  15467. this.mute(false);
  15468. }
  15469. stopMusic() {
  15470. Laya.SoundManager.stopMusic();
  15471. if (Moyu.isNeedPlatAudio) {
  15472. Moyu.stopMusic();
  15473. }
  15474. }
  15475. mute(mute) {
  15476. if (Moyu.isNeedPlatAudio) {
  15477. Moyu.pauseMusic(mute);
  15478. }
  15479. else {
  15480. Laya.SoundManager.musicMuted = mute;
  15481. if (!mute && !this.musicPlayed && this.musicPath) {
  15482. this.playMusic(this.musicPath);
  15483. }
  15484. }
  15485. }
  15486. stopSound(path) {
  15487. let url = this.getUrl(path);
  15488. Laya.SoundManager.stopSound(url);
  15489. }
  15490. playSound(path, loop = 1, soundMax = this.soundMax) {
  15491. if (!this.isLoad)
  15492. return;
  15493. if (!this.isSound)
  15494. return;
  15495. if (!path || path == "")
  15496. return;
  15497. let url = this.getUrl(path);
  15498. if (Moyu.isNeedPlatAudio) {
  15499. Moyu.playSound(path, loop == 0);
  15500. }
  15501. else {
  15502. let count = 1;
  15503. if (this.soundMap[path])
  15504. count = this.soundMap[path] + 1;
  15505. if (count > soundMax)
  15506. return;
  15507. this.soundMap[path] = count;
  15508. Laya.SoundManager.playSound(url, loop);
  15509. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15510. }
  15511. }
  15512. removePath(path) {
  15513. if (this.soundMap[path]) {
  15514. let count = this.soundMap[path];
  15515. count--;
  15516. if (count < 1)
  15517. delete this.soundMap[path];
  15518. else
  15519. this.soundMap[path] = count;
  15520. }
  15521. }
  15522. playBtnSound() {
  15523. this.playSound("btn");
  15524. }
  15525. playGetSound() {
  15526. }
  15527. playCloseUISound() {
  15528. }
  15529. }
  15530. SoundMgr._instance = null;
  15531. var Handler$1 = Laya.Handler;
  15532. var EResType;
  15533. (function (EResType) {
  15534. EResType[EResType["none"] = 0] = "none";
  15535. EResType[EResType["nromal"] = 1] = "nromal";
  15536. EResType[EResType["td"] = 2] = "td";
  15537. EResType[EResType["sk"] = 3] = "sk";
  15538. })(EResType || (EResType = {}));
  15539. class CResLoader {
  15540. constructor(doneCall, proCall) {
  15541. this.completrCall = doneCall;
  15542. this.progressCall = proCall;
  15543. this.progressHander = new Handler$1(this, this.onProgress);
  15544. this.tdResMap = {};
  15545. }
  15546. load(resList) {
  15547. this.resCount = 0;
  15548. this.loadCount = 0;
  15549. for (let i = 0; i < resList.length; i++) {
  15550. let path = resList[i];
  15551. if (!path)
  15552. continue;
  15553. this.resCount++;
  15554. let type = this.getResType(path);
  15555. if (type == EResType.nromal)
  15556. this.loadNromal(path);
  15557. else if (type == EResType.td)
  15558. this.loadTd(path);
  15559. }
  15560. }
  15561. getRes(path) {
  15562. let type = this.getResType(path);
  15563. if (type == EResType.nromal)
  15564. return Laya.loader.getRes(path);
  15565. else if (type == EResType.td) {
  15566. let res = this.tdResMap[path];
  15567. if (res)
  15568. return res.clone();
  15569. return null;
  15570. }
  15571. }
  15572. destroy() {
  15573. this.progressHander.clear();
  15574. this.progressHander = null;
  15575. }
  15576. clearRes(path) {
  15577. let type = this.getResType(path);
  15578. if (type == EResType.nromal)
  15579. Laya.loader.clearRes(path);
  15580. else if (type == EResType.td) {
  15581. let obj = this.tdResMap[path];
  15582. if (obj)
  15583. obj.destroy();
  15584. delete this.tdResMap[path];
  15585. }
  15586. }
  15587. getResType(path) {
  15588. let exs = this.getExtension(path);
  15589. if (exs == "sk")
  15590. return EResType.sk;
  15591. if (exs == "ls" || exs == "lh" || exs == "lm")
  15592. return EResType.td;
  15593. else
  15594. return EResType.nromal;
  15595. }
  15596. getExtension(res) {
  15597. var index = res.lastIndexOf(".");
  15598. return res.substr(index + 1);
  15599. }
  15600. loadNromal(path) {
  15601. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15602. if (res) {
  15603. this.onLoad();
  15604. }
  15605. else
  15606. console.log("load res fail:" + path);
  15607. }), this.progressHander);
  15608. }
  15609. loadSk() {
  15610. }
  15611. loadTd(path) {
  15612. if (this.tdResMap[path]) {
  15613. this.onLoad();
  15614. return;
  15615. }
  15616. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15617. if (res) {
  15618. this.tdResMap[path] = res;
  15619. this.onLoad();
  15620. }
  15621. else
  15622. console.log("load res fail:" + path);
  15623. }));
  15624. }
  15625. onLoad() {
  15626. this.loadCount++;
  15627. this.onProgress(1);
  15628. if (this.loadCount >= this.resCount) {
  15629. this.completrCall.run();
  15630. }
  15631. }
  15632. onProgress(pro) {
  15633. let progress = (this.loadCount + pro) / this.resCount;
  15634. this.progressCall.runWith(progress);
  15635. }
  15636. }
  15637. var Handler$2 = Laya.Handler;
  15638. class ResInfo {
  15639. constructor() {
  15640. this.index = 0;
  15641. }
  15642. }
  15643. class ResMgr {
  15644. constructor() {
  15645. this.resList = [];
  15646. this.doneList = [];
  15647. this.resMap = {};
  15648. this.currentLoad = null;
  15649. this.completeHandler = new Handler$2(this, this.onComplete);
  15650. this.progressHandler = new Handler$2(this, this.onProgress);
  15651. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15652. }
  15653. static getInstance() {
  15654. if (ResMgr._instance == null) {
  15655. ResMgr._instance = new ResMgr();
  15656. }
  15657. return ResMgr._instance;
  15658. }
  15659. loadList(list, completeHandler, progressHandler) {
  15660. if (list.length < 1) {
  15661. completeHandler.run();
  15662. return;
  15663. }
  15664. let info = this.getResInfo();
  15665. info.resList = list;
  15666. info.completeHandler = completeHandler;
  15667. info.progressHandler = progressHandler;
  15668. this.resList.push(info);
  15669. this.startLoad();
  15670. }
  15671. loadFguiRes(list, completeHandler, progressHandler) {
  15672. Laya.loader.load(list, completeHandler, progressHandler);
  15673. }
  15674. loadAny(list, completeHandler, progressHandler) {
  15675. Laya.loader.load(list, completeHandler, progressHandler);
  15676. }
  15677. load(path, completeHandler, progressHandler) {
  15678. let count = this.resMap[path];
  15679. if (count && count > 0) {
  15680. if (completeHandler)
  15681. completeHandler.run();
  15682. }
  15683. else
  15684. this.loadList([path], completeHandler, progressHandler);
  15685. }
  15686. getRes(path) {
  15687. let res = this.resMap[path];
  15688. if (!res)
  15689. this.showLog("资源不存在:" + path);
  15690. else
  15691. return this.loader.getRes(path);
  15692. }
  15693. clearList(list, force = false) {
  15694. if (!list || list.length < 1)
  15695. return;
  15696. let cr = () => {
  15697. for (const k in list) {
  15698. let v = list[k];
  15699. if (!v)
  15700. continue;
  15701. if (force) {
  15702. this.loader.clearRes(v);
  15703. delete this.resMap[v];
  15704. }
  15705. else {
  15706. let count = this.resMap[v];
  15707. if (count && count > 1) {
  15708. count--;
  15709. this.resMap[v] = count;
  15710. }
  15711. else {
  15712. this.loader.clearRes(v);
  15713. delete this.resMap[v];
  15714. }
  15715. }
  15716. }
  15717. if (!window.hasOwnProperty("ks"))
  15718. Laya.Resource.destroyUnusedResources();
  15719. };
  15720. Laya.timer.clearAll(this);
  15721. Laya.timer.once(2000, this, cr);
  15722. }
  15723. clear3D() {
  15724. for (const k in this.loader.tdResMap) {
  15725. this.loader.clearRes(k);
  15726. if (this.resMap[k])
  15727. delete this.resMap[k];
  15728. }
  15729. if (!window.hasOwnProperty("ks"))
  15730. Laya.Resource.destroyUnusedResources();
  15731. }
  15732. clear(path, force = false) {
  15733. this.clearList([path], force);
  15734. }
  15735. getResInfo() {
  15736. if (this.doneList.length > 0)
  15737. return this.doneList.pop();
  15738. else
  15739. return new ResInfo();
  15740. }
  15741. startLoad() {
  15742. if (this.currentLoad)
  15743. return;
  15744. this.currentLoad = this.resList.pop();
  15745. if (this.currentLoad) {
  15746. this.loader.load(this.currentLoad.resList);
  15747. }
  15748. }
  15749. onComplete() {
  15750. if (!this.currentLoad)
  15751. return;
  15752. for (const k in this.currentLoad.resList) {
  15753. let v = this.currentLoad.resList[k];
  15754. let count = this.resMap[v];
  15755. if (count)
  15756. count++;
  15757. else
  15758. count = 1;
  15759. this.resMap[v] = count;
  15760. }
  15761. if (this.currentLoad.completeHandler)
  15762. this.currentLoad.completeHandler.run();
  15763. this.doneList.push(this.currentLoad);
  15764. this.currentLoad = null;
  15765. this.startLoad();
  15766. }
  15767. onProgress(pro) {
  15768. if (!this.currentLoad)
  15769. return;
  15770. if (this.currentLoad.progressHandler)
  15771. this.currentLoad.progressHandler.runWith(pro);
  15772. }
  15773. showLog(str, ...args) {
  15774. console.log("[ResLoader] " + str);
  15775. }
  15776. }
  15777. ResMgr._instance = null;
  15778. class EventMgr extends Laya.EventDispatcher {
  15779. }
  15780. let eventMgr = new EventMgr();
  15781. class ConfigMgr {
  15782. static getInstance() {
  15783. if (!this._instance) {
  15784. this._instance = new ConfigMgr();
  15785. }
  15786. return this._instance;
  15787. }
  15788. init() {
  15789. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15790. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15791. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15792. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15793. }
  15794. getUserInfoByIndex(index) {
  15795. return this.npcJson[index];
  15796. }
  15797. getRandomUserInfo() {
  15798. let index = xGame.tools.random(0, this.npcJson.length);
  15799. return this.npcJson[index];
  15800. }
  15801. getMaxBigMoveLength() {
  15802. return Object.keys(this.levelCfg).length;
  15803. }
  15804. getBigMoveLevelByIndex(index) {
  15805. let cfg = this.levelCfg;
  15806. cfg = cfg[index];
  15807. return cfg;
  15808. }
  15809. getRandomClassicLevel() {
  15810. let cfg = this.classicCfg;
  15811. let num = Object.keys(cfg).length;
  15812. let rand = xGame.common.randomNum(1, num);
  15813. return cfg[rand];
  15814. }
  15815. getPlaceBallByLevel(level) {
  15816. return this.placeBallCfg[level];
  15817. }
  15818. getMaxPlaceBall() {
  15819. return Object.keys(this.placeBallCfg).length;
  15820. }
  15821. }
  15822. class PoolD3Mgr {
  15823. constructor() {
  15824. this.pool = {};
  15825. }
  15826. static get ins() {
  15827. return this._ins || (this._ins = new PoolD3Mgr);
  15828. }
  15829. createList(key, prefab, parent) {
  15830. if (!this.pool[key]) {
  15831. this.pool[key] = {};
  15832. this.pool[key].prefab = prefab;
  15833. this.pool[key].list = [];
  15834. this.pool[key].parent = parent;
  15835. }
  15836. }
  15837. getItem(key) {
  15838. if (!this.pool[key]) {
  15839. return;
  15840. }
  15841. let temp;
  15842. if (this.pool[key].list.length > 0) {
  15843. temp = this.pool[key].list.pop();
  15844. }
  15845. else {
  15846. temp = this.pool[key].prefab.clone();
  15847. if (this.pool[key].parent) {
  15848. this.pool[key].parent.addChild(temp);
  15849. }
  15850. }
  15851. temp.active = true;
  15852. return temp;
  15853. }
  15854. putItem(key, obj) {
  15855. if (!this.pool[key]) {
  15856. return;
  15857. }
  15858. obj.active = false;
  15859. this.pool[key].list.push(obj);
  15860. }
  15861. }
  15862. let context$1 = context;
  15863. let uiMgr = UIMgr.inst;
  15864. let soundMgr = SoundMgr.getInstance();
  15865. let resMgr = ResMgr.getInstance();
  15866. let httpMgr = HttpMgr.getInstance();
  15867. let common = Common.getInstance();
  15868. let cfgMgr = ConfigMgr.getInstance();
  15869. let poolD3Mgr = PoolD3Mgr.ins;
  15870. let d3TexUrl = "res/d3Res/";
  15871. let d3ModeUrl = "res/unityRes/";
  15872. function setStageSize(view) {
  15873. if (view.width) {
  15874. view.width = Laya.stage.width;
  15875. view.height = Laya.stage.height;
  15876. }
  15877. }
  15878. function filledBg(view) {
  15879. let wh = Laya.stage.height / Laya.stage.width;
  15880. if (wh > 16 / 9) {
  15881. view.height = Laya.stage.height;
  15882. view.width = Laya.stage.height / 1334 * 750;
  15883. }
  15884. else {
  15885. view.width = Laya.stage.width;
  15886. view.height = Laya.stage.width / 750 * 1334;
  15887. }
  15888. }
  15889. function setNotch(view) {
  15890. if (view.height) {
  15891. view.y += context$1.notchHeight;
  15892. }
  15893. }
  15894. function showTip(str) {
  15895. uiMgr.Show(UIMsg, str);
  15896. }
  15897. function log(...args) {
  15898. console.log(args);
  15899. }
  15900. let xGame = {
  15901. context: context$1,
  15902. eventMgr,
  15903. resMgr,
  15904. uiMgr,
  15905. soundMgr,
  15906. define,
  15907. tools,
  15908. httpMgr,
  15909. d3TexUrl,
  15910. d3ModeUrl,
  15911. common,
  15912. cfgMgr,
  15913. poolD3Mgr,
  15914. setStageSize,
  15915. filledBg,
  15916. setNotch,
  15917. showTip,
  15918. log,
  15919. };
  15920. window["xGame"] = xGame;
  15921. let dataName = 'tBall_';
  15922. class UserData {
  15923. constructor() {
  15924. this.userId = "";
  15925. this.isAgree = false;
  15926. this.coinNum = 0;
  15927. this.gemNum = 0;
  15928. this.sound = true;
  15929. this.vibration = true;
  15930. this.currentDate = 0;
  15931. this.createTime = 0;
  15932. this.awardTime = 0;
  15933. this.roleId = 1;
  15934. this.roleList = [];
  15935. this.roleAds = [];
  15936. this.dressId = 101;
  15937. this.itemId = 201;
  15938. this.bigSkills = [1, 1, 1, 1, 1];
  15939. this.coin = 4000;
  15940. this.diamond = 0;
  15941. this.skillSuccessTimes = 0;
  15942. this.skillGuide = 0;
  15943. this.skillAccTimes = 0;
  15944. this.placeBallData = [];
  15945. this.shareDiamondTimes = 0;
  15946. this.dailyVideoShareTimes = 0;
  15947. this.secretary = [1, 0];
  15948. this.curSecretary = 0;
  15949. this.ballRod = [1, 0, 0, 0, 0, 1];
  15950. this.curBallRod = 5;
  15951. this.signData = 0;
  15952. this.signTime = 0;
  15953. this.drawTimes = 0;
  15954. this.drawAwardTimes = 0;
  15955. this.dailyfreeDrawTimes = 1;
  15956. this.power = 5;
  15957. this.powerTime = 0;
  15958. this.challengeTimes = 0;
  15959. this.extraSign = 0;
  15960. this.classicTimes = 0;
  15961. this.guideHelpLine = 0;
  15962. this.newUser = true;
  15963. this.rootBallFoul = 0;
  15964. this.timeoutFoul = 0;
  15965. this.roleList = [1];
  15966. }
  15967. saveData() {
  15968. let data = {};
  15969. for (let k in this) {
  15970. data[k.toString()] = this[k];
  15971. }
  15972. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15973. }
  15974. getData() {
  15975. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15976. if (ld) {
  15977. let localData = JSON.parse(ld);
  15978. if (localData) {
  15979. for (let k in this) {
  15980. let key = k.toString();
  15981. let data = localData[key];
  15982. if (data != undefined) {
  15983. this[k] = data;
  15984. }
  15985. }
  15986. }
  15987. }
  15988. }
  15989. }
  15990. class ItemData {
  15991. constructor() {
  15992. this.itemList = {};
  15993. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15994. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15995. }
  15996. saveData() {
  15997. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15998. }
  15999. getData() {
  16000. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  16001. if (ld) {
  16002. let localData = JSON.parse(ld);
  16003. if (localData) {
  16004. this.itemList = localData;
  16005. }
  16006. }
  16007. }
  16008. }
  16009. class GameData {
  16010. constructor() {
  16011. this.curLevel = 0;
  16012. this.gameType = 1;
  16013. this.signIdx = 0;
  16014. this.signMax = 0;
  16015. this.rotaryTime = 0;
  16016. this.rotaryCount = 0;
  16017. this.rotaryList = [];
  16018. this.diyCount = 3;
  16019. this.awardIdx = 0;
  16020. this.shareNum = 2;
  16021. this.rankWeek = 0;
  16022. this.rankScore = 0;
  16023. this.gameCount = 0;
  16024. this.trySkill = -1;
  16025. this.tryTime = 0;
  16026. }
  16027. saveData() {
  16028. let data = {};
  16029. for (let k in this) {
  16030. data[k.toString()] = this[k];
  16031. }
  16032. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  16033. }
  16034. getData() {
  16035. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  16036. if (ld) {
  16037. let localData = JSON.parse(ld);
  16038. if (localData) {
  16039. for (let k in this) {
  16040. let key = k.toString();
  16041. let data = localData[key];
  16042. if (data != undefined) {
  16043. this[k] = data;
  16044. }
  16045. }
  16046. }
  16047. }
  16048. }
  16049. }
  16050. class DataMgr {
  16051. static Init() {
  16052. this.userData = new UserData();
  16053. this.gameData = new GameData();
  16054. this.itemData = new ItemData();
  16055. this.userData.getData();
  16056. this.gameData.getData();
  16057. this.itemData.getData();
  16058. this.roleId = this.userData.roleId;
  16059. this.resetUse();
  16060. }
  16061. static isNewDay() {
  16062. Moyu.isNewDay(this, (isnew) => {
  16063. xGame.common.isNewDay = isnew;
  16064. if (!isnew)
  16065. return;
  16066. DataMgr.setShareDiamondTimes(0, false);
  16067. DataMgr.setDailyVideoShareTimes(0, false);
  16068. DataMgr.setDailyfreeDrawTimes(1);
  16069. DataMgr.setExtraSign(0);
  16070. });
  16071. }
  16072. static deletData() {
  16073. Laya.LocalStorage.clear();
  16074. }
  16075. static upRankData() {
  16076. let num = xGame.common.getAllStarNum();
  16077. if (num > 0)
  16078. Moyu.upRankData(xGame.common.curRankID, num);
  16079. }
  16080. static addItem(id, count = 1) {
  16081. let v = this.itemData.itemList[id];
  16082. if (!v)
  16083. v = { id: id, count: count, adnum: 0, active: true };
  16084. else {
  16085. if (v.active) {
  16086. v.count += count;
  16087. }
  16088. else {
  16089. v.count = count;
  16090. v.active = true;
  16091. }
  16092. }
  16093. this.itemData.itemList[id] = v;
  16094. xGame.soundMgr.playGetSound();
  16095. this.saveItemData();
  16096. }
  16097. static hasItem(id) {
  16098. let v = this.itemData.itemList[id];
  16099. if (v && v.active)
  16100. return true;
  16101. return false;
  16102. }
  16103. static getItem(id) {
  16104. let v = this.itemData.itemList[id];
  16105. return v;
  16106. }
  16107. static getItemCount(id) {
  16108. let v = this.itemData.itemList[id];
  16109. if (v && v.active)
  16110. return v.count;
  16111. return 0;
  16112. }
  16113. static getItemAd(id) {
  16114. let v = this.itemData.itemList[id];
  16115. if (v) {
  16116. return v.adnum;
  16117. }
  16118. return 0;
  16119. }
  16120. static onItemAd(id, num = 1) {
  16121. let v = this.itemData.itemList[id];
  16122. if (!v)
  16123. v = { id: id, count: 1, adnum: num, active: false };
  16124. else
  16125. v.adnum += num;
  16126. this.itemData.itemList[id] = v;
  16127. this.saveItemData();
  16128. }
  16129. static costItem(id, count) {
  16130. let v = this.itemData.itemList[id];
  16131. if (v && v.active) {
  16132. if (v.count < count)
  16133. return false;
  16134. else {
  16135. v.count -= count;
  16136. this.itemData.itemList[id] = v;
  16137. return true;
  16138. }
  16139. }
  16140. return false;
  16141. }
  16142. static resetUse() {
  16143. this.dressId = this.userData.dressId;
  16144. this.itemId = this.userData.itemId;
  16145. }
  16146. static passLevel() {
  16147. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  16148. this.gameData.curLevel++;
  16149. this.curLevel = this.gameData.curLevel;
  16150. this.saveGameData();
  16151. }
  16152. static useRole(id) {
  16153. this.roleId = id;
  16154. if (this.hasRole(id)) {
  16155. this.userData.roleId = id;
  16156. this.saveUserData();
  16157. }
  16158. }
  16159. static addRole(id) {
  16160. if (this.hasRole(id))
  16161. return;
  16162. this.userData.roleList.push(id);
  16163. this.saveUserData();
  16164. }
  16165. static hasRole(id) {
  16166. return this.userData.roleList.indexOf(id) >= 0;
  16167. }
  16168. static gemEnough(num) {
  16169. return this.userData.gemNum >= num;
  16170. }
  16171. static roleHasAd(id) {
  16172. let count = this.userData.roleAds[id];
  16173. if (count != undefined && count >= 0)
  16174. return true;
  16175. else
  16176. return false;
  16177. }
  16178. static saveUserData(time = 500, event, arg) {
  16179. if (this.userSaving)
  16180. return;
  16181. this.userSaving = true;
  16182. Laya.timer.once(time, this, () => {
  16183. this.userSaving = false;
  16184. this.userData.saveData();
  16185. if (event)
  16186. xGame.eventMgr.event(event, arg);
  16187. });
  16188. }
  16189. static saveGameData() {
  16190. if (this.gameSaving)
  16191. return;
  16192. this.gameSaving = true;
  16193. Laya.timer.once(1000, this, () => {
  16194. this.gameSaving = false;
  16195. this.gameData.saveData();
  16196. });
  16197. }
  16198. static saveItemData() {
  16199. let fun = () => {
  16200. this.itemData.saveData();
  16201. };
  16202. Laya.timer.clear(this, fun);
  16203. Laya.timer.once(500, this, fun);
  16204. }
  16205. static saveData() {
  16206. this.saveUserData();
  16207. this.saveGameData();
  16208. }
  16209. static getBigSkillList() {
  16210. return this.userData.bigSkills;
  16211. }
  16212. static getBigSkillByIndex(index) {
  16213. return this.userData.bigSkills[index];
  16214. }
  16215. static setBigSkill(index, val, addUp = true) {
  16216. if (addUp) {
  16217. this.userData.bigSkills[index] += val;
  16218. }
  16219. else {
  16220. this.userData.bigSkills[index] = val;
  16221. }
  16222. this.saveUserData();
  16223. }
  16224. static coinEnough(need) {
  16225. if (typeof need != "number") {
  16226. console.error("金币格式错误");
  16227. return;
  16228. }
  16229. return this.userData.coin >= need;
  16230. }
  16231. static setCoin(val) {
  16232. if (typeof val != "number") {
  16233. return;
  16234. }
  16235. this.userData.coin += val;
  16236. this.saveUserData();
  16237. xGame.eventMgr.event(COIN_CHANGE);
  16238. }
  16239. static getCoin() {
  16240. return this.userData.coin;
  16241. }
  16242. static diamondEnough(need) {
  16243. if (typeof need != "number") {
  16244. console.error("金币格式错误");
  16245. return;
  16246. }
  16247. return this.userData.diamond >= need;
  16248. }
  16249. static setDiamond(val) {
  16250. if (typeof val != "number") {
  16251. return;
  16252. }
  16253. this.userData.diamond += val;
  16254. this.saveUserData();
  16255. xGame.eventMgr.event(DIAMOND_CHANGE);
  16256. }
  16257. static getDiamond() {
  16258. return this.userData.diamond;
  16259. }
  16260. static getSkillSuccessTimes() {
  16261. return this.userData.skillSuccessTimes;
  16262. }
  16263. static setSkillSuccessTimes(val, addUp = true) {
  16264. if (addUp)
  16265. this.userData.skillSuccessTimes += val;
  16266. else
  16267. this.userData.skillSuccessTimes = val;
  16268. this.saveUserData();
  16269. }
  16270. static getSkillAccTimes() {
  16271. return this.userData.skillAccTimes;
  16272. }
  16273. static setSkillAccTimes(val) {
  16274. this.userData.skillAccTimes += val;
  16275. this.saveUserData();
  16276. }
  16277. static getSkillGuide() {
  16278. if (!xGame.common.openGuide) {
  16279. return 1;
  16280. }
  16281. return this.userData.skillGuide;
  16282. }
  16283. static setSkillGuide(val) {
  16284. this.userData.skillGuide = val;
  16285. this.saveUserData();
  16286. }
  16287. static getPlaceBallLevelList() {
  16288. return this.userData.placeBallData;
  16289. }
  16290. static getPlaceBallLevel(level) {
  16291. let arr = this.userData.placeBallData;
  16292. let index = level - 1;
  16293. let out;
  16294. if (arr[index]) {
  16295. out = arr[index];
  16296. }
  16297. else {
  16298. let max = arr.length;
  16299. if (max == index) {
  16300. out = {
  16301. star: 0,
  16302. play: true,
  16303. isCur: true,
  16304. getAward: false
  16305. };
  16306. }
  16307. else {
  16308. out = {
  16309. star: 0,
  16310. play: false,
  16311. getAward: false
  16312. };
  16313. }
  16314. }
  16315. return out;
  16316. }
  16317. static setPlaceBallLevel(level, star) {
  16318. let arr = this.userData.placeBallData;
  16319. let index = level - 1;
  16320. if (arr[index]) {
  16321. arr[index].star = Math.max(arr[index].star, star);
  16322. }
  16323. else {
  16324. let max = arr.length;
  16325. if (max == index) {
  16326. arr.push({
  16327. star: star,
  16328. play: true,
  16329. getAward: false
  16330. });
  16331. }
  16332. else {
  16333. console.error("关卡存储出错");
  16334. }
  16335. }
  16336. this.saveUserData();
  16337. }
  16338. static setPlaceBallAward(level) {
  16339. let arr = this.userData.placeBallData;
  16340. let index = level - 1;
  16341. if (arr[index]) {
  16342. arr[index].getAward = true;
  16343. }
  16344. this.saveUserData();
  16345. }
  16346. static getShareDiamondTimes() {
  16347. return this.userData.shareDiamondTimes;
  16348. }
  16349. static setShareDiamondTimes(val, addUp = true) {
  16350. if (addUp) {
  16351. this.userData.shareDiamondTimes += val;
  16352. }
  16353. else {
  16354. this.userData.shareDiamondTimes = val;
  16355. }
  16356. this.saveUserData();
  16357. }
  16358. static getDailyVideoShareTimes() {
  16359. return this.userData.dailyVideoShareTimes;
  16360. }
  16361. static setDailyVideoShareTimes(val, addUp = true) {
  16362. if (addUp) {
  16363. this.userData.dailyVideoShareTimes += val;
  16364. }
  16365. else {
  16366. this.userData.dailyVideoShareTimes = val;
  16367. }
  16368. this.saveUserData();
  16369. }
  16370. static getSecretary(index) {
  16371. return this.userData.secretary[index];
  16372. }
  16373. static setSecretary(index, val) {
  16374. this.userData.secretary[index] = val;
  16375. this.saveUserData();
  16376. }
  16377. static getCurSecretary() {
  16378. return this.userData.curSecretary;
  16379. }
  16380. static setCurSecretary(index) {
  16381. this.userData.curSecretary = index;
  16382. this.saveUserData();
  16383. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16384. }
  16385. static getBallRod(index) {
  16386. return this.userData.ballRod[index];
  16387. }
  16388. static setBallRod(index, val) {
  16389. this.userData.ballRod[index] = val;
  16390. this.saveUserData();
  16391. }
  16392. static getCurBallRod() {
  16393. return this.userData.curBallRod;
  16394. }
  16395. static setCurBallRod(index) {
  16396. this.userData.curBallRod = index;
  16397. this.saveUserData();
  16398. }
  16399. static setSignData(val) {
  16400. this.userData.signData = val;
  16401. this.saveUserData();
  16402. }
  16403. static getSignData() {
  16404. return this.userData.signData;
  16405. }
  16406. static setSignTime(val) {
  16407. this.userData.signTime = val;
  16408. this.saveUserData();
  16409. }
  16410. static getSignTime() {
  16411. return this.userData.signTime;
  16412. }
  16413. static getDrawTimes() {
  16414. return this.userData.drawTimes;
  16415. }
  16416. static setDrawTimes(val, addUp = true) {
  16417. if (addUp) {
  16418. this.userData.drawTimes += val;
  16419. }
  16420. else {
  16421. this.userData.drawTimes = val;
  16422. }
  16423. this.saveUserData();
  16424. }
  16425. static getDrawAwardTimes() {
  16426. return this.userData.drawAwardTimes;
  16427. }
  16428. static setDrawAwardTimes(val) {
  16429. this.userData.drawAwardTimes = val;
  16430. this.saveUserData();
  16431. }
  16432. static getDailyfreeDrawTimes() {
  16433. return this.userData.dailyfreeDrawTimes;
  16434. }
  16435. static setDailyfreeDrawTimes(val) {
  16436. this.userData.dailyfreeDrawTimes = val;
  16437. this.saveUserData();
  16438. }
  16439. static setPower(val, addUp = true) {
  16440. if (addUp)
  16441. this.userData.power += val;
  16442. else
  16443. this.userData.power = val;
  16444. if (this.userData.power >= xGame.common.maxPower) {
  16445. this.userData.power = xGame.common.maxPower;
  16446. }
  16447. xGame.eventMgr.event(POWER_CHANGE, val);
  16448. this.saveUserData();
  16449. }
  16450. static getPower() {
  16451. return this.userData.power;
  16452. }
  16453. static setPowerTime(val) {
  16454. this.userData.powerTime = val;
  16455. this.saveUserData();
  16456. }
  16457. static getPowerTime() {
  16458. return this.userData.powerTime;
  16459. }
  16460. static powerEnough() {
  16461. return this.getPower() > 0;
  16462. }
  16463. static getChallengeTimes() {
  16464. return this.userData.challengeTimes;
  16465. }
  16466. static setChallengeTimes(val) {
  16467. this.userData.challengeTimes += val;
  16468. this.saveUserData();
  16469. }
  16470. static getExtraSign() {
  16471. return this.userData.extraSign;
  16472. }
  16473. static setExtraSign(val) {
  16474. this.userData.extraSign = val;
  16475. this.saveUserData();
  16476. }
  16477. static getClassicTimes() {
  16478. return this.userData.classicTimes;
  16479. }
  16480. static setClassicTimes() {
  16481. this.userData.classicTimes += 1;
  16482. this.saveUserData();
  16483. }
  16484. static getGuideHelpLine() {
  16485. return this.userData.guideHelpLine;
  16486. }
  16487. static setGuideHelpLine() {
  16488. this.userData.guideHelpLine = 1;
  16489. this.saveUserData();
  16490. }
  16491. static getNewUser() {
  16492. return this.userData.newUser;
  16493. }
  16494. static setNewUser() {
  16495. this.userData.newUser = false;
  16496. this.saveUserData();
  16497. }
  16498. static getRootBallFoul() {
  16499. return this.userData.rootBallFoul;
  16500. }
  16501. static setRootBallFoul() {
  16502. this.userData.rootBallFoul = 1;
  16503. this.saveUserData();
  16504. }
  16505. static getTimeoutFoul() {
  16506. return this.userData.timeoutFoul;
  16507. }
  16508. static setTimeoutFoul() {
  16509. this.userData.timeoutFoul = 1;
  16510. this.saveUserData();
  16511. }
  16512. }
  16513. DataMgr.isNewUser = false;
  16514. DataMgr.fristEnter = true;
  16515. DataMgr.levelType = 0;
  16516. DataMgr.awardId = 0;
  16517. DataMgr.awardCoin = 0;
  16518. DataMgr.sceneId = -1;
  16519. DataMgr.tryId = 0;
  16520. DataMgr.curLevel = 1;
  16521. DataMgr.vipLevel = 0;
  16522. DataMgr.maxLevel = 0;
  16523. DataMgr.awardRatio = 1;
  16524. DataMgr.gameList = [];
  16525. DataMgr.rankList = [];
  16526. DataMgr.recoverTime = 480000;
  16527. DataMgr.minScore = 0;
  16528. DataMgr.rankDis = 0;
  16529. DataMgr.userSaving = false;
  16530. DataMgr.gameSaving = false;
  16531. class D3Tween extends Laya.Script3D {
  16532. constructor() {
  16533. super();
  16534. this.isInited = false;
  16535. }
  16536. ;
  16537. init() {
  16538. if (this.isInited)
  16539. return;
  16540. this.isInited = true;
  16541. this.gameObj = this.owner;
  16542. this.transform = this.gameObj.transform;
  16543. }
  16544. get rotX() {
  16545. return this.transform.localRotationEulerX;
  16546. }
  16547. set rotX(v) {
  16548. this.transform.localRotationEulerX = v;
  16549. }
  16550. get rotY() {
  16551. return this.transform.localRotationEulerY;
  16552. }
  16553. set rotY(v) {
  16554. this.transform.localRotationEulerY = v;
  16555. }
  16556. get rotZ() {
  16557. return this.transform.localRotationEulerZ;
  16558. }
  16559. set rotZ(v) {
  16560. this.transform.localRotationEulerZ = v;
  16561. }
  16562. get posX() {
  16563. return this.transform.localPositionX;
  16564. }
  16565. set posX(v) {
  16566. this.transform.localPositionX = v;
  16567. }
  16568. get posY() {
  16569. return this.transform.localPositionY;
  16570. }
  16571. set posY(v) {
  16572. this.transform.localPositionY = v;
  16573. }
  16574. get posZ() {
  16575. return this.transform.localPositionZ;
  16576. }
  16577. set posZ(v) {
  16578. this.transform.localPositionZ = v;
  16579. }
  16580. get rotation() {
  16581. return this.transform.localRotation;
  16582. }
  16583. set rotation(v) {
  16584. this.transform.localRotation = v;
  16585. }
  16586. }
  16587. class D2Hole extends Laya.Script {
  16588. constructor() { super(); }
  16589. onTriggerEnter(collider) {
  16590. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16591. return;
  16592. }
  16593. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16594. if (collider.owner["mySrc"].isRunSkillAni) {
  16595. return;
  16596. }
  16597. if (collider.owner["mySrc"].number != 0) {
  16598. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16599. }
  16600. xGame.common.ballColliHole(collider);
  16601. xGame.common.recoverCameraView();
  16602. }
  16603. }
  16604. }
  16605. class Table extends Laya.Script3D {
  16606. constructor() {
  16607. super();
  16608. this.isSetBorder = false;
  16609. this.inited = false;
  16610. }
  16611. ;
  16612. onAwake() {
  16613. this.init();
  16614. }
  16615. init() {
  16616. if (this.inited)
  16617. return;
  16618. this.inited = true;
  16619. this.gameObj = this.owner;
  16620. this.border = this.gameObj.getChildByName("border");
  16621. }
  16622. setBorderPos() {
  16623. if (this.isSetBorder)
  16624. return;
  16625. this.isSetBorder = true;
  16626. let ui = xGame.common.gameUI.ui;
  16627. let bar1 = this.border.getChildByName("bar1");
  16628. let bar2 = this.border.getChildByName("bar2");
  16629. let bar3 = this.border.getChildByName("bar3");
  16630. let bar4 = this.border.getChildByName("bar4");
  16631. let bar5 = this.border.getChildByName("bar5");
  16632. let bar6 = this.border.getChildByName("bar6");
  16633. this.setInfo(bar1, ui.border.bar1, "box");
  16634. this.setInfo(bar2, ui.border.bar2, "box");
  16635. this.setInfo(bar3, ui.border.bar3, "box");
  16636. this.setInfo(bar4, ui.border.bar4, "box");
  16637. this.setInfo(bar5, ui.border.bar5, "box");
  16638. this.setInfo(bar6, ui.border.bar6, "box");
  16639. let circle1 = this.border.getChildByName("circle1");
  16640. let circle2 = this.border.getChildByName("circle2");
  16641. let circle3 = this.border.getChildByName("circle3");
  16642. let circle4 = this.border.getChildByName("circle4");
  16643. let circle5 = this.border.getChildByName("circle5");
  16644. let circle6 = this.border.getChildByName("circle6");
  16645. this.setInfo(circle1, ui.border.circle1, "circle");
  16646. this.setInfo(circle2, ui.border.circle2, "circle");
  16647. this.setInfo(circle3, ui.border.circle3, "circle");
  16648. this.setInfo(circle4, ui.border.circle4, "circle");
  16649. this.setInfo(circle5, ui.border.circle5, "circle");
  16650. this.setInfo(circle6, ui.border.circle6, "circle");
  16651. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16652. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16653. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16654. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16655. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16656. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16657. let arr = xGame.common.gameMgr.holePosList;
  16658. xGame.common.gameMgr.posObj = {
  16659. "1": arr[0],
  16660. "3": arr[2],
  16661. "4": arr[3],
  16662. "6": arr[5]
  16663. };
  16664. }
  16665. initHolePos(x, y) {
  16666. if (x < 300)
  16667. x += 25;
  16668. else if (x > 1000)
  16669. x -= 25;
  16670. else if (y > 200)
  16671. y -= 10;
  16672. else
  16673. y += 10;
  16674. if (y < 200)
  16675. y += 30;
  16676. else if (y > 500)
  16677. y -= 30;
  16678. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16679. }
  16680. setInfo(d3Obj, d2Obj, type) {
  16681. let ui = xGame.common.gameUI.ui;
  16682. let sprite = new Laya.Sprite();
  16683. ui.border.displayObject.addChild(sprite);
  16684. let colli = xGame.common.getCollider(type);
  16685. sprite.addComponentIntance(colli);
  16686. let rigy = xGame.common.getRigbody();
  16687. rigy.type = "static";
  16688. sprite.addComponentIntance(rigy);
  16689. let d3Pos = d3Obj.transform.position;
  16690. xGame.common.pos3to2Convert(d3Pos);
  16691. let scaleX = d3Obj.transform.localScaleX;
  16692. let scaleZ = d3Obj.transform.localScaleZ;
  16693. let width = xGame.common.scale3to2Convert(scaleZ);
  16694. let height = xGame.common.scale3to2Convert(scaleX);
  16695. sprite.pivotX = width / 2;
  16696. sprite.pivotY = height / 2;
  16697. sprite.x = d3Pos.x;
  16698. sprite.y = d3Pos.y;
  16699. sprite.width = width;
  16700. sprite.height = height;
  16701. d2Obj.x = d3Pos.x;
  16702. d2Obj.y = d3Pos.y;
  16703. d2Obj.width = width;
  16704. d2Obj.height = height;
  16705. if (type == "box") {
  16706. colli.width = width;
  16707. colli.height = height;
  16708. colli.isSensor = false;
  16709. colli.label = "border";
  16710. }
  16711. else {
  16712. colli.radius = width / 2;
  16713. colli.isSensor = true;
  16714. colli.label = "hole";
  16715. sprite.addComponent(D2Hole);
  16716. }
  16717. }
  16718. }
  16719. class D3World extends Laya.Script3D {
  16720. constructor() {
  16721. super();
  16722. this.loadNum = 0;
  16723. this.setLoadNum = 7;
  16724. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16725. }
  16726. onAwake() {
  16727. }
  16728. loadScene() {
  16729. this.scene = this.owner;
  16730. let url = `res/unityRes/root.lh`;
  16731. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16732. this.scene.addChild(prefab);
  16733. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16734. this.putCameraInfo();
  16735. this.camera.enableHDR = false;
  16736. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16737. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16738. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16739. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16740. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16741. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16742. this.knife.active = false;
  16743. this.loadD3Obj();
  16744. }));
  16745. }
  16746. putCameraInfo() {
  16747. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16748. this.cameraObj = new cameraType();
  16749. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16750. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16751. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16752. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16753. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16754. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16755. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16756. this.visitAngleChild.init();
  16757. this.visitRootObj.posX = this.visitAngleChild.posX;
  16758. this.visitRootObj.posY = this.visitAngleChild.posY;
  16759. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16760. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16761. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16762. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16763. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16764. xGame.common.showOneCamera("mainCamera");
  16765. }
  16766. loadD3Obj() {
  16767. this.loadTable();
  16768. this.loadRoom();
  16769. this.loadInHoleParticial();
  16770. this.loadIceParticial();
  16771. this.loadHitParticial();
  16772. this.loadFireworksParticial();
  16773. this.loadBall();
  16774. }
  16775. loadInHoleParticial() {
  16776. this.loadD3Res("inHoleEft", "", (prefab) => {
  16777. prefab.addComponent(Partical);
  16778. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16779. });
  16780. }
  16781. loadIceParticial() {
  16782. this.loadD3Res("iceEft", "", (prefab) => {
  16783. prefab.addComponent(Partical);
  16784. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16785. });
  16786. }
  16787. loadHitParticial() {
  16788. this.loadD3Res("hitEft", "", (prefab) => {
  16789. prefab.addComponent(Partical);
  16790. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16791. });
  16792. }
  16793. loadFireworksParticial() {
  16794. this.loadD3Res("fireworksEft", "", (prefab) => {
  16795. prefab.addComponent(Partical);
  16796. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16797. });
  16798. }
  16799. loadBall(index = 1) {
  16800. this.loadD3Res("ball", index, (prefab) => {
  16801. this.ballPrefab = prefab;
  16802. this.ballPrefab.addComponent(Ball);
  16803. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16804. });
  16805. }
  16806. loadTable(index = 1) {
  16807. this.loadD3Res("table", index, (prefab) => {
  16808. this.tableSrc = prefab.addComponent(Table);
  16809. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16810. this.d3Hand.init();
  16811. this.tableRoot.addChild(prefab);
  16812. });
  16813. }
  16814. loadRoom(index = 1) {
  16815. this.loadD3Res("room", index, (prefab) => {
  16816. this.roomRoot.addChild(prefab);
  16817. });
  16818. }
  16819. loadD3Res(type, index, callback) {
  16820. let url = `res/unityRes/${type}${index}.lh`;
  16821. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16822. callback && callback(prefab);
  16823. this.checkResLoad();
  16824. }));
  16825. }
  16826. checkResLoad() {
  16827. this.loadNum++;
  16828. if (this.loadNum >= this.setLoadNum) {
  16829. xGame.eventMgr.event(D3RES_LOADED);
  16830. }
  16831. }
  16832. prePlayEft() {
  16833. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16834. eft.transform.localPositionX = 0;
  16835. eft.transform.localPositionY = -5;
  16836. eft.transform.localPositionZ = 0;
  16837. eft.active = true;
  16838. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16839. ice.transform.localPositionX = 0;
  16840. ice.transform.localPositionY = -5;
  16841. ice.transform.localPositionZ = 0;
  16842. ice.active = true;
  16843. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16844. hit.transform.localPositionX = 0;
  16845. hit.transform.localPositionY = -5;
  16846. hit.transform.localPositionZ = 0;
  16847. hit.active = true;
  16848. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16849. fireworks.transform.localPositionX = 0;
  16850. fireworks.transform.localPositionY = -5;
  16851. fireworks.transform.localPositionZ = 0;
  16852. fireworks.active = true;
  16853. }
  16854. }
  16855. class cameraType {
  16856. }
  16857. class MoyuMgr$1 {
  16858. static initMoyu() {
  16859. this.moyuView = new MoyuView$1();
  16860. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16861. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16862. this.moyuView.ui.displayObject.zOrder = 1000;
  16863. this.moyuView.init();
  16864. this.moyuView.showTip(true);
  16865. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16866. window['XApk'] = this;
  16867. }
  16868. static showAge(show) {
  16869. if (this.moyuView)
  16870. this.moyuView.showAge(show);
  16871. }
  16872. static onPlatMsg(idx) {
  16873. if (!MoyuMgr$1.moyuView)
  16874. return;
  16875. if (idx == '0') {
  16876. MoyuMgr$1.moyuView.showTip(false);
  16877. }
  16878. }
  16879. static showAgree(call) {
  16880. if (this.moyuView)
  16881. this.moyuView.showAgree(call);
  16882. else
  16883. call && call();
  16884. }
  16885. static showXy(type = 1) {
  16886. if (this.moyuView)
  16887. this.moyuView.showXy(type);
  16888. }
  16889. }
  16890. MoyuMgr$1.isAdvise = false;
  16891. class MoyuView$1 {
  16892. constructor() {
  16893. this.ysxyNum = 1;
  16894. this.ysJson = null;
  16895. this.ui = ui_UIMoyu.createInstance();
  16896. }
  16897. init() {
  16898. this.ui.mainBg.visible = false;
  16899. this.ui.xyNode.visible = false;
  16900. this.ui.ageNode.visible = false;
  16901. this.ui.tipNode.visible = false;
  16902. this.ui.rnNode.visible = false;
  16903. this.ui.fcmNode.visible = false;
  16904. this.ui.ageTip.visible = false;
  16905. this.ui.msgNode.visible = false;
  16906. this.ui.visible = false;
  16907. this.ui.xyNode.xyList.setVirtual();
  16908. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16909. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16910. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16911. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16912. this.ui.xyNode.btnKnown.visible = false;
  16913. this.ui.xyNode.xy1.visible = false;
  16914. this.ui.xyNode.xy2.visible = false;
  16915. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16916. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16917. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16918. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16919. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16920. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16921. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16922. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16923. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16924. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16925. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16926. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16927. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16928. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16929. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16930. this.ysxyNum = 2;
  16931. }
  16932. }
  16933. onClick(obj) {
  16934. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16935. switch (obj) {
  16936. case this.ui.ageTip:
  16937. if (Moyu.isTTApk) {
  16938. this.ui.ageNode.visible = true;
  16939. this.ui.mainBg.visible = true;
  16940. }
  16941. break;
  16942. case this.ui.tipNode:
  16943. this.showTip(false);
  16944. break;
  16945. case this.ui.ageNode.btnAge:
  16946. this.ui.ageNode.visible = false;
  16947. this.ui.mainBg.visible = false;
  16948. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16949. this.ui.visible = false;
  16950. break;
  16951. case this.ui.xyNode.btnXy3:
  16952. case this.ui.xyNode.btnXy1:
  16953. this.loadXy(1);
  16954. break;
  16955. case this.ui.xyNode.btnXy2:
  16956. this.loadXy(2);
  16957. break;
  16958. case this.ui.xyNode.btnBack:
  16959. this.ui.xyNode.xy1.visible = true;
  16960. this.ui.xyNode.xy2.visible = false;
  16961. break;
  16962. case this.ui.xyNode.btnKnown:
  16963. this.ui.xyNode.visible = false;
  16964. this.ui.mainBg.visible = false;
  16965. this.ui.visible = false;
  16966. break;
  16967. case this.ui.rnNode.btnCheck:
  16968. this.check();
  16969. break;
  16970. case this.ui.rnNode.btnExit:
  16971. case this.ui.xyNode.btnNo:
  16972. this.ysxyNum--;
  16973. if (this.ysxyNum > 0)
  16974. this.showMsg("Refuse to quit the game once again");
  16975. else {
  16976. Moyu.userAgree(false);
  16977. Moyu.exit();
  16978. }
  16979. break;
  16980. case this.ui.xyNode.btnSure:
  16981. case this.ui.xyNode.btnYes:
  16982. DataMgr.userData.isAgree = true;
  16983. DataMgr.saveUserData();
  16984. this.onAgree();
  16985. break;
  16986. case this.ui.rnNode.btnDone:
  16987. this.ui.rnNode.visible = false;
  16988. this.ui.visible = false;
  16989. break;
  16990. case this.ui.fcmNode.btnRn:
  16991. this.showRn();
  16992. break;
  16993. }
  16994. }
  16995. showTip(show) {
  16996. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16997. return;
  16998. if (show) {
  16999. MoyuMgr$1.isAdvise = true;
  17000. this.ui.visible = true;
  17001. this.ui.tipNode.visible = true;
  17002. this.ui.tipNode.alpha = 1;
  17003. Laya.timer.once(1000, this, this.showTip, [false]);
  17004. }
  17005. else {
  17006. this.ui.tipNode.alpha = 1;
  17007. this.ui.tipNode.visible = true;
  17008. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  17009. this.ui.tipNode.visible = false;
  17010. MoyuMgr$1.isAdvise = false;
  17011. }), 1000);
  17012. }
  17013. }
  17014. showAge(show, px = 0, py = 0) {
  17015. if (Moyu.platType > 10 && !Moyu.isIos) {
  17016. this.ui.ageTip.x = px;
  17017. this.ui.ageTip.y = py;
  17018. this.ui.ageTip.visible = show;
  17019. if (show)
  17020. this.ui.visible = true;
  17021. }
  17022. }
  17023. showAgree(call) {
  17024. this.agreeCall = call;
  17025. this.onAgree();
  17026. return;
  17027. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  17028. this.showXy(0);
  17029. }
  17030. else
  17031. this.onAgree();
  17032. }
  17033. onAgree() {
  17034. if (!this.ui.ageNode.visible)
  17035. this.ui.visible = false;
  17036. this.ui.xyNode.visible = false;
  17037. Moyu.userAgree(true);
  17038. this.showAge(false);
  17039. this.agreeCall && this.agreeCall();
  17040. this.showRn();
  17041. }
  17042. showMsg(txt) {
  17043. this.ui.msgNode.txtMsg.text = txt;
  17044. this.ui.msgNode.visible = true;
  17045. this.ui.msgNode.alpha = 1;
  17046. this.ui.visible = true;
  17047. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  17048. this.ui.msgNode.visible = false;
  17049. }), 2500, true);
  17050. }
  17051. showRn() {
  17052. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17053. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  17054. this.ui.rnNode.rn1.visible = true;
  17055. this.ui.rnNode.rn2.visible = false;
  17056. this.ui.rnNode.rn3.visible = false;
  17057. this.ui.rnNode.rn4.visible = false;
  17058. this.ui.rnNode.visible = true;
  17059. this.ui.mainBg.visible = true;
  17060. this.ui.rnNode.btnDone.visible = false;
  17061. this.ui.rnNode.btnExit.visible = true;
  17062. this.ui.rnNode.btnCheck.visible = true;
  17063. this.ui.fcmNode.visible = false;
  17064. this.ui.visible = true;
  17065. return;
  17066. }
  17067. }
  17068. this.showFcm();
  17069. }
  17070. showFcm() {
  17071. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17072. Moyu.initFCM(true);
  17073. if (Moyu.gameTime < 1)
  17074. this.fcmLoop();
  17075. else if (Moyu.gameTime < 999)
  17076. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  17077. }
  17078. }
  17079. fcmLoop() {
  17080. if (Moyu.gameTime < 1) {
  17081. this.ui.rnNode.visible = false;
  17082. this.ui.fcmNode.visible = true;
  17083. this.ui.mainBg.visible = true;
  17084. this.ui.visible = true;
  17085. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  17086. Laya.timer.clear(this.ui, this.fcmLoop);
  17087. }
  17088. }
  17089. check() {
  17090. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  17091. this.ui.rnNode.rn1.visible = false;
  17092. this.ui.rnNode.rn2.visible = false;
  17093. this.ui.rnNode.rn4.visible = true;
  17094. }
  17095. else if (this.ui.rnNode.rn4.visible) {
  17096. let name = this.ui.rnNode.inputName.text;
  17097. let code = this.ui.rnNode.inputCode.text;
  17098. if (code && code.length == 18) {
  17099. this.ui.rnNode.rn1.visible = false;
  17100. this.ui.rnNode.rn4.visible = false;
  17101. Moyu.authenticate(name, code, (res) => {
  17102. this.ui.rnNode.rn2.visible = !res;
  17103. this.ui.rnNode.rn3.visible = res;
  17104. this.ui.rnNode.btnDone.visible = res;
  17105. this.ui.rnNode.btnExit.visible = !res;
  17106. this.ui.rnNode.btnCheck.visible = !res;
  17107. if (res)
  17108. this.showFcm();
  17109. });
  17110. }
  17111. else
  17112. this.showMsg("信息填写不完整");
  17113. }
  17114. }
  17115. loadXy(type = 0) {
  17116. this.ui.xyNode.xy1.visible = false;
  17117. this.ui.xyNode.xy2.visible = true;
  17118. this.ui.xyNode.xyList.scrollToView(0);
  17119. if (type == 1) {
  17120. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  17121. }
  17122. else if (type == 2) {
  17123. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  17124. }
  17125. }
  17126. showXy(type = 0) {
  17127. this.xyBtn();
  17128. if (type == 0) {
  17129. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  17130. this.ui.xyNode.btnSure.visible = true;
  17131. }
  17132. else {
  17133. this.ui.xyNode.btnYes.visible = true;
  17134. this.ui.xyNode.btnNo.visible = true;
  17135. }
  17136. }
  17137. else {
  17138. this.ui.xyNode.btnKnown.visible = true;
  17139. this.ui.mainBg.visible = true;
  17140. }
  17141. this.ui.xyNode.xy1.visible = true;
  17142. this.ui.xyNode.xy2.visible = false;
  17143. this.ui.xyNode.visible = true;
  17144. this.ui.visible = true;
  17145. }
  17146. xyBtn() {
  17147. this.ui.xyNode.btnSure.visible = false;
  17148. this.ui.xyNode.btnYes.visible = false;
  17149. this.ui.xyNode.btnNo.visible = false;
  17150. this.ui.xyNode.btnKnown.visible = false;
  17151. {
  17152. this.ui.xyNode.btnXy3.visible = false;
  17153. this.ui.xyNode.btnXy2.visible = true;
  17154. this.ui.xyNode.btnXy1.visible = true;
  17155. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  17156. }
  17157. }
  17158. createXY(json) {
  17159. this.ysJson = json.content;
  17160. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  17161. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  17162. this.ui.xyNode.xy2.visible = true;
  17163. }
  17164. renderListItem(idx, cell) {
  17165. let xy = this.ysJson[idx];
  17166. cell.height = xy.line * 30;
  17167. cell.xyItem.text = xy.text;
  17168. }
  17169. onDestroy() {
  17170. this.agreeCall = null;
  17171. }
  17172. }
  17173. class UILoading extends UIBase {
  17174. constructor() {
  17175. super();
  17176. this.accTime = 0;
  17177. this.curNum = 0;
  17178. this.rate = 1;
  17179. this.loadSubOk = false;
  17180. this.loadResOK = false;
  17181. this.openLoading = true;
  17182. this.beginLoadRes = false;
  17183. this.finishD2 = false;
  17184. this.finishD3 = false;
  17185. }
  17186. onConstructor() {
  17187. this.ui = ui_UILoading.createInstance();
  17188. this.contentPane = this.ui;
  17189. this.isEject = false;
  17190. this._initUI();
  17191. this._addEvent();
  17192. }
  17193. _initUI() {
  17194. MoyuMgr$1.initMoyu();
  17195. }
  17196. _addEvent() {
  17197. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  17198. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  17199. }
  17200. show() {
  17201. super.show();
  17202. console.log('zh:加载分包资源');
  17203. loadSubRes(this.subResProgress.bind(this));
  17204. this.ui.txtLoad.text = "Loading...";
  17205. }
  17206. subResProgress(pro, finish) {
  17207. this.curNum = pro;
  17208. if (finish) {
  17209. this.curNum = 1;
  17210. this.loadSubOk = true;
  17211. }
  17212. }
  17213. laodD3Res() {
  17214. let scene3D = new Laya.Scene3D();
  17215. xGame.common.d3Scene = scene3D;
  17216. xGame.common.d3World = scene3D.addComponent(D3World);
  17217. xGame.common.d3World.loadScene();
  17218. }
  17219. loadD2Res() {
  17220. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  17221. this.finishD2 = true;
  17222. this.checkLoadAll();
  17223. this.curNum = 1;
  17224. }), Laya.Handler.create(this, (pro) => {
  17225. this.curNum = pro;
  17226. }, null, false));
  17227. }
  17228. d3ResFinish() {
  17229. this.finishD3 = true;
  17230. this.checkLoadAll();
  17231. }
  17232. checkLoadAll() {
  17233. if (this.finishD2 && this.finishD3) {
  17234. this.loadResOK = true;
  17235. }
  17236. }
  17237. loadRes() {
  17238. this.laodD3Res();
  17239. this.loadD2Res();
  17240. }
  17241. myUpdate(dt) {
  17242. if (!this.openLoading)
  17243. return;
  17244. this.accTime += dt * this.rate;
  17245. if (this.accTime >= this.curNum)
  17246. this.accTime = this.curNum;
  17247. this.ui.loadinfo.value = this.accTime * 100;
  17248. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  17249. if (!this.beginLoadRes) {
  17250. this.beginLoadRes = true;
  17251. this.ui.txtLoad.text = "Loading...";
  17252. this.curNum = 0;
  17253. this.accTime = 0;
  17254. this.loadRes();
  17255. }
  17256. if (this.loadResOK) {
  17257. this.openLoading = false;
  17258. Laya.timer.once(300, this, () => {
  17259. xGame.common.d3Scene.active = false;
  17260. MoyuMgr$1.showAgree(enterGame);
  17261. });
  17262. }
  17263. }
  17264. }
  17265. release() {
  17266. }
  17267. hide() {
  17268. super.hide();
  17269. this.release();
  17270. }
  17271. onClose() {
  17272. this.hide();
  17273. }
  17274. }
  17275. UILoading.uiName = "UILoading";
  17276. class UIRepentProp$1 extends UIBase {
  17277. constructor() {
  17278. super();
  17279. this.viewType = 0;
  17280. this.regretType = 0;
  17281. }
  17282. onConstructor() {
  17283. this.ui = ui_UIRepentProp.createInstance();
  17284. this.contentPane = this.ui;
  17285. this.isEject = false;
  17286. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17287. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17288. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17289. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17290. }
  17291. show(viewType, regretType, callback) {
  17292. PlatMgr.showInsert(true);
  17293. this.viewType = viewType;
  17294. this.regretType = regretType;
  17295. this.callback = callback;
  17296. super.show();
  17297. this.ui.t0.play();
  17298. this.ui.c1.selectedIndex = this.viewType;
  17299. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17300. if (this.viewType == 0) {
  17301. let guide = DataMgr.getGuideHelpLine();
  17302. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17303. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17304. }
  17305. xGame.common.gameMgr.gamePause = true;
  17306. }
  17307. hideSelf() {
  17308. xGame.common.gameMgr.gamePause = false;
  17309. this.callback && this.callback(false);
  17310. this.hide();
  17311. }
  17312. videoRegret() {
  17313. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  17314. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  17315. }
  17316. else {
  17317. console.log('zh:AD 失败,直接发放奖励');
  17318. this.qjff_AD_for_UIrepentProp_videoRegret();
  17319. }
  17320. }
  17321. qjff_AD_for_UIrepentProp_videoRegret() {
  17322. this.callback && this.callback(true);
  17323. this.hideSelf();
  17324. }
  17325. videoAddHelpLine() {
  17326. let guide = DataMgr.getGuideHelpLine();
  17327. if (guide == 0) {
  17328. this.callback && this.callback(true);
  17329. this.hideSelf();
  17330. DataMgr.setGuideHelpLine();
  17331. xGame.common.gameUI.ui.guideNode.visible = false;
  17332. }
  17333. else {
  17334. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  17335. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  17336. }
  17337. else {
  17338. console.log('zh:AD 失败,直接发放奖励');
  17339. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  17340. }
  17341. }
  17342. }
  17343. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  17344. this.callback && this.callback(true);
  17345. this.hideSelf();
  17346. }
  17347. }
  17348. UIRepentProp$1.uiName = "UIRepentProp";
  17349. class UIRodMethod$1 extends UIBase {
  17350. constructor() {
  17351. super();
  17352. this.isPressd = false;
  17353. }
  17354. onConstructor() {
  17355. this.ui = ui_UIRodMethod.createInstance();
  17356. this.contentPane = this.ui;
  17357. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17358. this.moveDir = new Laya.Vector2();
  17359. this.moveDest = new Laya.Vector2();
  17360. this.centerPos = new Laya.Vector2();
  17361. xGame.common.uiRodMethod = this;
  17362. }
  17363. show() {
  17364. super.show();
  17365. xGame.common.gameMgr.gamePause = true;
  17366. this.openPressDotEvent();
  17367. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17368. this.centerPos.x = this.ui.white.x;
  17369. this.centerPos.y = this.ui.white.y;
  17370. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17371. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17372. this.setDot();
  17373. }
  17374. setDot() {
  17375. this.ui.dot.x = this.moveDest.x;
  17376. this.ui.dot.y = this.moveDest.y;
  17377. }
  17378. closeSelf() {
  17379. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17380. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17381. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17382. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17383. xGame.common.gameMgr.gamePause = false;
  17384. this.hide();
  17385. }
  17386. openPressDotEvent() {
  17387. this.closePressDotEvent();
  17388. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17389. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17390. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17391. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17392. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17393. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17394. }
  17395. closePressDotEvent() {
  17396. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17397. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17398. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17399. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17400. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17401. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17402. }
  17403. onDown(e) {
  17404. if (e.type == Laya.Event.MOUSE_DOWN)
  17405. this.isPressd = true;
  17406. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17407. this.isPressd = false;
  17408. if (!this.isPressd)
  17409. return;
  17410. this.moveDest.x = e.stageX;
  17411. this.moveDest.y = e.stageY;
  17412. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17413. if (dis > 6724) {
  17414. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17415. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17416. }
  17417. this.setDot();
  17418. }
  17419. resetRod() {
  17420. this.ui.dot.x = this.ui.white.x;
  17421. this.ui.dot.y = this.ui.white.y;
  17422. this.gameRod.dot.x = this.gameRod.bg.x;
  17423. this.gameRod.dot.y = this.gameRod.bg.y;
  17424. xGame.common.rodOffest.x = 0;
  17425. xGame.common.rodOffest.y = 0;
  17426. }
  17427. }
  17428. UIRodMethod$1.uiName = "UIRodMethod";
  17429. class UIMsg$1 extends UIBase {
  17430. constructor() {
  17431. super();
  17432. }
  17433. onConstructor() {
  17434. this.ui = ui_UIMsg.createInstance();
  17435. this.contentPane = this.ui;
  17436. this.isEject = false;
  17437. this.isMuti = true;
  17438. }
  17439. show(msg, callback) {
  17440. super.show();
  17441. this.ui.tipsNode.msgTxt.text = msg;
  17442. this.ui.alpha = 1;
  17443. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17444. this.hide();
  17445. callback && callback();
  17446. }), 1000);
  17447. }
  17448. }
  17449. UIMsg$1.uiName = "UIMsg";
  17450. class UITips$1 extends UIBase {
  17451. constructor() {
  17452. super();
  17453. this.type = 0;
  17454. }
  17455. onConstructor() {
  17456. this.ui = ui_UITips.createInstance();
  17457. this.contentPane = this.ui;
  17458. this.isEject = false;
  17459. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17460. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17461. }
  17462. show(tipsTxt, womanTxt, type) {
  17463. super.show();
  17464. this.ui.t0.play();
  17465. this.ui.myNode.tipsTxt.text = tipsTxt;
  17466. this.ui.myNode.womanTxt.text = womanTxt;
  17467. PlatMgr.showInsert(true);
  17468. this.ui.myNode.c1.selectedIndex = type;
  17469. this.type = type;
  17470. switch (this.type) {
  17471. case TipsType.exitGame:
  17472. xGame.common.gameMgr.gamePause = true;
  17473. break;
  17474. case TipsType.foul:
  17475. Laya.timer.once(200, this, () => {
  17476. xGame.common.gameMgr.gamePause = true;
  17477. });
  17478. break;
  17479. default:
  17480. break;
  17481. }
  17482. }
  17483. clickLeftBtn() {
  17484. this.hide();
  17485. xGame.common.gameMgr.gamePause = false;
  17486. switch (this.type) {
  17487. case TipsType.exitGame:
  17488. break;
  17489. case TipsType.foul:
  17490. break;
  17491. default:
  17492. break;
  17493. }
  17494. }
  17495. clickRightBtn() {
  17496. this.hide();
  17497. switch (this.type) {
  17498. case TipsType.exitGame:
  17499. xGame.eventMgr.event(RESET_GAME);
  17500. xGame.uiMgr.Show(UIMain$1);
  17501. Moyu.recordEnd(this, null);
  17502. xGame.common.longHelpLine = false;
  17503. break;
  17504. case TipsType.foul:
  17505. xGame.common.gameMgr.gamePause = false;
  17506. Laya.timer.clearAll(this);
  17507. break;
  17508. default:
  17509. break;
  17510. }
  17511. }
  17512. }
  17513. UITips$1.uiName = "UITips";
  17514. class UIGame$1 extends UIBase {
  17515. constructor() {
  17516. super();
  17517. this.powerNum = 0;
  17518. this.isD3Inited = false;
  17519. this.isPrePlay = false;
  17520. this.isMoveRod = false;
  17521. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17522. this.rulerDis = 20;
  17523. this.rulerOffset = 0;
  17524. }
  17525. onConstructor() {
  17526. this.ui = ui_UIGame.createInstance();
  17527. this.contentPane = this.ui;
  17528. this.ui.x += xGame.common.sysOffestNum;
  17529. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17530. this.isEject = false;
  17531. xGame.common.gameUI = this;
  17532. this.initSelf();
  17533. }
  17534. isTurnSelf() {
  17535. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17536. return true;
  17537. }
  17538. }
  17539. initSelf() {
  17540. let topUI = this.ui.topNode;
  17541. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17542. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17543. this.barInfo = {};
  17544. this.barInfo.curY = 0;
  17545. this.barInfo.height = this.ui.powerNode.height;
  17546. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17547. this.barInfo.powerStartY = this.ui.powerNode.y;
  17548. xGame.common.aiPlayer = new AIPlayer();
  17549. xGame.common.gameMgr = new GameMgr();
  17550. xGame.common.skillMgr = new SkillMgr();
  17551. xGame.common.wordsMgr = new WordsMgr();
  17552. xGame.common.talkMgr = new TalkMgr();
  17553. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17554. console.log("加载经典模式表情文件chenggon !");
  17555. });
  17556. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17557. console.log("挑战模式奖励模式spine加载成功!");
  17558. });
  17559. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17560. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17561. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17562. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17563. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17564. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17565. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17566. }
  17567. getGanZiImg() {
  17568. let index = DataMgr.getCurBallRod();
  17569. let data = cfgTable.ballrodData[index + 1];
  17570. let gan_url = xGame.common.getGameIconUrl(data.img);
  17571. console.log('zh:getGanZiImg gan_url==' + gan_url);
  17572. this.ui.powerNode.showImg.url = gan_url;
  17573. console.log('zh:修改杆子图标O K');
  17574. }
  17575. returnHome() {
  17576. let tips = "Are you sure to exit the game?";
  17577. let woman = "Boss, why don't you play for a while longer?";
  17578. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17579. }
  17580. addRodMethodClick() {
  17581. if (this.isTurnSelf()) {
  17582. xGame.uiMgr.Show(UIRodMethod$1);
  17583. }
  17584. }
  17585. clickHelpLineBtn(force = false) {
  17586. if (!this.isTurnSelf())
  17587. return;
  17588. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17589. if (success) {
  17590. xGame.common.longHelpLine = true;
  17591. xGame.common.d2World.getHelpLine();
  17592. Moyu.sendDataEvent("guideNum");
  17593. }
  17594. else {
  17595. }
  17596. });
  17597. }
  17598. renderSelfDisplayBalls(index, target) {
  17599. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17600. target.myImg.url = xGame.common.getGameIconUrl(str);
  17601. }
  17602. renderAIDisplayBalls(index, target) {
  17603. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17604. target.myImg.url = xGame.common.getGameIconUrl(str);
  17605. ;
  17606. }
  17607. updateMode() {
  17608. if (xGame.common.gameMode == GameMode.classic) {
  17609. this.ui.topNode.scoreNode.visible = false;
  17610. }
  17611. else if (xGame.common.gameMode == GameMode.bigMove) {
  17612. this.ui.topNode.scoreNode.visible = true;
  17613. }
  17614. }
  17615. show() {
  17616. super.show();
  17617. console.log("zh:uigame show AADD");
  17618. this.ui.alpha = 0;
  17619. this.updateSelf();
  17620. xGame.common.gameMgr.gamePause = false;
  17621. xGame.common.gameUI.ui.blackAni.visible = false;
  17622. xGame.common.gameUI.ui.whiteAni.visible = false;
  17623. this.ui.powerEft.visible = false;
  17624. this.ui.colorNode.visible = false;
  17625. this.updateHead();
  17626. let curUse = DataMgr.getCurBallRod();
  17627. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  17628. this.getGanZiImg();
  17629. }
  17630. updateSelf() {
  17631. if (xGame.common.gameMode == GameMode.classic) {
  17632. this.ui.c1.selectedIndex = 0;
  17633. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17634. this.ui.topNode.middleNode.visible = true;
  17635. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17636. }
  17637. else if (xGame.common.gameMode == GameMode.bigMove) {
  17638. this.ui.c1.selectedIndex = 0;
  17639. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17640. this.ui.topNode.middleNode.visible = false;
  17641. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17642. let rand = xGame.common.randomNum(1, max);
  17643. let guide = DataMgr.getSkillGuide();
  17644. if (guide == 0)
  17645. rand = 1;
  17646. xGame.common.bigMoveLevelIndex = rand;
  17647. }
  17648. else if (xGame.common.gameMode == GameMode.placeBall) {
  17649. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17650. this.ui.c1.selectedIndex = 1 + data.type;
  17651. this.ui.alpha = 1;
  17652. this.startGame();
  17653. }
  17654. this.updateMode();
  17655. this.initD3world();
  17656. this.initD2world();
  17657. }
  17658. startGame() {
  17659. this.ui.snowNode.visible = Math.random() <= 0.1;
  17660. this.ui.d2Node.visible = false;
  17661. xGame.common.d3World.d3Hand.gameObj.active = false;
  17662. xGame.common.d3World.tableSrc.init();
  17663. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17664. this.cameraViewChange(() => {
  17665. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17666. switch (xGame.common.gameMode) {
  17667. case GameMode.classic:
  17668. xGame.common.d3World.d3Hand.gameObj.active = true;
  17669. this.playPutBallD3Ani();
  17670. break;
  17671. case GameMode.bigMove:
  17672. this.enterGame();
  17673. Laya.timer.once(500, this, () => {
  17674. this.ui.topNode.middleNode.visible = true;
  17675. this.ui.topNode.middleNode.t0.play();
  17676. });
  17677. break;
  17678. case GameMode.placeBall:
  17679. this.enterGame();
  17680. break;
  17681. default:
  17682. break;
  17683. }
  17684. });
  17685. PlatMgr.showBanner(false);
  17686. }
  17687. enterGame() {
  17688. this.ui.d2Node.visible = true;
  17689. xGame.common.d3World.d3Hand.gameObj.active = false;
  17690. xGame.common.showOneCamera("mainCamera");
  17691. Moyu.recordGame(30, true);
  17692. if (!this.isPrePlay) {
  17693. this.isPrePlay = true;
  17694. xGame.common.d3World.prePlayEft();
  17695. }
  17696. xGame.common.gameMgr.gameReady();
  17697. this.openAllEvent();
  17698. this.ui.snowNode.visible = false;
  17699. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17700. this.ui.helpBtn.visible = condition;
  17701. }
  17702. showHelpLineGuide() {
  17703. let longGuide = DataMgr.getGuideHelpLine();
  17704. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17705. this.ui.helpBtn.visible = true;
  17706. this.ui.guideNode.visible = true;
  17707. }
  17708. }
  17709. setTurnAlpha(alpha) {
  17710. this.ui.keduNode.alpha = alpha;
  17711. this.ui.ganNode.alpha = alpha;
  17712. this.ui.rodMethodNode.alpha = alpha;
  17713. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17714. }
  17715. cameraViewChange(callback) {
  17716. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17717. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17718. xGame.common.showOneCamera("visitAngle");
  17719. cameraSrc.localRotationEulerY = 180;
  17720. cameraSrc.localRotationEulerZ = 0;
  17721. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17722. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17723. callback && callback();
  17724. }));
  17725. }));
  17726. }
  17727. playPutBallD3Ani() {
  17728. xGame.common.showOneCamera("mainCamera");
  17729. let handSrc = xGame.common.d3World.d3Hand;
  17730. handSrc.gameObj.active = true;
  17731. handSrc.transform.localPositionZ = 3;
  17732. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17733. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17734. handSrc.gameObj.active = false;
  17735. this.enterGame();
  17736. }), 400);
  17737. }));
  17738. }
  17739. updateHead() {
  17740. let user = Moyu.getUserInfo();
  17741. this.ui.topNode.selfNameTxt.text = user.nickName;
  17742. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17743. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17744. if (DataMgr.getSkillGuide() < 1) {
  17745. this.ui.topNode.aiNameTxt.text = 'billiards';
  17746. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17747. }
  17748. else {
  17749. this.ui.topNode.aiNameTxt.text = aiData.name;
  17750. let randNo = Math.floor(Math.random() * 10) + 1;
  17751. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17752. }
  17753. }
  17754. initD2world() {
  17755. let node = this.ui.d2Root.displayObject;
  17756. let src = node.getComponent(D2World);
  17757. if (!src) {
  17758. xGame.common.d2World = node.addComponent(D2World);
  17759. }
  17760. xGame.common.d2World.initSelf();
  17761. }
  17762. initD3world() {
  17763. if (this.isD3Inited)
  17764. return;
  17765. this.isD3Inited = true;
  17766. let scene3D = xGame.common.d3Scene;
  17767. this.ui.d3Root.displayObject.addChild(scene3D);
  17768. scene3D.active = true;
  17769. xGame.common.d3World.tableSrc.setBorderPos();
  17770. }
  17771. onRootMove(e) {
  17772. let rootBall = xGame.common.d2World.rootBall;
  17773. this.ui.moveNode.x = e.x;
  17774. this.ui.moveNode.y = e.y;
  17775. rootBall.gameObj.x = e.x;
  17776. rootBall.gameObj.y = e.y;
  17777. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17778. }
  17779. aiRootMove(move) {
  17780. if (move)
  17781. this.hideBallUI();
  17782. else {
  17783. this.showBallUI();
  17784. xGame.common.d2World.getHelpLine();
  17785. }
  17786. }
  17787. aiForce(type, force = 0) {
  17788. this.pressTarget = PressType.powerNode;
  17789. if (type == 1)
  17790. this.onEventUp({ force: true });
  17791. else if (type == 2)
  17792. this.onEventMove({ stageY: force, force: true });
  17793. }
  17794. onEventPress(e) {
  17795. if (e.stopPropagation)
  17796. e.stopPropagation();
  17797. if (!this.isTurnSelf())
  17798. return;
  17799. let target = e.target;
  17800. switch (target) {
  17801. case this.ui.myPowerNode.displayObject:
  17802. this.pressTarget = PressType.powerNode;
  17803. this.barInfo.curY = e.stageY;
  17804. this.updateBarInfo();
  17805. break;
  17806. case this.ui.moveNode.displayObject:
  17807. this.pressTarget = PressType.moveNode;
  17808. this.hideBallUI();
  17809. this.eventObj.curX = this.ui.moveNode.x;
  17810. this.eventObj.curY = this.ui.moveNode.y;
  17811. this.ui.moveNode.finger.visible = false;
  17812. this.eventObj.lastX = e.stageX;
  17813. this.eventObj.lastY = e.stageY;
  17814. break;
  17815. case this.ui.rulerClickNode.displayObject:
  17816. this.pressTarget = PressType.rulerNode;
  17817. this.eventObj.lastY = e.stageY;
  17818. break;
  17819. case this.ui.d2Root.displayObject:
  17820. this.pressTarget = PressType.d2Root;
  17821. this.eventObj.lastX = e.stageX;
  17822. this.eventObj.lastY = e.stageY;
  17823. this.eventObj.starX = e.stageX;
  17824. this.eventObj.starY = e.stageY;
  17825. this.eventObj.curX = 0;
  17826. this.eventObj.curY = 0;
  17827. xGame.common.d2World.d2Gan.setGanLastInfo();
  17828. this.rulerOffset = 0;
  17829. break;
  17830. default:
  17831. break;
  17832. }
  17833. }
  17834. onEventMove(e) {
  17835. if (e.stopPropagation)
  17836. e.stopPropagation();
  17837. if (e && e.force) {
  17838. }
  17839. else {
  17840. if (!this.isTurnSelf())
  17841. return;
  17842. }
  17843. switch (this.pressTarget) {
  17844. case PressType.powerNode:
  17845. this.barInfo.curY = e.stageY;
  17846. this.updateBarInfo();
  17847. this.isMoveRod = true;
  17848. break;
  17849. case PressType.moveNode:
  17850. let rootBall = xGame.common.d2World.rootBall;
  17851. let radius = rootBall.gameObj.width / 2;
  17852. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17853. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17854. let border = xGame.common.d2World.borderRect;
  17855. if (curX <= border.x + radius)
  17856. curX = border.x + radius;
  17857. else if (curX >= border.x + border.width - radius)
  17858. curX = border.x + border.width - radius;
  17859. if (curY <= border.y + radius)
  17860. curY = border.y + radius;
  17861. else if (curY >= border.y + border.height - radius)
  17862. curY = border.y + border.height - radius;
  17863. if (xGame.common.gameMgr.isOpenBall) {
  17864. if (curX >= border.x + border.openBallW - radius)
  17865. curX = border.x + border.openBallW - radius;
  17866. }
  17867. this.ui.moveNode.x = curX;
  17868. this.ui.moveNode.y = curY;
  17869. rootBall.gameObj.x = curX;
  17870. rootBall.gameObj.y = curY;
  17871. rootBall.d3BallSrc.setTransPos(curX, curY);
  17872. this.isMoveRod = true;
  17873. break;
  17874. case PressType.rulerNode:
  17875. let yy = e.stageY - this.eventObj.lastY;
  17876. this.eventObj.lastY = e.stageY;
  17877. let ruler1 = this.ui.rulerNode.img1;
  17878. let ruler2 = this.ui.rulerNode.img2;
  17879. ruler1.y += yy;
  17880. ruler2.y += yy;
  17881. this.rulerOffset += yy;
  17882. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17883. this.rulerOffset = 0;
  17884. xGame.soundMgr.playSound("inch", 1, 10);
  17885. }
  17886. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17887. let h = ruler1.height;
  17888. this.checkGuide();
  17889. this.isMoveRod = true;
  17890. if (ruler1.y >= h) {
  17891. ruler1.y = -h;
  17892. ruler2.y = 0;
  17893. return;
  17894. }
  17895. else if (ruler1.y <= -h) {
  17896. ruler1.y = h;
  17897. ruler2.y = 0;
  17898. return;
  17899. }
  17900. if (ruler2.y >= h) {
  17901. ruler2.y = -h;
  17902. ruler1.y = 0;
  17903. return;
  17904. }
  17905. else if (ruler2.y <= -h) {
  17906. ruler2.y = h;
  17907. ruler1.y = 0;
  17908. return;
  17909. }
  17910. break;
  17911. case PressType.d2Root:
  17912. this.eventObj.curX = e.stageX;
  17913. this.eventObj.curY = e.stageY;
  17914. let offset = this.checkRodMoveDir();
  17915. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17916. this.eventObj.lastX = e.stageX;
  17917. this.eventObj.lastY = e.stageY;
  17918. break;
  17919. default:
  17920. break;
  17921. }
  17922. }
  17923. onEventUp(e) {
  17924. if (e.stopPropagation)
  17925. e.stopPropagation();
  17926. if (e && e.force) {
  17927. }
  17928. else {
  17929. if (!this.isTurnSelf())
  17930. return;
  17931. }
  17932. switch (this.pressTarget) {
  17933. case PressType.powerNode:
  17934. this.ui.powerNode.value = 0;
  17935. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17936. this.ui.powerTxt.text = "";
  17937. if (this.powerNum > 0) {
  17938. xGame.eventMgr.event(BALL_SHOOT);
  17939. xGame.common.d2World.shoot(this.powerNum);
  17940. xGame.common.d2World.d2Gan.shoot();
  17941. xGame.common.d2World.d2HelpLine.shoot();
  17942. this.finishGuide();
  17943. this.ui.powerEft.visible = false;
  17944. this.ui.colorNode.visible = false;
  17945. let ganStr = "";
  17946. if (this.powerNum <= 30) {
  17947. ganStr = "gan_30";
  17948. }
  17949. else if (this.powerNum <= 60) {
  17950. ganStr = "gan_50";
  17951. }
  17952. else {
  17953. ganStr = "gan_80";
  17954. }
  17955. xGame.soundMgr.playSound(ganStr);
  17956. }
  17957. break;
  17958. case PressType.moveNode:
  17959. let rootBall = xGame.common.d2World.rootBall;
  17960. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17961. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17962. let isIntersect = this.judgeBallIntersect();
  17963. if (isIntersect) {
  17964. this.ui.moveNode.x = lastX;
  17965. this.ui.moveNode.y = lastY;
  17966. rootBall.gameObj.x = lastX;
  17967. rootBall.gameObj.y = lastY;
  17968. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17969. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17970. }
  17971. else {
  17972. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17973. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17974. }
  17975. this.showBallUI();
  17976. this.ui.moveNode.finger.visible = true;
  17977. xGame.common.d2World.getHelpLine();
  17978. break;
  17979. case PressType.rulerNode:
  17980. break;
  17981. case PressType.d2Root:
  17982. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17983. if (dis <= 25) {
  17984. this.moveToClickDot(e);
  17985. }
  17986. break;
  17987. default:
  17988. break;
  17989. }
  17990. this.pressTarget = -1;
  17991. }
  17992. checkGuide() {
  17993. let guide = DataMgr.getSkillGuide();
  17994. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17995. xGame.common.guideStep++;
  17996. xGame.common.gameUI.ui.guide2.visible = false;
  17997. xGame.common.gameUI.ui.guide3.visible = true;
  17998. }
  17999. }
  18000. finishGuide() {
  18001. let guide = DataMgr.getSkillGuide();
  18002. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  18003. xGame.common.guideStep = 10;
  18004. this.closeAllGuide();
  18005. }
  18006. }
  18007. closeAllGuide() {
  18008. xGame.common.gameUI.ui.guide1.visible = false;
  18009. xGame.common.gameUI.ui.guide2.visible = false;
  18010. xGame.common.gameUI.ui.guide3.visible = false;
  18011. }
  18012. updateBarInfo() {
  18013. let star = this.ui.powerNode.y;
  18014. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  18015. if (rate >= 1)
  18016. rate = 1;
  18017. if (rate <= 0)
  18018. rate = 0;
  18019. this.powerNum = Math.ceil(rate * 100);
  18020. this.ui.powerNode.value = this.powerNum;
  18021. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  18022. this.ui.colorNode.value = this.powerNum;
  18023. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  18024. this.ui.powerEft.visible = this.powerNum != 0;
  18025. this.ui.colorNode.visible = this.powerNum != 0;
  18026. this.ui.powerTxt.text = this.powerNum + "";
  18027. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  18028. }
  18029. forceCancel() {
  18030. this.ui.powerNode.value = 0;
  18031. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18032. this.ui.powerTxt.text = "";
  18033. }
  18034. checkRodMoveDir() {
  18035. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  18036. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  18037. if (tempX >= 0 && tempY <= 0) {
  18038. return this.checkDir();
  18039. }
  18040. else if (tempX < 0 && tempY < 0) {
  18041. return this.checkDir(1, -1);
  18042. }
  18043. else if (tempX < 0 && tempY > 0) {
  18044. return this.checkDir(-1, -1);
  18045. }
  18046. else {
  18047. return this.checkDir(-1, 1);
  18048. }
  18049. }
  18050. checkDir(flagX = 1, flagY = 1) {
  18051. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  18052. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  18053. if (offsetY == 0) {
  18054. return offsetX * flagX;
  18055. }
  18056. if (offsetX == 0) {
  18057. return offsetY * flagY;
  18058. }
  18059. let angle = offsetY / offsetX;
  18060. if (Math.abs(angle) >= 1) {
  18061. return offsetY * flagY;
  18062. }
  18063. else {
  18064. return offsetX * flagX;
  18065. }
  18066. }
  18067. judgeBallIntersect() {
  18068. let rootBall = xGame.common.d2World.rootBall;
  18069. let ballArr = xGame.common.d2World.ballArr;
  18070. let radius = rootBall.gameObj.width / 2;
  18071. let temp;
  18072. let isIntersect = false;
  18073. for (let index = 0; index < ballArr.length; index++) {
  18074. temp = ballArr[index];
  18075. if (temp.number == rootBall.number)
  18076. continue;
  18077. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  18078. if (isIntersect) {
  18079. break;
  18080. }
  18081. }
  18082. return isIntersect;
  18083. }
  18084. hideBallUI() {
  18085. let d2Gan = xGame.common.d2World.d2Gan;
  18086. if (!d2Gan.ui.isDisposed)
  18087. d2Gan.ui.visible = false;
  18088. let d2Help = xGame.common.d2World.d2HelpLine;
  18089. if (!d2Help.ui.isDisposed)
  18090. d2Help.ui.visible = false;
  18091. let rootBall = xGame.common.d2World.rootBall;
  18092. if (!rootBall.destroyed) {
  18093. rootBall.gameObj.active = false;
  18094. }
  18095. }
  18096. showBallUI() {
  18097. let d2Gan = xGame.common.d2World.d2Gan;
  18098. if (!d2Gan.ui.isDisposed)
  18099. d2Gan.ui.visible = true;
  18100. let d2Help = xGame.common.d2World.d2HelpLine;
  18101. if (!d2Help.ui.isDisposed)
  18102. d2Help.ui.visible = true;
  18103. let rootBall = xGame.common.d2World.rootBall;
  18104. if (!rootBall.destroyed) {
  18105. rootBall.gameObj.active = true;
  18106. }
  18107. }
  18108. moveToClickDot(e) {
  18109. if (!this.isMoveRod && !xGame.common.clickedBall) {
  18110. let root = xGame.common.d2World.rootBall.gameObj;
  18111. let xx = e.stageX - xGame.common.sysOffestNum;
  18112. let yy = e.stageY;
  18113. let x = xx - root.x;
  18114. let y = yy - root.y;
  18115. let angle = xGame.common.getfguiRotation(x, y);
  18116. xGame.common.d2World.d2Gan.ui.rotation = angle;
  18117. xGame.common.d2World.getHelpLine();
  18118. }
  18119. this.isMoveRod = false;
  18120. xGame.common.clickedBall = false;
  18121. }
  18122. openAllEvent() {
  18123. this.closeAllEvent();
  18124. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18125. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18126. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18127. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18128. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18129. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18130. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18131. }
  18132. closeAllEvent() {
  18133. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18134. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18135. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18136. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18137. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18138. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18139. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18140. }
  18141. resetGame() {
  18142. this.closeAllEvent();
  18143. this.hideBallUI();
  18144. xGame.common.gameMgr.gamePause = true;
  18145. }
  18146. }
  18147. UIGame$1.uiName = "UIGame";
  18148. class UIAddCoin$1 extends UIBase {
  18149. constructor() {
  18150. super();
  18151. this.coinNum = 2000;
  18152. }
  18153. onConstructor() {
  18154. this.ui = ui_UIAddCoin.createInstance();
  18155. this.contentPane = this.ui;
  18156. this.isEject = false;
  18157. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18158. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  18159. }
  18160. show() {
  18161. super.show();
  18162. this.ui.t0.play();
  18163. }
  18164. videoAddCoin() {
  18165. console.log('zh:qjff_AD_for_UIAddCoin');
  18166. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  18167. }
  18168. else {
  18169. console.log('zh:AD 失败,直接发放奖励');
  18170. this.qjff_AD_for_UIAddCoin();
  18171. }
  18172. }
  18173. qjff_AD_for_UIAddCoin() {
  18174. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  18175. this.hide();
  18176. }
  18177. }
  18178. UIAddCoin$1.uiName = "UIAddCoin";
  18179. class UIInvitation$1 extends UIBase {
  18180. constructor() {
  18181. super();
  18182. }
  18183. onConstructor() {
  18184. this.ui = ui_UIInvitation.createInstance();
  18185. this.contentPane = this.ui;
  18186. this.isEject = false;
  18187. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  18188. }
  18189. show() {
  18190. super.show();
  18191. }
  18192. enterGame() {
  18193. xGame.common.gameMode = GameMode.classic;
  18194. DataMgr.setChallengeTimes(1);
  18195. xGame.common.passAwardCoin = 2000;
  18196. let need = xGame.common.classicNiceNeddCoin;
  18197. if (DataMgr.coinEnough(need)) {
  18198. DataMgr.setCoin(-need);
  18199. xGame.eventMgr.event(RESTART_GAME, true);
  18200. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  18201. }
  18202. else {
  18203. xGame.eventMgr.event(RESTART_GAME, true);
  18204. }
  18205. this.hide();
  18206. }
  18207. hide() {
  18208. super.hide();
  18209. }
  18210. }
  18211. UIInvitation$1.uiName = "UIInvitation";
  18212. class UIPower$1 extends UIBase {
  18213. constructor() {
  18214. super();
  18215. }
  18216. onConstructor() {
  18217. this.ui = ui_UIPower.createInstance();
  18218. this.contentPane = this.ui;
  18219. this.isEject = false;
  18220. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18221. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  18222. }
  18223. show() {
  18224. super.show();
  18225. this.ui.t0.play();
  18226. }
  18227. videoGetPower() {
  18228. console.log('zh:qjff_AD_for_uipower');
  18229. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  18230. }
  18231. else {
  18232. console.log('zh:AD 失败,直接发放奖励');
  18233. this.qjff_AD_for_uipower();
  18234. }
  18235. }
  18236. qjff_AD_for_uipower() {
  18237. DataMgr.setPower(xGame.common.videoPower, true);
  18238. xGame.eventMgr.event(POWER_TIME);
  18239. this.hide();
  18240. }
  18241. }
  18242. UIPower$1.uiName = "UIPower";
  18243. class UIGameEnd$1 extends UIBase {
  18244. constructor() {
  18245. super();
  18246. this.success = false;
  18247. this.awardCoinNum = 1000;
  18248. this.awardDiamondNum = 10;
  18249. }
  18250. onConstructor() {
  18251. this.ui = ui_UIGameEnd.createInstance();
  18252. this.contentPane = this.ui;
  18253. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  18254. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  18255. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  18256. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18257. this.ui.talkNode.visible = false;
  18258. if (Moyu.isKs)
  18259. this.ui.closeNode.closeBtn.x += 100;
  18260. }
  18261. updateType() {
  18262. switch (xGame.common.gameMode) {
  18263. case GameMode.classic:
  18264. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18265. this.ui.coinNode.visible = this.success;
  18266. if (!this.success) {
  18267. Laya.timer.once(500, this, () => {
  18268. xGame.uiMgr.Show(UIAddCoin$1);
  18269. });
  18270. }
  18271. this.ui.isGetAward.visible = false;
  18272. this.ui.leftBtn.c1.selectedIndex = 3;
  18273. this.ui.rightBtn.c1.selectedIndex = 0;
  18274. this.moneyNode.ui.c1.selectedIndex = 1;
  18275. break;
  18276. case GameMode.bigMove:
  18277. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18278. this.ui.coinNode.visible = this.success;
  18279. if (xGame.common.gameMode == GameMode.bigMove) {
  18280. if (this.success) {
  18281. DataMgr.setSkillSuccessTimes(1, true);
  18282. DataMgr.setSkillAccTimes(1);
  18283. }
  18284. else {
  18285. DataMgr.setSkillSuccessTimes(0, false);
  18286. }
  18287. }
  18288. if (!this.success) {
  18289. Laya.timer.once(500, this, () => {
  18290. xGame.uiMgr.Show(UIAddCoin$1);
  18291. });
  18292. }
  18293. this.ui.isGetAward.visible = false;
  18294. this.ui.leftBtn.c1.selectedIndex = 3;
  18295. this.ui.rightBtn.c1.selectedIndex = 0;
  18296. this.moneyNode.ui.c1.selectedIndex = 1;
  18297. break;
  18298. case GameMode.placeBall:
  18299. this.ui.coinNode.visible = false;
  18300. if (this.success) {
  18301. if (xGame.common.placeBallStarNum == 3) {
  18302. this.ui.c1.selectedIndex = 2;
  18303. }
  18304. else {
  18305. this.ui.c1.selectedIndex = 3;
  18306. }
  18307. }
  18308. else {
  18309. this.ui.c1.selectedIndex = 4;
  18310. }
  18311. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18312. if (cfg.type == PlaceBallType.challenge) {
  18313. this.ui.c1.selectedIndex = 2;
  18314. }
  18315. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  18316. this.updatePlaceBallBtn();
  18317. this.updatePlaceBallStarNum();
  18318. this.updatePlaceBallAwardState();
  18319. this.moneyNode.ui.c1.selectedIndex = 2;
  18320. this.moneyNode.checkPowerTime();
  18321. this.moneyNode.powerChange();
  18322. DataMgr.upRankData();
  18323. break;
  18324. default:
  18325. break;
  18326. }
  18327. }
  18328. updatePlaceBallBtn() {
  18329. this.ui.leftBtn.c1.selectedIndex = 5;
  18330. if (this.success) {
  18331. this.ui.rightBtn.c1.selectedIndex = 14;
  18332. }
  18333. else {
  18334. if (xGame.common.placeBallStarNum == 3) {
  18335. this.ui.rightBtn.c1.selectedIndex = 14;
  18336. }
  18337. else {
  18338. this.ui.rightBtn.c1.selectedIndex = 1;
  18339. }
  18340. }
  18341. }
  18342. updatePlaceBallStarNum() {
  18343. let starNum = xGame.common.placeBallStarNum;
  18344. if (starNum == 0)
  18345. this.ui.starNumNode.c1.selectedIndex = 3;
  18346. else {
  18347. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18348. }
  18349. }
  18350. updatePlaceBallAwardState() {
  18351. let level = xGame.common.placeBallCurLevel;
  18352. let starNum = xGame.common.placeBallStarNum;
  18353. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18354. let data = cfgTable.placeballData[level].award;
  18355. let cfg = cfgTable.placeballData[level];
  18356. this.awardDiamondNum = data[1];
  18357. this.awardCoinNum = data[0];
  18358. if (cfg.type == PlaceBallType.challenge) {
  18359. this.awardDiamondNum = 0;
  18360. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18361. }
  18362. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18363. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18364. if (cfg.type == PlaceBallType.challenge) {
  18365. this.ui.awardNode.coinNode.visible = true;
  18366. }
  18367. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18368. this.ui.awardNode.diamondNode.x = 265;
  18369. this.ui.awardNode.coinNode.x = 354;
  18370. }
  18371. else {
  18372. this.ui.awardNode.diamondNode.x = 291;
  18373. this.ui.awardNode.coinNode.x = 291;
  18374. }
  18375. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18376. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18377. if (this.awardCoinNum == 0) {
  18378. this.ui.awardNode.coinNode.numTxt.text = "";
  18379. }
  18380. if (getAward) {
  18381. this.ui.isGetAward.visible = true;
  18382. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18383. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18384. }
  18385. else {
  18386. this.ui.isGetAward.visible = false;
  18387. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18388. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18389. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18390. }
  18391. else {
  18392. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18393. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18394. }
  18395. }
  18396. }
  18397. show(success) {
  18398. super.show();
  18399. xGame.eventMgr.event(RESET_GAME);
  18400. this.success = success;
  18401. Laya.timer.clearAll(this);
  18402. this.playSecretaryAni();
  18403. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18404. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18405. offsetTime = Math.floor(offsetTime / 1000);
  18406. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18407. this.updateType();
  18408. Laya.timer.once(200, this, () => {
  18409. this.addAward(() => {
  18410. this.updateType();
  18411. Laya.timer.once(500, this, () => {
  18412. this.showChallengeLevel();
  18413. });
  18414. });
  18415. });
  18416. if (this.success) {
  18417. xGame.soundMgr.playSound('slots_roll01');
  18418. xGame.soundMgr.playSound("s_win");
  18419. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18420. }
  18421. else {
  18422. xGame.soundMgr.playSound('matchwin01');
  18423. xGame.soundMgr.playSound("s_lose");
  18424. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18425. }
  18426. if (!Moyu.isLegal)
  18427. PlatMgr.showBanner(true);
  18428. let challengeNum = DataMgr.getChallengeTimes();
  18429. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18430. DataMgr.setChallengeTimes(1);
  18431. }
  18432. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18433. DataMgr.setClassicTimes();
  18434. }
  18435. }
  18436. showChallengeLevel() {
  18437. if (DataMgr.getChallengeTimes() != 0)
  18438. return;
  18439. let skill = DataMgr.getSkillAccTimes();
  18440. let put = DataMgr.getPlaceBallLevelList().length;
  18441. if (skill >= 3 || put >= 5) {
  18442. xGame.uiMgr.Show(UIInvitation$1);
  18443. this.hide();
  18444. }
  18445. }
  18446. addAward(callback) {
  18447. if (!this.success) {
  18448. callback && callback();
  18449. return;
  18450. }
  18451. switch (xGame.common.gameMode) {
  18452. case GameMode.classic:
  18453. this.awardCoinNum = xGame.common.passAwardCoin;
  18454. this.awardDiamondNum = 0;
  18455. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18456. break;
  18457. case GameMode.bigMove:
  18458. this.awardCoinNum = xGame.common.passAwardCoin;
  18459. this.awardDiamondNum = 0;
  18460. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18461. callback && callback();
  18462. break;
  18463. case GameMode.placeBall:
  18464. let level = xGame.common.placeBallCurLevel;
  18465. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18466. if (xGame.common.placeBallStarNum != 3) {
  18467. callback && callback();
  18468. return;
  18469. }
  18470. else {
  18471. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18472. if (getAward) {
  18473. callback && callback();
  18474. return;
  18475. }
  18476. }
  18477. let cfg = cfgTable.placeballData[level];
  18478. let data = cfgTable.placeballData[level].award;
  18479. this.awardCoinNum = data[0];
  18480. this.awardDiamondNum = data[1];
  18481. if (cfg.type == PlaceBallType.challenge) {
  18482. this.awardDiamondNum = 0;
  18483. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18484. }
  18485. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18486. let diamondAward;
  18487. if (this.awardDiamondNum > 0) {
  18488. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18489. xGame.common.getAward([diamondAward, coinAward], callback);
  18490. }
  18491. else {
  18492. xGame.common.getAward([coinAward], callback);
  18493. }
  18494. if (cfg.type == PlaceBallType.normal) {
  18495. DataMgr.setPlaceBallAward(level);
  18496. }
  18497. break;
  18498. default:
  18499. break;
  18500. }
  18501. }
  18502. playSecretaryAni_old() {
  18503. let parent = this.ui.secretary.displayObject;
  18504. parent.destroyChildren();
  18505. let xx = this.ui.secretary.width / 2;
  18506. let yy = this.ui.secretary.height;
  18507. let scale = xGame.common.getSecretaryScale();
  18508. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18509. if (this.success) {
  18510. let rand = Math.random() <= 0.5 ? 2 : 3;
  18511. xGame.common.secretary.play(data, rand, false, parent, () => {
  18512. xGame.common.secretary.play(data, 1, true, parent);
  18513. });
  18514. }
  18515. else {
  18516. xGame.common.secretary.play(data, 0, true, parent);
  18517. }
  18518. }
  18519. playSecretaryAni() {
  18520. let parent = this.ui.secretary.displayObject;
  18521. parent.destroyChildren();
  18522. let xx = this.ui.secretary.width / 2;
  18523. let yy = this.ui.secretary.height;
  18524. let scale = xGame.common.getSecretaryScale();
  18525. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18526. if (this.success) {
  18527. let rand = 0;
  18528. xGame.common.secretary.play(data, 0, true, parent);
  18529. }
  18530. else {
  18531. xGame.common.secretary.play(data, 0, true, parent);
  18532. }
  18533. }
  18534. restartGame() {
  18535. switch (xGame.common.gameMode) {
  18536. case GameMode.classic:
  18537. xGame.eventMgr.event(RESTART_GAME);
  18538. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18539. break;
  18540. case GameMode.bigMove:
  18541. this.hide();
  18542. xGame.eventMgr.event(RESTART_GAME);
  18543. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18544. break;
  18545. default:
  18546. break;
  18547. }
  18548. }
  18549. hide() {
  18550. super.hide();
  18551. xGame.common.stopGirlPop(this.ui.talkNode);
  18552. PlatMgr.showBanner(false);
  18553. }
  18554. returnHome() {
  18555. this.hide();
  18556. let showFailWords = !this.success;
  18557. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18558. }
  18559. clickLeftBtn() {
  18560. switch (xGame.common.gameMode) {
  18561. case GameMode.classic:
  18562. case GameMode.bigMove:
  18563. this.returnHome();
  18564. break;
  18565. case GameMode.placeBall:
  18566. let level = xGame.common.placeBallCurLevel;
  18567. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18568. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18569. break;
  18570. default:
  18571. break;
  18572. }
  18573. }
  18574. powerStartPlaceBallLevel(level, btn) {
  18575. if (DataMgr.powerEnough()) {
  18576. btn.touchable = false;
  18577. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18578. btn.touchable = true;
  18579. DataMgr.setPower(-1);
  18580. xGame.eventMgr.event(POWER_TIME);
  18581. this.startPlaceBallLevel(level);
  18582. }));
  18583. }
  18584. else {
  18585. xGame.uiMgr.Show(UIPower$1, 0);
  18586. }
  18587. }
  18588. clickRightBtn() {
  18589. switch (xGame.common.gameMode) {
  18590. case GameMode.classic:
  18591. console.log('zh:clickRightBtn 111');
  18592. case GameMode.bigMove:
  18593. console.log('zh:clickRightBtn 222');
  18594. this.restartGame();
  18595. break;
  18596. case GameMode.placeBall:
  18597. console.log('zh:clickRightBtn 333');
  18598. let level = xGame.common.placeBallCurLevel;
  18599. let data = DataMgr.getPlaceBallLevel(level);
  18600. let curPss = data.play && !data.isCur;
  18601. if (curPss) {
  18602. console.log('zh:clickRightBtn 333-111');
  18603. console.log('zh:当前LV=' + level);
  18604. if (level == 60) {
  18605. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  18606. Laya.timer.once(3000, this, () => {
  18607. this.returnHome();
  18608. });
  18609. }
  18610. else {
  18611. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18612. }
  18613. }
  18614. else {
  18615. console.log('zh:clickRightBtn 333-000');
  18616. Moyu.sendDataEvent("placeBallNextLevel");
  18617. console.log('zh:qjff_AD_for_uiGameEnd');
  18618. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  18619. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  18620. }
  18621. else {
  18622. console.log('zh:AD 失败,直接发放奖励');
  18623. this.qjff_AD_for_uiGameEnd(level);
  18624. }
  18625. }
  18626. break;
  18627. default:
  18628. console.log('zh:clickRightBtn 444');
  18629. break;
  18630. }
  18631. }
  18632. qjff_AD_for_uiGameEnd(level) {
  18633. DataMgr.setPlaceBallLevel(level, 1);
  18634. this.startPlaceBallLevel(level + 1);
  18635. }
  18636. startPlaceBallLevel(level) {
  18637. xGame.common.gameMode = GameMode.placeBall;
  18638. xGame.common.placeBallCurLevel = level;
  18639. xGame.uiMgr.Show(UIGame$1);
  18640. this.hide();
  18641. }
  18642. }
  18643. UIGameEnd$1.uiName = "UIGameEnd";
  18644. class ShowItem$1 {
  18645. constructor() {
  18646. this.ui = ui_ShowItem.createInstance();
  18647. }
  18648. destroySelf() {
  18649. if (!this.ui.isDisposed) {
  18650. this.ui.removeFromParent();
  18651. this.ui.dispose();
  18652. }
  18653. }
  18654. setParent(parent) {
  18655. parent.addChild(this.ui);
  18656. }
  18657. setPos(x, y) {
  18658. this.ui.x = x;
  18659. this.ui.y = y;
  18660. }
  18661. setUrl(index) {
  18662. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18663. }
  18664. }
  18665. class UILevelProp$1 extends UIBase {
  18666. constructor() {
  18667. super();
  18668. this.firstPos = 385;
  18669. this.secondPos = 467;
  18670. this.showItemArr = [];
  18671. }
  18672. onFontLoaded() {
  18673. try {
  18674. this.ui.myNode.conditionTxt.font = "arial";
  18675. console.log("zh: onFontLoaded 设置arial字体成功");
  18676. }
  18677. catch (error) {
  18678. console.log("zh: constructor onFontLoaded加载arial字体失败");
  18679. }
  18680. }
  18681. onConstructor() {
  18682. this.ui = ui_UILevelProp.createInstance();
  18683. this.contentPane = this.ui;
  18684. this.isEject = false;
  18685. this.addUIClick(this.ui.closeBtn, this.hide);
  18686. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18687. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18688. }
  18689. show(level) {
  18690. super.show();
  18691. this.ui.t1.play();
  18692. this.level = level;
  18693. this.data = cfgTable.placeballData[this.level];
  18694. this.updateSelf();
  18695. this.showPreView();
  18696. this.moneyNode.ui.c1.selectedIndex = 2;
  18697. this.moneyNode.checkPowerTime();
  18698. this.moneyNode.powerChange();
  18699. }
  18700. showPreView() {
  18701. let item;
  18702. let data;
  18703. for (let index = 0; index < this.showItemArr.length; index++) {
  18704. item = this.showItemArr[index];
  18705. item.destroySelf();
  18706. }
  18707. this.showItemArr = [];
  18708. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18709. for (const key in cfgData) {
  18710. data = cfgData[key];
  18711. item = new ShowItem$1();
  18712. item.setParent(this.ui.myNode.displayRoot);
  18713. item.setPos(data.x, data.y);
  18714. item.setUrl(data.value);
  18715. this.showItemArr.push(item);
  18716. }
  18717. }
  18718. updateSelf() {
  18719. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18720. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18721. if (this.data.ball == -1) {
  18722. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18723. }
  18724. else {
  18725. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  18726. }
  18727. let localData = DataMgr.getPlaceBallLevel(this.level);
  18728. let getAward = localData.getAward;
  18729. let cfg = cfgTable.placeballData[this.level];
  18730. let coin = this.data.award[0];
  18731. let diamond = this.data.award[1];
  18732. if (cfg.type == PlaceBallType.challenge) {
  18733. diamond = 0;
  18734. coin = 100;
  18735. }
  18736. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18737. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18738. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18739. if (cfg.type == PlaceBallType.challenge) {
  18740. this.ui.myNode.coinNode.numTxt.text = "";
  18741. }
  18742. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18743. if (coin > 0 && diamond > 0) {
  18744. this.ui.myNode.diamondNode.x = 385;
  18745. this.ui.myNode.coinNode.x = 467;
  18746. }
  18747. else {
  18748. this.ui.myNode.diamondNode.x = 385;
  18749. this.ui.myNode.coinNode.x = 385;
  18750. }
  18751. if (!getAward) {
  18752. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18753. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18754. }
  18755. else {
  18756. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18757. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18758. }
  18759. }
  18760. startGame() {
  18761. if (DataMgr.powerEnough()) {
  18762. this.ui.myNode.startBtn.touchable = false;
  18763. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18764. console.log('zh:startGame ');
  18765. this.ui.myNode.startBtn.touchable = true;
  18766. DataMgr.setPower(-1);
  18767. xGame.eventMgr.event(POWER_TIME);
  18768. xGame.common.gameMode = GameMode.placeBall;
  18769. xGame.common.placeBallCurLevel = this.level;
  18770. xGame.uiMgr.Show(UIGame$1);
  18771. xGame.uiMgr.Hide(UILevelDisplay$1);
  18772. xGame.uiMgr.Hide(UIMain$1);
  18773. this.hide();
  18774. }));
  18775. }
  18776. else {
  18777. console.log('zh:startGame no power');
  18778. xGame.uiMgr.Show(UIPower$1);
  18779. }
  18780. }
  18781. hide() {
  18782. super.hide();
  18783. }
  18784. }
  18785. UILevelProp$1.uiName = "UILevelProp";
  18786. class PutBallLevelDisplay$1 {
  18787. constructor(ui, index) {
  18788. this.index = 0;
  18789. this.ui = ui;
  18790. this.index = index;
  18791. this.ui.onClick(this, this.clickSelf);
  18792. this.updateSelf();
  18793. this.ui.levelTxt.text = (this.index + 1) + "";
  18794. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18795. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18796. }
  18797. updateSelf() {
  18798. let level = this.index + 1;
  18799. this.data = DataMgr.getPlaceBallLevel(level);
  18800. this.ui.starNode.c1.selectedIndex = this.data.star;
  18801. let isChallenge = cfgTable.placeballData[level].type;
  18802. if (this.data.isCur) {
  18803. if (isChallenge) {
  18804. this.ui.c1.selectedIndex = 5;
  18805. }
  18806. else {
  18807. this.ui.c1.selectedIndex = 2;
  18808. }
  18809. }
  18810. else {
  18811. if (this.data.play) {
  18812. if (this.data.star == 3) {
  18813. this.ui.c1.selectedIndex = 0;
  18814. }
  18815. else {
  18816. this.ui.c1.selectedIndex = 1;
  18817. }
  18818. }
  18819. else {
  18820. if (isChallenge) {
  18821. this.ui.c1.selectedIndex = 4;
  18822. }
  18823. else {
  18824. this.ui.c1.selectedIndex = 3;
  18825. }
  18826. }
  18827. }
  18828. }
  18829. clickSelf() {
  18830. if (!this.data.play)
  18831. return;
  18832. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18833. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18834. }
  18835. }
  18836. class UILevelDisplay$1 extends UIBase {
  18837. constructor() {
  18838. super();
  18839. }
  18840. onConstructor() {
  18841. this.ui = ui_UILevelDisplay.createInstance();
  18842. this.contentPane = this.ui;
  18843. this.isEject = false;
  18844. this.myList = this.ui.myNode.myList;
  18845. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18846. this.levelItemArr = [];
  18847. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18848. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18849. this.myList.numItems = levelNum;
  18850. if (Moyu.isKs)
  18851. this.ui.closeNode.closeBtn.x += 100;
  18852. }
  18853. levelItemRender(index, target) {
  18854. let item = new PutBallLevelDisplay$1(target, index);
  18855. this.levelItemArr.push(item);
  18856. }
  18857. show() {
  18858. super.show();
  18859. this.updateLevel();
  18860. this.scrollToPlace();
  18861. }
  18862. updateLevel() {
  18863. let temp;
  18864. for (let index = 0; index < this.levelItemArr.length; index++) {
  18865. temp = this.levelItemArr[index];
  18866. temp.updateSelf();
  18867. }
  18868. }
  18869. scrollToPlace() {
  18870. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18871. let passArr = DataMgr.getPlaceBallLevelList();
  18872. let offest = passArr.length;
  18873. if (offest >= maxNum - 1)
  18874. offest = maxNum - 1;
  18875. this.myList.scrollToView(offest, true, true);
  18876. }
  18877. hide() {
  18878. super.hide();
  18879. }
  18880. }
  18881. UILevelDisplay$1.uiName = "UILevelDisplay";
  18882. class UIMatching$1 extends UIBase {
  18883. constructor() {
  18884. super();
  18885. }
  18886. onConstructor() {
  18887. this.ui = ui_UIMatching.createInstance();
  18888. this.contentPane = this.ui;
  18889. this.isEject = false;
  18890. }
  18891. show(callback) {
  18892. super.show();
  18893. PlatMgr.showBanner(true);
  18894. this.callback = callback;
  18895. let user = Moyu.getUserInfo();
  18896. if (!this.selfPot) {
  18897. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18898. }
  18899. if (!this.aiPot) {
  18900. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18901. }
  18902. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18903. this.ui.selfHead.nameTxt.text = user.nickName;
  18904. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18905. this.ui.aiHead.nameTxt.text = "???";
  18906. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18907. this.ui.selfHead.c1.selectedIndex = 0;
  18908. this.ui.aiHead.c1.selectedIndex = 0;
  18909. this.ui.selfHead.x = this.selfPot.x;
  18910. this.ui.selfHead.y = this.selfPot.y;
  18911. this.ui.aiHead.x = this.aiPot.x;
  18912. this.ui.aiHead.y = this.aiPot.y;
  18913. switch (xGame.common.gameMode) {
  18914. case GameMode.classic:
  18915. break;
  18916. case GameMode.bigMove:
  18917. this.initSkillData();
  18918. break;
  18919. default:
  18920. break;
  18921. }
  18922. this.ui.t1.play(Laya.Handler.create(this, () => {
  18923. this.ui.t2.play(Laya.Handler.create(this, () => {
  18924. switch (xGame.common.gameMode) {
  18925. case GameMode.classic:
  18926. this.waitingPeople();
  18927. break;
  18928. case GameMode.bigMove:
  18929. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18930. break;
  18931. default:
  18932. break;
  18933. }
  18934. }));
  18935. }));
  18936. }
  18937. initSkillData() {
  18938. this.skillSelectData = [];
  18939. let skillUrl = xGame.common.skillIconList;
  18940. let skillName = xGame.common.skillNameList;
  18941. let skillLevel = DataMgr.getBigSkillList();
  18942. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18943. for (let index = 0; index < 5; index++) {
  18944. let obj = {};
  18945. obj.skillImg = skillUrl[index];
  18946. obj.skillName = skillName[index];
  18947. obj.skillType = skillType[index];
  18948. obj.skillLevel = skillLevel[index];
  18949. this.skillSelectData.push(obj);
  18950. }
  18951. }
  18952. getAISkillLevel(myLevel) {
  18953. let video = xGame.common.upSkillLevel;
  18954. let aiLevel;
  18955. let temp;
  18956. if (video) {
  18957. temp = xGame.common.randomNum(-2, -1);
  18958. }
  18959. else {
  18960. if (myLevel <= 5) {
  18961. temp = xGame.common.randomNum(1, 3);
  18962. }
  18963. else if (myLevel <= 9) {
  18964. temp = xGame.common.randomNum(-2, 1);
  18965. }
  18966. else {
  18967. temp = xGame.common.randomNum(-4, 0);
  18968. }
  18969. }
  18970. aiLevel = temp + myLevel;
  18971. if (aiLevel <= 1)
  18972. aiLevel = 1;
  18973. if (aiLevel >= 10)
  18974. aiLevel = 10;
  18975. return aiLevel;
  18976. }
  18977. getAISkillType() {
  18978. return xGame.common.randomNum(1, 4);
  18979. let successTimes = DataMgr.getSkillSuccessTimes();
  18980. let info = cfgTable.aiskillData[successTimes];
  18981. if (!info) {
  18982. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18983. info = cfgTable.aiskillData[max];
  18984. }
  18985. let dataArr = info.skillselect;
  18986. let myCfg = {};
  18987. for (let index = 0; index < dataArr.length; index++) {
  18988. let temp = dataArr[index].split('-');
  18989. myCfg[temp[0]] = {};
  18990. myCfg[temp[0]].id = parseInt(temp[0]);
  18991. myCfg[temp[0]].weight = parseInt(temp[1]);
  18992. }
  18993. let aiCfg = xGame.common.initWeight(myCfg);
  18994. let curData = xGame.common.getRandomWeightData(aiCfg);
  18995. return parseInt(curData.id);
  18996. }
  18997. getAISkillData(index) {
  18998. let myLevel = this.skillSelectData[index].skillLevel;
  18999. let aiLevel = this.getAISkillLevel(myLevel);
  19000. let aiType = this.getAISkillType() - 1;
  19001. return { aiLevel, aiType } = { aiLevel, aiType };
  19002. }
  19003. skillSelectFinish(index) {
  19004. let aiInfo = this.getAISkillData(index);
  19005. xGame.common.gameMgr.selfCurSkill = index;
  19006. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  19007. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  19008. this.ui.selfHead.c1.selectedIndex = 1;
  19009. this.ui.aiHead.c1.selectedIndex = 1;
  19010. let myData = this.skillSelectData[index];
  19011. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  19012. let guide = DataMgr.getSkillGuide();
  19013. if (guide == 0) {
  19014. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  19015. }
  19016. else {
  19017. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  19018. }
  19019. let aiData = this.skillSelectData[aiInfo.aiType];
  19020. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  19021. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  19022. this.waitingPeople();
  19023. }
  19024. waitingPeople() {
  19025. let time = xGame.common.randomNum(1000, 3000);
  19026. time += 1000;
  19027. Laya.timer.once(time, this, () => {
  19028. this.matchingSuccess();
  19029. });
  19030. }
  19031. matchingSuccess() {
  19032. let gameUI = xGame.common.gameUI;
  19033. let name = gameUI.ui.topNode.aiNameTxt.text;
  19034. let url = gameUI.ui.topNode.aiHeadLoader.url;
  19035. this.ui.aiHead.nameTxt.text = name;
  19036. this.ui.aiHead.headImg.url = url;
  19037. name = gameUI.ui.topNode.selfNameTxt.text;
  19038. url = gameUI.ui.topNode.selfHeadLoader.url;
  19039. this.ui.selfHead.nameTxt.text = name;
  19040. this.ui.selfHead.headImg.url = url;
  19041. this.ui.t3.play(Laya.Handler.create(this, () => {
  19042. this.callback && this.callback();
  19043. this.ui.t4.play(Laya.Handler.create(this, () => {
  19044. this.destroySelf();
  19045. }));
  19046. }));
  19047. }
  19048. destroySelf() {
  19049. this.callback = null;
  19050. this.skillSelectData = null;
  19051. this.selfPot = null;
  19052. this.aiPot = null;
  19053. if (!this.ui.isDisposed) {
  19054. this.ui.removeFromParent();
  19055. this.ui.dispose();
  19056. }
  19057. xGame.uiMgr.destroyUI(this);
  19058. }
  19059. }
  19060. UIMatching$1.uiName = "UIMatching";
  19061. class SkillDisplay$1 {
  19062. constructor(ui, data, uiIndex) {
  19063. this.starX = 0;
  19064. this.starY = 0;
  19065. this.index = 0;
  19066. this.ui = ui;
  19067. this.data = data;
  19068. this.index = uiIndex;
  19069. this.initSelf();
  19070. console.log('zh:SkillDisplay constructor this.skillData=', data);
  19071. }
  19072. initSelf() {
  19073. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  19074. this.ui.nameTxt.text = this.data.name;
  19075. this.ui.describeTxt.text = this.data.describe;
  19076. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  19077. this.ui.startBtn.onClick(this, this.startGame);
  19078. this.updateSelf();
  19079. }
  19080. updateSelf() {
  19081. this.checkTry();
  19082. let level = DataMgr.getBigSkillByIndex(this.index);
  19083. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  19084. }
  19085. checkTry() {
  19086. let index = this.index;
  19087. let level = DataMgr.getBigSkillByIndex(index);
  19088. if (level == null) {
  19089. DataMgr.setBigSkill(index, 1, false);
  19090. level = 1;
  19091. }
  19092. this.ui.levelTxt.text = "LV." + level;
  19093. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  19094. this.ui.tryNode.visible = true;
  19095. else
  19096. this.ui.tryNode.visible = false;
  19097. }
  19098. clickAddLevel() {
  19099. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19100. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  19101. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  19102. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  19103. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19104. }
  19105. else {
  19106. console.log('zh:AD 失败,直接发放奖励');
  19107. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19108. }
  19109. }
  19110. qjff_AD_for_skilldisplay_clickAddLevel() {
  19111. DataMgr.setBigSkill(this.data.index, 1);
  19112. this.updateSelf();
  19113. xGame.common.upSkillLevel = true;
  19114. }
  19115. startGame() {
  19116. if (this.data.index == 3) {
  19117. alert('Coming soon!');
  19118. return;
  19119. }
  19120. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19121. let needCoin = xGame.common.bigMoveNeedCoin;
  19122. xGame.common.passAwardCoin = 2000;
  19123. let guide = DataMgr.getSkillGuide();
  19124. console.log('zh:startGame guide=' + guide);
  19125. xGame.common.temSelfLevel = 0;
  19126. if (guide == 0) {
  19127. needCoin = 0;
  19128. xGame.common.temSelfLevel = 100;
  19129. }
  19130. if (DataMgr.coinEnough(needCoin)) {
  19131. DataMgr.setCoin(-needCoin);
  19132. xGame.common.curPlayerSkillType = this.index;
  19133. if (guide == 0)
  19134. xGame.common.curPlayerSkillType = 0;
  19135. xGame.uiMgr.Show(UIGame$1);
  19136. xGame.uiMgr.Hide(UIMain$1);
  19137. xGame.uiMgr.Show(UIMatching$1, () => {
  19138. xGame.common.gameUI.ui.alpha = 1;
  19139. xGame.common.gameUI.startGame();
  19140. xGame.uiMgr.Hide(UISkill$1);
  19141. });
  19142. }
  19143. else {
  19144. xGame.uiMgr.Show(UIAddProp$1, 0);
  19145. Moyu.sendDataEvent("AddCoinVideo");
  19146. }
  19147. }
  19148. }
  19149. class UISkill$1 extends UIBase {
  19150. constructor() {
  19151. super();
  19152. this.skillData = [];
  19153. }
  19154. onConstructor() {
  19155. this.ui = ui_UISkill.createInstance();
  19156. this.contentPane = this.ui;
  19157. this.isEject = false;
  19158. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19159. this.initSkillData();
  19160. console.log('zh:aaaaaa1111111111');
  19161. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  19162. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  19163. console.log('zh:aaaaaa22222222');
  19164. this.displayList = [];
  19165. this.ui.skillNode.skillList.numItems = 3;
  19166. this.addUIClick(this.ui, this.interuptSecretary);
  19167. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  19168. this.ui.talkNode.visible = false;
  19169. if (Moyu.isKs)
  19170. this.ui.closeNode.closeBtn.x += 100;
  19171. }
  19172. show() {
  19173. super.show();
  19174. this.playSecretaryIdle();
  19175. this.moneyNode.ui.c1.selectedIndex = 1;
  19176. Laya.timer.clearAll(this);
  19177. xGame.soundMgr.playSound("s_start");
  19178. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19179. let guide = DataMgr.getSkillGuide();
  19180. this.ui.guideNode.visible = guide == 0;
  19181. let item = this.getSkillItemByUIIndex(0);
  19182. if (guide == 0) {
  19183. item.ui.c1.selectedIndex = 1;
  19184. }
  19185. else {
  19186. item.ui.c1.selectedIndex = 0;
  19187. }
  19188. this.ui.guideNode.guideBtn.visible = guide == 0;
  19189. for (let index = 0; index < this.displayList.length; index++) {
  19190. this.displayList[index].checkTry();
  19191. }
  19192. }
  19193. getSkillItemByUIIndex(cur) {
  19194. for (let index = 0; index < this.displayList.length; index++) {
  19195. if (this.displayList[index].index == cur) {
  19196. return this.displayList[index];
  19197. }
  19198. }
  19199. }
  19200. enterGuideLevel() {
  19201. let item = this.getSkillItemByUIIndex(0);
  19202. item.startGame();
  19203. if (DataMgr.getNewUser())
  19204. Moyu.sendDataEvent("gameStart1");
  19205. }
  19206. initSkillData() {
  19207. this.skillData = [];
  19208. let nameList = xGame.common.skillNameList;
  19209. let iconList = xGame.common.skillIconList;
  19210. let describeList = [
  19211. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  19212. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
  19213. "The power of frost descends—freezing the flow and taking full control of the game!"
  19214. ];
  19215. console.log('zh:initSkillData 111111111');
  19216. let data;
  19217. for (let index = 0; index < nameList.length; index++) {
  19218. data = {};
  19219. data.name = nameList[index];
  19220. data.icon = iconList[index];
  19221. data.describe = describeList[index];
  19222. data.index = index;
  19223. this.skillData.push(data);
  19224. }
  19225. }
  19226. updateSkillItem(index, target) {
  19227. if (this.displayList[index] == null) {
  19228. let uiIndex;
  19229. switch (index) {
  19230. case 0:
  19231. uiIndex = 1;
  19232. break;
  19233. case 1:
  19234. uiIndex = 0;
  19235. break;
  19236. case 2:
  19237. uiIndex = 2;
  19238. break;
  19239. case 3:
  19240. uiIndex = 3;
  19241. break;
  19242. default:
  19243. break;
  19244. }
  19245. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  19246. this.displayList.push(temp);
  19247. }
  19248. }
  19249. playSecretaryIdle() {
  19250. let parent = this.ui.secretary.displayObject;
  19251. parent.destroyChildren();
  19252. let xx = this.ui.secretary.width / 2;
  19253. let yy = this.ui.secretary.height;
  19254. let scale = xGame.common.getSecretaryScale();
  19255. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19256. xGame.common.secretary.play(data, 0, true, parent);
  19257. }
  19258. returnUIMain() {
  19259. this.hide();
  19260. xGame.common.stopGirlPop(this.ui.talkNode);
  19261. xGame.uiMgr.Show(UIMain$1);
  19262. }
  19263. interuptSecretary() {
  19264. Laya.timer.clearAll(this);
  19265. this.playSecretaryRandomSound();
  19266. }
  19267. playSecretaryRandomSound() {
  19268. if (this.isHide)
  19269. return;
  19270. let time = xGame.common.randomNum(45000, 60000);
  19271. Laya.timer.once(time, this, () => {
  19272. if (this.isHide)
  19273. return;
  19274. let index = xGame.common.randomNum(4, 7);
  19275. xGame.soundMgr.playSound("s_main0" + index);
  19276. let words = 1;
  19277. switch (index) {
  19278. case 4:
  19279. words = 5;
  19280. break;
  19281. case 5:
  19282. words = 3;
  19283. break;
  19284. case 6:
  19285. words = 6;
  19286. break;
  19287. case 7:
  19288. words = 7;
  19289. break;
  19290. default:
  19291. break;
  19292. }
  19293. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19294. this.playSecretaryRandomSound();
  19295. });
  19296. }
  19297. }
  19298. UISkill$1.uiName = "UISkill";
  19299. class UIAddProp$1 extends UIBase {
  19300. constructor() {
  19301. super();
  19302. this.curType = "";
  19303. }
  19304. onConstructor() {
  19305. this.ui = ui_UIAddProp.createInstance();
  19306. this.contentPane = this.ui;
  19307. this.isEject = false;
  19308. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19309. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  19310. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  19311. this.updateUI();
  19312. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  19313. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  19314. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  19315. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  19316. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  19317. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  19318. }
  19319. show(type) {
  19320. super.show();
  19321. this.curType = type == 0 ? "coin" : "diamond";
  19322. this.switchBtn("");
  19323. this.ui.t0.play();
  19324. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  19325. PlatMgr.showInsert(true);
  19326. }
  19327. closeSelf() {
  19328. this.hide();
  19329. }
  19330. updateUI() {
  19331. let data = cfgTable.moneyData;
  19332. let temp;
  19333. let obj;
  19334. for (const key in data) {
  19335. temp = data[key];
  19336. obj = this.ui.myNode["node" + key];
  19337. if (parseInt(key) <= 2) {
  19338. obj.diamondTxt.text = "+" + temp.num;
  19339. }
  19340. else {
  19341. obj.coinTxt.text = temp.num;
  19342. obj.diamondTxt.text = temp.get.split('_')[1];
  19343. }
  19344. }
  19345. this.updateDiamondShare();
  19346. }
  19347. updateDiamondShare() {
  19348. let data = DataMgr.getShareDiamondTimes();
  19349. if (data >= xGame.common.maxShareDiamondTimes) {
  19350. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  19351. this.ui.myNode.node1.touchable = false;
  19352. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19353. }
  19354. else {
  19355. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  19356. this.ui.myNode.node1.touchable = true;
  19357. }
  19358. }
  19359. switchBtn(type) {
  19360. if (type == "")
  19361. type = this.curType;
  19362. else {
  19363. if (this.curType == type) {
  19364. return;
  19365. }
  19366. else {
  19367. this.curType = type;
  19368. }
  19369. }
  19370. if (type == "coin") {
  19371. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  19372. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  19373. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  19374. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  19375. this.ui.myNode.c1.selectedIndex = 0;
  19376. }
  19377. else {
  19378. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  19379. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  19380. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  19381. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  19382. this.ui.myNode.c1.selectedIndex = 1;
  19383. }
  19384. }
  19385. convertCoin(index) {
  19386. let data = cfgTable.moneyData[index];
  19387. let coinNum = data.num;
  19388. let str = data.get.split('_')[1];
  19389. let needDiamond = parseInt(str);
  19390. if (DataMgr.diamondEnough(needDiamond)) {
  19391. DataMgr.setDiamond(-needDiamond);
  19392. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  19393. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  19394. }
  19395. else {
  19396. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  19397. this.switchBtn("diamond");
  19398. }
  19399. }
  19400. videoGetDiamond() {
  19401. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  19402. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  19403. }
  19404. else {
  19405. console.log('zh:AD 失败,直接发放奖励');
  19406. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  19407. }
  19408. }
  19409. qjff_AD_for_uiAddProp_videoGetDiamond() {
  19410. let num = cfgTable.moneyData[2].num;
  19411. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19412. this.closeSelf();
  19413. }
  19414. videoGetCoin() {
  19415. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  19416. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  19417. }
  19418. else {
  19419. console.log('zh:AD 失败,直接发放奖励');
  19420. this.qjff_AD_for_uiAddProp_videoGetCoin();
  19421. }
  19422. }
  19423. qjff_AD_for_uiAddProp_videoGetCoin() {
  19424. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19425. this.closeSelf();
  19426. }
  19427. shareGetDiamond() {
  19428. let times = DataMgr.getShareDiamondTimes();
  19429. if (times >= xGame.common.maxShareDiamondTimes) {
  19430. console.log('zh: 233333333333 maxShareDiamondTimes');
  19431. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19432. }
  19433. else {
  19434. console.log('zh:33333333333333ad');
  19435. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  19436. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  19437. }
  19438. else {
  19439. console.log('zh:AD 失败,直接发放奖励');
  19440. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  19441. }
  19442. }
  19443. }
  19444. qjff_AD_for_uiAddProp_shareGetDiamond() {
  19445. let diamond = xGame.common.randomNum(50, 100);
  19446. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19447. DataMgr.setShareDiamondTimes(1);
  19448. this.updateDiamondShare();
  19449. }
  19450. openPutBallView() {
  19451. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19452. let skill = xGame.uiMgr.getUI(UISkill$1);
  19453. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19454. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19455. if (end && !end.isHide) {
  19456. xGame.uiMgr.Hide(UIGameEnd$1);
  19457. xGame.uiMgr.Show(UIMain$1);
  19458. }
  19459. if (skill && !skill.isHide)
  19460. xGame.uiMgr.Hide(UISkill$1);
  19461. if (uigame && !uigame.isHide)
  19462. xGame.uiMgr.Hide(UIGame$1);
  19463. if (level && !level.isHide) {
  19464. }
  19465. else {
  19466. xGame.uiMgr.Show(UILevelDisplay$1);
  19467. }
  19468. this.closeSelf();
  19469. }
  19470. }
  19471. UIAddProp$1.uiName = "UIAddProp";
  19472. class MoneyNode$1 {
  19473. constructor(ui) {
  19474. this.leftTime = 0;
  19475. this.ui = ui;
  19476. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19477. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19478. this.ui.addPowerBtn.onClick(this, this.addPower);
  19479. this.ui.c1.selectedIndex = 1;
  19480. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19481. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19482. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19483. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19484. this.coinChange();
  19485. this.diamondChange();
  19486. this.powerChange();
  19487. }
  19488. addPower() {
  19489. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19490. xGame.uiMgr.Show(UIPower$1);
  19491. }
  19492. powerChange() {
  19493. let powerNum = DataMgr.getPower();
  19494. this.ui.powerTxt.text = powerNum + "";
  19495. }
  19496. checkPowerTime() {
  19497. let cur = new Date().getTime();
  19498. let last = DataMgr.getPowerTime();
  19499. if (last == 0) {
  19500. last = cur;
  19501. DataMgr.setPowerTime(cur);
  19502. }
  19503. let power = DataMgr.getPower();
  19504. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19505. Laya.timer.clearAll(this);
  19506. if (power >= xGame.common.natureMaxPower) {
  19507. this.ui.powerTimeTxt.text = "";
  19508. DataMgr.setPowerTime(cur);
  19509. return;
  19510. }
  19511. if (power + offset >= xGame.common.natureMaxPower) {
  19512. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19513. this.ui.powerTimeTxt.text = "";
  19514. DataMgr.setPowerTime(cur);
  19515. }
  19516. else {
  19517. if (offset > 0) {
  19518. DataMgr.setPower(offset);
  19519. DataMgr.setPowerTime(cur);
  19520. }
  19521. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19522. this.leftTime = xGame.common.powerRecoverNum - time;
  19523. if (this.leftTime <= 0)
  19524. this.leftTime = 0;
  19525. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19526. Laya.timer.loop(1000, this, this.updatePowerTime);
  19527. }
  19528. }
  19529. updatePowerTime() {
  19530. this.leftTime -= 1;
  19531. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19532. if (this.leftTime <= 0) {
  19533. this.checkPowerTime();
  19534. }
  19535. }
  19536. coinChange() {
  19537. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19538. }
  19539. diamondChange() {
  19540. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19541. }
  19542. addCoin() {
  19543. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19544. Moyu.sendDataEvent("AddCoinBtn");
  19545. xGame.uiMgr.Show(UIAddProp$1, 0);
  19546. }
  19547. addDiamond() {
  19548. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19549. Moyu.sendDataEvent("AddDiamondBtn");
  19550. xGame.uiMgr.Show(UIAddProp$1, 1);
  19551. }
  19552. }
  19553. class SettingNode$1 {
  19554. constructor(ui) {
  19555. this.showSetting = false;
  19556. this.openSound = true;
  19557. this.openShake = true;
  19558. this.ui = ui;
  19559. this.ui.soundBtn.onClick(this, this.switchSound);
  19560. this.ui.shakeBtn.onClick(this, this.switchShake);
  19561. this.ui.xyBtn.onClick(this, this.onXy);
  19562. this.ui.clickNode.onClick(this, this.changeSetting);
  19563. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19564. this.ui.xyBtn.visible = false;
  19565. this.ui.shakeBtn.visible = false;
  19566. }
  19567. changeSetting() {
  19568. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19569. this.showSetting = !this.showSetting;
  19570. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19571. }
  19572. switchSound() {
  19573. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19574. this.openSound = !this.openSound;
  19575. Moyu.onSetting(this.openSound, this.openShake);
  19576. xGame.soundMgr.onSetting(this.openSound);
  19577. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19578. }
  19579. switchShake() {
  19580. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19581. this.openShake = !this.openShake;
  19582. Moyu.onSetting(this.openSound, this.openShake);
  19583. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19584. }
  19585. onXy() {
  19586. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19587. MoyuMgr$1.showXy(1);
  19588. }
  19589. }
  19590. class UIDraw$1 extends UIBase {
  19591. constructor() {
  19592. super();
  19593. this.curKey = 0;
  19594. }
  19595. onConstructor() {
  19596. this.ui = ui_UIDraw.createInstance();
  19597. this.contentPane = this.ui;
  19598. this.isEject = false;
  19599. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19600. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19601. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19602. this.initDraw();
  19603. this.initUI();
  19604. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19605. if (Moyu.isKs)
  19606. this.ui.closeNode.closeBtn.x += 100;
  19607. }
  19608. show() {
  19609. super.show();
  19610. this.ui.t0.play();
  19611. this.playSecretaryIdle();
  19612. this.updateDraw();
  19613. this.checkFree();
  19614. if (PlatMgr.bannerDelay > 0) {
  19615. this.ui.closeNode.closeBtn.visible = false;
  19616. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19617. this.ui.closeNode.closeBtn.visible = true;
  19618. });
  19619. }
  19620. PlatMgr.showRateBanner();
  19621. }
  19622. hide() {
  19623. Laya.timer.clearAll(this);
  19624. super.hide();
  19625. }
  19626. checkFree() {
  19627. let isFree = DataMgr.getDailyfreeDrawTimes();
  19628. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19629. }
  19630. initDraw() {
  19631. this.drawObj = [];
  19632. let data = cfgTable.drawData;
  19633. let temp;
  19634. let weight = 0;
  19635. for (const key in data) {
  19636. temp = data[key];
  19637. weight += temp.weight;
  19638. this.drawObj.push(weight);
  19639. }
  19640. this.allWeight = weight;
  19641. }
  19642. initUI() {
  19643. let data = cfgTable.drawData;
  19644. let temp;
  19645. let img;
  19646. let txt;
  19647. for (const key in data) {
  19648. temp = data[key];
  19649. img = this.ui.myNode.rotNode["img" + key];
  19650. txt = this.ui.myNode.rotNode["txt" + key];
  19651. img.url = xGame.common.getGameIconUrl(temp.icon);
  19652. txt.visible = true;
  19653. if (temp.award > 2) {
  19654. img.rotation = 0;
  19655. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19656. }
  19657. else {
  19658. img.rotation = temp.rotation;
  19659. txt.text = temp.num;
  19660. }
  19661. }
  19662. }
  19663. getCurkey() {
  19664. let rand = Math.random() * this.allWeight;
  19665. let temp;
  19666. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19667. temp = this.drawObj[index];
  19668. if (index == 0) {
  19669. if (rand < temp) {
  19670. return index + 1;
  19671. }
  19672. }
  19673. else {
  19674. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19675. return index + 1;
  19676. }
  19677. }
  19678. }
  19679. return 2;
  19680. }
  19681. startDraw() {
  19682. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19683. if (freeTimes > 0) {
  19684. this.beginDraw();
  19685. DataMgr.setDailyfreeDrawTimes(0);
  19686. this.checkFree();
  19687. }
  19688. else {
  19689. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  19690. }
  19691. else {
  19692. console.log('zh:AD 失败,直接发放奖励');
  19693. this.qjff_chouJiang();
  19694. }
  19695. }
  19696. }
  19697. qjff_chouJiang() {
  19698. this.beginDraw();
  19699. }
  19700. beginDraw() {
  19701. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19702. this.ui.drawBtn.touchable = false;
  19703. this.curKey = this.getCurkey();
  19704. console.log("当前key", this.curKey);
  19705. let cell = 60;
  19706. let lap = 3;
  19707. let angle = cell * (this.curKey - 1) + lap * 360;
  19708. let target = this.ui.myNode.rotNode;
  19709. target.rotation = 0;
  19710. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19711. console.log("旋转完成");
  19712. this.ui.drawBtn.touchable = true;
  19713. this.getAward();
  19714. }));
  19715. }
  19716. getAward() {
  19717. let data = cfgTable.drawData[this.curKey];
  19718. let temp = new AwardType();
  19719. temp.type = data.award;
  19720. temp.num = data.num;
  19721. xGame.common.getAward([temp], () => {
  19722. DataMgr.setDrawTimes(1);
  19723. this.updateDraw();
  19724. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19725. });
  19726. }
  19727. updateDraw() {
  19728. let drawTimes = DataMgr.getDrawTimes();
  19729. let awardTimes = DataMgr.getDrawAwardTimes();
  19730. if (Math.floor(drawTimes / 3) > awardTimes) {
  19731. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19732. this.ui.extraNode.boxBtn.touchable = true;
  19733. this.ui.extraNode.tipsTxt.text = "3/3";
  19734. this.ui.extraNode.barNode.width = 265;
  19735. this.getExtraAward();
  19736. }
  19737. else {
  19738. this.ui.extraNode.boxBtn.t0.stop();
  19739. this.ui.extraNode.boxBtn.touchable = false;
  19740. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19741. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19742. }
  19743. let data = cfgTable.drawData[1];
  19744. if (awardTimes == 0) {
  19745. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19746. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19747. this.ui.myNode.rotNode.img1.rotation = 0;
  19748. }
  19749. else {
  19750. let award = data.nextid;
  19751. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19752. this.ui.myNode.rotNode.txt1.text = award[1];
  19753. this.ui.myNode.rotNode.img1.rotation = 0;
  19754. }
  19755. }
  19756. getExtraAward() {
  19757. let drawTimes = DataMgr.getDrawTimes();
  19758. let awardTimes = DataMgr.getDrawAwardTimes();
  19759. let data = cfgTable.drawData[1];
  19760. let award = new AwardType();
  19761. if (awardTimes == 0) {
  19762. award.num = data.num;
  19763. award.type = data.award;
  19764. xGame.common.getAward([award], () => {
  19765. let all = Math.floor(drawTimes / 3);
  19766. DataMgr.setDrawAwardTimes(all);
  19767. this.updateDraw();
  19768. });
  19769. }
  19770. else {
  19771. award.num = parseInt(data.nextid[1]);
  19772. award.type = parseInt(data.nextid[0]);
  19773. xGame.common.getAward([award], () => {
  19774. let all = Math.floor(drawTimes / 3);
  19775. DataMgr.setDrawAwardTimes(all);
  19776. this.updateDraw();
  19777. });
  19778. }
  19779. }
  19780. closeSelf() {
  19781. this.hide();
  19782. }
  19783. playSecretaryIdle() {
  19784. let parent = this.ui.secretary.displayObject;
  19785. parent.destroyChildren();
  19786. let xx = this.ui.secretary.width / 2;
  19787. let yy = this.ui.secretary.height;
  19788. let scale = xGame.common.getSecretaryScale();
  19789. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19790. xGame.common.secretary.play(data, 0, true, parent);
  19791. }
  19792. }
  19793. UIDraw$1.uiName = "UIDraw";
  19794. class UIRanking$1 extends UIBase {
  19795. constructor() {
  19796. super();
  19797. this.showSelf = true;
  19798. this.rankType = 1;
  19799. this.rankList = [];
  19800. this.myIndex = 0;
  19801. this.myStar = 0;
  19802. }
  19803. onConstructor() {
  19804. this.ui = ui_UIRanking.createInstance();
  19805. this.contentPane = this.ui;
  19806. this.isEject = false;
  19807. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19808. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19809. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19810. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19811. this.ui.myNode.myList.setVirtual();
  19812. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19813. }
  19814. show() {
  19815. super.show();
  19816. this.myIndex = 51;
  19817. Moyu.getRankList({
  19818. rankId: xGame.common.curRankID,
  19819. type: MoyuRankType.total,
  19820. page: 1,
  19821. pageSize: 50,
  19822. }, this, this.updateItemData);
  19823. this.updateSelf();
  19824. let self = Moyu.getUserInfo();
  19825. if (!self.isAuth) {
  19826. Moyu.initUser(this, () => {
  19827. DataMgr.upRankData();
  19828. });
  19829. }
  19830. }
  19831. updateSelfItem() {
  19832. let self = Moyu.getUserInfo();
  19833. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19834. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19835. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19836. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19837. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19838. }
  19839. updateItemData(data) {
  19840. this.myStar = xGame.common.getAllStarNum();
  19841. if (this.rankList.length < 2) {
  19842. this.rankList = data;
  19843. let self = Moyu.getUserInfo();
  19844. for (let i = 0; i < data.length; i++) {
  19845. let data = this.rankList[i];
  19846. if (data.userId == self.userId) {
  19847. this.rankList.splice(i, 1);
  19848. break;
  19849. }
  19850. }
  19851. for (let i = 0; i < data.length; i++) {
  19852. let data = this.rankList[i];
  19853. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19854. this.myIndex = i + 1;
  19855. let user = { headIcon: self.headIcon, nickName: "myself" };
  19856. let ud = { user: user, data: {} };
  19857. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19858. if (Moyu.platType < 11) {
  19859. user.headIcon = self.headIcon;
  19860. user.nickName = self.nickName;
  19861. }
  19862. this.rankList.splice(i, 0, md);
  19863. break;
  19864. }
  19865. }
  19866. }
  19867. this.updateSelfItem();
  19868. this.ui.myNode.myList.numItems = this.rankList.length;
  19869. }
  19870. updateItemUI(index, obj) {
  19871. let data = this.rankList[index];
  19872. let userData = JSON.parse(data.userData).user;
  19873. obj.nameTxt.text = userData.nickName.toString();
  19874. obj.valueTxt.text = data.rankScore;
  19875. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19876. obj.rankTxt.text = index + 1;
  19877. switch (index) {
  19878. case 0:
  19879. this.setImg(obj, 1, 0, 0);
  19880. obj.rankTxt.color = "#FFC047";
  19881. break;
  19882. case 1:
  19883. this.setImg(obj, 0, 1, 0);
  19884. obj.rankTxt.color = "#ACACAC";
  19885. break;
  19886. case 2:
  19887. this.setImg(obj, 0, 0, 1);
  19888. obj.rankTxt.color = "#D09672";
  19889. break;
  19890. default:
  19891. this.setImg(obj, 0, 0, 0);
  19892. obj.rankTxt.color = "#496FAB";
  19893. break;
  19894. }
  19895. }
  19896. setImg(obj, a, b, c) {
  19897. obj.img1.visible = a ? true : false;
  19898. obj.img2.visible = b ? true : false;
  19899. obj.img3.visible = c ? true : false;
  19900. }
  19901. changeList(type) {
  19902. this.rankType = type;
  19903. this.updateSelf();
  19904. }
  19905. changeSelfNode() {
  19906. this.showSelf = !this.showSelf;
  19907. this.updateSelf();
  19908. }
  19909. updateSelf() {
  19910. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19911. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19912. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19913. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19914. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19915. }
  19916. }
  19917. UIRanking$1.uiName = "UIRanking";
  19918. class UISecretary$1 extends UIBase {
  19919. constructor() {
  19920. super();
  19921. this.curIndex = 1;
  19922. }
  19923. onConstructor() {
  19924. this.ui = ui_UISecretary.createInstance();
  19925. this.contentPane = this.ui;
  19926. this.isEject = false;
  19927. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19928. this.nodeObj = { left: null, right: null, cur: null };
  19929. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19930. }
  19931. show() {
  19932. super.show();
  19933. this.ui.t0.play();
  19934. this.updateData();
  19935. }
  19936. addSecretarySpine(node, spineName) {
  19937. if (spineName == "mishu") {
  19938. if (this.secretarySpine1) {
  19939. node.displayObject.destroyChildren();
  19940. this.playWoman(this.secretarySpine1, node.displayObject);
  19941. }
  19942. else {
  19943. let spine1 = new SpineMgr("mishu", () => {
  19944. this.secretarySpine1 = spine1;
  19945. this.playWoman(this.secretarySpine1, node.displayObject);
  19946. });
  19947. }
  19948. }
  19949. else {
  19950. if (this.secretarySpine2) {
  19951. node.displayObject.destroyChildren();
  19952. this.playWoman(this.secretarySpine2, node.displayObject);
  19953. }
  19954. else {
  19955. let spine2 = new SpineMgr("xiaomishu2", () => {
  19956. this.secretarySpine2 = spine2;
  19957. this.playWoman(this.secretarySpine2, node.displayObject);
  19958. });
  19959. }
  19960. }
  19961. }
  19962. playWoman(node, parent) {
  19963. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  19964. let yy = this.ui.myNode.gameNode3.secretary.height;
  19965. let scale = 1.5;
  19966. if (node == this.secretarySpine2) {
  19967. scale = 1.2;
  19968. }
  19969. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19970. node.play(data, 0, true, parent);
  19971. }
  19972. turnLeft() {
  19973. this.curIndex--;
  19974. if (this.curIndex < 1) {
  19975. this.curIndex = 2;
  19976. }
  19977. let left = this.nodeObj.left;
  19978. let right = this.nodeObj.right;
  19979. let cur = this.nodeObj.cur;
  19980. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19981. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19982. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19983. this.updateData();
  19984. }));
  19985. this.ui.myNode.setChildIndex(right, 2);
  19986. this.nodeObj.left = cur;
  19987. this.nodeObj.right = left;
  19988. this.nodeObj.cur = right;
  19989. }
  19990. turnRight() {
  19991. this.curIndex++;
  19992. if (this.curIndex > 2) {
  19993. this.curIndex = 1;
  19994. }
  19995. let left = this.nodeObj.left;
  19996. let right = this.nodeObj.right;
  19997. let cur = this.nodeObj.cur;
  19998. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19999. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  20000. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  20001. this.updateData();
  20002. }));
  20003. this.ui.myNode.setChildIndex(left, 2);
  20004. this.nodeObj.left = right;
  20005. this.nodeObj.right = cur;
  20006. this.nodeObj.cur = left;
  20007. }
  20008. updateData() {
  20009. console.log('zh: updateData FFFFFFFFFF');
  20010. let data = cfgTable.secretaryshopData;
  20011. let children = this.ui.myNode._children;
  20012. let temp;
  20013. let curData;
  20014. for (let index = 0; index < children.length; index++) {
  20015. temp = children[index];
  20016. curData = data[1];
  20017. temp.heightTxt.text = curData.height;
  20018. temp.foodTxt.text = curData.food;
  20019. temp.historyTxt.text = curData.history;
  20020. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  20021. this.addSecretarySpine(temp.secretary, curData.spine);
  20022. let womanIndex = curData.id - 1;
  20023. let getWoman = DataMgr.getSecretary(womanIndex);
  20024. let curUse = DataMgr.getCurSecretary();
  20025. if (getWoman) {
  20026. if (curUse == womanIndex) {
  20027. temp.purchaseBtn.c1.selectedIndex = 1;
  20028. }
  20029. else {
  20030. temp.purchaseBtn.c1.selectedIndex = 2;
  20031. }
  20032. }
  20033. else {
  20034. temp.purchaseBtn.c1.selectedIndex = 0;
  20035. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  20036. }
  20037. temp.purchaseBtn.visible = false;
  20038. }
  20039. }
  20040. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  20041. console.log('zh: 点击了clickSecretary ');
  20042. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20043. if (getWoman) {
  20044. if (curUse != womanIndex) {
  20045. console.log();
  20046. DataMgr.setCurSecretary(womanIndex);
  20047. this.updateData();
  20048. }
  20049. }
  20050. else {
  20051. console.log('zh:点击购买了');
  20052. let need = needDiamond;
  20053. if (DataMgr.diamondEnough(need)) {
  20054. DataMgr.setDiamond(-need);
  20055. DataMgr.setSecretary(womanIndex, 1);
  20056. DataMgr.setCurSecretary(womanIndex);
  20057. this.updateData();
  20058. }
  20059. else {
  20060. xGame.uiMgr.Show(UIAddProp$1, 1);
  20061. }
  20062. }
  20063. }
  20064. closeSelf() {
  20065. this.hide();
  20066. }
  20067. }
  20068. UISecretary$1.uiName = "UISecretary";
  20069. class BallRodDisplay$1 {
  20070. constructor(ui, index) {
  20071. this.index = 0;
  20072. this.uiIndex = 0;
  20073. this.ui = ui;
  20074. this.index = index;
  20075. this.initData();
  20076. }
  20077. initData() {
  20078. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  20079. let data = cfgTable.ballrodData[this.index + 1];
  20080. this.ui.nameTxt.text = data.name;
  20081. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  20082. this.ui.levelNode.c1.selectedIndex = data.quality;
  20083. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  20084. if (data.spine) {
  20085. this.mySpine = new SpineMgr(data.spine, () => {
  20086. let xx = 150;
  20087. let yy = 70;
  20088. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  20089. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  20090. });
  20091. }
  20092. }
  20093. updateSelf() {
  20094. console.log('zh:updateSelf -------------- ');
  20095. let get = DataMgr.getBallRod(this.index);
  20096. if (get == null)
  20097. get = 1;
  20098. let curUse = DataMgr.getCurBallRod();
  20099. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20100. if (get) {
  20101. if (curUse == this.index) {
  20102. this.ui.purchaseBtn.c1.selectedIndex = 0;
  20103. }
  20104. else {
  20105. this.ui.purchaseBtn.c1.selectedIndex = 1;
  20106. }
  20107. }
  20108. else {
  20109. this.ui.purchaseBtn.c1.selectedIndex = 2;
  20110. }
  20111. }
  20112. buyBallRod() {
  20113. console.log('zh:buyBallRod eeeeee');
  20114. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20115. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  20116. switch (selectedIndex) {
  20117. case 0:
  20118. break;
  20119. case 1:
  20120. console.log('zh:点击了 USE THIS');
  20121. DataMgr.setCurBallRod(this.index);
  20122. let curUse = DataMgr.getCurBallRod();
  20123. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20124. let ui = xGame.uiMgr.getUI(UIShop$1);
  20125. ui.updateBallRod();
  20126. break;
  20127. case 2:
  20128. let data = cfgTable.ballrodData[this.index + 1];
  20129. let need = data.price;
  20130. if (DataMgr.diamondEnough(need)) {
  20131. DataMgr.setDiamond(-need);
  20132. DataMgr.setBallRod(this.index, 1);
  20133. DataMgr.setCurBallRod(this.index);
  20134. let ui = xGame.uiMgr.getUI(UIShop$1);
  20135. ui.updateBallRod();
  20136. }
  20137. else {
  20138. xGame.uiMgr.Show(UIAddProp$1, 1);
  20139. }
  20140. break;
  20141. default:
  20142. break;
  20143. }
  20144. }
  20145. }
  20146. class UIShop$1 extends UIBase {
  20147. constructor() {
  20148. super();
  20149. this.itemNums = 0;
  20150. }
  20151. onConstructor() {
  20152. this.ui = ui_UIShop.createInstance();
  20153. this.contentPane = this.ui;
  20154. this.isEject = false;
  20155. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20156. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20157. this.addUIClick(this.ui, this.interuptSecretary);
  20158. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  20159. this.ballRodArr = [];
  20160. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  20161. this.ui.myNode.myList.numItems = this.itemNums;
  20162. if (Moyu.isKs)
  20163. this.ui.closeNode.closeBtn.x += 100;
  20164. }
  20165. show() {
  20166. super.show();
  20167. this.playSecretaryIdle();
  20168. this.updateBallRod();
  20169. }
  20170. updateBallRod() {
  20171. for (let index = 0; index < this.ballRodArr.length; index++) {
  20172. this.ballRodArr[index].updateSelf();
  20173. }
  20174. }
  20175. renderBallRod(sort, obj) {
  20176. let index = this.getIndexBySort(sort + 1) - 1;
  20177. let ballRod = new BallRodDisplay$1(obj, index);
  20178. this.ballRodArr.push(ballRod);
  20179. }
  20180. getIndexBySort(sort) {
  20181. let object = cfgTable.ballrodData;
  20182. for (const key in object) {
  20183. if (object[key].sort == sort) {
  20184. return parseInt(key);
  20185. }
  20186. }
  20187. }
  20188. playSecretaryIdle() {
  20189. let parent = this.ui.secretary.displayObject;
  20190. parent.destroyChildren();
  20191. let xx = this.ui.secretary.width / 2;
  20192. let yy = this.ui.secretary.height;
  20193. let scale = xGame.common.getSecretaryScale();
  20194. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20195. xGame.common.secretary.play(data, 0, true, parent);
  20196. }
  20197. interuptSecretary() {
  20198. Laya.timer.clearAll(this);
  20199. this.playSecretaryRandomSound();
  20200. }
  20201. playSecretaryRandomSound() {
  20202. if (this.isHide)
  20203. return;
  20204. let time = xGame.common.randomNum(45000, 60000);
  20205. Laya.timer.once(time, this, () => {
  20206. if (this.isHide)
  20207. return;
  20208. let index = xGame.common.randomNum(4, 7);
  20209. xGame.soundMgr.playSound("s_main0" + index);
  20210. let words = 1;
  20211. switch (index) {
  20212. case 4:
  20213. words = 5;
  20214. break;
  20215. case 5:
  20216. words = 3;
  20217. break;
  20218. case 6:
  20219. words = 6;
  20220. break;
  20221. case 7:
  20222. words = 7;
  20223. break;
  20224. default:
  20225. break;
  20226. }
  20227. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20228. this.playSecretaryRandomSound();
  20229. });
  20230. }
  20231. closeSelf() {
  20232. this.hide();
  20233. }
  20234. }
  20235. UIShop$1.uiName = "UIShop";
  20236. class SignMax$1 {
  20237. constructor(ui) {
  20238. this.ui = ui;
  20239. }
  20240. updateSelf(index, sameDay, curDayIndex) {
  20241. let data = cfgTable.signData[index + 1];
  20242. this.ui.titleTxt.text = data.title;
  20243. let arr1 = data.award[0].split('-');
  20244. let arr2 = data.award[1].split('-');
  20245. let num1 = parseInt(arr1[1]);
  20246. let num2 = parseInt(arr2[1]);
  20247. this.ui.numTxt1.text = num1 + "";
  20248. this.ui.numTxt2.text = num2 + "";
  20249. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  20250. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  20251. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  20252. this.ui.numTxt1.visible = false;
  20253. }
  20254. else {
  20255. this.ui.numTxt1.visible = true;
  20256. }
  20257. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  20258. this.ui.numTxt2.visible = false;
  20259. }
  20260. else {
  20261. this.ui.numTxt2.visible = true;
  20262. }
  20263. if (index < curDayIndex) {
  20264. this.ui.c1.selectedIndex = 1;
  20265. }
  20266. else if (index == curDayIndex) {
  20267. if (sameDay) {
  20268. this.ui.c1.selectedIndex = 2;
  20269. }
  20270. else {
  20271. this.ui.c1.selectedIndex = 2;
  20272. }
  20273. }
  20274. else {
  20275. this.ui.c1.selectedIndex = 0;
  20276. }
  20277. }
  20278. }
  20279. class SignNormal$1 {
  20280. constructor(ui) {
  20281. this.ui = ui;
  20282. }
  20283. updateSelf(index, sameDay, curDayIndex) {
  20284. let data = cfgTable.signData[index + 1];
  20285. this.ui.titleTxt.text = data.title;
  20286. let arr = data.award[0].split('-');
  20287. let type = parseInt(arr[0]);
  20288. let num = parseInt(arr[1]);
  20289. this.ui.numTxt.text = num + "";
  20290. if (type > 2) {
  20291. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  20292. this.ui.myIcon.rotation = 0;
  20293. }
  20294. else {
  20295. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  20296. this.ui.myIcon.rotation = 0;
  20297. }
  20298. if (xGame.common.signAwardContainsRod(data.award)) {
  20299. this.ui.numTxt.visible = false;
  20300. }
  20301. else {
  20302. this.ui.numTxt.visible = true;
  20303. }
  20304. if (index < curDayIndex) {
  20305. this.ui.c1.selectedIndex = 1;
  20306. }
  20307. else if (index == curDayIndex) {
  20308. if (sameDay) {
  20309. this.ui.c1.selectedIndex = 2;
  20310. }
  20311. else {
  20312. this.ui.c1.selectedIndex = 2;
  20313. }
  20314. }
  20315. else {
  20316. this.ui.c1.selectedIndex = 0;
  20317. }
  20318. }
  20319. }
  20320. class UISign$1 extends UIBase {
  20321. constructor() {
  20322. super();
  20323. this.curDayIndex = 0;
  20324. this.starX = 0;
  20325. }
  20326. onConstructor() {
  20327. this.ui = ui_UISign.createInstance();
  20328. this.contentPane = this.ui;
  20329. this.isEject = false;
  20330. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20331. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20332. this.initSignItem();
  20333. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  20334. this.addUIClick(this.ui.againBtn, this.againGetAward);
  20335. }
  20336. show() {
  20337. super.show();
  20338. this.ui.t0.play();
  20339. this.playSecretaryIdle();
  20340. this.updateSign();
  20341. }
  20342. initSignItem() {
  20343. this.signArr = [];
  20344. for (let index = 0; index < 6; index++) {
  20345. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  20346. this.signArr.push(temp);
  20347. }
  20348. this.signMax = new SignMax$1(this.ui.myNode.day7);
  20349. if (Moyu.isKs)
  20350. this.ui.closeNode.closeBtn.x += 100;
  20351. }
  20352. updateSign() {
  20353. let sameDay = xGame.common.judgeSameDay();
  20354. let max = 7;
  20355. this.curDayIndex = DataMgr.getSignData();
  20356. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  20357. this.curDayIndex = 0;
  20358. if (!sameDay) {
  20359. this.ui.normalBtn.visible = true;
  20360. this.ui.tipsNode.visible = false;
  20361. this.ui.againBtn.visible = false;
  20362. }
  20363. else {
  20364. this.ui.normalBtn.visible = false;
  20365. let again = DataMgr.getExtraSign();
  20366. let isCurrency = false;
  20367. let index = this.curDayIndex;
  20368. if (index == 0)
  20369. index = 7;
  20370. let award = cfgTable.signData[index].award;
  20371. let num = award[0].split("-")[0];
  20372. if (num == "1" || num == "2")
  20373. isCurrency = true;
  20374. let showAgain = again == 0 && isCurrency;
  20375. this.ui.againBtn.visible = showAgain;
  20376. this.ui.tipsNode.visible = !showAgain;
  20377. }
  20378. for (let index = 0; index < this.signArr.length; index++) {
  20379. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  20380. }
  20381. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  20382. }
  20383. playSecretaryIdle() {
  20384. let parent = this.ui.secretary.displayObject;
  20385. parent.destroyChildren();
  20386. let xx = this.ui.secretary.width / 2;
  20387. let yy = this.ui.secretary.height;
  20388. let scale = xGame.common.getSecretaryScale();
  20389. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20390. xGame.common.secretary.play(data, 0, true, parent);
  20391. }
  20392. closeSelf() {
  20393. this.hide();
  20394. }
  20395. normalGetAward() {
  20396. let sameDay = xGame.common.judgeSameDay();
  20397. if (!sameDay) {
  20398. let award = cfgTable.signData[this.curDayIndex + 1].award;
  20399. let temp;
  20400. let type;
  20401. let num;
  20402. let arr = [];
  20403. for (let index = 0; index < award.length; index++) {
  20404. temp = award[index].split("-");
  20405. type = parseInt(temp[0]);
  20406. num = parseInt(temp[1]);
  20407. let awardType = new AwardType();
  20408. awardType.num = num;
  20409. awardType.type = type;
  20410. arr.push(awardType);
  20411. }
  20412. xGame.common.getAward(arr, (watchVideo) => {
  20413. this.curDayIndex++;
  20414. if (this.curDayIndex > 7)
  20415. this.curDayIndex = 0;
  20416. DataMgr.setSignData(this.curDayIndex);
  20417. DataMgr.setSignTime(new Date().getTime());
  20418. if (watchVideo) {
  20419. DataMgr.setExtraSign(1);
  20420. Moyu.sendDataEvent("signIn1");
  20421. }
  20422. this.updateSign();
  20423. });
  20424. }
  20425. }
  20426. againGetAward() {
  20427. Moyu.sendDataEvent("signIn2");
  20428. console.log('zh:qjff_AD_for_uisign');
  20429. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  20430. }
  20431. else {
  20432. console.log('zh:AD 失败,直接发放奖励');
  20433. this.qjff_AD_for_uisign();
  20434. }
  20435. }
  20436. qjff_AD_for_uisign() {
  20437. let index = this.curDayIndex;
  20438. if (index == 0)
  20439. index = 7;
  20440. let award = cfgTable.signData[index].award;
  20441. let temp;
  20442. let type;
  20443. let num;
  20444. for (let index = 0; index < award.length; index++) {
  20445. temp = award[index].split("-");
  20446. type = parseInt(temp[0]);
  20447. num = parseInt(temp[1]) * 3;
  20448. xGame.common.playObjFlyAnim(num, type);
  20449. }
  20450. DataMgr.setExtraSign(1);
  20451. this.updateSign();
  20452. }
  20453. }
  20454. UISign$1.uiName = "UISign";
  20455. class UIModeSelection$1 extends UIBase {
  20456. constructor() {
  20457. super();
  20458. }
  20459. onConstructor() {
  20460. this.ui = ui_UIModeSelection.createInstance();
  20461. this.contentPane = this.ui;
  20462. this.isEject = false;
  20463. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20464. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20465. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20466. this.addUIClick(this.ui.closeBtn, this.hide);
  20467. this.peopleArr = [650, 6900, 3800];
  20468. this.peopleOffest = [50, 500, 200];
  20469. this.updateSelf();
  20470. }
  20471. show(callback) {
  20472. super.show();
  20473. this.ui.t0.play();
  20474. this.callback = callback;
  20475. }
  20476. updateSelf() {
  20477. let cfg = cfgTable.modeselectData;
  20478. for (let index = 1; index <= 3; index++) {
  20479. let node = this.ui.myNode["type" + index];
  20480. node.need.text = cfg[index].need;
  20481. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20482. node.peopleTxt.text = this.getRandPeople(index - 1);
  20483. }
  20484. }
  20485. enterGame(type) {
  20486. xGame.common.classicRoomType = type;
  20487. let cfg = cfgTable.modeselectData[type];
  20488. let need = cfg.need;
  20489. xGame.common.passAwardCoin = cfg.award;
  20490. if (DataMgr.coinEnough(need)) {
  20491. DataMgr.setCoin(-need);
  20492. this.ui.myNode["type" + type].t0.play();
  20493. Laya.timer.once(200, this, () => {
  20494. this.callback && this.callback();
  20495. });
  20496. }
  20497. else {
  20498. Moyu.sendDataEvent("AddCoinVideo");
  20499. xGame.uiMgr.Show(UIAddProp$1, 0);
  20500. }
  20501. }
  20502. getRandPeople(index) {
  20503. let rand = this.peopleOffest[index];
  20504. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20505. }
  20506. }
  20507. UIModeSelection$1.uiName = "UIModeSelection";
  20508. class UITry$1 extends UIBase {
  20509. constructor() {
  20510. super();
  20511. this.closeTime = 0;
  20512. this.closeNum = 0;
  20513. this.skillUrl = xGame.common.skillIconList;
  20514. }
  20515. onConstructor() {
  20516. this.ui = ui_UITry.createInstance();
  20517. this.contentPane = this.ui;
  20518. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  20519. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  20520. }
  20521. show() {
  20522. super.show();
  20523. this.closeNum = 0;
  20524. this.closeTime = 15;
  20525. this.ui.t0.play();
  20526. PlatMgr.showRateBanner();
  20527. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20528. Laya.timer.loop(1000, this, this.updateTime);
  20529. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  20530. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  20531. xGame.common.gameMgr.gamePause = true;
  20532. }
  20533. updateTime() {
  20534. if (this.closeTime > 1) {
  20535. this.closeTime--;
  20536. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20537. }
  20538. else
  20539. this.hide();
  20540. }
  20541. hide() {
  20542. Laya.timer.clearAll(this);
  20543. Moyu.showBannerAd(false);
  20544. super.hide();
  20545. xGame.common.gameMgr.gamePause = false;
  20546. }
  20547. onTry() {
  20548. console.log('zh:qjff_AD_for_uitry');
  20549. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  20550. }
  20551. else {
  20552. console.log('zh:AD 失败,直接发放奖励');
  20553. this.qjff_AD_for_uitry();
  20554. }
  20555. }
  20556. qjff_AD_for_uitry() {
  20557. let select = xGame.common.curPlayerSkillType;
  20558. DataMgr.gameData.trySkill = select;
  20559. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  20560. DataMgr.saveGameData();
  20561. DataMgr.setBigSkill(select, 1);
  20562. xGame.showTip("Trial Successful");
  20563. this.hide();
  20564. }
  20565. onCancel() {
  20566. if (this.closeNum > 0) {
  20567. this.closeNum--;
  20568. if (this.closeNum < 2)
  20569. this.hide();
  20570. return;
  20571. }
  20572. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  20573. this.onTry();
  20574. }
  20575. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  20576. this.closeNum = 3;
  20577. }
  20578. else
  20579. this.hide();
  20580. }
  20581. }
  20582. UITry$1.uiName = "UITry";
  20583. class UIGetAward$1 extends UIBase {
  20584. constructor() {
  20585. super();
  20586. this.showTriple = true;
  20587. }
  20588. onConstructor() {
  20589. this.ui = ui_UIGetAward.createInstance();
  20590. this.contentPane = this.ui;
  20591. this.isEject = false;
  20592. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  20593. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  20594. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  20595. }
  20596. show(arr, showTriple, callback) {
  20597. super.show();
  20598. this.ui.t0.play();
  20599. this.ui.eftNode.visible = true;
  20600. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  20601. this.ui.eftNode.visible = false;
  20602. }), 1, 0, 0, 0.9);
  20603. this.awardArr = arr;
  20604. this.showTriple = showTriple;
  20605. this.callback = callback;
  20606. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  20607. this.ui.myList.numItems = arr.length;
  20608. xGame.soundMgr.playSound("getaward");
  20609. }
  20610. updateSelf(index, obj) {
  20611. let temp = this.awardArr[index];
  20612. let icon = this.getIcon(temp.type);
  20613. let str = icon;
  20614. if (temp.type > 2) {
  20615. str = "s" + icon;
  20616. }
  20617. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  20618. obj.myIcon.rotation = 0;
  20619. obj.numTxt.text = temp.num + "";
  20620. obj.numTxt.visible = temp.type > 2 ? false : true;
  20621. obj.nameTxt.text = this.getNameStr(temp.type);
  20622. }
  20623. renderItem(index, obj) {
  20624. this.updateSelf(index, obj);
  20625. }
  20626. tripleGetAward() {
  20627. console.log('zh:qjff_AD_for_uigetAward');
  20628. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  20629. }
  20630. else {
  20631. console.log('zh:AD 失败,直接发放奖励');
  20632. this.qjff_AD_for_uigetAward();
  20633. }
  20634. }
  20635. qjff_AD_for_uigetAward() {
  20636. this.getAward(3);
  20637. }
  20638. normalGetAward() {
  20639. if (PlatMgr.isMisVideo())
  20640. this.tripleGetAward();
  20641. else
  20642. this.getAward();
  20643. }
  20644. getAward(times = 1) {
  20645. this.hide();
  20646. for (let index = 0; index < this.awardArr.length; index++) {
  20647. this.awardArr[index].num *= times;
  20648. }
  20649. this.callback && this.callback(times != 1);
  20650. }
  20651. getIcon(type) {
  20652. switch (type) {
  20653. case Prop.diamond:
  20654. return "ty_zs";
  20655. case Prop.coin:
  20656. return "ty_jb";
  20657. case Prop.gan1:
  20658. return "qg1";
  20659. case Prop.gan2:
  20660. return "qg2";
  20661. case Prop.gan3:
  20662. return "qg3";
  20663. case Prop.gan4:
  20664. return "qg4";
  20665. default:
  20666. break;
  20667. }
  20668. }
  20669. getNameStr(type) {
  20670. switch (type) {
  20671. case Prop.diamond:
  20672. return "Diamond";
  20673. case Prop.coin:
  20674. return "Coins";
  20675. case Prop.gan1:
  20676. case Prop.gan2:
  20677. case Prop.gan3:
  20678. case Prop.gan4:
  20679. return cfgTable.ballrodData[type - 1].name;
  20680. default:
  20681. break;
  20682. }
  20683. }
  20684. }
  20685. UIGetAward$1.uiName = "UIGetAward";
  20686. class UIBox$1 extends UIBase {
  20687. constructor() {
  20688. super();
  20689. this.boxNum = 0;
  20690. this.boxMax = 10;
  20691. this.inAd = false;
  20692. this.isClose = false;
  20693. }
  20694. onConstructor() {
  20695. this.ui = ui_UIBox.createInstance();
  20696. this.contentPane = this.ui;
  20697. this.isEject = false;
  20698. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  20699. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  20700. Laya.timer.loop(1000, this, this.update);
  20701. }
  20702. update() {
  20703. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  20704. this.boxNum -= 1;
  20705. this.upBar();
  20706. }
  20707. }
  20708. upBar() {
  20709. if (this.boxNum > this.boxMax)
  20710. this.boxNum = this.boxMax;
  20711. this.ui.bar.value = this.boxNum * 10;
  20712. }
  20713. show() {
  20714. super.show();
  20715. this.isClose = false;
  20716. this.boxNum = 0;
  20717. this.inAd = false;
  20718. this.upBar();
  20719. this.ui.t0.play();
  20720. this.ui.closeBtn.visible = false;
  20721. Laya.timer.once(3000, this, () => {
  20722. this.ui.closeBtn.visible = true;
  20723. this.ui.bar.alpha = 1;
  20724. });
  20725. Laya.timer.once(500, this, () => {
  20726. this.ui.t1.play();
  20727. });
  20728. }
  20729. hide() {
  20730. Laya.timer.clearAll(this);
  20731. Moyu.showBannerAd(false);
  20732. super.hide();
  20733. }
  20734. onOpenBox() {
  20735. this.boxNum++;
  20736. if (this.boxNum < this.boxMax) {
  20737. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  20738. Moyu.showInsertAd(0, PlatMgr.insertGap);
  20739. }
  20740. else if (this.boxNum == this.boxMax) {
  20741. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  20742. this.ui.openBtn.c1.selectedIndex = 13;
  20743. this.inAd = true;
  20744. }
  20745. else
  20746. this.getAward();
  20747. }
  20748. else if (this.inAd) {
  20749. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  20750. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  20751. }
  20752. else {
  20753. console.log('zh:AD 失败,直接发放奖励');
  20754. this.qjff_AD_for_UIBOX_onOpenBox();
  20755. }
  20756. }
  20757. this.upBar();
  20758. }
  20759. qjff_AD_for_UIBOX_onOpenBox() {
  20760. this.getAward();
  20761. }
  20762. onCloseBox() {
  20763. if (this.isClose)
  20764. this.hide();
  20765. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  20766. this.isClose = true;
  20767. PlatMgr.showBanner(true, 0, 3000);
  20768. }
  20769. else
  20770. this.hide();
  20771. }
  20772. getAward() {
  20773. let str = "";
  20774. if (Math.random() < 0.5) {
  20775. let max = Moyu.isLegal ? 500 : 2500;
  20776. let num = xGame.tools.random(max, 500 + max);
  20777. DataMgr.setCoin(num);
  20778. str = "金币x" + num;
  20779. }
  20780. else {
  20781. let max = Moyu.isLegal ? 10 : 30;
  20782. let num = xGame.tools.random(max, 30 + max);
  20783. DataMgr.setDiamond(num);
  20784. str = "钻石x" + num;
  20785. }
  20786. xGame.showTip("恭喜获得-" + str);
  20787. this.hide();
  20788. }
  20789. }
  20790. UIBox$1.uiName = "UIBox";
  20791. class UIMain$1 extends UIBase {
  20792. constructor() {
  20793. super();
  20794. this.firstEnter = true;
  20795. }
  20796. nativeCallJs(msg) {
  20797. let t = msg;
  20798. console.log("zh: nativeCallJs 奖励开始发放:", t);
  20799. switch (t) {
  20800. case 'qjff_chouJiang':
  20801. let dui = xGame.uiMgr.getUI(UIDraw$1);
  20802. dui.qjff_chouJiang();
  20803. break;
  20804. case 'qjff_AD_for_uisign':
  20805. let dui2 = xGame.uiMgr.getUI(UISign$1);
  20806. dui2.qjff_AD_for_uisign();
  20807. break;
  20808. case 'qjff_AD_for_uitry':
  20809. let dui3 = xGame.uiMgr.getUI(UITry$1);
  20810. dui3.qjff_AD_for_uitry();
  20811. break;
  20812. case 'qjff_AD_for_uipower':
  20813. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  20814. dui4.qjff_AD_for_uipower();
  20815. break;
  20816. case 'qjff_AD_for_uigetAward':
  20817. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  20818. dui5.qjff_AD_for_uigetAward();
  20819. break;
  20820. case 'qjff_AD_for_uiGameEnd':
  20821. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  20822. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  20823. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  20824. break;
  20825. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  20826. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  20827. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  20828. break;
  20829. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  20830. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  20831. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  20832. break;
  20833. case 'qjff_AD_for_UIrepentProp_videoRegret':
  20834. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  20835. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  20836. break;
  20837. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  20838. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  20839. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  20840. break;
  20841. case 'qjff_AD_for_UIBOX_onOpenBox':
  20842. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  20843. dui11.qjff_AD_for_UIBOX_onOpenBox();
  20844. break;
  20845. case 'qjff_AD_for_UIAddCoin':
  20846. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  20847. dui12.qjff_AD_for_UIAddCoin();
  20848. break;
  20849. case '111a':
  20850. let dui14 = xGame.uiMgr.getUI(UISign$1);
  20851. dui14.qjff_AD_for_uisign();
  20852. break;
  20853. case '222a':
  20854. let dui15 = xGame.uiMgr.getUI(UISign$1);
  20855. dui15.qjff_AD_for_uisign();
  20856. break;
  20857. case '333a':
  20858. let dui16 = xGame.uiMgr.getUI(UISign$1);
  20859. dui16.qjff_AD_for_uisign();
  20860. break;
  20861. default:
  20862. console.log('zh:未知的方法名字' + t);
  20863. break;
  20864. }
  20865. }
  20866. onConstructor() {
  20867. console.log('zh: UIMain onConstructor');
  20868. this.ui = ui_UIMain.createInstance();
  20869. this.contentPane = this.ui;
  20870. this.isEject = false;
  20871. this.addEvent();
  20872. this.addClickSpine();
  20873. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20874. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20875. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20876. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20877. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20878. let curUse = DataMgr.getCurSecretary();
  20879. this.changeSecretary(curUse);
  20880. this.ui.talkNode.visible = false;
  20881. let guide = DataMgr.getSkillGuide();
  20882. if (xGame.common.isNewDay && guide == 1) {
  20883. xGame.common.isNewDay = false;
  20884. xGame.soundMgr.playSound("s_main01");
  20885. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20886. console.log("zh:播放小秘书每天语音");
  20887. }
  20888. this.ui.n83.visible = false;
  20889. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  20890. }
  20891. changeSecretary(curUse) {
  20892. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20893. xGame.common.secretary && xGame.common.secretary.dispose();
  20894. this.addSecretarySpine(name);
  20895. }
  20896. addSecretarySpine(name) {
  20897. let spine = new SpineMgr(name, () => {
  20898. this.playSecretaryIdle();
  20899. });
  20900. xGame.common.secretary = spine;
  20901. }
  20902. addClickSpine() {
  20903. let clickSpine = new SpineMgr("dianji", () => {
  20904. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20905. let parent = Laya.stage;
  20906. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20907. clickSpine.play(data, 0, false, parent, (spine) => {
  20908. spine.destroy(true);
  20909. });
  20910. });
  20911. });
  20912. }
  20913. addEvent() {
  20914. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20915. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20916. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  20917. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20918. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20919. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20920. this.addUIClick(this.ui, this.interuptSecretary);
  20921. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20922. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20923. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20924. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20925. this.addUIClick(this.ui.signBtn, this.openSignView);
  20926. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20927. this.addUIClick(this.ui.rankBtn, this.openRanking);
  20928. }
  20929. show(showFailWords) {
  20930. super.show();
  20931. this.moneyNode.ui.c1.selectedIndex = 1;
  20932. this.playSecretaryIdle();
  20933. xGame.soundMgr.playMusic("caromhall01", 0);
  20934. Laya.timer.clearAll(this);
  20935. this.playSecretaryRandomSound();
  20936. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  20937. if (showFailWords) {
  20938. console.log('zh:uimain.ts ');
  20939. setTimeout(() => {
  20940. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20941. let words = -1;
  20942. if (str == "s_main02") {
  20943. words = 2;
  20944. }
  20945. else {
  20946. words = 3;
  20947. }
  20948. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20949. xGame.soundMgr.playSound(str);
  20950. }, 300);
  20951. }
  20952. this.showGuide();
  20953. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20954. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20955. let guide = DataMgr.getSkillGuide();
  20956. if (guide == 1) {
  20957. let randTime = xGame.common.randomNum(300, 800);
  20958. if (this.firstEnter) {
  20959. this.firstEnter = false;
  20960. randTime += 900;
  20961. }
  20962. Laya.timer.once(randTime, this, () => {
  20963. xGame.common.autoPopUIView();
  20964. });
  20965. }
  20966. }
  20967. checkActive(show) {
  20968. }
  20969. showGuide() {
  20970. let guide = DataMgr.getSkillGuide();
  20971. this.ui.guideBtn.visible = guide == 0;
  20972. this.ui.enterGuide.visible = false;
  20973. this.ui.secretaryGuide.visible = guide == 0;
  20974. if (guide == 0) {
  20975. xGame.soundMgr.playSound("s_guide");
  20976. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20977. }
  20978. }
  20979. ensureSecretary() {
  20980. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  20981. this.ui.secretaryGuide.visible = false;
  20982. this.ui.enterGuide.visible = true;
  20983. this.ui.wordsNode.t0.play();
  20984. if (DataMgr.getNewUser())
  20985. Moyu.sendDataEvent("gameReady");
  20986. }
  20987. playSecretaryIdle() {
  20988. let parent = this.ui.secretary.displayObject;
  20989. parent.destroyChildren();
  20990. let xx = this.ui.secretary.width / 2;
  20991. let yy = this.ui.secretary.height;
  20992. let scale = xGame.common.getSecretaryScale();
  20993. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20994. console.log("zh:playSecretaryIdle", data);
  20995. xGame.common.secretary.play(data, 0, true, parent);
  20996. }
  20997. startGame(type) {
  20998. xGame.common.gameMode = type;
  20999. Moyu.sendDataEvent("PlayGame", { type: type });
  21000. switch (xGame.common.gameMode) {
  21001. case GameMode.classic:
  21002. let challengeTimes = DataMgr.getChallengeTimes();
  21003. if (challengeTimes == 0) {
  21004. xGame.uiMgr.Show(UIInvitation$1);
  21005. }
  21006. else {
  21007. this.beginGame();
  21008. }
  21009. break;
  21010. case GameMode.bigMove:
  21011. this.beginGame();
  21012. if (DataMgr.getNewUser())
  21013. Moyu.sendDataEvent("gameStart0");
  21014. break;
  21015. default:
  21016. break;
  21017. }
  21018. }
  21019. beginGame(isNice = false) {
  21020. console.log('zh:beginGame beginGame beginGame');
  21021. if (xGame.common.gameMode == GameMode.classic) {
  21022. if (isNice) {
  21023. this.enterClassic();
  21024. }
  21025. else {
  21026. xGame.uiMgr.Show(UIModeSelection$1, () => {
  21027. this.enterClassic();
  21028. });
  21029. }
  21030. }
  21031. else if (xGame.common.gameMode == GameMode.bigMove) {
  21032. this.ui.enterGuide.visible = false;
  21033. xGame.uiMgr.Show(UISkill$1);
  21034. }
  21035. }
  21036. enterClassic() {
  21037. xGame.uiMgr.Show(UIGame$1);
  21038. xGame.uiMgr.Show(UIMatching$1, () => {
  21039. if (!this.isHide)
  21040. this.hide();
  21041. xGame.common.gameUI.ui.alpha = 1;
  21042. xGame.common.gameUI.startGame();
  21043. xGame.uiMgr.Hide(UIGameEnd$1);
  21044. });
  21045. }
  21046. startGlobal() {
  21047. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21048. }
  21049. startWeekly() {
  21050. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21051. }
  21052. zhouSaiMonth() {
  21053. console.log('zh: zhouSaiMonth 被调用');
  21054. }
  21055. startPlaceBall() {
  21056. xGame.uiMgr.Show(UILevelDisplay$1);
  21057. }
  21058. hide() {
  21059. console.log('zh:uimain hide ...');
  21060. super.hide();
  21061. xGame.common.stopGirlPop(this.ui.talkNode);
  21062. }
  21063. onGetUserInfo(force = false) {
  21064. if (Moyu.isWx) {
  21065. let info = Moyu.getSystemInfo();
  21066. if (info)
  21067. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  21068. }
  21069. else {
  21070. Moyu.initUser(this, this.freshUser, force);
  21071. }
  21072. if (!Moyu.hasUserInfo) {
  21073. let user = Moyu.getUserInfo();
  21074. user.headIcon = 'res/ty_touxiang.png';
  21075. }
  21076. this.freshUser();
  21077. }
  21078. freshUser() {
  21079. let user = Moyu.getUserInfo();
  21080. if (!user.isAuth) {
  21081. user.headIcon = 'res/ty_touxiang.png';
  21082. }
  21083. else
  21084. DataMgr.upRankData();
  21085. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  21086. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  21087. }
  21088. interuptSecretary() {
  21089. Laya.timer.clearAll(this);
  21090. this.playSecretaryRandomSound();
  21091. }
  21092. playSecretaryRandomSound() {
  21093. if (this.isHide)
  21094. return;
  21095. let time = xGame.common.randomNum(45000, 60000);
  21096. Laya.timer.once(time, this, () => {
  21097. if (this.isHide)
  21098. return;
  21099. let index = xGame.common.randomNum(4, 7);
  21100. xGame.soundMgr.playSound("s_main0" + index);
  21101. let words = 1;
  21102. switch (index) {
  21103. case 4:
  21104. words = 5;
  21105. break;
  21106. case 5:
  21107. words = 3;
  21108. break;
  21109. case 6:
  21110. words = 6;
  21111. break;
  21112. case 7:
  21113. words = 7;
  21114. break;
  21115. default:
  21116. break;
  21117. }
  21118. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21119. this.playSecretaryRandomSound();
  21120. });
  21121. }
  21122. openSecretaryView() {
  21123. xGame.uiMgr.Show(UISecretary$1);
  21124. Moyu.sendDataEvent("secretary");
  21125. }
  21126. openShopView() {
  21127. xGame.uiMgr.Show(UIShop$1);
  21128. }
  21129. openSignView() {
  21130. xGame.uiMgr.Show(UISign$1);
  21131. }
  21132. openDrawView() {
  21133. xGame.uiMgr.Show(UIDraw$1);
  21134. }
  21135. openRanking() {
  21136. console.log('zh:phb openRanking');
  21137. xGame.uiMgr.Show(UIRanking$1);
  21138. Moyu.sendDataEvent("rankingList");
  21139. }
  21140. }
  21141. UIMain$1.uiName = "UIMain";
  21142. function InitShader() {
  21143. }
  21144. function appInit() {
  21145. xGame.context.init(getLoadingResList(), initCallback);
  21146. }
  21147. function getLoadingResList() {
  21148. return [
  21149. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  21150. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  21151. ];
  21152. }
  21153. function getGameResList() {
  21154. return [
  21155. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  21156. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  21157. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  21158. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  21159. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  21160. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  21161. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  21162. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  21163. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  21164. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  21165. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  21166. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  21167. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  21168. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  21169. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  21170. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  21171. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  21172. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  21173. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  21174. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  21175. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  21176. ];
  21177. }
  21178. function initCallback() {
  21179. window["DataMgr"] = DataMgr;
  21180. DataMgr.Init();
  21181. Moyu.init(getPlat(), this, () => {
  21182. DataMgr.isNewDay();
  21183. PlatMgr.initConfig();
  21184. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  21185. }, true);
  21186. console.log('zh:开始sm init1 start');
  21187. xGame.soundMgr.init();
  21188. console.log('zh:开始sm init1 end');
  21189. xGame.uiMgr.init();
  21190. xGame.uiMgr.clearTempData();
  21191. xGame.uiMgr.bindFUI(fguiRes.loading);
  21192. xGame.uiMgr.Show(UILoading);
  21193. }
  21194. function loadSubRes(callback) {
  21195. var tab = ["asset", "res", "spine"];
  21196. let subDone = 0;
  21197. for (var i = 0; i < tab.length; i++) {
  21198. let sub = tab[i];
  21199. Moyu.loadSubRes(sub, (pro) => {
  21200. callback && callback(pro, false);
  21201. }).then(() => {
  21202. subDone++;
  21203. if (subDone >= tab.length)
  21204. callback && callback(1, true);
  21205. });
  21206. }
  21207. }
  21208. function enterGame() {
  21209. xGame.cfgMgr.init();
  21210. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  21211. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  21212. xGame.uiMgr.Hide(UILoading);
  21213. fgui.UIPackage.removePackage(fguiRes.loading);
  21214. xGame.uiMgr.bindFUI(fguiRes.game);
  21215. xGame.uiMgr.Show(UIMain$1);
  21216. if (DataMgr.getNewUser())
  21217. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  21218. }
  21219. function getPlat() {
  21220. let cfg = new MoyuCfg();
  21221. cfg.plat = MoyuPlat.web;
  21222. cfg.myId = 120;
  21223. cfg.myKey = '8848a885774230a4';
  21224. cfg.version = 0;
  21225. if (window.hasOwnProperty("gamebox")) {
  21226. cfg.plat = MoyuPlat.f399;
  21227. cfg.version = 0;
  21228. }
  21229. else if (window.hasOwnProperty("ks")) {
  21230. cfg.plat = MoyuPlat.ks;
  21231. cfg.version = 0;
  21232. cfg.ads.ksVideoId = '2300002254_01';
  21233. cfg.ads.ksInsertId = '2300002254_02';
  21234. }
  21235. else if (Laya.Browser.onTTMiniGame) {
  21236. cfg.plat = MoyuPlat.tt;
  21237. cfg.version = 0;
  21238. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  21239. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  21240. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  21241. }
  21242. else if (Laya.Browser.onMiniGame) {
  21243. cfg.plat = MoyuPlat.wx;
  21244. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  21245. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  21246. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  21247. }
  21248. else if (Laya.Browser.onQQMiniGame) {
  21249. cfg.plat = MoyuPlat.qq;
  21250. }
  21251. else if (Laya.Browser.onQGMiniGame) {
  21252. cfg.plat = MoyuPlat.op;
  21253. cfg.ads.opVideoId = '455502';
  21254. cfg.ads.opBannerId = '455507';
  21255. }
  21256. else if (Laya.Browser.onVVMiniGame) {
  21257. cfg.plat = MoyuPlat.vv;
  21258. cfg.version = 0;
  21259. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  21260. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  21261. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  21262. }
  21263. else if (Laya.Browser.onHWMiniGame) {
  21264. cfg.plat = MoyuPlat.hw;
  21265. }
  21266. else if (window["mz"]) {
  21267. cfg.plat = MoyuPlat.mz;
  21268. }
  21269. else {
  21270. let cfg = window['conchConfig'];
  21271. if (cfg) {
  21272. var os = cfg.getOS();
  21273. if (os == "Conch-ios") {
  21274. cfg.plat = MoyuPlat.ios;
  21275. }
  21276. else if (os == "Conch-android") {
  21277. }
  21278. }
  21279. }
  21280. return cfg;
  21281. }
  21282. class Main {
  21283. constructor() {
  21284. if (window["Laya3D"])
  21285. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  21286. else {
  21287. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  21288. this.initMain();
  21289. }
  21290. }
  21291. initMain() {
  21292. Laya["Physics"] && Laya["Physics"].enable();
  21293. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  21294. Laya.stage.scaleMode = GameConfig.scaleMode;
  21295. Laya.stage.screenMode = GameConfig.screenMode;
  21296. Laya.stage.alignV = GameConfig.alignV;
  21297. Laya.stage.alignH = GameConfig.alignH;
  21298. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  21299. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  21300. Laya.enableDebugPanel();
  21301. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  21302. Laya["PhysicsDebugDraw"].enable();
  21303. if (GameConfig.stat)
  21304. Laya.Stat.show();
  21305. Laya.alertGlobalError(true);
  21306. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  21307. }
  21308. onVersionLoaded() {
  21309. appInit();
  21310. }
  21311. }
  21312. new Main();
  21313. }());
  21314. //# sourceMappingURL=bundle.js.map