bundle.js 830 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  52. let poolKey = {
  53. inHoleEft: "inHoleEft",
  54. d3ball: "d3ball",
  55. iceEft: "iceEft",
  56. hitEft: "hitEft",
  57. fireworksEft: "fireworksEft",
  58. };
  59. var GameMode;
  60. (function (GameMode) {
  61. GameMode[GameMode["classic"] = 0] = "classic";
  62. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  63. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  64. })(GameMode || (GameMode = {}));
  65. var SkillType;
  66. (function (SkillType) {
  67. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  68. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  69. SkillType[SkillType["ice"] = 2] = "ice";
  70. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  71. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  72. })(SkillType || (SkillType = {}));
  73. var ClassicWordsType;
  74. (function (ClassicWordsType) {
  75. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  76. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  77. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  78. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  79. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  80. })(ClassicWordsType || (ClassicWordsType = {}));
  81. var PressType;
  82. (function (PressType) {
  83. PressType[PressType["powerNode"] = 0] = "powerNode";
  84. PressType[PressType["d2Root"] = 1] = "d2Root";
  85. PressType[PressType["moveNode"] = 2] = "moveNode";
  86. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  87. })(PressType || (PressType = {}));
  88. var PlaceBallType;
  89. (function (PlaceBallType) {
  90. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  91. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  92. })(PlaceBallType || (PlaceBallType = {}));
  93. var EAdType;
  94. (function (EAdType) {
  95. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  96. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  97. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  98. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  99. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  100. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  101. EAdType[EAdType["sign"] = 6] = "sign";
  102. EAdType[EAdType["draw"] = 7] = "draw";
  103. EAdType[EAdType["triple"] = 8] = "triple";
  104. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  105. EAdType[EAdType["getPower"] = 10] = "getPower";
  106. EAdType[EAdType["box"] = 11] = "box";
  107. EAdType[EAdType["try"] = 12] = "try";
  108. EAdType[EAdType["againSign"] = 13] = "againSign";
  109. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  110. })(EAdType || (EAdType = {}));
  111. var Prop;
  112. (function (Prop) {
  113. Prop[Prop["diamond"] = 1] = "diamond";
  114. Prop[Prop["coin"] = 2] = "coin";
  115. Prop[Prop["gan1"] = 3] = "gan1";
  116. Prop[Prop["gan2"] = 4] = "gan2";
  117. Prop[Prop["gan3"] = 5] = "gan3";
  118. Prop[Prop["gan4"] = 6] = "gan4";
  119. })(Prop || (Prop = {}));
  120. var TipsType;
  121. (function (TipsType) {
  122. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  123. TipsType[TipsType["foul"] = 1] = "foul";
  124. })(TipsType || (TipsType = {}));
  125. class AwardType {
  126. constructor(type, num) {
  127. this.type = type;
  128. this.num = num;
  129. }
  130. }
  131. var define = /*#__PURE__*/Object.freeze({
  132. fguiRes: fguiRes,
  133. ballCamp: ballCamp,
  134. FoulType: FoulType,
  135. ALL_BALL_STOP: ALL_BALL_STOP,
  136. WAIT_SHOOT: WAIT_SHOOT,
  137. D3RES_LOADED: D3RES_LOADED,
  138. BALL_SHOOT: BALL_SHOOT,
  139. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  140. RESET_GAME: RESET_GAME,
  141. COIN_CHANGE: COIN_CHANGE,
  142. DIAMOND_CHANGE: DIAMOND_CHANGE,
  143. RESTART_GAME: RESTART_GAME,
  144. GET_USER_INFO: GET_USER_INFO,
  145. CHANGE_SECRETARY: CHANGE_SECRETARY,
  146. POWER_CHANGE: POWER_CHANGE,
  147. POWER_TIME: POWER_TIME,
  148. baseHeadUrl: baseHeadUrl,
  149. poolKey: poolKey,
  150. get GameMode () { return GameMode; },
  151. get SkillType () { return SkillType; },
  152. get ClassicWordsType () { return ClassicWordsType; },
  153. get PressType () { return PressType; },
  154. get PlaceBallType () { return PlaceBallType; },
  155. get EAdType () { return EAdType; },
  156. get Prop () { return Prop; },
  157. get TipsType () { return TipsType; },
  158. AwardType: AwardType
  159. });
  160. class CContext {
  161. constructor() {
  162. this.winSize = { width: 0, height: 0 };
  163. this.notchHeight = 0;
  164. this.bannerHeight = 0;
  165. }
  166. init(resList, callback) {
  167. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  168. this.notchHeight = this.getNotchHeight();
  169. this.bannerHeight = this.getBannerHeight();
  170. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  171. callback && callback();
  172. }));
  173. }
  174. getNotchHeight() {
  175. let notchHeight = 50;
  176. if (Laya.Browser.onMiniGame) {
  177. let deviceInfo = wx.getSystemInfoSync();
  178. if (Laya.Browser.onIOS) {
  179. if (deviceInfo.model.search('iPhone X') != -1) {
  180. notchHeight = deviceInfo.statusBarHeight - 10;
  181. }
  182. else {
  183. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  184. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  185. notchHeight = deviceInfo.statusBarHeight - 10;
  186. }
  187. }
  188. }
  189. else if (Laya.Browser.onAndroid) {
  190. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  191. notchHeight = deviceInfo.statusBarHeight;
  192. }
  193. }
  194. }
  195. return notchHeight;
  196. }
  197. getBannerHeight() {
  198. return 0;
  199. }
  200. }
  201. let context = new CContext();
  202. var Handler = Laya.Handler;
  203. var Tween = Laya.Tween;
  204. function playClickEffect(btn) {
  205. if (!btn)
  206. return;
  207. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  208. if (!btn)
  209. return;
  210. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  211. if (!btn)
  212. return;
  213. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  214. }), 0, true);
  215. }), 0, true);
  216. }
  217. function getNumList(strList) {
  218. let dataList = [];
  219. if (strList) {
  220. let list = strList;
  221. let array = list.split(',');
  222. for (var v in array) {
  223. dataList.push(Number(array[v]));
  224. }
  225. }
  226. return dataList;
  227. }
  228. function getStrList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split('|');
  233. for (var v in array) {
  234. dataList.push(String(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getRandStr(len) {
  240. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  241. let str = "";
  242. for (let i = 0; i < len; i++) {
  243. let rand = random(0, list.length);
  244. str += list[rand];
  245. }
  246. return str;
  247. }
  248. function getUserId() {
  249. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  250. return str;
  251. }
  252. function formatPos(pos, len = 2) {
  253. let v = Math.pow(10, len);
  254. pos.x = Math.floor(pos.x * v) / v;
  255. pos.y = Math.floor(pos.y * v) / v;
  256. if (pos.z)
  257. pos.z = Math.floor(pos.z * v) / v;
  258. return pos;
  259. }
  260. function setPosInt(pos) {
  261. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  262. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  263. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  264. return pos;
  265. }
  266. function random(min, max) {
  267. var rang = max - min;
  268. var rand = Math.random() * rang;
  269. return Math.floor(rand) + min;
  270. }
  271. function randomList(list, num) {
  272. if (list.length <= num)
  273. return list;
  274. let arry = [];
  275. list.forEach(item => {
  276. arry.push(item);
  277. });
  278. let nums = [];
  279. for (let i = 0; i < num; i++) {
  280. let rand = random(0, arry.length);
  281. let v = arry[rand];
  282. nums.push(v);
  283. arry.splice(rand, 1);
  284. }
  285. return nums;
  286. }
  287. function worldToScreen(camera, point, pos) {
  288. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  289. pos.x = pos.x / Laya.stage.clientScaleX;
  290. pos.y = pos.y / Laya.stage.clientScaleY;
  291. }
  292. function getStringLenght(str) {
  293. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  294. }
  295. function reviseString(str, len) {
  296. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  297. if (ld > len) {
  298. let sl = Math.floor(len / 2);
  299. let rs = str.substring(0, sl);
  300. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  301. while (d + 2 < len) {
  302. sl++;
  303. rs = str.substring(0, sl);
  304. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. return rs + "...";
  307. }
  308. return str;
  309. }
  310. function getCoinString(coin) {
  311. if (coin < 10000)
  312. return coin.toString();
  313. else if (coin < 1000000) {
  314. let vh = Math.ceil(coin / 100);
  315. return (vh / 10) + "k";
  316. }
  317. else if (coin < 1000000000) {
  318. var vh = Math.ceil(coin / 100000);
  319. return (vh / 10) + "m";
  320. }
  321. else if (coin < 1000000000000) {
  322. var vh = Math.ceil(coin / 100000000);
  323. return (vh / 10) + "b";
  324. }
  325. else if (coin < 1000000000000000) {
  326. var vh = Math.ceil(coin / 100000000000);
  327. return (vh / 10) + "t";
  328. }
  329. }
  330. function getV3Dest(pos, dir, dis, dest) {
  331. dir.x *= dis;
  332. dir.y *= dis;
  333. dir.z *= dis;
  334. Laya.Vector3.add(pos, dir, dest);
  335. return dest;
  336. }
  337. function getV2Dest(x1, y1, dir, dis, dest) {
  338. dest.x = x1 + dir.x * dis;
  339. dest.y = y1 + dir.y * dis;
  340. return dest;
  341. }
  342. function getV2Dir(x1, y1, x2, y2, dir) {
  343. dir.x = x2 - x1;
  344. dir.y = y2 - y1;
  345. Laya.Vector2.normalize(dir, dir);
  346. return dir;
  347. }
  348. function getV3Dir(p1, p2, dir) {
  349. Laya.Vector3.subtract(p1, p2, dir);
  350. Laya.Vector3.normalize(dir, dir);
  351. return dir;
  352. }
  353. function copyPos(ip, op) {
  354. op.x = ip.x;
  355. op.y = ip.y;
  356. if (ip.z)
  357. op.z = ip.z;
  358. return op;
  359. }
  360. function getScreenImg() {
  361. let gl = Laya.WebGLContext.mainContext;
  362. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  363. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  364. let w = gl.drawingBufferWidth;
  365. let h = gl.drawingBufferHeight;
  366. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  367. texture2d.setPixels(pixels);
  368. return new Laya.Texture(texture2d);
  369. }
  370. function playMoveByPositions(sp, positions, v, completeCallback) {
  371. let p;
  372. let play = () => {
  373. if (positions.length == 0) {
  374. completeCallback();
  375. return;
  376. }
  377. p = positions[0];
  378. positions.splice(0, 1);
  379. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  380. play();
  381. }));
  382. };
  383. play();
  384. }
  385. function setStarPos(node, num, max) {
  386. for (let i = 1; i <= 5; i++) {
  387. let img = node.getChildAt(i - 1);
  388. img.width = img.height = 30;
  389. img.pivotX = img.pivotY = 0.5;
  390. img.gray = i > num;
  391. img.visible = i <= max;
  392. if (max == 3) {
  393. img.x = node.width / 2 + (i - 2) * 30 - 15;
  394. img.y = node.height - 40;
  395. if (i == 2)
  396. img.y = node.height - 30;
  397. }
  398. else if (max == 5) {
  399. let ly = Math.abs(i - 3);
  400. img.x = node.width / 2 + (i - 3) * 20 - 15;
  401. img.y = node.height - ly * 8 - 30;
  402. }
  403. }
  404. }
  405. function playLoopAnimRotate(sp, time, clockwise = true) {
  406. let rotation;
  407. sp.rotation = sp.rotation % 360;
  408. if (clockwise) {
  409. rotation = -360;
  410. }
  411. else {
  412. rotation = 360;
  413. }
  414. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  415. this.playLoopAnimRotate(sp, time, clockwise);
  416. }));
  417. }
  418. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  419. let x, y;
  420. if (isBig) {
  421. x = valueXMin;
  422. y = valueYMin;
  423. }
  424. else {
  425. x = valueXMax;
  426. y = valueYMax;
  427. }
  428. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  429. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  430. }));
  431. }
  432. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  433. let scale;
  434. if (isBig) {
  435. scale = valueMin;
  436. }
  437. else {
  438. scale = valueMax;
  439. }
  440. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  441. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  442. }));
  443. }
  444. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  445. let value;
  446. if (isBig) {
  447. value = valueMin;
  448. }
  449. else {
  450. value = valueMax;
  451. }
  452. if (count) {
  453. count--;
  454. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  455. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  456. }));
  457. }
  458. else {
  459. sp.rotation = 0;
  460. }
  461. }
  462. function inRect(rect, p) {
  463. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  464. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  465. return true;
  466. }
  467. }
  468. return false;
  469. }
  470. function getNumberK(number) {
  471. if (number < 1000) {
  472. return number.toString();
  473. }
  474. else {
  475. return (number / 1000).toFixed(1) + "k";
  476. }
  477. }
  478. function pointInsideCircle(point, circle, r) {
  479. if (r === 0)
  480. return false;
  481. var dx = circle.x - point.x;
  482. var dy = circle.y - point.y;
  483. return dx * dx + dy * dy <= r * r;
  484. }
  485. function formatString(str, data) {
  486. if (!str || data == undefined) {
  487. return str;
  488. }
  489. if (typeof data === "object") {
  490. for (var key in data) {
  491. if (data.hasOwnProperty(key)) {
  492. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  493. }
  494. }
  495. }
  496. else {
  497. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  498. return str.replace(reg, function (match, index) {
  499. return args[index - (-1)];
  500. });
  501. }
  502. return str;
  503. }
  504. function getIntersection(a, b) {
  505. let t = [];
  506. for (var i = 0; i < a.length; i++) {
  507. for (var j = 0; j < b.length; j++) {
  508. if (a[i] == b[j]) {
  509. t.push(a[i]);
  510. }
  511. }
  512. }
  513. return t;
  514. }
  515. function getComplement(a, b) {
  516. let t = [];
  517. let count = false;
  518. for (var i = 0; i < a.length; i++) {
  519. count = false;
  520. for (var j = 0; j < b.length; j++) {
  521. if (a[i] == b[j]) {
  522. count = true;
  523. break;
  524. }
  525. }
  526. if (!count) {
  527. t.push(a[i]);
  528. }
  529. }
  530. return t;
  531. }
  532. function geSpriteStageRect(sp) {
  533. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  534. let rect = {
  535. x: point.x,
  536. y: point.y,
  537. width: sp.width * sp.globalScaleX,
  538. height: sp.height * sp.globalScaleY
  539. };
  540. return rect;
  541. }
  542. function touchButton(button) {
  543. let event = new Laya.Event();
  544. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  545. }
  546. function setColor(sprite, r, g, b) {
  547. var redMat = [
  548. r / 255, 0, 0, 0, 0,
  549. g / 255, 0, 0, 0, 0,
  550. b / 255, 0, 0, 0, 0,
  551. 0, 0, 0, 1, 0,
  552. ];
  553. var filter = new Laya.ColorFilter(redMat);
  554. sprite.filters = [filter];
  555. }
  556. function clone(obj, newobj = {}) {
  557. for (var attr in obj) {
  558. if (typeof obj[attr] == "object") {
  559. newobj[attr] = clone(obj[attr], newobj[attr]);
  560. }
  561. else {
  562. newobj[attr] = obj[attr];
  563. }
  564. }
  565. return newobj;
  566. }
  567. function _ms(arr, compare, begin, end) {
  568. const size = end - begin;
  569. if (size <= 1) {
  570. return;
  571. }
  572. const middle = (end + begin) >> 1;
  573. _ms(arr, compare, begin, middle);
  574. _ms(arr, compare, middle, end);
  575. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  576. return;
  577. }
  578. const merged = [];
  579. let leftIndex = begin, rightIndex = middle;
  580. while (merged.length < size) {
  581. if (leftIndex === middle) {
  582. merged.push(arr[rightIndex++]);
  583. }
  584. else if (rightIndex === end) {
  585. merged.push(arr[leftIndex++]);
  586. }
  587. else {
  588. const c = compare(arr[leftIndex], arr[rightIndex]);
  589. if (c <= 0) {
  590. merged.push(arr[leftIndex++]);
  591. }
  592. else {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. }
  596. }
  597. arr.splice(begin, size, ...merged);
  598. }
  599. function sort(arr, compare) {
  600. if (!Array.isArray(arr)) {
  601. throw new Error('sort的参数必须为数组');
  602. }
  603. _ms(arr, compare, 0, arr.length);
  604. return arr;
  605. }
  606. function getLanguage(id) {
  607. }
  608. function getLanguageByTip(id) {
  609. }
  610. function toWeights(array) {
  611. let max = 0;
  612. for (var i = 0; i < array.length; i++) {
  613. max = max + array[i];
  614. if (array[i] == 0) {
  615. array[i] = 0;
  616. }
  617. else {
  618. array[i] = max;
  619. }
  620. }
  621. return array;
  622. }
  623. function unique(array) {
  624. var n = {}, r = [], len = array.length, val, type;
  625. for (var i = 0; i < array.length; i++) {
  626. val = array[i];
  627. type = typeof val;
  628. if (!n[val]) {
  629. n[val] = [type];
  630. r.push(val);
  631. }
  632. else if (n[val].indexOf(type) < 0) {
  633. n[val].push(type);
  634. r.push(val);
  635. }
  636. }
  637. return r;
  638. }
  639. function unique1(array) {
  640. var r = [];
  641. for (var i = 0, l = array.length; i < l; i++) {
  642. for (var j = i + 1; j < l; j++)
  643. if (array[i] == array[j])
  644. j == ++i;
  645. r.push(array[i]);
  646. }
  647. return r;
  648. }
  649. function getDistance(x1, y1, x2, y2) {
  650. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  651. }
  652. function getV2Dis(pos1, pos2) {
  653. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  654. }
  655. function getV2SqDis(pos1, pos2) {
  656. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  657. }
  658. function getDis(x1, y1, x2, y2) {
  659. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  660. }
  661. function getDeltaxy(x1, y1, x2, y2) {
  662. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  663. }
  664. function getSymbolNumber(num) {
  665. if (num > 0) {
  666. return "+" + num;
  667. }
  668. else if (num < 0) {
  669. return num.toString();
  670. }
  671. return num.toString();
  672. }
  673. function fixNumber(num, length) {
  674. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  675. }
  676. function toThousands(num) {
  677. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  678. }
  679. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  680. function fmtMoney(money) {
  681. money = toThousands(money.replace(/^0+/, ''));
  682. if (money.length == 0) {
  683. money = "0";
  684. }
  685. let unit = 0;
  686. for (var i = 0; i < money.length; i++) {
  687. if (money.charAt(i) == ",") {
  688. unit++;
  689. }
  690. }
  691. if (unit == 0) {
  692. return money;
  693. }
  694. else {
  695. let idx = money.indexOf(",");
  696. if (idx) {
  697. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  698. }
  699. return money.replace(",", ".");
  700. }
  701. }
  702. function flatten(arr) {
  703. while (arr.some(item => Array.isArray(item))) {
  704. arr = [].concat(...arr);
  705. }
  706. return arr;
  707. }
  708. function getDistanceByPoint(p1, p2) {
  709. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  710. }
  711. function getAngleByPoint(p1, p2) {
  712. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  713. }
  714. function toIntByArray(array) {
  715. for (var index = 0; index < array.length; index++) {
  716. array[index] = parseInt(array[index]);
  717. }
  718. return array;
  719. }
  720. function getAngle0To360(angle) {
  721. while (angle < 0) {
  722. angle += 360;
  723. }
  724. while (angle >= 360) {
  725. angle -= 360;
  726. }
  727. return angle;
  728. }
  729. function toAngle(radian) {
  730. return radian * 180 / Math.PI;
  731. }
  732. function toRadian(angle) {
  733. return angle * Math.PI / 180;
  734. }
  735. function getArrayValueRandom(array) {
  736. return array[random(0, array.length - 1)];
  737. }
  738. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  739. }
  740. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function fmtTimeMMSS(time) {
  743. if (time < 0) {
  744. time = 0;
  745. }
  746. else
  747. time = Math.floor(time);
  748. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  749. }
  750. function fmtTimeMS(time) {
  751. if (time < 0) {
  752. time = 0;
  753. }
  754. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  755. }
  756. function fmtTimeHHMM(time) {
  757. if (time < 0) {
  758. time = 0;
  759. }
  760. time = Math.floor(time / 1000);
  761. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  762. }
  763. let severTime = 0;
  764. function getServerTime() {
  765. return new Date(new Date().getTime() - severTime);
  766. }
  767. function setServerTime(data) {
  768. severTime = (new Date().getTime() - data);
  769. }
  770. var tools = /*#__PURE__*/Object.freeze({
  771. playClickEffect: playClickEffect,
  772. getNumList: getNumList,
  773. getStrList: getStrList,
  774. getRandStr: getRandStr,
  775. getUserId: getUserId,
  776. formatPos: formatPos,
  777. setPosInt: setPosInt,
  778. random: random,
  779. randomList: randomList,
  780. worldToScreen: worldToScreen,
  781. getStringLenght: getStringLenght,
  782. reviseString: reviseString,
  783. getCoinString: getCoinString,
  784. getV3Dest: getV3Dest,
  785. getV2Dest: getV2Dest,
  786. getV2Dir: getV2Dir,
  787. getV3Dir: getV3Dir,
  788. copyPos: copyPos,
  789. getScreenImg: getScreenImg,
  790. playMoveByPositions: playMoveByPositions,
  791. setStarPos: setStarPos,
  792. playLoopAnimRotate: playLoopAnimRotate,
  793. playLoopAnimPosition: playLoopAnimPosition,
  794. playLoopAnimScale: playLoopAnimScale,
  795. playLoopAnimRotation: playLoopAnimRotation,
  796. inRect: inRect,
  797. getNumberK: getNumberK,
  798. pointInsideCircle: pointInsideCircle,
  799. formatString: formatString,
  800. getIntersection: getIntersection,
  801. getComplement: getComplement,
  802. geSpriteStageRect: geSpriteStageRect,
  803. touchButton: touchButton,
  804. setColor: setColor,
  805. clone: clone,
  806. sort: sort,
  807. getLanguage: getLanguage,
  808. getLanguageByTip: getLanguageByTip,
  809. toWeights: toWeights,
  810. unique: unique,
  811. unique1: unique1,
  812. getDistance: getDistance,
  813. getV2Dis: getV2Dis,
  814. getV2SqDis: getV2SqDis,
  815. getDis: getDis,
  816. getDeltaxy: getDeltaxy,
  817. getSymbolNumber: getSymbolNumber,
  818. fixNumber: fixNumber,
  819. toThousands: toThousands,
  820. fmtMoney: fmtMoney,
  821. flatten: flatten,
  822. getDistanceByPoint: getDistanceByPoint,
  823. getAngleByPoint: getAngleByPoint,
  824. toIntByArray: toIntByArray,
  825. getAngle0To360: getAngle0To360,
  826. toAngle: toAngle,
  827. toRadian: toRadian,
  828. getArrayValueRandom: getArrayValueRandom,
  829. promptByTip: promptByTip,
  830. promptByErrorCode: promptByErrorCode,
  831. fmtTimeMMSS: fmtTimeMMSS,
  832. fmtTimeMS: fmtTimeMS,
  833. fmtTimeHHMM: fmtTimeHHMM,
  834. getServerTime: getServerTime,
  835. setServerTime: setServerTime
  836. });
  837. class HttpMgr {
  838. constructor() {
  839. HttpMgr._instance = this;
  840. }
  841. static getInstance() {
  842. if (!this._instance) {
  843. this._instance = new HttpMgr();
  844. }
  845. return this._instance;
  846. }
  847. sendPost(url, data, call) {
  848. let httpObj = new Laya.HttpRequest();
  849. httpObj.http.timeout = 5000;
  850. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  851. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  852. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  853. function errorHandler(error) {
  854. console.log("errorHandler:" + error);
  855. }
  856. function completeHandler(data) {
  857. if (data && data.length > 0) {
  858. let jsonData = JSON.parse(data);
  859. if (call)
  860. call(jsonData);
  861. }
  862. }
  863. }
  864. sendGet(url, call) {
  865. let httpObj = new Laya.HttpRequest();
  866. httpObj.http.timeout = 5000;
  867. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  868. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  869. httpObj.send(url, '', 'get');
  870. function errorHandler(error) {
  871. console.log("errorHandler:" + error);
  872. }
  873. function completeHandler(data) {
  874. if (data && data.length > 0) {
  875. if (call)
  876. call(data);
  877. }
  878. }
  879. }
  880. }
  881. HttpMgr._instance = null;
  882. class LightShader extends Laya.Sprite {
  883. constructor() {
  884. super();
  885. this._time = 0;
  886. this._sin = 0;
  887. this.initShader();
  888. }
  889. initShader() {
  890. var vs = `
  891. #define FSHIGHPRECISION
  892. attribute vec4 posuv;
  893. uniform vec2 size;
  894. varying vec4 v_texcoord;
  895. void main() {
  896. vec4 pos = vec4(posuv.xy,0.,1.);
  897. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  898. gl_Position=pos1;
  899. v_texcoord.xy = posuv.xy;
  900. }
  901. `;
  902. var ps = `
  903. #define FSHIGHPRECISION
  904. precision highp float;
  905. varying vec4 v_texcoord;
  906. uniform vec2 size;
  907. uniform sampler2D texture;
  908. uniform float u_Time;
  909. void main() {
  910. vec4 color= texture2D(texture, v_texcoord.xy);
  911. float width = 0.2;
  912. float start = u_Time;
  913. float offset = 1.0;
  914. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  915. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  916. {
  917. color.r=1.1;
  918. color.g=1.1;
  919. color.b=1.1;
  920. gl_FragColor = color;
  921. } else {
  922. gl_FragColor = color;
  923. }
  924. }
  925. `;
  926. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  927. this.customRenderEnable = true;
  928. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  929. }
  930. customRender(context, x, y) {
  931. this.onUpdate();
  932. if (!this.texture)
  933. return;
  934. let xx = x - this.pivotX;
  935. let yy = y - this.pivotY;
  936. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  937. }
  938. onUpdate() {
  939. this._time += 2 * Laya.timer.delta * 0.001;
  940. this._sin = Math.sin(this._time);
  941. if (this._sin > 0.99) {
  942. this._sin = 0;
  943. this._time = 0;
  944. }
  945. this.shaderValue['u_Time'] = this._sin;
  946. }
  947. }
  948. LightShader.DissolveSurfaceSaveName = 9997;
  949. class UIBase extends fairygui.Window {
  950. constructor() {
  951. super();
  952. this.isEject = true;
  953. this.isHide = true;
  954. this.showbanner = true;
  955. this.className = "";
  956. this.isMuti = false;
  957. this.showbanner = false;
  958. this.onConstructor();
  959. }
  960. checkActive(show) {
  961. }
  962. getUIName() {
  963. return UIBase.uiName;
  964. }
  965. onConstructor() {
  966. }
  967. onInit() {
  968. if (!!this.contentPane) {
  969. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  970. }
  971. this.setPivot(0.5, 0.5, false);
  972. }
  973. doShowAnimation() {
  974. if (!this.isEject)
  975. return;
  976. super.doShowAnimation();
  977. Laya.Tween.clearTween(this);
  978. this.scaleX = this.scaleY = 0.8;
  979. let tweenFunc1 = (func) => {
  980. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  981. };
  982. let tweenFunc2 = (func) => {
  983. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  984. };
  985. tweenFunc1(tweenFunc2);
  986. }
  987. show(...args) {
  988. super.show();
  989. this._openParam = args;
  990. this.isHide = false;
  991. xGame.uiMgr.checkUIState();
  992. }
  993. moveBannerButton() {
  994. }
  995. showBannerButton() {
  996. this.bannerButton.visible = true;
  997. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  998. this.bannerButton.touchable = true;
  999. }));
  1000. }
  1001. hide() {
  1002. super.hide();
  1003. this.isHide = true;
  1004. xGame.uiMgr.checkUIState();
  1005. }
  1006. Dispose() {
  1007. super.dispose();
  1008. }
  1009. myUpdate(delay) {
  1010. }
  1011. refresh() { }
  1012. addUIClick(obj, func, arr = null) {
  1013. obj.onClick(this, func, arr);
  1014. obj.onClick(this, this.playBtnSound);
  1015. }
  1016. offUIClick(obj, func) {
  1017. obj.offClick(this, func);
  1018. }
  1019. playBtnSound() {
  1020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1021. }
  1022. }
  1023. UIBase.lastShowBanner = 0;
  1024. UIBase.showBannerNum = 0;
  1025. UIBase.uiName = "";
  1026. class ui_UIDraw extends fgui.GComponent {
  1027. static createInstance() {
  1028. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1029. }
  1030. onConstruct() {
  1031. this.n1 = (this.getChild("n1"));
  1032. this.extraNode = (this.getChild("extraNode"));
  1033. this.myNode = (this.getChild("myNode"));
  1034. this.closeNode = (this.getChild("closeNode"));
  1035. this.moneyNode = (this.getChild("moneyNode"));
  1036. this.n38 = (this.getChild("n38"));
  1037. this.secretary = (this.getChild("secretary"));
  1038. this.drawBtn = (this.getChild("drawBtn"));
  1039. this.talkNode = (this.getChild("talkNode"));
  1040. this.t0 = this.getTransition("t0");
  1041. }
  1042. }
  1043. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1044. class ui_UIBox extends fgui.GComponent {
  1045. static createInstance() {
  1046. return (fgui.UIPackage.createObject("game", "UIBox"));
  1047. }
  1048. onConstruct() {
  1049. this.n0 = (this.getChild("n0"));
  1050. this.n12 = (this.getChild("n12"));
  1051. this.n1 = (this.getChild("n1"));
  1052. this.n2 = (this.getChild("n2"));
  1053. this.bar = (this.getChild("bar"));
  1054. this.closeBtn = (this.getChild("closeBtn"));
  1055. this.openBtn = (this.getChild("openBtn"));
  1056. this.t0 = this.getTransition("t0");
  1057. this.t1 = this.getTransition("t1");
  1058. }
  1059. }
  1060. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1061. class GlobalManager {
  1062. constructor() {
  1063. }
  1064. registerMethod(name, method) {
  1065. console.log('zh: 注册全局方法', name);
  1066. this[name] = method;
  1067. }
  1068. callMethod(name, ...args) {
  1069. console.log('zh: 调用全局方法', name);
  1070. if (this[name]) {
  1071. return this[name](...args);
  1072. }
  1073. else {
  1074. console.error(`zh: 全局方法 Method ${name} not found`);
  1075. }
  1076. }
  1077. }
  1078. GlobalManager.instance = new GlobalManager();
  1079. class JSBridgeUtils {
  1080. constructor() { }
  1081. static get instance() {
  1082. if (!this._instance) {
  1083. this._instance = new JSBridgeUtils();
  1084. }
  1085. return this._instance;
  1086. }
  1087. initBridge() {
  1088. if (!Laya.Browser.onAndroid) {
  1089. console.log('zh:非android dev');
  1090. return;
  1091. }
  1092. let cfg = window['conchConfig'];
  1093. if (cfg) {
  1094. var os = cfg.getOS();
  1095. if (os == "Conch-android") {
  1096. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1097. if (this.bridge) {
  1098. return true;
  1099. }
  1100. else {
  1101. return false;
  1102. }
  1103. }
  1104. else {
  1105. return false;
  1106. }
  1107. }
  1108. else {
  1109. return false;
  1110. }
  1111. }
  1112. testAd1() {
  1113. if (!Laya.Browser.onAndroid) {
  1114. console.log('zh:非android dev');
  1115. return;
  1116. }
  1117. if (!this.initBridge()) {
  1118. return;
  1119. }
  1120. let rs = this.bridge.call("testString", "hello");
  1121. console.log('zh:testString rs=' + rs);
  1122. }
  1123. testAdCallBack() {
  1124. if (!this.initBridge()) {
  1125. return;
  1126. }
  1127. console.log("zh:testAdCallBack start");
  1128. const defaultObj = { code: 200, msg: "req update Ui" };
  1129. const reqObj = { code: 300, msg: "hello java ui" };
  1130. this.bridge.callWithBack((rsStr) => {
  1131. const rsObj = JSON.parse(rsStr);
  1132. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1133. }, "testAsyncCallback", JSON.stringify(reqObj));
  1134. }
  1135. showInternAd(mark) {
  1136. console.log('zh:showInternAd start');
  1137. if (!Laya.Browser.onAndroid) {
  1138. console.log('zh:showInternAd 非android dev');
  1139. return false;
  1140. }
  1141. if (!this.initBridge()) {
  1142. return false;
  1143. }
  1144. let rs = this.bridge.call("showInternAd", mark);
  1145. try {
  1146. const result = JSON.parse(rs);
  1147. if (result.code === 200) {
  1148. console.log("zh:showInternAd OK");
  1149. return true;
  1150. }
  1151. else {
  1152. console.warn("zh:showInternAd FAILL:", result.msg);
  1153. return false;
  1154. }
  1155. }
  1156. catch (e) {
  1157. console.error("zh:解析桥接返回值失败:", e);
  1158. return false;
  1159. }
  1160. }
  1161. showRewardAd(mark) {
  1162. if (!Laya.Browser.onAndroid) {
  1163. console.log('zh:非android dev');
  1164. return false;
  1165. }
  1166. if (!this.initBridge()) {
  1167. return false;
  1168. }
  1169. let rs = this.bridge.call("showRewardAd", mark);
  1170. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1171. try {
  1172. const result = JSON.parse(rs);
  1173. if (result.code === 200) {
  1174. console.log("zh:广告显示成功");
  1175. return true;
  1176. }
  1177. else {
  1178. console.warn("zh:广告显示失败:", result.msg);
  1179. return false;
  1180. }
  1181. }
  1182. catch (e) {
  1183. console.error("zh:解析桥接返回值失败:", e);
  1184. return false;
  1185. }
  1186. }
  1187. 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. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1264. }
  1265. }
  1266. else if (this.boxNum == this.boxMax) {
  1267. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1268. this.ui.openBtn.c1.selectedIndex = 13;
  1269. this.inAd = true;
  1270. }
  1271. else
  1272. this.getAward();
  1273. }
  1274. else if (this.inAd) {
  1275. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1276. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1277. }
  1278. else {
  1279. console.log('zh:AD 失败,直接发放奖励');
  1280. this.qjff_AD_for_UIBOX_onOpenBox();
  1281. }
  1282. }
  1283. this.upBar();
  1284. }
  1285. qjff_AD_for_UIBOX_onOpenBox() {
  1286. this.getAward();
  1287. }
  1288. onCloseBox() {
  1289. if (this.isClose)
  1290. this.hide();
  1291. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1292. this.isClose = true;
  1293. PlatMgr.showBanner(true, 0, 3000);
  1294. }
  1295. else
  1296. this.hide();
  1297. }
  1298. getAward() {
  1299. let str = "";
  1300. if (Math.random() < 0.5) {
  1301. let max = Moyu.isLegal ? 500 : 2500;
  1302. let num = xGame.tools.random(max, 500 + max);
  1303. DataMgr.setCoin(num);
  1304. str = "金币x" + num;
  1305. }
  1306. else {
  1307. let max = Moyu.isLegal ? 10 : 30;
  1308. let num = xGame.tools.random(max, 30 + max);
  1309. DataMgr.setDiamond(num);
  1310. str = "钻石x" + num;
  1311. }
  1312. xGame.showTip("恭喜获得-" + str);
  1313. this.hide();
  1314. }
  1315. }
  1316. UIBox.uiName = "UIBox";
  1317. class ui_UITry extends fgui.GComponent {
  1318. static createInstance() {
  1319. return (fgui.UIPackage.createObject("game", "UITry"));
  1320. }
  1321. onConstruct() {
  1322. this.n11 = (this.getChild("n11"));
  1323. this.myNode = (this.getChild("myNode"));
  1324. this.t0 = this.getTransition("t0");
  1325. }
  1326. }
  1327. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1328. class UITry extends UIBase {
  1329. constructor() {
  1330. super();
  1331. this.closeTime = 0;
  1332. this.closeNum = 0;
  1333. this.skillUrl = xGame.common.skillIconList;
  1334. }
  1335. onConstructor() {
  1336. this.ui = ui_UITry.createInstance();
  1337. this.contentPane = this.ui;
  1338. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1339. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1340. }
  1341. show() {
  1342. super.show();
  1343. this.closeNum = 0;
  1344. this.closeTime = 15;
  1345. this.ui.t0.play();
  1346. PlatMgr.showRateBanner();
  1347. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1348. Laya.timer.loop(1000, this, this.updateTime);
  1349. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1350. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1351. xGame.common.gameMgr.gamePause = true;
  1352. }
  1353. updateTime() {
  1354. if (this.closeTime > 1) {
  1355. this.closeTime--;
  1356. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1357. }
  1358. else
  1359. this.hide();
  1360. }
  1361. hide() {
  1362. Laya.timer.clearAll(this);
  1363. Moyu.showBannerAd(false);
  1364. super.hide();
  1365. xGame.common.gameMgr.gamePause = false;
  1366. }
  1367. onTry() {
  1368. console.log('zh:qjff_AD_for_uitry');
  1369. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1370. }
  1371. else {
  1372. console.log('zh:AD 失败,直接发放奖励');
  1373. this.qjff_AD_for_uitry();
  1374. }
  1375. }
  1376. qjff_AD_for_uitry() {
  1377. let select = xGame.common.curPlayerSkillType;
  1378. DataMgr.gameData.trySkill = select;
  1379. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1380. DataMgr.saveGameData();
  1381. DataMgr.setBigSkill(select, 1);
  1382. xGame.showTip("Trial Successful");
  1383. this.hide();
  1384. }
  1385. onCancel() {
  1386. if (this.closeNum > 0) {
  1387. this.closeNum--;
  1388. if (this.closeNum < 2)
  1389. this.hide();
  1390. return;
  1391. }
  1392. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1393. this.onTry();
  1394. }
  1395. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1396. this.closeNum = 3;
  1397. }
  1398. else
  1399. this.hide();
  1400. }
  1401. }
  1402. UITry.uiName = "UITry";
  1403. class PlatMgr {
  1404. static initConfig() {
  1405. this.lastVt = 0;
  1406. if (!Moyu.platConfig)
  1407. return;
  1408. for (let k in Moyu.platConfig) {
  1409. let pd = this[k];
  1410. let pc = Moyu.platConfig[k];
  1411. if (pd != undefined && pc != undefined)
  1412. this[k] = pc;
  1413. }
  1414. Moyu.setBannerPos(0.5, 1);
  1415. }
  1416. static rand100(num) {
  1417. return xGame.tools.random(0, 100) < num;
  1418. }
  1419. static isMisVideo() {
  1420. let dt = Laya.timer.currTimer - this.lastVt;
  1421. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1422. this.lastVt = Laya.timer.currTimer;
  1423. return true;
  1424. }
  1425. else {
  1426. if (this.rand100(this.fullVideoRate)) {
  1427. console.log('zh:插屏 ad start');
  1428. JSBridgeUtils.instance.showInternAd('platMgr');
  1429. }
  1430. return false;
  1431. }
  1432. }
  1433. static showVideo(call, type) {
  1434. Moyu.showVideoAd(() => {
  1435. this.lastVt = Laya.timer.currTimer;
  1436. call && call();
  1437. }, type);
  1438. }
  1439. static showInsert(delay = false) {
  1440. if (this.getRand() < this.insertRate) {
  1441. let dt = delay ? this.insertDelay : 0;
  1442. console.log('zh:插屏 ad start');
  1443. JSBridgeUtils.instance.showInternAd('gameInsert');
  1444. }
  1445. }
  1446. static gameInsert() {
  1447. let t = this.getRand();
  1448. let r = this.gameInsertRate;
  1449. if (t < r) {
  1450. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1451. }
  1452. }
  1453. static showRateBanner() {
  1454. if (this.getRand() < this.bannerRate)
  1455. this.showBanner(true, this.bannerDelay, 3000);
  1456. }
  1457. static showBanner(show, delay = 0, hide = 0) {
  1458. if (2 > 1) {
  1459. console.log('zh:显示showBanner广告 直接返回');
  1460. return;
  1461. }
  1462. if (!show)
  1463. Moyu.showBannerAd(false);
  1464. else {
  1465. Laya.timer.clear(this, this.bannerShow);
  1466. if (delay > 0)
  1467. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1468. else
  1469. this.bannerShow(true);
  1470. if (hide > 0)
  1471. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1472. }
  1473. }
  1474. static bannerShow(show) {
  1475. if (2 > 1) {
  1476. console.log('zh:显示showBanner广告 直接返回');
  1477. return;
  1478. }
  1479. Moyu.showBannerAd(show);
  1480. console.log("showBanner" + show);
  1481. }
  1482. static getRand() {
  1483. return xGame.tools.random(0, 100);
  1484. }
  1485. static openBox() {
  1486. if (this.getRand() < this.boxRate)
  1487. xGame.uiMgr.Show(UIBox);
  1488. }
  1489. static openTry() {
  1490. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1491. return;
  1492. if (this.getRand() < this.tryRate)
  1493. xGame.uiMgr.Show(UITry);
  1494. else if (DataMgr.gameData.gameCount == 1)
  1495. xGame.uiMgr.Show(UITry);
  1496. }
  1497. }
  1498. PlatMgr.forceShare = 0;
  1499. PlatMgr.signAdRate = 0;
  1500. PlatMgr.forceVideoRate = 0;
  1501. PlatMgr.forceVideoGap = 0;
  1502. PlatMgr.fullVideoRate = 0;
  1503. PlatMgr.gameInsertRate = 0;
  1504. PlatMgr.insertGap = 0;
  1505. PlatMgr.insertDelay = 0;
  1506. PlatMgr.insertRate = 0;
  1507. PlatMgr.boxRate = 0;
  1508. PlatMgr.boxVideoRate = 0;
  1509. PlatMgr.boxInsertRate = 0;
  1510. PlatMgr.boxBannerRate = 0;
  1511. PlatMgr.tryRate = 0;
  1512. PlatMgr.tryClose3Rate = 0;
  1513. PlatMgr.tryVideoRate = 0;
  1514. PlatMgr.bannerRate = 0;
  1515. PlatMgr.lastVt = 0;
  1516. class ui_UIAddProp extends fgui.GComponent {
  1517. static createInstance() {
  1518. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1519. }
  1520. onConstruct() {
  1521. this.n11 = (this.getChild("n11"));
  1522. this.myNode = (this.getChild("myNode"));
  1523. this.closeBtn = (this.getChild("closeBtn"));
  1524. this.t0 = this.getTransition("t0");
  1525. }
  1526. }
  1527. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1528. class SpineMgr {
  1529. constructor(name, loadCb = null) {
  1530. this.loaded = false;
  1531. this.spineName = '';
  1532. this.loadedCallback = loadCb;
  1533. this.templet = new Laya.Templet();
  1534. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1535. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1536. if (name === 'mishu') {
  1537. this.templet.loadAni('spine/nvmishu.sk');
  1538. }
  1539. else {
  1540. this.templet.loadAni(`spine/${name}.sk`);
  1541. }
  1542. this.templet.lock = true;
  1543. this.spineName = name;
  1544. }
  1545. onError() {
  1546. console.log("zh:spine加载出错");
  1547. }
  1548. parseComplete() {
  1549. this.loaded = true;
  1550. this.loadedCallback && this.loadedCallback();
  1551. }
  1552. dispose() {
  1553. if (this.templet && !this.templet.destroyed) {
  1554. this.templet.destroy();
  1555. }
  1556. this.templet = null;
  1557. }
  1558. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1559. if (!this.loaded) {
  1560. return;
  1561. }
  1562. let spine;
  1563. if (mySpine) {
  1564. spine = mySpine;
  1565. }
  1566. else {
  1567. spine = this.createSpine(data, parent);
  1568. }
  1569. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1570. if (!isLoop) {
  1571. spine.on(Laya.Event.STOPPED, this, () => {
  1572. spine.offAll(Laya.Event.STOPPED);
  1573. callback && callback(spine);
  1574. });
  1575. }
  1576. return spine;
  1577. }
  1578. createSpine(data, parent, type = 1) {
  1579. let spine;
  1580. spine = this.templet.buildArmature(type);
  1581. spine.showSkinByIndex(0);
  1582. parent.addChild(spine);
  1583. spine.pos(data.x, data.y);
  1584. spine.scale(data.scaleX, data.scaleY, true);
  1585. return spine;
  1586. }
  1587. }
  1588. var AIState;
  1589. (function (AIState) {
  1590. AIState[AIState["none"] = 0] = "none";
  1591. AIState[AIState["idle"] = 1] = "idle";
  1592. AIState[AIState["reset"] = 2] = "reset";
  1593. AIState[AIState["move"] = 3] = "move";
  1594. AIState[AIState["wait"] = 4] = "wait";
  1595. AIState[AIState["select"] = 5] = "select";
  1596. AIState[AIState["turn"] = 6] = "turn";
  1597. AIState[AIState["shoot"] = 7] = "shoot";
  1598. AIState[AIState["leave"] = 8] = "leave";
  1599. })(AIState || (AIState = {}));
  1600. class AIPlayer {
  1601. constructor() {
  1602. this.dtime = 30;
  1603. this.awayTime = 0;
  1604. this.awayNum = 0;
  1605. this.hideTime = 0;
  1606. this.rootMoveTime = 0;
  1607. this.isGuide = false;
  1608. this.state = AIState.none;
  1609. this.waitTime = 0;
  1610. this.forceNum = 0;
  1611. this.forceMax = 0;
  1612. this.ballSize = 33;
  1613. this.selectNum = 0;
  1614. this.destRot = 0;
  1615. this.aiLv = 10;
  1616. this.kickBall = [];
  1617. this.lineBall = [];
  1618. this.scoreBall = [];
  1619. this.holeBall = [];
  1620. this.turnNum = 0;
  1621. this.setNum = 0;
  1622. this.setMax = 0;
  1623. this.setRate = 0;
  1624. this.rectL = 0;
  1625. this.rectR = 0;
  1626. this.rectT = 0;
  1627. this.rectB = 0;
  1628. this.rootPos = { x: 0, y: 0 };
  1629. this.bestForce = 0;
  1630. this.bestAngle = 180;
  1631. this.bestPos = { x: 0, y: 0 };
  1632. this.bestKick = { x: 0, y: 0 };
  1633. this.posList = [];
  1634. this.posIdx = 0;
  1635. this.chatTime = 3000;
  1636. this.tempDir1 = new Laya.Vector2();
  1637. this.tempDir2 = new Laya.Vector2();
  1638. this.tempDir3 = new Laya.Vector2();
  1639. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1640. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1641. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1642. this.gameSrc = xGame.common.gameUI;
  1643. this.hideTime = Laya.timer.currTimer;
  1644. Moyu.setOnTipCall((id) => {
  1645. if (id == 20012)
  1646. this.hideTime = Laya.timer.currTimer;
  1647. else
  1648. (id == 20011);
  1649. {
  1650. let dt = Laya.timer.currTimer - this.hideTime;
  1651. console.log("onshow" + dt);
  1652. if (dt > 30000 && this.state > AIState.none)
  1653. xGame.common.gameMgr.aiGameEnd(false);
  1654. }
  1655. }, this);
  1656. }
  1657. init() {
  1658. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1659. this.awayTime = xGame.tools.random(5000, 10000);
  1660. this.awayNum = 0;
  1661. this.hideTime = Laya.timer.currTimer;
  1662. let rect = xGame.common.d2World.borderRect;
  1663. this.rectL = Math.ceil(rect.x) + 17;
  1664. this.rectT = Math.ceil(rect.y) + 17;
  1665. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1666. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1667. this.wBall = xGame.common.d2World.rootBall;
  1668. this.ballSize = this.wBall.gameObj.width - 1;
  1669. if (this.posList.length < 1) {
  1670. let dp = 40;
  1671. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1672. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1673. let dx = i < this.rectR ? i : this.rectR;
  1674. let dy = j < this.rectB ? j : this.rectB;
  1675. let order = xGame.tools.random(0, 1000);
  1676. this.posList.push({ x: dx, y: dy, order: order });
  1677. }
  1678. }
  1679. this.posList.sort(function (a, b) {
  1680. return a.order - b.order;
  1681. });
  1682. this.setMax = this.posList.length;
  1683. }
  1684. this.state = AIState.idle;
  1685. }
  1686. setAiLevel(num) {
  1687. this.aiLv = num;
  1688. }
  1689. initBall() {
  1690. this.rootPos.x = this.wBall.gameObj.x;
  1691. this.rootPos.y = this.wBall.gameObj.y;
  1692. this.initHoleBall();
  1693. }
  1694. initHoleBall() {
  1695. this.kickBall = [];
  1696. this.lineBall = [];
  1697. this.scoreBall = [];
  1698. this.holeBall = [];
  1699. this.selectNum = 0;
  1700. this.forceNum = 0;
  1701. this.forceMax = 0;
  1702. this.turnNum = 0;
  1703. let list = xGame.common.d2World.ballArr;
  1704. if (list.length < 20 && !this.isGuide) {
  1705. let holes = xGame.common.gameMgr.holePosList;
  1706. for (let i = 0; i < list.length; i++) {
  1707. let obj = list[i];
  1708. if (!obj)
  1709. continue;
  1710. obj.kickPos.x = 0;
  1711. obj.kickPos.y = 0;
  1712. obj.poleAngle = 0;
  1713. obj.hard = 0;
  1714. obj.borderDis = 0;
  1715. obj.kickAngle = 180;
  1716. if (obj.number == 0)
  1717. continue;
  1718. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1719. continue;
  1720. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1721. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1722. continue;
  1723. }
  1724. let b = obj.gameObj;
  1725. let wbp = this.rootPos;
  1726. let bx = wbp.x - b.x;
  1727. let by = wbp.y - b.y;
  1728. obj.borderDis = xGame.tools.random(0, 100);
  1729. this.kickBall.push(obj);
  1730. if (!this.isLine(wbp, obj))
  1731. continue;
  1732. obj.kickAngle = xGame.tools.random(90, 180);
  1733. obj.kickPos.x = b.x;
  1734. obj.kickPos.y = b.y;
  1735. this.lineBall.push(obj);
  1736. let minDis = 999999;
  1737. let hole = false;
  1738. for (let j = 0; j < holes.length; j++) {
  1739. let hp = holes[j];
  1740. if (bx >= 0 && hp.x > b.x + 100)
  1741. continue;
  1742. if (bx <= 0 && hp.x < b.x - 100)
  1743. continue;
  1744. if (by < -10 && hp.y < wbp.y)
  1745. continue;
  1746. if (by > 10 && hp.y > wbp.y)
  1747. continue;
  1748. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1749. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1750. if (dis < minDis) {
  1751. let dx = b.x - this.tempDir1.x * this.ballSize;
  1752. let dy = b.y - this.tempDir1.y * this.ballSize;
  1753. this.tempDir3.x = this.tempDir1.x;
  1754. this.tempDir3.y = this.tempDir1.y;
  1755. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1756. obj.kickPos.x = dx;
  1757. obj.kickPos.y = dy;
  1758. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1759. if (num > 1)
  1760. num = 1;
  1761. obj.kickAngle = Math.acos(num) * 57.3;
  1762. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1763. dis = dis * 2;
  1764. if (Math.abs(hp.x - 600) < 100)
  1765. dis += 50;
  1766. obj.hard = dis + obj.kickAngle * 3;
  1767. hole = true;
  1768. }
  1769. }
  1770. }
  1771. }
  1772. if (hole) {
  1773. this.scoreBall.push(obj);
  1774. this.holeBall.push(obj);
  1775. }
  1776. }
  1777. this.scoreBall.sort(function (a, b) {
  1778. return a.hard - b.hard;
  1779. });
  1780. this.holeBall.sort(function (a, b) {
  1781. return a.kickAngle - b.kickAngle;
  1782. });
  1783. this.kickBall.sort(function (a, b) {
  1784. return a.borderDis - b.borderDis;
  1785. });
  1786. }
  1787. else {
  1788. let max = list.length - 1;
  1789. let i = xGame.tools.random(0, max);
  1790. for (i; i <= max; i++) {
  1791. let idx = i >= max ? i -= max : i;
  1792. let obj = list[idx];
  1793. if (obj && obj.number != 0) {
  1794. obj.kickAngle = xGame.tools.random(90, 180);
  1795. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1796. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1797. this.lineBall.push(obj);
  1798. break;
  1799. }
  1800. }
  1801. }
  1802. }
  1803. selectBall() {
  1804. let ball = null;
  1805. this.destRot = 0;
  1806. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1807. let ai = 110 - this.aiLv * 10;
  1808. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1809. let score = false;
  1810. if (this.scoreBall.length < 1) {
  1811. if (this.lineBall.length < 1) {
  1812. for (let i = 0; i < this.kickBall.length; i++) {
  1813. let list = [];
  1814. let bo = this.kickBall[i];
  1815. let bobj = bo.gameObj;
  1816. let rect = xGame.common.d2World.borderRect;
  1817. let mobj = this.wBall.gameObj;
  1818. let minb = bobj.y - rect.y - 20;
  1819. let minw = mobj.y - rect.y - 50;
  1820. if (minb > 0 && minw > 0) {
  1821. let dlenx = 0;
  1822. let dleny = mobj.y - rect.y;
  1823. let spx = mobj.x;
  1824. let spy = rect.y - dleny;
  1825. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1826. }
  1827. minb = rect.y + rect.height - bobj.y - 20;
  1828. minw = rect.y + rect.height - mobj.y - 50;
  1829. if (minb > 0 && minw > 0) {
  1830. let dlenx = 0;
  1831. let dleny = rect.y + rect.height - mobj.y;
  1832. let spx = mobj.x;
  1833. let spy = rect.y + rect.height + dleny;
  1834. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1835. }
  1836. minb = bobj.x - rect.x - 20;
  1837. minw = mobj.x - rect.x - 50;
  1838. if (minb > 0 && minw > 0) {
  1839. let dlenx = mobj.x - rect.x;
  1840. let dleny = 0;
  1841. let spx = rect.x - dlenx;
  1842. let spy = mobj.y;
  1843. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1844. }
  1845. minb = rect.x + rect.width - bobj.x - 20;
  1846. minw = rect.x + rect.width - mobj.x - 50;
  1847. if (minb > 0 && minw > 0) {
  1848. let dlenx = rect.x + rect.width - mobj.x;
  1849. let dleny = 0;
  1850. let spx = rect.x + rect.width + dlenx;
  1851. let spy = mobj.y;
  1852. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1853. }
  1854. list.sort(function (a, b) {
  1855. return a.order - b.order;
  1856. });
  1857. for (let i = 0; i < list.length; i++) {
  1858. let data = list[i];
  1859. let mx = mobj.x - bobj.x;
  1860. let my = mobj.y - bobj.y;
  1861. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1862. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1863. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1864. if (num > 1)
  1865. num = 1;
  1866. let cos = Math.acos(num);
  1867. if (cos > 1.57)
  1868. cos = 1.57;
  1869. else if (cos < 0.01)
  1870. cos = 0.01;
  1871. let tan = Math.tan(cos);
  1872. let dx = tan * data.dleny;
  1873. let dy = tan * data.dlenx;
  1874. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1875. if (Math.abs(bx - 667) < 40)
  1876. continue;
  1877. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1878. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1879. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1880. this.forceMax = dis * 0.08;
  1881. this.destRot += mis * 0.1;
  1882. this.setKick(bx, by);
  1883. return true;
  1884. }
  1885. }
  1886. }
  1887. }
  1888. else {
  1889. ball = xGame.common.getRandArrEle(this.lineBall);
  1890. }
  1891. }
  1892. else {
  1893. for (let i = 0; i < this.scoreBall.length; i++) {
  1894. if (i < this.scoreBall.length - 1) {
  1895. let rand = 70 + this.aiLv * 10 + i * 10;
  1896. if (xGame.tools.random(0, 100) < rand) {
  1897. ball = this.scoreBall[i];
  1898. break;
  1899. }
  1900. }
  1901. else {
  1902. ball = this.scoreBall[i];
  1903. break;
  1904. }
  1905. }
  1906. score = true;
  1907. this.selectNum++;
  1908. }
  1909. if (!ball)
  1910. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1911. if (this.selectNum >= max) {
  1912. let dx = ball.gameObj.x;
  1913. let dy = ball.gameObj.y;
  1914. let kickAngle = 0;
  1915. if (score) {
  1916. dx = ball.kickPos.x;
  1917. dy = ball.kickPos.y;
  1918. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1919. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1920. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1921. if (adot > 1)
  1922. adot = 1;
  1923. kickAngle = Math.acos(adot) * 57.3;
  1924. if (kickAngle > 45) {
  1925. let kdx = ball.kickPos.x - ball.gameObj.x;
  1926. let kdy = ball.kickPos.y - ball.gameObj.y;
  1927. dx = ball.kickPos.x - kdx * mis * 0.3;
  1928. dy = ball.kickPos.y - kdy * mis * 0.3;
  1929. }
  1930. else
  1931. this.destRot += mis;
  1932. }
  1933. else if (ball.poleAngle != 0) {
  1934. this.destRot += ball.poleAngle;
  1935. }
  1936. if (xGame.common.gameMode == 0) {
  1937. let af = kickAngle * 0.08;
  1938. this.forceMax = ball.hard * 0.1 + af * af;
  1939. }
  1940. this.setKick(dx, dy);
  1941. }
  1942. else {
  1943. let rand = this.aiLv * 5 + 40;
  1944. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1945. ball = xGame.common.getRandArrEle(this.scoreBall);
  1946. else
  1947. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1948. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1949. if (xGame.tools.random(0, 100) > rand) {
  1950. this.selectNum = max;
  1951. }
  1952. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1953. this.selectNum++;
  1954. }
  1955. ball.onClick(0, true);
  1956. }
  1957. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1958. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1959. let balls = xGame.common.d2World.ballArr;
  1960. let max = xGame.tools.getDis(hx, hy, bx, by);
  1961. for (let index = 0; index < balls.length; index++) {
  1962. let obj = balls[index];
  1963. if (obj.number == 0)
  1964. continue;
  1965. if (obj.number == bn || obj.number == dn)
  1966. continue;
  1967. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  1968. if (dis * dis > max)
  1969. continue;
  1970. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  1971. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1972. if (num > 1)
  1973. num = 1;
  1974. if (num < 0)
  1975. continue;
  1976. let gap = Math.sin(Math.acos(num)) * dis;
  1977. if (gap < this.ballSize)
  1978. return true;
  1979. }
  1980. return false;
  1981. }
  1982. isLine(xy, ball) {
  1983. let bx = xy.x;
  1984. let by = xy.y;
  1985. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  1986. let dis = ball.getDestDis(xy);
  1987. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  1988. let sin = Math.sin(angle);
  1989. let cos = Math.cos(angle);
  1990. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1991. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1992. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1993. let dx = bx + this.tempDir2.x * dis;
  1994. let dy = by + this.tempDir2.y * dis;
  1995. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  1996. sin = Math.sin(-angle);
  1997. cos = Math.cos(-angle);
  1998. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1999. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2000. dx = bx + this.tempDir2.x * dis;
  2001. dy = by + this.tempDir2.y * dis;
  2002. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2003. if (isr && isl)
  2004. return false;
  2005. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2006. }
  2007. return true;
  2008. }
  2009. turnPole() {
  2010. this.turnNum++;
  2011. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2012. let dr = rot - this.destRot;
  2013. let abs = Math.abs(dr) % 360;
  2014. if (abs > 180) {
  2015. if (rot > 180)
  2016. rot -= 360;
  2017. if (this.destRot > 180)
  2018. this.destRot -= 360;
  2019. }
  2020. let max = this.turnNum * 5 + this.aiLv * 5;
  2021. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2022. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2023. let at = xGame.tools.random(1000, 2000);
  2024. if (!this.onAway(3))
  2025. at += xGame.tools.random(10000, 15000);
  2026. this.setState(AIState.shoot, at);
  2027. }
  2028. else {
  2029. let mr = 0;
  2030. if (abs > 3)
  2031. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2032. else if (Math.random() > 0.6)
  2033. mr = xGame.tools.random(1, 10) * 0.1;
  2034. mr = dr > 0 ? -mr : mr;
  2035. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2036. }
  2037. }
  2038. setKick(dx, dy) {
  2039. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2040. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2041. this.tempDir1.x = 0;
  2042. this.tempDir1.y = 1;
  2043. this.tempDir2.y = -this.tempDir2.y;
  2044. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2045. if (num > 1)
  2046. num = 1;
  2047. let rot = Math.acos(num) * 57.3;
  2048. if (this.tempDir2.x < 0)
  2049. rot = 360 - rot;
  2050. this.destRot += rot;
  2051. if (!xGame.common.gameMgr.finishOneShoot) {
  2052. this.forceMax += xGame.tools.random(10, 50);
  2053. this.forceMax -= this.aiLv * 2;
  2054. if (this.forceMax < 20)
  2055. this.forceMax = 20;
  2056. }
  2057. if (this.forceMax > 100)
  2058. this.forceMax = 101;
  2059. else if (this.forceMax < 10)
  2060. this.forceMax += xGame.tools.random(0, 10);
  2061. if (xGame.common.gameMode == 1)
  2062. this.forceMax = xGame.tools.random(80, 100);
  2063. else
  2064. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2065. let max = 2000 - this.aiLv * 100;
  2066. if (Math.random() > 0.8)
  2067. max += xGame.tools.random(100, 2000);
  2068. this.setState(AIState.turn, xGame.tools.random(500, max));
  2069. }
  2070. shoot() {
  2071. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2072. if (Math.random() > 0.8) {
  2073. this.gameSrc.aiForce(1);
  2074. this.setState(AIState.wait);
  2075. }
  2076. }
  2077. else {
  2078. let df = xGame.tools.random(3, 8);
  2079. if (this.forceNum < this.forceMax)
  2080. this.forceNum += df;
  2081. else
  2082. this.forceNum -= df;
  2083. let startY = this.gameSrc.ui.powerNode.y;
  2084. let height = this.gameSrc.ui.powerNode.height;
  2085. let force = startY + height * this.forceNum * 0.01;
  2086. this.gameSrc.aiForce(2, force);
  2087. }
  2088. }
  2089. reset() {
  2090. for (let i = 0; i < 4; i++) {
  2091. this.setRate--;
  2092. this.setNum++;
  2093. let pos = this.posList[this.posIdx];
  2094. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2095. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2096. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2097. this.rootPos.x = 387;
  2098. if (this.rootPos.x < this.rectL)
  2099. this.rootPos.x = this.rectL;
  2100. else if (this.rootPos.x > this.rectR)
  2101. this.rootPos.x = this.rectR;
  2102. if (this.rootPos.y < this.rectT)
  2103. this.rootPos.y = this.rectT;
  2104. else if (this.rootPos.y > this.rectB)
  2105. this.rootPos.y = this.rectB;
  2106. this.posIdx++;
  2107. let max = this.posList.length;
  2108. if (this.posIdx >= max)
  2109. this.posIdx -= max;
  2110. this.initHoleBall();
  2111. let ball = null;
  2112. if (this.scoreBall.length > 0)
  2113. ball = this.scoreBall[0];
  2114. else if (this.lineBall.length > 0)
  2115. ball = xGame.common.getRandArrEle(this.lineBall);
  2116. if (ball && ball.kickAngle < this.bestAngle) {
  2117. this.bestAngle = ball.kickAngle;
  2118. this.bestKick.x = ball.kickPos.x;
  2119. this.bestKick.y = ball.kickPos.y;
  2120. this.bestPos.x = this.rootPos.x;
  2121. this.bestPos.y = this.rootPos.y;
  2122. this.bestForce = ball.hard * 0.08;
  2123. }
  2124. }
  2125. if (this.setNum >= this.setMax)
  2126. this.setMax = 0;
  2127. if (this.setRate < 1) {
  2128. this.setState(AIState.move, 0);
  2129. this.rootMoveTime = Laya.timer.currTimer;
  2130. this.gameSrc.aiRootMove(true);
  2131. }
  2132. }
  2133. delayLine() {
  2134. this.gameSrc.aiRootMove(false);
  2135. }
  2136. move() {
  2137. if (this.bestPos.x < 1)
  2138. this.bestPos = this.rootPos;
  2139. let wObj = this.wBall.gameObj;
  2140. let destx = wObj.x;
  2141. let desty = wObj.y;
  2142. let dx = Math.abs(destx - this.bestPos.x);
  2143. let dy = Math.abs(desty - this.bestPos.y);
  2144. let mx = 3 + dx * 0.03;
  2145. let my = 3 + dy * 0.03;
  2146. if (dx < 4 && dy < 4) {
  2147. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2148. dt = dt < 1000 ? 1000 - dt : 0;
  2149. if (this.setMax > 0) {
  2150. let min = this.setMax * 0.3 + this.aiLv * 5;
  2151. this.setRate = xGame.tools.random(min, this.setMax);
  2152. this.setState(AIState.reset, 0);
  2153. }
  2154. else {
  2155. this.destRot = 0;
  2156. this.forceMax = this.bestForce;
  2157. this.setKick(this.bestKick.x, this.bestKick.y);
  2158. }
  2159. if (dt > 100) {
  2160. Laya.timer.clear(this, this.delayLine);
  2161. Laya.timer.once(dt, this, this.delayLine);
  2162. }
  2163. else
  2164. this.gameSrc.aiRootMove(false);
  2165. }
  2166. else {
  2167. if (dx > 4)
  2168. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2169. if (dy > 4)
  2170. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2171. this.gameSrc.onRootMove({ x: destx, y: desty });
  2172. }
  2173. }
  2174. resetRoot() {
  2175. this.bestAngle = 180;
  2176. this.bestForce = 0;
  2177. this.setMax = this.posList.length;
  2178. this.posIdx = xGame.tools.random(0, this.setMax);
  2179. let min = this.setMax * 0.3 + this.aiLv * 5;
  2180. this.setRate = xGame.tools.random(min, this.setMax);
  2181. let max = 2000 - this.aiLv * 100;
  2182. if (Math.random() > 0.8)
  2183. max += xGame.tools.random(100, 1000);
  2184. if (this.isGuide)
  2185. this.setState(AIState.select, 500);
  2186. else if (this.onAway(2))
  2187. this.setState(AIState.reset, xGame.tools.random(400, max));
  2188. else
  2189. this.setState(AIState.none);
  2190. if (xGame.common.gameMgr.finishOneShoot)
  2191. this.chat();
  2192. }
  2193. runAI() {
  2194. if (this.state > AIState.idle)
  2195. return;
  2196. this.initBall();
  2197. this.onGame(2500);
  2198. if (Math.random() > 0.6)
  2199. this.chat();
  2200. }
  2201. stopRun() {
  2202. this.setState(AIState.idle);
  2203. }
  2204. onGame(base) {
  2205. let max = base - this.aiLv * 100;
  2206. if (Math.random() > 0.8)
  2207. max += xGame.tools.random(100, 1000);
  2208. if (this.onAway(2))
  2209. this.setState(AIState.select, xGame.tools.random(500, max));
  2210. else
  2211. this.setState(AIState.none);
  2212. }
  2213. setState(sta, wt = 0) {
  2214. if (this.state == AIState.none)
  2215. return;
  2216. this.state = sta;
  2217. this.waitTime = wt;
  2218. }
  2219. onUpdate() {
  2220. if (this.state == AIState.none)
  2221. return;
  2222. this.awayTime -= this.dtime;
  2223. if (this.awayTime < 1) {
  2224. this.awayTime = xGame.tools.random(6000, 10000);
  2225. this.awayNum += (11 - this.aiLv);
  2226. this.onAway(1);
  2227. }
  2228. if (this.waitTime >= 0) {
  2229. this.waitTime -= this.dtime;
  2230. return;
  2231. }
  2232. switch (this.state) {
  2233. case AIState.idle:
  2234. this.chat();
  2235. break;
  2236. case AIState.reset:
  2237. this.reset();
  2238. break;
  2239. case AIState.move:
  2240. this.move();
  2241. break;
  2242. case AIState.leave:
  2243. this.state = AIState.none;
  2244. xGame.common.gameMgr.aiGameEnd(true);
  2245. break;
  2246. case AIState.select:
  2247. this.selectBall();
  2248. break;
  2249. case AIState.turn:
  2250. this.turnPole();
  2251. break;
  2252. case AIState.shoot:
  2253. this.shoot();
  2254. break;
  2255. }
  2256. }
  2257. onAway(type) {
  2258. if (type == 1) {
  2259. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2260. let num = this.awayNum + db * 20;
  2261. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2262. xGame.common.gameMgr.aiLeave();
  2263. this.setState(AIState.leave, 6666);
  2264. }
  2265. }
  2266. else if (type == 2) {
  2267. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2268. let num = this.awayNum + db * 30;
  2269. if (xGame.tools.random(0, 10000) < num)
  2270. return false;
  2271. }
  2272. else if (type == 3) {
  2273. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2274. let num = this.awayNum + db * 10;
  2275. if (xGame.tools.random(0, 4000) < num)
  2276. return false;
  2277. }
  2278. return true;
  2279. }
  2280. chat() {
  2281. if (this.chatTime > 0) {
  2282. this.chatTime -= this.dtime;
  2283. return;
  2284. }
  2285. this.chatTime = xGame.tools.random(2000, 10000);
  2286. let rand = xGame.tools.random(0, 100);
  2287. if (rand < 15)
  2288. this.talk();
  2289. else if (rand < 35)
  2290. this.emotion();
  2291. }
  2292. talk() {
  2293. xGame.common.talkMgr.showAITalk(0);
  2294. }
  2295. emotion() {
  2296. xGame.common.talkMgr.showAIEmotion(0);
  2297. }
  2298. resetAI() {
  2299. this.stopRun();
  2300. this.state = AIState.none;
  2301. }
  2302. }
  2303. class Partical extends Laya.Script3D {
  2304. constructor() {
  2305. super();
  2306. this.duration = 2000;
  2307. }
  2308. ;
  2309. onAwake() {
  2310. this.gameObj = this.owner;
  2311. }
  2312. onEnable() {
  2313. this.openTimer();
  2314. }
  2315. openTimer() {
  2316. Laya.timer.once(this.duration, this, this.disappear);
  2317. }
  2318. setCallback(obj, callback) {
  2319. this.obj = obj;
  2320. this.callback = callback;
  2321. Laya.timer.clearAll(this);
  2322. Laya.timer.once(this.duration, this, this.disappear);
  2323. }
  2324. disappear() {
  2325. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2326. this.callback && this.callback(this.obj);
  2327. }
  2328. }
  2329. class Ball extends Laya.Script3D {
  2330. constructor() {
  2331. super();
  2332. this.posV3 = new Laya.Vector3();
  2333. this.rotRate = 2.1;
  2334. this.rotSpeed = new Laya.Vector3();
  2335. this.myIndex = 0;
  2336. }
  2337. onAwake() {
  2338. this.gameObj = this.owner;
  2339. this.transform = this.gameObj.transform;
  2340. this.ballNode = this.gameObj.getChildByName("Ball");
  2341. this.shadowNode = this.gameObj.getChildByName("shadow");
  2342. }
  2343. initSelf(index, x, y, owner) {
  2344. this.d2BallSrc = owner;
  2345. this.myIndex = index;
  2346. this.setAlbedoTexture();
  2347. this.setTransPos(x, y);
  2348. this.setScale();
  2349. this.ballNode.transform.localRotationEulerX = 90;
  2350. if (index == 0) {
  2351. }
  2352. }
  2353. setAlbedoTexture(isIce = false) {
  2354. let url;
  2355. if (isIce) {
  2356. url = `res/d3Res/ballTexture/ice.jpg`;
  2357. }
  2358. else {
  2359. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2360. }
  2361. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2362. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2363. }));
  2364. }
  2365. runFireworks(obj, delay, callback) {
  2366. Laya.timer.clearAll(this);
  2367. Laya.timer.once(delay + 1, this, () => {
  2368. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2369. fire.transform.localPositionX = this.transform.localPositionX;
  2370. fire.transform.localPositionY = this.transform.localPositionY;
  2371. fire.transform.localPositionZ = this.transform.localPositionZ;
  2372. let src = fire.getComponent(Partical);
  2373. src.duration = 1000;
  2374. src.setCallback(obj, callback);
  2375. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2376. eft.transform.localPositionX = this.transform.localPositionX;
  2377. eft.transform.localPositionY = this.transform.localPositionY;
  2378. eft.transform.localPositionZ = this.transform.localPositionZ;
  2379. });
  2380. }
  2381. setTransPos(x, y) {
  2382. this.setRotation();
  2383. xGame.common.pos2to3Convert(x, y, this.posV3);
  2384. this.transform.localPositionX = this.posV3.x;
  2385. this.transform.localPositionY = 0;
  2386. this.transform.localPositionZ = this.posV3.z;
  2387. this.transform.localRotationEulerX = 0;
  2388. this.transform.localRotationEulerY = 0;
  2389. this.transform.localRotationEulerZ = 0;
  2390. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2391. this.shadowNode.transform.localPositionY = 0.1;
  2392. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2393. }
  2394. setRotation() {
  2395. if (this.d2BallSrc.canRot) {
  2396. let speed = this.d2BallSrc.rigy.linearVelocity;
  2397. this.rotSpeed.x = speed.x * this.rotRate;
  2398. this.rotSpeed.z = speed.y * this.rotRate;
  2399. this.rotSpeed.y = this.d2BallSrc.rotY;
  2400. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2401. }
  2402. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2403. this.rotSpeed.x = this.rotSpeed.y = 0;
  2404. this.rotSpeed.y = this.d2BallSrc.rotY;
  2405. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2406. }
  2407. }
  2408. setScale() {
  2409. let radius = xGame.common.d2World.rootBall.ui.width;
  2410. let scale = xGame.common.scale2to3Convert(radius);
  2411. this.transform.localScaleX = scale;
  2412. this.transform.localScaleY = scale;
  2413. this.transform.localScaleZ = scale;
  2414. }
  2415. playInHoleEft() {
  2416. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2417. eft.transform.position = this.transform.position;
  2418. }
  2419. playIceEft() {
  2420. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2421. eft.transform.position = this.transform.position;
  2422. }
  2423. get scaleXYZ() {
  2424. return this.transform.localScaleX;
  2425. }
  2426. set scaleXYZ(val) {
  2427. this.transform.localScaleX = val;
  2428. this.transform.localScaleY = val;
  2429. this.transform.localScaleZ = val;
  2430. }
  2431. get posX() {
  2432. return this.transform.localPositionX;
  2433. }
  2434. set posX(val) {
  2435. this.transform.localPositionX = val;
  2436. }
  2437. get posY() {
  2438. return this.transform.localPositionY;
  2439. }
  2440. set posY(val) {
  2441. this.transform.localPositionY = val;
  2442. }
  2443. get posZ() {
  2444. return this.transform.localPositionZ;
  2445. }
  2446. set posZ(val) {
  2447. this.transform.localPositionZ = val;
  2448. }
  2449. destroySelf() {
  2450. this.posV3 = null;
  2451. this.rotSpeed = null;
  2452. this.d2BallSrc = null;
  2453. this.ballNode = null;
  2454. this.gameObj.destroy(true);
  2455. this.transform = null;
  2456. this.destroy();
  2457. }
  2458. }
  2459. class ui_D2Ball extends fgui.GComponent {
  2460. static createInstance() {
  2461. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2462. }
  2463. onConstruct() {
  2464. this.myIcon = (this.getChild("myIcon"));
  2465. this.inner = (this.getChild("inner"));
  2466. this.n8 = (this.getChild("n8"));
  2467. this.n4 = (this.getChild("n4"));
  2468. this.wrongTips = (this.getChild("wrongTips"));
  2469. this.rightTips = (this.getChild("rightTips"));
  2470. this.breathAni = this.getTransition("breathAni");
  2471. }
  2472. }
  2473. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2474. class D2BallSrc extends Laya.Script {
  2475. constructor() {
  2476. super();
  2477. this.number = 0;
  2478. this.startX = 0;
  2479. this.startY = 0;
  2480. this.angleV2 = new Laya.Vector2();
  2481. this.isRootBall = false;
  2482. this.isBlackBall = false;
  2483. this.ballType = "";
  2484. this.canRot = true;
  2485. this.rotY = 0;
  2486. this.poleAngle = 0;
  2487. this.kickPos = { x: 0, y: 0 };
  2488. this.hard = 0;
  2489. this.kickAngle = 0;
  2490. this.borderDis = 0;
  2491. this.speedP10 = 5.6;
  2492. this.lastSpeed = { x: 0, y: 0 };
  2493. this.stillSpeed = 0.12;
  2494. this.ballFunc = "normal";
  2495. this.isRunSkillAni = false;
  2496. this.isInHole = false;
  2497. this.iceOwner = "";
  2498. this.forceRun = false;
  2499. this.myUNID = "";
  2500. this.rectL = 0;
  2501. this.rectR = 0;
  2502. this.rectT = 0;
  2503. this.rectB = 0;
  2504. this.forceVec = new Laya.Vector2();
  2505. this.lastDis = 0;
  2506. this.helpOut = { type: "", x: 0, y: 0 };
  2507. }
  2508. initSelf(number, x, y, d3Ball) {
  2509. if (!this.gameObj)
  2510. this.gameObj = this.owner;
  2511. this.number = number;
  2512. this.startX = x;
  2513. this.startY = y;
  2514. this.d3Ball = d3Ball;
  2515. this.isRootBall = false;
  2516. this.isBlackBall = false;
  2517. this.ballType = "";
  2518. if (number == 0) {
  2519. this.isRootBall = true;
  2520. }
  2521. else if (number == 8) {
  2522. this.isBlackBall = true;
  2523. }
  2524. else {
  2525. if (number <= 7) {
  2526. this.ballType = ballCamp.full;
  2527. }
  2528. else {
  2529. this.ballType = ballCamp.flower;
  2530. }
  2531. }
  2532. this.setInfo();
  2533. this.setD3Ball();
  2534. this.owner["mySrc"] = this;
  2535. this.rigy.linearDamping = 1;
  2536. D2BallSrc._unid++;
  2537. this.myUNID = "d2ball" + D2BallSrc._unid;
  2538. let rect = xGame.common.d2World.borderRect;
  2539. this.rectL = Math.ceil(rect.x) + 20;
  2540. this.rectT = Math.ceil(rect.y) + 20;
  2541. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2542. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2543. }
  2544. setInfo() {
  2545. this.gameObj.x = this.startX;
  2546. this.gameObj.y = this.startY;
  2547. let radius = this.ui.width / 2;
  2548. this.gameObj.width = radius * 2;
  2549. this.gameObj.height = radius * 2;
  2550. if (xGame.common.showDebug) {
  2551. this.ui.myIcon.alpha = 1;
  2552. this.ui.inner.alpha = 1;
  2553. }
  2554. else {
  2555. this.ui.myIcon.alpha = 0;
  2556. this.ui.inner.alpha = 0;
  2557. }
  2558. }
  2559. setD3Ball() {
  2560. this.d3Ball = this.d3Ball;
  2561. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2562. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2563. }
  2564. onUpdate() {
  2565. if (xGame.common.gameMgr.gamePause)
  2566. return;
  2567. if (this.isInHole)
  2568. return;
  2569. if (!xGame.common.d2World.openCheckStill)
  2570. return;
  2571. this.runBall();
  2572. }
  2573. runBall() {
  2574. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2575. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2576. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2577. this.judgeBorder();
  2578. }
  2579. getDestDis(dest) {
  2580. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2581. }
  2582. setmyXY(x, y) {
  2583. this.d3BallSrc.setTransPos(x, y);
  2584. }
  2585. getSpeed() {
  2586. let speed = this.rigy.linearVelocity;
  2587. return speed.x * speed.x + speed.y * speed.y;
  2588. }
  2589. onTriggerEnter(collider) {
  2590. if (!collider || !collider.owner)
  2591. return;
  2592. let coll = "collide";
  2593. let speed = this.getSpeed();
  2594. let sv2 = this.speedP10 * this.speedP10;
  2595. if (collider.label == "ball") {
  2596. if (speed < 9 && this.number != 0)
  2597. coll = "";
  2598. else if (speed < sv2)
  2599. coll = "collide_4";
  2600. else if (speed < sv2 * 6.2)
  2601. coll = "collide_3";
  2602. else if (speed < sv2 * 25)
  2603. coll = "collide_2";
  2604. else if (speed < sv2 * 56)
  2605. coll = "collide_1";
  2606. xGame.soundMgr.playSound(coll);
  2607. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2608. if (collider.owner) {
  2609. let rig = collider.owner.getComponent(D2BallSrc);
  2610. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2611. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2612. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2613. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2614. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2615. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2616. let rx = 0;
  2617. let ry = 0;
  2618. if (this.gameObj.x < this.rectL)
  2619. rx = vx;
  2620. else if (this.gameObj.x > this.rectR)
  2621. rx = -vx;
  2622. else if (this.gameObj.y < this.rectT)
  2623. ry = vy;
  2624. else if (this.gameObj.y > this.rectB)
  2625. ry = -vy;
  2626. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2627. }
  2628. }
  2629. if (this.number != 0) {
  2630. return;
  2631. }
  2632. else {
  2633. if (this.forceRun) {
  2634. console.log("randon force");
  2635. this.applyForce(collider);
  2636. }
  2637. }
  2638. if (xGame.common.d2World.isOnSameLine) {
  2639. xGame.common.d2World.isOnSameLine = false;
  2640. this.rigy.linearVelocity = { x: 0, y: 0 };
  2641. }
  2642. if (xGame.common.gameMgr.firstColliObj == null) {
  2643. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2644. xGame.common.gameMgr.isTouchedBall = true;
  2645. }
  2646. }
  2647. else {
  2648. xGame.common.recoverCameraView();
  2649. let wallStr = "";
  2650. if (speed < 9) { }
  2651. else if (speed < sv2) { }
  2652. else if (speed < sv2 * 6.2)
  2653. wallStr = "wall_30";
  2654. else if (speed < sv2 * 25)
  2655. wallStr = "wall_50";
  2656. else if (speed < sv2 * 56)
  2657. wallStr = "wall_80";
  2658. xGame.soundMgr.playSound(wallStr);
  2659. }
  2660. }
  2661. applyForce(collider) {
  2662. let src = collider.owner.mySrc;
  2663. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2664. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2665. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2666. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2667. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2668. }
  2669. checkWrongBall(playEft = true) {
  2670. if (this.isInHole)
  2671. return;
  2672. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2673. if (this.number != 0 && playEft)
  2674. this.d3BallSrc.playInHoleEft();
  2675. let coll = "inpocket_1";
  2676. let speed = this.getSpeed();
  2677. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2678. if (speed < 9 && this.number != 0)
  2679. coll = "";
  2680. else if (speed < sv2 * 6.2)
  2681. coll = "inpocket_4";
  2682. else if (speed < sv2 * 25)
  2683. coll = "collide_3";
  2684. else if (speed < sv2 * 56)
  2685. coll = "collide_2";
  2686. xGame.soundMgr.playSound(coll);
  2687. this.isInHole = true;
  2688. if (this.number == 0) {
  2689. console.log("白球进了。。");
  2690. this.reset();
  2691. this.rigy.linearVelocity = { x: 0, y: 0 };
  2692. this.hideSelf();
  2693. xGame.common.gameUI.ui.whiteAni.visible = true;
  2694. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2695. xGame.common.gameUI.ui.whiteAni.visible = false;
  2696. }));
  2697. }
  2698. else {
  2699. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2700. xGame.common.d2World.removeOneBall(this);
  2701. this.destroySelf();
  2702. xGame.common.playHappySound(this.number);
  2703. this.runFlyEft();
  2704. }
  2705. }
  2706. runFlyEft() {
  2707. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2708. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2709. }
  2710. }
  2711. hideSelf() {
  2712. if (this.d3Ball)
  2713. this.d3Ball.active = false;
  2714. }
  2715. showSelf() {
  2716. this.isInHole = false;
  2717. if (this.d3Ball && !this.d3Ball.active)
  2718. this.d3Ball.active = true;
  2719. }
  2720. isStill() {
  2721. let speed = this.rigy.linearVelocity;
  2722. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2723. this.rigy.linearVelocity = { x: 0, y: 0 };
  2724. return true;
  2725. }
  2726. return false;
  2727. }
  2728. reset() {
  2729. }
  2730. destroySelf() {
  2731. this.d3BallSrc.destroySelf();
  2732. if (!this.ui.isDisposed) {
  2733. this.ui.removeFromParent();
  2734. this.ui.dispose();
  2735. this.ui = null;
  2736. }
  2737. this.outColli = null;
  2738. this.innerColli = null;
  2739. this.rigy = null;
  2740. this.d3Ball = null;
  2741. this.d3BallSrc = null;
  2742. this.angleV2 = null;
  2743. this.gameObj.destroy(true);
  2744. this.destroy();
  2745. }
  2746. judgeBorder() {
  2747. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2748. return;
  2749. }
  2750. if (this.destroyed)
  2751. return;
  2752. if (xGame.common.gameMode == GameMode.classic)
  2753. return;
  2754. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2755. if (isOver) {
  2756. this.checkWrongBall();
  2757. }
  2758. }
  2759. onClick(e, force = false) {
  2760. if (this.number == 0)
  2761. return;
  2762. if (force) {
  2763. }
  2764. else {
  2765. if (xGame.common.d2World.openCheckStill)
  2766. return;
  2767. if (!xGame.common.gameMgr.selfTurn) {
  2768. return;
  2769. }
  2770. }
  2771. if (!xGame.common.gameMgr.finishOneShoot)
  2772. return;
  2773. let root = xGame.common.d2World.rootBall.gameObj;
  2774. let x = this.gameObj.x - root.x;
  2775. let y = this.gameObj.y - root.y;
  2776. let angle = xGame.common.getfguiRotation(x, y);
  2777. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2778. xGame.common.d2World.getHelpLine();
  2779. xGame.common.clickedBall = true;
  2780. this.checkGuide();
  2781. }
  2782. checkGuide() {
  2783. let guide = DataMgr.getSkillGuide();
  2784. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2785. xGame.common.guideStep++;
  2786. xGame.common.gameUI.ui.guide1.visible = false;
  2787. xGame.common.gameUI.ui.guide2.visible = true;
  2788. }
  2789. }
  2790. checkDistance(disX, disY, angle) {
  2791. let diameter = this.gameObj.width - 1;
  2792. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2793. if (!this.lastDis)
  2794. this.lastDis = dis;
  2795. else {
  2796. if (dis > this.lastDis) {
  2797. this.helpOut.type = "remove";
  2798. return this.helpOut;
  2799. }
  2800. }
  2801. if (dis <= Math.pow(diameter, 2)) {
  2802. let del = 0.01;
  2803. let offest = 0;
  2804. let realX = disX - this.gameObj.x;
  2805. let realY = disY - this.gameObj.y;
  2806. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2807. offest += del;
  2808. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2809. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2810. }
  2811. this.helpOut.type = "ok";
  2812. this.helpOut.x = realX + this.gameObj.x;
  2813. this.helpOut.y = realY + this.gameObj.y;
  2814. return this.helpOut;
  2815. }
  2816. else {
  2817. this.helpOut.type = "no";
  2818. return this.helpOut;
  2819. }
  2820. }
  2821. clearBallEft() {
  2822. this.clearBallRightEft();
  2823. this.clearBallWrongEft();
  2824. }
  2825. clearBallRightEft() {
  2826. this.ui.breathAni.stop();
  2827. this.ui.rightTips.visible = false;
  2828. }
  2829. clearBallWrongEft() {
  2830. this.ui.wrongTips.visible = false;
  2831. }
  2832. showWrongEft() {
  2833. if (!xGame.common.gameMgr.selfTurn)
  2834. return;
  2835. this.ui.wrongTips.visible = true;
  2836. }
  2837. showRightEft() {
  2838. if (!xGame.common.gameMgr.selfTurn)
  2839. return;
  2840. this.ui.rightTips.visible = true;
  2841. this.ui.rightTips.scaleX = 1;
  2842. this.ui.rightTips.scaleY = 1;
  2843. this.ui.breathAni.play();
  2844. }
  2845. setBallFunc(type, owner) {
  2846. if (type == "ice") {
  2847. this.ballFunc = type;
  2848. this.d3BallSrc.setAlbedoTexture(true);
  2849. this.rigy.type = "static";
  2850. this.iceOwner = owner;
  2851. }
  2852. else {
  2853. if (owner == this.iceOwner) {
  2854. this.ballFunc = type;
  2855. this.d3BallSrc.setAlbedoTexture(false);
  2856. this.rigy.type = "dynamic";
  2857. }
  2858. }
  2859. }
  2860. }
  2861. D2BallSrc._unid = 0;
  2862. class D2RootBallSrc extends D2BallSrc {
  2863. constructor() {
  2864. super();
  2865. this.maxSpeed = 0;
  2866. this.classicMaxSpeed = 2.2;
  2867. this.bigSkillMaxSpeed = 4;
  2868. this.angle = 0;
  2869. this.allPercent = 0;
  2870. this.linearPercent = 0;
  2871. this.anglePercent = 0;
  2872. this.maxAngleRate = 0.6;
  2873. this.baseRot = 7;
  2874. this.angleMax = 0;
  2875. this.speed = new Laya.Vector2();
  2876. this.rotSpeed = new Laya.Vector2();
  2877. }
  2878. isStill() {
  2879. let speed = this.rigy.linearVelocity;
  2880. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2881. if (this.anglePercent <= 0.1) {
  2882. this.rigy.linearVelocity = { x: 0, y: 0 };
  2883. return true;
  2884. }
  2885. }
  2886. return false;
  2887. }
  2888. reset() {
  2889. this.linearPercent = 0;
  2890. this.anglePercent = 0;
  2891. }
  2892. setSpeed(percent, angle) {
  2893. this.allPercent = percent;
  2894. this.angle = angle;
  2895. this.setAngleSpeed();
  2896. this.setLinearSpeed();
  2897. let hit = "hit";
  2898. if (percent < 25)
  2899. hit = "hit03";
  2900. else if (percent < 50)
  2901. hit = "hit02";
  2902. else if (percent < 75)
  2903. hit = "hit01";
  2904. xGame.soundMgr.playSound(hit);
  2905. }
  2906. setAngleSpeed() {
  2907. let offest = xGame.common.rodOffest;
  2908. let radius = 82;
  2909. let rate = Math.abs(offest.y / radius) * 0.5;
  2910. if (offest.y > 0)
  2911. this.angleMax = -this.baseRot * 2;
  2912. else
  2913. this.angleMax = this.baseRot;
  2914. this.rotY = -offest.x / radius * 100;
  2915. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2916. this.linearPercent = this.allPercent - this.anglePercent;
  2917. }
  2918. setLinearSpeed() {
  2919. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2920. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2921. if (!xGame.common.longHelpLine) {
  2922. let offset = -150 + xGame.common.randomNum(0, 300);
  2923. offset /= 100;
  2924. this.angle += offset;
  2925. }
  2926. }
  2927. }
  2928. let sin = Math.sin(this.angle * Math.PI / 180);
  2929. let cos = Math.cos(this.angle * Math.PI / 180);
  2930. switch (xGame.common.gameMode) {
  2931. case GameMode.classic:
  2932. this.maxSpeed = this.classicMaxSpeed;
  2933. break;
  2934. case GameMode.bigMove:
  2935. this.maxSpeed = this.bigSkillMaxSpeed;
  2936. break;
  2937. case GameMode.placeBall:
  2938. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2939. if (data.type == 1) {
  2940. this.maxSpeed = this.bigSkillMaxSpeed;
  2941. }
  2942. else {
  2943. this.maxSpeed = this.classicMaxSpeed;
  2944. }
  2945. break;
  2946. default:
  2947. break;
  2948. }
  2949. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2950. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2951. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2952. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2953. this.rigy.applyLinearImpulseToCenter(this.speed);
  2954. }
  2955. onUpdate() {
  2956. if (this.anglePercent > 0.1) {
  2957. this.anglePercent *= 0.97;
  2958. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2959. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2960. this.rigy.applyForceToCenter(this.rotSpeed);
  2961. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  2962. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  2963. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  2964. if (num > 0.9)
  2965. this.canRot = true;
  2966. }
  2967. else
  2968. this.canRot = true;
  2969. if (Math.abs(this.rotY) > 0.1)
  2970. this.rotY *= 0.98;
  2971. super.onUpdate();
  2972. }
  2973. destroySelf() {
  2974. super.destroySelf();
  2975. this.speed = null;
  2976. }
  2977. }
  2978. class D2Ball extends Laya.Sprite {
  2979. constructor(isRootBall = false) {
  2980. super();
  2981. this.ui = ui_D2Ball.createInstance();
  2982. this.pivotX = this.ui.width / 2;
  2983. this.pivotY = this.ui.width / 2;
  2984. this.x = 0;
  2985. this.y = 0;
  2986. this.addChild(this.ui.displayObject);
  2987. this.ui.displayObject.x += this.ui.width / 2;
  2988. this.ui.displayObject.y += this.ui.width / 2;
  2989. if (isRootBall) {
  2990. this.d2Src = this.addComponent(D2RootBallSrc);
  2991. }
  2992. else {
  2993. this.d2Src = this.addComponent(D2BallSrc);
  2994. }
  2995. this.d2Src.ui = this.ui;
  2996. this.addCircleCollider();
  2997. this.addInnerCircleCollider();
  2998. this.addRigyBody();
  2999. }
  3000. addCircleCollider() {
  3001. let colli = xGame.common.getCollider("circle");
  3002. colli.radius = this.ui.width / 2;
  3003. this.addComponentIntance(colli);
  3004. this.d2Src.outColli = colli;
  3005. colli.label = "ball";
  3006. }
  3007. addInnerCircleCollider() {
  3008. let colli = xGame.common.getCollider("circle");
  3009. colli.radius = this.ui.inner.width / 2;
  3010. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3011. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3012. this.addComponentIntance(colli);
  3013. this.d2Src.innerColli = colli;
  3014. colli.label = "inner";
  3015. }
  3016. addRigyBody() {
  3017. let rigy = xGame.common.getRigbody();
  3018. rigy.type = "dynamic";
  3019. this.addComponentIntance(rigy);
  3020. this.d2Src.rigy = rigy;
  3021. }
  3022. disposeSelf() {
  3023. if (!this.ui.isDisposed) {
  3024. this.ui.dispose();
  3025. this.ui.removeFromParent();
  3026. this.ui = null;
  3027. }
  3028. }
  3029. }
  3030. class ui_D2Gan extends fgui.GComponent {
  3031. static createInstance() {
  3032. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3033. }
  3034. onConstruct() {
  3035. this.myIcon = (this.getChild("myIcon"));
  3036. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3037. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3038. this.self = (this.getChild("self"));
  3039. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3040. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3041. this.ai = (this.getChild("ai"));
  3042. }
  3043. }
  3044. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3045. class D2Gan {
  3046. constructor() {
  3047. this.offset = 0.15;
  3048. this.cell = 1.5;
  3049. this.onBallCell = 0.4;
  3050. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3051. this.moveNum = 70;
  3052. this.rulerRate = 0.1;
  3053. this.ui = ui_D2Gan.createInstance();
  3054. this.changeSelfRod();
  3055. this.changeAIRod();
  3056. }
  3057. changeSelfRod() {
  3058. let index = DataMgr.getCurBallRod();
  3059. let data = cfgTable.ballrodData[index + 1];
  3060. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3061. this.selfMySpine && this.selfMySpine.dispose();
  3062. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3063. if (data.spine) {
  3064. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3065. this.selfMySpine = new SpineMgr(data.spine, () => {
  3066. let xx = this.ui.selfEftRoot.width / 2;
  3067. let yy = this.ui.selfEftRoot.height / 2;
  3068. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3069. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3070. outSpine.rotation = -90;
  3071. });
  3072. }
  3073. }
  3074. changeAIRod() {
  3075. let length = Object.keys(cfgTable.ballrodData).length;
  3076. let rand = Math.floor(length * Math.random()) + 1;
  3077. let data = cfgTable.ballrodData[rand];
  3078. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3079. this.aiMySpine && this.aiMySpine.dispose();
  3080. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3081. if (data.spine) {
  3082. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3083. this.aiMySpine = new SpineMgr(data.spine, () => {
  3084. let xx = this.ui.aiEftRoot.width / 2;
  3085. let yy = this.ui.aiEftRoot.height / 2;
  3086. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3087. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3088. outSpine.rotation = -90;
  3089. });
  3090. }
  3091. }
  3092. setGanLastInfo() {
  3093. this.lastInfo.rotation = this.ui.rotation;
  3094. this.lastInfo.x = this.ui.x;
  3095. this.lastInfo.y = this.ui.y;
  3096. }
  3097. rotateSelf(flag, isRuler = false) {
  3098. let angle;
  3099. flag = flag * this.offset;
  3100. if (xGame.common.d2World.isHelpLineOnBall) {
  3101. angle = flag * this.onBallCell;
  3102. }
  3103. else {
  3104. angle = flag * this.cell;
  3105. }
  3106. if (isRuler) {
  3107. angle *= this.rulerRate;
  3108. }
  3109. this.ui.rotation += angle;
  3110. xGame.common.d2World.getHelpLine();
  3111. }
  3112. checkDistance() {
  3113. let target = xGame.common.d2World.targetBall;
  3114. let root = xGame.common.d2World.rootBall;
  3115. if (target == null) {
  3116. return 1;
  3117. }
  3118. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3119. if (dis <= 2500) {
  3120. return 5;
  3121. }
  3122. return 1;
  3123. }
  3124. rotDest(rot) {
  3125. this.ui.rotation = rot;
  3126. xGame.common.d2World.getHelpLine();
  3127. }
  3128. storagePower(powerNum) {
  3129. let pos = (powerNum / 100) * this.moveNum;
  3130. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3131. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3132. this.ui.x = this.lastInfo.x + xx;
  3133. this.ui.y = this.lastInfo.y + yy;
  3134. }
  3135. shoot() {
  3136. this.storagePower(0);
  3137. this.ui.visible = false;
  3138. }
  3139. destroySelf() {
  3140. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3141. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3142. this.selfMySpine && this.selfMySpine.dispose();
  3143. this.aiMySpine && this.aiMySpine.dispose();
  3144. this.lastInfo = null;
  3145. if (!this.ui.isDisposed) {
  3146. this.ui.removeFromParent();
  3147. this.ui.dispose();
  3148. }
  3149. }
  3150. }
  3151. class ui_HelpLine extends fgui.GComponent {
  3152. static createInstance() {
  3153. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3154. }
  3155. onConstruct() {
  3156. this.n10 = (this.getChild("n10"));
  3157. this.rect = (this.getChild("rect"));
  3158. this.dir11 = (this.getChild("dir11"));
  3159. this.dir = (this.getChild("dir"));
  3160. this.rootDir = (this.getChild("rootDir"));
  3161. this.dirDot = (this.getChild("dirDot"));
  3162. }
  3163. }
  3164. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3165. class D2HelpLine {
  3166. constructor() {
  3167. this.starX = 0;
  3168. this.starY = 0;
  3169. this.ui = ui_HelpLine.createInstance();
  3170. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3171. this.starX = this.ui.rect.x;
  3172. this.starY = this.ui.rect.y;
  3173. }
  3174. shoot() {
  3175. this.ui.visible = false;
  3176. }
  3177. destroySelf() {
  3178. if (this.ui.isDisposed) {
  3179. this.ui.removeFromParent();
  3180. this.ui.dispose();
  3181. }
  3182. }
  3183. }
  3184. class D2World extends Laya.Script {
  3185. constructor() {
  3186. super();
  3187. this.ballArr = [];
  3188. this.openCheckStill = false;
  3189. this.checkArr = [];
  3190. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3191. this.isHelpLineOnBall = false;
  3192. this.isOnSameLine = false;
  3193. this.reflectAngle = 0;
  3194. this.powerPercent = 0;
  3195. this.inHolesSpeed = [];
  3196. this.outDir = new Laya.Vector2();
  3197. this.rootDir = new Laya.Vector2();
  3198. this.aiLv = 0;
  3199. this.rootPos = new Laya.Vector2();
  3200. this.tempDir1 = new Laya.Vector2();
  3201. this.tempDir2 = new Laya.Vector2();
  3202. this.tempDir3 = new Laya.Vector2();
  3203. this.ballSize = 33;
  3204. this.destRot = 0;
  3205. }
  3206. initSelf() {
  3207. this.createBalls();
  3208. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3209. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3210. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3211. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3212. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3213. }
  3214. setBorderRect() {
  3215. let ui = xGame.common.gameUI.ui;
  3216. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3217. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3218. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3219. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3220. this.borderRect.x = starX;
  3221. this.borderRect.y = starY;
  3222. this.borderRect.width = width;
  3223. this.borderRect.height = height;
  3224. }
  3225. resetGame() {
  3226. this.openCheckStill = false;
  3227. let temp;
  3228. for (let index = 0; index < this.ballArr.length; index++) {
  3229. temp = this.ballArr[index];
  3230. temp.destroySelf();
  3231. }
  3232. xGame.common.d3World.ballRoot.destroyChildren();
  3233. xGame.common.gameUI.ui.ballNode.removeChildren();
  3234. console.log("进入摧毁逻辑");
  3235. this.d2Gan.destroySelf();
  3236. this.d2HelpLine.destroySelf();
  3237. this.ballArr = [];
  3238. }
  3239. setD2Gan() {
  3240. let ballNode = this.rootBall.ui;
  3241. let d2Gan = new D2Gan();
  3242. this.d2Gan = d2Gan;
  3243. let ganNode = d2Gan.ui;
  3244. ballNode.addChild(ganNode);
  3245. ganNode.pivotX = ganNode.pivotX;
  3246. ganNode.pivotY = ganNode.pivotY;
  3247. ganNode.x = ganNode.myIcon.width / 2;
  3248. ganNode.y = this.rootBall.gameObj.width;
  3249. d2Gan.setGanLastInfo();
  3250. }
  3251. setHelpLine() {
  3252. let d2Help = new D2HelpLine();
  3253. this.d2HelpLine = d2Help;
  3254. }
  3255. createBalls() {
  3256. let cfg;
  3257. switch (xGame.common.gameMode) {
  3258. case GameMode.classic:
  3259. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3260. break;
  3261. case GameMode.bigMove:
  3262. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3263. break;
  3264. case GameMode.placeBall:
  3265. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3266. break;
  3267. default:
  3268. break;
  3269. }
  3270. cfg = JSON.parse(JSON.stringify(cfg));
  3271. for (const key in cfg) {
  3272. if (cfg[key].value == 0) {
  3273. this.createRootBall(cfg[key]);
  3274. delete cfg[key];
  3275. break;
  3276. }
  3277. }
  3278. this.createOtherBalls(cfg);
  3279. }
  3280. createRootBall(data) {
  3281. let root = new D2Ball(true);
  3282. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3283. this.rootBall = root.d2Src;
  3284. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3285. let d3BallSrc = d3Ball.getComponent(Ball);
  3286. xGame.common.d3World.rootBall = d3Ball;
  3287. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3288. let xx = data.x;
  3289. let yy = data.y;
  3290. let numer = data.value;
  3291. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3292. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3293. this.ballArr.push(this.rootBall);
  3294. this.setD2Gan();
  3295. this.setHelpLine();
  3296. }
  3297. createOtherBalls(cfg) {
  3298. let temp;
  3299. let src;
  3300. let data;
  3301. for (const key in cfg) {
  3302. data = cfg[key];
  3303. temp = new D2Ball();
  3304. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3305. src = temp.d2Src;
  3306. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3307. src.initSelf(data.value, data.x, data.y, d3Ball);
  3308. this.ballArr.push(src);
  3309. }
  3310. }
  3311. shoot(percent) {
  3312. this.powerPercent = percent;
  3313. this.openCheckStill = true;
  3314. let d2Angle = this.d2Gan.ui.rotation;
  3315. this.rootBall.setSpeed(percent, d2Angle);
  3316. this.clearBallAllEft();
  3317. this.changePlayerView();
  3318. }
  3319. onUpdate() {
  3320. if (!this.openCheckStill)
  3321. return;
  3322. this.checkStill();
  3323. }
  3324. checkStill() {
  3325. for (let index = 0; index < this.ballArr.length; index++) {
  3326. if (!this.ballArr[index].isStill()) {
  3327. return;
  3328. }
  3329. }
  3330. xGame.eventMgr.event(ALL_BALL_STOP);
  3331. }
  3332. allBallStop() {
  3333. this.openCheckStill = false;
  3334. xGame.common.recoverCameraView();
  3335. }
  3336. waitShoot() {
  3337. if (!this.d2Gan.ui.isDisposed) {
  3338. this.d2Gan.ui.visible = true;
  3339. }
  3340. if (!this.d2HelpLine.ui.isDisposed) {
  3341. this.d2HelpLine.ui.visible = true;
  3342. }
  3343. this.clearBallAllEft();
  3344. this.showBallRightEft();
  3345. this.getHelpLine();
  3346. this.inHolesSpeed = [];
  3347. this.selectOneBall();
  3348. }
  3349. _getAllBallArr() {
  3350. let arr = this.ballArr;
  3351. let outArr = [];
  3352. for (let index = 0; index < arr.length; index++) {
  3353. if (arr[index] instanceof D2RootBallSrc)
  3354. continue;
  3355. if (arr[index].ballFunc == "ice")
  3356. continue;
  3357. if (arr[index].destroyed)
  3358. continue;
  3359. outArr.push(arr[index]);
  3360. }
  3361. return outArr;
  3362. }
  3363. _getBlackObj() {
  3364. let arr = this.ballArr;
  3365. for (let index = 0; index < arr.length; index++) {
  3366. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3367. return arr[index];
  3368. }
  3369. }
  3370. }
  3371. selectOneBall() {
  3372. let all = this._getAllBallArr();
  3373. let target;
  3374. switch (xGame.common.gameMode) {
  3375. case GameMode.classic:
  3376. if (xGame.common.gameMgr.selfTurn) {
  3377. let self = xGame.common.gameMgr.selfBallArr;
  3378. let black = this._getBlackObj();
  3379. if (xGame.common.gameMgr.ensureBallType) {
  3380. if (self.length > 0) {
  3381. let out = [];
  3382. for (let j = 0; j < all.length; j++) {
  3383. if (self.indexOf(all[j].number) > -1) {
  3384. out.push(all[j]);
  3385. }
  3386. }
  3387. target = this.selectBestEnterOne(out);
  3388. }
  3389. else {
  3390. target = this.selectBestEnterOne([black]);
  3391. }
  3392. }
  3393. else {
  3394. target = this.selectBestEnterOne(all);
  3395. }
  3396. }
  3397. else {
  3398. target = this.selectBestEnterOne(all);
  3399. }
  3400. break;
  3401. case GameMode.bigMove:
  3402. target = this.selectBestEnterOne(all);
  3403. break;
  3404. case GameMode.placeBall:
  3405. if (all.length > 0) {
  3406. target = this.selectBestEnterOne(all);
  3407. }
  3408. break;
  3409. default:
  3410. break;
  3411. }
  3412. if (target && !target.destroyed && target.onClick) {
  3413. target.onClick(0, true);
  3414. let num = -200 + xGame.common.randomNum(0, 400);
  3415. num /= 150;
  3416. if (xGame.common.longHelpLine) {
  3417. num = 0;
  3418. }
  3419. this.destRot += num;
  3420. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3421. }
  3422. }
  3423. removeOneBall(ball) {
  3424. for (let index = 0; index < this.ballArr.length; index++) {
  3425. if (this.ballArr[index].id == ball.id) {
  3426. this.ballArr.splice(index, 1);
  3427. break;
  3428. }
  3429. }
  3430. }
  3431. getHelpLine() {
  3432. this.d2HelpLine.ui.dirDot.visible = false;
  3433. this.isOnSameLine = false;
  3434. let startX = this.rootBall.gameObj.x;
  3435. let startY = this.rootBall.gameObj.y;
  3436. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3437. if (dis == null) {
  3438. this.d2HelpLine.ui.visible = false;
  3439. console.error("辅助线异常");
  3440. return;
  3441. }
  3442. this.d2HelpLine.ui.visible = true;
  3443. let angle = this.d2Gan.ui.rotation;
  3444. let radius = 16.5;
  3445. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3446. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3447. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3448. if (colliObj == null) {
  3449. this.getColliPos(disX, disY, radius, angle);
  3450. xGame.common.d2World.isHelpLineOnBall = false;
  3451. this.targetBall = null;
  3452. this.reflectAngle = 0;
  3453. this.showBallWrongEft();
  3454. }
  3455. else {
  3456. let target = colliObj.src;
  3457. let radius = 16.5;
  3458. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3459. dis1 = Math.sqrt(dis1);
  3460. let realDis = colliObj.disHon - dis1;
  3461. let dir = colliObj.dir;
  3462. let xx = startX + dir.x * realDis;
  3463. let yy = startY + dir.y * realDis;
  3464. this.getColliPos(xx, yy, radius, angle);
  3465. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3466. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3467. let offset = xGame.common.rodOffest;
  3468. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3469. this.isOnSameLine = true;
  3470. }
  3471. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3472. xGame.common.d2World.isHelpLineOnBall = true;
  3473. this.targetBall = target;
  3474. this.reflectAngle = reflectAngle;
  3475. this.showBallWrongEft();
  3476. if (xGame.common.longHelpLine) {
  3477. this.delayReflectLine(target, reflectAngle);
  3478. }
  3479. }
  3480. }
  3481. getBorderDot(startX, startY, angle) {
  3482. let radius = 17;
  3483. let distance;
  3484. let isDone;
  3485. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3486. isDone = this.judgeUpDown(distance, angle, startX);
  3487. if (isDone != null) {
  3488. return isDone;
  3489. }
  3490. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3491. isDone = this.judgeUpDown(distance, angle, startX);
  3492. if (isDone != null) {
  3493. return isDone;
  3494. }
  3495. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3496. isDone = this.judgeLeftRight(distance, angle, startY);
  3497. if (isDone != null) {
  3498. return isDone;
  3499. }
  3500. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3501. isDone = this.judgeLeftRight(distance, angle, startY);
  3502. if (isDone != null) {
  3503. return isDone;
  3504. }
  3505. }
  3506. judgeUpDown(distance, angle, startX) {
  3507. let flag = Math.sin(angle * Math.PI / 180);
  3508. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3509. if (distance >= 0) {
  3510. if (flag > 0) {
  3511. if (temp < this.borderRect.x + this.borderRect.width) {
  3512. return distance;
  3513. }
  3514. }
  3515. else {
  3516. if (temp > this.borderRect.x) {
  3517. return distance;
  3518. }
  3519. }
  3520. }
  3521. }
  3522. judgeLeftRight(distance, angle, starY) {
  3523. let flag = -Math.cos(angle * Math.PI / 180);
  3524. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3525. if (distance >= 0) {
  3526. if (flag > 0) {
  3527. if (temp < this.borderRect.y + this.borderRect.height) {
  3528. return distance;
  3529. }
  3530. }
  3531. else {
  3532. if (temp > this.borderRect.y) {
  3533. return distance;
  3534. }
  3535. }
  3536. }
  3537. }
  3538. clearBallAllEft() {
  3539. let temp;
  3540. for (let index = 0; index < this.ballArr.length; index++) {
  3541. temp = this.ballArr[index];
  3542. temp.clearBallEft();
  3543. }
  3544. }
  3545. showBallRightEft() {
  3546. let gameMgr = xGame.common.gameMgr;
  3547. let temp;
  3548. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3549. if (targetArr.length <= 0)
  3550. return;
  3551. for (let index = 0; index < this.ballArr.length; index++) {
  3552. temp = this.ballArr[index];
  3553. if (targetArr.indexOf(temp.number) > -1) {
  3554. temp.showRightEft();
  3555. }
  3556. }
  3557. }
  3558. showBallWrongEft() {
  3559. let gameMgr = xGame.common.gameMgr;
  3560. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3561. if (targetArr.length <= 0)
  3562. return;
  3563. let temp;
  3564. for (let index = 0; index < this.ballArr.length; index++) {
  3565. temp = this.ballArr[index];
  3566. if (this.targetBall && this.targetBall.number == temp.number) {
  3567. if (targetArr.indexOf(temp.number) <= -1) {
  3568. temp.showWrongEft();
  3569. }
  3570. else {
  3571. temp.clearBallWrongEft();
  3572. }
  3573. }
  3574. else {
  3575. temp.clearBallWrongEft();
  3576. }
  3577. }
  3578. }
  3579. getColliPos(x, y, radius, angle) {
  3580. this.d2HelpLine.ui.x = x;
  3581. this.d2HelpLine.ui.y = y;
  3582. let dirX = x - this.rootBall.gameObj.x;
  3583. let dirY = y - this.rootBall.gameObj.y;
  3584. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3585. if (rectH <= 0)
  3586. rectH = 0;
  3587. this.d2HelpLine.ui.rect.height = 0;
  3588. this.d2HelpLine.ui.rect.height = rectH;
  3589. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3590. if (rectH < this.rootBall.gameObj.width) {
  3591. this.d2HelpLine.ui.rect.visible = false;
  3592. }
  3593. else {
  3594. this.d2HelpLine.ui.rect.visible = true;
  3595. }
  3596. this.d2HelpLine.ui.dir.visible = false;
  3597. this.d2HelpLine.ui.rootDir.visible = false;
  3598. }
  3599. getReflectLine(x, y, radius, target) {
  3600. this.d2HelpLine.ui.dir.visible = true;
  3601. let dirX = target.x - x;
  3602. let dirY = target.y - y;
  3603. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3604. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3605. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3606. this.d2HelpLine.ui.dir.height = 48;
  3607. this.d2HelpLine.ui.dir.rotation = angle;
  3608. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3609. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3610. return angle;
  3611. }
  3612. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3613. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3614. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3615. let targetX = target.gameObj.x;
  3616. let targetY = target.gameObj.y;
  3617. this.outDir.setValue(targetX - xx, targetY - yy);
  3618. this.rootDir.setValue(rtX - xx, rtY - yy);
  3619. let ver = Math.PI / 2;
  3620. let sin = Math.sin(ver);
  3621. let cos = Math.cos(ver);
  3622. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3623. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3624. this.outDir.setValue(outX, outY);
  3625. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3626. Laya.Vector2.normalize(this.outDir, this.outDir);
  3627. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3628. if (Math.abs(result) <= 0.08) {
  3629. this.d2HelpLine.ui.rootDir.visible = false;
  3630. return;
  3631. }
  3632. if (result > 0) {
  3633. angle += 90;
  3634. }
  3635. else if (result < 0) {
  3636. angle -= 90;
  3637. }
  3638. this.d2HelpLine.ui.rootDir.visible = true;
  3639. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3640. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3641. this.d2HelpLine.ui.rootDir.rotation = angle;
  3642. }
  3643. delayReflectLine(obj, angle) {
  3644. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3645. return;
  3646. }
  3647. this.isOnSameLine = false;
  3648. let startX = obj.gameObj.x;
  3649. let startY = obj.gameObj.y;
  3650. let dis = this.getBorderDot(startX, startY, angle);
  3651. if (dis == null) {
  3652. this.d2HelpLine.ui.dirDot.visible = false;
  3653. return;
  3654. }
  3655. this.d2HelpLine.ui.visible = true;
  3656. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3657. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3658. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3659. if (colliObj == null) {
  3660. this.setDelayLine(disX, disY, obj, angle);
  3661. }
  3662. else {
  3663. let radius = 16;
  3664. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3665. dis1 = Math.sqrt(dis1);
  3666. let realDis = colliObj.disHon - dis1;
  3667. let dir = colliObj.dir;
  3668. let xx = startX + dir.x * realDis;
  3669. let yy = startY + dir.y * realDis;
  3670. this.setDelayLine(xx, yy, obj, angle);
  3671. }
  3672. }
  3673. setDelayLine(x, y, obj, angle) {
  3674. let dirX = x - obj.gameObj.x;
  3675. let dirY = y - obj.gameObj.y;
  3676. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3677. if (rectH <= 0)
  3678. rectH = 0;
  3679. this.d2HelpLine.ui.dir.height = rectH;
  3680. this.d2HelpLine.ui.dirDot.visible = true;
  3681. this.d2HelpLine.ui.dirDot.x = 17;
  3682. this.d2HelpLine.ui.dirDot.y = 17;
  3683. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3684. ;
  3685. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3686. }
  3687. changePlayerView() {
  3688. if (Math.random() >= 0.7)
  3689. return;
  3690. if (!this.targetBall) {
  3691. return;
  3692. }
  3693. if (!xGame.common.gameMgr.selfTurn)
  3694. return;
  3695. switch (xGame.common.gameMode) {
  3696. case GameMode.classic:
  3697. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3698. if (this.targetBall.number != 8) {
  3699. return;
  3700. }
  3701. }
  3702. break;
  3703. case GameMode.bigMove:
  3704. return;
  3705. case GameMode.placeBall:
  3706. break;
  3707. default:
  3708. break;
  3709. }
  3710. let startX = this.targetBall.gameObj.x;
  3711. let startY = this.targetBall.gameObj.y;
  3712. let angle = this.reflectAngle;
  3713. let dis = this.getBorderDot(startX, startY, angle);
  3714. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3715. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3716. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3717. if (colliObj) {
  3718. return;
  3719. }
  3720. let offset = 40;
  3721. let posObj = xGame.common.gameMgr.posObj;
  3722. let temp;
  3723. let radius;
  3724. let tarX, tarY;
  3725. for (const key in posObj) {
  3726. temp = posObj[key];
  3727. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3728. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3729. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3730. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3731. xGame.common.showOneCamera("angle" + key);
  3732. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3733. Laya.physicsTimer.scale = 0.7;
  3734. break;
  3735. }
  3736. }
  3737. }
  3738. selectBestEnterOne(arr) {
  3739. this.aiLv = xGame.tools.random(1, 11);
  3740. this.aiLv = 10;
  3741. this.wBall = xGame.common.d2World.rootBall;
  3742. this.rootPos.x = this.wBall.gameObj.x;
  3743. this.rootPos.y = this.wBall.gameObj.y;
  3744. this.initHoleBall(arr);
  3745. return this.selectBall();
  3746. }
  3747. selectBall() {
  3748. let ball = null;
  3749. this.destRot = 0;
  3750. let ai = 110 - this.aiLv * 10;
  3751. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3752. let score = false;
  3753. if (this.scoreBall.length < 1) {
  3754. if (this.lineBall.length < 1) {
  3755. for (let i = 0; i < this.kickBall.length; i++) {
  3756. let list = [];
  3757. let bo = this.kickBall[i];
  3758. let bobj = bo.gameObj;
  3759. let rect = xGame.common.d2World.borderRect;
  3760. let mobj = this.wBall.gameObj;
  3761. let minb = bobj.y - rect.y - 20;
  3762. let minw = mobj.y - rect.y - 50;
  3763. if (minb > 0 && minw > 0) {
  3764. let dlenx = 0;
  3765. let dleny = mobj.y - rect.y;
  3766. let spx = mobj.x;
  3767. let spy = rect.y - dleny;
  3768. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3769. }
  3770. minb = rect.y + rect.height - bobj.y - 20;
  3771. minw = rect.y + rect.height - mobj.y - 50;
  3772. if (minb > 0 && minw > 0) {
  3773. let dlenx = 0;
  3774. let dleny = rect.y + rect.height - mobj.y;
  3775. let spx = mobj.x;
  3776. let spy = rect.y + rect.height + dleny;
  3777. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3778. }
  3779. minb = bobj.x - rect.x - 20;
  3780. minw = mobj.x - rect.x - 50;
  3781. if (minb > 0 && minw > 0) {
  3782. let dlenx = mobj.x - rect.x;
  3783. let dleny = 0;
  3784. let spx = rect.x - dlenx;
  3785. let spy = mobj.y;
  3786. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3787. }
  3788. minb = rect.x + rect.width - bobj.x - 20;
  3789. minw = rect.x + rect.width - mobj.x - 50;
  3790. if (minb > 0 && minw > 0) {
  3791. let dlenx = rect.x + rect.width - mobj.x;
  3792. let dleny = 0;
  3793. let spx = rect.x + rect.width + dlenx;
  3794. let spy = mobj.y;
  3795. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3796. }
  3797. list.sort(function (a, b) {
  3798. return a.order - b.order;
  3799. });
  3800. for (let i = 0; i < list.length; i++) {
  3801. let data = list[i];
  3802. let mx = mobj.x - bobj.x;
  3803. let my = mobj.y - bobj.y;
  3804. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3805. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3806. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3807. if (num > 1)
  3808. num = 1;
  3809. let cos = Math.acos(num);
  3810. if (cos > 1.57)
  3811. cos = 1.57;
  3812. else if (cos < 0.01)
  3813. cos = 0.01;
  3814. let tan = Math.tan(cos);
  3815. let dx = tan * data.dleny;
  3816. let dy = tan * data.dlenx;
  3817. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3818. if (Math.abs(bx - 667) < 40)
  3819. continue;
  3820. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3821. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3822. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3823. this.forceMax = dis * 0.08;
  3824. this.destRot += mis * 0.1;
  3825. this.setKick(bx, by);
  3826. return true;
  3827. }
  3828. }
  3829. }
  3830. }
  3831. else {
  3832. ball = xGame.common.getRandArrEle(this.lineBall);
  3833. }
  3834. }
  3835. else {
  3836. for (let i = 0; i < this.scoreBall.length; i++) {
  3837. if (i < this.scoreBall.length - 1) {
  3838. let rand = 70 + this.aiLv * 10 + i * 10;
  3839. if (xGame.tools.random(0, 100) < rand) {
  3840. ball = this.scoreBall[i];
  3841. break;
  3842. }
  3843. }
  3844. else {
  3845. ball = this.scoreBall[i];
  3846. break;
  3847. }
  3848. }
  3849. score = true;
  3850. this.selectNum++;
  3851. }
  3852. if (!ball)
  3853. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3854. let dx = ball.gameObj.x;
  3855. let dy = ball.gameObj.y;
  3856. let kickAngle = 0;
  3857. if (score) {
  3858. dx = ball.kickPos.x;
  3859. dy = ball.kickPos.y;
  3860. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3861. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3862. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3863. if (adot > 1)
  3864. adot = 1;
  3865. kickAngle = Math.acos(adot) * 57.3;
  3866. if (kickAngle > 45) {
  3867. let kdx = ball.kickPos.x - ball.gameObj.x;
  3868. let kdy = ball.kickPos.y - ball.gameObj.y;
  3869. dx = ball.kickPos.x - kdx * mis * 0.3;
  3870. dy = ball.kickPos.y - kdy * mis * 0.3;
  3871. }
  3872. else
  3873. this.destRot += mis;
  3874. }
  3875. else if (ball.poleAngle != 0) {
  3876. this.destRot += ball.poleAngle;
  3877. }
  3878. if (xGame.common.gameMode == 0) {
  3879. let af = kickAngle * 0.08;
  3880. this.forceMax = ball.hard * 0.1 + af * af;
  3881. }
  3882. this.setKick(dx, dy);
  3883. return ball;
  3884. }
  3885. initHoleBall(arr) {
  3886. this.kickBall = [];
  3887. this.lineBall = [];
  3888. this.scoreBall = [];
  3889. this.holeBall = [];
  3890. this.selectNum = 0;
  3891. this.forceNum = 0;
  3892. this.forceMax = 0;
  3893. this.turnNum = 0;
  3894. let list = arr;
  3895. let holes = xGame.common.gameMgr.holePosList;
  3896. let self = xGame.common.aiPlayer;
  3897. for (let i = 0; i < list.length; i++) {
  3898. let obj = list[i];
  3899. if (!obj)
  3900. continue;
  3901. obj.kickPos.x = 0;
  3902. obj.kickPos.y = 0;
  3903. obj.poleAngle = 0;
  3904. obj.hard = 0;
  3905. obj.borderDis = 0;
  3906. obj.kickAngle = 180;
  3907. let b = obj.gameObj;
  3908. let wbp = this.rootPos;
  3909. let bx = wbp.x - b.x;
  3910. let by = wbp.y - b.y;
  3911. obj.borderDis = xGame.tools.random(0, 100);
  3912. this.kickBall.push(obj);
  3913. if (!this.isLine(wbp, obj))
  3914. continue;
  3915. obj.kickAngle = xGame.tools.random(90, 180);
  3916. obj.kickPos.x = b.x;
  3917. obj.kickPos.y = b.y;
  3918. this.lineBall.push(obj);
  3919. let minDis = 999999;
  3920. let hole = false;
  3921. for (let j = 0; j < holes.length; j++) {
  3922. let hp = holes[j];
  3923. if (bx >= 0 && hp.x > b.x + 100)
  3924. continue;
  3925. if (bx <= 0 && hp.x < b.x - 100)
  3926. continue;
  3927. if (by < -10 && hp.y < wbp.y)
  3928. continue;
  3929. if (by > 10 && hp.y > wbp.y)
  3930. continue;
  3931. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3932. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3933. if (dis < minDis) {
  3934. let dx = b.x - this.tempDir1.x * this.ballSize;
  3935. let dy = b.y - this.tempDir1.y * this.ballSize;
  3936. this.tempDir3.x = this.tempDir1.x;
  3937. this.tempDir3.y = this.tempDir1.y;
  3938. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3939. obj.kickPos.x = dx;
  3940. obj.kickPos.y = dy;
  3941. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3942. if (num > 1)
  3943. num = 1;
  3944. obj.kickAngle = Math.acos(num) * 57.3;
  3945. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3946. dis = dis * 2;
  3947. if (Math.abs(hp.x - 600) < 100)
  3948. dis += 50;
  3949. obj.hard = dis + obj.kickAngle * 3;
  3950. hole = true;
  3951. }
  3952. }
  3953. }
  3954. }
  3955. if (hole) {
  3956. this.scoreBall.push(obj);
  3957. this.holeBall.push(obj);
  3958. }
  3959. }
  3960. this.scoreBall.sort(function (a, b) {
  3961. return a.hard - b.hard;
  3962. });
  3963. this.holeBall.sort(function (a, b) {
  3964. return a.kickAngle - b.kickAngle;
  3965. });
  3966. this.kickBall.sort(function (a, b) {
  3967. return a.borderDis - b.borderDis;
  3968. });
  3969. }
  3970. isBlock(bn, bx, by, hx, hy, dn = -1) {
  3971. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  3972. let balls = xGame.common.d2World.ballArr;
  3973. let max = xGame.tools.getDis(hx, hy, bx, by);
  3974. for (let index = 0; index < balls.length; index++) {
  3975. let obj = balls[index];
  3976. if (obj.number == 0)
  3977. continue;
  3978. if (obj.number == bn || obj.number == dn)
  3979. continue;
  3980. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  3981. if (dis * dis > max)
  3982. continue;
  3983. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  3984. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3985. if (num > 1)
  3986. num = 1;
  3987. if (num < 0)
  3988. continue;
  3989. let gap = Math.sin(Math.acos(num)) * dis;
  3990. if (gap < this.ballSize)
  3991. return true;
  3992. }
  3993. return false;
  3994. }
  3995. isLine(xy, ball) {
  3996. let bx = xy.x;
  3997. let by = xy.y;
  3998. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  3999. let dis = ball.getDestDis(xy);
  4000. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4001. let sin = Math.sin(angle);
  4002. let cos = Math.cos(angle);
  4003. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4004. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4005. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4006. let dx = bx + this.tempDir2.x * dis;
  4007. let dy = by + this.tempDir2.y * dis;
  4008. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4009. sin = Math.sin(-angle);
  4010. cos = Math.cos(-angle);
  4011. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4012. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4013. dx = bx + this.tempDir2.x * dis;
  4014. dy = by + this.tempDir2.y * dis;
  4015. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4016. if (isr && isl)
  4017. return false;
  4018. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4019. }
  4020. return true;
  4021. }
  4022. setKick(dx, dy) {
  4023. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4024. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4025. this.tempDir1.x = 0;
  4026. this.tempDir1.y = 1;
  4027. this.tempDir2.y = -this.tempDir2.y;
  4028. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4029. if (num > 1)
  4030. num = 1;
  4031. let rot = Math.acos(num) * 57.3;
  4032. if (this.tempDir2.x < 0)
  4033. rot = 360 - rot;
  4034. this.destRot += rot;
  4035. }
  4036. }
  4037. class ui_UIGame extends fgui.GComponent {
  4038. static createInstance() {
  4039. return (fgui.UIPackage.createObject("game", "UIGame"));
  4040. }
  4041. onConstruct() {
  4042. this.c1 = this.getController("c1");
  4043. this.d3Root = (this.getChild("d3Root"));
  4044. this.clickNode = (this.getChild("clickNode"));
  4045. this.d2Root = (this.getChild("d2Root"));
  4046. this.topNode = (this.getChild("topNode"));
  4047. this.n72 = (this.getChild("n72"));
  4048. this.n40 = (this.getChild("n40"));
  4049. this.rulerNode = (this.getChild("rulerNode"));
  4050. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4051. this.n50 = (this.getChild("n50"));
  4052. this.keduNode = (this.getChild("keduNode"));
  4053. this.powerTxt = (this.getChild("powerTxt"));
  4054. this.powerNode = (this.getChild("powerNode"));
  4055. this.colorNode = (this.getChild("colorNode"));
  4056. this.powerEft = (this.getChild("powerEft"));
  4057. this.myPowerNode = (this.getChild("myPowerNode"));
  4058. this.ganNode = (this.getChild("ganNode"));
  4059. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4060. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4061. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4062. this.skillRod = (this.getChild("skillRod"));
  4063. this.border = (this.getChild("border"));
  4064. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4065. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4066. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4067. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4068. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4069. this.guanyuNode = (this.getChild("guanyuNode"));
  4070. this.helpBtn = (this.getChild("helpBtn"));
  4071. this.wordsBtn = (this.getChild("wordsBtn"));
  4072. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4073. this.returnBtn = (this.getChild("returnBtn"));
  4074. this.ballNode = (this.getChild("ballNode"));
  4075. this.whiteAni = (this.getChild("whiteAni"));
  4076. this.blackAni = (this.getChild("blackAni"));
  4077. this.selfTurn = (this.getChild("selfTurn"));
  4078. this.aiTurn = (this.getChild("aiTurn"));
  4079. this.deskNode = (this.getChild("deskNode"));
  4080. this.moveNode = (this.getChild("moveNode"));
  4081. this.selfTalk = (this.getChild("selfTalk"));
  4082. this.aiTalk = (this.getChild("aiTalk"));
  4083. this.d2Node = (this.getChild("d2Node"));
  4084. this.snowNode = (this.getChild("snowNode"));
  4085. this.guide2 = (this.getChild("guide2"));
  4086. this.guide1 = (this.getChild("guide1"));
  4087. this.guide3 = (this.getChild("guide3"));
  4088. this.guideNode = (this.getChild("guideNode"));
  4089. }
  4090. }
  4091. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4092. class ui_UIGameEnd extends fgui.GComponent {
  4093. static createInstance() {
  4094. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4095. }
  4096. onConstruct() {
  4097. this.c1 = this.getController("c1");
  4098. this.n22 = (this.getChild("n22"));
  4099. this.n2 = (this.getChild("n2"));
  4100. this.n52 = (this.getChild("n52"));
  4101. this.n53 = (this.getChild("n53"));
  4102. this.coinNode = (this.getChild("coinNode"));
  4103. this.closeNode = (this.getChild("closeNode"));
  4104. this.moneyNode = (this.getChild("moneyNode"));
  4105. this.secretary = (this.getChild("secretary"));
  4106. this.n27 = (this.getChild("n27"));
  4107. this.n29 = (this.getChild("n29"));
  4108. this.talkNode = (this.getChild("talkNode"));
  4109. this.n38 = (this.getChild("n38"));
  4110. this.n39 = (this.getChild("n39"));
  4111. this.n40 = (this.getChild("n40"));
  4112. this.awardNode = (this.getChild("awardNode"));
  4113. this.starNumNode = (this.getChild("starNumNode"));
  4114. this.n47 = (this.getChild("n47"));
  4115. this.conditionNode = (this.getChild("conditionNode"));
  4116. this.isGetAward = (this.getChild("isGetAward"));
  4117. this.leftBtn = (this.getChild("leftBtn"));
  4118. this.rightBtn = (this.getChild("rightBtn"));
  4119. this.btnNode = (this.getChild("btnNode"));
  4120. }
  4121. }
  4122. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4123. class ui_UIAddCoin extends fgui.GComponent {
  4124. static createInstance() {
  4125. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4126. }
  4127. onConstruct() {
  4128. this.n11 = (this.getChild("n11"));
  4129. this.myNode = (this.getChild("myNode"));
  4130. this.t0 = this.getTransition("t0");
  4131. }
  4132. }
  4133. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4134. class UIAddCoin extends UIBase {
  4135. constructor() {
  4136. super();
  4137. this.coinNum = 2000;
  4138. }
  4139. onConstructor() {
  4140. this.ui = ui_UIAddCoin.createInstance();
  4141. this.contentPane = this.ui;
  4142. this.isEject = false;
  4143. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4144. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4145. }
  4146. show() {
  4147. super.show();
  4148. this.ui.t0.play();
  4149. }
  4150. videoAddCoin() {
  4151. console.log('zh:qjff_AD_for_UIAddCoin');
  4152. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4153. }
  4154. else {
  4155. console.log('zh:AD 失败,直接发放奖励');
  4156. this.qjff_AD_for_UIAddCoin();
  4157. }
  4158. }
  4159. qjff_AD_for_UIAddCoin() {
  4160. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4161. this.hide();
  4162. }
  4163. }
  4164. UIAddCoin.uiName = "UIAddCoin";
  4165. class ui_UIInvitation extends fgui.GComponent {
  4166. static createInstance() {
  4167. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4168. }
  4169. onConstruct() {
  4170. this.n14 = (this.getChild("n14"));
  4171. this.myNode = (this.getChild("myNode"));
  4172. this.t0 = this.getTransition("t0");
  4173. }
  4174. }
  4175. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4176. class UIInvitation extends UIBase {
  4177. constructor() {
  4178. super();
  4179. }
  4180. onConstructor() {
  4181. this.ui = ui_UIInvitation.createInstance();
  4182. this.contentPane = this.ui;
  4183. this.isEject = false;
  4184. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4185. }
  4186. show() {
  4187. super.show();
  4188. }
  4189. enterGame() {
  4190. xGame.common.gameMode = GameMode.classic;
  4191. DataMgr.setChallengeTimes(1);
  4192. xGame.common.passAwardCoin = 2000;
  4193. let need = xGame.common.classicNiceNeddCoin;
  4194. if (DataMgr.coinEnough(need)) {
  4195. DataMgr.setCoin(-need);
  4196. xGame.eventMgr.event(RESTART_GAME, true);
  4197. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4198. }
  4199. else {
  4200. xGame.eventMgr.event(RESTART_GAME, true);
  4201. }
  4202. this.hide();
  4203. }
  4204. hide() {
  4205. super.hide();
  4206. }
  4207. }
  4208. UIInvitation.uiName = "UIInvitation";
  4209. class ui_UIMain extends fgui.GComponent {
  4210. static createInstance() {
  4211. return (fgui.UIPackage.createObject("game", "UIMain"));
  4212. }
  4213. onConstruct() {
  4214. this.n47 = (this.getChild("n47"));
  4215. this.n10 = (this.getChild("n10"));
  4216. this.secretary = (this.getChild("secretary"));
  4217. this.shopBtn = (this.getChild("shopBtn"));
  4218. this.moneyNode = (this.getChild("moneyNode"));
  4219. this.headNode = (this.getChild("headNode"));
  4220. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4221. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4222. this.classicBtn = (this.getChild("classicBtn"));
  4223. this.globalBtn = (this.getChild("globalBtn"));
  4224. this.n44 = (this.getChild("n44"));
  4225. this.signBtn = (this.getChild("signBtn"));
  4226. this.drawBtn = (this.getChild("drawBtn"));
  4227. this.settingNode = (this.getChild("settingNode"));
  4228. this.n45 = (this.getChild("n45"));
  4229. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4230. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4231. this.rankBtn = (this.getChild("rankBtn"));
  4232. this.n46 = (this.getChild("n46"));
  4233. this.liucheng1 = (this.getChild("liucheng1"));
  4234. this.rightBtn = (this.getChild("rightBtn"));
  4235. this.n75 = (this.getChild("n75"));
  4236. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4237. this.liucheng2 = (this.getChild("liucheng2"));
  4238. this.guideBtn = (this.getChild("guideBtn"));
  4239. this.n73 = (this.getChild("n73"));
  4240. this.wordsNode = (this.getChild("wordsNode"));
  4241. this.enterGuide = (this.getChild("enterGuide"));
  4242. this.talkNode = (this.getChild("talkNode"));
  4243. this.n83 = (this.getChild("n83"));
  4244. this.n84 = (this.getChild("n84"));
  4245. }
  4246. }
  4247. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4248. class ui_UIMoyu extends fgui.GComponent {
  4249. static createInstance() {
  4250. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4251. }
  4252. onConstruct() {
  4253. this.ageTip = (this.getChild("ageTip"));
  4254. this.mainBg = (this.getChild("mainBg"));
  4255. this.xyNode = (this.getChild("xyNode"));
  4256. this.rnNode = (this.getChild("rnNode"));
  4257. this.fcmNode = (this.getChild("fcmNode"));
  4258. this.ageNode = (this.getChild("ageNode"));
  4259. this.tipNode = (this.getChild("tipNode"));
  4260. this.msgNode = (this.getChild("msgNode"));
  4261. }
  4262. }
  4263. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4264. class MoyuMgr {
  4265. static initMoyu() {
  4266. this.moyuView = new MoyuView();
  4267. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4268. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4269. this.moyuView.ui.displayObject.zOrder = 1000;
  4270. this.moyuView.init();
  4271. this.moyuView.showTip(true);
  4272. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4273. window['XApk'] = this;
  4274. }
  4275. static showAge(show) {
  4276. if (this.moyuView)
  4277. this.moyuView.showAge(show);
  4278. }
  4279. static onPlatMsg(idx) {
  4280. if (!MoyuMgr.moyuView)
  4281. return;
  4282. if (idx == '0') {
  4283. MoyuMgr.moyuView.showTip(false);
  4284. }
  4285. }
  4286. static showAgree(call) {
  4287. if (this.moyuView)
  4288. this.moyuView.showAgree(call);
  4289. else
  4290. call && call();
  4291. }
  4292. static showXy(type = 1) {
  4293. if (this.moyuView)
  4294. this.moyuView.showXy(type);
  4295. }
  4296. }
  4297. MoyuMgr.isAdvise = false;
  4298. class MoyuView {
  4299. constructor() {
  4300. this.ysxyNum = 1;
  4301. this.ysJson = null;
  4302. this.ui = ui_UIMoyu.createInstance();
  4303. }
  4304. init() {
  4305. this.ui.mainBg.visible = false;
  4306. this.ui.xyNode.visible = false;
  4307. this.ui.ageNode.visible = false;
  4308. this.ui.tipNode.visible = false;
  4309. this.ui.rnNode.visible = false;
  4310. this.ui.fcmNode.visible = false;
  4311. this.ui.ageTip.visible = false;
  4312. this.ui.msgNode.visible = false;
  4313. this.ui.visible = false;
  4314. this.ui.xyNode.xyList.setVirtual();
  4315. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4316. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4317. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4318. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4319. this.ui.xyNode.btnKnown.visible = false;
  4320. this.ui.xyNode.xy1.visible = false;
  4321. this.ui.xyNode.xy2.visible = false;
  4322. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4323. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4324. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4325. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4326. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4327. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4328. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4329. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4330. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4331. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4332. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4333. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4334. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4335. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4336. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4337. this.ysxyNum = 2;
  4338. }
  4339. }
  4340. onClick(obj) {
  4341. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4342. switch (obj) {
  4343. case this.ui.ageTip:
  4344. if (Moyu.isTTApk) {
  4345. this.ui.ageNode.visible = true;
  4346. this.ui.mainBg.visible = true;
  4347. }
  4348. break;
  4349. case this.ui.tipNode:
  4350. this.showTip(false);
  4351. break;
  4352. case this.ui.ageNode.btnAge:
  4353. this.ui.ageNode.visible = false;
  4354. this.ui.mainBg.visible = false;
  4355. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4356. this.ui.visible = false;
  4357. break;
  4358. case this.ui.xyNode.btnXy3:
  4359. case this.ui.xyNode.btnXy1:
  4360. this.loadXy(1);
  4361. break;
  4362. case this.ui.xyNode.btnXy2:
  4363. this.loadXy(2);
  4364. break;
  4365. case this.ui.xyNode.btnBack:
  4366. this.ui.xyNode.xy1.visible = true;
  4367. this.ui.xyNode.xy2.visible = false;
  4368. break;
  4369. case this.ui.xyNode.btnKnown:
  4370. this.ui.xyNode.visible = false;
  4371. this.ui.mainBg.visible = false;
  4372. this.ui.visible = false;
  4373. break;
  4374. case this.ui.rnNode.btnCheck:
  4375. this.check();
  4376. break;
  4377. case this.ui.rnNode.btnExit:
  4378. case this.ui.xyNode.btnNo:
  4379. this.ysxyNum--;
  4380. if (this.ysxyNum > 0)
  4381. this.showMsg("Refuse to quit the game once again");
  4382. else {
  4383. Moyu.userAgree(false);
  4384. Moyu.exit();
  4385. }
  4386. break;
  4387. case this.ui.xyNode.btnSure:
  4388. case this.ui.xyNode.btnYes:
  4389. DataMgr.userData.isAgree = true;
  4390. DataMgr.saveUserData();
  4391. this.onAgree();
  4392. break;
  4393. case this.ui.rnNode.btnDone:
  4394. this.ui.rnNode.visible = false;
  4395. this.ui.visible = false;
  4396. break;
  4397. case this.ui.fcmNode.btnRn:
  4398. this.showRn();
  4399. break;
  4400. }
  4401. }
  4402. showTip(show) {
  4403. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4404. return;
  4405. if (show) {
  4406. MoyuMgr.isAdvise = true;
  4407. this.ui.visible = true;
  4408. this.ui.tipNode.visible = true;
  4409. this.ui.tipNode.alpha = 1;
  4410. Laya.timer.once(1000, this, this.showTip, [false]);
  4411. }
  4412. else {
  4413. this.ui.tipNode.alpha = 1;
  4414. this.ui.tipNode.visible = true;
  4415. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4416. this.ui.tipNode.visible = false;
  4417. MoyuMgr.isAdvise = false;
  4418. }), 1000);
  4419. }
  4420. }
  4421. showAge(show, px = 0, py = 0) {
  4422. if (Moyu.platType > 10 && !Moyu.isIos) {
  4423. this.ui.ageTip.x = px;
  4424. this.ui.ageTip.y = py;
  4425. this.ui.ageTip.visible = show;
  4426. if (show)
  4427. this.ui.visible = true;
  4428. }
  4429. }
  4430. showAgree(call) {
  4431. this.agreeCall = call;
  4432. this.onAgree();
  4433. return;
  4434. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4435. this.showXy(0);
  4436. }
  4437. else
  4438. this.onAgree();
  4439. }
  4440. onAgree() {
  4441. if (!this.ui.ageNode.visible)
  4442. this.ui.visible = false;
  4443. this.ui.xyNode.visible = false;
  4444. Moyu.userAgree(true);
  4445. this.showAge(false);
  4446. this.agreeCall && this.agreeCall();
  4447. this.showRn();
  4448. }
  4449. showMsg(txt) {
  4450. this.ui.msgNode.txtMsg.text = txt;
  4451. this.ui.msgNode.visible = true;
  4452. this.ui.msgNode.alpha = 1;
  4453. this.ui.visible = true;
  4454. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4455. this.ui.msgNode.visible = false;
  4456. }), 2500, true);
  4457. }
  4458. showRn() {
  4459. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4460. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4461. this.ui.rnNode.rn1.visible = true;
  4462. this.ui.rnNode.rn2.visible = false;
  4463. this.ui.rnNode.rn3.visible = false;
  4464. this.ui.rnNode.rn4.visible = false;
  4465. this.ui.rnNode.visible = true;
  4466. this.ui.mainBg.visible = true;
  4467. this.ui.rnNode.btnDone.visible = false;
  4468. this.ui.rnNode.btnExit.visible = true;
  4469. this.ui.rnNode.btnCheck.visible = true;
  4470. this.ui.fcmNode.visible = false;
  4471. this.ui.visible = true;
  4472. return;
  4473. }
  4474. }
  4475. this.showFcm();
  4476. }
  4477. showFcm() {
  4478. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4479. Moyu.initFCM(true);
  4480. if (Moyu.gameTime < 1)
  4481. this.fcmLoop();
  4482. else if (Moyu.gameTime < 999)
  4483. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4484. }
  4485. }
  4486. fcmLoop() {
  4487. if (Moyu.gameTime < 1) {
  4488. this.ui.rnNode.visible = false;
  4489. this.ui.fcmNode.visible = true;
  4490. this.ui.mainBg.visible = true;
  4491. this.ui.visible = true;
  4492. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4493. Laya.timer.clear(this.ui, this.fcmLoop);
  4494. }
  4495. }
  4496. check() {
  4497. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4498. this.ui.rnNode.rn1.visible = false;
  4499. this.ui.rnNode.rn2.visible = false;
  4500. this.ui.rnNode.rn4.visible = true;
  4501. }
  4502. else if (this.ui.rnNode.rn4.visible) {
  4503. let name = this.ui.rnNode.inputName.text;
  4504. let code = this.ui.rnNode.inputCode.text;
  4505. if (code && code.length == 18) {
  4506. this.ui.rnNode.rn1.visible = false;
  4507. this.ui.rnNode.rn4.visible = false;
  4508. Moyu.authenticate(name, code, (res) => {
  4509. this.ui.rnNode.rn2.visible = !res;
  4510. this.ui.rnNode.rn3.visible = res;
  4511. this.ui.rnNode.btnDone.visible = res;
  4512. this.ui.rnNode.btnExit.visible = !res;
  4513. this.ui.rnNode.btnCheck.visible = !res;
  4514. if (res)
  4515. this.showFcm();
  4516. });
  4517. }
  4518. else
  4519. this.showMsg("信息填写不完整");
  4520. }
  4521. }
  4522. loadXy(type = 0) {
  4523. this.ui.xyNode.xy1.visible = false;
  4524. this.ui.xyNode.xy2.visible = true;
  4525. this.ui.xyNode.xyList.scrollToView(0);
  4526. if (type == 1) {
  4527. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4528. }
  4529. else if (type == 2) {
  4530. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4531. }
  4532. }
  4533. showXy(type = 0) {
  4534. this.xyBtn();
  4535. if (type == 0) {
  4536. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4537. this.ui.xyNode.btnSure.visible = true;
  4538. }
  4539. else {
  4540. this.ui.xyNode.btnYes.visible = true;
  4541. this.ui.xyNode.btnNo.visible = true;
  4542. }
  4543. }
  4544. else {
  4545. this.ui.xyNode.btnKnown.visible = true;
  4546. this.ui.mainBg.visible = true;
  4547. }
  4548. this.ui.xyNode.xy1.visible = true;
  4549. this.ui.xyNode.xy2.visible = false;
  4550. this.ui.xyNode.visible = true;
  4551. this.ui.visible = true;
  4552. }
  4553. xyBtn() {
  4554. this.ui.xyNode.btnSure.visible = false;
  4555. this.ui.xyNode.btnYes.visible = false;
  4556. this.ui.xyNode.btnNo.visible = false;
  4557. this.ui.xyNode.btnKnown.visible = false;
  4558. {
  4559. this.ui.xyNode.btnXy3.visible = false;
  4560. this.ui.xyNode.btnXy2.visible = true;
  4561. this.ui.xyNode.btnXy1.visible = true;
  4562. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4563. }
  4564. }
  4565. createXY(json) {
  4566. this.ysJson = json.content;
  4567. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4568. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4569. this.ui.xyNode.xy2.visible = true;
  4570. }
  4571. renderListItem(idx, cell) {
  4572. let xy = this.ysJson[idx];
  4573. cell.height = xy.line * 30;
  4574. cell.xyItem.text = xy.text;
  4575. }
  4576. onDestroy() {
  4577. this.agreeCall = null;
  4578. }
  4579. }
  4580. class SettingNode {
  4581. constructor(ui) {
  4582. this.showSetting = false;
  4583. this.openSound = true;
  4584. this.openShake = true;
  4585. this.ui = ui;
  4586. this.ui.soundBtn.onClick(this, this.switchSound);
  4587. this.ui.shakeBtn.onClick(this, this.switchShake);
  4588. this.ui.xyBtn.onClick(this, this.onXy);
  4589. this.ui.clickNode.onClick(this, this.changeSetting);
  4590. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4591. this.ui.xyBtn.visible = false;
  4592. this.ui.shakeBtn.visible = false;
  4593. }
  4594. changeSetting() {
  4595. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4596. this.showSetting = !this.showSetting;
  4597. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4598. }
  4599. switchSound() {
  4600. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4601. this.openSound = !this.openSound;
  4602. Moyu.onSetting(this.openSound, this.openShake);
  4603. xGame.soundMgr.onSetting(this.openSound);
  4604. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4605. }
  4606. switchShake() {
  4607. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4608. this.openShake = !this.openShake;
  4609. Moyu.onSetting(this.openSound, this.openShake);
  4610. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4611. }
  4612. onXy() {
  4613. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4614. MoyuMgr.showXy(1);
  4615. }
  4616. }
  4617. class ui_UILevelDisplay extends fgui.GComponent {
  4618. static createInstance() {
  4619. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4620. }
  4621. onConstruct() {
  4622. this.n9 = (this.getChild("n9"));
  4623. this.myNode = (this.getChild("myNode"));
  4624. this.closeNode = (this.getChild("closeNode"));
  4625. }
  4626. }
  4627. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4628. class ui_UILevelProp extends fgui.GComponent {
  4629. static createInstance() {
  4630. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4631. }
  4632. onConstruct() {
  4633. this.n16 = (this.getChild("n16"));
  4634. this.myNode = (this.getChild("myNode"));
  4635. this.closeBtn = (this.getChild("closeBtn"));
  4636. this.moneyNode = (this.getChild("moneyNode"));
  4637. this.t1 = this.getTransition("t1");
  4638. }
  4639. }
  4640. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4641. class ui_ShowItem extends fgui.GComponent {
  4642. static createInstance() {
  4643. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4644. }
  4645. onConstruct() {
  4646. this.myImg = (this.getChild("myImg"));
  4647. }
  4648. }
  4649. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4650. class ShowItem {
  4651. constructor() {
  4652. this.ui = ui_ShowItem.createInstance();
  4653. }
  4654. destroySelf() {
  4655. if (!this.ui.isDisposed) {
  4656. this.ui.removeFromParent();
  4657. this.ui.dispose();
  4658. }
  4659. }
  4660. setParent(parent) {
  4661. parent.addChild(this.ui);
  4662. }
  4663. setPos(x, y) {
  4664. this.ui.x = x;
  4665. this.ui.y = y;
  4666. }
  4667. setUrl(index) {
  4668. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4669. }
  4670. }
  4671. class ui_UIPower extends fgui.GComponent {
  4672. static createInstance() {
  4673. return (fgui.UIPackage.createObject("game", "UIPower"));
  4674. }
  4675. onConstruct() {
  4676. this.n11 = (this.getChild("n11"));
  4677. this.myNode = (this.getChild("myNode"));
  4678. this.t0 = this.getTransition("t0");
  4679. }
  4680. }
  4681. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4682. class UIPower extends UIBase {
  4683. constructor() {
  4684. super();
  4685. }
  4686. onConstructor() {
  4687. this.ui = ui_UIPower.createInstance();
  4688. this.contentPane = this.ui;
  4689. this.isEject = false;
  4690. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4691. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4692. }
  4693. show() {
  4694. super.show();
  4695. this.ui.t0.play();
  4696. }
  4697. videoGetPower() {
  4698. console.log('zh:qjff_AD_for_uipower');
  4699. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4700. }
  4701. else {
  4702. console.log('zh:AD 失败,直接发放奖励');
  4703. this.qjff_AD_for_uipower();
  4704. }
  4705. }
  4706. qjff_AD_for_uipower() {
  4707. DataMgr.setPower(xGame.common.videoPower, true);
  4708. xGame.eventMgr.event(POWER_TIME);
  4709. this.hide();
  4710. }
  4711. }
  4712. UIPower.uiName = "UIPower";
  4713. class UILevelProp extends UIBase {
  4714. constructor() {
  4715. super();
  4716. this.firstPos = 385;
  4717. this.secondPos = 467;
  4718. this.showItemArr = [];
  4719. }
  4720. onFontLoaded() {
  4721. try {
  4722. this.ui.myNode.conditionTxt.font = "arial";
  4723. console.log("zh: onFontLoaded 设置arial字体成功");
  4724. }
  4725. catch (error) {
  4726. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4727. }
  4728. }
  4729. onConstructor() {
  4730. this.ui = ui_UILevelProp.createInstance();
  4731. this.contentPane = this.ui;
  4732. this.isEject = false;
  4733. this.addUIClick(this.ui.closeBtn, this.hide);
  4734. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4735. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4736. }
  4737. show(level) {
  4738. super.show();
  4739. this.ui.t1.play();
  4740. this.level = level;
  4741. this.data = cfgTable.placeballData[this.level];
  4742. this.updateSelf();
  4743. this.showPreView();
  4744. this.moneyNode.ui.c1.selectedIndex = 2;
  4745. this.moneyNode.checkPowerTime();
  4746. this.moneyNode.powerChange();
  4747. }
  4748. showPreView() {
  4749. let item;
  4750. let data;
  4751. for (let index = 0; index < this.showItemArr.length; index++) {
  4752. item = this.showItemArr[index];
  4753. item.destroySelf();
  4754. }
  4755. this.showItemArr = [];
  4756. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4757. for (const key in cfgData) {
  4758. data = cfgData[key];
  4759. item = new ShowItem();
  4760. item.setParent(this.ui.myNode.displayRoot);
  4761. item.setPos(data.x, data.y);
  4762. item.setUrl(data.value);
  4763. this.showItemArr.push(item);
  4764. }
  4765. }
  4766. updateSelf() {
  4767. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4768. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4769. if (this.data.ball == -1) {
  4770. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4771. }
  4772. else {
  4773. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4774. }
  4775. let localData = DataMgr.getPlaceBallLevel(this.level);
  4776. let getAward = localData.getAward;
  4777. let cfg = cfgTable.placeballData[this.level];
  4778. let coin = this.data.award[0];
  4779. let diamond = this.data.award[1];
  4780. if (cfg.type == PlaceBallType.challenge) {
  4781. diamond = 0;
  4782. coin = 100;
  4783. }
  4784. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4785. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4786. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4787. if (cfg.type == PlaceBallType.challenge) {
  4788. this.ui.myNode.coinNode.numTxt.text = "";
  4789. }
  4790. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4791. if (coin > 0 && diamond > 0) {
  4792. this.ui.myNode.diamondNode.x = 385;
  4793. this.ui.myNode.coinNode.x = 467;
  4794. }
  4795. else {
  4796. this.ui.myNode.diamondNode.x = 385;
  4797. this.ui.myNode.coinNode.x = 385;
  4798. }
  4799. if (!getAward) {
  4800. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4801. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4802. }
  4803. else {
  4804. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4805. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4806. }
  4807. }
  4808. startGame() {
  4809. if (DataMgr.powerEnough()) {
  4810. this.ui.myNode.startBtn.touchable = false;
  4811. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4812. console.log('zh:startGame ');
  4813. this.ui.myNode.startBtn.touchable = true;
  4814. DataMgr.setPower(-1);
  4815. xGame.eventMgr.event(POWER_TIME);
  4816. xGame.common.gameMode = GameMode.placeBall;
  4817. xGame.common.placeBallCurLevel = this.level;
  4818. xGame.uiMgr.Show(UIGame);
  4819. xGame.uiMgr.Hide(UILevelDisplay);
  4820. xGame.uiMgr.Hide(UIMain);
  4821. this.hide();
  4822. }));
  4823. }
  4824. else {
  4825. console.log('zh:startGame no power');
  4826. xGame.uiMgr.Show(UIPower);
  4827. }
  4828. }
  4829. hide() {
  4830. super.hide();
  4831. }
  4832. }
  4833. UILevelProp.uiName = "UILevelProp";
  4834. class PutBallLevelDisplay {
  4835. constructor(ui, index) {
  4836. this.index = 0;
  4837. this.ui = ui;
  4838. this.index = index;
  4839. this.ui.onClick(this, this.clickSelf);
  4840. this.updateSelf();
  4841. this.ui.levelTxt.text = (this.index + 1) + "";
  4842. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4843. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4844. }
  4845. updateSelf() {
  4846. let level = this.index + 1;
  4847. this.data = DataMgr.getPlaceBallLevel(level);
  4848. this.ui.starNode.c1.selectedIndex = this.data.star;
  4849. let isChallenge = cfgTable.placeballData[level].type;
  4850. if (this.data.isCur) {
  4851. if (isChallenge) {
  4852. this.ui.c1.selectedIndex = 5;
  4853. }
  4854. else {
  4855. this.ui.c1.selectedIndex = 2;
  4856. }
  4857. }
  4858. else {
  4859. if (this.data.play) {
  4860. if (this.data.star == 3) {
  4861. this.ui.c1.selectedIndex = 0;
  4862. }
  4863. else {
  4864. this.ui.c1.selectedIndex = 1;
  4865. }
  4866. }
  4867. else {
  4868. if (isChallenge) {
  4869. this.ui.c1.selectedIndex = 4;
  4870. }
  4871. else {
  4872. this.ui.c1.selectedIndex = 3;
  4873. }
  4874. }
  4875. }
  4876. }
  4877. clickSelf() {
  4878. if (!this.data.play)
  4879. return;
  4880. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4881. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4882. }
  4883. }
  4884. class UILevelDisplay extends UIBase {
  4885. constructor() {
  4886. super();
  4887. }
  4888. onConstructor() {
  4889. this.ui = ui_UILevelDisplay.createInstance();
  4890. this.contentPane = this.ui;
  4891. this.isEject = false;
  4892. this.myList = this.ui.myNode.myList;
  4893. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4894. this.levelItemArr = [];
  4895. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4896. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4897. this.myList.numItems = levelNum;
  4898. if (Moyu.isKs)
  4899. this.ui.closeNode.closeBtn.x += 100;
  4900. }
  4901. levelItemRender(index, target) {
  4902. let item = new PutBallLevelDisplay(target, index);
  4903. this.levelItemArr.push(item);
  4904. }
  4905. show() {
  4906. super.show();
  4907. this.updateLevel();
  4908. this.scrollToPlace();
  4909. }
  4910. updateLevel() {
  4911. let temp;
  4912. for (let index = 0; index < this.levelItemArr.length; index++) {
  4913. temp = this.levelItemArr[index];
  4914. temp.updateSelf();
  4915. }
  4916. }
  4917. scrollToPlace() {
  4918. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4919. let passArr = DataMgr.getPlaceBallLevelList();
  4920. let offest = passArr.length;
  4921. if (offest >= maxNum - 1)
  4922. offest = maxNum - 1;
  4923. this.myList.scrollToView(offest, true, true);
  4924. }
  4925. hide() {
  4926. super.hide();
  4927. }
  4928. }
  4929. UILevelDisplay.uiName = "UILevelDisplay";
  4930. class ui_UIMatching extends fgui.GComponent {
  4931. static createInstance() {
  4932. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4933. }
  4934. onConstruct() {
  4935. this.n5 = (this.getChild("n5"));
  4936. this.n49 = (this.getChild("n49"));
  4937. this.n51 = (this.getChild("n51"));
  4938. this.n64 = (this.getChild("n64"));
  4939. this.n2 = (this.getChild("n2"));
  4940. this.n53 = (this.getChild("n53"));
  4941. this.n54 = (this.getChild("n54"));
  4942. this.n56 = (this.getChild("n56"));
  4943. this.n58 = (this.getChild("n58"));
  4944. this.n59 = (this.getChild("n59"));
  4945. this.n57 = (this.getChild("n57"));
  4946. this.n60 = (this.getChild("n60"));
  4947. this.n62 = (this.getChild("n62"));
  4948. this.awardTxt = (this.getChild("awardTxt"));
  4949. this.n61 = (this.getChild("n61"));
  4950. this.selfHead = (this.getChild("selfHead"));
  4951. this.aiHead = (this.getChild("aiHead"));
  4952. this.n82 = (this.getChild("n82"));
  4953. this.n84 = (this.getChild("n84"));
  4954. this.n83 = (this.getChild("n83"));
  4955. this.t1 = this.getTransition("t1");
  4956. this.t2 = this.getTransition("t2");
  4957. this.t3 = this.getTransition("t3");
  4958. this.t4 = this.getTransition("t4");
  4959. }
  4960. }
  4961. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4962. class UIMatching extends UIBase {
  4963. constructor() {
  4964. super();
  4965. }
  4966. onConstructor() {
  4967. this.ui = ui_UIMatching.createInstance();
  4968. this.contentPane = this.ui;
  4969. this.isEject = false;
  4970. }
  4971. show(callback) {
  4972. super.show();
  4973. PlatMgr.showBanner(true);
  4974. this.callback = callback;
  4975. let user = Moyu.getUserInfo();
  4976. if (!this.selfPot) {
  4977. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4978. }
  4979. if (!this.aiPot) {
  4980. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4981. }
  4982. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4983. this.ui.selfHead.nameTxt.text = user.nickName;
  4984. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4985. this.ui.aiHead.nameTxt.text = "???";
  4986. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4987. this.ui.selfHead.c1.selectedIndex = 0;
  4988. this.ui.aiHead.c1.selectedIndex = 0;
  4989. this.ui.selfHead.x = this.selfPot.x;
  4990. this.ui.selfHead.y = this.selfPot.y;
  4991. this.ui.aiHead.x = this.aiPot.x;
  4992. this.ui.aiHead.y = this.aiPot.y;
  4993. switch (xGame.common.gameMode) {
  4994. case GameMode.classic:
  4995. break;
  4996. case GameMode.bigMove:
  4997. this.initSkillData();
  4998. break;
  4999. default:
  5000. break;
  5001. }
  5002. this.ui.t1.play(Laya.Handler.create(this, () => {
  5003. this.ui.t2.play(Laya.Handler.create(this, () => {
  5004. switch (xGame.common.gameMode) {
  5005. case GameMode.classic:
  5006. this.waitingPeople();
  5007. break;
  5008. case GameMode.bigMove:
  5009. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5010. break;
  5011. default:
  5012. break;
  5013. }
  5014. }));
  5015. }));
  5016. }
  5017. initSkillData() {
  5018. this.skillSelectData = [];
  5019. let skillUrl = xGame.common.skillIconList;
  5020. let skillName = xGame.common.skillNameList;
  5021. let skillLevel = DataMgr.getBigSkillList();
  5022. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5023. for (let index = 0; index < 5; index++) {
  5024. let obj = {};
  5025. obj.skillImg = skillUrl[index];
  5026. obj.skillName = skillName[index];
  5027. obj.skillType = skillType[index];
  5028. obj.skillLevel = skillLevel[index];
  5029. this.skillSelectData.push(obj);
  5030. }
  5031. }
  5032. getAISkillLevel(myLevel) {
  5033. let video = xGame.common.upSkillLevel;
  5034. let aiLevel;
  5035. let temp;
  5036. if (video) {
  5037. temp = xGame.common.randomNum(-2, -1);
  5038. }
  5039. else {
  5040. if (myLevel <= 5) {
  5041. temp = xGame.common.randomNum(1, 3);
  5042. }
  5043. else if (myLevel <= 9) {
  5044. temp = xGame.common.randomNum(-2, 1);
  5045. }
  5046. else {
  5047. temp = xGame.common.randomNum(-4, 0);
  5048. }
  5049. }
  5050. aiLevel = temp + myLevel;
  5051. if (aiLevel <= 1)
  5052. aiLevel = 1;
  5053. if (aiLevel >= 10)
  5054. aiLevel = 10;
  5055. return aiLevel;
  5056. }
  5057. getAISkillType() {
  5058. return xGame.common.randomNum(1, 4);
  5059. let successTimes = DataMgr.getSkillSuccessTimes();
  5060. let info = cfgTable.aiskillData[successTimes];
  5061. if (!info) {
  5062. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5063. info = cfgTable.aiskillData[max];
  5064. }
  5065. let dataArr = info.skillselect;
  5066. let myCfg = {};
  5067. for (let index = 0; index < dataArr.length; index++) {
  5068. let temp = dataArr[index].split('-');
  5069. myCfg[temp[0]] = {};
  5070. myCfg[temp[0]].id = parseInt(temp[0]);
  5071. myCfg[temp[0]].weight = parseInt(temp[1]);
  5072. }
  5073. let aiCfg = xGame.common.initWeight(myCfg);
  5074. let curData = xGame.common.getRandomWeightData(aiCfg);
  5075. return parseInt(curData.id);
  5076. }
  5077. getAISkillData(index) {
  5078. let myLevel = this.skillSelectData[index].skillLevel;
  5079. let aiLevel = this.getAISkillLevel(myLevel);
  5080. let aiType = this.getAISkillType() - 1;
  5081. return { aiLevel, aiType } = { aiLevel, aiType };
  5082. }
  5083. skillSelectFinish(index) {
  5084. let aiInfo = this.getAISkillData(index);
  5085. xGame.common.gameMgr.selfCurSkill = index;
  5086. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5087. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5088. this.ui.selfHead.c1.selectedIndex = 1;
  5089. this.ui.aiHead.c1.selectedIndex = 1;
  5090. let myData = this.skillSelectData[index];
  5091. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5092. let guide = DataMgr.getSkillGuide();
  5093. if (guide == 0) {
  5094. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5095. }
  5096. else {
  5097. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5098. }
  5099. let aiData = this.skillSelectData[aiInfo.aiType];
  5100. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5101. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5102. this.waitingPeople();
  5103. }
  5104. waitingPeople() {
  5105. let time = xGame.common.randomNum(1000, 3000);
  5106. time += 1000;
  5107. Laya.timer.once(time, this, () => {
  5108. this.matchingSuccess();
  5109. });
  5110. }
  5111. matchingSuccess() {
  5112. let gameUI = xGame.common.gameUI;
  5113. let name = gameUI.ui.topNode.aiNameTxt.text;
  5114. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5115. this.ui.aiHead.nameTxt.text = name;
  5116. this.ui.aiHead.headImg.url = url;
  5117. name = gameUI.ui.topNode.selfNameTxt.text;
  5118. url = gameUI.ui.topNode.selfHeadLoader.url;
  5119. this.ui.selfHead.nameTxt.text = name;
  5120. this.ui.selfHead.headImg.url = url;
  5121. this.ui.t3.play(Laya.Handler.create(this, () => {
  5122. this.callback && this.callback();
  5123. this.ui.t4.play(Laya.Handler.create(this, () => {
  5124. this.destroySelf();
  5125. }));
  5126. }));
  5127. }
  5128. destroySelf() {
  5129. this.callback = null;
  5130. this.skillSelectData = null;
  5131. this.selfPot = null;
  5132. this.aiPot = null;
  5133. if (!this.ui.isDisposed) {
  5134. this.ui.removeFromParent();
  5135. this.ui.dispose();
  5136. }
  5137. xGame.uiMgr.destroyUI(this);
  5138. }
  5139. }
  5140. UIMatching.uiName = "UIMatching";
  5141. class ui_UIRanking extends fgui.GComponent {
  5142. static createInstance() {
  5143. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5144. }
  5145. onConstruct() {
  5146. this.n26 = (this.getChild("n26"));
  5147. this.myNode = (this.getChild("myNode"));
  5148. }
  5149. }
  5150. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5151. class UIRanking extends UIBase {
  5152. constructor() {
  5153. super();
  5154. this.showSelf = true;
  5155. this.rankType = 1;
  5156. this.rankList = [];
  5157. this.myIndex = 0;
  5158. this.myStar = 0;
  5159. }
  5160. onConstructor() {
  5161. this.ui = ui_UIRanking.createInstance();
  5162. this.contentPane = this.ui;
  5163. this.isEject = false;
  5164. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5165. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5166. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5167. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5168. this.ui.myNode.myList.setVirtual();
  5169. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5170. }
  5171. show() {
  5172. super.show();
  5173. this.myIndex = 51;
  5174. Moyu.getRankList({
  5175. rankId: xGame.common.curRankID,
  5176. type: MoyuRankType.total,
  5177. page: 1,
  5178. pageSize: 50,
  5179. }, this, this.updateItemData);
  5180. this.updateSelf();
  5181. let self = Moyu.getUserInfo();
  5182. if (!self.isAuth) {
  5183. Moyu.initUser(this, () => {
  5184. DataMgr.upRankData();
  5185. });
  5186. }
  5187. }
  5188. updateSelfItem() {
  5189. let self = Moyu.getUserInfo();
  5190. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5191. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  5192. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5193. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  5194. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5195. }
  5196. updateItemData(data) {
  5197. this.myStar = xGame.common.getAllStarNum();
  5198. if (this.rankList.length < 2) {
  5199. this.rankList = data;
  5200. let self = Moyu.getUserInfo();
  5201. for (let i = 0; i < data.length; i++) {
  5202. let data = this.rankList[i];
  5203. if (data.userId == self.userId) {
  5204. this.rankList.splice(i, 1);
  5205. break;
  5206. }
  5207. }
  5208. for (let i = 0; i < data.length; i++) {
  5209. let data = this.rankList[i];
  5210. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5211. this.myIndex = i + 1;
  5212. let user = { headIcon: self.headIcon, nickName: "myself" };
  5213. let ud = { user: user, data: {} };
  5214. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5215. if (Moyu.platType < 11) {
  5216. user.headIcon = self.headIcon;
  5217. user.nickName = self.nickName;
  5218. }
  5219. this.rankList.splice(i, 0, md);
  5220. break;
  5221. }
  5222. }
  5223. }
  5224. this.updateSelfItem();
  5225. this.ui.myNode.myList.numItems = this.rankList.length;
  5226. }
  5227. updateItemUI(index, obj) {
  5228. let data = this.rankList[index];
  5229. let userData = JSON.parse(data.userData).user;
  5230. obj.nameTxt.text = userData.nickName.toString();
  5231. obj.valueTxt.text = data.rankScore;
  5232. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5233. obj.rankTxt.text = index + 1;
  5234. switch (index) {
  5235. case 0:
  5236. this.setImg(obj, 1, 0, 0);
  5237. obj.rankTxt.color = "#FFC047";
  5238. break;
  5239. case 1:
  5240. this.setImg(obj, 0, 1, 0);
  5241. obj.rankTxt.color = "#ACACAC";
  5242. break;
  5243. case 2:
  5244. this.setImg(obj, 0, 0, 1);
  5245. obj.rankTxt.color = "#D09672";
  5246. break;
  5247. default:
  5248. this.setImg(obj, 0, 0, 0);
  5249. obj.rankTxt.color = "#496FAB";
  5250. break;
  5251. }
  5252. }
  5253. setImg(obj, a, b, c) {
  5254. obj.img1.visible = a ? true : false;
  5255. obj.img2.visible = b ? true : false;
  5256. obj.img3.visible = c ? true : false;
  5257. }
  5258. changeList(type) {
  5259. this.rankType = type;
  5260. this.updateSelf();
  5261. }
  5262. changeSelfNode() {
  5263. this.showSelf = !this.showSelf;
  5264. this.updateSelf();
  5265. }
  5266. updateSelf() {
  5267. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5268. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5269. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5270. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5271. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5272. }
  5273. }
  5274. UIRanking.uiName = "UIRanking";
  5275. class ui_UISecretary extends fgui.GComponent {
  5276. static createInstance() {
  5277. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5278. }
  5279. onConstruct() {
  5280. this.n0 = (this.getChild("n0"));
  5281. this.myNode = (this.getChild("myNode"));
  5282. this.closeBtn = (this.getChild("closeBtn"));
  5283. this.t0 = this.getTransition("t0");
  5284. }
  5285. }
  5286. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5287. class UISecretary extends UIBase {
  5288. constructor() {
  5289. super();
  5290. this.curIndex = 1;
  5291. }
  5292. onConstructor() {
  5293. this.ui = ui_UISecretary.createInstance();
  5294. this.contentPane = this.ui;
  5295. this.isEject = false;
  5296. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5297. this.nodeObj = { left: null, right: null, cur: null };
  5298. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5299. }
  5300. show() {
  5301. super.show();
  5302. this.ui.t0.play();
  5303. this.updateData();
  5304. }
  5305. addSecretarySpine(node, spineName) {
  5306. if (spineName == "mishu") {
  5307. if (this.secretarySpine1) {
  5308. node.displayObject.destroyChildren();
  5309. this.playWoman(this.secretarySpine1, node.displayObject);
  5310. }
  5311. else {
  5312. let spine1 = new SpineMgr("mishu", () => {
  5313. this.secretarySpine1 = spine1;
  5314. this.playWoman(this.secretarySpine1, node.displayObject);
  5315. });
  5316. }
  5317. }
  5318. else {
  5319. if (this.secretarySpine2) {
  5320. node.displayObject.destroyChildren();
  5321. this.playWoman(this.secretarySpine2, node.displayObject);
  5322. }
  5323. else {
  5324. let spine2 = new SpineMgr("xiaomishu2", () => {
  5325. this.secretarySpine2 = spine2;
  5326. this.playWoman(this.secretarySpine2, node.displayObject);
  5327. });
  5328. }
  5329. }
  5330. }
  5331. playWoman(node, parent) {
  5332. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5333. let yy = this.ui.myNode.gameNode3.secretary.height;
  5334. let scale = 1.5;
  5335. if (node == this.secretarySpine2) {
  5336. scale = 1.2;
  5337. }
  5338. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5339. node.play(data, 0, true, parent);
  5340. }
  5341. turnLeft() {
  5342. this.curIndex--;
  5343. if (this.curIndex < 1) {
  5344. this.curIndex = 2;
  5345. }
  5346. let left = this.nodeObj.left;
  5347. let right = this.nodeObj.right;
  5348. let cur = this.nodeObj.cur;
  5349. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5350. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5351. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5352. this.updateData();
  5353. }));
  5354. this.ui.myNode.setChildIndex(right, 2);
  5355. this.nodeObj.left = cur;
  5356. this.nodeObj.right = left;
  5357. this.nodeObj.cur = right;
  5358. }
  5359. turnRight() {
  5360. this.curIndex++;
  5361. if (this.curIndex > 2) {
  5362. this.curIndex = 1;
  5363. }
  5364. let left = this.nodeObj.left;
  5365. let right = this.nodeObj.right;
  5366. let cur = this.nodeObj.cur;
  5367. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5368. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5369. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5370. this.updateData();
  5371. }));
  5372. this.ui.myNode.setChildIndex(left, 2);
  5373. this.nodeObj.left = right;
  5374. this.nodeObj.right = cur;
  5375. this.nodeObj.cur = left;
  5376. }
  5377. updateData() {
  5378. console.log('zh: updateData FFFFFFFFFF');
  5379. let data = cfgTable.secretaryshopData;
  5380. let children = this.ui.myNode._children;
  5381. let temp;
  5382. let curData;
  5383. for (let index = 0; index < children.length; index++) {
  5384. temp = children[index];
  5385. curData = data[1];
  5386. temp.heightTxt.text = curData.height;
  5387. temp.foodTxt.text = curData.food;
  5388. temp.historyTxt.text = curData.history;
  5389. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5390. this.addSecretarySpine(temp.secretary, curData.spine);
  5391. let womanIndex = curData.id - 1;
  5392. let getWoman = DataMgr.getSecretary(womanIndex);
  5393. let curUse = DataMgr.getCurSecretary();
  5394. if (getWoman) {
  5395. if (curUse == womanIndex) {
  5396. temp.purchaseBtn.c1.selectedIndex = 1;
  5397. }
  5398. else {
  5399. temp.purchaseBtn.c1.selectedIndex = 2;
  5400. }
  5401. }
  5402. else {
  5403. temp.purchaseBtn.c1.selectedIndex = 0;
  5404. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5405. }
  5406. temp.purchaseBtn.visible = false;
  5407. }
  5408. }
  5409. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5410. console.log('zh: 点击了clickSecretary ');
  5411. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5412. if (getWoman) {
  5413. if (curUse != womanIndex) {
  5414. console.log();
  5415. DataMgr.setCurSecretary(womanIndex);
  5416. this.updateData();
  5417. }
  5418. }
  5419. else {
  5420. console.log('zh:点击购买了');
  5421. let need = needDiamond;
  5422. if (DataMgr.diamondEnough(need)) {
  5423. DataMgr.setDiamond(-need);
  5424. DataMgr.setSecretary(womanIndex, 1);
  5425. DataMgr.setCurSecretary(womanIndex);
  5426. this.updateData();
  5427. }
  5428. else {
  5429. xGame.uiMgr.Show(UIAddProp, 1);
  5430. }
  5431. }
  5432. }
  5433. closeSelf() {
  5434. this.hide();
  5435. }
  5436. }
  5437. UISecretary.uiName = "UISecretary";
  5438. class ui_UIShop extends fgui.GComponent {
  5439. static createInstance() {
  5440. return (fgui.UIPackage.createObject("game", "UIShop"));
  5441. }
  5442. onConstruct() {
  5443. this.n48 = (this.getChild("n48"));
  5444. this.n0 = (this.getChild("n0"));
  5445. this.secretary = (this.getChild("secretary"));
  5446. this.talkNode = (this.getChild("talkNode"));
  5447. this.closeNode = (this.getChild("closeNode"));
  5448. this.moneyNode = (this.getChild("moneyNode"));
  5449. this.myNode = (this.getChild("myNode"));
  5450. }
  5451. }
  5452. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5453. class BallRodDisplay {
  5454. constructor(ui, index) {
  5455. this.index = 0;
  5456. this.uiIndex = 0;
  5457. this.ui = ui;
  5458. this.index = index;
  5459. this.initData();
  5460. }
  5461. initData() {
  5462. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5463. let data = cfgTable.ballrodData[this.index + 1];
  5464. this.ui.nameTxt.text = data.name;
  5465. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5466. this.ui.levelNode.c1.selectedIndex = data.quality;
  5467. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5468. if (data.spine) {
  5469. this.mySpine = new SpineMgr(data.spine, () => {
  5470. let xx = 150;
  5471. let yy = 70;
  5472. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5473. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5474. });
  5475. }
  5476. }
  5477. updateSelf() {
  5478. console.log('zh:updateSelf -------------- ');
  5479. let get = DataMgr.getBallRod(this.index);
  5480. if (get == null)
  5481. get = 1;
  5482. let curUse = DataMgr.getCurBallRod();
  5483. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5484. if (get) {
  5485. if (curUse == this.index) {
  5486. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5487. }
  5488. else {
  5489. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5490. }
  5491. }
  5492. else {
  5493. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5494. }
  5495. }
  5496. buyBallRod() {
  5497. console.log('zh:buyBallRod eeeeee');
  5498. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5499. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5500. switch (selectedIndex) {
  5501. case 0:
  5502. break;
  5503. case 1:
  5504. console.log('zh:点击了 USE THIS');
  5505. DataMgr.setCurBallRod(this.index);
  5506. let curUse = DataMgr.getCurBallRod();
  5507. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5508. let ui = xGame.uiMgr.getUI(UIShop);
  5509. ui.updateBallRod();
  5510. break;
  5511. case 2:
  5512. let data = cfgTable.ballrodData[this.index + 1];
  5513. let need = data.price;
  5514. if (DataMgr.diamondEnough(need)) {
  5515. DataMgr.setDiamond(-need);
  5516. DataMgr.setBallRod(this.index, 1);
  5517. DataMgr.setCurBallRod(this.index);
  5518. let ui = xGame.uiMgr.getUI(UIShop);
  5519. ui.updateBallRod();
  5520. }
  5521. else {
  5522. xGame.uiMgr.Show(UIAddProp, 1);
  5523. }
  5524. break;
  5525. default:
  5526. break;
  5527. }
  5528. }
  5529. }
  5530. class UIShop extends UIBase {
  5531. constructor() {
  5532. super();
  5533. this.itemNums = 0;
  5534. }
  5535. onConstructor() {
  5536. this.ui = ui_UIShop.createInstance();
  5537. this.contentPane = this.ui;
  5538. this.isEject = false;
  5539. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5540. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5541. this.addUIClick(this.ui, this.interuptSecretary);
  5542. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5543. this.ballRodArr = [];
  5544. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5545. this.ui.myNode.myList.numItems = this.itemNums;
  5546. if (Moyu.isKs)
  5547. this.ui.closeNode.closeBtn.x += 100;
  5548. }
  5549. show() {
  5550. super.show();
  5551. this.playSecretaryIdle();
  5552. this.updateBallRod();
  5553. }
  5554. updateBallRod() {
  5555. for (let index = 0; index < this.ballRodArr.length; index++) {
  5556. this.ballRodArr[index].updateSelf();
  5557. }
  5558. }
  5559. renderBallRod(sort, obj) {
  5560. let index = this.getIndexBySort(sort + 1) - 1;
  5561. let ballRod = new BallRodDisplay(obj, index);
  5562. this.ballRodArr.push(ballRod);
  5563. }
  5564. getIndexBySort(sort) {
  5565. let object = cfgTable.ballrodData;
  5566. for (const key in object) {
  5567. if (object[key].sort == sort) {
  5568. return parseInt(key);
  5569. }
  5570. }
  5571. }
  5572. playSecretaryIdle() {
  5573. let parent = this.ui.secretary.displayObject;
  5574. parent.destroyChildren();
  5575. let xx = this.ui.secretary.width / 2;
  5576. let yy = this.ui.secretary.height;
  5577. let scale = xGame.common.getSecretaryScale();
  5578. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5579. xGame.common.secretary.play(data, 0, true, parent);
  5580. }
  5581. interuptSecretary() {
  5582. Laya.timer.clearAll(this);
  5583. this.playSecretaryRandomSound();
  5584. }
  5585. playSecretaryRandomSound() {
  5586. if (this.isHide)
  5587. return;
  5588. let time = xGame.common.randomNum(45000, 60000);
  5589. Laya.timer.once(time, this, () => {
  5590. if (this.isHide)
  5591. return;
  5592. let index = xGame.common.randomNum(4, 7);
  5593. xGame.soundMgr.playSound("s_main0" + index);
  5594. let words = 1;
  5595. switch (index) {
  5596. case 4:
  5597. words = 5;
  5598. break;
  5599. case 5:
  5600. words = 3;
  5601. break;
  5602. case 6:
  5603. words = 6;
  5604. break;
  5605. case 7:
  5606. words = 7;
  5607. break;
  5608. default:
  5609. break;
  5610. }
  5611. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5612. this.playSecretaryRandomSound();
  5613. });
  5614. }
  5615. closeSelf() {
  5616. this.hide();
  5617. }
  5618. }
  5619. UIShop.uiName = "UIShop";
  5620. class ui_UISign extends fgui.GComponent {
  5621. static createInstance() {
  5622. return (fgui.UIPackage.createObject("game", "UISign"));
  5623. }
  5624. onConstruct() {
  5625. this.n6 = (this.getChild("n6"));
  5626. this.closeNode = (this.getChild("closeNode"));
  5627. this.myNode = (this.getChild("myNode"));
  5628. this.moneyNode = (this.getChild("moneyNode"));
  5629. this.secretary = (this.getChild("secretary"));
  5630. this.talkNode = (this.getChild("talkNode"));
  5631. this.tripleBtn = (this.getChild("tripleBtn"));
  5632. this.normalBtn = (this.getChild("normalBtn"));
  5633. this.tipsNode = (this.getChild("tipsNode"));
  5634. this.againBtn = (this.getChild("againBtn"));
  5635. this.t0 = this.getTransition("t0");
  5636. }
  5637. }
  5638. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5639. class SignMax {
  5640. constructor(ui) {
  5641. this.ui = ui;
  5642. }
  5643. updateSelf(index, sameDay, curDayIndex) {
  5644. let data = cfgTable.signData[index + 1];
  5645. this.ui.titleTxt.text = data.title;
  5646. let arr1 = data.award[0].split('-');
  5647. let arr2 = data.award[1].split('-');
  5648. let num1 = parseInt(arr1[1]);
  5649. let num2 = parseInt(arr2[1]);
  5650. this.ui.numTxt1.text = num1 + "";
  5651. this.ui.numTxt2.text = num2 + "";
  5652. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5653. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5654. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5655. this.ui.numTxt1.visible = false;
  5656. }
  5657. else {
  5658. this.ui.numTxt1.visible = true;
  5659. }
  5660. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5661. this.ui.numTxt2.visible = false;
  5662. }
  5663. else {
  5664. this.ui.numTxt2.visible = true;
  5665. }
  5666. if (index < curDayIndex) {
  5667. this.ui.c1.selectedIndex = 1;
  5668. }
  5669. else if (index == curDayIndex) {
  5670. if (sameDay) {
  5671. this.ui.c1.selectedIndex = 2;
  5672. }
  5673. else {
  5674. this.ui.c1.selectedIndex = 2;
  5675. }
  5676. }
  5677. else {
  5678. this.ui.c1.selectedIndex = 0;
  5679. }
  5680. }
  5681. }
  5682. class SignNormal {
  5683. constructor(ui) {
  5684. this.ui = ui;
  5685. }
  5686. updateSelf(index, sameDay, curDayIndex) {
  5687. let data = cfgTable.signData[index + 1];
  5688. this.ui.titleTxt.text = data.title;
  5689. let arr = data.award[0].split('-');
  5690. let type = parseInt(arr[0]);
  5691. let num = parseInt(arr[1]);
  5692. this.ui.numTxt.text = num + "";
  5693. if (type > 2) {
  5694. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5695. this.ui.myIcon.rotation = 0;
  5696. }
  5697. else {
  5698. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5699. this.ui.myIcon.rotation = 0;
  5700. }
  5701. if (xGame.common.signAwardContainsRod(data.award)) {
  5702. this.ui.numTxt.visible = false;
  5703. }
  5704. else {
  5705. this.ui.numTxt.visible = true;
  5706. }
  5707. if (index < curDayIndex) {
  5708. this.ui.c1.selectedIndex = 1;
  5709. }
  5710. else if (index == curDayIndex) {
  5711. if (sameDay) {
  5712. this.ui.c1.selectedIndex = 2;
  5713. }
  5714. else {
  5715. this.ui.c1.selectedIndex = 2;
  5716. }
  5717. }
  5718. else {
  5719. this.ui.c1.selectedIndex = 0;
  5720. }
  5721. }
  5722. }
  5723. class UISign extends UIBase {
  5724. constructor() {
  5725. super();
  5726. this.curDayIndex = 0;
  5727. this.starX = 0;
  5728. }
  5729. onConstructor() {
  5730. this.ui = ui_UISign.createInstance();
  5731. this.contentPane = this.ui;
  5732. this.isEject = false;
  5733. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5734. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5735. this.initSignItem();
  5736. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5737. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5738. }
  5739. show() {
  5740. super.show();
  5741. this.ui.t0.play();
  5742. this.playSecretaryIdle();
  5743. this.updateSign();
  5744. }
  5745. initSignItem() {
  5746. this.signArr = [];
  5747. for (let index = 0; index < 6; index++) {
  5748. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5749. this.signArr.push(temp);
  5750. }
  5751. this.signMax = new SignMax(this.ui.myNode.day7);
  5752. if (Moyu.isKs)
  5753. this.ui.closeNode.closeBtn.x += 100;
  5754. }
  5755. updateSign() {
  5756. let sameDay = xGame.common.judgeSameDay();
  5757. let max = 7;
  5758. this.curDayIndex = DataMgr.getSignData();
  5759. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5760. this.curDayIndex = 0;
  5761. if (!sameDay) {
  5762. this.ui.normalBtn.visible = true;
  5763. this.ui.tipsNode.visible = false;
  5764. this.ui.againBtn.visible = false;
  5765. }
  5766. else {
  5767. this.ui.normalBtn.visible = false;
  5768. let again = DataMgr.getExtraSign();
  5769. let isCurrency = false;
  5770. let index = this.curDayIndex;
  5771. if (index == 0)
  5772. index = 7;
  5773. let award = cfgTable.signData[index].award;
  5774. let num = award[0].split("-")[0];
  5775. if (num == "1" || num == "2")
  5776. isCurrency = true;
  5777. let showAgain = again == 0 && isCurrency;
  5778. this.ui.againBtn.visible = showAgain;
  5779. this.ui.tipsNode.visible = !showAgain;
  5780. }
  5781. for (let index = 0; index < this.signArr.length; index++) {
  5782. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5783. }
  5784. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5785. }
  5786. playSecretaryIdle() {
  5787. let parent = this.ui.secretary.displayObject;
  5788. parent.destroyChildren();
  5789. let xx = this.ui.secretary.width / 2;
  5790. let yy = this.ui.secretary.height;
  5791. let scale = xGame.common.getSecretaryScale();
  5792. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5793. xGame.common.secretary.play(data, 0, true, parent);
  5794. }
  5795. closeSelf() {
  5796. this.hide();
  5797. }
  5798. normalGetAward() {
  5799. let sameDay = xGame.common.judgeSameDay();
  5800. if (!sameDay) {
  5801. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5802. let temp;
  5803. let type;
  5804. let num;
  5805. let arr = [];
  5806. for (let index = 0; index < award.length; index++) {
  5807. temp = award[index].split("-");
  5808. type = parseInt(temp[0]);
  5809. num = parseInt(temp[1]);
  5810. let awardType = new AwardType();
  5811. awardType.num = num;
  5812. awardType.type = type;
  5813. arr.push(awardType);
  5814. }
  5815. xGame.common.getAward(arr, (watchVideo) => {
  5816. this.curDayIndex++;
  5817. if (this.curDayIndex > 7)
  5818. this.curDayIndex = 0;
  5819. DataMgr.setSignData(this.curDayIndex);
  5820. DataMgr.setSignTime(new Date().getTime());
  5821. if (watchVideo) {
  5822. DataMgr.setExtraSign(1);
  5823. Moyu.sendDataEvent("signIn1");
  5824. }
  5825. this.updateSign();
  5826. });
  5827. }
  5828. }
  5829. againGetAward() {
  5830. Moyu.sendDataEvent("signIn2");
  5831. console.log('zh:qjff_AD_for_uisign');
  5832. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  5833. }
  5834. else {
  5835. console.log('zh:AD 失败,直接发放奖励');
  5836. this.qjff_AD_for_uisign();
  5837. }
  5838. }
  5839. qjff_AD_for_uisign() {
  5840. let index = this.curDayIndex;
  5841. if (index == 0)
  5842. index = 7;
  5843. let award = cfgTable.signData[index].award;
  5844. let temp;
  5845. let type;
  5846. let num;
  5847. for (let index = 0; index < award.length; index++) {
  5848. temp = award[index].split("-");
  5849. type = parseInt(temp[0]);
  5850. num = parseInt(temp[1]) * 3;
  5851. xGame.common.playObjFlyAnim(num, type);
  5852. }
  5853. DataMgr.setExtraSign(1);
  5854. this.updateSign();
  5855. }
  5856. }
  5857. UISign.uiName = "UISign";
  5858. class ui_UISkill extends fgui.GComponent {
  5859. static createInstance() {
  5860. return (fgui.UIPackage.createObject("game", "UISkill"));
  5861. }
  5862. onConstruct() {
  5863. this.n48 = (this.getChild("n48"));
  5864. this.n0 = (this.getChild("n0"));
  5865. this.secretary = (this.getChild("secretary"));
  5866. this.talkNode = (this.getChild("talkNode"));
  5867. this.closeNode = (this.getChild("closeNode"));
  5868. this.moneyNode = (this.getChild("moneyNode"));
  5869. this.skillNode = (this.getChild("skillNode"));
  5870. this.guideNode = (this.getChild("guideNode"));
  5871. }
  5872. }
  5873. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5874. class SkillDisplay {
  5875. constructor(ui, data, uiIndex) {
  5876. this.starX = 0;
  5877. this.starY = 0;
  5878. this.index = 0;
  5879. this.ui = ui;
  5880. this.data = data;
  5881. this.index = uiIndex;
  5882. this.initSelf();
  5883. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5884. }
  5885. initSelf() {
  5886. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5887. this.ui.nameTxt.text = this.data.name;
  5888. this.ui.describeTxt.text = this.data.describe;
  5889. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5890. this.ui.startBtn.onClick(this, this.startGame);
  5891. this.updateSelf();
  5892. }
  5893. updateSelf() {
  5894. this.checkTry();
  5895. let level = DataMgr.getBigSkillByIndex(this.index);
  5896. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5897. }
  5898. checkTry() {
  5899. let index = this.index;
  5900. let level = DataMgr.getBigSkillByIndex(index);
  5901. if (level == null) {
  5902. DataMgr.setBigSkill(index, 1, false);
  5903. level = 1;
  5904. }
  5905. this.ui.levelTxt.text = "LV." + level;
  5906. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5907. this.ui.tryNode.visible = true;
  5908. else
  5909. this.ui.tryNode.visible = false;
  5910. }
  5911. clickAddLevel() {
  5912. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5913. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5914. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  5915. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  5916. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5917. }
  5918. else {
  5919. console.log('zh:AD 失败,直接发放奖励');
  5920. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5921. }
  5922. }
  5923. qjff_AD_for_skilldisplay_clickAddLevel() {
  5924. DataMgr.setBigSkill(this.data.index, 1);
  5925. this.updateSelf();
  5926. xGame.common.upSkillLevel = true;
  5927. }
  5928. startGame() {
  5929. if (this.data.index == 3) {
  5930. alert('Coming soon!');
  5931. return;
  5932. }
  5933. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5934. let needCoin = xGame.common.bigMoveNeedCoin;
  5935. xGame.common.passAwardCoin = 2000;
  5936. let guide = DataMgr.getSkillGuide();
  5937. console.log('zh:startGame guide=' + guide);
  5938. xGame.common.temSelfLevel = 0;
  5939. if (guide == 0) {
  5940. needCoin = 0;
  5941. xGame.common.temSelfLevel = 100;
  5942. }
  5943. if (DataMgr.coinEnough(needCoin)) {
  5944. DataMgr.setCoin(-needCoin);
  5945. xGame.common.curPlayerSkillType = this.index;
  5946. if (guide == 0)
  5947. xGame.common.curPlayerSkillType = 0;
  5948. xGame.uiMgr.Show(UIGame);
  5949. xGame.uiMgr.Hide(UIMain);
  5950. xGame.uiMgr.Show(UIMatching, () => {
  5951. xGame.common.gameUI.ui.alpha = 1;
  5952. xGame.common.gameUI.startGame();
  5953. xGame.uiMgr.Hide(UISkill);
  5954. });
  5955. }
  5956. else {
  5957. xGame.uiMgr.Show(UIAddProp, 0);
  5958. Moyu.sendDataEvent("AddCoinVideo");
  5959. }
  5960. }
  5961. }
  5962. class UISkill extends UIBase {
  5963. constructor() {
  5964. super();
  5965. this.skillData = [];
  5966. }
  5967. onConstructor() {
  5968. this.ui = ui_UISkill.createInstance();
  5969. this.contentPane = this.ui;
  5970. this.isEject = false;
  5971. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5972. this.initSkillData();
  5973. console.log('zh:aaaaaa1111111111');
  5974. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5975. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5976. console.log('zh:aaaaaa22222222');
  5977. this.displayList = [];
  5978. this.ui.skillNode.skillList.numItems = 3;
  5979. this.addUIClick(this.ui, this.interuptSecretary);
  5980. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5981. this.ui.talkNode.visible = false;
  5982. if (Moyu.isKs)
  5983. this.ui.closeNode.closeBtn.x += 100;
  5984. }
  5985. show() {
  5986. super.show();
  5987. this.playSecretaryIdle();
  5988. this.moneyNode.ui.c1.selectedIndex = 1;
  5989. Laya.timer.clearAll(this);
  5990. xGame.soundMgr.playSound("s_start");
  5991. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5992. let guide = DataMgr.getSkillGuide();
  5993. this.ui.guideNode.visible = guide == 0;
  5994. let item = this.getSkillItemByUIIndex(0);
  5995. if (guide == 0) {
  5996. item.ui.c1.selectedIndex = 1;
  5997. }
  5998. else {
  5999. item.ui.c1.selectedIndex = 0;
  6000. }
  6001. this.ui.guideNode.guideBtn.visible = guide == 0;
  6002. for (let index = 0; index < this.displayList.length; index++) {
  6003. this.displayList[index].checkTry();
  6004. }
  6005. }
  6006. getSkillItemByUIIndex(cur) {
  6007. for (let index = 0; index < this.displayList.length; index++) {
  6008. if (this.displayList[index].index == cur) {
  6009. return this.displayList[index];
  6010. }
  6011. }
  6012. }
  6013. enterGuideLevel() {
  6014. let item = this.getSkillItemByUIIndex(0);
  6015. item.startGame();
  6016. if (DataMgr.getNewUser())
  6017. Moyu.sendDataEvent("gameStart1");
  6018. }
  6019. initSkillData() {
  6020. this.skillData = [];
  6021. let nameList = xGame.common.skillNameList;
  6022. let iconList = xGame.common.skillIconList;
  6023. let describeList = [
  6024. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6025. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
  6026. "The power of frost descends—freezing the flow and taking full control of the game!"
  6027. ];
  6028. console.log('zh:initSkillData 111111111');
  6029. let data;
  6030. for (let index = 0; index < nameList.length; index++) {
  6031. data = {};
  6032. data.name = nameList[index];
  6033. data.icon = iconList[index];
  6034. data.describe = describeList[index];
  6035. data.index = index;
  6036. this.skillData.push(data);
  6037. }
  6038. }
  6039. updateSkillItem(index, target) {
  6040. if (this.displayList[index] == null) {
  6041. let uiIndex;
  6042. switch (index) {
  6043. case 0:
  6044. uiIndex = 1;
  6045. break;
  6046. case 1:
  6047. uiIndex = 0;
  6048. break;
  6049. case 2:
  6050. uiIndex = 2;
  6051. break;
  6052. case 3:
  6053. uiIndex = 3;
  6054. break;
  6055. default:
  6056. break;
  6057. }
  6058. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6059. this.displayList.push(temp);
  6060. }
  6061. }
  6062. playSecretaryIdle() {
  6063. let parent = this.ui.secretary.displayObject;
  6064. parent.destroyChildren();
  6065. let xx = this.ui.secretary.width / 2;
  6066. let yy = this.ui.secretary.height;
  6067. let scale = xGame.common.getSecretaryScale();
  6068. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6069. xGame.common.secretary.play(data, 0, true, parent);
  6070. }
  6071. returnUIMain() {
  6072. this.hide();
  6073. xGame.common.stopGirlPop(this.ui.talkNode);
  6074. xGame.uiMgr.Show(UIMain);
  6075. }
  6076. interuptSecretary() {
  6077. Laya.timer.clearAll(this);
  6078. this.playSecretaryRandomSound();
  6079. }
  6080. playSecretaryRandomSound() {
  6081. if (this.isHide)
  6082. return;
  6083. let time = xGame.common.randomNum(45000, 60000);
  6084. Laya.timer.once(time, this, () => {
  6085. if (this.isHide)
  6086. return;
  6087. let index = xGame.common.randomNum(4, 7);
  6088. xGame.soundMgr.playSound("s_main0" + index);
  6089. let words = 1;
  6090. switch (index) {
  6091. case 4:
  6092. words = 5;
  6093. break;
  6094. case 5:
  6095. words = 3;
  6096. break;
  6097. case 6:
  6098. words = 6;
  6099. break;
  6100. case 7:
  6101. words = 7;
  6102. break;
  6103. default:
  6104. break;
  6105. }
  6106. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6107. this.playSecretaryRandomSound();
  6108. });
  6109. }
  6110. }
  6111. UISkill.uiName = "UISkill";
  6112. class ui_UIMsg extends fgui.GComponent {
  6113. static createInstance() {
  6114. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6115. }
  6116. onConstruct() {
  6117. this.tipsNode = (this.getChild("tipsNode"));
  6118. }
  6119. }
  6120. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6121. class UIMsg extends UIBase {
  6122. constructor() {
  6123. super();
  6124. }
  6125. onConstructor() {
  6126. this.ui = ui_UIMsg.createInstance();
  6127. this.contentPane = this.ui;
  6128. this.isEject = false;
  6129. this.isMuti = true;
  6130. }
  6131. show(msg, callback) {
  6132. super.show();
  6133. this.ui.tipsNode.msgTxt.text = msg;
  6134. this.ui.alpha = 1;
  6135. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6136. this.hide();
  6137. callback && callback();
  6138. }), 1000);
  6139. }
  6140. }
  6141. UIMsg.uiName = "UIMsg";
  6142. class ui_UIModeSelection extends fgui.GComponent {
  6143. static createInstance() {
  6144. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6145. }
  6146. onConstruct() {
  6147. this.n19 = (this.getChild("n19"));
  6148. this.closeBtn = (this.getChild("closeBtn"));
  6149. this.myNode = (this.getChild("myNode"));
  6150. this.t0 = this.getTransition("t0");
  6151. }
  6152. }
  6153. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6154. class UIModeSelection extends UIBase {
  6155. constructor() {
  6156. super();
  6157. }
  6158. onConstructor() {
  6159. this.ui = ui_UIModeSelection.createInstance();
  6160. this.contentPane = this.ui;
  6161. this.isEject = false;
  6162. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6163. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6164. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6165. this.addUIClick(this.ui.closeBtn, this.hide);
  6166. this.peopleArr = [650, 6900, 3800];
  6167. this.peopleOffest = [50, 500, 200];
  6168. this.updateSelf();
  6169. }
  6170. show(callback) {
  6171. super.show();
  6172. this.ui.t0.play();
  6173. this.callback = callback;
  6174. }
  6175. updateSelf() {
  6176. let cfg = cfgTable.modeselectData;
  6177. for (let index = 1; index <= 3; index++) {
  6178. let node = this.ui.myNode["type" + index];
  6179. node.need.text = cfg[index].need;
  6180. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6181. node.peopleTxt.text = this.getRandPeople(index - 1);
  6182. }
  6183. }
  6184. enterGame(type) {
  6185. console.log('zh: 进入经典模式 type: ' + type);
  6186. xGame.common.classicRoomType = type;
  6187. let cfg = cfgTable.modeselectData[type];
  6188. let need = cfg.need;
  6189. xGame.common.passAwardCoin = cfg.award;
  6190. if (DataMgr.coinEnough(need)) {
  6191. DataMgr.setCoin(-need);
  6192. this.ui.myNode["type" + type].t0.play();
  6193. Laya.timer.once(200, this, () => {
  6194. this.callback && this.callback();
  6195. });
  6196. }
  6197. else {
  6198. Moyu.sendDataEvent("AddCoinVideo");
  6199. xGame.uiMgr.Show(UIAddProp, 0);
  6200. }
  6201. }
  6202. getRandPeople(index) {
  6203. let rand = this.peopleOffest[index];
  6204. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6205. }
  6206. }
  6207. UIModeSelection.uiName = "UIModeSelection";
  6208. class ui_UIGetAward extends fgui.GComponent {
  6209. static createInstance() {
  6210. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6211. }
  6212. onConstruct() {
  6213. this.n4 = (this.getChild("n4"));
  6214. this.n0 = (this.getChild("n0"));
  6215. this.myList = (this.getChild("myList"));
  6216. this.n1 = (this.getChild("n1"));
  6217. this.eftNode = (this.getChild("eftNode"));
  6218. this.btnNode = (this.getChild("btnNode"));
  6219. this.t0 = this.getTransition("t0");
  6220. }
  6221. }
  6222. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6223. class UIGetAward extends UIBase {
  6224. constructor() {
  6225. super();
  6226. this.showTriple = true;
  6227. }
  6228. onConstructor() {
  6229. this.ui = ui_UIGetAward.createInstance();
  6230. this.contentPane = this.ui;
  6231. this.isEject = false;
  6232. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6233. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6234. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6235. }
  6236. show(arr, showTriple, callback) {
  6237. super.show();
  6238. this.ui.t0.play();
  6239. this.ui.eftNode.visible = true;
  6240. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6241. this.ui.eftNode.visible = false;
  6242. }), 1, 0, 0, 0.9);
  6243. this.awardArr = arr;
  6244. this.showTriple = showTriple;
  6245. this.callback = callback;
  6246. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6247. this.ui.myList.numItems = arr.length;
  6248. xGame.soundMgr.playSound("getaward");
  6249. }
  6250. updateSelf(index, obj) {
  6251. let temp = this.awardArr[index];
  6252. let icon = this.getIcon(temp.type);
  6253. let str = icon;
  6254. if (temp.type > 2) {
  6255. str = "s" + icon;
  6256. }
  6257. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6258. obj.myIcon.rotation = 0;
  6259. obj.numTxt.text = temp.num + "";
  6260. obj.numTxt.visible = temp.type > 2 ? false : true;
  6261. obj.nameTxt.text = this.getNameStr(temp.type);
  6262. }
  6263. renderItem(index, obj) {
  6264. this.updateSelf(index, obj);
  6265. }
  6266. tripleGetAward() {
  6267. console.log('zh:qjff_AD_for_uigetAward');
  6268. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6269. }
  6270. else {
  6271. console.log('zh:AD 失败,直接发放奖励');
  6272. this.qjff_AD_for_uigetAward();
  6273. }
  6274. }
  6275. qjff_AD_for_uigetAward() {
  6276. this.getAward(3);
  6277. }
  6278. normalGetAward() {
  6279. if (PlatMgr.isMisVideo())
  6280. this.tripleGetAward();
  6281. else
  6282. this.getAward();
  6283. }
  6284. getAward(times = 1) {
  6285. this.hide();
  6286. for (let index = 0; index < this.awardArr.length; index++) {
  6287. this.awardArr[index].num *= times;
  6288. }
  6289. this.callback && this.callback(times != 1);
  6290. }
  6291. getIcon(type) {
  6292. switch (type) {
  6293. case Prop.diamond:
  6294. return "ty_zs";
  6295. case Prop.coin:
  6296. return "ty_jb";
  6297. case Prop.gan1:
  6298. return "qg1";
  6299. case Prop.gan2:
  6300. return "qg2";
  6301. case Prop.gan3:
  6302. return "qg3";
  6303. case Prop.gan4:
  6304. return "qg4";
  6305. default:
  6306. break;
  6307. }
  6308. }
  6309. getNameStr(type) {
  6310. switch (type) {
  6311. case Prop.diamond:
  6312. return "Diamond";
  6313. case Prop.coin:
  6314. return "Coins";
  6315. case Prop.gan1:
  6316. case Prop.gan2:
  6317. case Prop.gan3:
  6318. case Prop.gan4:
  6319. return cfgTable.ballrodData[type - 1].name;
  6320. default:
  6321. break;
  6322. }
  6323. }
  6324. }
  6325. UIGetAward.uiName = "UIGetAward";
  6326. class ui_UIRepentProp extends fgui.GComponent {
  6327. static createInstance() {
  6328. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6329. }
  6330. onConstruct() {
  6331. this.c1 = this.getController("c1");
  6332. this.n11 = (this.getChild("n11"));
  6333. this.regretNode = (this.getChild("regretNode"));
  6334. this.helpLineNode = (this.getChild("helpLineNode"));
  6335. this.t0 = this.getTransition("t0");
  6336. }
  6337. }
  6338. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6339. class UIRepentProp extends UIBase {
  6340. constructor() {
  6341. super();
  6342. this.viewType = 0;
  6343. this.regretType = 0;
  6344. }
  6345. onConstructor() {
  6346. this.ui = ui_UIRepentProp.createInstance();
  6347. this.contentPane = this.ui;
  6348. this.isEject = false;
  6349. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6350. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6351. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6352. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6353. }
  6354. show(viewType, regretType, callback) {
  6355. PlatMgr.showInsert(true);
  6356. this.viewType = viewType;
  6357. this.regretType = regretType;
  6358. this.callback = callback;
  6359. super.show();
  6360. this.ui.t0.play();
  6361. this.ui.c1.selectedIndex = this.viewType;
  6362. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6363. if (this.viewType == 0) {
  6364. let guide = DataMgr.getGuideHelpLine();
  6365. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6366. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6367. }
  6368. xGame.common.gameMgr.gamePause = true;
  6369. }
  6370. hideSelf() {
  6371. xGame.common.gameMgr.gamePause = false;
  6372. this.callback && this.callback(false);
  6373. this.hide();
  6374. }
  6375. videoRegret() {
  6376. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6377. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6378. }
  6379. else {
  6380. console.log('zh:AD 失败,直接发放奖励');
  6381. this.qjff_AD_for_UIrepentProp_videoRegret();
  6382. }
  6383. }
  6384. qjff_AD_for_UIrepentProp_videoRegret() {
  6385. this.callback && this.callback(true);
  6386. this.hideSelf();
  6387. }
  6388. videoAddHelpLine() {
  6389. let guide = DataMgr.getGuideHelpLine();
  6390. if (guide == 0) {
  6391. this.callback && this.callback(true);
  6392. this.hideSelf();
  6393. DataMgr.setGuideHelpLine();
  6394. xGame.common.gameUI.ui.guideNode.visible = false;
  6395. }
  6396. else {
  6397. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6398. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6399. }
  6400. else {
  6401. console.log('zh:AD 失败,直接发放奖励');
  6402. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6403. }
  6404. }
  6405. }
  6406. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6407. this.callback && this.callback(true);
  6408. this.hideSelf();
  6409. }
  6410. }
  6411. UIRepentProp.uiName = "UIRepentProp";
  6412. class UIMain extends UIBase {
  6413. constructor() {
  6414. super();
  6415. this.firstEnter = true;
  6416. }
  6417. nativeCallJs(msg) {
  6418. let t = msg;
  6419. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6420. switch (t) {
  6421. case 'qjff_chouJiang':
  6422. let dui = xGame.uiMgr.getUI(UIDraw);
  6423. dui.qjff_chouJiang();
  6424. break;
  6425. case 'qjff_AD_for_uisign':
  6426. let dui2 = xGame.uiMgr.getUI(UISign);
  6427. dui2.qjff_AD_for_uisign();
  6428. break;
  6429. case 'qjff_AD_for_uitry':
  6430. let dui3 = xGame.uiMgr.getUI(UITry);
  6431. dui3.qjff_AD_for_uitry();
  6432. break;
  6433. case 'qjff_AD_for_uipower':
  6434. let dui4 = xGame.uiMgr.getUI(UIPower);
  6435. dui4.qjff_AD_for_uipower();
  6436. break;
  6437. case 'qjff_AD_for_uigetAward':
  6438. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6439. dui5.qjff_AD_for_uigetAward();
  6440. break;
  6441. case 'qjff_AD_for_uiGameEnd':
  6442. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6443. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6444. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6445. break;
  6446. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6447. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6448. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6449. break;
  6450. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6451. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6452. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6453. break;
  6454. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6455. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6456. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6457. break;
  6458. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6459. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6460. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6461. break;
  6462. case 'qjff_AD_for_UIBOX_onOpenBox':
  6463. let dui11 = xGame.uiMgr.getUI(UIBox);
  6464. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6465. break;
  6466. case 'qjff_AD_for_UIAddCoin':
  6467. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6468. dui12.qjff_AD_for_UIAddCoin();
  6469. break;
  6470. case '111a':
  6471. let dui14 = xGame.uiMgr.getUI(UISign);
  6472. dui14.qjff_AD_for_uisign();
  6473. break;
  6474. case '222a':
  6475. let dui15 = xGame.uiMgr.getUI(UISign);
  6476. dui15.qjff_AD_for_uisign();
  6477. break;
  6478. case '333a':
  6479. let dui16 = xGame.uiMgr.getUI(UISign);
  6480. dui16.qjff_AD_for_uisign();
  6481. break;
  6482. default:
  6483. console.log('zh:未知的方法名字' + t);
  6484. break;
  6485. }
  6486. }
  6487. onConstructor() {
  6488. console.log('zh: UIMain onConstructor');
  6489. this.ui = ui_UIMain.createInstance();
  6490. this.contentPane = this.ui;
  6491. this.isEject = false;
  6492. this.addEvent();
  6493. this.addClickSpine();
  6494. this.settingNode = new SettingNode(this.ui.settingNode);
  6495. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6496. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6497. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6498. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6499. let curUse = DataMgr.getCurSecretary();
  6500. this.changeSecretary(curUse);
  6501. this.ui.rankBtn.visible = false;
  6502. this.ui.talkNode.visible = false;
  6503. let guide = DataMgr.getSkillGuide();
  6504. if (xGame.common.isNewDay && guide == 1) {
  6505. xGame.common.isNewDay = false;
  6506. xGame.soundMgr.playSound("s_main01");
  6507. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6508. console.log("zh:播放小秘书每天语音");
  6509. }
  6510. this.ui.n83.visible = false;
  6511. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6512. }
  6513. changeSecretary(curUse) {
  6514. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6515. xGame.common.secretary && xGame.common.secretary.dispose();
  6516. this.addSecretarySpine(name);
  6517. }
  6518. addSecretarySpine(name) {
  6519. let spine = new SpineMgr(name, () => {
  6520. this.playSecretaryIdle();
  6521. });
  6522. xGame.common.secretary = spine;
  6523. }
  6524. addClickSpine() {
  6525. let clickSpine = new SpineMgr("dianji", () => {
  6526. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6527. let parent = Laya.stage;
  6528. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6529. clickSpine.play(data, 0, false, parent, (spine) => {
  6530. spine.destroy(true);
  6531. });
  6532. });
  6533. });
  6534. }
  6535. addEvent() {
  6536. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6537. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6538. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6539. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6540. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6541. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6542. this.addUIClick(this.ui, this.interuptSecretary);
  6543. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6544. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6545. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6546. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6547. this.addUIClick(this.ui.signBtn, this.openSignView);
  6548. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6549. }
  6550. show(showFailWords) {
  6551. super.show();
  6552. this.moneyNode.ui.c1.selectedIndex = 1;
  6553. this.playSecretaryIdle();
  6554. xGame.soundMgr.playMusic("caromhall01", 0);
  6555. Laya.timer.clearAll(this);
  6556. this.playSecretaryRandomSound();
  6557. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  6558. if (showFailWords) {
  6559. console.log('zh:uimain.ts ');
  6560. setTimeout(() => {
  6561. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6562. let words = -1;
  6563. if (str == "s_main02") {
  6564. words = 2;
  6565. }
  6566. else {
  6567. words = 3;
  6568. }
  6569. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6570. xGame.soundMgr.playSound(str);
  6571. }, 300);
  6572. }
  6573. this.showGuide();
  6574. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6575. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6576. let guide = DataMgr.getSkillGuide();
  6577. if (guide == 1) {
  6578. let randTime = xGame.common.randomNum(300, 800);
  6579. if (this.firstEnter) {
  6580. console.log("zh: firstEnter");
  6581. this.firstEnter = false;
  6582. randTime += 900;
  6583. }
  6584. else {
  6585. console.log("zh: no firstEnter");
  6586. }
  6587. Laya.timer.once(randTime, this, () => {
  6588. xGame.common.autoPopUIView();
  6589. });
  6590. }
  6591. }
  6592. checkActive(show) {
  6593. }
  6594. showGuide() {
  6595. let guide = DataMgr.getSkillGuide();
  6596. this.ui.guideBtn.visible = guide == 0;
  6597. this.ui.enterGuide.visible = false;
  6598. this.ui.secretaryGuide.visible = guide == 0;
  6599. if (guide == 0) {
  6600. console.log("zh:显示引导");
  6601. xGame.soundMgr.playSound("s_guide");
  6602. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6603. }
  6604. else {
  6605. console.log("zh:不需要显示引导");
  6606. }
  6607. }
  6608. ensureSecretary() {
  6609. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6610. this.ui.secretaryGuide.visible = false;
  6611. this.ui.enterGuide.visible = true;
  6612. this.ui.wordsNode.t0.play();
  6613. if (DataMgr.getNewUser())
  6614. Moyu.sendDataEvent("gameReady");
  6615. }
  6616. playSecretaryIdle() {
  6617. let parent = this.ui.secretary.displayObject;
  6618. parent.destroyChildren();
  6619. let xx = this.ui.secretary.width / 2;
  6620. let yy = this.ui.secretary.height;
  6621. let scale = xGame.common.getSecretaryScale();
  6622. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6623. console.log("zh:playSecretaryIdle", data);
  6624. xGame.common.secretary.play(data, 0, true, parent);
  6625. }
  6626. startGame(type) {
  6627. xGame.common.gameMode = type;
  6628. Moyu.sendDataEvent("PlayGame", { type: type });
  6629. switch (xGame.common.gameMode) {
  6630. case GameMode.classic:
  6631. let challengeTimes = DataMgr.getChallengeTimes();
  6632. if (challengeTimes == 0) {
  6633. xGame.uiMgr.Show(UIInvitation);
  6634. }
  6635. else {
  6636. this.beginGame();
  6637. }
  6638. break;
  6639. case GameMode.bigMove:
  6640. this.beginGame();
  6641. if (DataMgr.getNewUser())
  6642. Moyu.sendDataEvent("gameStart0");
  6643. break;
  6644. default:
  6645. break;
  6646. }
  6647. }
  6648. beginGame(isNice = false) {
  6649. console.log('zh:beginGame ');
  6650. let guide = DataMgr.getSkillGuide();
  6651. if (guide == 1) {
  6652. console.log('zh:非新手引导,showInternAd ');
  6653. JSBridgeUtils.instance.showInternAd('beginGame');
  6654. }
  6655. else {
  6656. console.log('zh:新手引导,不显示AD ');
  6657. }
  6658. console.log('zh:beginGame 2 go');
  6659. if (xGame.common.gameMode == GameMode.classic) {
  6660. if (isNice) {
  6661. this.enterClassic();
  6662. }
  6663. else {
  6664. xGame.uiMgr.Show(UIModeSelection, () => {
  6665. this.enterClassic();
  6666. });
  6667. }
  6668. }
  6669. else if (xGame.common.gameMode == GameMode.bigMove) {
  6670. this.ui.enterGuide.visible = false;
  6671. xGame.uiMgr.Show(UISkill);
  6672. }
  6673. }
  6674. enterClassic() {
  6675. xGame.uiMgr.Show(UIGame);
  6676. xGame.uiMgr.Show(UIMatching, () => {
  6677. if (!this.isHide)
  6678. this.hide();
  6679. xGame.common.gameUI.ui.alpha = 1;
  6680. xGame.common.gameUI.startGame();
  6681. xGame.uiMgr.Hide(UIGameEnd);
  6682. });
  6683. }
  6684. startGlobal() {
  6685. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6686. }
  6687. startWeekly() {
  6688. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6689. }
  6690. zhouSaiMonth() {
  6691. console.log('zh: zhouSaiMonth 被调用');
  6692. }
  6693. startPlaceBall() {
  6694. xGame.uiMgr.Show(UILevelDisplay);
  6695. }
  6696. hide() {
  6697. console.log('zh:uimain hide ...');
  6698. super.hide();
  6699. xGame.common.stopGirlPop(this.ui.talkNode);
  6700. }
  6701. onGetUserInfo(force = false) {
  6702. if (Moyu.isWx) {
  6703. let info = Moyu.getSystemInfo();
  6704. if (info)
  6705. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6706. }
  6707. else {
  6708. Moyu.initUser(this, this.freshUser, force);
  6709. }
  6710. if (!Moyu.hasUserInfo) {
  6711. let user = Moyu.getUserInfo();
  6712. user.headIcon = 'res/ty_touxiang.png';
  6713. }
  6714. this.freshUser();
  6715. }
  6716. freshUser() {
  6717. let user = Moyu.getUserInfo();
  6718. if (!user.isAuth) {
  6719. user.headIcon = 'res/ty_touxiang.png';
  6720. }
  6721. else
  6722. DataMgr.upRankData();
  6723. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6724. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6725. }
  6726. interuptSecretary() {
  6727. Laya.timer.clearAll(this);
  6728. this.playSecretaryRandomSound();
  6729. }
  6730. playSecretaryRandomSound() {
  6731. if (this.isHide)
  6732. return;
  6733. let time = xGame.common.randomNum(45000, 60000);
  6734. Laya.timer.once(time, this, () => {
  6735. if (this.isHide)
  6736. return;
  6737. let index = xGame.common.randomNum(4, 7);
  6738. xGame.soundMgr.playSound("s_main0" + index);
  6739. let words = 1;
  6740. switch (index) {
  6741. case 4:
  6742. words = 5;
  6743. break;
  6744. case 5:
  6745. words = 3;
  6746. break;
  6747. case 6:
  6748. words = 6;
  6749. break;
  6750. case 7:
  6751. words = 7;
  6752. break;
  6753. default:
  6754. break;
  6755. }
  6756. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6757. this.playSecretaryRandomSound();
  6758. });
  6759. }
  6760. openSecretaryView() {
  6761. xGame.uiMgr.Show(UISecretary);
  6762. Moyu.sendDataEvent("secretary");
  6763. }
  6764. openShopView() {
  6765. xGame.uiMgr.Show(UIShop);
  6766. }
  6767. openSignView() {
  6768. xGame.uiMgr.Show(UISign);
  6769. }
  6770. openDrawView() {
  6771. xGame.uiMgr.Show(UIDraw);
  6772. }
  6773. openRanking() {
  6774. console.log('zh:phb openRanking');
  6775. xGame.uiMgr.Show(UIRanking);
  6776. Moyu.sendDataEvent("rankingList");
  6777. }
  6778. }
  6779. UIMain.uiName = "UIMain";
  6780. class UIGameEnd extends UIBase {
  6781. constructor() {
  6782. super();
  6783. this.success = false;
  6784. this.awardCoinNum = 1000;
  6785. this.awardDiamondNum = 10;
  6786. }
  6787. onConstructor() {
  6788. this.ui = ui_UIGameEnd.createInstance();
  6789. this.contentPane = this.ui;
  6790. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6791. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6792. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6793. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6794. this.ui.talkNode.visible = false;
  6795. if (Moyu.isKs)
  6796. this.ui.closeNode.closeBtn.x += 100;
  6797. }
  6798. updateType() {
  6799. switch (xGame.common.gameMode) {
  6800. case GameMode.classic:
  6801. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6802. this.ui.coinNode.visible = this.success;
  6803. if (!this.success) {
  6804. Laya.timer.once(500, this, () => {
  6805. xGame.uiMgr.Show(UIAddCoin);
  6806. });
  6807. }
  6808. this.ui.isGetAward.visible = false;
  6809. this.ui.leftBtn.c1.selectedIndex = 3;
  6810. this.ui.rightBtn.c1.selectedIndex = 0;
  6811. this.moneyNode.ui.c1.selectedIndex = 1;
  6812. break;
  6813. case GameMode.bigMove:
  6814. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6815. this.ui.coinNode.visible = this.success;
  6816. if (xGame.common.gameMode == GameMode.bigMove) {
  6817. if (this.success) {
  6818. DataMgr.setSkillSuccessTimes(1, true);
  6819. DataMgr.setSkillAccTimes(1);
  6820. }
  6821. else {
  6822. DataMgr.setSkillSuccessTimes(0, false);
  6823. }
  6824. }
  6825. if (!this.success) {
  6826. Laya.timer.once(500, this, () => {
  6827. xGame.uiMgr.Show(UIAddCoin);
  6828. });
  6829. }
  6830. this.ui.isGetAward.visible = false;
  6831. this.ui.leftBtn.c1.selectedIndex = 3;
  6832. this.ui.rightBtn.c1.selectedIndex = 0;
  6833. this.moneyNode.ui.c1.selectedIndex = 1;
  6834. break;
  6835. case GameMode.placeBall:
  6836. this.ui.coinNode.visible = false;
  6837. if (this.success) {
  6838. if (xGame.common.placeBallStarNum == 3) {
  6839. this.ui.c1.selectedIndex = 2;
  6840. }
  6841. else {
  6842. this.ui.c1.selectedIndex = 3;
  6843. }
  6844. }
  6845. else {
  6846. this.ui.c1.selectedIndex = 4;
  6847. }
  6848. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6849. if (cfg.type == PlaceBallType.challenge) {
  6850. this.ui.c1.selectedIndex = 2;
  6851. }
  6852. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6853. this.updatePlaceBallBtn();
  6854. this.updatePlaceBallStarNum();
  6855. this.updatePlaceBallAwardState();
  6856. this.moneyNode.ui.c1.selectedIndex = 2;
  6857. this.moneyNode.checkPowerTime();
  6858. this.moneyNode.powerChange();
  6859. DataMgr.upRankData();
  6860. break;
  6861. default:
  6862. break;
  6863. }
  6864. }
  6865. updatePlaceBallBtn() {
  6866. this.ui.leftBtn.c1.selectedIndex = 5;
  6867. if (this.success) {
  6868. this.ui.rightBtn.c1.selectedIndex = 14;
  6869. }
  6870. else {
  6871. if (xGame.common.placeBallStarNum == 3) {
  6872. this.ui.rightBtn.c1.selectedIndex = 14;
  6873. }
  6874. else {
  6875. this.ui.rightBtn.c1.selectedIndex = 1;
  6876. }
  6877. }
  6878. }
  6879. updatePlaceBallStarNum() {
  6880. let starNum = xGame.common.placeBallStarNum;
  6881. if (starNum == 0)
  6882. this.ui.starNumNode.c1.selectedIndex = 3;
  6883. else {
  6884. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6885. }
  6886. }
  6887. updatePlaceBallAwardState() {
  6888. let level = xGame.common.placeBallCurLevel;
  6889. let starNum = xGame.common.placeBallStarNum;
  6890. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6891. let data = cfgTable.placeballData[level].award;
  6892. let cfg = cfgTable.placeballData[level];
  6893. this.awardDiamondNum = data[1];
  6894. this.awardCoinNum = data[0];
  6895. if (cfg.type == PlaceBallType.challenge) {
  6896. this.awardDiamondNum = 0;
  6897. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6898. }
  6899. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6900. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6901. if (cfg.type == PlaceBallType.challenge) {
  6902. this.ui.awardNode.coinNode.visible = true;
  6903. }
  6904. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6905. this.ui.awardNode.diamondNode.x = 265;
  6906. this.ui.awardNode.coinNode.x = 354;
  6907. }
  6908. else {
  6909. this.ui.awardNode.diamondNode.x = 291;
  6910. this.ui.awardNode.coinNode.x = 291;
  6911. }
  6912. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6913. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6914. if (this.awardCoinNum == 0) {
  6915. this.ui.awardNode.coinNode.numTxt.text = "";
  6916. }
  6917. if (getAward) {
  6918. this.ui.isGetAward.visible = true;
  6919. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6920. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6921. }
  6922. else {
  6923. this.ui.isGetAward.visible = false;
  6924. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6925. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6926. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6927. }
  6928. else {
  6929. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6930. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6931. }
  6932. }
  6933. }
  6934. show(success) {
  6935. super.show();
  6936. xGame.eventMgr.event(RESET_GAME);
  6937. this.success = success;
  6938. Laya.timer.clearAll(this);
  6939. this.playSecretaryAni();
  6940. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6941. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6942. offsetTime = Math.floor(offsetTime / 1000);
  6943. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6944. this.updateType();
  6945. Laya.timer.once(200, this, () => {
  6946. this.addAward(() => {
  6947. this.updateType();
  6948. Laya.timer.once(500, this, () => {
  6949. this.showChallengeLevel();
  6950. });
  6951. });
  6952. });
  6953. if (this.success) {
  6954. JSBridgeUtils.instance.showInternAd('gameend_success');
  6955. console.log('zh:game end 成功');
  6956. xGame.soundMgr.playSound('slots_roll01');
  6957. xGame.soundMgr.playSound("s_win");
  6958. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6959. }
  6960. else {
  6961. JSBridgeUtils.instance.showInternAd('gameend_faill');
  6962. console.log('zh:game end失败');
  6963. xGame.soundMgr.playSound('matchwin01');
  6964. xGame.soundMgr.playSound("s_lose");
  6965. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6966. }
  6967. let challengeNum = DataMgr.getChallengeTimes();
  6968. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6969. DataMgr.setChallengeTimes(1);
  6970. }
  6971. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6972. DataMgr.setClassicTimes();
  6973. }
  6974. }
  6975. showChallengeLevel() {
  6976. if (DataMgr.getChallengeTimes() != 0)
  6977. return;
  6978. let skill = DataMgr.getSkillAccTimes();
  6979. let put = DataMgr.getPlaceBallLevelList().length;
  6980. if (skill >= 3 || put >= 5) {
  6981. xGame.uiMgr.Show(UIInvitation);
  6982. this.hide();
  6983. }
  6984. }
  6985. addAward(callback) {
  6986. if (!this.success) {
  6987. callback && callback();
  6988. return;
  6989. }
  6990. switch (xGame.common.gameMode) {
  6991. case GameMode.classic:
  6992. this.awardCoinNum = xGame.common.passAwardCoin;
  6993. this.awardDiamondNum = 0;
  6994. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6995. break;
  6996. case GameMode.bigMove:
  6997. this.awardCoinNum = xGame.common.passAwardCoin;
  6998. this.awardDiamondNum = 0;
  6999. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7000. callback && callback();
  7001. break;
  7002. case GameMode.placeBall:
  7003. let level = xGame.common.placeBallCurLevel;
  7004. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  7005. if (xGame.common.placeBallStarNum != 3) {
  7006. callback && callback();
  7007. return;
  7008. }
  7009. else {
  7010. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7011. if (getAward) {
  7012. callback && callback();
  7013. return;
  7014. }
  7015. }
  7016. let cfg = cfgTable.placeballData[level];
  7017. let data = cfgTable.placeballData[level].award;
  7018. this.awardCoinNum = data[0];
  7019. this.awardDiamondNum = data[1];
  7020. if (cfg.type == PlaceBallType.challenge) {
  7021. this.awardDiamondNum = 0;
  7022. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7023. }
  7024. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  7025. let diamondAward;
  7026. if (this.awardDiamondNum > 0) {
  7027. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  7028. xGame.common.getAward([diamondAward, coinAward], callback);
  7029. }
  7030. else {
  7031. xGame.common.getAward([coinAward], callback);
  7032. }
  7033. if (cfg.type == PlaceBallType.normal) {
  7034. DataMgr.setPlaceBallAward(level);
  7035. }
  7036. break;
  7037. default:
  7038. break;
  7039. }
  7040. }
  7041. playSecretaryAni_old() {
  7042. let parent = this.ui.secretary.displayObject;
  7043. parent.destroyChildren();
  7044. let xx = this.ui.secretary.width / 2;
  7045. let yy = this.ui.secretary.height;
  7046. let scale = xGame.common.getSecretaryScale();
  7047. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7048. if (this.success) {
  7049. let rand = Math.random() <= 0.5 ? 2 : 3;
  7050. xGame.common.secretary.play(data, rand, false, parent, () => {
  7051. xGame.common.secretary.play(data, 1, true, parent);
  7052. });
  7053. }
  7054. else {
  7055. xGame.common.secretary.play(data, 0, true, parent);
  7056. }
  7057. }
  7058. playSecretaryAni() {
  7059. let parent = this.ui.secretary.displayObject;
  7060. parent.destroyChildren();
  7061. let xx = this.ui.secretary.width / 2;
  7062. let yy = this.ui.secretary.height;
  7063. let scale = xGame.common.getSecretaryScale();
  7064. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7065. if (this.success) {
  7066. let rand = 0;
  7067. xGame.common.secretary.play(data, 0, true, parent);
  7068. }
  7069. else {
  7070. xGame.common.secretary.play(data, 0, true, parent);
  7071. }
  7072. }
  7073. restartGame() {
  7074. switch (xGame.common.gameMode) {
  7075. case GameMode.classic:
  7076. xGame.eventMgr.event(RESTART_GAME);
  7077. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7078. break;
  7079. case GameMode.bigMove:
  7080. this.hide();
  7081. xGame.eventMgr.event(RESTART_GAME);
  7082. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7083. break;
  7084. default:
  7085. break;
  7086. }
  7087. }
  7088. hide() {
  7089. super.hide();
  7090. xGame.common.stopGirlPop(this.ui.talkNode);
  7091. PlatMgr.showBanner(false);
  7092. }
  7093. returnHome() {
  7094. this.hide();
  7095. let showFailWords = !this.success;
  7096. xGame.uiMgr.Show(UIMain, showFailWords);
  7097. }
  7098. clickLeftBtn() {
  7099. switch (xGame.common.gameMode) {
  7100. case GameMode.classic:
  7101. case GameMode.bigMove:
  7102. this.returnHome();
  7103. break;
  7104. case GameMode.placeBall:
  7105. let level = xGame.common.placeBallCurLevel;
  7106. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7107. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7108. break;
  7109. default:
  7110. break;
  7111. }
  7112. }
  7113. powerStartPlaceBallLevel(level, btn) {
  7114. if (DataMgr.powerEnough()) {
  7115. btn.touchable = false;
  7116. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7117. btn.touchable = true;
  7118. DataMgr.setPower(-1);
  7119. xGame.eventMgr.event(POWER_TIME);
  7120. this.startPlaceBallLevel(level);
  7121. }));
  7122. }
  7123. else {
  7124. xGame.uiMgr.Show(UIPower, 0);
  7125. }
  7126. }
  7127. clickRightBtn() {
  7128. switch (xGame.common.gameMode) {
  7129. case GameMode.classic:
  7130. console.log('zh:clickRightBtn 111');
  7131. case GameMode.bigMove:
  7132. console.log('zh:clickRightBtn 222');
  7133. this.restartGame();
  7134. break;
  7135. case GameMode.placeBall:
  7136. console.log('zh:clickRightBtn 333');
  7137. let level = xGame.common.placeBallCurLevel;
  7138. let data = DataMgr.getPlaceBallLevel(level);
  7139. let curPss = data.play && !data.isCur;
  7140. if (curPss) {
  7141. console.log('zh:clickRightBtn 333-111');
  7142. console.log('zh:当前LV=' + level);
  7143. if (level == 60) {
  7144. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7145. Laya.timer.once(3000, this, () => {
  7146. this.returnHome();
  7147. });
  7148. }
  7149. else {
  7150. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  7151. }
  7152. }
  7153. else {
  7154. console.log('zh:clickRightBtn 333-000');
  7155. Moyu.sendDataEvent("placeBallNextLevel");
  7156. console.log('zh:qjff_AD_for_uiGameEnd');
  7157. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7158. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7159. }
  7160. else {
  7161. console.log('zh:AD 失败,直接发放奖励');
  7162. this.qjff_AD_for_uiGameEnd(level);
  7163. }
  7164. }
  7165. break;
  7166. default:
  7167. console.log('zh:clickRightBtn 444');
  7168. break;
  7169. }
  7170. }
  7171. qjff_AD_for_uiGameEnd(level) {
  7172. DataMgr.setPlaceBallLevel(level, 1);
  7173. this.startPlaceBallLevel(level + 1);
  7174. }
  7175. startPlaceBallLevel(level) {
  7176. xGame.common.gameMode = GameMode.placeBall;
  7177. xGame.common.placeBallCurLevel = level;
  7178. xGame.uiMgr.Show(UIGame);
  7179. this.hide();
  7180. }
  7181. }
  7182. UIGameEnd.uiName = "UIGameEnd";
  7183. class ui_UIVideoShare extends fgui.GComponent {
  7184. static createInstance() {
  7185. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7186. }
  7187. onConstruct() {
  7188. this.n10 = (this.getChild("n10"));
  7189. this.myNode = (this.getChild("myNode"));
  7190. this.t0 = this.getTransition("t0");
  7191. }
  7192. }
  7193. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7194. class UIVideoShare extends UIBase {
  7195. constructor() {
  7196. super();
  7197. this.success = false;
  7198. this.awardNum = 0;
  7199. this.isShared = true;
  7200. }
  7201. onConstructor() {
  7202. this.ui = ui_UIVideoShare.createInstance();
  7203. this.contentPane = this.ui;
  7204. this.isEject = false;
  7205. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7206. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7207. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7208. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7209. }
  7210. show(success) {
  7211. super.show();
  7212. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7213. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7214. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7215. this.success = success;
  7216. let time = xGame.common.randomNum(600, 1500);
  7217. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  7218. if (success)
  7219. xGame.soundMgr.playSound("applause");
  7220. this.ui.t0.play();
  7221. this.checkShareState();
  7222. let times = DataMgr.getDailyVideoShareTimes();
  7223. this.awardNum = times == 0 ? 2000 : 200;
  7224. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  7225. }
  7226. checkShareState() {
  7227. if (PlatMgr.forceShare == 0) {
  7228. this.ui.myNode.closeBtn.visible = true;
  7229. this.ui.myNode.tipsNode.visible = false;
  7230. this.ui.myNode.closeBtn.x = 90;
  7231. this.ui.myNode.shareBtn.x = 342;
  7232. }
  7233. else if (PlatMgr.forceShare == 1) {
  7234. this.ui.myNode.closeBtn.visible = false;
  7235. this.ui.myNode.tipsNode.visible = true;
  7236. this.ui.myNode.shareBtn.x = 218;
  7237. this.isShared = true;
  7238. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7239. }
  7240. }
  7241. checkForceShare() {
  7242. this.isShared = !this.isShared;
  7243. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7244. }
  7245. videoShare() {
  7246. if (PlatMgr.forceShare == 1) {
  7247. if (this.isShared) {
  7248. this.shareGame();
  7249. }
  7250. else {
  7251. this.hideSelf();
  7252. }
  7253. }
  7254. else {
  7255. this.shareGame();
  7256. }
  7257. }
  7258. shareGame() {
  7259. Moyu.sendDataEvent("VideoShare");
  7260. if (Moyu.canShare() > 100) {
  7261. Moyu.shareGame((success) => {
  7262. if (success) {
  7263. DataMgr.setDailyVideoShareTimes(1);
  7264. DataMgr.setCoin(this.awardNum);
  7265. }
  7266. this.hideSelf();
  7267. }, this);
  7268. }
  7269. else {
  7270. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  7271. this.hideSelf();
  7272. }
  7273. }
  7274. hideSelf() {
  7275. this.hide();
  7276. xGame.uiMgr.Show(UIGameEnd, this.success);
  7277. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  7278. xGame.common.screenImg.destroy();
  7279. xGame.common.screenImg = null;
  7280. }
  7281. }
  7282. }
  7283. UIVideoShare.uiName = "UIVideoShare";
  7284. class ui_UITips extends fgui.GComponent {
  7285. static createInstance() {
  7286. return (fgui.UIPackage.createObject("game", "UITips"));
  7287. }
  7288. onConstruct() {
  7289. this.n0 = (this.getChild("n0"));
  7290. this.myNode = (this.getChild("myNode"));
  7291. this.t0 = this.getTransition("t0");
  7292. }
  7293. }
  7294. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7295. class UITips extends UIBase {
  7296. constructor() {
  7297. super();
  7298. this.type = 0;
  7299. }
  7300. onConstructor() {
  7301. this.ui = ui_UITips.createInstance();
  7302. this.contentPane = this.ui;
  7303. this.isEject = false;
  7304. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7305. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7306. }
  7307. show(tipsTxt, womanTxt, type) {
  7308. super.show();
  7309. this.ui.t0.play();
  7310. this.ui.myNode.tipsTxt.text = tipsTxt;
  7311. this.ui.myNode.womanTxt.text = womanTxt;
  7312. PlatMgr.showInsert(true);
  7313. this.ui.myNode.c1.selectedIndex = type;
  7314. this.type = type;
  7315. switch (this.type) {
  7316. case TipsType.exitGame:
  7317. xGame.common.gameMgr.gamePause = true;
  7318. break;
  7319. case TipsType.foul:
  7320. Laya.timer.once(200, this, () => {
  7321. xGame.common.gameMgr.gamePause = true;
  7322. });
  7323. break;
  7324. default:
  7325. break;
  7326. }
  7327. }
  7328. clickLeftBtn() {
  7329. this.hide();
  7330. xGame.common.gameMgr.gamePause = false;
  7331. switch (this.type) {
  7332. case TipsType.exitGame:
  7333. break;
  7334. case TipsType.foul:
  7335. break;
  7336. default:
  7337. break;
  7338. }
  7339. }
  7340. clickRightBtn() {
  7341. this.hide();
  7342. switch (this.type) {
  7343. case TipsType.exitGame:
  7344. xGame.eventMgr.event(RESET_GAME);
  7345. xGame.uiMgr.Show(UIMain);
  7346. Moyu.recordEnd(this, null);
  7347. xGame.common.longHelpLine = false;
  7348. break;
  7349. case TipsType.foul:
  7350. xGame.common.gameMgr.gamePause = false;
  7351. Laya.timer.clearAll(this);
  7352. break;
  7353. default:
  7354. break;
  7355. }
  7356. }
  7357. }
  7358. UITips.uiName = "UITips";
  7359. class GameMgr {
  7360. constructor() {
  7361. this.selfCamp = "";
  7362. this.selfFoulNum = 0;
  7363. this.selfBallArr = [];
  7364. this.selfTimer = 0;
  7365. this.selfScore = 0;
  7366. this.aiCamp = "";
  7367. this.aiFoulNum = 0;
  7368. this.aiBallArr = [];
  7369. this.aiTimer = 0;
  7370. this.aiScore = 0;
  7371. this.aiSkillLevelNum = 1;
  7372. this.targertScore = 0;
  7373. this.setTime = 30;
  7374. this.selfTurnRate = 0.5;
  7375. this.accTime = 0;
  7376. this.curFoul = "";
  7377. this.maxFoulTimes = 3;
  7378. this.isFirstInGame = true;
  7379. this.firstColliObj = null;
  7380. this.inHoleBalls = [];
  7381. this.blackNum = 8;
  7382. this.success = false;
  7383. this.holePosList = [];
  7384. this.posObj = {};
  7385. this._selfTurn = false;
  7386. this.lastRootBallPos = new Laya.Vector2(311, 430);
  7387. this.ensureBallType = false;
  7388. this.isOpenBall = true;
  7389. this.finishOneShoot = true;
  7390. this.isEnd = false;
  7391. this.isChangeTurn = false;
  7392. this.isInterrupt = false;
  7393. this.aiPlayedBreakArmy = false;
  7394. this.isTouchedBall = false;
  7395. this.finishBalls = 0;
  7396. this.needBalls = 0;
  7397. this.allBallNum = 0;
  7398. this.placeBallPosData = {};
  7399. this.curHP = 0;
  7400. this.showLongView = false;
  7401. this.firstShoot = true;
  7402. this._gamePause = false;
  7403. this.trunCount = 0;
  7404. this.isBlackInHole = false;
  7405. this.isEnter = true;
  7406. xGame.eventMgr.offAll(ALL_BALL_STOP);
  7407. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  7408. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  7409. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  7410. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  7411. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  7412. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  7413. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  7414. }
  7415. get gamePause() {
  7416. return this._gamePause;
  7417. }
  7418. set gamePause(v) {
  7419. if (v) {
  7420. Laya.physicsTimer.pause();
  7421. }
  7422. else {
  7423. Laya.physicsTimer.resume();
  7424. }
  7425. this._gamePause = v;
  7426. }
  7427. get selfTurn() {
  7428. return this._selfTurn;
  7429. }
  7430. set selfTurn(val) {
  7431. this.trunCount++;
  7432. this._selfTurn = val;
  7433. if (val) {
  7434. xGame.common.d2World.d2Gan.ui.self.visible = true;
  7435. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7436. }
  7437. else {
  7438. xGame.common.d2World.d2Gan.ui.self.visible = false;
  7439. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  7440. if (this.trunCount > 1)
  7441. PlatMgr.openBox();
  7442. }
  7443. }
  7444. resetGame() {
  7445. this.inHoleBalls = [];
  7446. this.isFirstInGame = true;
  7447. this.firstColliObj = null;
  7448. this.aiCamp = "";
  7449. this.selfCamp = "";
  7450. this.aiFoulNum = 0;
  7451. this.selfFoulNum = 0;
  7452. this.selfBallArr = [];
  7453. this.aiBallArr = [];
  7454. this.gamePause = false;
  7455. this.ensureBallType = false;
  7456. this.isInterrupt = false;
  7457. this.updateLeftBall();
  7458. this.clearTime();
  7459. this.aiPlayedBreakArmy = false;
  7460. this.isBlackInHole = false;
  7461. this.placeBallPosData = {};
  7462. if (xGame.common.d3World.knifeRoot) {
  7463. xGame.common.d3World.knifeRoot.destroyChildren();
  7464. }
  7465. }
  7466. gameReady() {
  7467. this.trunCount = 0;
  7468. this.firstColliObj = null;
  7469. this.isFirstInGame = true;
  7470. this.selfTurn = Math.random() <= this.selfTurnRate;
  7471. let challengeNum = DataMgr.getChallengeTimes();
  7472. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7473. this.selfTurn = true;
  7474. }
  7475. if (xGame.common.gameMode == GameMode.placeBall)
  7476. this.selfTurn = true;
  7477. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7478. this.selfTurn = true;
  7479. }
  7480. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7481. this.checkGuide();
  7482. if (xGame.common.uiRodMethod)
  7483. xGame.common.uiRodMethod.resetRod();
  7484. xGame.common.d2World.getHelpLine();
  7485. this.isOpenBall = true;
  7486. this.isTouchedBall = false;
  7487. xGame.common.aiPlayer.stopRun();
  7488. this.setTime = 30;
  7489. let ui = xGame.common.gameUI.ui;
  7490. switch (xGame.common.gameMode) {
  7491. case GameMode.classic:
  7492. xGame.common.aiPlayer.init();
  7493. this.blackNum = 8;
  7494. this.placeRootBall();
  7495. this.peoplePlay(9, 10);
  7496. ui.wordsBtn.visible = true;
  7497. ui.aiWordsBtn.visible = true;
  7498. xGame.common.talkMgr.changeAIState(true);
  7499. DataMgr.gameData.gameCount++;
  7500. DataMgr.saveGameData();
  7501. break;
  7502. case GameMode.bigMove:
  7503. this.blackNum = -1;
  7504. this.selfScore = 0;
  7505. this.aiScore = 0;
  7506. xGame.common.aiPlayer.init();
  7507. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7508. this.updateSelfScore();
  7509. this.updateAIScore();
  7510. this.updateTargetSroce();
  7511. this.placeRootBall();
  7512. this.peoplePlay(9, 10);
  7513. ui.wordsBtn.visible = true;
  7514. ui.aiWordsBtn.visible = true;
  7515. xGame.common.talkMgr.changeAIState(true);
  7516. if (DataMgr.getSkillGuide() < 1)
  7517. DataMgr.gameData.gameCount = 0;
  7518. else {
  7519. DataMgr.gameData.gameCount++;
  7520. DataMgr.saveGameData();
  7521. PlatMgr.openTry();
  7522. }
  7523. if (xGame.common.d3World.knifeRoot) {
  7524. xGame.common.d3World.knifeRoot.destroyChildren();
  7525. }
  7526. break;
  7527. case GameMode.placeBall:
  7528. this.blackNum = -1;
  7529. this.selfTurn = true;
  7530. this.setTime = 10000;
  7531. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7532. this.curHP = this.placeBallData.hp;
  7533. if (this.placeBallData.ball == -1)
  7534. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7535. else
  7536. this.needBalls = this.placeBallData.ball;
  7537. console.log("需要的进球数目", this.needBalls);
  7538. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7539. this.finishBalls = 0;
  7540. this.placeBallPosData = {};
  7541. this.updatePlaceBallPos();
  7542. this.updatePlaceBallState();
  7543. this.finishOneShoot = true;
  7544. xGame.common.gameUI.ui.moveNode.visible = false;
  7545. this.isOpenBall = false;
  7546. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7547. ui.wordsBtn.visible = false;
  7548. ui.aiWordsBtn.visible = false;
  7549. xGame.common.talkMgr.changeAIState(false);
  7550. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7551. PlatMgr.openBox();
  7552. });
  7553. break;
  7554. default:
  7555. break;
  7556. }
  7557. this.showLongView = false;
  7558. xGame.common.wordsMgr.comboTimes = 1;
  7559. let guide = DataMgr.getSkillGuide();
  7560. if (guide)
  7561. xGame.eventMgr.event(WAIT_SHOOT);
  7562. xGame.common.upSkillLevel = false;
  7563. xGame.common.gameStartTime = new Date().getTime();
  7564. this.firstShoot = true;
  7565. }
  7566. checkGuide() {
  7567. let guide = DataMgr.getSkillGuide();
  7568. let gameUI = xGame.common.gameUI.ui;
  7569. gameUI.guide1.visible = false;
  7570. gameUI.guide2.visible = false;
  7571. gameUI.guide3.visible = false;
  7572. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7573. this.selfTurn = true;
  7574. }
  7575. else {
  7576. return;
  7577. }
  7578. let oneBall = this.getOneBall();
  7579. gameUI.guide1.visible = true;
  7580. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7581. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7582. }
  7583. getOneBall() {
  7584. let arr = xGame.common.d2World.ballArr;
  7585. for (let index = 0; index < arr.length; index++) {
  7586. if (arr[index].number == 0)
  7587. continue;
  7588. return arr[index];
  7589. }
  7590. }
  7591. updateSelfScore() {
  7592. let ui = xGame.common.gameUI.ui.topNode;
  7593. ui.selfScoreTxt.text = this.selfScore + "";
  7594. }
  7595. updateAIScore() {
  7596. let ui = xGame.common.gameUI.ui.topNode;
  7597. ui.aiScoreTxt.text = this.aiScore + "";
  7598. }
  7599. updateTargetSroce() {
  7600. let ui = xGame.common.gameUI.ui.topNode;
  7601. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7602. }
  7603. updateLeftBall() {
  7604. let topUI = xGame.common.gameUI.ui.topNode;
  7605. topUI.selfBallList.numItems = this.selfBallArr.length;
  7606. topUI.aiBallList.numItems = this.aiBallArr.length;
  7607. }
  7608. ballShoot() {
  7609. this.clearTime();
  7610. this.finishOneShoot = false;
  7611. xGame.common.gameUI.ui.moveNode.visible = false;
  7612. if (xGame.common.gameUI.ui.guideNode.visible) {
  7613. xGame.common.gameUI.ui.guideNode.visible = false;
  7614. }
  7615. if (this.firstShoot) {
  7616. this.firstShoot = false;
  7617. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7618. }
  7619. }
  7620. ensureCamp(number) {
  7621. this.ensureBallType = true;
  7622. this.isOpenBall = false;
  7623. if (xGame.common.gameMode != GameMode.classic)
  7624. return;
  7625. let full = [1, 2, 3, 4, 5, 6, 7];
  7626. let flower = [9, 10, 11, 12, 13, 14, 15];
  7627. let sayWords = "";
  7628. if (this.selfTurn) {
  7629. if (number <= 7) {
  7630. this.selfCamp = ballCamp.full;
  7631. this.selfBallArr = full;
  7632. this.aiCamp = ballCamp.flower;
  7633. this.aiBallArr = flower;
  7634. sayWords = cfgTable.wordsData[3].msg;
  7635. }
  7636. else {
  7637. this.selfCamp = ballCamp.flower;
  7638. this.selfBallArr = flower;
  7639. this.aiCamp = ballCamp.full;
  7640. this.aiBallArr = full;
  7641. sayWords = cfgTable.wordsData[4].msg;
  7642. }
  7643. }
  7644. else {
  7645. if (number <= 7) {
  7646. this.selfCamp = ballCamp.flower;
  7647. this.selfBallArr = flower;
  7648. this.aiCamp = ballCamp.full;
  7649. this.aiBallArr = full;
  7650. sayWords = cfgTable.wordsData[2].msg;
  7651. }
  7652. else {
  7653. this.selfCamp = ballCamp.full;
  7654. this.selfBallArr = full;
  7655. this.aiCamp = ballCamp.flower;
  7656. this.aiBallArr = flower;
  7657. sayWords = cfgTable.wordsData[1].msg;
  7658. }
  7659. }
  7660. this.updateLeftBall();
  7661. xGame.uiMgr.Show(UIMsg, sayWords);
  7662. }
  7663. updatePlaceBallState() {
  7664. let ui = xGame.common.gameUI.ui;
  7665. switch (this.placeBallData.type) {
  7666. case PlaceBallType.normal:
  7667. let normal = ui.placeNormalNode;
  7668. normal.hpTxt.text = this.curHP + "";
  7669. this.updatePlaceBallStar(normal);
  7670. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7671. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7672. break;
  7673. case PlaceBallType.challenge:
  7674. let challenge = ui.placeChallengeNode;
  7675. challenge.hpTxt.text = "Shots:" + this.curHP;
  7676. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7677. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7678. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7679. break;
  7680. default:
  7681. break;
  7682. }
  7683. }
  7684. playSubHpAni() {
  7685. let ui = xGame.common.gameUI.ui;
  7686. switch (this.placeBallData.type) {
  7687. case PlaceBallType.normal:
  7688. let normal = ui.placeNormalNode;
  7689. normal.hpTxt.visible = false;
  7690. normal.starAni.c1.selectedIndex = 1;
  7691. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7692. normal.hpTxt.visible = true;
  7693. normal.starAni.c1.selectedIndex = 0;
  7694. }));
  7695. break;
  7696. default:
  7697. break;
  7698. }
  7699. }
  7700. getEndStarNum() {
  7701. let num;
  7702. let level = xGame.common.placeBallCurLevel;
  7703. if (this.curHP == this.placeBallData.hp) {
  7704. num = 3;
  7705. }
  7706. else if (this.curHP <= 1) {
  7707. num = 1;
  7708. }
  7709. else {
  7710. num = 2;
  7711. }
  7712. if (!this.success) {
  7713. num = 0;
  7714. }
  7715. else {
  7716. DataMgr.setPlaceBallLevel(level, num);
  7717. }
  7718. let myType = cfgTable.placeballData[level].type;
  7719. if (this.success && myType == 1) {
  7720. num = 3;
  7721. }
  7722. xGame.common.placeBallStarNum = num;
  7723. }
  7724. updatePlaceBallStar(node) {
  7725. let star = 0;
  7726. if (this.curHP == this.placeBallData.hp) {
  7727. star = 3;
  7728. }
  7729. else if (this.curHP >= 2) {
  7730. star = 2;
  7731. }
  7732. else if (this.curHP == 1) {
  7733. star = 1;
  7734. }
  7735. else {
  7736. star = 0;
  7737. }
  7738. let temp;
  7739. for (let index = 1; index <= 3; index++) {
  7740. temp = node["star" + index];
  7741. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7742. }
  7743. node.myProgress.value = (star / 3) * 100;
  7744. }
  7745. openRegretView(isFoul, GoalNum, challenge = false) {
  7746. let regretType = -1;
  7747. if (isFoul) {
  7748. regretType = 1;
  7749. }
  7750. else {
  7751. if (GoalNum <= 0) {
  7752. regretType = 0;
  7753. }
  7754. }
  7755. if (challenge) {
  7756. regretType = 1;
  7757. }
  7758. if (regretType != -1) {
  7759. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7760. if (success) {
  7761. this.curHP++;
  7762. this.updatePlaceBallState();
  7763. this.setPlaceBallAllPos();
  7764. xGame.common.gameUI.ui.moveNode.visible = false;
  7765. }
  7766. else {
  7767. if (this.curHP <= 0) {
  7768. this.success = false;
  7769. this.gameEnd();
  7770. }
  7771. this.playSubHpAni();
  7772. }
  7773. this.updatePlaceBallState();
  7774. this.updatePlaceBallPos();
  7775. });
  7776. }
  7777. }
  7778. setPlaceBallAllPos() {
  7779. let allBall = xGame.common.d2World.ballArr;
  7780. let cfgArr = this.placeBallPosData;
  7781. let temp;
  7782. let obj;
  7783. for (let index = 0; index < allBall.length; index++) {
  7784. temp = allBall[index];
  7785. if (temp.destroyed)
  7786. continue;
  7787. obj = cfgArr[temp.myUNID];
  7788. if (obj && obj.src && !obj.src.destroyed) {
  7789. temp.gameObj.x = obj.posX;
  7790. temp.gameObj.y = obj.posY;
  7791. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7792. }
  7793. }
  7794. xGame.common.d2World.getHelpLine();
  7795. }
  7796. updatePlaceBallPos() {
  7797. let arr = xGame.common.d2World.ballArr;
  7798. let temp;
  7799. for (let index = 0; index < arr.length; index++) {
  7800. temp = arr[index];
  7801. if (!this.placeBallPosData[temp.myUNID]) {
  7802. this.placeBallPosData[temp.myUNID] = {
  7803. src: temp,
  7804. posX: temp.gameObj.x,
  7805. posY: temp.gameObj.y
  7806. };
  7807. }
  7808. else {
  7809. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7810. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7811. }
  7812. }
  7813. let check;
  7814. for (const key in this.placeBallPosData) {
  7815. check = this.placeBallPosData[key];
  7816. if (check.src.destroyed) {
  7817. delete this.placeBallPosData[key];
  7818. }
  7819. }
  7820. }
  7821. gameRun(type) {
  7822. if (this.gamePause)
  7823. return;
  7824. this.curFoul = this.getFoulType();
  7825. if (type) {
  7826. xGame.common.d2World.d2Gan.shoot();
  7827. xGame.common.gameUI.forceCancel();
  7828. this.curFoul = type;
  7829. }
  7830. this.isEnd = false;
  7831. this.isChangeTurn = true;
  7832. if (xGame.common.gameMode == GameMode.classic) {
  7833. this.judgeClassic(this.curFoul);
  7834. this.checkClassicWords(() => {
  7835. xGame.common.destroyClassicEmotion();
  7836. if (this.isEnd) {
  7837. if (this.isBlackInHole) {
  7838. xGame.common.gameUI.ui.blackAni.visible = true;
  7839. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7840. xGame.common.gameUI.ui.blackAni.visible = false;
  7841. this.gameEnd();
  7842. }));
  7843. }
  7844. else {
  7845. this.gameEnd();
  7846. }
  7847. }
  7848. else {
  7849. this.waitShoot();
  7850. xGame.eventMgr.event(WAIT_SHOOT);
  7851. }
  7852. });
  7853. }
  7854. else if (xGame.common.gameMode == GameMode.bigMove) {
  7855. xGame.common.aiPlayer.stopRun();
  7856. let scoreArr = this.getScore(this.curFoul);
  7857. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7858. this.isEnd = true;
  7859. }
  7860. this.checkBigSkillWords(() => {
  7861. if (this.isEnd) {
  7862. this.gameEnd();
  7863. }
  7864. else {
  7865. this.waitShoot();
  7866. xGame.eventMgr.event(WAIT_SHOOT);
  7867. }
  7868. });
  7869. }
  7870. else if (xGame.common.gameMode == GameMode.placeBall) {
  7871. xGame.common.destroyAwardSpine();
  7872. let isFoul = this.curFoul == FoulType.rootHole;
  7873. let GoalNum = this.inHoleBalls.length;
  7874. if (this.inHoleBalls.indexOf(0) > -1)
  7875. GoalNum -= 1;
  7876. if (isFoul) {
  7877. this.placeRootBall();
  7878. }
  7879. console.log("neeballs", this.needBalls);
  7880. console.log("当前完成的goalNum", GoalNum);
  7881. this.finishBalls += GoalNum;
  7882. console.log("当前完成的finishballs", this.finishBalls);
  7883. let need = this.needBalls;
  7884. if (this.placeBallData.type == PlaceBallType.challenge) {
  7885. need += 100;
  7886. }
  7887. if (this.finishBalls >= need) {
  7888. this.success = true;
  7889. this.gameEnd();
  7890. }
  7891. else {
  7892. switch (this.placeBallData.type) {
  7893. case PlaceBallType.normal:
  7894. if (!isFoul && GoalNum > 0) {
  7895. this.updatePlaceBallPos();
  7896. this.updatePlaceBallState();
  7897. }
  7898. else {
  7899. this.curHP--;
  7900. this.openRegretView(isFoul, GoalNum);
  7901. }
  7902. this.waitShoot();
  7903. xGame.eventMgr.event(WAIT_SHOOT);
  7904. break;
  7905. case PlaceBallType.challenge:
  7906. this.curHP--;
  7907. this.updatePlaceBallState();
  7908. if (isFoul) {
  7909. this.openRegretView(isFoul, GoalNum, true);
  7910. }
  7911. else {
  7912. this.updatePlaceBallPos();
  7913. if (this.curHP <= 0) {
  7914. this.success = true;
  7915. this.gameEnd();
  7916. }
  7917. }
  7918. this.waitShoot();
  7919. xGame.eventMgr.event(WAIT_SHOOT);
  7920. break;
  7921. default:
  7922. break;
  7923. }
  7924. }
  7925. }
  7926. }
  7927. checkClassicWords(callback) {
  7928. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7929. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7930. let type = this.getClassicWordsType();
  7931. if (condition && type != -1) {
  7932. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7933. xGame.soundMgr.playSound(str);
  7934. xGame.common.wordsMgr.playClassicWords(type, callback);
  7935. }
  7936. else {
  7937. Laya.timer.once(300, this, () => {
  7938. callback && callback();
  7939. });
  7940. }
  7941. }
  7942. getClassicWordsType() {
  7943. let d2world = xGame.common.d2World;
  7944. let type = -1;
  7945. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7946. type = ClassicWordsType.perfectShow;
  7947. return type;
  7948. }
  7949. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7950. type = ClassicWordsType.directShoot;
  7951. return type;
  7952. }
  7953. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7954. type = ClassicWordsType.anotherShoot;
  7955. return type;
  7956. }
  7957. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7958. type = ClassicWordsType.bigPower;
  7959. return type;
  7960. }
  7961. let minSpeed = 1;
  7962. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7963. type = ClassicWordsType.hardShoot;
  7964. return type;
  7965. }
  7966. if (this.inHoleBalls.length > 0) {
  7967. type = ClassicWordsType.directShoot;
  7968. return type;
  7969. }
  7970. return type;
  7971. }
  7972. checkBigSkillWords(callback) {
  7973. if (this.curFoul == FoulType.timeOut) {
  7974. callback && callback();
  7975. }
  7976. else {
  7977. let playSkill = false;
  7978. if (this.selfTurn) {
  7979. playSkill = true;
  7980. }
  7981. else {
  7982. if (!this.aiPlayedBreakArmy) {
  7983. this.aiPlayedBreakArmy = true;
  7984. playSkill = true;
  7985. }
  7986. if (this.aiCurSkill != SkillType.breakArmy) {
  7987. playSkill = true;
  7988. }
  7989. }
  7990. if (xGame.common.skillMgr.playedLastSkill) {
  7991. xGame.common.skillMgr.playedLastSkill = false;
  7992. playSkill = false;
  7993. }
  7994. if (playSkill) {
  7995. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7996. let selfExtra = 0;
  7997. let aiExtra = 0;
  7998. if (this.selfTurn)
  7999. selfExtra += extraScore;
  8000. else
  8001. aiExtra += extraScore;
  8002. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  8003. this.isEnd = true;
  8004. }
  8005. this.playBigSkillTimes(callback);
  8006. });
  8007. }
  8008. else {
  8009. this.playBigSkillTimes(callback);
  8010. }
  8011. }
  8012. }
  8013. playBigSkillTimes(callback) {
  8014. let length = this.inHoleBalls.length;
  8015. if (this.inHoleBalls.indexOf(0) > -1) {
  8016. length = this.inHoleBalls.length - 1;
  8017. }
  8018. if (length <= 0) {
  8019. callback && callback();
  8020. return;
  8021. }
  8022. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  8023. callback && callback();
  8024. });
  8025. }
  8026. playSkillTips() {
  8027. let levelNum = 0;
  8028. let curType;
  8029. if (this.selfTurn) {
  8030. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  8031. curType = this.selfCurSkill;
  8032. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8033. levelNum += 5;
  8034. }
  8035. }
  8036. else {
  8037. levelNum = this.aiSkillLevelNum;
  8038. curType = this.aiCurSkill;
  8039. }
  8040. let str = ``;
  8041. switch (curType) {
  8042. case SkillType.highSpace:
  8043. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8044. break;
  8045. case SkillType.breakArmy:
  8046. str = `You pocketed ${levelNum} extra balls`;
  8047. break;
  8048. case SkillType.ice:
  8049. str = `${levelNum * 2} extra balls were frozen`;
  8050. break;
  8051. case SkillType.fireworks:
  8052. str = `${levelNum} extra balls exploded `;
  8053. break;
  8054. case SkillType.GuanYu:
  8055. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8056. break;
  8057. default:
  8058. break;
  8059. }
  8060. xGame.uiMgr.Show(UIMsg, str);
  8061. }
  8062. getFoulType() {
  8063. let foulType = "";
  8064. if (this.firstColliObj == null) {
  8065. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8066. return FoulType.rootHole;
  8067. }
  8068. return FoulType.notTouch;
  8069. }
  8070. else {
  8071. if (this.selfTurn) {
  8072. if (this.selfBallArr.length > 0) {
  8073. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8074. foulType = FoulType.wrongTouch;
  8075. }
  8076. }
  8077. else {
  8078. if (this.ensureBallType) {
  8079. }
  8080. else {
  8081. if (this.firstColliObj == this.blackNum) {
  8082. foulType = FoulType.wrongTouch;
  8083. }
  8084. }
  8085. }
  8086. }
  8087. else {
  8088. if (this.aiBallArr.length > 0) {
  8089. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8090. foulType = FoulType.wrongTouch;
  8091. }
  8092. }
  8093. else {
  8094. if (this.ensureBallType) {
  8095. }
  8096. else {
  8097. if (this.firstColliObj == this.blackNum) {
  8098. foulType = FoulType.wrongTouch;
  8099. }
  8100. }
  8101. }
  8102. }
  8103. if (this.inHoleBalls.length <= 0) {
  8104. return foulType;
  8105. }
  8106. let temp;
  8107. if (this.inHoleBalls.indexOf(0) > -1) {
  8108. foulType = FoulType.rootHole;
  8109. }
  8110. else {
  8111. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8112. temp = this.inHoleBalls[index];
  8113. if (this.selfTurn) {
  8114. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8115. foulType = FoulType.wrongHole;
  8116. break;
  8117. }
  8118. }
  8119. else {
  8120. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8121. foulType = FoulType.wrongHole;
  8122. break;
  8123. }
  8124. }
  8125. }
  8126. }
  8127. let foo;
  8128. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8129. temp = this.inHoleBalls[index];
  8130. foo = this.selfBallArr.indexOf(temp);
  8131. if (foo > -1) {
  8132. this.selfBallArr.splice(foo, 1);
  8133. }
  8134. foo = this.aiBallArr.indexOf(temp);
  8135. if (foo > -1) {
  8136. this.aiBallArr.splice(foo, 1);
  8137. }
  8138. }
  8139. this.updateLeftBall();
  8140. }
  8141. return foulType;
  8142. }
  8143. judgeGameEndByBlack(arr) {
  8144. if (this.selfTurn) {
  8145. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8146. this.selfFoulNum = this.maxFoulTimes;
  8147. return true;
  8148. }
  8149. }
  8150. else {
  8151. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8152. this.aiFoulNum = this.maxFoulTimes;
  8153. return true;
  8154. }
  8155. }
  8156. }
  8157. judgeClassic(type) {
  8158. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8159. xGame.common.aiPlayer.stopRun();
  8160. if (this.judgeNormalSuccess()) {
  8161. this.isEnd = true;
  8162. return;
  8163. }
  8164. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8165. if (this.selfTurn) {
  8166. if (isFoul) {
  8167. this.selfFoulNum++;
  8168. }
  8169. if (this.selfFoulNum >= this.maxFoulTimes) {
  8170. this.success = false;
  8171. this.isEnd = true;
  8172. return;
  8173. }
  8174. }
  8175. else {
  8176. if (isFoul)
  8177. this.aiFoulNum++;
  8178. if (this.aiFoulNum >= this.maxFoulTimes) {
  8179. this.success = true;
  8180. this.isEnd = true;
  8181. return;
  8182. }
  8183. }
  8184. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8185. this.isChangeTurn = false;
  8186. }
  8187. else {
  8188. this.isInterrupt = true;
  8189. }
  8190. }
  8191. waitShoot() {
  8192. if (xGame.common.gameMode == GameMode.classic) {
  8193. switch (this.curFoul) {
  8194. case FoulType.timeOut:
  8195. case FoulType.rootHole:
  8196. this.selfTurn = !this.selfTurn;
  8197. this.peoplePlay(5, 6, true);
  8198. break;
  8199. case FoulType.notTouch:
  8200. this.selfTurn = !this.selfTurn;
  8201. this.peoplePlay(7, 7);
  8202. break;
  8203. case FoulType.wrongHole:
  8204. this.selfTurn = !this.selfTurn;
  8205. this.peoplePlay(11, 11);
  8206. break;
  8207. default:
  8208. if (this.inHoleBalls.length > 0) {
  8209. this.peoplePlay(0, 0, false, false);
  8210. }
  8211. else {
  8212. this.selfTurn = !this.selfTurn;
  8213. this.peoplePlay(7, 7);
  8214. }
  8215. break;
  8216. }
  8217. }
  8218. else if (xGame.common.gameMode == GameMode.bigMove) {
  8219. if (this.curFoul == FoulType.timeOut) {
  8220. this.selfTurn = !this.selfTurn;
  8221. this.peoplePlay(14, 15);
  8222. this.placeRootBall();
  8223. }
  8224. else {
  8225. this.selfTurn = !this.selfTurn;
  8226. if (this.curFoul == FoulType.rootHole) {
  8227. this.peoplePlay(12, 13);
  8228. this.placeRootBall();
  8229. }
  8230. else {
  8231. this.peoplePlay(0, 0, false, false);
  8232. }
  8233. }
  8234. }
  8235. else if (xGame.common.gameMode == GameMode.placeBall) {
  8236. this.finishOneShoot = true;
  8237. }
  8238. this.gameResult();
  8239. }
  8240. gameResult() {
  8241. this.firstColliObj = null;
  8242. this.inHoleBalls = [];
  8243. let curX = xGame.common.d2World.rootBall.gameObj.x;
  8244. let curY = xGame.common.d2World.rootBall.gameObj.y;
  8245. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  8246. if (xGame.common.uiRodMethod)
  8247. xGame.common.uiRodMethod.resetRod();
  8248. xGame.common.d2World.rootBall.showSelf();
  8249. this.clearIceSkill();
  8250. if (this.selfTurn) {
  8251. console.log("zh:处理一杆结束后的逻辑 gameResult");
  8252. PlatMgr.gameInsert();
  8253. }
  8254. xGame.common.d3World.knifeRoot.destroyChildren();
  8255. if (this.selfTurn) {
  8256. xGame.common.gameUI.showHelpLineGuide();
  8257. xGame.common.gameUI.setTurnAlpha(true);
  8258. }
  8259. else {
  8260. xGame.common.gameUI.setTurnAlpha(false);
  8261. }
  8262. }
  8263. getScore(type) {
  8264. let selfAdd = 0;
  8265. let aiAdd = 0;
  8266. if (type == FoulType.timeOut) {
  8267. if (this.selfTurn)
  8268. aiAdd += 3;
  8269. else
  8270. selfAdd += 3;
  8271. }
  8272. else {
  8273. if (this.inHoleBalls.length > 0) {
  8274. if (this.selfTurn) {
  8275. if (type == FoulType.rootHole) {
  8276. aiAdd += 3;
  8277. if (this.inHoleBalls.length - 1 > 0) {
  8278. selfAdd += this.inHoleBalls.length - 1;
  8279. }
  8280. }
  8281. else {
  8282. selfAdd += this.inHoleBalls.length;
  8283. }
  8284. }
  8285. else {
  8286. if (type == FoulType.rootHole) {
  8287. selfAdd += 3;
  8288. if (this.inHoleBalls.length - 1 > 0) {
  8289. aiAdd += this.inHoleBalls.length - 1;
  8290. }
  8291. }
  8292. else {
  8293. aiAdd += this.inHoleBalls.length;
  8294. }
  8295. }
  8296. }
  8297. }
  8298. return [selfAdd, aiAdd];
  8299. }
  8300. judgeScoreEnd(selfAdd, aiAdd) {
  8301. this.selfScore += selfAdd;
  8302. this.aiScore += aiAdd;
  8303. this.updateAIScore();
  8304. this.updateSelfScore();
  8305. if (this.selfScore >= this.targertScore) {
  8306. this.success = true;
  8307. return true;
  8308. }
  8309. if (this.aiScore >= this.targertScore) {
  8310. this.success = false;
  8311. return true;
  8312. }
  8313. let ballArr = xGame.common.d2World.ballArr;
  8314. if (ballArr.length == 1 && ballArr[0].number == 0) {
  8315. if (this.selfScore > this.aiScore) {
  8316. this.success = true;
  8317. return true;
  8318. }
  8319. else if (this.selfScore < this.aiScore) {
  8320. this.success = false;
  8321. return true;
  8322. }
  8323. else {
  8324. if (this.selfTurn) {
  8325. this.success = false;
  8326. }
  8327. else {
  8328. this.success = true;
  8329. }
  8330. return true;
  8331. }
  8332. }
  8333. }
  8334. clearIceSkill() {
  8335. let arr = xGame.common.d2World.ballArr;
  8336. let temp;
  8337. if (this.selfTurn) {
  8338. if (this.selfCurSkill == SkillType.ice) {
  8339. for (let index = 0; index < arr.length; index++) {
  8340. temp = arr[index];
  8341. if (temp.ballFunc == "ice") {
  8342. temp.setBallFunc("normal", "self");
  8343. }
  8344. }
  8345. }
  8346. }
  8347. else {
  8348. if (this.aiCurSkill == SkillType.ice) {
  8349. for (let index = 0; index < arr.length; index++) {
  8350. temp = arr[index];
  8351. if (temp.ballFunc == "ice") {
  8352. temp.setBallFunc("normal", "ai");
  8353. }
  8354. }
  8355. }
  8356. }
  8357. }
  8358. judgeNormalSuccess() {
  8359. if (this.selfTurn) {
  8360. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8361. this.success = true;
  8362. return true;
  8363. }
  8364. }
  8365. else {
  8366. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8367. this.success = false;
  8368. return true;
  8369. }
  8370. }
  8371. }
  8372. gameEnd() {
  8373. if (Moyu.isTT) {
  8374. xGame.common.screenImg = getScreenImg();
  8375. }
  8376. console.log("游戏结束", this.success);
  8377. xGame.common.aiPlayer.stopRun();
  8378. if (xGame.common.gameMode == GameMode.placeBall) {
  8379. this.getEndStarNum();
  8380. this.updatePlaceBallState();
  8381. }
  8382. this.isEnter = false;
  8383. Moyu.recordEnd(this, () => {
  8384. if (this.isEnter)
  8385. return;
  8386. this.isEnter = true;
  8387. console.log("进入录结束回调");
  8388. this.enterNext();
  8389. });
  8390. Laya.timer.once(1000, this, () => {
  8391. if (this.isEnter)
  8392. return;
  8393. this.isEnter = true;
  8394. this.enterNext();
  8395. });
  8396. xGame.common.longHelpLine = false;
  8397. }
  8398. enterNext() {
  8399. Laya.timer.clearAll(this);
  8400. if (Moyu.canShare() > 100 || Moyu.isKs) {
  8401. xGame.uiMgr.Show(UIVideoShare, this.success);
  8402. }
  8403. else {
  8404. xGame.uiMgr.Show(UIGameEnd, this.success);
  8405. }
  8406. }
  8407. aiLeave() {
  8408. let ui = xGame.common.gameUI.ui;
  8409. ui.topNode.aiNameTxt.text = "offline";
  8410. }
  8411. aiGameEnd(suc) {
  8412. this.success = suc;
  8413. xGame.common.aiPlayer.stopRun();
  8414. if (this.success) {
  8415. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  8416. Laya.timer.once(1000, this, () => {
  8417. this.clearTime();
  8418. this.gameEnd();
  8419. });
  8420. }
  8421. }
  8422. openTimer() {
  8423. let src = xGame.common.gameUI;
  8424. if (this.selfTurn) {
  8425. src.ui.topNode.selfProgress.visible = true;
  8426. src.ui.topNode.aiProgress.visible = false;
  8427. this.curTimer = src.ui.topNode.selfProgress;
  8428. }
  8429. else {
  8430. src.ui.topNode.selfProgress.visible = false;
  8431. src.ui.topNode.aiProgress.visible = true;
  8432. this.curTimer = src.ui.topNode.aiProgress;
  8433. }
  8434. this.accTime = 0;
  8435. Laya.timer.clearAll(this);
  8436. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  8437. this.curTimer.value = 100;
  8438. }
  8439. updateTime(dt) {
  8440. if (this.gamePause)
  8441. return;
  8442. this.accTime += dt;
  8443. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8444. if (this.accTime >= this.setTime) {
  8445. this.clearTime();
  8446. console.log("时钟进入了gameRun");
  8447. this.gameRun(FoulType.timeOut);
  8448. }
  8449. }
  8450. clearTime() {
  8451. let src = xGame.common.gameUI;
  8452. src.ui.topNode.selfProgress.visible = false;
  8453. src.ui.topNode.aiProgress.visible = false;
  8454. Laya.timer.clearAll(this);
  8455. }
  8456. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8457. let ui = xGame.common.gameUI.ui;
  8458. let selfMsg, aiMsg;
  8459. if (sayWords) {
  8460. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8461. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8462. if (Foul) {
  8463. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8464. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8465. this.placeRootBall();
  8466. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8467. if (this.curFoul == FoulType.rootHole) {
  8468. if (!DataMgr.getRootBallFoul()) {
  8469. DataMgr.setRootBallFoul();
  8470. aiMsg = "";
  8471. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8472. let woman = "Boss, pay attention next time~";
  8473. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8474. }
  8475. }
  8476. else if (this.curFoul == FoulType.timeOut) {
  8477. if (!DataMgr.getTimeoutFoul()) {
  8478. DataMgr.setTimeoutFoul();
  8479. aiMsg = "";
  8480. let tips = "Game timeout, 3 fouls, this game failed.";
  8481. let woman = "Boss, pay attention to the timeline~";
  8482. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8483. }
  8484. }
  8485. }
  8486. }
  8487. }
  8488. if (this.selfTurn) {
  8489. if (sayWords) {
  8490. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8491. ui.selfTurn.visible = true;
  8492. ui.aiTurn.visible = false;
  8493. ui.selfTurn.t0.play();
  8494. Moyu.vibration();
  8495. });
  8496. }
  8497. }
  8498. else {
  8499. let aiNum = xGame.tools.random(1, 11);
  8500. let challengeNum = DataMgr.getChallengeTimes();
  8501. let delay = false;
  8502. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8503. aiNum = 9;
  8504. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8505. aiNum = 3;
  8506. if (challengeNum == 3) {
  8507. if (!this.showLongView) {
  8508. this.showLongView = true;
  8509. delay = true;
  8510. }
  8511. }
  8512. }
  8513. }
  8514. if (delay) {
  8515. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8516. if (success) {
  8517. xGame.common.longHelpLine = true;
  8518. xGame.common.d2World.getHelpLine();
  8519. }
  8520. else {
  8521. aiNum = 10;
  8522. }
  8523. xGame.common.aiPlayer.setAiLevel(aiNum);
  8524. if (sayWords) {
  8525. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8526. xGame.common.aiPlayer.runAI();
  8527. ui.selfTurn.visible = false;
  8528. ui.aiTurn.visible = true;
  8529. ui.aiTurn.t0.play();
  8530. });
  8531. }
  8532. else {
  8533. xGame.common.aiPlayer.runAI();
  8534. }
  8535. this.openTimer();
  8536. this.finishOneShoot = true;
  8537. if (this.selfTurn) {
  8538. ui.topNode.selfKuang.visible = true;
  8539. ui.topNode.aiKuang.visible = false;
  8540. ui.topNode.selfTips.visible = true;
  8541. ui.topNode.aiTips.visible = false;
  8542. }
  8543. else {
  8544. ui.topNode.selfKuang.visible = false;
  8545. ui.topNode.aiKuang.visible = true;
  8546. ui.topNode.selfTips.visible = false;
  8547. ui.topNode.aiTips.visible = true;
  8548. }
  8549. });
  8550. return;
  8551. }
  8552. if (xGame.common.gameMode == GameMode.classic) {
  8553. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8554. if (cfg) {
  8555. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8556. aiNum = aiLevel;
  8557. }
  8558. }
  8559. xGame.common.aiPlayer.setAiLevel(aiNum);
  8560. if (sayWords) {
  8561. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8562. xGame.common.aiPlayer.runAI();
  8563. ui.selfTurn.visible = false;
  8564. ui.aiTurn.visible = true;
  8565. ui.aiTurn.t0.play();
  8566. });
  8567. }
  8568. else {
  8569. xGame.common.aiPlayer.runAI();
  8570. }
  8571. }
  8572. this.openTimer();
  8573. this.finishOneShoot = true;
  8574. if (this.selfTurn) {
  8575. ui.topNode.selfKuang.visible = true;
  8576. ui.topNode.aiKuang.visible = false;
  8577. ui.topNode.selfTips.visible = true;
  8578. ui.topNode.aiTips.visible = false;
  8579. }
  8580. else {
  8581. ui.topNode.selfKuang.visible = false;
  8582. ui.topNode.aiKuang.visible = true;
  8583. ui.topNode.selfTips.visible = false;
  8584. ui.topNode.aiTips.visible = true;
  8585. }
  8586. }
  8587. placeRootBall() {
  8588. let rootBall = xGame.common.d2World.rootBall;
  8589. if (!rootBall)
  8590. return;
  8591. rootBall.gameObj.x = this.lastRootBallPos.x;
  8592. rootBall.gameObj.y = this.lastRootBallPos.y;
  8593. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8594. let moveNode = xGame.common.gameUI.ui.moveNode;
  8595. moveNode.visible = true;
  8596. moveNode.x = this.lastRootBallPos.x;
  8597. moveNode.y = this.lastRootBallPos.y;
  8598. if (!this.selfTurn) {
  8599. xGame.common.aiPlayer.resetRoot();
  8600. }
  8601. }
  8602. }
  8603. class ui_guanyuAni extends fgui.GComponent {
  8604. static createInstance() {
  8605. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8606. }
  8607. onConstruct() {
  8608. this.n0 = (this.getChild("n0"));
  8609. }
  8610. }
  8611. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8612. class UIFireworks extends UIBase {
  8613. constructor() {
  8614. super();
  8615. }
  8616. onConstructor() {
  8617. this.isEject = false;
  8618. }
  8619. show(callback) {
  8620. super.show();
  8621. }
  8622. }
  8623. UIFireworks.uiName = "UIFireworks";
  8624. class ui_UIGuanYu extends fgui.GComponent {
  8625. static createInstance() {
  8626. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8627. }
  8628. onConstruct() {
  8629. this.n2 = (this.getChild("n2"));
  8630. this.n1 = (this.getChild("n1"));
  8631. this.n3 = (this.getChild("n3"));
  8632. this.n4 = (this.getChild("n4"));
  8633. this.n5 = (this.getChild("n5"));
  8634. this.n6 = (this.getChild("n6"));
  8635. this.n8 = (this.getChild("n8"));
  8636. this.n7 = (this.getChild("n7"));
  8637. this.t0 = this.getTransition("t0");
  8638. }
  8639. }
  8640. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8641. class UIGuanYu extends UIBase {
  8642. constructor() {
  8643. super();
  8644. }
  8645. onConstructor() {
  8646. this.ui = ui_UIGuanYu.createInstance();
  8647. this.contentPane = this.ui;
  8648. this.isEject = false;
  8649. }
  8650. show(callback) {
  8651. super.show();
  8652. this.ui.t0.play(Laya.Handler.create(this, () => {
  8653. callback && callback();
  8654. this.hide();
  8655. }));
  8656. }
  8657. }
  8658. UIGuanYu.uiName = "UIGuanYu";
  8659. class SkillMgr {
  8660. constructor() {
  8661. this.leveNum = 0;
  8662. this.extraScore = 0;
  8663. this.selfTurn = false;
  8664. this.playedLastSkill = false;
  8665. this.tweenArr = [];
  8666. this._finishNum = 0;
  8667. this._curFinish = 0;
  8668. this._rootX = 0;
  8669. this._rootY = 0;
  8670. this.knifeTimes = 0;
  8671. this.knifeV2 = new Laya.Vector2();
  8672. this.knifeV3 = new Laya.Vector3();
  8673. this.rtStarX = 0;
  8674. this.rtStarY = 0;
  8675. this.addBigSkillSpine();
  8676. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8677. }
  8678. addBigSkillSpine() {
  8679. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8680. console.log("extra2 success");
  8681. });
  8682. }
  8683. runBigSkill(callback) {
  8684. this.tweenArr = [];
  8685. this.callback = callback;
  8686. this.judgeSkill();
  8687. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8688. let guide = DataMgr.getSkillGuide();
  8689. if (!xGame.common.gameMgr.selfTurn) {
  8690. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8691. }
  8692. else {
  8693. if (xGame.common.temSelfLevel != 0) {
  8694. this.leveNum = xGame.common.temSelfLevel;
  8695. }
  8696. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8697. this.leveNum += 5;
  8698. }
  8699. }
  8700. if (guide == 0) {
  8701. DataMgr.setSkillGuide(1);
  8702. if (DataMgr.getNewUser()) {
  8703. Moyu.sendDataEvent("gameFirstPlay");
  8704. DataMgr.setNewUser();
  8705. }
  8706. }
  8707. this.playSpineAni(() => {
  8708. switch (this.curSkill) {
  8709. case SkillType.highSpace:
  8710. this.runHighSpace();
  8711. break;
  8712. case SkillType.breakArmy:
  8713. this.runBreakArmy();
  8714. break;
  8715. case SkillType.ice:
  8716. this.runIce();
  8717. break;
  8718. case SkillType.fireworks:
  8719. this.runFireworks();
  8720. break;
  8721. case SkillType.GuanYu:
  8722. this.runGuanYu();
  8723. break;
  8724. default:
  8725. break;
  8726. }
  8727. });
  8728. }
  8729. judgeSkill() {
  8730. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8731. let gameMgr = xGame.common.gameMgr;
  8732. let type;
  8733. for (let index = 0; index < typeArr.length; index++) {
  8734. type = typeArr[index];
  8735. if (gameMgr.selfTurn) {
  8736. if (gameMgr.selfCurSkill == type) {
  8737. this.selfTurn = true;
  8738. this.curSkill = type;
  8739. return;
  8740. }
  8741. }
  8742. else {
  8743. if (gameMgr.aiCurSkill == type) {
  8744. this.selfTurn = false;
  8745. this.curSkill = type;
  8746. return;
  8747. }
  8748. }
  8749. }
  8750. }
  8751. playSpineAni(callback) {
  8752. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8753. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8754. parent.destroyChildren();
  8755. let aniIndex = 0;
  8756. let skillSpine;
  8757. switch (this.curSkill) {
  8758. case SkillType.highSpace:
  8759. aniIndex = 1;
  8760. xGame.soundMgr.playSound("skill01");
  8761. skillSpine = this.skillSpine2;
  8762. data.scaleX = 0.5;
  8763. data.scaleY = 0.5;
  8764. skillSpine.play(data, 1, false, parent, () => {
  8765. callback && callback();
  8766. });
  8767. break;
  8768. case SkillType.breakArmy:
  8769. aniIndex = 2;
  8770. xGame.soundMgr.playSound("skill02");
  8771. skillSpine = this.skillSpine2;
  8772. data.scaleX = 0.5;
  8773. data.scaleY = 0.5;
  8774. skillSpine.play(data, 2, false, parent, () => {
  8775. callback && callback();
  8776. });
  8777. break;
  8778. case SkillType.ice:
  8779. aniIndex = 0;
  8780. xGame.soundMgr.playSound("skill03");
  8781. skillSpine = this.skillSpine2;
  8782. data.scaleX = 0.5;
  8783. data.scaleY = 0.5;
  8784. skillSpine.play(data, 0, false, parent, () => {
  8785. callback && callback();
  8786. });
  8787. break;
  8788. case SkillType.fireworks:
  8789. xGame.soundMgr.playSound("skill_04_01");
  8790. xGame.soundMgr.playSound("skill04");
  8791. xGame.uiMgr.Show(UIFireworks, callback);
  8792. break;
  8793. case SkillType.GuanYu:
  8794. xGame.soundMgr.playSound("skill05_1");
  8795. xGame.soundMgr.playSound("skill05");
  8796. xGame.uiMgr.Show(UIGuanYu, callback);
  8797. break;
  8798. default:
  8799. break;
  8800. }
  8801. }
  8802. getAllBallArr() {
  8803. let arr = xGame.common.d2World.ballArr;
  8804. let outArr = [];
  8805. for (let index = 0; index < arr.length; index++) {
  8806. if (arr[index] instanceof D2RootBallSrc)
  8807. continue;
  8808. if (arr[index].ballFunc == "ice")
  8809. continue;
  8810. if (arr[index].destroyed)
  8811. continue;
  8812. outArr.push(arr[index]);
  8813. }
  8814. return outArr;
  8815. }
  8816. getOneArr(deletObj) {
  8817. let allArr = this.getAllBallArr();
  8818. let temp;
  8819. for (let index = 0; index < allArr.length; index++) {
  8820. temp = allArr[index];
  8821. if (temp.id == deletObj.id) {
  8822. allArr.splice(index, 1);
  8823. break;
  8824. }
  8825. }
  8826. return allArr;
  8827. }
  8828. getNearBallBag(ball) {
  8829. let ui = xGame.common.gameUI.ui;
  8830. let circleArr = [];
  8831. for (let index = 1; index <= 6; index++) {
  8832. circleArr.push(ui.border["circle" + index]);
  8833. }
  8834. let outIndex = 0;
  8835. let temp;
  8836. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8837. ;
  8838. let dis = 0;
  8839. for (let index = 1; index < circleArr.length; index++) {
  8840. temp = circleArr[index];
  8841. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8842. if (dis < min) {
  8843. min = dis;
  8844. outIndex = index;
  8845. }
  8846. }
  8847. return [circleArr[outIndex], outIndex];
  8848. }
  8849. ballFlyToBag(ballArr, time = 300) {
  8850. let temp;
  8851. let hole;
  8852. this._finishNum = ballArr.length;
  8853. this._curFinish = 0;
  8854. let holeObj = {};
  8855. let holeCfg = {
  8856. "1": 0,
  8857. "2": 0,
  8858. "3": 0,
  8859. "4": 0,
  8860. "5": 0,
  8861. "6": 0
  8862. };
  8863. for (let index = 0; index < ballArr.length; index++) {
  8864. temp = ballArr[index];
  8865. temp.outColli.isSensor = true;
  8866. temp.innerColli.isSensor = true;
  8867. temp.isRunSkillAni = true;
  8868. let holeArr = this.getNearBallBag(temp);
  8869. hole = holeArr[0];
  8870. holeObj[index] = holeArr[1];
  8871. temp.d3BallSrc.scaleXYZ = 0.5;
  8872. this.tweenArr.push(temp.d3BallSrc, temp);
  8873. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8874. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8875. }));
  8876. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8877. let mIndex = holeObj[this._curFinish];
  8878. let isDone = holeCfg[mIndex];
  8879. if (isDone) {
  8880. ballArr[this._curFinish].checkWrongBall(false);
  8881. }
  8882. else {
  8883. holeCfg[mIndex] = 1;
  8884. ballArr[this._curFinish].checkWrongBall();
  8885. }
  8886. this._curFinish++;
  8887. if (this._curFinish >= this._finishNum) {
  8888. if (this.curSkill == SkillType.highSpace) {
  8889. }
  8890. else if (this.curSkill == SkillType.breakArmy) {
  8891. let rootBall = xGame.common.d2World.rootBall;
  8892. rootBall.gameObj.x = this._rootX;
  8893. rootBall.gameObj.y = this._rootY;
  8894. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8895. xGame.common.d2World.d2Gan.ui.visible = true;
  8896. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8897. xGame.common.d2World.getHelpLine();
  8898. this.callback && this.callback(this.extraScore);
  8899. }
  8900. }
  8901. }));
  8902. }
  8903. }
  8904. runHighSpace() {
  8905. let rootBall = xGame.common.d2World.rootBall;
  8906. rootBall.showSelf();
  8907. let d3Src = rootBall.d3BallSrc;
  8908. let allArr = this.getAllBallArr();
  8909. if (allArr.length <= 0) {
  8910. this.callback && this.callback(0);
  8911. return;
  8912. }
  8913. let selectBall = xGame.common.d2World.targetBall;
  8914. let wrong = selectBall && selectBall.destroyed;
  8915. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8916. selectBall = xGame.common.getRandArrEle(allArr);
  8917. }
  8918. let targetD3Src = selectBall.d3BallSrc;
  8919. xGame.common.d2World.d2Gan.ui.visible = false;
  8920. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8921. d3Src.scaleXYZ = 0.5;
  8922. this.tweenArr.push(d3Src);
  8923. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8924. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8925. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8926. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8927. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8928. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8929. let outArr = [selectBall];
  8930. let other = this.leveNum - 1;
  8931. if (other > 0) {
  8932. let nearArr = this.getOneArr(selectBall);
  8933. if (nearArr.length > 0) {
  8934. xGame.common.botherArr(nearArr);
  8935. if (other >= nearArr.length)
  8936. other = nearArr.length;
  8937. for (let index = 0; index < other; index++) {
  8938. outArr.push(nearArr[index]);
  8939. }
  8940. }
  8941. }
  8942. xGame.common.extraMoveNum = other + 1;
  8943. this.extraScore = other + 1;
  8944. this._rootX = selectBall.gameObj.x;
  8945. this._rootY = selectBall.gameObj.y;
  8946. rootBall.gameObj.x = this._rootX;
  8947. rootBall.gameObj.y = this._rootY;
  8948. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8949. Laya.Tween.clearAll(d3Src);
  8950. this.addRandomForce(outArr);
  8951. }));
  8952. }));
  8953. }
  8954. addRandomForce(outArr) {
  8955. if (outArr.length > 0) {
  8956. xGame.common.d2World.openCheckStill = true;
  8957. this.playedLastSkill = true;
  8958. }
  8959. let temp;
  8960. for (let index = 0; index < outArr.length; index++) {
  8961. let angle = xGame.common.randomNum(0, 360);
  8962. let linearPercent = xGame.common.randomNum(65, 100);
  8963. temp = outArr[index];
  8964. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8965. }
  8966. }
  8967. setLinearSpeed(angle, rigy, linearPercent) {
  8968. let sin = Math.sin(angle * Math.PI / 180);
  8969. let cos = Math.cos(angle * Math.PI / 180);
  8970. let maxSpeed = 4;
  8971. let speed = new Laya.Vector2();
  8972. speed.x = maxSpeed * linearPercent * sin;
  8973. speed.y = -maxSpeed * linearPercent * cos;
  8974. rigy.applyLinearImpulseToCenter(speed);
  8975. }
  8976. runBreakArmy() {
  8977. xGame.common.d2World.d2Gan.ui.visible = false;
  8978. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8979. let gameUI = xGame.common.gameUI.ui;
  8980. gameUI.skillRod.visible = true;
  8981. gameUI.skillRod.rotation = 110;
  8982. let outArr = this.getAllBallArr();
  8983. if (outArr.length <= 0) {
  8984. gameUI.skillRod.visible = false;
  8985. this.callback && this.callback(0);
  8986. return;
  8987. }
  8988. xGame.common.botherArr(outArr);
  8989. if (this.leveNum >= outArr.length)
  8990. this.leveNum = outArr.length;
  8991. let deleteNum = outArr.length - this.leveNum;
  8992. outArr.splice(0, deleteNum);
  8993. this.extraScore = this.leveNum;
  8994. let potX = gameUI.skillRod.x;
  8995. let potY = gameUI.skillRod.y;
  8996. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8997. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8998. let disArr = [];
  8999. for (let index = 0; index < outArr.length; index++) {
  9000. let obj = outArr[index];
  9001. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  9002. dis = Math.pow(dis, 0.5);
  9003. disArr.push(dis);
  9004. }
  9005. this.tweenArr.push(gameUI.skillRod);
  9006. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9007. })).update = Laya.Handler.create(this, (e, t, c) => {
  9008. let angle = gameUI.skillRod.rotation;
  9009. let xx;
  9010. let yy;
  9011. let temp;
  9012. for (let index = 0; index < outArr.length; index++) {
  9013. temp = outArr[index];
  9014. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  9015. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  9016. yy -= 20;
  9017. temp.gameObj.x = xx;
  9018. temp.gameObj.y = yy;
  9019. temp.d3BallSrc.setTransPos(xx, yy);
  9020. }
  9021. if (angle <= 60) {
  9022. Laya.Tween.clearAll(gameUI.skillRod);
  9023. this.ballFlyToBag(outArr, 150);
  9024. gameUI.skillRod.visible = false;
  9025. }
  9026. }, null, false);
  9027. }
  9028. runIce() {
  9029. let ballArr = xGame.common.d2World.ballArr;
  9030. this.leveNum *= 2;
  9031. if (this.leveNum >= ballArr.length - 1)
  9032. this.leveNum = ballArr.length - 1;
  9033. let tempArr = [];
  9034. let outArr = [];
  9035. for (let index = 0; index < ballArr.length; index++) {
  9036. if (ballArr[index] instanceof D2RootBallSrc)
  9037. continue;
  9038. tempArr.push(ballArr[index]);
  9039. }
  9040. if (tempArr.length <= 0) {
  9041. this.callback && this.callback(0);
  9042. return;
  9043. }
  9044. xGame.common.botherArr(tempArr);
  9045. for (let index = 0; index < this.leveNum; index++) {
  9046. outArr.push(tempArr[index]);
  9047. }
  9048. this.extraScore = this.leveNum;
  9049. let temp;
  9050. for (let index = 0; index < outArr.length; index++) {
  9051. temp = outArr[index];
  9052. temp.d3BallSrc.playIceEft();
  9053. }
  9054. Laya.timer.once(2000, this, () => {
  9055. for (let index = 0; index < outArr.length; index++) {
  9056. temp = outArr[index];
  9057. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9058. temp.setBallFunc("ice", str);
  9059. }
  9060. this.callback && this.callback(0);
  9061. });
  9062. }
  9063. runFireworks() {
  9064. let allArr = this.getAllBallArr();
  9065. if (allArr.length <= 0) {
  9066. this.callback && this.callback(0);
  9067. return;
  9068. }
  9069. xGame.common.d2World.d2Gan.ui.visible = false;
  9070. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9071. let outArr = [];
  9072. let other = this.leveNum;
  9073. if (other > 0) {
  9074. if (allArr.length > 0) {
  9075. xGame.common.botherArr(allArr);
  9076. if (other >= allArr.length)
  9077. other = allArr.length;
  9078. for (let index = 0; index < other; index++) {
  9079. outArr.push(allArr[index]);
  9080. }
  9081. }
  9082. }
  9083. xGame.common.extraMoveNum = other;
  9084. this.extraScore = other;
  9085. this.addRandmomFireworks(outArr);
  9086. }
  9087. addRandmomFireworks(outArr) {
  9088. Laya.timer.once(1100, this, () => {
  9089. if (outArr.length > 0) {
  9090. xGame.common.d2World.openCheckStill = true;
  9091. this.playedLastSkill = true;
  9092. }
  9093. });
  9094. xGame.soundMgr.playSound("skill_04_02");
  9095. let temp;
  9096. let delay = -200;
  9097. for (let index = 0; index < outArr.length; index++) {
  9098. temp = outArr[index];
  9099. delay += 200;
  9100. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9101. let angle = xGame.common.randomNum(0, 360);
  9102. angle = this.getFireworksAngle(obj);
  9103. let linearPercent = xGame.common.randomNum(45, 80);
  9104. if (!obj.destroyed)
  9105. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9106. });
  9107. }
  9108. }
  9109. getFireworksAngle(obj) {
  9110. let rootBall = xGame.common.d2World.rootBall;
  9111. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9112. }
  9113. resetGame() {
  9114. Laya.timer.clearAll(this);
  9115. if (this.tweenArr) {
  9116. for (let index = 0; index < this.tweenArr.length; index++) {
  9117. Laya.Tween.clearAll(this.tweenArr[index]);
  9118. }
  9119. }
  9120. this.tweenArr = null;
  9121. }
  9122. runGuanYu() {
  9123. xGame.common.d2World.d2Gan.ui.visible = false;
  9124. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9125. let rootBall = xGame.common.d2World.rootBall;
  9126. if (rootBall.isInHole) {
  9127. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9128. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9129. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9130. rootBall.showSelf();
  9131. }
  9132. this.rtStarX = rootBall.gameObj.x;
  9133. this.rtStarY = rootBall.gameObj.y;
  9134. this.knifeTimes = 0;
  9135. this.playedLastSkill = true;
  9136. rootBall.forceRun = true;
  9137. rootBall.rigy.type = "static";
  9138. xGame.common.d2World.openCheckStill = true;
  9139. this.guanyuRandomKnife();
  9140. }
  9141. guanyuRandomKnife() {
  9142. let rootBall = xGame.common.d2World.rootBall;
  9143. let dir = this.getRandDir();
  9144. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9145. console.log("当前angle", angle);
  9146. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9147. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9148. let dis = 324;
  9149. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9150. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9151. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9152. this.rtStarX = rootBall.gameObj.x;
  9153. this.rtStarY = rootBall.gameObj.y;
  9154. this.knifeTimes++;
  9155. let skillLevel;
  9156. if (xGame.common.gameMgr.selfTurn) {
  9157. skillLevel = DataMgr.getBigSkillByIndex(4);
  9158. }
  9159. else {
  9160. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9161. }
  9162. if (!skillLevel)
  9163. skillLevel = 1;
  9164. skillLevel += 2;
  9165. if (this.knifeTimes < skillLevel) {
  9166. Laya.timer.once(400, this, () => {
  9167. this.guanyuRandomKnife();
  9168. });
  9169. }
  9170. else {
  9171. rootBall.forceRun = false;
  9172. rootBall.rigy.type = "dynamic";
  9173. xGame.common.extraMoveNum = skillLevel;
  9174. }
  9175. }));
  9176. }
  9177. getRandDir() {
  9178. let rootBall = xGame.common.d2World.rootBall;
  9179. let allBall = this.getAllBallArr();
  9180. let target = xGame.common.getRandArrEle(allBall);
  9181. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9182. return this.knifeV2;
  9183. }
  9184. cloneKnife(x, y, rotation) {
  9185. let parent = xGame.common.d3World.knifeRoot;
  9186. let prefab = xGame.common.d3World.knife;
  9187. let clone = prefab.clone();
  9188. parent.addChild(clone);
  9189. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9190. clone.transform.localPositionX = this.knifeV3.x;
  9191. clone.transform.localPositionY = 0;
  9192. clone.transform.localPositionZ = this.knifeV3.z;
  9193. clone.transform.localRotationEulerX = 0;
  9194. clone.transform.localRotationEulerY = rotation;
  9195. clone.transform.localRotationEulerZ = 0;
  9196. clone.active = true;
  9197. return clone;
  9198. }
  9199. cloneGuanYuEft(x, y, angle) {
  9200. return;
  9201. let parent = xGame.common.gameUI.ui.guanyuNode;
  9202. let eft = new ui_guanyuAni();
  9203. eft.parent = parent;
  9204. eft.x = x;
  9205. eft.y = y;
  9206. eft.rotation = angle;
  9207. }
  9208. }
  9209. class ui_UIWordsList extends fgui.GComponent {
  9210. static createInstance() {
  9211. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9212. }
  9213. onConstruct() {
  9214. this.c1 = this.getController("c1");
  9215. this.n74 = (this.getChild("n74"));
  9216. this.clickNode = (this.getChild("clickNode"));
  9217. this.myNode = (this.getChild("myNode"));
  9218. this.n68 = (this.getChild("n68"));
  9219. this.n66 = (this.getChild("n66"));
  9220. this.n55 = (this.getChild("n55"));
  9221. this.wordsBtn = (this.getChild("wordsBtn"));
  9222. this.emotionBtn = (this.getChild("emotionBtn"));
  9223. this.mybggg = (this.getChild("mybggg"));
  9224. this.wordsList = (this.getChild("wordsList"));
  9225. this.emotionList = (this.getChild("emotionList"));
  9226. this.myRoot = (this.getChild("myRoot"));
  9227. }
  9228. }
  9229. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  9230. class EmotionDisplay {
  9231. constructor(index, ui) {
  9232. this.ui = ui;
  9233. this.index = index;
  9234. this.ui.onClick(this, this.clickSelf);
  9235. this.updateSelf();
  9236. }
  9237. updateSelf() {
  9238. let data = cfgTable.emotionData[this.index + 1];
  9239. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  9240. }
  9241. clickSelf() {
  9242. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9243. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  9244. xGame.common.talkMgr.closeTalkView();
  9245. }
  9246. }
  9247. class WordsDisplay {
  9248. constructor(index, ui) {
  9249. this.ui = ui;
  9250. this.index = index;
  9251. this.ui.onClick(this, this.clickSelf);
  9252. this.updateSelf();
  9253. }
  9254. updateSelf() {
  9255. let data = cfgTable.talkwordsData[this.index + 1];
  9256. this.ui.txt.text = data.msg;
  9257. }
  9258. clickSelf() {
  9259. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9260. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  9261. xGame.common.talkMgr.closeTalkView();
  9262. }
  9263. }
  9264. class UIWordsList extends UIBase {
  9265. constructor() {
  9266. super();
  9267. }
  9268. onConstructor() {
  9269. this.ui = ui_UIWordsList.createInstance();
  9270. this.contentPane = this.ui;
  9271. this.isEject = false;
  9272. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  9273. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  9274. this.addUIClick(this.ui.clickNode, this.hide);
  9275. this.initTalkList();
  9276. this.initEmotionList();
  9277. }
  9278. show() {
  9279. super.show();
  9280. }
  9281. initTalkList() {
  9282. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  9283. let data = cfgTable.talkwordsData;
  9284. let length = Object.keys(data).length;
  9285. this.ui.wordsList.numItems = length;
  9286. }
  9287. initEmotionList() {
  9288. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  9289. let data = cfgTable.emotionData;
  9290. let length = Object.keys(data).length;
  9291. this.ui.emotionList.numItems = length;
  9292. }
  9293. renderTalkItem(index, obj) {
  9294. let temp = new WordsDisplay(index, obj);
  9295. }
  9296. renderEmotionItem(index, obj) {
  9297. let temp = new EmotionDisplay(index, obj);
  9298. }
  9299. openTalkList() {
  9300. this.ui.c1.selectedIndex = 0;
  9301. }
  9302. openEmotionList() {
  9303. this.ui.c1.selectedIndex = 1;
  9304. }
  9305. }
  9306. UIWordsList.uiName = "UIWordsList";
  9307. class TalkMgr {
  9308. constructor() {
  9309. this.aiSpeak = true;
  9310. this.emotionList = [];
  9311. this.talkList = [];
  9312. this.addEvent();
  9313. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9314. this.emotionList = [];
  9315. this.talkList = [];
  9316. for (let k in cfgTable.emotionData) {
  9317. this.emotionList.push(cfgTable.emotionData[k].id);
  9318. }
  9319. for (let k in cfgTable.talkwordsData) {
  9320. this.talkList.push(cfgTable.talkwordsData[k].id);
  9321. }
  9322. }
  9323. addEvent() {
  9324. let ui = xGame.common.gameUI.ui;
  9325. ui.wordsBtn.visible = true;
  9326. ui.wordsBtn.onClick(this, this.openTalkView);
  9327. ui.aiWordsBtn.visible = true;
  9328. ui.aiWordsBtn.onClick(this, this.clickAIState);
  9329. }
  9330. openTalkView() {
  9331. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9332. xGame.uiMgr.Show(UIWordsList);
  9333. }
  9334. closeTalkView() {
  9335. xGame.uiMgr.Hide(UIWordsList);
  9336. }
  9337. clickAIState() {
  9338. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9339. this.aiSpeak = !this.aiSpeak;
  9340. this.changeAIState(this.aiSpeak);
  9341. }
  9342. changeAIState(speak) {
  9343. this.aiSpeak = speak;
  9344. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  9345. if (speak) {
  9346. btn.c1.selectedIndex = 0;
  9347. }
  9348. else {
  9349. btn.c1.selectedIndex = 1;
  9350. }
  9351. }
  9352. showSelfTalk(wordsId) {
  9353. let ui = xGame.common.gameUI.ui;
  9354. ui.selfTalk.visible = true;
  9355. ui.selfTalk.myNode.c1.selectedIndex = 1;
  9356. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9357. ui.selfTalk.t0.play();
  9358. }
  9359. showSelfEmotion(emotionId) {
  9360. let ui = xGame.common.gameUI.ui;
  9361. ui.selfTalk.visible = true;
  9362. ui.selfTalk.myNode.c1.selectedIndex = 0;
  9363. this.selfSpine && this.selfSpine.dispose();
  9364. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9365. let spineData = cfgTable.emotionData[emotionId].spine;
  9366. this.selfSpine = new SpineMgr(spineData, () => {
  9367. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  9368. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  9369. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9370. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  9371. });
  9372. ui.selfTalk.t0.play();
  9373. }
  9374. showAITalk(wordsId) {
  9375. if (!this.aiSpeak)
  9376. return;
  9377. if (DataMgr.gameData.gameCount < 2)
  9378. return;
  9379. if (wordsId < 1)
  9380. wordsId = this.getRandTalk();
  9381. let ui = xGame.common.gameUI.ui;
  9382. ui.aiTalk.visible = true;
  9383. ui.aiTalk.myNode.c1.selectedIndex = 1;
  9384. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9385. ui.aiTalk.t0.play();
  9386. }
  9387. getRandTalk() {
  9388. let rand = xGame.tools.random(0, this.talkList.length);
  9389. return this.emotionList[rand];
  9390. }
  9391. getRandEmotion() {
  9392. let rand = xGame.tools.random(0, this.emotionList.length);
  9393. return this.emotionList[rand];
  9394. }
  9395. showAIEmotion(emotionId) {
  9396. if (!this.aiSpeak)
  9397. return;
  9398. if (DataMgr.gameData.gameCount < 2)
  9399. return;
  9400. if (emotionId < 1)
  9401. emotionId = this.getRandEmotion();
  9402. let ui = xGame.common.gameUI.ui;
  9403. ui.aiTalk.visible = true;
  9404. ui.aiTalk.myNode.c1.selectedIndex = 0;
  9405. this.aiSpine && this.aiSpine.dispose();
  9406. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9407. let spineData = cfgTable.emotionData[emotionId].spine;
  9408. this.aiSpine = new SpineMgr(spineData, () => {
  9409. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  9410. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  9411. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9412. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  9413. });
  9414. ui.aiTalk.t0.play();
  9415. }
  9416. resetGame() {
  9417. let ui = xGame.common.gameUI.ui;
  9418. ui.aiTalk.visible = false;
  9419. ui.selfTalk.visible = false;
  9420. this.aiSpine && this.aiSpine.dispose();
  9421. this.selfSpine && this.selfSpine.dispose();
  9422. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9423. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9424. this.closeTalkView();
  9425. }
  9426. }
  9427. class WordsMgr {
  9428. constructor() {
  9429. this.comboTimes = 1;
  9430. this.skillTimes = 0;
  9431. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  9432. this.comboSpine = new SpineMgr("yxz_liangan");
  9433. this.skillSpine = new SpineMgr("yiganxqiu");
  9434. this.scoreSpine = new SpineMgr("defen");
  9435. }
  9436. setClassicCombo(isInterrupt) {
  9437. if (isInterrupt) {
  9438. this.comboTimes = 0;
  9439. }
  9440. }
  9441. playClassicWords(type, callback) {
  9442. this.callback = callback;
  9443. let aniIndex = type;
  9444. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9445. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9446. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9447. mySpine.destroy(true);
  9448. this.playClassicTimes();
  9449. });
  9450. }
  9451. playClassicTimes() {
  9452. this.comboTimes++;
  9453. if (this.comboTimes <= 1) {
  9454. this.callback && this.callback();
  9455. }
  9456. else {
  9457. let aniIndex = this.comboTimes - 1;
  9458. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9459. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9460. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9461. mySpine.destroy(true);
  9462. this.callback && this.callback();
  9463. });
  9464. }
  9465. }
  9466. playBigSkillTimes(times, callback) {
  9467. if (times <= 0) {
  9468. callback && callback();
  9469. return;
  9470. }
  9471. this.callback = callback;
  9472. let pre = "sz_0";
  9473. let aniIndex = 0;
  9474. this.getWordsImg(times, pre, () => {
  9475. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9476. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9477. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9478. let r1 = ``;
  9479. let r2 = ``;
  9480. if (times <= 9) {
  9481. r1 = `res/d2Res/${pre}${times}.png`;
  9482. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9483. aniIndex = 0;
  9484. }
  9485. else {
  9486. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9487. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9488. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9489. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9490. aniIndex = 1;
  9491. }
  9492. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9493. mySpine.destroy(true);
  9494. xGame.common.gameMgr.playSkillTips();
  9495. this.playScore(times);
  9496. xGame.common.playRandomMutiBallBigSkillSound();
  9497. }, mySpine);
  9498. });
  9499. }
  9500. playScore(score) {
  9501. let pre = "sz_";
  9502. let aniIndex = 0;
  9503. this.getWordsImg(score, pre, () => {
  9504. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9505. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9506. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9507. let r1 = ``;
  9508. let r2 = ``;
  9509. if (score <= 9) {
  9510. r1 = `res/d2Res/${pre}${score}.png`;
  9511. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9512. aniIndex = 0;
  9513. }
  9514. else {
  9515. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9516. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9517. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9518. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9519. aniIndex = 1;
  9520. }
  9521. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9522. mySpine.destroy(true);
  9523. this.callback && this.callback();
  9524. }, mySpine);
  9525. });
  9526. }
  9527. getWordsImg(number, pre = "", callback) {
  9528. let arr = [];
  9529. if (number <= 9) {
  9530. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9531. }
  9532. else {
  9533. 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 });
  9534. }
  9535. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9536. callback && callback();
  9537. }));
  9538. }
  9539. }
  9540. class ui_UIRodMethod extends fgui.GComponent {
  9541. static createInstance() {
  9542. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9543. }
  9544. onConstruct() {
  9545. this.n24 = (this.getChild("n24"));
  9546. this.white = (this.getChild("white"));
  9547. this.dot = (this.getChild("dot"));
  9548. this.sureBtn = (this.getChild("sureBtn"));
  9549. this.n20 = (this.getChild("n20"));
  9550. this.n21 = (this.getChild("n21"));
  9551. this.n22 = (this.getChild("n22"));
  9552. this.n23 = (this.getChild("n23"));
  9553. this.n5 = (this.getChild("n5"));
  9554. this.n14 = (this.getChild("n14"));
  9555. this.t0 = this.getTransition("t0");
  9556. }
  9557. }
  9558. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9559. class UIRodMethod extends UIBase {
  9560. constructor() {
  9561. super();
  9562. this.isPressd = false;
  9563. }
  9564. onConstructor() {
  9565. this.ui = ui_UIRodMethod.createInstance();
  9566. this.contentPane = this.ui;
  9567. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9568. this.moveDir = new Laya.Vector2();
  9569. this.moveDest = new Laya.Vector2();
  9570. this.centerPos = new Laya.Vector2();
  9571. xGame.common.uiRodMethod = this;
  9572. }
  9573. show() {
  9574. super.show();
  9575. xGame.common.gameMgr.gamePause = true;
  9576. this.openPressDotEvent();
  9577. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9578. this.centerPos.x = this.ui.white.x;
  9579. this.centerPos.y = this.ui.white.y;
  9580. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9581. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9582. this.setDot();
  9583. }
  9584. setDot() {
  9585. this.ui.dot.x = this.moveDest.x;
  9586. this.ui.dot.y = this.moveDest.y;
  9587. }
  9588. closeSelf() {
  9589. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9590. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9591. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9592. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9593. xGame.common.gameMgr.gamePause = false;
  9594. this.hide();
  9595. }
  9596. openPressDotEvent() {
  9597. this.closePressDotEvent();
  9598. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9599. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9600. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9601. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9602. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9603. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9604. }
  9605. closePressDotEvent() {
  9606. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9607. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9608. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9609. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9610. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9611. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9612. }
  9613. onDown(e) {
  9614. if (e.type == Laya.Event.MOUSE_DOWN)
  9615. this.isPressd = true;
  9616. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9617. this.isPressd = false;
  9618. if (!this.isPressd)
  9619. return;
  9620. this.moveDest.x = e.stageX;
  9621. this.moveDest.y = e.stageY;
  9622. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9623. if (dis > 6724) {
  9624. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9625. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9626. }
  9627. this.setDot();
  9628. }
  9629. resetRod() {
  9630. this.ui.dot.x = this.ui.white.x;
  9631. this.ui.dot.y = this.ui.white.y;
  9632. this.gameRod.dot.x = this.gameRod.bg.x;
  9633. this.gameRod.dot.y = this.gameRod.bg.y;
  9634. xGame.common.rodOffest.x = 0;
  9635. xGame.common.rodOffest.y = 0;
  9636. }
  9637. }
  9638. UIRodMethod.uiName = "UIRodMethod";
  9639. class UIGame extends UIBase {
  9640. constructor() {
  9641. super();
  9642. this.powerNum = 0;
  9643. this.isD3Inited = false;
  9644. this.isPrePlay = false;
  9645. this.isMoveRod = false;
  9646. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9647. this.rulerDis = 20;
  9648. this.rulerOffset = 0;
  9649. }
  9650. onConstructor() {
  9651. this.ui = ui_UIGame.createInstance();
  9652. this.contentPane = this.ui;
  9653. this.ui.x += xGame.common.sysOffestNum;
  9654. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9655. this.isEject = false;
  9656. xGame.common.gameUI = this;
  9657. this.initSelf();
  9658. }
  9659. isTurnSelf() {
  9660. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9661. return true;
  9662. }
  9663. }
  9664. initSelf() {
  9665. let topUI = this.ui.topNode;
  9666. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9667. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9668. this.barInfo = {};
  9669. this.barInfo.curY = 0;
  9670. this.barInfo.height = this.ui.powerNode.height;
  9671. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9672. this.barInfo.powerStartY = this.ui.powerNode.y;
  9673. xGame.common.aiPlayer = new AIPlayer();
  9674. xGame.common.gameMgr = new GameMgr();
  9675. xGame.common.skillMgr = new SkillMgr();
  9676. xGame.common.wordsMgr = new WordsMgr();
  9677. xGame.common.talkMgr = new TalkMgr();
  9678. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9679. console.log("加载经典模式表情文件chenggon !");
  9680. });
  9681. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9682. console.log("挑战模式奖励模式spine加载成功!");
  9683. });
  9684. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9685. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9686. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9687. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9688. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9689. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9690. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9691. }
  9692. getGanZiImg() {
  9693. let index = DataMgr.getCurBallRod();
  9694. let data = cfgTable.ballrodData[index + 1];
  9695. let gan_url = xGame.common.getGameIconUrl(data.img);
  9696. console.log('zh:getGanZiImg gan_url==' + gan_url);
  9697. this.ui.powerNode.showImg.url = gan_url;
  9698. console.log('zh:修改杆子图标O K');
  9699. }
  9700. returnHome() {
  9701. let tips = "Are you sure to exit the game?";
  9702. let woman = "Boss, why don't you play for a while longer?";
  9703. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9704. }
  9705. addRodMethodClick() {
  9706. if (this.isTurnSelf()) {
  9707. xGame.uiMgr.Show(UIRodMethod);
  9708. }
  9709. }
  9710. clickHelpLineBtn(force = false) {
  9711. if (!this.isTurnSelf())
  9712. return;
  9713. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9714. if (success) {
  9715. xGame.common.longHelpLine = true;
  9716. xGame.common.d2World.getHelpLine();
  9717. Moyu.sendDataEvent("guideNum");
  9718. }
  9719. else {
  9720. }
  9721. });
  9722. }
  9723. renderSelfDisplayBalls(index, target) {
  9724. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9725. target.myImg.url = xGame.common.getGameIconUrl(str);
  9726. }
  9727. renderAIDisplayBalls(index, target) {
  9728. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9729. target.myImg.url = xGame.common.getGameIconUrl(str);
  9730. ;
  9731. }
  9732. updateMode() {
  9733. if (xGame.common.gameMode == GameMode.classic) {
  9734. this.ui.topNode.scoreNode.visible = false;
  9735. }
  9736. else if (xGame.common.gameMode == GameMode.bigMove) {
  9737. this.ui.topNode.scoreNode.visible = true;
  9738. }
  9739. }
  9740. show() {
  9741. super.show();
  9742. console.log("zh:uigame show AADD");
  9743. this.ui.alpha = 0;
  9744. this.updateSelf();
  9745. xGame.common.gameMgr.gamePause = false;
  9746. xGame.common.gameUI.ui.blackAni.visible = false;
  9747. xGame.common.gameUI.ui.whiteAni.visible = false;
  9748. this.ui.powerEft.visible = false;
  9749. this.ui.colorNode.visible = false;
  9750. this.updateHead();
  9751. let curUse = DataMgr.getCurBallRod();
  9752. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  9753. this.getGanZiImg();
  9754. }
  9755. updateSelf() {
  9756. if (xGame.common.gameMode == GameMode.classic) {
  9757. this.ui.c1.selectedIndex = 0;
  9758. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9759. this.ui.topNode.middleNode.visible = true;
  9760. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9761. }
  9762. else if (xGame.common.gameMode == GameMode.bigMove) {
  9763. this.ui.c1.selectedIndex = 0;
  9764. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9765. this.ui.topNode.middleNode.visible = false;
  9766. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9767. let rand = xGame.common.randomNum(1, max);
  9768. let guide = DataMgr.getSkillGuide();
  9769. if (guide == 0)
  9770. rand = 1;
  9771. xGame.common.bigMoveLevelIndex = rand;
  9772. }
  9773. else if (xGame.common.gameMode == GameMode.placeBall) {
  9774. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9775. this.ui.c1.selectedIndex = 1 + data.type;
  9776. this.ui.alpha = 1;
  9777. this.startGame();
  9778. }
  9779. this.updateMode();
  9780. this.initD3world();
  9781. this.initD2world();
  9782. }
  9783. startGame() {
  9784. this.ui.snowNode.visible = Math.random() <= 0.1;
  9785. this.ui.d2Node.visible = false;
  9786. xGame.common.d3World.d3Hand.gameObj.active = false;
  9787. xGame.common.d3World.tableSrc.init();
  9788. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9789. this.cameraViewChange(() => {
  9790. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9791. switch (xGame.common.gameMode) {
  9792. case GameMode.classic:
  9793. xGame.common.d3World.d3Hand.gameObj.active = true;
  9794. this.playPutBallD3Ani();
  9795. break;
  9796. case GameMode.bigMove:
  9797. this.enterGame();
  9798. Laya.timer.once(500, this, () => {
  9799. this.ui.topNode.middleNode.visible = true;
  9800. this.ui.topNode.middleNode.t0.play();
  9801. });
  9802. break;
  9803. case GameMode.placeBall:
  9804. this.enterGame();
  9805. break;
  9806. default:
  9807. break;
  9808. }
  9809. });
  9810. PlatMgr.showBanner(false);
  9811. }
  9812. enterGame() {
  9813. this.ui.d2Node.visible = true;
  9814. xGame.common.d3World.d3Hand.gameObj.active = false;
  9815. xGame.common.showOneCamera("mainCamera");
  9816. Moyu.recordGame(30, true);
  9817. if (!this.isPrePlay) {
  9818. this.isPrePlay = true;
  9819. xGame.common.d3World.prePlayEft();
  9820. }
  9821. xGame.common.gameMgr.gameReady();
  9822. this.openAllEvent();
  9823. this.ui.snowNode.visible = false;
  9824. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9825. this.ui.helpBtn.visible = condition;
  9826. }
  9827. showHelpLineGuide() {
  9828. let longGuide = DataMgr.getGuideHelpLine();
  9829. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9830. this.ui.helpBtn.visible = true;
  9831. this.ui.guideNode.visible = true;
  9832. }
  9833. }
  9834. setTurnAlpha(alpha) {
  9835. this.ui.keduNode.alpha = alpha;
  9836. this.ui.ganNode.alpha = alpha;
  9837. this.ui.rodMethodNode.alpha = alpha;
  9838. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9839. }
  9840. cameraViewChange(callback) {
  9841. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9842. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9843. xGame.common.showOneCamera("visitAngle");
  9844. cameraSrc.localRotationEulerY = 180;
  9845. cameraSrc.localRotationEulerZ = 0;
  9846. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9847. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9848. callback && callback();
  9849. }));
  9850. }));
  9851. }
  9852. playPutBallD3Ani() {
  9853. xGame.common.showOneCamera("mainCamera");
  9854. let handSrc = xGame.common.d3World.d3Hand;
  9855. handSrc.gameObj.active = true;
  9856. handSrc.transform.localPositionZ = 3;
  9857. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9858. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9859. handSrc.gameObj.active = false;
  9860. this.enterGame();
  9861. }), 400);
  9862. }));
  9863. }
  9864. updateHead() {
  9865. let user = Moyu.getUserInfo();
  9866. this.ui.topNode.selfNameTxt.text = user.nickName;
  9867. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9868. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9869. if (DataMgr.getSkillGuide() < 1) {
  9870. this.ui.topNode.aiNameTxt.text = 'billiards';
  9871. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9872. }
  9873. else {
  9874. this.ui.topNode.aiNameTxt.text = aiData.name;
  9875. let randNo = Math.floor(Math.random() * 10) + 1;
  9876. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9877. }
  9878. }
  9879. initD2world() {
  9880. let node = this.ui.d2Root.displayObject;
  9881. let src = node.getComponent(D2World);
  9882. if (!src) {
  9883. xGame.common.d2World = node.addComponent(D2World);
  9884. }
  9885. xGame.common.d2World.initSelf();
  9886. }
  9887. initD3world() {
  9888. if (this.isD3Inited)
  9889. return;
  9890. this.isD3Inited = true;
  9891. let scene3D = xGame.common.d3Scene;
  9892. this.ui.d3Root.displayObject.addChild(scene3D);
  9893. scene3D.active = true;
  9894. xGame.common.d3World.tableSrc.setBorderPos();
  9895. }
  9896. onRootMove(e) {
  9897. let rootBall = xGame.common.d2World.rootBall;
  9898. this.ui.moveNode.x = e.x;
  9899. this.ui.moveNode.y = e.y;
  9900. rootBall.gameObj.x = e.x;
  9901. rootBall.gameObj.y = e.y;
  9902. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9903. }
  9904. aiRootMove(move) {
  9905. if (move)
  9906. this.hideBallUI();
  9907. else {
  9908. this.showBallUI();
  9909. xGame.common.d2World.getHelpLine();
  9910. }
  9911. }
  9912. aiForce(type, force = 0) {
  9913. this.pressTarget = PressType.powerNode;
  9914. if (type == 1)
  9915. this.onEventUp({ force: true });
  9916. else if (type == 2)
  9917. this.onEventMove({ stageY: force, force: true });
  9918. }
  9919. onEventPress(e) {
  9920. if (e.stopPropagation)
  9921. e.stopPropagation();
  9922. if (!this.isTurnSelf())
  9923. return;
  9924. let target = e.target;
  9925. switch (target) {
  9926. case this.ui.myPowerNode.displayObject:
  9927. this.pressTarget = PressType.powerNode;
  9928. this.barInfo.curY = e.stageY;
  9929. this.updateBarInfo();
  9930. break;
  9931. case this.ui.moveNode.displayObject:
  9932. this.pressTarget = PressType.moveNode;
  9933. this.hideBallUI();
  9934. this.eventObj.curX = this.ui.moveNode.x;
  9935. this.eventObj.curY = this.ui.moveNode.y;
  9936. this.ui.moveNode.finger.visible = false;
  9937. this.eventObj.lastX = e.stageX;
  9938. this.eventObj.lastY = e.stageY;
  9939. break;
  9940. case this.ui.rulerClickNode.displayObject:
  9941. this.pressTarget = PressType.rulerNode;
  9942. this.eventObj.lastY = e.stageY;
  9943. break;
  9944. case this.ui.d2Root.displayObject:
  9945. this.pressTarget = PressType.d2Root;
  9946. this.eventObj.lastX = e.stageX;
  9947. this.eventObj.lastY = e.stageY;
  9948. this.eventObj.starX = e.stageX;
  9949. this.eventObj.starY = e.stageY;
  9950. this.eventObj.curX = 0;
  9951. this.eventObj.curY = 0;
  9952. xGame.common.d2World.d2Gan.setGanLastInfo();
  9953. this.rulerOffset = 0;
  9954. break;
  9955. default:
  9956. break;
  9957. }
  9958. }
  9959. onEventMove(e) {
  9960. if (e.stopPropagation)
  9961. e.stopPropagation();
  9962. if (e && e.force) {
  9963. }
  9964. else {
  9965. if (!this.isTurnSelf())
  9966. return;
  9967. }
  9968. switch (this.pressTarget) {
  9969. case PressType.powerNode:
  9970. this.barInfo.curY = e.stageY;
  9971. this.updateBarInfo();
  9972. this.isMoveRod = true;
  9973. break;
  9974. case PressType.moveNode:
  9975. let rootBall = xGame.common.d2World.rootBall;
  9976. let radius = rootBall.gameObj.width / 2;
  9977. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9978. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9979. let border = xGame.common.d2World.borderRect;
  9980. if (curX <= border.x + radius)
  9981. curX = border.x + radius;
  9982. else if (curX >= border.x + border.width - radius)
  9983. curX = border.x + border.width - radius;
  9984. if (curY <= border.y + radius)
  9985. curY = border.y + radius;
  9986. else if (curY >= border.y + border.height - radius)
  9987. curY = border.y + border.height - radius;
  9988. if (xGame.common.gameMgr.isOpenBall) {
  9989. if (curX >= border.x + border.openBallW - radius)
  9990. curX = border.x + border.openBallW - radius;
  9991. }
  9992. this.ui.moveNode.x = curX;
  9993. this.ui.moveNode.y = curY;
  9994. rootBall.gameObj.x = curX;
  9995. rootBall.gameObj.y = curY;
  9996. rootBall.d3BallSrc.setTransPos(curX, curY);
  9997. this.isMoveRod = true;
  9998. break;
  9999. case PressType.rulerNode:
  10000. let yy = e.stageY - this.eventObj.lastY;
  10001. this.eventObj.lastY = e.stageY;
  10002. let ruler1 = this.ui.rulerNode.img1;
  10003. let ruler2 = this.ui.rulerNode.img2;
  10004. ruler1.y += yy;
  10005. ruler2.y += yy;
  10006. this.rulerOffset += yy;
  10007. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  10008. this.rulerOffset = 0;
  10009. xGame.soundMgr.playSound("inch", 1, 10);
  10010. }
  10011. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  10012. let h = ruler1.height;
  10013. this.checkGuide();
  10014. this.isMoveRod = true;
  10015. if (ruler1.y >= h) {
  10016. ruler1.y = -h;
  10017. ruler2.y = 0;
  10018. return;
  10019. }
  10020. else if (ruler1.y <= -h) {
  10021. ruler1.y = h;
  10022. ruler2.y = 0;
  10023. return;
  10024. }
  10025. if (ruler2.y >= h) {
  10026. ruler2.y = -h;
  10027. ruler1.y = 0;
  10028. return;
  10029. }
  10030. else if (ruler2.y <= -h) {
  10031. ruler2.y = h;
  10032. ruler1.y = 0;
  10033. return;
  10034. }
  10035. break;
  10036. case PressType.d2Root:
  10037. this.eventObj.curX = e.stageX;
  10038. this.eventObj.curY = e.stageY;
  10039. let offset = this.checkRodMoveDir();
  10040. xGame.common.d2World.d2Gan.rotateSelf(offset);
  10041. this.eventObj.lastX = e.stageX;
  10042. this.eventObj.lastY = e.stageY;
  10043. break;
  10044. default:
  10045. break;
  10046. }
  10047. }
  10048. onEventUp(e) {
  10049. if (e.stopPropagation)
  10050. e.stopPropagation();
  10051. if (e && e.force) {
  10052. }
  10053. else {
  10054. if (!this.isTurnSelf())
  10055. return;
  10056. }
  10057. switch (this.pressTarget) {
  10058. case PressType.powerNode:
  10059. this.ui.powerNode.value = 0;
  10060. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10061. this.ui.powerTxt.text = "";
  10062. if (this.powerNum > 0) {
  10063. xGame.eventMgr.event(BALL_SHOOT);
  10064. xGame.common.d2World.shoot(this.powerNum);
  10065. xGame.common.d2World.d2Gan.shoot();
  10066. xGame.common.d2World.d2HelpLine.shoot();
  10067. this.finishGuide();
  10068. this.ui.powerEft.visible = false;
  10069. this.ui.colorNode.visible = false;
  10070. let ganStr = "";
  10071. if (this.powerNum <= 30) {
  10072. ganStr = "gan_30";
  10073. }
  10074. else if (this.powerNum <= 60) {
  10075. ganStr = "gan_50";
  10076. }
  10077. else {
  10078. ganStr = "gan_80";
  10079. }
  10080. xGame.soundMgr.playSound(ganStr);
  10081. }
  10082. break;
  10083. case PressType.moveNode:
  10084. let rootBall = xGame.common.d2World.rootBall;
  10085. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10086. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10087. let isIntersect = this.judgeBallIntersect();
  10088. if (isIntersect) {
  10089. this.ui.moveNode.x = lastX;
  10090. this.ui.moveNode.y = lastY;
  10091. rootBall.gameObj.x = lastX;
  10092. rootBall.gameObj.y = lastY;
  10093. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10094. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10095. }
  10096. else {
  10097. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10098. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10099. }
  10100. this.showBallUI();
  10101. this.ui.moveNode.finger.visible = true;
  10102. xGame.common.d2World.getHelpLine();
  10103. break;
  10104. case PressType.rulerNode:
  10105. break;
  10106. case PressType.d2Root:
  10107. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10108. if (dis <= 25) {
  10109. this.moveToClickDot(e);
  10110. }
  10111. break;
  10112. default:
  10113. break;
  10114. }
  10115. this.pressTarget = -1;
  10116. }
  10117. checkGuide() {
  10118. let guide = DataMgr.getSkillGuide();
  10119. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10120. xGame.common.guideStep++;
  10121. xGame.common.gameUI.ui.guide2.visible = false;
  10122. xGame.common.gameUI.ui.guide3.visible = true;
  10123. }
  10124. }
  10125. finishGuide() {
  10126. let guide = DataMgr.getSkillGuide();
  10127. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10128. xGame.common.guideStep = 10;
  10129. this.closeAllGuide();
  10130. }
  10131. }
  10132. closeAllGuide() {
  10133. xGame.common.gameUI.ui.guide1.visible = false;
  10134. xGame.common.gameUI.ui.guide2.visible = false;
  10135. xGame.common.gameUI.ui.guide3.visible = false;
  10136. }
  10137. updateBarInfo() {
  10138. let star = this.ui.powerNode.y;
  10139. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10140. if (rate >= 1)
  10141. rate = 1;
  10142. if (rate <= 0)
  10143. rate = 0;
  10144. this.powerNum = Math.ceil(rate * 100);
  10145. this.ui.powerNode.value = this.powerNum;
  10146. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10147. this.ui.colorNode.value = this.powerNum;
  10148. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10149. this.ui.powerEft.visible = this.powerNum != 0;
  10150. this.ui.colorNode.visible = this.powerNum != 0;
  10151. this.ui.powerTxt.text = this.powerNum + "";
  10152. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10153. }
  10154. forceCancel() {
  10155. this.ui.powerNode.value = 0;
  10156. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10157. this.ui.powerTxt.text = "";
  10158. }
  10159. checkRodMoveDir() {
  10160. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10161. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10162. if (tempX >= 0 && tempY <= 0) {
  10163. return this.checkDir();
  10164. }
  10165. else if (tempX < 0 && tempY < 0) {
  10166. return this.checkDir(1, -1);
  10167. }
  10168. else if (tempX < 0 && tempY > 0) {
  10169. return this.checkDir(-1, -1);
  10170. }
  10171. else {
  10172. return this.checkDir(-1, 1);
  10173. }
  10174. }
  10175. checkDir(flagX = 1, flagY = 1) {
  10176. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10177. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10178. if (offsetY == 0) {
  10179. return offsetX * flagX;
  10180. }
  10181. if (offsetX == 0) {
  10182. return offsetY * flagY;
  10183. }
  10184. let angle = offsetY / offsetX;
  10185. if (Math.abs(angle) >= 1) {
  10186. return offsetY * flagY;
  10187. }
  10188. else {
  10189. return offsetX * flagX;
  10190. }
  10191. }
  10192. judgeBallIntersect() {
  10193. let rootBall = xGame.common.d2World.rootBall;
  10194. let ballArr = xGame.common.d2World.ballArr;
  10195. let radius = rootBall.gameObj.width / 2;
  10196. let temp;
  10197. let isIntersect = false;
  10198. for (let index = 0; index < ballArr.length; index++) {
  10199. temp = ballArr[index];
  10200. if (temp.number == rootBall.number)
  10201. continue;
  10202. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10203. if (isIntersect) {
  10204. break;
  10205. }
  10206. }
  10207. return isIntersect;
  10208. }
  10209. hideBallUI() {
  10210. let d2Gan = xGame.common.d2World.d2Gan;
  10211. if (!d2Gan.ui.isDisposed)
  10212. d2Gan.ui.visible = false;
  10213. let d2Help = xGame.common.d2World.d2HelpLine;
  10214. if (!d2Help.ui.isDisposed)
  10215. d2Help.ui.visible = false;
  10216. let rootBall = xGame.common.d2World.rootBall;
  10217. if (!rootBall.destroyed) {
  10218. rootBall.gameObj.active = false;
  10219. }
  10220. }
  10221. showBallUI() {
  10222. let d2Gan = xGame.common.d2World.d2Gan;
  10223. if (!d2Gan.ui.isDisposed)
  10224. d2Gan.ui.visible = true;
  10225. let d2Help = xGame.common.d2World.d2HelpLine;
  10226. if (!d2Help.ui.isDisposed)
  10227. d2Help.ui.visible = true;
  10228. let rootBall = xGame.common.d2World.rootBall;
  10229. if (!rootBall.destroyed) {
  10230. rootBall.gameObj.active = true;
  10231. }
  10232. }
  10233. moveToClickDot(e) {
  10234. if (!this.isMoveRod && !xGame.common.clickedBall) {
  10235. let root = xGame.common.d2World.rootBall.gameObj;
  10236. let xx = e.stageX - xGame.common.sysOffestNum;
  10237. let yy = e.stageY;
  10238. let x = xx - root.x;
  10239. let y = yy - root.y;
  10240. let angle = xGame.common.getfguiRotation(x, y);
  10241. xGame.common.d2World.d2Gan.ui.rotation = angle;
  10242. xGame.common.d2World.getHelpLine();
  10243. }
  10244. this.isMoveRod = false;
  10245. xGame.common.clickedBall = false;
  10246. }
  10247. openAllEvent() {
  10248. this.closeAllEvent();
  10249. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10250. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10251. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10252. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10253. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10254. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10255. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10256. }
  10257. closeAllEvent() {
  10258. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10259. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10260. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10261. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10262. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10263. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10264. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10265. }
  10266. resetGame() {
  10267. this.closeAllEvent();
  10268. this.hideBallUI();
  10269. xGame.common.gameMgr.gamePause = true;
  10270. }
  10271. }
  10272. UIGame.uiName = "UIGame";
  10273. class UIAddProp extends UIBase {
  10274. constructor() {
  10275. super();
  10276. this.curType = "";
  10277. }
  10278. onConstructor() {
  10279. this.ui = ui_UIAddProp.createInstance();
  10280. this.contentPane = this.ui;
  10281. this.isEject = false;
  10282. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  10283. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  10284. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  10285. this.updateUI();
  10286. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  10287. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  10288. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  10289. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  10290. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  10291. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  10292. }
  10293. show(type) {
  10294. super.show();
  10295. this.curType = type == 0 ? "coin" : "diamond";
  10296. this.switchBtn("");
  10297. this.ui.t0.play();
  10298. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  10299. PlatMgr.showInsert(true);
  10300. }
  10301. closeSelf() {
  10302. this.hide();
  10303. }
  10304. updateUI() {
  10305. let data = cfgTable.moneyData;
  10306. let temp;
  10307. let obj;
  10308. for (const key in data) {
  10309. temp = data[key];
  10310. obj = this.ui.myNode["node" + key];
  10311. if (parseInt(key) <= 2) {
  10312. obj.diamondTxt.text = "+" + temp.num;
  10313. }
  10314. else {
  10315. obj.coinTxt.text = temp.num;
  10316. obj.diamondTxt.text = temp.get.split('_')[1];
  10317. }
  10318. }
  10319. this.updateDiamondShare();
  10320. }
  10321. updateDiamondShare() {
  10322. let data = DataMgr.getShareDiamondTimes();
  10323. if (data >= xGame.common.maxShareDiamondTimes) {
  10324. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  10325. this.ui.myNode.node1.touchable = false;
  10326. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10327. }
  10328. else {
  10329. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  10330. this.ui.myNode.node1.touchable = true;
  10331. }
  10332. }
  10333. switchBtn(type) {
  10334. if (type == "")
  10335. type = this.curType;
  10336. else {
  10337. if (this.curType == type) {
  10338. return;
  10339. }
  10340. else {
  10341. this.curType = type;
  10342. }
  10343. }
  10344. if (type == "coin") {
  10345. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  10346. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  10347. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  10348. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  10349. this.ui.myNode.c1.selectedIndex = 0;
  10350. }
  10351. else {
  10352. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  10353. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  10354. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  10355. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  10356. this.ui.myNode.c1.selectedIndex = 1;
  10357. }
  10358. }
  10359. convertCoin(index) {
  10360. let data = cfgTable.moneyData[index];
  10361. let coinNum = data.num;
  10362. let str = data.get.split('_')[1];
  10363. let needDiamond = parseInt(str);
  10364. if (DataMgr.diamondEnough(needDiamond)) {
  10365. DataMgr.setDiamond(-needDiamond);
  10366. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  10367. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  10368. }
  10369. else {
  10370. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  10371. this.switchBtn("diamond");
  10372. }
  10373. }
  10374. videoGetDiamond() {
  10375. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  10376. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  10377. }
  10378. else {
  10379. console.log('zh:AD 失败,直接发放奖励');
  10380. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  10381. }
  10382. }
  10383. qjff_AD_for_uiAddProp_videoGetDiamond() {
  10384. let num = cfgTable.moneyData[2].num;
  10385. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10386. this.closeSelf();
  10387. }
  10388. videoGetCoin() {
  10389. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  10390. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  10391. }
  10392. else {
  10393. console.log('zh:AD 失败,直接发放奖励');
  10394. this.qjff_AD_for_uiAddProp_videoGetCoin();
  10395. }
  10396. }
  10397. qjff_AD_for_uiAddProp_videoGetCoin() {
  10398. xGame.common.playObjFlyAnim(2000, Prop.coin);
  10399. this.closeSelf();
  10400. }
  10401. shareGetDiamond() {
  10402. let times = DataMgr.getShareDiamondTimes();
  10403. if (times >= xGame.common.maxShareDiamondTimes) {
  10404. console.log('zh: 233333333333 maxShareDiamondTimes');
  10405. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10406. }
  10407. else {
  10408. console.log('zh:33333333333333ad');
  10409. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  10410. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  10411. }
  10412. else {
  10413. console.log('zh:AD 失败,直接发放奖励');
  10414. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  10415. }
  10416. }
  10417. }
  10418. qjff_AD_for_uiAddProp_shareGetDiamond() {
  10419. let diamond = xGame.common.randomNum(50, 100);
  10420. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  10421. DataMgr.setShareDiamondTimes(1);
  10422. this.updateDiamondShare();
  10423. }
  10424. openPutBallView() {
  10425. let end = xGame.uiMgr.getUI(UIGameEnd);
  10426. let skill = xGame.uiMgr.getUI(UISkill);
  10427. let level = xGame.uiMgr.getUI(UILevelDisplay);
  10428. let uigame = xGame.uiMgr.getUI(UIGame);
  10429. if (end && !end.isHide) {
  10430. xGame.uiMgr.Hide(UIGameEnd);
  10431. xGame.uiMgr.Show(UIMain);
  10432. }
  10433. if (skill && !skill.isHide)
  10434. xGame.uiMgr.Hide(UISkill);
  10435. if (uigame && !uigame.isHide)
  10436. xGame.uiMgr.Hide(UIGame);
  10437. if (level && !level.isHide) {
  10438. }
  10439. else {
  10440. xGame.uiMgr.Show(UILevelDisplay);
  10441. }
  10442. this.closeSelf();
  10443. }
  10444. }
  10445. UIAddProp.uiName = "UIAddProp";
  10446. class MoneyNode {
  10447. constructor(ui) {
  10448. this.leftTime = 0;
  10449. this.ui = ui;
  10450. this.ui.addCoinBtn.onClick(this, this.addCoin);
  10451. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  10452. this.ui.addPowerBtn.onClick(this, this.addPower);
  10453. this.ui.c1.selectedIndex = 1;
  10454. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  10455. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  10456. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  10457. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10458. this.coinChange();
  10459. this.diamondChange();
  10460. this.powerChange();
  10461. }
  10462. addPower() {
  10463. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10464. xGame.uiMgr.Show(UIPower);
  10465. }
  10466. powerChange() {
  10467. let powerNum = DataMgr.getPower();
  10468. this.ui.powerTxt.text = powerNum + "";
  10469. }
  10470. checkPowerTime() {
  10471. let cur = new Date().getTime();
  10472. let last = DataMgr.getPowerTime();
  10473. if (last == 0) {
  10474. last = cur;
  10475. DataMgr.setPowerTime(cur);
  10476. }
  10477. let power = DataMgr.getPower();
  10478. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10479. Laya.timer.clearAll(this);
  10480. if (power >= xGame.common.natureMaxPower) {
  10481. this.ui.powerTimeTxt.text = "";
  10482. DataMgr.setPowerTime(cur);
  10483. return;
  10484. }
  10485. if (power + offset >= xGame.common.natureMaxPower) {
  10486. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10487. this.ui.powerTimeTxt.text = "";
  10488. DataMgr.setPowerTime(cur);
  10489. }
  10490. else {
  10491. if (offset > 0) {
  10492. DataMgr.setPower(offset);
  10493. DataMgr.setPowerTime(cur);
  10494. }
  10495. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10496. this.leftTime = xGame.common.powerRecoverNum - time;
  10497. if (this.leftTime <= 0)
  10498. this.leftTime = 0;
  10499. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10500. Laya.timer.loop(1000, this, this.updatePowerTime);
  10501. }
  10502. }
  10503. updatePowerTime() {
  10504. this.leftTime -= 1;
  10505. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10506. if (this.leftTime <= 0) {
  10507. this.checkPowerTime();
  10508. }
  10509. }
  10510. coinChange() {
  10511. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10512. }
  10513. diamondChange() {
  10514. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10515. }
  10516. addCoin() {
  10517. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10518. Moyu.sendDataEvent("AddCoinBtn");
  10519. xGame.uiMgr.Show(UIAddProp, 0);
  10520. }
  10521. addDiamond() {
  10522. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10523. Moyu.sendDataEvent("AddDiamondBtn");
  10524. xGame.uiMgr.Show(UIAddProp, 1);
  10525. }
  10526. }
  10527. class UIDraw extends UIBase {
  10528. constructor() {
  10529. super();
  10530. this.curKey = 0;
  10531. }
  10532. onConstructor() {
  10533. this.ui = ui_UIDraw.createInstance();
  10534. this.contentPane = this.ui;
  10535. this.isEject = false;
  10536. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10537. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10538. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10539. this.initDraw();
  10540. this.initUI();
  10541. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10542. if (Moyu.isKs)
  10543. this.ui.closeNode.closeBtn.x += 100;
  10544. }
  10545. show() {
  10546. super.show();
  10547. this.ui.t0.play();
  10548. this.playSecretaryIdle();
  10549. this.updateDraw();
  10550. this.checkFree();
  10551. if (PlatMgr.bannerDelay > 0) {
  10552. this.ui.closeNode.closeBtn.visible = false;
  10553. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10554. this.ui.closeNode.closeBtn.visible = true;
  10555. });
  10556. }
  10557. PlatMgr.showRateBanner();
  10558. }
  10559. hide() {
  10560. Laya.timer.clearAll(this);
  10561. super.hide();
  10562. }
  10563. checkFree() {
  10564. let isFree = DataMgr.getDailyfreeDrawTimes();
  10565. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10566. }
  10567. initDraw() {
  10568. this.drawObj = [];
  10569. let data = cfgTable.drawData;
  10570. let temp;
  10571. let weight = 0;
  10572. for (const key in data) {
  10573. temp = data[key];
  10574. weight += temp.weight;
  10575. this.drawObj.push(weight);
  10576. }
  10577. this.allWeight = weight;
  10578. }
  10579. initUI() {
  10580. let data = cfgTable.drawData;
  10581. let temp;
  10582. let img;
  10583. let txt;
  10584. for (const key in data) {
  10585. temp = data[key];
  10586. img = this.ui.myNode.rotNode["img" + key];
  10587. txt = this.ui.myNode.rotNode["txt" + key];
  10588. img.url = xGame.common.getGameIconUrl(temp.icon);
  10589. txt.visible = true;
  10590. if (temp.award > 2) {
  10591. img.rotation = 0;
  10592. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10593. }
  10594. else {
  10595. img.rotation = temp.rotation;
  10596. txt.text = temp.num;
  10597. }
  10598. }
  10599. }
  10600. getCurkey() {
  10601. let rand = Math.random() * this.allWeight;
  10602. let temp;
  10603. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10604. temp = this.drawObj[index];
  10605. if (index == 0) {
  10606. if (rand < temp) {
  10607. return index + 1;
  10608. }
  10609. }
  10610. else {
  10611. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10612. return index + 1;
  10613. }
  10614. }
  10615. }
  10616. return 2;
  10617. }
  10618. startDraw() {
  10619. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10620. if (freeTimes > 0) {
  10621. this.beginDraw();
  10622. DataMgr.setDailyfreeDrawTimes(0);
  10623. this.checkFree();
  10624. }
  10625. else {
  10626. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  10627. }
  10628. else {
  10629. console.log('zh:AD 失败,直接发放奖励');
  10630. this.qjff_chouJiang();
  10631. }
  10632. }
  10633. }
  10634. qjff_chouJiang() {
  10635. this.beginDraw();
  10636. }
  10637. beginDraw() {
  10638. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10639. this.ui.drawBtn.touchable = false;
  10640. this.curKey = this.getCurkey();
  10641. console.log("当前key", this.curKey);
  10642. let cell = 60;
  10643. let lap = 3;
  10644. let angle = cell * (this.curKey - 1) + lap * 360;
  10645. let target = this.ui.myNode.rotNode;
  10646. target.rotation = 0;
  10647. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10648. console.log("旋转完成");
  10649. this.ui.drawBtn.touchable = true;
  10650. this.getAward();
  10651. }));
  10652. }
  10653. getAward() {
  10654. let data = cfgTable.drawData[this.curKey];
  10655. let temp = new AwardType();
  10656. temp.type = data.award;
  10657. temp.num = data.num;
  10658. xGame.common.getAward([temp], () => {
  10659. DataMgr.setDrawTimes(1);
  10660. this.updateDraw();
  10661. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10662. });
  10663. }
  10664. updateDraw() {
  10665. let drawTimes = DataMgr.getDrawTimes();
  10666. let awardTimes = DataMgr.getDrawAwardTimes();
  10667. if (Math.floor(drawTimes / 3) > awardTimes) {
  10668. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10669. this.ui.extraNode.boxBtn.touchable = true;
  10670. this.ui.extraNode.tipsTxt.text = "3/3";
  10671. this.ui.extraNode.barNode.width = 265;
  10672. this.getExtraAward();
  10673. }
  10674. else {
  10675. this.ui.extraNode.boxBtn.t0.stop();
  10676. this.ui.extraNode.boxBtn.touchable = false;
  10677. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10678. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10679. }
  10680. let data = cfgTable.drawData[1];
  10681. if (awardTimes == 0) {
  10682. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10683. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10684. this.ui.myNode.rotNode.img1.rotation = 0;
  10685. }
  10686. else {
  10687. let award = data.nextid;
  10688. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10689. this.ui.myNode.rotNode.txt1.text = award[1];
  10690. this.ui.myNode.rotNode.img1.rotation = 0;
  10691. }
  10692. }
  10693. getExtraAward() {
  10694. let drawTimes = DataMgr.getDrawTimes();
  10695. let awardTimes = DataMgr.getDrawAwardTimes();
  10696. let data = cfgTable.drawData[1];
  10697. let award = new AwardType();
  10698. if (awardTimes == 0) {
  10699. award.num = data.num;
  10700. award.type = data.award;
  10701. xGame.common.getAward([award], () => {
  10702. let all = Math.floor(drawTimes / 3);
  10703. DataMgr.setDrawAwardTimes(all);
  10704. this.updateDraw();
  10705. });
  10706. }
  10707. else {
  10708. award.num = parseInt(data.nextid[1]);
  10709. award.type = parseInt(data.nextid[0]);
  10710. xGame.common.getAward([award], () => {
  10711. let all = Math.floor(drawTimes / 3);
  10712. DataMgr.setDrawAwardTimes(all);
  10713. this.updateDraw();
  10714. });
  10715. }
  10716. }
  10717. closeSelf() {
  10718. this.hide();
  10719. }
  10720. playSecretaryIdle() {
  10721. let parent = this.ui.secretary.displayObject;
  10722. parent.destroyChildren();
  10723. let xx = this.ui.secretary.width / 2;
  10724. let yy = this.ui.secretary.height;
  10725. let scale = xGame.common.getSecretaryScale();
  10726. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10727. xGame.common.secretary.play(data, 0, true, parent);
  10728. }
  10729. }
  10730. UIDraw.uiName = "UIDraw";
  10731. class ui_UIFlyEft extends fgui.GComponent {
  10732. static createInstance() {
  10733. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10734. }
  10735. onConstruct() {
  10736. this.n0 = (this.getChild("n0"));
  10737. this.n1 = (this.getChild("n1"));
  10738. this.n2 = (this.getChild("n2"));
  10739. this.n3 = (this.getChild("n3"));
  10740. this.n4 = (this.getChild("n4"));
  10741. this.n5 = (this.getChild("n5"));
  10742. this.n6 = (this.getChild("n6"));
  10743. this.n7 = (this.getChild("n7"));
  10744. this.iconNode = (this.getChild("iconNode"));
  10745. this.txt = (this.getChild("txt"));
  10746. this.txtNode = (this.getChild("txtNode"));
  10747. }
  10748. }
  10749. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10750. class UIFlyEft extends UIBase {
  10751. constructor() {
  10752. super();
  10753. this.max = 8;
  10754. this.delay = 0;
  10755. }
  10756. onConstructor() {
  10757. this.ui = ui_UIFlyEft.createInstance();
  10758. this.contentPane = this.ui;
  10759. this.isEject = false;
  10760. this.isMuti = true;
  10761. this.ui.x += xGame.common.sysOffestNum;
  10762. }
  10763. getArrPos() {
  10764. if (this.iconPos && this.iconPos.length > 0)
  10765. return;
  10766. this.iconPos = [];
  10767. let temp;
  10768. for (let index = 0; index < this.max; index++) {
  10769. temp = this.ui["n" + index];
  10770. this.iconPos.push([temp.x, temp.y]);
  10771. }
  10772. }
  10773. show(stPos, edPos, num, type, callback) {
  10774. super.show();
  10775. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10776. this.getArrPos();
  10777. this.updateUI(type);
  10778. this.updatePos();
  10779. this.runFly(edPos, callback);
  10780. this.runWorlds(stPos, num);
  10781. }
  10782. updateUI(type) {
  10783. let temp;
  10784. let str;
  10785. for (let index = 0; index < this.max; index++) {
  10786. temp = this.ui["n" + index];
  10787. str = this.getIconStr(type);
  10788. temp.url = xGame.common.getGameIconUrl(str);
  10789. }
  10790. }
  10791. getIconStr(type) {
  10792. switch (type) {
  10793. case Prop.diamond:
  10794. return "ty_zs";
  10795. case Prop.coin:
  10796. return "ty_jb";
  10797. default:
  10798. break;
  10799. }
  10800. }
  10801. updatePos() {
  10802. let temp;
  10803. for (let index = 0; index < this.max; index++) {
  10804. temp = this.ui["n" + index];
  10805. temp.x = this.iconPos[index][0];
  10806. temp.y = this.iconPos[index][1];
  10807. }
  10808. }
  10809. runFly(endPos, callback) {
  10810. let all = 0;
  10811. let temp;
  10812. for (let index = 0; index < this.max; index++) {
  10813. temp = this.ui["n" + index];
  10814. temp.visible = true;
  10815. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10816. temp.visible = false;
  10817. all++;
  10818. if (all >= this.max) {
  10819. callback && callback();
  10820. }
  10821. }), 20 * index);
  10822. }
  10823. }
  10824. runWorlds(stPos, num) {
  10825. let str = "+" + num;
  10826. this.ui.txt.text = str;
  10827. let starX = stPos.x;
  10828. let starY = stPos.y + 50;
  10829. this.ui.txt.x = starX;
  10830. this.ui.txt.y = starY;
  10831. this.ui.txt.visible = true;
  10832. this.ui.txt.alpha = 1;
  10833. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10834. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10835. this.ui.txt.visible = false;
  10836. this.hide();
  10837. }));
  10838. }));
  10839. }
  10840. }
  10841. UIFlyEft.uiName = "UIFlyEft";
  10842. class Common {
  10843. constructor() {
  10844. this.convertNum = 0.025;
  10845. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10846. this.scaleV3One = new Laya.Vector3();
  10847. this.scaleV3Two = new Laya.Vector3();
  10848. this.posV4 = new Laya.Vector4();
  10849. this.showDebug = false;
  10850. this.openGuide = true;
  10851. this.rodOffest = new Laya.Vector2(0, 0);
  10852. this.rodAngle = 0;
  10853. this.gameMode = GameMode.classic;
  10854. this.bigMoveLevelIndex = 1;
  10855. this.bigMoveNeedCoin = 1000;
  10856. this.classicNiceNeddCoin = 1000;
  10857. this.passAwardCoin = 2000;
  10858. this.classicRoomType = 1;
  10859. this.maxPower = 20;
  10860. this.natureMaxPower = 5;
  10861. this.videoPower = 2;
  10862. this.powerRecoverNum = 900;
  10863. this.curPlayerSkillType = 0;
  10864. this.isNewDay = false;
  10865. this.clickedBall = false;
  10866. this.placeBallCurLevel = 0;
  10867. this.placeBallStarNum = 0;
  10868. this.longHelpLine = false;
  10869. this.maxShareDiamondTimes = 3;
  10870. this.guideStep = 0;
  10871. this.temSelfLevel = 0;
  10872. this.extraMoveNum = 0;
  10873. this.curRankID = 0;
  10874. this.rankID = {
  10875. normalStar: 12000,
  10876. wxStar: 12001
  10877. };
  10878. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  10879. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  10880. this.btnClickStr = "buttonclick";
  10881. this.maxSkillLevel = 10;
  10882. this.upSkillLevel = false;
  10883. this.gameStartTime = 0;
  10884. this._sysOffestNum = 0;
  10885. this.angleV2 = new Laya.Vector2();
  10886. this.rootV = new Laya.Vector2(0, 1);
  10887. this.tempDir1 = new Laya.Vector2();
  10888. this.tempDir2 = new Laya.Vector2();
  10889. this.ballSize = 33;
  10890. this.stPos = new Laya.Point();
  10891. this.edPos = new Laya.Point();
  10892. Common._instance = this;
  10893. window["common"] = this;
  10894. }
  10895. static getInstance() {
  10896. if (!this._instance) {
  10897. this._instance = new Common();
  10898. }
  10899. return this._instance;
  10900. }
  10901. get sysOffestNum() {
  10902. if (this._sysOffestNum == 0) {
  10903. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10904. }
  10905. return this._sysOffestNum;
  10906. }
  10907. testShader() {
  10908. let test = new LightShader();
  10909. test.texture = "res/d3Res/ballTexture/ball1.png";
  10910. Laya.stage.addChild(test);
  10911. }
  10912. playScale(node) {
  10913. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10914. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10915. }));
  10916. }));
  10917. }
  10918. setGroup(colli, ...group) {
  10919. let out = 0;
  10920. for (let index = 0; index < group.length; index++) {
  10921. if (index == 0) {
  10922. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10923. }
  10924. else {
  10925. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10926. }
  10927. }
  10928. colli.collisionGroup = out;
  10929. }
  10930. setCanGroupWith(colli, ...group) {
  10931. let out = 0;
  10932. for (let index = 0; index < group.length; index++) {
  10933. if (index == 0) {
  10934. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10935. }
  10936. else {
  10937. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10938. }
  10939. }
  10940. colli.canCollideWith = out;
  10941. }
  10942. loadPrefab(name, callback) {
  10943. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10944. let prefab = new Laya.Prefab();
  10945. prefab.json = obj;
  10946. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10947. callback && callback(img);
  10948. }));
  10949. }
  10950. pos2to3Convert(x, y, d3Pos) {
  10951. x = x + this.sysOffestNum;
  10952. d3Pos.setValue(x, y, 0);
  10953. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10954. if (success) {
  10955. }
  10956. else {
  10957. console.error("转换出错了。。。。。。。。");
  10958. }
  10959. }
  10960. scale2to3Convert(num) {
  10961. this.scaleV3One.setValue(0, 0, 0);
  10962. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10963. this.scaleV3Two.setValue(0, num, 0);
  10964. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10965. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10966. return outNum;
  10967. }
  10968. pos3to2Convert(d3Pos) {
  10969. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10970. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10971. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10972. d3Pos.x -= this.sysOffestNum;
  10973. }
  10974. scale3to2Convert(num) {
  10975. let scale = this.scale2to3Convert(1);
  10976. let d2Out = num / scale;
  10977. return d2Out;
  10978. }
  10979. getCollider(type, restitution = 0.9, density = 10) {
  10980. let colli;
  10981. if (type == "box")
  10982. colli = new Laya.BoxCollider();
  10983. else
  10984. colli = new Laya.CircleCollider();
  10985. colli.friction = 0;
  10986. colli.restitution = restitution;
  10987. colli.density = density;
  10988. return colli;
  10989. }
  10990. getRigbody() {
  10991. let rigy = new Laya.RigidBody();
  10992. rigy.bullet = true;
  10993. rigy.allowRotation = false;
  10994. rigy.allowSleep = false;
  10995. rigy.gravityScale = 0;
  10996. return rigy;
  10997. }
  10998. getfguiRotation(x, y) {
  10999. this.angleV2.setValue(x, y);
  11000. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11001. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11002. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  11003. angle = -angle;
  11004. }
  11005. return 180 + angle;
  11006. }
  11007. getAngle(x, y) {
  11008. this.angleV2.setValue(x, y);
  11009. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11010. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11011. return angle;
  11012. }
  11013. randomNum(a, b) {
  11014. return a + Math.floor((b - a + 1) * Math.random());
  11015. }
  11016. getRandArrEle(arr) {
  11017. return arr[Math.floor(arr.length * Math.random())];
  11018. }
  11019. getSign(val) {
  11020. return val >= 0 ? 1 : -1;
  11021. }
  11022. botherArr(arr) {
  11023. let times = arr.length + 2;
  11024. let length = arr.length;
  11025. let a;
  11026. let b;
  11027. let temp;
  11028. for (let index = 0; index < times; index++) {
  11029. a = Math.floor(Math.random() * length);
  11030. b = Math.floor(Math.random() * length);
  11031. temp = arr[a];
  11032. arr[a] = arr[b];
  11033. arr[b] = temp;
  11034. }
  11035. }
  11036. getGameIconUrl(id) {
  11037. return "ui://game/" + id;
  11038. }
  11039. getComponentUrl(id) {
  11040. return "ui://game/" + id;
  11041. }
  11042. getAnimation() {
  11043. }
  11044. judgeSkillType(type = SkillType.highSpace) {
  11045. if (this.gameMode == GameMode.classic)
  11046. return;
  11047. let gameMgr = this.gameMgr;
  11048. if (gameMgr.selfTurn) {
  11049. if (gameMgr.selfCurSkill == type) {
  11050. return true;
  11051. }
  11052. }
  11053. else {
  11054. if (gameMgr.aiCurSkill == type) {
  11055. return true;
  11056. }
  11057. }
  11058. }
  11059. ballColliHole(collider) {
  11060. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11061. xGame.common.gameMgr.isFirstInGame = false;
  11062. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11063. }
  11064. collider.owner.mySrc.checkWrongBall();
  11065. }
  11066. getArrMaxEle(arr) {
  11067. let max = -Infinity;
  11068. for (let index = 0; index < arr.length; index++) {
  11069. max = Math.max(arr[index], max);
  11070. }
  11071. return max;
  11072. }
  11073. getArrMinEle(arr) {
  11074. let min = Infinity;
  11075. for (let index = 0; index < arr.length; index++) {
  11076. min = Math.min(arr[index], min);
  11077. }
  11078. return min;
  11079. }
  11080. playRandomMutiBallBigSkillSound() {
  11081. if (Math.random() <= 0.5)
  11082. return;
  11083. let rand = this.randomNum(1, 6);
  11084. let str = "ganfa0" + rand;
  11085. xGame.soundMgr.playSound(str);
  11086. }
  11087. showOneCamera(type) {
  11088. let object = xGame.common.d3World.cameraObj;
  11089. for (const key in object) {
  11090. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11091. object[key].init();
  11092. object[key].owner.active = key == type;
  11093. }
  11094. }
  11095. }
  11096. checkBallOverBorder(x, y) {
  11097. let radius = 17;
  11098. let condition = this._checkBorder(x + radius, y) ||
  11099. this._checkBorder(x - radius, y) ||
  11100. this._checkBorder(x, y + radius) ||
  11101. this._checkBorder(x, y - radius);
  11102. if (condition) {
  11103. return true;
  11104. }
  11105. }
  11106. _checkBorder(x, y) {
  11107. let borderRect = this.d2World.borderRect;
  11108. let xOffest = 20;
  11109. let yOffest = 20;
  11110. if (y <= borderRect.y - yOffest) {
  11111. return true;
  11112. }
  11113. if (y >= borderRect.y + borderRect.height + yOffest) {
  11114. return true;
  11115. }
  11116. if (x <= borderRect.x - xOffest) {
  11117. return true;
  11118. }
  11119. if (x >= borderRect.x + borderRect.width + xOffest) {
  11120. return true;
  11121. }
  11122. }
  11123. initWeight(cfg) {
  11124. let allCfgData = { data: {}, allWeightNum: 0 };
  11125. let weightCfg = allCfgData.data;
  11126. let weight = 0;
  11127. for (const key in cfg) {
  11128. weightCfg[key] = {};
  11129. weightCfg[key].id = cfg[key].id;
  11130. weightCfg[key].minWeight = weight;
  11131. weight += cfg[key].weight;
  11132. weightCfg[key].maxWeight = weight;
  11133. }
  11134. allCfgData.allWeightNum = weight;
  11135. return allCfgData;
  11136. }
  11137. getRandomWeightData(cfg) {
  11138. let weightCfg = cfg.data;
  11139. let allWeightNum = cfg.allWeightNum;
  11140. let rand = Math.floor(Math.random() * allWeightNum);
  11141. for (const key in weightCfg) {
  11142. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11143. return weightCfg[key];
  11144. }
  11145. }
  11146. return weightCfg[1];
  11147. }
  11148. showGirlTalkPop(wordsIndex, node, msgNode) {
  11149. node.visible = true;
  11150. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11151. node.t0.play(Laya.Handler.create(this, () => {
  11152. node.visible = false;
  11153. }));
  11154. }
  11155. stopGirlPop(node) {
  11156. node.t0.stop();
  11157. node.visible = false;
  11158. }
  11159. createHead(loader, url, size = 107) {
  11160. if (Laya.Browser.name == "Browser") {
  11161. loader.url = url;
  11162. return;
  11163. }
  11164. if (Moyu.isTT) {
  11165. let localImage = new Image();
  11166. localImage.src = url;
  11167. localImage.onload = () => {
  11168. let t2d = new Laya.Texture2D();
  11169. t2d.width = size;
  11170. t2d.height = size;
  11171. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  11172. t2d.loadImageSource(localImage);
  11173. };
  11174. }
  11175. else {
  11176. console.log('zh:url=', url);
  11177. loader.url = url;
  11178. }
  11179. }
  11180. addTestCoin(num) {
  11181. DataMgr.setCoin(num);
  11182. }
  11183. addTestDiamond(num) {
  11184. DataMgr.setDiamond(num);
  11185. }
  11186. addTestSkill() {
  11187. DataMgr.setBigSkill(0, 99);
  11188. DataMgr.setBigSkill(1, 99);
  11189. DataMgr.setBigSkill(2, 99);
  11190. }
  11191. playClassicEmotion(number, x, y) {
  11192. if (this.gameMode == GameMode.bigMove)
  11193. return;
  11194. let randIndex = this.randomNum(0, 2);
  11195. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11196. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11197. if (this.gameMgr.selfTurn) {
  11198. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11199. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11200. }
  11201. else {
  11202. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11203. }
  11204. else {
  11205. if (number == this.gameMgr.blackNum) {
  11206. if (this.gameMgr.selfBallArr.length == 0) {
  11207. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11208. }
  11209. else {
  11210. }
  11211. }
  11212. else {
  11213. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11214. }
  11215. }
  11216. }
  11217. }
  11218. else {
  11219. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11220. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11221. }
  11222. else {
  11223. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11224. }
  11225. else {
  11226. if (number == this.gameMgr.blackNum) {
  11227. if (this.gameMgr.aiBallArr.length == 0) {
  11228. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11229. }
  11230. else {
  11231. }
  11232. }
  11233. else {
  11234. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11235. }
  11236. }
  11237. }
  11238. }
  11239. }
  11240. playHappySound(number) {
  11241. if (this.gameMode != GameMode.classic)
  11242. return;
  11243. if (number == 8)
  11244. return;
  11245. let play = false;
  11246. if (this.gameMgr.selfTurn) {
  11247. if (this.gameMgr.ensureBallType) {
  11248. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11249. play = true;
  11250. }
  11251. }
  11252. else {
  11253. play = true;
  11254. }
  11255. }
  11256. else {
  11257. if (this.gameMgr.ensureBallType) {
  11258. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11259. play = true;
  11260. }
  11261. }
  11262. else {
  11263. play = true;
  11264. }
  11265. }
  11266. if (play)
  11267. xGame.soundMgr.playSound("applause");
  11268. }
  11269. destroyClassicEmotion() {
  11270. if (this.gameMode == GameMode.bigMove)
  11271. return;
  11272. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11273. parent.destroyChildren();
  11274. }
  11275. playAwardSpine(x, y) {
  11276. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11277. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11278. this.awardSpine.play(data, 0, false, parent);
  11279. }
  11280. destroyAwardSpine() {
  11281. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11282. parent.destroyChildren();
  11283. }
  11284. isBlock(bx, by, hx, hy, except = null) {
  11285. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  11286. let balls = xGame.common.d2World.ballArr;
  11287. let outArr = [];
  11288. for (let index = 0; index < balls.length; index++) {
  11289. let obj = balls[index];
  11290. if (obj.number == 0)
  11291. continue;
  11292. if (obj == except)
  11293. continue;
  11294. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  11295. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  11296. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  11297. if (num >= 1)
  11298. num = 1;
  11299. if (num < 0)
  11300. continue;
  11301. let gap = Math.sin(Math.acos(num)) * dis;
  11302. if (gap < this.ballSize) {
  11303. outArr.push({
  11304. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  11305. disHon: Math.cos(Math.acos(num)) * dis,
  11306. disVer: Math.sin(Math.acos(num)) * dis,
  11307. src: balls[index],
  11308. dir: this.tempDir1
  11309. });
  11310. }
  11311. }
  11312. if (outArr.length > 0) {
  11313. outArr.sort((a, b) => { return a.dis - b.dis; });
  11314. return outArr[0];
  11315. }
  11316. }
  11317. AngleBetween(vector1, vector2) {
  11318. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  11319. return rad * (180 / Math.PI);
  11320. }
  11321. getSecretaryScale() {
  11322. if (this.secretary.spineName == "mishu") {
  11323. return 1.28;
  11324. }
  11325. else {
  11326. return 1.024;
  11327. }
  11328. }
  11329. signAwardContainsRod(arr) {
  11330. let temp;
  11331. for (let index = 0; index < arr.length; index++) {
  11332. temp = arr[index].split('-')[0];
  11333. if (parseInt(temp) > 2) {
  11334. return true;
  11335. }
  11336. }
  11337. }
  11338. judgeSameDay() {
  11339. let lastTime = DataMgr.getSignTime();
  11340. let curTime = new Date().getTime();
  11341. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  11342. return true;
  11343. }
  11344. return false;
  11345. }
  11346. getAward(arr, callback) {
  11347. let showTriple = arr[0].type <= 2;
  11348. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  11349. let temp;
  11350. for (let index = 0; index < arr.length; index++) {
  11351. temp = arr[index];
  11352. switch (temp.type) {
  11353. case 1:
  11354. this.playObjFlyAnim(temp.num, temp.type);
  11355. break;
  11356. case 2:
  11357. this.playObjFlyAnim(temp.num, temp.type);
  11358. break;
  11359. case 3:
  11360. case 4:
  11361. case 5:
  11362. case 6:
  11363. DataMgr.setBallRod(temp.type - 2, 1);
  11364. DataMgr.setCurBallRod(temp.type - 2);
  11365. break;
  11366. default:
  11367. break;
  11368. }
  11369. }
  11370. callback && callback(watchVideo);
  11371. });
  11372. }
  11373. getMoneyNode() {
  11374. let moneyNode;
  11375. let sign = xGame.uiMgr.getUI(UISign);
  11376. let draw = xGame.uiMgr.getUI(UIDraw);
  11377. let end = xGame.uiMgr.getUI(UIGameEnd);
  11378. let skill = xGame.uiMgr.getUI(UISkill);
  11379. if (sign && !sign.isHide)
  11380. moneyNode = sign.ui.moneyNode;
  11381. if (draw && !draw.isHide)
  11382. moneyNode = draw.ui.moneyNode;
  11383. if (end && !end.isHide)
  11384. moneyNode = end.ui.moneyNode;
  11385. if (skill && !skill.isHide)
  11386. moneyNode = skill.ui.moneyNode;
  11387. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11388. let main = xGame.uiMgr.getUI(UIMain);
  11389. if (condition1 && main && !main.isHide) {
  11390. moneyNode = main.ui.moneyNode;
  11391. }
  11392. return moneyNode;
  11393. }
  11394. playObjFlyAnim(num, type, callback = null) {
  11395. this.stPos.x = Laya.stage.width / 2;
  11396. this.stPos.y = Laya.stage.height / 2;
  11397. let moneyNode = this.getMoneyNode();
  11398. switch (type) {
  11399. case Prop.diamond:
  11400. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11401. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11402. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11403. this.edPos.x /= 2;
  11404. this.edPos.y /= 2;
  11405. break;
  11406. case Prop.coin:
  11407. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11408. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11409. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11410. this.edPos.x /= 2;
  11411. this.edPos.y /= 2;
  11412. break;
  11413. default:
  11414. break;
  11415. }
  11416. xGame.soundMgr.playSound("coinbag");
  11417. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11418. switch (type) {
  11419. case Prop.diamond:
  11420. DataMgr.setDiamond(num);
  11421. break;
  11422. case Prop.coin:
  11423. DataMgr.setCoin(num);
  11424. break;
  11425. default:
  11426. break;
  11427. }
  11428. callback && callback();
  11429. });
  11430. }
  11431. autoPopUIView() {
  11432. let arr = [];
  11433. let sign = this.judgeSameDay() ? false : true;
  11434. if (sign)
  11435. arr.push("sign");
  11436. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11437. if (draw)
  11438. arr.push("draw");
  11439. if (arr.length <= 0)
  11440. return;
  11441. let str = this.getRandArrEle(arr);
  11442. switch (str) {
  11443. case "sign":
  11444. xGame.uiMgr.Show(UISign);
  11445. break;
  11446. case "draw":
  11447. xGame.uiMgr.Show(UIDraw);
  11448. break;
  11449. default:
  11450. break;
  11451. }
  11452. }
  11453. getMSTime(time) {
  11454. let min = Math.floor(time / 60);
  11455. let sec = Math.floor((time - min * 60));
  11456. if (sec < 10)
  11457. sec = "0" + sec;
  11458. if (min < 10)
  11459. min = "0" + min;
  11460. return `${min}:${sec}`;
  11461. }
  11462. testPower() {
  11463. DataMgr.setPower(0, false);
  11464. }
  11465. getAllStarNum() {
  11466. let data = DataMgr.getPlaceBallLevelList();
  11467. let out = 0;
  11468. for (let index = 0; index < data.length; index++) {
  11469. out += data[index].star;
  11470. }
  11471. return out;
  11472. }
  11473. recoverCameraView() {
  11474. Laya.timer.once(900, this, () => {
  11475. xGame.common.showOneCamera("mainCamera");
  11476. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11477. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11478. xGame.common.gameUI.ui.border.alpha = 0;
  11479. if (Laya.physicsTimer.scale < 1) {
  11480. Laya.physicsTimer.scale = 1;
  11481. }
  11482. }
  11483. });
  11484. }
  11485. getClassicLevel() {
  11486. let successTimes = DataMgr.getClassicTimes();
  11487. let needKey = "";
  11488. let lastKey = "";
  11489. let cfg = cfgTable.classictimesData;
  11490. let data;
  11491. for (const key in cfg) {
  11492. data = cfg[key];
  11493. if (successTimes <= data.times) {
  11494. needKey = key;
  11495. }
  11496. lastKey = key;
  11497. }
  11498. if (needKey == "")
  11499. needKey = lastKey;
  11500. return cfg[needKey];
  11501. }
  11502. }
  11503. Common._instance = null;
  11504. class ui_Component92 extends fgui.GComponent {
  11505. static createInstance() {
  11506. return (fgui.UIPackage.createObject("game", "Component92"));
  11507. }
  11508. onConstruct() {
  11509. this.n0 = (this.getChild("n0"));
  11510. }
  11511. }
  11512. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11513. class ui_Component129 extends fgui.GProgressBar {
  11514. static createInstance() {
  11515. return (fgui.UIPackage.createObject("game", "Component129"));
  11516. }
  11517. onConstruct() {
  11518. this.bar_v = (this.getChild("bar_v"));
  11519. this.n84 = (this.getChild("n84"));
  11520. }
  11521. }
  11522. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11523. class ui_Component130 extends fgui.GComponent {
  11524. static createInstance() {
  11525. return (fgui.UIPackage.createObject("game", "Component130"));
  11526. }
  11527. onConstruct() {
  11528. this.ani = (this.getChild("ani"));
  11529. this.t0 = this.getTransition("t0");
  11530. }
  11531. }
  11532. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11533. class ui_powerEft extends fgui.GComponent {
  11534. static createInstance() {
  11535. return (fgui.UIPackage.createObject("game", "powerEft"));
  11536. }
  11537. onConstruct() {
  11538. this.ani = (this.getChild("ani"));
  11539. this.n88 = (this.getChild("n88"));
  11540. this.n89 = (this.getChild("n89"));
  11541. }
  11542. }
  11543. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11544. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11545. static createInstance() {
  11546. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11547. }
  11548. onConstruct() {
  11549. this.c1 = this.getController("c1");
  11550. this.n2 = (this.getChild("n2"));
  11551. this.n22 = (this.getChild("n22"));
  11552. this.n23 = (this.getChild("n23"));
  11553. this.n15 = (this.getChild("n15"));
  11554. this.challenge = (this.getChild("challenge"));
  11555. this.n17 = (this.getChild("n17"));
  11556. this.n3 = (this.getChild("n3"));
  11557. this.starNode = (this.getChild("starNode"));
  11558. this.levelTxt = (this.getChild("levelTxt"));
  11559. this.n14 = (this.getChild("n14"));
  11560. this.n19 = (this.getChild("n19"));
  11561. this.n20 = (this.getChild("n20"));
  11562. this.n21 = (this.getChild("n21"));
  11563. this.special = (this.getChild("special"));
  11564. }
  11565. }
  11566. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11567. class ui_Component79 extends fgui.GComponent {
  11568. static createInstance() {
  11569. return (fgui.UIPackage.createObject("game", "Component79"));
  11570. }
  11571. onConstruct() {
  11572. this.c1 = this.getController("c1");
  11573. this.n7 = (this.getChild("n7"));
  11574. this.n8 = (this.getChild("n8"));
  11575. this.n9 = (this.getChild("n9"));
  11576. this.n10 = (this.getChild("n10"));
  11577. this.n11 = (this.getChild("n11"));
  11578. this.n12 = (this.getChild("n12"));
  11579. }
  11580. }
  11581. ui_Component79.URL = "ui://isxx5ak7avag477";
  11582. class ui_Component80 extends fgui.GComponent {
  11583. static createInstance() {
  11584. return (fgui.UIPackage.createObject("game", "Component80"));
  11585. }
  11586. onConstruct() {
  11587. this.n0 = (this.getChild("n0"));
  11588. this.n1 = (this.getChild("n1"));
  11589. this.myList = (this.getChild("myList"));
  11590. this.t0 = this.getTransition("t0");
  11591. }
  11592. }
  11593. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11594. class ui_SignNormal extends fgui.GComponent {
  11595. static createInstance() {
  11596. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11597. }
  11598. onConstruct() {
  11599. this.c1 = this.getController("c1");
  11600. this.n7 = (this.getChild("n7"));
  11601. this.n15 = (this.getChild("n15"));
  11602. this.titleTxt = (this.getChild("titleTxt"));
  11603. this.n8 = (this.getChild("n8"));
  11604. this.myIcon = (this.getChild("myIcon"));
  11605. this.numTxt = (this.getChild("numTxt"));
  11606. this.n12 = (this.getChild("n12"));
  11607. this.n13 = (this.getChild("n13"));
  11608. this.n17 = (this.getChild("n17"));
  11609. this.n14 = (this.getChild("n14"));
  11610. }
  11611. }
  11612. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11613. class ui_screenNode extends fgui.GComponent {
  11614. static createInstance() {
  11615. return (fgui.UIPackage.createObject("game", "screenNode"));
  11616. }
  11617. onConstruct() {
  11618. this.n9 = (this.getChild("n9"));
  11619. this.screenImg = (this.getChild("screenImg"));
  11620. }
  11621. }
  11622. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11623. class ui_GetAwrad_com1 extends fgui.GComponent {
  11624. static createInstance() {
  11625. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11626. }
  11627. onConstruct() {
  11628. this.n38 = (this.getChild("n38"));
  11629. this.n39 = (this.getChild("n39"));
  11630. this.n40 = (this.getChild("n40"));
  11631. this.t0 = this.getTransition("t0");
  11632. this.t1 = this.getTransition("t1");
  11633. }
  11634. }
  11635. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11636. class ui_GetAwrad_com2 extends fgui.GComponent {
  11637. static createInstance() {
  11638. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11639. }
  11640. onConstruct() {
  11641. this.n39 = (this.getChild("n39"));
  11642. this.n40 = (this.getChild("n40"));
  11643. this.t0 = this.getTransition("t0");
  11644. }
  11645. }
  11646. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11647. class ui_Component128 extends fgui.GComponent {
  11648. static createInstance() {
  11649. return (fgui.UIPackage.createObject("game", "Component128"));
  11650. }
  11651. onConstruct() {
  11652. this.n38 = (this.getChild("n38"));
  11653. this.n40 = (this.getChild("n40"));
  11654. }
  11655. }
  11656. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11657. class ui_Component100_1 extends fgui.GComponent {
  11658. static createInstance() {
  11659. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11660. }
  11661. onConstruct() {
  11662. this.myNode = (this.getChild("myNode"));
  11663. this.t0 = this.getTransition("t0");
  11664. }
  11665. }
  11666. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11667. class ui_Component142 extends fgui.GComponent {
  11668. static createInstance() {
  11669. return (fgui.UIPackage.createObject("game", "Component142"));
  11670. }
  11671. onConstruct() {
  11672. this.n41 = (this.getChild("n41"));
  11673. this.n42 = (this.getChild("n42"));
  11674. }
  11675. }
  11676. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11677. class ui_main_guang extends fgui.GComponent {
  11678. static createInstance() {
  11679. return (fgui.UIPackage.createObject("game", "main_guang"));
  11680. }
  11681. onConstruct() {
  11682. this.n1 = (this.getChild("n1"));
  11683. this.n2 = (this.getChild("n2"));
  11684. this.n3 = (this.getChild("n3"));
  11685. this.n4 = (this.getChild("n4"));
  11686. this.n5 = (this.getChild("n5"));
  11687. this.n6 = (this.getChild("n6"));
  11688. this.n8 = (this.getChild("n8"));
  11689. this.t0 = this.getTransition("t0");
  11690. }
  11691. }
  11692. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11693. class ui_try_com1 extends fgui.GComponent {
  11694. static createInstance() {
  11695. return (fgui.UIPackage.createObject("game", "try_com1"));
  11696. }
  11697. onConstruct() {
  11698. this.c1 = this.getController("c1");
  11699. this.n0 = (this.getChild("n0"));
  11700. this.n2 = (this.getChild("n2"));
  11701. this.cancelBtn = (this.getChild("cancelBtn"));
  11702. this.videoBtn = (this.getChild("videoBtn"));
  11703. this.n9 = (this.getChild("n9"));
  11704. this.n24 = (this.getChild("n24"));
  11705. this.titleTxt = (this.getChild("titleTxt"));
  11706. this.n32 = (this.getChild("n32"));
  11707. this.n29 = (this.getChild("n29"));
  11708. this.n36 = (this.getChild("n36"));
  11709. this.txtTime = (this.getChild("txtTime"));
  11710. this.t0 = this.getTransition("t0");
  11711. }
  11712. }
  11713. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11714. class ui_try_com2 extends fgui.GComponent {
  11715. static createInstance() {
  11716. return (fgui.UIPackage.createObject("game", "try_com2"));
  11717. }
  11718. onConstruct() {
  11719. this.skillicon = (this.getChild("skillicon"));
  11720. this.n35 = (this.getChild("n35"));
  11721. this.n31 = (this.getChild("n31"));
  11722. this.n32 = (this.getChild("n32"));
  11723. this.n33 = (this.getChild("n33"));
  11724. this.n34 = (this.getChild("n34"));
  11725. }
  11726. }
  11727. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11728. class ui_try_com3 extends fgui.GComponent {
  11729. static createInstance() {
  11730. return (fgui.UIPackage.createObject("game", "try_com3"));
  11731. }
  11732. onConstruct() {
  11733. this.n33 = (this.getChild("n33"));
  11734. this.n34 = (this.getChild("n34"));
  11735. this.n35 = (this.getChild("n35"));
  11736. this.t0 = this.getTransition("t0");
  11737. }
  11738. }
  11739. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11740. class ui_huihe1 extends fgui.GComponent {
  11741. static createInstance() {
  11742. return (fgui.UIPackage.createObject("game", "huihe1"));
  11743. }
  11744. onConstruct() {
  11745. this.n0 = (this.getChild("n0"));
  11746. this.n1 = (this.getChild("n1"));
  11747. this.t0 = this.getTransition("t0");
  11748. }
  11749. }
  11750. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11751. class ui_huihe2 extends fgui.GComponent {
  11752. static createInstance() {
  11753. return (fgui.UIPackage.createObject("game", "huihe2"));
  11754. }
  11755. onConstruct() {
  11756. this.n0 = (this.getChild("n0"));
  11757. this.n1 = (this.getChild("n1"));
  11758. this.t0 = this.getTransition("t0");
  11759. }
  11760. }
  11761. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11762. class ui_Component143 extends fgui.GComponent {
  11763. static createInstance() {
  11764. return (fgui.UIPackage.createObject("game", "Component143"));
  11765. }
  11766. onConstruct() {
  11767. this.n3 = (this.getChild("n3"));
  11768. this.n4 = (this.getChild("n4"));
  11769. this.n5 = (this.getChild("n5"));
  11770. this.n6 = (this.getChild("n6"));
  11771. this.n7 = (this.getChild("n7"));
  11772. this.n8 = (this.getChild("n8"));
  11773. this.n9 = (this.getChild("n9"));
  11774. this.n10 = (this.getChild("n10"));
  11775. this.t0 = this.getTransition("t0");
  11776. }
  11777. }
  11778. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11779. class ui_dh_jingbi2 extends fgui.GComponent {
  11780. static createInstance() {
  11781. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11782. }
  11783. onConstruct() {
  11784. this.n0 = (this.getChild("n0"));
  11785. this.n1 = (this.getChild("n1"));
  11786. this.n2 = (this.getChild("n2"));
  11787. this.n3 = (this.getChild("n3"));
  11788. this.n4 = (this.getChild("n4"));
  11789. this.n5 = (this.getChild("n5"));
  11790. this.n6 = (this.getChild("n6"));
  11791. this.n8 = (this.getChild("n8"));
  11792. this.n10 = (this.getChild("n10"));
  11793. this.t0 = this.getTransition("t0");
  11794. }
  11795. }
  11796. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11797. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11798. static createInstance() {
  11799. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11800. }
  11801. onConstruct() {
  11802. this.n1 = (this.getChild("n1"));
  11803. this.n4 = (this.getChild("n4"));
  11804. this.t0 = this.getTransition("t0");
  11805. }
  11806. }
  11807. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11808. class ui_dh_jingbi3 extends fgui.GComponent {
  11809. static createInstance() {
  11810. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11811. }
  11812. onConstruct() {
  11813. this.n0 = (this.getChild("n0"));
  11814. this.n1 = (this.getChild("n1"));
  11815. this.n2 = (this.getChild("n2"));
  11816. this.n3 = (this.getChild("n3"));
  11817. this.n4 = (this.getChild("n4"));
  11818. this.n5 = (this.getChild("n5"));
  11819. this.n6 = (this.getChild("n6"));
  11820. this.n8 = (this.getChild("n8"));
  11821. this.n10 = (this.getChild("n10"));
  11822. this.t0 = this.getTransition("t0");
  11823. }
  11824. }
  11825. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11826. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11827. static createInstance() {
  11828. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11829. }
  11830. onConstruct() {
  11831. this.n3 = (this.getChild("n3"));
  11832. this.n1 = (this.getChild("n1"));
  11833. this.t0 = this.getTransition("t0");
  11834. }
  11835. }
  11836. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11837. class ui_hb_jinbi1 extends fgui.GButton {
  11838. static createInstance() {
  11839. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11840. }
  11841. onConstruct() {
  11842. this.n20 = (this.getChild("n20"));
  11843. this.n25 = (this.getChild("n25"));
  11844. this.coinTxt = (this.getChild("coinTxt"));
  11845. this.n28 = (this.getChild("n28"));
  11846. this.n32 = (this.getChild("n32"));
  11847. this.n38 = (this.getChild("n38"));
  11848. this.n45 = (this.getChild("n45"));
  11849. this.getTips = (this.getChild("getTips"));
  11850. this.n39 = (this.getChild("n39"));
  11851. this.diamondTxt = (this.getChild("diamondTxt"));
  11852. this.n41 = (this.getChild("n41"));
  11853. this.n42 = (this.getChild("n42"));
  11854. this.n46 = (this.getChild("n46"));
  11855. this.n47 = (this.getChild("n47"));
  11856. this.n48 = (this.getChild("n48"));
  11857. this.t0 = this.getTransition("t0");
  11858. }
  11859. }
  11860. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11861. class ui_hb_jinbi2 extends fgui.GButton {
  11862. static createInstance() {
  11863. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11864. }
  11865. onConstruct() {
  11866. this.n20 = (this.getChild("n20"));
  11867. this.n25 = (this.getChild("n25"));
  11868. this.coinTxt = (this.getChild("coinTxt"));
  11869. this.n28 = (this.getChild("n28"));
  11870. this.n32 = (this.getChild("n32"));
  11871. this.n38 = (this.getChild("n38"));
  11872. this.n39 = (this.getChild("n39"));
  11873. this.diamondTxt = (this.getChild("diamondTxt"));
  11874. this.n41 = (this.getChild("n41"));
  11875. this.n42 = (this.getChild("n42"));
  11876. this.n43 = (this.getChild("n43"));
  11877. this.n44 = (this.getChild("n44"));
  11878. this.n45 = (this.getChild("n45"));
  11879. this.t0 = this.getTransition("t0");
  11880. }
  11881. }
  11882. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11883. class ui_hb_jinbi3 extends fgui.GButton {
  11884. static createInstance() {
  11885. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11886. }
  11887. onConstruct() {
  11888. this.n20 = (this.getChild("n20"));
  11889. this.n25 = (this.getChild("n25"));
  11890. this.coinTxt = (this.getChild("coinTxt"));
  11891. this.n28 = (this.getChild("n28"));
  11892. this.n32 = (this.getChild("n32"));
  11893. this.n38 = (this.getChild("n38"));
  11894. this.n39 = (this.getChild("n39"));
  11895. this.diamondTxt = (this.getChild("diamondTxt"));
  11896. this.n41 = (this.getChild("n41"));
  11897. this.n42 = (this.getChild("n42"));
  11898. this.n43 = (this.getChild("n43"));
  11899. this.n44 = (this.getChild("n44"));
  11900. this.n45 = (this.getChild("n45"));
  11901. this.t0 = this.getTransition("t0");
  11902. }
  11903. }
  11904. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11905. class ui_Component104 extends fgui.GComponent {
  11906. static createInstance() {
  11907. return (fgui.UIPackage.createObject("game", "Component104"));
  11908. }
  11909. onConstruct() {
  11910. this.c1 = this.getController("c1");
  11911. this.n12 = (this.getChild("n12"));
  11912. this.coinBtn = (this.getChild("coinBtn"));
  11913. this.diamondBtn = (this.getChild("diamondBtn"));
  11914. this.node3 = (this.getChild("node3"));
  11915. this.node4 = (this.getChild("node4"));
  11916. this.node5 = (this.getChild("node5"));
  11917. this.node1 = (this.getChild("node1"));
  11918. this.node2 = (this.getChild("node2"));
  11919. this.node6 = (this.getChild("node6"));
  11920. this.t0 = this.getTransition("t0");
  11921. }
  11922. }
  11923. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11924. class ui_Component105 extends fgui.GButton {
  11925. static createInstance() {
  11926. return (fgui.UIPackage.createObject("game", "Component105"));
  11927. }
  11928. onConstruct() {
  11929. this.c1 = this.getController("c1");
  11930. this.n49 = (this.getChild("n49"));
  11931. this.n18 = (this.getChild("n18"));
  11932. this.n46 = (this.getChild("n46"));
  11933. this.n48 = (this.getChild("n48"));
  11934. }
  11935. }
  11936. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11937. class ui_Component106 extends fgui.GButton {
  11938. static createInstance() {
  11939. return (fgui.UIPackage.createObject("game", "Component106"));
  11940. }
  11941. onConstruct() {
  11942. this.c1 = this.getController("c1");
  11943. this.n49 = (this.getChild("n49"));
  11944. this.n18 = (this.getChild("n18"));
  11945. this.n46 = (this.getChild("n46"));
  11946. this.n48 = (this.getChild("n48"));
  11947. }
  11948. }
  11949. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11950. class ui_hb_zs1 extends fgui.GButton {
  11951. static createInstance() {
  11952. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11953. }
  11954. onConstruct() {
  11955. this.c1 = this.getController("c1");
  11956. this.n20 = (this.getChild("n20"));
  11957. this.n21 = (this.getChild("n21"));
  11958. this.n26 = (this.getChild("n26"));
  11959. this.n27 = (this.getChild("n27"));
  11960. this.shareTxt = (this.getChild("shareTxt"));
  11961. this.n32 = (this.getChild("n32"));
  11962. this.n38 = (this.getChild("n38"));
  11963. this.n39 = (this.getChild("n39"));
  11964. this.n44 = (this.getChild("n44"));
  11965. this.diamondTxt = (this.getChild("diamondTxt"));
  11966. this.n41 = (this.getChild("n41"));
  11967. this.n45 = (this.getChild("n45"));
  11968. this.n47 = (this.getChild("n47"));
  11969. this.n48 = (this.getChild("n48"));
  11970. this.randTxt = (this.getChild("randTxt"));
  11971. this.n50 = (this.getChild("n50"));
  11972. this.t0 = this.getTransition("t0");
  11973. }
  11974. }
  11975. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11976. class ui_dh_zs1 extends fgui.GComponent {
  11977. static createInstance() {
  11978. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11979. }
  11980. onConstruct() {
  11981. this.n10 = (this.getChild("n10"));
  11982. this.n9 = (this.getChild("n9"));
  11983. this.n1 = (this.getChild("n1"));
  11984. this.n2 = (this.getChild("n2"));
  11985. this.n3 = (this.getChild("n3"));
  11986. this.n4 = (this.getChild("n4"));
  11987. this.n5 = (this.getChild("n5"));
  11988. this.n6 = (this.getChild("n6"));
  11989. this.n8 = (this.getChild("n8"));
  11990. this.n11 = (this.getChild("n11"));
  11991. this.t0 = this.getTransition("t0");
  11992. }
  11993. }
  11994. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11995. class ui_dh_zs1_1 extends fgui.GComponent {
  11996. static createInstance() {
  11997. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11998. }
  11999. onConstruct() {
  12000. this.n3 = (this.getChild("n3"));
  12001. this.n1 = (this.getChild("n1"));
  12002. this.t0 = this.getTransition("t0");
  12003. }
  12004. }
  12005. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  12006. class ui_hb_zs2 extends fgui.GButton {
  12007. static createInstance() {
  12008. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  12009. }
  12010. onConstruct() {
  12011. this.n20 = (this.getChild("n20"));
  12012. this.n21 = (this.getChild("n21"));
  12013. this.n26 = (this.getChild("n26"));
  12014. this.n27 = (this.getChild("n27"));
  12015. this.n32 = (this.getChild("n32"));
  12016. this.n38 = (this.getChild("n38"));
  12017. this.n39 = (this.getChild("n39"));
  12018. this.n44 = (this.getChild("n44"));
  12019. this.diamondTxt = (this.getChild("diamondTxt"));
  12020. this.n41 = (this.getChild("n41"));
  12021. this.n45 = (this.getChild("n45"));
  12022. this.t0 = this.getTransition("t0");
  12023. }
  12024. }
  12025. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  12026. class ui_hb_zs3 extends fgui.GButton {
  12027. static createInstance() {
  12028. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  12029. }
  12030. onConstruct() {
  12031. this.n20 = (this.getChild("n20"));
  12032. this.n21 = (this.getChild("n21"));
  12033. this.n26 = (this.getChild("n26"));
  12034. this.n27 = (this.getChild("n27"));
  12035. this.n32 = (this.getChild("n32"));
  12036. this.n38 = (this.getChild("n38"));
  12037. this.n47 = (this.getChild("n47"));
  12038. this.t0 = this.getTransition("t0");
  12039. }
  12040. }
  12041. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12042. class ui_dh_zs2 extends fgui.GComponent {
  12043. static createInstance() {
  12044. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12045. }
  12046. onConstruct() {
  12047. this.n10 = (this.getChild("n10"));
  12048. this.n9 = (this.getChild("n9"));
  12049. this.n1 = (this.getChild("n1"));
  12050. this.n2 = (this.getChild("n2"));
  12051. this.n3 = (this.getChild("n3"));
  12052. this.n4 = (this.getChild("n4"));
  12053. this.n5 = (this.getChild("n5"));
  12054. this.n6 = (this.getChild("n6"));
  12055. this.n8 = (this.getChild("n8"));
  12056. this.n11 = (this.getChild("n11"));
  12057. this.t0 = this.getTransition("t0");
  12058. }
  12059. }
  12060. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12061. class ui_dh_zs2_1 extends fgui.GComponent {
  12062. static createInstance() {
  12063. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12064. }
  12065. onConstruct() {
  12066. this.n3 = (this.getChild("n3"));
  12067. this.n1 = (this.getChild("n1"));
  12068. this.t0 = this.getTransition("t0");
  12069. }
  12070. }
  12071. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12072. class ui_dh_zs3 extends fgui.GComponent {
  12073. static createInstance() {
  12074. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12075. }
  12076. onConstruct() {
  12077. this.n10 = (this.getChild("n10"));
  12078. this.n9 = (this.getChild("n9"));
  12079. this.n1 = (this.getChild("n1"));
  12080. this.n2 = (this.getChild("n2"));
  12081. this.n3 = (this.getChild("n3"));
  12082. this.n4 = (this.getChild("n4"));
  12083. this.n5 = (this.getChild("n5"));
  12084. this.n6 = (this.getChild("n6"));
  12085. this.n8 = (this.getChild("n8"));
  12086. this.n11 = (this.getChild("n11"));
  12087. this.t0 = this.getTransition("t0");
  12088. }
  12089. }
  12090. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12091. class ui_dh_zs3_1 extends fgui.GComponent {
  12092. static createInstance() {
  12093. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12094. }
  12095. onConstruct() {
  12096. this.n3 = (this.getChild("n3"));
  12097. this.n1 = (this.getChild("n1"));
  12098. this.t0 = this.getTransition("t0");
  12099. }
  12100. }
  12101. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12102. class ui_Component107 extends fgui.GComponent {
  12103. static createInstance() {
  12104. return (fgui.UIPackage.createObject("game", "Component107"));
  12105. }
  12106. onConstruct() {
  12107. this.n18 = (this.getChild("n18"));
  12108. this.n19 = (this.getChild("n19"));
  12109. this.n20 = (this.getChild("n20"));
  12110. this.n21 = (this.getChild("n21"));
  12111. this.n22 = (this.getChild("n22"));
  12112. this.levelTxt = (this.getChild("levelTxt"));
  12113. this.t0 = this.getTransition("t0");
  12114. }
  12115. }
  12116. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12117. class ui_box_com1 extends fgui.GComponent {
  12118. static createInstance() {
  12119. return (fgui.UIPackage.createObject("game", "box_com1"));
  12120. }
  12121. onConstruct() {
  12122. this.n14 = (this.getChild("n14"));
  12123. this.n6 = (this.getChild("n6"));
  12124. this.t0 = this.getTransition("t0");
  12125. }
  12126. }
  12127. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12128. class ui_box_com2 extends fgui.GProgressBar {
  12129. static createInstance() {
  12130. return (fgui.UIPackage.createObject("game", "box_com2"));
  12131. }
  12132. onConstruct() {
  12133. this.bg0 = (this.getChild("bg0"));
  12134. this.bg = (this.getChild("bg"));
  12135. this.bar = (this.getChild("bar"));
  12136. this.n7 = (this.getChild("n7"));
  12137. this.n8 = (this.getChild("n8"));
  12138. this.n10 = (this.getChild("n10"));
  12139. this.n11 = (this.getChild("n11"));
  12140. this.n12 = (this.getChild("n12"));
  12141. }
  12142. }
  12143. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12144. class ui_box_com4 extends fgui.GComponent {
  12145. static createInstance() {
  12146. return (fgui.UIPackage.createObject("game", "box_com4"));
  12147. }
  12148. onConstruct() {
  12149. this.n8 = (this.getChild("n8"));
  12150. this.t0 = this.getTransition("t0");
  12151. }
  12152. }
  12153. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12154. class ui_box_com3 extends fgui.GComponent {
  12155. static createInstance() {
  12156. return (fgui.UIPackage.createObject("game", "box_com3"));
  12157. }
  12158. onConstruct() {
  12159. this.n2 = (this.getChild("n2"));
  12160. this.n3 = (this.getChild("n3"));
  12161. this.n4 = (this.getChild("n4"));
  12162. this.n5 = (this.getChild("n5"));
  12163. this.t0 = this.getTransition("t0");
  12164. this.t1 = this.getTransition("t1");
  12165. }
  12166. }
  12167. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12168. class ui_Component97 extends fgui.GComponent {
  12169. static createInstance() {
  12170. return (fgui.UIPackage.createObject("game", "Component97"));
  12171. }
  12172. onConstruct() {
  12173. this.c1 = this.getController("c1");
  12174. this.n46 = (this.getChild("n46"));
  12175. this.diamondNode = (this.getChild("diamondNode"));
  12176. this.coinNode = (this.getChild("coinNode"));
  12177. this.t0 = this.getTransition("t0");
  12178. }
  12179. }
  12180. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12181. class ui_Component98 extends fgui.GButton {
  12182. static createInstance() {
  12183. return (fgui.UIPackage.createObject("game", "Component98"));
  12184. }
  12185. onConstruct() {
  12186. this.n8 = (this.getChild("n8"));
  12187. this.n40 = (this.getChild("n40"));
  12188. }
  12189. }
  12190. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12191. class ui_Component28_11 extends fgui.GButton {
  12192. static createInstance() {
  12193. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12194. }
  12195. onConstruct() {
  12196. this.c1 = this.getController("c1");
  12197. this.n12 = (this.getChild("n12"));
  12198. this.n17 = (this.getChild("n17"));
  12199. this.n13 = (this.getChild("n13"));
  12200. this.diamondTxt = (this.getChild("diamondTxt"));
  12201. this.n15 = (this.getChild("n15"));
  12202. this.n16 = (this.getChild("n16"));
  12203. }
  12204. }
  12205. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12206. class ui_Component58_11 extends fgui.GComponent {
  12207. static createInstance() {
  12208. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12209. }
  12210. onConstruct() {
  12211. this.n23 = (this.getChild("n23"));
  12212. this.n41 = (this.getChild("n41"));
  12213. this.myList = (this.getChild("myList"));
  12214. this.n45 = (this.getChild("n45"));
  12215. this.n44 = (this.getChild("n44"));
  12216. this.t0 = this.getTransition("t0");
  12217. }
  12218. }
  12219. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12220. class ui_Component100 extends fgui.GComponent {
  12221. static createInstance() {
  12222. return (fgui.UIPackage.createObject("game", "Component100"));
  12223. }
  12224. onConstruct() {
  12225. this.c1 = this.getController("c1");
  12226. this.n75 = (this.getChild("n75"));
  12227. this.n76 = (this.getChild("n76"));
  12228. this.n80 = (this.getChild("n80"));
  12229. this.txt = (this.getChild("txt"));
  12230. this.spineRoot = (this.getChild("spineRoot"));
  12231. }
  12232. }
  12233. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12234. class ui_Component101 extends fgui.GComponent {
  12235. static createInstance() {
  12236. return (fgui.UIPackage.createObject("game", "Component101"));
  12237. }
  12238. onConstruct() {
  12239. this.c1 = this.getController("c1");
  12240. this.n36 = (this.getChild("n36"));
  12241. this.n35 = (this.getChild("n35"));
  12242. this.n33 = (this.getChild("n33"));
  12243. this.n34 = (this.getChild("n34"));
  12244. }
  12245. }
  12246. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12247. class ui_Component53 extends fgui.GComponent {
  12248. static createInstance() {
  12249. return (fgui.UIPackage.createObject("game", "Component53"));
  12250. }
  12251. onConstruct() {
  12252. this.n0 = (this.getChild("n0"));
  12253. this.n1 = (this.getChild("n1"));
  12254. this.n2 = (this.getChild("n2"));
  12255. this.n3 = (this.getChild("n3"));
  12256. this.n4 = (this.getChild("n4"));
  12257. this.n5 = (this.getChild("n5"));
  12258. this.n6 = (this.getChild("n6"));
  12259. this.n7 = (this.getChild("n7"));
  12260. this.n8 = (this.getChild("n8"));
  12261. this.n9 = (this.getChild("n9"));
  12262. this.n10 = (this.getChild("n10"));
  12263. this.n11 = (this.getChild("n11"));
  12264. this.n12 = (this.getChild("n12"));
  12265. this.n13 = (this.getChild("n13"));
  12266. this.n14 = (this.getChild("n14"));
  12267. this.n15 = (this.getChild("n15"));
  12268. this.n16 = (this.getChild("n16"));
  12269. this.n19 = (this.getChild("n19"));
  12270. this.n20 = (this.getChild("n20"));
  12271. this.n21 = (this.getChild("n21"));
  12272. this.n22 = (this.getChild("n22"));
  12273. this.n23 = (this.getChild("n23"));
  12274. this.n24 = (this.getChild("n24"));
  12275. this.n25 = (this.getChild("n25"));
  12276. this.n26 = (this.getChild("n26"));
  12277. this.n27 = (this.getChild("n27"));
  12278. this.n28 = (this.getChild("n28"));
  12279. this.n29 = (this.getChild("n29"));
  12280. this.n30 = (this.getChild("n30"));
  12281. this.n31 = (this.getChild("n31"));
  12282. this.n32 = (this.getChild("n32"));
  12283. this.n33 = (this.getChild("n33"));
  12284. this.n34 = (this.getChild("n34"));
  12285. this.n35 = (this.getChild("n35"));
  12286. this.t0 = this.getTransition("t0");
  12287. }
  12288. }
  12289. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12290. class ui_Component58 extends fgui.GComponent {
  12291. static createInstance() {
  12292. return (fgui.UIPackage.createObject("game", "Component58"));
  12293. }
  12294. onConstruct() {
  12295. this.n23 = (this.getChild("n23"));
  12296. this.n41 = (this.getChild("n41"));
  12297. this.n8 = (this.getChild("n8"));
  12298. this.skillList = (this.getChild("skillList"));
  12299. this.t0 = this.getTransition("t0");
  12300. }
  12301. }
  12302. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12303. class ui_Component59 extends fgui.GComponent {
  12304. static createInstance() {
  12305. return (fgui.UIPackage.createObject("game", "Component59"));
  12306. }
  12307. onConstruct() {
  12308. this.n3 = (this.getChild("n3"));
  12309. this.msgTxt = (this.getChild("msgTxt"));
  12310. this.t0 = this.getTransition("t0");
  12311. }
  12312. }
  12313. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12314. class ui_RulerNode extends fgui.GComponent {
  12315. static createInstance() {
  12316. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12317. }
  12318. onConstruct() {
  12319. this.n6 = (this.getChild("n6"));
  12320. this.n4 = (this.getChild("n4"));
  12321. this.img1 = (this.getChild("img1"));
  12322. this.img2 = (this.getChild("img2"));
  12323. }
  12324. }
  12325. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12326. class ui_Component108 extends fgui.GComponent {
  12327. static createInstance() {
  12328. return (fgui.UIPackage.createObject("game", "Component108"));
  12329. }
  12330. onConstruct() {
  12331. this.n19 = (this.getChild("n19"));
  12332. this.t0 = this.getTransition("t0");
  12333. }
  12334. }
  12335. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12336. class ui_Component63 extends fgui.GComponent {
  12337. static createInstance() {
  12338. return (fgui.UIPackage.createObject("game", "Component63"));
  12339. }
  12340. onConstruct() {
  12341. this.n66 = (this.getChild("n66"));
  12342. this.n56 = (this.getChild("n56"));
  12343. this.n63 = (this.getChild("n63"));
  12344. this.n65 = (this.getChild("n65"));
  12345. this.t0 = this.getTransition("t0");
  12346. }
  12347. }
  12348. ui_Component63.URL = "ui://isxx5ak7h657452";
  12349. class ui_topNode extends fgui.GComponent {
  12350. static createInstance() {
  12351. return (fgui.UIPackage.createObject("game", "topNode"));
  12352. }
  12353. onConstruct() {
  12354. this.selfProgress = (this.getChild("selfProgress"));
  12355. this.aiProgress = (this.getChild("aiProgress"));
  12356. this.selfKuang = (this.getChild("selfKuang"));
  12357. this.aiKuang = (this.getChild("aiKuang"));
  12358. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12359. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12360. this.n33 = (this.getChild("n33"));
  12361. this.n34 = (this.getChild("n34"));
  12362. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12363. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12364. this.selfBallList = (this.getChild("selfBallList"));
  12365. this.aiBallList = (this.getChild("aiBallList"));
  12366. this.middleNode = (this.getChild("middleNode"));
  12367. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12368. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12369. this.scoreNode = (this.getChild("scoreNode"));
  12370. this.selfTips = (this.getChild("selfTips"));
  12371. this.aiTips = (this.getChild("aiTips"));
  12372. }
  12373. }
  12374. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12375. class ui_selfProgress extends fgui.GProgressBar {
  12376. static createInstance() {
  12377. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12378. }
  12379. onConstruct() {
  12380. this.n3 = (this.getChild("n3"));
  12381. this.bar = (this.getChild("bar"));
  12382. }
  12383. }
  12384. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12385. class ui_aiProgress extends fgui.GProgressBar {
  12386. static createInstance() {
  12387. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12388. }
  12389. onConstruct() {
  12390. this.n3 = (this.getChild("n3"));
  12391. this.bar = (this.getChild("bar"));
  12392. }
  12393. }
  12394. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12395. class ui_ballDisplay extends fgui.GComponent {
  12396. static createInstance() {
  12397. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12398. }
  12399. onConstruct() {
  12400. this.myImg = (this.getChild("myImg"));
  12401. }
  12402. }
  12403. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12404. class ui_moveNode extends fgui.GComponent {
  12405. static createInstance() {
  12406. return (fgui.UIPackage.createObject("game", "moveNode"));
  12407. }
  12408. onConstruct() {
  12409. this.n8 = (this.getChild("n8"));
  12410. this.finger = (this.getChild("finger"));
  12411. }
  12412. }
  12413. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12414. class ui_cancelBtn extends fgui.GButton {
  12415. static createInstance() {
  12416. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12417. }
  12418. onConstruct() {
  12419. this.c1 = this.getController("c1");
  12420. this.n0 = (this.getChild("n0"));
  12421. this.n1 = (this.getChild("n1"));
  12422. }
  12423. }
  12424. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12425. class ui_shareBtn extends fgui.GButton {
  12426. static createInstance() {
  12427. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12428. }
  12429. onConstruct() {
  12430. this.c1 = this.getController("c1");
  12431. this.n2 = (this.getChild("n2"));
  12432. this.n1 = (this.getChild("n1"));
  12433. this.n3 = (this.getChild("n3"));
  12434. this.n4 = (this.getChild("n4"));
  12435. this.n5 = (this.getChild("n5"));
  12436. this.n6 = (this.getChild("n6"));
  12437. }
  12438. }
  12439. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12440. class ui_share2Btn extends fgui.GButton {
  12441. static createInstance() {
  12442. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12443. }
  12444. onConstruct() {
  12445. this.n3 = (this.getChild("n3"));
  12446. }
  12447. }
  12448. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12449. class ui_rodMethodNode extends fgui.GComponent {
  12450. static createInstance() {
  12451. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12452. }
  12453. onConstruct() {
  12454. this.bg = (this.getChild("bg"));
  12455. this.dot = (this.getChild("dot"));
  12456. }
  12457. }
  12458. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12459. class ui_sureBtn extends fgui.GButton {
  12460. static createInstance() {
  12461. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12462. }
  12463. onConstruct() {
  12464. this.n2 = (this.getChild("n2"));
  12465. this.n1 = (this.getChild("n1"));
  12466. }
  12467. }
  12468. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12469. class ui_Component18 extends fgui.GComponent {
  12470. static createInstance() {
  12471. return (fgui.UIPackage.createObject("game", "Component18"));
  12472. }
  12473. onConstruct() {
  12474. this.c1 = this.getController("c1");
  12475. this.nameTxt = (this.getChild("nameTxt"));
  12476. this.headImg = (this.getChild("headImg"));
  12477. this.n24 = (this.getChild("n24"));
  12478. this.skillImg = (this.getChild("skillImg"));
  12479. this.skillTxt = (this.getChild("skillTxt"));
  12480. }
  12481. }
  12482. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12483. class ui_Component45 extends fgui.GComponent {
  12484. static createInstance() {
  12485. return (fgui.UIPackage.createObject("game", "Component45"));
  12486. }
  12487. onConstruct() {
  12488. this.c1 = this.getController("c1");
  12489. this.n40 = (this.getChild("n40"));
  12490. this.n41 = (this.getChild("n41"));
  12491. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12492. this.n42 = (this.getChild("n42"));
  12493. this.awardTxt = (this.getChild("awardTxt"));
  12494. this.n44 = (this.getChild("n44"));
  12495. this.t0 = this.getTransition("t0");
  12496. }
  12497. }
  12498. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12499. class ui_emotionDisplay extends fgui.GButton {
  12500. static createInstance() {
  12501. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12502. }
  12503. onConstruct() {
  12504. this.myIcon = (this.getChild("myIcon"));
  12505. }
  12506. }
  12507. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12508. class ui_Component49 extends fgui.GButton {
  12509. static createInstance() {
  12510. return (fgui.UIPackage.createObject("game", "Component49"));
  12511. }
  12512. onConstruct() {
  12513. this.n69 = (this.getChild("n69"));
  12514. this.n56 = (this.getChild("n56"));
  12515. }
  12516. }
  12517. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12518. class ui_Component50 extends fgui.GButton {
  12519. static createInstance() {
  12520. return (fgui.UIPackage.createObject("game", "Component50"));
  12521. }
  12522. onConstruct() {
  12523. this.n54 = (this.getChild("n54"));
  12524. this.n65 = (this.getChild("n65"));
  12525. }
  12526. }
  12527. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12528. class ui_Component51 extends fgui.GButton {
  12529. static createInstance() {
  12530. return (fgui.UIPackage.createObject("game", "Component51"));
  12531. }
  12532. onConstruct() {
  12533. this.c1 = this.getController("c1");
  12534. this.n51 = (this.getChild("n51"));
  12535. this.n54 = (this.getChild("n54"));
  12536. }
  12537. }
  12538. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12539. class ui_Button5 extends fgui.GButton {
  12540. static createInstance() {
  12541. return (fgui.UIPackage.createObject("game", "Button5"));
  12542. }
  12543. onConstruct() {
  12544. this.c1 = this.getController("c1");
  12545. this.n0 = (this.getChild("n0"));
  12546. this.n2 = (this.getChild("n2"));
  12547. }
  12548. }
  12549. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12550. class ui_Component124 extends fgui.GComponent {
  12551. static createInstance() {
  12552. return (fgui.UIPackage.createObject("game", "Component124"));
  12553. }
  12554. onConstruct() {
  12555. this.n22 = (this.getChild("n22"));
  12556. this.shareNode = (this.getChild("shareNode"));
  12557. }
  12558. }
  12559. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12560. class ui_Component125 extends fgui.GComponent {
  12561. static createInstance() {
  12562. return (fgui.UIPackage.createObject("game", "Component125"));
  12563. }
  12564. onConstruct() {
  12565. this.n29 = (this.getChild("n29"));
  12566. this.coinTxt = (this.getChild("coinTxt"));
  12567. }
  12568. }
  12569. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12570. class ui_Component52 extends fgui.GButton {
  12571. static createInstance() {
  12572. return (fgui.UIPackage.createObject("game", "Component52"));
  12573. }
  12574. onConstruct() {
  12575. this.n35 = (this.getChild("n35"));
  12576. this.n36 = (this.getChild("n36"));
  12577. }
  12578. }
  12579. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12580. class ui_drawBtn extends fgui.GButton {
  12581. static createInstance() {
  12582. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12583. }
  12584. onConstruct() {
  12585. this.c1 = this.getController("c1");
  12586. this.n2 = (this.getChild("n2"));
  12587. this.n1 = (this.getChild("n1"));
  12588. this.n5 = (this.getChild("n5"));
  12589. }
  12590. }
  12591. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12592. class ui_Component43 extends fgui.GButton {
  12593. static createInstance() {
  12594. return (fgui.UIPackage.createObject("game", "Component43"));
  12595. }
  12596. onConstruct() {
  12597. this.n49 = (this.getChild("n49"));
  12598. }
  12599. }
  12600. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12601. class ui_wordsDisplay extends fgui.GComponent {
  12602. static createInstance() {
  12603. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12604. }
  12605. onConstruct() {
  12606. this.txt = (this.getChild("txt"));
  12607. this.n63 = (this.getChild("n63"));
  12608. }
  12609. }
  12610. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12611. class ui_Component_phb extends fgui.GComponent {
  12612. static createInstance() {
  12613. return (fgui.UIPackage.createObject("game", "Component_phb"));
  12614. }
  12615. onConstruct() {
  12616. this.n3 = (this.getChild("n3"));
  12617. this.n4 = (this.getChild("n4"));
  12618. }
  12619. }
  12620. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  12621. class ui_Component3 extends fgui.GComponent {
  12622. static createInstance() {
  12623. return (fgui.UIPackage.createObject("game", "Component3"));
  12624. }
  12625. onConstruct() {
  12626. this.n26 = (this.getChild("n26"));
  12627. this.n24 = (this.getChild("n24"));
  12628. this.nameTxt = (this.getChild("nameTxt"));
  12629. this.headRoot = (this.getChild("headRoot"));
  12630. }
  12631. }
  12632. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12633. class ui_Component4 extends fgui.GComponent {
  12634. static createInstance() {
  12635. return (fgui.UIPackage.createObject("game", "Component4"));
  12636. }
  12637. onConstruct() {
  12638. this.headImg = (this.getChild("headImg"));
  12639. }
  12640. }
  12641. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12642. class ui_Component7 extends fgui.GButton {
  12643. static createInstance() {
  12644. return (fgui.UIPackage.createObject("game", "Component7"));
  12645. }
  12646. onConstruct() {
  12647. this.n17 = (this.getChild("n17"));
  12648. }
  12649. }
  12650. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12651. class ui_Component8 extends fgui.GButton {
  12652. static createInstance() {
  12653. return (fgui.UIPackage.createObject("game", "Component8"));
  12654. }
  12655. onConstruct() {
  12656. this.n19 = (this.getChild("n19"));
  12657. }
  12658. }
  12659. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12660. class ui_Component10 extends fgui.GButton {
  12661. static createInstance() {
  12662. return (fgui.UIPackage.createObject("game", "Component10"));
  12663. }
  12664. onConstruct() {
  12665. this.c1 = this.getController("c1");
  12666. this.n40 = (this.getChild("n40"));
  12667. }
  12668. }
  12669. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12670. class ui_Component11 extends fgui.GButton {
  12671. static createInstance() {
  12672. return (fgui.UIPackage.createObject("game", "Component11"));
  12673. }
  12674. onConstruct() {
  12675. this.n34 = (this.getChild("n34"));
  12676. }
  12677. }
  12678. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12679. class ui_Component12 extends fgui.GButton {
  12680. static createInstance() {
  12681. return (fgui.UIPackage.createObject("game", "Component12"));
  12682. }
  12683. onConstruct() {
  12684. this.n35 = (this.getChild("n35"));
  12685. }
  12686. }
  12687. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12688. class ui_Component13 extends fgui.GButton {
  12689. static createInstance() {
  12690. return (fgui.UIPackage.createObject("game", "Component13"));
  12691. }
  12692. onConstruct() {
  12693. this.n27 = (this.getChild("n27"));
  12694. this.n36 = (this.getChild("n36"));
  12695. }
  12696. }
  12697. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12698. class ui_dh_js_tuowei extends fgui.GComponent {
  12699. static createInstance() {
  12700. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12701. }
  12702. onConstruct() {
  12703. this.n19 = (this.getChild("n19"));
  12704. this.n18 = (this.getChild("n18"));
  12705. this.n0 = (this.getChild("n0"));
  12706. this.n3 = (this.getChild("n3"));
  12707. this.n4 = (this.getChild("n4"));
  12708. this.n5 = (this.getChild("n5"));
  12709. this.n6 = (this.getChild("n6"));
  12710. this.n8 = (this.getChild("n8"));
  12711. this.n9 = (this.getChild("n9"));
  12712. this.n10 = (this.getChild("n10"));
  12713. this.n11 = (this.getChild("n11"));
  12714. this.n12 = (this.getChild("n12"));
  12715. this.n13 = (this.getChild("n13"));
  12716. this.n14 = (this.getChild("n14"));
  12717. this.n15 = (this.getChild("n15"));
  12718. this.n20 = (this.getChild("n20"));
  12719. this.t0 = this.getTransition("t0");
  12720. this.t1 = this.getTransition("t1");
  12721. }
  12722. }
  12723. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12724. class ui_dh_js_tw_g extends fgui.GComponent {
  12725. static createInstance() {
  12726. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12727. }
  12728. onConstruct() {
  12729. this.n0 = (this.getChild("n0"));
  12730. this.n1 = (this.getChild("n1"));
  12731. this.t0 = this.getTransition("t0");
  12732. }
  12733. }
  12734. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12735. class ui_dh_js_xingxing extends fgui.GComponent {
  12736. static createInstance() {
  12737. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12738. }
  12739. onConstruct() {
  12740. this.n1 = (this.getChild("n1"));
  12741. this.n2 = (this.getChild("n2"));
  12742. this.n3 = (this.getChild("n3"));
  12743. this.n4 = (this.getChild("n4"));
  12744. this.n0 = (this.getChild("n0"));
  12745. this.t2 = this.getTransition("t2");
  12746. this.t1 = this.getTransition("t1");
  12747. }
  12748. }
  12749. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12750. class ui_dh_zy_jiazai extends fgui.GComponent {
  12751. static createInstance() {
  12752. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12753. }
  12754. onConstruct() {
  12755. this.c1 = this.getController("c1");
  12756. this.n0 = (this.getChild("n0"));
  12757. this.n1 = (this.getChild("n1"));
  12758. this.n2 = (this.getChild("n2"));
  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.n7 = (this.getChild("n7"));
  12764. this.t0 = this.getTransition("t0");
  12765. }
  12766. }
  12767. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12768. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12769. static createInstance() {
  12770. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12771. }
  12772. onConstruct() {
  12773. this.c1 = this.getController("c1");
  12774. this.n3 = (this.getChild("n3"));
  12775. this.n5 = (this.getChild("n5"));
  12776. this.n4 = (this.getChild("n4"));
  12777. this.n0 = (this.getChild("n0"));
  12778. this.n1 = (this.getChild("n1"));
  12779. this.n2 = (this.getChild("n2"));
  12780. }
  12781. }
  12782. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12783. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12784. static createInstance() {
  12785. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12786. }
  12787. onConstruct() {
  12788. this.n19 = (this.getChild("n19"));
  12789. this.n21 = (this.getChild("n21"));
  12790. this.n0 = (this.getChild("n0"));
  12791. this.n3 = (this.getChild("n3"));
  12792. this.n4 = (this.getChild("n4"));
  12793. this.n5 = (this.getChild("n5"));
  12794. this.n6 = (this.getChild("n6"));
  12795. this.n8 = (this.getChild("n8"));
  12796. this.n9 = (this.getChild("n9"));
  12797. this.n10 = (this.getChild("n10"));
  12798. this.n11 = (this.getChild("n11"));
  12799. this.n12 = (this.getChild("n12"));
  12800. this.n13 = (this.getChild("n13"));
  12801. this.n14 = (this.getChild("n14"));
  12802. this.n15 = (this.getChild("n15"));
  12803. this.n23 = (this.getChild("n23"));
  12804. this.t0 = this.getTransition("t0");
  12805. this.t1 = this.getTransition("t1");
  12806. }
  12807. }
  12808. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12809. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12810. static createInstance() {
  12811. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12812. }
  12813. onConstruct() {
  12814. this.n1 = (this.getChild("n1"));
  12815. this.n2 = (this.getChild("n2"));
  12816. this.t0 = this.getTransition("t0");
  12817. }
  12818. }
  12819. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12820. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12821. static createInstance() {
  12822. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12823. }
  12824. onConstruct() {
  12825. this.n4 = (this.getChild("n4"));
  12826. this.n2 = (this.getChild("n2"));
  12827. this.n3 = (this.getChild("n3"));
  12828. this.idle = this.getTransition("idle");
  12829. this.attack = this.getTransition("attack");
  12830. }
  12831. }
  12832. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12833. class ui_special extends fgui.GComponent {
  12834. static createInstance() {
  12835. return (fgui.UIPackage.createObject("game", "special"));
  12836. }
  12837. onConstruct() {
  12838. this.n18 = (this.getChild("n18"));
  12839. this.n19 = (this.getChild("n19"));
  12840. this.n20 = (this.getChild("n20"));
  12841. this.n21 = (this.getChild("n21"));
  12842. this.n22 = (this.getChild("n22"));
  12843. this.levelTxt = (this.getChild("levelTxt"));
  12844. this.n24 = (this.getChild("n24"));
  12845. this.n25 = (this.getChild("n25"));
  12846. this.t0 = this.getTransition("t0");
  12847. }
  12848. }
  12849. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12850. class ui_Component145 extends fgui.GComponent {
  12851. static createInstance() {
  12852. return (fgui.UIPackage.createObject("game", "Component145"));
  12853. }
  12854. onConstruct() {
  12855. this.guanyuNode = (this.getChild("guanyuNode"));
  12856. }
  12857. }
  12858. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12859. class ui_longBtn extends fgui.GButton {
  12860. static createInstance() {
  12861. return (fgui.UIPackage.createObject("game", "longBtn"));
  12862. }
  12863. onConstruct() {
  12864. this.c1 = this.getController("c1");
  12865. this.n2 = (this.getChild("n2"));
  12866. this.n1 = (this.getChild("n1"));
  12867. this.n4 = (this.getChild("n4"));
  12868. }
  12869. }
  12870. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12871. class ui_Component146 extends fgui.GComponent {
  12872. static createInstance() {
  12873. return (fgui.UIPackage.createObject("game", "Component146"));
  12874. }
  12875. onConstruct() {
  12876. this.n89 = (this.getChild("n89"));
  12877. this.n90 = (this.getChild("n90"));
  12878. this.guideBtn = (this.getChild("guideBtn"));
  12879. }
  12880. }
  12881. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12882. class ui_Component146_11 extends fgui.GComponent {
  12883. static createInstance() {
  12884. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12885. }
  12886. onConstruct() {
  12887. this.n89 = (this.getChild("n89"));
  12888. this.n90 = (this.getChild("n90"));
  12889. this.guideBtn = (this.getChild("guideBtn"));
  12890. }
  12891. }
  12892. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12893. class ui_Component111_1 extends fgui.GComponent {
  12894. static createInstance() {
  12895. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12896. }
  12897. onConstruct() {
  12898. this.n68 = (this.getChild("n68"));
  12899. this.myMask = (this.getChild("myMask"));
  12900. }
  12901. }
  12902. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12903. class ui_Component64_1 extends fgui.GComponent {
  12904. static createInstance() {
  12905. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12906. }
  12907. onConstruct() {
  12908. this.n57 = (this.getChild("n57"));
  12909. this.n54 = (this.getChild("n54"));
  12910. this.n55 = (this.getChild("n55"));
  12911. this.n56 = (this.getChild("n56"));
  12912. this.t1 = this.getTransition("t1");
  12913. }
  12914. }
  12915. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12916. class ui_ModeSelection_com123 extends fgui.GComponent {
  12917. static createInstance() {
  12918. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12919. }
  12920. onConstruct() {
  12921. this.type1 = (this.getChild("type1"));
  12922. this.type2 = (this.getChild("type2"));
  12923. this.type3 = (this.getChild("type3"));
  12924. this.n38 = (this.getChild("n38"));
  12925. this.t0 = this.getTransition("t0");
  12926. }
  12927. }
  12928. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12929. class ui_Component132_2 extends fgui.GComponent {
  12930. static createInstance() {
  12931. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12932. }
  12933. onConstruct() {
  12934. this.n25 = (this.getChild("n25"));
  12935. this.n26 = (this.getChild("n26"));
  12936. this.n27 = (this.getChild("n27"));
  12937. this.t0 = this.getTransition("t0");
  12938. }
  12939. }
  12940. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12941. class ui_UIPower$1 extends fgui.GComponent {
  12942. static createInstance() {
  12943. return (fgui.UIPackage.createObject("game", "UIPower"));
  12944. }
  12945. onConstruct() {
  12946. this.n11 = (this.getChild("n11"));
  12947. this.myNode = (this.getChild("myNode"));
  12948. this.t0 = this.getTransition("t0");
  12949. }
  12950. }
  12951. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12952. class ui_Component133 extends fgui.GComponent {
  12953. static createInstance() {
  12954. return (fgui.UIPackage.createObject("game", "Component133"));
  12955. }
  12956. onConstruct() {
  12957. this.n29 = (this.getChild("n29"));
  12958. this.n30 = (this.getChild("n30"));
  12959. }
  12960. }
  12961. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12962. class ui_Component134 extends fgui.GComponent {
  12963. static createInstance() {
  12964. return (fgui.UIPackage.createObject("game", "Component134"));
  12965. }
  12966. onConstruct() {
  12967. this.n30 = (this.getChild("n30"));
  12968. this.n31 = (this.getChild("n31"));
  12969. this.t0 = this.getTransition("t0");
  12970. }
  12971. }
  12972. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12973. class ui_Component135 extends fgui.GComponent {
  12974. static createInstance() {
  12975. return (fgui.UIPackage.createObject("game", "Component135"));
  12976. }
  12977. onConstruct() {
  12978. this.n30 = (this.getChild("n30"));
  12979. this.t0 = this.getTransition("t0");
  12980. }
  12981. }
  12982. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12983. class ui_Component137 extends fgui.GComponent {
  12984. static createInstance() {
  12985. return (fgui.UIPackage.createObject("game", "Component137"));
  12986. }
  12987. onConstruct() {
  12988. this.n28 = (this.getChild("n28"));
  12989. this.n29 = (this.getChild("n29"));
  12990. this.n30 = (this.getChild("n30"));
  12991. this.n32 = (this.getChild("n32"));
  12992. }
  12993. }
  12994. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12995. class ui_dh_zuanshi extends fgui.GButton {
  12996. static createInstance() {
  12997. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12998. }
  12999. onConstruct() {
  13000. this.n1 = (this.getChild("n1"));
  13001. this.n2 = (this.getChild("n2"));
  13002. this.n0 = (this.getChild("n0"));
  13003. this.n3 = (this.getChild("n3"));
  13004. this.n4 = (this.getChild("n4"));
  13005. }
  13006. }
  13007. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  13008. class ui_Component138 extends fgui.GComponent {
  13009. static createInstance() {
  13010. return (fgui.UIPackage.createObject("game", "Component138"));
  13011. }
  13012. onConstruct() {
  13013. this.n1 = (this.getChild("n1"));
  13014. this.n2 = (this.getChild("n2"));
  13015. this.t0 = this.getTransition("t0");
  13016. }
  13017. }
  13018. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  13019. class ui_Component139 extends fgui.GComponent {
  13020. static createInstance() {
  13021. return (fgui.UIPackage.createObject("game", "Component139"));
  13022. }
  13023. onConstruct() {
  13024. this.n0 = (this.getChild("n0"));
  13025. this.t0 = this.getTransition("t0");
  13026. }
  13027. }
  13028. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  13029. class ui_Component140 extends fgui.GComponent {
  13030. static createInstance() {
  13031. return (fgui.UIPackage.createObject("game", "Component140"));
  13032. }
  13033. onConstruct() {
  13034. this.n2 = (this.getChild("n2"));
  13035. this.n3 = (this.getChild("n3"));
  13036. this.t0 = this.getTransition("t0");
  13037. }
  13038. }
  13039. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  13040. class ui_Component141 extends fgui.GComponent {
  13041. static createInstance() {
  13042. return (fgui.UIPackage.createObject("game", "Component141"));
  13043. }
  13044. onConstruct() {
  13045. this.n0 = (this.getChild("n0"));
  13046. this.t0 = this.getTransition("t0");
  13047. }
  13048. }
  13049. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  13050. class ui_powerNode extends fgui.GProgressBar {
  13051. static createInstance() {
  13052. return (fgui.UIPackage.createObject("game", "powerNode"));
  13053. }
  13054. onConstruct() {
  13055. this.n2 = (this.getChild("n2"));
  13056. this.bar_v = (this.getChild("bar_v"));
  13057. this.showImg = (this.getChild("showImg"));
  13058. this.n12 = (this.getChild("n12"));
  13059. }
  13060. }
  13061. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13062. class ui_dh_jingbi1 extends fgui.GComponent {
  13063. static createInstance() {
  13064. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13065. }
  13066. onConstruct() {
  13067. this.n0 = (this.getChild("n0"));
  13068. this.n1 = (this.getChild("n1"));
  13069. this.n2 = (this.getChild("n2"));
  13070. this.n3 = (this.getChild("n3"));
  13071. this.n4 = (this.getChild("n4"));
  13072. this.n5 = (this.getChild("n5"));
  13073. this.n6 = (this.getChild("n6"));
  13074. this.n8 = (this.getChild("n8"));
  13075. this.t0 = this.getTransition("t0");
  13076. }
  13077. }
  13078. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13079. class ui_Component94 extends fgui.GButton {
  13080. static createInstance() {
  13081. return (fgui.UIPackage.createObject("game", "Component94"));
  13082. }
  13083. onConstruct() {
  13084. this.n77 = (this.getChild("n77"));
  13085. }
  13086. }
  13087. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13088. class ui_Component95 extends fgui.GButton {
  13089. static createInstance() {
  13090. return (fgui.UIPackage.createObject("game", "Component95"));
  13091. }
  13092. onConstruct() {
  13093. this.n77 = (this.getChild("n77"));
  13094. }
  13095. }
  13096. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13097. class ui_Component126 extends fgui.GComponent {
  13098. static createInstance() {
  13099. return (fgui.UIPackage.createObject("game", "Component126"));
  13100. }
  13101. onConstruct() {
  13102. this.c1 = this.getController("c1");
  13103. this.normalBtn = (this.getChild("normalBtn"));
  13104. this.tripleBtn = (this.getChild("tripleBtn"));
  13105. }
  13106. }
  13107. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13108. class ui_Component60 extends fgui.GComponent {
  13109. static createInstance() {
  13110. return (fgui.UIPackage.createObject("game", "Component60"));
  13111. }
  13112. onConstruct() {
  13113. this.c1 = this.getController("c1");
  13114. this.n48 = (this.getChild("n48"));
  13115. this.womanTxt = (this.getChild("womanTxt"));
  13116. this.t0 = this.getTransition("t0");
  13117. }
  13118. }
  13119. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13120. class ui_Component98_3 extends fgui.GButton {
  13121. static createInstance() {
  13122. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13123. }
  13124. onConstruct() {
  13125. this.c1 = this.getController("c1");
  13126. this.n8 = (this.getChild("n8"));
  13127. this.n41 = (this.getChild("n41"));
  13128. this.n40 = (this.getChild("n40"));
  13129. }
  13130. }
  13131. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13132. class ui_ModeSelection_com1 extends fgui.GButton {
  13133. static createInstance() {
  13134. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13135. }
  13136. onConstruct() {
  13137. this.n34 = (this.getChild("n34"));
  13138. this.n36 = (this.getChild("n36"));
  13139. this.n22 = (this.getChild("n22"));
  13140. this.n20 = (this.getChild("n20"));
  13141. this.n23 = (this.getChild("n23"));
  13142. this.n24 = (this.getChild("n24"));
  13143. this.n26 = (this.getChild("n26"));
  13144. this.n33 = (this.getChild("n33"));
  13145. this.coinImg = (this.getChild("coinImg"));
  13146. this.need = (this.getChild("need"));
  13147. this.n35 = (this.getChild("n35"));
  13148. this.n29 = (this.getChild("n29"));
  13149. this.tipsTxt = (this.getChild("tipsTxt"));
  13150. this.n30 = (this.getChild("n30"));
  13151. this.peopleTxt = (this.getChild("peopleTxt"));
  13152. this.t0 = this.getTransition("t0");
  13153. }
  13154. }
  13155. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13156. class ui_ModeSelection_com2 extends fgui.GButton {
  13157. static createInstance() {
  13158. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13159. }
  13160. onConstruct() {
  13161. this.n36 = (this.getChild("n36"));
  13162. this.n34 = (this.getChild("n34"));
  13163. this.n22 = (this.getChild("n22"));
  13164. this.n20 = (this.getChild("n20"));
  13165. this.n23 = (this.getChild("n23"));
  13166. this.n24 = (this.getChild("n24"));
  13167. this.n26 = (this.getChild("n26"));
  13168. this.n33 = (this.getChild("n33"));
  13169. this.coinImg = (this.getChild("coinImg"));
  13170. this.need = (this.getChild("need"));
  13171. this.n35 = (this.getChild("n35"));
  13172. this.n29 = (this.getChild("n29"));
  13173. this.tipsTxt = (this.getChild("tipsTxt"));
  13174. this.n30 = (this.getChild("n30"));
  13175. this.peopleTxt = (this.getChild("peopleTxt"));
  13176. this.t0 = this.getTransition("t0");
  13177. }
  13178. }
  13179. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13180. class ui_ModeSelection_com3 extends fgui.GButton {
  13181. static createInstance() {
  13182. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13183. }
  13184. onConstruct() {
  13185. this.n34 = (this.getChild("n34"));
  13186. this.n36 = (this.getChild("n36"));
  13187. this.n22 = (this.getChild("n22"));
  13188. this.n20 = (this.getChild("n20"));
  13189. this.n23 = (this.getChild("n23"));
  13190. this.n24 = (this.getChild("n24"));
  13191. this.n26 = (this.getChild("n26"));
  13192. this.n33 = (this.getChild("n33"));
  13193. this.coinImg = (this.getChild("coinImg"));
  13194. this.need = (this.getChild("need"));
  13195. this.n35 = (this.getChild("n35"));
  13196. this.n29 = (this.getChild("n29"));
  13197. this.tipsTxt = (this.getChild("tipsTxt"));
  13198. this.n30 = (this.getChild("n30"));
  13199. this.peopleTxt = (this.getChild("peopleTxt"));
  13200. this.t0 = this.getTransition("t0");
  13201. }
  13202. }
  13203. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13204. class ui_Invitation_com1 extends fgui.GComponent {
  13205. static createInstance() {
  13206. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13207. }
  13208. onConstruct() {
  13209. this.n14 = (this.getChild("n14"));
  13210. this.n13 = (this.getChild("n13"));
  13211. this.n3 = (this.getChild("n3"));
  13212. this.n1 = (this.getChild("n1"));
  13213. this.n6 = (this.getChild("n6"));
  13214. this.n7 = (this.getChild("n7"));
  13215. this.enterBtn = (this.getChild("enterBtn"));
  13216. this.n11 = (this.getChild("n11"));
  13217. this.n12 = (this.getChild("n12"));
  13218. this.n15 = (this.getChild("n15"));
  13219. this.t0 = this.getTransition("t0");
  13220. this.t1 = this.getTransition("t1");
  13221. }
  13222. }
  13223. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13224. class ui_Component87_1 extends fgui.GComponent {
  13225. static createInstance() {
  13226. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13227. }
  13228. onConstruct() {
  13229. this.n74 = (this.getChild("n74"));
  13230. this.n73 = (this.getChild("n73"));
  13231. this.ballTxt = (this.getChild("ballTxt"));
  13232. this.n76 = (this.getChild("n76"));
  13233. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13234. this.levelTxt = (this.getChild("levelTxt"));
  13235. this.n87 = (this.getChild("n87"));
  13236. this.n84 = (this.getChild("n84"));
  13237. this.hpTxt = (this.getChild("hpTxt"));
  13238. this.n89 = (this.getChild("n89"));
  13239. this.tipsTxt = (this.getChild("tipsTxt"));
  13240. }
  13241. }
  13242. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13243. class ui_sqg1 extends fgui.GComponent {
  13244. static createInstance() {
  13245. return (fgui.UIPackage.createObject("game", "sqg1"));
  13246. }
  13247. onConstruct() {
  13248. this.n1 = (this.getChild("n1"));
  13249. this.n0 = (this.getChild("n0"));
  13250. }
  13251. }
  13252. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  13253. class ui_sqg2 extends fgui.GComponent {
  13254. static createInstance() {
  13255. return (fgui.UIPackage.createObject("game", "sqg2"));
  13256. }
  13257. onConstruct() {
  13258. this.n1 = (this.getChild("n1"));
  13259. this.n0 = (this.getChild("n0"));
  13260. }
  13261. }
  13262. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  13263. class ui_sqg3 extends fgui.GComponent {
  13264. static createInstance() {
  13265. return (fgui.UIPackage.createObject("game", "sqg3"));
  13266. }
  13267. onConstruct() {
  13268. this.n1 = (this.getChild("n1"));
  13269. this.n0 = (this.getChild("n0"));
  13270. }
  13271. }
  13272. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  13273. class ui_sqg4 extends fgui.GComponent {
  13274. static createInstance() {
  13275. return (fgui.UIPackage.createObject("game", "sqg4"));
  13276. }
  13277. onConstruct() {
  13278. this.n1 = (this.getChild("n1"));
  13279. this.n0 = (this.getChild("n0"));
  13280. }
  13281. }
  13282. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  13283. class ui_Component36 extends fgui.GButton {
  13284. static createInstance() {
  13285. return (fgui.UIPackage.createObject("game", "Component36"));
  13286. }
  13287. onConstruct() {
  13288. this.c1 = this.getController("c1");
  13289. this.n53 = (this.getChild("n53"));
  13290. this.n56 = (this.getChild("n56"));
  13291. }
  13292. }
  13293. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  13294. class ui_Component37 extends fgui.GButton {
  13295. static createInstance() {
  13296. return (fgui.UIPackage.createObject("game", "Component37"));
  13297. }
  13298. onConstruct() {
  13299. this.c1 = this.getController("c1");
  13300. this.n52 = (this.getChild("n52"));
  13301. this.n54 = (this.getChild("n54"));
  13302. }
  13303. }
  13304. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  13305. class ui_UISetting extends fgui.GComponent {
  13306. static createInstance() {
  13307. return (fgui.UIPackage.createObject("game", "UISetting"));
  13308. }
  13309. onConstruct() {
  13310. this.c1 = this.getController("c1");
  13311. this.n4 = (this.getChild("n4"));
  13312. this.soundBtn = (this.getChild("soundBtn"));
  13313. this.shakeBtn = (this.getChild("shakeBtn"));
  13314. this.clickNode = (this.getChild("clickNode"));
  13315. this.xyBtn = (this.getChild("xyBtn"));
  13316. }
  13317. }
  13318. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  13319. class ui_Component39 extends fgui.GComponent {
  13320. static createInstance() {
  13321. return (fgui.UIPackage.createObject("game", "Component39"));
  13322. }
  13323. onConstruct() {
  13324. this.n5 = (this.getChild("n5"));
  13325. this.n6 = (this.getChild("n6"));
  13326. this.n7 = (this.getChild("n7"));
  13327. this.t0 = this.getTransition("t0");
  13328. }
  13329. }
  13330. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  13331. class ui_Component40 extends fgui.GButton {
  13332. static createInstance() {
  13333. return (fgui.UIPackage.createObject("game", "Component40"));
  13334. }
  13335. onConstruct() {
  13336. this.n46 = (this.getChild("n46"));
  13337. this.n47 = (this.getChild("n47"));
  13338. }
  13339. }
  13340. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13341. class ui_Component41 extends fgui.GComponent {
  13342. static createInstance() {
  13343. return (fgui.UIPackage.createObject("game", "Component41"));
  13344. }
  13345. onConstruct() {
  13346. this.c1 = this.getController("c1");
  13347. this.n0 = (this.getChild("n0"));
  13348. this.titleTxt = (this.getChild("titleTxt"));
  13349. this.n2 = (this.getChild("n2"));
  13350. this.msgTips = (this.getChild("msgTips"));
  13351. this.numTxt = (this.getChild("numTxt"));
  13352. this.n18 = (this.getChild("n18"));
  13353. this.cancelBtn = (this.getChild("cancelBtn"));
  13354. this.videoBtn = (this.getChild("videoBtn"));
  13355. this.n10 = (this.getChild("n10"));
  13356. }
  13357. }
  13358. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13359. class ui_Component42 extends fgui.GComponent {
  13360. static createInstance() {
  13361. return (fgui.UIPackage.createObject("game", "Component42"));
  13362. }
  13363. onConstruct() {
  13364. this.c1 = this.getController("c1");
  13365. this.n1 = (this.getChild("n1"));
  13366. this.n2 = (this.getChild("n2"));
  13367. this.n3 = (this.getChild("n3"));
  13368. this.tipsTxt = (this.getChild("tipsTxt"));
  13369. this.cancelBtn = (this.getChild("cancelBtn"));
  13370. this.sureBtn = (this.getChild("sureBtn"));
  13371. this.n11 = (this.getChild("n11"));
  13372. this.n13 = (this.getChild("n13"));
  13373. this.n14 = (this.getChild("n14"));
  13374. this.womanTxt = (this.getChild("womanTxt"));
  13375. this.t0 = this.getTransition("t0");
  13376. }
  13377. }
  13378. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13379. class ui_dh_js_shengli extends fgui.GComponent {
  13380. static createInstance() {
  13381. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13382. }
  13383. onConstruct() {
  13384. this.n3 = (this.getChild("n3"));
  13385. this.n4 = (this.getChild("n4"));
  13386. this.n1 = (this.getChild("n1"));
  13387. this.n2 = (this.getChild("n2"));
  13388. this.n5 = (this.getChild("n5"));
  13389. this.n6 = (this.getChild("n6"));
  13390. this.n7 = (this.getChild("n7"));
  13391. this.n8 = (this.getChild("n8"));
  13392. this.attack = this.getTransition("attack");
  13393. this.idle = this.getTransition("idle");
  13394. }
  13395. }
  13396. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13397. class ui_dh_js_shengli_g extends fgui.GComponent {
  13398. static createInstance() {
  13399. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13400. }
  13401. onConstruct() {
  13402. this.n3 = (this.getChild("n3"));
  13403. this.n1 = (this.getChild("n1"));
  13404. this.t0 = this.getTransition("t0");
  13405. }
  13406. }
  13407. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13408. class ui_dh_js_shibai extends fgui.GComponent {
  13409. static createInstance() {
  13410. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13411. }
  13412. onConstruct() {
  13413. this.n0 = (this.getChild("n0"));
  13414. this.n1 = (this.getChild("n1"));
  13415. this.n2 = (this.getChild("n2"));
  13416. this.n3 = (this.getChild("n3"));
  13417. this.idle = this.getTransition("idle");
  13418. this.attack = this.getTransition("attack");
  13419. }
  13420. }
  13421. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13422. class ui_dh_zy_ganfa extends fgui.GButton {
  13423. static createInstance() {
  13424. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13425. }
  13426. onConstruct() {
  13427. this.n0 = (this.getChild("n0"));
  13428. }
  13429. }
  13430. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13431. class ui_dh_zy_sc_guang extends fgui.GButton {
  13432. static createInstance() {
  13433. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13434. }
  13435. onConstruct() {
  13436. this.n0 = (this.getChild("n0"));
  13437. this.n2 = (this.getChild("n2"));
  13438. }
  13439. }
  13440. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13441. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13442. static createInstance() {
  13443. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13444. }
  13445. onConstruct() {
  13446. this.n0 = (this.getChild("n0"));
  13447. this.n3 = (this.getChild("n3"));
  13448. this.t0 = this.getTransition("t0");
  13449. }
  13450. }
  13451. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13452. class ui_dh_zy_wanfa extends fgui.GButton {
  13453. static createInstance() {
  13454. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13455. }
  13456. onConstruct() {
  13457. this.n0 = (this.getChild("n0"));
  13458. }
  13459. }
  13460. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13461. class ui_Component53_1 extends fgui.GComponent {
  13462. static createInstance() {
  13463. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13464. }
  13465. onConstruct() {
  13466. this.n0 = (this.getChild("n0"));
  13467. this.n1 = (this.getChild("n1"));
  13468. this.n2 = (this.getChild("n2"));
  13469. this.n3 = (this.getChild("n3"));
  13470. this.n4 = (this.getChild("n4"));
  13471. this.n5 = (this.getChild("n5"));
  13472. this.n6 = (this.getChild("n6"));
  13473. this.n7 = (this.getChild("n7"));
  13474. this.n8 = (this.getChild("n8"));
  13475. this.n9 = (this.getChild("n9"));
  13476. this.n10 = (this.getChild("n10"));
  13477. this.n11 = (this.getChild("n11"));
  13478. this.n12 = (this.getChild("n12"));
  13479. this.n13 = (this.getChild("n13"));
  13480. this.n14 = (this.getChild("n14"));
  13481. this.n15 = (this.getChild("n15"));
  13482. this.n16 = (this.getChild("n16"));
  13483. this.n19 = (this.getChild("n19"));
  13484. this.n20 = (this.getChild("n20"));
  13485. this.n21 = (this.getChild("n21"));
  13486. this.n22 = (this.getChild("n22"));
  13487. this.n23 = (this.getChild("n23"));
  13488. this.n24 = (this.getChild("n24"));
  13489. this.n25 = (this.getChild("n25"));
  13490. this.n26 = (this.getChild("n26"));
  13491. this.n27 = (this.getChild("n27"));
  13492. this.n28 = (this.getChild("n28"));
  13493. this.n29 = (this.getChild("n29"));
  13494. this.n30 = (this.getChild("n30"));
  13495. this.n31 = (this.getChild("n31"));
  13496. this.n32 = (this.getChild("n32"));
  13497. this.n33 = (this.getChild("n33"));
  13498. this.n34 = (this.getChild("n34"));
  13499. this.n35 = (this.getChild("n35"));
  13500. this.t0 = this.getTransition("t0");
  13501. }
  13502. }
  13503. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13504. class ui_Component30 extends fgui.GComponent {
  13505. static createInstance() {
  13506. return (fgui.UIPackage.createObject("game", "Component30"));
  13507. }
  13508. onConstruct() {
  13509. this.c1 = this.getController("c1");
  13510. this.n46 = (this.getChild("n46"));
  13511. this.n47 = (this.getChild("n47"));
  13512. this.numTxt = (this.getChild("numTxt"));
  13513. this.n50 = (this.getChild("n50"));
  13514. this.n53 = (this.getChild("n53"));
  13515. this.n54 = (this.getChild("n54"));
  13516. this.n55 = (this.getChild("n55"));
  13517. this.n56 = (this.getChild("n56"));
  13518. }
  13519. }
  13520. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13521. class ui_Component30_1 extends fgui.GComponent {
  13522. static createInstance() {
  13523. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13524. }
  13525. onConstruct() {
  13526. this.c1 = this.getController("c1");
  13527. this.n46 = (this.getChild("n46"));
  13528. this.n47 = (this.getChild("n47"));
  13529. this.numTxt = (this.getChild("numTxt"));
  13530. this.n50 = (this.getChild("n50"));
  13531. this.n51 = (this.getChild("n51"));
  13532. this.n52 = (this.getChild("n52"));
  13533. this.n53 = (this.getChild("n53"));
  13534. this.n54 = (this.getChild("n54"));
  13535. }
  13536. }
  13537. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13538. class ui_Component31 extends fgui.GComponent {
  13539. static createInstance() {
  13540. return (fgui.UIPackage.createObject("game", "Component31"));
  13541. }
  13542. onConstruct() {
  13543. this.n55 = (this.getChild("n55"));
  13544. this.n54 = (this.getChild("n54"));
  13545. this.conditionTxt = (this.getChild("conditionTxt"));
  13546. this.n57 = (this.getChild("n57"));
  13547. this.t0 = this.getTransition("t0");
  13548. }
  13549. }
  13550. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13551. class ui_Component32 extends fgui.GComponent {
  13552. static createInstance() {
  13553. return (fgui.UIPackage.createObject("game", "Component32"));
  13554. }
  13555. onConstruct() {
  13556. this.n5 = (this.getChild("n5"));
  13557. this.n6 = (this.getChild("n6"));
  13558. this.n7 = (this.getChild("n7"));
  13559. this.t0 = this.getTransition("t0");
  13560. }
  13561. }
  13562. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13563. class ui_AwardItem extends fgui.GComponent {
  13564. static createInstance() {
  13565. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13566. }
  13567. onConstruct() {
  13568. this.n9 = (this.getChild("n9"));
  13569. this.myIcon = (this.getChild("myIcon"));
  13570. this.numTxt = (this.getChild("numTxt"));
  13571. this.nameTxt = (this.getChild("nameTxt"));
  13572. this.n16 = (this.getChild("n16"));
  13573. this.n17 = (this.getChild("n17"));
  13574. }
  13575. }
  13576. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13577. class ui_ranking_com1 extends fgui.GButton {
  13578. static createInstance() {
  13579. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13580. }
  13581. onConstruct() {
  13582. this.c1 = this.getController("c1");
  13583. this.n49 = (this.getChild("n49"));
  13584. this.n18 = (this.getChild("n18"));
  13585. this.n46 = (this.getChild("n46"));
  13586. this.n48 = (this.getChild("n48"));
  13587. this.n50 = (this.getChild("n50"));
  13588. }
  13589. }
  13590. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13591. class ui_ranking_com2 extends fgui.GButton {
  13592. static createInstance() {
  13593. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13594. }
  13595. onConstruct() {
  13596. this.c1 = this.getController("c1");
  13597. this.n49 = (this.getChild("n49"));
  13598. this.n18 = (this.getChild("n18"));
  13599. this.n46 = (this.getChild("n46"));
  13600. this.n48 = (this.getChild("n48"));
  13601. this.n50 = (this.getChild("n50"));
  13602. }
  13603. }
  13604. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13605. class ui_ranking_com3 extends fgui.GComponent {
  13606. static createInstance() {
  13607. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13608. }
  13609. onConstruct() {
  13610. this.n17 = (this.getChild("n17"));
  13611. this.myIcon = (this.getChild("myIcon"));
  13612. }
  13613. }
  13614. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13615. class ui_ranking_com4 extends fgui.GComponent {
  13616. static createInstance() {
  13617. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13618. }
  13619. onConstruct() {
  13620. this.n16 = (this.getChild("n16"));
  13621. this.head = (this.getChild("head"));
  13622. }
  13623. }
  13624. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13625. class ui_ranking_com5 extends fgui.GComponent {
  13626. static createInstance() {
  13627. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13628. }
  13629. onConstruct() {
  13630. this.c1 = this.getController("c1");
  13631. this.c2 = this.getController("c2");
  13632. this.n2 = (this.getChild("n2"));
  13633. this.n3 = (this.getChild("n3"));
  13634. this.levelBtn = (this.getChild("levelBtn"));
  13635. this.starBtn = (this.getChild("starBtn"));
  13636. this.n23 = (this.getChild("n23"));
  13637. this.n24 = (this.getChild("n24"));
  13638. this.n25 = (this.getChild("n25"));
  13639. this.myList = (this.getChild("myList"));
  13640. this.selfNode = (this.getChild("selfNode"));
  13641. this.n9 = (this.getChild("n9"));
  13642. this.n12 = (this.getChild("n12"));
  13643. this.n13 = (this.getChild("n13"));
  13644. this.n14 = (this.getChild("n14"));
  13645. this.n39 = (this.getChild("n39"));
  13646. this.n41 = (this.getChild("n41"));
  13647. this.n42 = (this.getChild("n42"));
  13648. this.n45 = (this.getChild("n45"));
  13649. this.changeBtn = (this.getChild("changeBtn"));
  13650. this.closeBtn = (this.getChild("closeBtn"));
  13651. this.t0 = this.getTransition("t0");
  13652. }
  13653. }
  13654. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13655. class ui_RankItem extends fgui.GComponent {
  13656. static createInstance() {
  13657. return (fgui.UIPackage.createObject("game", "RankItem"));
  13658. }
  13659. onConstruct() {
  13660. this.n10 = (this.getChild("n10"));
  13661. this.n11 = (this.getChild("n11"));
  13662. this.rankTxt = (this.getChild("rankTxt"));
  13663. this.headNode = (this.getChild("headNode"));
  13664. this.nameTxt = (this.getChild("nameTxt"));
  13665. this.n19 = (this.getChild("n19"));
  13666. this.valueTxt = (this.getChild("valueTxt"));
  13667. this.img1 = (this.getChild("img1"));
  13668. this.img2 = (this.getChild("img2"));
  13669. this.img3 = (this.getChild("img3"));
  13670. }
  13671. }
  13672. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13673. class ui_ranking_com9 extends fgui.GComponent {
  13674. static createInstance() {
  13675. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13676. }
  13677. onConstruct() {
  13678. this.c1 = this.getController("c1");
  13679. this.n27 = (this.getChild("n27"));
  13680. this.n28 = (this.getChild("n28"));
  13681. this.headNode = (this.getChild("headNode"));
  13682. this.rankTxt = (this.getChild("rankTxt"));
  13683. this.nameTxt = (this.getChild("nameTxt"));
  13684. this.n34 = (this.getChild("n34"));
  13685. this.valueTxt = (this.getChild("valueTxt"));
  13686. this.n36 = (this.getChild("n36"));
  13687. this.n37 = (this.getChild("n37"));
  13688. this.n38 = (this.getChild("n38"));
  13689. this.n39 = (this.getChild("n39"));
  13690. this.n40 = (this.getChild("n40"));
  13691. }
  13692. }
  13693. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13694. class ui_ranking_com10 extends fgui.GComponent {
  13695. static createInstance() {
  13696. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13697. }
  13698. onConstruct() {
  13699. this.n23 = (this.getChild("n23"));
  13700. this.n24 = (this.getChild("n24"));
  13701. }
  13702. }
  13703. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13704. class ui_ranking_com11 extends fgui.GComponent {
  13705. static createInstance() {
  13706. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13707. }
  13708. onConstruct() {
  13709. this.n24 = (this.getChild("n24"));
  13710. this.n25 = (this.getChild("n25"));
  13711. this.t0 = this.getTransition("t0");
  13712. }
  13713. }
  13714. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13715. class ui_ranking_com13 extends fgui.GButton {
  13716. static createInstance() {
  13717. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13718. }
  13719. onConstruct() {
  13720. this.c1 = this.getController("c1");
  13721. this.n44 = (this.getChild("n44"));
  13722. this.n45 = (this.getChild("n45"));
  13723. this.n46 = (this.getChild("n46"));
  13724. }
  13725. }
  13726. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13727. class ui_Component122 extends fgui.GComponent {
  13728. static createInstance() {
  13729. return (fgui.UIPackage.createObject("game", "Component122"));
  13730. }
  13731. onConstruct() {
  13732. this.gameNode3 = (this.getChild("gameNode3"));
  13733. }
  13734. }
  13735. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13736. class ui_skillItem extends fgui.GComponent {
  13737. static createInstance() {
  13738. return (fgui.UIPackage.createObject("game", "skillItem"));
  13739. }
  13740. onConstruct() {
  13741. this.c1 = this.getController("c1");
  13742. this.n31 = (this.getChild("n31"));
  13743. this.n6 = (this.getChild("n6"));
  13744. this.skillImg = (this.getChild("skillImg"));
  13745. this.nameTxt = (this.getChild("nameTxt"));
  13746. this.levelTxt = (this.getChild("levelTxt"));
  13747. this.n28 = (this.getChild("n28"));
  13748. this.describeTxt = (this.getChild("describeTxt"));
  13749. this.n32 = (this.getChild("n32"));
  13750. this.mutiBtn = (this.getChild("mutiBtn"));
  13751. this.tryNode = (this.getChild("tryNode"));
  13752. this.normalBtn = (this.getChild("normalBtn"));
  13753. this.startBtn = (this.getChild("startBtn"));
  13754. this.n42 = (this.getChild("n42"));
  13755. this.n43 = (this.getChild("n43"));
  13756. this.n44 = (this.getChild("n44"));
  13757. }
  13758. }
  13759. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13760. class ui_Component26 extends fgui.GButton {
  13761. static createInstance() {
  13762. return (fgui.UIPackage.createObject("game", "Component26"));
  13763. }
  13764. onConstruct() {
  13765. this.n11 = (this.getChild("n11"));
  13766. this.n30 = (this.getChild("n30"));
  13767. this.n34 = (this.getChild("n34"));
  13768. }
  13769. }
  13770. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13771. class ui_Component28 extends fgui.GButton {
  13772. static createInstance() {
  13773. return (fgui.UIPackage.createObject("game", "Component28"));
  13774. }
  13775. onConstruct() {
  13776. this.n12 = (this.getChild("n12"));
  13777. this.n31 = (this.getChild("n31"));
  13778. this.curTxt = (this.getChild("curTxt"));
  13779. this.n33 = (this.getChild("n33"));
  13780. }
  13781. }
  13782. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13783. class ui_Component1302 extends fgui.GComponent {
  13784. static createInstance() {
  13785. return (fgui.UIPackage.createObject("game", "Component1302"));
  13786. }
  13787. onConstruct() {
  13788. this.n2 = (this.getChild("n2"));
  13789. this.n3 = (this.getChild("n3"));
  13790. }
  13791. }
  13792. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13793. class ui_Component113 extends fgui.GComponent {
  13794. static createInstance() {
  13795. return (fgui.UIPackage.createObject("game", "Component113"));
  13796. }
  13797. onConstruct() {
  13798. this.n85 = (this.getChild("n85"));
  13799. this.n86 = (this.getChild("n86"));
  13800. this.n77 = (this.getChild("n77"));
  13801. this.n79 = (this.getChild("n79"));
  13802. this.n80 = (this.getChild("n80"));
  13803. this.n81 = (this.getChild("n81"));
  13804. this.n82 = (this.getChild("n82"));
  13805. this.n84 = (this.getChild("n84"));
  13806. this.n87 = (this.getChild("n87"));
  13807. this.t0 = this.getTransition("t0");
  13808. }
  13809. }
  13810. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13811. class ui_Component114 extends fgui.GComponent {
  13812. static createInstance() {
  13813. return (fgui.UIPackage.createObject("game", "Component114"));
  13814. }
  13815. onConstruct() {
  13816. this.n77 = (this.getChild("n77"));
  13817. this.t0 = this.getTransition("t0");
  13818. }
  13819. }
  13820. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13821. class ui_Component115 extends fgui.GComponent {
  13822. static createInstance() {
  13823. return (fgui.UIPackage.createObject("game", "Component115"));
  13824. }
  13825. onConstruct() {
  13826. this.n83 = (this.getChild("n83"));
  13827. this.fingerNode = (this.getChild("fingerNode"));
  13828. this.n84 = (this.getChild("n84"));
  13829. }
  13830. }
  13831. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13832. class ui_Component117 extends fgui.GComponent {
  13833. static createInstance() {
  13834. return (fgui.UIPackage.createObject("game", "Component117"));
  13835. }
  13836. onConstruct() {
  13837. this.n87 = (this.getChild("n87"));
  13838. this.n88 = (this.getChild("n88"));
  13839. this.n84 = (this.getChild("n84"));
  13840. this.n85 = (this.getChild("n85"));
  13841. this.n86 = (this.getChild("n86"));
  13842. this.t0 = this.getTransition("t0");
  13843. }
  13844. }
  13845. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13846. class ui_Component98_1 extends fgui.GButton {
  13847. static createInstance() {
  13848. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13849. }
  13850. onConstruct() {
  13851. this.c1 = this.getController("c1");
  13852. this.n8 = (this.getChild("n8"));
  13853. this.n41 = (this.getChild("n41"));
  13854. this.n40 = (this.getChild("n40"));
  13855. }
  13856. }
  13857. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13858. class ui_Component61 extends fgui.GComponent {
  13859. static createInstance() {
  13860. return (fgui.UIPackage.createObject("game", "Component61"));
  13861. }
  13862. onConstruct() {
  13863. this.n14 = (this.getChild("n14"));
  13864. this.n6 = (this.getChild("n6"));
  13865. this.t0 = this.getTransition("t0");
  13866. }
  13867. }
  13868. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13869. class ui_Component62 extends fgui.GComponent {
  13870. static createInstance() {
  13871. return (fgui.UIPackage.createObject("game", "Component62"));
  13872. }
  13873. onConstruct() {
  13874. this.n66 = (this.getChild("n66"));
  13875. this.n56 = (this.getChild("n56"));
  13876. this.n63 = (this.getChild("n63"));
  13877. this.n65 = (this.getChild("n65"));
  13878. this.t0 = this.getTransition("t0");
  13879. }
  13880. }
  13881. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13882. class ui_d3Root extends fgui.GComponent {
  13883. static createInstance() {
  13884. return (fgui.UIPackage.createObject("game", "d3Root"));
  13885. }
  13886. onConstruct() {
  13887. }
  13888. }
  13889. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13890. class ui_d2Root extends fgui.GComponent {
  13891. static createInstance() {
  13892. return (fgui.UIPackage.createObject("game", "d2Root"));
  13893. }
  13894. onConstruct() {
  13895. }
  13896. }
  13897. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13898. class ui_ballNode extends fgui.GComponent {
  13899. static createInstance() {
  13900. return (fgui.UIPackage.createObject("game", "ballNode"));
  13901. }
  13902. onConstruct() {
  13903. }
  13904. }
  13905. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13906. class ui_border extends fgui.GComponent {
  13907. static createInstance() {
  13908. return (fgui.UIPackage.createObject("game", "border"));
  13909. }
  13910. onConstruct() {
  13911. this.bar1 = (this.getChild("bar1"));
  13912. this.bar2 = (this.getChild("bar2"));
  13913. this.bar3 = (this.getChild("bar3"));
  13914. this.bar4 = (this.getChild("bar4"));
  13915. this.bar5 = (this.getChild("bar5"));
  13916. this.bar6 = (this.getChild("bar6"));
  13917. this.circle1 = (this.getChild("circle1"));
  13918. this.circle2 = (this.getChild("circle2"));
  13919. this.circle3 = (this.getChild("circle3"));
  13920. this.circle4 = (this.getChild("circle4"));
  13921. this.circle5 = (this.getChild("circle5"));
  13922. this.circle6 = (this.getChild("circle6"));
  13923. this.n28 = (this.getChild("n28"));
  13924. }
  13925. }
  13926. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13927. class ui_Component41_2 extends fgui.GComponent {
  13928. static createInstance() {
  13929. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13930. }
  13931. onConstruct() {
  13932. this.c1 = this.getController("c1");
  13933. this.n0 = (this.getChild("n0"));
  13934. this.n2 = (this.getChild("n2"));
  13935. this.n19 = (this.getChild("n19"));
  13936. this.cancelBtn = (this.getChild("cancelBtn"));
  13937. this.videoBtn = (this.getChild("videoBtn"));
  13938. this.n9 = (this.getChild("n9"));
  13939. this.n22 = (this.getChild("n22"));
  13940. this.tipsTxt = (this.getChild("tipsTxt"));
  13941. this.n23 = (this.getChild("n23"));
  13942. this.n24 = (this.getChild("n24"));
  13943. this.n26 = (this.getChild("n26"));
  13944. this.n27 = (this.getChild("n27"));
  13945. this.titleTxt = (this.getChild("titleTxt"));
  13946. }
  13947. }
  13948. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13949. class ui_Component41_1 extends fgui.GComponent {
  13950. static createInstance() {
  13951. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13952. }
  13953. onConstruct() {
  13954. this.c1 = this.getController("c1");
  13955. this.n0 = (this.getChild("n0"));
  13956. this.n2 = (this.getChild("n2"));
  13957. this.cancelBtn = (this.getChild("cancelBtn"));
  13958. this.videoBtn = (this.getChild("videoBtn"));
  13959. this.n27 = (this.getChild("n27"));
  13960. this.n30 = (this.getChild("n30"));
  13961. this.n31 = (this.getChild("n31"));
  13962. this.n32 = (this.getChild("n32"));
  13963. this.n33 = (this.getChild("n33"));
  13964. this.n34 = (this.getChild("n34"));
  13965. this.n35 = (this.getChild("n35"));
  13966. this.n36 = (this.getChild("n36"));
  13967. this.n1 = (this.getChild("n1"));
  13968. this.n37 = (this.getChild("n37"));
  13969. this.t0 = this.getTransition("t0");
  13970. this.t1 = this.getTransition("t1");
  13971. this.t2 = this.getTransition("t2");
  13972. this.t3 = this.getTransition("t3");
  13973. }
  13974. }
  13975. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13976. class ui_againBtn extends fgui.GButton {
  13977. static createInstance() {
  13978. return (fgui.UIPackage.createObject("game", "againBtn"));
  13979. }
  13980. onConstruct() {
  13981. this.n2 = (this.getChild("n2"));
  13982. this.n1 = (this.getChild("n1"));
  13983. this.n5 = (this.getChild("n5"));
  13984. }
  13985. }
  13986. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13987. class ui_Component118 extends fgui.GButton {
  13988. static createInstance() {
  13989. return (fgui.UIPackage.createObject("game", "Component118"));
  13990. }
  13991. onConstruct() {
  13992. this.c1 = this.getController("c1");
  13993. this.n14 = (this.getChild("n14"));
  13994. this.n9 = (this.getChild("n9"));
  13995. this.n10 = (this.getChild("n10"));
  13996. this.diamondTxt = (this.getChild("diamondTxt"));
  13997. this.n13 = (this.getChild("n13"));
  13998. this.n15 = (this.getChild("n15"));
  13999. }
  14000. }
  14001. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  14002. class ui_Component119 extends fgui.GComponent {
  14003. static createInstance() {
  14004. return (fgui.UIPackage.createObject("game", "Component119"));
  14005. }
  14006. onConstruct() {
  14007. this.n1 = (this.getChild("n1"));
  14008. this.n2 = (this.getChild("n2"));
  14009. this.n13 = (this.getChild("n13"));
  14010. this.n6 = (this.getChild("n6"));
  14011. this.screenNode = (this.getChild("screenNode"));
  14012. this.n15 = (this.getChild("n15"));
  14013. this.closeBtn = (this.getChild("closeBtn"));
  14014. this.share2Btn = (this.getChild("share2Btn"));
  14015. this.shareBtn = (this.getChild("shareBtn"));
  14016. this.tipsNode = (this.getChild("tipsNode"));
  14017. this.awardNode = (this.getChild("awardNode"));
  14018. }
  14019. }
  14020. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  14021. class ui_Component132_1 extends fgui.GComponent {
  14022. static createInstance() {
  14023. return (fgui.UIPackage.createObject("game", "Component132_1"));
  14024. }
  14025. onConstruct() {
  14026. this.n25 = (this.getChild("n25"));
  14027. this.n26 = (this.getChild("n26"));
  14028. this.n27 = (this.getChild("n27"));
  14029. this.t0 = this.getTransition("t0");
  14030. }
  14031. }
  14032. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  14033. class ui_SecretaryDisplay extends fgui.GComponent {
  14034. static createInstance() {
  14035. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  14036. }
  14037. onConstruct() {
  14038. this.n2 = (this.getChild("n2"));
  14039. this.levelTxt = (this.getChild("levelTxt"));
  14040. this.n4 = (this.getChild("n4"));
  14041. this.secretary = (this.getChild("secretary"));
  14042. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14043. this.n16 = (this.getChild("n16"));
  14044. this.n37 = (this.getChild("n37"));
  14045. this.n41 = (this.getChild("n41"));
  14046. this.n14 = (this.getChild("n14"));
  14047. this.n17 = (this.getChild("n17"));
  14048. this.heightTxt = (this.getChild("heightTxt"));
  14049. this.n46 = (this.getChild("n46"));
  14050. this.n36 = (this.getChild("n36"));
  14051. this.n38 = (this.getChild("n38"));
  14052. this.foodTxt = (this.getChild("foodTxt"));
  14053. this.n47 = (this.getChild("n47"));
  14054. this.n40 = (this.getChild("n40"));
  14055. this.n42 = (this.getChild("n42"));
  14056. this.historyTxt = (this.getChild("historyTxt"));
  14057. this.n48 = (this.getChild("n48"));
  14058. this.nameImg = (this.getChild("nameImg"));
  14059. this.n12 = (this.getChild("n12"));
  14060. this.n49 = (this.getChild("n49"));
  14061. this.t0 = this.getTransition("t0");
  14062. }
  14063. }
  14064. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14065. class ui_BallRodDisplay extends fgui.GComponent {
  14066. static createInstance() {
  14067. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14068. }
  14069. onConstruct() {
  14070. this.c1 = this.getController("c1");
  14071. this.n31 = (this.getChild("n31"));
  14072. this.n6 = (this.getChild("n6"));
  14073. this.nameTxt = (this.getChild("nameTxt"));
  14074. this.rodImg = (this.getChild("rodImg"));
  14075. this.levelNode = (this.getChild("levelNode"));
  14076. this.eftRod = (this.getChild("eftRod"));
  14077. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14078. }
  14079. }
  14080. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14081. class ui_Component111_11 extends fgui.GComponent {
  14082. static createInstance() {
  14083. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14084. }
  14085. onConstruct() {
  14086. this.n68 = (this.getChild("n68"));
  14087. this.n69 = (this.getChild("n69"));
  14088. }
  14089. }
  14090. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14091. class ui_Component112 extends fgui.GComponent {
  14092. static createInstance() {
  14093. return (fgui.UIPackage.createObject("game", "Component112"));
  14094. }
  14095. onConstruct() {
  14096. this.n68 = (this.getChild("n68"));
  14097. this.n70 = (this.getChild("n70"));
  14098. this.myMask = (this.getChild("myMask"));
  14099. }
  14100. }
  14101. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14102. class ui_Component111 extends fgui.GComponent {
  14103. static createInstance() {
  14104. return (fgui.UIPackage.createObject("game", "Component111"));
  14105. }
  14106. onConstruct() {
  14107. this.n68 = (this.getChild("n68"));
  14108. this.myMask = (this.getChild("myMask"));
  14109. }
  14110. }
  14111. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14112. class ui_Component144 extends fgui.GButton {
  14113. static createInstance() {
  14114. return (fgui.UIPackage.createObject("game", "Component144"));
  14115. }
  14116. onConstruct() {
  14117. this.n8 = (this.getChild("n8"));
  14118. }
  14119. }
  14120. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14121. class ui_Sign_com2 extends fgui.GComponent {
  14122. static createInstance() {
  14123. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14124. }
  14125. onConstruct() {
  14126. this.n0 = (this.getChild("n0"));
  14127. this.n1 = (this.getChild("n1"));
  14128. this.t0 = this.getTransition("t0");
  14129. }
  14130. }
  14131. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14132. class ui_Sign_guang extends fgui.GComponent {
  14133. static createInstance() {
  14134. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14135. }
  14136. onConstruct() {
  14137. this.n1 = (this.getChild("n1"));
  14138. this.n2 = (this.getChild("n2"));
  14139. this.n3 = (this.getChild("n3"));
  14140. this.n4 = (this.getChild("n4"));
  14141. this.n5 = (this.getChild("n5"));
  14142. this.n6 = (this.getChild("n6"));
  14143. this.n8 = (this.getChild("n8"));
  14144. }
  14145. }
  14146. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14147. class ui_SignMax extends fgui.GComponent {
  14148. static createInstance() {
  14149. return (fgui.UIPackage.createObject("game", "SignMax"));
  14150. }
  14151. onConstruct() {
  14152. this.c1 = this.getController("c1");
  14153. this.n7 = (this.getChild("n7"));
  14154. this.n15 = (this.getChild("n15"));
  14155. this.n8 = (this.getChild("n8"));
  14156. this.titleTxt = (this.getChild("titleTxt"));
  14157. this.myIcon1 = (this.getChild("myIcon1"));
  14158. this.numTxt1 = (this.getChild("numTxt1"));
  14159. this.myIcon2 = (this.getChild("myIcon2"));
  14160. this.n20 = (this.getChild("n20"));
  14161. this.n17 = (this.getChild("n17"));
  14162. this.numTxt2 = (this.getChild("numTxt2"));
  14163. this.n12 = (this.getChild("n12"));
  14164. this.n13 = (this.getChild("n13"));
  14165. this.n21 = (this.getChild("n21"));
  14166. this.n14 = (this.getChild("n14"));
  14167. }
  14168. }
  14169. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14170. class ui_Sign_com2_1 extends fgui.GComponent {
  14171. static createInstance() {
  14172. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14173. }
  14174. onConstruct() {
  14175. this.n0 = (this.getChild("n0"));
  14176. this.n1 = (this.getChild("n1"));
  14177. this.t0 = this.getTransition("t0");
  14178. }
  14179. }
  14180. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14181. class ui_Sign_com5 extends fgui.GComponent {
  14182. static createInstance() {
  14183. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14184. }
  14185. onConstruct() {
  14186. this.n3 = (this.getChild("n3"));
  14187. this.n29 = (this.getChild("n29"));
  14188. this.n4 = (this.getChild("n4"));
  14189. this.day1 = (this.getChild("day1"));
  14190. this.day2 = (this.getChild("day2"));
  14191. this.day3 = (this.getChild("day3"));
  14192. this.day4 = (this.getChild("day4"));
  14193. this.day5 = (this.getChild("day5"));
  14194. this.day6 = (this.getChild("day6"));
  14195. this.day7 = (this.getChild("day7"));
  14196. this.t0 = this.getTransition("t0");
  14197. }
  14198. }
  14199. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  14200. class ui_Sign_com8 extends fgui.GComponent {
  14201. static createInstance() {
  14202. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  14203. }
  14204. onConstruct() {
  14205. this.n48 = (this.getChild("n48"));
  14206. this.womanTxt = (this.getChild("womanTxt"));
  14207. this.t0 = this.getTransition("t0");
  14208. }
  14209. }
  14210. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  14211. class ui_Sign_com6 extends fgui.GComponent {
  14212. static createInstance() {
  14213. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  14214. }
  14215. onConstruct() {
  14216. this.n2 = (this.getChild("n2"));
  14217. this.n3 = (this.getChild("n3"));
  14218. this.t0 = this.getTransition("t0");
  14219. }
  14220. }
  14221. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  14222. class ui_Sign_com7 extends fgui.GComponent {
  14223. static createInstance() {
  14224. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  14225. }
  14226. onConstruct() {
  14227. this.n29 = (this.getChild("n29"));
  14228. this.n2 = (this.getChild("n2"));
  14229. }
  14230. }
  14231. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  14232. class ui_UITurntable_com1_2 extends fgui.GComponent {
  14233. static createInstance() {
  14234. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  14235. }
  14236. onConstruct() {
  14237. this.n5 = (this.getChild("n5"));
  14238. this.n4 = (this.getChild("n4"));
  14239. this.t0 = this.getTransition("t0");
  14240. }
  14241. }
  14242. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  14243. class ui_UITurntable_com2 extends fgui.GComponent {
  14244. static createInstance() {
  14245. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  14246. }
  14247. onConstruct() {
  14248. this.c1 = this.getController("c1");
  14249. this.n4 = (this.getChild("n4"));
  14250. this.n6 = (this.getChild("n6"));
  14251. this.n10 = (this.getChild("n10"));
  14252. this.n11 = (this.getChild("n11"));
  14253. this.n12 = (this.getChild("n12"));
  14254. this.n13 = (this.getChild("n13"));
  14255. this.n14 = (this.getChild("n14"));
  14256. this.n15 = (this.getChild("n15"));
  14257. this.n16 = (this.getChild("n16"));
  14258. this.n17 = (this.getChild("n17"));
  14259. this.n18 = (this.getChild("n18"));
  14260. this.n19 = (this.getChild("n19"));
  14261. this.n20 = (this.getChild("n20"));
  14262. this.n21 = (this.getChild("n21"));
  14263. this.n22 = (this.getChild("n22"));
  14264. this.n23 = (this.getChild("n23"));
  14265. this.n24 = (this.getChild("n24"));
  14266. this.n25 = (this.getChild("n25"));
  14267. this.n26 = (this.getChild("n26"));
  14268. this.n27 = (this.getChild("n27"));
  14269. this.n28 = (this.getChild("n28"));
  14270. this.n29 = (this.getChild("n29"));
  14271. this.n30 = (this.getChild("n30"));
  14272. this.n31 = (this.getChild("n31"));
  14273. this.n32 = (this.getChild("n32"));
  14274. this.n33 = (this.getChild("n33"));
  14275. }
  14276. }
  14277. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  14278. class ui_UITurntable_com1_1 extends fgui.GComponent {
  14279. static createInstance() {
  14280. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  14281. }
  14282. onConstruct() {
  14283. this.n5 = (this.getChild("n5"));
  14284. this.n4 = (this.getChild("n4"));
  14285. this.t0 = this.getTransition("t0");
  14286. }
  14287. }
  14288. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  14289. class ui_UITurntable_com5 extends fgui.GComponent {
  14290. static createInstance() {
  14291. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  14292. }
  14293. onConstruct() {
  14294. this.flashNode = (this.getChild("flashNode"));
  14295. this.rotNode = (this.getChild("rotNode"));
  14296. this.n3 = (this.getChild("n3"));
  14297. this.n21 = (this.getChild("n21"));
  14298. this.t0 = this.getTransition("t0");
  14299. }
  14300. }
  14301. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14302. class ui_UITurntable_com7 extends fgui.GComponent {
  14303. static createInstance() {
  14304. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14305. }
  14306. onConstruct() {
  14307. this.n2 = (this.getChild("n2"));
  14308. this.n35 = (this.getChild("n35"));
  14309. this.img1 = (this.getChild("img1"));
  14310. this.img2 = (this.getChild("img2"));
  14311. this.img3 = (this.getChild("img3"));
  14312. this.img4 = (this.getChild("img4"));
  14313. this.img6 = (this.getChild("img6"));
  14314. this.img5 = (this.getChild("img5"));
  14315. this.txt1 = (this.getChild("txt1"));
  14316. this.txt2 = (this.getChild("txt2"));
  14317. this.txt3 = (this.getChild("txt3"));
  14318. this.txt4 = (this.getChild("txt4"));
  14319. this.txt5 = (this.getChild("txt5"));
  14320. this.txt6 = (this.getChild("txt6"));
  14321. }
  14322. }
  14323. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14324. class ui_UITurntable_com9 extends fgui.GComponent {
  14325. static createInstance() {
  14326. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14327. }
  14328. onConstruct() {
  14329. this.n38 = (this.getChild("n38"));
  14330. this.n39 = (this.getChild("n39"));
  14331. }
  14332. }
  14333. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14334. class ui_UITurntable_com10 extends fgui.GComponent {
  14335. static createInstance() {
  14336. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14337. }
  14338. onConstruct() {
  14339. this.n39 = (this.getChild("n39"));
  14340. this.n40 = (this.getChild("n40"));
  14341. this.t0 = this.getTransition("t0");
  14342. }
  14343. }
  14344. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14345. class ui_UITurntable_com11 extends fgui.GComponent {
  14346. static createInstance() {
  14347. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14348. }
  14349. onConstruct() {
  14350. this.n38 = (this.getChild("n38"));
  14351. this.n39 = (this.getChild("n39"));
  14352. this.n40 = (this.getChild("n40"));
  14353. this.t0 = this.getTransition("t0");
  14354. }
  14355. }
  14356. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14357. class ui_UITurntable_com12 extends fgui.GComponent {
  14358. static createInstance() {
  14359. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14360. }
  14361. onConstruct() {
  14362. this.n43 = (this.getChild("n43"));
  14363. this.barNode = (this.getChild("barNode"));
  14364. this.tipsTxt = (this.getChild("tipsTxt"));
  14365. this.n45 = (this.getChild("n45"));
  14366. this.boxBtn = (this.getChild("boxBtn"));
  14367. }
  14368. }
  14369. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14370. class ui_UITurntable_com1 extends fgui.GButton {
  14371. static createInstance() {
  14372. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14373. }
  14374. onConstruct() {
  14375. this.n41 = (this.getChild("n41"));
  14376. this.n42 = (this.getChild("n42"));
  14377. this.t0 = this.getTransition("t0");
  14378. }
  14379. }
  14380. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14381. class ui_UITurntable_com3 extends fgui.GComponent {
  14382. static createInstance() {
  14383. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14384. }
  14385. onConstruct() {
  14386. this.n48 = (this.getChild("n48"));
  14387. this.womanTxt = (this.getChild("womanTxt"));
  14388. this.t0 = this.getTransition("t0");
  14389. }
  14390. }
  14391. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14392. class ui_cancelBtn2 extends fgui.GButton {
  14393. static createInstance() {
  14394. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14395. }
  14396. onConstruct() {
  14397. this.c1 = this.getController("c1");
  14398. this.n0 = (this.getChild("n0"));
  14399. this.n1 = (this.getChild("n1"));
  14400. this.n2 = (this.getChild("n2"));
  14401. this.n3 = (this.getChild("n3"));
  14402. this.n4 = (this.getChild("n4"));
  14403. this.n5 = (this.getChild("n5"));
  14404. this.n6 = (this.getChild("n6"));
  14405. this.n7 = (this.getChild("n7"));
  14406. this.n8 = (this.getChild("n8"));
  14407. this.powerEft = (this.getChild("powerEft"));
  14408. }
  14409. }
  14410. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14411. class ui_shareBtn2 extends fgui.GButton {
  14412. static createInstance() {
  14413. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14414. }
  14415. onConstruct() {
  14416. this.c1 = this.getController("c1");
  14417. this.n2 = (this.getChild("n2"));
  14418. this.n24 = (this.getChild("n24"));
  14419. this.n1 = (this.getChild("n1"));
  14420. this.n3 = (this.getChild("n3"));
  14421. this.n23 = (this.getChild("n23"));
  14422. this.n4 = (this.getChild("n4"));
  14423. this.n5 = (this.getChild("n5"));
  14424. this.n6 = (this.getChild("n6"));
  14425. this.n20 = (this.getChild("n20"));
  14426. this.n21 = (this.getChild("n21"));
  14427. this.n22 = (this.getChild("n22"));
  14428. this.powerEft = (this.getChild("powerEft"));
  14429. }
  14430. }
  14431. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14432. class ui_UIMoney extends fgui.GComponent {
  14433. static createInstance() {
  14434. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14435. }
  14436. onConstruct() {
  14437. this.c1 = this.getController("c1");
  14438. this.n4 = (this.getChild("n4"));
  14439. this.coinImg = (this.getChild("coinImg"));
  14440. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14441. this.coinTxt = (this.getChild("coinTxt"));
  14442. this.n7 = (this.getChild("n7"));
  14443. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14444. this.diamondTxt = (this.getChild("diamondTxt"));
  14445. this.diamondImg = (this.getChild("diamondImg"));
  14446. this.n12 = (this.getChild("n12"));
  14447. this.powerImg = (this.getChild("powerImg"));
  14448. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14449. this.powerTxt = (this.getChild("powerTxt"));
  14450. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14451. }
  14452. }
  14453. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14454. class ui_backBtn extends fgui.GButton {
  14455. static createInstance() {
  14456. return (fgui.UIPackage.createObject("game", "backBtn"));
  14457. }
  14458. onConstruct() {
  14459. this.n0 = (this.getChild("n0"));
  14460. this.t0 = this.getTransition("t0");
  14461. this.t1 = this.getTransition("t1");
  14462. }
  14463. }
  14464. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14465. class ui_MoneyBtn extends fgui.GButton {
  14466. static createInstance() {
  14467. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14468. }
  14469. onConstruct() {
  14470. this.button = this.getController("button");
  14471. this.n0 = (this.getChild("n0"));
  14472. }
  14473. }
  14474. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14475. class ui_UIMoneyBtn extends fgui.GComponent {
  14476. static createInstance() {
  14477. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14478. }
  14479. onConstruct() {
  14480. this.n1 = (this.getChild("n1"));
  14481. this.closeBtn = (this.getChild("closeBtn"));
  14482. }
  14483. }
  14484. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14485. class ui_Component64 extends fgui.GComponent {
  14486. static createInstance() {
  14487. return (fgui.UIPackage.createObject("game", "Component64"));
  14488. }
  14489. onConstruct() {
  14490. this.n57 = (this.getChild("n57"));
  14491. this.n54 = (this.getChild("n54"));
  14492. this.n55 = (this.getChild("n55"));
  14493. this.n56 = (this.getChild("n56"));
  14494. this.t1 = this.getTransition("t1");
  14495. }
  14496. }
  14497. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14498. class ui_Component41_3 extends fgui.GComponent {
  14499. static createInstance() {
  14500. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14501. }
  14502. onConstruct() {
  14503. this.c1 = this.getController("c1");
  14504. this.n0 = (this.getChild("n0"));
  14505. this.n2 = (this.getChild("n2"));
  14506. this.cancelBtn = (this.getChild("cancelBtn"));
  14507. this.videoBtn = (this.getChild("videoBtn"));
  14508. this.n9 = (this.getChild("n9"));
  14509. this.n24 = (this.getChild("n24"));
  14510. this.n27 = (this.getChild("n27"));
  14511. this.titleTxt = (this.getChild("titleTxt"));
  14512. this.n28 = (this.getChild("n28"));
  14513. this.t0 = this.getTransition("t0");
  14514. }
  14515. }
  14516. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14517. class ui_dh_zs_4 extends fgui.GComponent {
  14518. static createInstance() {
  14519. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14520. }
  14521. onConstruct() {
  14522. this.n1 = (this.getChild("n1"));
  14523. this.n2 = (this.getChild("n2"));
  14524. this.n3 = (this.getChild("n3"));
  14525. this.n4 = (this.getChild("n4"));
  14526. this.n5 = (this.getChild("n5"));
  14527. this.n6 = (this.getChild("n6"));
  14528. this.n8 = (this.getChild("n8"));
  14529. this.t0 = this.getTransition("t0");
  14530. }
  14531. }
  14532. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14533. class ui_Component71_1 extends fgui.GButton {
  14534. static createInstance() {
  14535. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14536. }
  14537. onConstruct() {
  14538. this.n17 = (this.getChild("n17"));
  14539. this.t0 = this.getTransition("t0");
  14540. }
  14541. }
  14542. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14543. class ui_Component83 extends fgui.GComponent {
  14544. static createInstance() {
  14545. return (fgui.UIPackage.createObject("game", "Component83"));
  14546. }
  14547. onConstruct() {
  14548. this.c1 = this.getController("c1");
  14549. this.n17 = (this.getChild("n17"));
  14550. this.n19 = (this.getChild("n19"));
  14551. this.n20 = (this.getChild("n20"));
  14552. }
  14553. }
  14554. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14555. class ui_Component84 extends fgui.GComponent {
  14556. static createInstance() {
  14557. return (fgui.UIPackage.createObject("game", "Component84"));
  14558. }
  14559. onConstruct() {
  14560. this.c1 = this.getController("c1");
  14561. this.n4 = (this.getChild("n4"));
  14562. this.n22 = (this.getChild("n22"));
  14563. this.n23 = (this.getChild("n23"));
  14564. this.numTxt = (this.getChild("numTxt"));
  14565. this.n25 = (this.getChild("n25"));
  14566. this.n26 = (this.getChild("n26"));
  14567. }
  14568. }
  14569. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14570. class ui_Component84_1 extends fgui.GComponent {
  14571. static createInstance() {
  14572. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14573. }
  14574. onConstruct() {
  14575. this.c1 = this.getController("c1");
  14576. this.n4 = (this.getChild("n4"));
  14577. this.n22 = (this.getChild("n22"));
  14578. this.n23 = (this.getChild("n23"));
  14579. this.numTxt = (this.getChild("numTxt"));
  14580. this.n25 = (this.getChild("n25"));
  14581. this.n26 = (this.getChild("n26"));
  14582. }
  14583. }
  14584. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14585. class ui_Component85 extends fgui.GComponent {
  14586. static createInstance() {
  14587. return (fgui.UIPackage.createObject("game", "Component85"));
  14588. }
  14589. onConstruct() {
  14590. this.n1 = (this.getChild("n1"));
  14591. this.n6 = (this.getChild("n6"));
  14592. this.n2 = (this.getChild("n2"));
  14593. this.n3 = (this.getChild("n3"));
  14594. this.levelTxt = (this.getChild("levelTxt"));
  14595. this.n10 = (this.getChild("n10"));
  14596. this.n11 = (this.getChild("n11"));
  14597. this.n12 = (this.getChild("n12"));
  14598. this.n13 = (this.getChild("n13"));
  14599. this.n14 = (this.getChild("n14"));
  14600. this.modeNode = (this.getChild("modeNode"));
  14601. this.n18 = (this.getChild("n18"));
  14602. this.conditionTxt = (this.getChild("conditionTxt"));
  14603. this.diamondNode = (this.getChild("diamondNode"));
  14604. this.coinNode = (this.getChild("coinNode"));
  14605. this.startBtn = (this.getChild("startBtn"));
  14606. this.n28 = (this.getChild("n28"));
  14607. this.displayRoot = (this.getChild("displayRoot"));
  14608. this.t0 = this.getTransition("t0");
  14609. }
  14610. }
  14611. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14612. class ui_Component86 extends fgui.GButton {
  14613. static createInstance() {
  14614. return (fgui.UIPackage.createObject("game", "Component86"));
  14615. }
  14616. onConstruct() {
  14617. this.n15 = (this.getChild("n15"));
  14618. this.t0 = this.getTransition("t0");
  14619. }
  14620. }
  14621. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14622. class ui_Component87 extends fgui.GComponent {
  14623. static createInstance() {
  14624. return (fgui.UIPackage.createObject("game", "Component87"));
  14625. }
  14626. onConstruct() {
  14627. this.n66 = (this.getChild("n66"));
  14628. this.myProgress = (this.getChild("myProgress"));
  14629. this.starAni = (this.getChild("starAni"));
  14630. this.hpTxt = (this.getChild("hpTxt"));
  14631. this.n74 = (this.getChild("n74"));
  14632. this.n73 = (this.getChild("n73"));
  14633. this.ballTxt = (this.getChild("ballTxt"));
  14634. this.n76 = (this.getChild("n76"));
  14635. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14636. this.levelTxt = (this.getChild("levelTxt"));
  14637. this.star1 = (this.getChild("star1"));
  14638. this.star2 = (this.getChild("star2"));
  14639. this.star3 = (this.getChild("star3"));
  14640. }
  14641. }
  14642. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14643. class ui_Component88 extends fgui.GProgressBar {
  14644. static createInstance() {
  14645. return (fgui.UIPackage.createObject("game", "Component88"));
  14646. }
  14647. onConstruct() {
  14648. this.n68 = (this.getChild("n68"));
  14649. this.bar = (this.getChild("bar"));
  14650. }
  14651. }
  14652. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14653. class ui_Component89 extends fgui.GComponent {
  14654. static createInstance() {
  14655. return (fgui.UIPackage.createObject("game", "Component89"));
  14656. }
  14657. onConstruct() {
  14658. this.c1 = this.getController("c1");
  14659. this.n71 = (this.getChild("n71"));
  14660. this.n72 = (this.getChild("n72"));
  14661. }
  14662. }
  14663. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14664. class ui_Component90 extends fgui.GComponent {
  14665. static createInstance() {
  14666. return (fgui.UIPackage.createObject("game", "Component90"));
  14667. }
  14668. onConstruct() {
  14669. this.c1 = this.getController("c1");
  14670. this.n64 = (this.getChild("n64"));
  14671. this.n65 = (this.getChild("n65"));
  14672. this.n66 = (this.getChild("n66"));
  14673. this.t0 = this.getTransition("t0");
  14674. }
  14675. }
  14676. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14677. class ui_Component127 extends fgui.GButton {
  14678. static createInstance() {
  14679. return (fgui.UIPackage.createObject("game", "Component127"));
  14680. }
  14681. onConstruct() {
  14682. this.n5 = (this.getChild("n5"));
  14683. }
  14684. }
  14685. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14686. class gameBinder {
  14687. static bindAll() {
  14688. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14689. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14690. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14691. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14692. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14693. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14694. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14695. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14696. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14697. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14698. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14699. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14700. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14701. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14702. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14703. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14704. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14705. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14706. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14707. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14708. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14709. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14710. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14711. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14712. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14713. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14714. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14715. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14716. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14717. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14718. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14719. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14720. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14721. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14722. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14723. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14724. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14725. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14726. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14727. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14728. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14729. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14730. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14731. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14732. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14733. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14734. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14735. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14736. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14737. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14738. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14739. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14740. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14741. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14742. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14743. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14744. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14745. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14746. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14747. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14748. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14749. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14750. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14751. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14752. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14753. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14754. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14755. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14756. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14757. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14758. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14759. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14760. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14761. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14762. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14763. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14764. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14765. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14766. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14767. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14768. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14769. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14770. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14771. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14772. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14773. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14774. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14775. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14776. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14777. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14778. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14779. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14780. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  14781. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14782. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14783. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14784. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14785. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14786. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14787. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14788. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14789. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14790. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14791. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14792. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14793. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14794. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14795. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14796. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14797. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14798. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14799. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14800. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14801. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14802. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14803. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14804. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14805. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14806. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14807. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14808. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14809. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14810. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14811. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14812. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14813. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14814. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14815. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14816. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14817. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14818. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14819. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14820. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14821. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14822. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14823. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14824. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14825. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14826. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14827. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14828. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14829. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14830. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14831. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14832. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14833. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14834. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14835. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14836. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14837. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14838. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14839. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14840. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14841. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14842. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14843. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14844. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14845. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14846. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14847. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14848. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14849. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14850. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14851. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14852. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14853. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14854. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14855. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14856. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14857. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14858. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14859. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14860. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14861. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14862. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14863. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14864. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14865. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14866. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14867. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14868. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14869. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14870. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14871. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14872. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14873. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14874. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14875. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14876. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14877. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14878. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14879. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14880. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14881. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14882. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14883. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14884. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14885. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14886. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14887. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14888. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14889. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14890. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14891. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14892. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14893. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14894. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14895. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14896. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14897. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14898. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14899. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14900. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14901. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14902. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14903. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14904. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14905. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14906. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14907. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14908. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14909. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14910. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14911. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14912. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14913. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14914. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14915. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14916. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14917. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14918. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14919. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14920. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14921. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14922. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14923. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14924. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14925. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14926. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14927. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14928. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14929. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14930. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14931. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14932. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14933. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14934. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14935. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14936. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14937. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14938. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14939. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14940. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14941. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14942. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14943. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14944. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14945. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14946. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14947. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14948. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14949. }
  14950. }
  14951. class ui_btn6 extends fgui.GButton {
  14952. static createInstance() {
  14953. return (fgui.UIPackage.createObject("loading", "btn6"));
  14954. }
  14955. onConstruct() {
  14956. this.n6 = (this.getChild("n6"));
  14957. this.n1 = (this.getChild("n1"));
  14958. }
  14959. }
  14960. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14961. class ui_xyItem extends fgui.GComponent {
  14962. static createInstance() {
  14963. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14964. }
  14965. onConstruct() {
  14966. this.xyItem = (this.getChild("xyItem"));
  14967. }
  14968. }
  14969. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14970. class ui_loadinfo extends fgui.GProgressBar {
  14971. static createInstance() {
  14972. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14973. }
  14974. onConstruct() {
  14975. this.bg = (this.getChild("bg"));
  14976. this.bar = (this.getChild("bar"));
  14977. this.title = (this.getChild("title"));
  14978. this.ani = (this.getChild("ani"));
  14979. }
  14980. }
  14981. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14982. class ui_xyNode extends fgui.GComponent {
  14983. static createInstance() {
  14984. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14985. }
  14986. onConstruct() {
  14987. this.n0 = (this.getChild("n0"));
  14988. this.btnYes = (this.getChild("btnYes"));
  14989. this.btnNo = (this.getChild("btnNo"));
  14990. this.btnKnown = (this.getChild("btnKnown"));
  14991. this.btnSure = (this.getChild("btnSure"));
  14992. this.txtWelcom = (this.getChild("txtWelcom"));
  14993. this.txtXy = (this.getChild("txtXy"));
  14994. this.n75 = (this.getChild("n75"));
  14995. this.btnXy1 = (this.getChild("btnXy1"));
  14996. this.btnXy3 = (this.getChild("btnXy3"));
  14997. this.btnXy2 = (this.getChild("btnXy2"));
  14998. this.n74 = (this.getChild("n74"));
  14999. this.xy1 = (this.getChild("xy1"));
  15000. this.txtTitle = (this.getChild("txtTitle"));
  15001. this.btnBack = (this.getChild("btnBack"));
  15002. this.xyList = (this.getChild("xyList"));
  15003. this.xy2 = (this.getChild("xy2"));
  15004. this.xyNode = (this.getChild("xyNode"));
  15005. }
  15006. }
  15007. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  15008. class ui_ageNode extends fgui.GComponent {
  15009. static createInstance() {
  15010. return (fgui.UIPackage.createObject("loading", "ageNode"));
  15011. }
  15012. onConstruct() {
  15013. this.n3 = (this.getChild("n3"));
  15014. this.n7 = (this.getChild("n7"));
  15015. this.n4 = (this.getChild("n4"));
  15016. this.btnAge = (this.getChild("btnAge"));
  15017. this.ageNode = (this.getChild("ageNode"));
  15018. }
  15019. }
  15020. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  15021. class ui_rnNode extends fgui.GComponent {
  15022. static createInstance() {
  15023. return (fgui.UIPackage.createObject("loading", "rnNode"));
  15024. }
  15025. onConstruct() {
  15026. this.n28 = (this.getChild("n28"));
  15027. this.n30 = (this.getChild("n30"));
  15028. this.n33 = (this.getChild("n33"));
  15029. this.rn1 = (this.getChild("rn1"));
  15030. this.n40 = (this.getChild("n40"));
  15031. this.n41 = (this.getChild("n41"));
  15032. this.rn3 = (this.getChild("rn3"));
  15033. this.n37 = (this.getChild("n37"));
  15034. this.n39 = (this.getChild("n39"));
  15035. this.rn2 = (this.getChild("rn2"));
  15036. this.n47 = (this.getChild("n47"));
  15037. this.n49 = (this.getChild("n49"));
  15038. this.n44 = (this.getChild("n44"));
  15039. this.inputCode = (this.getChild("inputCode"));
  15040. this.inputName = (this.getChild("inputName"));
  15041. this.n48 = (this.getChild("n48"));
  15042. this.n50 = (this.getChild("n50"));
  15043. this.rn4 = (this.getChild("rn4"));
  15044. this.btnCheck = (this.getChild("btnCheck"));
  15045. this.btnExit = (this.getChild("btnExit"));
  15046. this.btnDone = (this.getChild("btnDone"));
  15047. this.rnNode = (this.getChild("rnNode"));
  15048. }
  15049. }
  15050. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  15051. class ui_tipNode extends fgui.GComponent {
  15052. static createInstance() {
  15053. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15054. }
  15055. onConstruct() {
  15056. this.bg = (this.getChild("bg"));
  15057. this.n55 = (this.getChild("n55"));
  15058. this.n56 = (this.getChild("n56"));
  15059. this.tipNode = (this.getChild("tipNode"));
  15060. }
  15061. }
  15062. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15063. class ui_fcmNode extends fgui.GComponent {
  15064. static createInstance() {
  15065. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15066. }
  15067. onConstruct() {
  15068. this.n63 = (this.getChild("n63"));
  15069. this.n62 = (this.getChild("n62"));
  15070. this.btnRn = (this.getChild("btnRn"));
  15071. this.n61 = (this.getChild("n61"));
  15072. this.n58 = (this.getChild("n58"));
  15073. this.fcmNode = (this.getChild("fcmNode"));
  15074. }
  15075. }
  15076. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15077. class ui_msgNode extends fgui.GComponent {
  15078. static createInstance() {
  15079. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15080. }
  15081. onConstruct() {
  15082. this.n69 = (this.getChild("n69"));
  15083. this.txtMsg = (this.getChild("txtMsg"));
  15084. this.msgNode = (this.getChild("msgNode"));
  15085. }
  15086. }
  15087. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15088. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15089. static createInstance() {
  15090. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15091. }
  15092. onConstruct() {
  15093. this.n1 = (this.getChild("n1"));
  15094. this.n13 = (this.getChild("n13"));
  15095. this.n14 = (this.getChild("n14"));
  15096. this.n15 = (this.getChild("n15"));
  15097. this.n3 = (this.getChild("n3"));
  15098. this.n4 = (this.getChild("n4"));
  15099. this.n5 = (this.getChild("n5"));
  15100. this.n6 = (this.getChild("n6"));
  15101. this.n7 = (this.getChild("n7"));
  15102. this.n8 = (this.getChild("n8"));
  15103. this.n9 = (this.getChild("n9"));
  15104. this.n10 = (this.getChild("n10"));
  15105. this.n12 = (this.getChild("n12"));
  15106. this.n11 = (this.getChild("n11"));
  15107. this.n16 = (this.getChild("n16"));
  15108. this.n17 = (this.getChild("n17"));
  15109. this.n18 = (this.getChild("n18"));
  15110. this.n20 = (this.getChild("n20"));
  15111. this.n21 = (this.getChild("n21"));
  15112. this.t0 = this.getTransition("t0");
  15113. }
  15114. }
  15115. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15116. class ui_btn5 extends fgui.GButton {
  15117. static createInstance() {
  15118. return (fgui.UIPackage.createObject("loading", "btn5"));
  15119. }
  15120. onConstruct() {
  15121. this.n9 = (this.getChild("n9"));
  15122. this.n1 = (this.getChild("n1"));
  15123. }
  15124. }
  15125. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15126. class ui_UILoading extends fgui.GComponent {
  15127. static createInstance() {
  15128. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15129. }
  15130. onConstruct() {
  15131. this.n12 = (this.getChild("n12"));
  15132. this.loadinfo = (this.getChild("loadinfo"));
  15133. this.n13 = (this.getChild("n13"));
  15134. this.txtLoad = (this.getChild("txtLoad"));
  15135. this.n18 = (this.getChild("n18"));
  15136. }
  15137. }
  15138. ui_UILoading.URL = "ui://37nctnhwphc33";
  15139. class ui_AgeItem extends fgui.GComponent {
  15140. static createInstance() {
  15141. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15142. }
  15143. onConstruct() {
  15144. this.txtAge = (this.getChild("txtAge"));
  15145. }
  15146. }
  15147. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15148. class ui_btn1 extends fgui.GButton {
  15149. static createInstance() {
  15150. return (fgui.UIPackage.createObject("loading", "btn1"));
  15151. }
  15152. onConstruct() {
  15153. this.n6 = (this.getChild("n6"));
  15154. this.n1 = (this.getChild("n1"));
  15155. }
  15156. }
  15157. ui_btn1.URL = "ui://37nctnhwxe622p";
  15158. class ui_btn3 extends fgui.GButton {
  15159. static createInstance() {
  15160. return (fgui.UIPackage.createObject("loading", "btn3"));
  15161. }
  15162. onConstruct() {
  15163. this.n9 = (this.getChild("n9"));
  15164. this.n1 = (this.getChild("n1"));
  15165. }
  15166. }
  15167. ui_btn3.URL = "ui://37nctnhwxe622s";
  15168. class ui_btn2 extends fgui.GButton {
  15169. static createInstance() {
  15170. return (fgui.UIPackage.createObject("loading", "btn2"));
  15171. }
  15172. onConstruct() {
  15173. this.n6 = (this.getChild("n6"));
  15174. this.n1 = (this.getChild("n1"));
  15175. }
  15176. }
  15177. ui_btn2.URL = "ui://37nctnhwxe622t";
  15178. class ui_btnBack extends fgui.GButton {
  15179. static createInstance() {
  15180. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15181. }
  15182. onConstruct() {
  15183. this.n6 = (this.getChild("n6"));
  15184. this.n7 = (this.getChild("n7"));
  15185. }
  15186. }
  15187. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15188. class ui_btnXy1 extends fgui.GButton {
  15189. static createInstance() {
  15190. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15191. }
  15192. onConstruct() {
  15193. this.n1 = (this.getChild("n1"));
  15194. }
  15195. }
  15196. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15197. class ui_btnXy2 extends fgui.GButton {
  15198. static createInstance() {
  15199. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15200. }
  15201. onConstruct() {
  15202. this.n1 = (this.getChild("n1"));
  15203. }
  15204. }
  15205. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  15206. class ui_btnXy3 extends fgui.GButton {
  15207. static createInstance() {
  15208. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15209. }
  15210. onConstruct() {
  15211. this.n1 = (this.getChild("n1"));
  15212. }
  15213. }
  15214. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15215. class ui_btn4 extends fgui.GButton {
  15216. static createInstance() {
  15217. return (fgui.UIPackage.createObject("loading", "btn4"));
  15218. }
  15219. onConstruct() {
  15220. this.n9 = (this.getChild("n9"));
  15221. this.n1 = (this.getChild("n1"));
  15222. }
  15223. }
  15224. ui_btn4.URL = "ui://37nctnhwxe622z";
  15225. class loadingBinder {
  15226. static bindAll() {
  15227. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15228. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15229. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15230. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15231. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15232. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15233. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15234. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15235. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15236. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15237. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15238. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15239. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15240. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15241. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15242. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15243. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15244. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15245. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15246. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15247. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15248. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15249. }
  15250. }
  15251. class UIMgr {
  15252. constructor() {
  15253. this._stage = null;
  15254. this._uiList = [];
  15255. this._showList = [];
  15256. this._bindPkgList = [];
  15257. this.uiIndex = 0;
  15258. }
  15259. static get inst() {
  15260. if (UIMgr._inst == null) {
  15261. UIMgr._inst = new UIMgr();
  15262. }
  15263. return UIMgr._inst;
  15264. }
  15265. setStage(s) {
  15266. if (this._stage) {
  15267. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15268. return;
  15269. }
  15270. this._stage = s;
  15271. }
  15272. clearTempData() {
  15273. console.log('zh:clearTempData start');
  15274. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  15275. console.log('zh:clearTempData end');
  15276. }
  15277. init() {
  15278. this.setStage(Laya.stage);
  15279. fairygui.UIConfig.defaultFont = "微软雅黑";
  15280. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15281. fairygui.UIConfig.packageFileExtension = "obj";
  15282. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15283. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15284. fairygui.GRoot.inst.width = Laya.stage.width;
  15285. fairygui.GRoot.inst.height = Laya.stage.height;
  15286. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15287. }
  15288. addAllUpdate() {
  15289. this.uiIndex = 0;
  15290. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15291. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15292. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15293. }
  15294. }
  15295. }
  15296. bindFUI(pkgname) {
  15297. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15298. return;
  15299. }
  15300. switch (pkgname) {
  15301. case fguiRes.loading:
  15302. fairygui.UIPackage.addPackage(pkgname);
  15303. loadingBinder.bindAll();
  15304. this._bindPkgList.push(pkgname);
  15305. break;
  15306. case fguiRes.game:
  15307. fairygui.UIPackage.addPackage(pkgname);
  15308. gameBinder.bindAll();
  15309. this._bindPkgList.push(pkgname);
  15310. break;
  15311. default:
  15312. break;
  15313. }
  15314. }
  15315. Show(cls, ...param) {
  15316. let nameStr = cls.uiName;
  15317. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15318. let temp = this._uiList[i];
  15319. let str = temp.className;
  15320. if (str == nameStr) {
  15321. if (temp.isMuti) {
  15322. if (temp.isHide) {
  15323. temp.show(...param);
  15324. this._uiList.splice(i, 1);
  15325. this._uiList.push(temp);
  15326. return temp;
  15327. }
  15328. }
  15329. else {
  15330. temp.show(...param);
  15331. this._uiList.splice(i, 1);
  15332. this._uiList.push(temp);
  15333. return temp;
  15334. }
  15335. }
  15336. }
  15337. let ui = new cls();
  15338. ui.className = nameStr;
  15339. this._showUI(ui, param);
  15340. return ui;
  15341. }
  15342. destroyUI(ui) {
  15343. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15344. let temp = this._uiList[i].className;
  15345. if (temp == ui.className) {
  15346. this._uiList.splice(i, 1);
  15347. break;
  15348. }
  15349. }
  15350. this.checkUIState();
  15351. }
  15352. _showUI(ui, param) {
  15353. this._uiList.push(ui);
  15354. ui.show(...param);
  15355. }
  15356. Hide(uiClass) {
  15357. let ui = this.getUI(uiClass);
  15358. if (ui && !ui.isHide) {
  15359. ui.hide();
  15360. }
  15361. }
  15362. getUI(ui) {
  15363. let nameStr = ui.uiName;
  15364. for (let index = 0; index < this._uiList.length; index++) {
  15365. let temp = this._uiList[index];
  15366. if (temp.className == nameStr) {
  15367. return temp;
  15368. }
  15369. }
  15370. return null;
  15371. }
  15372. isShow(cls) {
  15373. for (var i of this._uiList) {
  15374. if (i instanceof cls) {
  15375. return i.isShowing;
  15376. }
  15377. }
  15378. return false;
  15379. }
  15380. showUINum() {
  15381. let num = 0;
  15382. for (var i of this._uiList) {
  15383. if (i.isShowing) {
  15384. num++;
  15385. }
  15386. }
  15387. return num;
  15388. }
  15389. checkUIState() {
  15390. Laya.timer.clear(this, this._uiCheck);
  15391. Laya.timer.once(400, this, this._uiCheck);
  15392. }
  15393. _uiCheck() {
  15394. let showList = [];
  15395. for (var i of this._uiList) {
  15396. if (!i.isHide) {
  15397. showList.push(i);
  15398. }
  15399. }
  15400. for (let index = 0; index < showList.length; index++) {
  15401. if (index == showList.length - 1) {
  15402. showList[index].checkActive(true);
  15403. }
  15404. else {
  15405. showList[index].checkActive(false);
  15406. }
  15407. }
  15408. }
  15409. showTip(msg, time = 600, size = 30) {
  15410. }
  15411. }
  15412. class UIShowList {
  15413. }
  15414. class SoundMgr {
  15415. constructor() {
  15416. this.soundMax = 4;
  15417. this.isLoad = false;
  15418. this.soundMap = {};
  15419. this.isSound = true;
  15420. this.openShake = true;
  15421. SoundMgr._instance = this;
  15422. }
  15423. static getInstance() {
  15424. if (!this._instance) {
  15425. this._instance = new SoundMgr();
  15426. }
  15427. return this._instance;
  15428. }
  15429. init() {
  15430. console.log('zh:sm init 1');
  15431. Laya.SoundManager.autoReleaseSound = true;
  15432. Laya.SoundManager.autoStopMusic = true;
  15433. Laya.SoundManager.musicVolume = 0.3;
  15434. Laya.SoundManager.soundVolume = 0.5;
  15435. this.musicPlayed = false;
  15436. this.audioUrl = "asset/sound/ogg/";
  15437. console.log('zh:sm init 2');
  15438. console.log('zh:dev type ');
  15439. if (Laya.Browser.onAndroid) {
  15440. console.log('zh:dev type android');
  15441. this.audioUrl = "asset/sound/ogg/";
  15442. this.isLoad = true;
  15443. }
  15444. else {
  15445. console.log('zh:dev type not android');
  15446. this.audioUrl = "asset/sound/mp3/";
  15447. this.isLoad = true;
  15448. }
  15449. }
  15450. onSetting(isS) {
  15451. this.isSound = isS;
  15452. this.mute(!this.isSound);
  15453. }
  15454. clearCount() {
  15455. for (var key in this.soundMap) {
  15456. delete this.soundMap[key];
  15457. }
  15458. }
  15459. playMusic(path, loop = 0) {
  15460. console.log('zh:playMusic 1 PATH=' + path);
  15461. this.musicPath = path;
  15462. if (!this.isLoad) {
  15463. return;
  15464. }
  15465. if (!path || path == "") {
  15466. return;
  15467. }
  15468. if (!this.isSound) {
  15469. return;
  15470. }
  15471. this.musicPlayed = true;
  15472. let url = this.getUrl(path);
  15473. if (!Laya.Browser.onAndroid) {
  15474. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15475. this.play(url, loop);
  15476. }));
  15477. }
  15478. else {
  15479. this.play(url, loop);
  15480. }
  15481. }
  15482. play(url, loop) {
  15483. Laya.SoundManager.playMusic(url, loop);
  15484. }
  15485. getUrl(path) {
  15486. let url = this.audioUrl + path;
  15487. if (Laya.Browser.onAndroid) {
  15488. url += ".ogg";
  15489. }
  15490. else {
  15491. url += ".mp3";
  15492. }
  15493. return url;
  15494. }
  15495. pauseMusic(pause) {
  15496. if (pause) {
  15497. this.mute(true);
  15498. }
  15499. else if (this.isSound)
  15500. this.mute(false);
  15501. }
  15502. stopMusic() {
  15503. Laya.SoundManager.stopMusic();
  15504. if (Moyu.isNeedPlatAudio) {
  15505. Moyu.stopMusic();
  15506. }
  15507. }
  15508. mute(mute) {
  15509. if (Moyu.isNeedPlatAudio) {
  15510. Moyu.pauseMusic(mute);
  15511. }
  15512. else {
  15513. Laya.SoundManager.musicMuted = mute;
  15514. if (!mute && !this.musicPlayed && this.musicPath) {
  15515. this.playMusic(this.musicPath);
  15516. }
  15517. }
  15518. }
  15519. stopSound(path) {
  15520. let url = this.getUrl(path);
  15521. Laya.SoundManager.stopSound(url);
  15522. }
  15523. playSound(path, loop = 1, soundMax = this.soundMax) {
  15524. if (!this.isLoad)
  15525. return;
  15526. if (!this.isSound)
  15527. return;
  15528. if (!path || path == "")
  15529. return;
  15530. let url = this.getUrl(path);
  15531. if (Moyu.isNeedPlatAudio) {
  15532. Moyu.playSound(path, loop == 0);
  15533. }
  15534. else {
  15535. let count = 1;
  15536. if (this.soundMap[path])
  15537. count = this.soundMap[path] + 1;
  15538. if (count > soundMax)
  15539. return;
  15540. this.soundMap[path] = count;
  15541. Laya.SoundManager.playSound(url, loop);
  15542. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15543. }
  15544. }
  15545. removePath(path) {
  15546. if (this.soundMap[path]) {
  15547. let count = this.soundMap[path];
  15548. count--;
  15549. if (count < 1)
  15550. delete this.soundMap[path];
  15551. else
  15552. this.soundMap[path] = count;
  15553. }
  15554. }
  15555. playBtnSound() {
  15556. this.playSound("btn");
  15557. }
  15558. playGetSound() {
  15559. }
  15560. playCloseUISound() {
  15561. }
  15562. }
  15563. SoundMgr._instance = null;
  15564. var Handler$1 = Laya.Handler;
  15565. var EResType;
  15566. (function (EResType) {
  15567. EResType[EResType["none"] = 0] = "none";
  15568. EResType[EResType["nromal"] = 1] = "nromal";
  15569. EResType[EResType["td"] = 2] = "td";
  15570. EResType[EResType["sk"] = 3] = "sk";
  15571. })(EResType || (EResType = {}));
  15572. class CResLoader {
  15573. constructor(doneCall, proCall) {
  15574. this.completrCall = doneCall;
  15575. this.progressCall = proCall;
  15576. this.progressHander = new Handler$1(this, this.onProgress);
  15577. this.tdResMap = {};
  15578. }
  15579. load(resList) {
  15580. this.resCount = 0;
  15581. this.loadCount = 0;
  15582. for (let i = 0; i < resList.length; i++) {
  15583. let path = resList[i];
  15584. if (!path)
  15585. continue;
  15586. this.resCount++;
  15587. let type = this.getResType(path);
  15588. if (type == EResType.nromal)
  15589. this.loadNromal(path);
  15590. else if (type == EResType.td)
  15591. this.loadTd(path);
  15592. }
  15593. }
  15594. getRes(path) {
  15595. let type = this.getResType(path);
  15596. if (type == EResType.nromal)
  15597. return Laya.loader.getRes(path);
  15598. else if (type == EResType.td) {
  15599. let res = this.tdResMap[path];
  15600. if (res)
  15601. return res.clone();
  15602. return null;
  15603. }
  15604. }
  15605. destroy() {
  15606. this.progressHander.clear();
  15607. this.progressHander = null;
  15608. }
  15609. clearRes(path) {
  15610. let type = this.getResType(path);
  15611. if (type == EResType.nromal)
  15612. Laya.loader.clearRes(path);
  15613. else if (type == EResType.td) {
  15614. let obj = this.tdResMap[path];
  15615. if (obj)
  15616. obj.destroy();
  15617. delete this.tdResMap[path];
  15618. }
  15619. }
  15620. getResType(path) {
  15621. let exs = this.getExtension(path);
  15622. if (exs == "sk")
  15623. return EResType.sk;
  15624. if (exs == "ls" || exs == "lh" || exs == "lm")
  15625. return EResType.td;
  15626. else
  15627. return EResType.nromal;
  15628. }
  15629. getExtension(res) {
  15630. var index = res.lastIndexOf(".");
  15631. return res.substr(index + 1);
  15632. }
  15633. loadNromal(path) {
  15634. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15635. if (res) {
  15636. this.onLoad();
  15637. }
  15638. else
  15639. console.log("load res fail:" + path);
  15640. }), this.progressHander);
  15641. }
  15642. loadSk() {
  15643. }
  15644. loadTd(path) {
  15645. if (this.tdResMap[path]) {
  15646. this.onLoad();
  15647. return;
  15648. }
  15649. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15650. if (res) {
  15651. this.tdResMap[path] = res;
  15652. this.onLoad();
  15653. }
  15654. else
  15655. console.log("load res fail:" + path);
  15656. }));
  15657. }
  15658. onLoad() {
  15659. this.loadCount++;
  15660. this.onProgress(1);
  15661. if (this.loadCount >= this.resCount) {
  15662. this.completrCall.run();
  15663. }
  15664. }
  15665. onProgress(pro) {
  15666. let progress = (this.loadCount + pro) / this.resCount;
  15667. this.progressCall.runWith(progress);
  15668. }
  15669. }
  15670. var Handler$2 = Laya.Handler;
  15671. class ResInfo {
  15672. constructor() {
  15673. this.index = 0;
  15674. }
  15675. }
  15676. class ResMgr {
  15677. constructor() {
  15678. this.resList = [];
  15679. this.doneList = [];
  15680. this.resMap = {};
  15681. this.currentLoad = null;
  15682. this.completeHandler = new Handler$2(this, this.onComplete);
  15683. this.progressHandler = new Handler$2(this, this.onProgress);
  15684. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15685. }
  15686. static getInstance() {
  15687. if (ResMgr._instance == null) {
  15688. ResMgr._instance = new ResMgr();
  15689. }
  15690. return ResMgr._instance;
  15691. }
  15692. loadList(list, completeHandler, progressHandler) {
  15693. if (list.length < 1) {
  15694. completeHandler.run();
  15695. return;
  15696. }
  15697. let info = this.getResInfo();
  15698. info.resList = list;
  15699. info.completeHandler = completeHandler;
  15700. info.progressHandler = progressHandler;
  15701. this.resList.push(info);
  15702. this.startLoad();
  15703. }
  15704. loadFguiRes(list, completeHandler, progressHandler) {
  15705. Laya.loader.load(list, completeHandler, progressHandler);
  15706. }
  15707. loadAny(list, completeHandler, progressHandler) {
  15708. Laya.loader.load(list, completeHandler, progressHandler);
  15709. }
  15710. load(path, completeHandler, progressHandler) {
  15711. let count = this.resMap[path];
  15712. if (count && count > 0) {
  15713. if (completeHandler)
  15714. completeHandler.run();
  15715. }
  15716. else
  15717. this.loadList([path], completeHandler, progressHandler);
  15718. }
  15719. getRes(path) {
  15720. let res = this.resMap[path];
  15721. if (!res)
  15722. this.showLog("资源不存在:" + path);
  15723. else
  15724. return this.loader.getRes(path);
  15725. }
  15726. clearList(list, force = false) {
  15727. if (!list || list.length < 1)
  15728. return;
  15729. let cr = () => {
  15730. for (const k in list) {
  15731. let v = list[k];
  15732. if (!v)
  15733. continue;
  15734. if (force) {
  15735. this.loader.clearRes(v);
  15736. delete this.resMap[v];
  15737. }
  15738. else {
  15739. let count = this.resMap[v];
  15740. if (count && count > 1) {
  15741. count--;
  15742. this.resMap[v] = count;
  15743. }
  15744. else {
  15745. this.loader.clearRes(v);
  15746. delete this.resMap[v];
  15747. }
  15748. }
  15749. }
  15750. if (!window.hasOwnProperty("ks"))
  15751. Laya.Resource.destroyUnusedResources();
  15752. };
  15753. Laya.timer.clearAll(this);
  15754. Laya.timer.once(2000, this, cr);
  15755. }
  15756. clear3D() {
  15757. for (const k in this.loader.tdResMap) {
  15758. this.loader.clearRes(k);
  15759. if (this.resMap[k])
  15760. delete this.resMap[k];
  15761. }
  15762. if (!window.hasOwnProperty("ks"))
  15763. Laya.Resource.destroyUnusedResources();
  15764. }
  15765. clear(path, force = false) {
  15766. this.clearList([path], force);
  15767. }
  15768. getResInfo() {
  15769. if (this.doneList.length > 0)
  15770. return this.doneList.pop();
  15771. else
  15772. return new ResInfo();
  15773. }
  15774. startLoad() {
  15775. if (this.currentLoad)
  15776. return;
  15777. this.currentLoad = this.resList.pop();
  15778. if (this.currentLoad) {
  15779. this.loader.load(this.currentLoad.resList);
  15780. }
  15781. }
  15782. onComplete() {
  15783. if (!this.currentLoad)
  15784. return;
  15785. for (const k in this.currentLoad.resList) {
  15786. let v = this.currentLoad.resList[k];
  15787. let count = this.resMap[v];
  15788. if (count)
  15789. count++;
  15790. else
  15791. count = 1;
  15792. this.resMap[v] = count;
  15793. }
  15794. if (this.currentLoad.completeHandler)
  15795. this.currentLoad.completeHandler.run();
  15796. this.doneList.push(this.currentLoad);
  15797. this.currentLoad = null;
  15798. this.startLoad();
  15799. }
  15800. onProgress(pro) {
  15801. if (!this.currentLoad)
  15802. return;
  15803. if (this.currentLoad.progressHandler)
  15804. this.currentLoad.progressHandler.runWith(pro);
  15805. }
  15806. showLog(str, ...args) {
  15807. console.log("[ResLoader] " + str);
  15808. }
  15809. }
  15810. ResMgr._instance = null;
  15811. class EventMgr extends Laya.EventDispatcher {
  15812. }
  15813. let eventMgr = new EventMgr();
  15814. class ConfigMgr {
  15815. static getInstance() {
  15816. if (!this._instance) {
  15817. this._instance = new ConfigMgr();
  15818. }
  15819. return this._instance;
  15820. }
  15821. init() {
  15822. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15823. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15824. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15825. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15826. }
  15827. getUserInfoByIndex(index) {
  15828. return this.npcJson[index];
  15829. }
  15830. getRandomUserInfo() {
  15831. let index = xGame.tools.random(0, this.npcJson.length);
  15832. return this.npcJson[index];
  15833. }
  15834. getMaxBigMoveLength() {
  15835. return Object.keys(this.levelCfg).length;
  15836. }
  15837. getBigMoveLevelByIndex(index) {
  15838. let cfg = this.levelCfg;
  15839. cfg = cfg[index];
  15840. return cfg;
  15841. }
  15842. getRandomClassicLevel() {
  15843. let cfg = this.classicCfg;
  15844. let num = Object.keys(cfg).length;
  15845. let rand = xGame.common.randomNum(1, num);
  15846. return cfg[rand];
  15847. }
  15848. getPlaceBallByLevel(level) {
  15849. return this.placeBallCfg[level];
  15850. }
  15851. getMaxPlaceBall() {
  15852. return Object.keys(this.placeBallCfg).length;
  15853. }
  15854. }
  15855. class PoolD3Mgr {
  15856. constructor() {
  15857. this.pool = {};
  15858. }
  15859. static get ins() {
  15860. return this._ins || (this._ins = new PoolD3Mgr);
  15861. }
  15862. createList(key, prefab, parent) {
  15863. if (!this.pool[key]) {
  15864. this.pool[key] = {};
  15865. this.pool[key].prefab = prefab;
  15866. this.pool[key].list = [];
  15867. this.pool[key].parent = parent;
  15868. }
  15869. }
  15870. getItem(key) {
  15871. if (!this.pool[key]) {
  15872. return;
  15873. }
  15874. let temp;
  15875. if (this.pool[key].list.length > 0) {
  15876. temp = this.pool[key].list.pop();
  15877. }
  15878. else {
  15879. temp = this.pool[key].prefab.clone();
  15880. if (this.pool[key].parent) {
  15881. this.pool[key].parent.addChild(temp);
  15882. }
  15883. }
  15884. temp.active = true;
  15885. return temp;
  15886. }
  15887. putItem(key, obj) {
  15888. if (!this.pool[key]) {
  15889. return;
  15890. }
  15891. obj.active = false;
  15892. this.pool[key].list.push(obj);
  15893. }
  15894. }
  15895. let context$1 = context;
  15896. let uiMgr = UIMgr.inst;
  15897. let soundMgr = SoundMgr.getInstance();
  15898. let resMgr = ResMgr.getInstance();
  15899. let httpMgr = HttpMgr.getInstance();
  15900. let common = Common.getInstance();
  15901. let cfgMgr = ConfigMgr.getInstance();
  15902. let poolD3Mgr = PoolD3Mgr.ins;
  15903. let d3TexUrl = "res/d3Res/";
  15904. let d3ModeUrl = "res/unityRes/";
  15905. function setStageSize(view) {
  15906. if (view.width) {
  15907. view.width = Laya.stage.width;
  15908. view.height = Laya.stage.height;
  15909. }
  15910. }
  15911. function filledBg(view) {
  15912. let wh = Laya.stage.height / Laya.stage.width;
  15913. if (wh > 16 / 9) {
  15914. view.height = Laya.stage.height;
  15915. view.width = Laya.stage.height / 1334 * 750;
  15916. }
  15917. else {
  15918. view.width = Laya.stage.width;
  15919. view.height = Laya.stage.width / 750 * 1334;
  15920. }
  15921. }
  15922. function setNotch(view) {
  15923. if (view.height) {
  15924. view.y += context$1.notchHeight;
  15925. }
  15926. }
  15927. function showTip(str) {
  15928. uiMgr.Show(UIMsg, str);
  15929. }
  15930. function log(...args) {
  15931. console.log(args);
  15932. }
  15933. let xGame = {
  15934. context: context$1,
  15935. eventMgr,
  15936. resMgr,
  15937. uiMgr,
  15938. soundMgr,
  15939. define,
  15940. tools,
  15941. httpMgr,
  15942. d3TexUrl,
  15943. d3ModeUrl,
  15944. common,
  15945. cfgMgr,
  15946. poolD3Mgr,
  15947. setStageSize,
  15948. filledBg,
  15949. setNotch,
  15950. showTip,
  15951. log,
  15952. };
  15953. window["xGame"] = xGame;
  15954. let dataName = 'tBall_';
  15955. class UserData {
  15956. constructor() {
  15957. this.userId = "";
  15958. this.isAgree = false;
  15959. this.coinNum = 0;
  15960. this.gemNum = 0;
  15961. this.sound = true;
  15962. this.vibration = true;
  15963. this.currentDate = 0;
  15964. this.createTime = 0;
  15965. this.awardTime = 0;
  15966. this.roleId = 1;
  15967. this.roleList = [];
  15968. this.roleAds = [];
  15969. this.dressId = 101;
  15970. this.itemId = 201;
  15971. this.bigSkills = [1, 1, 1, 1, 1];
  15972. this.coin = 4000;
  15973. this.diamond = 0;
  15974. this.skillSuccessTimes = 0;
  15975. this.skillGuide = 0;
  15976. this.skillAccTimes = 0;
  15977. this.placeBallData = [];
  15978. this.shareDiamondTimes = 0;
  15979. this.dailyVideoShareTimes = 0;
  15980. this.secretary = [1, 0];
  15981. this.curSecretary = 0;
  15982. this.ballRod = [1, 0, 0, 0, 0, 1];
  15983. this.curBallRod = 5;
  15984. this.signData = 0;
  15985. this.signTime = 0;
  15986. this.drawTimes = 0;
  15987. this.drawAwardTimes = 0;
  15988. this.dailyfreeDrawTimes = 1;
  15989. this.power = 5;
  15990. this.powerTime = 0;
  15991. this.challengeTimes = 0;
  15992. this.extraSign = 0;
  15993. this.classicTimes = 0;
  15994. this.guideHelpLine = 0;
  15995. this.newUser = true;
  15996. this.rootBallFoul = 0;
  15997. this.timeoutFoul = 0;
  15998. this.roleList = [1];
  15999. }
  16000. saveData() {
  16001. let data = {};
  16002. for (let k in this) {
  16003. data[k.toString()] = this[k];
  16004. }
  16005. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  16006. }
  16007. getData() {
  16008. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  16009. if (ld) {
  16010. let localData = JSON.parse(ld);
  16011. if (localData) {
  16012. for (let k in this) {
  16013. let key = k.toString();
  16014. let data = localData[key];
  16015. if (data != undefined) {
  16016. this[k] = data;
  16017. }
  16018. }
  16019. }
  16020. }
  16021. }
  16022. }
  16023. class ItemData {
  16024. constructor() {
  16025. this.itemList = {};
  16026. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  16027. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  16028. }
  16029. saveData() {
  16030. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  16031. }
  16032. getData() {
  16033. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  16034. if (ld) {
  16035. let localData = JSON.parse(ld);
  16036. if (localData) {
  16037. this.itemList = localData;
  16038. }
  16039. }
  16040. }
  16041. }
  16042. class GameData {
  16043. constructor() {
  16044. this.curLevel = 0;
  16045. this.gameType = 1;
  16046. this.signIdx = 0;
  16047. this.signMax = 0;
  16048. this.rotaryTime = 0;
  16049. this.rotaryCount = 0;
  16050. this.rotaryList = [];
  16051. this.diyCount = 3;
  16052. this.awardIdx = 0;
  16053. this.shareNum = 2;
  16054. this.rankWeek = 0;
  16055. this.rankScore = 0;
  16056. this.gameCount = 0;
  16057. this.trySkill = -1;
  16058. this.tryTime = 0;
  16059. }
  16060. saveData() {
  16061. let data = {};
  16062. for (let k in this) {
  16063. data[k.toString()] = this[k];
  16064. }
  16065. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  16066. }
  16067. getData() {
  16068. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  16069. if (ld) {
  16070. let localData = JSON.parse(ld);
  16071. if (localData) {
  16072. for (let k in this) {
  16073. let key = k.toString();
  16074. let data = localData[key];
  16075. if (data != undefined) {
  16076. this[k] = data;
  16077. }
  16078. }
  16079. }
  16080. }
  16081. }
  16082. }
  16083. class DataMgr {
  16084. static Init() {
  16085. this.userData = new UserData();
  16086. this.gameData = new GameData();
  16087. this.itemData = new ItemData();
  16088. this.userData.getData();
  16089. this.gameData.getData();
  16090. this.itemData.getData();
  16091. this.roleId = this.userData.roleId;
  16092. this.resetUse();
  16093. }
  16094. static isNewDay() {
  16095. Moyu.isNewDay(this, (isnew) => {
  16096. xGame.common.isNewDay = isnew;
  16097. if (!isnew)
  16098. return;
  16099. DataMgr.setShareDiamondTimes(0, false);
  16100. DataMgr.setDailyVideoShareTimes(0, false);
  16101. DataMgr.setDailyfreeDrawTimes(1);
  16102. DataMgr.setExtraSign(0);
  16103. });
  16104. }
  16105. static deletData() {
  16106. Laya.LocalStorage.clear();
  16107. }
  16108. static upRankData() {
  16109. let num = xGame.common.getAllStarNum();
  16110. if (num > 0)
  16111. Moyu.upRankData(xGame.common.curRankID, num);
  16112. }
  16113. static addItem(id, count = 1) {
  16114. let v = this.itemData.itemList[id];
  16115. if (!v)
  16116. v = { id: id, count: count, adnum: 0, active: true };
  16117. else {
  16118. if (v.active) {
  16119. v.count += count;
  16120. }
  16121. else {
  16122. v.count = count;
  16123. v.active = true;
  16124. }
  16125. }
  16126. this.itemData.itemList[id] = v;
  16127. xGame.soundMgr.playGetSound();
  16128. this.saveItemData();
  16129. }
  16130. static hasItem(id) {
  16131. let v = this.itemData.itemList[id];
  16132. if (v && v.active)
  16133. return true;
  16134. return false;
  16135. }
  16136. static getItem(id) {
  16137. let v = this.itemData.itemList[id];
  16138. return v;
  16139. }
  16140. static getItemCount(id) {
  16141. let v = this.itemData.itemList[id];
  16142. if (v && v.active)
  16143. return v.count;
  16144. return 0;
  16145. }
  16146. static getItemAd(id) {
  16147. let v = this.itemData.itemList[id];
  16148. if (v) {
  16149. return v.adnum;
  16150. }
  16151. return 0;
  16152. }
  16153. static onItemAd(id, num = 1) {
  16154. let v = this.itemData.itemList[id];
  16155. if (!v)
  16156. v = { id: id, count: 1, adnum: num, active: false };
  16157. else
  16158. v.adnum += num;
  16159. this.itemData.itemList[id] = v;
  16160. this.saveItemData();
  16161. }
  16162. static costItem(id, count) {
  16163. let v = this.itemData.itemList[id];
  16164. if (v && v.active) {
  16165. if (v.count < count)
  16166. return false;
  16167. else {
  16168. v.count -= count;
  16169. this.itemData.itemList[id] = v;
  16170. return true;
  16171. }
  16172. }
  16173. return false;
  16174. }
  16175. static resetUse() {
  16176. this.dressId = this.userData.dressId;
  16177. this.itemId = this.userData.itemId;
  16178. }
  16179. static passLevel() {
  16180. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  16181. this.gameData.curLevel++;
  16182. this.curLevel = this.gameData.curLevel;
  16183. this.saveGameData();
  16184. }
  16185. static useRole(id) {
  16186. this.roleId = id;
  16187. if (this.hasRole(id)) {
  16188. this.userData.roleId = id;
  16189. this.saveUserData();
  16190. }
  16191. }
  16192. static addRole(id) {
  16193. if (this.hasRole(id))
  16194. return;
  16195. this.userData.roleList.push(id);
  16196. this.saveUserData();
  16197. }
  16198. static hasRole(id) {
  16199. return this.userData.roleList.indexOf(id) >= 0;
  16200. }
  16201. static gemEnough(num) {
  16202. return this.userData.gemNum >= num;
  16203. }
  16204. static roleHasAd(id) {
  16205. let count = this.userData.roleAds[id];
  16206. if (count != undefined && count >= 0)
  16207. return true;
  16208. else
  16209. return false;
  16210. }
  16211. static saveUserData(time = 500, event, arg) {
  16212. if (this.userSaving)
  16213. return;
  16214. this.userSaving = true;
  16215. Laya.timer.once(time, this, () => {
  16216. this.userSaving = false;
  16217. this.userData.saveData();
  16218. if (event)
  16219. xGame.eventMgr.event(event, arg);
  16220. });
  16221. }
  16222. static saveGameData() {
  16223. if (this.gameSaving)
  16224. return;
  16225. this.gameSaving = true;
  16226. Laya.timer.once(1000, this, () => {
  16227. this.gameSaving = false;
  16228. this.gameData.saveData();
  16229. });
  16230. }
  16231. static saveItemData() {
  16232. let fun = () => {
  16233. this.itemData.saveData();
  16234. };
  16235. Laya.timer.clear(this, fun);
  16236. Laya.timer.once(500, this, fun);
  16237. }
  16238. static saveData() {
  16239. this.saveUserData();
  16240. this.saveGameData();
  16241. }
  16242. static getBigSkillList() {
  16243. return this.userData.bigSkills;
  16244. }
  16245. static getBigSkillByIndex(index) {
  16246. return this.userData.bigSkills[index];
  16247. }
  16248. static setBigSkill(index, val, addUp = true) {
  16249. if (addUp) {
  16250. this.userData.bigSkills[index] += val;
  16251. }
  16252. else {
  16253. this.userData.bigSkills[index] = val;
  16254. }
  16255. this.saveUserData();
  16256. }
  16257. static coinEnough(need) {
  16258. if (typeof need != "number") {
  16259. console.error("金币格式错误");
  16260. return;
  16261. }
  16262. return this.userData.coin >= need;
  16263. }
  16264. static setCoin(val) {
  16265. if (typeof val != "number") {
  16266. return;
  16267. }
  16268. this.userData.coin += val;
  16269. this.saveUserData();
  16270. xGame.eventMgr.event(COIN_CHANGE);
  16271. }
  16272. static getCoin() {
  16273. return this.userData.coin;
  16274. }
  16275. static diamondEnough(need) {
  16276. if (typeof need != "number") {
  16277. console.error("金币格式错误");
  16278. return;
  16279. }
  16280. return this.userData.diamond >= need;
  16281. }
  16282. static setDiamond(val) {
  16283. if (typeof val != "number") {
  16284. return;
  16285. }
  16286. this.userData.diamond += val;
  16287. this.saveUserData();
  16288. xGame.eventMgr.event(DIAMOND_CHANGE);
  16289. }
  16290. static getDiamond() {
  16291. return this.userData.diamond;
  16292. }
  16293. static getSkillSuccessTimes() {
  16294. return this.userData.skillSuccessTimes;
  16295. }
  16296. static setSkillSuccessTimes(val, addUp = true) {
  16297. if (addUp)
  16298. this.userData.skillSuccessTimes += val;
  16299. else
  16300. this.userData.skillSuccessTimes = val;
  16301. this.saveUserData();
  16302. }
  16303. static getSkillAccTimes() {
  16304. return this.userData.skillAccTimes;
  16305. }
  16306. static setSkillAccTimes(val) {
  16307. this.userData.skillAccTimes += val;
  16308. this.saveUserData();
  16309. }
  16310. static getSkillGuide() {
  16311. if (!xGame.common.openGuide) {
  16312. return 1;
  16313. }
  16314. return this.userData.skillGuide;
  16315. }
  16316. static setSkillGuide(val) {
  16317. this.userData.skillGuide = val;
  16318. this.saveUserData();
  16319. }
  16320. static getPlaceBallLevelList() {
  16321. return this.userData.placeBallData;
  16322. }
  16323. static getPlaceBallLevel(level) {
  16324. let arr = this.userData.placeBallData;
  16325. let index = level - 1;
  16326. let out;
  16327. if (arr[index]) {
  16328. out = arr[index];
  16329. }
  16330. else {
  16331. let max = arr.length;
  16332. if (max == index) {
  16333. out = {
  16334. star: 0,
  16335. play: true,
  16336. isCur: true,
  16337. getAward: false
  16338. };
  16339. }
  16340. else {
  16341. out = {
  16342. star: 0,
  16343. play: false,
  16344. getAward: false
  16345. };
  16346. }
  16347. }
  16348. return out;
  16349. }
  16350. static setPlaceBallLevel(level, star) {
  16351. let arr = this.userData.placeBallData;
  16352. let index = level - 1;
  16353. if (arr[index]) {
  16354. arr[index].star = Math.max(arr[index].star, star);
  16355. }
  16356. else {
  16357. let max = arr.length;
  16358. if (max == index) {
  16359. arr.push({
  16360. star: star,
  16361. play: true,
  16362. getAward: false
  16363. });
  16364. }
  16365. else {
  16366. console.error("关卡存储出错");
  16367. }
  16368. }
  16369. this.saveUserData();
  16370. }
  16371. static setPlaceBallAward(level) {
  16372. let arr = this.userData.placeBallData;
  16373. let index = level - 1;
  16374. if (arr[index]) {
  16375. arr[index].getAward = true;
  16376. }
  16377. this.saveUserData();
  16378. }
  16379. static getShareDiamondTimes() {
  16380. return this.userData.shareDiamondTimes;
  16381. }
  16382. static setShareDiamondTimes(val, addUp = true) {
  16383. if (addUp) {
  16384. this.userData.shareDiamondTimes += val;
  16385. }
  16386. else {
  16387. this.userData.shareDiamondTimes = val;
  16388. }
  16389. this.saveUserData();
  16390. }
  16391. static getDailyVideoShareTimes() {
  16392. return this.userData.dailyVideoShareTimes;
  16393. }
  16394. static setDailyVideoShareTimes(val, addUp = true) {
  16395. if (addUp) {
  16396. this.userData.dailyVideoShareTimes += val;
  16397. }
  16398. else {
  16399. this.userData.dailyVideoShareTimes = val;
  16400. }
  16401. this.saveUserData();
  16402. }
  16403. static getSecretary(index) {
  16404. return this.userData.secretary[index];
  16405. }
  16406. static setSecretary(index, val) {
  16407. this.userData.secretary[index] = val;
  16408. this.saveUserData();
  16409. }
  16410. static getCurSecretary() {
  16411. return this.userData.curSecretary;
  16412. }
  16413. static setCurSecretary(index) {
  16414. this.userData.curSecretary = index;
  16415. this.saveUserData();
  16416. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16417. }
  16418. static getBallRod(index) {
  16419. return this.userData.ballRod[index];
  16420. }
  16421. static setBallRod(index, val) {
  16422. this.userData.ballRod[index] = val;
  16423. this.saveUserData();
  16424. }
  16425. static getCurBallRod() {
  16426. return this.userData.curBallRod;
  16427. }
  16428. static setCurBallRod(index) {
  16429. this.userData.curBallRod = index;
  16430. this.saveUserData();
  16431. }
  16432. static setSignData(val) {
  16433. this.userData.signData = val;
  16434. this.saveUserData();
  16435. }
  16436. static getSignData() {
  16437. return this.userData.signData;
  16438. }
  16439. static setSignTime(val) {
  16440. this.userData.signTime = val;
  16441. this.saveUserData();
  16442. }
  16443. static getSignTime() {
  16444. return this.userData.signTime;
  16445. }
  16446. static getDrawTimes() {
  16447. return this.userData.drawTimes;
  16448. }
  16449. static setDrawTimes(val, addUp = true) {
  16450. if (addUp) {
  16451. this.userData.drawTimes += val;
  16452. }
  16453. else {
  16454. this.userData.drawTimes = val;
  16455. }
  16456. this.saveUserData();
  16457. }
  16458. static getDrawAwardTimes() {
  16459. return this.userData.drawAwardTimes;
  16460. }
  16461. static setDrawAwardTimes(val) {
  16462. this.userData.drawAwardTimes = val;
  16463. this.saveUserData();
  16464. }
  16465. static getDailyfreeDrawTimes() {
  16466. return this.userData.dailyfreeDrawTimes;
  16467. }
  16468. static setDailyfreeDrawTimes(val) {
  16469. this.userData.dailyfreeDrawTimes = val;
  16470. this.saveUserData();
  16471. }
  16472. static setPower(val, addUp = true) {
  16473. if (addUp)
  16474. this.userData.power += val;
  16475. else
  16476. this.userData.power = val;
  16477. if (this.userData.power >= xGame.common.maxPower) {
  16478. this.userData.power = xGame.common.maxPower;
  16479. }
  16480. xGame.eventMgr.event(POWER_CHANGE, val);
  16481. this.saveUserData();
  16482. }
  16483. static getPower() {
  16484. return this.userData.power;
  16485. }
  16486. static setPowerTime(val) {
  16487. this.userData.powerTime = val;
  16488. this.saveUserData();
  16489. }
  16490. static getPowerTime() {
  16491. return this.userData.powerTime;
  16492. }
  16493. static powerEnough() {
  16494. return this.getPower() > 0;
  16495. }
  16496. static getChallengeTimes() {
  16497. return this.userData.challengeTimes;
  16498. }
  16499. static setChallengeTimes(val) {
  16500. this.userData.challengeTimes += val;
  16501. this.saveUserData();
  16502. }
  16503. static getExtraSign() {
  16504. return this.userData.extraSign;
  16505. }
  16506. static setExtraSign(val) {
  16507. this.userData.extraSign = val;
  16508. this.saveUserData();
  16509. }
  16510. static getClassicTimes() {
  16511. return this.userData.classicTimes;
  16512. }
  16513. static setClassicTimes() {
  16514. this.userData.classicTimes += 1;
  16515. this.saveUserData();
  16516. }
  16517. static getGuideHelpLine() {
  16518. return this.userData.guideHelpLine;
  16519. }
  16520. static setGuideHelpLine() {
  16521. this.userData.guideHelpLine = 1;
  16522. this.saveUserData();
  16523. }
  16524. static getNewUser() {
  16525. return this.userData.newUser;
  16526. }
  16527. static setNewUser() {
  16528. this.userData.newUser = false;
  16529. this.saveUserData();
  16530. }
  16531. static getRootBallFoul() {
  16532. return this.userData.rootBallFoul;
  16533. }
  16534. static setRootBallFoul() {
  16535. this.userData.rootBallFoul = 1;
  16536. this.saveUserData();
  16537. }
  16538. static getTimeoutFoul() {
  16539. return this.userData.timeoutFoul;
  16540. }
  16541. static setTimeoutFoul() {
  16542. this.userData.timeoutFoul = 1;
  16543. this.saveUserData();
  16544. }
  16545. }
  16546. DataMgr.isNewUser = false;
  16547. DataMgr.fristEnter = true;
  16548. DataMgr.levelType = 0;
  16549. DataMgr.awardId = 0;
  16550. DataMgr.awardCoin = 0;
  16551. DataMgr.sceneId = -1;
  16552. DataMgr.tryId = 0;
  16553. DataMgr.curLevel = 1;
  16554. DataMgr.vipLevel = 0;
  16555. DataMgr.maxLevel = 0;
  16556. DataMgr.awardRatio = 1;
  16557. DataMgr.gameList = [];
  16558. DataMgr.rankList = [];
  16559. DataMgr.recoverTime = 480000;
  16560. DataMgr.minScore = 0;
  16561. DataMgr.rankDis = 0;
  16562. DataMgr.userSaving = false;
  16563. DataMgr.gameSaving = false;
  16564. class D3Tween extends Laya.Script3D {
  16565. constructor() {
  16566. super();
  16567. this.isInited = false;
  16568. }
  16569. ;
  16570. init() {
  16571. if (this.isInited)
  16572. return;
  16573. this.isInited = true;
  16574. this.gameObj = this.owner;
  16575. this.transform = this.gameObj.transform;
  16576. }
  16577. get rotX() {
  16578. return this.transform.localRotationEulerX;
  16579. }
  16580. set rotX(v) {
  16581. this.transform.localRotationEulerX = v;
  16582. }
  16583. get rotY() {
  16584. return this.transform.localRotationEulerY;
  16585. }
  16586. set rotY(v) {
  16587. this.transform.localRotationEulerY = v;
  16588. }
  16589. get rotZ() {
  16590. return this.transform.localRotationEulerZ;
  16591. }
  16592. set rotZ(v) {
  16593. this.transform.localRotationEulerZ = v;
  16594. }
  16595. get posX() {
  16596. return this.transform.localPositionX;
  16597. }
  16598. set posX(v) {
  16599. this.transform.localPositionX = v;
  16600. }
  16601. get posY() {
  16602. return this.transform.localPositionY;
  16603. }
  16604. set posY(v) {
  16605. this.transform.localPositionY = v;
  16606. }
  16607. get posZ() {
  16608. return this.transform.localPositionZ;
  16609. }
  16610. set posZ(v) {
  16611. this.transform.localPositionZ = v;
  16612. }
  16613. get rotation() {
  16614. return this.transform.localRotation;
  16615. }
  16616. set rotation(v) {
  16617. this.transform.localRotation = v;
  16618. }
  16619. }
  16620. class D2Hole extends Laya.Script {
  16621. constructor() { super(); }
  16622. onTriggerEnter(collider) {
  16623. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16624. return;
  16625. }
  16626. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16627. if (collider.owner["mySrc"].isRunSkillAni) {
  16628. return;
  16629. }
  16630. if (collider.owner["mySrc"].number != 0) {
  16631. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16632. }
  16633. xGame.common.ballColliHole(collider);
  16634. xGame.common.recoverCameraView();
  16635. }
  16636. }
  16637. }
  16638. class Table extends Laya.Script3D {
  16639. constructor() {
  16640. super();
  16641. this.isSetBorder = false;
  16642. this.inited = false;
  16643. }
  16644. ;
  16645. onAwake() {
  16646. this.init();
  16647. }
  16648. init() {
  16649. if (this.inited)
  16650. return;
  16651. this.inited = true;
  16652. this.gameObj = this.owner;
  16653. this.border = this.gameObj.getChildByName("border");
  16654. }
  16655. setBorderPos() {
  16656. if (this.isSetBorder)
  16657. return;
  16658. this.isSetBorder = true;
  16659. let ui = xGame.common.gameUI.ui;
  16660. let bar1 = this.border.getChildByName("bar1");
  16661. let bar2 = this.border.getChildByName("bar2");
  16662. let bar3 = this.border.getChildByName("bar3");
  16663. let bar4 = this.border.getChildByName("bar4");
  16664. let bar5 = this.border.getChildByName("bar5");
  16665. let bar6 = this.border.getChildByName("bar6");
  16666. this.setInfo(bar1, ui.border.bar1, "box");
  16667. this.setInfo(bar2, ui.border.bar2, "box");
  16668. this.setInfo(bar3, ui.border.bar3, "box");
  16669. this.setInfo(bar4, ui.border.bar4, "box");
  16670. this.setInfo(bar5, ui.border.bar5, "box");
  16671. this.setInfo(bar6, ui.border.bar6, "box");
  16672. let circle1 = this.border.getChildByName("circle1");
  16673. let circle2 = this.border.getChildByName("circle2");
  16674. let circle3 = this.border.getChildByName("circle3");
  16675. let circle4 = this.border.getChildByName("circle4");
  16676. let circle5 = this.border.getChildByName("circle5");
  16677. let circle6 = this.border.getChildByName("circle6");
  16678. this.setInfo(circle1, ui.border.circle1, "circle");
  16679. this.setInfo(circle2, ui.border.circle2, "circle");
  16680. this.setInfo(circle3, ui.border.circle3, "circle");
  16681. this.setInfo(circle4, ui.border.circle4, "circle");
  16682. this.setInfo(circle5, ui.border.circle5, "circle");
  16683. this.setInfo(circle6, ui.border.circle6, "circle");
  16684. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16685. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16686. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16687. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16688. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16689. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16690. let arr = xGame.common.gameMgr.holePosList;
  16691. xGame.common.gameMgr.posObj = {
  16692. "1": arr[0],
  16693. "3": arr[2],
  16694. "4": arr[3],
  16695. "6": arr[5]
  16696. };
  16697. }
  16698. initHolePos(x, y) {
  16699. if (x < 300)
  16700. x += 25;
  16701. else if (x > 1000)
  16702. x -= 25;
  16703. else if (y > 200)
  16704. y -= 10;
  16705. else
  16706. y += 10;
  16707. if (y < 200)
  16708. y += 30;
  16709. else if (y > 500)
  16710. y -= 30;
  16711. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16712. }
  16713. setInfo(d3Obj, d2Obj, type) {
  16714. let ui = xGame.common.gameUI.ui;
  16715. let sprite = new Laya.Sprite();
  16716. ui.border.displayObject.addChild(sprite);
  16717. let colli = xGame.common.getCollider(type);
  16718. sprite.addComponentIntance(colli);
  16719. let rigy = xGame.common.getRigbody();
  16720. rigy.type = "static";
  16721. sprite.addComponentIntance(rigy);
  16722. let d3Pos = d3Obj.transform.position;
  16723. xGame.common.pos3to2Convert(d3Pos);
  16724. let scaleX = d3Obj.transform.localScaleX;
  16725. let scaleZ = d3Obj.transform.localScaleZ;
  16726. let width = xGame.common.scale3to2Convert(scaleZ);
  16727. let height = xGame.common.scale3to2Convert(scaleX);
  16728. sprite.pivotX = width / 2;
  16729. sprite.pivotY = height / 2;
  16730. sprite.x = d3Pos.x;
  16731. sprite.y = d3Pos.y;
  16732. sprite.width = width;
  16733. sprite.height = height;
  16734. d2Obj.x = d3Pos.x;
  16735. d2Obj.y = d3Pos.y;
  16736. d2Obj.width = width;
  16737. d2Obj.height = height;
  16738. if (type == "box") {
  16739. colli.width = width;
  16740. colli.height = height;
  16741. colli.isSensor = false;
  16742. colli.label = "border";
  16743. }
  16744. else {
  16745. colli.radius = width / 2;
  16746. colli.isSensor = true;
  16747. colli.label = "hole";
  16748. sprite.addComponent(D2Hole);
  16749. }
  16750. }
  16751. }
  16752. class D3World extends Laya.Script3D {
  16753. constructor() {
  16754. super();
  16755. this.loadNum = 0;
  16756. this.setLoadNum = 7;
  16757. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16758. }
  16759. onAwake() {
  16760. }
  16761. loadScene() {
  16762. this.scene = this.owner;
  16763. let url = `res/unityRes/root.lh`;
  16764. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16765. this.scene.addChild(prefab);
  16766. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16767. this.putCameraInfo();
  16768. this.camera.enableHDR = false;
  16769. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16770. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16771. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16772. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16773. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16774. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16775. this.knife.active = false;
  16776. this.loadD3Obj();
  16777. }));
  16778. }
  16779. putCameraInfo() {
  16780. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16781. this.cameraObj = new cameraType();
  16782. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16783. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16784. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16785. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16786. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16787. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16788. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16789. this.visitAngleChild.init();
  16790. this.visitRootObj.posX = this.visitAngleChild.posX;
  16791. this.visitRootObj.posY = this.visitAngleChild.posY;
  16792. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16793. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16794. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16795. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16796. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16797. xGame.common.showOneCamera("mainCamera");
  16798. }
  16799. loadD3Obj() {
  16800. this.loadTable();
  16801. this.loadRoom();
  16802. this.loadInHoleParticial();
  16803. this.loadIceParticial();
  16804. this.loadHitParticial();
  16805. this.loadFireworksParticial();
  16806. this.loadBall();
  16807. }
  16808. loadInHoleParticial() {
  16809. this.loadD3Res("inHoleEft", "", (prefab) => {
  16810. prefab.addComponent(Partical);
  16811. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16812. });
  16813. }
  16814. loadIceParticial() {
  16815. this.loadD3Res("iceEft", "", (prefab) => {
  16816. prefab.addComponent(Partical);
  16817. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16818. });
  16819. }
  16820. loadHitParticial() {
  16821. this.loadD3Res("hitEft", "", (prefab) => {
  16822. prefab.addComponent(Partical);
  16823. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16824. });
  16825. }
  16826. loadFireworksParticial() {
  16827. this.loadD3Res("fireworksEft", "", (prefab) => {
  16828. prefab.addComponent(Partical);
  16829. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16830. });
  16831. }
  16832. loadBall(index = 1) {
  16833. this.loadD3Res("ball", index, (prefab) => {
  16834. this.ballPrefab = prefab;
  16835. this.ballPrefab.addComponent(Ball);
  16836. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16837. });
  16838. }
  16839. loadTable(index = 1) {
  16840. this.loadD3Res("table", index, (prefab) => {
  16841. this.tableSrc = prefab.addComponent(Table);
  16842. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16843. this.d3Hand.init();
  16844. this.tableRoot.addChild(prefab);
  16845. });
  16846. }
  16847. loadRoom(index = 1) {
  16848. this.loadD3Res("room", index, (prefab) => {
  16849. this.roomRoot.addChild(prefab);
  16850. });
  16851. }
  16852. loadD3Res(type, index, callback) {
  16853. let url = `res/unityRes/${type}${index}.lh`;
  16854. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16855. callback && callback(prefab);
  16856. this.checkResLoad();
  16857. }));
  16858. }
  16859. checkResLoad() {
  16860. this.loadNum++;
  16861. if (this.loadNum >= this.setLoadNum) {
  16862. xGame.eventMgr.event(D3RES_LOADED);
  16863. }
  16864. }
  16865. prePlayEft() {
  16866. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16867. eft.transform.localPositionX = 0;
  16868. eft.transform.localPositionY = -5;
  16869. eft.transform.localPositionZ = 0;
  16870. eft.active = true;
  16871. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16872. ice.transform.localPositionX = 0;
  16873. ice.transform.localPositionY = -5;
  16874. ice.transform.localPositionZ = 0;
  16875. ice.active = true;
  16876. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16877. hit.transform.localPositionX = 0;
  16878. hit.transform.localPositionY = -5;
  16879. hit.transform.localPositionZ = 0;
  16880. hit.active = true;
  16881. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16882. fireworks.transform.localPositionX = 0;
  16883. fireworks.transform.localPositionY = -5;
  16884. fireworks.transform.localPositionZ = 0;
  16885. fireworks.active = true;
  16886. }
  16887. }
  16888. class cameraType {
  16889. }
  16890. class MoyuMgr$1 {
  16891. static initMoyu() {
  16892. this.moyuView = new MoyuView$1();
  16893. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16894. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16895. this.moyuView.ui.displayObject.zOrder = 1000;
  16896. this.moyuView.init();
  16897. this.moyuView.showTip(true);
  16898. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16899. window['XApk'] = this;
  16900. }
  16901. static showAge(show) {
  16902. if (this.moyuView)
  16903. this.moyuView.showAge(show);
  16904. }
  16905. static onPlatMsg(idx) {
  16906. if (!MoyuMgr$1.moyuView)
  16907. return;
  16908. if (idx == '0') {
  16909. MoyuMgr$1.moyuView.showTip(false);
  16910. }
  16911. }
  16912. static showAgree(call) {
  16913. if (this.moyuView)
  16914. this.moyuView.showAgree(call);
  16915. else
  16916. call && call();
  16917. }
  16918. static showXy(type = 1) {
  16919. if (this.moyuView)
  16920. this.moyuView.showXy(type);
  16921. }
  16922. }
  16923. MoyuMgr$1.isAdvise = false;
  16924. class MoyuView$1 {
  16925. constructor() {
  16926. this.ysxyNum = 1;
  16927. this.ysJson = null;
  16928. this.ui = ui_UIMoyu.createInstance();
  16929. }
  16930. init() {
  16931. this.ui.mainBg.visible = false;
  16932. this.ui.xyNode.visible = false;
  16933. this.ui.ageNode.visible = false;
  16934. this.ui.tipNode.visible = false;
  16935. this.ui.rnNode.visible = false;
  16936. this.ui.fcmNode.visible = false;
  16937. this.ui.ageTip.visible = false;
  16938. this.ui.msgNode.visible = false;
  16939. this.ui.visible = false;
  16940. this.ui.xyNode.xyList.setVirtual();
  16941. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16942. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16943. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16944. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16945. this.ui.xyNode.btnKnown.visible = false;
  16946. this.ui.xyNode.xy1.visible = false;
  16947. this.ui.xyNode.xy2.visible = false;
  16948. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16949. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16950. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16951. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16952. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16953. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16954. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16955. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16956. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16957. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16958. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16959. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16960. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16961. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16962. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16963. this.ysxyNum = 2;
  16964. }
  16965. }
  16966. onClick(obj) {
  16967. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16968. switch (obj) {
  16969. case this.ui.ageTip:
  16970. if (Moyu.isTTApk) {
  16971. this.ui.ageNode.visible = true;
  16972. this.ui.mainBg.visible = true;
  16973. }
  16974. break;
  16975. case this.ui.tipNode:
  16976. this.showTip(false);
  16977. break;
  16978. case this.ui.ageNode.btnAge:
  16979. this.ui.ageNode.visible = false;
  16980. this.ui.mainBg.visible = false;
  16981. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16982. this.ui.visible = false;
  16983. break;
  16984. case this.ui.xyNode.btnXy3:
  16985. case this.ui.xyNode.btnXy1:
  16986. this.loadXy(1);
  16987. break;
  16988. case this.ui.xyNode.btnXy2:
  16989. this.loadXy(2);
  16990. break;
  16991. case this.ui.xyNode.btnBack:
  16992. this.ui.xyNode.xy1.visible = true;
  16993. this.ui.xyNode.xy2.visible = false;
  16994. break;
  16995. case this.ui.xyNode.btnKnown:
  16996. this.ui.xyNode.visible = false;
  16997. this.ui.mainBg.visible = false;
  16998. this.ui.visible = false;
  16999. break;
  17000. case this.ui.rnNode.btnCheck:
  17001. this.check();
  17002. break;
  17003. case this.ui.rnNode.btnExit:
  17004. case this.ui.xyNode.btnNo:
  17005. this.ysxyNum--;
  17006. if (this.ysxyNum > 0)
  17007. this.showMsg("Refuse to quit the game once again");
  17008. else {
  17009. Moyu.userAgree(false);
  17010. Moyu.exit();
  17011. }
  17012. break;
  17013. case this.ui.xyNode.btnSure:
  17014. case this.ui.xyNode.btnYes:
  17015. DataMgr.userData.isAgree = true;
  17016. DataMgr.saveUserData();
  17017. this.onAgree();
  17018. break;
  17019. case this.ui.rnNode.btnDone:
  17020. this.ui.rnNode.visible = false;
  17021. this.ui.visible = false;
  17022. break;
  17023. case this.ui.fcmNode.btnRn:
  17024. this.showRn();
  17025. break;
  17026. }
  17027. }
  17028. showTip(show) {
  17029. if (!Moyu.isVVApk && !Moyu.isOPApk)
  17030. return;
  17031. if (show) {
  17032. MoyuMgr$1.isAdvise = true;
  17033. this.ui.visible = true;
  17034. this.ui.tipNode.visible = true;
  17035. this.ui.tipNode.alpha = 1;
  17036. Laya.timer.once(1000, this, this.showTip, [false]);
  17037. }
  17038. else {
  17039. this.ui.tipNode.alpha = 1;
  17040. this.ui.tipNode.visible = true;
  17041. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  17042. this.ui.tipNode.visible = false;
  17043. MoyuMgr$1.isAdvise = false;
  17044. }), 1000);
  17045. }
  17046. }
  17047. showAge(show, px = 0, py = 0) {
  17048. if (Moyu.platType > 10 && !Moyu.isIos) {
  17049. this.ui.ageTip.x = px;
  17050. this.ui.ageTip.y = py;
  17051. this.ui.ageTip.visible = show;
  17052. if (show)
  17053. this.ui.visible = true;
  17054. }
  17055. }
  17056. showAgree(call) {
  17057. this.agreeCall = call;
  17058. this.onAgree();
  17059. return;
  17060. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  17061. this.showXy(0);
  17062. }
  17063. else
  17064. this.onAgree();
  17065. }
  17066. onAgree() {
  17067. if (!this.ui.ageNode.visible)
  17068. this.ui.visible = false;
  17069. this.ui.xyNode.visible = false;
  17070. Moyu.userAgree(true);
  17071. this.showAge(false);
  17072. this.agreeCall && this.agreeCall();
  17073. this.showRn();
  17074. }
  17075. showMsg(txt) {
  17076. this.ui.msgNode.txtMsg.text = txt;
  17077. this.ui.msgNode.visible = true;
  17078. this.ui.msgNode.alpha = 1;
  17079. this.ui.visible = true;
  17080. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  17081. this.ui.msgNode.visible = false;
  17082. }), 2500, true);
  17083. }
  17084. showRn() {
  17085. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17086. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  17087. this.ui.rnNode.rn1.visible = true;
  17088. this.ui.rnNode.rn2.visible = false;
  17089. this.ui.rnNode.rn3.visible = false;
  17090. this.ui.rnNode.rn4.visible = false;
  17091. this.ui.rnNode.visible = true;
  17092. this.ui.mainBg.visible = true;
  17093. this.ui.rnNode.btnDone.visible = false;
  17094. this.ui.rnNode.btnExit.visible = true;
  17095. this.ui.rnNode.btnCheck.visible = true;
  17096. this.ui.fcmNode.visible = false;
  17097. this.ui.visible = true;
  17098. return;
  17099. }
  17100. }
  17101. this.showFcm();
  17102. }
  17103. showFcm() {
  17104. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17105. Moyu.initFCM(true);
  17106. if (Moyu.gameTime < 1)
  17107. this.fcmLoop();
  17108. else if (Moyu.gameTime < 999)
  17109. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  17110. }
  17111. }
  17112. fcmLoop() {
  17113. if (Moyu.gameTime < 1) {
  17114. this.ui.rnNode.visible = false;
  17115. this.ui.fcmNode.visible = true;
  17116. this.ui.mainBg.visible = true;
  17117. this.ui.visible = true;
  17118. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  17119. Laya.timer.clear(this.ui, this.fcmLoop);
  17120. }
  17121. }
  17122. check() {
  17123. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  17124. this.ui.rnNode.rn1.visible = false;
  17125. this.ui.rnNode.rn2.visible = false;
  17126. this.ui.rnNode.rn4.visible = true;
  17127. }
  17128. else if (this.ui.rnNode.rn4.visible) {
  17129. let name = this.ui.rnNode.inputName.text;
  17130. let code = this.ui.rnNode.inputCode.text;
  17131. if (code && code.length == 18) {
  17132. this.ui.rnNode.rn1.visible = false;
  17133. this.ui.rnNode.rn4.visible = false;
  17134. Moyu.authenticate(name, code, (res) => {
  17135. this.ui.rnNode.rn2.visible = !res;
  17136. this.ui.rnNode.rn3.visible = res;
  17137. this.ui.rnNode.btnDone.visible = res;
  17138. this.ui.rnNode.btnExit.visible = !res;
  17139. this.ui.rnNode.btnCheck.visible = !res;
  17140. if (res)
  17141. this.showFcm();
  17142. });
  17143. }
  17144. else
  17145. this.showMsg("信息填写不完整");
  17146. }
  17147. }
  17148. loadXy(type = 0) {
  17149. this.ui.xyNode.xy1.visible = false;
  17150. this.ui.xyNode.xy2.visible = true;
  17151. this.ui.xyNode.xyList.scrollToView(0);
  17152. if (type == 1) {
  17153. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  17154. }
  17155. else if (type == 2) {
  17156. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  17157. }
  17158. }
  17159. showXy(type = 0) {
  17160. this.xyBtn();
  17161. if (type == 0) {
  17162. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  17163. this.ui.xyNode.btnSure.visible = true;
  17164. }
  17165. else {
  17166. this.ui.xyNode.btnYes.visible = true;
  17167. this.ui.xyNode.btnNo.visible = true;
  17168. }
  17169. }
  17170. else {
  17171. this.ui.xyNode.btnKnown.visible = true;
  17172. this.ui.mainBg.visible = true;
  17173. }
  17174. this.ui.xyNode.xy1.visible = true;
  17175. this.ui.xyNode.xy2.visible = false;
  17176. this.ui.xyNode.visible = true;
  17177. this.ui.visible = true;
  17178. }
  17179. xyBtn() {
  17180. this.ui.xyNode.btnSure.visible = false;
  17181. this.ui.xyNode.btnYes.visible = false;
  17182. this.ui.xyNode.btnNo.visible = false;
  17183. this.ui.xyNode.btnKnown.visible = false;
  17184. {
  17185. this.ui.xyNode.btnXy3.visible = false;
  17186. this.ui.xyNode.btnXy2.visible = true;
  17187. this.ui.xyNode.btnXy1.visible = true;
  17188. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  17189. }
  17190. }
  17191. createXY(json) {
  17192. this.ysJson = json.content;
  17193. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  17194. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  17195. this.ui.xyNode.xy2.visible = true;
  17196. }
  17197. renderListItem(idx, cell) {
  17198. let xy = this.ysJson[idx];
  17199. cell.height = xy.line * 30;
  17200. cell.xyItem.text = xy.text;
  17201. }
  17202. onDestroy() {
  17203. this.agreeCall = null;
  17204. }
  17205. }
  17206. class UILoading extends UIBase {
  17207. constructor() {
  17208. super();
  17209. this.accTime = 0;
  17210. this.curNum = 0;
  17211. this.rate = 1;
  17212. this.loadSubOk = false;
  17213. this.loadResOK = false;
  17214. this.openLoading = true;
  17215. this.beginLoadRes = false;
  17216. this.finishD2 = false;
  17217. this.finishD3 = false;
  17218. }
  17219. onConstructor() {
  17220. this.ui = ui_UILoading.createInstance();
  17221. this.contentPane = this.ui;
  17222. this.isEject = false;
  17223. this._initUI();
  17224. this._addEvent();
  17225. }
  17226. _initUI() {
  17227. MoyuMgr$1.initMoyu();
  17228. }
  17229. _addEvent() {
  17230. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  17231. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  17232. }
  17233. show() {
  17234. super.show();
  17235. console.log('zh:加载分包资源');
  17236. loadSubRes(this.subResProgress.bind(this));
  17237. this.ui.txtLoad.text = "Loading...";
  17238. }
  17239. subResProgress(pro, finish) {
  17240. this.curNum = pro;
  17241. if (finish) {
  17242. this.curNum = 1;
  17243. this.loadSubOk = true;
  17244. }
  17245. }
  17246. laodD3Res() {
  17247. let scene3D = new Laya.Scene3D();
  17248. xGame.common.d3Scene = scene3D;
  17249. xGame.common.d3World = scene3D.addComponent(D3World);
  17250. xGame.common.d3World.loadScene();
  17251. }
  17252. loadD2Res() {
  17253. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  17254. this.finishD2 = true;
  17255. this.checkLoadAll();
  17256. this.curNum = 1;
  17257. }), Laya.Handler.create(this, (pro) => {
  17258. this.curNum = pro;
  17259. }, null, false));
  17260. }
  17261. d3ResFinish() {
  17262. this.finishD3 = true;
  17263. this.checkLoadAll();
  17264. }
  17265. checkLoadAll() {
  17266. if (this.finishD2 && this.finishD3) {
  17267. this.loadResOK = true;
  17268. }
  17269. }
  17270. loadRes() {
  17271. this.laodD3Res();
  17272. this.loadD2Res();
  17273. }
  17274. myUpdate(dt) {
  17275. if (!this.openLoading)
  17276. return;
  17277. this.accTime += dt * this.rate;
  17278. if (this.accTime >= this.curNum)
  17279. this.accTime = this.curNum;
  17280. this.ui.loadinfo.value = this.accTime * 100;
  17281. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  17282. if (!this.beginLoadRes) {
  17283. this.beginLoadRes = true;
  17284. this.ui.txtLoad.text = "Loading...";
  17285. this.curNum = 0;
  17286. this.accTime = 0;
  17287. this.loadRes();
  17288. }
  17289. if (this.loadResOK) {
  17290. this.openLoading = false;
  17291. Laya.timer.once(300, this, () => {
  17292. xGame.common.d3Scene.active = false;
  17293. MoyuMgr$1.showAgree(enterGame);
  17294. });
  17295. }
  17296. }
  17297. }
  17298. release() {
  17299. }
  17300. hide() {
  17301. super.hide();
  17302. this.release();
  17303. }
  17304. onClose() {
  17305. this.hide();
  17306. }
  17307. }
  17308. UILoading.uiName = "UILoading";
  17309. class UIRepentProp$1 extends UIBase {
  17310. constructor() {
  17311. super();
  17312. this.viewType = 0;
  17313. this.regretType = 0;
  17314. }
  17315. onConstructor() {
  17316. this.ui = ui_UIRepentProp.createInstance();
  17317. this.contentPane = this.ui;
  17318. this.isEject = false;
  17319. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17320. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17321. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17322. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17323. }
  17324. show(viewType, regretType, callback) {
  17325. PlatMgr.showInsert(true);
  17326. this.viewType = viewType;
  17327. this.regretType = regretType;
  17328. this.callback = callback;
  17329. super.show();
  17330. this.ui.t0.play();
  17331. this.ui.c1.selectedIndex = this.viewType;
  17332. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17333. if (this.viewType == 0) {
  17334. let guide = DataMgr.getGuideHelpLine();
  17335. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17336. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17337. }
  17338. xGame.common.gameMgr.gamePause = true;
  17339. }
  17340. hideSelf() {
  17341. xGame.common.gameMgr.gamePause = false;
  17342. this.callback && this.callback(false);
  17343. this.hide();
  17344. }
  17345. videoRegret() {
  17346. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  17347. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  17348. }
  17349. else {
  17350. console.log('zh:AD 失败,直接发放奖励');
  17351. this.qjff_AD_for_UIrepentProp_videoRegret();
  17352. }
  17353. }
  17354. qjff_AD_for_UIrepentProp_videoRegret() {
  17355. this.callback && this.callback(true);
  17356. this.hideSelf();
  17357. }
  17358. videoAddHelpLine() {
  17359. let guide = DataMgr.getGuideHelpLine();
  17360. if (guide == 0) {
  17361. this.callback && this.callback(true);
  17362. this.hideSelf();
  17363. DataMgr.setGuideHelpLine();
  17364. xGame.common.gameUI.ui.guideNode.visible = false;
  17365. }
  17366. else {
  17367. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  17368. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  17369. }
  17370. else {
  17371. console.log('zh:AD 失败,直接发放奖励');
  17372. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  17373. }
  17374. }
  17375. }
  17376. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  17377. this.callback && this.callback(true);
  17378. this.hideSelf();
  17379. }
  17380. }
  17381. UIRepentProp$1.uiName = "UIRepentProp";
  17382. class UIRodMethod$1 extends UIBase {
  17383. constructor() {
  17384. super();
  17385. this.isPressd = false;
  17386. }
  17387. onConstructor() {
  17388. this.ui = ui_UIRodMethod.createInstance();
  17389. this.contentPane = this.ui;
  17390. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17391. this.moveDir = new Laya.Vector2();
  17392. this.moveDest = new Laya.Vector2();
  17393. this.centerPos = new Laya.Vector2();
  17394. xGame.common.uiRodMethod = this;
  17395. }
  17396. show() {
  17397. super.show();
  17398. xGame.common.gameMgr.gamePause = true;
  17399. this.openPressDotEvent();
  17400. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17401. this.centerPos.x = this.ui.white.x;
  17402. this.centerPos.y = this.ui.white.y;
  17403. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17404. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17405. this.setDot();
  17406. }
  17407. setDot() {
  17408. this.ui.dot.x = this.moveDest.x;
  17409. this.ui.dot.y = this.moveDest.y;
  17410. }
  17411. closeSelf() {
  17412. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17413. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17414. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17415. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17416. xGame.common.gameMgr.gamePause = false;
  17417. this.hide();
  17418. }
  17419. openPressDotEvent() {
  17420. this.closePressDotEvent();
  17421. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17422. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17423. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17424. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17425. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17426. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17427. }
  17428. closePressDotEvent() {
  17429. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17430. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17431. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17432. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17433. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17434. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17435. }
  17436. onDown(e) {
  17437. if (e.type == Laya.Event.MOUSE_DOWN)
  17438. this.isPressd = true;
  17439. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17440. this.isPressd = false;
  17441. if (!this.isPressd)
  17442. return;
  17443. this.moveDest.x = e.stageX;
  17444. this.moveDest.y = e.stageY;
  17445. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17446. if (dis > 6724) {
  17447. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17448. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17449. }
  17450. this.setDot();
  17451. }
  17452. resetRod() {
  17453. this.ui.dot.x = this.ui.white.x;
  17454. this.ui.dot.y = this.ui.white.y;
  17455. this.gameRod.dot.x = this.gameRod.bg.x;
  17456. this.gameRod.dot.y = this.gameRod.bg.y;
  17457. xGame.common.rodOffest.x = 0;
  17458. xGame.common.rodOffest.y = 0;
  17459. }
  17460. }
  17461. UIRodMethod$1.uiName = "UIRodMethod";
  17462. class UIMsg$1 extends UIBase {
  17463. constructor() {
  17464. super();
  17465. }
  17466. onConstructor() {
  17467. this.ui = ui_UIMsg.createInstance();
  17468. this.contentPane = this.ui;
  17469. this.isEject = false;
  17470. this.isMuti = true;
  17471. }
  17472. show(msg, callback) {
  17473. super.show();
  17474. this.ui.tipsNode.msgTxt.text = msg;
  17475. this.ui.alpha = 1;
  17476. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17477. this.hide();
  17478. callback && callback();
  17479. }), 1000);
  17480. }
  17481. }
  17482. UIMsg$1.uiName = "UIMsg";
  17483. class UITips$1 extends UIBase {
  17484. constructor() {
  17485. super();
  17486. this.type = 0;
  17487. }
  17488. onConstructor() {
  17489. this.ui = ui_UITips.createInstance();
  17490. this.contentPane = this.ui;
  17491. this.isEject = false;
  17492. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17493. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17494. }
  17495. show(tipsTxt, womanTxt, type) {
  17496. super.show();
  17497. this.ui.t0.play();
  17498. this.ui.myNode.tipsTxt.text = tipsTxt;
  17499. this.ui.myNode.womanTxt.text = womanTxt;
  17500. PlatMgr.showInsert(true);
  17501. this.ui.myNode.c1.selectedIndex = type;
  17502. this.type = type;
  17503. switch (this.type) {
  17504. case TipsType.exitGame:
  17505. xGame.common.gameMgr.gamePause = true;
  17506. break;
  17507. case TipsType.foul:
  17508. Laya.timer.once(200, this, () => {
  17509. xGame.common.gameMgr.gamePause = true;
  17510. });
  17511. break;
  17512. default:
  17513. break;
  17514. }
  17515. }
  17516. clickLeftBtn() {
  17517. this.hide();
  17518. xGame.common.gameMgr.gamePause = false;
  17519. switch (this.type) {
  17520. case TipsType.exitGame:
  17521. break;
  17522. case TipsType.foul:
  17523. break;
  17524. default:
  17525. break;
  17526. }
  17527. }
  17528. clickRightBtn() {
  17529. this.hide();
  17530. switch (this.type) {
  17531. case TipsType.exitGame:
  17532. xGame.eventMgr.event(RESET_GAME);
  17533. xGame.uiMgr.Show(UIMain$1);
  17534. Moyu.recordEnd(this, null);
  17535. xGame.common.longHelpLine = false;
  17536. break;
  17537. case TipsType.foul:
  17538. xGame.common.gameMgr.gamePause = false;
  17539. Laya.timer.clearAll(this);
  17540. break;
  17541. default:
  17542. break;
  17543. }
  17544. }
  17545. }
  17546. UITips$1.uiName = "UITips";
  17547. class UIGame$1 extends UIBase {
  17548. constructor() {
  17549. super();
  17550. this.powerNum = 0;
  17551. this.isD3Inited = false;
  17552. this.isPrePlay = false;
  17553. this.isMoveRod = false;
  17554. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17555. this.rulerDis = 20;
  17556. this.rulerOffset = 0;
  17557. }
  17558. onConstructor() {
  17559. this.ui = ui_UIGame.createInstance();
  17560. this.contentPane = this.ui;
  17561. this.ui.x += xGame.common.sysOffestNum;
  17562. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17563. this.isEject = false;
  17564. xGame.common.gameUI = this;
  17565. this.initSelf();
  17566. }
  17567. isTurnSelf() {
  17568. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17569. return true;
  17570. }
  17571. }
  17572. initSelf() {
  17573. let topUI = this.ui.topNode;
  17574. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17575. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17576. this.barInfo = {};
  17577. this.barInfo.curY = 0;
  17578. this.barInfo.height = this.ui.powerNode.height;
  17579. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17580. this.barInfo.powerStartY = this.ui.powerNode.y;
  17581. xGame.common.aiPlayer = new AIPlayer();
  17582. xGame.common.gameMgr = new GameMgr();
  17583. xGame.common.skillMgr = new SkillMgr();
  17584. xGame.common.wordsMgr = new WordsMgr();
  17585. xGame.common.talkMgr = new TalkMgr();
  17586. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17587. console.log("加载经典模式表情文件chenggon !");
  17588. });
  17589. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17590. console.log("挑战模式奖励模式spine加载成功!");
  17591. });
  17592. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17593. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17594. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17595. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17596. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17597. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17598. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17599. }
  17600. getGanZiImg() {
  17601. let index = DataMgr.getCurBallRod();
  17602. let data = cfgTable.ballrodData[index + 1];
  17603. let gan_url = xGame.common.getGameIconUrl(data.img);
  17604. console.log('zh:getGanZiImg gan_url==' + gan_url);
  17605. this.ui.powerNode.showImg.url = gan_url;
  17606. console.log('zh:修改杆子图标O K');
  17607. }
  17608. returnHome() {
  17609. let tips = "Are you sure to exit the game?";
  17610. let woman = "Boss, why don't you play for a while longer?";
  17611. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17612. }
  17613. addRodMethodClick() {
  17614. if (this.isTurnSelf()) {
  17615. xGame.uiMgr.Show(UIRodMethod$1);
  17616. }
  17617. }
  17618. clickHelpLineBtn(force = false) {
  17619. if (!this.isTurnSelf())
  17620. return;
  17621. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17622. if (success) {
  17623. xGame.common.longHelpLine = true;
  17624. xGame.common.d2World.getHelpLine();
  17625. Moyu.sendDataEvent("guideNum");
  17626. }
  17627. else {
  17628. }
  17629. });
  17630. }
  17631. renderSelfDisplayBalls(index, target) {
  17632. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17633. target.myImg.url = xGame.common.getGameIconUrl(str);
  17634. }
  17635. renderAIDisplayBalls(index, target) {
  17636. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17637. target.myImg.url = xGame.common.getGameIconUrl(str);
  17638. ;
  17639. }
  17640. updateMode() {
  17641. if (xGame.common.gameMode == GameMode.classic) {
  17642. this.ui.topNode.scoreNode.visible = false;
  17643. }
  17644. else if (xGame.common.gameMode == GameMode.bigMove) {
  17645. this.ui.topNode.scoreNode.visible = true;
  17646. }
  17647. }
  17648. show() {
  17649. super.show();
  17650. console.log("zh:uigame show AADD");
  17651. this.ui.alpha = 0;
  17652. this.updateSelf();
  17653. xGame.common.gameMgr.gamePause = false;
  17654. xGame.common.gameUI.ui.blackAni.visible = false;
  17655. xGame.common.gameUI.ui.whiteAni.visible = false;
  17656. this.ui.powerEft.visible = false;
  17657. this.ui.colorNode.visible = false;
  17658. this.updateHead();
  17659. let curUse = DataMgr.getCurBallRod();
  17660. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  17661. this.getGanZiImg();
  17662. }
  17663. updateSelf() {
  17664. if (xGame.common.gameMode == GameMode.classic) {
  17665. this.ui.c1.selectedIndex = 0;
  17666. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17667. this.ui.topNode.middleNode.visible = true;
  17668. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17669. }
  17670. else if (xGame.common.gameMode == GameMode.bigMove) {
  17671. this.ui.c1.selectedIndex = 0;
  17672. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17673. this.ui.topNode.middleNode.visible = false;
  17674. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17675. let rand = xGame.common.randomNum(1, max);
  17676. let guide = DataMgr.getSkillGuide();
  17677. if (guide == 0)
  17678. rand = 1;
  17679. xGame.common.bigMoveLevelIndex = rand;
  17680. }
  17681. else if (xGame.common.gameMode == GameMode.placeBall) {
  17682. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17683. this.ui.c1.selectedIndex = 1 + data.type;
  17684. this.ui.alpha = 1;
  17685. this.startGame();
  17686. }
  17687. this.updateMode();
  17688. this.initD3world();
  17689. this.initD2world();
  17690. }
  17691. startGame() {
  17692. this.ui.snowNode.visible = Math.random() <= 0.1;
  17693. this.ui.d2Node.visible = false;
  17694. xGame.common.d3World.d3Hand.gameObj.active = false;
  17695. xGame.common.d3World.tableSrc.init();
  17696. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17697. this.cameraViewChange(() => {
  17698. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17699. switch (xGame.common.gameMode) {
  17700. case GameMode.classic:
  17701. xGame.common.d3World.d3Hand.gameObj.active = true;
  17702. this.playPutBallD3Ani();
  17703. break;
  17704. case GameMode.bigMove:
  17705. this.enterGame();
  17706. Laya.timer.once(500, this, () => {
  17707. this.ui.topNode.middleNode.visible = true;
  17708. this.ui.topNode.middleNode.t0.play();
  17709. });
  17710. break;
  17711. case GameMode.placeBall:
  17712. this.enterGame();
  17713. break;
  17714. default:
  17715. break;
  17716. }
  17717. });
  17718. PlatMgr.showBanner(false);
  17719. }
  17720. enterGame() {
  17721. this.ui.d2Node.visible = true;
  17722. xGame.common.d3World.d3Hand.gameObj.active = false;
  17723. xGame.common.showOneCamera("mainCamera");
  17724. Moyu.recordGame(30, true);
  17725. if (!this.isPrePlay) {
  17726. this.isPrePlay = true;
  17727. xGame.common.d3World.prePlayEft();
  17728. }
  17729. xGame.common.gameMgr.gameReady();
  17730. this.openAllEvent();
  17731. this.ui.snowNode.visible = false;
  17732. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17733. this.ui.helpBtn.visible = condition;
  17734. }
  17735. showHelpLineGuide() {
  17736. let longGuide = DataMgr.getGuideHelpLine();
  17737. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17738. this.ui.helpBtn.visible = true;
  17739. this.ui.guideNode.visible = true;
  17740. }
  17741. }
  17742. setTurnAlpha(alpha) {
  17743. this.ui.keduNode.alpha = alpha;
  17744. this.ui.ganNode.alpha = alpha;
  17745. this.ui.rodMethodNode.alpha = alpha;
  17746. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17747. }
  17748. cameraViewChange(callback) {
  17749. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17750. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17751. xGame.common.showOneCamera("visitAngle");
  17752. cameraSrc.localRotationEulerY = 180;
  17753. cameraSrc.localRotationEulerZ = 0;
  17754. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17755. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17756. callback && callback();
  17757. }));
  17758. }));
  17759. }
  17760. playPutBallD3Ani() {
  17761. xGame.common.showOneCamera("mainCamera");
  17762. let handSrc = xGame.common.d3World.d3Hand;
  17763. handSrc.gameObj.active = true;
  17764. handSrc.transform.localPositionZ = 3;
  17765. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17766. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17767. handSrc.gameObj.active = false;
  17768. this.enterGame();
  17769. }), 400);
  17770. }));
  17771. }
  17772. updateHead() {
  17773. let user = Moyu.getUserInfo();
  17774. this.ui.topNode.selfNameTxt.text = user.nickName;
  17775. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17776. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17777. if (DataMgr.getSkillGuide() < 1) {
  17778. this.ui.topNode.aiNameTxt.text = 'billiards';
  17779. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17780. }
  17781. else {
  17782. this.ui.topNode.aiNameTxt.text = aiData.name;
  17783. let randNo = Math.floor(Math.random() * 10) + 1;
  17784. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17785. }
  17786. }
  17787. initD2world() {
  17788. let node = this.ui.d2Root.displayObject;
  17789. let src = node.getComponent(D2World);
  17790. if (!src) {
  17791. xGame.common.d2World = node.addComponent(D2World);
  17792. }
  17793. xGame.common.d2World.initSelf();
  17794. }
  17795. initD3world() {
  17796. if (this.isD3Inited)
  17797. return;
  17798. this.isD3Inited = true;
  17799. let scene3D = xGame.common.d3Scene;
  17800. this.ui.d3Root.displayObject.addChild(scene3D);
  17801. scene3D.active = true;
  17802. xGame.common.d3World.tableSrc.setBorderPos();
  17803. }
  17804. onRootMove(e) {
  17805. let rootBall = xGame.common.d2World.rootBall;
  17806. this.ui.moveNode.x = e.x;
  17807. this.ui.moveNode.y = e.y;
  17808. rootBall.gameObj.x = e.x;
  17809. rootBall.gameObj.y = e.y;
  17810. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17811. }
  17812. aiRootMove(move) {
  17813. if (move)
  17814. this.hideBallUI();
  17815. else {
  17816. this.showBallUI();
  17817. xGame.common.d2World.getHelpLine();
  17818. }
  17819. }
  17820. aiForce(type, force = 0) {
  17821. this.pressTarget = PressType.powerNode;
  17822. if (type == 1)
  17823. this.onEventUp({ force: true });
  17824. else if (type == 2)
  17825. this.onEventMove({ stageY: force, force: true });
  17826. }
  17827. onEventPress(e) {
  17828. if (e.stopPropagation)
  17829. e.stopPropagation();
  17830. if (!this.isTurnSelf())
  17831. return;
  17832. let target = e.target;
  17833. switch (target) {
  17834. case this.ui.myPowerNode.displayObject:
  17835. this.pressTarget = PressType.powerNode;
  17836. this.barInfo.curY = e.stageY;
  17837. this.updateBarInfo();
  17838. break;
  17839. case this.ui.moveNode.displayObject:
  17840. this.pressTarget = PressType.moveNode;
  17841. this.hideBallUI();
  17842. this.eventObj.curX = this.ui.moveNode.x;
  17843. this.eventObj.curY = this.ui.moveNode.y;
  17844. this.ui.moveNode.finger.visible = false;
  17845. this.eventObj.lastX = e.stageX;
  17846. this.eventObj.lastY = e.stageY;
  17847. break;
  17848. case this.ui.rulerClickNode.displayObject:
  17849. this.pressTarget = PressType.rulerNode;
  17850. this.eventObj.lastY = e.stageY;
  17851. break;
  17852. case this.ui.d2Root.displayObject:
  17853. this.pressTarget = PressType.d2Root;
  17854. this.eventObj.lastX = e.stageX;
  17855. this.eventObj.lastY = e.stageY;
  17856. this.eventObj.starX = e.stageX;
  17857. this.eventObj.starY = e.stageY;
  17858. this.eventObj.curX = 0;
  17859. this.eventObj.curY = 0;
  17860. xGame.common.d2World.d2Gan.setGanLastInfo();
  17861. this.rulerOffset = 0;
  17862. break;
  17863. default:
  17864. break;
  17865. }
  17866. }
  17867. onEventMove(e) {
  17868. if (e.stopPropagation)
  17869. e.stopPropagation();
  17870. if (e && e.force) {
  17871. }
  17872. else {
  17873. if (!this.isTurnSelf())
  17874. return;
  17875. }
  17876. switch (this.pressTarget) {
  17877. case PressType.powerNode:
  17878. this.barInfo.curY = e.stageY;
  17879. this.updateBarInfo();
  17880. this.isMoveRod = true;
  17881. break;
  17882. case PressType.moveNode:
  17883. let rootBall = xGame.common.d2World.rootBall;
  17884. let radius = rootBall.gameObj.width / 2;
  17885. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17886. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17887. let border = xGame.common.d2World.borderRect;
  17888. if (curX <= border.x + radius)
  17889. curX = border.x + radius;
  17890. else if (curX >= border.x + border.width - radius)
  17891. curX = border.x + border.width - radius;
  17892. if (curY <= border.y + radius)
  17893. curY = border.y + radius;
  17894. else if (curY >= border.y + border.height - radius)
  17895. curY = border.y + border.height - radius;
  17896. if (xGame.common.gameMgr.isOpenBall) {
  17897. if (curX >= border.x + border.openBallW - radius)
  17898. curX = border.x + border.openBallW - radius;
  17899. }
  17900. this.ui.moveNode.x = curX;
  17901. this.ui.moveNode.y = curY;
  17902. rootBall.gameObj.x = curX;
  17903. rootBall.gameObj.y = curY;
  17904. rootBall.d3BallSrc.setTransPos(curX, curY);
  17905. this.isMoveRod = true;
  17906. break;
  17907. case PressType.rulerNode:
  17908. let yy = e.stageY - this.eventObj.lastY;
  17909. this.eventObj.lastY = e.stageY;
  17910. let ruler1 = this.ui.rulerNode.img1;
  17911. let ruler2 = this.ui.rulerNode.img2;
  17912. ruler1.y += yy;
  17913. ruler2.y += yy;
  17914. this.rulerOffset += yy;
  17915. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17916. this.rulerOffset = 0;
  17917. xGame.soundMgr.playSound("inch", 1, 10);
  17918. }
  17919. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17920. let h = ruler1.height;
  17921. this.checkGuide();
  17922. this.isMoveRod = true;
  17923. if (ruler1.y >= h) {
  17924. ruler1.y = -h;
  17925. ruler2.y = 0;
  17926. return;
  17927. }
  17928. else if (ruler1.y <= -h) {
  17929. ruler1.y = h;
  17930. ruler2.y = 0;
  17931. return;
  17932. }
  17933. if (ruler2.y >= h) {
  17934. ruler2.y = -h;
  17935. ruler1.y = 0;
  17936. return;
  17937. }
  17938. else if (ruler2.y <= -h) {
  17939. ruler2.y = h;
  17940. ruler1.y = 0;
  17941. return;
  17942. }
  17943. break;
  17944. case PressType.d2Root:
  17945. this.eventObj.curX = e.stageX;
  17946. this.eventObj.curY = e.stageY;
  17947. let offset = this.checkRodMoveDir();
  17948. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17949. this.eventObj.lastX = e.stageX;
  17950. this.eventObj.lastY = e.stageY;
  17951. break;
  17952. default:
  17953. break;
  17954. }
  17955. }
  17956. onEventUp(e) {
  17957. if (e.stopPropagation)
  17958. e.stopPropagation();
  17959. if (e && e.force) {
  17960. }
  17961. else {
  17962. if (!this.isTurnSelf())
  17963. return;
  17964. }
  17965. switch (this.pressTarget) {
  17966. case PressType.powerNode:
  17967. this.ui.powerNode.value = 0;
  17968. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17969. this.ui.powerTxt.text = "";
  17970. if (this.powerNum > 0) {
  17971. xGame.eventMgr.event(BALL_SHOOT);
  17972. xGame.common.d2World.shoot(this.powerNum);
  17973. xGame.common.d2World.d2Gan.shoot();
  17974. xGame.common.d2World.d2HelpLine.shoot();
  17975. this.finishGuide();
  17976. this.ui.powerEft.visible = false;
  17977. this.ui.colorNode.visible = false;
  17978. let ganStr = "";
  17979. if (this.powerNum <= 30) {
  17980. ganStr = "gan_30";
  17981. }
  17982. else if (this.powerNum <= 60) {
  17983. ganStr = "gan_50";
  17984. }
  17985. else {
  17986. ganStr = "gan_80";
  17987. }
  17988. xGame.soundMgr.playSound(ganStr);
  17989. }
  17990. break;
  17991. case PressType.moveNode:
  17992. let rootBall = xGame.common.d2World.rootBall;
  17993. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17994. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17995. let isIntersect = this.judgeBallIntersect();
  17996. if (isIntersect) {
  17997. this.ui.moveNode.x = lastX;
  17998. this.ui.moveNode.y = lastY;
  17999. rootBall.gameObj.x = lastX;
  18000. rootBall.gameObj.y = lastY;
  18001. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  18002. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  18003. }
  18004. else {
  18005. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  18006. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  18007. }
  18008. this.showBallUI();
  18009. this.ui.moveNode.finger.visible = true;
  18010. xGame.common.d2World.getHelpLine();
  18011. break;
  18012. case PressType.rulerNode:
  18013. break;
  18014. case PressType.d2Root:
  18015. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  18016. if (dis <= 25) {
  18017. this.moveToClickDot(e);
  18018. }
  18019. break;
  18020. default:
  18021. break;
  18022. }
  18023. this.pressTarget = -1;
  18024. }
  18025. checkGuide() {
  18026. let guide = DataMgr.getSkillGuide();
  18027. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  18028. xGame.common.guideStep++;
  18029. xGame.common.gameUI.ui.guide2.visible = false;
  18030. xGame.common.gameUI.ui.guide3.visible = true;
  18031. }
  18032. }
  18033. finishGuide() {
  18034. let guide = DataMgr.getSkillGuide();
  18035. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  18036. xGame.common.guideStep = 10;
  18037. this.closeAllGuide();
  18038. }
  18039. }
  18040. closeAllGuide() {
  18041. xGame.common.gameUI.ui.guide1.visible = false;
  18042. xGame.common.gameUI.ui.guide2.visible = false;
  18043. xGame.common.gameUI.ui.guide3.visible = false;
  18044. }
  18045. updateBarInfo() {
  18046. let star = this.ui.powerNode.y;
  18047. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  18048. if (rate >= 1)
  18049. rate = 1;
  18050. if (rate <= 0)
  18051. rate = 0;
  18052. this.powerNum = Math.ceil(rate * 100);
  18053. this.ui.powerNode.value = this.powerNum;
  18054. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  18055. this.ui.colorNode.value = this.powerNum;
  18056. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  18057. this.ui.powerEft.visible = this.powerNum != 0;
  18058. this.ui.colorNode.visible = this.powerNum != 0;
  18059. this.ui.powerTxt.text = this.powerNum + "";
  18060. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  18061. }
  18062. forceCancel() {
  18063. this.ui.powerNode.value = 0;
  18064. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18065. this.ui.powerTxt.text = "";
  18066. }
  18067. checkRodMoveDir() {
  18068. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  18069. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  18070. if (tempX >= 0 && tempY <= 0) {
  18071. return this.checkDir();
  18072. }
  18073. else if (tempX < 0 && tempY < 0) {
  18074. return this.checkDir(1, -1);
  18075. }
  18076. else if (tempX < 0 && tempY > 0) {
  18077. return this.checkDir(-1, -1);
  18078. }
  18079. else {
  18080. return this.checkDir(-1, 1);
  18081. }
  18082. }
  18083. checkDir(flagX = 1, flagY = 1) {
  18084. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  18085. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  18086. if (offsetY == 0) {
  18087. return offsetX * flagX;
  18088. }
  18089. if (offsetX == 0) {
  18090. return offsetY * flagY;
  18091. }
  18092. let angle = offsetY / offsetX;
  18093. if (Math.abs(angle) >= 1) {
  18094. return offsetY * flagY;
  18095. }
  18096. else {
  18097. return offsetX * flagX;
  18098. }
  18099. }
  18100. judgeBallIntersect() {
  18101. let rootBall = xGame.common.d2World.rootBall;
  18102. let ballArr = xGame.common.d2World.ballArr;
  18103. let radius = rootBall.gameObj.width / 2;
  18104. let temp;
  18105. let isIntersect = false;
  18106. for (let index = 0; index < ballArr.length; index++) {
  18107. temp = ballArr[index];
  18108. if (temp.number == rootBall.number)
  18109. continue;
  18110. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  18111. if (isIntersect) {
  18112. break;
  18113. }
  18114. }
  18115. return isIntersect;
  18116. }
  18117. hideBallUI() {
  18118. let d2Gan = xGame.common.d2World.d2Gan;
  18119. if (!d2Gan.ui.isDisposed)
  18120. d2Gan.ui.visible = false;
  18121. let d2Help = xGame.common.d2World.d2HelpLine;
  18122. if (!d2Help.ui.isDisposed)
  18123. d2Help.ui.visible = false;
  18124. let rootBall = xGame.common.d2World.rootBall;
  18125. if (!rootBall.destroyed) {
  18126. rootBall.gameObj.active = false;
  18127. }
  18128. }
  18129. showBallUI() {
  18130. let d2Gan = xGame.common.d2World.d2Gan;
  18131. if (!d2Gan.ui.isDisposed)
  18132. d2Gan.ui.visible = true;
  18133. let d2Help = xGame.common.d2World.d2HelpLine;
  18134. if (!d2Help.ui.isDisposed)
  18135. d2Help.ui.visible = true;
  18136. let rootBall = xGame.common.d2World.rootBall;
  18137. if (!rootBall.destroyed) {
  18138. rootBall.gameObj.active = true;
  18139. }
  18140. }
  18141. moveToClickDot(e) {
  18142. if (!this.isMoveRod && !xGame.common.clickedBall) {
  18143. let root = xGame.common.d2World.rootBall.gameObj;
  18144. let xx = e.stageX - xGame.common.sysOffestNum;
  18145. let yy = e.stageY;
  18146. let x = xx - root.x;
  18147. let y = yy - root.y;
  18148. let angle = xGame.common.getfguiRotation(x, y);
  18149. xGame.common.d2World.d2Gan.ui.rotation = angle;
  18150. xGame.common.d2World.getHelpLine();
  18151. }
  18152. this.isMoveRod = false;
  18153. xGame.common.clickedBall = false;
  18154. }
  18155. openAllEvent() {
  18156. this.closeAllEvent();
  18157. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18158. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18159. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18160. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18161. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18162. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18163. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18164. }
  18165. closeAllEvent() {
  18166. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18167. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18168. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18169. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18170. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18171. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18172. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18173. }
  18174. resetGame() {
  18175. this.closeAllEvent();
  18176. this.hideBallUI();
  18177. xGame.common.gameMgr.gamePause = true;
  18178. }
  18179. }
  18180. UIGame$1.uiName = "UIGame";
  18181. class UIAddCoin$1 extends UIBase {
  18182. constructor() {
  18183. super();
  18184. this.coinNum = 2000;
  18185. }
  18186. onConstructor() {
  18187. this.ui = ui_UIAddCoin.createInstance();
  18188. this.contentPane = this.ui;
  18189. this.isEject = false;
  18190. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18191. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  18192. }
  18193. show() {
  18194. super.show();
  18195. this.ui.t0.play();
  18196. }
  18197. videoAddCoin() {
  18198. console.log('zh:qjff_AD_for_UIAddCoin');
  18199. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  18200. }
  18201. else {
  18202. console.log('zh:AD 失败,直接发放奖励');
  18203. this.qjff_AD_for_UIAddCoin();
  18204. }
  18205. }
  18206. qjff_AD_for_UIAddCoin() {
  18207. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  18208. this.hide();
  18209. }
  18210. }
  18211. UIAddCoin$1.uiName = "UIAddCoin";
  18212. class UIInvitation$1 extends UIBase {
  18213. constructor() {
  18214. super();
  18215. }
  18216. onConstructor() {
  18217. this.ui = ui_UIInvitation.createInstance();
  18218. this.contentPane = this.ui;
  18219. this.isEject = false;
  18220. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  18221. }
  18222. show() {
  18223. super.show();
  18224. }
  18225. enterGame() {
  18226. xGame.common.gameMode = GameMode.classic;
  18227. DataMgr.setChallengeTimes(1);
  18228. xGame.common.passAwardCoin = 2000;
  18229. let need = xGame.common.classicNiceNeddCoin;
  18230. if (DataMgr.coinEnough(need)) {
  18231. DataMgr.setCoin(-need);
  18232. xGame.eventMgr.event(RESTART_GAME, true);
  18233. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  18234. }
  18235. else {
  18236. xGame.eventMgr.event(RESTART_GAME, true);
  18237. }
  18238. this.hide();
  18239. }
  18240. hide() {
  18241. super.hide();
  18242. }
  18243. }
  18244. UIInvitation$1.uiName = "UIInvitation";
  18245. class UIPower$1 extends UIBase {
  18246. constructor() {
  18247. super();
  18248. }
  18249. onConstructor() {
  18250. this.ui = ui_UIPower.createInstance();
  18251. this.contentPane = this.ui;
  18252. this.isEject = false;
  18253. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18254. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  18255. }
  18256. show() {
  18257. super.show();
  18258. this.ui.t0.play();
  18259. }
  18260. videoGetPower() {
  18261. console.log('zh:qjff_AD_for_uipower');
  18262. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  18263. }
  18264. else {
  18265. console.log('zh:AD 失败,直接发放奖励');
  18266. this.qjff_AD_for_uipower();
  18267. }
  18268. }
  18269. qjff_AD_for_uipower() {
  18270. DataMgr.setPower(xGame.common.videoPower, true);
  18271. xGame.eventMgr.event(POWER_TIME);
  18272. this.hide();
  18273. }
  18274. }
  18275. UIPower$1.uiName = "UIPower";
  18276. class UIGameEnd$1 extends UIBase {
  18277. constructor() {
  18278. super();
  18279. this.success = false;
  18280. this.awardCoinNum = 1000;
  18281. this.awardDiamondNum = 10;
  18282. }
  18283. onConstructor() {
  18284. this.ui = ui_UIGameEnd.createInstance();
  18285. this.contentPane = this.ui;
  18286. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  18287. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  18288. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  18289. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18290. this.ui.talkNode.visible = false;
  18291. if (Moyu.isKs)
  18292. this.ui.closeNode.closeBtn.x += 100;
  18293. }
  18294. updateType() {
  18295. switch (xGame.common.gameMode) {
  18296. case GameMode.classic:
  18297. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18298. this.ui.coinNode.visible = this.success;
  18299. if (!this.success) {
  18300. Laya.timer.once(500, this, () => {
  18301. xGame.uiMgr.Show(UIAddCoin$1);
  18302. });
  18303. }
  18304. this.ui.isGetAward.visible = false;
  18305. this.ui.leftBtn.c1.selectedIndex = 3;
  18306. this.ui.rightBtn.c1.selectedIndex = 0;
  18307. this.moneyNode.ui.c1.selectedIndex = 1;
  18308. break;
  18309. case GameMode.bigMove:
  18310. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18311. this.ui.coinNode.visible = this.success;
  18312. if (xGame.common.gameMode == GameMode.bigMove) {
  18313. if (this.success) {
  18314. DataMgr.setSkillSuccessTimes(1, true);
  18315. DataMgr.setSkillAccTimes(1);
  18316. }
  18317. else {
  18318. DataMgr.setSkillSuccessTimes(0, false);
  18319. }
  18320. }
  18321. if (!this.success) {
  18322. Laya.timer.once(500, this, () => {
  18323. xGame.uiMgr.Show(UIAddCoin$1);
  18324. });
  18325. }
  18326. this.ui.isGetAward.visible = false;
  18327. this.ui.leftBtn.c1.selectedIndex = 3;
  18328. this.ui.rightBtn.c1.selectedIndex = 0;
  18329. this.moneyNode.ui.c1.selectedIndex = 1;
  18330. break;
  18331. case GameMode.placeBall:
  18332. this.ui.coinNode.visible = false;
  18333. if (this.success) {
  18334. if (xGame.common.placeBallStarNum == 3) {
  18335. this.ui.c1.selectedIndex = 2;
  18336. }
  18337. else {
  18338. this.ui.c1.selectedIndex = 3;
  18339. }
  18340. }
  18341. else {
  18342. this.ui.c1.selectedIndex = 4;
  18343. }
  18344. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18345. if (cfg.type == PlaceBallType.challenge) {
  18346. this.ui.c1.selectedIndex = 2;
  18347. }
  18348. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  18349. this.updatePlaceBallBtn();
  18350. this.updatePlaceBallStarNum();
  18351. this.updatePlaceBallAwardState();
  18352. this.moneyNode.ui.c1.selectedIndex = 2;
  18353. this.moneyNode.checkPowerTime();
  18354. this.moneyNode.powerChange();
  18355. DataMgr.upRankData();
  18356. break;
  18357. default:
  18358. break;
  18359. }
  18360. }
  18361. updatePlaceBallBtn() {
  18362. this.ui.leftBtn.c1.selectedIndex = 5;
  18363. if (this.success) {
  18364. this.ui.rightBtn.c1.selectedIndex = 14;
  18365. }
  18366. else {
  18367. if (xGame.common.placeBallStarNum == 3) {
  18368. this.ui.rightBtn.c1.selectedIndex = 14;
  18369. }
  18370. else {
  18371. this.ui.rightBtn.c1.selectedIndex = 1;
  18372. }
  18373. }
  18374. }
  18375. updatePlaceBallStarNum() {
  18376. let starNum = xGame.common.placeBallStarNum;
  18377. if (starNum == 0)
  18378. this.ui.starNumNode.c1.selectedIndex = 3;
  18379. else {
  18380. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18381. }
  18382. }
  18383. updatePlaceBallAwardState() {
  18384. let level = xGame.common.placeBallCurLevel;
  18385. let starNum = xGame.common.placeBallStarNum;
  18386. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18387. let data = cfgTable.placeballData[level].award;
  18388. let cfg = cfgTable.placeballData[level];
  18389. this.awardDiamondNum = data[1];
  18390. this.awardCoinNum = data[0];
  18391. if (cfg.type == PlaceBallType.challenge) {
  18392. this.awardDiamondNum = 0;
  18393. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18394. }
  18395. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18396. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18397. if (cfg.type == PlaceBallType.challenge) {
  18398. this.ui.awardNode.coinNode.visible = true;
  18399. }
  18400. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18401. this.ui.awardNode.diamondNode.x = 265;
  18402. this.ui.awardNode.coinNode.x = 354;
  18403. }
  18404. else {
  18405. this.ui.awardNode.diamondNode.x = 291;
  18406. this.ui.awardNode.coinNode.x = 291;
  18407. }
  18408. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18409. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18410. if (this.awardCoinNum == 0) {
  18411. this.ui.awardNode.coinNode.numTxt.text = "";
  18412. }
  18413. if (getAward) {
  18414. this.ui.isGetAward.visible = true;
  18415. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18416. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18417. }
  18418. else {
  18419. this.ui.isGetAward.visible = false;
  18420. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18421. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18422. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18423. }
  18424. else {
  18425. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18426. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18427. }
  18428. }
  18429. }
  18430. show(success) {
  18431. super.show();
  18432. xGame.eventMgr.event(RESET_GAME);
  18433. this.success = success;
  18434. Laya.timer.clearAll(this);
  18435. this.playSecretaryAni();
  18436. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18437. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18438. offsetTime = Math.floor(offsetTime / 1000);
  18439. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18440. this.updateType();
  18441. Laya.timer.once(200, this, () => {
  18442. this.addAward(() => {
  18443. this.updateType();
  18444. Laya.timer.once(500, this, () => {
  18445. this.showChallengeLevel();
  18446. });
  18447. });
  18448. });
  18449. if (this.success) {
  18450. JSBridgeUtils.instance.showInternAd('gameend_success');
  18451. console.log('zh:game end 成功');
  18452. xGame.soundMgr.playSound('slots_roll01');
  18453. xGame.soundMgr.playSound("s_win");
  18454. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18455. }
  18456. else {
  18457. JSBridgeUtils.instance.showInternAd('gameend_faill');
  18458. console.log('zh:game end失败');
  18459. xGame.soundMgr.playSound('matchwin01');
  18460. xGame.soundMgr.playSound("s_lose");
  18461. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18462. }
  18463. let challengeNum = DataMgr.getChallengeTimes();
  18464. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18465. DataMgr.setChallengeTimes(1);
  18466. }
  18467. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18468. DataMgr.setClassicTimes();
  18469. }
  18470. }
  18471. showChallengeLevel() {
  18472. if (DataMgr.getChallengeTimes() != 0)
  18473. return;
  18474. let skill = DataMgr.getSkillAccTimes();
  18475. let put = DataMgr.getPlaceBallLevelList().length;
  18476. if (skill >= 3 || put >= 5) {
  18477. xGame.uiMgr.Show(UIInvitation$1);
  18478. this.hide();
  18479. }
  18480. }
  18481. addAward(callback) {
  18482. if (!this.success) {
  18483. callback && callback();
  18484. return;
  18485. }
  18486. switch (xGame.common.gameMode) {
  18487. case GameMode.classic:
  18488. this.awardCoinNum = xGame.common.passAwardCoin;
  18489. this.awardDiamondNum = 0;
  18490. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18491. break;
  18492. case GameMode.bigMove:
  18493. this.awardCoinNum = xGame.common.passAwardCoin;
  18494. this.awardDiamondNum = 0;
  18495. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18496. callback && callback();
  18497. break;
  18498. case GameMode.placeBall:
  18499. let level = xGame.common.placeBallCurLevel;
  18500. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18501. if (xGame.common.placeBallStarNum != 3) {
  18502. callback && callback();
  18503. return;
  18504. }
  18505. else {
  18506. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18507. if (getAward) {
  18508. callback && callback();
  18509. return;
  18510. }
  18511. }
  18512. let cfg = cfgTable.placeballData[level];
  18513. let data = cfgTable.placeballData[level].award;
  18514. this.awardCoinNum = data[0];
  18515. this.awardDiamondNum = data[1];
  18516. if (cfg.type == PlaceBallType.challenge) {
  18517. this.awardDiamondNum = 0;
  18518. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18519. }
  18520. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18521. let diamondAward;
  18522. if (this.awardDiamondNum > 0) {
  18523. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18524. xGame.common.getAward([diamondAward, coinAward], callback);
  18525. }
  18526. else {
  18527. xGame.common.getAward([coinAward], callback);
  18528. }
  18529. if (cfg.type == PlaceBallType.normal) {
  18530. DataMgr.setPlaceBallAward(level);
  18531. }
  18532. break;
  18533. default:
  18534. break;
  18535. }
  18536. }
  18537. playSecretaryAni_old() {
  18538. let parent = this.ui.secretary.displayObject;
  18539. parent.destroyChildren();
  18540. let xx = this.ui.secretary.width / 2;
  18541. let yy = this.ui.secretary.height;
  18542. let scale = xGame.common.getSecretaryScale();
  18543. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18544. if (this.success) {
  18545. let rand = Math.random() <= 0.5 ? 2 : 3;
  18546. xGame.common.secretary.play(data, rand, false, parent, () => {
  18547. xGame.common.secretary.play(data, 1, true, parent);
  18548. });
  18549. }
  18550. else {
  18551. xGame.common.secretary.play(data, 0, true, parent);
  18552. }
  18553. }
  18554. playSecretaryAni() {
  18555. let parent = this.ui.secretary.displayObject;
  18556. parent.destroyChildren();
  18557. let xx = this.ui.secretary.width / 2;
  18558. let yy = this.ui.secretary.height;
  18559. let scale = xGame.common.getSecretaryScale();
  18560. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18561. if (this.success) {
  18562. let rand = 0;
  18563. xGame.common.secretary.play(data, 0, true, parent);
  18564. }
  18565. else {
  18566. xGame.common.secretary.play(data, 0, true, parent);
  18567. }
  18568. }
  18569. restartGame() {
  18570. switch (xGame.common.gameMode) {
  18571. case GameMode.classic:
  18572. xGame.eventMgr.event(RESTART_GAME);
  18573. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18574. break;
  18575. case GameMode.bigMove:
  18576. this.hide();
  18577. xGame.eventMgr.event(RESTART_GAME);
  18578. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18579. break;
  18580. default:
  18581. break;
  18582. }
  18583. }
  18584. hide() {
  18585. super.hide();
  18586. xGame.common.stopGirlPop(this.ui.talkNode);
  18587. PlatMgr.showBanner(false);
  18588. }
  18589. returnHome() {
  18590. this.hide();
  18591. let showFailWords = !this.success;
  18592. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18593. }
  18594. clickLeftBtn() {
  18595. switch (xGame.common.gameMode) {
  18596. case GameMode.classic:
  18597. case GameMode.bigMove:
  18598. this.returnHome();
  18599. break;
  18600. case GameMode.placeBall:
  18601. let level = xGame.common.placeBallCurLevel;
  18602. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18603. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18604. break;
  18605. default:
  18606. break;
  18607. }
  18608. }
  18609. powerStartPlaceBallLevel(level, btn) {
  18610. if (DataMgr.powerEnough()) {
  18611. btn.touchable = false;
  18612. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18613. btn.touchable = true;
  18614. DataMgr.setPower(-1);
  18615. xGame.eventMgr.event(POWER_TIME);
  18616. this.startPlaceBallLevel(level);
  18617. }));
  18618. }
  18619. else {
  18620. xGame.uiMgr.Show(UIPower$1, 0);
  18621. }
  18622. }
  18623. clickRightBtn() {
  18624. switch (xGame.common.gameMode) {
  18625. case GameMode.classic:
  18626. console.log('zh:clickRightBtn 111');
  18627. case GameMode.bigMove:
  18628. console.log('zh:clickRightBtn 222');
  18629. this.restartGame();
  18630. break;
  18631. case GameMode.placeBall:
  18632. console.log('zh:clickRightBtn 333');
  18633. let level = xGame.common.placeBallCurLevel;
  18634. let data = DataMgr.getPlaceBallLevel(level);
  18635. let curPss = data.play && !data.isCur;
  18636. if (curPss) {
  18637. console.log('zh:clickRightBtn 333-111');
  18638. console.log('zh:当前LV=' + level);
  18639. if (level == 60) {
  18640. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  18641. Laya.timer.once(3000, this, () => {
  18642. this.returnHome();
  18643. });
  18644. }
  18645. else {
  18646. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18647. }
  18648. }
  18649. else {
  18650. console.log('zh:clickRightBtn 333-000');
  18651. Moyu.sendDataEvent("placeBallNextLevel");
  18652. console.log('zh:qjff_AD_for_uiGameEnd');
  18653. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  18654. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  18655. }
  18656. else {
  18657. console.log('zh:AD 失败,直接发放奖励');
  18658. this.qjff_AD_for_uiGameEnd(level);
  18659. }
  18660. }
  18661. break;
  18662. default:
  18663. console.log('zh:clickRightBtn 444');
  18664. break;
  18665. }
  18666. }
  18667. qjff_AD_for_uiGameEnd(level) {
  18668. DataMgr.setPlaceBallLevel(level, 1);
  18669. this.startPlaceBallLevel(level + 1);
  18670. }
  18671. startPlaceBallLevel(level) {
  18672. xGame.common.gameMode = GameMode.placeBall;
  18673. xGame.common.placeBallCurLevel = level;
  18674. xGame.uiMgr.Show(UIGame$1);
  18675. this.hide();
  18676. }
  18677. }
  18678. UIGameEnd$1.uiName = "UIGameEnd";
  18679. class ShowItem$1 {
  18680. constructor() {
  18681. this.ui = ui_ShowItem.createInstance();
  18682. }
  18683. destroySelf() {
  18684. if (!this.ui.isDisposed) {
  18685. this.ui.removeFromParent();
  18686. this.ui.dispose();
  18687. }
  18688. }
  18689. setParent(parent) {
  18690. parent.addChild(this.ui);
  18691. }
  18692. setPos(x, y) {
  18693. this.ui.x = x;
  18694. this.ui.y = y;
  18695. }
  18696. setUrl(index) {
  18697. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18698. }
  18699. }
  18700. class UILevelProp$1 extends UIBase {
  18701. constructor() {
  18702. super();
  18703. this.firstPos = 385;
  18704. this.secondPos = 467;
  18705. this.showItemArr = [];
  18706. }
  18707. onFontLoaded() {
  18708. try {
  18709. this.ui.myNode.conditionTxt.font = "arial";
  18710. console.log("zh: onFontLoaded 设置arial字体成功");
  18711. }
  18712. catch (error) {
  18713. console.log("zh: constructor onFontLoaded加载arial字体失败");
  18714. }
  18715. }
  18716. onConstructor() {
  18717. this.ui = ui_UILevelProp.createInstance();
  18718. this.contentPane = this.ui;
  18719. this.isEject = false;
  18720. this.addUIClick(this.ui.closeBtn, this.hide);
  18721. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18722. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18723. }
  18724. show(level) {
  18725. super.show();
  18726. this.ui.t1.play();
  18727. this.level = level;
  18728. this.data = cfgTable.placeballData[this.level];
  18729. this.updateSelf();
  18730. this.showPreView();
  18731. this.moneyNode.ui.c1.selectedIndex = 2;
  18732. this.moneyNode.checkPowerTime();
  18733. this.moneyNode.powerChange();
  18734. }
  18735. showPreView() {
  18736. let item;
  18737. let data;
  18738. for (let index = 0; index < this.showItemArr.length; index++) {
  18739. item = this.showItemArr[index];
  18740. item.destroySelf();
  18741. }
  18742. this.showItemArr = [];
  18743. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18744. for (const key in cfgData) {
  18745. data = cfgData[key];
  18746. item = new ShowItem$1();
  18747. item.setParent(this.ui.myNode.displayRoot);
  18748. item.setPos(data.x, data.y);
  18749. item.setUrl(data.value);
  18750. this.showItemArr.push(item);
  18751. }
  18752. }
  18753. updateSelf() {
  18754. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18755. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18756. if (this.data.ball == -1) {
  18757. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18758. }
  18759. else {
  18760. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  18761. }
  18762. let localData = DataMgr.getPlaceBallLevel(this.level);
  18763. let getAward = localData.getAward;
  18764. let cfg = cfgTable.placeballData[this.level];
  18765. let coin = this.data.award[0];
  18766. let diamond = this.data.award[1];
  18767. if (cfg.type == PlaceBallType.challenge) {
  18768. diamond = 0;
  18769. coin = 100;
  18770. }
  18771. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18772. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18773. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18774. if (cfg.type == PlaceBallType.challenge) {
  18775. this.ui.myNode.coinNode.numTxt.text = "";
  18776. }
  18777. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18778. if (coin > 0 && diamond > 0) {
  18779. this.ui.myNode.diamondNode.x = 385;
  18780. this.ui.myNode.coinNode.x = 467;
  18781. }
  18782. else {
  18783. this.ui.myNode.diamondNode.x = 385;
  18784. this.ui.myNode.coinNode.x = 385;
  18785. }
  18786. if (!getAward) {
  18787. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18788. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18789. }
  18790. else {
  18791. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18792. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18793. }
  18794. }
  18795. startGame() {
  18796. if (DataMgr.powerEnough()) {
  18797. this.ui.myNode.startBtn.touchable = false;
  18798. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18799. console.log('zh:startGame ');
  18800. this.ui.myNode.startBtn.touchable = true;
  18801. DataMgr.setPower(-1);
  18802. xGame.eventMgr.event(POWER_TIME);
  18803. xGame.common.gameMode = GameMode.placeBall;
  18804. xGame.common.placeBallCurLevel = this.level;
  18805. xGame.uiMgr.Show(UIGame$1);
  18806. xGame.uiMgr.Hide(UILevelDisplay$1);
  18807. xGame.uiMgr.Hide(UIMain$1);
  18808. this.hide();
  18809. }));
  18810. }
  18811. else {
  18812. console.log('zh:startGame no power');
  18813. xGame.uiMgr.Show(UIPower$1);
  18814. }
  18815. }
  18816. hide() {
  18817. super.hide();
  18818. }
  18819. }
  18820. UILevelProp$1.uiName = "UILevelProp";
  18821. class PutBallLevelDisplay$1 {
  18822. constructor(ui, index) {
  18823. this.index = 0;
  18824. this.ui = ui;
  18825. this.index = index;
  18826. this.ui.onClick(this, this.clickSelf);
  18827. this.updateSelf();
  18828. this.ui.levelTxt.text = (this.index + 1) + "";
  18829. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18830. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18831. }
  18832. updateSelf() {
  18833. let level = this.index + 1;
  18834. this.data = DataMgr.getPlaceBallLevel(level);
  18835. this.ui.starNode.c1.selectedIndex = this.data.star;
  18836. let isChallenge = cfgTable.placeballData[level].type;
  18837. if (this.data.isCur) {
  18838. if (isChallenge) {
  18839. this.ui.c1.selectedIndex = 5;
  18840. }
  18841. else {
  18842. this.ui.c1.selectedIndex = 2;
  18843. }
  18844. }
  18845. else {
  18846. if (this.data.play) {
  18847. if (this.data.star == 3) {
  18848. this.ui.c1.selectedIndex = 0;
  18849. }
  18850. else {
  18851. this.ui.c1.selectedIndex = 1;
  18852. }
  18853. }
  18854. else {
  18855. if (isChallenge) {
  18856. this.ui.c1.selectedIndex = 4;
  18857. }
  18858. else {
  18859. this.ui.c1.selectedIndex = 3;
  18860. }
  18861. }
  18862. }
  18863. }
  18864. clickSelf() {
  18865. if (!this.data.play)
  18866. return;
  18867. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18868. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18869. }
  18870. }
  18871. class UILevelDisplay$1 extends UIBase {
  18872. constructor() {
  18873. super();
  18874. }
  18875. onConstructor() {
  18876. this.ui = ui_UILevelDisplay.createInstance();
  18877. this.contentPane = this.ui;
  18878. this.isEject = false;
  18879. this.myList = this.ui.myNode.myList;
  18880. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18881. this.levelItemArr = [];
  18882. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18883. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18884. this.myList.numItems = levelNum;
  18885. if (Moyu.isKs)
  18886. this.ui.closeNode.closeBtn.x += 100;
  18887. }
  18888. levelItemRender(index, target) {
  18889. let item = new PutBallLevelDisplay$1(target, index);
  18890. this.levelItemArr.push(item);
  18891. }
  18892. show() {
  18893. super.show();
  18894. this.updateLevel();
  18895. this.scrollToPlace();
  18896. }
  18897. updateLevel() {
  18898. let temp;
  18899. for (let index = 0; index < this.levelItemArr.length; index++) {
  18900. temp = this.levelItemArr[index];
  18901. temp.updateSelf();
  18902. }
  18903. }
  18904. scrollToPlace() {
  18905. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18906. let passArr = DataMgr.getPlaceBallLevelList();
  18907. let offest = passArr.length;
  18908. if (offest >= maxNum - 1)
  18909. offest = maxNum - 1;
  18910. this.myList.scrollToView(offest, true, true);
  18911. }
  18912. hide() {
  18913. super.hide();
  18914. }
  18915. }
  18916. UILevelDisplay$1.uiName = "UILevelDisplay";
  18917. class UIMatching$1 extends UIBase {
  18918. constructor() {
  18919. super();
  18920. }
  18921. onConstructor() {
  18922. this.ui = ui_UIMatching.createInstance();
  18923. this.contentPane = this.ui;
  18924. this.isEject = false;
  18925. }
  18926. show(callback) {
  18927. super.show();
  18928. PlatMgr.showBanner(true);
  18929. this.callback = callback;
  18930. let user = Moyu.getUserInfo();
  18931. if (!this.selfPot) {
  18932. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18933. }
  18934. if (!this.aiPot) {
  18935. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18936. }
  18937. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18938. this.ui.selfHead.nameTxt.text = user.nickName;
  18939. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18940. this.ui.aiHead.nameTxt.text = "???";
  18941. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18942. this.ui.selfHead.c1.selectedIndex = 0;
  18943. this.ui.aiHead.c1.selectedIndex = 0;
  18944. this.ui.selfHead.x = this.selfPot.x;
  18945. this.ui.selfHead.y = this.selfPot.y;
  18946. this.ui.aiHead.x = this.aiPot.x;
  18947. this.ui.aiHead.y = this.aiPot.y;
  18948. switch (xGame.common.gameMode) {
  18949. case GameMode.classic:
  18950. break;
  18951. case GameMode.bigMove:
  18952. this.initSkillData();
  18953. break;
  18954. default:
  18955. break;
  18956. }
  18957. this.ui.t1.play(Laya.Handler.create(this, () => {
  18958. this.ui.t2.play(Laya.Handler.create(this, () => {
  18959. switch (xGame.common.gameMode) {
  18960. case GameMode.classic:
  18961. this.waitingPeople();
  18962. break;
  18963. case GameMode.bigMove:
  18964. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18965. break;
  18966. default:
  18967. break;
  18968. }
  18969. }));
  18970. }));
  18971. }
  18972. initSkillData() {
  18973. this.skillSelectData = [];
  18974. let skillUrl = xGame.common.skillIconList;
  18975. let skillName = xGame.common.skillNameList;
  18976. let skillLevel = DataMgr.getBigSkillList();
  18977. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18978. for (let index = 0; index < 5; index++) {
  18979. let obj = {};
  18980. obj.skillImg = skillUrl[index];
  18981. obj.skillName = skillName[index];
  18982. obj.skillType = skillType[index];
  18983. obj.skillLevel = skillLevel[index];
  18984. this.skillSelectData.push(obj);
  18985. }
  18986. }
  18987. getAISkillLevel(myLevel) {
  18988. let video = xGame.common.upSkillLevel;
  18989. let aiLevel;
  18990. let temp;
  18991. if (video) {
  18992. temp = xGame.common.randomNum(-2, -1);
  18993. }
  18994. else {
  18995. if (myLevel <= 5) {
  18996. temp = xGame.common.randomNum(1, 3);
  18997. }
  18998. else if (myLevel <= 9) {
  18999. temp = xGame.common.randomNum(-2, 1);
  19000. }
  19001. else {
  19002. temp = xGame.common.randomNum(-4, 0);
  19003. }
  19004. }
  19005. aiLevel = temp + myLevel;
  19006. if (aiLevel <= 1)
  19007. aiLevel = 1;
  19008. if (aiLevel >= 10)
  19009. aiLevel = 10;
  19010. return aiLevel;
  19011. }
  19012. getAISkillType() {
  19013. return xGame.common.randomNum(1, 4);
  19014. let successTimes = DataMgr.getSkillSuccessTimes();
  19015. let info = cfgTable.aiskillData[successTimes];
  19016. if (!info) {
  19017. let max = Object.keys(cfgTable.aiskillData).length - 1;
  19018. info = cfgTable.aiskillData[max];
  19019. }
  19020. let dataArr = info.skillselect;
  19021. let myCfg = {};
  19022. for (let index = 0; index < dataArr.length; index++) {
  19023. let temp = dataArr[index].split('-');
  19024. myCfg[temp[0]] = {};
  19025. myCfg[temp[0]].id = parseInt(temp[0]);
  19026. myCfg[temp[0]].weight = parseInt(temp[1]);
  19027. }
  19028. let aiCfg = xGame.common.initWeight(myCfg);
  19029. let curData = xGame.common.getRandomWeightData(aiCfg);
  19030. return parseInt(curData.id);
  19031. }
  19032. getAISkillData(index) {
  19033. let myLevel = this.skillSelectData[index].skillLevel;
  19034. let aiLevel = this.getAISkillLevel(myLevel);
  19035. let aiType = this.getAISkillType() - 1;
  19036. return { aiLevel, aiType } = { aiLevel, aiType };
  19037. }
  19038. skillSelectFinish(index) {
  19039. let aiInfo = this.getAISkillData(index);
  19040. xGame.common.gameMgr.selfCurSkill = index;
  19041. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  19042. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  19043. this.ui.selfHead.c1.selectedIndex = 1;
  19044. this.ui.aiHead.c1.selectedIndex = 1;
  19045. let myData = this.skillSelectData[index];
  19046. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  19047. let guide = DataMgr.getSkillGuide();
  19048. if (guide == 0) {
  19049. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  19050. }
  19051. else {
  19052. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  19053. }
  19054. let aiData = this.skillSelectData[aiInfo.aiType];
  19055. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  19056. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  19057. this.waitingPeople();
  19058. }
  19059. waitingPeople() {
  19060. let time = xGame.common.randomNum(1000, 3000);
  19061. time += 1000;
  19062. Laya.timer.once(time, this, () => {
  19063. this.matchingSuccess();
  19064. });
  19065. }
  19066. matchingSuccess() {
  19067. let gameUI = xGame.common.gameUI;
  19068. let name = gameUI.ui.topNode.aiNameTxt.text;
  19069. let url = gameUI.ui.topNode.aiHeadLoader.url;
  19070. this.ui.aiHead.nameTxt.text = name;
  19071. this.ui.aiHead.headImg.url = url;
  19072. name = gameUI.ui.topNode.selfNameTxt.text;
  19073. url = gameUI.ui.topNode.selfHeadLoader.url;
  19074. this.ui.selfHead.nameTxt.text = name;
  19075. this.ui.selfHead.headImg.url = url;
  19076. this.ui.t3.play(Laya.Handler.create(this, () => {
  19077. this.callback && this.callback();
  19078. this.ui.t4.play(Laya.Handler.create(this, () => {
  19079. this.destroySelf();
  19080. }));
  19081. }));
  19082. }
  19083. destroySelf() {
  19084. this.callback = null;
  19085. this.skillSelectData = null;
  19086. this.selfPot = null;
  19087. this.aiPot = null;
  19088. if (!this.ui.isDisposed) {
  19089. this.ui.removeFromParent();
  19090. this.ui.dispose();
  19091. }
  19092. xGame.uiMgr.destroyUI(this);
  19093. }
  19094. }
  19095. UIMatching$1.uiName = "UIMatching";
  19096. class SkillDisplay$1 {
  19097. constructor(ui, data, uiIndex) {
  19098. this.starX = 0;
  19099. this.starY = 0;
  19100. this.index = 0;
  19101. this.ui = ui;
  19102. this.data = data;
  19103. this.index = uiIndex;
  19104. this.initSelf();
  19105. console.log('zh:SkillDisplay constructor this.skillData=', data);
  19106. }
  19107. initSelf() {
  19108. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  19109. this.ui.nameTxt.text = this.data.name;
  19110. this.ui.describeTxt.text = this.data.describe;
  19111. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  19112. this.ui.startBtn.onClick(this, this.startGame);
  19113. this.updateSelf();
  19114. }
  19115. updateSelf() {
  19116. this.checkTry();
  19117. let level = DataMgr.getBigSkillByIndex(this.index);
  19118. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  19119. }
  19120. checkTry() {
  19121. let index = this.index;
  19122. let level = DataMgr.getBigSkillByIndex(index);
  19123. if (level == null) {
  19124. DataMgr.setBigSkill(index, 1, false);
  19125. level = 1;
  19126. }
  19127. this.ui.levelTxt.text = "LV." + level;
  19128. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  19129. this.ui.tryNode.visible = true;
  19130. else
  19131. this.ui.tryNode.visible = false;
  19132. }
  19133. clickAddLevel() {
  19134. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19135. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  19136. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  19137. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  19138. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19139. }
  19140. else {
  19141. console.log('zh:AD 失败,直接发放奖励');
  19142. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19143. }
  19144. }
  19145. qjff_AD_for_skilldisplay_clickAddLevel() {
  19146. DataMgr.setBigSkill(this.data.index, 1);
  19147. this.updateSelf();
  19148. xGame.common.upSkillLevel = true;
  19149. }
  19150. startGame() {
  19151. if (this.data.index == 3) {
  19152. alert('Coming soon!');
  19153. return;
  19154. }
  19155. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19156. let needCoin = xGame.common.bigMoveNeedCoin;
  19157. xGame.common.passAwardCoin = 2000;
  19158. let guide = DataMgr.getSkillGuide();
  19159. console.log('zh:startGame guide=' + guide);
  19160. xGame.common.temSelfLevel = 0;
  19161. if (guide == 0) {
  19162. needCoin = 0;
  19163. xGame.common.temSelfLevel = 100;
  19164. }
  19165. if (DataMgr.coinEnough(needCoin)) {
  19166. DataMgr.setCoin(-needCoin);
  19167. xGame.common.curPlayerSkillType = this.index;
  19168. if (guide == 0)
  19169. xGame.common.curPlayerSkillType = 0;
  19170. xGame.uiMgr.Show(UIGame$1);
  19171. xGame.uiMgr.Hide(UIMain$1);
  19172. xGame.uiMgr.Show(UIMatching$1, () => {
  19173. xGame.common.gameUI.ui.alpha = 1;
  19174. xGame.common.gameUI.startGame();
  19175. xGame.uiMgr.Hide(UISkill$1);
  19176. });
  19177. }
  19178. else {
  19179. xGame.uiMgr.Show(UIAddProp$1, 0);
  19180. Moyu.sendDataEvent("AddCoinVideo");
  19181. }
  19182. }
  19183. }
  19184. class UISkill$1 extends UIBase {
  19185. constructor() {
  19186. super();
  19187. this.skillData = [];
  19188. }
  19189. onConstructor() {
  19190. this.ui = ui_UISkill.createInstance();
  19191. this.contentPane = this.ui;
  19192. this.isEject = false;
  19193. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19194. this.initSkillData();
  19195. console.log('zh:aaaaaa1111111111');
  19196. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  19197. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  19198. console.log('zh:aaaaaa22222222');
  19199. this.displayList = [];
  19200. this.ui.skillNode.skillList.numItems = 3;
  19201. this.addUIClick(this.ui, this.interuptSecretary);
  19202. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  19203. this.ui.talkNode.visible = false;
  19204. if (Moyu.isKs)
  19205. this.ui.closeNode.closeBtn.x += 100;
  19206. }
  19207. show() {
  19208. super.show();
  19209. this.playSecretaryIdle();
  19210. this.moneyNode.ui.c1.selectedIndex = 1;
  19211. Laya.timer.clearAll(this);
  19212. xGame.soundMgr.playSound("s_start");
  19213. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19214. let guide = DataMgr.getSkillGuide();
  19215. this.ui.guideNode.visible = guide == 0;
  19216. let item = this.getSkillItemByUIIndex(0);
  19217. if (guide == 0) {
  19218. item.ui.c1.selectedIndex = 1;
  19219. }
  19220. else {
  19221. item.ui.c1.selectedIndex = 0;
  19222. }
  19223. this.ui.guideNode.guideBtn.visible = guide == 0;
  19224. for (let index = 0; index < this.displayList.length; index++) {
  19225. this.displayList[index].checkTry();
  19226. }
  19227. }
  19228. getSkillItemByUIIndex(cur) {
  19229. for (let index = 0; index < this.displayList.length; index++) {
  19230. if (this.displayList[index].index == cur) {
  19231. return this.displayList[index];
  19232. }
  19233. }
  19234. }
  19235. enterGuideLevel() {
  19236. let item = this.getSkillItemByUIIndex(0);
  19237. item.startGame();
  19238. if (DataMgr.getNewUser())
  19239. Moyu.sendDataEvent("gameStart1");
  19240. }
  19241. initSkillData() {
  19242. this.skillData = [];
  19243. let nameList = xGame.common.skillNameList;
  19244. let iconList = xGame.common.skillIconList;
  19245. let describeList = [
  19246. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  19247. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
  19248. "The power of frost descends—freezing the flow and taking full control of the game!"
  19249. ];
  19250. console.log('zh:initSkillData 111111111');
  19251. let data;
  19252. for (let index = 0; index < nameList.length; index++) {
  19253. data = {};
  19254. data.name = nameList[index];
  19255. data.icon = iconList[index];
  19256. data.describe = describeList[index];
  19257. data.index = index;
  19258. this.skillData.push(data);
  19259. }
  19260. }
  19261. updateSkillItem(index, target) {
  19262. if (this.displayList[index] == null) {
  19263. let uiIndex;
  19264. switch (index) {
  19265. case 0:
  19266. uiIndex = 1;
  19267. break;
  19268. case 1:
  19269. uiIndex = 0;
  19270. break;
  19271. case 2:
  19272. uiIndex = 2;
  19273. break;
  19274. case 3:
  19275. uiIndex = 3;
  19276. break;
  19277. default:
  19278. break;
  19279. }
  19280. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  19281. this.displayList.push(temp);
  19282. }
  19283. }
  19284. playSecretaryIdle() {
  19285. let parent = this.ui.secretary.displayObject;
  19286. parent.destroyChildren();
  19287. let xx = this.ui.secretary.width / 2;
  19288. let yy = this.ui.secretary.height;
  19289. let scale = xGame.common.getSecretaryScale();
  19290. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19291. xGame.common.secretary.play(data, 0, true, parent);
  19292. }
  19293. returnUIMain() {
  19294. this.hide();
  19295. xGame.common.stopGirlPop(this.ui.talkNode);
  19296. xGame.uiMgr.Show(UIMain$1);
  19297. }
  19298. interuptSecretary() {
  19299. Laya.timer.clearAll(this);
  19300. this.playSecretaryRandomSound();
  19301. }
  19302. playSecretaryRandomSound() {
  19303. if (this.isHide)
  19304. return;
  19305. let time = xGame.common.randomNum(45000, 60000);
  19306. Laya.timer.once(time, this, () => {
  19307. if (this.isHide)
  19308. return;
  19309. let index = xGame.common.randomNum(4, 7);
  19310. xGame.soundMgr.playSound("s_main0" + index);
  19311. let words = 1;
  19312. switch (index) {
  19313. case 4:
  19314. words = 5;
  19315. break;
  19316. case 5:
  19317. words = 3;
  19318. break;
  19319. case 6:
  19320. words = 6;
  19321. break;
  19322. case 7:
  19323. words = 7;
  19324. break;
  19325. default:
  19326. break;
  19327. }
  19328. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19329. this.playSecretaryRandomSound();
  19330. });
  19331. }
  19332. }
  19333. UISkill$1.uiName = "UISkill";
  19334. class UIAddProp$1 extends UIBase {
  19335. constructor() {
  19336. super();
  19337. this.curType = "";
  19338. }
  19339. onConstructor() {
  19340. this.ui = ui_UIAddProp.createInstance();
  19341. this.contentPane = this.ui;
  19342. this.isEject = false;
  19343. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19344. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  19345. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  19346. this.updateUI();
  19347. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  19348. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  19349. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  19350. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  19351. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  19352. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  19353. }
  19354. show(type) {
  19355. super.show();
  19356. this.curType = type == 0 ? "coin" : "diamond";
  19357. this.switchBtn("");
  19358. this.ui.t0.play();
  19359. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  19360. PlatMgr.showInsert(true);
  19361. }
  19362. closeSelf() {
  19363. this.hide();
  19364. }
  19365. updateUI() {
  19366. let data = cfgTable.moneyData;
  19367. let temp;
  19368. let obj;
  19369. for (const key in data) {
  19370. temp = data[key];
  19371. obj = this.ui.myNode["node" + key];
  19372. if (parseInt(key) <= 2) {
  19373. obj.diamondTxt.text = "+" + temp.num;
  19374. }
  19375. else {
  19376. obj.coinTxt.text = temp.num;
  19377. obj.diamondTxt.text = temp.get.split('_')[1];
  19378. }
  19379. }
  19380. this.updateDiamondShare();
  19381. }
  19382. updateDiamondShare() {
  19383. let data = DataMgr.getShareDiamondTimes();
  19384. if (data >= xGame.common.maxShareDiamondTimes) {
  19385. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  19386. this.ui.myNode.node1.touchable = false;
  19387. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19388. }
  19389. else {
  19390. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  19391. this.ui.myNode.node1.touchable = true;
  19392. }
  19393. }
  19394. switchBtn(type) {
  19395. if (type == "")
  19396. type = this.curType;
  19397. else {
  19398. if (this.curType == type) {
  19399. return;
  19400. }
  19401. else {
  19402. this.curType = type;
  19403. }
  19404. }
  19405. if (type == "coin") {
  19406. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  19407. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  19408. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  19409. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  19410. this.ui.myNode.c1.selectedIndex = 0;
  19411. }
  19412. else {
  19413. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  19414. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  19415. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  19416. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  19417. this.ui.myNode.c1.selectedIndex = 1;
  19418. }
  19419. }
  19420. convertCoin(index) {
  19421. let data = cfgTable.moneyData[index];
  19422. let coinNum = data.num;
  19423. let str = data.get.split('_')[1];
  19424. let needDiamond = parseInt(str);
  19425. if (DataMgr.diamondEnough(needDiamond)) {
  19426. DataMgr.setDiamond(-needDiamond);
  19427. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  19428. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  19429. }
  19430. else {
  19431. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  19432. this.switchBtn("diamond");
  19433. }
  19434. }
  19435. videoGetDiamond() {
  19436. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  19437. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  19438. }
  19439. else {
  19440. console.log('zh:AD 失败,直接发放奖励');
  19441. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  19442. }
  19443. }
  19444. qjff_AD_for_uiAddProp_videoGetDiamond() {
  19445. let num = cfgTable.moneyData[2].num;
  19446. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19447. this.closeSelf();
  19448. }
  19449. videoGetCoin() {
  19450. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  19451. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  19452. }
  19453. else {
  19454. console.log('zh:AD 失败,直接发放奖励');
  19455. this.qjff_AD_for_uiAddProp_videoGetCoin();
  19456. }
  19457. }
  19458. qjff_AD_for_uiAddProp_videoGetCoin() {
  19459. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19460. this.closeSelf();
  19461. }
  19462. shareGetDiamond() {
  19463. let times = DataMgr.getShareDiamondTimes();
  19464. if (times >= xGame.common.maxShareDiamondTimes) {
  19465. console.log('zh: 233333333333 maxShareDiamondTimes');
  19466. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19467. }
  19468. else {
  19469. console.log('zh:33333333333333ad');
  19470. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  19471. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  19472. }
  19473. else {
  19474. console.log('zh:AD 失败,直接发放奖励');
  19475. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  19476. }
  19477. }
  19478. }
  19479. qjff_AD_for_uiAddProp_shareGetDiamond() {
  19480. let diamond = xGame.common.randomNum(50, 100);
  19481. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19482. DataMgr.setShareDiamondTimes(1);
  19483. this.updateDiamondShare();
  19484. }
  19485. openPutBallView() {
  19486. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19487. let skill = xGame.uiMgr.getUI(UISkill$1);
  19488. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19489. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19490. if (end && !end.isHide) {
  19491. xGame.uiMgr.Hide(UIGameEnd$1);
  19492. xGame.uiMgr.Show(UIMain$1);
  19493. }
  19494. if (skill && !skill.isHide)
  19495. xGame.uiMgr.Hide(UISkill$1);
  19496. if (uigame && !uigame.isHide)
  19497. xGame.uiMgr.Hide(UIGame$1);
  19498. if (level && !level.isHide) {
  19499. }
  19500. else {
  19501. xGame.uiMgr.Show(UILevelDisplay$1);
  19502. }
  19503. this.closeSelf();
  19504. }
  19505. }
  19506. UIAddProp$1.uiName = "UIAddProp";
  19507. class MoneyNode$1 {
  19508. constructor(ui) {
  19509. this.leftTime = 0;
  19510. this.ui = ui;
  19511. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19512. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19513. this.ui.addPowerBtn.onClick(this, this.addPower);
  19514. this.ui.c1.selectedIndex = 1;
  19515. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19516. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19517. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19518. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19519. this.coinChange();
  19520. this.diamondChange();
  19521. this.powerChange();
  19522. }
  19523. addPower() {
  19524. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19525. xGame.uiMgr.Show(UIPower$1);
  19526. }
  19527. powerChange() {
  19528. let powerNum = DataMgr.getPower();
  19529. this.ui.powerTxt.text = powerNum + "";
  19530. }
  19531. checkPowerTime() {
  19532. let cur = new Date().getTime();
  19533. let last = DataMgr.getPowerTime();
  19534. if (last == 0) {
  19535. last = cur;
  19536. DataMgr.setPowerTime(cur);
  19537. }
  19538. let power = DataMgr.getPower();
  19539. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19540. Laya.timer.clearAll(this);
  19541. if (power >= xGame.common.natureMaxPower) {
  19542. this.ui.powerTimeTxt.text = "";
  19543. DataMgr.setPowerTime(cur);
  19544. return;
  19545. }
  19546. if (power + offset >= xGame.common.natureMaxPower) {
  19547. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19548. this.ui.powerTimeTxt.text = "";
  19549. DataMgr.setPowerTime(cur);
  19550. }
  19551. else {
  19552. if (offset > 0) {
  19553. DataMgr.setPower(offset);
  19554. DataMgr.setPowerTime(cur);
  19555. }
  19556. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19557. this.leftTime = xGame.common.powerRecoverNum - time;
  19558. if (this.leftTime <= 0)
  19559. this.leftTime = 0;
  19560. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19561. Laya.timer.loop(1000, this, this.updatePowerTime);
  19562. }
  19563. }
  19564. updatePowerTime() {
  19565. this.leftTime -= 1;
  19566. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19567. if (this.leftTime <= 0) {
  19568. this.checkPowerTime();
  19569. }
  19570. }
  19571. coinChange() {
  19572. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19573. }
  19574. diamondChange() {
  19575. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19576. }
  19577. addCoin() {
  19578. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19579. Moyu.sendDataEvent("AddCoinBtn");
  19580. xGame.uiMgr.Show(UIAddProp$1, 0);
  19581. }
  19582. addDiamond() {
  19583. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19584. Moyu.sendDataEvent("AddDiamondBtn");
  19585. xGame.uiMgr.Show(UIAddProp$1, 1);
  19586. }
  19587. }
  19588. class SettingNode$1 {
  19589. constructor(ui) {
  19590. this.showSetting = false;
  19591. this.openSound = true;
  19592. this.openShake = true;
  19593. this.ui = ui;
  19594. this.ui.soundBtn.onClick(this, this.switchSound);
  19595. this.ui.shakeBtn.onClick(this, this.switchShake);
  19596. this.ui.xyBtn.onClick(this, this.onXy);
  19597. this.ui.clickNode.onClick(this, this.changeSetting);
  19598. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19599. this.ui.xyBtn.visible = false;
  19600. this.ui.shakeBtn.visible = false;
  19601. }
  19602. changeSetting() {
  19603. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19604. this.showSetting = !this.showSetting;
  19605. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19606. }
  19607. switchSound() {
  19608. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19609. this.openSound = !this.openSound;
  19610. Moyu.onSetting(this.openSound, this.openShake);
  19611. xGame.soundMgr.onSetting(this.openSound);
  19612. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19613. }
  19614. switchShake() {
  19615. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19616. this.openShake = !this.openShake;
  19617. Moyu.onSetting(this.openSound, this.openShake);
  19618. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19619. }
  19620. onXy() {
  19621. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19622. MoyuMgr$1.showXy(1);
  19623. }
  19624. }
  19625. class UIDraw$1 extends UIBase {
  19626. constructor() {
  19627. super();
  19628. this.curKey = 0;
  19629. }
  19630. onConstructor() {
  19631. this.ui = ui_UIDraw.createInstance();
  19632. this.contentPane = this.ui;
  19633. this.isEject = false;
  19634. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19635. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19636. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19637. this.initDraw();
  19638. this.initUI();
  19639. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19640. if (Moyu.isKs)
  19641. this.ui.closeNode.closeBtn.x += 100;
  19642. }
  19643. show() {
  19644. super.show();
  19645. this.ui.t0.play();
  19646. this.playSecretaryIdle();
  19647. this.updateDraw();
  19648. this.checkFree();
  19649. if (PlatMgr.bannerDelay > 0) {
  19650. this.ui.closeNode.closeBtn.visible = false;
  19651. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19652. this.ui.closeNode.closeBtn.visible = true;
  19653. });
  19654. }
  19655. PlatMgr.showRateBanner();
  19656. }
  19657. hide() {
  19658. Laya.timer.clearAll(this);
  19659. super.hide();
  19660. }
  19661. checkFree() {
  19662. let isFree = DataMgr.getDailyfreeDrawTimes();
  19663. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19664. }
  19665. initDraw() {
  19666. this.drawObj = [];
  19667. let data = cfgTable.drawData;
  19668. let temp;
  19669. let weight = 0;
  19670. for (const key in data) {
  19671. temp = data[key];
  19672. weight += temp.weight;
  19673. this.drawObj.push(weight);
  19674. }
  19675. this.allWeight = weight;
  19676. }
  19677. initUI() {
  19678. let data = cfgTable.drawData;
  19679. let temp;
  19680. let img;
  19681. let txt;
  19682. for (const key in data) {
  19683. temp = data[key];
  19684. img = this.ui.myNode.rotNode["img" + key];
  19685. txt = this.ui.myNode.rotNode["txt" + key];
  19686. img.url = xGame.common.getGameIconUrl(temp.icon);
  19687. txt.visible = true;
  19688. if (temp.award > 2) {
  19689. img.rotation = 0;
  19690. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19691. }
  19692. else {
  19693. img.rotation = temp.rotation;
  19694. txt.text = temp.num;
  19695. }
  19696. }
  19697. }
  19698. getCurkey() {
  19699. let rand = Math.random() * this.allWeight;
  19700. let temp;
  19701. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19702. temp = this.drawObj[index];
  19703. if (index == 0) {
  19704. if (rand < temp) {
  19705. return index + 1;
  19706. }
  19707. }
  19708. else {
  19709. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19710. return index + 1;
  19711. }
  19712. }
  19713. }
  19714. return 2;
  19715. }
  19716. startDraw() {
  19717. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19718. if (freeTimes > 0) {
  19719. this.beginDraw();
  19720. DataMgr.setDailyfreeDrawTimes(0);
  19721. this.checkFree();
  19722. }
  19723. else {
  19724. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  19725. }
  19726. else {
  19727. console.log('zh:AD 失败,直接发放奖励');
  19728. this.qjff_chouJiang();
  19729. }
  19730. }
  19731. }
  19732. qjff_chouJiang() {
  19733. this.beginDraw();
  19734. }
  19735. beginDraw() {
  19736. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19737. this.ui.drawBtn.touchable = false;
  19738. this.curKey = this.getCurkey();
  19739. console.log("当前key", this.curKey);
  19740. let cell = 60;
  19741. let lap = 3;
  19742. let angle = cell * (this.curKey - 1) + lap * 360;
  19743. let target = this.ui.myNode.rotNode;
  19744. target.rotation = 0;
  19745. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19746. console.log("旋转完成");
  19747. this.ui.drawBtn.touchable = true;
  19748. this.getAward();
  19749. }));
  19750. }
  19751. getAward() {
  19752. let data = cfgTable.drawData[this.curKey];
  19753. let temp = new AwardType();
  19754. temp.type = data.award;
  19755. temp.num = data.num;
  19756. xGame.common.getAward([temp], () => {
  19757. DataMgr.setDrawTimes(1);
  19758. this.updateDraw();
  19759. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19760. });
  19761. }
  19762. updateDraw() {
  19763. let drawTimes = DataMgr.getDrawTimes();
  19764. let awardTimes = DataMgr.getDrawAwardTimes();
  19765. if (Math.floor(drawTimes / 3) > awardTimes) {
  19766. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19767. this.ui.extraNode.boxBtn.touchable = true;
  19768. this.ui.extraNode.tipsTxt.text = "3/3";
  19769. this.ui.extraNode.barNode.width = 265;
  19770. this.getExtraAward();
  19771. }
  19772. else {
  19773. this.ui.extraNode.boxBtn.t0.stop();
  19774. this.ui.extraNode.boxBtn.touchable = false;
  19775. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19776. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19777. }
  19778. let data = cfgTable.drawData[1];
  19779. if (awardTimes == 0) {
  19780. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19781. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19782. this.ui.myNode.rotNode.img1.rotation = 0;
  19783. }
  19784. else {
  19785. let award = data.nextid;
  19786. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19787. this.ui.myNode.rotNode.txt1.text = award[1];
  19788. this.ui.myNode.rotNode.img1.rotation = 0;
  19789. }
  19790. }
  19791. getExtraAward() {
  19792. let drawTimes = DataMgr.getDrawTimes();
  19793. let awardTimes = DataMgr.getDrawAwardTimes();
  19794. let data = cfgTable.drawData[1];
  19795. let award = new AwardType();
  19796. if (awardTimes == 0) {
  19797. award.num = data.num;
  19798. award.type = data.award;
  19799. xGame.common.getAward([award], () => {
  19800. let all = Math.floor(drawTimes / 3);
  19801. DataMgr.setDrawAwardTimes(all);
  19802. this.updateDraw();
  19803. });
  19804. }
  19805. else {
  19806. award.num = parseInt(data.nextid[1]);
  19807. award.type = parseInt(data.nextid[0]);
  19808. xGame.common.getAward([award], () => {
  19809. let all = Math.floor(drawTimes / 3);
  19810. DataMgr.setDrawAwardTimes(all);
  19811. this.updateDraw();
  19812. });
  19813. }
  19814. }
  19815. closeSelf() {
  19816. this.hide();
  19817. }
  19818. playSecretaryIdle() {
  19819. let parent = this.ui.secretary.displayObject;
  19820. parent.destroyChildren();
  19821. let xx = this.ui.secretary.width / 2;
  19822. let yy = this.ui.secretary.height;
  19823. let scale = xGame.common.getSecretaryScale();
  19824. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19825. xGame.common.secretary.play(data, 0, true, parent);
  19826. }
  19827. }
  19828. UIDraw$1.uiName = "UIDraw";
  19829. class UIRanking$1 extends UIBase {
  19830. constructor() {
  19831. super();
  19832. this.showSelf = true;
  19833. this.rankType = 1;
  19834. this.rankList = [];
  19835. this.myIndex = 0;
  19836. this.myStar = 0;
  19837. }
  19838. onConstructor() {
  19839. this.ui = ui_UIRanking.createInstance();
  19840. this.contentPane = this.ui;
  19841. this.isEject = false;
  19842. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19843. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19844. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19845. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19846. this.ui.myNode.myList.setVirtual();
  19847. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19848. }
  19849. show() {
  19850. super.show();
  19851. this.myIndex = 51;
  19852. Moyu.getRankList({
  19853. rankId: xGame.common.curRankID,
  19854. type: MoyuRankType.total,
  19855. page: 1,
  19856. pageSize: 50,
  19857. }, this, this.updateItemData);
  19858. this.updateSelf();
  19859. let self = Moyu.getUserInfo();
  19860. if (!self.isAuth) {
  19861. Moyu.initUser(this, () => {
  19862. DataMgr.upRankData();
  19863. });
  19864. }
  19865. }
  19866. updateSelfItem() {
  19867. let self = Moyu.getUserInfo();
  19868. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19869. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19870. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19871. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19872. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19873. }
  19874. updateItemData(data) {
  19875. this.myStar = xGame.common.getAllStarNum();
  19876. if (this.rankList.length < 2) {
  19877. this.rankList = data;
  19878. let self = Moyu.getUserInfo();
  19879. for (let i = 0; i < data.length; i++) {
  19880. let data = this.rankList[i];
  19881. if (data.userId == self.userId) {
  19882. this.rankList.splice(i, 1);
  19883. break;
  19884. }
  19885. }
  19886. for (let i = 0; i < data.length; i++) {
  19887. let data = this.rankList[i];
  19888. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19889. this.myIndex = i + 1;
  19890. let user = { headIcon: self.headIcon, nickName: "myself" };
  19891. let ud = { user: user, data: {} };
  19892. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19893. if (Moyu.platType < 11) {
  19894. user.headIcon = self.headIcon;
  19895. user.nickName = self.nickName;
  19896. }
  19897. this.rankList.splice(i, 0, md);
  19898. break;
  19899. }
  19900. }
  19901. }
  19902. this.updateSelfItem();
  19903. this.ui.myNode.myList.numItems = this.rankList.length;
  19904. }
  19905. updateItemUI(index, obj) {
  19906. let data = this.rankList[index];
  19907. let userData = JSON.parse(data.userData).user;
  19908. obj.nameTxt.text = userData.nickName.toString();
  19909. obj.valueTxt.text = data.rankScore;
  19910. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19911. obj.rankTxt.text = index + 1;
  19912. switch (index) {
  19913. case 0:
  19914. this.setImg(obj, 1, 0, 0);
  19915. obj.rankTxt.color = "#FFC047";
  19916. break;
  19917. case 1:
  19918. this.setImg(obj, 0, 1, 0);
  19919. obj.rankTxt.color = "#ACACAC";
  19920. break;
  19921. case 2:
  19922. this.setImg(obj, 0, 0, 1);
  19923. obj.rankTxt.color = "#D09672";
  19924. break;
  19925. default:
  19926. this.setImg(obj, 0, 0, 0);
  19927. obj.rankTxt.color = "#496FAB";
  19928. break;
  19929. }
  19930. }
  19931. setImg(obj, a, b, c) {
  19932. obj.img1.visible = a ? true : false;
  19933. obj.img2.visible = b ? true : false;
  19934. obj.img3.visible = c ? true : false;
  19935. }
  19936. changeList(type) {
  19937. this.rankType = type;
  19938. this.updateSelf();
  19939. }
  19940. changeSelfNode() {
  19941. this.showSelf = !this.showSelf;
  19942. this.updateSelf();
  19943. }
  19944. updateSelf() {
  19945. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19946. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19947. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19948. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19949. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19950. }
  19951. }
  19952. UIRanking$1.uiName = "UIRanking";
  19953. class UISecretary$1 extends UIBase {
  19954. constructor() {
  19955. super();
  19956. this.curIndex = 1;
  19957. }
  19958. onConstructor() {
  19959. this.ui = ui_UISecretary.createInstance();
  19960. this.contentPane = this.ui;
  19961. this.isEject = false;
  19962. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19963. this.nodeObj = { left: null, right: null, cur: null };
  19964. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19965. }
  19966. show() {
  19967. super.show();
  19968. this.ui.t0.play();
  19969. this.updateData();
  19970. }
  19971. addSecretarySpine(node, spineName) {
  19972. if (spineName == "mishu") {
  19973. if (this.secretarySpine1) {
  19974. node.displayObject.destroyChildren();
  19975. this.playWoman(this.secretarySpine1, node.displayObject);
  19976. }
  19977. else {
  19978. let spine1 = new SpineMgr("mishu", () => {
  19979. this.secretarySpine1 = spine1;
  19980. this.playWoman(this.secretarySpine1, node.displayObject);
  19981. });
  19982. }
  19983. }
  19984. else {
  19985. if (this.secretarySpine2) {
  19986. node.displayObject.destroyChildren();
  19987. this.playWoman(this.secretarySpine2, node.displayObject);
  19988. }
  19989. else {
  19990. let spine2 = new SpineMgr("xiaomishu2", () => {
  19991. this.secretarySpine2 = spine2;
  19992. this.playWoman(this.secretarySpine2, node.displayObject);
  19993. });
  19994. }
  19995. }
  19996. }
  19997. playWoman(node, parent) {
  19998. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  19999. let yy = this.ui.myNode.gameNode3.secretary.height;
  20000. let scale = 1.5;
  20001. if (node == this.secretarySpine2) {
  20002. scale = 1.2;
  20003. }
  20004. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20005. node.play(data, 0, true, parent);
  20006. }
  20007. turnLeft() {
  20008. this.curIndex--;
  20009. if (this.curIndex < 1) {
  20010. this.curIndex = 2;
  20011. }
  20012. let left = this.nodeObj.left;
  20013. let right = this.nodeObj.right;
  20014. let cur = this.nodeObj.cur;
  20015. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  20016. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  20017. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  20018. this.updateData();
  20019. }));
  20020. this.ui.myNode.setChildIndex(right, 2);
  20021. this.nodeObj.left = cur;
  20022. this.nodeObj.right = left;
  20023. this.nodeObj.cur = right;
  20024. }
  20025. turnRight() {
  20026. this.curIndex++;
  20027. if (this.curIndex > 2) {
  20028. this.curIndex = 1;
  20029. }
  20030. let left = this.nodeObj.left;
  20031. let right = this.nodeObj.right;
  20032. let cur = this.nodeObj.cur;
  20033. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  20034. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  20035. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  20036. this.updateData();
  20037. }));
  20038. this.ui.myNode.setChildIndex(left, 2);
  20039. this.nodeObj.left = right;
  20040. this.nodeObj.right = cur;
  20041. this.nodeObj.cur = left;
  20042. }
  20043. updateData() {
  20044. console.log('zh: updateData FFFFFFFFFF');
  20045. let data = cfgTable.secretaryshopData;
  20046. let children = this.ui.myNode._children;
  20047. let temp;
  20048. let curData;
  20049. for (let index = 0; index < children.length; index++) {
  20050. temp = children[index];
  20051. curData = data[1];
  20052. temp.heightTxt.text = curData.height;
  20053. temp.foodTxt.text = curData.food;
  20054. temp.historyTxt.text = curData.history;
  20055. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  20056. this.addSecretarySpine(temp.secretary, curData.spine);
  20057. let womanIndex = curData.id - 1;
  20058. let getWoman = DataMgr.getSecretary(womanIndex);
  20059. let curUse = DataMgr.getCurSecretary();
  20060. if (getWoman) {
  20061. if (curUse == womanIndex) {
  20062. temp.purchaseBtn.c1.selectedIndex = 1;
  20063. }
  20064. else {
  20065. temp.purchaseBtn.c1.selectedIndex = 2;
  20066. }
  20067. }
  20068. else {
  20069. temp.purchaseBtn.c1.selectedIndex = 0;
  20070. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  20071. }
  20072. temp.purchaseBtn.visible = false;
  20073. }
  20074. }
  20075. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  20076. console.log('zh: 点击了clickSecretary ');
  20077. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20078. if (getWoman) {
  20079. if (curUse != womanIndex) {
  20080. console.log();
  20081. DataMgr.setCurSecretary(womanIndex);
  20082. this.updateData();
  20083. }
  20084. }
  20085. else {
  20086. console.log('zh:点击购买了');
  20087. let need = needDiamond;
  20088. if (DataMgr.diamondEnough(need)) {
  20089. DataMgr.setDiamond(-need);
  20090. DataMgr.setSecretary(womanIndex, 1);
  20091. DataMgr.setCurSecretary(womanIndex);
  20092. this.updateData();
  20093. }
  20094. else {
  20095. xGame.uiMgr.Show(UIAddProp$1, 1);
  20096. }
  20097. }
  20098. }
  20099. closeSelf() {
  20100. this.hide();
  20101. }
  20102. }
  20103. UISecretary$1.uiName = "UISecretary";
  20104. class BallRodDisplay$1 {
  20105. constructor(ui, index) {
  20106. this.index = 0;
  20107. this.uiIndex = 0;
  20108. this.ui = ui;
  20109. this.index = index;
  20110. this.initData();
  20111. }
  20112. initData() {
  20113. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  20114. let data = cfgTable.ballrodData[this.index + 1];
  20115. this.ui.nameTxt.text = data.name;
  20116. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  20117. this.ui.levelNode.c1.selectedIndex = data.quality;
  20118. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  20119. if (data.spine) {
  20120. this.mySpine = new SpineMgr(data.spine, () => {
  20121. let xx = 150;
  20122. let yy = 70;
  20123. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  20124. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  20125. });
  20126. }
  20127. }
  20128. updateSelf() {
  20129. console.log('zh:updateSelf -------------- ');
  20130. let get = DataMgr.getBallRod(this.index);
  20131. if (get == null)
  20132. get = 1;
  20133. let curUse = DataMgr.getCurBallRod();
  20134. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20135. if (get) {
  20136. if (curUse == this.index) {
  20137. this.ui.purchaseBtn.c1.selectedIndex = 0;
  20138. }
  20139. else {
  20140. this.ui.purchaseBtn.c1.selectedIndex = 1;
  20141. }
  20142. }
  20143. else {
  20144. this.ui.purchaseBtn.c1.selectedIndex = 2;
  20145. }
  20146. }
  20147. buyBallRod() {
  20148. console.log('zh:buyBallRod eeeeee');
  20149. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20150. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  20151. switch (selectedIndex) {
  20152. case 0:
  20153. break;
  20154. case 1:
  20155. console.log('zh:点击了 USE THIS');
  20156. DataMgr.setCurBallRod(this.index);
  20157. let curUse = DataMgr.getCurBallRod();
  20158. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20159. let ui = xGame.uiMgr.getUI(UIShop$1);
  20160. ui.updateBallRod();
  20161. break;
  20162. case 2:
  20163. let data = cfgTable.ballrodData[this.index + 1];
  20164. let need = data.price;
  20165. if (DataMgr.diamondEnough(need)) {
  20166. DataMgr.setDiamond(-need);
  20167. DataMgr.setBallRod(this.index, 1);
  20168. DataMgr.setCurBallRod(this.index);
  20169. let ui = xGame.uiMgr.getUI(UIShop$1);
  20170. ui.updateBallRod();
  20171. }
  20172. else {
  20173. xGame.uiMgr.Show(UIAddProp$1, 1);
  20174. }
  20175. break;
  20176. default:
  20177. break;
  20178. }
  20179. }
  20180. }
  20181. class UIShop$1 extends UIBase {
  20182. constructor() {
  20183. super();
  20184. this.itemNums = 0;
  20185. }
  20186. onConstructor() {
  20187. this.ui = ui_UIShop.createInstance();
  20188. this.contentPane = this.ui;
  20189. this.isEject = false;
  20190. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20191. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20192. this.addUIClick(this.ui, this.interuptSecretary);
  20193. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  20194. this.ballRodArr = [];
  20195. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  20196. this.ui.myNode.myList.numItems = this.itemNums;
  20197. if (Moyu.isKs)
  20198. this.ui.closeNode.closeBtn.x += 100;
  20199. }
  20200. show() {
  20201. super.show();
  20202. this.playSecretaryIdle();
  20203. this.updateBallRod();
  20204. }
  20205. updateBallRod() {
  20206. for (let index = 0; index < this.ballRodArr.length; index++) {
  20207. this.ballRodArr[index].updateSelf();
  20208. }
  20209. }
  20210. renderBallRod(sort, obj) {
  20211. let index = this.getIndexBySort(sort + 1) - 1;
  20212. let ballRod = new BallRodDisplay$1(obj, index);
  20213. this.ballRodArr.push(ballRod);
  20214. }
  20215. getIndexBySort(sort) {
  20216. let object = cfgTable.ballrodData;
  20217. for (const key in object) {
  20218. if (object[key].sort == sort) {
  20219. return parseInt(key);
  20220. }
  20221. }
  20222. }
  20223. playSecretaryIdle() {
  20224. let parent = this.ui.secretary.displayObject;
  20225. parent.destroyChildren();
  20226. let xx = this.ui.secretary.width / 2;
  20227. let yy = this.ui.secretary.height;
  20228. let scale = xGame.common.getSecretaryScale();
  20229. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20230. xGame.common.secretary.play(data, 0, true, parent);
  20231. }
  20232. interuptSecretary() {
  20233. Laya.timer.clearAll(this);
  20234. this.playSecretaryRandomSound();
  20235. }
  20236. playSecretaryRandomSound() {
  20237. if (this.isHide)
  20238. return;
  20239. let time = xGame.common.randomNum(45000, 60000);
  20240. Laya.timer.once(time, this, () => {
  20241. if (this.isHide)
  20242. return;
  20243. let index = xGame.common.randomNum(4, 7);
  20244. xGame.soundMgr.playSound("s_main0" + index);
  20245. let words = 1;
  20246. switch (index) {
  20247. case 4:
  20248. words = 5;
  20249. break;
  20250. case 5:
  20251. words = 3;
  20252. break;
  20253. case 6:
  20254. words = 6;
  20255. break;
  20256. case 7:
  20257. words = 7;
  20258. break;
  20259. default:
  20260. break;
  20261. }
  20262. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20263. this.playSecretaryRandomSound();
  20264. });
  20265. }
  20266. closeSelf() {
  20267. this.hide();
  20268. }
  20269. }
  20270. UIShop$1.uiName = "UIShop";
  20271. class SignMax$1 {
  20272. constructor(ui) {
  20273. this.ui = ui;
  20274. }
  20275. updateSelf(index, sameDay, curDayIndex) {
  20276. let data = cfgTable.signData[index + 1];
  20277. this.ui.titleTxt.text = data.title;
  20278. let arr1 = data.award[0].split('-');
  20279. let arr2 = data.award[1].split('-');
  20280. let num1 = parseInt(arr1[1]);
  20281. let num2 = parseInt(arr2[1]);
  20282. this.ui.numTxt1.text = num1 + "";
  20283. this.ui.numTxt2.text = num2 + "";
  20284. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  20285. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  20286. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  20287. this.ui.numTxt1.visible = false;
  20288. }
  20289. else {
  20290. this.ui.numTxt1.visible = true;
  20291. }
  20292. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  20293. this.ui.numTxt2.visible = false;
  20294. }
  20295. else {
  20296. this.ui.numTxt2.visible = true;
  20297. }
  20298. if (index < curDayIndex) {
  20299. this.ui.c1.selectedIndex = 1;
  20300. }
  20301. else if (index == curDayIndex) {
  20302. if (sameDay) {
  20303. this.ui.c1.selectedIndex = 2;
  20304. }
  20305. else {
  20306. this.ui.c1.selectedIndex = 2;
  20307. }
  20308. }
  20309. else {
  20310. this.ui.c1.selectedIndex = 0;
  20311. }
  20312. }
  20313. }
  20314. class SignNormal$1 {
  20315. constructor(ui) {
  20316. this.ui = ui;
  20317. }
  20318. updateSelf(index, sameDay, curDayIndex) {
  20319. let data = cfgTable.signData[index + 1];
  20320. this.ui.titleTxt.text = data.title;
  20321. let arr = data.award[0].split('-');
  20322. let type = parseInt(arr[0]);
  20323. let num = parseInt(arr[1]);
  20324. this.ui.numTxt.text = num + "";
  20325. if (type > 2) {
  20326. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  20327. this.ui.myIcon.rotation = 0;
  20328. }
  20329. else {
  20330. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  20331. this.ui.myIcon.rotation = 0;
  20332. }
  20333. if (xGame.common.signAwardContainsRod(data.award)) {
  20334. this.ui.numTxt.visible = false;
  20335. }
  20336. else {
  20337. this.ui.numTxt.visible = true;
  20338. }
  20339. if (index < curDayIndex) {
  20340. this.ui.c1.selectedIndex = 1;
  20341. }
  20342. else if (index == curDayIndex) {
  20343. if (sameDay) {
  20344. this.ui.c1.selectedIndex = 2;
  20345. }
  20346. else {
  20347. this.ui.c1.selectedIndex = 2;
  20348. }
  20349. }
  20350. else {
  20351. this.ui.c1.selectedIndex = 0;
  20352. }
  20353. }
  20354. }
  20355. class UISign$1 extends UIBase {
  20356. constructor() {
  20357. super();
  20358. this.curDayIndex = 0;
  20359. this.starX = 0;
  20360. }
  20361. onConstructor() {
  20362. this.ui = ui_UISign.createInstance();
  20363. this.contentPane = this.ui;
  20364. this.isEject = false;
  20365. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20366. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20367. this.initSignItem();
  20368. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  20369. this.addUIClick(this.ui.againBtn, this.againGetAward);
  20370. }
  20371. show() {
  20372. super.show();
  20373. this.ui.t0.play();
  20374. this.playSecretaryIdle();
  20375. this.updateSign();
  20376. }
  20377. initSignItem() {
  20378. this.signArr = [];
  20379. for (let index = 0; index < 6; index++) {
  20380. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  20381. this.signArr.push(temp);
  20382. }
  20383. this.signMax = new SignMax$1(this.ui.myNode.day7);
  20384. if (Moyu.isKs)
  20385. this.ui.closeNode.closeBtn.x += 100;
  20386. }
  20387. updateSign() {
  20388. let sameDay = xGame.common.judgeSameDay();
  20389. let max = 7;
  20390. this.curDayIndex = DataMgr.getSignData();
  20391. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  20392. this.curDayIndex = 0;
  20393. if (!sameDay) {
  20394. this.ui.normalBtn.visible = true;
  20395. this.ui.tipsNode.visible = false;
  20396. this.ui.againBtn.visible = false;
  20397. }
  20398. else {
  20399. this.ui.normalBtn.visible = false;
  20400. let again = DataMgr.getExtraSign();
  20401. let isCurrency = false;
  20402. let index = this.curDayIndex;
  20403. if (index == 0)
  20404. index = 7;
  20405. let award = cfgTable.signData[index].award;
  20406. let num = award[0].split("-")[0];
  20407. if (num == "1" || num == "2")
  20408. isCurrency = true;
  20409. let showAgain = again == 0 && isCurrency;
  20410. this.ui.againBtn.visible = showAgain;
  20411. this.ui.tipsNode.visible = !showAgain;
  20412. }
  20413. for (let index = 0; index < this.signArr.length; index++) {
  20414. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  20415. }
  20416. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  20417. }
  20418. playSecretaryIdle() {
  20419. let parent = this.ui.secretary.displayObject;
  20420. parent.destroyChildren();
  20421. let xx = this.ui.secretary.width / 2;
  20422. let yy = this.ui.secretary.height;
  20423. let scale = xGame.common.getSecretaryScale();
  20424. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20425. xGame.common.secretary.play(data, 0, true, parent);
  20426. }
  20427. closeSelf() {
  20428. this.hide();
  20429. }
  20430. normalGetAward() {
  20431. let sameDay = xGame.common.judgeSameDay();
  20432. if (!sameDay) {
  20433. let award = cfgTable.signData[this.curDayIndex + 1].award;
  20434. let temp;
  20435. let type;
  20436. let num;
  20437. let arr = [];
  20438. for (let index = 0; index < award.length; index++) {
  20439. temp = award[index].split("-");
  20440. type = parseInt(temp[0]);
  20441. num = parseInt(temp[1]);
  20442. let awardType = new AwardType();
  20443. awardType.num = num;
  20444. awardType.type = type;
  20445. arr.push(awardType);
  20446. }
  20447. xGame.common.getAward(arr, (watchVideo) => {
  20448. this.curDayIndex++;
  20449. if (this.curDayIndex > 7)
  20450. this.curDayIndex = 0;
  20451. DataMgr.setSignData(this.curDayIndex);
  20452. DataMgr.setSignTime(new Date().getTime());
  20453. if (watchVideo) {
  20454. DataMgr.setExtraSign(1);
  20455. Moyu.sendDataEvent("signIn1");
  20456. }
  20457. this.updateSign();
  20458. });
  20459. }
  20460. }
  20461. againGetAward() {
  20462. Moyu.sendDataEvent("signIn2");
  20463. console.log('zh:qjff_AD_for_uisign');
  20464. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  20465. }
  20466. else {
  20467. console.log('zh:AD 失败,直接发放奖励');
  20468. this.qjff_AD_for_uisign();
  20469. }
  20470. }
  20471. qjff_AD_for_uisign() {
  20472. let index = this.curDayIndex;
  20473. if (index == 0)
  20474. index = 7;
  20475. let award = cfgTable.signData[index].award;
  20476. let temp;
  20477. let type;
  20478. let num;
  20479. for (let index = 0; index < award.length; index++) {
  20480. temp = award[index].split("-");
  20481. type = parseInt(temp[0]);
  20482. num = parseInt(temp[1]) * 3;
  20483. xGame.common.playObjFlyAnim(num, type);
  20484. }
  20485. DataMgr.setExtraSign(1);
  20486. this.updateSign();
  20487. }
  20488. }
  20489. UISign$1.uiName = "UISign";
  20490. class UIModeSelection$1 extends UIBase {
  20491. constructor() {
  20492. super();
  20493. }
  20494. onConstructor() {
  20495. this.ui = ui_UIModeSelection.createInstance();
  20496. this.contentPane = this.ui;
  20497. this.isEject = false;
  20498. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20499. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20500. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20501. this.addUIClick(this.ui.closeBtn, this.hide);
  20502. this.peopleArr = [650, 6900, 3800];
  20503. this.peopleOffest = [50, 500, 200];
  20504. this.updateSelf();
  20505. }
  20506. show(callback) {
  20507. super.show();
  20508. this.ui.t0.play();
  20509. this.callback = callback;
  20510. }
  20511. updateSelf() {
  20512. let cfg = cfgTable.modeselectData;
  20513. for (let index = 1; index <= 3; index++) {
  20514. let node = this.ui.myNode["type" + index];
  20515. node.need.text = cfg[index].need;
  20516. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20517. node.peopleTxt.text = this.getRandPeople(index - 1);
  20518. }
  20519. }
  20520. enterGame(type) {
  20521. console.log('zh: 进入经典模式 type: ' + type);
  20522. xGame.common.classicRoomType = type;
  20523. let cfg = cfgTable.modeselectData[type];
  20524. let need = cfg.need;
  20525. xGame.common.passAwardCoin = cfg.award;
  20526. if (DataMgr.coinEnough(need)) {
  20527. DataMgr.setCoin(-need);
  20528. this.ui.myNode["type" + type].t0.play();
  20529. Laya.timer.once(200, this, () => {
  20530. this.callback && this.callback();
  20531. });
  20532. }
  20533. else {
  20534. Moyu.sendDataEvent("AddCoinVideo");
  20535. xGame.uiMgr.Show(UIAddProp$1, 0);
  20536. }
  20537. }
  20538. getRandPeople(index) {
  20539. let rand = this.peopleOffest[index];
  20540. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20541. }
  20542. }
  20543. UIModeSelection$1.uiName = "UIModeSelection";
  20544. class UITry$1 extends UIBase {
  20545. constructor() {
  20546. super();
  20547. this.closeTime = 0;
  20548. this.closeNum = 0;
  20549. this.skillUrl = xGame.common.skillIconList;
  20550. }
  20551. onConstructor() {
  20552. this.ui = ui_UITry.createInstance();
  20553. this.contentPane = this.ui;
  20554. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  20555. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  20556. }
  20557. show() {
  20558. super.show();
  20559. this.closeNum = 0;
  20560. this.closeTime = 15;
  20561. this.ui.t0.play();
  20562. PlatMgr.showRateBanner();
  20563. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20564. Laya.timer.loop(1000, this, this.updateTime);
  20565. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  20566. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  20567. xGame.common.gameMgr.gamePause = true;
  20568. }
  20569. updateTime() {
  20570. if (this.closeTime > 1) {
  20571. this.closeTime--;
  20572. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20573. }
  20574. else
  20575. this.hide();
  20576. }
  20577. hide() {
  20578. Laya.timer.clearAll(this);
  20579. Moyu.showBannerAd(false);
  20580. super.hide();
  20581. xGame.common.gameMgr.gamePause = false;
  20582. }
  20583. onTry() {
  20584. console.log('zh:qjff_AD_for_uitry');
  20585. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  20586. }
  20587. else {
  20588. console.log('zh:AD 失败,直接发放奖励');
  20589. this.qjff_AD_for_uitry();
  20590. }
  20591. }
  20592. qjff_AD_for_uitry() {
  20593. let select = xGame.common.curPlayerSkillType;
  20594. DataMgr.gameData.trySkill = select;
  20595. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  20596. DataMgr.saveGameData();
  20597. DataMgr.setBigSkill(select, 1);
  20598. xGame.showTip("Trial Successful");
  20599. this.hide();
  20600. }
  20601. onCancel() {
  20602. if (this.closeNum > 0) {
  20603. this.closeNum--;
  20604. if (this.closeNum < 2)
  20605. this.hide();
  20606. return;
  20607. }
  20608. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  20609. this.onTry();
  20610. }
  20611. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  20612. this.closeNum = 3;
  20613. }
  20614. else
  20615. this.hide();
  20616. }
  20617. }
  20618. UITry$1.uiName = "UITry";
  20619. class UIGetAward$1 extends UIBase {
  20620. constructor() {
  20621. super();
  20622. this.showTriple = true;
  20623. }
  20624. onConstructor() {
  20625. this.ui = ui_UIGetAward.createInstance();
  20626. this.contentPane = this.ui;
  20627. this.isEject = false;
  20628. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  20629. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  20630. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  20631. }
  20632. show(arr, showTriple, callback) {
  20633. super.show();
  20634. this.ui.t0.play();
  20635. this.ui.eftNode.visible = true;
  20636. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  20637. this.ui.eftNode.visible = false;
  20638. }), 1, 0, 0, 0.9);
  20639. this.awardArr = arr;
  20640. this.showTriple = showTriple;
  20641. this.callback = callback;
  20642. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  20643. this.ui.myList.numItems = arr.length;
  20644. xGame.soundMgr.playSound("getaward");
  20645. }
  20646. updateSelf(index, obj) {
  20647. let temp = this.awardArr[index];
  20648. let icon = this.getIcon(temp.type);
  20649. let str = icon;
  20650. if (temp.type > 2) {
  20651. str = "s" + icon;
  20652. }
  20653. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  20654. obj.myIcon.rotation = 0;
  20655. obj.numTxt.text = temp.num + "";
  20656. obj.numTxt.visible = temp.type > 2 ? false : true;
  20657. obj.nameTxt.text = this.getNameStr(temp.type);
  20658. }
  20659. renderItem(index, obj) {
  20660. this.updateSelf(index, obj);
  20661. }
  20662. tripleGetAward() {
  20663. console.log('zh:qjff_AD_for_uigetAward');
  20664. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  20665. }
  20666. else {
  20667. console.log('zh:AD 失败,直接发放奖励');
  20668. this.qjff_AD_for_uigetAward();
  20669. }
  20670. }
  20671. qjff_AD_for_uigetAward() {
  20672. this.getAward(3);
  20673. }
  20674. normalGetAward() {
  20675. if (PlatMgr.isMisVideo())
  20676. this.tripleGetAward();
  20677. else
  20678. this.getAward();
  20679. }
  20680. getAward(times = 1) {
  20681. this.hide();
  20682. for (let index = 0; index < this.awardArr.length; index++) {
  20683. this.awardArr[index].num *= times;
  20684. }
  20685. this.callback && this.callback(times != 1);
  20686. }
  20687. getIcon(type) {
  20688. switch (type) {
  20689. case Prop.diamond:
  20690. return "ty_zs";
  20691. case Prop.coin:
  20692. return "ty_jb";
  20693. case Prop.gan1:
  20694. return "qg1";
  20695. case Prop.gan2:
  20696. return "qg2";
  20697. case Prop.gan3:
  20698. return "qg3";
  20699. case Prop.gan4:
  20700. return "qg4";
  20701. default:
  20702. break;
  20703. }
  20704. }
  20705. getNameStr(type) {
  20706. switch (type) {
  20707. case Prop.diamond:
  20708. return "Diamond";
  20709. case Prop.coin:
  20710. return "Coins";
  20711. case Prop.gan1:
  20712. case Prop.gan2:
  20713. case Prop.gan3:
  20714. case Prop.gan4:
  20715. return cfgTable.ballrodData[type - 1].name;
  20716. default:
  20717. break;
  20718. }
  20719. }
  20720. }
  20721. UIGetAward$1.uiName = "UIGetAward";
  20722. class UIBox$1 extends UIBase {
  20723. constructor() {
  20724. super();
  20725. this.boxNum = 0;
  20726. this.boxMax = 10;
  20727. this.inAd = false;
  20728. this.isClose = false;
  20729. }
  20730. onConstructor() {
  20731. this.ui = ui_UIBox.createInstance();
  20732. this.contentPane = this.ui;
  20733. this.isEject = false;
  20734. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  20735. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  20736. Laya.timer.loop(1000, this, this.update);
  20737. }
  20738. update() {
  20739. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  20740. this.boxNum -= 1;
  20741. this.upBar();
  20742. }
  20743. }
  20744. upBar() {
  20745. if (this.boxNum > this.boxMax)
  20746. this.boxNum = this.boxMax;
  20747. this.ui.bar.value = this.boxNum * 10;
  20748. }
  20749. show() {
  20750. super.show();
  20751. this.isClose = false;
  20752. this.boxNum = 0;
  20753. this.inAd = false;
  20754. this.upBar();
  20755. this.ui.t0.play();
  20756. this.ui.closeBtn.visible = false;
  20757. Laya.timer.once(3000, this, () => {
  20758. this.ui.closeBtn.visible = true;
  20759. this.ui.bar.alpha = 1;
  20760. });
  20761. Laya.timer.once(500, this, () => {
  20762. this.ui.t1.play();
  20763. });
  20764. }
  20765. hide() {
  20766. Laya.timer.clearAll(this);
  20767. Moyu.showBannerAd(false);
  20768. super.hide();
  20769. }
  20770. onOpenBox() {
  20771. this.boxNum++;
  20772. if (this.boxNum < this.boxMax) {
  20773. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  20774. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  20775. }
  20776. }
  20777. else if (this.boxNum == this.boxMax) {
  20778. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  20779. this.ui.openBtn.c1.selectedIndex = 13;
  20780. this.inAd = true;
  20781. }
  20782. else
  20783. this.getAward();
  20784. }
  20785. else if (this.inAd) {
  20786. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  20787. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  20788. }
  20789. else {
  20790. console.log('zh:AD 失败,直接发放奖励');
  20791. this.qjff_AD_for_UIBOX_onOpenBox();
  20792. }
  20793. }
  20794. this.upBar();
  20795. }
  20796. qjff_AD_for_UIBOX_onOpenBox() {
  20797. this.getAward();
  20798. }
  20799. onCloseBox() {
  20800. if (this.isClose)
  20801. this.hide();
  20802. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  20803. this.isClose = true;
  20804. PlatMgr.showBanner(true, 0, 3000);
  20805. }
  20806. else
  20807. this.hide();
  20808. }
  20809. getAward() {
  20810. let str = "";
  20811. if (Math.random() < 0.5) {
  20812. let max = Moyu.isLegal ? 500 : 2500;
  20813. let num = xGame.tools.random(max, 500 + max);
  20814. DataMgr.setCoin(num);
  20815. str = "金币x" + num;
  20816. }
  20817. else {
  20818. let max = Moyu.isLegal ? 10 : 30;
  20819. let num = xGame.tools.random(max, 30 + max);
  20820. DataMgr.setDiamond(num);
  20821. str = "钻石x" + num;
  20822. }
  20823. xGame.showTip("恭喜获得-" + str);
  20824. this.hide();
  20825. }
  20826. }
  20827. UIBox$1.uiName = "UIBox";
  20828. class UIMain$1 extends UIBase {
  20829. constructor() {
  20830. super();
  20831. this.firstEnter = true;
  20832. }
  20833. nativeCallJs(msg) {
  20834. let t = msg;
  20835. console.log("zh: nativeCallJs 奖励开始发放:", t);
  20836. switch (t) {
  20837. case 'qjff_chouJiang':
  20838. let dui = xGame.uiMgr.getUI(UIDraw$1);
  20839. dui.qjff_chouJiang();
  20840. break;
  20841. case 'qjff_AD_for_uisign':
  20842. let dui2 = xGame.uiMgr.getUI(UISign$1);
  20843. dui2.qjff_AD_for_uisign();
  20844. break;
  20845. case 'qjff_AD_for_uitry':
  20846. let dui3 = xGame.uiMgr.getUI(UITry$1);
  20847. dui3.qjff_AD_for_uitry();
  20848. break;
  20849. case 'qjff_AD_for_uipower':
  20850. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  20851. dui4.qjff_AD_for_uipower();
  20852. break;
  20853. case 'qjff_AD_for_uigetAward':
  20854. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  20855. dui5.qjff_AD_for_uigetAward();
  20856. break;
  20857. case 'qjff_AD_for_uiGameEnd':
  20858. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  20859. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  20860. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  20861. break;
  20862. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  20863. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  20864. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  20865. break;
  20866. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  20867. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  20868. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  20869. break;
  20870. case 'qjff_AD_for_UIrepentProp_videoRegret':
  20871. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  20872. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  20873. break;
  20874. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  20875. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  20876. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  20877. break;
  20878. case 'qjff_AD_for_UIBOX_onOpenBox':
  20879. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  20880. dui11.qjff_AD_for_UIBOX_onOpenBox();
  20881. break;
  20882. case 'qjff_AD_for_UIAddCoin':
  20883. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  20884. dui12.qjff_AD_for_UIAddCoin();
  20885. break;
  20886. case '111a':
  20887. let dui14 = xGame.uiMgr.getUI(UISign$1);
  20888. dui14.qjff_AD_for_uisign();
  20889. break;
  20890. case '222a':
  20891. let dui15 = xGame.uiMgr.getUI(UISign$1);
  20892. dui15.qjff_AD_for_uisign();
  20893. break;
  20894. case '333a':
  20895. let dui16 = xGame.uiMgr.getUI(UISign$1);
  20896. dui16.qjff_AD_for_uisign();
  20897. break;
  20898. default:
  20899. console.log('zh:未知的方法名字' + t);
  20900. break;
  20901. }
  20902. }
  20903. onConstructor() {
  20904. console.log('zh: UIMain onConstructor');
  20905. this.ui = ui_UIMain.createInstance();
  20906. this.contentPane = this.ui;
  20907. this.isEject = false;
  20908. this.addEvent();
  20909. this.addClickSpine();
  20910. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20911. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20912. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20913. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20914. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20915. let curUse = DataMgr.getCurSecretary();
  20916. this.changeSecretary(curUse);
  20917. this.ui.rankBtn.visible = false;
  20918. this.ui.talkNode.visible = false;
  20919. let guide = DataMgr.getSkillGuide();
  20920. if (xGame.common.isNewDay && guide == 1) {
  20921. xGame.common.isNewDay = false;
  20922. xGame.soundMgr.playSound("s_main01");
  20923. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20924. console.log("zh:播放小秘书每天语音");
  20925. }
  20926. this.ui.n83.visible = false;
  20927. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  20928. }
  20929. changeSecretary(curUse) {
  20930. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20931. xGame.common.secretary && xGame.common.secretary.dispose();
  20932. this.addSecretarySpine(name);
  20933. }
  20934. addSecretarySpine(name) {
  20935. let spine = new SpineMgr(name, () => {
  20936. this.playSecretaryIdle();
  20937. });
  20938. xGame.common.secretary = spine;
  20939. }
  20940. addClickSpine() {
  20941. let clickSpine = new SpineMgr("dianji", () => {
  20942. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20943. let parent = Laya.stage;
  20944. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20945. clickSpine.play(data, 0, false, parent, (spine) => {
  20946. spine.destroy(true);
  20947. });
  20948. });
  20949. });
  20950. }
  20951. addEvent() {
  20952. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20953. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20954. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  20955. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20956. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20957. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20958. this.addUIClick(this.ui, this.interuptSecretary);
  20959. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20960. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20961. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20962. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20963. this.addUIClick(this.ui.signBtn, this.openSignView);
  20964. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20965. }
  20966. show(showFailWords) {
  20967. super.show();
  20968. this.moneyNode.ui.c1.selectedIndex = 1;
  20969. this.playSecretaryIdle();
  20970. xGame.soundMgr.playMusic("caromhall01", 0);
  20971. Laya.timer.clearAll(this);
  20972. this.playSecretaryRandomSound();
  20973. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  20974. if (showFailWords) {
  20975. console.log('zh:uimain.ts ');
  20976. setTimeout(() => {
  20977. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20978. let words = -1;
  20979. if (str == "s_main02") {
  20980. words = 2;
  20981. }
  20982. else {
  20983. words = 3;
  20984. }
  20985. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20986. xGame.soundMgr.playSound(str);
  20987. }, 300);
  20988. }
  20989. this.showGuide();
  20990. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20991. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20992. let guide = DataMgr.getSkillGuide();
  20993. if (guide == 1) {
  20994. let randTime = xGame.common.randomNum(300, 800);
  20995. if (this.firstEnter) {
  20996. console.log("zh: firstEnter");
  20997. this.firstEnter = false;
  20998. randTime += 900;
  20999. }
  21000. else {
  21001. console.log("zh: no firstEnter");
  21002. }
  21003. Laya.timer.once(randTime, this, () => {
  21004. xGame.common.autoPopUIView();
  21005. });
  21006. }
  21007. }
  21008. checkActive(show) {
  21009. }
  21010. showGuide() {
  21011. let guide = DataMgr.getSkillGuide();
  21012. this.ui.guideBtn.visible = guide == 0;
  21013. this.ui.enterGuide.visible = false;
  21014. this.ui.secretaryGuide.visible = guide == 0;
  21015. if (guide == 0) {
  21016. console.log("zh:显示引导");
  21017. xGame.soundMgr.playSound("s_guide");
  21018. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21019. }
  21020. else {
  21021. console.log("zh:不需要显示引导");
  21022. }
  21023. }
  21024. ensureSecretary() {
  21025. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  21026. this.ui.secretaryGuide.visible = false;
  21027. this.ui.enterGuide.visible = true;
  21028. this.ui.wordsNode.t0.play();
  21029. if (DataMgr.getNewUser())
  21030. Moyu.sendDataEvent("gameReady");
  21031. }
  21032. playSecretaryIdle() {
  21033. let parent = this.ui.secretary.displayObject;
  21034. parent.destroyChildren();
  21035. let xx = this.ui.secretary.width / 2;
  21036. let yy = this.ui.secretary.height;
  21037. let scale = xGame.common.getSecretaryScale();
  21038. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21039. console.log("zh:playSecretaryIdle", data);
  21040. xGame.common.secretary.play(data, 0, true, parent);
  21041. }
  21042. startGame(type) {
  21043. xGame.common.gameMode = type;
  21044. Moyu.sendDataEvent("PlayGame", { type: type });
  21045. switch (xGame.common.gameMode) {
  21046. case GameMode.classic:
  21047. let challengeTimes = DataMgr.getChallengeTimes();
  21048. if (challengeTimes == 0) {
  21049. xGame.uiMgr.Show(UIInvitation$1);
  21050. }
  21051. else {
  21052. this.beginGame();
  21053. }
  21054. break;
  21055. case GameMode.bigMove:
  21056. this.beginGame();
  21057. if (DataMgr.getNewUser())
  21058. Moyu.sendDataEvent("gameStart0");
  21059. break;
  21060. default:
  21061. break;
  21062. }
  21063. }
  21064. beginGame(isNice = false) {
  21065. console.log('zh:beginGame ');
  21066. let guide = DataMgr.getSkillGuide();
  21067. if (guide == 1) {
  21068. console.log('zh:非新手引导,showInternAd ');
  21069. JSBridgeUtils.instance.showInternAd('beginGame');
  21070. }
  21071. else {
  21072. console.log('zh:新手引导,不显示AD ');
  21073. }
  21074. console.log('zh:beginGame 2 go');
  21075. if (xGame.common.gameMode == GameMode.classic) {
  21076. if (isNice) {
  21077. this.enterClassic();
  21078. }
  21079. else {
  21080. xGame.uiMgr.Show(UIModeSelection$1, () => {
  21081. this.enterClassic();
  21082. });
  21083. }
  21084. }
  21085. else if (xGame.common.gameMode == GameMode.bigMove) {
  21086. this.ui.enterGuide.visible = false;
  21087. xGame.uiMgr.Show(UISkill$1);
  21088. }
  21089. }
  21090. enterClassic() {
  21091. xGame.uiMgr.Show(UIGame$1);
  21092. xGame.uiMgr.Show(UIMatching$1, () => {
  21093. if (!this.isHide)
  21094. this.hide();
  21095. xGame.common.gameUI.ui.alpha = 1;
  21096. xGame.common.gameUI.startGame();
  21097. xGame.uiMgr.Hide(UIGameEnd$1);
  21098. });
  21099. }
  21100. startGlobal() {
  21101. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21102. }
  21103. startWeekly() {
  21104. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21105. }
  21106. zhouSaiMonth() {
  21107. console.log('zh: zhouSaiMonth 被调用');
  21108. }
  21109. startPlaceBall() {
  21110. xGame.uiMgr.Show(UILevelDisplay$1);
  21111. }
  21112. hide() {
  21113. console.log('zh:uimain hide ...');
  21114. super.hide();
  21115. xGame.common.stopGirlPop(this.ui.talkNode);
  21116. }
  21117. onGetUserInfo(force = false) {
  21118. if (Moyu.isWx) {
  21119. let info = Moyu.getSystemInfo();
  21120. if (info)
  21121. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  21122. }
  21123. else {
  21124. Moyu.initUser(this, this.freshUser, force);
  21125. }
  21126. if (!Moyu.hasUserInfo) {
  21127. let user = Moyu.getUserInfo();
  21128. user.headIcon = 'res/ty_touxiang.png';
  21129. }
  21130. this.freshUser();
  21131. }
  21132. freshUser() {
  21133. let user = Moyu.getUserInfo();
  21134. if (!user.isAuth) {
  21135. user.headIcon = 'res/ty_touxiang.png';
  21136. }
  21137. else
  21138. DataMgr.upRankData();
  21139. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  21140. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  21141. }
  21142. interuptSecretary() {
  21143. Laya.timer.clearAll(this);
  21144. this.playSecretaryRandomSound();
  21145. }
  21146. playSecretaryRandomSound() {
  21147. if (this.isHide)
  21148. return;
  21149. let time = xGame.common.randomNum(45000, 60000);
  21150. Laya.timer.once(time, this, () => {
  21151. if (this.isHide)
  21152. return;
  21153. let index = xGame.common.randomNum(4, 7);
  21154. xGame.soundMgr.playSound("s_main0" + index);
  21155. let words = 1;
  21156. switch (index) {
  21157. case 4:
  21158. words = 5;
  21159. break;
  21160. case 5:
  21161. words = 3;
  21162. break;
  21163. case 6:
  21164. words = 6;
  21165. break;
  21166. case 7:
  21167. words = 7;
  21168. break;
  21169. default:
  21170. break;
  21171. }
  21172. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21173. this.playSecretaryRandomSound();
  21174. });
  21175. }
  21176. openSecretaryView() {
  21177. xGame.uiMgr.Show(UISecretary$1);
  21178. Moyu.sendDataEvent("secretary");
  21179. }
  21180. openShopView() {
  21181. xGame.uiMgr.Show(UIShop$1);
  21182. }
  21183. openSignView() {
  21184. xGame.uiMgr.Show(UISign$1);
  21185. }
  21186. openDrawView() {
  21187. xGame.uiMgr.Show(UIDraw$1);
  21188. }
  21189. openRanking() {
  21190. console.log('zh:phb openRanking');
  21191. xGame.uiMgr.Show(UIRanking$1);
  21192. Moyu.sendDataEvent("rankingList");
  21193. }
  21194. }
  21195. UIMain$1.uiName = "UIMain";
  21196. function InitShader() {
  21197. }
  21198. function appInit() {
  21199. xGame.context.init(getLoadingResList(), initCallback);
  21200. }
  21201. function getLoadingResList() {
  21202. return [
  21203. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  21204. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  21205. ];
  21206. }
  21207. function getGameResList() {
  21208. return [
  21209. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  21210. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  21211. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  21212. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  21213. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  21214. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  21215. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  21216. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  21217. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  21218. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  21219. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  21220. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  21221. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  21222. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  21223. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  21224. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  21225. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  21226. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  21227. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  21228. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  21229. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  21230. ];
  21231. }
  21232. function initCallback() {
  21233. window["DataMgr"] = DataMgr;
  21234. DataMgr.Init();
  21235. Moyu.init(getPlat(), this, () => {
  21236. DataMgr.isNewDay();
  21237. PlatMgr.initConfig();
  21238. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  21239. }, true);
  21240. console.log('zh:开始sm init1 start');
  21241. xGame.soundMgr.init();
  21242. console.log('zh:开始sm init1 end');
  21243. xGame.uiMgr.init();
  21244. xGame.uiMgr.clearTempData();
  21245. xGame.uiMgr.bindFUI(fguiRes.loading);
  21246. xGame.uiMgr.Show(UILoading);
  21247. }
  21248. function loadSubRes(callback) {
  21249. var tab = ["asset", "res", "spine"];
  21250. let subDone = 0;
  21251. for (var i = 0; i < tab.length; i++) {
  21252. let sub = tab[i];
  21253. Moyu.loadSubRes(sub, (pro) => {
  21254. callback && callback(pro, false);
  21255. }).then(() => {
  21256. subDone++;
  21257. if (subDone >= tab.length)
  21258. callback && callback(1, true);
  21259. });
  21260. }
  21261. }
  21262. function enterGame() {
  21263. xGame.cfgMgr.init();
  21264. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  21265. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  21266. xGame.uiMgr.Hide(UILoading);
  21267. fgui.UIPackage.removePackage(fguiRes.loading);
  21268. xGame.uiMgr.bindFUI(fguiRes.game);
  21269. xGame.uiMgr.Show(UIMain$1);
  21270. if (DataMgr.getNewUser())
  21271. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  21272. }
  21273. function getPlat() {
  21274. let cfg = new MoyuCfg();
  21275. cfg.plat = MoyuPlat.web;
  21276. cfg.myId = 120;
  21277. cfg.myKey = '8848a885774230a4';
  21278. cfg.version = 0;
  21279. if (window.hasOwnProperty("gamebox")) {
  21280. cfg.plat = MoyuPlat.f399;
  21281. cfg.version = 0;
  21282. }
  21283. else if (window.hasOwnProperty("ks")) {
  21284. cfg.plat = MoyuPlat.ks;
  21285. cfg.version = 0;
  21286. cfg.ads.ksVideoId = '2300002254_01';
  21287. cfg.ads.ksInsertId = '2300002254_02';
  21288. }
  21289. else if (Laya.Browser.onTTMiniGame) {
  21290. cfg.plat = MoyuPlat.tt;
  21291. cfg.version = 0;
  21292. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  21293. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  21294. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  21295. }
  21296. else if (Laya.Browser.onMiniGame) {
  21297. cfg.plat = MoyuPlat.wx;
  21298. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  21299. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  21300. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  21301. }
  21302. else if (Laya.Browser.onQQMiniGame) {
  21303. cfg.plat = MoyuPlat.qq;
  21304. }
  21305. else if (Laya.Browser.onQGMiniGame) {
  21306. cfg.plat = MoyuPlat.op;
  21307. cfg.ads.opVideoId = '455502';
  21308. cfg.ads.opBannerId = '455507';
  21309. }
  21310. else if (Laya.Browser.onVVMiniGame) {
  21311. cfg.plat = MoyuPlat.vv;
  21312. cfg.version = 0;
  21313. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  21314. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  21315. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  21316. }
  21317. else if (Laya.Browser.onHWMiniGame) {
  21318. cfg.plat = MoyuPlat.hw;
  21319. }
  21320. else if (window["mz"]) {
  21321. cfg.plat = MoyuPlat.mz;
  21322. }
  21323. else {
  21324. let cfg = window['conchConfig'];
  21325. if (cfg) {
  21326. var os = cfg.getOS();
  21327. if (os == "Conch-ios") {
  21328. cfg.plat = MoyuPlat.ios;
  21329. }
  21330. else if (os == "Conch-android") {
  21331. }
  21332. }
  21333. }
  21334. return cfg;
  21335. }
  21336. class Main {
  21337. constructor() {
  21338. if (window["Laya3D"])
  21339. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  21340. else {
  21341. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  21342. this.initMain();
  21343. }
  21344. }
  21345. initMain() {
  21346. Laya["Physics"] && Laya["Physics"].enable();
  21347. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  21348. Laya.stage.scaleMode = GameConfig.scaleMode;
  21349. Laya.stage.screenMode = GameConfig.screenMode;
  21350. Laya.stage.alignV = GameConfig.alignV;
  21351. Laya.stage.alignH = GameConfig.alignH;
  21352. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  21353. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  21354. Laya.enableDebugPanel();
  21355. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  21356. Laya["PhysicsDebugDraw"].enable();
  21357. if (GameConfig.stat)
  21358. Laya.Stat.show();
  21359. Laya.alertGlobalError(true);
  21360. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  21361. }
  21362. onVersionLoaded() {
  21363. appInit();
  21364. }
  21365. }
  21366. new Main();
  21367. }());
  21368. //# sourceMappingURL=bundle.js.map