bundle.js 864 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  52. let poolKey = {
  53. inHoleEft: "inHoleEft",
  54. d3ball: "d3ball",
  55. iceEft: "iceEft",
  56. hitEft: "hitEft",
  57. fireworksEft: "fireworksEft",
  58. };
  59. var GameMode;
  60. (function (GameMode) {
  61. GameMode[GameMode["classic"] = 0] = "classic";
  62. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  63. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  64. })(GameMode || (GameMode = {}));
  65. var SkillType;
  66. (function (SkillType) {
  67. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  68. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  69. SkillType[SkillType["ice"] = 2] = "ice";
  70. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  71. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  72. })(SkillType || (SkillType = {}));
  73. var ClassicWordsType;
  74. (function (ClassicWordsType) {
  75. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  76. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  77. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  78. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  79. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  80. })(ClassicWordsType || (ClassicWordsType = {}));
  81. var PressType;
  82. (function (PressType) {
  83. PressType[PressType["powerNode"] = 0] = "powerNode";
  84. PressType[PressType["d2Root"] = 1] = "d2Root";
  85. PressType[PressType["moveNode"] = 2] = "moveNode";
  86. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  87. })(PressType || (PressType = {}));
  88. var PlaceBallType;
  89. (function (PlaceBallType) {
  90. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  91. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  92. })(PlaceBallType || (PlaceBallType = {}));
  93. var EAdType;
  94. (function (EAdType) {
  95. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  96. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  97. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  98. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  99. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  100. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  101. EAdType[EAdType["sign"] = 6] = "sign";
  102. EAdType[EAdType["draw"] = 7] = "draw";
  103. EAdType[EAdType["triple"] = 8] = "triple";
  104. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  105. EAdType[EAdType["getPower"] = 10] = "getPower";
  106. EAdType[EAdType["box"] = 11] = "box";
  107. EAdType[EAdType["try"] = 12] = "try";
  108. EAdType[EAdType["againSign"] = 13] = "againSign";
  109. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  110. })(EAdType || (EAdType = {}));
  111. var Prop;
  112. (function (Prop) {
  113. Prop[Prop["diamond"] = 1] = "diamond";
  114. Prop[Prop["coin"] = 2] = "coin";
  115. Prop[Prop["gan1"] = 3] = "gan1";
  116. Prop[Prop["gan2"] = 4] = "gan2";
  117. Prop[Prop["gan3"] = 5] = "gan3";
  118. Prop[Prop["gan4"] = 6] = "gan4";
  119. })(Prop || (Prop = {}));
  120. var TipsType;
  121. (function (TipsType) {
  122. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  123. TipsType[TipsType["foul"] = 1] = "foul";
  124. })(TipsType || (TipsType = {}));
  125. class AwardType {
  126. constructor(type, num) {
  127. this.type = type;
  128. this.num = num;
  129. }
  130. }
  131. var define = /*#__PURE__*/Object.freeze({
  132. fguiRes: fguiRes,
  133. ballCamp: ballCamp,
  134. FoulType: FoulType,
  135. ALL_BALL_STOP: ALL_BALL_STOP,
  136. WAIT_SHOOT: WAIT_SHOOT,
  137. D3RES_LOADED: D3RES_LOADED,
  138. BALL_SHOOT: BALL_SHOOT,
  139. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  140. RESET_GAME: RESET_GAME,
  141. COIN_CHANGE: COIN_CHANGE,
  142. DIAMOND_CHANGE: DIAMOND_CHANGE,
  143. RESTART_GAME: RESTART_GAME,
  144. GET_USER_INFO: GET_USER_INFO,
  145. CHANGE_SECRETARY: CHANGE_SECRETARY,
  146. POWER_CHANGE: POWER_CHANGE,
  147. POWER_TIME: POWER_TIME,
  148. baseHeadUrl: baseHeadUrl,
  149. poolKey: poolKey,
  150. get GameMode () { return GameMode; },
  151. get SkillType () { return SkillType; },
  152. get ClassicWordsType () { return ClassicWordsType; },
  153. get PressType () { return PressType; },
  154. get PlaceBallType () { return PlaceBallType; },
  155. get EAdType () { return EAdType; },
  156. get Prop () { return Prop; },
  157. get TipsType () { return TipsType; },
  158. AwardType: AwardType
  159. });
  160. class CContext {
  161. constructor() {
  162. this.winSize = { width: 0, height: 0 };
  163. this.notchHeight = 0;
  164. this.bannerHeight = 0;
  165. }
  166. init(resList, callback) {
  167. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  168. this.notchHeight = this.getNotchHeight();
  169. this.bannerHeight = this.getBannerHeight();
  170. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  171. callback && callback();
  172. }));
  173. }
  174. getNotchHeight() {
  175. let notchHeight = 50;
  176. if (Laya.Browser.onMiniGame) {
  177. let deviceInfo = wx.getSystemInfoSync();
  178. if (Laya.Browser.onIOS) {
  179. if (deviceInfo.model.search('iPhone X') != -1) {
  180. notchHeight = deviceInfo.statusBarHeight - 10;
  181. }
  182. else {
  183. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  184. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  185. notchHeight = deviceInfo.statusBarHeight - 10;
  186. }
  187. }
  188. }
  189. else if (Laya.Browser.onAndroid) {
  190. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  191. notchHeight = deviceInfo.statusBarHeight;
  192. }
  193. }
  194. }
  195. return notchHeight;
  196. }
  197. getBannerHeight() {
  198. return 0;
  199. }
  200. }
  201. let context = new CContext();
  202. var Handler = Laya.Handler;
  203. var Tween = Laya.Tween;
  204. function playClickEffect(btn) {
  205. if (!btn)
  206. return;
  207. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  208. if (!btn)
  209. return;
  210. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  211. if (!btn)
  212. return;
  213. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  214. }), 0, true);
  215. }), 0, true);
  216. }
  217. function getNumList(strList) {
  218. let dataList = [];
  219. if (strList) {
  220. let list = strList;
  221. let array = list.split(',');
  222. for (var v in array) {
  223. dataList.push(Number(array[v]));
  224. }
  225. }
  226. return dataList;
  227. }
  228. function getStrList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split('|');
  233. for (var v in array) {
  234. dataList.push(String(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getRandStr(len) {
  240. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  241. let str = "";
  242. for (let i = 0; i < len; i++) {
  243. let rand = random(0, list.length);
  244. str += list[rand];
  245. }
  246. return str;
  247. }
  248. function getUserId() {
  249. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  250. return str;
  251. }
  252. function formatPos(pos, len = 2) {
  253. let v = Math.pow(10, len);
  254. pos.x = Math.floor(pos.x * v) / v;
  255. pos.y = Math.floor(pos.y * v) / v;
  256. if (pos.z)
  257. pos.z = Math.floor(pos.z * v) / v;
  258. return pos;
  259. }
  260. function setPosInt(pos) {
  261. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  262. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  263. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  264. return pos;
  265. }
  266. function random(min, max) {
  267. var rang = max - min;
  268. var rand = Math.random() * rang;
  269. return Math.floor(rand) + min;
  270. }
  271. function randomList(list, num) {
  272. if (list.length <= num)
  273. return list;
  274. let arry = [];
  275. list.forEach(item => {
  276. arry.push(item);
  277. });
  278. let nums = [];
  279. for (let i = 0; i < num; i++) {
  280. let rand = random(0, arry.length);
  281. let v = arry[rand];
  282. nums.push(v);
  283. arry.splice(rand, 1);
  284. }
  285. return nums;
  286. }
  287. function worldToScreen(camera, point, pos) {
  288. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  289. pos.x = pos.x / Laya.stage.clientScaleX;
  290. pos.y = pos.y / Laya.stage.clientScaleY;
  291. }
  292. function getStringLenght(str) {
  293. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  294. }
  295. function reviseString(str, len) {
  296. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  297. if (ld > len) {
  298. let sl = Math.floor(len / 2);
  299. let rs = str.substring(0, sl);
  300. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  301. while (d + 2 < len) {
  302. sl++;
  303. rs = str.substring(0, sl);
  304. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. return rs + "...";
  307. }
  308. return str;
  309. }
  310. function getCoinString(coin) {
  311. if (coin < 10000)
  312. return coin.toString();
  313. else if (coin < 1000000) {
  314. let vh = Math.ceil(coin / 100);
  315. return (vh / 10) + "k";
  316. }
  317. else if (coin < 1000000000) {
  318. var vh = Math.ceil(coin / 100000);
  319. return (vh / 10) + "m";
  320. }
  321. else if (coin < 1000000000000) {
  322. var vh = Math.ceil(coin / 100000000);
  323. return (vh / 10) + "b";
  324. }
  325. else if (coin < 1000000000000000) {
  326. var vh = Math.ceil(coin / 100000000000);
  327. return (vh / 10) + "t";
  328. }
  329. }
  330. function getV3Dest(pos, dir, dis, dest) {
  331. dir.x *= dis;
  332. dir.y *= dis;
  333. dir.z *= dis;
  334. Laya.Vector3.add(pos, dir, dest);
  335. return dest;
  336. }
  337. function getV2Dest(x1, y1, dir, dis, dest) {
  338. dest.x = x1 + dir.x * dis;
  339. dest.y = y1 + dir.y * dis;
  340. return dest;
  341. }
  342. function getV2Dir(x1, y1, x2, y2, dir) {
  343. dir.x = x2 - x1;
  344. dir.y = y2 - y1;
  345. Laya.Vector2.normalize(dir, dir);
  346. return dir;
  347. }
  348. function getV3Dir(p1, p2, dir) {
  349. Laya.Vector3.subtract(p1, p2, dir);
  350. Laya.Vector3.normalize(dir, dir);
  351. return dir;
  352. }
  353. function copyPos(ip, op) {
  354. op.x = ip.x;
  355. op.y = ip.y;
  356. if (ip.z)
  357. op.z = ip.z;
  358. return op;
  359. }
  360. function getScreenImg() {
  361. let gl = Laya.WebGLContext.mainContext;
  362. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  363. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  364. let w = gl.drawingBufferWidth;
  365. let h = gl.drawingBufferHeight;
  366. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  367. texture2d.setPixels(pixels);
  368. return new Laya.Texture(texture2d);
  369. }
  370. function playMoveByPositions(sp, positions, v, completeCallback) {
  371. let p;
  372. let play = () => {
  373. if (positions.length == 0) {
  374. completeCallback();
  375. return;
  376. }
  377. p = positions[0];
  378. positions.splice(0, 1);
  379. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  380. play();
  381. }));
  382. };
  383. play();
  384. }
  385. function setStarPos(node, num, max) {
  386. for (let i = 1; i <= 5; i++) {
  387. let img = node.getChildAt(i - 1);
  388. img.width = img.height = 30;
  389. img.pivotX = img.pivotY = 0.5;
  390. img.gray = i > num;
  391. img.visible = i <= max;
  392. if (max == 3) {
  393. img.x = node.width / 2 + (i - 2) * 30 - 15;
  394. img.y = node.height - 40;
  395. if (i == 2)
  396. img.y = node.height - 30;
  397. }
  398. else if (max == 5) {
  399. let ly = Math.abs(i - 3);
  400. img.x = node.width / 2 + (i - 3) * 20 - 15;
  401. img.y = node.height - ly * 8 - 30;
  402. }
  403. }
  404. }
  405. function playLoopAnimRotate(sp, time, clockwise = true) {
  406. let rotation;
  407. sp.rotation = sp.rotation % 360;
  408. if (clockwise) {
  409. rotation = -360;
  410. }
  411. else {
  412. rotation = 360;
  413. }
  414. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  415. this.playLoopAnimRotate(sp, time, clockwise);
  416. }));
  417. }
  418. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  419. let x, y;
  420. if (isBig) {
  421. x = valueXMin;
  422. y = valueYMin;
  423. }
  424. else {
  425. x = valueXMax;
  426. y = valueYMax;
  427. }
  428. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  429. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  430. }));
  431. }
  432. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  433. let scale;
  434. if (isBig) {
  435. scale = valueMin;
  436. }
  437. else {
  438. scale = valueMax;
  439. }
  440. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  441. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  442. }));
  443. }
  444. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  445. let value;
  446. if (isBig) {
  447. value = valueMin;
  448. }
  449. else {
  450. value = valueMax;
  451. }
  452. if (count) {
  453. count--;
  454. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  455. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  456. }));
  457. }
  458. else {
  459. sp.rotation = 0;
  460. }
  461. }
  462. function inRect(rect, p) {
  463. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  464. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  465. return true;
  466. }
  467. }
  468. return false;
  469. }
  470. function getNumberK(number) {
  471. if (number < 1000) {
  472. return number.toString();
  473. }
  474. else {
  475. return (number / 1000).toFixed(1) + "k";
  476. }
  477. }
  478. function pointInsideCircle(point, circle, r) {
  479. if (r === 0)
  480. return false;
  481. var dx = circle.x - point.x;
  482. var dy = circle.y - point.y;
  483. return dx * dx + dy * dy <= r * r;
  484. }
  485. function formatString(str, data) {
  486. if (!str || data == undefined) {
  487. return str;
  488. }
  489. if (typeof data === "object") {
  490. for (var key in data) {
  491. if (data.hasOwnProperty(key)) {
  492. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  493. }
  494. }
  495. }
  496. else {
  497. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  498. return str.replace(reg, function (match, index) {
  499. return args[index - (-1)];
  500. });
  501. }
  502. return str;
  503. }
  504. function getIntersection(a, b) {
  505. let t = [];
  506. for (var i = 0; i < a.length; i++) {
  507. for (var j = 0; j < b.length; j++) {
  508. if (a[i] == b[j]) {
  509. t.push(a[i]);
  510. }
  511. }
  512. }
  513. return t;
  514. }
  515. function getComplement(a, b) {
  516. let t = [];
  517. let count = false;
  518. for (var i = 0; i < a.length; i++) {
  519. count = false;
  520. for (var j = 0; j < b.length; j++) {
  521. if (a[i] == b[j]) {
  522. count = true;
  523. break;
  524. }
  525. }
  526. if (!count) {
  527. t.push(a[i]);
  528. }
  529. }
  530. return t;
  531. }
  532. function geSpriteStageRect(sp) {
  533. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  534. let rect = {
  535. x: point.x,
  536. y: point.y,
  537. width: sp.width * sp.globalScaleX,
  538. height: sp.height * sp.globalScaleY
  539. };
  540. return rect;
  541. }
  542. function touchButton(button) {
  543. let event = new Laya.Event();
  544. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  545. }
  546. function setColor(sprite, r, g, b) {
  547. var redMat = [
  548. r / 255, 0, 0, 0, 0,
  549. g / 255, 0, 0, 0, 0,
  550. b / 255, 0, 0, 0, 0,
  551. 0, 0, 0, 1, 0,
  552. ];
  553. var filter = new Laya.ColorFilter(redMat);
  554. sprite.filters = [filter];
  555. }
  556. function clone(obj, newobj = {}) {
  557. for (var attr in obj) {
  558. if (typeof obj[attr] == "object") {
  559. newobj[attr] = clone(obj[attr], newobj[attr]);
  560. }
  561. else {
  562. newobj[attr] = obj[attr];
  563. }
  564. }
  565. return newobj;
  566. }
  567. function _ms(arr, compare, begin, end) {
  568. const size = end - begin;
  569. if (size <= 1) {
  570. return;
  571. }
  572. const middle = (end + begin) >> 1;
  573. _ms(arr, compare, begin, middle);
  574. _ms(arr, compare, middle, end);
  575. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  576. return;
  577. }
  578. const merged = [];
  579. let leftIndex = begin, rightIndex = middle;
  580. while (merged.length < size) {
  581. if (leftIndex === middle) {
  582. merged.push(arr[rightIndex++]);
  583. }
  584. else if (rightIndex === end) {
  585. merged.push(arr[leftIndex++]);
  586. }
  587. else {
  588. const c = compare(arr[leftIndex], arr[rightIndex]);
  589. if (c <= 0) {
  590. merged.push(arr[leftIndex++]);
  591. }
  592. else {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. }
  596. }
  597. arr.splice(begin, size, ...merged);
  598. }
  599. function sort(arr, compare) {
  600. if (!Array.isArray(arr)) {
  601. throw new Error('sort的参数必须为数组');
  602. }
  603. _ms(arr, compare, 0, arr.length);
  604. return arr;
  605. }
  606. function getLanguage(id) {
  607. }
  608. function getLanguageByTip(id) {
  609. }
  610. function toWeights(array) {
  611. let max = 0;
  612. for (var i = 0; i < array.length; i++) {
  613. max = max + array[i];
  614. if (array[i] == 0) {
  615. array[i] = 0;
  616. }
  617. else {
  618. array[i] = max;
  619. }
  620. }
  621. return array;
  622. }
  623. function unique(array) {
  624. var n = {}, r = [], len = array.length, val, type;
  625. for (var i = 0; i < array.length; i++) {
  626. val = array[i];
  627. type = typeof val;
  628. if (!n[val]) {
  629. n[val] = [type];
  630. r.push(val);
  631. }
  632. else if (n[val].indexOf(type) < 0) {
  633. n[val].push(type);
  634. r.push(val);
  635. }
  636. }
  637. return r;
  638. }
  639. function unique1(array) {
  640. var r = [];
  641. for (var i = 0, l = array.length; i < l; i++) {
  642. for (var j = i + 1; j < l; j++)
  643. if (array[i] == array[j])
  644. j == ++i;
  645. r.push(array[i]);
  646. }
  647. return r;
  648. }
  649. function getDistance(x1, y1, x2, y2) {
  650. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  651. }
  652. function getV2Dis(pos1, pos2) {
  653. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  654. }
  655. function getV2SqDis(pos1, pos2) {
  656. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  657. }
  658. function getDis(x1, y1, x2, y2) {
  659. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  660. }
  661. function getDeltaxy(x1, y1, x2, y2) {
  662. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  663. }
  664. function getSymbolNumber(num) {
  665. if (num > 0) {
  666. return "+" + num;
  667. }
  668. else if (num < 0) {
  669. return num.toString();
  670. }
  671. return num.toString();
  672. }
  673. function fixNumber(num, length) {
  674. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  675. }
  676. function toThousands(num) {
  677. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  678. }
  679. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  680. function fmtMoney(money) {
  681. money = toThousands(money.replace(/^0+/, ''));
  682. if (money.length == 0) {
  683. money = "0";
  684. }
  685. let unit = 0;
  686. for (var i = 0; i < money.length; i++) {
  687. if (money.charAt(i) == ",") {
  688. unit++;
  689. }
  690. }
  691. if (unit == 0) {
  692. return money;
  693. }
  694. else {
  695. let idx = money.indexOf(",");
  696. if (idx) {
  697. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  698. }
  699. return money.replace(",", ".");
  700. }
  701. }
  702. function flatten(arr) {
  703. while (arr.some(item => Array.isArray(item))) {
  704. arr = [].concat(...arr);
  705. }
  706. return arr;
  707. }
  708. function getDistanceByPoint(p1, p2) {
  709. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  710. }
  711. function getAngleByPoint(p1, p2) {
  712. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  713. }
  714. function toIntByArray(array) {
  715. for (var index = 0; index < array.length; index++) {
  716. array[index] = parseInt(array[index]);
  717. }
  718. return array;
  719. }
  720. function getAngle0To360(angle) {
  721. while (angle < 0) {
  722. angle += 360;
  723. }
  724. while (angle >= 360) {
  725. angle -= 360;
  726. }
  727. return angle;
  728. }
  729. function toAngle(radian) {
  730. return radian * 180 / Math.PI;
  731. }
  732. function toRadian(angle) {
  733. return angle * Math.PI / 180;
  734. }
  735. function getArrayValueRandom(array) {
  736. return array[random(0, array.length - 1)];
  737. }
  738. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  739. }
  740. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function fmtTimeMMSS(time) {
  743. if (time < 0) {
  744. time = 0;
  745. }
  746. else
  747. time = Math.floor(time);
  748. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  749. }
  750. function fmtTimeMS(time) {
  751. if (time < 0) {
  752. time = 0;
  753. }
  754. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  755. }
  756. function fmtTimeHHMM(time) {
  757. if (time < 0) {
  758. time = 0;
  759. }
  760. time = Math.floor(time / 1000);
  761. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  762. }
  763. let severTime = 0;
  764. function getServerTime() {
  765. return new Date(new Date().getTime() - severTime);
  766. }
  767. function setServerTime(data) {
  768. severTime = (new Date().getTime() - data);
  769. }
  770. var tools = /*#__PURE__*/Object.freeze({
  771. playClickEffect: playClickEffect,
  772. getNumList: getNumList,
  773. getStrList: getStrList,
  774. getRandStr: getRandStr,
  775. getUserId: getUserId,
  776. formatPos: formatPos,
  777. setPosInt: setPosInt,
  778. random: random,
  779. randomList: randomList,
  780. worldToScreen: worldToScreen,
  781. getStringLenght: getStringLenght,
  782. reviseString: reviseString,
  783. getCoinString: getCoinString,
  784. getV3Dest: getV3Dest,
  785. getV2Dest: getV2Dest,
  786. getV2Dir: getV2Dir,
  787. getV3Dir: getV3Dir,
  788. copyPos: copyPos,
  789. getScreenImg: getScreenImg,
  790. playMoveByPositions: playMoveByPositions,
  791. setStarPos: setStarPos,
  792. playLoopAnimRotate: playLoopAnimRotate,
  793. playLoopAnimPosition: playLoopAnimPosition,
  794. playLoopAnimScale: playLoopAnimScale,
  795. playLoopAnimRotation: playLoopAnimRotation,
  796. inRect: inRect,
  797. getNumberK: getNumberK,
  798. pointInsideCircle: pointInsideCircle,
  799. formatString: formatString,
  800. getIntersection: getIntersection,
  801. getComplement: getComplement,
  802. geSpriteStageRect: geSpriteStageRect,
  803. touchButton: touchButton,
  804. setColor: setColor,
  805. clone: clone,
  806. sort: sort,
  807. getLanguage: getLanguage,
  808. getLanguageByTip: getLanguageByTip,
  809. toWeights: toWeights,
  810. unique: unique,
  811. unique1: unique1,
  812. getDistance: getDistance,
  813. getV2Dis: getV2Dis,
  814. getV2SqDis: getV2SqDis,
  815. getDis: getDis,
  816. getDeltaxy: getDeltaxy,
  817. getSymbolNumber: getSymbolNumber,
  818. fixNumber: fixNumber,
  819. toThousands: toThousands,
  820. fmtMoney: fmtMoney,
  821. flatten: flatten,
  822. getDistanceByPoint: getDistanceByPoint,
  823. getAngleByPoint: getAngleByPoint,
  824. toIntByArray: toIntByArray,
  825. getAngle0To360: getAngle0To360,
  826. toAngle: toAngle,
  827. toRadian: toRadian,
  828. getArrayValueRandom: getArrayValueRandom,
  829. promptByTip: promptByTip,
  830. promptByErrorCode: promptByErrorCode,
  831. fmtTimeMMSS: fmtTimeMMSS,
  832. fmtTimeMS: fmtTimeMS,
  833. fmtTimeHHMM: fmtTimeHHMM,
  834. getServerTime: getServerTime,
  835. setServerTime: setServerTime
  836. });
  837. class HttpMgr {
  838. constructor() {
  839. HttpMgr._instance = this;
  840. }
  841. static getInstance() {
  842. if (!this._instance) {
  843. this._instance = new HttpMgr();
  844. }
  845. return this._instance;
  846. }
  847. sendPost(url, data, call) {
  848. let httpObj = new Laya.HttpRequest();
  849. httpObj.http.timeout = 5000;
  850. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  851. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  852. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  853. function errorHandler(error) {
  854. console.log("errorHandler:" + error);
  855. }
  856. function completeHandler(data) {
  857. if (data && data.length > 0) {
  858. let jsonData = JSON.parse(data);
  859. if (call)
  860. call(jsonData);
  861. }
  862. }
  863. }
  864. sendGet(url, call) {
  865. let httpObj = new Laya.HttpRequest();
  866. httpObj.http.timeout = 5000;
  867. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  868. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  869. httpObj.send(url, '', 'get');
  870. function errorHandler(error) {
  871. console.log("errorHandler:" + error);
  872. }
  873. function completeHandler(data) {
  874. if (data && data.length > 0) {
  875. if (call)
  876. call(data);
  877. }
  878. }
  879. }
  880. }
  881. HttpMgr._instance = null;
  882. class LightShader extends Laya.Sprite {
  883. constructor() {
  884. super();
  885. this._time = 0;
  886. this._sin = 0;
  887. this.initShader();
  888. }
  889. initShader() {
  890. var vs = `
  891. #define FSHIGHPRECISION
  892. attribute vec4 posuv;
  893. uniform vec2 size;
  894. varying vec4 v_texcoord;
  895. void main() {
  896. vec4 pos = vec4(posuv.xy,0.,1.);
  897. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  898. gl_Position=pos1;
  899. v_texcoord.xy = posuv.xy;
  900. }
  901. `;
  902. var ps = `
  903. #define FSHIGHPRECISION
  904. precision highp float;
  905. varying vec4 v_texcoord;
  906. uniform vec2 size;
  907. uniform sampler2D texture;
  908. uniform float u_Time;
  909. void main() {
  910. vec4 color= texture2D(texture, v_texcoord.xy);
  911. float width = 0.2;
  912. float start = u_Time;
  913. float offset = 1.0;
  914. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  915. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  916. {
  917. color.r=1.1;
  918. color.g=1.1;
  919. color.b=1.1;
  920. gl_FragColor = color;
  921. } else {
  922. gl_FragColor = color;
  923. }
  924. }
  925. `;
  926. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  927. this.customRenderEnable = true;
  928. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  929. }
  930. customRender(context, x, y) {
  931. this.onUpdate();
  932. if (!this.texture)
  933. return;
  934. let xx = x - this.pivotX;
  935. let yy = y - this.pivotY;
  936. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  937. }
  938. onUpdate() {
  939. this._time += 2 * Laya.timer.delta * 0.001;
  940. this._sin = Math.sin(this._time);
  941. if (this._sin > 0.99) {
  942. this._sin = 0;
  943. this._time = 0;
  944. }
  945. this.shaderValue['u_Time'] = this._sin;
  946. }
  947. }
  948. LightShader.DissolveSurfaceSaveName = 9997;
  949. class UIBase extends fairygui.Window {
  950. constructor() {
  951. super();
  952. this.isEject = true;
  953. this.isHide = true;
  954. this.showbanner = true;
  955. this.className = "";
  956. this.isMuti = false;
  957. this.showbanner = false;
  958. this.onConstructor();
  959. }
  960. checkActive(show) {
  961. }
  962. getUIName() {
  963. return UIBase.uiName;
  964. }
  965. onConstructor() {
  966. }
  967. onInit() {
  968. if (!!this.contentPane) {
  969. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  970. }
  971. this.setPivot(0.5, 0.5, false);
  972. }
  973. doShowAnimation() {
  974. if (!this.isEject)
  975. return;
  976. super.doShowAnimation();
  977. Laya.Tween.clearTween(this);
  978. this.scaleX = this.scaleY = 0.8;
  979. let tweenFunc1 = (func) => {
  980. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  981. };
  982. let tweenFunc2 = (func) => {
  983. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  984. };
  985. tweenFunc1(tweenFunc2);
  986. }
  987. show(...args) {
  988. super.show();
  989. this._openParam = args;
  990. this.isHide = false;
  991. xGame.uiMgr.checkUIState();
  992. }
  993. moveBannerButton() {
  994. }
  995. showBannerButton() {
  996. this.bannerButton.visible = true;
  997. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  998. this.bannerButton.touchable = true;
  999. }));
  1000. }
  1001. hide() {
  1002. super.hide();
  1003. this.isHide = true;
  1004. xGame.uiMgr.checkUIState();
  1005. }
  1006. Dispose() {
  1007. super.dispose();
  1008. }
  1009. myUpdate(delay) {
  1010. }
  1011. refresh() { }
  1012. addUIClick(obj, func, arr = null) {
  1013. obj.onClick(this, func, arr);
  1014. obj.onClick(this, this.playBtnSound);
  1015. }
  1016. offUIClick(obj, func) {
  1017. obj.offClick(this, func);
  1018. }
  1019. playBtnSound() {
  1020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1021. }
  1022. }
  1023. UIBase.lastShowBanner = 0;
  1024. UIBase.showBannerNum = 0;
  1025. UIBase.uiName = "";
  1026. class ui_UIDraw extends fgui.GComponent {
  1027. static createInstance() {
  1028. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1029. }
  1030. onConstruct() {
  1031. this.n1 = (this.getChild("n1"));
  1032. this.extraNode = (this.getChild("extraNode"));
  1033. this.myNode = (this.getChild("myNode"));
  1034. this.closeNode = (this.getChild("closeNode"));
  1035. this.moneyNode = (this.getChild("moneyNode"));
  1036. this.n38 = (this.getChild("n38"));
  1037. this.secretary = (this.getChild("secretary"));
  1038. this.drawBtn = (this.getChild("drawBtn"));
  1039. this.talkNode = (this.getChild("talkNode"));
  1040. this.t0 = this.getTransition("t0");
  1041. }
  1042. }
  1043. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1044. class ui_UIBox extends fgui.GComponent {
  1045. static createInstance() {
  1046. return (fgui.UIPackage.createObject("game", "UIBox"));
  1047. }
  1048. onConstruct() {
  1049. this.n0 = (this.getChild("n0"));
  1050. this.n12 = (this.getChild("n12"));
  1051. this.n1 = (this.getChild("n1"));
  1052. this.n2 = (this.getChild("n2"));
  1053. this.bar = (this.getChild("bar"));
  1054. this.closeBtn = (this.getChild("closeBtn"));
  1055. this.openBtn = (this.getChild("openBtn"));
  1056. this.t0 = this.getTransition("t0");
  1057. this.t1 = this.getTransition("t1");
  1058. }
  1059. }
  1060. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1061. class GlobalManager {
  1062. constructor() {
  1063. }
  1064. registerMethod(name, method) {
  1065. console.log('zh: 注册全局方法', name);
  1066. this[name] = method;
  1067. }
  1068. callMethod(name, ...args) {
  1069. console.log('zh: 调用全局方法', name);
  1070. if (this[name]) {
  1071. return this[name](...args);
  1072. }
  1073. else {
  1074. console.error(`zh: 全局方法 Method ${name} not found`);
  1075. }
  1076. }
  1077. }
  1078. GlobalManager.instance = new GlobalManager();
  1079. class JSBridgeUtils {
  1080. constructor() { }
  1081. static get instance() {
  1082. if (!this._instance) {
  1083. this._instance = new JSBridgeUtils();
  1084. }
  1085. return this._instance;
  1086. }
  1087. initBridge() {
  1088. if (!Laya.Browser.onAndroid) {
  1089. console.log('zh:非android dev');
  1090. return;
  1091. }
  1092. let cfg = window['conchConfig'];
  1093. if (cfg) {
  1094. var os = cfg.getOS();
  1095. if (os == "Conch-android") {
  1096. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1097. if (this.bridge) {
  1098. return true;
  1099. }
  1100. else {
  1101. return false;
  1102. }
  1103. }
  1104. else {
  1105. return false;
  1106. }
  1107. }
  1108. else {
  1109. return false;
  1110. }
  1111. }
  1112. testAd1() {
  1113. if (!Laya.Browser.onAndroid) {
  1114. console.log('zh:非android dev');
  1115. return;
  1116. }
  1117. if (!this.initBridge()) {
  1118. return;
  1119. }
  1120. let rs = this.bridge.call("testString", "hello");
  1121. console.log('zh:testString rs=' + rs);
  1122. }
  1123. testAdCallBack() {
  1124. if (!this.initBridge()) {
  1125. return;
  1126. }
  1127. console.log("zh:testAdCallBack start");
  1128. const defaultObj = { code: 200, msg: "req update Ui" };
  1129. const reqObj = { code: 300, msg: "hello java ui" };
  1130. this.bridge.callWithBack((rsStr) => {
  1131. const rsObj = JSON.parse(rsStr);
  1132. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1133. }, "testAsyncCallback", JSON.stringify(reqObj));
  1134. }
  1135. showInternAd(mark) {
  1136. console.log('zh:showInternAd start');
  1137. if (!Laya.Browser.onAndroid) {
  1138. console.log('zh:showInternAd 非android dev');
  1139. return false;
  1140. }
  1141. if (!this.initBridge()) {
  1142. return false;
  1143. }
  1144. let rs = this.bridge.call("showInternAd", mark);
  1145. try {
  1146. const result = JSON.parse(rs);
  1147. if (result.code === 200) {
  1148. console.log("zh:showInternAd OK");
  1149. return true;
  1150. }
  1151. else {
  1152. console.warn("zh:showInternAd FAILL:", result.msg);
  1153. return false;
  1154. }
  1155. }
  1156. catch (e) {
  1157. console.error("zh:解析桥接返回值失败:", e);
  1158. return false;
  1159. }
  1160. }
  1161. showRewardAd(mark) {
  1162. if (!Laya.Browser.onAndroid) {
  1163. console.log('zh:非android dev');
  1164. return false;
  1165. }
  1166. if (!this.initBridge()) {
  1167. return false;
  1168. }
  1169. let rs = this.bridge.call("showRewardAd", mark);
  1170. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1171. try {
  1172. const result = JSON.parse(rs);
  1173. if (result.code === 200) {
  1174. console.log("zh:广告显示成功");
  1175. return true;
  1176. }
  1177. else {
  1178. console.warn("zh:广告显示失败:", result.msg);
  1179. return false;
  1180. }
  1181. }
  1182. catch (e) {
  1183. console.error("zh:解析桥接返回值失败:", e);
  1184. return false;
  1185. }
  1186. }
  1187. logEventForAdNoParams(eventName) {
  1188. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1189. if (!Laya.Browser.onAndroid) {
  1190. console.log('zh:非android dev');
  1191. return;
  1192. }
  1193. if (!this.initBridge()) {
  1194. return;
  1195. }
  1196. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1197. this.bridge.call("logEventForAdNoParams", eventName);
  1198. }
  1199. logEventForAdHaveParams(eventName, jsonStr) {
  1200. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1201. if (!Laya.Browser.onAndroid) {
  1202. console.log('zh:非android dev');
  1203. return;
  1204. }
  1205. if (!this.initBridge()) {
  1206. return;
  1207. }
  1208. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1209. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1210. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1211. }
  1212. nativeCallJs(msg) {
  1213. console.log("zh:nativeCallJs received data: 1111", msg);
  1214. if (msg === 'Ad1') {
  1215. GlobalManager.instance.callMethod('Ad1');
  1216. console.log("zh: Ad1 奖励发送成功");
  1217. }
  1218. else if (msg === 'Ad2') {
  1219. GlobalManager.instance.callMethod('Ad2');
  1220. console.log("zh: Ad2 奖励发送成功");
  1221. }
  1222. else if (msg === 'Ad3') {
  1223. GlobalManager.instance.callMethod('Ad3');
  1224. console.log("zh: Ad3 奖励发送成功");
  1225. }
  1226. else if (msg === 'Ad4') {
  1227. GlobalManager.instance.callMethod('Ad4');
  1228. console.log("zh: Ad4 奖励发送成功");
  1229. }
  1230. else if (msg === 'Ad5') {
  1231. console.log("zh: Ad5 奖励发送成功");
  1232. GlobalManager.instance.callMethod('Ad5');
  1233. }
  1234. }
  1235. }
  1236. class UIBox extends UIBase {
  1237. constructor() {
  1238. super();
  1239. this.boxNum = 0;
  1240. this.boxMax = 10;
  1241. this.inAd = false;
  1242. this.isClose = false;
  1243. }
  1244. onConstructor() {
  1245. this.ui = ui_UIBox.createInstance();
  1246. this.contentPane = this.ui;
  1247. this.isEject = false;
  1248. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1249. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1250. Laya.timer.loop(1000, this, this.update);
  1251. }
  1252. update() {
  1253. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1254. this.boxNum -= 1;
  1255. this.upBar();
  1256. }
  1257. }
  1258. upBar() {
  1259. if (this.boxNum > this.boxMax)
  1260. this.boxNum = this.boxMax;
  1261. this.ui.bar.value = this.boxNum * 10;
  1262. }
  1263. show() {
  1264. super.show();
  1265. this.isClose = false;
  1266. this.boxNum = 0;
  1267. this.inAd = false;
  1268. this.upBar();
  1269. this.ui.t0.play();
  1270. this.ui.closeBtn.visible = false;
  1271. Laya.timer.once(3000, this, () => {
  1272. this.ui.closeBtn.visible = true;
  1273. this.ui.bar.alpha = 1;
  1274. });
  1275. Laya.timer.once(500, this, () => {
  1276. this.ui.t1.play();
  1277. });
  1278. }
  1279. hide() {
  1280. Laya.timer.clearAll(this);
  1281. Moyu.showBannerAd(false);
  1282. super.hide();
  1283. }
  1284. onOpenBox() {
  1285. this.boxNum++;
  1286. if (this.boxNum < this.boxMax) {
  1287. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1288. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1289. }
  1290. }
  1291. else if (this.boxNum == this.boxMax) {
  1292. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1293. this.ui.openBtn.c1.selectedIndex = 13;
  1294. this.inAd = true;
  1295. }
  1296. else
  1297. this.getAward();
  1298. }
  1299. else if (this.inAd) {
  1300. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1301. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1302. }
  1303. else {
  1304. console.log('zh:AD 失败,直接发放奖励');
  1305. this.qjff_AD_for_UIBOX_onOpenBox();
  1306. }
  1307. }
  1308. this.upBar();
  1309. }
  1310. qjff_AD_for_UIBOX_onOpenBox() {
  1311. this.getAward();
  1312. }
  1313. onCloseBox() {
  1314. if (this.isClose)
  1315. this.hide();
  1316. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1317. this.isClose = true;
  1318. PlatMgr.showBanner(true, 0, 3000);
  1319. }
  1320. else
  1321. this.hide();
  1322. }
  1323. getAward() {
  1324. let str = "";
  1325. if (Math.random() < 0.5) {
  1326. let max = Moyu.isLegal ? 500 : 2500;
  1327. let num = xGame.tools.random(max, 500 + max);
  1328. DataMgr.setCoin(num);
  1329. str = "金币x" + num;
  1330. }
  1331. else {
  1332. let max = Moyu.isLegal ? 10 : 30;
  1333. let num = xGame.tools.random(max, 30 + max);
  1334. DataMgr.setDiamond(num);
  1335. str = "钻石x" + num;
  1336. }
  1337. xGame.showTip("恭喜获得-" + str);
  1338. this.hide();
  1339. }
  1340. }
  1341. UIBox.uiName = "UIBox";
  1342. class ui_UITry extends fgui.GComponent {
  1343. static createInstance() {
  1344. return (fgui.UIPackage.createObject("game", "UITry"));
  1345. }
  1346. onConstruct() {
  1347. this.n11 = (this.getChild("n11"));
  1348. this.myNode = (this.getChild("myNode"));
  1349. this.t0 = this.getTransition("t0");
  1350. }
  1351. }
  1352. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1353. class UITry extends UIBase {
  1354. constructor() {
  1355. super();
  1356. this.closeTime = 0;
  1357. this.closeNum = 0;
  1358. this.skillUrl = xGame.common.skillIconList;
  1359. }
  1360. onConstructor() {
  1361. this.ui = ui_UITry.createInstance();
  1362. this.contentPane = this.ui;
  1363. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1364. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1365. }
  1366. show() {
  1367. super.show();
  1368. this.closeNum = 0;
  1369. this.closeTime = 15;
  1370. this.ui.t0.play();
  1371. PlatMgr.showRateBanner();
  1372. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1373. Laya.timer.loop(1000, this, this.updateTime);
  1374. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1375. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1376. xGame.common.gameMgr.gamePause = true;
  1377. }
  1378. updateTime() {
  1379. if (this.closeTime > 1) {
  1380. this.closeTime--;
  1381. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1382. }
  1383. else
  1384. this.hide();
  1385. }
  1386. hide() {
  1387. Laya.timer.clearAll(this);
  1388. Moyu.showBannerAd(false);
  1389. super.hide();
  1390. xGame.common.gameMgr.gamePause = false;
  1391. }
  1392. onTry() {
  1393. console.log('zh:qjff_AD_for_uitry');
  1394. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1395. }
  1396. else {
  1397. console.log('zh:AD 失败,直接发放奖励');
  1398. this.qjff_AD_for_uitry();
  1399. }
  1400. }
  1401. qjff_AD_for_uitry() {
  1402. let select = xGame.common.curPlayerSkillType;
  1403. DataMgr.gameData.trySkill = select;
  1404. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1405. DataMgr.saveGameData();
  1406. DataMgr.setBigSkill(select, 1);
  1407. xGame.showTip("Trial Successful");
  1408. this.hide();
  1409. }
  1410. onCancel() {
  1411. if (this.closeNum > 0) {
  1412. this.closeNum--;
  1413. if (this.closeNum < 2)
  1414. this.hide();
  1415. return;
  1416. }
  1417. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1418. this.onTry();
  1419. }
  1420. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1421. this.closeNum = 3;
  1422. }
  1423. else
  1424. this.hide();
  1425. }
  1426. }
  1427. UITry.uiName = "UITry";
  1428. class PlatMgr {
  1429. static initConfig() {
  1430. this.lastVt = 0;
  1431. if (!Moyu.platConfig)
  1432. return;
  1433. for (let k in Moyu.platConfig) {
  1434. let pd = this[k];
  1435. let pc = Moyu.platConfig[k];
  1436. if (pd != undefined && pc != undefined)
  1437. this[k] = pc;
  1438. }
  1439. Moyu.setBannerPos(0.5, 1);
  1440. }
  1441. static rand100(num) {
  1442. return xGame.tools.random(0, 100) < num;
  1443. }
  1444. static isMisVideo() {
  1445. let dt = Laya.timer.currTimer - this.lastVt;
  1446. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1447. this.lastVt = Laya.timer.currTimer;
  1448. return true;
  1449. }
  1450. else {
  1451. if (this.rand100(this.fullVideoRate)) {
  1452. console.log('zh:插屏 ad start');
  1453. JSBridgeUtils.instance.showInternAd('platMgr');
  1454. }
  1455. return false;
  1456. }
  1457. }
  1458. static showVideo(call, type) {
  1459. Moyu.showVideoAd(() => {
  1460. this.lastVt = Laya.timer.currTimer;
  1461. call && call();
  1462. }, type);
  1463. }
  1464. static showInsert(delay = false) {
  1465. if (this.getRand() < this.insertRate) {
  1466. let dt = delay ? this.insertDelay : 0;
  1467. console.log('zh:插屏 ad start');
  1468. JSBridgeUtils.instance.showInternAd('gameInsert');
  1469. }
  1470. }
  1471. static gameInsert() {
  1472. let t = this.getRand();
  1473. let r = this.gameInsertRate;
  1474. if (t < r) {
  1475. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1476. }
  1477. }
  1478. static showRateBanner() {
  1479. if (this.getRand() < this.bannerRate)
  1480. this.showBanner(true, this.bannerDelay, 3000);
  1481. }
  1482. static showBanner(show, delay = 0, hide = 0) {
  1483. if (2 > 1) {
  1484. console.log('zh:显示showBanner广告 直接返回');
  1485. return;
  1486. }
  1487. if (!show)
  1488. Moyu.showBannerAd(false);
  1489. else {
  1490. Laya.timer.clear(this, this.bannerShow);
  1491. if (delay > 0)
  1492. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1493. else
  1494. this.bannerShow(true);
  1495. if (hide > 0)
  1496. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1497. }
  1498. }
  1499. static bannerShow(show) {
  1500. if (2 > 1) {
  1501. console.log('zh:显示showBanner广告 直接返回');
  1502. return;
  1503. }
  1504. Moyu.showBannerAd(show);
  1505. console.log("showBanner" + show);
  1506. }
  1507. static getRand() {
  1508. return xGame.tools.random(0, 100);
  1509. }
  1510. static openBox() {
  1511. if (this.getRand() < this.boxRate)
  1512. xGame.uiMgr.Show(UIBox);
  1513. }
  1514. static openTry() {
  1515. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1516. return;
  1517. if (this.getRand() < this.tryRate)
  1518. xGame.uiMgr.Show(UITry);
  1519. else if (DataMgr.gameData.gameCount == 1)
  1520. xGame.uiMgr.Show(UITry);
  1521. }
  1522. }
  1523. PlatMgr.forceShare = 0;
  1524. PlatMgr.signAdRate = 0;
  1525. PlatMgr.forceVideoRate = 0;
  1526. PlatMgr.forceVideoGap = 0;
  1527. PlatMgr.fullVideoRate = 0;
  1528. PlatMgr.gameInsertRate = 0;
  1529. PlatMgr.insertGap = 0;
  1530. PlatMgr.insertDelay = 0;
  1531. PlatMgr.insertRate = 0;
  1532. PlatMgr.boxRate = 0;
  1533. PlatMgr.boxVideoRate = 0;
  1534. PlatMgr.boxInsertRate = 0;
  1535. PlatMgr.boxBannerRate = 0;
  1536. PlatMgr.tryRate = 0;
  1537. PlatMgr.tryClose3Rate = 0;
  1538. PlatMgr.tryVideoRate = 0;
  1539. PlatMgr.bannerRate = 0;
  1540. PlatMgr.lastVt = 0;
  1541. class ui_UIAddProp extends fgui.GComponent {
  1542. static createInstance() {
  1543. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1544. }
  1545. onConstruct() {
  1546. this.n11 = (this.getChild("n11"));
  1547. this.myNode = (this.getChild("myNode"));
  1548. this.closeBtn = (this.getChild("closeBtn"));
  1549. this.t0 = this.getTransition("t0");
  1550. }
  1551. }
  1552. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1553. class SpineMgr {
  1554. constructor(name, loadCb = null) {
  1555. this.loaded = false;
  1556. this.spineName = '';
  1557. this.loadedCallback = loadCb;
  1558. this.templet = new Laya.Templet();
  1559. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1560. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1561. if (name === 'mishu') {
  1562. this.templet.loadAni('spine/nvmishu.sk');
  1563. }
  1564. else {
  1565. this.templet.loadAni(`spine/${name}.sk`);
  1566. }
  1567. this.templet.lock = true;
  1568. this.spineName = name;
  1569. }
  1570. onError() {
  1571. console.log("zh:spine加载出错");
  1572. }
  1573. parseComplete() {
  1574. this.loaded = true;
  1575. this.loadedCallback && this.loadedCallback();
  1576. }
  1577. dispose() {
  1578. if (this.templet && !this.templet.destroyed) {
  1579. this.templet.destroy();
  1580. }
  1581. this.templet = null;
  1582. }
  1583. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1584. if (!this.loaded) {
  1585. return;
  1586. }
  1587. let spine;
  1588. if (mySpine) {
  1589. spine = mySpine;
  1590. }
  1591. else {
  1592. spine = this.createSpine(data, parent);
  1593. }
  1594. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1595. if (!isLoop) {
  1596. spine.on(Laya.Event.STOPPED, this, () => {
  1597. spine.offAll(Laya.Event.STOPPED);
  1598. callback && callback(spine);
  1599. });
  1600. }
  1601. return spine;
  1602. }
  1603. createSpine(data, parent, type = 1) {
  1604. let spine;
  1605. spine = this.templet.buildArmature(type);
  1606. spine.showSkinByIndex(0);
  1607. parent.addChild(spine);
  1608. spine.pos(data.x, data.y);
  1609. spine.scale(data.scaleX, data.scaleY, true);
  1610. return spine;
  1611. }
  1612. }
  1613. var AIState;
  1614. (function (AIState) {
  1615. AIState[AIState["none"] = 0] = "none";
  1616. AIState[AIState["idle"] = 1] = "idle";
  1617. AIState[AIState["reset"] = 2] = "reset";
  1618. AIState[AIState["move"] = 3] = "move";
  1619. AIState[AIState["wait"] = 4] = "wait";
  1620. AIState[AIState["select"] = 5] = "select";
  1621. AIState[AIState["turn"] = 6] = "turn";
  1622. AIState[AIState["shoot"] = 7] = "shoot";
  1623. AIState[AIState["leave"] = 8] = "leave";
  1624. })(AIState || (AIState = {}));
  1625. class AIPlayer {
  1626. constructor() {
  1627. this.dtime = 30;
  1628. this.awayTime = 0;
  1629. this.awayNum = 0;
  1630. this.hideTime = 0;
  1631. this.rootMoveTime = 0;
  1632. this.isGuide = false;
  1633. this.state = AIState.none;
  1634. this.waitTime = 0;
  1635. this.forceNum = 0;
  1636. this.forceMax = 0;
  1637. this.ballSize = 33;
  1638. this.selectNum = 0;
  1639. this.destRot = 0;
  1640. this.aiLv = 10;
  1641. this.kickBall = [];
  1642. this.lineBall = [];
  1643. this.scoreBall = [];
  1644. this.holeBall = [];
  1645. this.turnNum = 0;
  1646. this.setNum = 0;
  1647. this.setMax = 0;
  1648. this.setRate = 0;
  1649. this.rectL = 0;
  1650. this.rectR = 0;
  1651. this.rectT = 0;
  1652. this.rectB = 0;
  1653. this.rootPos = { x: 0, y: 0 };
  1654. this.bestForce = 0;
  1655. this.bestAngle = 180;
  1656. this.bestPos = { x: 0, y: 0 };
  1657. this.bestKick = { x: 0, y: 0 };
  1658. this.posList = [];
  1659. this.posIdx = 0;
  1660. this.chatTime = 3000;
  1661. this.tempDir1 = new Laya.Vector2();
  1662. this.tempDir2 = new Laya.Vector2();
  1663. this.tempDir3 = new Laya.Vector2();
  1664. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1665. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1666. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1667. this.gameSrc = xGame.common.gameUI;
  1668. this.hideTime = Laya.timer.currTimer;
  1669. Moyu.setOnTipCall((id) => {
  1670. if (id == 20012)
  1671. this.hideTime = Laya.timer.currTimer;
  1672. else
  1673. (id == 20011);
  1674. {
  1675. let dt = Laya.timer.currTimer - this.hideTime;
  1676. console.log("onshow" + dt);
  1677. if (dt > 30000 && this.state > AIState.none)
  1678. xGame.common.gameMgr.aiGameEnd(false);
  1679. }
  1680. }, this);
  1681. }
  1682. init() {
  1683. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1684. this.awayTime = xGame.tools.random(5000, 10000);
  1685. this.awayNum = 0;
  1686. this.hideTime = Laya.timer.currTimer;
  1687. let rect = xGame.common.d2World.borderRect;
  1688. this.rectL = Math.ceil(rect.x) + 17;
  1689. this.rectT = Math.ceil(rect.y) + 17;
  1690. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1691. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1692. this.wBall = xGame.common.d2World.rootBall;
  1693. this.ballSize = this.wBall.gameObj.width - 1;
  1694. if (this.posList.length < 1) {
  1695. let dp = 40;
  1696. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1697. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1698. let dx = i < this.rectR ? i : this.rectR;
  1699. let dy = j < this.rectB ? j : this.rectB;
  1700. let order = xGame.tools.random(0, 1000);
  1701. this.posList.push({ x: dx, y: dy, order: order });
  1702. }
  1703. }
  1704. this.posList.sort(function (a, b) {
  1705. return a.order - b.order;
  1706. });
  1707. this.setMax = this.posList.length;
  1708. }
  1709. this.state = AIState.idle;
  1710. }
  1711. setAiLevel(num) {
  1712. this.aiLv = num;
  1713. }
  1714. initBall() {
  1715. this.rootPos.x = this.wBall.gameObj.x;
  1716. this.rootPos.y = this.wBall.gameObj.y;
  1717. this.initHoleBall();
  1718. }
  1719. initHoleBall() {
  1720. this.kickBall = [];
  1721. this.lineBall = [];
  1722. this.scoreBall = [];
  1723. this.holeBall = [];
  1724. this.selectNum = 0;
  1725. this.forceNum = 0;
  1726. this.forceMax = 0;
  1727. this.turnNum = 0;
  1728. let list = xGame.common.d2World.ballArr;
  1729. if (list.length < 20 && !this.isGuide) {
  1730. let holes = xGame.common.gameMgr.holePosList;
  1731. for (let i = 0; i < list.length; i++) {
  1732. let obj = list[i];
  1733. if (!obj)
  1734. continue;
  1735. obj.kickPos.x = 0;
  1736. obj.kickPos.y = 0;
  1737. obj.poleAngle = 0;
  1738. obj.hard = 0;
  1739. obj.borderDis = 0;
  1740. obj.kickAngle = 180;
  1741. if (obj.number == 0)
  1742. continue;
  1743. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1744. continue;
  1745. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1746. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1747. continue;
  1748. }
  1749. let b = obj.gameObj;
  1750. let wbp = this.rootPos;
  1751. let bx = wbp.x - b.x;
  1752. let by = wbp.y - b.y;
  1753. obj.borderDis = xGame.tools.random(0, 100);
  1754. this.kickBall.push(obj);
  1755. if (!this.isLine(wbp, obj))
  1756. continue;
  1757. obj.kickAngle = xGame.tools.random(90, 180);
  1758. obj.kickPos.x = b.x;
  1759. obj.kickPos.y = b.y;
  1760. this.lineBall.push(obj);
  1761. let minDis = 999999;
  1762. let hole = false;
  1763. for (let j = 0; j < holes.length; j++) {
  1764. let hp = holes[j];
  1765. if (bx >= 0 && hp.x > b.x + 100)
  1766. continue;
  1767. if (bx <= 0 && hp.x < b.x - 100)
  1768. continue;
  1769. if (by < -10 && hp.y < wbp.y)
  1770. continue;
  1771. if (by > 10 && hp.y > wbp.y)
  1772. continue;
  1773. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1774. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1775. if (dis < minDis) {
  1776. let dx = b.x - this.tempDir1.x * this.ballSize;
  1777. let dy = b.y - this.tempDir1.y * this.ballSize;
  1778. this.tempDir3.x = this.tempDir1.x;
  1779. this.tempDir3.y = this.tempDir1.y;
  1780. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1781. obj.kickPos.x = dx;
  1782. obj.kickPos.y = dy;
  1783. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1784. if (num > 1)
  1785. num = 1;
  1786. obj.kickAngle = Math.acos(num) * 57.3;
  1787. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1788. dis = dis * 2;
  1789. if (Math.abs(hp.x - 600) < 100)
  1790. dis += 50;
  1791. obj.hard = dis + obj.kickAngle * 3;
  1792. hole = true;
  1793. }
  1794. }
  1795. }
  1796. }
  1797. if (hole) {
  1798. this.scoreBall.push(obj);
  1799. this.holeBall.push(obj);
  1800. }
  1801. }
  1802. this.scoreBall.sort(function (a, b) {
  1803. return a.hard - b.hard;
  1804. });
  1805. this.holeBall.sort(function (a, b) {
  1806. return a.kickAngle - b.kickAngle;
  1807. });
  1808. this.kickBall.sort(function (a, b) {
  1809. return a.borderDis - b.borderDis;
  1810. });
  1811. }
  1812. else {
  1813. let max = list.length - 1;
  1814. let i = xGame.tools.random(0, max);
  1815. for (i; i <= max; i++) {
  1816. let idx = i >= max ? i -= max : i;
  1817. let obj = list[idx];
  1818. if (obj && obj.number != 0) {
  1819. obj.kickAngle = xGame.tools.random(90, 180);
  1820. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1821. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1822. this.lineBall.push(obj);
  1823. break;
  1824. }
  1825. }
  1826. }
  1827. }
  1828. selectBall() {
  1829. let ball = null;
  1830. this.destRot = 0;
  1831. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1832. let ai = 110 - this.aiLv * 10;
  1833. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1834. let score = false;
  1835. if (this.scoreBall.length < 1) {
  1836. if (this.lineBall.length < 1) {
  1837. for (let i = 0; i < this.kickBall.length; i++) {
  1838. let list = [];
  1839. let bo = this.kickBall[i];
  1840. let bobj = bo.gameObj;
  1841. let rect = xGame.common.d2World.borderRect;
  1842. let mobj = this.wBall.gameObj;
  1843. let minb = bobj.y - rect.y - 20;
  1844. let minw = mobj.y - rect.y - 50;
  1845. if (minb > 0 && minw > 0) {
  1846. let dlenx = 0;
  1847. let dleny = mobj.y - rect.y;
  1848. let spx = mobj.x;
  1849. let spy = rect.y - dleny;
  1850. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1851. }
  1852. minb = rect.y + rect.height - bobj.y - 20;
  1853. minw = rect.y + rect.height - mobj.y - 50;
  1854. if (minb > 0 && minw > 0) {
  1855. let dlenx = 0;
  1856. let dleny = rect.y + rect.height - mobj.y;
  1857. let spx = mobj.x;
  1858. let spy = rect.y + rect.height + dleny;
  1859. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1860. }
  1861. minb = bobj.x - rect.x - 20;
  1862. minw = mobj.x - rect.x - 50;
  1863. if (minb > 0 && minw > 0) {
  1864. let dlenx = mobj.x - rect.x;
  1865. let dleny = 0;
  1866. let spx = rect.x - dlenx;
  1867. let spy = mobj.y;
  1868. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1869. }
  1870. minb = rect.x + rect.width - bobj.x - 20;
  1871. minw = rect.x + rect.width - mobj.x - 50;
  1872. if (minb > 0 && minw > 0) {
  1873. let dlenx = rect.x + rect.width - mobj.x;
  1874. let dleny = 0;
  1875. let spx = rect.x + rect.width + dlenx;
  1876. let spy = mobj.y;
  1877. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1878. }
  1879. list.sort(function (a, b) {
  1880. return a.order - b.order;
  1881. });
  1882. for (let i = 0; i < list.length; i++) {
  1883. let data = list[i];
  1884. let mx = mobj.x - bobj.x;
  1885. let my = mobj.y - bobj.y;
  1886. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1887. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1888. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1889. if (num > 1)
  1890. num = 1;
  1891. let cos = Math.acos(num);
  1892. if (cos > 1.57)
  1893. cos = 1.57;
  1894. else if (cos < 0.01)
  1895. cos = 0.01;
  1896. let tan = Math.tan(cos);
  1897. let dx = tan * data.dleny;
  1898. let dy = tan * data.dlenx;
  1899. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1900. if (Math.abs(bx - 667) < 40)
  1901. continue;
  1902. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1903. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1904. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1905. this.forceMax = dis * 0.08;
  1906. this.destRot += mis * 0.1;
  1907. this.setKick(bx, by);
  1908. return true;
  1909. }
  1910. }
  1911. }
  1912. }
  1913. else {
  1914. ball = xGame.common.getRandArrEle(this.lineBall);
  1915. }
  1916. }
  1917. else {
  1918. for (let i = 0; i < this.scoreBall.length; i++) {
  1919. if (i < this.scoreBall.length - 1) {
  1920. let rand = 70 + this.aiLv * 10 + i * 10;
  1921. if (xGame.tools.random(0, 100) < rand) {
  1922. ball = this.scoreBall[i];
  1923. break;
  1924. }
  1925. }
  1926. else {
  1927. ball = this.scoreBall[i];
  1928. break;
  1929. }
  1930. }
  1931. score = true;
  1932. this.selectNum++;
  1933. }
  1934. if (!ball)
  1935. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1936. if (this.selectNum >= max) {
  1937. let dx = ball.gameObj.x;
  1938. let dy = ball.gameObj.y;
  1939. let kickAngle = 0;
  1940. if (score) {
  1941. dx = ball.kickPos.x;
  1942. dy = ball.kickPos.y;
  1943. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1944. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1945. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1946. if (adot > 1)
  1947. adot = 1;
  1948. kickAngle = Math.acos(adot) * 57.3;
  1949. if (kickAngle > 45) {
  1950. let kdx = ball.kickPos.x - ball.gameObj.x;
  1951. let kdy = ball.kickPos.y - ball.gameObj.y;
  1952. dx = ball.kickPos.x - kdx * mis * 0.3;
  1953. dy = ball.kickPos.y - kdy * mis * 0.3;
  1954. }
  1955. else
  1956. this.destRot += mis;
  1957. }
  1958. else if (ball.poleAngle != 0) {
  1959. this.destRot += ball.poleAngle;
  1960. }
  1961. if (xGame.common.gameMode == 0) {
  1962. let af = kickAngle * 0.08;
  1963. this.forceMax = ball.hard * 0.1 + af * af;
  1964. }
  1965. this.setKick(dx, dy);
  1966. }
  1967. else {
  1968. let rand = this.aiLv * 5 + 40;
  1969. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1970. ball = xGame.common.getRandArrEle(this.scoreBall);
  1971. else
  1972. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1973. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1974. if (xGame.tools.random(0, 100) > rand) {
  1975. this.selectNum = max;
  1976. }
  1977. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1978. this.selectNum++;
  1979. }
  1980. ball.onClick(0, true);
  1981. }
  1982. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1983. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1984. let balls = xGame.common.d2World.ballArr;
  1985. let max = xGame.tools.getDis(hx, hy, bx, by);
  1986. for (let index = 0; index < balls.length; index++) {
  1987. let obj = balls[index];
  1988. if (obj.number == 0)
  1989. continue;
  1990. if (obj.number == bn || obj.number == dn)
  1991. continue;
  1992. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  1993. if (dis * dis > max)
  1994. continue;
  1995. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  1996. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1997. if (num > 1)
  1998. num = 1;
  1999. if (num < 0)
  2000. continue;
  2001. let gap = Math.sin(Math.acos(num)) * dis;
  2002. if (gap < this.ballSize)
  2003. return true;
  2004. }
  2005. return false;
  2006. }
  2007. isLine(xy, ball) {
  2008. let bx = xy.x;
  2009. let by = xy.y;
  2010. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2011. let dis = ball.getDestDis(xy);
  2012. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2013. let sin = Math.sin(angle);
  2014. let cos = Math.cos(angle);
  2015. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2016. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2017. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2018. let dx = bx + this.tempDir2.x * dis;
  2019. let dy = by + this.tempDir2.y * dis;
  2020. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2021. sin = Math.sin(-angle);
  2022. cos = Math.cos(-angle);
  2023. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2024. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2025. dx = bx + this.tempDir2.x * dis;
  2026. dy = by + this.tempDir2.y * dis;
  2027. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2028. if (isr && isl)
  2029. return false;
  2030. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2031. }
  2032. return true;
  2033. }
  2034. turnPole() {
  2035. this.turnNum++;
  2036. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2037. let dr = rot - this.destRot;
  2038. let abs = Math.abs(dr) % 360;
  2039. if (abs > 180) {
  2040. if (rot > 180)
  2041. rot -= 360;
  2042. if (this.destRot > 180)
  2043. this.destRot -= 360;
  2044. }
  2045. let max = this.turnNum * 5 + this.aiLv * 5;
  2046. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2047. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2048. let at = xGame.tools.random(1000, 2000);
  2049. if (!this.onAway(3))
  2050. at += xGame.tools.random(10000, 15000);
  2051. this.setState(AIState.shoot, at);
  2052. }
  2053. else {
  2054. let mr = 0;
  2055. if (abs > 3)
  2056. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2057. else if (Math.random() > 0.6)
  2058. mr = xGame.tools.random(1, 10) * 0.1;
  2059. mr = dr > 0 ? -mr : mr;
  2060. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2061. }
  2062. }
  2063. setKick(dx, dy) {
  2064. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2065. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2066. this.tempDir1.x = 0;
  2067. this.tempDir1.y = 1;
  2068. this.tempDir2.y = -this.tempDir2.y;
  2069. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2070. if (num > 1)
  2071. num = 1;
  2072. let rot = Math.acos(num) * 57.3;
  2073. if (this.tempDir2.x < 0)
  2074. rot = 360 - rot;
  2075. this.destRot += rot;
  2076. if (!xGame.common.gameMgr.finishOneShoot) {
  2077. this.forceMax += xGame.tools.random(10, 50);
  2078. this.forceMax -= this.aiLv * 2;
  2079. if (this.forceMax < 20)
  2080. this.forceMax = 20;
  2081. }
  2082. if (this.forceMax > 100)
  2083. this.forceMax = 101;
  2084. else if (this.forceMax < 10)
  2085. this.forceMax += xGame.tools.random(0, 10);
  2086. if (xGame.common.gameMode == 1)
  2087. this.forceMax = xGame.tools.random(80, 100);
  2088. else
  2089. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2090. let max = 2000 - this.aiLv * 100;
  2091. if (Math.random() > 0.8)
  2092. max += xGame.tools.random(100, 2000);
  2093. this.setState(AIState.turn, xGame.tools.random(500, max));
  2094. }
  2095. shoot() {
  2096. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2097. if (Math.random() > 0.8) {
  2098. this.gameSrc.aiForce(1);
  2099. this.setState(AIState.wait);
  2100. }
  2101. }
  2102. else {
  2103. let df = xGame.tools.random(3, 8);
  2104. if (this.forceNum < this.forceMax)
  2105. this.forceNum += df;
  2106. else
  2107. this.forceNum -= df;
  2108. let startY = this.gameSrc.ui.powerNode.y;
  2109. let height = this.gameSrc.ui.powerNode.height;
  2110. let force = startY + height * this.forceNum * 0.01;
  2111. this.gameSrc.aiForce(2, force);
  2112. }
  2113. }
  2114. reset() {
  2115. for (let i = 0; i < 4; i++) {
  2116. this.setRate--;
  2117. this.setNum++;
  2118. let pos = this.posList[this.posIdx];
  2119. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2120. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2121. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2122. this.rootPos.x = 387;
  2123. if (this.rootPos.x < this.rectL)
  2124. this.rootPos.x = this.rectL;
  2125. else if (this.rootPos.x > this.rectR)
  2126. this.rootPos.x = this.rectR;
  2127. if (this.rootPos.y < this.rectT)
  2128. this.rootPos.y = this.rectT;
  2129. else if (this.rootPos.y > this.rectB)
  2130. this.rootPos.y = this.rectB;
  2131. this.posIdx++;
  2132. let max = this.posList.length;
  2133. if (this.posIdx >= max)
  2134. this.posIdx -= max;
  2135. this.initHoleBall();
  2136. let ball = null;
  2137. if (this.scoreBall.length > 0)
  2138. ball = this.scoreBall[0];
  2139. else if (this.lineBall.length > 0)
  2140. ball = xGame.common.getRandArrEle(this.lineBall);
  2141. if (ball && ball.kickAngle < this.bestAngle) {
  2142. this.bestAngle = ball.kickAngle;
  2143. this.bestKick.x = ball.kickPos.x;
  2144. this.bestKick.y = ball.kickPos.y;
  2145. this.bestPos.x = this.rootPos.x;
  2146. this.bestPos.y = this.rootPos.y;
  2147. this.bestForce = ball.hard * 0.08;
  2148. }
  2149. }
  2150. if (this.setNum >= this.setMax)
  2151. this.setMax = 0;
  2152. if (this.setRate < 1) {
  2153. this.setState(AIState.move, 0);
  2154. this.rootMoveTime = Laya.timer.currTimer;
  2155. this.gameSrc.aiRootMove(true);
  2156. }
  2157. }
  2158. delayLine() {
  2159. this.gameSrc.aiRootMove(false);
  2160. }
  2161. move() {
  2162. if (this.bestPos.x < 1)
  2163. this.bestPos = this.rootPos;
  2164. let wObj = this.wBall.gameObj;
  2165. let destx = wObj.x;
  2166. let desty = wObj.y;
  2167. let dx = Math.abs(destx - this.bestPos.x);
  2168. let dy = Math.abs(desty - this.bestPos.y);
  2169. let mx = 3 + dx * 0.03;
  2170. let my = 3 + dy * 0.03;
  2171. if (dx < 4 && dy < 4) {
  2172. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2173. dt = dt < 1000 ? 1000 - dt : 0;
  2174. if (this.setMax > 0) {
  2175. let min = this.setMax * 0.3 + this.aiLv * 5;
  2176. this.setRate = xGame.tools.random(min, this.setMax);
  2177. this.setState(AIState.reset, 0);
  2178. }
  2179. else {
  2180. this.destRot = 0;
  2181. this.forceMax = this.bestForce;
  2182. this.setKick(this.bestKick.x, this.bestKick.y);
  2183. }
  2184. if (dt > 100) {
  2185. Laya.timer.clear(this, this.delayLine);
  2186. Laya.timer.once(dt, this, this.delayLine);
  2187. }
  2188. else
  2189. this.gameSrc.aiRootMove(false);
  2190. }
  2191. else {
  2192. if (dx > 4)
  2193. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2194. if (dy > 4)
  2195. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2196. this.gameSrc.onRootMove({ x: destx, y: desty });
  2197. }
  2198. }
  2199. resetRoot() {
  2200. this.bestAngle = 180;
  2201. this.bestForce = 0;
  2202. this.setMax = this.posList.length;
  2203. this.posIdx = xGame.tools.random(0, this.setMax);
  2204. let min = this.setMax * 0.3 + this.aiLv * 5;
  2205. this.setRate = xGame.tools.random(min, this.setMax);
  2206. let max = 2000 - this.aiLv * 100;
  2207. if (Math.random() > 0.8)
  2208. max += xGame.tools.random(100, 1000);
  2209. if (this.isGuide)
  2210. this.setState(AIState.select, 500);
  2211. else if (this.onAway(2))
  2212. this.setState(AIState.reset, xGame.tools.random(400, max));
  2213. else
  2214. this.setState(AIState.none);
  2215. if (xGame.common.gameMgr.finishOneShoot)
  2216. this.chat();
  2217. }
  2218. runAI() {
  2219. if (this.state > AIState.idle)
  2220. return;
  2221. this.initBall();
  2222. this.onGame(2500);
  2223. if (Math.random() > 0.6)
  2224. this.chat();
  2225. }
  2226. stopRun() {
  2227. this.setState(AIState.idle);
  2228. }
  2229. onGame(base) {
  2230. let max = base - this.aiLv * 100;
  2231. if (Math.random() > 0.8)
  2232. max += xGame.tools.random(100, 1000);
  2233. if (this.onAway(2))
  2234. this.setState(AIState.select, xGame.tools.random(500, max));
  2235. else
  2236. this.setState(AIState.none);
  2237. }
  2238. setState(sta, wt = 0) {
  2239. if (this.state == AIState.none)
  2240. return;
  2241. this.state = sta;
  2242. this.waitTime = wt;
  2243. }
  2244. onUpdate() {
  2245. if (this.state == AIState.none)
  2246. return;
  2247. this.awayTime -= this.dtime;
  2248. if (this.awayTime < 1) {
  2249. this.awayTime = xGame.tools.random(6000, 10000);
  2250. this.awayNum += (11 - this.aiLv);
  2251. this.onAway(1);
  2252. }
  2253. if (this.waitTime >= 0) {
  2254. this.waitTime -= this.dtime;
  2255. return;
  2256. }
  2257. switch (this.state) {
  2258. case AIState.idle:
  2259. this.chat();
  2260. break;
  2261. case AIState.reset:
  2262. this.reset();
  2263. break;
  2264. case AIState.move:
  2265. this.move();
  2266. break;
  2267. case AIState.leave:
  2268. this.state = AIState.none;
  2269. xGame.common.gameMgr.aiGameEnd(true);
  2270. break;
  2271. case AIState.select:
  2272. this.selectBall();
  2273. break;
  2274. case AIState.turn:
  2275. this.turnPole();
  2276. break;
  2277. case AIState.shoot:
  2278. this.shoot();
  2279. break;
  2280. }
  2281. }
  2282. onAway(type) {
  2283. if (type == 1) {
  2284. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2285. let num = this.awayNum + db * 20;
  2286. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2287. xGame.common.gameMgr.aiLeave();
  2288. this.setState(AIState.leave, 6666);
  2289. }
  2290. }
  2291. else if (type == 2) {
  2292. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2293. let num = this.awayNum + db * 30;
  2294. if (xGame.tools.random(0, 10000) < num)
  2295. return false;
  2296. }
  2297. else if (type == 3) {
  2298. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2299. let num = this.awayNum + db * 10;
  2300. if (xGame.tools.random(0, 4000) < num)
  2301. return false;
  2302. }
  2303. return true;
  2304. }
  2305. chat() {
  2306. if (this.chatTime > 0) {
  2307. this.chatTime -= this.dtime;
  2308. return;
  2309. }
  2310. this.chatTime = xGame.tools.random(2000, 10000);
  2311. let rand = xGame.tools.random(0, 100);
  2312. if (rand < 15)
  2313. this.talk();
  2314. else if (rand < 35)
  2315. this.emotion();
  2316. }
  2317. talk() {
  2318. xGame.common.talkMgr.showAITalk(0);
  2319. }
  2320. emotion() {
  2321. xGame.common.talkMgr.showAIEmotion(0);
  2322. }
  2323. resetAI() {
  2324. this.stopRun();
  2325. this.state = AIState.none;
  2326. }
  2327. }
  2328. class Partical extends Laya.Script3D {
  2329. constructor() {
  2330. super();
  2331. this.duration = 2000;
  2332. }
  2333. ;
  2334. onAwake() {
  2335. this.gameObj = this.owner;
  2336. }
  2337. onEnable() {
  2338. this.openTimer();
  2339. }
  2340. openTimer() {
  2341. Laya.timer.once(this.duration, this, this.disappear);
  2342. }
  2343. setCallback(obj, callback) {
  2344. this.obj = obj;
  2345. this.callback = callback;
  2346. Laya.timer.clearAll(this);
  2347. Laya.timer.once(this.duration, this, this.disappear);
  2348. }
  2349. disappear() {
  2350. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2351. this.callback && this.callback(this.obj);
  2352. }
  2353. }
  2354. class Ball extends Laya.Script3D {
  2355. constructor() {
  2356. super();
  2357. this.posV3 = new Laya.Vector3();
  2358. this.rotRate = 2.1;
  2359. this.rotSpeed = new Laya.Vector3();
  2360. this.myIndex = 0;
  2361. }
  2362. onAwake() {
  2363. this.gameObj = this.owner;
  2364. this.transform = this.gameObj.transform;
  2365. this.ballNode = this.gameObj.getChildByName("Ball");
  2366. this.shadowNode = this.gameObj.getChildByName("shadow");
  2367. }
  2368. initSelf(index, x, y, owner) {
  2369. this.d2BallSrc = owner;
  2370. this.myIndex = index;
  2371. this.setAlbedoTexture();
  2372. this.setTransPos(x, y);
  2373. this.setScale();
  2374. this.ballNode.transform.localRotationEulerX = 90;
  2375. if (index == 0) {
  2376. }
  2377. }
  2378. setAlbedoTexture(isIce = false) {
  2379. let url;
  2380. if (isIce) {
  2381. url = `res/d3Res/ballTexture/ice.jpg`;
  2382. }
  2383. else {
  2384. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2385. }
  2386. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2387. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2388. }));
  2389. }
  2390. runFireworks(obj, delay, callback) {
  2391. Laya.timer.clearAll(this);
  2392. Laya.timer.once(delay + 1, this, () => {
  2393. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2394. fire.transform.localPositionX = this.transform.localPositionX;
  2395. fire.transform.localPositionY = this.transform.localPositionY;
  2396. fire.transform.localPositionZ = this.transform.localPositionZ;
  2397. let src = fire.getComponent(Partical);
  2398. src.duration = 1000;
  2399. src.setCallback(obj, callback);
  2400. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2401. eft.transform.localPositionX = this.transform.localPositionX;
  2402. eft.transform.localPositionY = this.transform.localPositionY;
  2403. eft.transform.localPositionZ = this.transform.localPositionZ;
  2404. });
  2405. }
  2406. setTransPos(x, y) {
  2407. this.setRotation();
  2408. xGame.common.pos2to3Convert(x, y, this.posV3);
  2409. this.transform.localPositionX = this.posV3.x;
  2410. this.transform.localPositionY = 0;
  2411. this.transform.localPositionZ = this.posV3.z;
  2412. this.transform.localRotationEulerX = 0;
  2413. this.transform.localRotationEulerY = 0;
  2414. this.transform.localRotationEulerZ = 0;
  2415. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2416. this.shadowNode.transform.localPositionY = 0.1;
  2417. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2418. }
  2419. setRotation() {
  2420. if (this.d2BallSrc.canRot) {
  2421. let speed = this.d2BallSrc.rigy.linearVelocity;
  2422. this.rotSpeed.x = speed.x * this.rotRate;
  2423. this.rotSpeed.z = speed.y * this.rotRate;
  2424. this.rotSpeed.y = this.d2BallSrc.rotY;
  2425. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2426. }
  2427. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2428. this.rotSpeed.x = this.rotSpeed.y = 0;
  2429. this.rotSpeed.y = this.d2BallSrc.rotY;
  2430. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2431. }
  2432. }
  2433. setScale() {
  2434. let radius = xGame.common.d2World.rootBall.ui.width;
  2435. let scale = xGame.common.scale2to3Convert(radius);
  2436. this.transform.localScaleX = scale;
  2437. this.transform.localScaleY = scale;
  2438. this.transform.localScaleZ = scale;
  2439. }
  2440. playInHoleEft() {
  2441. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2442. eft.transform.position = this.transform.position;
  2443. }
  2444. playIceEft() {
  2445. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2446. eft.transform.position = this.transform.position;
  2447. }
  2448. get scaleXYZ() {
  2449. return this.transform.localScaleX;
  2450. }
  2451. set scaleXYZ(val) {
  2452. this.transform.localScaleX = val;
  2453. this.transform.localScaleY = val;
  2454. this.transform.localScaleZ = val;
  2455. }
  2456. get posX() {
  2457. return this.transform.localPositionX;
  2458. }
  2459. set posX(val) {
  2460. this.transform.localPositionX = val;
  2461. }
  2462. get posY() {
  2463. return this.transform.localPositionY;
  2464. }
  2465. set posY(val) {
  2466. this.transform.localPositionY = val;
  2467. }
  2468. get posZ() {
  2469. return this.transform.localPositionZ;
  2470. }
  2471. set posZ(val) {
  2472. this.transform.localPositionZ = val;
  2473. }
  2474. destroySelf() {
  2475. this.posV3 = null;
  2476. this.rotSpeed = null;
  2477. this.d2BallSrc = null;
  2478. this.ballNode = null;
  2479. this.gameObj.destroy(true);
  2480. this.transform = null;
  2481. this.destroy();
  2482. }
  2483. }
  2484. class ui_D2Ball extends fgui.GComponent {
  2485. static createInstance() {
  2486. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2487. }
  2488. onConstruct() {
  2489. this.myIcon = (this.getChild("myIcon"));
  2490. this.inner = (this.getChild("inner"));
  2491. this.n8 = (this.getChild("n8"));
  2492. this.n4 = (this.getChild("n4"));
  2493. this.wrongTips = (this.getChild("wrongTips"));
  2494. this.rightTips = (this.getChild("rightTips"));
  2495. this.breathAni = this.getTransition("breathAni");
  2496. }
  2497. }
  2498. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2499. class D2BallSrc extends Laya.Script {
  2500. constructor() {
  2501. super();
  2502. this.number = 0;
  2503. this.startX = 0;
  2504. this.startY = 0;
  2505. this.angleV2 = new Laya.Vector2();
  2506. this.isRootBall = false;
  2507. this.isBlackBall = false;
  2508. this.ballType = "";
  2509. this.canRot = true;
  2510. this.rotY = 0;
  2511. this.poleAngle = 0;
  2512. this.kickPos = { x: 0, y: 0 };
  2513. this.hard = 0;
  2514. this.kickAngle = 0;
  2515. this.borderDis = 0;
  2516. this.speedP10 = 5.6;
  2517. this.lastSpeed = { x: 0, y: 0 };
  2518. this.stillSpeed = 0.12;
  2519. this.ballFunc = "normal";
  2520. this.isRunSkillAni = false;
  2521. this.isInHole = false;
  2522. this.iceOwner = "";
  2523. this.forceRun = false;
  2524. this.myUNID = "";
  2525. this.rectL = 0;
  2526. this.rectR = 0;
  2527. this.rectT = 0;
  2528. this.rectB = 0;
  2529. this.forceVec = new Laya.Vector2();
  2530. this.lastDis = 0;
  2531. this.helpOut = { type: "", x: 0, y: 0 };
  2532. }
  2533. initSelf(number, x, y, d3Ball) {
  2534. if (!this.gameObj)
  2535. this.gameObj = this.owner;
  2536. this.number = number;
  2537. this.startX = x;
  2538. this.startY = y;
  2539. this.d3Ball = d3Ball;
  2540. this.isRootBall = false;
  2541. this.isBlackBall = false;
  2542. this.ballType = "";
  2543. if (number == 0) {
  2544. this.isRootBall = true;
  2545. }
  2546. else if (number == 8) {
  2547. this.isBlackBall = true;
  2548. }
  2549. else {
  2550. if (number <= 7) {
  2551. this.ballType = ballCamp.full;
  2552. }
  2553. else {
  2554. this.ballType = ballCamp.flower;
  2555. }
  2556. }
  2557. this.setInfo();
  2558. this.setD3Ball();
  2559. this.owner["mySrc"] = this;
  2560. this.rigy.linearDamping = 1;
  2561. D2BallSrc._unid++;
  2562. this.myUNID = "d2ball" + D2BallSrc._unid;
  2563. let rect = xGame.common.d2World.borderRect;
  2564. this.rectL = Math.ceil(rect.x) + 20;
  2565. this.rectT = Math.ceil(rect.y) + 20;
  2566. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2567. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2568. }
  2569. setInfo() {
  2570. this.gameObj.x = this.startX;
  2571. this.gameObj.y = this.startY;
  2572. let radius = this.ui.width / 2;
  2573. this.gameObj.width = radius * 2;
  2574. this.gameObj.height = radius * 2;
  2575. if (xGame.common.showDebug) {
  2576. this.ui.myIcon.alpha = 1;
  2577. this.ui.inner.alpha = 1;
  2578. }
  2579. else {
  2580. this.ui.myIcon.alpha = 0;
  2581. this.ui.inner.alpha = 0;
  2582. }
  2583. }
  2584. setD3Ball() {
  2585. this.d3Ball = this.d3Ball;
  2586. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2587. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2588. }
  2589. onUpdate() {
  2590. if (xGame.common.gameMgr.gamePause)
  2591. return;
  2592. if (this.isInHole)
  2593. return;
  2594. if (!xGame.common.d2World.openCheckStill)
  2595. return;
  2596. this.runBall();
  2597. }
  2598. runBall() {
  2599. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2600. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2601. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2602. this.judgeBorder();
  2603. }
  2604. getDestDis(dest) {
  2605. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2606. }
  2607. setmyXY(x, y) {
  2608. this.d3BallSrc.setTransPos(x, y);
  2609. }
  2610. getSpeed() {
  2611. let speed = this.rigy.linearVelocity;
  2612. return speed.x * speed.x + speed.y * speed.y;
  2613. }
  2614. onTriggerEnter(collider) {
  2615. if (!collider || !collider.owner)
  2616. return;
  2617. let coll = "collide";
  2618. let speed = this.getSpeed();
  2619. let sv2 = this.speedP10 * this.speedP10;
  2620. if (collider.label == "ball") {
  2621. if (speed < 9 && this.number != 0)
  2622. coll = "";
  2623. else if (speed < sv2)
  2624. coll = "collide_4";
  2625. else if (speed < sv2 * 6.2)
  2626. coll = "collide_3";
  2627. else if (speed < sv2 * 25)
  2628. coll = "collide_2";
  2629. else if (speed < sv2 * 56)
  2630. coll = "collide_1";
  2631. xGame.soundMgr.playSound(coll);
  2632. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2633. if (collider.owner) {
  2634. let rig = collider.owner.getComponent(D2BallSrc);
  2635. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2636. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2637. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2638. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2639. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2640. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2641. let rx = 0;
  2642. let ry = 0;
  2643. if (this.gameObj.x < this.rectL)
  2644. rx = vx;
  2645. else if (this.gameObj.x > this.rectR)
  2646. rx = -vx;
  2647. else if (this.gameObj.y < this.rectT)
  2648. ry = vy;
  2649. else if (this.gameObj.y > this.rectB)
  2650. ry = -vy;
  2651. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2652. }
  2653. }
  2654. if (this.number != 0) {
  2655. return;
  2656. }
  2657. else {
  2658. if (this.forceRun) {
  2659. console.log("randon force");
  2660. this.applyForce(collider);
  2661. }
  2662. }
  2663. if (xGame.common.d2World.isOnSameLine) {
  2664. xGame.common.d2World.isOnSameLine = false;
  2665. this.rigy.linearVelocity = { x: 0, y: 0 };
  2666. }
  2667. if (xGame.common.gameMgr.firstColliObj == null) {
  2668. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2669. xGame.common.gameMgr.isTouchedBall = true;
  2670. }
  2671. }
  2672. else {
  2673. xGame.common.recoverCameraView();
  2674. let wallStr = "";
  2675. if (speed < 9) { }
  2676. else if (speed < sv2) { }
  2677. else if (speed < sv2 * 6.2)
  2678. wallStr = "wall_30";
  2679. else if (speed < sv2 * 25)
  2680. wallStr = "wall_50";
  2681. else if (speed < sv2 * 56)
  2682. wallStr = "wall_80";
  2683. xGame.soundMgr.playSound(wallStr);
  2684. }
  2685. }
  2686. applyForce(collider) {
  2687. let src = collider.owner.mySrc;
  2688. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2689. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2690. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2691. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2692. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2693. }
  2694. checkWrongBall(playEft = true) {
  2695. if (this.isInHole)
  2696. return;
  2697. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2698. if (this.number != 0 && playEft)
  2699. this.d3BallSrc.playInHoleEft();
  2700. let coll = "inpocket_1";
  2701. let speed = this.getSpeed();
  2702. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2703. if (speed < 9 && this.number != 0)
  2704. coll = "";
  2705. else if (speed < sv2 * 6.2)
  2706. coll = "inpocket_4";
  2707. else if (speed < sv2 * 25)
  2708. coll = "collide_3";
  2709. else if (speed < sv2 * 56)
  2710. coll = "collide_2";
  2711. xGame.soundMgr.playSound(coll);
  2712. this.isInHole = true;
  2713. if (this.number == 0) {
  2714. console.log("白球进了。。");
  2715. this.reset();
  2716. this.rigy.linearVelocity = { x: 0, y: 0 };
  2717. this.hideSelf();
  2718. xGame.common.gameUI.ui.whiteAni.visible = true;
  2719. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2720. xGame.common.gameUI.ui.whiteAni.visible = false;
  2721. }));
  2722. }
  2723. else {
  2724. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2725. xGame.common.d2World.removeOneBall(this);
  2726. this.destroySelf();
  2727. xGame.common.playHappySound(this.number);
  2728. this.runFlyEft();
  2729. }
  2730. }
  2731. runFlyEft() {
  2732. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2733. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2734. }
  2735. }
  2736. hideSelf() {
  2737. if (this.d3Ball)
  2738. this.d3Ball.active = false;
  2739. }
  2740. showSelf() {
  2741. this.isInHole = false;
  2742. if (this.d3Ball && !this.d3Ball.active)
  2743. this.d3Ball.active = true;
  2744. }
  2745. isStill() {
  2746. let speed = this.rigy.linearVelocity;
  2747. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2748. this.rigy.linearVelocity = { x: 0, y: 0 };
  2749. return true;
  2750. }
  2751. return false;
  2752. }
  2753. reset() {
  2754. }
  2755. destroySelf() {
  2756. this.d3BallSrc.destroySelf();
  2757. if (!this.ui.isDisposed) {
  2758. this.ui.removeFromParent();
  2759. this.ui.dispose();
  2760. this.ui = null;
  2761. }
  2762. this.outColli = null;
  2763. this.innerColli = null;
  2764. this.rigy = null;
  2765. this.d3Ball = null;
  2766. this.d3BallSrc = null;
  2767. this.angleV2 = null;
  2768. this.gameObj.destroy(true);
  2769. this.destroy();
  2770. }
  2771. judgeBorder() {
  2772. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2773. return;
  2774. }
  2775. if (this.destroyed)
  2776. return;
  2777. if (xGame.common.gameMode == GameMode.classic)
  2778. return;
  2779. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2780. if (isOver) {
  2781. this.checkWrongBall();
  2782. }
  2783. }
  2784. onClick(e, force = false) {
  2785. if (this.number == 0)
  2786. return;
  2787. if (force) {
  2788. }
  2789. else {
  2790. if (xGame.common.d2World.openCheckStill)
  2791. return;
  2792. if (!xGame.common.gameMgr.selfTurn) {
  2793. return;
  2794. }
  2795. }
  2796. if (!xGame.common.gameMgr.finishOneShoot)
  2797. return;
  2798. let root = xGame.common.d2World.rootBall.gameObj;
  2799. let x = this.gameObj.x - root.x;
  2800. let y = this.gameObj.y - root.y;
  2801. let angle = xGame.common.getfguiRotation(x, y);
  2802. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2803. xGame.common.d2World.getHelpLine();
  2804. xGame.common.clickedBall = true;
  2805. this.checkGuide();
  2806. }
  2807. checkGuide() {
  2808. let guide = DataMgr.getSkillGuide();
  2809. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2810. xGame.common.guideStep++;
  2811. xGame.common.gameUI.ui.guide1.visible = false;
  2812. xGame.common.gameUI.ui.guide2.visible = true;
  2813. }
  2814. }
  2815. checkDistance(disX, disY, angle) {
  2816. let diameter = this.gameObj.width - 1;
  2817. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2818. if (!this.lastDis)
  2819. this.lastDis = dis;
  2820. else {
  2821. if (dis > this.lastDis) {
  2822. this.helpOut.type = "remove";
  2823. return this.helpOut;
  2824. }
  2825. }
  2826. if (dis <= Math.pow(diameter, 2)) {
  2827. let del = 0.01;
  2828. let offest = 0;
  2829. let realX = disX - this.gameObj.x;
  2830. let realY = disY - this.gameObj.y;
  2831. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2832. offest += del;
  2833. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2834. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2835. }
  2836. this.helpOut.type = "ok";
  2837. this.helpOut.x = realX + this.gameObj.x;
  2838. this.helpOut.y = realY + this.gameObj.y;
  2839. return this.helpOut;
  2840. }
  2841. else {
  2842. this.helpOut.type = "no";
  2843. return this.helpOut;
  2844. }
  2845. }
  2846. clearBallEft() {
  2847. this.clearBallRightEft();
  2848. this.clearBallWrongEft();
  2849. }
  2850. clearBallRightEft() {
  2851. this.ui.breathAni.stop();
  2852. this.ui.rightTips.visible = false;
  2853. }
  2854. clearBallWrongEft() {
  2855. this.ui.wrongTips.visible = false;
  2856. }
  2857. showWrongEft() {
  2858. if (!xGame.common.gameMgr.selfTurn)
  2859. return;
  2860. this.ui.wrongTips.visible = true;
  2861. }
  2862. showRightEft() {
  2863. if (!xGame.common.gameMgr.selfTurn)
  2864. return;
  2865. this.ui.rightTips.visible = true;
  2866. this.ui.rightTips.scaleX = 1;
  2867. this.ui.rightTips.scaleY = 1;
  2868. this.ui.breathAni.play();
  2869. }
  2870. setBallFunc(type, owner) {
  2871. if (type == "ice") {
  2872. this.ballFunc = type;
  2873. this.d3BallSrc.setAlbedoTexture(true);
  2874. this.rigy.type = "static";
  2875. this.iceOwner = owner;
  2876. }
  2877. else {
  2878. if (owner == this.iceOwner) {
  2879. this.ballFunc = type;
  2880. this.d3BallSrc.setAlbedoTexture(false);
  2881. this.rigy.type = "dynamic";
  2882. }
  2883. }
  2884. }
  2885. }
  2886. D2BallSrc._unid = 0;
  2887. class D2RootBallSrc extends D2BallSrc {
  2888. constructor() {
  2889. super();
  2890. this.maxSpeed = 0;
  2891. this.classicMaxSpeed = 2.2;
  2892. this.bigSkillMaxSpeed = 4;
  2893. this.angle = 0;
  2894. this.allPercent = 0;
  2895. this.linearPercent = 0;
  2896. this.anglePercent = 0;
  2897. this.maxAngleRate = 0.6;
  2898. this.baseRot = 7;
  2899. this.angleMax = 0;
  2900. this.speed = new Laya.Vector2();
  2901. this.rotSpeed = new Laya.Vector2();
  2902. }
  2903. isStill() {
  2904. let speed = this.rigy.linearVelocity;
  2905. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2906. if (this.anglePercent <= 0.1) {
  2907. this.rigy.linearVelocity = { x: 0, y: 0 };
  2908. return true;
  2909. }
  2910. }
  2911. return false;
  2912. }
  2913. reset() {
  2914. this.linearPercent = 0;
  2915. this.anglePercent = 0;
  2916. }
  2917. setSpeed(percent, angle) {
  2918. this.allPercent = percent;
  2919. this.angle = angle;
  2920. this.setAngleSpeed();
  2921. this.setLinearSpeed();
  2922. let hit = "hit";
  2923. if (percent < 25)
  2924. hit = "hit03";
  2925. else if (percent < 50)
  2926. hit = "hit02";
  2927. else if (percent < 75)
  2928. hit = "hit01";
  2929. xGame.soundMgr.playSound(hit);
  2930. }
  2931. setAngleSpeed() {
  2932. let offest = xGame.common.rodOffest;
  2933. let radius = 82;
  2934. let rate = Math.abs(offest.y / radius) * 0.5;
  2935. if (offest.y > 0)
  2936. this.angleMax = -this.baseRot * 2;
  2937. else
  2938. this.angleMax = this.baseRot;
  2939. this.rotY = -offest.x / radius * 100;
  2940. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2941. this.linearPercent = this.allPercent - this.anglePercent;
  2942. }
  2943. setLinearSpeed() {
  2944. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2945. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2946. if (!xGame.common.longHelpLine) {
  2947. let offset = -150 + xGame.common.randomNum(0, 300);
  2948. offset /= 100;
  2949. this.angle += offset;
  2950. }
  2951. }
  2952. }
  2953. let sin = Math.sin(this.angle * Math.PI / 180);
  2954. let cos = Math.cos(this.angle * Math.PI / 180);
  2955. switch (xGame.common.gameMode) {
  2956. case GameMode.classic:
  2957. this.maxSpeed = this.classicMaxSpeed;
  2958. break;
  2959. case GameMode.bigMove:
  2960. this.maxSpeed = this.bigSkillMaxSpeed;
  2961. break;
  2962. case GameMode.placeBall:
  2963. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2964. if (data.type == 1) {
  2965. this.maxSpeed = this.bigSkillMaxSpeed;
  2966. }
  2967. else {
  2968. this.maxSpeed = this.classicMaxSpeed;
  2969. }
  2970. break;
  2971. default:
  2972. break;
  2973. }
  2974. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2975. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2976. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2977. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2978. this.rigy.applyLinearImpulseToCenter(this.speed);
  2979. }
  2980. onUpdate() {
  2981. if (this.anglePercent > 0.1) {
  2982. this.anglePercent *= 0.97;
  2983. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2984. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2985. this.rigy.applyForceToCenter(this.rotSpeed);
  2986. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  2987. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  2988. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  2989. if (num > 0.9)
  2990. this.canRot = true;
  2991. }
  2992. else
  2993. this.canRot = true;
  2994. if (Math.abs(this.rotY) > 0.1)
  2995. this.rotY *= 0.98;
  2996. super.onUpdate();
  2997. }
  2998. destroySelf() {
  2999. super.destroySelf();
  3000. this.speed = null;
  3001. }
  3002. }
  3003. class D2Ball extends Laya.Sprite {
  3004. constructor(isRootBall = false) {
  3005. super();
  3006. this.ui = ui_D2Ball.createInstance();
  3007. this.pivotX = this.ui.width / 2;
  3008. this.pivotY = this.ui.width / 2;
  3009. this.x = 0;
  3010. this.y = 0;
  3011. this.addChild(this.ui.displayObject);
  3012. this.ui.displayObject.x += this.ui.width / 2;
  3013. this.ui.displayObject.y += this.ui.width / 2;
  3014. if (isRootBall) {
  3015. this.d2Src = this.addComponent(D2RootBallSrc);
  3016. }
  3017. else {
  3018. this.d2Src = this.addComponent(D2BallSrc);
  3019. }
  3020. this.d2Src.ui = this.ui;
  3021. this.addCircleCollider();
  3022. this.addInnerCircleCollider();
  3023. this.addRigyBody();
  3024. }
  3025. addCircleCollider() {
  3026. let colli = xGame.common.getCollider("circle");
  3027. colli.radius = this.ui.width / 2;
  3028. this.addComponentIntance(colli);
  3029. this.d2Src.outColli = colli;
  3030. colli.label = "ball";
  3031. }
  3032. addInnerCircleCollider() {
  3033. let colli = xGame.common.getCollider("circle");
  3034. colli.radius = this.ui.inner.width / 2;
  3035. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3036. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3037. this.addComponentIntance(colli);
  3038. this.d2Src.innerColli = colli;
  3039. colli.label = "inner";
  3040. }
  3041. addRigyBody() {
  3042. let rigy = xGame.common.getRigbody();
  3043. rigy.type = "dynamic";
  3044. this.addComponentIntance(rigy);
  3045. this.d2Src.rigy = rigy;
  3046. }
  3047. disposeSelf() {
  3048. if (!this.ui.isDisposed) {
  3049. this.ui.dispose();
  3050. this.ui.removeFromParent();
  3051. this.ui = null;
  3052. }
  3053. }
  3054. }
  3055. class ui_D2Gan extends fgui.GComponent {
  3056. static createInstance() {
  3057. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3058. }
  3059. onConstruct() {
  3060. this.myIcon = (this.getChild("myIcon"));
  3061. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3062. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3063. this.self = (this.getChild("self"));
  3064. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3065. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3066. this.ai = (this.getChild("ai"));
  3067. }
  3068. }
  3069. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3070. class D2Gan {
  3071. constructor() {
  3072. this.offset = 0.15;
  3073. this.cell = 1.5;
  3074. this.onBallCell = 0.4;
  3075. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3076. this.moveNum = 70;
  3077. this.rulerRate = 0.1;
  3078. this.ui = ui_D2Gan.createInstance();
  3079. this.changeSelfRod();
  3080. this.changeAIRod();
  3081. }
  3082. changeSelfRod() {
  3083. let index = DataMgr.getCurBallRod();
  3084. let data = cfgTable.ballrodData[index + 1];
  3085. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3086. this.selfMySpine && this.selfMySpine.dispose();
  3087. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3088. if (data.spine) {
  3089. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3090. this.selfMySpine = new SpineMgr(data.spine, () => {
  3091. let xx = this.ui.selfEftRoot.width / 2;
  3092. let yy = this.ui.selfEftRoot.height / 2;
  3093. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3094. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3095. outSpine.rotation = -90;
  3096. });
  3097. }
  3098. }
  3099. changeAIRod() {
  3100. let length = Object.keys(cfgTable.ballrodData).length;
  3101. let rand = Math.floor(length * Math.random()) + 1;
  3102. let data = cfgTable.ballrodData[rand];
  3103. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3104. this.aiMySpine && this.aiMySpine.dispose();
  3105. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3106. if (data.spine) {
  3107. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3108. this.aiMySpine = new SpineMgr(data.spine, () => {
  3109. let xx = this.ui.aiEftRoot.width / 2;
  3110. let yy = this.ui.aiEftRoot.height / 2;
  3111. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3112. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3113. outSpine.rotation = -90;
  3114. });
  3115. }
  3116. }
  3117. setGanLastInfo() {
  3118. this.lastInfo.rotation = this.ui.rotation;
  3119. this.lastInfo.x = this.ui.x;
  3120. this.lastInfo.y = this.ui.y;
  3121. }
  3122. rotateSelf(flag, isRuler = false) {
  3123. let angle;
  3124. flag = flag * this.offset;
  3125. if (xGame.common.d2World.isHelpLineOnBall) {
  3126. angle = flag * this.onBallCell;
  3127. }
  3128. else {
  3129. angle = flag * this.cell;
  3130. }
  3131. if (isRuler) {
  3132. angle *= this.rulerRate;
  3133. }
  3134. this.ui.rotation += angle;
  3135. xGame.common.d2World.getHelpLine();
  3136. }
  3137. checkDistance() {
  3138. let target = xGame.common.d2World.targetBall;
  3139. let root = xGame.common.d2World.rootBall;
  3140. if (target == null) {
  3141. return 1;
  3142. }
  3143. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3144. if (dis <= 2500) {
  3145. return 5;
  3146. }
  3147. return 1;
  3148. }
  3149. rotDest(rot) {
  3150. this.ui.rotation = rot;
  3151. xGame.common.d2World.getHelpLine();
  3152. }
  3153. storagePower(powerNum) {
  3154. let pos = (powerNum / 100) * this.moveNum;
  3155. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3156. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3157. this.ui.x = this.lastInfo.x + xx;
  3158. this.ui.y = this.lastInfo.y + yy;
  3159. }
  3160. shoot() {
  3161. this.storagePower(0);
  3162. this.ui.visible = false;
  3163. }
  3164. destroySelf() {
  3165. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3166. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3167. this.selfMySpine && this.selfMySpine.dispose();
  3168. this.aiMySpine && this.aiMySpine.dispose();
  3169. this.lastInfo = null;
  3170. if (!this.ui.isDisposed) {
  3171. this.ui.removeFromParent();
  3172. this.ui.dispose();
  3173. }
  3174. }
  3175. }
  3176. class ui_HelpLine extends fgui.GComponent {
  3177. static createInstance() {
  3178. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3179. }
  3180. onConstruct() {
  3181. this.n10 = (this.getChild("n10"));
  3182. this.rect = (this.getChild("rect"));
  3183. this.dir11 = (this.getChild("dir11"));
  3184. this.dir = (this.getChild("dir"));
  3185. this.rootDir = (this.getChild("rootDir"));
  3186. this.dirDot = (this.getChild("dirDot"));
  3187. }
  3188. }
  3189. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3190. class D2HelpLine {
  3191. constructor() {
  3192. this.starX = 0;
  3193. this.starY = 0;
  3194. this.ui = ui_HelpLine.createInstance();
  3195. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3196. this.starX = this.ui.rect.x;
  3197. this.starY = this.ui.rect.y;
  3198. }
  3199. shoot() {
  3200. this.ui.visible = false;
  3201. }
  3202. destroySelf() {
  3203. if (this.ui.isDisposed) {
  3204. this.ui.removeFromParent();
  3205. this.ui.dispose();
  3206. }
  3207. }
  3208. }
  3209. class D2World extends Laya.Script {
  3210. constructor() {
  3211. super();
  3212. this.ballArr = [];
  3213. this.openCheckStill = false;
  3214. this.checkArr = [];
  3215. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3216. this.isHelpLineOnBall = false;
  3217. this.isOnSameLine = false;
  3218. this.reflectAngle = 0;
  3219. this.powerPercent = 0;
  3220. this.inHolesSpeed = [];
  3221. this.outDir = new Laya.Vector2();
  3222. this.rootDir = new Laya.Vector2();
  3223. this.aiLv = 0;
  3224. this.rootPos = new Laya.Vector2();
  3225. this.tempDir1 = new Laya.Vector2();
  3226. this.tempDir2 = new Laya.Vector2();
  3227. this.tempDir3 = new Laya.Vector2();
  3228. this.ballSize = 33;
  3229. this.destRot = 0;
  3230. }
  3231. initSelf() {
  3232. this.createBalls();
  3233. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3234. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3235. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3236. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3237. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3238. }
  3239. setBorderRect() {
  3240. let ui = xGame.common.gameUI.ui;
  3241. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3242. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3243. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3244. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3245. this.borderRect.x = starX;
  3246. this.borderRect.y = starY;
  3247. this.borderRect.width = width;
  3248. this.borderRect.height = height;
  3249. }
  3250. resetGame() {
  3251. this.openCheckStill = false;
  3252. let temp;
  3253. for (let index = 0; index < this.ballArr.length; index++) {
  3254. temp = this.ballArr[index];
  3255. temp.destroySelf();
  3256. }
  3257. xGame.common.d3World.ballRoot.destroyChildren();
  3258. xGame.common.gameUI.ui.ballNode.removeChildren();
  3259. console.log("进入摧毁逻辑");
  3260. this.d2Gan.destroySelf();
  3261. this.d2HelpLine.destroySelf();
  3262. this.ballArr = [];
  3263. }
  3264. setD2Gan() {
  3265. let ballNode = this.rootBall.ui;
  3266. let d2Gan = new D2Gan();
  3267. this.d2Gan = d2Gan;
  3268. let ganNode = d2Gan.ui;
  3269. ballNode.addChild(ganNode);
  3270. ganNode.pivotX = ganNode.pivotX;
  3271. ganNode.pivotY = ganNode.pivotY;
  3272. ganNode.x = ganNode.myIcon.width / 2;
  3273. ganNode.y = this.rootBall.gameObj.width;
  3274. d2Gan.setGanLastInfo();
  3275. }
  3276. setHelpLine() {
  3277. let d2Help = new D2HelpLine();
  3278. this.d2HelpLine = d2Help;
  3279. }
  3280. createBalls() {
  3281. let cfg;
  3282. switch (xGame.common.gameMode) {
  3283. case GameMode.classic:
  3284. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3285. break;
  3286. case GameMode.bigMove:
  3287. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3288. break;
  3289. case GameMode.placeBall:
  3290. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3291. break;
  3292. default:
  3293. break;
  3294. }
  3295. cfg = JSON.parse(JSON.stringify(cfg));
  3296. for (const key in cfg) {
  3297. if (cfg[key].value == 0) {
  3298. this.createRootBall(cfg[key]);
  3299. delete cfg[key];
  3300. break;
  3301. }
  3302. }
  3303. this.createOtherBalls(cfg);
  3304. }
  3305. createRootBall(data) {
  3306. let root = new D2Ball(true);
  3307. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3308. this.rootBall = root.d2Src;
  3309. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3310. let d3BallSrc = d3Ball.getComponent(Ball);
  3311. xGame.common.d3World.rootBall = d3Ball;
  3312. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3313. let xx = data.x;
  3314. let yy = data.y;
  3315. let numer = data.value;
  3316. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3317. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3318. this.ballArr.push(this.rootBall);
  3319. this.setD2Gan();
  3320. this.setHelpLine();
  3321. }
  3322. createOtherBalls(cfg) {
  3323. let temp;
  3324. let src;
  3325. let data;
  3326. for (const key in cfg) {
  3327. data = cfg[key];
  3328. temp = new D2Ball();
  3329. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3330. src = temp.d2Src;
  3331. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3332. src.initSelf(data.value, data.x, data.y, d3Ball);
  3333. this.ballArr.push(src);
  3334. }
  3335. }
  3336. shoot(percent) {
  3337. this.powerPercent = percent;
  3338. this.openCheckStill = true;
  3339. let d2Angle = this.d2Gan.ui.rotation;
  3340. this.rootBall.setSpeed(percent, d2Angle);
  3341. this.clearBallAllEft();
  3342. this.changePlayerView();
  3343. }
  3344. onUpdate() {
  3345. if (!this.openCheckStill)
  3346. return;
  3347. this.checkStill();
  3348. }
  3349. checkStill() {
  3350. for (let index = 0; index < this.ballArr.length; index++) {
  3351. if (!this.ballArr[index].isStill()) {
  3352. return;
  3353. }
  3354. }
  3355. xGame.eventMgr.event(ALL_BALL_STOP);
  3356. }
  3357. allBallStop() {
  3358. this.openCheckStill = false;
  3359. xGame.common.recoverCameraView();
  3360. }
  3361. waitShoot() {
  3362. if (!this.d2Gan.ui.isDisposed) {
  3363. this.d2Gan.ui.visible = true;
  3364. }
  3365. if (!this.d2HelpLine.ui.isDisposed) {
  3366. this.d2HelpLine.ui.visible = true;
  3367. }
  3368. this.clearBallAllEft();
  3369. this.showBallRightEft();
  3370. this.getHelpLine();
  3371. this.inHolesSpeed = [];
  3372. this.selectOneBall();
  3373. }
  3374. _getAllBallArr() {
  3375. let arr = this.ballArr;
  3376. let outArr = [];
  3377. for (let index = 0; index < arr.length; index++) {
  3378. if (arr[index] instanceof D2RootBallSrc)
  3379. continue;
  3380. if (arr[index].ballFunc == "ice")
  3381. continue;
  3382. if (arr[index].destroyed)
  3383. continue;
  3384. outArr.push(arr[index]);
  3385. }
  3386. return outArr;
  3387. }
  3388. _getBlackObj() {
  3389. let arr = this.ballArr;
  3390. for (let index = 0; index < arr.length; index++) {
  3391. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3392. return arr[index];
  3393. }
  3394. }
  3395. }
  3396. selectOneBall() {
  3397. let all = this._getAllBallArr();
  3398. let target;
  3399. switch (xGame.common.gameMode) {
  3400. case GameMode.classic:
  3401. if (xGame.common.gameMgr.selfTurn) {
  3402. let self = xGame.common.gameMgr.selfBallArr;
  3403. let black = this._getBlackObj();
  3404. if (xGame.common.gameMgr.ensureBallType) {
  3405. if (self.length > 0) {
  3406. let out = [];
  3407. for (let j = 0; j < all.length; j++) {
  3408. if (self.indexOf(all[j].number) > -1) {
  3409. out.push(all[j]);
  3410. }
  3411. }
  3412. target = this.selectBestEnterOne(out);
  3413. }
  3414. else {
  3415. target = this.selectBestEnterOne([black]);
  3416. }
  3417. }
  3418. else {
  3419. target = this.selectBestEnterOne(all);
  3420. }
  3421. }
  3422. else {
  3423. target = this.selectBestEnterOne(all);
  3424. }
  3425. break;
  3426. case GameMode.bigMove:
  3427. target = this.selectBestEnterOne(all);
  3428. break;
  3429. case GameMode.placeBall:
  3430. if (all.length > 0) {
  3431. target = this.selectBestEnterOne(all);
  3432. }
  3433. break;
  3434. default:
  3435. break;
  3436. }
  3437. if (target && !target.destroyed && target.onClick) {
  3438. target.onClick(0, true);
  3439. let num = -200 + xGame.common.randomNum(0, 400);
  3440. num /= 150;
  3441. if (xGame.common.longHelpLine) {
  3442. num = 0;
  3443. }
  3444. this.destRot += num;
  3445. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3446. }
  3447. }
  3448. removeOneBall(ball) {
  3449. for (let index = 0; index < this.ballArr.length; index++) {
  3450. if (this.ballArr[index].id == ball.id) {
  3451. this.ballArr.splice(index, 1);
  3452. break;
  3453. }
  3454. }
  3455. }
  3456. getHelpLine() {
  3457. this.d2HelpLine.ui.dirDot.visible = false;
  3458. this.isOnSameLine = false;
  3459. let startX = this.rootBall.gameObj.x;
  3460. let startY = this.rootBall.gameObj.y;
  3461. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3462. if (dis == null) {
  3463. this.d2HelpLine.ui.visible = false;
  3464. console.error("辅助线异常");
  3465. return;
  3466. }
  3467. this.d2HelpLine.ui.visible = true;
  3468. let angle = this.d2Gan.ui.rotation;
  3469. let radius = 16.5;
  3470. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3471. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3472. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3473. if (colliObj == null) {
  3474. this.getColliPos(disX, disY, radius, angle);
  3475. xGame.common.d2World.isHelpLineOnBall = false;
  3476. this.targetBall = null;
  3477. this.reflectAngle = 0;
  3478. this.showBallWrongEft();
  3479. }
  3480. else {
  3481. let target = colliObj.src;
  3482. let radius = 16.5;
  3483. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3484. dis1 = Math.sqrt(dis1);
  3485. let realDis = colliObj.disHon - dis1;
  3486. let dir = colliObj.dir;
  3487. let xx = startX + dir.x * realDis;
  3488. let yy = startY + dir.y * realDis;
  3489. this.getColliPos(xx, yy, radius, angle);
  3490. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3491. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3492. let offset = xGame.common.rodOffest;
  3493. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3494. this.isOnSameLine = true;
  3495. }
  3496. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3497. xGame.common.d2World.isHelpLineOnBall = true;
  3498. this.targetBall = target;
  3499. this.reflectAngle = reflectAngle;
  3500. this.showBallWrongEft();
  3501. if (xGame.common.longHelpLine) {
  3502. this.delayReflectLine(target, reflectAngle);
  3503. }
  3504. }
  3505. }
  3506. getBorderDot(startX, startY, angle) {
  3507. let radius = 17;
  3508. let distance;
  3509. let isDone;
  3510. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3511. isDone = this.judgeUpDown(distance, angle, startX);
  3512. if (isDone != null) {
  3513. return isDone;
  3514. }
  3515. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3516. isDone = this.judgeUpDown(distance, angle, startX);
  3517. if (isDone != null) {
  3518. return isDone;
  3519. }
  3520. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3521. isDone = this.judgeLeftRight(distance, angle, startY);
  3522. if (isDone != null) {
  3523. return isDone;
  3524. }
  3525. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3526. isDone = this.judgeLeftRight(distance, angle, startY);
  3527. if (isDone != null) {
  3528. return isDone;
  3529. }
  3530. }
  3531. judgeUpDown(distance, angle, startX) {
  3532. let flag = Math.sin(angle * Math.PI / 180);
  3533. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3534. if (distance >= 0) {
  3535. if (flag > 0) {
  3536. if (temp < this.borderRect.x + this.borderRect.width) {
  3537. return distance;
  3538. }
  3539. }
  3540. else {
  3541. if (temp > this.borderRect.x) {
  3542. return distance;
  3543. }
  3544. }
  3545. }
  3546. }
  3547. judgeLeftRight(distance, angle, starY) {
  3548. let flag = -Math.cos(angle * Math.PI / 180);
  3549. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3550. if (distance >= 0) {
  3551. if (flag > 0) {
  3552. if (temp < this.borderRect.y + this.borderRect.height) {
  3553. return distance;
  3554. }
  3555. }
  3556. else {
  3557. if (temp > this.borderRect.y) {
  3558. return distance;
  3559. }
  3560. }
  3561. }
  3562. }
  3563. clearBallAllEft() {
  3564. let temp;
  3565. for (let index = 0; index < this.ballArr.length; index++) {
  3566. temp = this.ballArr[index];
  3567. temp.clearBallEft();
  3568. }
  3569. }
  3570. showBallRightEft() {
  3571. let gameMgr = xGame.common.gameMgr;
  3572. let temp;
  3573. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3574. if (targetArr.length <= 0)
  3575. return;
  3576. for (let index = 0; index < this.ballArr.length; index++) {
  3577. temp = this.ballArr[index];
  3578. if (targetArr.indexOf(temp.number) > -1) {
  3579. temp.showRightEft();
  3580. }
  3581. }
  3582. }
  3583. showBallWrongEft() {
  3584. let gameMgr = xGame.common.gameMgr;
  3585. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3586. if (targetArr.length <= 0)
  3587. return;
  3588. let temp;
  3589. for (let index = 0; index < this.ballArr.length; index++) {
  3590. temp = this.ballArr[index];
  3591. if (this.targetBall && this.targetBall.number == temp.number) {
  3592. if (targetArr.indexOf(temp.number) <= -1) {
  3593. temp.showWrongEft();
  3594. }
  3595. else {
  3596. temp.clearBallWrongEft();
  3597. }
  3598. }
  3599. else {
  3600. temp.clearBallWrongEft();
  3601. }
  3602. }
  3603. }
  3604. getColliPos(x, y, radius, angle) {
  3605. this.d2HelpLine.ui.x = x;
  3606. this.d2HelpLine.ui.y = y;
  3607. let dirX = x - this.rootBall.gameObj.x;
  3608. let dirY = y - this.rootBall.gameObj.y;
  3609. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3610. if (rectH <= 0)
  3611. rectH = 0;
  3612. this.d2HelpLine.ui.rect.height = 0;
  3613. this.d2HelpLine.ui.rect.height = rectH;
  3614. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3615. if (rectH < this.rootBall.gameObj.width) {
  3616. this.d2HelpLine.ui.rect.visible = false;
  3617. }
  3618. else {
  3619. this.d2HelpLine.ui.rect.visible = true;
  3620. }
  3621. this.d2HelpLine.ui.dir.visible = false;
  3622. this.d2HelpLine.ui.rootDir.visible = false;
  3623. }
  3624. getReflectLine(x, y, radius, target) {
  3625. this.d2HelpLine.ui.dir.visible = true;
  3626. let dirX = target.x - x;
  3627. let dirY = target.y - y;
  3628. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3629. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3630. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3631. this.d2HelpLine.ui.dir.height = 48;
  3632. this.d2HelpLine.ui.dir.rotation = angle;
  3633. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3634. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3635. return angle;
  3636. }
  3637. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3638. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3639. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3640. let targetX = target.gameObj.x;
  3641. let targetY = target.gameObj.y;
  3642. this.outDir.setValue(targetX - xx, targetY - yy);
  3643. this.rootDir.setValue(rtX - xx, rtY - yy);
  3644. let ver = Math.PI / 2;
  3645. let sin = Math.sin(ver);
  3646. let cos = Math.cos(ver);
  3647. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3648. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3649. this.outDir.setValue(outX, outY);
  3650. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3651. Laya.Vector2.normalize(this.outDir, this.outDir);
  3652. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3653. if (Math.abs(result) <= 0.08) {
  3654. this.d2HelpLine.ui.rootDir.visible = false;
  3655. return;
  3656. }
  3657. if (result > 0) {
  3658. angle += 90;
  3659. }
  3660. else if (result < 0) {
  3661. angle -= 90;
  3662. }
  3663. this.d2HelpLine.ui.rootDir.visible = true;
  3664. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3665. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3666. this.d2HelpLine.ui.rootDir.rotation = angle;
  3667. }
  3668. delayReflectLine(obj, angle) {
  3669. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3670. return;
  3671. }
  3672. this.isOnSameLine = false;
  3673. let startX = obj.gameObj.x;
  3674. let startY = obj.gameObj.y;
  3675. let dis = this.getBorderDot(startX, startY, angle);
  3676. if (dis == null) {
  3677. this.d2HelpLine.ui.dirDot.visible = false;
  3678. return;
  3679. }
  3680. this.d2HelpLine.ui.visible = true;
  3681. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3682. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3683. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3684. if (colliObj == null) {
  3685. this.setDelayLine(disX, disY, obj, angle);
  3686. }
  3687. else {
  3688. let radius = 16;
  3689. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3690. dis1 = Math.sqrt(dis1);
  3691. let realDis = colliObj.disHon - dis1;
  3692. let dir = colliObj.dir;
  3693. let xx = startX + dir.x * realDis;
  3694. let yy = startY + dir.y * realDis;
  3695. this.setDelayLine(xx, yy, obj, angle);
  3696. }
  3697. }
  3698. setDelayLine(x, y, obj, angle) {
  3699. let dirX = x - obj.gameObj.x;
  3700. let dirY = y - obj.gameObj.y;
  3701. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3702. if (rectH <= 0)
  3703. rectH = 0;
  3704. this.d2HelpLine.ui.dir.height = rectH;
  3705. this.d2HelpLine.ui.dirDot.visible = true;
  3706. this.d2HelpLine.ui.dirDot.x = 17;
  3707. this.d2HelpLine.ui.dirDot.y = 17;
  3708. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3709. ;
  3710. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3711. }
  3712. changePlayerView() {
  3713. if (Math.random() >= 0.7)
  3714. return;
  3715. if (!this.targetBall) {
  3716. return;
  3717. }
  3718. if (!xGame.common.gameMgr.selfTurn)
  3719. return;
  3720. switch (xGame.common.gameMode) {
  3721. case GameMode.classic:
  3722. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3723. if (this.targetBall.number != 8) {
  3724. return;
  3725. }
  3726. }
  3727. break;
  3728. case GameMode.bigMove:
  3729. return;
  3730. case GameMode.placeBall:
  3731. break;
  3732. default:
  3733. break;
  3734. }
  3735. let startX = this.targetBall.gameObj.x;
  3736. let startY = this.targetBall.gameObj.y;
  3737. let angle = this.reflectAngle;
  3738. let dis = this.getBorderDot(startX, startY, angle);
  3739. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3740. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3741. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3742. if (colliObj) {
  3743. return;
  3744. }
  3745. let offset = 40;
  3746. let posObj = xGame.common.gameMgr.posObj;
  3747. let temp;
  3748. let radius;
  3749. let tarX, tarY;
  3750. for (const key in posObj) {
  3751. temp = posObj[key];
  3752. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3753. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3754. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3755. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3756. xGame.common.showOneCamera("angle" + key);
  3757. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3758. Laya.physicsTimer.scale = 0.7;
  3759. break;
  3760. }
  3761. }
  3762. }
  3763. selectBestEnterOne(arr) {
  3764. this.aiLv = xGame.tools.random(1, 11);
  3765. this.aiLv = 10;
  3766. this.wBall = xGame.common.d2World.rootBall;
  3767. this.rootPos.x = this.wBall.gameObj.x;
  3768. this.rootPos.y = this.wBall.gameObj.y;
  3769. this.initHoleBall(arr);
  3770. return this.selectBall();
  3771. }
  3772. selectBall() {
  3773. let ball = null;
  3774. this.destRot = 0;
  3775. let ai = 110 - this.aiLv * 10;
  3776. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3777. let score = false;
  3778. if (this.scoreBall.length < 1) {
  3779. if (this.lineBall.length < 1) {
  3780. for (let i = 0; i < this.kickBall.length; i++) {
  3781. let list = [];
  3782. let bo = this.kickBall[i];
  3783. let bobj = bo.gameObj;
  3784. let rect = xGame.common.d2World.borderRect;
  3785. let mobj = this.wBall.gameObj;
  3786. let minb = bobj.y - rect.y - 20;
  3787. let minw = mobj.y - rect.y - 50;
  3788. if (minb > 0 && minw > 0) {
  3789. let dlenx = 0;
  3790. let dleny = mobj.y - rect.y;
  3791. let spx = mobj.x;
  3792. let spy = rect.y - dleny;
  3793. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3794. }
  3795. minb = rect.y + rect.height - bobj.y - 20;
  3796. minw = rect.y + rect.height - mobj.y - 50;
  3797. if (minb > 0 && minw > 0) {
  3798. let dlenx = 0;
  3799. let dleny = rect.y + rect.height - mobj.y;
  3800. let spx = mobj.x;
  3801. let spy = rect.y + rect.height + dleny;
  3802. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3803. }
  3804. minb = bobj.x - rect.x - 20;
  3805. minw = mobj.x - rect.x - 50;
  3806. if (minb > 0 && minw > 0) {
  3807. let dlenx = mobj.x - rect.x;
  3808. let dleny = 0;
  3809. let spx = rect.x - dlenx;
  3810. let spy = mobj.y;
  3811. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3812. }
  3813. minb = rect.x + rect.width - bobj.x - 20;
  3814. minw = rect.x + rect.width - mobj.x - 50;
  3815. if (minb > 0 && minw > 0) {
  3816. let dlenx = rect.x + rect.width - mobj.x;
  3817. let dleny = 0;
  3818. let spx = rect.x + rect.width + dlenx;
  3819. let spy = mobj.y;
  3820. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3821. }
  3822. list.sort(function (a, b) {
  3823. return a.order - b.order;
  3824. });
  3825. for (let i = 0; i < list.length; i++) {
  3826. let data = list[i];
  3827. let mx = mobj.x - bobj.x;
  3828. let my = mobj.y - bobj.y;
  3829. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3830. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3831. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3832. if (num > 1)
  3833. num = 1;
  3834. let cos = Math.acos(num);
  3835. if (cos > 1.57)
  3836. cos = 1.57;
  3837. else if (cos < 0.01)
  3838. cos = 0.01;
  3839. let tan = Math.tan(cos);
  3840. let dx = tan * data.dleny;
  3841. let dy = tan * data.dlenx;
  3842. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3843. if (Math.abs(bx - 667) < 40)
  3844. continue;
  3845. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3846. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3847. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3848. this.forceMax = dis * 0.08;
  3849. this.destRot += mis * 0.1;
  3850. this.setKick(bx, by);
  3851. return true;
  3852. }
  3853. }
  3854. }
  3855. }
  3856. else {
  3857. ball = xGame.common.getRandArrEle(this.lineBall);
  3858. }
  3859. }
  3860. else {
  3861. for (let i = 0; i < this.scoreBall.length; i++) {
  3862. if (i < this.scoreBall.length - 1) {
  3863. let rand = 70 + this.aiLv * 10 + i * 10;
  3864. if (xGame.tools.random(0, 100) < rand) {
  3865. ball = this.scoreBall[i];
  3866. break;
  3867. }
  3868. }
  3869. else {
  3870. ball = this.scoreBall[i];
  3871. break;
  3872. }
  3873. }
  3874. score = true;
  3875. this.selectNum++;
  3876. }
  3877. if (!ball)
  3878. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3879. let dx = ball.gameObj.x;
  3880. let dy = ball.gameObj.y;
  3881. let kickAngle = 0;
  3882. if (score) {
  3883. dx = ball.kickPos.x;
  3884. dy = ball.kickPos.y;
  3885. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3886. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3887. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3888. if (adot > 1)
  3889. adot = 1;
  3890. kickAngle = Math.acos(adot) * 57.3;
  3891. if (kickAngle > 45) {
  3892. let kdx = ball.kickPos.x - ball.gameObj.x;
  3893. let kdy = ball.kickPos.y - ball.gameObj.y;
  3894. dx = ball.kickPos.x - kdx * mis * 0.3;
  3895. dy = ball.kickPos.y - kdy * mis * 0.3;
  3896. }
  3897. else
  3898. this.destRot += mis;
  3899. }
  3900. else if (ball.poleAngle != 0) {
  3901. this.destRot += ball.poleAngle;
  3902. }
  3903. if (xGame.common.gameMode == 0) {
  3904. let af = kickAngle * 0.08;
  3905. this.forceMax = ball.hard * 0.1 + af * af;
  3906. }
  3907. this.setKick(dx, dy);
  3908. return ball;
  3909. }
  3910. initHoleBall(arr) {
  3911. this.kickBall = [];
  3912. this.lineBall = [];
  3913. this.scoreBall = [];
  3914. this.holeBall = [];
  3915. this.selectNum = 0;
  3916. this.forceNum = 0;
  3917. this.forceMax = 0;
  3918. this.turnNum = 0;
  3919. let list = arr;
  3920. let holes = xGame.common.gameMgr.holePosList;
  3921. let self = xGame.common.aiPlayer;
  3922. for (let i = 0; i < list.length; i++) {
  3923. let obj = list[i];
  3924. if (!obj)
  3925. continue;
  3926. obj.kickPos.x = 0;
  3927. obj.kickPos.y = 0;
  3928. obj.poleAngle = 0;
  3929. obj.hard = 0;
  3930. obj.borderDis = 0;
  3931. obj.kickAngle = 180;
  3932. let b = obj.gameObj;
  3933. let wbp = this.rootPos;
  3934. let bx = wbp.x - b.x;
  3935. let by = wbp.y - b.y;
  3936. obj.borderDis = xGame.tools.random(0, 100);
  3937. this.kickBall.push(obj);
  3938. if (!this.isLine(wbp, obj))
  3939. continue;
  3940. obj.kickAngle = xGame.tools.random(90, 180);
  3941. obj.kickPos.x = b.x;
  3942. obj.kickPos.y = b.y;
  3943. this.lineBall.push(obj);
  3944. let minDis = 999999;
  3945. let hole = false;
  3946. for (let j = 0; j < holes.length; j++) {
  3947. let hp = holes[j];
  3948. if (bx >= 0 && hp.x > b.x + 100)
  3949. continue;
  3950. if (bx <= 0 && hp.x < b.x - 100)
  3951. continue;
  3952. if (by < -10 && hp.y < wbp.y)
  3953. continue;
  3954. if (by > 10 && hp.y > wbp.y)
  3955. continue;
  3956. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3957. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3958. if (dis < minDis) {
  3959. let dx = b.x - this.tempDir1.x * this.ballSize;
  3960. let dy = b.y - this.tempDir1.y * this.ballSize;
  3961. this.tempDir3.x = this.tempDir1.x;
  3962. this.tempDir3.y = this.tempDir1.y;
  3963. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3964. obj.kickPos.x = dx;
  3965. obj.kickPos.y = dy;
  3966. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3967. if (num > 1)
  3968. num = 1;
  3969. obj.kickAngle = Math.acos(num) * 57.3;
  3970. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3971. dis = dis * 2;
  3972. if (Math.abs(hp.x - 600) < 100)
  3973. dis += 50;
  3974. obj.hard = dis + obj.kickAngle * 3;
  3975. hole = true;
  3976. }
  3977. }
  3978. }
  3979. }
  3980. if (hole) {
  3981. this.scoreBall.push(obj);
  3982. this.holeBall.push(obj);
  3983. }
  3984. }
  3985. this.scoreBall.sort(function (a, b) {
  3986. return a.hard - b.hard;
  3987. });
  3988. this.holeBall.sort(function (a, b) {
  3989. return a.kickAngle - b.kickAngle;
  3990. });
  3991. this.kickBall.sort(function (a, b) {
  3992. return a.borderDis - b.borderDis;
  3993. });
  3994. }
  3995. isBlock(bn, bx, by, hx, hy, dn = -1) {
  3996. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  3997. let balls = xGame.common.d2World.ballArr;
  3998. let max = xGame.tools.getDis(hx, hy, bx, by);
  3999. for (let index = 0; index < balls.length; index++) {
  4000. let obj = balls[index];
  4001. if (obj.number == 0)
  4002. continue;
  4003. if (obj.number == bn || obj.number == dn)
  4004. continue;
  4005. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4006. if (dis * dis > max)
  4007. continue;
  4008. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4009. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4010. if (num > 1)
  4011. num = 1;
  4012. if (num < 0)
  4013. continue;
  4014. let gap = Math.sin(Math.acos(num)) * dis;
  4015. if (gap < this.ballSize)
  4016. return true;
  4017. }
  4018. return false;
  4019. }
  4020. isLine(xy, ball) {
  4021. let bx = xy.x;
  4022. let by = xy.y;
  4023. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4024. let dis = ball.getDestDis(xy);
  4025. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4026. let sin = Math.sin(angle);
  4027. let cos = Math.cos(angle);
  4028. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4029. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4030. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4031. let dx = bx + this.tempDir2.x * dis;
  4032. let dy = by + this.tempDir2.y * dis;
  4033. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4034. sin = Math.sin(-angle);
  4035. cos = Math.cos(-angle);
  4036. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4037. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4038. dx = bx + this.tempDir2.x * dis;
  4039. dy = by + this.tempDir2.y * dis;
  4040. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4041. if (isr && isl)
  4042. return false;
  4043. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4044. }
  4045. return true;
  4046. }
  4047. setKick(dx, dy) {
  4048. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4049. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4050. this.tempDir1.x = 0;
  4051. this.tempDir1.y = 1;
  4052. this.tempDir2.y = -this.tempDir2.y;
  4053. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4054. if (num > 1)
  4055. num = 1;
  4056. let rot = Math.acos(num) * 57.3;
  4057. if (this.tempDir2.x < 0)
  4058. rot = 360 - rot;
  4059. this.destRot += rot;
  4060. }
  4061. }
  4062. class ui_UIGame extends fgui.GComponent {
  4063. static createInstance() {
  4064. return (fgui.UIPackage.createObject("game", "UIGame"));
  4065. }
  4066. onConstruct() {
  4067. this.c1 = this.getController("c1");
  4068. this.d3Root = (this.getChild("d3Root"));
  4069. this.clickNode = (this.getChild("clickNode"));
  4070. this.d2Root = (this.getChild("d2Root"));
  4071. this.topNode = (this.getChild("topNode"));
  4072. this.n72 = (this.getChild("n72"));
  4073. this.n40 = (this.getChild("n40"));
  4074. this.rulerNode = (this.getChild("rulerNode"));
  4075. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4076. this.n50 = (this.getChild("n50"));
  4077. this.keduNode = (this.getChild("keduNode"));
  4078. this.powerTxt = (this.getChild("powerTxt"));
  4079. this.powerNode = (this.getChild("powerNode"));
  4080. this.colorNode = (this.getChild("colorNode"));
  4081. this.powerEft = (this.getChild("powerEft"));
  4082. this.myPowerNode = (this.getChild("myPowerNode"));
  4083. this.ganNode = (this.getChild("ganNode"));
  4084. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4085. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4086. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4087. this.skillRod = (this.getChild("skillRod"));
  4088. this.border = (this.getChild("border"));
  4089. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4090. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4091. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4092. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4093. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4094. this.guanyuNode = (this.getChild("guanyuNode"));
  4095. this.helpBtn = (this.getChild("helpBtn"));
  4096. this.wordsBtn = (this.getChild("wordsBtn"));
  4097. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4098. this.returnBtn = (this.getChild("returnBtn"));
  4099. this.ballNode = (this.getChild("ballNode"));
  4100. this.whiteAni = (this.getChild("whiteAni"));
  4101. this.blackAni = (this.getChild("blackAni"));
  4102. this.selfTurn = (this.getChild("selfTurn"));
  4103. this.aiTurn = (this.getChild("aiTurn"));
  4104. this.deskNode = (this.getChild("deskNode"));
  4105. this.moveNode = (this.getChild("moveNode"));
  4106. this.selfTalk = (this.getChild("selfTalk"));
  4107. this.aiTalk = (this.getChild("aiTalk"));
  4108. this.d2Node = (this.getChild("d2Node"));
  4109. this.snowNode = (this.getChild("snowNode"));
  4110. this.guide2 = (this.getChild("guide2"));
  4111. this.guide1 = (this.getChild("guide1"));
  4112. this.guide3 = (this.getChild("guide3"));
  4113. this.guideNode = (this.getChild("guideNode"));
  4114. }
  4115. }
  4116. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4117. class ui_UIGameEnd extends fgui.GComponent {
  4118. static createInstance() {
  4119. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4120. }
  4121. onConstruct() {
  4122. this.c1 = this.getController("c1");
  4123. this.n22 = (this.getChild("n22"));
  4124. this.n2 = (this.getChild("n2"));
  4125. this.n52 = (this.getChild("n52"));
  4126. this.n53 = (this.getChild("n53"));
  4127. this.coinNode = (this.getChild("coinNode"));
  4128. this.closeNode = (this.getChild("closeNode"));
  4129. this.moneyNode = (this.getChild("moneyNode"));
  4130. this.secretary = (this.getChild("secretary"));
  4131. this.n27 = (this.getChild("n27"));
  4132. this.n29 = (this.getChild("n29"));
  4133. this.talkNode = (this.getChild("talkNode"));
  4134. this.n38 = (this.getChild("n38"));
  4135. this.n39 = (this.getChild("n39"));
  4136. this.n40 = (this.getChild("n40"));
  4137. this.awardNode = (this.getChild("awardNode"));
  4138. this.starNumNode = (this.getChild("starNumNode"));
  4139. this.n47 = (this.getChild("n47"));
  4140. this.conditionNode = (this.getChild("conditionNode"));
  4141. this.isGetAward = (this.getChild("isGetAward"));
  4142. this.leftBtn = (this.getChild("leftBtn"));
  4143. this.rightBtn = (this.getChild("rightBtn"));
  4144. this.btnNode = (this.getChild("btnNode"));
  4145. }
  4146. }
  4147. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4148. class ui_UIAddCoin extends fgui.GComponent {
  4149. static createInstance() {
  4150. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4151. }
  4152. onConstruct() {
  4153. this.n11 = (this.getChild("n11"));
  4154. this.myNode = (this.getChild("myNode"));
  4155. this.t0 = this.getTransition("t0");
  4156. }
  4157. }
  4158. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4159. class UIAddCoin extends UIBase {
  4160. constructor() {
  4161. super();
  4162. this.coinNum = 2000;
  4163. }
  4164. onConstructor() {
  4165. this.ui = ui_UIAddCoin.createInstance();
  4166. this.contentPane = this.ui;
  4167. this.isEject = false;
  4168. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4169. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4170. }
  4171. show() {
  4172. super.show();
  4173. this.ui.t0.play();
  4174. }
  4175. videoAddCoin() {
  4176. console.log('zh:qjff_AD_for_UIAddCoin');
  4177. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4178. }
  4179. else {
  4180. console.log('zh:AD 失败,直接发放奖励');
  4181. this.qjff_AD_for_UIAddCoin();
  4182. }
  4183. }
  4184. qjff_AD_for_UIAddCoin() {
  4185. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4186. this.hide();
  4187. }
  4188. }
  4189. UIAddCoin.uiName = "UIAddCoin";
  4190. class ui_UIInvitation extends fgui.GComponent {
  4191. static createInstance() {
  4192. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4193. }
  4194. onConstruct() {
  4195. this.n14 = (this.getChild("n14"));
  4196. this.myNode = (this.getChild("myNode"));
  4197. this.t0 = this.getTransition("t0");
  4198. }
  4199. }
  4200. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4201. class UIInvitation extends UIBase {
  4202. constructor() {
  4203. super();
  4204. }
  4205. onConstructor() {
  4206. this.ui = ui_UIInvitation.createInstance();
  4207. this.contentPane = this.ui;
  4208. this.isEject = false;
  4209. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4210. }
  4211. show() {
  4212. super.show();
  4213. }
  4214. enterGame() {
  4215. xGame.common.gameMode = GameMode.classic;
  4216. DataMgr.setChallengeTimes(1);
  4217. xGame.common.passAwardCoin = 2000;
  4218. let need = xGame.common.classicNiceNeddCoin;
  4219. if (DataMgr.coinEnough(need)) {
  4220. DataMgr.setCoin(-need);
  4221. xGame.eventMgr.event(RESTART_GAME, true);
  4222. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4223. }
  4224. else {
  4225. xGame.eventMgr.event(RESTART_GAME, true);
  4226. }
  4227. this.hide();
  4228. }
  4229. hide() {
  4230. super.hide();
  4231. }
  4232. }
  4233. UIInvitation.uiName = "UIInvitation";
  4234. class ui_UIMain extends fgui.GComponent {
  4235. static createInstance() {
  4236. return (fgui.UIPackage.createObject("game", "UIMain"));
  4237. }
  4238. onConstruct() {
  4239. this.n47 = (this.getChild("n47"));
  4240. this.n10 = (this.getChild("n10"));
  4241. this.secretary = (this.getChild("secretary"));
  4242. this.shopBtn = (this.getChild("shopBtn"));
  4243. this.moneyNode = (this.getChild("moneyNode"));
  4244. this.headNode = (this.getChild("headNode"));
  4245. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4246. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4247. this.classicBtn = (this.getChild("classicBtn"));
  4248. this.globalBtn = (this.getChild("globalBtn"));
  4249. this.n44 = (this.getChild("n44"));
  4250. this.signBtn = (this.getChild("signBtn"));
  4251. this.drawBtn = (this.getChild("drawBtn"));
  4252. this.settingNode = (this.getChild("settingNode"));
  4253. this.n45 = (this.getChild("n45"));
  4254. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4255. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4256. this.rankBtn = (this.getChild("rankBtn"));
  4257. this.n46 = (this.getChild("n46"));
  4258. this.liucheng1 = (this.getChild("liucheng1"));
  4259. this.rightBtn = (this.getChild("rightBtn"));
  4260. this.n75 = (this.getChild("n75"));
  4261. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4262. this.liucheng2 = (this.getChild("liucheng2"));
  4263. this.guideBtn = (this.getChild("guideBtn"));
  4264. this.n73 = (this.getChild("n73"));
  4265. this.wordsNode = (this.getChild("wordsNode"));
  4266. this.enterGuide = (this.getChild("enterGuide"));
  4267. this.talkNode = (this.getChild("talkNode"));
  4268. this.n83 = (this.getChild("n83"));
  4269. this.n84 = (this.getChild("n84"));
  4270. }
  4271. }
  4272. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4273. class ui_UIMoyu extends fgui.GComponent {
  4274. static createInstance() {
  4275. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4276. }
  4277. onConstruct() {
  4278. this.ageTip = (this.getChild("ageTip"));
  4279. this.mainBg = (this.getChild("mainBg"));
  4280. this.xyNode = (this.getChild("xyNode"));
  4281. this.rnNode = (this.getChild("rnNode"));
  4282. this.fcmNode = (this.getChild("fcmNode"));
  4283. this.ageNode = (this.getChild("ageNode"));
  4284. this.tipNode = (this.getChild("tipNode"));
  4285. this.msgNode = (this.getChild("msgNode"));
  4286. }
  4287. }
  4288. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4289. class MoyuMgr {
  4290. static initMoyu() {
  4291. this.moyuView = new MoyuView();
  4292. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4293. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4294. this.moyuView.ui.displayObject.zOrder = 1000;
  4295. this.moyuView.init();
  4296. this.moyuView.showTip(true);
  4297. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4298. window['XApk'] = this;
  4299. }
  4300. static showAge(show) {
  4301. if (this.moyuView)
  4302. this.moyuView.showAge(show);
  4303. }
  4304. static onPlatMsg(idx) {
  4305. if (!MoyuMgr.moyuView)
  4306. return;
  4307. if (idx == '0') {
  4308. MoyuMgr.moyuView.showTip(false);
  4309. }
  4310. }
  4311. static showAgree(call) {
  4312. if (this.moyuView)
  4313. this.moyuView.showAgree(call);
  4314. else
  4315. call && call();
  4316. }
  4317. static showXy(type = 1) {
  4318. if (this.moyuView)
  4319. this.moyuView.showXy(type);
  4320. }
  4321. }
  4322. MoyuMgr.isAdvise = false;
  4323. class MoyuView {
  4324. constructor() {
  4325. this.ysxyNum = 1;
  4326. this.ysJson = null;
  4327. this.ui = ui_UIMoyu.createInstance();
  4328. }
  4329. init() {
  4330. this.ui.mainBg.visible = false;
  4331. this.ui.xyNode.visible = false;
  4332. this.ui.ageNode.visible = false;
  4333. this.ui.tipNode.visible = false;
  4334. this.ui.rnNode.visible = false;
  4335. this.ui.fcmNode.visible = false;
  4336. this.ui.ageTip.visible = false;
  4337. this.ui.msgNode.visible = false;
  4338. this.ui.visible = false;
  4339. this.ui.xyNode.xyList.setVirtual();
  4340. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4341. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4342. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4343. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4344. this.ui.xyNode.btnKnown.visible = false;
  4345. this.ui.xyNode.xy1.visible = false;
  4346. this.ui.xyNode.xy2.visible = false;
  4347. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4348. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4349. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4350. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4351. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4352. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4353. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4354. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4355. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4356. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4357. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4358. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4359. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4360. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4361. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4362. this.ysxyNum = 2;
  4363. }
  4364. }
  4365. onClick(obj) {
  4366. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4367. switch (obj) {
  4368. case this.ui.ageTip:
  4369. if (Moyu.isTTApk) {
  4370. this.ui.ageNode.visible = true;
  4371. this.ui.mainBg.visible = true;
  4372. }
  4373. break;
  4374. case this.ui.tipNode:
  4375. this.showTip(false);
  4376. break;
  4377. case this.ui.ageNode.btnAge:
  4378. this.ui.ageNode.visible = false;
  4379. this.ui.mainBg.visible = false;
  4380. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4381. this.ui.visible = false;
  4382. break;
  4383. case this.ui.xyNode.btnXy3:
  4384. case this.ui.xyNode.btnXy1:
  4385. this.loadXy(1);
  4386. break;
  4387. case this.ui.xyNode.btnXy2:
  4388. this.loadXy(2);
  4389. break;
  4390. case this.ui.xyNode.btnBack:
  4391. this.ui.xyNode.xy1.visible = true;
  4392. this.ui.xyNode.xy2.visible = false;
  4393. break;
  4394. case this.ui.xyNode.btnKnown:
  4395. this.ui.xyNode.visible = false;
  4396. this.ui.mainBg.visible = false;
  4397. this.ui.visible = false;
  4398. break;
  4399. case this.ui.rnNode.btnCheck:
  4400. this.check();
  4401. break;
  4402. case this.ui.rnNode.btnExit:
  4403. case this.ui.xyNode.btnNo:
  4404. this.ysxyNum--;
  4405. if (this.ysxyNum > 0)
  4406. this.showMsg("Refuse to quit the game once again");
  4407. else {
  4408. Moyu.userAgree(false);
  4409. Moyu.exit();
  4410. }
  4411. break;
  4412. case this.ui.xyNode.btnSure:
  4413. case this.ui.xyNode.btnYes:
  4414. DataMgr.userData.isAgree = true;
  4415. DataMgr.saveUserData();
  4416. this.onAgree();
  4417. break;
  4418. case this.ui.rnNode.btnDone:
  4419. this.ui.rnNode.visible = false;
  4420. this.ui.visible = false;
  4421. break;
  4422. case this.ui.fcmNode.btnRn:
  4423. this.showRn();
  4424. break;
  4425. }
  4426. }
  4427. showTip(show) {
  4428. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4429. return;
  4430. if (show) {
  4431. MoyuMgr.isAdvise = true;
  4432. this.ui.visible = true;
  4433. this.ui.tipNode.visible = true;
  4434. this.ui.tipNode.alpha = 1;
  4435. Laya.timer.once(1000, this, this.showTip, [false]);
  4436. }
  4437. else {
  4438. this.ui.tipNode.alpha = 1;
  4439. this.ui.tipNode.visible = true;
  4440. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4441. this.ui.tipNode.visible = false;
  4442. MoyuMgr.isAdvise = false;
  4443. }), 1000);
  4444. }
  4445. }
  4446. showAge(show, px = 0, py = 0) {
  4447. if (Moyu.platType > 10 && !Moyu.isIos) {
  4448. this.ui.ageTip.x = px;
  4449. this.ui.ageTip.y = py;
  4450. this.ui.ageTip.visible = show;
  4451. if (show)
  4452. this.ui.visible = true;
  4453. }
  4454. }
  4455. showAgree(call) {
  4456. this.agreeCall = call;
  4457. this.onAgree();
  4458. return;
  4459. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4460. this.showXy(0);
  4461. }
  4462. else
  4463. this.onAgree();
  4464. }
  4465. onAgree() {
  4466. if (!this.ui.ageNode.visible)
  4467. this.ui.visible = false;
  4468. this.ui.xyNode.visible = false;
  4469. Moyu.userAgree(true);
  4470. this.showAge(false);
  4471. this.agreeCall && this.agreeCall();
  4472. this.showRn();
  4473. }
  4474. showMsg(txt) {
  4475. this.ui.msgNode.txtMsg.text = txt;
  4476. this.ui.msgNode.visible = true;
  4477. this.ui.msgNode.alpha = 1;
  4478. this.ui.visible = true;
  4479. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4480. this.ui.msgNode.visible = false;
  4481. }), 2500, true);
  4482. }
  4483. showRn() {
  4484. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4485. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4486. this.ui.rnNode.rn1.visible = true;
  4487. this.ui.rnNode.rn2.visible = false;
  4488. this.ui.rnNode.rn3.visible = false;
  4489. this.ui.rnNode.rn4.visible = false;
  4490. this.ui.rnNode.visible = true;
  4491. this.ui.mainBg.visible = true;
  4492. this.ui.rnNode.btnDone.visible = false;
  4493. this.ui.rnNode.btnExit.visible = true;
  4494. this.ui.rnNode.btnCheck.visible = true;
  4495. this.ui.fcmNode.visible = false;
  4496. this.ui.visible = true;
  4497. return;
  4498. }
  4499. }
  4500. this.showFcm();
  4501. }
  4502. showFcm() {
  4503. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4504. Moyu.initFCM(true);
  4505. if (Moyu.gameTime < 1)
  4506. this.fcmLoop();
  4507. else if (Moyu.gameTime < 999)
  4508. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4509. }
  4510. }
  4511. fcmLoop() {
  4512. if (Moyu.gameTime < 1) {
  4513. this.ui.rnNode.visible = false;
  4514. this.ui.fcmNode.visible = true;
  4515. this.ui.mainBg.visible = true;
  4516. this.ui.visible = true;
  4517. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4518. Laya.timer.clear(this.ui, this.fcmLoop);
  4519. }
  4520. }
  4521. check() {
  4522. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4523. this.ui.rnNode.rn1.visible = false;
  4524. this.ui.rnNode.rn2.visible = false;
  4525. this.ui.rnNode.rn4.visible = true;
  4526. }
  4527. else if (this.ui.rnNode.rn4.visible) {
  4528. let name = this.ui.rnNode.inputName.text;
  4529. let code = this.ui.rnNode.inputCode.text;
  4530. if (code && code.length == 18) {
  4531. this.ui.rnNode.rn1.visible = false;
  4532. this.ui.rnNode.rn4.visible = false;
  4533. Moyu.authenticate(name, code, (res) => {
  4534. this.ui.rnNode.rn2.visible = !res;
  4535. this.ui.rnNode.rn3.visible = res;
  4536. this.ui.rnNode.btnDone.visible = res;
  4537. this.ui.rnNode.btnExit.visible = !res;
  4538. this.ui.rnNode.btnCheck.visible = !res;
  4539. if (res)
  4540. this.showFcm();
  4541. });
  4542. }
  4543. else
  4544. this.showMsg("信息填写不完整");
  4545. }
  4546. }
  4547. loadXy(type = 0) {
  4548. this.ui.xyNode.xy1.visible = false;
  4549. this.ui.xyNode.xy2.visible = true;
  4550. this.ui.xyNode.xyList.scrollToView(0);
  4551. if (type == 1) {
  4552. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4553. }
  4554. else if (type == 2) {
  4555. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4556. }
  4557. }
  4558. showXy(type = 0) {
  4559. this.xyBtn();
  4560. if (type == 0) {
  4561. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4562. this.ui.xyNode.btnSure.visible = true;
  4563. }
  4564. else {
  4565. this.ui.xyNode.btnYes.visible = true;
  4566. this.ui.xyNode.btnNo.visible = true;
  4567. }
  4568. }
  4569. else {
  4570. this.ui.xyNode.btnKnown.visible = true;
  4571. this.ui.mainBg.visible = true;
  4572. }
  4573. this.ui.xyNode.xy1.visible = true;
  4574. this.ui.xyNode.xy2.visible = false;
  4575. this.ui.xyNode.visible = true;
  4576. this.ui.visible = true;
  4577. }
  4578. xyBtn() {
  4579. this.ui.xyNode.btnSure.visible = false;
  4580. this.ui.xyNode.btnYes.visible = false;
  4581. this.ui.xyNode.btnNo.visible = false;
  4582. this.ui.xyNode.btnKnown.visible = false;
  4583. {
  4584. this.ui.xyNode.btnXy3.visible = false;
  4585. this.ui.xyNode.btnXy2.visible = true;
  4586. this.ui.xyNode.btnXy1.visible = true;
  4587. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4588. }
  4589. }
  4590. createXY(json) {
  4591. this.ysJson = json.content;
  4592. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4593. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4594. this.ui.xyNode.xy2.visible = true;
  4595. }
  4596. renderListItem(idx, cell) {
  4597. let xy = this.ysJson[idx];
  4598. cell.height = xy.line * 30;
  4599. cell.xyItem.text = xy.text;
  4600. }
  4601. onDestroy() {
  4602. this.agreeCall = null;
  4603. }
  4604. }
  4605. class SettingNode {
  4606. constructor(ui) {
  4607. this.showSetting = false;
  4608. this.openSound = true;
  4609. this.openShake = true;
  4610. this.ui = ui;
  4611. this.ui.soundBtn.onClick(this, this.switchSound);
  4612. this.ui.shakeBtn.onClick(this, this.switchShake);
  4613. this.ui.xyBtn.onClick(this, this.onXy);
  4614. this.ui.clickNode.onClick(this, this.changeSetting);
  4615. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4616. this.ui.xyBtn.visible = false;
  4617. this.ui.shakeBtn.visible = false;
  4618. }
  4619. changeSetting() {
  4620. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4621. this.showSetting = !this.showSetting;
  4622. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4623. }
  4624. switchSound() {
  4625. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4626. this.openSound = !this.openSound;
  4627. Moyu.onSetting(this.openSound, this.openShake);
  4628. xGame.soundMgr.onSetting(this.openSound);
  4629. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4630. }
  4631. switchShake() {
  4632. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4633. this.openShake = !this.openShake;
  4634. Moyu.onSetting(this.openSound, this.openShake);
  4635. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4636. }
  4637. onXy() {
  4638. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4639. MoyuMgr.showXy(1);
  4640. }
  4641. }
  4642. class ui_UILevelDisplay extends fgui.GComponent {
  4643. static createInstance() {
  4644. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4645. }
  4646. onConstruct() {
  4647. this.n9 = (this.getChild("n9"));
  4648. this.myNode = (this.getChild("myNode"));
  4649. this.closeNode = (this.getChild("closeNode"));
  4650. }
  4651. }
  4652. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4653. class ui_UILevelProp extends fgui.GComponent {
  4654. static createInstance() {
  4655. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4656. }
  4657. onConstruct() {
  4658. this.n16 = (this.getChild("n16"));
  4659. this.myNode = (this.getChild("myNode"));
  4660. this.closeBtn = (this.getChild("closeBtn"));
  4661. this.moneyNode = (this.getChild("moneyNode"));
  4662. this.t1 = this.getTransition("t1");
  4663. }
  4664. }
  4665. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4666. class ui_ShowItem extends fgui.GComponent {
  4667. static createInstance() {
  4668. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4669. }
  4670. onConstruct() {
  4671. this.myImg = (this.getChild("myImg"));
  4672. }
  4673. }
  4674. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4675. class ShowItem {
  4676. constructor() {
  4677. this.ui = ui_ShowItem.createInstance();
  4678. }
  4679. destroySelf() {
  4680. if (!this.ui.isDisposed) {
  4681. this.ui.removeFromParent();
  4682. this.ui.dispose();
  4683. }
  4684. }
  4685. setParent(parent) {
  4686. parent.addChild(this.ui);
  4687. }
  4688. setPos(x, y) {
  4689. this.ui.x = x;
  4690. this.ui.y = y;
  4691. }
  4692. setUrl(index) {
  4693. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4694. }
  4695. }
  4696. class ui_UIPower extends fgui.GComponent {
  4697. static createInstance() {
  4698. return (fgui.UIPackage.createObject("game", "UIPower"));
  4699. }
  4700. onConstruct() {
  4701. this.n11 = (this.getChild("n11"));
  4702. this.myNode = (this.getChild("myNode"));
  4703. this.t0 = this.getTransition("t0");
  4704. }
  4705. }
  4706. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4707. class UIPower extends UIBase {
  4708. constructor() {
  4709. super();
  4710. }
  4711. onConstructor() {
  4712. this.ui = ui_UIPower.createInstance();
  4713. this.contentPane = this.ui;
  4714. this.isEject = false;
  4715. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4716. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4717. }
  4718. show() {
  4719. super.show();
  4720. this.ui.t0.play();
  4721. }
  4722. videoGetPower() {
  4723. console.log('zh:qjff_AD_for_uipower');
  4724. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4725. }
  4726. else {
  4727. console.log('zh:AD 失败,直接发放奖励');
  4728. this.qjff_AD_for_uipower();
  4729. }
  4730. }
  4731. qjff_AD_for_uipower() {
  4732. DataMgr.setPower(xGame.common.videoPower, true);
  4733. xGame.eventMgr.event(POWER_TIME);
  4734. this.hide();
  4735. }
  4736. }
  4737. UIPower.uiName = "UIPower";
  4738. class LocalStorageManager {
  4739. test1() {
  4740. LocalStorageManager.setItem("playerName", "Tom");
  4741. LocalStorageManager.setItem("playerLevel", 5);
  4742. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  4743. const name = LocalStorageManager.getItem("playerName");
  4744. const level = LocalStorageManager.getItem("playerLevel");
  4745. const data = LocalStorageManager.getItem("playerData");
  4746. console.log(name);
  4747. console.log(level);
  4748. console.log(data);
  4749. LocalStorageManager.removeItem("playerLevel");
  4750. }
  4751. static setItem(key, value) {
  4752. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  4753. }
  4754. static getItem(key) {
  4755. const data = Laya.LocalStorage.getItem(key);
  4756. if (data === null)
  4757. return null;
  4758. try {
  4759. return JSON.parse(data);
  4760. }
  4761. catch (e) {
  4762. return data;
  4763. }
  4764. }
  4765. static removeItem(key) {
  4766. Laya.LocalStorage.removeItem(key);
  4767. }
  4768. static clear() {
  4769. Laya.LocalStorage.clear();
  4770. }
  4771. static hasJosnKey(key) {
  4772. var value = Laya.LocalStorage.getJSON(key);
  4773. if (value != null) {
  4774. return true;
  4775. }
  4776. else {
  4777. return false;
  4778. }
  4779. }
  4780. static hasKey(key) {
  4781. return Laya.LocalStorage.getItem(key) !== null;
  4782. }
  4783. }
  4784. class UILevelProp extends UIBase {
  4785. constructor() {
  4786. super();
  4787. this.firstPos = 385;
  4788. this.secondPos = 467;
  4789. this.showItemArr = [];
  4790. }
  4791. onFontLoaded() {
  4792. try {
  4793. this.ui.myNode.conditionTxt.font = "arial";
  4794. console.log("zh: onFontLoaded 设置arial字体成功");
  4795. }
  4796. catch (error) {
  4797. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4798. }
  4799. }
  4800. onConstructor() {
  4801. this.ui = ui_UILevelProp.createInstance();
  4802. this.contentPane = this.ui;
  4803. this.isEject = false;
  4804. this.addUIClick(this.ui.closeBtn, this.hide);
  4805. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4806. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4807. }
  4808. show(level) {
  4809. super.show();
  4810. this.ui.t1.play();
  4811. this.level = level;
  4812. this.data = cfgTable.placeballData[this.level];
  4813. this.updateSelf();
  4814. this.showPreView();
  4815. this.moneyNode.ui.c1.selectedIndex = 2;
  4816. this.moneyNode.checkPowerTime();
  4817. this.moneyNode.powerChange();
  4818. }
  4819. showPreView() {
  4820. let item;
  4821. let data;
  4822. for (let index = 0; index < this.showItemArr.length; index++) {
  4823. item = this.showItemArr[index];
  4824. item.destroySelf();
  4825. }
  4826. this.showItemArr = [];
  4827. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4828. for (const key in cfgData) {
  4829. data = cfgData[key];
  4830. item = new ShowItem();
  4831. item.setParent(this.ui.myNode.displayRoot);
  4832. item.setPos(data.x, data.y);
  4833. item.setUrl(data.value);
  4834. this.showItemArr.push(item);
  4835. }
  4836. }
  4837. updateSelf() {
  4838. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4839. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4840. if (this.data.ball == -1) {
  4841. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4842. }
  4843. else {
  4844. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4845. }
  4846. let localData = DataMgr.getPlaceBallLevel(this.level);
  4847. let getAward = localData.getAward;
  4848. let cfg = cfgTable.placeballData[this.level];
  4849. let coin = this.data.award[0];
  4850. let diamond = this.data.award[1];
  4851. if (cfg.type == PlaceBallType.challenge) {
  4852. diamond = 0;
  4853. coin = 100;
  4854. }
  4855. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4856. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4857. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4858. if (cfg.type == PlaceBallType.challenge) {
  4859. this.ui.myNode.coinNode.numTxt.text = "";
  4860. }
  4861. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4862. if (coin > 0 && diamond > 0) {
  4863. this.ui.myNode.diamondNode.x = 385;
  4864. this.ui.myNode.coinNode.x = 467;
  4865. }
  4866. else {
  4867. this.ui.myNode.diamondNode.x = 385;
  4868. this.ui.myNode.coinNode.x = 385;
  4869. }
  4870. if (!getAward) {
  4871. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4872. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4873. }
  4874. else {
  4875. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4876. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4877. }
  4878. }
  4879. startGame() {
  4880. if (DataMgr.powerEnough()) {
  4881. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  4882. this.ui.myNode.startBtn.touchable = false;
  4883. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4884. console.log('zh:startGame ');
  4885. this.ui.myNode.startBtn.touchable = true;
  4886. DataMgr.setPower(-1);
  4887. xGame.eventMgr.event(POWER_TIME);
  4888. xGame.common.gameMode = GameMode.placeBall;
  4889. xGame.common.placeBallCurLevel = this.level;
  4890. xGame.uiMgr.Show(UIGame);
  4891. this.logEventForChallenge_level_start(this.level);
  4892. xGame.uiMgr.Hide(UILevelDisplay);
  4893. xGame.uiMgr.Hide(UIMain);
  4894. this.hide();
  4895. }));
  4896. }
  4897. else {
  4898. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  4899. xGame.uiMgr.Show(UIPower);
  4900. }
  4901. }
  4902. logEventForChallenge_level_start(level) {
  4903. let keyStr = 'sjmd_challenge_level_start';
  4904. let jsonStr = {
  4905. "count": 0,
  4906. "gold_balance ": DataMgr.getCoin(),
  4907. "level": level,
  4908. "diamond_balance ": DataMgr.getDiamond()
  4909. };
  4910. if (LocalStorageManager.hasJosnKey(keyStr)) {
  4911. const d = LocalStorageManager.getItem(keyStr);
  4912. if (level > d.level) {
  4913. jsonStr.count = d.count + 1;
  4914. LocalStorageManager.setItem(keyStr, jsonStr);
  4915. }
  4916. else {
  4917. }
  4918. }
  4919. else {
  4920. LocalStorageManager.setItem(keyStr, jsonStr);
  4921. }
  4922. const reqStr = JSON.stringify(jsonStr);
  4923. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  4924. }
  4925. hide() {
  4926. super.hide();
  4927. }
  4928. }
  4929. UILevelProp.uiName = "UILevelProp";
  4930. class PutBallLevelDisplay {
  4931. constructor(ui, index) {
  4932. this.index = 0;
  4933. this.ui = ui;
  4934. this.index = index;
  4935. this.ui.onClick(this, this.clickSelf);
  4936. this.updateSelf();
  4937. this.ui.levelTxt.text = (this.index + 1) + "";
  4938. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4939. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4940. }
  4941. updateSelf() {
  4942. let level = this.index + 1;
  4943. this.data = DataMgr.getPlaceBallLevel(level);
  4944. this.ui.starNode.c1.selectedIndex = this.data.star;
  4945. let isChallenge = cfgTable.placeballData[level].type;
  4946. if (this.data.isCur) {
  4947. if (isChallenge) {
  4948. this.ui.c1.selectedIndex = 5;
  4949. }
  4950. else {
  4951. this.ui.c1.selectedIndex = 2;
  4952. }
  4953. }
  4954. else {
  4955. if (this.data.play) {
  4956. if (this.data.star == 3) {
  4957. this.ui.c1.selectedIndex = 0;
  4958. }
  4959. else {
  4960. this.ui.c1.selectedIndex = 1;
  4961. }
  4962. }
  4963. else {
  4964. if (isChallenge) {
  4965. this.ui.c1.selectedIndex = 4;
  4966. }
  4967. else {
  4968. this.ui.c1.selectedIndex = 3;
  4969. }
  4970. }
  4971. }
  4972. }
  4973. clickSelf() {
  4974. if (!this.data.play)
  4975. return;
  4976. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4977. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4978. }
  4979. }
  4980. class UILevelDisplay extends UIBase {
  4981. constructor() {
  4982. super();
  4983. }
  4984. onConstructor() {
  4985. this.ui = ui_UILevelDisplay.createInstance();
  4986. this.contentPane = this.ui;
  4987. this.isEject = false;
  4988. this.myList = this.ui.myNode.myList;
  4989. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4990. this.levelItemArr = [];
  4991. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4992. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4993. this.myList.numItems = levelNum;
  4994. if (Moyu.isKs)
  4995. this.ui.closeNode.closeBtn.x += 100;
  4996. }
  4997. levelItemRender(index, target) {
  4998. let item = new PutBallLevelDisplay(target, index);
  4999. this.levelItemArr.push(item);
  5000. }
  5001. show() {
  5002. super.show();
  5003. this.updateLevel();
  5004. this.scrollToPlace();
  5005. }
  5006. updateLevel() {
  5007. let temp;
  5008. for (let index = 0; index < this.levelItemArr.length; index++) {
  5009. temp = this.levelItemArr[index];
  5010. temp.updateSelf();
  5011. }
  5012. }
  5013. scrollToPlace() {
  5014. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5015. let passArr = DataMgr.getPlaceBallLevelList();
  5016. let offest = passArr.length;
  5017. if (offest >= maxNum - 1)
  5018. offest = maxNum - 1;
  5019. this.myList.scrollToView(offest, true, true);
  5020. }
  5021. hide() {
  5022. super.hide();
  5023. }
  5024. }
  5025. UILevelDisplay.uiName = "UILevelDisplay";
  5026. class ui_UIMatching extends fgui.GComponent {
  5027. static createInstance() {
  5028. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5029. }
  5030. onConstruct() {
  5031. this.n5 = (this.getChild("n5"));
  5032. this.n49 = (this.getChild("n49"));
  5033. this.n51 = (this.getChild("n51"));
  5034. this.n64 = (this.getChild("n64"));
  5035. this.n2 = (this.getChild("n2"));
  5036. this.n53 = (this.getChild("n53"));
  5037. this.n54 = (this.getChild("n54"));
  5038. this.n56 = (this.getChild("n56"));
  5039. this.n58 = (this.getChild("n58"));
  5040. this.n59 = (this.getChild("n59"));
  5041. this.n57 = (this.getChild("n57"));
  5042. this.n60 = (this.getChild("n60"));
  5043. this.n62 = (this.getChild("n62"));
  5044. this.awardTxt = (this.getChild("awardTxt"));
  5045. this.n61 = (this.getChild("n61"));
  5046. this.selfHead = (this.getChild("selfHead"));
  5047. this.aiHead = (this.getChild("aiHead"));
  5048. this.n82 = (this.getChild("n82"));
  5049. this.n84 = (this.getChild("n84"));
  5050. this.n83 = (this.getChild("n83"));
  5051. this.t1 = this.getTransition("t1");
  5052. this.t2 = this.getTransition("t2");
  5053. this.t3 = this.getTransition("t3");
  5054. this.t4 = this.getTransition("t4");
  5055. }
  5056. }
  5057. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5058. class UIMatching extends UIBase {
  5059. constructor() {
  5060. super();
  5061. }
  5062. onConstructor() {
  5063. this.ui = ui_UIMatching.createInstance();
  5064. this.contentPane = this.ui;
  5065. this.isEject = false;
  5066. }
  5067. show(callback) {
  5068. super.show();
  5069. PlatMgr.showBanner(true);
  5070. this.callback = callback;
  5071. let user = Moyu.getUserInfo();
  5072. if (!this.selfPot) {
  5073. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5074. }
  5075. if (!this.aiPot) {
  5076. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5077. }
  5078. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5079. this.ui.selfHead.nameTxt.text = user.nickName;
  5080. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5081. this.ui.aiHead.nameTxt.text = "???";
  5082. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5083. this.ui.selfHead.c1.selectedIndex = 0;
  5084. this.ui.aiHead.c1.selectedIndex = 0;
  5085. this.ui.selfHead.x = this.selfPot.x;
  5086. this.ui.selfHead.y = this.selfPot.y;
  5087. this.ui.aiHead.x = this.aiPot.x;
  5088. this.ui.aiHead.y = this.aiPot.y;
  5089. switch (xGame.common.gameMode) {
  5090. case GameMode.classic:
  5091. break;
  5092. case GameMode.bigMove:
  5093. this.initSkillData();
  5094. break;
  5095. default:
  5096. break;
  5097. }
  5098. this.ui.t1.play(Laya.Handler.create(this, () => {
  5099. this.ui.t2.play(Laya.Handler.create(this, () => {
  5100. switch (xGame.common.gameMode) {
  5101. case GameMode.classic:
  5102. this.waitingPeople();
  5103. break;
  5104. case GameMode.bigMove:
  5105. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5106. break;
  5107. default:
  5108. break;
  5109. }
  5110. }));
  5111. }));
  5112. }
  5113. initSkillData() {
  5114. this.skillSelectData = [];
  5115. let skillUrl = xGame.common.skillIconList;
  5116. let skillName = xGame.common.skillNameList;
  5117. let skillLevel = DataMgr.getBigSkillList();
  5118. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5119. for (let index = 0; index < 5; index++) {
  5120. let obj = {};
  5121. obj.skillImg = skillUrl[index];
  5122. obj.skillName = skillName[index];
  5123. obj.skillType = skillType[index];
  5124. obj.skillLevel = skillLevel[index];
  5125. this.skillSelectData.push(obj);
  5126. }
  5127. }
  5128. getAISkillLevel(myLevel) {
  5129. let video = xGame.common.upSkillLevel;
  5130. let aiLevel;
  5131. let temp;
  5132. if (video) {
  5133. temp = xGame.common.randomNum(-2, -1);
  5134. }
  5135. else {
  5136. if (myLevel <= 5) {
  5137. temp = xGame.common.randomNum(1, 3);
  5138. }
  5139. else if (myLevel <= 9) {
  5140. temp = xGame.common.randomNum(-2, 1);
  5141. }
  5142. else {
  5143. temp = xGame.common.randomNum(-4, 0);
  5144. }
  5145. }
  5146. aiLevel = temp + myLevel;
  5147. if (aiLevel <= 1)
  5148. aiLevel = 1;
  5149. if (aiLevel >= 10)
  5150. aiLevel = 10;
  5151. return aiLevel;
  5152. }
  5153. getAISkillType() {
  5154. return xGame.common.randomNum(1, 4);
  5155. let successTimes = DataMgr.getSkillSuccessTimes();
  5156. let info = cfgTable.aiskillData[successTimes];
  5157. if (!info) {
  5158. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5159. info = cfgTable.aiskillData[max];
  5160. }
  5161. let dataArr = info.skillselect;
  5162. let myCfg = {};
  5163. for (let index = 0; index < dataArr.length; index++) {
  5164. let temp = dataArr[index].split('-');
  5165. myCfg[temp[0]] = {};
  5166. myCfg[temp[0]].id = parseInt(temp[0]);
  5167. myCfg[temp[0]].weight = parseInt(temp[1]);
  5168. }
  5169. let aiCfg = xGame.common.initWeight(myCfg);
  5170. let curData = xGame.common.getRandomWeightData(aiCfg);
  5171. return parseInt(curData.id);
  5172. }
  5173. getAISkillData(index) {
  5174. let myLevel = this.skillSelectData[index].skillLevel;
  5175. let aiLevel = this.getAISkillLevel(myLevel);
  5176. let aiType = this.getAISkillType() - 1;
  5177. return { aiLevel, aiType } = { aiLevel, aiType };
  5178. }
  5179. skillSelectFinish(index) {
  5180. let aiInfo = this.getAISkillData(index);
  5181. xGame.common.gameMgr.selfCurSkill = index;
  5182. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5183. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5184. this.ui.selfHead.c1.selectedIndex = 1;
  5185. this.ui.aiHead.c1.selectedIndex = 1;
  5186. let myData = this.skillSelectData[index];
  5187. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5188. let guide = DataMgr.getSkillGuide();
  5189. if (guide == 0) {
  5190. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5191. }
  5192. else {
  5193. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5194. }
  5195. let aiData = this.skillSelectData[aiInfo.aiType];
  5196. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5197. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5198. this.waitingPeople();
  5199. }
  5200. waitingPeople() {
  5201. let time = xGame.common.randomNum(1000, 3000);
  5202. time += 1000;
  5203. Laya.timer.once(time, this, () => {
  5204. this.matchingSuccess();
  5205. });
  5206. }
  5207. matchingSuccess() {
  5208. let gameUI = xGame.common.gameUI;
  5209. let name = gameUI.ui.topNode.aiNameTxt.text;
  5210. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5211. this.ui.aiHead.nameTxt.text = name;
  5212. this.ui.aiHead.headImg.url = url;
  5213. name = gameUI.ui.topNode.selfNameTxt.text;
  5214. url = gameUI.ui.topNode.selfHeadLoader.url;
  5215. this.ui.selfHead.nameTxt.text = name;
  5216. this.ui.selfHead.headImg.url = url;
  5217. this.ui.t3.play(Laya.Handler.create(this, () => {
  5218. this.callback && this.callback();
  5219. this.ui.t4.play(Laya.Handler.create(this, () => {
  5220. this.destroySelf();
  5221. }));
  5222. }));
  5223. }
  5224. destroySelf() {
  5225. this.callback = null;
  5226. this.skillSelectData = null;
  5227. this.selfPot = null;
  5228. this.aiPot = null;
  5229. if (!this.ui.isDisposed) {
  5230. this.ui.removeFromParent();
  5231. this.ui.dispose();
  5232. }
  5233. xGame.uiMgr.destroyUI(this);
  5234. }
  5235. }
  5236. UIMatching.uiName = "UIMatching";
  5237. class ui_UIRanking extends fgui.GComponent {
  5238. static createInstance() {
  5239. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5240. }
  5241. onConstruct() {
  5242. this.n26 = (this.getChild("n26"));
  5243. this.myNode = (this.getChild("myNode"));
  5244. }
  5245. }
  5246. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5247. class UIRanking extends UIBase {
  5248. constructor() {
  5249. super();
  5250. this.showSelf = true;
  5251. this.rankType = 1;
  5252. this.rankList = [];
  5253. this.topX = 10;
  5254. this.myIndex = this.topX + 1;
  5255. this.myStar = 0;
  5256. }
  5257. onConstructor() {
  5258. this.ui = ui_UIRanking.createInstance();
  5259. this.contentPane = this.ui;
  5260. this.isEject = false;
  5261. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5262. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5263. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5264. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5265. this.ui.myNode.myList.setVirtual();
  5266. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5267. }
  5268. show() {
  5269. super.show();
  5270. this.getPaiHangBangDataFormJosnFile();
  5271. this.updateSelf();
  5272. let self = Moyu.getUserInfo();
  5273. if (!self.isAuth) {
  5274. Moyu.initUser(this, () => {
  5275. DataMgr.upRankData();
  5276. });
  5277. }
  5278. }
  5279. getPaiHangBangDataFormJosnFile() {
  5280. const rankingList = cfgTable.paiHangBangData.list;
  5281. this.updateItemData(rankingList);
  5282. }
  5283. updateSelfItem() {
  5284. console.log('zh:Moyu.platType =' + Moyu.platType);
  5285. let self = Moyu.getUserInfo();
  5286. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5287. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5288. if (this.myIndex > this.topX) {
  5289. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5290. }
  5291. else {
  5292. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5293. }
  5294. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5295. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5296. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5297. }
  5298. updateItemData(data) {
  5299. this.myStar = xGame.common.getAllStarNum();
  5300. if (this.rankList.length < 2) {
  5301. this.rankList = data;
  5302. let self = Moyu.getUserInfo();
  5303. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5304. self.headIcon = self.headIcon;
  5305. for (let i = 0; i < data.length; i++) {
  5306. let data = this.rankList[i];
  5307. if (data.userId == self.userId) {
  5308. this.rankList.splice(i, 1);
  5309. break;
  5310. }
  5311. }
  5312. for (let i = 0; i < data.length; i++) {
  5313. let data = this.rankList[i];
  5314. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5315. this.myIndex = i + 1;
  5316. let user = { headIcon: self.headIcon, nickName: "myself" };
  5317. let ud = { user: user, data: {} };
  5318. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5319. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5320. if (Moyu.platType < 11) {
  5321. user.headIcon = self.headIcon;
  5322. user.nickName = self.nickName;
  5323. }
  5324. this.rankList.splice(i, 0, md);
  5325. break;
  5326. }
  5327. }
  5328. }
  5329. this.updateSelfItem();
  5330. this.ui.myNode.myList.numItems = this.rankList.length;
  5331. }
  5332. updateItemUI(index, obj) {
  5333. let data = this.rankList[index];
  5334. let userData = JSON.parse(data.userData).user;
  5335. obj.nameTxt.text = userData.nickName.toString();
  5336. obj.valueTxt.text = data.rankScore;
  5337. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5338. obj.rankTxt.text = index + 1;
  5339. switch (index) {
  5340. case 0:
  5341. this.setImg(obj, 1, 0, 0);
  5342. obj.rankTxt.color = "#FFC047";
  5343. break;
  5344. case 1:
  5345. this.setImg(obj, 0, 1, 0);
  5346. obj.rankTxt.color = "#ACACAC";
  5347. break;
  5348. case 2:
  5349. this.setImg(obj, 0, 0, 1);
  5350. obj.rankTxt.color = "#D09672";
  5351. break;
  5352. default:
  5353. this.setImg(obj, 0, 0, 0);
  5354. obj.rankTxt.color = "#496FAB";
  5355. break;
  5356. }
  5357. }
  5358. setImg(obj, a, b, c) {
  5359. obj.img1.visible = a ? true : false;
  5360. obj.img2.visible = b ? true : false;
  5361. obj.img3.visible = c ? true : false;
  5362. }
  5363. changeList(type) {
  5364. this.rankType = type;
  5365. this.updateSelf();
  5366. }
  5367. changeSelfNode() {
  5368. this.showSelf = !this.showSelf;
  5369. this.updateSelf();
  5370. }
  5371. updateSelf() {
  5372. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5373. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5374. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5375. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5376. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5377. }
  5378. }
  5379. UIRanking.uiName = "UIRanking";
  5380. class ui_UISecretary extends fgui.GComponent {
  5381. static createInstance() {
  5382. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5383. }
  5384. onConstruct() {
  5385. this.n0 = (this.getChild("n0"));
  5386. this.myNode = (this.getChild("myNode"));
  5387. this.closeBtn = (this.getChild("closeBtn"));
  5388. this.t0 = this.getTransition("t0");
  5389. }
  5390. }
  5391. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5392. class UISecretary extends UIBase {
  5393. constructor() {
  5394. super();
  5395. this.curIndex = 1;
  5396. }
  5397. onConstructor() {
  5398. this.ui = ui_UISecretary.createInstance();
  5399. this.contentPane = this.ui;
  5400. this.isEject = false;
  5401. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5402. this.nodeObj = { left: null, right: null, cur: null };
  5403. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5404. }
  5405. show() {
  5406. super.show();
  5407. this.ui.t0.play();
  5408. this.updateData();
  5409. }
  5410. addSecretarySpine(node, spineName) {
  5411. if (spineName == "mishu") {
  5412. if (this.secretarySpine1) {
  5413. node.displayObject.destroyChildren();
  5414. this.playWoman(this.secretarySpine1, node.displayObject);
  5415. }
  5416. else {
  5417. let spine1 = new SpineMgr("mishu", () => {
  5418. this.secretarySpine1 = spine1;
  5419. this.playWoman(this.secretarySpine1, node.displayObject);
  5420. });
  5421. }
  5422. }
  5423. else {
  5424. if (this.secretarySpine2) {
  5425. node.displayObject.destroyChildren();
  5426. this.playWoman(this.secretarySpine2, node.displayObject);
  5427. }
  5428. else {
  5429. let spine2 = new SpineMgr("xiaomishu2", () => {
  5430. this.secretarySpine2 = spine2;
  5431. this.playWoman(this.secretarySpine2, node.displayObject);
  5432. });
  5433. }
  5434. }
  5435. }
  5436. playWoman(node, parent) {
  5437. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5438. let yy = this.ui.myNode.gameNode3.secretary.height;
  5439. let scale = 1.5;
  5440. if (node == this.secretarySpine2) {
  5441. scale = 1.2;
  5442. }
  5443. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5444. node.play(data, 0, true, parent);
  5445. }
  5446. turnLeft() {
  5447. this.curIndex--;
  5448. if (this.curIndex < 1) {
  5449. this.curIndex = 2;
  5450. }
  5451. let left = this.nodeObj.left;
  5452. let right = this.nodeObj.right;
  5453. let cur = this.nodeObj.cur;
  5454. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5455. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5456. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5457. this.updateData();
  5458. }));
  5459. this.ui.myNode.setChildIndex(right, 2);
  5460. this.nodeObj.left = cur;
  5461. this.nodeObj.right = left;
  5462. this.nodeObj.cur = right;
  5463. }
  5464. turnRight() {
  5465. this.curIndex++;
  5466. if (this.curIndex > 2) {
  5467. this.curIndex = 1;
  5468. }
  5469. let left = this.nodeObj.left;
  5470. let right = this.nodeObj.right;
  5471. let cur = this.nodeObj.cur;
  5472. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5473. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5474. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5475. this.updateData();
  5476. }));
  5477. this.ui.myNode.setChildIndex(left, 2);
  5478. this.nodeObj.left = right;
  5479. this.nodeObj.right = cur;
  5480. this.nodeObj.cur = left;
  5481. }
  5482. updateData() {
  5483. console.log('zh: updateData FFFFFFFFFF');
  5484. let data = cfgTable.secretaryshopData;
  5485. let children = this.ui.myNode._children;
  5486. let temp;
  5487. let curData;
  5488. for (let index = 0; index < children.length; index++) {
  5489. temp = children[index];
  5490. curData = data[1];
  5491. temp.heightTxt.text = curData.height;
  5492. temp.foodTxt.text = curData.food;
  5493. temp.historyTxt.text = curData.history;
  5494. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5495. this.addSecretarySpine(temp.secretary, curData.spine);
  5496. let womanIndex = curData.id - 1;
  5497. let getWoman = DataMgr.getSecretary(womanIndex);
  5498. let curUse = DataMgr.getCurSecretary();
  5499. if (getWoman) {
  5500. if (curUse == womanIndex) {
  5501. temp.purchaseBtn.c1.selectedIndex = 1;
  5502. }
  5503. else {
  5504. temp.purchaseBtn.c1.selectedIndex = 2;
  5505. }
  5506. }
  5507. else {
  5508. temp.purchaseBtn.c1.selectedIndex = 0;
  5509. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5510. }
  5511. temp.purchaseBtn.visible = false;
  5512. }
  5513. }
  5514. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5515. console.log('zh: 点击了clickSecretary ');
  5516. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5517. if (getWoman) {
  5518. if (curUse != womanIndex) {
  5519. console.log();
  5520. DataMgr.setCurSecretary(womanIndex);
  5521. this.updateData();
  5522. }
  5523. }
  5524. else {
  5525. console.log('zh:点击购买了');
  5526. let need = needDiamond;
  5527. if (DataMgr.diamondEnough(need)) {
  5528. DataMgr.setDiamond(-need);
  5529. DataMgr.setSecretary(womanIndex, 1);
  5530. DataMgr.setCurSecretary(womanIndex);
  5531. this.updateData();
  5532. }
  5533. else {
  5534. xGame.uiMgr.Show(UIAddProp, 1);
  5535. }
  5536. }
  5537. }
  5538. closeSelf() {
  5539. this.hide();
  5540. }
  5541. }
  5542. UISecretary.uiName = "UISecretary";
  5543. class ui_UIShop extends fgui.GComponent {
  5544. static createInstance() {
  5545. return (fgui.UIPackage.createObject("game", "UIShop"));
  5546. }
  5547. onConstruct() {
  5548. this.n48 = (this.getChild("n48"));
  5549. this.n0 = (this.getChild("n0"));
  5550. this.secretary = (this.getChild("secretary"));
  5551. this.talkNode = (this.getChild("talkNode"));
  5552. this.closeNode = (this.getChild("closeNode"));
  5553. this.moneyNode = (this.getChild("moneyNode"));
  5554. this.myNode = (this.getChild("myNode"));
  5555. }
  5556. }
  5557. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5558. class BallRodDisplay {
  5559. constructor(ui, index) {
  5560. this.index = 0;
  5561. this.uiIndex = 0;
  5562. this.ui = ui;
  5563. this.index = index;
  5564. this.initData();
  5565. }
  5566. initData() {
  5567. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5568. let data = cfgTable.ballrodData[this.index + 1];
  5569. this.ui.nameTxt.text = data.name;
  5570. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5571. this.ui.levelNode.c1.selectedIndex = data.quality;
  5572. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5573. if (data.spine) {
  5574. this.mySpine = new SpineMgr(data.spine, () => {
  5575. let xx = 150;
  5576. let yy = 70;
  5577. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5578. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5579. });
  5580. }
  5581. }
  5582. updateSelf() {
  5583. console.log('zh:updateSelf -------------- ');
  5584. let get = DataMgr.getBallRod(this.index);
  5585. if (get == null)
  5586. get = 1;
  5587. let curUse = DataMgr.getCurBallRod();
  5588. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5589. if (get) {
  5590. if (curUse == this.index) {
  5591. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5592. }
  5593. else {
  5594. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5595. }
  5596. }
  5597. else {
  5598. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5599. }
  5600. }
  5601. buyBallRod() {
  5602. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5603. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5604. switch (selectedIndex) {
  5605. case 0:
  5606. break;
  5607. case 1:
  5608. console.log('zh:点击了 USE THIS');
  5609. DataMgr.setCurBallRod(this.index);
  5610. DataMgr.setDiamond(99999);
  5611. let curUse = DataMgr.getCurBallRod();
  5612. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5613. let ui = xGame.uiMgr.getUI(UIShop);
  5614. ui.updateBallRod();
  5615. break;
  5616. case 2:
  5617. let data = cfgTable.ballrodData[this.index + 1];
  5618. let need = data.price;
  5619. if (DataMgr.diamondEnough(need)) {
  5620. DataMgr.setDiamond(-need);
  5621. DataMgr.setBallRod(this.index, 1);
  5622. DataMgr.setCurBallRod(this.index);
  5623. let ui = xGame.uiMgr.getUI(UIShop);
  5624. ui.updateBallRod();
  5625. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5626. }
  5627. else {
  5628. xGame.uiMgr.Show(UIAddProp, 1);
  5629. }
  5630. break;
  5631. default:
  5632. break;
  5633. }
  5634. }
  5635. logEventForGouMaiGan(qiuGanName) {
  5636. const ev = {
  5637. value: qiuGanName
  5638. };
  5639. const jsonStr = JSON.stringify(ev);
  5640. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5641. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5642. }
  5643. }
  5644. class UIShop extends UIBase {
  5645. constructor() {
  5646. super();
  5647. this.itemNums = 0;
  5648. }
  5649. onConstructor() {
  5650. this.ui = ui_UIShop.createInstance();
  5651. this.contentPane = this.ui;
  5652. this.isEject = false;
  5653. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5654. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5655. this.addUIClick(this.ui, this.interuptSecretary);
  5656. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5657. this.ballRodArr = [];
  5658. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5659. this.ui.myNode.myList.numItems = this.itemNums;
  5660. if (Moyu.isKs)
  5661. this.ui.closeNode.closeBtn.x += 100;
  5662. }
  5663. show() {
  5664. super.show();
  5665. this.playSecretaryIdle();
  5666. this.updateBallRod();
  5667. }
  5668. updateBallRod() {
  5669. for (let index = 0; index < this.ballRodArr.length; index++) {
  5670. this.ballRodArr[index].updateSelf();
  5671. }
  5672. }
  5673. renderBallRod(sort, obj) {
  5674. let index = this.getIndexBySort(sort + 1) - 1;
  5675. let ballRod = new BallRodDisplay(obj, index);
  5676. this.ballRodArr.push(ballRod);
  5677. }
  5678. getIndexBySort(sort) {
  5679. let object = cfgTable.ballrodData;
  5680. for (const key in object) {
  5681. if (object[key].sort == sort) {
  5682. return parseInt(key);
  5683. }
  5684. }
  5685. }
  5686. playSecretaryIdle() {
  5687. let parent = this.ui.secretary.displayObject;
  5688. parent.destroyChildren();
  5689. let xx = this.ui.secretary.width / 2;
  5690. let yy = this.ui.secretary.height;
  5691. let scale = xGame.common.getSecretaryScale();
  5692. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5693. xGame.common.secretary.play(data, 0, true, parent);
  5694. }
  5695. interuptSecretary() {
  5696. Laya.timer.clearAll(this);
  5697. this.playSecretaryRandomSound();
  5698. }
  5699. playSecretaryRandomSound() {
  5700. if (this.isHide)
  5701. return;
  5702. let time = xGame.common.randomNum(45000, 60000);
  5703. Laya.timer.once(time, this, () => {
  5704. if (this.isHide)
  5705. return;
  5706. let index = xGame.common.randomNum(4, 7);
  5707. xGame.soundMgr.playSound("s_main0" + index);
  5708. let words = 1;
  5709. switch (index) {
  5710. case 4:
  5711. words = 5;
  5712. break;
  5713. case 5:
  5714. words = 3;
  5715. break;
  5716. case 6:
  5717. words = 6;
  5718. break;
  5719. case 7:
  5720. words = 7;
  5721. break;
  5722. default:
  5723. break;
  5724. }
  5725. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5726. this.playSecretaryRandomSound();
  5727. });
  5728. }
  5729. closeSelf() {
  5730. this.hide();
  5731. }
  5732. }
  5733. UIShop.uiName = "UIShop";
  5734. class ui_UISign extends fgui.GComponent {
  5735. static createInstance() {
  5736. return (fgui.UIPackage.createObject("game", "UISign"));
  5737. }
  5738. onConstruct() {
  5739. this.n6 = (this.getChild("n6"));
  5740. this.closeNode = (this.getChild("closeNode"));
  5741. this.myNode = (this.getChild("myNode"));
  5742. this.moneyNode = (this.getChild("moneyNode"));
  5743. this.secretary = (this.getChild("secretary"));
  5744. this.talkNode = (this.getChild("talkNode"));
  5745. this.tripleBtn = (this.getChild("tripleBtn"));
  5746. this.normalBtn = (this.getChild("normalBtn"));
  5747. this.tipsNode = (this.getChild("tipsNode"));
  5748. this.againBtn = (this.getChild("againBtn"));
  5749. this.t0 = this.getTransition("t0");
  5750. }
  5751. }
  5752. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5753. class SignMax {
  5754. constructor(ui) {
  5755. this.ui = ui;
  5756. }
  5757. updateSelf(index, sameDay, curDayIndex) {
  5758. let data = cfgTable.signData[index + 1];
  5759. this.ui.titleTxt.text = data.title;
  5760. let arr1 = data.award[0].split('-');
  5761. let arr2 = data.award[1].split('-');
  5762. let num1 = parseInt(arr1[1]);
  5763. let num2 = parseInt(arr2[1]);
  5764. this.ui.numTxt1.text = num1 + "";
  5765. this.ui.numTxt2.text = num2 + "";
  5766. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5767. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5768. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5769. this.ui.numTxt1.visible = false;
  5770. }
  5771. else {
  5772. this.ui.numTxt1.visible = true;
  5773. }
  5774. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5775. this.ui.numTxt2.visible = false;
  5776. }
  5777. else {
  5778. this.ui.numTxt2.visible = true;
  5779. }
  5780. if (index < curDayIndex) {
  5781. this.ui.c1.selectedIndex = 1;
  5782. }
  5783. else if (index == curDayIndex) {
  5784. if (sameDay) {
  5785. this.ui.c1.selectedIndex = 2;
  5786. }
  5787. else {
  5788. this.ui.c1.selectedIndex = 2;
  5789. }
  5790. }
  5791. else {
  5792. this.ui.c1.selectedIndex = 0;
  5793. }
  5794. }
  5795. }
  5796. class SignNormal {
  5797. constructor(ui) {
  5798. this.ui = ui;
  5799. }
  5800. updateSelf(index, sameDay, curDayIndex) {
  5801. let data = cfgTable.signData[index + 1];
  5802. this.ui.titleTxt.text = data.title;
  5803. let arr = data.award[0].split('-');
  5804. let type = parseInt(arr[0]);
  5805. let num = parseInt(arr[1]);
  5806. this.ui.numTxt.text = num + "";
  5807. if (type > 2) {
  5808. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5809. this.ui.myIcon.rotation = 0;
  5810. }
  5811. else {
  5812. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5813. this.ui.myIcon.rotation = 0;
  5814. }
  5815. if (xGame.common.signAwardContainsRod(data.award)) {
  5816. this.ui.numTxt.visible = false;
  5817. }
  5818. else {
  5819. this.ui.numTxt.visible = true;
  5820. }
  5821. if (index < curDayIndex) {
  5822. this.ui.c1.selectedIndex = 1;
  5823. }
  5824. else if (index == curDayIndex) {
  5825. if (sameDay) {
  5826. this.ui.c1.selectedIndex = 2;
  5827. }
  5828. else {
  5829. this.ui.c1.selectedIndex = 2;
  5830. }
  5831. }
  5832. else {
  5833. this.ui.c1.selectedIndex = 0;
  5834. }
  5835. }
  5836. }
  5837. class UISign extends UIBase {
  5838. constructor() {
  5839. super();
  5840. this.curDayIndex = 0;
  5841. this.starX = 0;
  5842. }
  5843. onConstructor() {
  5844. this.ui = ui_UISign.createInstance();
  5845. this.contentPane = this.ui;
  5846. this.isEject = false;
  5847. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5848. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5849. this.initSignItem();
  5850. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5851. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5852. }
  5853. show() {
  5854. super.show();
  5855. this.ui.t0.play();
  5856. this.playSecretaryIdle();
  5857. this.updateSign();
  5858. }
  5859. initSignItem() {
  5860. this.signArr = [];
  5861. for (let index = 0; index < 6; index++) {
  5862. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5863. this.signArr.push(temp);
  5864. }
  5865. this.signMax = new SignMax(this.ui.myNode.day7);
  5866. if (Moyu.isKs)
  5867. this.ui.closeNode.closeBtn.x += 100;
  5868. }
  5869. updateSign() {
  5870. let sameDay = xGame.common.judgeSameDay();
  5871. let max = 7;
  5872. this.curDayIndex = DataMgr.getSignData();
  5873. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5874. this.curDayIndex = 0;
  5875. if (!sameDay) {
  5876. this.ui.normalBtn.visible = true;
  5877. this.ui.tipsNode.visible = false;
  5878. this.ui.againBtn.visible = false;
  5879. }
  5880. else {
  5881. this.ui.normalBtn.visible = false;
  5882. let again = DataMgr.getExtraSign();
  5883. let isCurrency = false;
  5884. let index = this.curDayIndex;
  5885. if (index == 0)
  5886. index = 7;
  5887. let award = cfgTable.signData[index].award;
  5888. let num = award[0].split("-")[0];
  5889. if (num == "1" || num == "2")
  5890. isCurrency = true;
  5891. let showAgain = again == 0 && isCurrency;
  5892. this.ui.againBtn.visible = showAgain;
  5893. this.ui.tipsNode.visible = !showAgain;
  5894. }
  5895. for (let index = 0; index < this.signArr.length; index++) {
  5896. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5897. }
  5898. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5899. }
  5900. playSecretaryIdle() {
  5901. let parent = this.ui.secretary.displayObject;
  5902. parent.destroyChildren();
  5903. let xx = this.ui.secretary.width / 2;
  5904. let yy = this.ui.secretary.height;
  5905. let scale = xGame.common.getSecretaryScale();
  5906. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5907. xGame.common.secretary.play(data, 0, true, parent);
  5908. }
  5909. closeSelf() {
  5910. this.hide();
  5911. }
  5912. normalGetAward() {
  5913. let sameDay = xGame.common.judgeSameDay();
  5914. if (!sameDay) {
  5915. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5916. let temp;
  5917. let type;
  5918. let num;
  5919. let arr = [];
  5920. for (let index = 0; index < award.length; index++) {
  5921. temp = award[index].split("-");
  5922. type = parseInt(temp[0]);
  5923. num = parseInt(temp[1]);
  5924. let awardType = new AwardType();
  5925. awardType.num = num;
  5926. awardType.type = type;
  5927. arr.push(awardType);
  5928. }
  5929. xGame.common.getAward(arr, (watchVideo) => {
  5930. this.curDayIndex++;
  5931. if (this.curDayIndex > 7)
  5932. this.curDayIndex = 0;
  5933. DataMgr.setSignData(this.curDayIndex);
  5934. DataMgr.setSignTime(new Date().getTime());
  5935. if (watchVideo) {
  5936. DataMgr.setExtraSign(1);
  5937. Moyu.sendDataEvent("signIn1");
  5938. }
  5939. this.updateSign();
  5940. });
  5941. }
  5942. }
  5943. againGetAward() {
  5944. Moyu.sendDataEvent("signIn2");
  5945. console.log('zh:qjff_AD_for_uisign');
  5946. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  5947. }
  5948. else {
  5949. console.log('zh:AD 失败,直接发放奖励');
  5950. this.qjff_AD_for_uisign();
  5951. }
  5952. }
  5953. qjff_AD_for_uisign() {
  5954. let index = this.curDayIndex;
  5955. if (index == 0)
  5956. index = 7;
  5957. let award = cfgTable.signData[index].award;
  5958. let temp;
  5959. let type;
  5960. let num;
  5961. for (let index = 0; index < award.length; index++) {
  5962. temp = award[index].split("-");
  5963. type = parseInt(temp[0]);
  5964. num = parseInt(temp[1]) * 3;
  5965. xGame.common.playObjFlyAnim(num, type);
  5966. }
  5967. DataMgr.setExtraSign(1);
  5968. this.updateSign();
  5969. }
  5970. }
  5971. UISign.uiName = "UISign";
  5972. class ui_UISkill extends fgui.GComponent {
  5973. static createInstance() {
  5974. return (fgui.UIPackage.createObject("game", "UISkill"));
  5975. }
  5976. onConstruct() {
  5977. this.n48 = (this.getChild("n48"));
  5978. this.n0 = (this.getChild("n0"));
  5979. this.secretary = (this.getChild("secretary"));
  5980. this.talkNode = (this.getChild("talkNode"));
  5981. this.closeNode = (this.getChild("closeNode"));
  5982. this.moneyNode = (this.getChild("moneyNode"));
  5983. this.skillNode = (this.getChild("skillNode"));
  5984. this.guideNode = (this.getChild("guideNode"));
  5985. }
  5986. }
  5987. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5988. class SkillDisplay {
  5989. constructor(ui, data, uiIndex) {
  5990. this.starX = 0;
  5991. this.starY = 0;
  5992. this.index = 0;
  5993. this.ui = ui;
  5994. this.data = data;
  5995. this.index = uiIndex;
  5996. this.initSelf();
  5997. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5998. }
  5999. initSelf() {
  6000. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6001. this.ui.nameTxt.text = this.data.name;
  6002. this.ui.describeTxt.text = this.data.describe;
  6003. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6004. this.ui.startBtn.onClick(this, this.startGame);
  6005. this.updateSelf();
  6006. }
  6007. updateSelf() {
  6008. this.checkTry();
  6009. let level = DataMgr.getBigSkillByIndex(this.index);
  6010. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6011. }
  6012. checkTry() {
  6013. let index = this.index;
  6014. let level = DataMgr.getBigSkillByIndex(index);
  6015. if (level == null) {
  6016. DataMgr.setBigSkill(index, 1, false);
  6017. level = 1;
  6018. }
  6019. this.ui.levelTxt.text = "LV." + level;
  6020. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6021. this.ui.tryNode.visible = true;
  6022. else
  6023. this.ui.tryNode.visible = false;
  6024. }
  6025. clickAddLevel() {
  6026. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6027. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6028. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6029. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6030. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6031. }
  6032. else {
  6033. console.log('zh:AD 失败,直接发放奖励');
  6034. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6035. }
  6036. }
  6037. qjff_AD_for_skilldisplay_clickAddLevel() {
  6038. DataMgr.setBigSkill(this.data.index, 1);
  6039. this.updateSelf();
  6040. xGame.common.upSkillLevel = true;
  6041. }
  6042. startGame() {
  6043. console.log('zh:rod skill startgame');
  6044. if (this.data.index == 3) {
  6045. alert('Coming soon!');
  6046. return;
  6047. }
  6048. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6049. let needCoin = xGame.common.bigMoveNeedCoin;
  6050. xGame.common.passAwardCoin = 2000;
  6051. let guide = DataMgr.getSkillGuide();
  6052. console.log('zh:startGame guide=' + guide);
  6053. xGame.common.temSelfLevel = 0;
  6054. if (guide == 0) {
  6055. needCoin = 0;
  6056. xGame.common.temSelfLevel = 100;
  6057. }
  6058. if (DataMgr.coinEnough(needCoin)) {
  6059. DataMgr.setCoin(-needCoin);
  6060. xGame.common.curPlayerSkillType = this.index;
  6061. if (guide == 0)
  6062. xGame.common.curPlayerSkillType = 0;
  6063. console.log('zh: skilldisplay 1');
  6064. xGame.uiMgr.Show(UIGame);
  6065. xGame.uiMgr.Hide(UIMain);
  6066. xGame.uiMgr.Show(UIMatching, () => {
  6067. xGame.common.gameUI.ui.alpha = 1;
  6068. xGame.common.gameUI.startGame();
  6069. xGame.uiMgr.Hide(UISkill);
  6070. });
  6071. this.logEventForRod_start();
  6072. }
  6073. else {
  6074. console.log('zh: skilldisplay 2');
  6075. xGame.uiMgr.Show(UIAddProp, 0);
  6076. Moyu.sendDataEvent("AddCoinVideo");
  6077. }
  6078. }
  6079. logEventForRod_start() {
  6080. let gfmsIdx = xGame.common.curPlayerSkillType;
  6081. console.log('zh:选择的技能=' + gfmsIdx);
  6082. let gfmc = 'Skyfall Shot';
  6083. if (gfmsIdx == 0) {
  6084. gfmc = 'Skyfall Shot';
  6085. }
  6086. if (gfmsIdx == 1) {
  6087. gfmc = 'Surging break';
  6088. }
  6089. if (gfmsIdx == 2) {
  6090. gfmc = 'Frost Lock';
  6091. }
  6092. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6093. let jsonStr = {
  6094. "count": 1,
  6095. "name": gfmc
  6096. };
  6097. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6098. const d = LocalStorageManager.getItem(keyStr);
  6099. jsonStr.count = d.count + 1;
  6100. LocalStorageManager.setItem(keyStr, jsonStr);
  6101. }
  6102. else {
  6103. LocalStorageManager.setItem(keyStr, jsonStr);
  6104. }
  6105. const reqStr = JSON.stringify(jsonStr);
  6106. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6107. }
  6108. }
  6109. class UISkill extends UIBase {
  6110. constructor() {
  6111. super();
  6112. this.skillData = [];
  6113. }
  6114. onConstructor() {
  6115. this.ui = ui_UISkill.createInstance();
  6116. this.contentPane = this.ui;
  6117. this.isEject = false;
  6118. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6119. this.initSkillData();
  6120. console.log('zh:aaaaaa1111111111');
  6121. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6122. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6123. console.log('zh:aaaaaa22222222');
  6124. this.displayList = [];
  6125. this.ui.skillNode.skillList.numItems = 3;
  6126. this.addUIClick(this.ui, this.interuptSecretary);
  6127. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6128. this.ui.talkNode.visible = false;
  6129. if (Moyu.isKs)
  6130. this.ui.closeNode.closeBtn.x += 100;
  6131. }
  6132. show() {
  6133. super.show();
  6134. this.playSecretaryIdle();
  6135. this.moneyNode.ui.c1.selectedIndex = 1;
  6136. Laya.timer.clearAll(this);
  6137. xGame.soundMgr.playSound("s_start");
  6138. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6139. let guide = DataMgr.getSkillGuide();
  6140. this.ui.guideNode.visible = guide == 0;
  6141. let item = this.getSkillItemByUIIndex(0);
  6142. if (guide == 0) {
  6143. item.ui.c1.selectedIndex = 1;
  6144. }
  6145. else {
  6146. item.ui.c1.selectedIndex = 0;
  6147. }
  6148. this.ui.guideNode.guideBtn.visible = guide == 0;
  6149. for (let index = 0; index < this.displayList.length; index++) {
  6150. this.displayList[index].checkTry();
  6151. }
  6152. }
  6153. getSkillItemByUIIndex(cur) {
  6154. for (let index = 0; index < this.displayList.length; index++) {
  6155. if (this.displayList[index].index == cur) {
  6156. return this.displayList[index];
  6157. }
  6158. }
  6159. }
  6160. enterGuideLevel() {
  6161. let item = this.getSkillItemByUIIndex(0);
  6162. item.startGame();
  6163. if (DataMgr.getNewUser())
  6164. Moyu.sendDataEvent("gameStart1");
  6165. }
  6166. initSkillData() {
  6167. this.skillData = [];
  6168. let nameList = xGame.common.skillNameList;
  6169. let iconList = xGame.common.skillIconList;
  6170. let describeList = [
  6171. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6172. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
  6173. "The power of frost descends—freezing the flow and taking full control of the game!"
  6174. ];
  6175. console.log('zh:initSkillData 111111111');
  6176. let data;
  6177. for (let index = 0; index < nameList.length; index++) {
  6178. data = {};
  6179. data.name = nameList[index];
  6180. data.icon = iconList[index];
  6181. data.describe = describeList[index];
  6182. data.index = index;
  6183. this.skillData.push(data);
  6184. }
  6185. }
  6186. updateSkillItem(index, target) {
  6187. if (this.displayList[index] == null) {
  6188. let uiIndex;
  6189. switch (index) {
  6190. case 0:
  6191. uiIndex = 1;
  6192. break;
  6193. case 1:
  6194. uiIndex = 0;
  6195. break;
  6196. case 2:
  6197. uiIndex = 2;
  6198. break;
  6199. case 3:
  6200. uiIndex = 3;
  6201. break;
  6202. default:
  6203. break;
  6204. }
  6205. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6206. this.displayList.push(temp);
  6207. }
  6208. }
  6209. playSecretaryIdle() {
  6210. let parent = this.ui.secretary.displayObject;
  6211. parent.destroyChildren();
  6212. let xx = this.ui.secretary.width / 2;
  6213. let yy = this.ui.secretary.height;
  6214. let scale = xGame.common.getSecretaryScale();
  6215. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6216. xGame.common.secretary.play(data, 0, true, parent);
  6217. }
  6218. returnUIMain() {
  6219. this.hide();
  6220. xGame.common.stopGirlPop(this.ui.talkNode);
  6221. xGame.uiMgr.Show(UIMain);
  6222. }
  6223. interuptSecretary() {
  6224. Laya.timer.clearAll(this);
  6225. this.playSecretaryRandomSound();
  6226. }
  6227. playSecretaryRandomSound() {
  6228. if (this.isHide)
  6229. return;
  6230. let time = xGame.common.randomNum(45000, 60000);
  6231. Laya.timer.once(time, this, () => {
  6232. if (this.isHide)
  6233. return;
  6234. let index = xGame.common.randomNum(4, 7);
  6235. xGame.soundMgr.playSound("s_main0" + index);
  6236. let words = 1;
  6237. switch (index) {
  6238. case 4:
  6239. words = 5;
  6240. break;
  6241. case 5:
  6242. words = 3;
  6243. break;
  6244. case 6:
  6245. words = 6;
  6246. break;
  6247. case 7:
  6248. words = 7;
  6249. break;
  6250. default:
  6251. break;
  6252. }
  6253. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6254. this.playSecretaryRandomSound();
  6255. });
  6256. }
  6257. }
  6258. UISkill.uiName = "UISkill";
  6259. class ui_UIMsg extends fgui.GComponent {
  6260. static createInstance() {
  6261. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6262. }
  6263. onConstruct() {
  6264. this.tipsNode = (this.getChild("tipsNode"));
  6265. }
  6266. }
  6267. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6268. class UIMsg extends UIBase {
  6269. constructor() {
  6270. super();
  6271. }
  6272. onConstructor() {
  6273. this.ui = ui_UIMsg.createInstance();
  6274. this.contentPane = this.ui;
  6275. this.isEject = false;
  6276. this.isMuti = true;
  6277. }
  6278. show(msg, callback) {
  6279. super.show();
  6280. this.ui.tipsNode.msgTxt.text = msg;
  6281. this.ui.alpha = 1;
  6282. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6283. this.hide();
  6284. callback && callback();
  6285. }), 1000);
  6286. }
  6287. }
  6288. UIMsg.uiName = "UIMsg";
  6289. class ui_UIModeSelection extends fgui.GComponent {
  6290. static createInstance() {
  6291. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6292. }
  6293. onConstruct() {
  6294. this.n19 = (this.getChild("n19"));
  6295. this.closeBtn = (this.getChild("closeBtn"));
  6296. this.myNode = (this.getChild("myNode"));
  6297. this.t0 = this.getTransition("t0");
  6298. }
  6299. }
  6300. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6301. class UIModeSelection extends UIBase {
  6302. constructor() {
  6303. super();
  6304. }
  6305. onConstructor() {
  6306. this.ui = ui_UIModeSelection.createInstance();
  6307. this.contentPane = this.ui;
  6308. this.isEject = false;
  6309. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6310. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6311. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6312. this.addUIClick(this.ui.closeBtn, this.hide);
  6313. this.peopleArr = [650, 6900, 3800];
  6314. this.peopleOffest = [50, 500, 200];
  6315. this.updateSelf();
  6316. }
  6317. show(callback) {
  6318. super.show();
  6319. this.ui.t0.play();
  6320. this.callback = callback;
  6321. }
  6322. updateSelf() {
  6323. let cfg = cfgTable.modeselectData;
  6324. for (let index = 1; index <= 3; index++) {
  6325. let node = this.ui.myNode["type" + index];
  6326. node.need.text = cfg[index].need;
  6327. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6328. node.peopleTxt.text = this.getRandPeople(index - 1);
  6329. }
  6330. }
  6331. enterGame(type) {
  6332. console.log('zh: 进入经典模式 type: ' + type);
  6333. xGame.common.classicRoomType = type;
  6334. let cfg = cfgTable.modeselectData[type];
  6335. let need = cfg.need;
  6336. xGame.common.passAwardCoin = cfg.award;
  6337. if (DataMgr.coinEnough(need)) {
  6338. DataMgr.setCoin(-need);
  6339. this.ui.myNode["type" + type].t0.play();
  6340. Laya.timer.once(200, this, () => {
  6341. this.callback && this.callback();
  6342. });
  6343. this.logEventForClassic_start();
  6344. }
  6345. else {
  6346. Moyu.sendDataEvent("AddCoinVideo");
  6347. xGame.uiMgr.Show(UIAddProp, 0);
  6348. }
  6349. }
  6350. getRandPeople(index) {
  6351. let rand = this.peopleOffest[index];
  6352. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6353. }
  6354. logEventForClassic_start() {
  6355. let rtype = xGame.common.classicRoomType;
  6356. let msmc = '';
  6357. if (rtype == 1) {
  6358. msmc = 'beginner';
  6359. }
  6360. if (rtype == 2) {
  6361. msmc = 'expert';
  6362. }
  6363. if (rtype == 3) {
  6364. msmc = 'master';
  6365. }
  6366. let keyStr = 'sjmd_classic_start_' + rtype;
  6367. let jsonStr = {
  6368. "difficulty": msmc,
  6369. "classic_count": 1,
  6370. "difficulty_count": 1
  6371. };
  6372. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6373. const d = LocalStorageManager.getItem(keyStr);
  6374. jsonStr.classic_count = d.classic_count + 1;
  6375. jsonStr.difficulty_count = d.difficulty_count + 1;
  6376. LocalStorageManager.setItem(keyStr, jsonStr);
  6377. }
  6378. else {
  6379. LocalStorageManager.setItem(keyStr, jsonStr);
  6380. }
  6381. const reqStr = JSON.stringify(jsonStr);
  6382. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6383. }
  6384. }
  6385. UIModeSelection.uiName = "UIModeSelection";
  6386. class ui_UIGetAward extends fgui.GComponent {
  6387. static createInstance() {
  6388. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6389. }
  6390. onConstruct() {
  6391. this.n4 = (this.getChild("n4"));
  6392. this.n0 = (this.getChild("n0"));
  6393. this.myList = (this.getChild("myList"));
  6394. this.n1 = (this.getChild("n1"));
  6395. this.eftNode = (this.getChild("eftNode"));
  6396. this.btnNode = (this.getChild("btnNode"));
  6397. this.t0 = this.getTransition("t0");
  6398. }
  6399. }
  6400. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6401. class UIGetAward extends UIBase {
  6402. constructor() {
  6403. super();
  6404. this.showTriple = true;
  6405. }
  6406. onConstructor() {
  6407. this.ui = ui_UIGetAward.createInstance();
  6408. this.contentPane = this.ui;
  6409. this.isEject = false;
  6410. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6411. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6412. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6413. }
  6414. show(arr, showTriple, callback) {
  6415. super.show();
  6416. this.ui.t0.play();
  6417. this.ui.eftNode.visible = true;
  6418. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6419. this.ui.eftNode.visible = false;
  6420. }), 1, 0, 0, 0.9);
  6421. this.awardArr = arr;
  6422. this.showTriple = showTriple;
  6423. this.callback = callback;
  6424. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6425. this.ui.myList.numItems = arr.length;
  6426. xGame.soundMgr.playSound("getaward");
  6427. }
  6428. updateSelf(index, obj) {
  6429. let temp = this.awardArr[index];
  6430. let icon = this.getIcon(temp.type);
  6431. let str = icon;
  6432. if (temp.type > 2) {
  6433. str = "s" + icon;
  6434. }
  6435. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6436. obj.myIcon.rotation = 0;
  6437. obj.numTxt.text = temp.num + "";
  6438. obj.numTxt.visible = temp.type > 2 ? false : true;
  6439. obj.nameTxt.text = this.getNameStr(temp.type);
  6440. }
  6441. renderItem(index, obj) {
  6442. this.updateSelf(index, obj);
  6443. }
  6444. tripleGetAward() {
  6445. console.log('zh:qjff_AD_for_uigetAward');
  6446. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6447. }
  6448. else {
  6449. console.log('zh:AD 失败,直接发放奖励');
  6450. this.qjff_AD_for_uigetAward();
  6451. }
  6452. }
  6453. qjff_AD_for_uigetAward() {
  6454. this.getAward(3);
  6455. }
  6456. normalGetAward() {
  6457. if (PlatMgr.isMisVideo())
  6458. this.tripleGetAward();
  6459. else
  6460. this.getAward();
  6461. }
  6462. getAward(times = 1) {
  6463. this.hide();
  6464. for (let index = 0; index < this.awardArr.length; index++) {
  6465. this.awardArr[index].num *= times;
  6466. }
  6467. this.callback && this.callback(times != 1);
  6468. }
  6469. getIcon(type) {
  6470. switch (type) {
  6471. case Prop.diamond:
  6472. return "ty_zs";
  6473. case Prop.coin:
  6474. return "ty_jb";
  6475. case Prop.gan1:
  6476. return "qg1";
  6477. case Prop.gan2:
  6478. return "qg2";
  6479. case Prop.gan3:
  6480. return "qg3";
  6481. case Prop.gan4:
  6482. return "qg4";
  6483. default:
  6484. break;
  6485. }
  6486. }
  6487. getNameStr(type) {
  6488. switch (type) {
  6489. case Prop.diamond:
  6490. return "Diamond";
  6491. case Prop.coin:
  6492. return "Coins";
  6493. case Prop.gan1:
  6494. case Prop.gan2:
  6495. case Prop.gan3:
  6496. case Prop.gan4:
  6497. return cfgTable.ballrodData[type - 1].name;
  6498. default:
  6499. break;
  6500. }
  6501. }
  6502. }
  6503. UIGetAward.uiName = "UIGetAward";
  6504. class ui_UIRepentProp extends fgui.GComponent {
  6505. static createInstance() {
  6506. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6507. }
  6508. onConstruct() {
  6509. this.c1 = this.getController("c1");
  6510. this.n11 = (this.getChild("n11"));
  6511. this.regretNode = (this.getChild("regretNode"));
  6512. this.helpLineNode = (this.getChild("helpLineNode"));
  6513. this.t0 = this.getTransition("t0");
  6514. }
  6515. }
  6516. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6517. class UIRepentProp extends UIBase {
  6518. constructor() {
  6519. super();
  6520. this.viewType = 0;
  6521. this.regretType = 0;
  6522. }
  6523. onConstructor() {
  6524. this.ui = ui_UIRepentProp.createInstance();
  6525. this.contentPane = this.ui;
  6526. this.isEject = false;
  6527. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6528. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6529. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6530. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6531. }
  6532. show(viewType, regretType, callback) {
  6533. PlatMgr.showInsert(true);
  6534. this.viewType = viewType;
  6535. this.regretType = regretType;
  6536. this.callback = callback;
  6537. super.show();
  6538. this.ui.t0.play();
  6539. this.ui.c1.selectedIndex = this.viewType;
  6540. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6541. if (this.viewType == 0) {
  6542. let guide = DataMgr.getGuideHelpLine();
  6543. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6544. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6545. }
  6546. xGame.common.gameMgr.gamePause = true;
  6547. }
  6548. hideSelf() {
  6549. xGame.common.gameMgr.gamePause = false;
  6550. this.callback && this.callback(false);
  6551. this.hide();
  6552. }
  6553. videoRegret() {
  6554. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6555. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6556. }
  6557. else {
  6558. console.log('zh:AD 失败,直接发放奖励');
  6559. this.qjff_AD_for_UIrepentProp_videoRegret();
  6560. }
  6561. }
  6562. qjff_AD_for_UIrepentProp_videoRegret() {
  6563. this.callback && this.callback(true);
  6564. this.hideSelf();
  6565. }
  6566. videoAddHelpLine() {
  6567. let guide = DataMgr.getGuideHelpLine();
  6568. if (guide == 0) {
  6569. this.callback && this.callback(true);
  6570. this.hideSelf();
  6571. DataMgr.setGuideHelpLine();
  6572. xGame.common.gameUI.ui.guideNode.visible = false;
  6573. }
  6574. else {
  6575. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6576. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6577. }
  6578. else {
  6579. console.log('zh:AD 失败,直接发放奖励');
  6580. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6581. }
  6582. }
  6583. }
  6584. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6585. this.callback && this.callback(true);
  6586. this.hideSelf();
  6587. }
  6588. }
  6589. UIRepentProp.uiName = "UIRepentProp";
  6590. class UIMain extends UIBase {
  6591. constructor() {
  6592. super();
  6593. this.firstEnter = true;
  6594. }
  6595. nativeCallJs(msg) {
  6596. let t = msg;
  6597. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6598. switch (t) {
  6599. case 'qjff_chouJiang':
  6600. let dui = xGame.uiMgr.getUI(UIDraw);
  6601. dui.qjff_chouJiang();
  6602. break;
  6603. case 'qjff_AD_for_uisign':
  6604. let dui2 = xGame.uiMgr.getUI(UISign);
  6605. dui2.qjff_AD_for_uisign();
  6606. break;
  6607. case 'qjff_AD_for_uitry':
  6608. let dui3 = xGame.uiMgr.getUI(UITry);
  6609. dui3.qjff_AD_for_uitry();
  6610. break;
  6611. case 'qjff_AD_for_uipower':
  6612. let dui4 = xGame.uiMgr.getUI(UIPower);
  6613. dui4.qjff_AD_for_uipower();
  6614. break;
  6615. case 'qjff_AD_for_uigetAward':
  6616. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6617. dui5.qjff_AD_for_uigetAward();
  6618. break;
  6619. case 'qjff_AD_for_uiGameEnd':
  6620. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6621. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6622. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6623. break;
  6624. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6625. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6626. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6627. break;
  6628. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6629. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6630. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6631. break;
  6632. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6633. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6634. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6635. break;
  6636. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6637. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6638. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6639. break;
  6640. case 'qjff_AD_for_UIBOX_onOpenBox':
  6641. let dui11 = xGame.uiMgr.getUI(UIBox);
  6642. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6643. break;
  6644. case 'qjff_AD_for_UIAddCoin':
  6645. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6646. dui12.qjff_AD_for_UIAddCoin();
  6647. break;
  6648. case '111a':
  6649. let dui14 = xGame.uiMgr.getUI(UISign);
  6650. dui14.qjff_AD_for_uisign();
  6651. break;
  6652. case '222a':
  6653. let dui15 = xGame.uiMgr.getUI(UISign);
  6654. dui15.qjff_AD_for_uisign();
  6655. break;
  6656. case '333a':
  6657. let dui16 = xGame.uiMgr.getUI(UISign);
  6658. dui16.qjff_AD_for_uisign();
  6659. break;
  6660. default:
  6661. console.log('zh:未知的方法名字' + t);
  6662. break;
  6663. }
  6664. }
  6665. onConstructor() {
  6666. console.log('zh: UIMain onConstructor');
  6667. this.ui = ui_UIMain.createInstance();
  6668. this.contentPane = this.ui;
  6669. this.isEject = false;
  6670. this.addEvent();
  6671. this.addClickSpine();
  6672. this.settingNode = new SettingNode(this.ui.settingNode);
  6673. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6674. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6675. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6676. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6677. let curUse = DataMgr.getCurSecretary();
  6678. this.changeSecretary(curUse);
  6679. this.ui.talkNode.visible = false;
  6680. let guide = DataMgr.getSkillGuide();
  6681. if (xGame.common.isNewDay && guide == 1) {
  6682. xGame.common.isNewDay = false;
  6683. xGame.soundMgr.playSound("s_main01");
  6684. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6685. console.log("zh:播放小秘书每天语音");
  6686. }
  6687. this.ui.n83.visible = false;
  6688. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6689. }
  6690. changeSecretary(curUse) {
  6691. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6692. xGame.common.secretary && xGame.common.secretary.dispose();
  6693. this.addSecretarySpine(name);
  6694. }
  6695. addSecretarySpine(name) {
  6696. let spine = new SpineMgr(name, () => {
  6697. this.playSecretaryIdle();
  6698. });
  6699. xGame.common.secretary = spine;
  6700. }
  6701. addClickSpine() {
  6702. let clickSpine = new SpineMgr("dianji", () => {
  6703. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6704. let parent = Laya.stage;
  6705. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6706. clickSpine.play(data, 0, false, parent, (spine) => {
  6707. spine.destroy(true);
  6708. });
  6709. });
  6710. });
  6711. }
  6712. addEvent() {
  6713. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6714. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6715. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6716. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6717. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6718. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6719. this.addUIClick(this.ui, this.interuptSecretary);
  6720. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6721. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6722. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6723. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6724. this.addUIClick(this.ui.signBtn, this.openSignView);
  6725. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6726. this.addUIClick(this.ui.rankBtn, this.openRanking);
  6727. }
  6728. show(showFailWords) {
  6729. super.show();
  6730. this.moneyNode.ui.c1.selectedIndex = 1;
  6731. this.playSecretaryIdle();
  6732. xGame.soundMgr.playMusic("caromhall01", 0);
  6733. Laya.timer.clearAll(this);
  6734. this.playSecretaryRandomSound();
  6735. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  6736. if (showFailWords) {
  6737. console.log('zh:uimain.ts ');
  6738. setTimeout(() => {
  6739. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6740. let words = -1;
  6741. if (str == "s_main02") {
  6742. words = 2;
  6743. }
  6744. else {
  6745. words = 3;
  6746. }
  6747. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6748. xGame.soundMgr.playSound(str);
  6749. }, 300);
  6750. }
  6751. this.showGuide();
  6752. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6753. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6754. let guide = DataMgr.getSkillGuide();
  6755. if (guide == 1) {
  6756. let randTime = xGame.common.randomNum(300, 800);
  6757. if (this.firstEnter) {
  6758. console.log("zh: firstEnter");
  6759. this.firstEnter = false;
  6760. randTime += 900;
  6761. }
  6762. else {
  6763. console.log("zh: no firstEnter");
  6764. }
  6765. Laya.timer.once(randTime, this, () => {
  6766. xGame.common.autoPopUIView();
  6767. });
  6768. }
  6769. }
  6770. checkActive(show) {
  6771. }
  6772. showGuide() {
  6773. let guide = DataMgr.getSkillGuide();
  6774. this.ui.guideBtn.visible = guide == 0;
  6775. this.ui.enterGuide.visible = false;
  6776. this.ui.secretaryGuide.visible = guide == 0;
  6777. if (guide == 0) {
  6778. console.log("zh:显示引导");
  6779. xGame.soundMgr.playSound("s_guide");
  6780. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6781. }
  6782. else {
  6783. console.log("zh:不需要显示引导");
  6784. }
  6785. }
  6786. ensureSecretary() {
  6787. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6788. this.ui.secretaryGuide.visible = false;
  6789. this.ui.enterGuide.visible = true;
  6790. this.ui.wordsNode.t0.play();
  6791. if (DataMgr.getNewUser())
  6792. Moyu.sendDataEvent("gameReady");
  6793. }
  6794. playSecretaryIdle() {
  6795. let parent = this.ui.secretary.displayObject;
  6796. parent.destroyChildren();
  6797. let xx = this.ui.secretary.width / 2;
  6798. let yy = this.ui.secretary.height;
  6799. let scale = xGame.common.getSecretaryScale();
  6800. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6801. console.log("zh:playSecretaryIdle", data);
  6802. xGame.common.secretary.play(data, 0, true, parent);
  6803. }
  6804. startGame(type) {
  6805. xGame.common.gameMode = type;
  6806. Moyu.sendDataEvent("PlayGame", { type: type });
  6807. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  6808. switch (xGame.common.gameMode) {
  6809. case GameMode.classic:
  6810. console.log('zh:进入经典模式111111111');
  6811. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  6812. let db_over_lev = DataMgr.getChallengeMode_overLev();
  6813. console.log('zh:classic db_over_lev=', db_over_lev);
  6814. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  6815. console.log('zh:判断是否可以玩该模式classic =NO');
  6816. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  6817. xGame.uiMgr.Show(UIMsg, tipStr);
  6818. console.log('zh:返回');
  6819. return;
  6820. }
  6821. else {
  6822. console.log('zh:可以玩该模式classic 66666666666666');
  6823. this.beginGame();
  6824. }
  6825. }
  6826. else {
  6827. console.log('zh:不需要判断是否可以玩该classic');
  6828. let challengeTimes = DataMgr.getChallengeTimes();
  6829. if (challengeTimes == 0) {
  6830. xGame.uiMgr.Show(UIInvitation);
  6831. }
  6832. else {
  6833. this.beginGame();
  6834. }
  6835. break;
  6836. }
  6837. case GameMode.bigMove:
  6838. console.error('zh:bigMove check');
  6839. let guide = DataMgr.getSkillGuide();
  6840. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  6841. let db_over_lev = DataMgr.getChallengeMode_overLev();
  6842. console.log('zh:bigMove db_over_lev=', db_over_lev);
  6843. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  6844. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  6845. xGame.uiMgr.Show(UIMsg, tipStr);
  6846. return;
  6847. }
  6848. else {
  6849. console.log('zh:可以玩该模式 bigMove');
  6850. this.beginGame();
  6851. if (DataMgr.getNewUser())
  6852. Moyu.sendDataEvent("gameStart0");
  6853. }
  6854. }
  6855. else {
  6856. this.beginGame();
  6857. if (DataMgr.getNewUser())
  6858. Moyu.sendDataEvent("gameStart0");
  6859. }
  6860. break;
  6861. default:
  6862. console.error('zh:未知错误!!!!');
  6863. break;
  6864. }
  6865. }
  6866. beginGame(isNice = false) {
  6867. console.log('zh:beginGame ');
  6868. let guide = DataMgr.getSkillGuide();
  6869. if (guide == 1) {
  6870. console.log('zh:非新手引导,showInternAd ');
  6871. JSBridgeUtils.instance.showInternAd('beginGame');
  6872. }
  6873. else {
  6874. console.log('zh:新手引导,不显示AD ');
  6875. }
  6876. console.log('zh:beginGame 2 go');
  6877. if (xGame.common.gameMode == GameMode.classic) {
  6878. if (isNice) {
  6879. this.enterClassic();
  6880. }
  6881. else {
  6882. xGame.uiMgr.Show(UIModeSelection, () => {
  6883. console.log('zh:BBBBBBBBBBBBBBB');
  6884. this.enterClassic();
  6885. });
  6886. }
  6887. }
  6888. else if (xGame.common.gameMode == GameMode.bigMove) {
  6889. this.ui.enterGuide.visible = false;
  6890. xGame.uiMgr.Show(UISkill);
  6891. }
  6892. }
  6893. enterClassic() {
  6894. xGame.uiMgr.Show(UIGame);
  6895. xGame.uiMgr.Show(UIMatching, () => {
  6896. if (!this.isHide)
  6897. this.hide();
  6898. xGame.common.gameUI.ui.alpha = 1;
  6899. xGame.common.gameUI.startGame();
  6900. xGame.uiMgr.Hide(UIGameEnd);
  6901. });
  6902. }
  6903. startGlobal() {
  6904. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6905. }
  6906. startWeekly() {
  6907. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6908. }
  6909. zhouSaiMonth() {
  6910. console.log('zh: zhouSaiMonth 被调用');
  6911. }
  6912. startPlaceBall() {
  6913. xGame.uiMgr.Show(UILevelDisplay);
  6914. }
  6915. hide() {
  6916. console.log('zh:uimain hide ...');
  6917. super.hide();
  6918. xGame.common.stopGirlPop(this.ui.talkNode);
  6919. }
  6920. onGetUserInfo(force = false) {
  6921. if (Moyu.isWx) {
  6922. let info = Moyu.getSystemInfo();
  6923. if (info)
  6924. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6925. }
  6926. else {
  6927. Moyu.initUser(this, this.freshUser, force);
  6928. }
  6929. if (!Moyu.hasUserInfo) {
  6930. let user = Moyu.getUserInfo();
  6931. user.headIcon = 'res/ty_touxiang.png';
  6932. }
  6933. this.freshUser();
  6934. }
  6935. freshUser() {
  6936. let user = Moyu.getUserInfo();
  6937. if (!user.isAuth) {
  6938. user.headIcon = 'res/ty_touxiang.png';
  6939. }
  6940. else
  6941. DataMgr.upRankData();
  6942. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6943. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6944. }
  6945. interuptSecretary() {
  6946. Laya.timer.clearAll(this);
  6947. this.playSecretaryRandomSound();
  6948. }
  6949. playSecretaryRandomSound() {
  6950. if (this.isHide)
  6951. return;
  6952. let time = xGame.common.randomNum(45000, 60000);
  6953. Laya.timer.once(time, this, () => {
  6954. if (this.isHide)
  6955. return;
  6956. let index = xGame.common.randomNum(4, 7);
  6957. xGame.soundMgr.playSound("s_main0" + index);
  6958. let words = 1;
  6959. switch (index) {
  6960. case 4:
  6961. words = 5;
  6962. break;
  6963. case 5:
  6964. words = 3;
  6965. break;
  6966. case 6:
  6967. words = 6;
  6968. break;
  6969. case 7:
  6970. words = 7;
  6971. break;
  6972. default:
  6973. break;
  6974. }
  6975. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6976. this.playSecretaryRandomSound();
  6977. });
  6978. }
  6979. openSecretaryView() {
  6980. xGame.uiMgr.Show(UISecretary);
  6981. Moyu.sendDataEvent("secretary");
  6982. }
  6983. openShopView() {
  6984. xGame.uiMgr.Show(UIShop);
  6985. }
  6986. openSignView() {
  6987. xGame.uiMgr.Show(UISign);
  6988. }
  6989. openDrawView() {
  6990. xGame.uiMgr.Show(UIDraw);
  6991. }
  6992. openRanking() {
  6993. console.log('zh:phb openRanking');
  6994. xGame.uiMgr.Show(UIRanking);
  6995. Moyu.sendDataEvent("rankingList");
  6996. }
  6997. }
  6998. UIMain.uiName = "UIMain";
  6999. class UIGameEnd extends UIBase {
  7000. constructor() {
  7001. super();
  7002. this.success = false;
  7003. this.awardCoinNum = 1000;
  7004. this.awardDiamondNum = 10;
  7005. }
  7006. onConstructor() {
  7007. this.ui = ui_UIGameEnd.createInstance();
  7008. this.contentPane = this.ui;
  7009. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7010. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7011. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7012. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7013. this.ui.talkNode.visible = false;
  7014. if (Moyu.isKs)
  7015. this.ui.closeNode.closeBtn.x += 100;
  7016. }
  7017. updateType() {
  7018. switch (xGame.common.gameMode) {
  7019. case GameMode.classic:
  7020. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7021. this.ui.coinNode.visible = this.success;
  7022. if (!this.success) {
  7023. Laya.timer.once(500, this, () => {
  7024. xGame.uiMgr.Show(UIAddCoin);
  7025. });
  7026. }
  7027. else {
  7028. this.logEventForClassic_win();
  7029. }
  7030. this.ui.isGetAward.visible = false;
  7031. this.ui.leftBtn.c1.selectedIndex = 3;
  7032. this.ui.rightBtn.c1.selectedIndex = 0;
  7033. this.moneyNode.ui.c1.selectedIndex = 1;
  7034. break;
  7035. case GameMode.bigMove:
  7036. console.log('zh:招法模式 aaaaaa bigMove');
  7037. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7038. this.ui.coinNode.visible = this.success;
  7039. if (xGame.common.gameMode == GameMode.bigMove) {
  7040. if (this.success) {
  7041. DataMgr.setSkillSuccessTimes(1, true);
  7042. DataMgr.setSkillAccTimes(1);
  7043. }
  7044. else {
  7045. DataMgr.setSkillSuccessTimes(0, false);
  7046. }
  7047. }
  7048. this.logEventForRod_complete_N();
  7049. if (!this.success) {
  7050. Laya.timer.once(500, this, () => {
  7051. xGame.uiMgr.Show(UIAddCoin);
  7052. });
  7053. }
  7054. else {
  7055. this.logEventForRod_win();
  7056. }
  7057. this.ui.isGetAward.visible = false;
  7058. this.ui.leftBtn.c1.selectedIndex = 3;
  7059. this.ui.rightBtn.c1.selectedIndex = 0;
  7060. this.moneyNode.ui.c1.selectedIndex = 1;
  7061. break;
  7062. case GameMode.placeBall:
  7063. this.ui.coinNode.visible = false;
  7064. if (this.success) {
  7065. if (xGame.common.placeBallStarNum == 3) {
  7066. this.ui.c1.selectedIndex = 2;
  7067. }
  7068. else {
  7069. this.ui.c1.selectedIndex = 3;
  7070. }
  7071. let level = xGame.common.placeBallCurLevel;
  7072. if (level > 59) {
  7073. this.logEventForChallenge_level_complete(level);
  7074. }
  7075. else {
  7076. this.logEventForChallenge_level_N(level);
  7077. }
  7078. }
  7079. else {
  7080. this.ui.c1.selectedIndex = 4;
  7081. }
  7082. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7083. if (cfg.type == PlaceBallType.challenge) {
  7084. this.ui.c1.selectedIndex = 2;
  7085. }
  7086. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7087. this.updatePlaceBallBtn();
  7088. this.updatePlaceBallStarNum();
  7089. this.updatePlaceBallAwardState();
  7090. this.moneyNode.ui.c1.selectedIndex = 2;
  7091. this.moneyNode.checkPowerTime();
  7092. this.moneyNode.powerChange();
  7093. DataMgr.upRankData();
  7094. break;
  7095. default:
  7096. break;
  7097. }
  7098. }
  7099. logEventForRod_complete_N() {
  7100. let gfmsIdx = xGame.common.curPlayerSkillType;
  7101. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7102. let gfmc = 'Skyfall Shot';
  7103. if (gfmsIdx == 0) {
  7104. gfmc = 'Skyfall Shot';
  7105. }
  7106. if (gfmsIdx == 1) {
  7107. gfmc = 'Surging break';
  7108. }
  7109. if (gfmsIdx == 2) {
  7110. gfmc = 'Frost Lock';
  7111. }
  7112. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7113. console.log('zh:logEventForRod_complete_N level = ' + level);
  7114. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7115. let jsonStr = {
  7116. "count": 1,
  7117. "name": gfmc
  7118. };
  7119. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7120. const d = LocalStorageManager.getItem(keyStr);
  7121. jsonStr.count = d.count + 1;
  7122. LocalStorageManager.setItem(keyStr, jsonStr);
  7123. }
  7124. else {
  7125. LocalStorageManager.setItem(keyStr, jsonStr);
  7126. }
  7127. const d2 = LocalStorageManager.getItem(keyStr);
  7128. let count = d2.count;
  7129. console.log('zh:logEventForRod_complete_N count = ' + count);
  7130. if (count % 5 == 0) {
  7131. const reqStr = JSON.stringify(jsonStr);
  7132. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7133. }
  7134. }
  7135. logEventForRod_win() {
  7136. console.log('zh:logEventForRod_win,胜利');
  7137. let gfmsIdx = xGame.common.curPlayerSkillType;
  7138. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  7139. let gfmc = 'Skyfall Shot';
  7140. if (gfmsIdx == 0) {
  7141. gfmc = 'Skyfall Shot';
  7142. }
  7143. if (gfmsIdx == 1) {
  7144. gfmc = 'Surging break';
  7145. }
  7146. if (gfmsIdx == 2) {
  7147. gfmc = 'Frost Lock';
  7148. }
  7149. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7150. console.log('zh:logEventForRod_win level = ' + level);
  7151. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  7152. let jsonStr = {
  7153. "count": 1,
  7154. "name": gfmc + ' Lev' + level
  7155. };
  7156. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7157. const d = LocalStorageManager.getItem(keyStr);
  7158. jsonStr.count = d.count + 1;
  7159. LocalStorageManager.setItem(keyStr, jsonStr);
  7160. }
  7161. else {
  7162. LocalStorageManager.setItem(keyStr, jsonStr);
  7163. }
  7164. const reqStr = JSON.stringify(jsonStr);
  7165. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  7166. }
  7167. logEventForClassic_win() {
  7168. console.log('zh:logEventForClassic_win,胜利');
  7169. let rtype = xGame.common.classicRoomType;
  7170. let msmc = '';
  7171. if (rtype == 1) {
  7172. msmc = 'beginner';
  7173. }
  7174. if (rtype == 2) {
  7175. msmc = 'expert';
  7176. }
  7177. if (rtype == 3) {
  7178. msmc = 'master';
  7179. }
  7180. let keyStr = 'sjmd_classic_win_' + rtype;
  7181. let jsonStr = {
  7182. "difficulty": msmc,
  7183. "classic_count": 1,
  7184. "difficulty_count": 1
  7185. };
  7186. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7187. const d = LocalStorageManager.getItem(keyStr);
  7188. jsonStr.classic_count = d.classic_count + 1;
  7189. jsonStr.difficulty_count = d.difficulty_count + 1;
  7190. LocalStorageManager.setItem(keyStr, jsonStr);
  7191. }
  7192. else {
  7193. LocalStorageManager.setItem(keyStr, jsonStr);
  7194. }
  7195. const reqStr = JSON.stringify(jsonStr);
  7196. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  7197. }
  7198. updatePlaceBallBtn() {
  7199. this.ui.leftBtn.c1.selectedIndex = 5;
  7200. if (this.success) {
  7201. this.ui.rightBtn.c1.selectedIndex = 14;
  7202. }
  7203. else {
  7204. if (xGame.common.placeBallStarNum == 3) {
  7205. this.ui.rightBtn.c1.selectedIndex = 14;
  7206. }
  7207. else {
  7208. this.ui.rightBtn.c1.selectedIndex = 1;
  7209. }
  7210. }
  7211. }
  7212. updatePlaceBallStarNum() {
  7213. let starNum = xGame.common.placeBallStarNum;
  7214. if (starNum == 0)
  7215. this.ui.starNumNode.c1.selectedIndex = 3;
  7216. else {
  7217. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  7218. }
  7219. }
  7220. updatePlaceBallAwardState() {
  7221. let level = xGame.common.placeBallCurLevel;
  7222. let starNum = xGame.common.placeBallStarNum;
  7223. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7224. let data = cfgTable.placeballData[level].award;
  7225. let cfg = cfgTable.placeballData[level];
  7226. this.awardDiamondNum = data[1];
  7227. this.awardCoinNum = data[0];
  7228. if (cfg.type == PlaceBallType.challenge) {
  7229. this.awardDiamondNum = 0;
  7230. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7231. }
  7232. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  7233. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  7234. if (cfg.type == PlaceBallType.challenge) {
  7235. this.ui.awardNode.coinNode.visible = true;
  7236. }
  7237. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  7238. this.ui.awardNode.diamondNode.x = 265;
  7239. this.ui.awardNode.coinNode.x = 354;
  7240. }
  7241. else {
  7242. this.ui.awardNode.diamondNode.x = 291;
  7243. this.ui.awardNode.coinNode.x = 291;
  7244. }
  7245. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  7246. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  7247. if (this.awardCoinNum == 0) {
  7248. this.ui.awardNode.coinNode.numTxt.text = "";
  7249. }
  7250. if (getAward) {
  7251. this.ui.isGetAward.visible = true;
  7252. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  7253. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  7254. }
  7255. else {
  7256. this.ui.isGetAward.visible = false;
  7257. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  7258. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  7259. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  7260. }
  7261. else {
  7262. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  7263. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  7264. }
  7265. }
  7266. }
  7267. show(success) {
  7268. super.show();
  7269. xGame.eventMgr.event(RESET_GAME);
  7270. this.success = success;
  7271. Laya.timer.clearAll(this);
  7272. this.playSecretaryAni();
  7273. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  7274. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  7275. offsetTime = Math.floor(offsetTime / 1000);
  7276. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  7277. this.updateType();
  7278. Laya.timer.once(200, this, () => {
  7279. this.addAward(() => {
  7280. this.updateType();
  7281. Laya.timer.once(500, this, () => {
  7282. this.showChallengeLevel();
  7283. });
  7284. });
  7285. });
  7286. if (this.success) {
  7287. JSBridgeUtils.instance.showInternAd('gameend_success');
  7288. console.log('zh:game end 成功');
  7289. xGame.soundMgr.playSound('slots_roll01');
  7290. xGame.soundMgr.playSound("s_win");
  7291. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7292. this.diyGameDataUtilForGameWin();
  7293. }
  7294. else {
  7295. JSBridgeUtils.instance.showInternAd('gameend_faill');
  7296. console.log('zh:game end失败');
  7297. xGame.soundMgr.playSound('matchwin01');
  7298. xGame.soundMgr.playSound("s_lose");
  7299. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7300. }
  7301. let challengeNum = DataMgr.getChallengeTimes();
  7302. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7303. DataMgr.setChallengeTimes(1);
  7304. }
  7305. if (this.success && xGame.common.gameMode == GameMode.classic) {
  7306. DataMgr.setClassicTimes();
  7307. }
  7308. }
  7309. diyGameDataUtilForGameWin() {
  7310. console.log('zh: DiyGameDataUtilForGameWin diy ');
  7311. switch (xGame.common.gameMode) {
  7312. case GameMode.classic:
  7313. console.log('zh:DiyGameDataUtilForGameWin 111');
  7314. case GameMode.bigMove:
  7315. console.log('zh:DiyGameDataUtilForGameWin 222');
  7316. this.restartGame();
  7317. break;
  7318. case GameMode.placeBall:
  7319. console.log('zh:DiyGameDataUtilForGameWin 333');
  7320. var level = xGame.common.placeBallCurLevel;
  7321. console.log('zh:练习模式 联系了多少LEV=' + level);
  7322. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7323. if (level > db_over_lev) {
  7324. DataMgr.setChallengeMode_overLev(level);
  7325. }
  7326. break;
  7327. default:
  7328. console.log('zh:DiyGameDataUtilForGameWin 444');
  7329. break;
  7330. }
  7331. }
  7332. showChallengeLevel() {
  7333. if (DataMgr.getChallengeTimes() != 0)
  7334. return;
  7335. let skill = DataMgr.getSkillAccTimes();
  7336. let put = DataMgr.getPlaceBallLevelList().length;
  7337. if (skill >= 3 || put >= 5) {
  7338. xGame.uiMgr.Show(UIInvitation);
  7339. this.hide();
  7340. }
  7341. }
  7342. addAward(callback) {
  7343. if (!this.success) {
  7344. callback && callback();
  7345. return;
  7346. }
  7347. switch (xGame.common.gameMode) {
  7348. case GameMode.classic:
  7349. this.awardCoinNum = xGame.common.passAwardCoin;
  7350. this.awardDiamondNum = 0;
  7351. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7352. break;
  7353. case GameMode.bigMove:
  7354. this.awardCoinNum = xGame.common.passAwardCoin;
  7355. this.awardDiamondNum = 0;
  7356. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7357. callback && callback();
  7358. break;
  7359. case GameMode.placeBall:
  7360. let level = xGame.common.placeBallCurLevel;
  7361. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  7362. if (xGame.common.placeBallStarNum != 3) {
  7363. callback && callback();
  7364. return;
  7365. }
  7366. else {
  7367. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7368. if (getAward) {
  7369. callback && callback();
  7370. return;
  7371. }
  7372. }
  7373. let cfg = cfgTable.placeballData[level];
  7374. let data = cfgTable.placeballData[level].award;
  7375. this.awardCoinNum = data[0];
  7376. this.awardDiamondNum = data[1];
  7377. if (cfg.type == PlaceBallType.challenge) {
  7378. this.awardDiamondNum = 0;
  7379. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7380. }
  7381. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  7382. let diamondAward;
  7383. if (this.awardDiamondNum > 0) {
  7384. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  7385. xGame.common.getAward([diamondAward, coinAward], callback);
  7386. }
  7387. else {
  7388. xGame.common.getAward([coinAward], callback);
  7389. }
  7390. if (cfg.type == PlaceBallType.normal) {
  7391. DataMgr.setPlaceBallAward(level);
  7392. }
  7393. break;
  7394. default:
  7395. break;
  7396. }
  7397. }
  7398. playSecretaryAni_old() {
  7399. let parent = this.ui.secretary.displayObject;
  7400. parent.destroyChildren();
  7401. let xx = this.ui.secretary.width / 2;
  7402. let yy = this.ui.secretary.height;
  7403. let scale = xGame.common.getSecretaryScale();
  7404. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7405. if (this.success) {
  7406. let rand = Math.random() <= 0.5 ? 2 : 3;
  7407. xGame.common.secretary.play(data, rand, false, parent, () => {
  7408. xGame.common.secretary.play(data, 1, true, parent);
  7409. });
  7410. }
  7411. else {
  7412. xGame.common.secretary.play(data, 0, true, parent);
  7413. }
  7414. }
  7415. playSecretaryAni() {
  7416. let parent = this.ui.secretary.displayObject;
  7417. parent.destroyChildren();
  7418. let xx = this.ui.secretary.width / 2;
  7419. let yy = this.ui.secretary.height;
  7420. let scale = xGame.common.getSecretaryScale();
  7421. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7422. if (this.success) {
  7423. let rand = 0;
  7424. xGame.common.secretary.play(data, 0, true, parent);
  7425. }
  7426. else {
  7427. xGame.common.secretary.play(data, 0, true, parent);
  7428. }
  7429. }
  7430. restartGame() {
  7431. switch (xGame.common.gameMode) {
  7432. case GameMode.classic:
  7433. xGame.eventMgr.event(RESTART_GAME);
  7434. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7435. break;
  7436. case GameMode.bigMove:
  7437. this.hide();
  7438. xGame.eventMgr.event(RESTART_GAME);
  7439. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7440. break;
  7441. default:
  7442. break;
  7443. }
  7444. }
  7445. hide() {
  7446. super.hide();
  7447. xGame.common.stopGirlPop(this.ui.talkNode);
  7448. PlatMgr.showBanner(false);
  7449. }
  7450. returnHome() {
  7451. this.hide();
  7452. let showFailWords = !this.success;
  7453. xGame.uiMgr.Show(UIMain, showFailWords);
  7454. }
  7455. clickLeftBtn() {
  7456. switch (xGame.common.gameMode) {
  7457. case GameMode.classic:
  7458. case GameMode.bigMove:
  7459. this.returnHome();
  7460. break;
  7461. case GameMode.placeBall:
  7462. let level = xGame.common.placeBallCurLevel;
  7463. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7464. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7465. break;
  7466. default:
  7467. break;
  7468. }
  7469. }
  7470. powerStartPlaceBallLevel(level, btn) {
  7471. if (DataMgr.powerEnough()) {
  7472. btn.touchable = false;
  7473. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7474. btn.touchable = true;
  7475. DataMgr.setPower(-1);
  7476. xGame.eventMgr.event(POWER_TIME);
  7477. this.startPlaceBallLevel(level);
  7478. this.logEventForChallenge_level_start(level);
  7479. }));
  7480. }
  7481. else {
  7482. xGame.uiMgr.Show(UIPower, 0);
  7483. }
  7484. }
  7485. clickRightBtn() {
  7486. switch (xGame.common.gameMode) {
  7487. case GameMode.classic:
  7488. console.log('zh:clickRightBtn 111');
  7489. case GameMode.bigMove:
  7490. console.log('zh:clickRightBtn 222');
  7491. this.restartGame();
  7492. break;
  7493. case GameMode.placeBall:
  7494. console.log('zh:clickRightBtn 333');
  7495. let level = xGame.common.placeBallCurLevel;
  7496. let data = DataMgr.getPlaceBallLevel(level);
  7497. let curPss = data.play && !data.isCur;
  7498. if (curPss) {
  7499. console.log('zh:clickRightBtn 333-111');
  7500. console.log('zh:当前LV=' + level);
  7501. if (level == 60) {
  7502. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7503. Laya.timer.once(3000, this, () => {
  7504. this.returnHome();
  7505. });
  7506. }
  7507. else {
  7508. let lev = level + 1;
  7509. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  7510. }
  7511. }
  7512. else {
  7513. console.log('zh:clickRightBtn 333-000');
  7514. Moyu.sendDataEvent("placeBallNextLevel");
  7515. console.log('zh:qjff_AD_for_uiGameEnd');
  7516. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7517. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7518. }
  7519. else {
  7520. console.log('zh:AD 失败,直接发放奖励');
  7521. this.qjff_AD_for_uiGameEnd(level);
  7522. }
  7523. }
  7524. break;
  7525. default:
  7526. console.log('zh:clickRightBtn 444');
  7527. break;
  7528. }
  7529. }
  7530. logEventForChallenge_level_start(level) {
  7531. let keyStr = 'sjmd_challenge_level_start';
  7532. let jsonStr = {
  7533. "count": 0,
  7534. "gold_balance ": DataMgr.getCoin(),
  7535. "level": level,
  7536. "diamond_balance ": DataMgr.getDiamond()
  7537. };
  7538. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7539. const d = LocalStorageManager.getItem(keyStr);
  7540. if (level > d.level) {
  7541. jsonStr.count = d.count + 1;
  7542. LocalStorageManager.setItem(keyStr, jsonStr);
  7543. }
  7544. else {
  7545. }
  7546. }
  7547. else {
  7548. LocalStorageManager.setItem(keyStr, jsonStr);
  7549. }
  7550. const reqStr = JSON.stringify(jsonStr);
  7551. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  7552. }
  7553. qjff_AD_for_uiGameEnd(level) {
  7554. DataMgr.setPlaceBallLevel(level, 1);
  7555. this.startPlaceBallLevel(level + 1);
  7556. }
  7557. startPlaceBallLevel(level) {
  7558. xGame.common.gameMode = GameMode.placeBall;
  7559. xGame.common.placeBallCurLevel = level;
  7560. xGame.uiMgr.Show(UIGame);
  7561. this.hide();
  7562. }
  7563. logEventForChallenge_level_complete(level) {
  7564. let keyStr = 'sjmd_challenge_level_complete';
  7565. let jsonStr = {
  7566. "count": 1,
  7567. "gold_balance ": DataMgr.getCoin(),
  7568. "level": level,
  7569. "diamond_balance ": DataMgr.getDiamond()
  7570. };
  7571. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7572. const d = LocalStorageManager.getItem(keyStr);
  7573. jsonStr.count = d.count + 1;
  7574. LocalStorageManager.setItem(keyStr, jsonStr);
  7575. }
  7576. else {
  7577. LocalStorageManager.setItem(keyStr, jsonStr);
  7578. }
  7579. const reqStr = JSON.stringify(jsonStr);
  7580. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  7581. }
  7582. logEventForChallenge_level_N(level) {
  7583. console.log('zh:logEventForChallenge_level_N ' + level);
  7584. let keyStr = 'sjmd_challenge_level_N';
  7585. if (LocalStorageManager.hasKey(keyStr)) {
  7586. let lev = LocalStorageManager.getItem(keyStr);
  7587. if (level > lev) {
  7588. LocalStorageManager.setItem(keyStr, level);
  7589. }
  7590. if ((level) % 5 == 0) {
  7591. console.log('zh:每5关上报1次');
  7592. let sjmc = 'challenge_level_' + level;
  7593. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  7594. }
  7595. else {
  7596. console.log('zh:5 no 上报');
  7597. }
  7598. }
  7599. else {
  7600. LocalStorageManager.setItem(keyStr, level);
  7601. }
  7602. }
  7603. }
  7604. UIGameEnd.uiName = "UIGameEnd";
  7605. class ui_UIVideoShare extends fgui.GComponent {
  7606. static createInstance() {
  7607. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7608. }
  7609. onConstruct() {
  7610. this.n10 = (this.getChild("n10"));
  7611. this.myNode = (this.getChild("myNode"));
  7612. this.t0 = this.getTransition("t0");
  7613. }
  7614. }
  7615. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7616. class UIVideoShare extends UIBase {
  7617. constructor() {
  7618. super();
  7619. this.success = false;
  7620. this.awardNum = 0;
  7621. this.isShared = true;
  7622. }
  7623. onConstructor() {
  7624. this.ui = ui_UIVideoShare.createInstance();
  7625. this.contentPane = this.ui;
  7626. this.isEject = false;
  7627. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7628. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7629. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7630. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7631. }
  7632. show(success) {
  7633. super.show();
  7634. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7635. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7636. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7637. this.success = success;
  7638. let time = xGame.common.randomNum(600, 1500);
  7639. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  7640. if (success)
  7641. xGame.soundMgr.playSound("applause");
  7642. this.ui.t0.play();
  7643. this.checkShareState();
  7644. let times = DataMgr.getDailyVideoShareTimes();
  7645. this.awardNum = times == 0 ? 2000 : 200;
  7646. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  7647. }
  7648. checkShareState() {
  7649. if (PlatMgr.forceShare == 0) {
  7650. this.ui.myNode.closeBtn.visible = true;
  7651. this.ui.myNode.tipsNode.visible = false;
  7652. this.ui.myNode.closeBtn.x = 90;
  7653. this.ui.myNode.shareBtn.x = 342;
  7654. }
  7655. else if (PlatMgr.forceShare == 1) {
  7656. this.ui.myNode.closeBtn.visible = false;
  7657. this.ui.myNode.tipsNode.visible = true;
  7658. this.ui.myNode.shareBtn.x = 218;
  7659. this.isShared = true;
  7660. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7661. }
  7662. }
  7663. checkForceShare() {
  7664. this.isShared = !this.isShared;
  7665. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7666. }
  7667. videoShare() {
  7668. if (PlatMgr.forceShare == 1) {
  7669. if (this.isShared) {
  7670. this.shareGame();
  7671. }
  7672. else {
  7673. this.hideSelf();
  7674. }
  7675. }
  7676. else {
  7677. this.shareGame();
  7678. }
  7679. }
  7680. shareGame() {
  7681. Moyu.sendDataEvent("VideoShare");
  7682. if (Moyu.canShare() > 100) {
  7683. Moyu.shareGame((success) => {
  7684. if (success) {
  7685. DataMgr.setDailyVideoShareTimes(1);
  7686. DataMgr.setCoin(this.awardNum);
  7687. }
  7688. this.hideSelf();
  7689. }, this);
  7690. }
  7691. else {
  7692. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  7693. this.hideSelf();
  7694. }
  7695. }
  7696. hideSelf() {
  7697. this.hide();
  7698. xGame.uiMgr.Show(UIGameEnd, this.success);
  7699. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  7700. xGame.common.screenImg.destroy();
  7701. xGame.common.screenImg = null;
  7702. }
  7703. }
  7704. }
  7705. UIVideoShare.uiName = "UIVideoShare";
  7706. class ui_UITips extends fgui.GComponent {
  7707. static createInstance() {
  7708. return (fgui.UIPackage.createObject("game", "UITips"));
  7709. }
  7710. onConstruct() {
  7711. this.n0 = (this.getChild("n0"));
  7712. this.myNode = (this.getChild("myNode"));
  7713. this.t0 = this.getTransition("t0");
  7714. }
  7715. }
  7716. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7717. class UITips extends UIBase {
  7718. constructor() {
  7719. super();
  7720. this.type = 0;
  7721. }
  7722. onConstructor() {
  7723. this.ui = ui_UITips.createInstance();
  7724. this.contentPane = this.ui;
  7725. this.isEject = false;
  7726. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7727. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7728. }
  7729. show(tipsTxt, womanTxt, type) {
  7730. super.show();
  7731. this.ui.t0.play();
  7732. this.ui.myNode.tipsTxt.text = tipsTxt;
  7733. this.ui.myNode.womanTxt.text = womanTxt;
  7734. PlatMgr.showInsert(true);
  7735. this.ui.myNode.c1.selectedIndex = type;
  7736. this.type = type;
  7737. switch (this.type) {
  7738. case TipsType.exitGame:
  7739. xGame.common.gameMgr.gamePause = true;
  7740. break;
  7741. case TipsType.foul:
  7742. Laya.timer.once(200, this, () => {
  7743. xGame.common.gameMgr.gamePause = true;
  7744. });
  7745. break;
  7746. default:
  7747. break;
  7748. }
  7749. }
  7750. clickLeftBtn() {
  7751. this.hide();
  7752. xGame.common.gameMgr.gamePause = false;
  7753. switch (this.type) {
  7754. case TipsType.exitGame:
  7755. break;
  7756. case TipsType.foul:
  7757. break;
  7758. default:
  7759. break;
  7760. }
  7761. }
  7762. clickRightBtn() {
  7763. this.hide();
  7764. switch (this.type) {
  7765. case TipsType.exitGame:
  7766. xGame.eventMgr.event(RESET_GAME);
  7767. xGame.uiMgr.Show(UIMain);
  7768. Moyu.recordEnd(this, null);
  7769. xGame.common.longHelpLine = false;
  7770. break;
  7771. case TipsType.foul:
  7772. xGame.common.gameMgr.gamePause = false;
  7773. Laya.timer.clearAll(this);
  7774. break;
  7775. default:
  7776. break;
  7777. }
  7778. }
  7779. }
  7780. UITips.uiName = "UITips";
  7781. class GameMgr {
  7782. constructor() {
  7783. this.selfCamp = "";
  7784. this.selfFoulNum = 0;
  7785. this.selfBallArr = [];
  7786. this.selfTimer = 0;
  7787. this.selfScore = 0;
  7788. this.aiCamp = "";
  7789. this.aiFoulNum = 0;
  7790. this.aiBallArr = [];
  7791. this.aiTimer = 0;
  7792. this.aiScore = 0;
  7793. this.aiSkillLevelNum = 1;
  7794. this.targertScore = 0;
  7795. this.setTime = 30;
  7796. this.selfTurnRate = 0.5;
  7797. this.accTime = 0;
  7798. this.curFoul = "";
  7799. this.maxFoulTimes = 3;
  7800. this.isFirstInGame = true;
  7801. this.firstColliObj = null;
  7802. this.inHoleBalls = [];
  7803. this.blackNum = 8;
  7804. this.success = false;
  7805. this.holePosList = [];
  7806. this.posObj = {};
  7807. this._selfTurn = false;
  7808. this.lastRootBallPos = new Laya.Vector2(311, 430);
  7809. this.ensureBallType = false;
  7810. this.isOpenBall = true;
  7811. this.finishOneShoot = true;
  7812. this.isEnd = false;
  7813. this.isChangeTurn = false;
  7814. this.isInterrupt = false;
  7815. this.aiPlayedBreakArmy = false;
  7816. this.isTouchedBall = false;
  7817. this.finishBalls = 0;
  7818. this.needBalls = 0;
  7819. this.allBallNum = 0;
  7820. this.placeBallPosData = {};
  7821. this.curHP = 0;
  7822. this.showLongView = false;
  7823. this.firstShoot = true;
  7824. this._gamePause = false;
  7825. this.trunCount = 0;
  7826. this.isBlackInHole = false;
  7827. this.isEnter = true;
  7828. xGame.eventMgr.offAll(ALL_BALL_STOP);
  7829. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  7830. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  7831. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  7832. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  7833. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  7834. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  7835. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  7836. }
  7837. get gamePause() {
  7838. return this._gamePause;
  7839. }
  7840. set gamePause(v) {
  7841. if (v) {
  7842. Laya.physicsTimer.pause();
  7843. }
  7844. else {
  7845. Laya.physicsTimer.resume();
  7846. }
  7847. this._gamePause = v;
  7848. }
  7849. get selfTurn() {
  7850. return this._selfTurn;
  7851. }
  7852. set selfTurn(val) {
  7853. this.trunCount++;
  7854. this._selfTurn = val;
  7855. if (val) {
  7856. xGame.common.d2World.d2Gan.ui.self.visible = true;
  7857. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7858. }
  7859. else {
  7860. xGame.common.d2World.d2Gan.ui.self.visible = false;
  7861. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  7862. if (this.trunCount > 1)
  7863. PlatMgr.openBox();
  7864. }
  7865. }
  7866. resetGame() {
  7867. this.inHoleBalls = [];
  7868. this.isFirstInGame = true;
  7869. this.firstColliObj = null;
  7870. this.aiCamp = "";
  7871. this.selfCamp = "";
  7872. this.aiFoulNum = 0;
  7873. this.selfFoulNum = 0;
  7874. this.selfBallArr = [];
  7875. this.aiBallArr = [];
  7876. this.gamePause = false;
  7877. this.ensureBallType = false;
  7878. this.isInterrupt = false;
  7879. this.updateLeftBall();
  7880. this.clearTime();
  7881. this.aiPlayedBreakArmy = false;
  7882. this.isBlackInHole = false;
  7883. this.placeBallPosData = {};
  7884. if (xGame.common.d3World.knifeRoot) {
  7885. xGame.common.d3World.knifeRoot.destroyChildren();
  7886. }
  7887. }
  7888. gameReady() {
  7889. this.trunCount = 0;
  7890. this.firstColliObj = null;
  7891. this.isFirstInGame = true;
  7892. this.selfTurn = Math.random() <= this.selfTurnRate;
  7893. let challengeNum = DataMgr.getChallengeTimes();
  7894. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7895. this.selfTurn = true;
  7896. }
  7897. if (xGame.common.gameMode == GameMode.placeBall)
  7898. this.selfTurn = true;
  7899. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7900. this.selfTurn = true;
  7901. }
  7902. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7903. this.checkGuide();
  7904. if (xGame.common.uiRodMethod)
  7905. xGame.common.uiRodMethod.resetRod();
  7906. xGame.common.d2World.getHelpLine();
  7907. this.isOpenBall = true;
  7908. this.isTouchedBall = false;
  7909. xGame.common.aiPlayer.stopRun();
  7910. this.setTime = 30;
  7911. let ui = xGame.common.gameUI.ui;
  7912. switch (xGame.common.gameMode) {
  7913. case GameMode.classic:
  7914. xGame.common.aiPlayer.init();
  7915. this.blackNum = 8;
  7916. this.placeRootBall();
  7917. this.peoplePlay(9, 10);
  7918. ui.wordsBtn.visible = true;
  7919. ui.aiWordsBtn.visible = true;
  7920. xGame.common.talkMgr.changeAIState(true);
  7921. DataMgr.gameData.gameCount++;
  7922. DataMgr.saveGameData();
  7923. break;
  7924. case GameMode.bigMove:
  7925. this.blackNum = -1;
  7926. this.selfScore = 0;
  7927. this.aiScore = 0;
  7928. xGame.common.aiPlayer.init();
  7929. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7930. this.updateSelfScore();
  7931. this.updateAIScore();
  7932. this.updateTargetSroce();
  7933. this.placeRootBall();
  7934. this.peoplePlay(9, 10);
  7935. ui.wordsBtn.visible = true;
  7936. ui.aiWordsBtn.visible = true;
  7937. xGame.common.talkMgr.changeAIState(true);
  7938. if (DataMgr.getSkillGuide() < 1)
  7939. DataMgr.gameData.gameCount = 0;
  7940. else {
  7941. DataMgr.gameData.gameCount++;
  7942. DataMgr.saveGameData();
  7943. PlatMgr.openTry();
  7944. }
  7945. if (xGame.common.d3World.knifeRoot) {
  7946. xGame.common.d3World.knifeRoot.destroyChildren();
  7947. }
  7948. break;
  7949. case GameMode.placeBall:
  7950. this.blackNum = -1;
  7951. this.selfTurn = true;
  7952. this.setTime = 10000;
  7953. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7954. this.curHP = this.placeBallData.hp;
  7955. if (this.placeBallData.ball == -1)
  7956. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7957. else
  7958. this.needBalls = this.placeBallData.ball;
  7959. console.log("需要的进球数目", this.needBalls);
  7960. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7961. this.finishBalls = 0;
  7962. this.placeBallPosData = {};
  7963. this.updatePlaceBallPos();
  7964. this.updatePlaceBallState();
  7965. this.finishOneShoot = true;
  7966. xGame.common.gameUI.ui.moveNode.visible = false;
  7967. this.isOpenBall = false;
  7968. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7969. ui.wordsBtn.visible = false;
  7970. ui.aiWordsBtn.visible = false;
  7971. xGame.common.talkMgr.changeAIState(false);
  7972. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7973. PlatMgr.openBox();
  7974. });
  7975. break;
  7976. default:
  7977. break;
  7978. }
  7979. this.showLongView = false;
  7980. xGame.common.wordsMgr.comboTimes = 1;
  7981. let guide = DataMgr.getSkillGuide();
  7982. if (guide)
  7983. xGame.eventMgr.event(WAIT_SHOOT);
  7984. xGame.common.upSkillLevel = false;
  7985. xGame.common.gameStartTime = new Date().getTime();
  7986. this.firstShoot = true;
  7987. }
  7988. checkGuide() {
  7989. let guide = DataMgr.getSkillGuide();
  7990. let gameUI = xGame.common.gameUI.ui;
  7991. gameUI.guide1.visible = false;
  7992. gameUI.guide2.visible = false;
  7993. gameUI.guide3.visible = false;
  7994. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7995. this.selfTurn = true;
  7996. }
  7997. else {
  7998. return;
  7999. }
  8000. let oneBall = this.getOneBall();
  8001. gameUI.guide1.visible = true;
  8002. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8003. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8004. }
  8005. getOneBall() {
  8006. let arr = xGame.common.d2World.ballArr;
  8007. for (let index = 0; index < arr.length; index++) {
  8008. if (arr[index].number == 0)
  8009. continue;
  8010. return arr[index];
  8011. }
  8012. }
  8013. updateSelfScore() {
  8014. let ui = xGame.common.gameUI.ui.topNode;
  8015. ui.selfScoreTxt.text = this.selfScore + "";
  8016. }
  8017. updateAIScore() {
  8018. let ui = xGame.common.gameUI.ui.topNode;
  8019. ui.aiScoreTxt.text = this.aiScore + "";
  8020. }
  8021. updateTargetSroce() {
  8022. let ui = xGame.common.gameUI.ui.topNode;
  8023. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8024. }
  8025. updateLeftBall() {
  8026. let topUI = xGame.common.gameUI.ui.topNode;
  8027. topUI.selfBallList.numItems = this.selfBallArr.length;
  8028. topUI.aiBallList.numItems = this.aiBallArr.length;
  8029. }
  8030. ballShoot() {
  8031. this.clearTime();
  8032. this.finishOneShoot = false;
  8033. xGame.common.gameUI.ui.moveNode.visible = false;
  8034. if (xGame.common.gameUI.ui.guideNode.visible) {
  8035. xGame.common.gameUI.ui.guideNode.visible = false;
  8036. }
  8037. if (this.firstShoot) {
  8038. this.firstShoot = false;
  8039. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8040. }
  8041. }
  8042. ensureCamp(number) {
  8043. this.ensureBallType = true;
  8044. this.isOpenBall = false;
  8045. if (xGame.common.gameMode != GameMode.classic)
  8046. return;
  8047. let full = [1, 2, 3, 4, 5, 6, 7];
  8048. let flower = [9, 10, 11, 12, 13, 14, 15];
  8049. let sayWords = "";
  8050. if (this.selfTurn) {
  8051. if (number <= 7) {
  8052. this.selfCamp = ballCamp.full;
  8053. this.selfBallArr = full;
  8054. this.aiCamp = ballCamp.flower;
  8055. this.aiBallArr = flower;
  8056. sayWords = cfgTable.wordsData[3].msg;
  8057. }
  8058. else {
  8059. this.selfCamp = ballCamp.flower;
  8060. this.selfBallArr = flower;
  8061. this.aiCamp = ballCamp.full;
  8062. this.aiBallArr = full;
  8063. sayWords = cfgTable.wordsData[4].msg;
  8064. }
  8065. }
  8066. else {
  8067. if (number <= 7) {
  8068. this.selfCamp = ballCamp.flower;
  8069. this.selfBallArr = flower;
  8070. this.aiCamp = ballCamp.full;
  8071. this.aiBallArr = full;
  8072. sayWords = cfgTable.wordsData[2].msg;
  8073. }
  8074. else {
  8075. this.selfCamp = ballCamp.full;
  8076. this.selfBallArr = full;
  8077. this.aiCamp = ballCamp.flower;
  8078. this.aiBallArr = flower;
  8079. sayWords = cfgTable.wordsData[1].msg;
  8080. }
  8081. }
  8082. this.updateLeftBall();
  8083. xGame.uiMgr.Show(UIMsg, sayWords);
  8084. }
  8085. updatePlaceBallState() {
  8086. let ui = xGame.common.gameUI.ui;
  8087. switch (this.placeBallData.type) {
  8088. case PlaceBallType.normal:
  8089. let normal = ui.placeNormalNode;
  8090. normal.hpTxt.text = this.curHP + "";
  8091. this.updatePlaceBallStar(normal);
  8092. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8093. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8094. break;
  8095. case PlaceBallType.challenge:
  8096. let challenge = ui.placeChallengeNode;
  8097. challenge.hpTxt.text = "Shots:" + this.curHP;
  8098. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  8099. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8100. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  8101. break;
  8102. default:
  8103. break;
  8104. }
  8105. }
  8106. playSubHpAni() {
  8107. let ui = xGame.common.gameUI.ui;
  8108. switch (this.placeBallData.type) {
  8109. case PlaceBallType.normal:
  8110. let normal = ui.placeNormalNode;
  8111. normal.hpTxt.visible = false;
  8112. normal.starAni.c1.selectedIndex = 1;
  8113. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  8114. normal.hpTxt.visible = true;
  8115. normal.starAni.c1.selectedIndex = 0;
  8116. }));
  8117. break;
  8118. default:
  8119. break;
  8120. }
  8121. }
  8122. getEndStarNum() {
  8123. let num;
  8124. let level = xGame.common.placeBallCurLevel;
  8125. if (this.curHP == this.placeBallData.hp) {
  8126. num = 3;
  8127. }
  8128. else if (this.curHP <= 1) {
  8129. num = 1;
  8130. }
  8131. else {
  8132. num = 2;
  8133. }
  8134. if (!this.success) {
  8135. num = 0;
  8136. }
  8137. else {
  8138. DataMgr.setPlaceBallLevel(level, num);
  8139. }
  8140. let myType = cfgTable.placeballData[level].type;
  8141. if (this.success && myType == 1) {
  8142. num = 3;
  8143. }
  8144. xGame.common.placeBallStarNum = num;
  8145. }
  8146. updatePlaceBallStar(node) {
  8147. let star = 0;
  8148. if (this.curHP == this.placeBallData.hp) {
  8149. star = 3;
  8150. }
  8151. else if (this.curHP >= 2) {
  8152. star = 2;
  8153. }
  8154. else if (this.curHP == 1) {
  8155. star = 1;
  8156. }
  8157. else {
  8158. star = 0;
  8159. }
  8160. let temp;
  8161. for (let index = 1; index <= 3; index++) {
  8162. temp = node["star" + index];
  8163. temp.c1.selectedIndex = star >= index ? 1 : 0;
  8164. }
  8165. node.myProgress.value = (star / 3) * 100;
  8166. }
  8167. openRegretView(isFoul, GoalNum, challenge = false) {
  8168. let regretType = -1;
  8169. if (isFoul) {
  8170. regretType = 1;
  8171. }
  8172. else {
  8173. if (GoalNum <= 0) {
  8174. regretType = 0;
  8175. }
  8176. }
  8177. if (challenge) {
  8178. regretType = 1;
  8179. }
  8180. if (regretType != -1) {
  8181. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  8182. if (success) {
  8183. this.curHP++;
  8184. this.updatePlaceBallState();
  8185. this.setPlaceBallAllPos();
  8186. xGame.common.gameUI.ui.moveNode.visible = false;
  8187. }
  8188. else {
  8189. if (this.curHP <= 0) {
  8190. this.success = false;
  8191. this.gameEnd();
  8192. }
  8193. this.playSubHpAni();
  8194. }
  8195. this.updatePlaceBallState();
  8196. this.updatePlaceBallPos();
  8197. });
  8198. }
  8199. }
  8200. setPlaceBallAllPos() {
  8201. let allBall = xGame.common.d2World.ballArr;
  8202. let cfgArr = this.placeBallPosData;
  8203. let temp;
  8204. let obj;
  8205. for (let index = 0; index < allBall.length; index++) {
  8206. temp = allBall[index];
  8207. if (temp.destroyed)
  8208. continue;
  8209. obj = cfgArr[temp.myUNID];
  8210. if (obj && obj.src && !obj.src.destroyed) {
  8211. temp.gameObj.x = obj.posX;
  8212. temp.gameObj.y = obj.posY;
  8213. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  8214. }
  8215. }
  8216. xGame.common.d2World.getHelpLine();
  8217. }
  8218. updatePlaceBallPos() {
  8219. let arr = xGame.common.d2World.ballArr;
  8220. let temp;
  8221. for (let index = 0; index < arr.length; index++) {
  8222. temp = arr[index];
  8223. if (!this.placeBallPosData[temp.myUNID]) {
  8224. this.placeBallPosData[temp.myUNID] = {
  8225. src: temp,
  8226. posX: temp.gameObj.x,
  8227. posY: temp.gameObj.y
  8228. };
  8229. }
  8230. else {
  8231. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  8232. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  8233. }
  8234. }
  8235. let check;
  8236. for (const key in this.placeBallPosData) {
  8237. check = this.placeBallPosData[key];
  8238. if (check.src.destroyed) {
  8239. delete this.placeBallPosData[key];
  8240. }
  8241. }
  8242. }
  8243. gameRun(type) {
  8244. if (this.gamePause)
  8245. return;
  8246. this.curFoul = this.getFoulType();
  8247. if (type) {
  8248. xGame.common.d2World.d2Gan.shoot();
  8249. xGame.common.gameUI.forceCancel();
  8250. this.curFoul = type;
  8251. }
  8252. this.isEnd = false;
  8253. this.isChangeTurn = true;
  8254. if (xGame.common.gameMode == GameMode.classic) {
  8255. this.judgeClassic(this.curFoul);
  8256. this.checkClassicWords(() => {
  8257. xGame.common.destroyClassicEmotion();
  8258. if (this.isEnd) {
  8259. if (this.isBlackInHole) {
  8260. xGame.common.gameUI.ui.blackAni.visible = true;
  8261. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  8262. xGame.common.gameUI.ui.blackAni.visible = false;
  8263. this.gameEnd();
  8264. }));
  8265. }
  8266. else {
  8267. this.gameEnd();
  8268. }
  8269. }
  8270. else {
  8271. this.waitShoot();
  8272. xGame.eventMgr.event(WAIT_SHOOT);
  8273. }
  8274. });
  8275. }
  8276. else if (xGame.common.gameMode == GameMode.bigMove) {
  8277. xGame.common.aiPlayer.stopRun();
  8278. let scoreArr = this.getScore(this.curFoul);
  8279. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  8280. this.isEnd = true;
  8281. }
  8282. this.checkBigSkillWords(() => {
  8283. if (this.isEnd) {
  8284. this.gameEnd();
  8285. }
  8286. else {
  8287. this.waitShoot();
  8288. xGame.eventMgr.event(WAIT_SHOOT);
  8289. }
  8290. });
  8291. }
  8292. else if (xGame.common.gameMode == GameMode.placeBall) {
  8293. xGame.common.destroyAwardSpine();
  8294. let isFoul = this.curFoul == FoulType.rootHole;
  8295. let GoalNum = this.inHoleBalls.length;
  8296. if (this.inHoleBalls.indexOf(0) > -1)
  8297. GoalNum -= 1;
  8298. if (isFoul) {
  8299. this.placeRootBall();
  8300. }
  8301. console.log("neeballs", this.needBalls);
  8302. console.log("当前完成的goalNum", GoalNum);
  8303. this.finishBalls += GoalNum;
  8304. console.log("当前完成的finishballs", this.finishBalls);
  8305. let need = this.needBalls;
  8306. if (this.placeBallData.type == PlaceBallType.challenge) {
  8307. need += 100;
  8308. }
  8309. if (this.finishBalls >= need) {
  8310. this.success = true;
  8311. this.gameEnd();
  8312. }
  8313. else {
  8314. switch (this.placeBallData.type) {
  8315. case PlaceBallType.normal:
  8316. if (!isFoul && GoalNum > 0) {
  8317. this.updatePlaceBallPos();
  8318. this.updatePlaceBallState();
  8319. }
  8320. else {
  8321. this.curHP--;
  8322. this.openRegretView(isFoul, GoalNum);
  8323. }
  8324. this.waitShoot();
  8325. xGame.eventMgr.event(WAIT_SHOOT);
  8326. break;
  8327. case PlaceBallType.challenge:
  8328. this.curHP--;
  8329. this.updatePlaceBallState();
  8330. if (isFoul) {
  8331. this.openRegretView(isFoul, GoalNum, true);
  8332. }
  8333. else {
  8334. this.updatePlaceBallPos();
  8335. if (this.curHP <= 0) {
  8336. this.success = true;
  8337. this.gameEnd();
  8338. }
  8339. }
  8340. this.waitShoot();
  8341. xGame.eventMgr.event(WAIT_SHOOT);
  8342. break;
  8343. default:
  8344. break;
  8345. }
  8346. }
  8347. }
  8348. }
  8349. checkClassicWords(callback) {
  8350. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  8351. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  8352. let type = this.getClassicWordsType();
  8353. if (condition && type != -1) {
  8354. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  8355. xGame.soundMgr.playSound(str);
  8356. xGame.common.wordsMgr.playClassicWords(type, callback);
  8357. }
  8358. else {
  8359. Laya.timer.once(300, this, () => {
  8360. callback && callback();
  8361. });
  8362. }
  8363. }
  8364. getClassicWordsType() {
  8365. let d2world = xGame.common.d2World;
  8366. let type = -1;
  8367. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  8368. type = ClassicWordsType.perfectShow;
  8369. return type;
  8370. }
  8371. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  8372. type = ClassicWordsType.directShoot;
  8373. return type;
  8374. }
  8375. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  8376. type = ClassicWordsType.anotherShoot;
  8377. return type;
  8378. }
  8379. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  8380. type = ClassicWordsType.bigPower;
  8381. return type;
  8382. }
  8383. let minSpeed = 1;
  8384. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  8385. type = ClassicWordsType.hardShoot;
  8386. return type;
  8387. }
  8388. if (this.inHoleBalls.length > 0) {
  8389. type = ClassicWordsType.directShoot;
  8390. return type;
  8391. }
  8392. return type;
  8393. }
  8394. checkBigSkillWords(callback) {
  8395. if (this.curFoul == FoulType.timeOut) {
  8396. callback && callback();
  8397. }
  8398. else {
  8399. let playSkill = false;
  8400. if (this.selfTurn) {
  8401. playSkill = true;
  8402. }
  8403. else {
  8404. if (!this.aiPlayedBreakArmy) {
  8405. this.aiPlayedBreakArmy = true;
  8406. playSkill = true;
  8407. }
  8408. if (this.aiCurSkill != SkillType.breakArmy) {
  8409. playSkill = true;
  8410. }
  8411. }
  8412. if (xGame.common.skillMgr.playedLastSkill) {
  8413. xGame.common.skillMgr.playedLastSkill = false;
  8414. playSkill = false;
  8415. }
  8416. if (playSkill) {
  8417. xGame.common.skillMgr.runBigSkill((extraScore) => {
  8418. let selfExtra = 0;
  8419. let aiExtra = 0;
  8420. if (this.selfTurn)
  8421. selfExtra += extraScore;
  8422. else
  8423. aiExtra += extraScore;
  8424. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  8425. this.isEnd = true;
  8426. }
  8427. this.playBigSkillTimes(callback);
  8428. });
  8429. }
  8430. else {
  8431. this.playBigSkillTimes(callback);
  8432. }
  8433. }
  8434. }
  8435. playBigSkillTimes(callback) {
  8436. let length = this.inHoleBalls.length;
  8437. if (this.inHoleBalls.indexOf(0) > -1) {
  8438. length = this.inHoleBalls.length - 1;
  8439. }
  8440. if (length <= 0) {
  8441. callback && callback();
  8442. return;
  8443. }
  8444. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  8445. callback && callback();
  8446. });
  8447. }
  8448. playSkillTips() {
  8449. let levelNum = 0;
  8450. let curType;
  8451. if (this.selfTurn) {
  8452. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  8453. curType = this.selfCurSkill;
  8454. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8455. levelNum += 5;
  8456. }
  8457. }
  8458. else {
  8459. levelNum = this.aiSkillLevelNum;
  8460. curType = this.aiCurSkill;
  8461. }
  8462. let str = ``;
  8463. switch (curType) {
  8464. case SkillType.highSpace:
  8465. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8466. break;
  8467. case SkillType.breakArmy:
  8468. str = `You pocketed ${levelNum} extra balls`;
  8469. break;
  8470. case SkillType.ice:
  8471. str = `${levelNum * 2} extra balls were frozen`;
  8472. break;
  8473. case SkillType.fireworks:
  8474. str = `${levelNum} extra balls exploded `;
  8475. break;
  8476. case SkillType.GuanYu:
  8477. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8478. break;
  8479. default:
  8480. break;
  8481. }
  8482. xGame.uiMgr.Show(UIMsg, str);
  8483. }
  8484. getFoulType() {
  8485. let foulType = "";
  8486. if (this.firstColliObj == null) {
  8487. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8488. return FoulType.rootHole;
  8489. }
  8490. return FoulType.notTouch;
  8491. }
  8492. else {
  8493. if (this.selfTurn) {
  8494. if (this.selfBallArr.length > 0) {
  8495. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8496. foulType = FoulType.wrongTouch;
  8497. }
  8498. }
  8499. else {
  8500. if (this.ensureBallType) {
  8501. }
  8502. else {
  8503. if (this.firstColliObj == this.blackNum) {
  8504. foulType = FoulType.wrongTouch;
  8505. }
  8506. }
  8507. }
  8508. }
  8509. else {
  8510. if (this.aiBallArr.length > 0) {
  8511. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8512. foulType = FoulType.wrongTouch;
  8513. }
  8514. }
  8515. else {
  8516. if (this.ensureBallType) {
  8517. }
  8518. else {
  8519. if (this.firstColliObj == this.blackNum) {
  8520. foulType = FoulType.wrongTouch;
  8521. }
  8522. }
  8523. }
  8524. }
  8525. if (this.inHoleBalls.length <= 0) {
  8526. return foulType;
  8527. }
  8528. let temp;
  8529. if (this.inHoleBalls.indexOf(0) > -1) {
  8530. foulType = FoulType.rootHole;
  8531. }
  8532. else {
  8533. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8534. temp = this.inHoleBalls[index];
  8535. if (this.selfTurn) {
  8536. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8537. foulType = FoulType.wrongHole;
  8538. break;
  8539. }
  8540. }
  8541. else {
  8542. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8543. foulType = FoulType.wrongHole;
  8544. break;
  8545. }
  8546. }
  8547. }
  8548. }
  8549. let foo;
  8550. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8551. temp = this.inHoleBalls[index];
  8552. foo = this.selfBallArr.indexOf(temp);
  8553. if (foo > -1) {
  8554. this.selfBallArr.splice(foo, 1);
  8555. }
  8556. foo = this.aiBallArr.indexOf(temp);
  8557. if (foo > -1) {
  8558. this.aiBallArr.splice(foo, 1);
  8559. }
  8560. }
  8561. this.updateLeftBall();
  8562. }
  8563. return foulType;
  8564. }
  8565. judgeGameEndByBlack(arr) {
  8566. if (this.selfTurn) {
  8567. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8568. this.selfFoulNum = this.maxFoulTimes;
  8569. return true;
  8570. }
  8571. }
  8572. else {
  8573. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8574. this.aiFoulNum = this.maxFoulTimes;
  8575. return true;
  8576. }
  8577. }
  8578. }
  8579. judgeClassic(type) {
  8580. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8581. xGame.common.aiPlayer.stopRun();
  8582. if (this.judgeNormalSuccess()) {
  8583. this.isEnd = true;
  8584. return;
  8585. }
  8586. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8587. if (this.selfTurn) {
  8588. if (isFoul) {
  8589. this.selfFoulNum++;
  8590. }
  8591. if (this.selfFoulNum >= this.maxFoulTimes) {
  8592. this.success = false;
  8593. this.isEnd = true;
  8594. return;
  8595. }
  8596. }
  8597. else {
  8598. if (isFoul)
  8599. this.aiFoulNum++;
  8600. if (this.aiFoulNum >= this.maxFoulTimes) {
  8601. this.success = true;
  8602. this.isEnd = true;
  8603. return;
  8604. }
  8605. }
  8606. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8607. this.isChangeTurn = false;
  8608. }
  8609. else {
  8610. this.isInterrupt = true;
  8611. }
  8612. }
  8613. waitShoot() {
  8614. if (xGame.common.gameMode == GameMode.classic) {
  8615. switch (this.curFoul) {
  8616. case FoulType.timeOut:
  8617. case FoulType.rootHole:
  8618. this.selfTurn = !this.selfTurn;
  8619. this.peoplePlay(5, 6, true);
  8620. break;
  8621. case FoulType.notTouch:
  8622. this.selfTurn = !this.selfTurn;
  8623. this.peoplePlay(7, 7);
  8624. break;
  8625. case FoulType.wrongHole:
  8626. this.selfTurn = !this.selfTurn;
  8627. this.peoplePlay(11, 11);
  8628. break;
  8629. default:
  8630. if (this.inHoleBalls.length > 0) {
  8631. this.peoplePlay(0, 0, false, false);
  8632. }
  8633. else {
  8634. this.selfTurn = !this.selfTurn;
  8635. this.peoplePlay(7, 7);
  8636. }
  8637. break;
  8638. }
  8639. }
  8640. else if (xGame.common.gameMode == GameMode.bigMove) {
  8641. if (this.curFoul == FoulType.timeOut) {
  8642. this.selfTurn = !this.selfTurn;
  8643. this.peoplePlay(14, 15);
  8644. this.placeRootBall();
  8645. }
  8646. else {
  8647. this.selfTurn = !this.selfTurn;
  8648. if (this.curFoul == FoulType.rootHole) {
  8649. this.peoplePlay(12, 13);
  8650. this.placeRootBall();
  8651. }
  8652. else {
  8653. this.peoplePlay(0, 0, false, false);
  8654. }
  8655. }
  8656. }
  8657. else if (xGame.common.gameMode == GameMode.placeBall) {
  8658. this.finishOneShoot = true;
  8659. }
  8660. this.gameResult();
  8661. }
  8662. gameResult() {
  8663. this.firstColliObj = null;
  8664. this.inHoleBalls = [];
  8665. let curX = xGame.common.d2World.rootBall.gameObj.x;
  8666. let curY = xGame.common.d2World.rootBall.gameObj.y;
  8667. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  8668. if (xGame.common.uiRodMethod)
  8669. xGame.common.uiRodMethod.resetRod();
  8670. xGame.common.d2World.rootBall.showSelf();
  8671. this.clearIceSkill();
  8672. if (this.selfTurn) {
  8673. console.log("zh:处理一杆结束后的逻辑 gameResult");
  8674. PlatMgr.gameInsert();
  8675. }
  8676. xGame.common.d3World.knifeRoot.destroyChildren();
  8677. if (this.selfTurn) {
  8678. xGame.common.gameUI.showHelpLineGuide();
  8679. xGame.common.gameUI.setTurnAlpha(true);
  8680. }
  8681. else {
  8682. xGame.common.gameUI.setTurnAlpha(false);
  8683. }
  8684. }
  8685. getScore(type) {
  8686. let selfAdd = 0;
  8687. let aiAdd = 0;
  8688. if (type == FoulType.timeOut) {
  8689. if (this.selfTurn)
  8690. aiAdd += 3;
  8691. else
  8692. selfAdd += 3;
  8693. }
  8694. else {
  8695. if (this.inHoleBalls.length > 0) {
  8696. if (this.selfTurn) {
  8697. if (type == FoulType.rootHole) {
  8698. aiAdd += 3;
  8699. if (this.inHoleBalls.length - 1 > 0) {
  8700. selfAdd += this.inHoleBalls.length - 1;
  8701. }
  8702. }
  8703. else {
  8704. selfAdd += this.inHoleBalls.length;
  8705. }
  8706. }
  8707. else {
  8708. if (type == FoulType.rootHole) {
  8709. selfAdd += 3;
  8710. if (this.inHoleBalls.length - 1 > 0) {
  8711. aiAdd += this.inHoleBalls.length - 1;
  8712. }
  8713. }
  8714. else {
  8715. aiAdd += this.inHoleBalls.length;
  8716. }
  8717. }
  8718. }
  8719. }
  8720. return [selfAdd, aiAdd];
  8721. }
  8722. judgeScoreEnd(selfAdd, aiAdd) {
  8723. this.selfScore += selfAdd;
  8724. this.aiScore += aiAdd;
  8725. this.updateAIScore();
  8726. this.updateSelfScore();
  8727. if (this.selfScore >= this.targertScore) {
  8728. this.success = true;
  8729. return true;
  8730. }
  8731. if (this.aiScore >= this.targertScore) {
  8732. this.success = false;
  8733. return true;
  8734. }
  8735. let ballArr = xGame.common.d2World.ballArr;
  8736. if (ballArr.length == 1 && ballArr[0].number == 0) {
  8737. if (this.selfScore > this.aiScore) {
  8738. this.success = true;
  8739. return true;
  8740. }
  8741. else if (this.selfScore < this.aiScore) {
  8742. this.success = false;
  8743. return true;
  8744. }
  8745. else {
  8746. if (this.selfTurn) {
  8747. this.success = false;
  8748. }
  8749. else {
  8750. this.success = true;
  8751. }
  8752. return true;
  8753. }
  8754. }
  8755. }
  8756. clearIceSkill() {
  8757. let arr = xGame.common.d2World.ballArr;
  8758. let temp;
  8759. if (this.selfTurn) {
  8760. if (this.selfCurSkill == SkillType.ice) {
  8761. for (let index = 0; index < arr.length; index++) {
  8762. temp = arr[index];
  8763. if (temp.ballFunc == "ice") {
  8764. temp.setBallFunc("normal", "self");
  8765. }
  8766. }
  8767. }
  8768. }
  8769. else {
  8770. if (this.aiCurSkill == SkillType.ice) {
  8771. for (let index = 0; index < arr.length; index++) {
  8772. temp = arr[index];
  8773. if (temp.ballFunc == "ice") {
  8774. temp.setBallFunc("normal", "ai");
  8775. }
  8776. }
  8777. }
  8778. }
  8779. }
  8780. judgeNormalSuccess() {
  8781. if (this.selfTurn) {
  8782. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8783. this.success = true;
  8784. return true;
  8785. }
  8786. }
  8787. else {
  8788. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8789. this.success = false;
  8790. return true;
  8791. }
  8792. }
  8793. }
  8794. gameEnd() {
  8795. if (Moyu.isTT) {
  8796. xGame.common.screenImg = getScreenImg();
  8797. }
  8798. console.log("游戏结束", this.success);
  8799. xGame.common.aiPlayer.stopRun();
  8800. if (xGame.common.gameMode == GameMode.placeBall) {
  8801. this.getEndStarNum();
  8802. this.updatePlaceBallState();
  8803. }
  8804. this.isEnter = false;
  8805. Moyu.recordEnd(this, () => {
  8806. if (this.isEnter)
  8807. return;
  8808. this.isEnter = true;
  8809. console.log("进入录结束回调");
  8810. this.enterNext();
  8811. });
  8812. Laya.timer.once(1000, this, () => {
  8813. if (this.isEnter)
  8814. return;
  8815. this.isEnter = true;
  8816. this.enterNext();
  8817. });
  8818. xGame.common.longHelpLine = false;
  8819. }
  8820. enterNext() {
  8821. Laya.timer.clearAll(this);
  8822. if (Moyu.canShare() > 100 || Moyu.isKs) {
  8823. xGame.uiMgr.Show(UIVideoShare, this.success);
  8824. }
  8825. else {
  8826. xGame.uiMgr.Show(UIGameEnd, this.success);
  8827. }
  8828. }
  8829. aiLeave() {
  8830. let ui = xGame.common.gameUI.ui;
  8831. ui.topNode.aiNameTxt.text = "offline";
  8832. }
  8833. aiGameEnd(suc) {
  8834. this.success = suc;
  8835. xGame.common.aiPlayer.stopRun();
  8836. if (this.success) {
  8837. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  8838. Laya.timer.once(1000, this, () => {
  8839. this.clearTime();
  8840. this.gameEnd();
  8841. });
  8842. }
  8843. }
  8844. openTimer() {
  8845. let src = xGame.common.gameUI;
  8846. if (this.selfTurn) {
  8847. src.ui.topNode.selfProgress.visible = true;
  8848. src.ui.topNode.aiProgress.visible = false;
  8849. this.curTimer = src.ui.topNode.selfProgress;
  8850. }
  8851. else {
  8852. src.ui.topNode.selfProgress.visible = false;
  8853. src.ui.topNode.aiProgress.visible = true;
  8854. this.curTimer = src.ui.topNode.aiProgress;
  8855. }
  8856. this.accTime = 0;
  8857. Laya.timer.clearAll(this);
  8858. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  8859. this.curTimer.value = 100;
  8860. }
  8861. updateTime(dt) {
  8862. if (this.gamePause)
  8863. return;
  8864. this.accTime += dt;
  8865. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8866. if (this.accTime >= this.setTime) {
  8867. this.clearTime();
  8868. console.log("时钟进入了gameRun");
  8869. this.gameRun(FoulType.timeOut);
  8870. }
  8871. }
  8872. clearTime() {
  8873. let src = xGame.common.gameUI;
  8874. src.ui.topNode.selfProgress.visible = false;
  8875. src.ui.topNode.aiProgress.visible = false;
  8876. Laya.timer.clearAll(this);
  8877. }
  8878. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8879. let ui = xGame.common.gameUI.ui;
  8880. let selfMsg, aiMsg;
  8881. if (sayWords) {
  8882. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8883. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8884. if (Foul) {
  8885. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8886. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8887. this.placeRootBall();
  8888. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8889. if (this.curFoul == FoulType.rootHole) {
  8890. if (!DataMgr.getRootBallFoul()) {
  8891. DataMgr.setRootBallFoul();
  8892. aiMsg = "";
  8893. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8894. let woman = "Boss, pay attention next time~";
  8895. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8896. }
  8897. }
  8898. else if (this.curFoul == FoulType.timeOut) {
  8899. if (!DataMgr.getTimeoutFoul()) {
  8900. DataMgr.setTimeoutFoul();
  8901. aiMsg = "";
  8902. let tips = "Game timeout, 3 fouls, this game failed.";
  8903. let woman = "Boss, pay attention to the timeline~";
  8904. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8905. }
  8906. }
  8907. }
  8908. }
  8909. }
  8910. if (this.selfTurn) {
  8911. if (sayWords) {
  8912. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8913. ui.selfTurn.visible = true;
  8914. ui.aiTurn.visible = false;
  8915. ui.selfTurn.t0.play();
  8916. Moyu.vibration();
  8917. });
  8918. }
  8919. }
  8920. else {
  8921. let aiNum = xGame.tools.random(1, 11);
  8922. let challengeNum = DataMgr.getChallengeTimes();
  8923. let delay = false;
  8924. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8925. aiNum = 9;
  8926. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8927. aiNum = 3;
  8928. if (challengeNum == 3) {
  8929. if (!this.showLongView) {
  8930. this.showLongView = true;
  8931. delay = true;
  8932. }
  8933. }
  8934. }
  8935. }
  8936. if (delay) {
  8937. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8938. if (success) {
  8939. xGame.common.longHelpLine = true;
  8940. xGame.common.d2World.getHelpLine();
  8941. }
  8942. else {
  8943. aiNum = 10;
  8944. }
  8945. xGame.common.aiPlayer.setAiLevel(aiNum);
  8946. if (sayWords) {
  8947. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8948. xGame.common.aiPlayer.runAI();
  8949. ui.selfTurn.visible = false;
  8950. ui.aiTurn.visible = true;
  8951. ui.aiTurn.t0.play();
  8952. });
  8953. }
  8954. else {
  8955. xGame.common.aiPlayer.runAI();
  8956. }
  8957. this.openTimer();
  8958. this.finishOneShoot = true;
  8959. if (this.selfTurn) {
  8960. ui.topNode.selfKuang.visible = true;
  8961. ui.topNode.aiKuang.visible = false;
  8962. ui.topNode.selfTips.visible = true;
  8963. ui.topNode.aiTips.visible = false;
  8964. }
  8965. else {
  8966. ui.topNode.selfKuang.visible = false;
  8967. ui.topNode.aiKuang.visible = true;
  8968. ui.topNode.selfTips.visible = false;
  8969. ui.topNode.aiTips.visible = true;
  8970. }
  8971. });
  8972. return;
  8973. }
  8974. if (xGame.common.gameMode == GameMode.classic) {
  8975. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8976. if (cfg) {
  8977. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8978. aiNum = aiLevel;
  8979. }
  8980. }
  8981. xGame.common.aiPlayer.setAiLevel(aiNum);
  8982. if (sayWords) {
  8983. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8984. xGame.common.aiPlayer.runAI();
  8985. ui.selfTurn.visible = false;
  8986. ui.aiTurn.visible = true;
  8987. ui.aiTurn.t0.play();
  8988. });
  8989. }
  8990. else {
  8991. xGame.common.aiPlayer.runAI();
  8992. }
  8993. }
  8994. this.openTimer();
  8995. this.finishOneShoot = true;
  8996. if (this.selfTurn) {
  8997. ui.topNode.selfKuang.visible = true;
  8998. ui.topNode.aiKuang.visible = false;
  8999. ui.topNode.selfTips.visible = true;
  9000. ui.topNode.aiTips.visible = false;
  9001. }
  9002. else {
  9003. ui.topNode.selfKuang.visible = false;
  9004. ui.topNode.aiKuang.visible = true;
  9005. ui.topNode.selfTips.visible = false;
  9006. ui.topNode.aiTips.visible = true;
  9007. }
  9008. }
  9009. placeRootBall() {
  9010. let rootBall = xGame.common.d2World.rootBall;
  9011. if (!rootBall)
  9012. return;
  9013. rootBall.gameObj.x = this.lastRootBallPos.x;
  9014. rootBall.gameObj.y = this.lastRootBallPos.y;
  9015. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9016. let moveNode = xGame.common.gameUI.ui.moveNode;
  9017. moveNode.visible = true;
  9018. moveNode.x = this.lastRootBallPos.x;
  9019. moveNode.y = this.lastRootBallPos.y;
  9020. if (!this.selfTurn) {
  9021. xGame.common.aiPlayer.resetRoot();
  9022. }
  9023. }
  9024. }
  9025. class ui_guanyuAni extends fgui.GComponent {
  9026. static createInstance() {
  9027. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9028. }
  9029. onConstruct() {
  9030. this.n0 = (this.getChild("n0"));
  9031. }
  9032. }
  9033. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9034. class UIFireworks extends UIBase {
  9035. constructor() {
  9036. super();
  9037. }
  9038. onConstructor() {
  9039. this.isEject = false;
  9040. }
  9041. show(callback) {
  9042. super.show();
  9043. }
  9044. }
  9045. UIFireworks.uiName = "UIFireworks";
  9046. class ui_UIGuanYu extends fgui.GComponent {
  9047. static createInstance() {
  9048. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9049. }
  9050. onConstruct() {
  9051. this.n2 = (this.getChild("n2"));
  9052. this.n1 = (this.getChild("n1"));
  9053. this.n3 = (this.getChild("n3"));
  9054. this.n4 = (this.getChild("n4"));
  9055. this.n5 = (this.getChild("n5"));
  9056. this.n6 = (this.getChild("n6"));
  9057. this.n8 = (this.getChild("n8"));
  9058. this.n7 = (this.getChild("n7"));
  9059. this.t0 = this.getTransition("t0");
  9060. }
  9061. }
  9062. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9063. class UIGuanYu extends UIBase {
  9064. constructor() {
  9065. super();
  9066. }
  9067. onConstructor() {
  9068. this.ui = ui_UIGuanYu.createInstance();
  9069. this.contentPane = this.ui;
  9070. this.isEject = false;
  9071. }
  9072. show(callback) {
  9073. super.show();
  9074. this.ui.t0.play(Laya.Handler.create(this, () => {
  9075. callback && callback();
  9076. this.hide();
  9077. }));
  9078. }
  9079. }
  9080. UIGuanYu.uiName = "UIGuanYu";
  9081. class SkillMgr {
  9082. constructor() {
  9083. this.leveNum = 0;
  9084. this.extraScore = 0;
  9085. this.selfTurn = false;
  9086. this.playedLastSkill = false;
  9087. this.tweenArr = [];
  9088. this._finishNum = 0;
  9089. this._curFinish = 0;
  9090. this._rootX = 0;
  9091. this._rootY = 0;
  9092. this.knifeTimes = 0;
  9093. this.knifeV2 = new Laya.Vector2();
  9094. this.knifeV3 = new Laya.Vector3();
  9095. this.rtStarX = 0;
  9096. this.rtStarY = 0;
  9097. this.addBigSkillSpine();
  9098. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9099. }
  9100. addBigSkillSpine() {
  9101. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  9102. console.log("extra2 success");
  9103. });
  9104. }
  9105. runBigSkill(callback) {
  9106. this.tweenArr = [];
  9107. this.callback = callback;
  9108. this.judgeSkill();
  9109. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  9110. let guide = DataMgr.getSkillGuide();
  9111. if (!xGame.common.gameMgr.selfTurn) {
  9112. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  9113. }
  9114. else {
  9115. if (xGame.common.temSelfLevel != 0) {
  9116. this.leveNum = xGame.common.temSelfLevel;
  9117. }
  9118. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9119. this.leveNum += 5;
  9120. }
  9121. }
  9122. if (guide == 0) {
  9123. DataMgr.setSkillGuide(1);
  9124. if (DataMgr.getNewUser()) {
  9125. Moyu.sendDataEvent("gameFirstPlay");
  9126. DataMgr.setNewUser();
  9127. }
  9128. }
  9129. this.playSpineAni(() => {
  9130. switch (this.curSkill) {
  9131. case SkillType.highSpace:
  9132. this.runHighSpace();
  9133. break;
  9134. case SkillType.breakArmy:
  9135. this.runBreakArmy();
  9136. break;
  9137. case SkillType.ice:
  9138. this.runIce();
  9139. break;
  9140. case SkillType.fireworks:
  9141. this.runFireworks();
  9142. break;
  9143. case SkillType.GuanYu:
  9144. this.runGuanYu();
  9145. break;
  9146. default:
  9147. break;
  9148. }
  9149. });
  9150. }
  9151. judgeSkill() {
  9152. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  9153. let gameMgr = xGame.common.gameMgr;
  9154. let type;
  9155. for (let index = 0; index < typeArr.length; index++) {
  9156. type = typeArr[index];
  9157. if (gameMgr.selfTurn) {
  9158. if (gameMgr.selfCurSkill == type) {
  9159. this.selfTurn = true;
  9160. this.curSkill = type;
  9161. return;
  9162. }
  9163. }
  9164. else {
  9165. if (gameMgr.aiCurSkill == type) {
  9166. this.selfTurn = false;
  9167. this.curSkill = type;
  9168. return;
  9169. }
  9170. }
  9171. }
  9172. }
  9173. playSpineAni(callback) {
  9174. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  9175. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  9176. parent.destroyChildren();
  9177. let aniIndex = 0;
  9178. let skillSpine;
  9179. switch (this.curSkill) {
  9180. case SkillType.highSpace:
  9181. aniIndex = 1;
  9182. xGame.soundMgr.playSound("skill01");
  9183. skillSpine = this.skillSpine2;
  9184. data.scaleX = 0.5;
  9185. data.scaleY = 0.5;
  9186. skillSpine.play(data, 1, false, parent, () => {
  9187. callback && callback();
  9188. });
  9189. break;
  9190. case SkillType.breakArmy:
  9191. aniIndex = 2;
  9192. xGame.soundMgr.playSound("skill02");
  9193. skillSpine = this.skillSpine2;
  9194. data.scaleX = 0.5;
  9195. data.scaleY = 0.5;
  9196. skillSpine.play(data, 2, false, parent, () => {
  9197. callback && callback();
  9198. });
  9199. break;
  9200. case SkillType.ice:
  9201. aniIndex = 0;
  9202. xGame.soundMgr.playSound("skill03");
  9203. skillSpine = this.skillSpine2;
  9204. data.scaleX = 0.5;
  9205. data.scaleY = 0.5;
  9206. skillSpine.play(data, 0, false, parent, () => {
  9207. callback && callback();
  9208. });
  9209. break;
  9210. case SkillType.fireworks:
  9211. xGame.soundMgr.playSound("skill_04_01");
  9212. xGame.soundMgr.playSound("skill04");
  9213. xGame.uiMgr.Show(UIFireworks, callback);
  9214. break;
  9215. case SkillType.GuanYu:
  9216. xGame.soundMgr.playSound("skill05_1");
  9217. xGame.soundMgr.playSound("skill05");
  9218. xGame.uiMgr.Show(UIGuanYu, callback);
  9219. break;
  9220. default:
  9221. break;
  9222. }
  9223. }
  9224. getAllBallArr() {
  9225. let arr = xGame.common.d2World.ballArr;
  9226. let outArr = [];
  9227. for (let index = 0; index < arr.length; index++) {
  9228. if (arr[index] instanceof D2RootBallSrc)
  9229. continue;
  9230. if (arr[index].ballFunc == "ice")
  9231. continue;
  9232. if (arr[index].destroyed)
  9233. continue;
  9234. outArr.push(arr[index]);
  9235. }
  9236. return outArr;
  9237. }
  9238. getOneArr(deletObj) {
  9239. let allArr = this.getAllBallArr();
  9240. let temp;
  9241. for (let index = 0; index < allArr.length; index++) {
  9242. temp = allArr[index];
  9243. if (temp.id == deletObj.id) {
  9244. allArr.splice(index, 1);
  9245. break;
  9246. }
  9247. }
  9248. return allArr;
  9249. }
  9250. getNearBallBag(ball) {
  9251. let ui = xGame.common.gameUI.ui;
  9252. let circleArr = [];
  9253. for (let index = 1; index <= 6; index++) {
  9254. circleArr.push(ui.border["circle" + index]);
  9255. }
  9256. let outIndex = 0;
  9257. let temp;
  9258. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  9259. ;
  9260. let dis = 0;
  9261. for (let index = 1; index < circleArr.length; index++) {
  9262. temp = circleArr[index];
  9263. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  9264. if (dis < min) {
  9265. min = dis;
  9266. outIndex = index;
  9267. }
  9268. }
  9269. return [circleArr[outIndex], outIndex];
  9270. }
  9271. ballFlyToBag(ballArr, time = 300) {
  9272. let temp;
  9273. let hole;
  9274. this._finishNum = ballArr.length;
  9275. this._curFinish = 0;
  9276. let holeObj = {};
  9277. let holeCfg = {
  9278. "1": 0,
  9279. "2": 0,
  9280. "3": 0,
  9281. "4": 0,
  9282. "5": 0,
  9283. "6": 0
  9284. };
  9285. for (let index = 0; index < ballArr.length; index++) {
  9286. temp = ballArr[index];
  9287. temp.outColli.isSensor = true;
  9288. temp.innerColli.isSensor = true;
  9289. temp.isRunSkillAni = true;
  9290. let holeArr = this.getNearBallBag(temp);
  9291. hole = holeArr[0];
  9292. holeObj[index] = holeArr[1];
  9293. temp.d3BallSrc.scaleXYZ = 0.5;
  9294. this.tweenArr.push(temp.d3BallSrc, temp);
  9295. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9296. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  9297. }));
  9298. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  9299. let mIndex = holeObj[this._curFinish];
  9300. let isDone = holeCfg[mIndex];
  9301. if (isDone) {
  9302. ballArr[this._curFinish].checkWrongBall(false);
  9303. }
  9304. else {
  9305. holeCfg[mIndex] = 1;
  9306. ballArr[this._curFinish].checkWrongBall();
  9307. }
  9308. this._curFinish++;
  9309. if (this._curFinish >= this._finishNum) {
  9310. if (this.curSkill == SkillType.highSpace) {
  9311. }
  9312. else if (this.curSkill == SkillType.breakArmy) {
  9313. let rootBall = xGame.common.d2World.rootBall;
  9314. rootBall.gameObj.x = this._rootX;
  9315. rootBall.gameObj.y = this._rootY;
  9316. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9317. xGame.common.d2World.d2Gan.ui.visible = true;
  9318. xGame.common.d2World.d2HelpLine.ui.visible = true;
  9319. xGame.common.d2World.getHelpLine();
  9320. this.callback && this.callback(this.extraScore);
  9321. }
  9322. }
  9323. }));
  9324. }
  9325. }
  9326. runHighSpace() {
  9327. let rootBall = xGame.common.d2World.rootBall;
  9328. rootBall.showSelf();
  9329. let d3Src = rootBall.d3BallSrc;
  9330. let allArr = this.getAllBallArr();
  9331. if (allArr.length <= 0) {
  9332. this.callback && this.callback(0);
  9333. return;
  9334. }
  9335. let selectBall = xGame.common.d2World.targetBall;
  9336. let wrong = selectBall && selectBall.destroyed;
  9337. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  9338. selectBall = xGame.common.getRandArrEle(allArr);
  9339. }
  9340. let targetD3Src = selectBall.d3BallSrc;
  9341. xGame.common.d2World.d2Gan.ui.visible = false;
  9342. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9343. d3Src.scaleXYZ = 0.5;
  9344. this.tweenArr.push(d3Src);
  9345. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9346. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9347. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  9348. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  9349. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  9350. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  9351. let outArr = [selectBall];
  9352. let other = this.leveNum - 1;
  9353. if (other > 0) {
  9354. let nearArr = this.getOneArr(selectBall);
  9355. if (nearArr.length > 0) {
  9356. xGame.common.botherArr(nearArr);
  9357. if (other >= nearArr.length)
  9358. other = nearArr.length;
  9359. for (let index = 0; index < other; index++) {
  9360. outArr.push(nearArr[index]);
  9361. }
  9362. }
  9363. }
  9364. xGame.common.extraMoveNum = other + 1;
  9365. this.extraScore = other + 1;
  9366. this._rootX = selectBall.gameObj.x;
  9367. this._rootY = selectBall.gameObj.y;
  9368. rootBall.gameObj.x = this._rootX;
  9369. rootBall.gameObj.y = this._rootY;
  9370. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9371. Laya.Tween.clearAll(d3Src);
  9372. this.addRandomForce(outArr);
  9373. }));
  9374. }));
  9375. }
  9376. addRandomForce(outArr) {
  9377. if (outArr.length > 0) {
  9378. xGame.common.d2World.openCheckStill = true;
  9379. this.playedLastSkill = true;
  9380. }
  9381. let temp;
  9382. for (let index = 0; index < outArr.length; index++) {
  9383. let angle = xGame.common.randomNum(0, 360);
  9384. let linearPercent = xGame.common.randomNum(65, 100);
  9385. temp = outArr[index];
  9386. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  9387. }
  9388. }
  9389. setLinearSpeed(angle, rigy, linearPercent) {
  9390. let sin = Math.sin(angle * Math.PI / 180);
  9391. let cos = Math.cos(angle * Math.PI / 180);
  9392. let maxSpeed = 4;
  9393. let speed = new Laya.Vector2();
  9394. speed.x = maxSpeed * linearPercent * sin;
  9395. speed.y = -maxSpeed * linearPercent * cos;
  9396. rigy.applyLinearImpulseToCenter(speed);
  9397. }
  9398. runBreakArmy() {
  9399. xGame.common.d2World.d2Gan.ui.visible = false;
  9400. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9401. let gameUI = xGame.common.gameUI.ui;
  9402. gameUI.skillRod.visible = true;
  9403. gameUI.skillRod.rotation = 110;
  9404. let outArr = this.getAllBallArr();
  9405. if (outArr.length <= 0) {
  9406. gameUI.skillRod.visible = false;
  9407. this.callback && this.callback(0);
  9408. return;
  9409. }
  9410. xGame.common.botherArr(outArr);
  9411. if (this.leveNum >= outArr.length)
  9412. this.leveNum = outArr.length;
  9413. let deleteNum = outArr.length - this.leveNum;
  9414. outArr.splice(0, deleteNum);
  9415. this.extraScore = this.leveNum;
  9416. let potX = gameUI.skillRod.x;
  9417. let potY = gameUI.skillRod.y;
  9418. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  9419. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  9420. let disArr = [];
  9421. for (let index = 0; index < outArr.length; index++) {
  9422. let obj = outArr[index];
  9423. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  9424. dis = Math.pow(dis, 0.5);
  9425. disArr.push(dis);
  9426. }
  9427. this.tweenArr.push(gameUI.skillRod);
  9428. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9429. })).update = Laya.Handler.create(this, (e, t, c) => {
  9430. let angle = gameUI.skillRod.rotation;
  9431. let xx;
  9432. let yy;
  9433. let temp;
  9434. for (let index = 0; index < outArr.length; index++) {
  9435. temp = outArr[index];
  9436. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  9437. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  9438. yy -= 20;
  9439. temp.gameObj.x = xx;
  9440. temp.gameObj.y = yy;
  9441. temp.d3BallSrc.setTransPos(xx, yy);
  9442. }
  9443. if (angle <= 60) {
  9444. Laya.Tween.clearAll(gameUI.skillRod);
  9445. this.ballFlyToBag(outArr, 150);
  9446. gameUI.skillRod.visible = false;
  9447. }
  9448. }, null, false);
  9449. }
  9450. runIce() {
  9451. let ballArr = xGame.common.d2World.ballArr;
  9452. this.leveNum *= 2;
  9453. if (this.leveNum >= ballArr.length - 1)
  9454. this.leveNum = ballArr.length - 1;
  9455. let tempArr = [];
  9456. let outArr = [];
  9457. for (let index = 0; index < ballArr.length; index++) {
  9458. if (ballArr[index] instanceof D2RootBallSrc)
  9459. continue;
  9460. tempArr.push(ballArr[index]);
  9461. }
  9462. if (tempArr.length <= 0) {
  9463. this.callback && this.callback(0);
  9464. return;
  9465. }
  9466. xGame.common.botherArr(tempArr);
  9467. for (let index = 0; index < this.leveNum; index++) {
  9468. outArr.push(tempArr[index]);
  9469. }
  9470. this.extraScore = this.leveNum;
  9471. let temp;
  9472. for (let index = 0; index < outArr.length; index++) {
  9473. temp = outArr[index];
  9474. temp.d3BallSrc.playIceEft();
  9475. }
  9476. Laya.timer.once(2000, this, () => {
  9477. for (let index = 0; index < outArr.length; index++) {
  9478. temp = outArr[index];
  9479. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9480. temp.setBallFunc("ice", str);
  9481. }
  9482. this.callback && this.callback(0);
  9483. });
  9484. }
  9485. runFireworks() {
  9486. let allArr = this.getAllBallArr();
  9487. if (allArr.length <= 0) {
  9488. this.callback && this.callback(0);
  9489. return;
  9490. }
  9491. xGame.common.d2World.d2Gan.ui.visible = false;
  9492. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9493. let outArr = [];
  9494. let other = this.leveNum;
  9495. if (other > 0) {
  9496. if (allArr.length > 0) {
  9497. xGame.common.botherArr(allArr);
  9498. if (other >= allArr.length)
  9499. other = allArr.length;
  9500. for (let index = 0; index < other; index++) {
  9501. outArr.push(allArr[index]);
  9502. }
  9503. }
  9504. }
  9505. xGame.common.extraMoveNum = other;
  9506. this.extraScore = other;
  9507. this.addRandmomFireworks(outArr);
  9508. }
  9509. addRandmomFireworks(outArr) {
  9510. Laya.timer.once(1100, this, () => {
  9511. if (outArr.length > 0) {
  9512. xGame.common.d2World.openCheckStill = true;
  9513. this.playedLastSkill = true;
  9514. }
  9515. });
  9516. xGame.soundMgr.playSound("skill_04_02");
  9517. let temp;
  9518. let delay = -200;
  9519. for (let index = 0; index < outArr.length; index++) {
  9520. temp = outArr[index];
  9521. delay += 200;
  9522. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9523. let angle = xGame.common.randomNum(0, 360);
  9524. angle = this.getFireworksAngle(obj);
  9525. let linearPercent = xGame.common.randomNum(45, 80);
  9526. if (!obj.destroyed)
  9527. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9528. });
  9529. }
  9530. }
  9531. getFireworksAngle(obj) {
  9532. let rootBall = xGame.common.d2World.rootBall;
  9533. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9534. }
  9535. resetGame() {
  9536. Laya.timer.clearAll(this);
  9537. if (this.tweenArr) {
  9538. for (let index = 0; index < this.tweenArr.length; index++) {
  9539. Laya.Tween.clearAll(this.tweenArr[index]);
  9540. }
  9541. }
  9542. this.tweenArr = null;
  9543. }
  9544. runGuanYu() {
  9545. xGame.common.d2World.d2Gan.ui.visible = false;
  9546. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9547. let rootBall = xGame.common.d2World.rootBall;
  9548. if (rootBall.isInHole) {
  9549. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9550. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9551. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9552. rootBall.showSelf();
  9553. }
  9554. this.rtStarX = rootBall.gameObj.x;
  9555. this.rtStarY = rootBall.gameObj.y;
  9556. this.knifeTimes = 0;
  9557. this.playedLastSkill = true;
  9558. rootBall.forceRun = true;
  9559. rootBall.rigy.type = "static";
  9560. xGame.common.d2World.openCheckStill = true;
  9561. this.guanyuRandomKnife();
  9562. }
  9563. guanyuRandomKnife() {
  9564. let rootBall = xGame.common.d2World.rootBall;
  9565. let dir = this.getRandDir();
  9566. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9567. console.log("当前angle", angle);
  9568. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9569. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9570. let dis = 324;
  9571. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9572. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9573. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9574. this.rtStarX = rootBall.gameObj.x;
  9575. this.rtStarY = rootBall.gameObj.y;
  9576. this.knifeTimes++;
  9577. let skillLevel;
  9578. if (xGame.common.gameMgr.selfTurn) {
  9579. skillLevel = DataMgr.getBigSkillByIndex(4);
  9580. }
  9581. else {
  9582. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9583. }
  9584. if (!skillLevel)
  9585. skillLevel = 1;
  9586. skillLevel += 2;
  9587. if (this.knifeTimes < skillLevel) {
  9588. Laya.timer.once(400, this, () => {
  9589. this.guanyuRandomKnife();
  9590. });
  9591. }
  9592. else {
  9593. rootBall.forceRun = false;
  9594. rootBall.rigy.type = "dynamic";
  9595. xGame.common.extraMoveNum = skillLevel;
  9596. }
  9597. }));
  9598. }
  9599. getRandDir() {
  9600. let rootBall = xGame.common.d2World.rootBall;
  9601. let allBall = this.getAllBallArr();
  9602. let target = xGame.common.getRandArrEle(allBall);
  9603. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9604. return this.knifeV2;
  9605. }
  9606. cloneKnife(x, y, rotation) {
  9607. let parent = xGame.common.d3World.knifeRoot;
  9608. let prefab = xGame.common.d3World.knife;
  9609. let clone = prefab.clone();
  9610. parent.addChild(clone);
  9611. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9612. clone.transform.localPositionX = this.knifeV3.x;
  9613. clone.transform.localPositionY = 0;
  9614. clone.transform.localPositionZ = this.knifeV3.z;
  9615. clone.transform.localRotationEulerX = 0;
  9616. clone.transform.localRotationEulerY = rotation;
  9617. clone.transform.localRotationEulerZ = 0;
  9618. clone.active = true;
  9619. return clone;
  9620. }
  9621. cloneGuanYuEft(x, y, angle) {
  9622. return;
  9623. let parent = xGame.common.gameUI.ui.guanyuNode;
  9624. let eft = new ui_guanyuAni();
  9625. eft.parent = parent;
  9626. eft.x = x;
  9627. eft.y = y;
  9628. eft.rotation = angle;
  9629. }
  9630. }
  9631. class ui_UIWordsList extends fgui.GComponent {
  9632. static createInstance() {
  9633. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9634. }
  9635. onConstruct() {
  9636. this.c1 = this.getController("c1");
  9637. this.n74 = (this.getChild("n74"));
  9638. this.clickNode = (this.getChild("clickNode"));
  9639. this.myNode = (this.getChild("myNode"));
  9640. this.n68 = (this.getChild("n68"));
  9641. this.n66 = (this.getChild("n66"));
  9642. this.n55 = (this.getChild("n55"));
  9643. this.wordsBtn = (this.getChild("wordsBtn"));
  9644. this.emotionBtn = (this.getChild("emotionBtn"));
  9645. this.mybggg = (this.getChild("mybggg"));
  9646. this.wordsList = (this.getChild("wordsList"));
  9647. this.emotionList = (this.getChild("emotionList"));
  9648. this.myRoot = (this.getChild("myRoot"));
  9649. }
  9650. }
  9651. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  9652. class EmotionDisplay {
  9653. constructor(index, ui) {
  9654. this.ui = ui;
  9655. this.index = index;
  9656. this.ui.onClick(this, this.clickSelf);
  9657. this.updateSelf();
  9658. }
  9659. updateSelf() {
  9660. let data = cfgTable.emotionData[this.index + 1];
  9661. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  9662. }
  9663. clickSelf() {
  9664. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9665. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  9666. xGame.common.talkMgr.closeTalkView();
  9667. }
  9668. }
  9669. class WordsDisplay {
  9670. constructor(index, ui) {
  9671. this.ui = ui;
  9672. this.index = index;
  9673. this.ui.onClick(this, this.clickSelf);
  9674. this.updateSelf();
  9675. }
  9676. updateSelf() {
  9677. let data = cfgTable.talkwordsData[this.index + 1];
  9678. this.ui.txt.text = data.msg;
  9679. }
  9680. clickSelf() {
  9681. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9682. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  9683. xGame.common.talkMgr.closeTalkView();
  9684. }
  9685. }
  9686. class UIWordsList extends UIBase {
  9687. constructor() {
  9688. super();
  9689. }
  9690. onConstructor() {
  9691. this.ui = ui_UIWordsList.createInstance();
  9692. this.contentPane = this.ui;
  9693. this.isEject = false;
  9694. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  9695. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  9696. this.addUIClick(this.ui.clickNode, this.hide);
  9697. this.initTalkList();
  9698. this.initEmotionList();
  9699. }
  9700. show() {
  9701. super.show();
  9702. }
  9703. initTalkList() {
  9704. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  9705. let data = cfgTable.talkwordsData;
  9706. let length = Object.keys(data).length;
  9707. this.ui.wordsList.numItems = length;
  9708. }
  9709. initEmotionList() {
  9710. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  9711. let data = cfgTable.emotionData;
  9712. let length = Object.keys(data).length;
  9713. this.ui.emotionList.numItems = length;
  9714. }
  9715. renderTalkItem(index, obj) {
  9716. let temp = new WordsDisplay(index, obj);
  9717. }
  9718. renderEmotionItem(index, obj) {
  9719. let temp = new EmotionDisplay(index, obj);
  9720. }
  9721. openTalkList() {
  9722. this.ui.c1.selectedIndex = 0;
  9723. }
  9724. openEmotionList() {
  9725. this.ui.c1.selectedIndex = 1;
  9726. }
  9727. }
  9728. UIWordsList.uiName = "UIWordsList";
  9729. class TalkMgr {
  9730. constructor() {
  9731. this.aiSpeak = true;
  9732. this.emotionList = [];
  9733. this.talkList = [];
  9734. this.addEvent();
  9735. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9736. this.emotionList = [];
  9737. this.talkList = [];
  9738. for (let k in cfgTable.emotionData) {
  9739. this.emotionList.push(cfgTable.emotionData[k].id);
  9740. }
  9741. for (let k in cfgTable.talkwordsData) {
  9742. this.talkList.push(cfgTable.talkwordsData[k].id);
  9743. }
  9744. }
  9745. addEvent() {
  9746. let ui = xGame.common.gameUI.ui;
  9747. ui.wordsBtn.visible = true;
  9748. ui.wordsBtn.onClick(this, this.openTalkView);
  9749. ui.aiWordsBtn.visible = true;
  9750. ui.aiWordsBtn.onClick(this, this.clickAIState);
  9751. }
  9752. openTalkView() {
  9753. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9754. xGame.uiMgr.Show(UIWordsList);
  9755. }
  9756. closeTalkView() {
  9757. xGame.uiMgr.Hide(UIWordsList);
  9758. }
  9759. clickAIState() {
  9760. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9761. this.aiSpeak = !this.aiSpeak;
  9762. this.changeAIState(this.aiSpeak);
  9763. }
  9764. changeAIState(speak) {
  9765. this.aiSpeak = speak;
  9766. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  9767. if (speak) {
  9768. btn.c1.selectedIndex = 0;
  9769. }
  9770. else {
  9771. btn.c1.selectedIndex = 1;
  9772. }
  9773. }
  9774. showSelfTalk(wordsId) {
  9775. let ui = xGame.common.gameUI.ui;
  9776. ui.selfTalk.visible = true;
  9777. ui.selfTalk.myNode.c1.selectedIndex = 1;
  9778. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9779. ui.selfTalk.t0.play();
  9780. }
  9781. showSelfEmotion(emotionId) {
  9782. let ui = xGame.common.gameUI.ui;
  9783. ui.selfTalk.visible = true;
  9784. ui.selfTalk.myNode.c1.selectedIndex = 0;
  9785. this.selfSpine && this.selfSpine.dispose();
  9786. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9787. let spineData = cfgTable.emotionData[emotionId].spine;
  9788. this.selfSpine = new SpineMgr(spineData, () => {
  9789. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  9790. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  9791. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9792. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  9793. });
  9794. ui.selfTalk.t0.play();
  9795. }
  9796. showAITalk(wordsId) {
  9797. if (!this.aiSpeak)
  9798. return;
  9799. if (DataMgr.gameData.gameCount < 2)
  9800. return;
  9801. if (wordsId < 1)
  9802. wordsId = this.getRandTalk();
  9803. let ui = xGame.common.gameUI.ui;
  9804. ui.aiTalk.visible = true;
  9805. ui.aiTalk.myNode.c1.selectedIndex = 1;
  9806. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9807. ui.aiTalk.t0.play();
  9808. }
  9809. getRandTalk() {
  9810. let rand = xGame.tools.random(0, this.talkList.length);
  9811. return this.emotionList[rand];
  9812. }
  9813. getRandEmotion() {
  9814. let rand = xGame.tools.random(0, this.emotionList.length);
  9815. return this.emotionList[rand];
  9816. }
  9817. showAIEmotion(emotionId) {
  9818. if (!this.aiSpeak)
  9819. return;
  9820. if (DataMgr.gameData.gameCount < 2)
  9821. return;
  9822. if (emotionId < 1)
  9823. emotionId = this.getRandEmotion();
  9824. let ui = xGame.common.gameUI.ui;
  9825. ui.aiTalk.visible = true;
  9826. ui.aiTalk.myNode.c1.selectedIndex = 0;
  9827. this.aiSpine && this.aiSpine.dispose();
  9828. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9829. let spineData = cfgTable.emotionData[emotionId].spine;
  9830. this.aiSpine = new SpineMgr(spineData, () => {
  9831. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  9832. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  9833. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9834. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  9835. });
  9836. ui.aiTalk.t0.play();
  9837. }
  9838. resetGame() {
  9839. let ui = xGame.common.gameUI.ui;
  9840. ui.aiTalk.visible = false;
  9841. ui.selfTalk.visible = false;
  9842. this.aiSpine && this.aiSpine.dispose();
  9843. this.selfSpine && this.selfSpine.dispose();
  9844. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9845. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9846. this.closeTalkView();
  9847. }
  9848. }
  9849. class WordsMgr {
  9850. constructor() {
  9851. this.comboTimes = 1;
  9852. this.skillTimes = 0;
  9853. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  9854. this.comboSpine = new SpineMgr("yxz_liangan");
  9855. this.skillSpine = new SpineMgr("yiganxqiu");
  9856. this.scoreSpine = new SpineMgr("defen");
  9857. }
  9858. setClassicCombo(isInterrupt) {
  9859. if (isInterrupt) {
  9860. this.comboTimes = 0;
  9861. }
  9862. }
  9863. playClassicWords(type, callback) {
  9864. this.callback = callback;
  9865. let aniIndex = type;
  9866. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9867. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9868. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9869. mySpine.destroy(true);
  9870. this.playClassicTimes();
  9871. });
  9872. }
  9873. playClassicTimes() {
  9874. this.comboTimes++;
  9875. if (this.comboTimes <= 1) {
  9876. this.callback && this.callback();
  9877. }
  9878. else {
  9879. let aniIndex = this.comboTimes - 1;
  9880. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9881. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9882. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9883. mySpine.destroy(true);
  9884. this.callback && this.callback();
  9885. });
  9886. }
  9887. }
  9888. playBigSkillTimes(times, callback) {
  9889. if (times <= 0) {
  9890. callback && callback();
  9891. return;
  9892. }
  9893. this.callback = callback;
  9894. let pre = "sz_0";
  9895. let aniIndex = 0;
  9896. this.getWordsImg(times, pre, () => {
  9897. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9898. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9899. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9900. let r1 = ``;
  9901. let r2 = ``;
  9902. if (times <= 9) {
  9903. r1 = `res/d2Res/${pre}${times}.png`;
  9904. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9905. aniIndex = 0;
  9906. }
  9907. else {
  9908. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9909. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9910. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9911. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9912. aniIndex = 1;
  9913. }
  9914. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9915. mySpine.destroy(true);
  9916. xGame.common.gameMgr.playSkillTips();
  9917. this.playScore(times);
  9918. xGame.common.playRandomMutiBallBigSkillSound();
  9919. }, mySpine);
  9920. });
  9921. }
  9922. playScore(score) {
  9923. let pre = "sz_";
  9924. let aniIndex = 0;
  9925. this.getWordsImg(score, pre, () => {
  9926. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9927. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9928. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9929. let r1 = ``;
  9930. let r2 = ``;
  9931. if (score <= 9) {
  9932. r1 = `res/d2Res/${pre}${score}.png`;
  9933. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9934. aniIndex = 0;
  9935. }
  9936. else {
  9937. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9938. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9939. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9940. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9941. aniIndex = 1;
  9942. }
  9943. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9944. mySpine.destroy(true);
  9945. this.callback && this.callback();
  9946. }, mySpine);
  9947. });
  9948. }
  9949. getWordsImg(number, pre = "", callback) {
  9950. let arr = [];
  9951. if (number <= 9) {
  9952. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9953. }
  9954. else {
  9955. 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 });
  9956. }
  9957. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9958. callback && callback();
  9959. }));
  9960. }
  9961. }
  9962. class ui_UIRodMethod extends fgui.GComponent {
  9963. static createInstance() {
  9964. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9965. }
  9966. onConstruct() {
  9967. this.n24 = (this.getChild("n24"));
  9968. this.white = (this.getChild("white"));
  9969. this.dot = (this.getChild("dot"));
  9970. this.sureBtn = (this.getChild("sureBtn"));
  9971. this.n20 = (this.getChild("n20"));
  9972. this.n21 = (this.getChild("n21"));
  9973. this.n22 = (this.getChild("n22"));
  9974. this.n23 = (this.getChild("n23"));
  9975. this.n5 = (this.getChild("n5"));
  9976. this.n14 = (this.getChild("n14"));
  9977. this.t0 = this.getTransition("t0");
  9978. }
  9979. }
  9980. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9981. class UIRodMethod extends UIBase {
  9982. constructor() {
  9983. super();
  9984. this.isPressd = false;
  9985. }
  9986. onConstructor() {
  9987. this.ui = ui_UIRodMethod.createInstance();
  9988. this.contentPane = this.ui;
  9989. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9990. this.moveDir = new Laya.Vector2();
  9991. this.moveDest = new Laya.Vector2();
  9992. this.centerPos = new Laya.Vector2();
  9993. xGame.common.uiRodMethod = this;
  9994. }
  9995. show() {
  9996. super.show();
  9997. xGame.common.gameMgr.gamePause = true;
  9998. this.openPressDotEvent();
  9999. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10000. this.centerPos.x = this.ui.white.x;
  10001. this.centerPos.y = this.ui.white.y;
  10002. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10003. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10004. this.setDot();
  10005. }
  10006. setDot() {
  10007. this.ui.dot.x = this.moveDest.x;
  10008. this.ui.dot.y = this.moveDest.y;
  10009. }
  10010. closeSelf() {
  10011. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10012. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10013. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10014. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10015. xGame.common.gameMgr.gamePause = false;
  10016. this.hide();
  10017. }
  10018. openPressDotEvent() {
  10019. this.closePressDotEvent();
  10020. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10021. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10022. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10023. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10024. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10025. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10026. }
  10027. closePressDotEvent() {
  10028. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10029. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10030. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10031. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10032. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10033. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10034. }
  10035. onDown(e) {
  10036. if (e.type == Laya.Event.MOUSE_DOWN)
  10037. this.isPressd = true;
  10038. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10039. this.isPressd = false;
  10040. if (!this.isPressd)
  10041. return;
  10042. this.moveDest.x = e.stageX;
  10043. this.moveDest.y = e.stageY;
  10044. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10045. if (dis > 6724) {
  10046. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10047. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10048. }
  10049. this.setDot();
  10050. }
  10051. resetRod() {
  10052. this.ui.dot.x = this.ui.white.x;
  10053. this.ui.dot.y = this.ui.white.y;
  10054. this.gameRod.dot.x = this.gameRod.bg.x;
  10055. this.gameRod.dot.y = this.gameRod.bg.y;
  10056. xGame.common.rodOffest.x = 0;
  10057. xGame.common.rodOffest.y = 0;
  10058. }
  10059. }
  10060. UIRodMethod.uiName = "UIRodMethod";
  10061. class UIGame extends UIBase {
  10062. constructor() {
  10063. super();
  10064. this.powerNum = 0;
  10065. this.isD3Inited = false;
  10066. this.isPrePlay = false;
  10067. this.isMoveRod = false;
  10068. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10069. this.rulerDis = 20;
  10070. this.rulerOffset = 0;
  10071. }
  10072. onConstructor() {
  10073. this.ui = ui_UIGame.createInstance();
  10074. this.contentPane = this.ui;
  10075. this.ui.x += xGame.common.sysOffestNum;
  10076. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10077. this.isEject = false;
  10078. xGame.common.gameUI = this;
  10079. this.initSelf();
  10080. }
  10081. isTurnSelf() {
  10082. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10083. return true;
  10084. }
  10085. }
  10086. initSelf() {
  10087. let topUI = this.ui.topNode;
  10088. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10089. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10090. this.barInfo = {};
  10091. this.barInfo.curY = 0;
  10092. this.barInfo.height = this.ui.powerNode.height;
  10093. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10094. this.barInfo.powerStartY = this.ui.powerNode.y;
  10095. xGame.common.aiPlayer = new AIPlayer();
  10096. xGame.common.gameMgr = new GameMgr();
  10097. xGame.common.skillMgr = new SkillMgr();
  10098. xGame.common.wordsMgr = new WordsMgr();
  10099. xGame.common.talkMgr = new TalkMgr();
  10100. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  10101. console.log("加载经典模式表情文件chenggon !");
  10102. });
  10103. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  10104. console.log("挑战模式奖励模式spine加载成功!");
  10105. });
  10106. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  10107. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10108. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  10109. this.addUIClick(this.ui.returnBtn, this.returnHome);
  10110. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  10111. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  10112. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  10113. }
  10114. getGanZiImg() {
  10115. let index = DataMgr.getCurBallRod();
  10116. let data = cfgTable.ballrodData[index + 1];
  10117. let gan_url = xGame.common.getGameIconUrl(data.img);
  10118. console.log('zh:getGanZiImg gan_url==' + gan_url);
  10119. this.ui.powerNode.showImg.url = gan_url;
  10120. console.log('zh:修改杆子图标O K');
  10121. }
  10122. returnHome() {
  10123. let tips = "Are you sure to exit the game?";
  10124. let woman = "Boss, why don't you play for a while longer?";
  10125. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  10126. }
  10127. addRodMethodClick() {
  10128. if (this.isTurnSelf()) {
  10129. xGame.uiMgr.Show(UIRodMethod);
  10130. }
  10131. }
  10132. clickHelpLineBtn(force = false) {
  10133. if (!this.isTurnSelf())
  10134. return;
  10135. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10136. if (success) {
  10137. xGame.common.longHelpLine = true;
  10138. xGame.common.d2World.getHelpLine();
  10139. Moyu.sendDataEvent("guideNum");
  10140. }
  10141. else {
  10142. }
  10143. });
  10144. }
  10145. renderSelfDisplayBalls(index, target) {
  10146. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  10147. target.myImg.url = xGame.common.getGameIconUrl(str);
  10148. }
  10149. renderAIDisplayBalls(index, target) {
  10150. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  10151. target.myImg.url = xGame.common.getGameIconUrl(str);
  10152. ;
  10153. }
  10154. updateMode() {
  10155. if (xGame.common.gameMode == GameMode.classic) {
  10156. this.ui.topNode.scoreNode.visible = false;
  10157. }
  10158. else if (xGame.common.gameMode == GameMode.bigMove) {
  10159. this.ui.topNode.scoreNode.visible = true;
  10160. }
  10161. }
  10162. show() {
  10163. super.show();
  10164. console.log("zh:uigame show AADD");
  10165. this.ui.alpha = 0;
  10166. this.updateSelf();
  10167. xGame.common.gameMgr.gamePause = false;
  10168. xGame.common.gameUI.ui.blackAni.visible = false;
  10169. xGame.common.gameUI.ui.whiteAni.visible = false;
  10170. this.ui.powerEft.visible = false;
  10171. this.ui.colorNode.visible = false;
  10172. this.updateHead();
  10173. let curUse = DataMgr.getCurBallRod();
  10174. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  10175. this.getGanZiImg();
  10176. }
  10177. updateSelf() {
  10178. if (xGame.common.gameMode == GameMode.classic) {
  10179. this.ui.c1.selectedIndex = 0;
  10180. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  10181. this.ui.topNode.middleNode.visible = true;
  10182. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  10183. }
  10184. else if (xGame.common.gameMode == GameMode.bigMove) {
  10185. this.ui.c1.selectedIndex = 0;
  10186. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  10187. this.ui.topNode.middleNode.visible = false;
  10188. let max = xGame.cfgMgr.getMaxBigMoveLength();
  10189. let rand = xGame.common.randomNum(1, max);
  10190. let guide = DataMgr.getSkillGuide();
  10191. if (guide == 0)
  10192. rand = 1;
  10193. xGame.common.bigMoveLevelIndex = rand;
  10194. }
  10195. else if (xGame.common.gameMode == GameMode.placeBall) {
  10196. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  10197. this.ui.c1.selectedIndex = 1 + data.type;
  10198. this.ui.alpha = 1;
  10199. this.startGame();
  10200. }
  10201. this.updateMode();
  10202. this.initD3world();
  10203. this.initD2world();
  10204. }
  10205. startGame() {
  10206. this.ui.snowNode.visible = Math.random() <= 0.1;
  10207. this.ui.d2Node.visible = false;
  10208. xGame.common.d3World.d3Hand.gameObj.active = false;
  10209. xGame.common.d3World.tableSrc.init();
  10210. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10211. this.cameraViewChange(() => {
  10212. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  10213. switch (xGame.common.gameMode) {
  10214. case GameMode.classic:
  10215. xGame.common.d3World.d3Hand.gameObj.active = true;
  10216. this.playPutBallD3Ani();
  10217. break;
  10218. case GameMode.bigMove:
  10219. this.enterGame();
  10220. Laya.timer.once(500, this, () => {
  10221. this.ui.topNode.middleNode.visible = true;
  10222. this.ui.topNode.middleNode.t0.play();
  10223. });
  10224. break;
  10225. case GameMode.placeBall:
  10226. this.enterGame();
  10227. break;
  10228. default:
  10229. break;
  10230. }
  10231. });
  10232. PlatMgr.showBanner(false);
  10233. }
  10234. enterGame() {
  10235. this.ui.d2Node.visible = true;
  10236. xGame.common.d3World.d3Hand.gameObj.active = false;
  10237. xGame.common.showOneCamera("mainCamera");
  10238. Moyu.recordGame(30, true);
  10239. if (!this.isPrePlay) {
  10240. this.isPrePlay = true;
  10241. xGame.common.d3World.prePlayEft();
  10242. }
  10243. xGame.common.gameMgr.gameReady();
  10244. this.openAllEvent();
  10245. this.ui.snowNode.visible = false;
  10246. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  10247. this.ui.helpBtn.visible = condition;
  10248. }
  10249. showHelpLineGuide() {
  10250. let longGuide = DataMgr.getGuideHelpLine();
  10251. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  10252. this.ui.helpBtn.visible = true;
  10253. this.ui.guideNode.visible = true;
  10254. }
  10255. }
  10256. setTurnAlpha(alpha) {
  10257. this.ui.keduNode.alpha = alpha;
  10258. this.ui.ganNode.alpha = alpha;
  10259. this.ui.rodMethodNode.alpha = alpha;
  10260. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  10261. }
  10262. cameraViewChange(callback) {
  10263. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10264. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  10265. xGame.common.showOneCamera("visitAngle");
  10266. cameraSrc.localRotationEulerY = 180;
  10267. cameraSrc.localRotationEulerZ = 0;
  10268. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  10269. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  10270. callback && callback();
  10271. }));
  10272. }));
  10273. }
  10274. playPutBallD3Ani() {
  10275. xGame.common.showOneCamera("mainCamera");
  10276. let handSrc = xGame.common.d3World.d3Hand;
  10277. handSrc.gameObj.active = true;
  10278. handSrc.transform.localPositionZ = 3;
  10279. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10280. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  10281. handSrc.gameObj.active = false;
  10282. this.enterGame();
  10283. }), 400);
  10284. }));
  10285. }
  10286. updateHead() {
  10287. let user = Moyu.getUserInfo();
  10288. this.ui.topNode.selfNameTxt.text = user.nickName;
  10289. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  10290. let aiData = xGame.cfgMgr.getRandomUserInfo();
  10291. if (DataMgr.getSkillGuide() < 1) {
  10292. this.ui.topNode.aiNameTxt.text = 'billiards';
  10293. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  10294. }
  10295. else {
  10296. this.ui.topNode.aiNameTxt.text = aiData.name;
  10297. let randNo = Math.floor(Math.random() * 10) + 1;
  10298. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  10299. }
  10300. }
  10301. initD2world() {
  10302. let node = this.ui.d2Root.displayObject;
  10303. let src = node.getComponent(D2World);
  10304. if (!src) {
  10305. xGame.common.d2World = node.addComponent(D2World);
  10306. }
  10307. xGame.common.d2World.initSelf();
  10308. }
  10309. initD3world() {
  10310. if (this.isD3Inited)
  10311. return;
  10312. this.isD3Inited = true;
  10313. let scene3D = xGame.common.d3Scene;
  10314. this.ui.d3Root.displayObject.addChild(scene3D);
  10315. scene3D.active = true;
  10316. xGame.common.d3World.tableSrc.setBorderPos();
  10317. }
  10318. onRootMove(e) {
  10319. let rootBall = xGame.common.d2World.rootBall;
  10320. this.ui.moveNode.x = e.x;
  10321. this.ui.moveNode.y = e.y;
  10322. rootBall.gameObj.x = e.x;
  10323. rootBall.gameObj.y = e.y;
  10324. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  10325. }
  10326. aiRootMove(move) {
  10327. if (move)
  10328. this.hideBallUI();
  10329. else {
  10330. this.showBallUI();
  10331. xGame.common.d2World.getHelpLine();
  10332. }
  10333. }
  10334. aiForce(type, force = 0) {
  10335. this.pressTarget = PressType.powerNode;
  10336. if (type == 1)
  10337. this.onEventUp({ force: true });
  10338. else if (type == 2)
  10339. this.onEventMove({ stageY: force, force: true });
  10340. }
  10341. onEventPress(e) {
  10342. if (e.stopPropagation)
  10343. e.stopPropagation();
  10344. if (!this.isTurnSelf())
  10345. return;
  10346. let target = e.target;
  10347. switch (target) {
  10348. case this.ui.myPowerNode.displayObject:
  10349. this.pressTarget = PressType.powerNode;
  10350. this.barInfo.curY = e.stageY;
  10351. this.updateBarInfo();
  10352. break;
  10353. case this.ui.moveNode.displayObject:
  10354. this.pressTarget = PressType.moveNode;
  10355. this.hideBallUI();
  10356. this.eventObj.curX = this.ui.moveNode.x;
  10357. this.eventObj.curY = this.ui.moveNode.y;
  10358. this.ui.moveNode.finger.visible = false;
  10359. this.eventObj.lastX = e.stageX;
  10360. this.eventObj.lastY = e.stageY;
  10361. break;
  10362. case this.ui.rulerClickNode.displayObject:
  10363. this.pressTarget = PressType.rulerNode;
  10364. this.eventObj.lastY = e.stageY;
  10365. break;
  10366. case this.ui.d2Root.displayObject:
  10367. this.pressTarget = PressType.d2Root;
  10368. this.eventObj.lastX = e.stageX;
  10369. this.eventObj.lastY = e.stageY;
  10370. this.eventObj.starX = e.stageX;
  10371. this.eventObj.starY = e.stageY;
  10372. this.eventObj.curX = 0;
  10373. this.eventObj.curY = 0;
  10374. xGame.common.d2World.d2Gan.setGanLastInfo();
  10375. this.rulerOffset = 0;
  10376. break;
  10377. default:
  10378. break;
  10379. }
  10380. }
  10381. onEventMove(e) {
  10382. if (e.stopPropagation)
  10383. e.stopPropagation();
  10384. if (e && e.force) {
  10385. }
  10386. else {
  10387. if (!this.isTurnSelf())
  10388. return;
  10389. }
  10390. switch (this.pressTarget) {
  10391. case PressType.powerNode:
  10392. this.barInfo.curY = e.stageY;
  10393. this.updateBarInfo();
  10394. this.isMoveRod = true;
  10395. break;
  10396. case PressType.moveNode:
  10397. let rootBall = xGame.common.d2World.rootBall;
  10398. let radius = rootBall.gameObj.width / 2;
  10399. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  10400. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  10401. let border = xGame.common.d2World.borderRect;
  10402. if (curX <= border.x + radius)
  10403. curX = border.x + radius;
  10404. else if (curX >= border.x + border.width - radius)
  10405. curX = border.x + border.width - radius;
  10406. if (curY <= border.y + radius)
  10407. curY = border.y + radius;
  10408. else if (curY >= border.y + border.height - radius)
  10409. curY = border.y + border.height - radius;
  10410. if (xGame.common.gameMgr.isOpenBall) {
  10411. if (curX >= border.x + border.openBallW - radius)
  10412. curX = border.x + border.openBallW - radius;
  10413. }
  10414. this.ui.moveNode.x = curX;
  10415. this.ui.moveNode.y = curY;
  10416. rootBall.gameObj.x = curX;
  10417. rootBall.gameObj.y = curY;
  10418. rootBall.d3BallSrc.setTransPos(curX, curY);
  10419. this.isMoveRod = true;
  10420. break;
  10421. case PressType.rulerNode:
  10422. let yy = e.stageY - this.eventObj.lastY;
  10423. this.eventObj.lastY = e.stageY;
  10424. let ruler1 = this.ui.rulerNode.img1;
  10425. let ruler2 = this.ui.rulerNode.img2;
  10426. ruler1.y += yy;
  10427. ruler2.y += yy;
  10428. this.rulerOffset += yy;
  10429. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  10430. this.rulerOffset = 0;
  10431. xGame.soundMgr.playSound("inch", 1, 10);
  10432. }
  10433. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  10434. let h = ruler1.height;
  10435. this.checkGuide();
  10436. this.isMoveRod = true;
  10437. if (ruler1.y >= h) {
  10438. ruler1.y = -h;
  10439. ruler2.y = 0;
  10440. return;
  10441. }
  10442. else if (ruler1.y <= -h) {
  10443. ruler1.y = h;
  10444. ruler2.y = 0;
  10445. return;
  10446. }
  10447. if (ruler2.y >= h) {
  10448. ruler2.y = -h;
  10449. ruler1.y = 0;
  10450. return;
  10451. }
  10452. else if (ruler2.y <= -h) {
  10453. ruler2.y = h;
  10454. ruler1.y = 0;
  10455. return;
  10456. }
  10457. break;
  10458. case PressType.d2Root:
  10459. this.eventObj.curX = e.stageX;
  10460. this.eventObj.curY = e.stageY;
  10461. let offset = this.checkRodMoveDir();
  10462. xGame.common.d2World.d2Gan.rotateSelf(offset);
  10463. this.eventObj.lastX = e.stageX;
  10464. this.eventObj.lastY = e.stageY;
  10465. break;
  10466. default:
  10467. break;
  10468. }
  10469. }
  10470. onEventUp(e) {
  10471. if (e.stopPropagation)
  10472. e.stopPropagation();
  10473. if (e && e.force) {
  10474. }
  10475. else {
  10476. if (!this.isTurnSelf())
  10477. return;
  10478. }
  10479. switch (this.pressTarget) {
  10480. case PressType.powerNode:
  10481. this.ui.powerNode.value = 0;
  10482. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10483. this.ui.powerTxt.text = "";
  10484. if (this.powerNum > 0) {
  10485. xGame.eventMgr.event(BALL_SHOOT);
  10486. xGame.common.d2World.shoot(this.powerNum);
  10487. xGame.common.d2World.d2Gan.shoot();
  10488. xGame.common.d2World.d2HelpLine.shoot();
  10489. this.finishGuide();
  10490. this.ui.powerEft.visible = false;
  10491. this.ui.colorNode.visible = false;
  10492. let ganStr = "";
  10493. if (this.powerNum <= 30) {
  10494. ganStr = "gan_30";
  10495. }
  10496. else if (this.powerNum <= 60) {
  10497. ganStr = "gan_50";
  10498. }
  10499. else {
  10500. ganStr = "gan_80";
  10501. }
  10502. xGame.soundMgr.playSound(ganStr);
  10503. }
  10504. break;
  10505. case PressType.moveNode:
  10506. let rootBall = xGame.common.d2World.rootBall;
  10507. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10508. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10509. let isIntersect = this.judgeBallIntersect();
  10510. if (isIntersect) {
  10511. this.ui.moveNode.x = lastX;
  10512. this.ui.moveNode.y = lastY;
  10513. rootBall.gameObj.x = lastX;
  10514. rootBall.gameObj.y = lastY;
  10515. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10516. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10517. }
  10518. else {
  10519. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10520. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10521. }
  10522. this.showBallUI();
  10523. this.ui.moveNode.finger.visible = true;
  10524. xGame.common.d2World.getHelpLine();
  10525. break;
  10526. case PressType.rulerNode:
  10527. break;
  10528. case PressType.d2Root:
  10529. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10530. if (dis <= 25) {
  10531. this.moveToClickDot(e);
  10532. }
  10533. break;
  10534. default:
  10535. break;
  10536. }
  10537. this.pressTarget = -1;
  10538. }
  10539. checkGuide() {
  10540. let guide = DataMgr.getSkillGuide();
  10541. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10542. xGame.common.guideStep++;
  10543. xGame.common.gameUI.ui.guide2.visible = false;
  10544. xGame.common.gameUI.ui.guide3.visible = true;
  10545. }
  10546. }
  10547. finishGuide() {
  10548. let guide = DataMgr.getSkillGuide();
  10549. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10550. xGame.common.guideStep = 10;
  10551. this.closeAllGuide();
  10552. console.log('zh: 新手引导完毕');
  10553. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  10554. }
  10555. }
  10556. closeAllGuide() {
  10557. xGame.common.gameUI.ui.guide1.visible = false;
  10558. xGame.common.gameUI.ui.guide2.visible = false;
  10559. xGame.common.gameUI.ui.guide3.visible = false;
  10560. }
  10561. updateBarInfo() {
  10562. let star = this.ui.powerNode.y;
  10563. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10564. if (rate >= 1)
  10565. rate = 1;
  10566. if (rate <= 0)
  10567. rate = 0;
  10568. this.powerNum = Math.ceil(rate * 100);
  10569. this.ui.powerNode.value = this.powerNum;
  10570. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10571. this.ui.colorNode.value = this.powerNum;
  10572. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10573. this.ui.powerEft.visible = this.powerNum != 0;
  10574. this.ui.colorNode.visible = this.powerNum != 0;
  10575. this.ui.powerTxt.text = this.powerNum + "";
  10576. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10577. }
  10578. forceCancel() {
  10579. this.ui.powerNode.value = 0;
  10580. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10581. this.ui.powerTxt.text = "";
  10582. }
  10583. checkRodMoveDir() {
  10584. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10585. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10586. if (tempX >= 0 && tempY <= 0) {
  10587. return this.checkDir();
  10588. }
  10589. else if (tempX < 0 && tempY < 0) {
  10590. return this.checkDir(1, -1);
  10591. }
  10592. else if (tempX < 0 && tempY > 0) {
  10593. return this.checkDir(-1, -1);
  10594. }
  10595. else {
  10596. return this.checkDir(-1, 1);
  10597. }
  10598. }
  10599. checkDir(flagX = 1, flagY = 1) {
  10600. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10601. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10602. if (offsetY == 0) {
  10603. return offsetX * flagX;
  10604. }
  10605. if (offsetX == 0) {
  10606. return offsetY * flagY;
  10607. }
  10608. let angle = offsetY / offsetX;
  10609. if (Math.abs(angle) >= 1) {
  10610. return offsetY * flagY;
  10611. }
  10612. else {
  10613. return offsetX * flagX;
  10614. }
  10615. }
  10616. judgeBallIntersect() {
  10617. let rootBall = xGame.common.d2World.rootBall;
  10618. let ballArr = xGame.common.d2World.ballArr;
  10619. let radius = rootBall.gameObj.width / 2;
  10620. let temp;
  10621. let isIntersect = false;
  10622. for (let index = 0; index < ballArr.length; index++) {
  10623. temp = ballArr[index];
  10624. if (temp.number == rootBall.number)
  10625. continue;
  10626. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10627. if (isIntersect) {
  10628. break;
  10629. }
  10630. }
  10631. return isIntersect;
  10632. }
  10633. hideBallUI() {
  10634. let d2Gan = xGame.common.d2World.d2Gan;
  10635. if (!d2Gan.ui.isDisposed)
  10636. d2Gan.ui.visible = false;
  10637. let d2Help = xGame.common.d2World.d2HelpLine;
  10638. if (!d2Help.ui.isDisposed)
  10639. d2Help.ui.visible = false;
  10640. let rootBall = xGame.common.d2World.rootBall;
  10641. if (!rootBall.destroyed) {
  10642. rootBall.gameObj.active = false;
  10643. }
  10644. }
  10645. showBallUI() {
  10646. let d2Gan = xGame.common.d2World.d2Gan;
  10647. if (!d2Gan.ui.isDisposed)
  10648. d2Gan.ui.visible = true;
  10649. let d2Help = xGame.common.d2World.d2HelpLine;
  10650. if (!d2Help.ui.isDisposed)
  10651. d2Help.ui.visible = true;
  10652. let rootBall = xGame.common.d2World.rootBall;
  10653. if (!rootBall.destroyed) {
  10654. rootBall.gameObj.active = true;
  10655. }
  10656. }
  10657. moveToClickDot(e) {
  10658. if (!this.isMoveRod && !xGame.common.clickedBall) {
  10659. let root = xGame.common.d2World.rootBall.gameObj;
  10660. let xx = e.stageX - xGame.common.sysOffestNum;
  10661. let yy = e.stageY;
  10662. let x = xx - root.x;
  10663. let y = yy - root.y;
  10664. let angle = xGame.common.getfguiRotation(x, y);
  10665. xGame.common.d2World.d2Gan.ui.rotation = angle;
  10666. xGame.common.d2World.getHelpLine();
  10667. }
  10668. this.isMoveRod = false;
  10669. xGame.common.clickedBall = false;
  10670. }
  10671. openAllEvent() {
  10672. this.closeAllEvent();
  10673. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10674. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10675. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10676. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10677. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10678. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10679. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10680. }
  10681. closeAllEvent() {
  10682. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10683. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10684. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10685. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10686. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10687. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10688. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10689. }
  10690. resetGame() {
  10691. this.closeAllEvent();
  10692. this.hideBallUI();
  10693. xGame.common.gameMgr.gamePause = true;
  10694. }
  10695. }
  10696. UIGame.uiName = "UIGame";
  10697. class UIAddProp extends UIBase {
  10698. constructor() {
  10699. super();
  10700. this.curType = "";
  10701. }
  10702. onConstructor() {
  10703. this.ui = ui_UIAddProp.createInstance();
  10704. this.contentPane = this.ui;
  10705. this.isEject = false;
  10706. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  10707. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  10708. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  10709. this.updateUI();
  10710. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  10711. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  10712. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  10713. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  10714. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  10715. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  10716. }
  10717. show(type) {
  10718. super.show();
  10719. this.curType = type == 0 ? "coin" : "diamond";
  10720. this.switchBtn("");
  10721. this.ui.t0.play();
  10722. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  10723. PlatMgr.showInsert(true);
  10724. }
  10725. closeSelf() {
  10726. this.hide();
  10727. }
  10728. updateUI() {
  10729. let data = cfgTable.moneyData;
  10730. let temp;
  10731. let obj;
  10732. for (const key in data) {
  10733. temp = data[key];
  10734. obj = this.ui.myNode["node" + key];
  10735. if (parseInt(key) <= 2) {
  10736. obj.diamondTxt.text = "+" + temp.num;
  10737. }
  10738. else {
  10739. obj.coinTxt.text = temp.num;
  10740. obj.diamondTxt.text = temp.get.split('_')[1];
  10741. }
  10742. }
  10743. this.updateDiamondShare();
  10744. }
  10745. updateDiamondShare() {
  10746. let data = DataMgr.getShareDiamondTimes();
  10747. if (data >= xGame.common.maxShareDiamondTimes) {
  10748. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  10749. this.ui.myNode.node1.touchable = false;
  10750. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10751. }
  10752. else {
  10753. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  10754. this.ui.myNode.node1.touchable = true;
  10755. }
  10756. }
  10757. switchBtn(type) {
  10758. if (type == "")
  10759. type = this.curType;
  10760. else {
  10761. if (this.curType == type) {
  10762. return;
  10763. }
  10764. else {
  10765. this.curType = type;
  10766. }
  10767. }
  10768. if (type == "coin") {
  10769. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  10770. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  10771. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  10772. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  10773. this.ui.myNode.c1.selectedIndex = 0;
  10774. }
  10775. else {
  10776. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  10777. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  10778. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  10779. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  10780. this.ui.myNode.c1.selectedIndex = 1;
  10781. }
  10782. }
  10783. convertCoin(index) {
  10784. let data = cfgTable.moneyData[index];
  10785. let coinNum = data.num;
  10786. let str = data.get.split('_')[1];
  10787. let needDiamond = parseInt(str);
  10788. if (DataMgr.diamondEnough(needDiamond)) {
  10789. DataMgr.setDiamond(-needDiamond);
  10790. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  10791. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  10792. }
  10793. else {
  10794. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  10795. this.switchBtn("diamond");
  10796. }
  10797. }
  10798. videoGetDiamond() {
  10799. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  10800. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  10801. }
  10802. else {
  10803. console.log('zh:AD 失败,直接发放奖励');
  10804. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  10805. }
  10806. }
  10807. qjff_AD_for_uiAddProp_videoGetDiamond() {
  10808. let num = cfgTable.moneyData[2].num;
  10809. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10810. this.closeSelf();
  10811. }
  10812. videoGetCoin() {
  10813. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  10814. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  10815. }
  10816. else {
  10817. console.log('zh:AD 失败,直接发放奖励');
  10818. this.qjff_AD_for_uiAddProp_videoGetCoin();
  10819. }
  10820. }
  10821. qjff_AD_for_uiAddProp_videoGetCoin() {
  10822. xGame.common.playObjFlyAnim(2000, Prop.coin);
  10823. this.closeSelf();
  10824. }
  10825. shareGetDiamond() {
  10826. let times = DataMgr.getShareDiamondTimes();
  10827. if (times >= xGame.common.maxShareDiamondTimes) {
  10828. console.log('zh: 233333333333 maxShareDiamondTimes');
  10829. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10830. }
  10831. else {
  10832. console.log('zh:33333333333333ad');
  10833. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  10834. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  10835. }
  10836. else {
  10837. console.log('zh:AD 失败,直接发放奖励');
  10838. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  10839. }
  10840. }
  10841. }
  10842. qjff_AD_for_uiAddProp_shareGetDiamond() {
  10843. let diamond = xGame.common.randomNum(50, 100);
  10844. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  10845. DataMgr.setShareDiamondTimes(1);
  10846. this.updateDiamondShare();
  10847. }
  10848. openPutBallView() {
  10849. let end = xGame.uiMgr.getUI(UIGameEnd);
  10850. let skill = xGame.uiMgr.getUI(UISkill);
  10851. let level = xGame.uiMgr.getUI(UILevelDisplay);
  10852. let uigame = xGame.uiMgr.getUI(UIGame);
  10853. if (end && !end.isHide) {
  10854. xGame.uiMgr.Hide(UIGameEnd);
  10855. xGame.uiMgr.Show(UIMain);
  10856. }
  10857. if (skill && !skill.isHide)
  10858. xGame.uiMgr.Hide(UISkill);
  10859. if (uigame && !uigame.isHide)
  10860. xGame.uiMgr.Hide(UIGame);
  10861. if (level && !level.isHide) {
  10862. }
  10863. else {
  10864. xGame.uiMgr.Show(UILevelDisplay);
  10865. }
  10866. this.closeSelf();
  10867. }
  10868. }
  10869. UIAddProp.uiName = "UIAddProp";
  10870. class MoneyNode {
  10871. constructor(ui) {
  10872. this.leftTime = 0;
  10873. this.ui = ui;
  10874. this.ui.addCoinBtn.onClick(this, this.addCoin);
  10875. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  10876. this.ui.addPowerBtn.onClick(this, this.addPower);
  10877. this.ui.c1.selectedIndex = 1;
  10878. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  10879. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  10880. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  10881. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10882. this.coinChange();
  10883. this.diamondChange();
  10884. this.powerChange();
  10885. }
  10886. addPower() {
  10887. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10888. xGame.uiMgr.Show(UIPower);
  10889. }
  10890. powerChange() {
  10891. let powerNum = DataMgr.getPower();
  10892. this.ui.powerTxt.text = powerNum + "";
  10893. }
  10894. checkPowerTime() {
  10895. let cur = new Date().getTime();
  10896. let last = DataMgr.getPowerTime();
  10897. if (last == 0) {
  10898. last = cur;
  10899. DataMgr.setPowerTime(cur);
  10900. }
  10901. let power = DataMgr.getPower();
  10902. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10903. Laya.timer.clearAll(this);
  10904. if (power >= xGame.common.natureMaxPower) {
  10905. this.ui.powerTimeTxt.text = "";
  10906. DataMgr.setPowerTime(cur);
  10907. return;
  10908. }
  10909. if (power + offset >= xGame.common.natureMaxPower) {
  10910. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10911. this.ui.powerTimeTxt.text = "";
  10912. DataMgr.setPowerTime(cur);
  10913. }
  10914. else {
  10915. if (offset > 0) {
  10916. DataMgr.setPower(offset);
  10917. DataMgr.setPowerTime(cur);
  10918. }
  10919. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10920. this.leftTime = xGame.common.powerRecoverNum - time;
  10921. if (this.leftTime <= 0)
  10922. this.leftTime = 0;
  10923. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10924. Laya.timer.loop(1000, this, this.updatePowerTime);
  10925. }
  10926. }
  10927. updatePowerTime() {
  10928. this.leftTime -= 1;
  10929. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10930. if (this.leftTime <= 0) {
  10931. this.checkPowerTime();
  10932. }
  10933. }
  10934. coinChange() {
  10935. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10936. }
  10937. diamondChange() {
  10938. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10939. }
  10940. addCoin() {
  10941. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10942. Moyu.sendDataEvent("AddCoinBtn");
  10943. xGame.uiMgr.Show(UIAddProp, 0);
  10944. }
  10945. addDiamond() {
  10946. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10947. Moyu.sendDataEvent("AddDiamondBtn");
  10948. xGame.uiMgr.Show(UIAddProp, 1);
  10949. }
  10950. }
  10951. class UIDraw extends UIBase {
  10952. constructor() {
  10953. super();
  10954. this.curKey = 0;
  10955. }
  10956. onConstructor() {
  10957. this.ui = ui_UIDraw.createInstance();
  10958. this.contentPane = this.ui;
  10959. this.isEject = false;
  10960. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10961. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10962. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10963. this.initDraw();
  10964. this.initUI();
  10965. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10966. if (Moyu.isKs)
  10967. this.ui.closeNode.closeBtn.x += 100;
  10968. }
  10969. show() {
  10970. super.show();
  10971. this.ui.t0.play();
  10972. this.playSecretaryIdle();
  10973. this.updateDraw();
  10974. this.checkFree();
  10975. if (PlatMgr.bannerDelay > 0) {
  10976. this.ui.closeNode.closeBtn.visible = false;
  10977. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10978. this.ui.closeNode.closeBtn.visible = true;
  10979. });
  10980. }
  10981. PlatMgr.showRateBanner();
  10982. }
  10983. hide() {
  10984. Laya.timer.clearAll(this);
  10985. super.hide();
  10986. }
  10987. checkFree() {
  10988. let isFree = DataMgr.getDailyfreeDrawTimes();
  10989. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10990. }
  10991. initDraw() {
  10992. this.drawObj = [];
  10993. let data = cfgTable.drawData;
  10994. let temp;
  10995. let weight = 0;
  10996. for (const key in data) {
  10997. temp = data[key];
  10998. weight += temp.weight;
  10999. this.drawObj.push(weight);
  11000. }
  11001. this.allWeight = weight;
  11002. }
  11003. initUI() {
  11004. let data = cfgTable.drawData;
  11005. let temp;
  11006. let img;
  11007. let txt;
  11008. for (const key in data) {
  11009. temp = data[key];
  11010. img = this.ui.myNode.rotNode["img" + key];
  11011. txt = this.ui.myNode.rotNode["txt" + key];
  11012. img.url = xGame.common.getGameIconUrl(temp.icon);
  11013. txt.visible = true;
  11014. if (temp.award > 2) {
  11015. img.rotation = 0;
  11016. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11017. }
  11018. else {
  11019. img.rotation = temp.rotation;
  11020. txt.text = temp.num;
  11021. }
  11022. }
  11023. }
  11024. getCurkey() {
  11025. let rand = Math.random() * this.allWeight;
  11026. let temp;
  11027. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11028. temp = this.drawObj[index];
  11029. if (index == 0) {
  11030. if (rand < temp) {
  11031. return index + 1;
  11032. }
  11033. }
  11034. else {
  11035. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11036. return index + 1;
  11037. }
  11038. }
  11039. }
  11040. return 2;
  11041. }
  11042. startDraw() {
  11043. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11044. if (freeTimes > 0) {
  11045. this.beginDraw();
  11046. DataMgr.setDailyfreeDrawTimes(0);
  11047. this.checkFree();
  11048. }
  11049. else {
  11050. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11051. }
  11052. else {
  11053. console.log('zh:AD 失败,直接发放奖励');
  11054. this.qjff_chouJiang();
  11055. }
  11056. }
  11057. }
  11058. qjff_chouJiang() {
  11059. this.beginDraw();
  11060. }
  11061. beginDraw() {
  11062. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11063. this.ui.drawBtn.touchable = false;
  11064. this.curKey = this.getCurkey();
  11065. console.log("当前key", this.curKey);
  11066. let cell = 60;
  11067. let lap = 3;
  11068. let angle = cell * (this.curKey - 1) + lap * 360;
  11069. let target = this.ui.myNode.rotNode;
  11070. target.rotation = 0;
  11071. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  11072. console.log("旋转完成");
  11073. this.ui.drawBtn.touchable = true;
  11074. this.getAward();
  11075. }));
  11076. }
  11077. getAward() {
  11078. let data = cfgTable.drawData[this.curKey];
  11079. let temp = new AwardType();
  11080. temp.type = data.award;
  11081. temp.num = data.num;
  11082. xGame.common.getAward([temp], () => {
  11083. DataMgr.setDrawTimes(1);
  11084. this.updateDraw();
  11085. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11086. });
  11087. }
  11088. updateDraw() {
  11089. let drawTimes = DataMgr.getDrawTimes();
  11090. let awardTimes = DataMgr.getDrawAwardTimes();
  11091. if (Math.floor(drawTimes / 3) > awardTimes) {
  11092. this.ui.extraNode.boxBtn.t0.play(null, -1);
  11093. this.ui.extraNode.boxBtn.touchable = true;
  11094. this.ui.extraNode.tipsTxt.text = "3/3";
  11095. this.ui.extraNode.barNode.width = 265;
  11096. this.getExtraAward();
  11097. }
  11098. else {
  11099. this.ui.extraNode.boxBtn.t0.stop();
  11100. this.ui.extraNode.boxBtn.touchable = false;
  11101. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  11102. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  11103. }
  11104. let data = cfgTable.drawData[1];
  11105. if (awardTimes == 0) {
  11106. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  11107. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  11108. this.ui.myNode.rotNode.img1.rotation = 0;
  11109. }
  11110. else {
  11111. let award = data.nextid;
  11112. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  11113. this.ui.myNode.rotNode.txt1.text = award[1];
  11114. this.ui.myNode.rotNode.img1.rotation = 0;
  11115. }
  11116. }
  11117. getExtraAward() {
  11118. let drawTimes = DataMgr.getDrawTimes();
  11119. let awardTimes = DataMgr.getDrawAwardTimes();
  11120. let data = cfgTable.drawData[1];
  11121. let award = new AwardType();
  11122. if (awardTimes == 0) {
  11123. award.num = data.num;
  11124. award.type = data.award;
  11125. xGame.common.getAward([award], () => {
  11126. let all = Math.floor(drawTimes / 3);
  11127. DataMgr.setDrawAwardTimes(all);
  11128. this.updateDraw();
  11129. });
  11130. }
  11131. else {
  11132. award.num = parseInt(data.nextid[1]);
  11133. award.type = parseInt(data.nextid[0]);
  11134. xGame.common.getAward([award], () => {
  11135. let all = Math.floor(drawTimes / 3);
  11136. DataMgr.setDrawAwardTimes(all);
  11137. this.updateDraw();
  11138. });
  11139. }
  11140. }
  11141. closeSelf() {
  11142. this.hide();
  11143. }
  11144. playSecretaryIdle() {
  11145. let parent = this.ui.secretary.displayObject;
  11146. parent.destroyChildren();
  11147. let xx = this.ui.secretary.width / 2;
  11148. let yy = this.ui.secretary.height;
  11149. let scale = xGame.common.getSecretaryScale();
  11150. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  11151. xGame.common.secretary.play(data, 0, true, parent);
  11152. }
  11153. }
  11154. UIDraw.uiName = "UIDraw";
  11155. class ui_UIFlyEft extends fgui.GComponent {
  11156. static createInstance() {
  11157. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  11158. }
  11159. onConstruct() {
  11160. this.n0 = (this.getChild("n0"));
  11161. this.n1 = (this.getChild("n1"));
  11162. this.n2 = (this.getChild("n2"));
  11163. this.n3 = (this.getChild("n3"));
  11164. this.n4 = (this.getChild("n4"));
  11165. this.n5 = (this.getChild("n5"));
  11166. this.n6 = (this.getChild("n6"));
  11167. this.n7 = (this.getChild("n7"));
  11168. this.iconNode = (this.getChild("iconNode"));
  11169. this.txt = (this.getChild("txt"));
  11170. this.txtNode = (this.getChild("txtNode"));
  11171. }
  11172. }
  11173. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  11174. class UIFlyEft extends UIBase {
  11175. constructor() {
  11176. super();
  11177. this.max = 8;
  11178. this.delay = 0;
  11179. }
  11180. onConstructor() {
  11181. this.ui = ui_UIFlyEft.createInstance();
  11182. this.contentPane = this.ui;
  11183. this.isEject = false;
  11184. this.isMuti = true;
  11185. this.ui.x += xGame.common.sysOffestNum;
  11186. }
  11187. getArrPos() {
  11188. if (this.iconPos && this.iconPos.length > 0)
  11189. return;
  11190. this.iconPos = [];
  11191. let temp;
  11192. for (let index = 0; index < this.max; index++) {
  11193. temp = this.ui["n" + index];
  11194. this.iconPos.push([temp.x, temp.y]);
  11195. }
  11196. }
  11197. show(stPos, edPos, num, type, callback) {
  11198. super.show();
  11199. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  11200. this.getArrPos();
  11201. this.updateUI(type);
  11202. this.updatePos();
  11203. this.runFly(edPos, callback);
  11204. this.runWorlds(stPos, num);
  11205. }
  11206. updateUI(type) {
  11207. let temp;
  11208. let str;
  11209. for (let index = 0; index < this.max; index++) {
  11210. temp = this.ui["n" + index];
  11211. str = this.getIconStr(type);
  11212. temp.url = xGame.common.getGameIconUrl(str);
  11213. }
  11214. }
  11215. getIconStr(type) {
  11216. switch (type) {
  11217. case Prop.diamond:
  11218. return "ty_zs";
  11219. case Prop.coin:
  11220. return "ty_jb";
  11221. default:
  11222. break;
  11223. }
  11224. }
  11225. updatePos() {
  11226. let temp;
  11227. for (let index = 0; index < this.max; index++) {
  11228. temp = this.ui["n" + index];
  11229. temp.x = this.iconPos[index][0];
  11230. temp.y = this.iconPos[index][1];
  11231. }
  11232. }
  11233. runFly(endPos, callback) {
  11234. let all = 0;
  11235. let temp;
  11236. for (let index = 0; index < this.max; index++) {
  11237. temp = this.ui["n" + index];
  11238. temp.visible = true;
  11239. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  11240. temp.visible = false;
  11241. all++;
  11242. if (all >= this.max) {
  11243. callback && callback();
  11244. }
  11245. }), 20 * index);
  11246. }
  11247. }
  11248. runWorlds(stPos, num) {
  11249. let str = "+" + num;
  11250. this.ui.txt.text = str;
  11251. let starX = stPos.x;
  11252. let starY = stPos.y + 50;
  11253. this.ui.txt.x = starX;
  11254. this.ui.txt.y = starY;
  11255. this.ui.txt.visible = true;
  11256. this.ui.txt.alpha = 1;
  11257. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  11258. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  11259. this.ui.txt.visible = false;
  11260. this.hide();
  11261. }));
  11262. }));
  11263. }
  11264. }
  11265. UIFlyEft.uiName = "UIFlyEft";
  11266. class Common {
  11267. constructor() {
  11268. this.convertNum = 0.025;
  11269. this.VectorUp = new Laya.Vector3(0, 1, 0);
  11270. this.scaleV3One = new Laya.Vector3();
  11271. this.scaleV3Two = new Laya.Vector3();
  11272. this.posV4 = new Laya.Vector4();
  11273. this.showDebug = false;
  11274. this.openGuide = true;
  11275. this.rodOffest = new Laya.Vector2(0, 0);
  11276. this.rodAngle = 0;
  11277. this.gameMode = GameMode.classic;
  11278. this.bigMoveLevelIndex = 1;
  11279. this.bigMoveNeedCoin = 1000;
  11280. this.classicNiceNeddCoin = 1000;
  11281. this.passAwardCoin = 2000;
  11282. this.classicRoomType = 1;
  11283. this.maxPower = 20;
  11284. this.natureMaxPower = 5;
  11285. this.videoPower = 2;
  11286. this.powerRecoverNum = 900;
  11287. this.curPlayerSkillType = 0;
  11288. this.isNewDay = false;
  11289. this.clickedBall = false;
  11290. this.placeBallCurLevel = 0;
  11291. this.placeBallStarNum = 0;
  11292. this.longHelpLine = false;
  11293. this.maxShareDiamondTimes = 3;
  11294. this.guideStep = 0;
  11295. this.temSelfLevel = 0;
  11296. this.extraMoveNum = 0;
  11297. this.curRankID = 0;
  11298. this.rankID = {
  11299. normalStar: 12000,
  11300. wxStar: 12001
  11301. };
  11302. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  11303. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  11304. this.btnClickStr = "buttonclick";
  11305. this.maxSkillLevel = 10;
  11306. this.upSkillLevel = false;
  11307. this.gameStartTime = 0;
  11308. this._sysOffestNum = 0;
  11309. this.angleV2 = new Laya.Vector2();
  11310. this.rootV = new Laya.Vector2(0, 1);
  11311. this.tempDir1 = new Laya.Vector2();
  11312. this.tempDir2 = new Laya.Vector2();
  11313. this.ballSize = 33;
  11314. this.stPos = new Laya.Point();
  11315. this.edPos = new Laya.Point();
  11316. Common._instance = this;
  11317. window["common"] = this;
  11318. }
  11319. static getInstance() {
  11320. if (!this._instance) {
  11321. this._instance = new Common();
  11322. }
  11323. return this._instance;
  11324. }
  11325. get sysOffestNum() {
  11326. if (this._sysOffestNum == 0) {
  11327. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  11328. }
  11329. return this._sysOffestNum;
  11330. }
  11331. testShader() {
  11332. let test = new LightShader();
  11333. test.texture = "res/d3Res/ballTexture/ball1.png";
  11334. Laya.stage.addChild(test);
  11335. }
  11336. playScale(node) {
  11337. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  11338. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  11339. }));
  11340. }));
  11341. }
  11342. setGroup(colli, ...group) {
  11343. let out = 0;
  11344. for (let index = 0; index < group.length; index++) {
  11345. if (index == 0) {
  11346. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11347. }
  11348. else {
  11349. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11350. }
  11351. }
  11352. colli.collisionGroup = out;
  11353. }
  11354. setCanGroupWith(colli, ...group) {
  11355. let out = 0;
  11356. for (let index = 0; index < group.length; index++) {
  11357. if (index == 0) {
  11358. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11359. }
  11360. else {
  11361. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11362. }
  11363. }
  11364. colli.canCollideWith = out;
  11365. }
  11366. loadPrefab(name, callback) {
  11367. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  11368. let prefab = new Laya.Prefab();
  11369. prefab.json = obj;
  11370. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  11371. callback && callback(img);
  11372. }));
  11373. }
  11374. pos2to3Convert(x, y, d3Pos) {
  11375. x = x + this.sysOffestNum;
  11376. d3Pos.setValue(x, y, 0);
  11377. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  11378. if (success) {
  11379. }
  11380. else {
  11381. console.error("转换出错了。。。。。。。。");
  11382. }
  11383. }
  11384. scale2to3Convert(num) {
  11385. this.scaleV3One.setValue(0, 0, 0);
  11386. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  11387. this.scaleV3Two.setValue(0, num, 0);
  11388. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  11389. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  11390. return outNum;
  11391. }
  11392. pos3to2Convert(d3Pos) {
  11393. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  11394. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  11395. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  11396. d3Pos.x -= this.sysOffestNum;
  11397. }
  11398. scale3to2Convert(num) {
  11399. let scale = this.scale2to3Convert(1);
  11400. let d2Out = num / scale;
  11401. return d2Out;
  11402. }
  11403. getCollider(type, restitution = 0.9, density = 10) {
  11404. let colli;
  11405. if (type == "box")
  11406. colli = new Laya.BoxCollider();
  11407. else
  11408. colli = new Laya.CircleCollider();
  11409. colli.friction = 0;
  11410. colli.restitution = restitution;
  11411. colli.density = density;
  11412. return colli;
  11413. }
  11414. getRigbody() {
  11415. let rigy = new Laya.RigidBody();
  11416. rigy.bullet = true;
  11417. rigy.allowRotation = false;
  11418. rigy.allowSleep = false;
  11419. rigy.gravityScale = 0;
  11420. return rigy;
  11421. }
  11422. getfguiRotation(x, y) {
  11423. this.angleV2.setValue(x, y);
  11424. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11425. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11426. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  11427. angle = -angle;
  11428. }
  11429. return 180 + angle;
  11430. }
  11431. getAngle(x, y) {
  11432. this.angleV2.setValue(x, y);
  11433. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11434. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11435. return angle;
  11436. }
  11437. randomNum(a, b) {
  11438. return a + Math.floor((b - a + 1) * Math.random());
  11439. }
  11440. getRandArrEle(arr) {
  11441. return arr[Math.floor(arr.length * Math.random())];
  11442. }
  11443. getSign(val) {
  11444. return val >= 0 ? 1 : -1;
  11445. }
  11446. botherArr(arr) {
  11447. let times = arr.length + 2;
  11448. let length = arr.length;
  11449. let a;
  11450. let b;
  11451. let temp;
  11452. for (let index = 0; index < times; index++) {
  11453. a = Math.floor(Math.random() * length);
  11454. b = Math.floor(Math.random() * length);
  11455. temp = arr[a];
  11456. arr[a] = arr[b];
  11457. arr[b] = temp;
  11458. }
  11459. }
  11460. getGameIconUrl(id) {
  11461. return "ui://game/" + id;
  11462. }
  11463. getComponentUrl(id) {
  11464. return "ui://game/" + id;
  11465. }
  11466. getAnimation() {
  11467. }
  11468. judgeSkillType(type = SkillType.highSpace) {
  11469. if (this.gameMode == GameMode.classic)
  11470. return;
  11471. let gameMgr = this.gameMgr;
  11472. if (gameMgr.selfTurn) {
  11473. if (gameMgr.selfCurSkill == type) {
  11474. return true;
  11475. }
  11476. }
  11477. else {
  11478. if (gameMgr.aiCurSkill == type) {
  11479. return true;
  11480. }
  11481. }
  11482. }
  11483. ballColliHole(collider) {
  11484. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11485. xGame.common.gameMgr.isFirstInGame = false;
  11486. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11487. }
  11488. collider.owner.mySrc.checkWrongBall();
  11489. }
  11490. getArrMaxEle(arr) {
  11491. let max = -Infinity;
  11492. for (let index = 0; index < arr.length; index++) {
  11493. max = Math.max(arr[index], max);
  11494. }
  11495. return max;
  11496. }
  11497. getArrMinEle(arr) {
  11498. let min = Infinity;
  11499. for (let index = 0; index < arr.length; index++) {
  11500. min = Math.min(arr[index], min);
  11501. }
  11502. return min;
  11503. }
  11504. playRandomMutiBallBigSkillSound() {
  11505. if (Math.random() <= 0.5)
  11506. return;
  11507. let rand = this.randomNum(1, 6);
  11508. let str = "ganfa0" + rand;
  11509. xGame.soundMgr.playSound(str);
  11510. }
  11511. showOneCamera(type) {
  11512. let object = xGame.common.d3World.cameraObj;
  11513. for (const key in object) {
  11514. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11515. object[key].init();
  11516. object[key].owner.active = key == type;
  11517. }
  11518. }
  11519. }
  11520. checkBallOverBorder(x, y) {
  11521. let radius = 17;
  11522. let condition = this._checkBorder(x + radius, y) ||
  11523. this._checkBorder(x - radius, y) ||
  11524. this._checkBorder(x, y + radius) ||
  11525. this._checkBorder(x, y - radius);
  11526. if (condition) {
  11527. return true;
  11528. }
  11529. }
  11530. _checkBorder(x, y) {
  11531. let borderRect = this.d2World.borderRect;
  11532. let xOffest = 20;
  11533. let yOffest = 20;
  11534. if (y <= borderRect.y - yOffest) {
  11535. return true;
  11536. }
  11537. if (y >= borderRect.y + borderRect.height + yOffest) {
  11538. return true;
  11539. }
  11540. if (x <= borderRect.x - xOffest) {
  11541. return true;
  11542. }
  11543. if (x >= borderRect.x + borderRect.width + xOffest) {
  11544. return true;
  11545. }
  11546. }
  11547. initWeight(cfg) {
  11548. let allCfgData = { data: {}, allWeightNum: 0 };
  11549. let weightCfg = allCfgData.data;
  11550. let weight = 0;
  11551. for (const key in cfg) {
  11552. weightCfg[key] = {};
  11553. weightCfg[key].id = cfg[key].id;
  11554. weightCfg[key].minWeight = weight;
  11555. weight += cfg[key].weight;
  11556. weightCfg[key].maxWeight = weight;
  11557. }
  11558. allCfgData.allWeightNum = weight;
  11559. return allCfgData;
  11560. }
  11561. getRandomWeightData(cfg) {
  11562. let weightCfg = cfg.data;
  11563. let allWeightNum = cfg.allWeightNum;
  11564. let rand = Math.floor(Math.random() * allWeightNum);
  11565. for (const key in weightCfg) {
  11566. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11567. return weightCfg[key];
  11568. }
  11569. }
  11570. return weightCfg[1];
  11571. }
  11572. showGirlTalkPop(wordsIndex, node, msgNode) {
  11573. node.visible = true;
  11574. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11575. node.t0.play(Laya.Handler.create(this, () => {
  11576. node.visible = false;
  11577. }));
  11578. }
  11579. stopGirlPop(node) {
  11580. node.t0.stop();
  11581. node.visible = false;
  11582. }
  11583. createHead(loader, url, size = 107) {
  11584. if (Laya.Browser.name == "Browser") {
  11585. loader.url = url;
  11586. return;
  11587. }
  11588. else {
  11589. console.log('zh:url=', url);
  11590. loader.url = url;
  11591. }
  11592. }
  11593. addTestCoin(num) {
  11594. DataMgr.setCoin(num);
  11595. }
  11596. addTestDiamond(num) {
  11597. DataMgr.setDiamond(num);
  11598. }
  11599. addTestSkill() {
  11600. DataMgr.setBigSkill(0, 99);
  11601. DataMgr.setBigSkill(1, 99);
  11602. DataMgr.setBigSkill(2, 99);
  11603. }
  11604. playClassicEmotion(number, x, y) {
  11605. if (this.gameMode == GameMode.bigMove)
  11606. return;
  11607. let randIndex = this.randomNum(0, 2);
  11608. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11609. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11610. if (this.gameMgr.selfTurn) {
  11611. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11612. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11613. }
  11614. else {
  11615. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11616. }
  11617. else {
  11618. if (number == this.gameMgr.blackNum) {
  11619. if (this.gameMgr.selfBallArr.length == 0) {
  11620. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11621. }
  11622. else {
  11623. }
  11624. }
  11625. else {
  11626. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11627. }
  11628. }
  11629. }
  11630. }
  11631. else {
  11632. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11633. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11634. }
  11635. else {
  11636. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11637. }
  11638. else {
  11639. if (number == this.gameMgr.blackNum) {
  11640. if (this.gameMgr.aiBallArr.length == 0) {
  11641. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11642. }
  11643. else {
  11644. }
  11645. }
  11646. else {
  11647. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11648. }
  11649. }
  11650. }
  11651. }
  11652. }
  11653. playHappySound(number) {
  11654. if (this.gameMode != GameMode.classic)
  11655. return;
  11656. if (number == 8)
  11657. return;
  11658. let play = false;
  11659. if (this.gameMgr.selfTurn) {
  11660. if (this.gameMgr.ensureBallType) {
  11661. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11662. play = true;
  11663. }
  11664. }
  11665. else {
  11666. play = true;
  11667. }
  11668. }
  11669. else {
  11670. if (this.gameMgr.ensureBallType) {
  11671. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11672. play = true;
  11673. }
  11674. }
  11675. else {
  11676. play = true;
  11677. }
  11678. }
  11679. if (play)
  11680. xGame.soundMgr.playSound("applause");
  11681. }
  11682. destroyClassicEmotion() {
  11683. if (this.gameMode == GameMode.bigMove)
  11684. return;
  11685. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11686. parent.destroyChildren();
  11687. }
  11688. playAwardSpine(x, y) {
  11689. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11690. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11691. this.awardSpine.play(data, 0, false, parent);
  11692. }
  11693. destroyAwardSpine() {
  11694. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11695. parent.destroyChildren();
  11696. }
  11697. isBlock(bx, by, hx, hy, except = null) {
  11698. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  11699. let balls = xGame.common.d2World.ballArr;
  11700. let outArr = [];
  11701. for (let index = 0; index < balls.length; index++) {
  11702. let obj = balls[index];
  11703. if (obj.number == 0)
  11704. continue;
  11705. if (obj == except)
  11706. continue;
  11707. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  11708. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  11709. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  11710. if (num >= 1)
  11711. num = 1;
  11712. if (num < 0)
  11713. continue;
  11714. let gap = Math.sin(Math.acos(num)) * dis;
  11715. if (gap < this.ballSize) {
  11716. outArr.push({
  11717. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  11718. disHon: Math.cos(Math.acos(num)) * dis,
  11719. disVer: Math.sin(Math.acos(num)) * dis,
  11720. src: balls[index],
  11721. dir: this.tempDir1
  11722. });
  11723. }
  11724. }
  11725. if (outArr.length > 0) {
  11726. outArr.sort((a, b) => { return a.dis - b.dis; });
  11727. return outArr[0];
  11728. }
  11729. }
  11730. AngleBetween(vector1, vector2) {
  11731. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  11732. return rad * (180 / Math.PI);
  11733. }
  11734. getSecretaryScale() {
  11735. if (this.secretary.spineName == "mishu") {
  11736. return 1.28;
  11737. }
  11738. else {
  11739. return 1.024;
  11740. }
  11741. }
  11742. signAwardContainsRod(arr) {
  11743. let temp;
  11744. for (let index = 0; index < arr.length; index++) {
  11745. temp = arr[index].split('-')[0];
  11746. if (parseInt(temp) > 2) {
  11747. return true;
  11748. }
  11749. }
  11750. }
  11751. judgeSameDay() {
  11752. let lastTime = DataMgr.getSignTime();
  11753. let curTime = new Date().getTime();
  11754. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  11755. return true;
  11756. }
  11757. return false;
  11758. }
  11759. getAward(arr, callback) {
  11760. let showTriple = arr[0].type <= 2;
  11761. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  11762. let temp;
  11763. for (let index = 0; index < arr.length; index++) {
  11764. temp = arr[index];
  11765. switch (temp.type) {
  11766. case 1:
  11767. this.playObjFlyAnim(temp.num, temp.type);
  11768. break;
  11769. case 2:
  11770. this.playObjFlyAnim(temp.num, temp.type);
  11771. break;
  11772. case 3:
  11773. case 4:
  11774. case 5:
  11775. case 6:
  11776. DataMgr.setBallRod(temp.type - 2, 1);
  11777. DataMgr.setCurBallRod(temp.type - 2);
  11778. break;
  11779. default:
  11780. break;
  11781. }
  11782. }
  11783. callback && callback(watchVideo);
  11784. });
  11785. }
  11786. getMoneyNode() {
  11787. let moneyNode;
  11788. let sign = xGame.uiMgr.getUI(UISign);
  11789. let draw = xGame.uiMgr.getUI(UIDraw);
  11790. let end = xGame.uiMgr.getUI(UIGameEnd);
  11791. let skill = xGame.uiMgr.getUI(UISkill);
  11792. if (sign && !sign.isHide)
  11793. moneyNode = sign.ui.moneyNode;
  11794. if (draw && !draw.isHide)
  11795. moneyNode = draw.ui.moneyNode;
  11796. if (end && !end.isHide)
  11797. moneyNode = end.ui.moneyNode;
  11798. if (skill && !skill.isHide)
  11799. moneyNode = skill.ui.moneyNode;
  11800. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11801. let main = xGame.uiMgr.getUI(UIMain);
  11802. if (condition1 && main && !main.isHide) {
  11803. moneyNode = main.ui.moneyNode;
  11804. }
  11805. return moneyNode;
  11806. }
  11807. playObjFlyAnim(num, type, callback = null) {
  11808. this.stPos.x = Laya.stage.width / 2;
  11809. this.stPos.y = Laya.stage.height / 2;
  11810. let moneyNode = this.getMoneyNode();
  11811. switch (type) {
  11812. case Prop.diamond:
  11813. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11814. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11815. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11816. this.edPos.x /= 2;
  11817. this.edPos.y /= 2;
  11818. break;
  11819. case Prop.coin:
  11820. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11821. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11822. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11823. this.edPos.x /= 2;
  11824. this.edPos.y /= 2;
  11825. break;
  11826. default:
  11827. break;
  11828. }
  11829. xGame.soundMgr.playSound("coinbag");
  11830. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11831. switch (type) {
  11832. case Prop.diamond:
  11833. DataMgr.setDiamond(num);
  11834. break;
  11835. case Prop.coin:
  11836. DataMgr.setCoin(num);
  11837. break;
  11838. default:
  11839. break;
  11840. }
  11841. callback && callback();
  11842. });
  11843. }
  11844. autoPopUIView() {
  11845. let arr = [];
  11846. let sign = this.judgeSameDay() ? false : true;
  11847. if (sign)
  11848. arr.push("sign");
  11849. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11850. if (draw)
  11851. arr.push("draw");
  11852. if (arr.length <= 0)
  11853. return;
  11854. let str = this.getRandArrEle(arr);
  11855. switch (str) {
  11856. case "sign":
  11857. xGame.uiMgr.Show(UISign);
  11858. break;
  11859. case "draw":
  11860. xGame.uiMgr.Show(UIDraw);
  11861. break;
  11862. default:
  11863. break;
  11864. }
  11865. }
  11866. getMSTime(time) {
  11867. let min = Math.floor(time / 60);
  11868. let sec = Math.floor((time - min * 60));
  11869. if (sec < 10)
  11870. sec = "0" + sec;
  11871. if (min < 10)
  11872. min = "0" + min;
  11873. return `${min}:${sec}`;
  11874. }
  11875. testPower() {
  11876. DataMgr.setPower(0, false);
  11877. }
  11878. getAllStarNum() {
  11879. let data = DataMgr.getPlaceBallLevelList();
  11880. let out = 0;
  11881. for (let index = 0; index < data.length; index++) {
  11882. out += data[index].star;
  11883. }
  11884. return out;
  11885. }
  11886. recoverCameraView() {
  11887. Laya.timer.once(900, this, () => {
  11888. xGame.common.showOneCamera("mainCamera");
  11889. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11890. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11891. xGame.common.gameUI.ui.border.alpha = 0;
  11892. if (Laya.physicsTimer.scale < 1) {
  11893. Laya.physicsTimer.scale = 1;
  11894. }
  11895. }
  11896. });
  11897. }
  11898. getClassicLevel() {
  11899. let successTimes = DataMgr.getClassicTimes();
  11900. let needKey = "";
  11901. let lastKey = "";
  11902. let cfg = cfgTable.classictimesData;
  11903. let data;
  11904. for (const key in cfg) {
  11905. data = cfg[key];
  11906. if (successTimes <= data.times) {
  11907. needKey = key;
  11908. }
  11909. lastKey = key;
  11910. }
  11911. if (needKey == "")
  11912. needKey = lastKey;
  11913. return cfg[needKey];
  11914. }
  11915. }
  11916. Common._instance = null;
  11917. class ui_Component92 extends fgui.GComponent {
  11918. static createInstance() {
  11919. return (fgui.UIPackage.createObject("game", "Component92"));
  11920. }
  11921. onConstruct() {
  11922. this.n0 = (this.getChild("n0"));
  11923. }
  11924. }
  11925. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11926. class ui_Component129 extends fgui.GProgressBar {
  11927. static createInstance() {
  11928. return (fgui.UIPackage.createObject("game", "Component129"));
  11929. }
  11930. onConstruct() {
  11931. this.bar_v = (this.getChild("bar_v"));
  11932. this.n84 = (this.getChild("n84"));
  11933. }
  11934. }
  11935. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11936. class ui_Component130 extends fgui.GComponent {
  11937. static createInstance() {
  11938. return (fgui.UIPackage.createObject("game", "Component130"));
  11939. }
  11940. onConstruct() {
  11941. this.ani = (this.getChild("ani"));
  11942. this.t0 = this.getTransition("t0");
  11943. }
  11944. }
  11945. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11946. class ui_powerEft extends fgui.GComponent {
  11947. static createInstance() {
  11948. return (fgui.UIPackage.createObject("game", "powerEft"));
  11949. }
  11950. onConstruct() {
  11951. this.ani = (this.getChild("ani"));
  11952. this.n88 = (this.getChild("n88"));
  11953. this.n89 = (this.getChild("n89"));
  11954. }
  11955. }
  11956. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11957. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11958. static createInstance() {
  11959. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11960. }
  11961. onConstruct() {
  11962. this.c1 = this.getController("c1");
  11963. this.n2 = (this.getChild("n2"));
  11964. this.n22 = (this.getChild("n22"));
  11965. this.n23 = (this.getChild("n23"));
  11966. this.n15 = (this.getChild("n15"));
  11967. this.challenge = (this.getChild("challenge"));
  11968. this.n17 = (this.getChild("n17"));
  11969. this.n3 = (this.getChild("n3"));
  11970. this.starNode = (this.getChild("starNode"));
  11971. this.levelTxt = (this.getChild("levelTxt"));
  11972. this.n14 = (this.getChild("n14"));
  11973. this.n19 = (this.getChild("n19"));
  11974. this.n20 = (this.getChild("n20"));
  11975. this.n21 = (this.getChild("n21"));
  11976. this.special = (this.getChild("special"));
  11977. }
  11978. }
  11979. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11980. class ui_Component79 extends fgui.GComponent {
  11981. static createInstance() {
  11982. return (fgui.UIPackage.createObject("game", "Component79"));
  11983. }
  11984. onConstruct() {
  11985. this.c1 = this.getController("c1");
  11986. this.n7 = (this.getChild("n7"));
  11987. this.n8 = (this.getChild("n8"));
  11988. this.n9 = (this.getChild("n9"));
  11989. this.n10 = (this.getChild("n10"));
  11990. this.n11 = (this.getChild("n11"));
  11991. this.n12 = (this.getChild("n12"));
  11992. }
  11993. }
  11994. ui_Component79.URL = "ui://isxx5ak7avag477";
  11995. class ui_Component80 extends fgui.GComponent {
  11996. static createInstance() {
  11997. return (fgui.UIPackage.createObject("game", "Component80"));
  11998. }
  11999. onConstruct() {
  12000. this.n0 = (this.getChild("n0"));
  12001. this.n1 = (this.getChild("n1"));
  12002. this.myList = (this.getChild("myList"));
  12003. this.t0 = this.getTransition("t0");
  12004. }
  12005. }
  12006. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12007. class ui_SignNormal extends fgui.GComponent {
  12008. static createInstance() {
  12009. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12010. }
  12011. onConstruct() {
  12012. this.c1 = this.getController("c1");
  12013. this.n7 = (this.getChild("n7"));
  12014. this.n15 = (this.getChild("n15"));
  12015. this.titleTxt = (this.getChild("titleTxt"));
  12016. this.n8 = (this.getChild("n8"));
  12017. this.myIcon = (this.getChild("myIcon"));
  12018. this.numTxt = (this.getChild("numTxt"));
  12019. this.n12 = (this.getChild("n12"));
  12020. this.n13 = (this.getChild("n13"));
  12021. this.n17 = (this.getChild("n17"));
  12022. this.n14 = (this.getChild("n14"));
  12023. }
  12024. }
  12025. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12026. class ui_screenNode extends fgui.GComponent {
  12027. static createInstance() {
  12028. return (fgui.UIPackage.createObject("game", "screenNode"));
  12029. }
  12030. onConstruct() {
  12031. this.n9 = (this.getChild("n9"));
  12032. this.screenImg = (this.getChild("screenImg"));
  12033. }
  12034. }
  12035. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12036. class ui_GetAwrad_com1 extends fgui.GComponent {
  12037. static createInstance() {
  12038. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12039. }
  12040. onConstruct() {
  12041. this.n38 = (this.getChild("n38"));
  12042. this.n39 = (this.getChild("n39"));
  12043. this.n40 = (this.getChild("n40"));
  12044. this.t0 = this.getTransition("t0");
  12045. this.t1 = this.getTransition("t1");
  12046. }
  12047. }
  12048. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12049. class ui_GetAwrad_com2 extends fgui.GComponent {
  12050. static createInstance() {
  12051. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12052. }
  12053. onConstruct() {
  12054. this.n39 = (this.getChild("n39"));
  12055. this.n40 = (this.getChild("n40"));
  12056. this.t0 = this.getTransition("t0");
  12057. }
  12058. }
  12059. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  12060. class ui_Component128 extends fgui.GComponent {
  12061. static createInstance() {
  12062. return (fgui.UIPackage.createObject("game", "Component128"));
  12063. }
  12064. onConstruct() {
  12065. this.n38 = (this.getChild("n38"));
  12066. this.n40 = (this.getChild("n40"));
  12067. }
  12068. }
  12069. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  12070. class ui_Component100_1 extends fgui.GComponent {
  12071. static createInstance() {
  12072. return (fgui.UIPackage.createObject("game", "Component100_1"));
  12073. }
  12074. onConstruct() {
  12075. this.myNode = (this.getChild("myNode"));
  12076. this.t0 = this.getTransition("t0");
  12077. }
  12078. }
  12079. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  12080. class ui_Component142 extends fgui.GComponent {
  12081. static createInstance() {
  12082. return (fgui.UIPackage.createObject("game", "Component142"));
  12083. }
  12084. onConstruct() {
  12085. this.n41 = (this.getChild("n41"));
  12086. this.n42 = (this.getChild("n42"));
  12087. }
  12088. }
  12089. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  12090. class ui_main_guang extends fgui.GComponent {
  12091. static createInstance() {
  12092. return (fgui.UIPackage.createObject("game", "main_guang"));
  12093. }
  12094. onConstruct() {
  12095. this.n1 = (this.getChild("n1"));
  12096. this.n2 = (this.getChild("n2"));
  12097. this.n3 = (this.getChild("n3"));
  12098. this.n4 = (this.getChild("n4"));
  12099. this.n5 = (this.getChild("n5"));
  12100. this.n6 = (this.getChild("n6"));
  12101. this.n8 = (this.getChild("n8"));
  12102. this.t0 = this.getTransition("t0");
  12103. }
  12104. }
  12105. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  12106. class ui_try_com1 extends fgui.GComponent {
  12107. static createInstance() {
  12108. return (fgui.UIPackage.createObject("game", "try_com1"));
  12109. }
  12110. onConstruct() {
  12111. this.c1 = this.getController("c1");
  12112. this.n0 = (this.getChild("n0"));
  12113. this.n2 = (this.getChild("n2"));
  12114. this.cancelBtn = (this.getChild("cancelBtn"));
  12115. this.videoBtn = (this.getChild("videoBtn"));
  12116. this.n9 = (this.getChild("n9"));
  12117. this.n24 = (this.getChild("n24"));
  12118. this.titleTxt = (this.getChild("titleTxt"));
  12119. this.n32 = (this.getChild("n32"));
  12120. this.n29 = (this.getChild("n29"));
  12121. this.n36 = (this.getChild("n36"));
  12122. this.txtTime = (this.getChild("txtTime"));
  12123. this.t0 = this.getTransition("t0");
  12124. }
  12125. }
  12126. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  12127. class ui_try_com2 extends fgui.GComponent {
  12128. static createInstance() {
  12129. return (fgui.UIPackage.createObject("game", "try_com2"));
  12130. }
  12131. onConstruct() {
  12132. this.skillicon = (this.getChild("skillicon"));
  12133. this.n35 = (this.getChild("n35"));
  12134. this.n31 = (this.getChild("n31"));
  12135. this.n32 = (this.getChild("n32"));
  12136. this.n33 = (this.getChild("n33"));
  12137. this.n34 = (this.getChild("n34"));
  12138. }
  12139. }
  12140. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  12141. class ui_try_com3 extends fgui.GComponent {
  12142. static createInstance() {
  12143. return (fgui.UIPackage.createObject("game", "try_com3"));
  12144. }
  12145. onConstruct() {
  12146. this.n33 = (this.getChild("n33"));
  12147. this.n34 = (this.getChild("n34"));
  12148. this.n35 = (this.getChild("n35"));
  12149. this.t0 = this.getTransition("t0");
  12150. }
  12151. }
  12152. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  12153. class ui_huihe1 extends fgui.GComponent {
  12154. static createInstance() {
  12155. return (fgui.UIPackage.createObject("game", "huihe1"));
  12156. }
  12157. onConstruct() {
  12158. this.n0 = (this.getChild("n0"));
  12159. this.n1 = (this.getChild("n1"));
  12160. this.t0 = this.getTransition("t0");
  12161. }
  12162. }
  12163. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  12164. class ui_huihe2 extends fgui.GComponent {
  12165. static createInstance() {
  12166. return (fgui.UIPackage.createObject("game", "huihe2"));
  12167. }
  12168. onConstruct() {
  12169. this.n0 = (this.getChild("n0"));
  12170. this.n1 = (this.getChild("n1"));
  12171. this.t0 = this.getTransition("t0");
  12172. }
  12173. }
  12174. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  12175. class ui_Component143 extends fgui.GComponent {
  12176. static createInstance() {
  12177. return (fgui.UIPackage.createObject("game", "Component143"));
  12178. }
  12179. onConstruct() {
  12180. this.n3 = (this.getChild("n3"));
  12181. this.n4 = (this.getChild("n4"));
  12182. this.n5 = (this.getChild("n5"));
  12183. this.n6 = (this.getChild("n6"));
  12184. this.n7 = (this.getChild("n7"));
  12185. this.n8 = (this.getChild("n8"));
  12186. this.n9 = (this.getChild("n9"));
  12187. this.n10 = (this.getChild("n10"));
  12188. this.t0 = this.getTransition("t0");
  12189. }
  12190. }
  12191. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  12192. class ui_dh_jingbi2 extends fgui.GComponent {
  12193. static createInstance() {
  12194. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  12195. }
  12196. onConstruct() {
  12197. this.n0 = (this.getChild("n0"));
  12198. this.n1 = (this.getChild("n1"));
  12199. this.n2 = (this.getChild("n2"));
  12200. this.n3 = (this.getChild("n3"));
  12201. this.n4 = (this.getChild("n4"));
  12202. this.n5 = (this.getChild("n5"));
  12203. this.n6 = (this.getChild("n6"));
  12204. this.n8 = (this.getChild("n8"));
  12205. this.n10 = (this.getChild("n10"));
  12206. this.t0 = this.getTransition("t0");
  12207. }
  12208. }
  12209. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  12210. class ui_dh_jingbi2_1 extends fgui.GComponent {
  12211. static createInstance() {
  12212. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  12213. }
  12214. onConstruct() {
  12215. this.n1 = (this.getChild("n1"));
  12216. this.n4 = (this.getChild("n4"));
  12217. this.t0 = this.getTransition("t0");
  12218. }
  12219. }
  12220. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  12221. class ui_dh_jingbi3 extends fgui.GComponent {
  12222. static createInstance() {
  12223. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  12224. }
  12225. onConstruct() {
  12226. this.n0 = (this.getChild("n0"));
  12227. this.n1 = (this.getChild("n1"));
  12228. this.n2 = (this.getChild("n2"));
  12229. this.n3 = (this.getChild("n3"));
  12230. this.n4 = (this.getChild("n4"));
  12231. this.n5 = (this.getChild("n5"));
  12232. this.n6 = (this.getChild("n6"));
  12233. this.n8 = (this.getChild("n8"));
  12234. this.n10 = (this.getChild("n10"));
  12235. this.t0 = this.getTransition("t0");
  12236. }
  12237. }
  12238. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  12239. class ui_dh_jingbi3_1 extends fgui.GComponent {
  12240. static createInstance() {
  12241. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  12242. }
  12243. onConstruct() {
  12244. this.n3 = (this.getChild("n3"));
  12245. this.n1 = (this.getChild("n1"));
  12246. this.t0 = this.getTransition("t0");
  12247. }
  12248. }
  12249. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  12250. class ui_hb_jinbi1 extends fgui.GButton {
  12251. static createInstance() {
  12252. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  12253. }
  12254. onConstruct() {
  12255. this.n20 = (this.getChild("n20"));
  12256. this.n25 = (this.getChild("n25"));
  12257. this.coinTxt = (this.getChild("coinTxt"));
  12258. this.n28 = (this.getChild("n28"));
  12259. this.n32 = (this.getChild("n32"));
  12260. this.n38 = (this.getChild("n38"));
  12261. this.n45 = (this.getChild("n45"));
  12262. this.getTips = (this.getChild("getTips"));
  12263. this.n39 = (this.getChild("n39"));
  12264. this.diamondTxt = (this.getChild("diamondTxt"));
  12265. this.n41 = (this.getChild("n41"));
  12266. this.n42 = (this.getChild("n42"));
  12267. this.n46 = (this.getChild("n46"));
  12268. this.n47 = (this.getChild("n47"));
  12269. this.n48 = (this.getChild("n48"));
  12270. this.t0 = this.getTransition("t0");
  12271. }
  12272. }
  12273. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  12274. class ui_hb_jinbi2 extends fgui.GButton {
  12275. static createInstance() {
  12276. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  12277. }
  12278. onConstruct() {
  12279. this.n20 = (this.getChild("n20"));
  12280. this.n25 = (this.getChild("n25"));
  12281. this.coinTxt = (this.getChild("coinTxt"));
  12282. this.n28 = (this.getChild("n28"));
  12283. this.n32 = (this.getChild("n32"));
  12284. this.n38 = (this.getChild("n38"));
  12285. this.n39 = (this.getChild("n39"));
  12286. this.diamondTxt = (this.getChild("diamondTxt"));
  12287. this.n41 = (this.getChild("n41"));
  12288. this.n42 = (this.getChild("n42"));
  12289. this.n43 = (this.getChild("n43"));
  12290. this.n44 = (this.getChild("n44"));
  12291. this.n45 = (this.getChild("n45"));
  12292. this.t0 = this.getTransition("t0");
  12293. }
  12294. }
  12295. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  12296. class ui_hb_jinbi3 extends fgui.GButton {
  12297. static createInstance() {
  12298. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  12299. }
  12300. onConstruct() {
  12301. this.n20 = (this.getChild("n20"));
  12302. this.n25 = (this.getChild("n25"));
  12303. this.coinTxt = (this.getChild("coinTxt"));
  12304. this.n28 = (this.getChild("n28"));
  12305. this.n32 = (this.getChild("n32"));
  12306. this.n38 = (this.getChild("n38"));
  12307. this.n39 = (this.getChild("n39"));
  12308. this.diamondTxt = (this.getChild("diamondTxt"));
  12309. this.n41 = (this.getChild("n41"));
  12310. this.n42 = (this.getChild("n42"));
  12311. this.n43 = (this.getChild("n43"));
  12312. this.n44 = (this.getChild("n44"));
  12313. this.n45 = (this.getChild("n45"));
  12314. this.t0 = this.getTransition("t0");
  12315. }
  12316. }
  12317. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  12318. class ui_Component104 extends fgui.GComponent {
  12319. static createInstance() {
  12320. return (fgui.UIPackage.createObject("game", "Component104"));
  12321. }
  12322. onConstruct() {
  12323. this.c1 = this.getController("c1");
  12324. this.n12 = (this.getChild("n12"));
  12325. this.coinBtn = (this.getChild("coinBtn"));
  12326. this.diamondBtn = (this.getChild("diamondBtn"));
  12327. this.node3 = (this.getChild("node3"));
  12328. this.node4 = (this.getChild("node4"));
  12329. this.node5 = (this.getChild("node5"));
  12330. this.node1 = (this.getChild("node1"));
  12331. this.node2 = (this.getChild("node2"));
  12332. this.node6 = (this.getChild("node6"));
  12333. this.t0 = this.getTransition("t0");
  12334. }
  12335. }
  12336. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  12337. class ui_Component105 extends fgui.GButton {
  12338. static createInstance() {
  12339. return (fgui.UIPackage.createObject("game", "Component105"));
  12340. }
  12341. onConstruct() {
  12342. this.c1 = this.getController("c1");
  12343. this.n49 = (this.getChild("n49"));
  12344. this.n18 = (this.getChild("n18"));
  12345. this.n46 = (this.getChild("n46"));
  12346. this.n48 = (this.getChild("n48"));
  12347. }
  12348. }
  12349. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  12350. class ui_Component106 extends fgui.GButton {
  12351. static createInstance() {
  12352. return (fgui.UIPackage.createObject("game", "Component106"));
  12353. }
  12354. onConstruct() {
  12355. this.c1 = this.getController("c1");
  12356. this.n49 = (this.getChild("n49"));
  12357. this.n18 = (this.getChild("n18"));
  12358. this.n46 = (this.getChild("n46"));
  12359. this.n48 = (this.getChild("n48"));
  12360. }
  12361. }
  12362. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  12363. class ui_hb_zs1 extends fgui.GButton {
  12364. static createInstance() {
  12365. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  12366. }
  12367. onConstruct() {
  12368. this.c1 = this.getController("c1");
  12369. this.n20 = (this.getChild("n20"));
  12370. this.n21 = (this.getChild("n21"));
  12371. this.n26 = (this.getChild("n26"));
  12372. this.n27 = (this.getChild("n27"));
  12373. this.shareTxt = (this.getChild("shareTxt"));
  12374. this.n32 = (this.getChild("n32"));
  12375. this.n38 = (this.getChild("n38"));
  12376. this.n39 = (this.getChild("n39"));
  12377. this.n44 = (this.getChild("n44"));
  12378. this.diamondTxt = (this.getChild("diamondTxt"));
  12379. this.n41 = (this.getChild("n41"));
  12380. this.n45 = (this.getChild("n45"));
  12381. this.n47 = (this.getChild("n47"));
  12382. this.n48 = (this.getChild("n48"));
  12383. this.randTxt = (this.getChild("randTxt"));
  12384. this.n50 = (this.getChild("n50"));
  12385. this.t0 = this.getTransition("t0");
  12386. }
  12387. }
  12388. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  12389. class ui_dh_zs1 extends fgui.GComponent {
  12390. static createInstance() {
  12391. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  12392. }
  12393. onConstruct() {
  12394. this.n10 = (this.getChild("n10"));
  12395. this.n9 = (this.getChild("n9"));
  12396. this.n1 = (this.getChild("n1"));
  12397. this.n2 = (this.getChild("n2"));
  12398. this.n3 = (this.getChild("n3"));
  12399. this.n4 = (this.getChild("n4"));
  12400. this.n5 = (this.getChild("n5"));
  12401. this.n6 = (this.getChild("n6"));
  12402. this.n8 = (this.getChild("n8"));
  12403. this.n11 = (this.getChild("n11"));
  12404. this.t0 = this.getTransition("t0");
  12405. }
  12406. }
  12407. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  12408. class ui_dh_zs1_1 extends fgui.GComponent {
  12409. static createInstance() {
  12410. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  12411. }
  12412. onConstruct() {
  12413. this.n3 = (this.getChild("n3"));
  12414. this.n1 = (this.getChild("n1"));
  12415. this.t0 = this.getTransition("t0");
  12416. }
  12417. }
  12418. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  12419. class ui_hb_zs2 extends fgui.GButton {
  12420. static createInstance() {
  12421. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  12422. }
  12423. onConstruct() {
  12424. this.n20 = (this.getChild("n20"));
  12425. this.n21 = (this.getChild("n21"));
  12426. this.n26 = (this.getChild("n26"));
  12427. this.n27 = (this.getChild("n27"));
  12428. this.n32 = (this.getChild("n32"));
  12429. this.n38 = (this.getChild("n38"));
  12430. this.n39 = (this.getChild("n39"));
  12431. this.n44 = (this.getChild("n44"));
  12432. this.diamondTxt = (this.getChild("diamondTxt"));
  12433. this.n41 = (this.getChild("n41"));
  12434. this.n45 = (this.getChild("n45"));
  12435. this.t0 = this.getTransition("t0");
  12436. }
  12437. }
  12438. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  12439. class ui_hb_zs3 extends fgui.GButton {
  12440. static createInstance() {
  12441. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  12442. }
  12443. onConstruct() {
  12444. this.n20 = (this.getChild("n20"));
  12445. this.n21 = (this.getChild("n21"));
  12446. this.n26 = (this.getChild("n26"));
  12447. this.n27 = (this.getChild("n27"));
  12448. this.n32 = (this.getChild("n32"));
  12449. this.n38 = (this.getChild("n38"));
  12450. this.n47 = (this.getChild("n47"));
  12451. this.t0 = this.getTransition("t0");
  12452. }
  12453. }
  12454. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12455. class ui_dh_zs2 extends fgui.GComponent {
  12456. static createInstance() {
  12457. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12458. }
  12459. onConstruct() {
  12460. this.n10 = (this.getChild("n10"));
  12461. this.n9 = (this.getChild("n9"));
  12462. this.n1 = (this.getChild("n1"));
  12463. this.n2 = (this.getChild("n2"));
  12464. this.n3 = (this.getChild("n3"));
  12465. this.n4 = (this.getChild("n4"));
  12466. this.n5 = (this.getChild("n5"));
  12467. this.n6 = (this.getChild("n6"));
  12468. this.n8 = (this.getChild("n8"));
  12469. this.n11 = (this.getChild("n11"));
  12470. this.t0 = this.getTransition("t0");
  12471. }
  12472. }
  12473. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12474. class ui_dh_zs2_1 extends fgui.GComponent {
  12475. static createInstance() {
  12476. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12477. }
  12478. onConstruct() {
  12479. this.n3 = (this.getChild("n3"));
  12480. this.n1 = (this.getChild("n1"));
  12481. this.t0 = this.getTransition("t0");
  12482. }
  12483. }
  12484. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12485. class ui_dh_zs3 extends fgui.GComponent {
  12486. static createInstance() {
  12487. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12488. }
  12489. onConstruct() {
  12490. this.n10 = (this.getChild("n10"));
  12491. this.n9 = (this.getChild("n9"));
  12492. this.n1 = (this.getChild("n1"));
  12493. this.n2 = (this.getChild("n2"));
  12494. this.n3 = (this.getChild("n3"));
  12495. this.n4 = (this.getChild("n4"));
  12496. this.n5 = (this.getChild("n5"));
  12497. this.n6 = (this.getChild("n6"));
  12498. this.n8 = (this.getChild("n8"));
  12499. this.n11 = (this.getChild("n11"));
  12500. this.t0 = this.getTransition("t0");
  12501. }
  12502. }
  12503. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12504. class ui_dh_zs3_1 extends fgui.GComponent {
  12505. static createInstance() {
  12506. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12507. }
  12508. onConstruct() {
  12509. this.n3 = (this.getChild("n3"));
  12510. this.n1 = (this.getChild("n1"));
  12511. this.t0 = this.getTransition("t0");
  12512. }
  12513. }
  12514. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12515. class ui_Component107 extends fgui.GComponent {
  12516. static createInstance() {
  12517. return (fgui.UIPackage.createObject("game", "Component107"));
  12518. }
  12519. onConstruct() {
  12520. this.n18 = (this.getChild("n18"));
  12521. this.n19 = (this.getChild("n19"));
  12522. this.n20 = (this.getChild("n20"));
  12523. this.n21 = (this.getChild("n21"));
  12524. this.n22 = (this.getChild("n22"));
  12525. this.levelTxt = (this.getChild("levelTxt"));
  12526. this.t0 = this.getTransition("t0");
  12527. }
  12528. }
  12529. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12530. class ui_box_com1 extends fgui.GComponent {
  12531. static createInstance() {
  12532. return (fgui.UIPackage.createObject("game", "box_com1"));
  12533. }
  12534. onConstruct() {
  12535. this.n14 = (this.getChild("n14"));
  12536. this.n6 = (this.getChild("n6"));
  12537. this.t0 = this.getTransition("t0");
  12538. }
  12539. }
  12540. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12541. class ui_box_com2 extends fgui.GProgressBar {
  12542. static createInstance() {
  12543. return (fgui.UIPackage.createObject("game", "box_com2"));
  12544. }
  12545. onConstruct() {
  12546. this.bg0 = (this.getChild("bg0"));
  12547. this.bg = (this.getChild("bg"));
  12548. this.bar = (this.getChild("bar"));
  12549. this.n7 = (this.getChild("n7"));
  12550. this.n8 = (this.getChild("n8"));
  12551. this.n10 = (this.getChild("n10"));
  12552. this.n11 = (this.getChild("n11"));
  12553. this.n12 = (this.getChild("n12"));
  12554. }
  12555. }
  12556. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12557. class ui_box_com4 extends fgui.GComponent {
  12558. static createInstance() {
  12559. return (fgui.UIPackage.createObject("game", "box_com4"));
  12560. }
  12561. onConstruct() {
  12562. this.n8 = (this.getChild("n8"));
  12563. this.t0 = this.getTransition("t0");
  12564. }
  12565. }
  12566. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12567. class ui_box_com3 extends fgui.GComponent {
  12568. static createInstance() {
  12569. return (fgui.UIPackage.createObject("game", "box_com3"));
  12570. }
  12571. onConstruct() {
  12572. this.n2 = (this.getChild("n2"));
  12573. this.n3 = (this.getChild("n3"));
  12574. this.n4 = (this.getChild("n4"));
  12575. this.n5 = (this.getChild("n5"));
  12576. this.t0 = this.getTransition("t0");
  12577. this.t1 = this.getTransition("t1");
  12578. }
  12579. }
  12580. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12581. class ui_Component97 extends fgui.GComponent {
  12582. static createInstance() {
  12583. return (fgui.UIPackage.createObject("game", "Component97"));
  12584. }
  12585. onConstruct() {
  12586. this.c1 = this.getController("c1");
  12587. this.n46 = (this.getChild("n46"));
  12588. this.diamondNode = (this.getChild("diamondNode"));
  12589. this.coinNode = (this.getChild("coinNode"));
  12590. this.t0 = this.getTransition("t0");
  12591. }
  12592. }
  12593. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12594. class ui_Component98 extends fgui.GButton {
  12595. static createInstance() {
  12596. return (fgui.UIPackage.createObject("game", "Component98"));
  12597. }
  12598. onConstruct() {
  12599. this.n8 = (this.getChild("n8"));
  12600. this.n40 = (this.getChild("n40"));
  12601. }
  12602. }
  12603. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12604. class ui_Component28_11 extends fgui.GButton {
  12605. static createInstance() {
  12606. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12607. }
  12608. onConstruct() {
  12609. this.c1 = this.getController("c1");
  12610. this.n12 = (this.getChild("n12"));
  12611. this.n17 = (this.getChild("n17"));
  12612. this.n13 = (this.getChild("n13"));
  12613. this.diamondTxt = (this.getChild("diamondTxt"));
  12614. this.n15 = (this.getChild("n15"));
  12615. this.n16 = (this.getChild("n16"));
  12616. }
  12617. }
  12618. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12619. class ui_Component58_11 extends fgui.GComponent {
  12620. static createInstance() {
  12621. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12622. }
  12623. onConstruct() {
  12624. this.n23 = (this.getChild("n23"));
  12625. this.n41 = (this.getChild("n41"));
  12626. this.myList = (this.getChild("myList"));
  12627. this.n45 = (this.getChild("n45"));
  12628. this.n44 = (this.getChild("n44"));
  12629. this.t0 = this.getTransition("t0");
  12630. }
  12631. }
  12632. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12633. class ui_Component100 extends fgui.GComponent {
  12634. static createInstance() {
  12635. return (fgui.UIPackage.createObject("game", "Component100"));
  12636. }
  12637. onConstruct() {
  12638. this.c1 = this.getController("c1");
  12639. this.n75 = (this.getChild("n75"));
  12640. this.n76 = (this.getChild("n76"));
  12641. this.n80 = (this.getChild("n80"));
  12642. this.txt = (this.getChild("txt"));
  12643. this.spineRoot = (this.getChild("spineRoot"));
  12644. }
  12645. }
  12646. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12647. class ui_Component101 extends fgui.GComponent {
  12648. static createInstance() {
  12649. return (fgui.UIPackage.createObject("game", "Component101"));
  12650. }
  12651. onConstruct() {
  12652. this.c1 = this.getController("c1");
  12653. this.n36 = (this.getChild("n36"));
  12654. this.n35 = (this.getChild("n35"));
  12655. this.n33 = (this.getChild("n33"));
  12656. this.n34 = (this.getChild("n34"));
  12657. }
  12658. }
  12659. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12660. class ui_Component53 extends fgui.GComponent {
  12661. static createInstance() {
  12662. return (fgui.UIPackage.createObject("game", "Component53"));
  12663. }
  12664. onConstruct() {
  12665. this.n0 = (this.getChild("n0"));
  12666. this.n1 = (this.getChild("n1"));
  12667. this.n2 = (this.getChild("n2"));
  12668. this.n3 = (this.getChild("n3"));
  12669. this.n4 = (this.getChild("n4"));
  12670. this.n5 = (this.getChild("n5"));
  12671. this.n6 = (this.getChild("n6"));
  12672. this.n7 = (this.getChild("n7"));
  12673. this.n8 = (this.getChild("n8"));
  12674. this.n9 = (this.getChild("n9"));
  12675. this.n10 = (this.getChild("n10"));
  12676. this.n11 = (this.getChild("n11"));
  12677. this.n12 = (this.getChild("n12"));
  12678. this.n13 = (this.getChild("n13"));
  12679. this.n14 = (this.getChild("n14"));
  12680. this.n15 = (this.getChild("n15"));
  12681. this.n16 = (this.getChild("n16"));
  12682. this.n19 = (this.getChild("n19"));
  12683. this.n20 = (this.getChild("n20"));
  12684. this.n21 = (this.getChild("n21"));
  12685. this.n22 = (this.getChild("n22"));
  12686. this.n23 = (this.getChild("n23"));
  12687. this.n24 = (this.getChild("n24"));
  12688. this.n25 = (this.getChild("n25"));
  12689. this.n26 = (this.getChild("n26"));
  12690. this.n27 = (this.getChild("n27"));
  12691. this.n28 = (this.getChild("n28"));
  12692. this.n29 = (this.getChild("n29"));
  12693. this.n30 = (this.getChild("n30"));
  12694. this.n31 = (this.getChild("n31"));
  12695. this.n32 = (this.getChild("n32"));
  12696. this.n33 = (this.getChild("n33"));
  12697. this.n34 = (this.getChild("n34"));
  12698. this.n35 = (this.getChild("n35"));
  12699. this.t0 = this.getTransition("t0");
  12700. }
  12701. }
  12702. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12703. class ui_Component58 extends fgui.GComponent {
  12704. static createInstance() {
  12705. return (fgui.UIPackage.createObject("game", "Component58"));
  12706. }
  12707. onConstruct() {
  12708. this.n23 = (this.getChild("n23"));
  12709. this.n41 = (this.getChild("n41"));
  12710. this.n8 = (this.getChild("n8"));
  12711. this.skillList = (this.getChild("skillList"));
  12712. this.t0 = this.getTransition("t0");
  12713. }
  12714. }
  12715. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12716. class ui_Component59 extends fgui.GComponent {
  12717. static createInstance() {
  12718. return (fgui.UIPackage.createObject("game", "Component59"));
  12719. }
  12720. onConstruct() {
  12721. this.n3 = (this.getChild("n3"));
  12722. this.msgTxt = (this.getChild("msgTxt"));
  12723. this.t0 = this.getTransition("t0");
  12724. }
  12725. }
  12726. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12727. class ui_RulerNode extends fgui.GComponent {
  12728. static createInstance() {
  12729. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12730. }
  12731. onConstruct() {
  12732. this.n6 = (this.getChild("n6"));
  12733. this.n4 = (this.getChild("n4"));
  12734. this.img1 = (this.getChild("img1"));
  12735. this.img2 = (this.getChild("img2"));
  12736. }
  12737. }
  12738. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12739. class ui_Component108 extends fgui.GComponent {
  12740. static createInstance() {
  12741. return (fgui.UIPackage.createObject("game", "Component108"));
  12742. }
  12743. onConstruct() {
  12744. this.n19 = (this.getChild("n19"));
  12745. this.t0 = this.getTransition("t0");
  12746. }
  12747. }
  12748. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12749. class ui_Component63 extends fgui.GComponent {
  12750. static createInstance() {
  12751. return (fgui.UIPackage.createObject("game", "Component63"));
  12752. }
  12753. onConstruct() {
  12754. this.n66 = (this.getChild("n66"));
  12755. this.n56 = (this.getChild("n56"));
  12756. this.n63 = (this.getChild("n63"));
  12757. this.n65 = (this.getChild("n65"));
  12758. this.t0 = this.getTransition("t0");
  12759. }
  12760. }
  12761. ui_Component63.URL = "ui://isxx5ak7h657452";
  12762. class ui_topNode extends fgui.GComponent {
  12763. static createInstance() {
  12764. return (fgui.UIPackage.createObject("game", "topNode"));
  12765. }
  12766. onConstruct() {
  12767. this.selfProgress = (this.getChild("selfProgress"));
  12768. this.aiProgress = (this.getChild("aiProgress"));
  12769. this.selfKuang = (this.getChild("selfKuang"));
  12770. this.aiKuang = (this.getChild("aiKuang"));
  12771. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12772. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12773. this.n33 = (this.getChild("n33"));
  12774. this.n34 = (this.getChild("n34"));
  12775. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12776. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12777. this.selfBallList = (this.getChild("selfBallList"));
  12778. this.aiBallList = (this.getChild("aiBallList"));
  12779. this.middleNode = (this.getChild("middleNode"));
  12780. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12781. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12782. this.scoreNode = (this.getChild("scoreNode"));
  12783. this.selfTips = (this.getChild("selfTips"));
  12784. this.aiTips = (this.getChild("aiTips"));
  12785. }
  12786. }
  12787. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12788. class ui_selfProgress extends fgui.GProgressBar {
  12789. static createInstance() {
  12790. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12791. }
  12792. onConstruct() {
  12793. this.n3 = (this.getChild("n3"));
  12794. this.bar = (this.getChild("bar"));
  12795. }
  12796. }
  12797. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12798. class ui_aiProgress extends fgui.GProgressBar {
  12799. static createInstance() {
  12800. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12801. }
  12802. onConstruct() {
  12803. this.n3 = (this.getChild("n3"));
  12804. this.bar = (this.getChild("bar"));
  12805. }
  12806. }
  12807. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12808. class ui_ballDisplay extends fgui.GComponent {
  12809. static createInstance() {
  12810. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12811. }
  12812. onConstruct() {
  12813. this.myImg = (this.getChild("myImg"));
  12814. }
  12815. }
  12816. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12817. class ui_moveNode extends fgui.GComponent {
  12818. static createInstance() {
  12819. return (fgui.UIPackage.createObject("game", "moveNode"));
  12820. }
  12821. onConstruct() {
  12822. this.n8 = (this.getChild("n8"));
  12823. this.finger = (this.getChild("finger"));
  12824. }
  12825. }
  12826. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12827. class ui_cancelBtn extends fgui.GButton {
  12828. static createInstance() {
  12829. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12830. }
  12831. onConstruct() {
  12832. this.c1 = this.getController("c1");
  12833. this.n0 = (this.getChild("n0"));
  12834. this.n1 = (this.getChild("n1"));
  12835. }
  12836. }
  12837. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12838. class ui_shareBtn extends fgui.GButton {
  12839. static createInstance() {
  12840. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12841. }
  12842. onConstruct() {
  12843. this.c1 = this.getController("c1");
  12844. this.n2 = (this.getChild("n2"));
  12845. this.n1 = (this.getChild("n1"));
  12846. this.n3 = (this.getChild("n3"));
  12847. this.n4 = (this.getChild("n4"));
  12848. this.n5 = (this.getChild("n5"));
  12849. this.n6 = (this.getChild("n6"));
  12850. }
  12851. }
  12852. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12853. class ui_share2Btn extends fgui.GButton {
  12854. static createInstance() {
  12855. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12856. }
  12857. onConstruct() {
  12858. this.n3 = (this.getChild("n3"));
  12859. }
  12860. }
  12861. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12862. class ui_rodMethodNode extends fgui.GComponent {
  12863. static createInstance() {
  12864. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12865. }
  12866. onConstruct() {
  12867. this.bg = (this.getChild("bg"));
  12868. this.dot = (this.getChild("dot"));
  12869. }
  12870. }
  12871. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12872. class ui_sureBtn extends fgui.GButton {
  12873. static createInstance() {
  12874. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12875. }
  12876. onConstruct() {
  12877. this.n2 = (this.getChild("n2"));
  12878. this.n1 = (this.getChild("n1"));
  12879. }
  12880. }
  12881. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12882. class ui_Component18 extends fgui.GComponent {
  12883. static createInstance() {
  12884. return (fgui.UIPackage.createObject("game", "Component18"));
  12885. }
  12886. onConstruct() {
  12887. this.c1 = this.getController("c1");
  12888. this.nameTxt = (this.getChild("nameTxt"));
  12889. this.headImg = (this.getChild("headImg"));
  12890. this.n24 = (this.getChild("n24"));
  12891. this.skillImg = (this.getChild("skillImg"));
  12892. this.skillTxt = (this.getChild("skillTxt"));
  12893. }
  12894. }
  12895. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12896. class ui_Component45 extends fgui.GComponent {
  12897. static createInstance() {
  12898. return (fgui.UIPackage.createObject("game", "Component45"));
  12899. }
  12900. onConstruct() {
  12901. this.c1 = this.getController("c1");
  12902. this.n40 = (this.getChild("n40"));
  12903. this.n41 = (this.getChild("n41"));
  12904. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12905. this.n42 = (this.getChild("n42"));
  12906. this.awardTxt = (this.getChild("awardTxt"));
  12907. this.n44 = (this.getChild("n44"));
  12908. this.t0 = this.getTransition("t0");
  12909. }
  12910. }
  12911. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12912. class ui_emotionDisplay extends fgui.GButton {
  12913. static createInstance() {
  12914. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12915. }
  12916. onConstruct() {
  12917. this.myIcon = (this.getChild("myIcon"));
  12918. }
  12919. }
  12920. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12921. class ui_Component49 extends fgui.GButton {
  12922. static createInstance() {
  12923. return (fgui.UIPackage.createObject("game", "Component49"));
  12924. }
  12925. onConstruct() {
  12926. this.n69 = (this.getChild("n69"));
  12927. this.n56 = (this.getChild("n56"));
  12928. }
  12929. }
  12930. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12931. class ui_Component50 extends fgui.GButton {
  12932. static createInstance() {
  12933. return (fgui.UIPackage.createObject("game", "Component50"));
  12934. }
  12935. onConstruct() {
  12936. this.n54 = (this.getChild("n54"));
  12937. this.n65 = (this.getChild("n65"));
  12938. }
  12939. }
  12940. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12941. class ui_Component51 extends fgui.GButton {
  12942. static createInstance() {
  12943. return (fgui.UIPackage.createObject("game", "Component51"));
  12944. }
  12945. onConstruct() {
  12946. this.c1 = this.getController("c1");
  12947. this.n51 = (this.getChild("n51"));
  12948. this.n54 = (this.getChild("n54"));
  12949. }
  12950. }
  12951. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12952. class ui_Button5 extends fgui.GButton {
  12953. static createInstance() {
  12954. return (fgui.UIPackage.createObject("game", "Button5"));
  12955. }
  12956. onConstruct() {
  12957. this.c1 = this.getController("c1");
  12958. this.n0 = (this.getChild("n0"));
  12959. this.n2 = (this.getChild("n2"));
  12960. }
  12961. }
  12962. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12963. class ui_Component124 extends fgui.GComponent {
  12964. static createInstance() {
  12965. return (fgui.UIPackage.createObject("game", "Component124"));
  12966. }
  12967. onConstruct() {
  12968. this.n22 = (this.getChild("n22"));
  12969. this.shareNode = (this.getChild("shareNode"));
  12970. }
  12971. }
  12972. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12973. class ui_Component125 extends fgui.GComponent {
  12974. static createInstance() {
  12975. return (fgui.UIPackage.createObject("game", "Component125"));
  12976. }
  12977. onConstruct() {
  12978. this.n29 = (this.getChild("n29"));
  12979. this.coinTxt = (this.getChild("coinTxt"));
  12980. }
  12981. }
  12982. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12983. class ui_Component52 extends fgui.GButton {
  12984. static createInstance() {
  12985. return (fgui.UIPackage.createObject("game", "Component52"));
  12986. }
  12987. onConstruct() {
  12988. this.n35 = (this.getChild("n35"));
  12989. this.n36 = (this.getChild("n36"));
  12990. }
  12991. }
  12992. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12993. class ui_drawBtn extends fgui.GButton {
  12994. static createInstance() {
  12995. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12996. }
  12997. onConstruct() {
  12998. this.c1 = this.getController("c1");
  12999. this.n2 = (this.getChild("n2"));
  13000. this.n1 = (this.getChild("n1"));
  13001. this.n5 = (this.getChild("n5"));
  13002. }
  13003. }
  13004. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13005. class ui_Component43 extends fgui.GButton {
  13006. static createInstance() {
  13007. return (fgui.UIPackage.createObject("game", "Component43"));
  13008. }
  13009. onConstruct() {
  13010. this.n49 = (this.getChild("n49"));
  13011. }
  13012. }
  13013. ui_Component43.URL = "ui://isxx5ak7iveg434";
  13014. class ui_wordsDisplay extends fgui.GComponent {
  13015. static createInstance() {
  13016. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  13017. }
  13018. onConstruct() {
  13019. this.txt = (this.getChild("txt"));
  13020. this.n63 = (this.getChild("n63"));
  13021. }
  13022. }
  13023. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  13024. class ui_Component_phb extends fgui.GComponent {
  13025. static createInstance() {
  13026. return (fgui.UIPackage.createObject("game", "Component_phb"));
  13027. }
  13028. onConstruct() {
  13029. this.n3 = (this.getChild("n3"));
  13030. this.n4 = (this.getChild("n4"));
  13031. }
  13032. }
  13033. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  13034. class ui_Component3 extends fgui.GComponent {
  13035. static createInstance() {
  13036. return (fgui.UIPackage.createObject("game", "Component3"));
  13037. }
  13038. onConstruct() {
  13039. this.n26 = (this.getChild("n26"));
  13040. this.n24 = (this.getChild("n24"));
  13041. this.nameTxt = (this.getChild("nameTxt"));
  13042. this.headRoot = (this.getChild("headRoot"));
  13043. }
  13044. }
  13045. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  13046. class ui_Component4 extends fgui.GComponent {
  13047. static createInstance() {
  13048. return (fgui.UIPackage.createObject("game", "Component4"));
  13049. }
  13050. onConstruct() {
  13051. this.headImg = (this.getChild("headImg"));
  13052. }
  13053. }
  13054. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  13055. class ui_Component7 extends fgui.GButton {
  13056. static createInstance() {
  13057. return (fgui.UIPackage.createObject("game", "Component7"));
  13058. }
  13059. onConstruct() {
  13060. this.n17 = (this.getChild("n17"));
  13061. }
  13062. }
  13063. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  13064. class ui_Component8 extends fgui.GButton {
  13065. static createInstance() {
  13066. return (fgui.UIPackage.createObject("game", "Component8"));
  13067. }
  13068. onConstruct() {
  13069. this.n19 = (this.getChild("n19"));
  13070. }
  13071. }
  13072. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  13073. class ui_Component10 extends fgui.GButton {
  13074. static createInstance() {
  13075. return (fgui.UIPackage.createObject("game", "Component10"));
  13076. }
  13077. onConstruct() {
  13078. this.c1 = this.getController("c1");
  13079. this.n40 = (this.getChild("n40"));
  13080. }
  13081. }
  13082. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  13083. class ui_Component11 extends fgui.GButton {
  13084. static createInstance() {
  13085. return (fgui.UIPackage.createObject("game", "Component11"));
  13086. }
  13087. onConstruct() {
  13088. this.n34 = (this.getChild("n34"));
  13089. }
  13090. }
  13091. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  13092. class ui_Component12 extends fgui.GButton {
  13093. static createInstance() {
  13094. return (fgui.UIPackage.createObject("game", "Component12"));
  13095. }
  13096. onConstruct() {
  13097. this.n35 = (this.getChild("n35"));
  13098. }
  13099. }
  13100. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  13101. class ui_Component13 extends fgui.GButton {
  13102. static createInstance() {
  13103. return (fgui.UIPackage.createObject("game", "Component13"));
  13104. }
  13105. onConstruct() {
  13106. this.n27 = (this.getChild("n27"));
  13107. this.n36 = (this.getChild("n36"));
  13108. }
  13109. }
  13110. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  13111. class ui_dh_js_tuowei extends fgui.GComponent {
  13112. static createInstance() {
  13113. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  13114. }
  13115. onConstruct() {
  13116. this.n19 = (this.getChild("n19"));
  13117. this.n18 = (this.getChild("n18"));
  13118. this.n0 = (this.getChild("n0"));
  13119. this.n3 = (this.getChild("n3"));
  13120. this.n4 = (this.getChild("n4"));
  13121. this.n5 = (this.getChild("n5"));
  13122. this.n6 = (this.getChild("n6"));
  13123. this.n8 = (this.getChild("n8"));
  13124. this.n9 = (this.getChild("n9"));
  13125. this.n10 = (this.getChild("n10"));
  13126. this.n11 = (this.getChild("n11"));
  13127. this.n12 = (this.getChild("n12"));
  13128. this.n13 = (this.getChild("n13"));
  13129. this.n14 = (this.getChild("n14"));
  13130. this.n15 = (this.getChild("n15"));
  13131. this.n20 = (this.getChild("n20"));
  13132. this.t0 = this.getTransition("t0");
  13133. this.t1 = this.getTransition("t1");
  13134. }
  13135. }
  13136. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  13137. class ui_dh_js_tw_g extends fgui.GComponent {
  13138. static createInstance() {
  13139. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  13140. }
  13141. onConstruct() {
  13142. this.n0 = (this.getChild("n0"));
  13143. this.n1 = (this.getChild("n1"));
  13144. this.t0 = this.getTransition("t0");
  13145. }
  13146. }
  13147. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  13148. class ui_dh_js_xingxing extends fgui.GComponent {
  13149. static createInstance() {
  13150. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  13151. }
  13152. onConstruct() {
  13153. this.n1 = (this.getChild("n1"));
  13154. this.n2 = (this.getChild("n2"));
  13155. this.n3 = (this.getChild("n3"));
  13156. this.n4 = (this.getChild("n4"));
  13157. this.n0 = (this.getChild("n0"));
  13158. this.t2 = this.getTransition("t2");
  13159. this.t1 = this.getTransition("t1");
  13160. }
  13161. }
  13162. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  13163. class ui_dh_zy_jiazai extends fgui.GComponent {
  13164. static createInstance() {
  13165. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  13166. }
  13167. onConstruct() {
  13168. this.c1 = this.getController("c1");
  13169. this.n0 = (this.getChild("n0"));
  13170. this.n1 = (this.getChild("n1"));
  13171. this.n2 = (this.getChild("n2"));
  13172. this.n4 = (this.getChild("n4"));
  13173. this.n5 = (this.getChild("n5"));
  13174. this.n6 = (this.getChild("n6"));
  13175. this.n8 = (this.getChild("n8"));
  13176. this.n7 = (this.getChild("n7"));
  13177. this.t0 = this.getTransition("t0");
  13178. }
  13179. }
  13180. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  13181. class ui_dh_js_xingxing2 extends fgui.GComponent {
  13182. static createInstance() {
  13183. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  13184. }
  13185. onConstruct() {
  13186. this.c1 = this.getController("c1");
  13187. this.n3 = (this.getChild("n3"));
  13188. this.n5 = (this.getChild("n5"));
  13189. this.n4 = (this.getChild("n4"));
  13190. this.n0 = (this.getChild("n0"));
  13191. this.n1 = (this.getChild("n1"));
  13192. this.n2 = (this.getChild("n2"));
  13193. }
  13194. }
  13195. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  13196. class ui_dh_js_tuowei2 extends fgui.GComponent {
  13197. static createInstance() {
  13198. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  13199. }
  13200. onConstruct() {
  13201. this.n19 = (this.getChild("n19"));
  13202. this.n21 = (this.getChild("n21"));
  13203. this.n0 = (this.getChild("n0"));
  13204. this.n3 = (this.getChild("n3"));
  13205. this.n4 = (this.getChild("n4"));
  13206. this.n5 = (this.getChild("n5"));
  13207. this.n6 = (this.getChild("n6"));
  13208. this.n8 = (this.getChild("n8"));
  13209. this.n9 = (this.getChild("n9"));
  13210. this.n10 = (this.getChild("n10"));
  13211. this.n11 = (this.getChild("n11"));
  13212. this.n12 = (this.getChild("n12"));
  13213. this.n13 = (this.getChild("n13"));
  13214. this.n14 = (this.getChild("n14"));
  13215. this.n15 = (this.getChild("n15"));
  13216. this.n23 = (this.getChild("n23"));
  13217. this.t0 = this.getTransition("t0");
  13218. this.t1 = this.getTransition("t1");
  13219. }
  13220. }
  13221. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  13222. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  13223. static createInstance() {
  13224. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  13225. }
  13226. onConstruct() {
  13227. this.n1 = (this.getChild("n1"));
  13228. this.n2 = (this.getChild("n2"));
  13229. this.t0 = this.getTransition("t0");
  13230. }
  13231. }
  13232. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  13233. class ui_dh_js_shibai_1 extends fgui.GComponent {
  13234. static createInstance() {
  13235. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  13236. }
  13237. onConstruct() {
  13238. this.n4 = (this.getChild("n4"));
  13239. this.n2 = (this.getChild("n2"));
  13240. this.n3 = (this.getChild("n3"));
  13241. this.idle = this.getTransition("idle");
  13242. this.attack = this.getTransition("attack");
  13243. }
  13244. }
  13245. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  13246. class ui_special extends fgui.GComponent {
  13247. static createInstance() {
  13248. return (fgui.UIPackage.createObject("game", "special"));
  13249. }
  13250. onConstruct() {
  13251. this.n18 = (this.getChild("n18"));
  13252. this.n19 = (this.getChild("n19"));
  13253. this.n20 = (this.getChild("n20"));
  13254. this.n21 = (this.getChild("n21"));
  13255. this.n22 = (this.getChild("n22"));
  13256. this.levelTxt = (this.getChild("levelTxt"));
  13257. this.n24 = (this.getChild("n24"));
  13258. this.n25 = (this.getChild("n25"));
  13259. this.t0 = this.getTransition("t0");
  13260. }
  13261. }
  13262. ui_special.URL = "ui://isxx5ak7j979v4i6";
  13263. class ui_Component145 extends fgui.GComponent {
  13264. static createInstance() {
  13265. return (fgui.UIPackage.createObject("game", "Component145"));
  13266. }
  13267. onConstruct() {
  13268. this.guanyuNode = (this.getChild("guanyuNode"));
  13269. }
  13270. }
  13271. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  13272. class ui_longBtn extends fgui.GButton {
  13273. static createInstance() {
  13274. return (fgui.UIPackage.createObject("game", "longBtn"));
  13275. }
  13276. onConstruct() {
  13277. this.c1 = this.getController("c1");
  13278. this.n2 = (this.getChild("n2"));
  13279. this.n1 = (this.getChild("n1"));
  13280. this.n4 = (this.getChild("n4"));
  13281. }
  13282. }
  13283. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  13284. class ui_Component146 extends fgui.GComponent {
  13285. static createInstance() {
  13286. return (fgui.UIPackage.createObject("game", "Component146"));
  13287. }
  13288. onConstruct() {
  13289. this.n89 = (this.getChild("n89"));
  13290. this.n90 = (this.getChild("n90"));
  13291. this.guideBtn = (this.getChild("guideBtn"));
  13292. }
  13293. }
  13294. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  13295. class ui_Component146_11 extends fgui.GComponent {
  13296. static createInstance() {
  13297. return (fgui.UIPackage.createObject("game", "Component146_11"));
  13298. }
  13299. onConstruct() {
  13300. this.n89 = (this.getChild("n89"));
  13301. this.n90 = (this.getChild("n90"));
  13302. this.guideBtn = (this.getChild("guideBtn"));
  13303. }
  13304. }
  13305. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  13306. class ui_Component111_1 extends fgui.GComponent {
  13307. static createInstance() {
  13308. return (fgui.UIPackage.createObject("game", "Component111_1"));
  13309. }
  13310. onConstruct() {
  13311. this.n68 = (this.getChild("n68"));
  13312. this.myMask = (this.getChild("myMask"));
  13313. }
  13314. }
  13315. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  13316. class ui_Component64_1 extends fgui.GComponent {
  13317. static createInstance() {
  13318. return (fgui.UIPackage.createObject("game", "Component64_1"));
  13319. }
  13320. onConstruct() {
  13321. this.n57 = (this.getChild("n57"));
  13322. this.n54 = (this.getChild("n54"));
  13323. this.n55 = (this.getChild("n55"));
  13324. this.n56 = (this.getChild("n56"));
  13325. this.t1 = this.getTransition("t1");
  13326. }
  13327. }
  13328. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  13329. class ui_ModeSelection_com123 extends fgui.GComponent {
  13330. static createInstance() {
  13331. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  13332. }
  13333. onConstruct() {
  13334. this.type1 = (this.getChild("type1"));
  13335. this.type2 = (this.getChild("type2"));
  13336. this.type3 = (this.getChild("type3"));
  13337. this.n38 = (this.getChild("n38"));
  13338. this.t0 = this.getTransition("t0");
  13339. }
  13340. }
  13341. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  13342. class ui_Component132_2 extends fgui.GComponent {
  13343. static createInstance() {
  13344. return (fgui.UIPackage.createObject("game", "Component132_2"));
  13345. }
  13346. onConstruct() {
  13347. this.n25 = (this.getChild("n25"));
  13348. this.n26 = (this.getChild("n26"));
  13349. this.n27 = (this.getChild("n27"));
  13350. this.t0 = this.getTransition("t0");
  13351. }
  13352. }
  13353. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  13354. class ui_UIPower$1 extends fgui.GComponent {
  13355. static createInstance() {
  13356. return (fgui.UIPackage.createObject("game", "UIPower"));
  13357. }
  13358. onConstruct() {
  13359. this.n11 = (this.getChild("n11"));
  13360. this.myNode = (this.getChild("myNode"));
  13361. this.t0 = this.getTransition("t0");
  13362. }
  13363. }
  13364. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  13365. class ui_Component133 extends fgui.GComponent {
  13366. static createInstance() {
  13367. return (fgui.UIPackage.createObject("game", "Component133"));
  13368. }
  13369. onConstruct() {
  13370. this.n29 = (this.getChild("n29"));
  13371. this.n30 = (this.getChild("n30"));
  13372. }
  13373. }
  13374. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  13375. class ui_Component134 extends fgui.GComponent {
  13376. static createInstance() {
  13377. return (fgui.UIPackage.createObject("game", "Component134"));
  13378. }
  13379. onConstruct() {
  13380. this.n30 = (this.getChild("n30"));
  13381. this.n31 = (this.getChild("n31"));
  13382. this.t0 = this.getTransition("t0");
  13383. }
  13384. }
  13385. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  13386. class ui_Component135 extends fgui.GComponent {
  13387. static createInstance() {
  13388. return (fgui.UIPackage.createObject("game", "Component135"));
  13389. }
  13390. onConstruct() {
  13391. this.n30 = (this.getChild("n30"));
  13392. this.t0 = this.getTransition("t0");
  13393. }
  13394. }
  13395. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  13396. class ui_Component137 extends fgui.GComponent {
  13397. static createInstance() {
  13398. return (fgui.UIPackage.createObject("game", "Component137"));
  13399. }
  13400. onConstruct() {
  13401. this.n28 = (this.getChild("n28"));
  13402. this.n29 = (this.getChild("n29"));
  13403. this.n30 = (this.getChild("n30"));
  13404. this.n32 = (this.getChild("n32"));
  13405. }
  13406. }
  13407. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  13408. class ui_dh_zuanshi extends fgui.GButton {
  13409. static createInstance() {
  13410. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  13411. }
  13412. onConstruct() {
  13413. this.n1 = (this.getChild("n1"));
  13414. this.n2 = (this.getChild("n2"));
  13415. this.n0 = (this.getChild("n0"));
  13416. this.n3 = (this.getChild("n3"));
  13417. this.n4 = (this.getChild("n4"));
  13418. }
  13419. }
  13420. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  13421. class ui_Component138 extends fgui.GComponent {
  13422. static createInstance() {
  13423. return (fgui.UIPackage.createObject("game", "Component138"));
  13424. }
  13425. onConstruct() {
  13426. this.n1 = (this.getChild("n1"));
  13427. this.n2 = (this.getChild("n2"));
  13428. this.t0 = this.getTransition("t0");
  13429. }
  13430. }
  13431. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  13432. class ui_Component139 extends fgui.GComponent {
  13433. static createInstance() {
  13434. return (fgui.UIPackage.createObject("game", "Component139"));
  13435. }
  13436. onConstruct() {
  13437. this.n0 = (this.getChild("n0"));
  13438. this.t0 = this.getTransition("t0");
  13439. }
  13440. }
  13441. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  13442. class ui_Component140 extends fgui.GComponent {
  13443. static createInstance() {
  13444. return (fgui.UIPackage.createObject("game", "Component140"));
  13445. }
  13446. onConstruct() {
  13447. this.n2 = (this.getChild("n2"));
  13448. this.n3 = (this.getChild("n3"));
  13449. this.t0 = this.getTransition("t0");
  13450. }
  13451. }
  13452. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  13453. class ui_Component141 extends fgui.GComponent {
  13454. static createInstance() {
  13455. return (fgui.UIPackage.createObject("game", "Component141"));
  13456. }
  13457. onConstruct() {
  13458. this.n0 = (this.getChild("n0"));
  13459. this.t0 = this.getTransition("t0");
  13460. }
  13461. }
  13462. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  13463. class ui_powerNode extends fgui.GProgressBar {
  13464. static createInstance() {
  13465. return (fgui.UIPackage.createObject("game", "powerNode"));
  13466. }
  13467. onConstruct() {
  13468. this.n2 = (this.getChild("n2"));
  13469. this.bar_v = (this.getChild("bar_v"));
  13470. this.showImg = (this.getChild("showImg"));
  13471. this.n12 = (this.getChild("n12"));
  13472. }
  13473. }
  13474. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13475. class ui_dh_jingbi1 extends fgui.GComponent {
  13476. static createInstance() {
  13477. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13478. }
  13479. onConstruct() {
  13480. this.n0 = (this.getChild("n0"));
  13481. this.n1 = (this.getChild("n1"));
  13482. this.n2 = (this.getChild("n2"));
  13483. this.n3 = (this.getChild("n3"));
  13484. this.n4 = (this.getChild("n4"));
  13485. this.n5 = (this.getChild("n5"));
  13486. this.n6 = (this.getChild("n6"));
  13487. this.n8 = (this.getChild("n8"));
  13488. this.t0 = this.getTransition("t0");
  13489. }
  13490. }
  13491. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13492. class ui_Component94 extends fgui.GButton {
  13493. static createInstance() {
  13494. return (fgui.UIPackage.createObject("game", "Component94"));
  13495. }
  13496. onConstruct() {
  13497. this.n77 = (this.getChild("n77"));
  13498. }
  13499. }
  13500. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13501. class ui_Component95 extends fgui.GButton {
  13502. static createInstance() {
  13503. return (fgui.UIPackage.createObject("game", "Component95"));
  13504. }
  13505. onConstruct() {
  13506. this.n77 = (this.getChild("n77"));
  13507. }
  13508. }
  13509. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13510. class ui_Component126 extends fgui.GComponent {
  13511. static createInstance() {
  13512. return (fgui.UIPackage.createObject("game", "Component126"));
  13513. }
  13514. onConstruct() {
  13515. this.c1 = this.getController("c1");
  13516. this.normalBtn = (this.getChild("normalBtn"));
  13517. this.tripleBtn = (this.getChild("tripleBtn"));
  13518. }
  13519. }
  13520. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13521. class ui_Component60 extends fgui.GComponent {
  13522. static createInstance() {
  13523. return (fgui.UIPackage.createObject("game", "Component60"));
  13524. }
  13525. onConstruct() {
  13526. this.c1 = this.getController("c1");
  13527. this.n48 = (this.getChild("n48"));
  13528. this.womanTxt = (this.getChild("womanTxt"));
  13529. this.t0 = this.getTransition("t0");
  13530. }
  13531. }
  13532. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13533. class ui_Component98_3 extends fgui.GButton {
  13534. static createInstance() {
  13535. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13536. }
  13537. onConstruct() {
  13538. this.c1 = this.getController("c1");
  13539. this.n8 = (this.getChild("n8"));
  13540. this.n41 = (this.getChild("n41"));
  13541. this.n40 = (this.getChild("n40"));
  13542. }
  13543. }
  13544. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13545. class ui_ModeSelection_com1 extends fgui.GButton {
  13546. static createInstance() {
  13547. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13548. }
  13549. onConstruct() {
  13550. this.n34 = (this.getChild("n34"));
  13551. this.n36 = (this.getChild("n36"));
  13552. this.n22 = (this.getChild("n22"));
  13553. this.n20 = (this.getChild("n20"));
  13554. this.n23 = (this.getChild("n23"));
  13555. this.n24 = (this.getChild("n24"));
  13556. this.n26 = (this.getChild("n26"));
  13557. this.n33 = (this.getChild("n33"));
  13558. this.coinImg = (this.getChild("coinImg"));
  13559. this.need = (this.getChild("need"));
  13560. this.n35 = (this.getChild("n35"));
  13561. this.n29 = (this.getChild("n29"));
  13562. this.tipsTxt = (this.getChild("tipsTxt"));
  13563. this.n30 = (this.getChild("n30"));
  13564. this.peopleTxt = (this.getChild("peopleTxt"));
  13565. this.t0 = this.getTransition("t0");
  13566. }
  13567. }
  13568. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13569. class ui_ModeSelection_com2 extends fgui.GButton {
  13570. static createInstance() {
  13571. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13572. }
  13573. onConstruct() {
  13574. this.n36 = (this.getChild("n36"));
  13575. this.n34 = (this.getChild("n34"));
  13576. this.n22 = (this.getChild("n22"));
  13577. this.n20 = (this.getChild("n20"));
  13578. this.n23 = (this.getChild("n23"));
  13579. this.n24 = (this.getChild("n24"));
  13580. this.n26 = (this.getChild("n26"));
  13581. this.n33 = (this.getChild("n33"));
  13582. this.coinImg = (this.getChild("coinImg"));
  13583. this.need = (this.getChild("need"));
  13584. this.n35 = (this.getChild("n35"));
  13585. this.n29 = (this.getChild("n29"));
  13586. this.tipsTxt = (this.getChild("tipsTxt"));
  13587. this.n30 = (this.getChild("n30"));
  13588. this.peopleTxt = (this.getChild("peopleTxt"));
  13589. this.t0 = this.getTransition("t0");
  13590. }
  13591. }
  13592. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13593. class ui_ModeSelection_com3 extends fgui.GButton {
  13594. static createInstance() {
  13595. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13596. }
  13597. onConstruct() {
  13598. this.n34 = (this.getChild("n34"));
  13599. this.n36 = (this.getChild("n36"));
  13600. this.n22 = (this.getChild("n22"));
  13601. this.n20 = (this.getChild("n20"));
  13602. this.n23 = (this.getChild("n23"));
  13603. this.n24 = (this.getChild("n24"));
  13604. this.n26 = (this.getChild("n26"));
  13605. this.n33 = (this.getChild("n33"));
  13606. this.coinImg = (this.getChild("coinImg"));
  13607. this.need = (this.getChild("need"));
  13608. this.n35 = (this.getChild("n35"));
  13609. this.n29 = (this.getChild("n29"));
  13610. this.tipsTxt = (this.getChild("tipsTxt"));
  13611. this.n30 = (this.getChild("n30"));
  13612. this.peopleTxt = (this.getChild("peopleTxt"));
  13613. this.t0 = this.getTransition("t0");
  13614. }
  13615. }
  13616. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13617. class ui_Invitation_com1 extends fgui.GComponent {
  13618. static createInstance() {
  13619. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13620. }
  13621. onConstruct() {
  13622. this.n14 = (this.getChild("n14"));
  13623. this.n13 = (this.getChild("n13"));
  13624. this.n3 = (this.getChild("n3"));
  13625. this.n1 = (this.getChild("n1"));
  13626. this.n6 = (this.getChild("n6"));
  13627. this.n7 = (this.getChild("n7"));
  13628. this.enterBtn = (this.getChild("enterBtn"));
  13629. this.n11 = (this.getChild("n11"));
  13630. this.n12 = (this.getChild("n12"));
  13631. this.n15 = (this.getChild("n15"));
  13632. this.t0 = this.getTransition("t0");
  13633. this.t1 = this.getTransition("t1");
  13634. }
  13635. }
  13636. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13637. class ui_Component87_1 extends fgui.GComponent {
  13638. static createInstance() {
  13639. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13640. }
  13641. onConstruct() {
  13642. this.n74 = (this.getChild("n74"));
  13643. this.n73 = (this.getChild("n73"));
  13644. this.ballTxt = (this.getChild("ballTxt"));
  13645. this.n76 = (this.getChild("n76"));
  13646. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13647. this.levelTxt = (this.getChild("levelTxt"));
  13648. this.n87 = (this.getChild("n87"));
  13649. this.n84 = (this.getChild("n84"));
  13650. this.hpTxt = (this.getChild("hpTxt"));
  13651. this.n89 = (this.getChild("n89"));
  13652. this.tipsTxt = (this.getChild("tipsTxt"));
  13653. }
  13654. }
  13655. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13656. class ui_sqg1 extends fgui.GComponent {
  13657. static createInstance() {
  13658. return (fgui.UIPackage.createObject("game", "sqg1"));
  13659. }
  13660. onConstruct() {
  13661. this.n1 = (this.getChild("n1"));
  13662. this.n0 = (this.getChild("n0"));
  13663. }
  13664. }
  13665. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  13666. class ui_sqg2 extends fgui.GComponent {
  13667. static createInstance() {
  13668. return (fgui.UIPackage.createObject("game", "sqg2"));
  13669. }
  13670. onConstruct() {
  13671. this.n1 = (this.getChild("n1"));
  13672. this.n0 = (this.getChild("n0"));
  13673. }
  13674. }
  13675. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  13676. class ui_sqg3 extends fgui.GComponent {
  13677. static createInstance() {
  13678. return (fgui.UIPackage.createObject("game", "sqg3"));
  13679. }
  13680. onConstruct() {
  13681. this.n1 = (this.getChild("n1"));
  13682. this.n0 = (this.getChild("n0"));
  13683. }
  13684. }
  13685. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  13686. class ui_sqg4 extends fgui.GComponent {
  13687. static createInstance() {
  13688. return (fgui.UIPackage.createObject("game", "sqg4"));
  13689. }
  13690. onConstruct() {
  13691. this.n1 = (this.getChild("n1"));
  13692. this.n0 = (this.getChild("n0"));
  13693. }
  13694. }
  13695. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  13696. class ui_Component36 extends fgui.GButton {
  13697. static createInstance() {
  13698. return (fgui.UIPackage.createObject("game", "Component36"));
  13699. }
  13700. onConstruct() {
  13701. this.c1 = this.getController("c1");
  13702. this.n53 = (this.getChild("n53"));
  13703. this.n56 = (this.getChild("n56"));
  13704. }
  13705. }
  13706. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  13707. class ui_Component37 extends fgui.GButton {
  13708. static createInstance() {
  13709. return (fgui.UIPackage.createObject("game", "Component37"));
  13710. }
  13711. onConstruct() {
  13712. this.c1 = this.getController("c1");
  13713. this.n52 = (this.getChild("n52"));
  13714. this.n54 = (this.getChild("n54"));
  13715. }
  13716. }
  13717. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  13718. class ui_UISetting extends fgui.GComponent {
  13719. static createInstance() {
  13720. return (fgui.UIPackage.createObject("game", "UISetting"));
  13721. }
  13722. onConstruct() {
  13723. this.c1 = this.getController("c1");
  13724. this.n4 = (this.getChild("n4"));
  13725. this.soundBtn = (this.getChild("soundBtn"));
  13726. this.shakeBtn = (this.getChild("shakeBtn"));
  13727. this.clickNode = (this.getChild("clickNode"));
  13728. this.xyBtn = (this.getChild("xyBtn"));
  13729. }
  13730. }
  13731. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  13732. class ui_Component39 extends fgui.GComponent {
  13733. static createInstance() {
  13734. return (fgui.UIPackage.createObject("game", "Component39"));
  13735. }
  13736. onConstruct() {
  13737. this.n5 = (this.getChild("n5"));
  13738. this.n6 = (this.getChild("n6"));
  13739. this.n7 = (this.getChild("n7"));
  13740. this.t0 = this.getTransition("t0");
  13741. }
  13742. }
  13743. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  13744. class ui_Component40 extends fgui.GButton {
  13745. static createInstance() {
  13746. return (fgui.UIPackage.createObject("game", "Component40"));
  13747. }
  13748. onConstruct() {
  13749. this.n46 = (this.getChild("n46"));
  13750. this.n47 = (this.getChild("n47"));
  13751. }
  13752. }
  13753. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13754. class ui_Component41 extends fgui.GComponent {
  13755. static createInstance() {
  13756. return (fgui.UIPackage.createObject("game", "Component41"));
  13757. }
  13758. onConstruct() {
  13759. this.c1 = this.getController("c1");
  13760. this.n0 = (this.getChild("n0"));
  13761. this.titleTxt = (this.getChild("titleTxt"));
  13762. this.n2 = (this.getChild("n2"));
  13763. this.msgTips = (this.getChild("msgTips"));
  13764. this.numTxt = (this.getChild("numTxt"));
  13765. this.n18 = (this.getChild("n18"));
  13766. this.cancelBtn = (this.getChild("cancelBtn"));
  13767. this.videoBtn = (this.getChild("videoBtn"));
  13768. this.n10 = (this.getChild("n10"));
  13769. }
  13770. }
  13771. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13772. class ui_Component42 extends fgui.GComponent {
  13773. static createInstance() {
  13774. return (fgui.UIPackage.createObject("game", "Component42"));
  13775. }
  13776. onConstruct() {
  13777. this.c1 = this.getController("c1");
  13778. this.n1 = (this.getChild("n1"));
  13779. this.n2 = (this.getChild("n2"));
  13780. this.n3 = (this.getChild("n3"));
  13781. this.tipsTxt = (this.getChild("tipsTxt"));
  13782. this.cancelBtn = (this.getChild("cancelBtn"));
  13783. this.sureBtn = (this.getChild("sureBtn"));
  13784. this.n11 = (this.getChild("n11"));
  13785. this.n13 = (this.getChild("n13"));
  13786. this.n14 = (this.getChild("n14"));
  13787. this.womanTxt = (this.getChild("womanTxt"));
  13788. this.t0 = this.getTransition("t0");
  13789. }
  13790. }
  13791. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13792. class ui_dh_js_shengli extends fgui.GComponent {
  13793. static createInstance() {
  13794. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13795. }
  13796. onConstruct() {
  13797. this.n3 = (this.getChild("n3"));
  13798. this.n4 = (this.getChild("n4"));
  13799. this.n1 = (this.getChild("n1"));
  13800. this.n2 = (this.getChild("n2"));
  13801. this.n5 = (this.getChild("n5"));
  13802. this.n6 = (this.getChild("n6"));
  13803. this.n7 = (this.getChild("n7"));
  13804. this.n8 = (this.getChild("n8"));
  13805. this.attack = this.getTransition("attack");
  13806. this.idle = this.getTransition("idle");
  13807. }
  13808. }
  13809. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13810. class ui_dh_js_shengli_g extends fgui.GComponent {
  13811. static createInstance() {
  13812. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13813. }
  13814. onConstruct() {
  13815. this.n3 = (this.getChild("n3"));
  13816. this.n1 = (this.getChild("n1"));
  13817. this.t0 = this.getTransition("t0");
  13818. }
  13819. }
  13820. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13821. class ui_dh_js_shibai extends fgui.GComponent {
  13822. static createInstance() {
  13823. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13824. }
  13825. onConstruct() {
  13826. this.n0 = (this.getChild("n0"));
  13827. this.n1 = (this.getChild("n1"));
  13828. this.n2 = (this.getChild("n2"));
  13829. this.n3 = (this.getChild("n3"));
  13830. this.idle = this.getTransition("idle");
  13831. this.attack = this.getTransition("attack");
  13832. }
  13833. }
  13834. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13835. class ui_dh_zy_ganfa extends fgui.GButton {
  13836. static createInstance() {
  13837. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13838. }
  13839. onConstruct() {
  13840. this.n0 = (this.getChild("n0"));
  13841. }
  13842. }
  13843. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13844. class ui_dh_zy_sc_guang extends fgui.GButton {
  13845. static createInstance() {
  13846. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13847. }
  13848. onConstruct() {
  13849. this.n0 = (this.getChild("n0"));
  13850. this.n2 = (this.getChild("n2"));
  13851. }
  13852. }
  13853. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13854. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13855. static createInstance() {
  13856. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13857. }
  13858. onConstruct() {
  13859. this.n0 = (this.getChild("n0"));
  13860. this.n3 = (this.getChild("n3"));
  13861. this.t0 = this.getTransition("t0");
  13862. }
  13863. }
  13864. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13865. class ui_dh_zy_wanfa extends fgui.GButton {
  13866. static createInstance() {
  13867. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13868. }
  13869. onConstruct() {
  13870. this.n0 = (this.getChild("n0"));
  13871. }
  13872. }
  13873. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13874. class ui_Component53_1 extends fgui.GComponent {
  13875. static createInstance() {
  13876. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13877. }
  13878. onConstruct() {
  13879. this.n0 = (this.getChild("n0"));
  13880. this.n1 = (this.getChild("n1"));
  13881. this.n2 = (this.getChild("n2"));
  13882. this.n3 = (this.getChild("n3"));
  13883. this.n4 = (this.getChild("n4"));
  13884. this.n5 = (this.getChild("n5"));
  13885. this.n6 = (this.getChild("n6"));
  13886. this.n7 = (this.getChild("n7"));
  13887. this.n8 = (this.getChild("n8"));
  13888. this.n9 = (this.getChild("n9"));
  13889. this.n10 = (this.getChild("n10"));
  13890. this.n11 = (this.getChild("n11"));
  13891. this.n12 = (this.getChild("n12"));
  13892. this.n13 = (this.getChild("n13"));
  13893. this.n14 = (this.getChild("n14"));
  13894. this.n15 = (this.getChild("n15"));
  13895. this.n16 = (this.getChild("n16"));
  13896. this.n19 = (this.getChild("n19"));
  13897. this.n20 = (this.getChild("n20"));
  13898. this.n21 = (this.getChild("n21"));
  13899. this.n22 = (this.getChild("n22"));
  13900. this.n23 = (this.getChild("n23"));
  13901. this.n24 = (this.getChild("n24"));
  13902. this.n25 = (this.getChild("n25"));
  13903. this.n26 = (this.getChild("n26"));
  13904. this.n27 = (this.getChild("n27"));
  13905. this.n28 = (this.getChild("n28"));
  13906. this.n29 = (this.getChild("n29"));
  13907. this.n30 = (this.getChild("n30"));
  13908. this.n31 = (this.getChild("n31"));
  13909. this.n32 = (this.getChild("n32"));
  13910. this.n33 = (this.getChild("n33"));
  13911. this.n34 = (this.getChild("n34"));
  13912. this.n35 = (this.getChild("n35"));
  13913. this.t0 = this.getTransition("t0");
  13914. }
  13915. }
  13916. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13917. class ui_Component30 extends fgui.GComponent {
  13918. static createInstance() {
  13919. return (fgui.UIPackage.createObject("game", "Component30"));
  13920. }
  13921. onConstruct() {
  13922. this.c1 = this.getController("c1");
  13923. this.n46 = (this.getChild("n46"));
  13924. this.n47 = (this.getChild("n47"));
  13925. this.numTxt = (this.getChild("numTxt"));
  13926. this.n50 = (this.getChild("n50"));
  13927. this.n53 = (this.getChild("n53"));
  13928. this.n54 = (this.getChild("n54"));
  13929. this.n55 = (this.getChild("n55"));
  13930. this.n56 = (this.getChild("n56"));
  13931. }
  13932. }
  13933. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13934. class ui_Component30_1 extends fgui.GComponent {
  13935. static createInstance() {
  13936. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13937. }
  13938. onConstruct() {
  13939. this.c1 = this.getController("c1");
  13940. this.n46 = (this.getChild("n46"));
  13941. this.n47 = (this.getChild("n47"));
  13942. this.numTxt = (this.getChild("numTxt"));
  13943. this.n50 = (this.getChild("n50"));
  13944. this.n51 = (this.getChild("n51"));
  13945. this.n52 = (this.getChild("n52"));
  13946. this.n53 = (this.getChild("n53"));
  13947. this.n54 = (this.getChild("n54"));
  13948. }
  13949. }
  13950. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13951. class ui_Component31 extends fgui.GComponent {
  13952. static createInstance() {
  13953. return (fgui.UIPackage.createObject("game", "Component31"));
  13954. }
  13955. onConstruct() {
  13956. this.n55 = (this.getChild("n55"));
  13957. this.n54 = (this.getChild("n54"));
  13958. this.conditionTxt = (this.getChild("conditionTxt"));
  13959. this.n57 = (this.getChild("n57"));
  13960. this.t0 = this.getTransition("t0");
  13961. }
  13962. }
  13963. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13964. class ui_Component32 extends fgui.GComponent {
  13965. static createInstance() {
  13966. return (fgui.UIPackage.createObject("game", "Component32"));
  13967. }
  13968. onConstruct() {
  13969. this.n5 = (this.getChild("n5"));
  13970. this.n6 = (this.getChild("n6"));
  13971. this.n7 = (this.getChild("n7"));
  13972. this.t0 = this.getTransition("t0");
  13973. }
  13974. }
  13975. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13976. class ui_AwardItem extends fgui.GComponent {
  13977. static createInstance() {
  13978. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13979. }
  13980. onConstruct() {
  13981. this.n9 = (this.getChild("n9"));
  13982. this.myIcon = (this.getChild("myIcon"));
  13983. this.numTxt = (this.getChild("numTxt"));
  13984. this.nameTxt = (this.getChild("nameTxt"));
  13985. this.n16 = (this.getChild("n16"));
  13986. this.n17 = (this.getChild("n17"));
  13987. }
  13988. }
  13989. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13990. class ui_ranking_com1 extends fgui.GButton {
  13991. static createInstance() {
  13992. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13993. }
  13994. onConstruct() {
  13995. this.c1 = this.getController("c1");
  13996. this.n49 = (this.getChild("n49"));
  13997. this.n18 = (this.getChild("n18"));
  13998. this.n46 = (this.getChild("n46"));
  13999. this.n48 = (this.getChild("n48"));
  14000. this.n50 = (this.getChild("n50"));
  14001. }
  14002. }
  14003. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  14004. class ui_ranking_com2 extends fgui.GButton {
  14005. static createInstance() {
  14006. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  14007. }
  14008. onConstruct() {
  14009. this.c1 = this.getController("c1");
  14010. this.n49 = (this.getChild("n49"));
  14011. this.n18 = (this.getChild("n18"));
  14012. this.n46 = (this.getChild("n46"));
  14013. this.n48 = (this.getChild("n48"));
  14014. this.n50 = (this.getChild("n50"));
  14015. }
  14016. }
  14017. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  14018. class ui_ranking_com3 extends fgui.GComponent {
  14019. static createInstance() {
  14020. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  14021. }
  14022. onConstruct() {
  14023. this.n17 = (this.getChild("n17"));
  14024. this.myIcon = (this.getChild("myIcon"));
  14025. }
  14026. }
  14027. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  14028. class ui_ranking_com4 extends fgui.GComponent {
  14029. static createInstance() {
  14030. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  14031. }
  14032. onConstruct() {
  14033. this.n16 = (this.getChild("n16"));
  14034. this.head = (this.getChild("head"));
  14035. }
  14036. }
  14037. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  14038. class ui_ranking_com5 extends fgui.GComponent {
  14039. static createInstance() {
  14040. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  14041. }
  14042. onConstruct() {
  14043. this.c1 = this.getController("c1");
  14044. this.c2 = this.getController("c2");
  14045. this.n2 = (this.getChild("n2"));
  14046. this.n3 = (this.getChild("n3"));
  14047. this.levelBtn = (this.getChild("levelBtn"));
  14048. this.starBtn = (this.getChild("starBtn"));
  14049. this.n23 = (this.getChild("n23"));
  14050. this.n24 = (this.getChild("n24"));
  14051. this.n25 = (this.getChild("n25"));
  14052. this.myList = (this.getChild("myList"));
  14053. this.selfNode = (this.getChild("selfNode"));
  14054. this.n9 = (this.getChild("n9"));
  14055. this.n12 = (this.getChild("n12"));
  14056. this.n13 = (this.getChild("n13"));
  14057. this.n14 = (this.getChild("n14"));
  14058. this.n39 = (this.getChild("n39"));
  14059. this.n41 = (this.getChild("n41"));
  14060. this.n42 = (this.getChild("n42"));
  14061. this.n45 = (this.getChild("n45"));
  14062. this.changeBtn = (this.getChild("changeBtn"));
  14063. this.closeBtn = (this.getChild("closeBtn"));
  14064. this.t0 = this.getTransition("t0");
  14065. }
  14066. }
  14067. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  14068. class ui_RankItem extends fgui.GComponent {
  14069. static createInstance() {
  14070. return (fgui.UIPackage.createObject("game", "RankItem"));
  14071. }
  14072. onConstruct() {
  14073. this.n10 = (this.getChild("n10"));
  14074. this.n11 = (this.getChild("n11"));
  14075. this.rankTxt = (this.getChild("rankTxt"));
  14076. this.headNode = (this.getChild("headNode"));
  14077. this.nameTxt = (this.getChild("nameTxt"));
  14078. this.n19 = (this.getChild("n19"));
  14079. this.valueTxt = (this.getChild("valueTxt"));
  14080. this.img1 = (this.getChild("img1"));
  14081. this.img2 = (this.getChild("img2"));
  14082. this.img3 = (this.getChild("img3"));
  14083. }
  14084. }
  14085. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  14086. class ui_ranking_com9 extends fgui.GComponent {
  14087. static createInstance() {
  14088. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  14089. }
  14090. onConstruct() {
  14091. this.c1 = this.getController("c1");
  14092. this.n27 = (this.getChild("n27"));
  14093. this.n28 = (this.getChild("n28"));
  14094. this.headNode = (this.getChild("headNode"));
  14095. this.rankTxt = (this.getChild("rankTxt"));
  14096. this.nameTxt = (this.getChild("nameTxt"));
  14097. this.n34 = (this.getChild("n34"));
  14098. this.valueTxt = (this.getChild("valueTxt"));
  14099. this.n36 = (this.getChild("n36"));
  14100. this.n37 = (this.getChild("n37"));
  14101. this.n38 = (this.getChild("n38"));
  14102. this.n39 = (this.getChild("n39"));
  14103. this.n40 = (this.getChild("n40"));
  14104. }
  14105. }
  14106. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  14107. class ui_ranking_com10 extends fgui.GComponent {
  14108. static createInstance() {
  14109. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  14110. }
  14111. onConstruct() {
  14112. this.n23 = (this.getChild("n23"));
  14113. this.n24 = (this.getChild("n24"));
  14114. }
  14115. }
  14116. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  14117. class ui_ranking_com11 extends fgui.GComponent {
  14118. static createInstance() {
  14119. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  14120. }
  14121. onConstruct() {
  14122. this.n24 = (this.getChild("n24"));
  14123. this.n25 = (this.getChild("n25"));
  14124. this.t0 = this.getTransition("t0");
  14125. }
  14126. }
  14127. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  14128. class ui_ranking_com13 extends fgui.GButton {
  14129. static createInstance() {
  14130. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  14131. }
  14132. onConstruct() {
  14133. this.c1 = this.getController("c1");
  14134. this.n44 = (this.getChild("n44"));
  14135. this.n45 = (this.getChild("n45"));
  14136. this.n46 = (this.getChild("n46"));
  14137. }
  14138. }
  14139. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  14140. class ui_Component122 extends fgui.GComponent {
  14141. static createInstance() {
  14142. return (fgui.UIPackage.createObject("game", "Component122"));
  14143. }
  14144. onConstruct() {
  14145. this.gameNode3 = (this.getChild("gameNode3"));
  14146. }
  14147. }
  14148. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  14149. class ui_skillItem extends fgui.GComponent {
  14150. static createInstance() {
  14151. return (fgui.UIPackage.createObject("game", "skillItem"));
  14152. }
  14153. onConstruct() {
  14154. this.c1 = this.getController("c1");
  14155. this.n31 = (this.getChild("n31"));
  14156. this.n6 = (this.getChild("n6"));
  14157. this.skillImg = (this.getChild("skillImg"));
  14158. this.nameTxt = (this.getChild("nameTxt"));
  14159. this.levelTxt = (this.getChild("levelTxt"));
  14160. this.n28 = (this.getChild("n28"));
  14161. this.describeTxt = (this.getChild("describeTxt"));
  14162. this.n32 = (this.getChild("n32"));
  14163. this.mutiBtn = (this.getChild("mutiBtn"));
  14164. this.tryNode = (this.getChild("tryNode"));
  14165. this.normalBtn = (this.getChild("normalBtn"));
  14166. this.startBtn = (this.getChild("startBtn"));
  14167. this.n42 = (this.getChild("n42"));
  14168. this.n43 = (this.getChild("n43"));
  14169. this.n44 = (this.getChild("n44"));
  14170. }
  14171. }
  14172. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  14173. class ui_Component26 extends fgui.GButton {
  14174. static createInstance() {
  14175. return (fgui.UIPackage.createObject("game", "Component26"));
  14176. }
  14177. onConstruct() {
  14178. this.n11 = (this.getChild("n11"));
  14179. this.n30 = (this.getChild("n30"));
  14180. this.n34 = (this.getChild("n34"));
  14181. }
  14182. }
  14183. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  14184. class ui_Component28 extends fgui.GButton {
  14185. static createInstance() {
  14186. return (fgui.UIPackage.createObject("game", "Component28"));
  14187. }
  14188. onConstruct() {
  14189. this.n12 = (this.getChild("n12"));
  14190. this.n31 = (this.getChild("n31"));
  14191. this.curTxt = (this.getChild("curTxt"));
  14192. this.n33 = (this.getChild("n33"));
  14193. }
  14194. }
  14195. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  14196. class ui_Component1302 extends fgui.GComponent {
  14197. static createInstance() {
  14198. return (fgui.UIPackage.createObject("game", "Component1302"));
  14199. }
  14200. onConstruct() {
  14201. this.n2 = (this.getChild("n2"));
  14202. this.n3 = (this.getChild("n3"));
  14203. }
  14204. }
  14205. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  14206. class ui_Component113 extends fgui.GComponent {
  14207. static createInstance() {
  14208. return (fgui.UIPackage.createObject("game", "Component113"));
  14209. }
  14210. onConstruct() {
  14211. this.n85 = (this.getChild("n85"));
  14212. this.n86 = (this.getChild("n86"));
  14213. this.n77 = (this.getChild("n77"));
  14214. this.n79 = (this.getChild("n79"));
  14215. this.n80 = (this.getChild("n80"));
  14216. this.n81 = (this.getChild("n81"));
  14217. this.n82 = (this.getChild("n82"));
  14218. this.n84 = (this.getChild("n84"));
  14219. this.n87 = (this.getChild("n87"));
  14220. this.t0 = this.getTransition("t0");
  14221. }
  14222. }
  14223. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  14224. class ui_Component114 extends fgui.GComponent {
  14225. static createInstance() {
  14226. return (fgui.UIPackage.createObject("game", "Component114"));
  14227. }
  14228. onConstruct() {
  14229. this.n77 = (this.getChild("n77"));
  14230. this.t0 = this.getTransition("t0");
  14231. }
  14232. }
  14233. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  14234. class ui_Component115 extends fgui.GComponent {
  14235. static createInstance() {
  14236. return (fgui.UIPackage.createObject("game", "Component115"));
  14237. }
  14238. onConstruct() {
  14239. this.n83 = (this.getChild("n83"));
  14240. this.fingerNode = (this.getChild("fingerNode"));
  14241. this.n84 = (this.getChild("n84"));
  14242. }
  14243. }
  14244. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  14245. class ui_Component117 extends fgui.GComponent {
  14246. static createInstance() {
  14247. return (fgui.UIPackage.createObject("game", "Component117"));
  14248. }
  14249. onConstruct() {
  14250. this.n87 = (this.getChild("n87"));
  14251. this.n88 = (this.getChild("n88"));
  14252. this.n84 = (this.getChild("n84"));
  14253. this.n85 = (this.getChild("n85"));
  14254. this.n86 = (this.getChild("n86"));
  14255. this.t0 = this.getTransition("t0");
  14256. }
  14257. }
  14258. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  14259. class ui_Component98_1 extends fgui.GButton {
  14260. static createInstance() {
  14261. return (fgui.UIPackage.createObject("game", "Component98_1"));
  14262. }
  14263. onConstruct() {
  14264. this.c1 = this.getController("c1");
  14265. this.n8 = (this.getChild("n8"));
  14266. this.n41 = (this.getChild("n41"));
  14267. this.n40 = (this.getChild("n40"));
  14268. }
  14269. }
  14270. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  14271. class ui_Component61 extends fgui.GComponent {
  14272. static createInstance() {
  14273. return (fgui.UIPackage.createObject("game", "Component61"));
  14274. }
  14275. onConstruct() {
  14276. this.n14 = (this.getChild("n14"));
  14277. this.n6 = (this.getChild("n6"));
  14278. this.t0 = this.getTransition("t0");
  14279. }
  14280. }
  14281. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  14282. class ui_Component62 extends fgui.GComponent {
  14283. static createInstance() {
  14284. return (fgui.UIPackage.createObject("game", "Component62"));
  14285. }
  14286. onConstruct() {
  14287. this.n66 = (this.getChild("n66"));
  14288. this.n56 = (this.getChild("n56"));
  14289. this.n63 = (this.getChild("n63"));
  14290. this.n65 = (this.getChild("n65"));
  14291. this.t0 = this.getTransition("t0");
  14292. }
  14293. }
  14294. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  14295. class ui_d3Root extends fgui.GComponent {
  14296. static createInstance() {
  14297. return (fgui.UIPackage.createObject("game", "d3Root"));
  14298. }
  14299. onConstruct() {
  14300. }
  14301. }
  14302. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  14303. class ui_d2Root extends fgui.GComponent {
  14304. static createInstance() {
  14305. return (fgui.UIPackage.createObject("game", "d2Root"));
  14306. }
  14307. onConstruct() {
  14308. }
  14309. }
  14310. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  14311. class ui_ballNode extends fgui.GComponent {
  14312. static createInstance() {
  14313. return (fgui.UIPackage.createObject("game", "ballNode"));
  14314. }
  14315. onConstruct() {
  14316. }
  14317. }
  14318. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  14319. class ui_border extends fgui.GComponent {
  14320. static createInstance() {
  14321. return (fgui.UIPackage.createObject("game", "border"));
  14322. }
  14323. onConstruct() {
  14324. this.bar1 = (this.getChild("bar1"));
  14325. this.bar2 = (this.getChild("bar2"));
  14326. this.bar3 = (this.getChild("bar3"));
  14327. this.bar4 = (this.getChild("bar4"));
  14328. this.bar5 = (this.getChild("bar5"));
  14329. this.bar6 = (this.getChild("bar6"));
  14330. this.circle1 = (this.getChild("circle1"));
  14331. this.circle2 = (this.getChild("circle2"));
  14332. this.circle3 = (this.getChild("circle3"));
  14333. this.circle4 = (this.getChild("circle4"));
  14334. this.circle5 = (this.getChild("circle5"));
  14335. this.circle6 = (this.getChild("circle6"));
  14336. this.n28 = (this.getChild("n28"));
  14337. }
  14338. }
  14339. ui_border.URL = "ui://isxx5ak7sdh33qq";
  14340. class ui_Component41_2 extends fgui.GComponent {
  14341. static createInstance() {
  14342. return (fgui.UIPackage.createObject("game", "Component41_2"));
  14343. }
  14344. onConstruct() {
  14345. this.c1 = this.getController("c1");
  14346. this.n0 = (this.getChild("n0"));
  14347. this.n2 = (this.getChild("n2"));
  14348. this.n19 = (this.getChild("n19"));
  14349. this.cancelBtn = (this.getChild("cancelBtn"));
  14350. this.videoBtn = (this.getChild("videoBtn"));
  14351. this.n9 = (this.getChild("n9"));
  14352. this.n22 = (this.getChild("n22"));
  14353. this.tipsTxt = (this.getChild("tipsTxt"));
  14354. this.n23 = (this.getChild("n23"));
  14355. this.n24 = (this.getChild("n24"));
  14356. this.n26 = (this.getChild("n26"));
  14357. this.n27 = (this.getChild("n27"));
  14358. this.titleTxt = (this.getChild("titleTxt"));
  14359. }
  14360. }
  14361. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  14362. class ui_Component41_1 extends fgui.GComponent {
  14363. static createInstance() {
  14364. return (fgui.UIPackage.createObject("game", "Component41_1"));
  14365. }
  14366. onConstruct() {
  14367. this.c1 = this.getController("c1");
  14368. this.n0 = (this.getChild("n0"));
  14369. this.n2 = (this.getChild("n2"));
  14370. this.cancelBtn = (this.getChild("cancelBtn"));
  14371. this.videoBtn = (this.getChild("videoBtn"));
  14372. this.n27 = (this.getChild("n27"));
  14373. this.n30 = (this.getChild("n30"));
  14374. this.n31 = (this.getChild("n31"));
  14375. this.n32 = (this.getChild("n32"));
  14376. this.n33 = (this.getChild("n33"));
  14377. this.n34 = (this.getChild("n34"));
  14378. this.n35 = (this.getChild("n35"));
  14379. this.n36 = (this.getChild("n36"));
  14380. this.n1 = (this.getChild("n1"));
  14381. this.n37 = (this.getChild("n37"));
  14382. this.t0 = this.getTransition("t0");
  14383. this.t1 = this.getTransition("t1");
  14384. this.t2 = this.getTransition("t2");
  14385. this.t3 = this.getTransition("t3");
  14386. }
  14387. }
  14388. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  14389. class ui_againBtn extends fgui.GButton {
  14390. static createInstance() {
  14391. return (fgui.UIPackage.createObject("game", "againBtn"));
  14392. }
  14393. onConstruct() {
  14394. this.n2 = (this.getChild("n2"));
  14395. this.n1 = (this.getChild("n1"));
  14396. this.n5 = (this.getChild("n5"));
  14397. }
  14398. }
  14399. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  14400. class ui_Component118 extends fgui.GButton {
  14401. static createInstance() {
  14402. return (fgui.UIPackage.createObject("game", "Component118"));
  14403. }
  14404. onConstruct() {
  14405. this.c1 = this.getController("c1");
  14406. this.n14 = (this.getChild("n14"));
  14407. this.n9 = (this.getChild("n9"));
  14408. this.n10 = (this.getChild("n10"));
  14409. this.diamondTxt = (this.getChild("diamondTxt"));
  14410. this.n13 = (this.getChild("n13"));
  14411. this.n15 = (this.getChild("n15"));
  14412. }
  14413. }
  14414. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  14415. class ui_Component119 extends fgui.GComponent {
  14416. static createInstance() {
  14417. return (fgui.UIPackage.createObject("game", "Component119"));
  14418. }
  14419. onConstruct() {
  14420. this.n1 = (this.getChild("n1"));
  14421. this.n2 = (this.getChild("n2"));
  14422. this.n13 = (this.getChild("n13"));
  14423. this.n6 = (this.getChild("n6"));
  14424. this.screenNode = (this.getChild("screenNode"));
  14425. this.n15 = (this.getChild("n15"));
  14426. this.closeBtn = (this.getChild("closeBtn"));
  14427. this.share2Btn = (this.getChild("share2Btn"));
  14428. this.shareBtn = (this.getChild("shareBtn"));
  14429. this.tipsNode = (this.getChild("tipsNode"));
  14430. this.awardNode = (this.getChild("awardNode"));
  14431. }
  14432. }
  14433. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  14434. class ui_Component132_1 extends fgui.GComponent {
  14435. static createInstance() {
  14436. return (fgui.UIPackage.createObject("game", "Component132_1"));
  14437. }
  14438. onConstruct() {
  14439. this.n25 = (this.getChild("n25"));
  14440. this.n26 = (this.getChild("n26"));
  14441. this.n27 = (this.getChild("n27"));
  14442. this.t0 = this.getTransition("t0");
  14443. }
  14444. }
  14445. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  14446. class ui_SecretaryDisplay extends fgui.GComponent {
  14447. static createInstance() {
  14448. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  14449. }
  14450. onConstruct() {
  14451. this.n2 = (this.getChild("n2"));
  14452. this.levelTxt = (this.getChild("levelTxt"));
  14453. this.n4 = (this.getChild("n4"));
  14454. this.secretary = (this.getChild("secretary"));
  14455. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14456. this.n16 = (this.getChild("n16"));
  14457. this.n37 = (this.getChild("n37"));
  14458. this.n41 = (this.getChild("n41"));
  14459. this.n14 = (this.getChild("n14"));
  14460. this.n17 = (this.getChild("n17"));
  14461. this.heightTxt = (this.getChild("heightTxt"));
  14462. this.n46 = (this.getChild("n46"));
  14463. this.n36 = (this.getChild("n36"));
  14464. this.n38 = (this.getChild("n38"));
  14465. this.foodTxt = (this.getChild("foodTxt"));
  14466. this.n47 = (this.getChild("n47"));
  14467. this.n40 = (this.getChild("n40"));
  14468. this.n42 = (this.getChild("n42"));
  14469. this.historyTxt = (this.getChild("historyTxt"));
  14470. this.n48 = (this.getChild("n48"));
  14471. this.nameImg = (this.getChild("nameImg"));
  14472. this.n12 = (this.getChild("n12"));
  14473. this.n49 = (this.getChild("n49"));
  14474. this.t0 = this.getTransition("t0");
  14475. }
  14476. }
  14477. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14478. class ui_BallRodDisplay extends fgui.GComponent {
  14479. static createInstance() {
  14480. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14481. }
  14482. onConstruct() {
  14483. this.c1 = this.getController("c1");
  14484. this.n31 = (this.getChild("n31"));
  14485. this.n6 = (this.getChild("n6"));
  14486. this.nameTxt = (this.getChild("nameTxt"));
  14487. this.rodImg = (this.getChild("rodImg"));
  14488. this.levelNode = (this.getChild("levelNode"));
  14489. this.eftRod = (this.getChild("eftRod"));
  14490. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14491. }
  14492. }
  14493. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14494. class ui_Component111_11 extends fgui.GComponent {
  14495. static createInstance() {
  14496. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14497. }
  14498. onConstruct() {
  14499. this.n68 = (this.getChild("n68"));
  14500. this.n69 = (this.getChild("n69"));
  14501. }
  14502. }
  14503. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14504. class ui_Component112 extends fgui.GComponent {
  14505. static createInstance() {
  14506. return (fgui.UIPackage.createObject("game", "Component112"));
  14507. }
  14508. onConstruct() {
  14509. this.n68 = (this.getChild("n68"));
  14510. this.n70 = (this.getChild("n70"));
  14511. this.myMask = (this.getChild("myMask"));
  14512. }
  14513. }
  14514. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14515. class ui_Component111 extends fgui.GComponent {
  14516. static createInstance() {
  14517. return (fgui.UIPackage.createObject("game", "Component111"));
  14518. }
  14519. onConstruct() {
  14520. this.n68 = (this.getChild("n68"));
  14521. this.myMask = (this.getChild("myMask"));
  14522. }
  14523. }
  14524. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14525. class ui_Component144 extends fgui.GButton {
  14526. static createInstance() {
  14527. return (fgui.UIPackage.createObject("game", "Component144"));
  14528. }
  14529. onConstruct() {
  14530. this.n8 = (this.getChild("n8"));
  14531. }
  14532. }
  14533. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14534. class ui_Sign_com2 extends fgui.GComponent {
  14535. static createInstance() {
  14536. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14537. }
  14538. onConstruct() {
  14539. this.n0 = (this.getChild("n0"));
  14540. this.n1 = (this.getChild("n1"));
  14541. this.t0 = this.getTransition("t0");
  14542. }
  14543. }
  14544. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14545. class ui_Sign_guang extends fgui.GComponent {
  14546. static createInstance() {
  14547. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14548. }
  14549. onConstruct() {
  14550. this.n1 = (this.getChild("n1"));
  14551. this.n2 = (this.getChild("n2"));
  14552. this.n3 = (this.getChild("n3"));
  14553. this.n4 = (this.getChild("n4"));
  14554. this.n5 = (this.getChild("n5"));
  14555. this.n6 = (this.getChild("n6"));
  14556. this.n8 = (this.getChild("n8"));
  14557. }
  14558. }
  14559. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14560. class ui_SignMax extends fgui.GComponent {
  14561. static createInstance() {
  14562. return (fgui.UIPackage.createObject("game", "SignMax"));
  14563. }
  14564. onConstruct() {
  14565. this.c1 = this.getController("c1");
  14566. this.n7 = (this.getChild("n7"));
  14567. this.n15 = (this.getChild("n15"));
  14568. this.n8 = (this.getChild("n8"));
  14569. this.titleTxt = (this.getChild("titleTxt"));
  14570. this.myIcon1 = (this.getChild("myIcon1"));
  14571. this.numTxt1 = (this.getChild("numTxt1"));
  14572. this.myIcon2 = (this.getChild("myIcon2"));
  14573. this.n20 = (this.getChild("n20"));
  14574. this.n17 = (this.getChild("n17"));
  14575. this.numTxt2 = (this.getChild("numTxt2"));
  14576. this.n12 = (this.getChild("n12"));
  14577. this.n13 = (this.getChild("n13"));
  14578. this.n21 = (this.getChild("n21"));
  14579. this.n14 = (this.getChild("n14"));
  14580. }
  14581. }
  14582. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14583. class ui_Sign_com2_1 extends fgui.GComponent {
  14584. static createInstance() {
  14585. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14586. }
  14587. onConstruct() {
  14588. this.n0 = (this.getChild("n0"));
  14589. this.n1 = (this.getChild("n1"));
  14590. this.t0 = this.getTransition("t0");
  14591. }
  14592. }
  14593. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14594. class ui_Sign_com5 extends fgui.GComponent {
  14595. static createInstance() {
  14596. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14597. }
  14598. onConstruct() {
  14599. this.n3 = (this.getChild("n3"));
  14600. this.n29 = (this.getChild("n29"));
  14601. this.n4 = (this.getChild("n4"));
  14602. this.day1 = (this.getChild("day1"));
  14603. this.day2 = (this.getChild("day2"));
  14604. this.day3 = (this.getChild("day3"));
  14605. this.day4 = (this.getChild("day4"));
  14606. this.day5 = (this.getChild("day5"));
  14607. this.day6 = (this.getChild("day6"));
  14608. this.day7 = (this.getChild("day7"));
  14609. this.t0 = this.getTransition("t0");
  14610. }
  14611. }
  14612. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  14613. class ui_Sign_com8 extends fgui.GComponent {
  14614. static createInstance() {
  14615. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  14616. }
  14617. onConstruct() {
  14618. this.n48 = (this.getChild("n48"));
  14619. this.womanTxt = (this.getChild("womanTxt"));
  14620. this.t0 = this.getTransition("t0");
  14621. }
  14622. }
  14623. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  14624. class ui_Sign_com6 extends fgui.GComponent {
  14625. static createInstance() {
  14626. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  14627. }
  14628. onConstruct() {
  14629. this.n2 = (this.getChild("n2"));
  14630. this.n3 = (this.getChild("n3"));
  14631. this.t0 = this.getTransition("t0");
  14632. }
  14633. }
  14634. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  14635. class ui_Sign_com7 extends fgui.GComponent {
  14636. static createInstance() {
  14637. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  14638. }
  14639. onConstruct() {
  14640. this.n29 = (this.getChild("n29"));
  14641. this.n2 = (this.getChild("n2"));
  14642. }
  14643. }
  14644. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  14645. class ui_UITurntable_com1_2 extends fgui.GComponent {
  14646. static createInstance() {
  14647. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  14648. }
  14649. onConstruct() {
  14650. this.n5 = (this.getChild("n5"));
  14651. this.n4 = (this.getChild("n4"));
  14652. this.t0 = this.getTransition("t0");
  14653. }
  14654. }
  14655. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  14656. class ui_UITurntable_com2 extends fgui.GComponent {
  14657. static createInstance() {
  14658. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  14659. }
  14660. onConstruct() {
  14661. this.c1 = this.getController("c1");
  14662. this.n4 = (this.getChild("n4"));
  14663. this.n6 = (this.getChild("n6"));
  14664. this.n10 = (this.getChild("n10"));
  14665. this.n11 = (this.getChild("n11"));
  14666. this.n12 = (this.getChild("n12"));
  14667. this.n13 = (this.getChild("n13"));
  14668. this.n14 = (this.getChild("n14"));
  14669. this.n15 = (this.getChild("n15"));
  14670. this.n16 = (this.getChild("n16"));
  14671. this.n17 = (this.getChild("n17"));
  14672. this.n18 = (this.getChild("n18"));
  14673. this.n19 = (this.getChild("n19"));
  14674. this.n20 = (this.getChild("n20"));
  14675. this.n21 = (this.getChild("n21"));
  14676. this.n22 = (this.getChild("n22"));
  14677. this.n23 = (this.getChild("n23"));
  14678. this.n24 = (this.getChild("n24"));
  14679. this.n25 = (this.getChild("n25"));
  14680. this.n26 = (this.getChild("n26"));
  14681. this.n27 = (this.getChild("n27"));
  14682. this.n28 = (this.getChild("n28"));
  14683. this.n29 = (this.getChild("n29"));
  14684. this.n30 = (this.getChild("n30"));
  14685. this.n31 = (this.getChild("n31"));
  14686. this.n32 = (this.getChild("n32"));
  14687. this.n33 = (this.getChild("n33"));
  14688. }
  14689. }
  14690. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  14691. class ui_UITurntable_com1_1 extends fgui.GComponent {
  14692. static createInstance() {
  14693. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  14694. }
  14695. onConstruct() {
  14696. this.n5 = (this.getChild("n5"));
  14697. this.n4 = (this.getChild("n4"));
  14698. this.t0 = this.getTransition("t0");
  14699. }
  14700. }
  14701. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  14702. class ui_UITurntable_com5 extends fgui.GComponent {
  14703. static createInstance() {
  14704. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  14705. }
  14706. onConstruct() {
  14707. this.flashNode = (this.getChild("flashNode"));
  14708. this.rotNode = (this.getChild("rotNode"));
  14709. this.n3 = (this.getChild("n3"));
  14710. this.n21 = (this.getChild("n21"));
  14711. this.t0 = this.getTransition("t0");
  14712. }
  14713. }
  14714. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14715. class ui_UITurntable_com7 extends fgui.GComponent {
  14716. static createInstance() {
  14717. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14718. }
  14719. onConstruct() {
  14720. this.n2 = (this.getChild("n2"));
  14721. this.n35 = (this.getChild("n35"));
  14722. this.img1 = (this.getChild("img1"));
  14723. this.img2 = (this.getChild("img2"));
  14724. this.img3 = (this.getChild("img3"));
  14725. this.img4 = (this.getChild("img4"));
  14726. this.img6 = (this.getChild("img6"));
  14727. this.img5 = (this.getChild("img5"));
  14728. this.txt1 = (this.getChild("txt1"));
  14729. this.txt2 = (this.getChild("txt2"));
  14730. this.txt3 = (this.getChild("txt3"));
  14731. this.txt4 = (this.getChild("txt4"));
  14732. this.txt5 = (this.getChild("txt5"));
  14733. this.txt6 = (this.getChild("txt6"));
  14734. }
  14735. }
  14736. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14737. class ui_UITurntable_com9 extends fgui.GComponent {
  14738. static createInstance() {
  14739. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14740. }
  14741. onConstruct() {
  14742. this.n38 = (this.getChild("n38"));
  14743. this.n39 = (this.getChild("n39"));
  14744. }
  14745. }
  14746. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14747. class ui_UITurntable_com10 extends fgui.GComponent {
  14748. static createInstance() {
  14749. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14750. }
  14751. onConstruct() {
  14752. this.n39 = (this.getChild("n39"));
  14753. this.n40 = (this.getChild("n40"));
  14754. this.t0 = this.getTransition("t0");
  14755. }
  14756. }
  14757. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14758. class ui_UITurntable_com11 extends fgui.GComponent {
  14759. static createInstance() {
  14760. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14761. }
  14762. onConstruct() {
  14763. this.n38 = (this.getChild("n38"));
  14764. this.n39 = (this.getChild("n39"));
  14765. this.n40 = (this.getChild("n40"));
  14766. this.t0 = this.getTransition("t0");
  14767. }
  14768. }
  14769. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14770. class ui_UITurntable_com12 extends fgui.GComponent {
  14771. static createInstance() {
  14772. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14773. }
  14774. onConstruct() {
  14775. this.n43 = (this.getChild("n43"));
  14776. this.barNode = (this.getChild("barNode"));
  14777. this.tipsTxt = (this.getChild("tipsTxt"));
  14778. this.n45 = (this.getChild("n45"));
  14779. this.boxBtn = (this.getChild("boxBtn"));
  14780. }
  14781. }
  14782. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14783. class ui_UITurntable_com1 extends fgui.GButton {
  14784. static createInstance() {
  14785. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14786. }
  14787. onConstruct() {
  14788. this.n41 = (this.getChild("n41"));
  14789. this.n42 = (this.getChild("n42"));
  14790. this.t0 = this.getTransition("t0");
  14791. }
  14792. }
  14793. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14794. class ui_UITurntable_com3 extends fgui.GComponent {
  14795. static createInstance() {
  14796. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14797. }
  14798. onConstruct() {
  14799. this.n48 = (this.getChild("n48"));
  14800. this.womanTxt = (this.getChild("womanTxt"));
  14801. this.t0 = this.getTransition("t0");
  14802. }
  14803. }
  14804. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14805. class ui_cancelBtn2 extends fgui.GButton {
  14806. static createInstance() {
  14807. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14808. }
  14809. onConstruct() {
  14810. this.c1 = this.getController("c1");
  14811. this.n0 = (this.getChild("n0"));
  14812. this.n1 = (this.getChild("n1"));
  14813. this.n2 = (this.getChild("n2"));
  14814. this.n3 = (this.getChild("n3"));
  14815. this.n4 = (this.getChild("n4"));
  14816. this.n5 = (this.getChild("n5"));
  14817. this.n6 = (this.getChild("n6"));
  14818. this.n7 = (this.getChild("n7"));
  14819. this.n8 = (this.getChild("n8"));
  14820. this.powerEft = (this.getChild("powerEft"));
  14821. }
  14822. }
  14823. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14824. class ui_shareBtn2 extends fgui.GButton {
  14825. static createInstance() {
  14826. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14827. }
  14828. onConstruct() {
  14829. this.c1 = this.getController("c1");
  14830. this.n2 = (this.getChild("n2"));
  14831. this.n24 = (this.getChild("n24"));
  14832. this.n1 = (this.getChild("n1"));
  14833. this.n3 = (this.getChild("n3"));
  14834. this.n23 = (this.getChild("n23"));
  14835. this.n4 = (this.getChild("n4"));
  14836. this.n5 = (this.getChild("n5"));
  14837. this.n6 = (this.getChild("n6"));
  14838. this.n20 = (this.getChild("n20"));
  14839. this.n21 = (this.getChild("n21"));
  14840. this.n22 = (this.getChild("n22"));
  14841. this.powerEft = (this.getChild("powerEft"));
  14842. }
  14843. }
  14844. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14845. class ui_UIMoney extends fgui.GComponent {
  14846. static createInstance() {
  14847. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14848. }
  14849. onConstruct() {
  14850. this.c1 = this.getController("c1");
  14851. this.n4 = (this.getChild("n4"));
  14852. this.coinImg = (this.getChild("coinImg"));
  14853. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14854. this.coinTxt = (this.getChild("coinTxt"));
  14855. this.n7 = (this.getChild("n7"));
  14856. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14857. this.diamondTxt = (this.getChild("diamondTxt"));
  14858. this.diamondImg = (this.getChild("diamondImg"));
  14859. this.n12 = (this.getChild("n12"));
  14860. this.powerImg = (this.getChild("powerImg"));
  14861. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14862. this.powerTxt = (this.getChild("powerTxt"));
  14863. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14864. }
  14865. }
  14866. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14867. class ui_backBtn extends fgui.GButton {
  14868. static createInstance() {
  14869. return (fgui.UIPackage.createObject("game", "backBtn"));
  14870. }
  14871. onConstruct() {
  14872. this.n0 = (this.getChild("n0"));
  14873. this.t0 = this.getTransition("t0");
  14874. this.t1 = this.getTransition("t1");
  14875. }
  14876. }
  14877. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14878. class ui_MoneyBtn extends fgui.GButton {
  14879. static createInstance() {
  14880. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14881. }
  14882. onConstruct() {
  14883. this.button = this.getController("button");
  14884. this.n0 = (this.getChild("n0"));
  14885. }
  14886. }
  14887. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14888. class ui_UIMoneyBtn extends fgui.GComponent {
  14889. static createInstance() {
  14890. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14891. }
  14892. onConstruct() {
  14893. this.n1 = (this.getChild("n1"));
  14894. this.closeBtn = (this.getChild("closeBtn"));
  14895. }
  14896. }
  14897. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14898. class ui_Component64 extends fgui.GComponent {
  14899. static createInstance() {
  14900. return (fgui.UIPackage.createObject("game", "Component64"));
  14901. }
  14902. onConstruct() {
  14903. this.n57 = (this.getChild("n57"));
  14904. this.n54 = (this.getChild("n54"));
  14905. this.n55 = (this.getChild("n55"));
  14906. this.n56 = (this.getChild("n56"));
  14907. this.t1 = this.getTransition("t1");
  14908. }
  14909. }
  14910. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14911. class ui_Component41_3 extends fgui.GComponent {
  14912. static createInstance() {
  14913. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14914. }
  14915. onConstruct() {
  14916. this.c1 = this.getController("c1");
  14917. this.n0 = (this.getChild("n0"));
  14918. this.n2 = (this.getChild("n2"));
  14919. this.cancelBtn = (this.getChild("cancelBtn"));
  14920. this.videoBtn = (this.getChild("videoBtn"));
  14921. this.n9 = (this.getChild("n9"));
  14922. this.n24 = (this.getChild("n24"));
  14923. this.n27 = (this.getChild("n27"));
  14924. this.titleTxt = (this.getChild("titleTxt"));
  14925. this.n28 = (this.getChild("n28"));
  14926. this.t0 = this.getTransition("t0");
  14927. }
  14928. }
  14929. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14930. class ui_dh_zs_4 extends fgui.GComponent {
  14931. static createInstance() {
  14932. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14933. }
  14934. onConstruct() {
  14935. this.n1 = (this.getChild("n1"));
  14936. this.n2 = (this.getChild("n2"));
  14937. this.n3 = (this.getChild("n3"));
  14938. this.n4 = (this.getChild("n4"));
  14939. this.n5 = (this.getChild("n5"));
  14940. this.n6 = (this.getChild("n6"));
  14941. this.n8 = (this.getChild("n8"));
  14942. this.t0 = this.getTransition("t0");
  14943. }
  14944. }
  14945. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14946. class ui_Component71_1 extends fgui.GButton {
  14947. static createInstance() {
  14948. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14949. }
  14950. onConstruct() {
  14951. this.n17 = (this.getChild("n17"));
  14952. this.t0 = this.getTransition("t0");
  14953. }
  14954. }
  14955. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14956. class ui_Component83 extends fgui.GComponent {
  14957. static createInstance() {
  14958. return (fgui.UIPackage.createObject("game", "Component83"));
  14959. }
  14960. onConstruct() {
  14961. this.c1 = this.getController("c1");
  14962. this.n17 = (this.getChild("n17"));
  14963. this.n19 = (this.getChild("n19"));
  14964. this.n20 = (this.getChild("n20"));
  14965. }
  14966. }
  14967. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14968. class ui_Component84 extends fgui.GComponent {
  14969. static createInstance() {
  14970. return (fgui.UIPackage.createObject("game", "Component84"));
  14971. }
  14972. onConstruct() {
  14973. this.c1 = this.getController("c1");
  14974. this.n4 = (this.getChild("n4"));
  14975. this.n22 = (this.getChild("n22"));
  14976. this.n23 = (this.getChild("n23"));
  14977. this.numTxt = (this.getChild("numTxt"));
  14978. this.n25 = (this.getChild("n25"));
  14979. this.n26 = (this.getChild("n26"));
  14980. }
  14981. }
  14982. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14983. class ui_Component84_1 extends fgui.GComponent {
  14984. static createInstance() {
  14985. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14986. }
  14987. onConstruct() {
  14988. this.c1 = this.getController("c1");
  14989. this.n4 = (this.getChild("n4"));
  14990. this.n22 = (this.getChild("n22"));
  14991. this.n23 = (this.getChild("n23"));
  14992. this.numTxt = (this.getChild("numTxt"));
  14993. this.n25 = (this.getChild("n25"));
  14994. this.n26 = (this.getChild("n26"));
  14995. }
  14996. }
  14997. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14998. class ui_Component85 extends fgui.GComponent {
  14999. static createInstance() {
  15000. return (fgui.UIPackage.createObject("game", "Component85"));
  15001. }
  15002. onConstruct() {
  15003. this.n1 = (this.getChild("n1"));
  15004. this.n6 = (this.getChild("n6"));
  15005. this.n2 = (this.getChild("n2"));
  15006. this.n3 = (this.getChild("n3"));
  15007. this.levelTxt = (this.getChild("levelTxt"));
  15008. this.n10 = (this.getChild("n10"));
  15009. this.n11 = (this.getChild("n11"));
  15010. this.n12 = (this.getChild("n12"));
  15011. this.n13 = (this.getChild("n13"));
  15012. this.n14 = (this.getChild("n14"));
  15013. this.modeNode = (this.getChild("modeNode"));
  15014. this.n18 = (this.getChild("n18"));
  15015. this.conditionTxt = (this.getChild("conditionTxt"));
  15016. this.diamondNode = (this.getChild("diamondNode"));
  15017. this.coinNode = (this.getChild("coinNode"));
  15018. this.startBtn = (this.getChild("startBtn"));
  15019. this.n28 = (this.getChild("n28"));
  15020. this.displayRoot = (this.getChild("displayRoot"));
  15021. this.t0 = this.getTransition("t0");
  15022. }
  15023. }
  15024. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  15025. class ui_Component86 extends fgui.GButton {
  15026. static createInstance() {
  15027. return (fgui.UIPackage.createObject("game", "Component86"));
  15028. }
  15029. onConstruct() {
  15030. this.n15 = (this.getChild("n15"));
  15031. this.t0 = this.getTransition("t0");
  15032. }
  15033. }
  15034. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  15035. class ui_Component87 extends fgui.GComponent {
  15036. static createInstance() {
  15037. return (fgui.UIPackage.createObject("game", "Component87"));
  15038. }
  15039. onConstruct() {
  15040. this.n66 = (this.getChild("n66"));
  15041. this.myProgress = (this.getChild("myProgress"));
  15042. this.starAni = (this.getChild("starAni"));
  15043. this.hpTxt = (this.getChild("hpTxt"));
  15044. this.n74 = (this.getChild("n74"));
  15045. this.n73 = (this.getChild("n73"));
  15046. this.ballTxt = (this.getChild("ballTxt"));
  15047. this.n76 = (this.getChild("n76"));
  15048. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15049. this.levelTxt = (this.getChild("levelTxt"));
  15050. this.star1 = (this.getChild("star1"));
  15051. this.star2 = (this.getChild("star2"));
  15052. this.star3 = (this.getChild("star3"));
  15053. }
  15054. }
  15055. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  15056. class ui_Component88 extends fgui.GProgressBar {
  15057. static createInstance() {
  15058. return (fgui.UIPackage.createObject("game", "Component88"));
  15059. }
  15060. onConstruct() {
  15061. this.n68 = (this.getChild("n68"));
  15062. this.bar = (this.getChild("bar"));
  15063. }
  15064. }
  15065. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  15066. class ui_Component89 extends fgui.GComponent {
  15067. static createInstance() {
  15068. return (fgui.UIPackage.createObject("game", "Component89"));
  15069. }
  15070. onConstruct() {
  15071. this.c1 = this.getController("c1");
  15072. this.n71 = (this.getChild("n71"));
  15073. this.n72 = (this.getChild("n72"));
  15074. }
  15075. }
  15076. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  15077. class ui_Component90 extends fgui.GComponent {
  15078. static createInstance() {
  15079. return (fgui.UIPackage.createObject("game", "Component90"));
  15080. }
  15081. onConstruct() {
  15082. this.c1 = this.getController("c1");
  15083. this.n64 = (this.getChild("n64"));
  15084. this.n65 = (this.getChild("n65"));
  15085. this.n66 = (this.getChild("n66"));
  15086. this.t0 = this.getTransition("t0");
  15087. }
  15088. }
  15089. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  15090. class ui_Component127 extends fgui.GButton {
  15091. static createInstance() {
  15092. return (fgui.UIPackage.createObject("game", "Component127"));
  15093. }
  15094. onConstruct() {
  15095. this.n5 = (this.getChild("n5"));
  15096. }
  15097. }
  15098. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  15099. class gameBinder {
  15100. static bindAll() {
  15101. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  15102. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  15103. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  15104. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  15105. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  15106. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  15107. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  15108. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  15109. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  15110. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  15111. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  15112. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  15113. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  15114. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  15115. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  15116. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  15117. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  15118. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  15119. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  15120. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  15121. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  15122. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  15123. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  15124. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  15125. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  15126. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  15127. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  15128. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  15129. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  15130. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  15131. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  15132. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  15133. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  15134. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  15135. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  15136. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  15137. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  15138. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  15139. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  15140. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  15141. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  15142. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  15143. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  15144. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  15145. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  15146. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  15147. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  15148. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  15149. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  15150. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  15151. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  15152. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  15153. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  15154. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  15155. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  15156. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  15157. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  15158. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  15159. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  15160. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  15161. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  15162. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  15163. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  15164. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  15165. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  15166. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  15167. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  15168. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  15169. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  15170. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  15171. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  15172. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  15173. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  15174. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  15175. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  15176. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  15177. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  15178. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  15179. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  15180. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  15181. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  15182. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  15183. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  15184. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  15185. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  15186. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  15187. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  15188. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  15189. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  15190. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  15191. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  15192. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  15193. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  15194. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  15195. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  15196. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  15197. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  15198. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  15199. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  15200. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  15201. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  15202. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  15203. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  15204. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  15205. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  15206. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  15207. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  15208. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  15209. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  15210. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  15211. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  15212. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  15213. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  15214. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  15215. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  15216. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  15217. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  15218. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  15219. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  15220. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  15221. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  15222. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  15223. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  15224. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  15225. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  15226. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  15227. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  15228. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  15229. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  15230. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  15231. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  15232. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  15233. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  15234. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  15235. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  15236. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  15237. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  15238. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  15239. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  15240. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  15241. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  15242. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  15243. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  15244. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  15245. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  15246. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  15247. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  15248. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  15249. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  15250. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  15251. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  15252. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  15253. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  15254. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  15255. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  15256. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  15257. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  15258. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  15259. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  15260. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  15261. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  15262. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  15263. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  15264. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  15265. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  15266. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  15267. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  15268. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  15269. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  15270. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  15271. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  15272. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  15273. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  15274. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  15275. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  15276. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  15277. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  15278. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  15279. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  15280. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  15281. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  15282. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  15283. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  15284. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  15285. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  15286. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  15287. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  15288. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  15289. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  15290. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  15291. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  15292. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  15293. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  15294. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  15295. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  15296. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  15297. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  15298. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  15299. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  15300. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  15301. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  15302. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  15303. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  15304. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  15305. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  15306. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  15307. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  15308. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  15309. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  15310. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  15311. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  15312. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  15313. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  15314. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  15315. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  15316. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  15317. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  15318. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  15319. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  15320. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  15321. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  15322. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  15323. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  15324. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  15325. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  15326. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  15327. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  15328. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  15329. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  15330. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  15331. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  15332. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  15333. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  15334. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  15335. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  15336. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  15337. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  15338. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  15339. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  15340. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  15341. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  15342. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  15343. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  15344. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  15345. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  15346. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  15347. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  15348. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  15349. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  15350. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  15351. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  15352. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  15353. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  15354. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  15355. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  15356. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  15357. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  15358. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  15359. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  15360. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  15361. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  15362. }
  15363. }
  15364. class ui_btn6 extends fgui.GButton {
  15365. static createInstance() {
  15366. return (fgui.UIPackage.createObject("loading", "btn6"));
  15367. }
  15368. onConstruct() {
  15369. this.n6 = (this.getChild("n6"));
  15370. this.n1 = (this.getChild("n1"));
  15371. }
  15372. }
  15373. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  15374. class ui_xyItem extends fgui.GComponent {
  15375. static createInstance() {
  15376. return (fgui.UIPackage.createObject("loading", "xyItem"));
  15377. }
  15378. onConstruct() {
  15379. this.xyItem = (this.getChild("xyItem"));
  15380. }
  15381. }
  15382. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  15383. class ui_loadinfo extends fgui.GProgressBar {
  15384. static createInstance() {
  15385. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  15386. }
  15387. onConstruct() {
  15388. this.bg = (this.getChild("bg"));
  15389. this.bar = (this.getChild("bar"));
  15390. this.title = (this.getChild("title"));
  15391. this.ani = (this.getChild("ani"));
  15392. }
  15393. }
  15394. ui_loadinfo.URL = "ui://37nctnhwis36c";
  15395. class ui_xyNode extends fgui.GComponent {
  15396. static createInstance() {
  15397. return (fgui.UIPackage.createObject("loading", "xyNode"));
  15398. }
  15399. onConstruct() {
  15400. this.n0 = (this.getChild("n0"));
  15401. this.btnYes = (this.getChild("btnYes"));
  15402. this.btnNo = (this.getChild("btnNo"));
  15403. this.btnKnown = (this.getChild("btnKnown"));
  15404. this.btnSure = (this.getChild("btnSure"));
  15405. this.txtWelcom = (this.getChild("txtWelcom"));
  15406. this.txtXy = (this.getChild("txtXy"));
  15407. this.n75 = (this.getChild("n75"));
  15408. this.btnXy1 = (this.getChild("btnXy1"));
  15409. this.btnXy3 = (this.getChild("btnXy3"));
  15410. this.btnXy2 = (this.getChild("btnXy2"));
  15411. this.n74 = (this.getChild("n74"));
  15412. this.xy1 = (this.getChild("xy1"));
  15413. this.txtTitle = (this.getChild("txtTitle"));
  15414. this.btnBack = (this.getChild("btnBack"));
  15415. this.xyList = (this.getChild("xyList"));
  15416. this.xy2 = (this.getChild("xy2"));
  15417. this.xyNode = (this.getChild("xyNode"));
  15418. }
  15419. }
  15420. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  15421. class ui_ageNode extends fgui.GComponent {
  15422. static createInstance() {
  15423. return (fgui.UIPackage.createObject("loading", "ageNode"));
  15424. }
  15425. onConstruct() {
  15426. this.n3 = (this.getChild("n3"));
  15427. this.n7 = (this.getChild("n7"));
  15428. this.n4 = (this.getChild("n4"));
  15429. this.btnAge = (this.getChild("btnAge"));
  15430. this.ageNode = (this.getChild("ageNode"));
  15431. }
  15432. }
  15433. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  15434. class ui_rnNode extends fgui.GComponent {
  15435. static createInstance() {
  15436. return (fgui.UIPackage.createObject("loading", "rnNode"));
  15437. }
  15438. onConstruct() {
  15439. this.n28 = (this.getChild("n28"));
  15440. this.n30 = (this.getChild("n30"));
  15441. this.n33 = (this.getChild("n33"));
  15442. this.rn1 = (this.getChild("rn1"));
  15443. this.n40 = (this.getChild("n40"));
  15444. this.n41 = (this.getChild("n41"));
  15445. this.rn3 = (this.getChild("rn3"));
  15446. this.n37 = (this.getChild("n37"));
  15447. this.n39 = (this.getChild("n39"));
  15448. this.rn2 = (this.getChild("rn2"));
  15449. this.n47 = (this.getChild("n47"));
  15450. this.n49 = (this.getChild("n49"));
  15451. this.n44 = (this.getChild("n44"));
  15452. this.inputCode = (this.getChild("inputCode"));
  15453. this.inputName = (this.getChild("inputName"));
  15454. this.n48 = (this.getChild("n48"));
  15455. this.n50 = (this.getChild("n50"));
  15456. this.rn4 = (this.getChild("rn4"));
  15457. this.btnCheck = (this.getChild("btnCheck"));
  15458. this.btnExit = (this.getChild("btnExit"));
  15459. this.btnDone = (this.getChild("btnDone"));
  15460. this.rnNode = (this.getChild("rnNode"));
  15461. }
  15462. }
  15463. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  15464. class ui_tipNode extends fgui.GComponent {
  15465. static createInstance() {
  15466. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15467. }
  15468. onConstruct() {
  15469. this.bg = (this.getChild("bg"));
  15470. this.n55 = (this.getChild("n55"));
  15471. this.n56 = (this.getChild("n56"));
  15472. this.tipNode = (this.getChild("tipNode"));
  15473. }
  15474. }
  15475. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15476. class ui_fcmNode extends fgui.GComponent {
  15477. static createInstance() {
  15478. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15479. }
  15480. onConstruct() {
  15481. this.n63 = (this.getChild("n63"));
  15482. this.n62 = (this.getChild("n62"));
  15483. this.btnRn = (this.getChild("btnRn"));
  15484. this.n61 = (this.getChild("n61"));
  15485. this.n58 = (this.getChild("n58"));
  15486. this.fcmNode = (this.getChild("fcmNode"));
  15487. }
  15488. }
  15489. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15490. class ui_msgNode extends fgui.GComponent {
  15491. static createInstance() {
  15492. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15493. }
  15494. onConstruct() {
  15495. this.n69 = (this.getChild("n69"));
  15496. this.txtMsg = (this.getChild("txtMsg"));
  15497. this.msgNode = (this.getChild("msgNode"));
  15498. }
  15499. }
  15500. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15501. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15502. static createInstance() {
  15503. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15504. }
  15505. onConstruct() {
  15506. this.n1 = (this.getChild("n1"));
  15507. this.n13 = (this.getChild("n13"));
  15508. this.n14 = (this.getChild("n14"));
  15509. this.n15 = (this.getChild("n15"));
  15510. this.n3 = (this.getChild("n3"));
  15511. this.n4 = (this.getChild("n4"));
  15512. this.n5 = (this.getChild("n5"));
  15513. this.n6 = (this.getChild("n6"));
  15514. this.n7 = (this.getChild("n7"));
  15515. this.n8 = (this.getChild("n8"));
  15516. this.n9 = (this.getChild("n9"));
  15517. this.n10 = (this.getChild("n10"));
  15518. this.n12 = (this.getChild("n12"));
  15519. this.n11 = (this.getChild("n11"));
  15520. this.n16 = (this.getChild("n16"));
  15521. this.n17 = (this.getChild("n17"));
  15522. this.n18 = (this.getChild("n18"));
  15523. this.n20 = (this.getChild("n20"));
  15524. this.n21 = (this.getChild("n21"));
  15525. this.t0 = this.getTransition("t0");
  15526. }
  15527. }
  15528. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15529. class ui_btn5 extends fgui.GButton {
  15530. static createInstance() {
  15531. return (fgui.UIPackage.createObject("loading", "btn5"));
  15532. }
  15533. onConstruct() {
  15534. this.n9 = (this.getChild("n9"));
  15535. this.n1 = (this.getChild("n1"));
  15536. }
  15537. }
  15538. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15539. class ui_UILoading extends fgui.GComponent {
  15540. static createInstance() {
  15541. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15542. }
  15543. onConstruct() {
  15544. this.n12 = (this.getChild("n12"));
  15545. this.loadinfo = (this.getChild("loadinfo"));
  15546. this.n13 = (this.getChild("n13"));
  15547. this.txtLoad = (this.getChild("txtLoad"));
  15548. this.n18 = (this.getChild("n18"));
  15549. }
  15550. }
  15551. ui_UILoading.URL = "ui://37nctnhwphc33";
  15552. class ui_AgeItem extends fgui.GComponent {
  15553. static createInstance() {
  15554. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15555. }
  15556. onConstruct() {
  15557. this.txtAge = (this.getChild("txtAge"));
  15558. }
  15559. }
  15560. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15561. class ui_btn1 extends fgui.GButton {
  15562. static createInstance() {
  15563. return (fgui.UIPackage.createObject("loading", "btn1"));
  15564. }
  15565. onConstruct() {
  15566. this.n6 = (this.getChild("n6"));
  15567. this.n1 = (this.getChild("n1"));
  15568. }
  15569. }
  15570. ui_btn1.URL = "ui://37nctnhwxe622p";
  15571. class ui_btn3 extends fgui.GButton {
  15572. static createInstance() {
  15573. return (fgui.UIPackage.createObject("loading", "btn3"));
  15574. }
  15575. onConstruct() {
  15576. this.n9 = (this.getChild("n9"));
  15577. this.n1 = (this.getChild("n1"));
  15578. }
  15579. }
  15580. ui_btn3.URL = "ui://37nctnhwxe622s";
  15581. class ui_btn2 extends fgui.GButton {
  15582. static createInstance() {
  15583. return (fgui.UIPackage.createObject("loading", "btn2"));
  15584. }
  15585. onConstruct() {
  15586. this.n6 = (this.getChild("n6"));
  15587. this.n1 = (this.getChild("n1"));
  15588. }
  15589. }
  15590. ui_btn2.URL = "ui://37nctnhwxe622t";
  15591. class ui_btnBack extends fgui.GButton {
  15592. static createInstance() {
  15593. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15594. }
  15595. onConstruct() {
  15596. this.n6 = (this.getChild("n6"));
  15597. this.n7 = (this.getChild("n7"));
  15598. }
  15599. }
  15600. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15601. class ui_btnXy1 extends fgui.GButton {
  15602. static createInstance() {
  15603. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15604. }
  15605. onConstruct() {
  15606. this.n1 = (this.getChild("n1"));
  15607. }
  15608. }
  15609. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15610. class ui_btnXy2 extends fgui.GButton {
  15611. static createInstance() {
  15612. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15613. }
  15614. onConstruct() {
  15615. this.n1 = (this.getChild("n1"));
  15616. }
  15617. }
  15618. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  15619. class ui_btnXy3 extends fgui.GButton {
  15620. static createInstance() {
  15621. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15622. }
  15623. onConstruct() {
  15624. this.n1 = (this.getChild("n1"));
  15625. }
  15626. }
  15627. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15628. class ui_btn4 extends fgui.GButton {
  15629. static createInstance() {
  15630. return (fgui.UIPackage.createObject("loading", "btn4"));
  15631. }
  15632. onConstruct() {
  15633. this.n9 = (this.getChild("n9"));
  15634. this.n1 = (this.getChild("n1"));
  15635. }
  15636. }
  15637. ui_btn4.URL = "ui://37nctnhwxe622z";
  15638. class loadingBinder {
  15639. static bindAll() {
  15640. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15641. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15642. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15643. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15644. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15645. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15646. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15647. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15648. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15649. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15650. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15651. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15652. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15653. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15654. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15655. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15656. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15657. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15658. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15659. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15660. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15661. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15662. }
  15663. }
  15664. class UIMgr {
  15665. constructor() {
  15666. this._stage = null;
  15667. this._uiList = [];
  15668. this._showList = [];
  15669. this._bindPkgList = [];
  15670. this.uiIndex = 0;
  15671. }
  15672. static get inst() {
  15673. if (UIMgr._inst == null) {
  15674. UIMgr._inst = new UIMgr();
  15675. }
  15676. return UIMgr._inst;
  15677. }
  15678. setStage(s) {
  15679. if (this._stage) {
  15680. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15681. return;
  15682. }
  15683. this._stage = s;
  15684. }
  15685. clearTempData() {
  15686. console.log('zh:clearTempData start');
  15687. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  15688. console.log('zh:clearTempData end');
  15689. }
  15690. init() {
  15691. this.setStage(Laya.stage);
  15692. fairygui.UIConfig.defaultFont = "微软雅黑";
  15693. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15694. fairygui.UIConfig.packageFileExtension = "obj";
  15695. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15696. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15697. fairygui.GRoot.inst.width = Laya.stage.width;
  15698. fairygui.GRoot.inst.height = Laya.stage.height;
  15699. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15700. }
  15701. addAllUpdate() {
  15702. this.uiIndex = 0;
  15703. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15704. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15705. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15706. }
  15707. }
  15708. }
  15709. bindFUI(pkgname) {
  15710. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15711. return;
  15712. }
  15713. switch (pkgname) {
  15714. case fguiRes.loading:
  15715. fairygui.UIPackage.addPackage(pkgname);
  15716. loadingBinder.bindAll();
  15717. this._bindPkgList.push(pkgname);
  15718. break;
  15719. case fguiRes.game:
  15720. fairygui.UIPackage.addPackage(pkgname);
  15721. gameBinder.bindAll();
  15722. this._bindPkgList.push(pkgname);
  15723. break;
  15724. default:
  15725. break;
  15726. }
  15727. }
  15728. Show(cls, ...param) {
  15729. let nameStr = cls.uiName;
  15730. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15731. let temp = this._uiList[i];
  15732. let str = temp.className;
  15733. if (str == nameStr) {
  15734. if (temp.isMuti) {
  15735. if (temp.isHide) {
  15736. temp.show(...param);
  15737. this._uiList.splice(i, 1);
  15738. this._uiList.push(temp);
  15739. return temp;
  15740. }
  15741. }
  15742. else {
  15743. temp.show(...param);
  15744. this._uiList.splice(i, 1);
  15745. this._uiList.push(temp);
  15746. return temp;
  15747. }
  15748. }
  15749. }
  15750. let ui = new cls();
  15751. ui.className = nameStr;
  15752. this._showUI(ui, param);
  15753. return ui;
  15754. }
  15755. destroyUI(ui) {
  15756. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15757. let temp = this._uiList[i].className;
  15758. if (temp == ui.className) {
  15759. this._uiList.splice(i, 1);
  15760. break;
  15761. }
  15762. }
  15763. this.checkUIState();
  15764. }
  15765. _showUI(ui, param) {
  15766. this._uiList.push(ui);
  15767. ui.show(...param);
  15768. }
  15769. Hide(uiClass) {
  15770. let ui = this.getUI(uiClass);
  15771. if (ui && !ui.isHide) {
  15772. ui.hide();
  15773. }
  15774. }
  15775. getUI(ui) {
  15776. let nameStr = ui.uiName;
  15777. for (let index = 0; index < this._uiList.length; index++) {
  15778. let temp = this._uiList[index];
  15779. if (temp.className == nameStr) {
  15780. return temp;
  15781. }
  15782. }
  15783. return null;
  15784. }
  15785. isShow(cls) {
  15786. for (var i of this._uiList) {
  15787. if (i instanceof cls) {
  15788. return i.isShowing;
  15789. }
  15790. }
  15791. return false;
  15792. }
  15793. showUINum() {
  15794. let num = 0;
  15795. for (var i of this._uiList) {
  15796. if (i.isShowing) {
  15797. num++;
  15798. }
  15799. }
  15800. return num;
  15801. }
  15802. checkUIState() {
  15803. Laya.timer.clear(this, this._uiCheck);
  15804. Laya.timer.once(400, this, this._uiCheck);
  15805. }
  15806. _uiCheck() {
  15807. let showList = [];
  15808. for (var i of this._uiList) {
  15809. if (!i.isHide) {
  15810. showList.push(i);
  15811. }
  15812. }
  15813. for (let index = 0; index < showList.length; index++) {
  15814. if (index == showList.length - 1) {
  15815. showList[index].checkActive(true);
  15816. }
  15817. else {
  15818. showList[index].checkActive(false);
  15819. }
  15820. }
  15821. }
  15822. showTip(msg, time = 600, size = 30) {
  15823. }
  15824. }
  15825. class UIShowList {
  15826. }
  15827. class SoundMgr {
  15828. constructor() {
  15829. this.soundMax = 4;
  15830. this.isLoad = false;
  15831. this.soundMap = {};
  15832. this.isSound = true;
  15833. this.openShake = true;
  15834. SoundMgr._instance = this;
  15835. }
  15836. static getInstance() {
  15837. if (!this._instance) {
  15838. this._instance = new SoundMgr();
  15839. }
  15840. return this._instance;
  15841. }
  15842. init() {
  15843. console.log('zh:sm init 1');
  15844. Laya.SoundManager.autoReleaseSound = true;
  15845. Laya.SoundManager.autoStopMusic = true;
  15846. Laya.SoundManager.musicVolume = 0.3;
  15847. Laya.SoundManager.soundVolume = 0.5;
  15848. this.musicPlayed = false;
  15849. this.audioUrl = "asset/sound/ogg/";
  15850. console.log('zh:sm init 2');
  15851. console.log('zh:dev type ');
  15852. if (Laya.Browser.onAndroid) {
  15853. console.log('zh:dev type android');
  15854. this.audioUrl = "asset/sound/ogg/";
  15855. this.isLoad = true;
  15856. }
  15857. else {
  15858. console.log('zh:dev type not android');
  15859. this.audioUrl = "asset/sound/mp3/";
  15860. this.isLoad = true;
  15861. }
  15862. }
  15863. onSetting(isS) {
  15864. this.isSound = isS;
  15865. this.mute(!this.isSound);
  15866. }
  15867. clearCount() {
  15868. for (var key in this.soundMap) {
  15869. delete this.soundMap[key];
  15870. }
  15871. }
  15872. playMusic(path, loop = 0) {
  15873. console.log('zh:playMusic 1 PATH=' + path);
  15874. this.musicPath = path;
  15875. if (!this.isLoad) {
  15876. return;
  15877. }
  15878. if (!path || path == "") {
  15879. return;
  15880. }
  15881. if (!this.isSound) {
  15882. return;
  15883. }
  15884. this.musicPlayed = true;
  15885. let url = this.getUrl(path);
  15886. if (!Laya.Browser.onAndroid) {
  15887. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15888. this.play(url, loop);
  15889. }));
  15890. }
  15891. else {
  15892. this.play(url, loop);
  15893. }
  15894. }
  15895. play(url, loop) {
  15896. Laya.SoundManager.playMusic(url, loop);
  15897. }
  15898. getUrl(path) {
  15899. let url = this.audioUrl + path;
  15900. if (Laya.Browser.onAndroid) {
  15901. url += ".ogg";
  15902. }
  15903. else {
  15904. url += ".mp3";
  15905. }
  15906. return url;
  15907. }
  15908. pauseMusic(pause) {
  15909. if (pause) {
  15910. this.mute(true);
  15911. }
  15912. else if (this.isSound)
  15913. this.mute(false);
  15914. }
  15915. stopMusic() {
  15916. Laya.SoundManager.stopMusic();
  15917. if (Moyu.isNeedPlatAudio) {
  15918. Moyu.stopMusic();
  15919. }
  15920. }
  15921. mute(mute) {
  15922. if (Moyu.isNeedPlatAudio) {
  15923. Moyu.pauseMusic(mute);
  15924. }
  15925. else {
  15926. Laya.SoundManager.musicMuted = mute;
  15927. if (!mute && !this.musicPlayed && this.musicPath) {
  15928. this.playMusic(this.musicPath);
  15929. }
  15930. }
  15931. }
  15932. stopSound(path) {
  15933. let url = this.getUrl(path);
  15934. Laya.SoundManager.stopSound(url);
  15935. }
  15936. playSound(path, loop = 1, soundMax = this.soundMax) {
  15937. if (!this.isLoad)
  15938. return;
  15939. if (!this.isSound)
  15940. return;
  15941. if (!path || path == "")
  15942. return;
  15943. let url = this.getUrl(path);
  15944. if (Moyu.isNeedPlatAudio) {
  15945. Moyu.playSound(path, loop == 0);
  15946. }
  15947. else {
  15948. let count = 1;
  15949. if (this.soundMap[path])
  15950. count = this.soundMap[path] + 1;
  15951. if (count > soundMax)
  15952. return;
  15953. this.soundMap[path] = count;
  15954. Laya.SoundManager.playSound(url, loop);
  15955. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15956. }
  15957. }
  15958. removePath(path) {
  15959. if (this.soundMap[path]) {
  15960. let count = this.soundMap[path];
  15961. count--;
  15962. if (count < 1)
  15963. delete this.soundMap[path];
  15964. else
  15965. this.soundMap[path] = count;
  15966. }
  15967. }
  15968. playBtnSound() {
  15969. this.playSound("btn");
  15970. }
  15971. playGetSound() {
  15972. }
  15973. playCloseUISound() {
  15974. }
  15975. }
  15976. SoundMgr._instance = null;
  15977. var Handler$1 = Laya.Handler;
  15978. var EResType;
  15979. (function (EResType) {
  15980. EResType[EResType["none"] = 0] = "none";
  15981. EResType[EResType["nromal"] = 1] = "nromal";
  15982. EResType[EResType["td"] = 2] = "td";
  15983. EResType[EResType["sk"] = 3] = "sk";
  15984. })(EResType || (EResType = {}));
  15985. class CResLoader {
  15986. constructor(doneCall, proCall) {
  15987. this.completrCall = doneCall;
  15988. this.progressCall = proCall;
  15989. this.progressHander = new Handler$1(this, this.onProgress);
  15990. this.tdResMap = {};
  15991. }
  15992. load(resList) {
  15993. this.resCount = 0;
  15994. this.loadCount = 0;
  15995. for (let i = 0; i < resList.length; i++) {
  15996. let path = resList[i];
  15997. if (!path)
  15998. continue;
  15999. this.resCount++;
  16000. let type = this.getResType(path);
  16001. if (type == EResType.nromal)
  16002. this.loadNromal(path);
  16003. else if (type == EResType.td)
  16004. this.loadTd(path);
  16005. }
  16006. }
  16007. getRes(path) {
  16008. let type = this.getResType(path);
  16009. if (type == EResType.nromal)
  16010. return Laya.loader.getRes(path);
  16011. else if (type == EResType.td) {
  16012. let res = this.tdResMap[path];
  16013. if (res)
  16014. return res.clone();
  16015. return null;
  16016. }
  16017. }
  16018. destroy() {
  16019. this.progressHander.clear();
  16020. this.progressHander = null;
  16021. }
  16022. clearRes(path) {
  16023. let type = this.getResType(path);
  16024. if (type == EResType.nromal)
  16025. Laya.loader.clearRes(path);
  16026. else if (type == EResType.td) {
  16027. let obj = this.tdResMap[path];
  16028. if (obj)
  16029. obj.destroy();
  16030. delete this.tdResMap[path];
  16031. }
  16032. }
  16033. getResType(path) {
  16034. let exs = this.getExtension(path);
  16035. if (exs == "sk")
  16036. return EResType.sk;
  16037. if (exs == "ls" || exs == "lh" || exs == "lm")
  16038. return EResType.td;
  16039. else
  16040. return EResType.nromal;
  16041. }
  16042. getExtension(res) {
  16043. var index = res.lastIndexOf(".");
  16044. return res.substr(index + 1);
  16045. }
  16046. loadNromal(path) {
  16047. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  16048. if (res) {
  16049. this.onLoad();
  16050. }
  16051. else
  16052. console.log("load res fail:" + path);
  16053. }), this.progressHander);
  16054. }
  16055. loadSk() {
  16056. }
  16057. loadTd(path) {
  16058. if (this.tdResMap[path]) {
  16059. this.onLoad();
  16060. return;
  16061. }
  16062. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  16063. if (res) {
  16064. this.tdResMap[path] = res;
  16065. this.onLoad();
  16066. }
  16067. else
  16068. console.log("load res fail:" + path);
  16069. }));
  16070. }
  16071. onLoad() {
  16072. this.loadCount++;
  16073. this.onProgress(1);
  16074. if (this.loadCount >= this.resCount) {
  16075. this.completrCall.run();
  16076. }
  16077. }
  16078. onProgress(pro) {
  16079. let progress = (this.loadCount + pro) / this.resCount;
  16080. this.progressCall.runWith(progress);
  16081. }
  16082. }
  16083. var Handler$2 = Laya.Handler;
  16084. class ResInfo {
  16085. constructor() {
  16086. this.index = 0;
  16087. }
  16088. }
  16089. class ResMgr {
  16090. constructor() {
  16091. this.resList = [];
  16092. this.doneList = [];
  16093. this.resMap = {};
  16094. this.currentLoad = null;
  16095. this.completeHandler = new Handler$2(this, this.onComplete);
  16096. this.progressHandler = new Handler$2(this, this.onProgress);
  16097. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  16098. }
  16099. static getInstance() {
  16100. if (ResMgr._instance == null) {
  16101. ResMgr._instance = new ResMgr();
  16102. }
  16103. return ResMgr._instance;
  16104. }
  16105. loadList(list, completeHandler, progressHandler) {
  16106. if (list.length < 1) {
  16107. completeHandler.run();
  16108. return;
  16109. }
  16110. let info = this.getResInfo();
  16111. info.resList = list;
  16112. info.completeHandler = completeHandler;
  16113. info.progressHandler = progressHandler;
  16114. this.resList.push(info);
  16115. this.startLoad();
  16116. }
  16117. loadFguiRes(list, completeHandler, progressHandler) {
  16118. Laya.loader.load(list, completeHandler, progressHandler);
  16119. }
  16120. loadAny(list, completeHandler, progressHandler) {
  16121. Laya.loader.load(list, completeHandler, progressHandler);
  16122. }
  16123. load(path, completeHandler, progressHandler) {
  16124. let count = this.resMap[path];
  16125. if (count && count > 0) {
  16126. if (completeHandler)
  16127. completeHandler.run();
  16128. }
  16129. else
  16130. this.loadList([path], completeHandler, progressHandler);
  16131. }
  16132. getRes(path) {
  16133. let res = this.resMap[path];
  16134. if (!res)
  16135. this.showLog("资源不存在:" + path);
  16136. else
  16137. return this.loader.getRes(path);
  16138. }
  16139. clearList(list, force = false) {
  16140. if (!list || list.length < 1)
  16141. return;
  16142. let cr = () => {
  16143. for (const k in list) {
  16144. let v = list[k];
  16145. if (!v)
  16146. continue;
  16147. if (force) {
  16148. this.loader.clearRes(v);
  16149. delete this.resMap[v];
  16150. }
  16151. else {
  16152. let count = this.resMap[v];
  16153. if (count && count > 1) {
  16154. count--;
  16155. this.resMap[v] = count;
  16156. }
  16157. else {
  16158. this.loader.clearRes(v);
  16159. delete this.resMap[v];
  16160. }
  16161. }
  16162. }
  16163. if (!window.hasOwnProperty("ks"))
  16164. Laya.Resource.destroyUnusedResources();
  16165. };
  16166. Laya.timer.clearAll(this);
  16167. Laya.timer.once(2000, this, cr);
  16168. }
  16169. clear3D() {
  16170. for (const k in this.loader.tdResMap) {
  16171. this.loader.clearRes(k);
  16172. if (this.resMap[k])
  16173. delete this.resMap[k];
  16174. }
  16175. if (!window.hasOwnProperty("ks"))
  16176. Laya.Resource.destroyUnusedResources();
  16177. }
  16178. clear(path, force = false) {
  16179. this.clearList([path], force);
  16180. }
  16181. getResInfo() {
  16182. if (this.doneList.length > 0)
  16183. return this.doneList.pop();
  16184. else
  16185. return new ResInfo();
  16186. }
  16187. startLoad() {
  16188. if (this.currentLoad)
  16189. return;
  16190. this.currentLoad = this.resList.pop();
  16191. if (this.currentLoad) {
  16192. this.loader.load(this.currentLoad.resList);
  16193. }
  16194. }
  16195. onComplete() {
  16196. if (!this.currentLoad)
  16197. return;
  16198. for (const k in this.currentLoad.resList) {
  16199. let v = this.currentLoad.resList[k];
  16200. let count = this.resMap[v];
  16201. if (count)
  16202. count++;
  16203. else
  16204. count = 1;
  16205. this.resMap[v] = count;
  16206. }
  16207. if (this.currentLoad.completeHandler)
  16208. this.currentLoad.completeHandler.run();
  16209. this.doneList.push(this.currentLoad);
  16210. this.currentLoad = null;
  16211. this.startLoad();
  16212. }
  16213. onProgress(pro) {
  16214. if (!this.currentLoad)
  16215. return;
  16216. if (this.currentLoad.progressHandler)
  16217. this.currentLoad.progressHandler.runWith(pro);
  16218. }
  16219. showLog(str, ...args) {
  16220. console.log("[ResLoader] " + str);
  16221. }
  16222. }
  16223. ResMgr._instance = null;
  16224. class EventMgr extends Laya.EventDispatcher {
  16225. }
  16226. let eventMgr = new EventMgr();
  16227. class ConfigMgr {
  16228. static getInstance() {
  16229. if (!this._instance) {
  16230. this._instance = new ConfigMgr();
  16231. }
  16232. return this._instance;
  16233. }
  16234. init() {
  16235. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  16236. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  16237. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  16238. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  16239. }
  16240. getUserInfoByIndex(index) {
  16241. return this.npcJson[index];
  16242. }
  16243. getRandomUserInfo() {
  16244. let index = xGame.tools.random(0, this.npcJson.length);
  16245. return this.npcJson[index];
  16246. }
  16247. getMaxBigMoveLength() {
  16248. return Object.keys(this.levelCfg).length;
  16249. }
  16250. getBigMoveLevelByIndex(index) {
  16251. let cfg = this.levelCfg;
  16252. cfg = cfg[index];
  16253. return cfg;
  16254. }
  16255. getRandomClassicLevel() {
  16256. let cfg = this.classicCfg;
  16257. let num = Object.keys(cfg).length;
  16258. let rand = xGame.common.randomNum(1, num);
  16259. return cfg[rand];
  16260. }
  16261. getPlaceBallByLevel(level) {
  16262. return this.placeBallCfg[level];
  16263. }
  16264. getMaxPlaceBall() {
  16265. return Object.keys(this.placeBallCfg).length;
  16266. }
  16267. }
  16268. class PoolD3Mgr {
  16269. constructor() {
  16270. this.pool = {};
  16271. }
  16272. static get ins() {
  16273. return this._ins || (this._ins = new PoolD3Mgr);
  16274. }
  16275. createList(key, prefab, parent) {
  16276. if (!this.pool[key]) {
  16277. this.pool[key] = {};
  16278. this.pool[key].prefab = prefab;
  16279. this.pool[key].list = [];
  16280. this.pool[key].parent = parent;
  16281. }
  16282. }
  16283. getItem(key) {
  16284. if (!this.pool[key]) {
  16285. return;
  16286. }
  16287. let temp;
  16288. if (this.pool[key].list.length > 0) {
  16289. temp = this.pool[key].list.pop();
  16290. }
  16291. else {
  16292. temp = this.pool[key].prefab.clone();
  16293. if (this.pool[key].parent) {
  16294. this.pool[key].parent.addChild(temp);
  16295. }
  16296. }
  16297. temp.active = true;
  16298. return temp;
  16299. }
  16300. putItem(key, obj) {
  16301. if (!this.pool[key]) {
  16302. return;
  16303. }
  16304. obj.active = false;
  16305. this.pool[key].list.push(obj);
  16306. }
  16307. }
  16308. let context$1 = context;
  16309. let uiMgr = UIMgr.inst;
  16310. let soundMgr = SoundMgr.getInstance();
  16311. let resMgr = ResMgr.getInstance();
  16312. let httpMgr = HttpMgr.getInstance();
  16313. let common = Common.getInstance();
  16314. let cfgMgr = ConfigMgr.getInstance();
  16315. let poolD3Mgr = PoolD3Mgr.ins;
  16316. let d3TexUrl = "res/d3Res/";
  16317. let d3ModeUrl = "res/unityRes/";
  16318. function setStageSize(view) {
  16319. if (view.width) {
  16320. view.width = Laya.stage.width;
  16321. view.height = Laya.stage.height;
  16322. }
  16323. }
  16324. function filledBg(view) {
  16325. let wh = Laya.stage.height / Laya.stage.width;
  16326. if (wh > 16 / 9) {
  16327. view.height = Laya.stage.height;
  16328. view.width = Laya.stage.height / 1334 * 750;
  16329. }
  16330. else {
  16331. view.width = Laya.stage.width;
  16332. view.height = Laya.stage.width / 750 * 1334;
  16333. }
  16334. }
  16335. function setNotch(view) {
  16336. if (view.height) {
  16337. view.y += context$1.notchHeight;
  16338. }
  16339. }
  16340. function showTip(str) {
  16341. uiMgr.Show(UIMsg, str);
  16342. }
  16343. function log(...args) {
  16344. console.log(args);
  16345. }
  16346. let xGame = {
  16347. context: context$1,
  16348. eventMgr,
  16349. resMgr,
  16350. uiMgr,
  16351. soundMgr,
  16352. define,
  16353. tools,
  16354. httpMgr,
  16355. d3TexUrl,
  16356. d3ModeUrl,
  16357. common,
  16358. cfgMgr,
  16359. poolD3Mgr,
  16360. setStageSize,
  16361. filledBg,
  16362. setNotch,
  16363. showTip,
  16364. log,
  16365. };
  16366. window["xGame"] = xGame;
  16367. let dataName = 'tBall_';
  16368. class UserData {
  16369. constructor() {
  16370. this.userId = "";
  16371. this.isAgree = false;
  16372. this.coinNum = 0;
  16373. this.gemNum = 0;
  16374. this.sound = true;
  16375. this.vibration = true;
  16376. this.currentDate = 0;
  16377. this.createTime = 0;
  16378. this.awardTime = 0;
  16379. this.roleId = 1;
  16380. this.roleList = [];
  16381. this.roleAds = [];
  16382. this.dressId = 101;
  16383. this.itemId = 201;
  16384. this.bigSkills = [1, 1, 1, 1, 1];
  16385. this.coin = 4000;
  16386. this.diamond = 0;
  16387. this.skillSuccessTimes = 0;
  16388. this.skillGuide = 0;
  16389. this.skillAccTimes = 0;
  16390. this.placeBallData = [];
  16391. this.shareDiamondTimes = 0;
  16392. this.dailyVideoShareTimes = 0;
  16393. this.secretary = [1, 0];
  16394. this.curSecretary = 0;
  16395. this.ballRod = [1, 0, 0, 0, 0, 1];
  16396. this.curBallRod = 5;
  16397. this.signData = 0;
  16398. this.signTime = 0;
  16399. this.drawTimes = 0;
  16400. this.drawAwardTimes = 0;
  16401. this.dailyfreeDrawTimes = 1;
  16402. this.power = 5;
  16403. this.powerTime = 0;
  16404. this.challengeTimes = 0;
  16405. this.extraSign = 0;
  16406. this.classicTimes = 0;
  16407. this.guideHelpLine = 0;
  16408. this.newUser = true;
  16409. this.rootBallFoul = 0;
  16410. this.timeoutFoul = 0;
  16411. this.roleList = [1];
  16412. }
  16413. saveData() {
  16414. let data = {};
  16415. for (let k in this) {
  16416. data[k.toString()] = this[k];
  16417. }
  16418. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  16419. }
  16420. getData() {
  16421. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  16422. if (ld) {
  16423. let localData = JSON.parse(ld);
  16424. if (localData) {
  16425. for (let k in this) {
  16426. let key = k.toString();
  16427. let data = localData[key];
  16428. if (data != undefined) {
  16429. this[k] = data;
  16430. }
  16431. }
  16432. }
  16433. }
  16434. }
  16435. }
  16436. class ItemData {
  16437. constructor() {
  16438. this.itemList = {};
  16439. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  16440. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  16441. }
  16442. saveData() {
  16443. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  16444. }
  16445. getData() {
  16446. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  16447. if (ld) {
  16448. let localData = JSON.parse(ld);
  16449. if (localData) {
  16450. this.itemList = localData;
  16451. }
  16452. }
  16453. }
  16454. }
  16455. class GameData {
  16456. constructor() {
  16457. this.curLevel = 0;
  16458. this.gameType = 1;
  16459. this.signIdx = 0;
  16460. this.signMax = 0;
  16461. this.rotaryTime = 0;
  16462. this.rotaryCount = 0;
  16463. this.rotaryList = [];
  16464. this.diyCount = 3;
  16465. this.awardIdx = 0;
  16466. this.shareNum = 2;
  16467. this.rankWeek = 0;
  16468. this.rankScore = 0;
  16469. this.gameCount = 0;
  16470. this.trySkill = -1;
  16471. this.tryTime = 0;
  16472. }
  16473. saveData() {
  16474. let data = {};
  16475. for (let k in this) {
  16476. data[k.toString()] = this[k];
  16477. }
  16478. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  16479. }
  16480. getData() {
  16481. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  16482. if (ld) {
  16483. let localData = JSON.parse(ld);
  16484. if (localData) {
  16485. for (let k in this) {
  16486. let key = k.toString();
  16487. let data = localData[key];
  16488. if (data != undefined) {
  16489. this[k] = data;
  16490. }
  16491. }
  16492. }
  16493. }
  16494. }
  16495. }
  16496. class Diy2025GameData {
  16497. constructor() {
  16498. this.challengeMode_overLev = 0;
  16499. this.xszyForClassic = false;
  16500. this.xszyForChallenge = false;
  16501. }
  16502. saveData() {
  16503. let data = {};
  16504. for (let k in this) {
  16505. data[k.toString()] = this[k];
  16506. }
  16507. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  16508. }
  16509. getData() {
  16510. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  16511. if (ld) {
  16512. let localData = JSON.parse(ld);
  16513. if (localData) {
  16514. for (let k in this) {
  16515. let key = k.toString();
  16516. let data = localData[key];
  16517. if (data != undefined) {
  16518. this[k] = data;
  16519. }
  16520. }
  16521. }
  16522. }
  16523. }
  16524. }
  16525. class DataMgr {
  16526. static Init() {
  16527. this.userData = new UserData();
  16528. this.gameData = new GameData();
  16529. this.itemData = new ItemData();
  16530. this.diyGameData = new Diy2025GameData();
  16531. this.userData.getData();
  16532. this.gameData.getData();
  16533. this.itemData.getData();
  16534. this.diyGameData.getData();
  16535. this.roleId = this.userData.roleId;
  16536. this.resetUse();
  16537. }
  16538. static isNewDay() {
  16539. Moyu.isNewDay(this, (isnew) => {
  16540. xGame.common.isNewDay = isnew;
  16541. if (!isnew)
  16542. return;
  16543. DataMgr.setShareDiamondTimes(0, false);
  16544. DataMgr.setDailyVideoShareTimes(0, false);
  16545. DataMgr.setDailyfreeDrawTimes(1);
  16546. DataMgr.setExtraSign(0);
  16547. });
  16548. }
  16549. static deletData() {
  16550. Laya.LocalStorage.clear();
  16551. }
  16552. static upRankData() {
  16553. let num = xGame.common.getAllStarNum();
  16554. if (num > 0)
  16555. Moyu.upRankData(xGame.common.curRankID, num);
  16556. }
  16557. static addItem(id, count = 1) {
  16558. let v = this.itemData.itemList[id];
  16559. if (!v)
  16560. v = { id: id, count: count, adnum: 0, active: true };
  16561. else {
  16562. if (v.active) {
  16563. v.count += count;
  16564. }
  16565. else {
  16566. v.count = count;
  16567. v.active = true;
  16568. }
  16569. }
  16570. this.itemData.itemList[id] = v;
  16571. xGame.soundMgr.playGetSound();
  16572. this.saveItemData();
  16573. }
  16574. static hasItem(id) {
  16575. let v = this.itemData.itemList[id];
  16576. if (v && v.active)
  16577. return true;
  16578. return false;
  16579. }
  16580. static getItem(id) {
  16581. let v = this.itemData.itemList[id];
  16582. return v;
  16583. }
  16584. static getItemCount(id) {
  16585. let v = this.itemData.itemList[id];
  16586. if (v && v.active)
  16587. return v.count;
  16588. return 0;
  16589. }
  16590. static getItemAd(id) {
  16591. let v = this.itemData.itemList[id];
  16592. if (v) {
  16593. return v.adnum;
  16594. }
  16595. return 0;
  16596. }
  16597. static onItemAd(id, num = 1) {
  16598. let v = this.itemData.itemList[id];
  16599. if (!v)
  16600. v = { id: id, count: 1, adnum: num, active: false };
  16601. else
  16602. v.adnum += num;
  16603. this.itemData.itemList[id] = v;
  16604. this.saveItemData();
  16605. }
  16606. static costItem(id, count) {
  16607. let v = this.itemData.itemList[id];
  16608. if (v && v.active) {
  16609. if (v.count < count)
  16610. return false;
  16611. else {
  16612. v.count -= count;
  16613. this.itemData.itemList[id] = v;
  16614. return true;
  16615. }
  16616. }
  16617. return false;
  16618. }
  16619. static resetUse() {
  16620. this.dressId = this.userData.dressId;
  16621. this.itemId = this.userData.itemId;
  16622. }
  16623. static passLevel() {
  16624. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  16625. this.gameData.curLevel++;
  16626. this.curLevel = this.gameData.curLevel;
  16627. this.saveGameData();
  16628. }
  16629. static useRole(id) {
  16630. this.roleId = id;
  16631. if (this.hasRole(id)) {
  16632. this.userData.roleId = id;
  16633. this.saveUserData();
  16634. }
  16635. }
  16636. static addRole(id) {
  16637. if (this.hasRole(id))
  16638. return;
  16639. this.userData.roleList.push(id);
  16640. this.saveUserData();
  16641. }
  16642. static hasRole(id) {
  16643. return this.userData.roleList.indexOf(id) >= 0;
  16644. }
  16645. static gemEnough(num) {
  16646. return this.userData.gemNum >= num;
  16647. }
  16648. static roleHasAd(id) {
  16649. let count = this.userData.roleAds[id];
  16650. if (count != undefined && count >= 0)
  16651. return true;
  16652. else
  16653. return false;
  16654. }
  16655. static saveUserData(time = 500, event, arg) {
  16656. if (this.userSaving)
  16657. return;
  16658. this.userSaving = true;
  16659. Laya.timer.once(time, this, () => {
  16660. this.userSaving = false;
  16661. this.userData.saveData();
  16662. if (event)
  16663. xGame.eventMgr.event(event, arg);
  16664. });
  16665. }
  16666. static saveGameData() {
  16667. if (this.gameSaving)
  16668. return;
  16669. this.gameSaving = true;
  16670. Laya.timer.once(1000, this, () => {
  16671. this.gameSaving = false;
  16672. this.gameData.saveData();
  16673. });
  16674. }
  16675. static saveItemData() {
  16676. let fun = () => {
  16677. this.itemData.saveData();
  16678. };
  16679. Laya.timer.clear(this, fun);
  16680. Laya.timer.once(500, this, fun);
  16681. }
  16682. static saveData() {
  16683. this.saveUserData();
  16684. this.saveGameData();
  16685. }
  16686. static getBigSkillList() {
  16687. return this.userData.bigSkills;
  16688. }
  16689. static getBigSkillByIndex(index) {
  16690. return this.userData.bigSkills[index];
  16691. }
  16692. static setBigSkill(index, val, addUp = true) {
  16693. if (addUp) {
  16694. this.userData.bigSkills[index] += val;
  16695. }
  16696. else {
  16697. this.userData.bigSkills[index] = val;
  16698. }
  16699. this.saveUserData();
  16700. }
  16701. static coinEnough(need) {
  16702. if (typeof need != "number") {
  16703. console.error("金币格式错误");
  16704. return;
  16705. }
  16706. return this.userData.coin >= need;
  16707. }
  16708. static setCoin(val) {
  16709. if (typeof val != "number") {
  16710. return;
  16711. }
  16712. this.userData.coin += val;
  16713. this.saveUserData();
  16714. xGame.eventMgr.event(COIN_CHANGE);
  16715. }
  16716. static getCoin() {
  16717. return this.userData.coin;
  16718. }
  16719. static diamondEnough(need) {
  16720. if (typeof need != "number") {
  16721. console.error("金币格式错误");
  16722. return;
  16723. }
  16724. return this.userData.diamond >= need;
  16725. }
  16726. static setDiamond(val) {
  16727. if (typeof val != "number") {
  16728. return;
  16729. }
  16730. this.userData.diamond += val;
  16731. this.saveUserData();
  16732. xGame.eventMgr.event(DIAMOND_CHANGE);
  16733. }
  16734. static getDiamond() {
  16735. return this.userData.diamond;
  16736. }
  16737. static getSkillSuccessTimes() {
  16738. return this.userData.skillSuccessTimes;
  16739. }
  16740. static setSkillSuccessTimes(val, addUp = true) {
  16741. if (addUp)
  16742. this.userData.skillSuccessTimes += val;
  16743. else
  16744. this.userData.skillSuccessTimes = val;
  16745. this.saveUserData();
  16746. }
  16747. static getSkillAccTimes() {
  16748. return this.userData.skillAccTimes;
  16749. }
  16750. static setSkillAccTimes(val) {
  16751. this.userData.skillAccTimes += val;
  16752. this.saveUserData();
  16753. }
  16754. static getSkillGuide() {
  16755. if (!xGame.common.openGuide) {
  16756. return 1;
  16757. }
  16758. return this.userData.skillGuide;
  16759. }
  16760. static setSkillGuide(val) {
  16761. this.userData.skillGuide = val;
  16762. this.saveUserData();
  16763. }
  16764. static getPlaceBallLevelList() {
  16765. return this.userData.placeBallData;
  16766. }
  16767. static getPlaceBallLevel(level) {
  16768. let arr = this.userData.placeBallData;
  16769. let index = level - 1;
  16770. let out;
  16771. if (arr[index]) {
  16772. out = arr[index];
  16773. }
  16774. else {
  16775. let max = arr.length;
  16776. if (max == index) {
  16777. out = {
  16778. star: 0,
  16779. play: true,
  16780. isCur: true,
  16781. getAward: false
  16782. };
  16783. }
  16784. else {
  16785. out = {
  16786. star: 0,
  16787. play: false,
  16788. getAward: false
  16789. };
  16790. }
  16791. }
  16792. return out;
  16793. }
  16794. static setPlaceBallLevel(level, star) {
  16795. let arr = this.userData.placeBallData;
  16796. let index = level - 1;
  16797. if (arr[index]) {
  16798. arr[index].star = Math.max(arr[index].star, star);
  16799. }
  16800. else {
  16801. let max = arr.length;
  16802. if (max == index) {
  16803. arr.push({
  16804. star: star,
  16805. play: true,
  16806. getAward: false
  16807. });
  16808. }
  16809. else {
  16810. console.error("关卡存储出错");
  16811. }
  16812. }
  16813. this.saveUserData();
  16814. }
  16815. static setPlaceBallAward(level) {
  16816. let arr = this.userData.placeBallData;
  16817. let index = level - 1;
  16818. if (arr[index]) {
  16819. arr[index].getAward = true;
  16820. }
  16821. this.saveUserData();
  16822. }
  16823. static getShareDiamondTimes() {
  16824. return this.userData.shareDiamondTimes;
  16825. }
  16826. static setShareDiamondTimes(val, addUp = true) {
  16827. if (addUp) {
  16828. this.userData.shareDiamondTimes += val;
  16829. }
  16830. else {
  16831. this.userData.shareDiamondTimes = val;
  16832. }
  16833. this.saveUserData();
  16834. }
  16835. static getDailyVideoShareTimes() {
  16836. return this.userData.dailyVideoShareTimes;
  16837. }
  16838. static setDailyVideoShareTimes(val, addUp = true) {
  16839. if (addUp) {
  16840. this.userData.dailyVideoShareTimes += val;
  16841. }
  16842. else {
  16843. this.userData.dailyVideoShareTimes = val;
  16844. }
  16845. this.saveUserData();
  16846. }
  16847. static getSecretary(index) {
  16848. return this.userData.secretary[index];
  16849. }
  16850. static setSecretary(index, val) {
  16851. this.userData.secretary[index] = val;
  16852. this.saveUserData();
  16853. }
  16854. static getCurSecretary() {
  16855. return this.userData.curSecretary;
  16856. }
  16857. static setCurSecretary(index) {
  16858. this.userData.curSecretary = index;
  16859. this.saveUserData();
  16860. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16861. }
  16862. static getBallRod(index) {
  16863. return this.userData.ballRod[index];
  16864. }
  16865. static setBallRod(index, val) {
  16866. this.userData.ballRod[index] = val;
  16867. this.saveUserData();
  16868. }
  16869. static getCurBallRod() {
  16870. return this.userData.curBallRod;
  16871. }
  16872. static setCurBallRod(index) {
  16873. this.userData.curBallRod = index;
  16874. this.saveUserData();
  16875. }
  16876. static setSignData(val) {
  16877. this.userData.signData = val;
  16878. this.saveUserData();
  16879. }
  16880. static getSignData() {
  16881. return this.userData.signData;
  16882. }
  16883. static setSignTime(val) {
  16884. this.userData.signTime = val;
  16885. this.saveUserData();
  16886. }
  16887. static getSignTime() {
  16888. return this.userData.signTime;
  16889. }
  16890. static getDrawTimes() {
  16891. return this.userData.drawTimes;
  16892. }
  16893. static setDrawTimes(val, addUp = true) {
  16894. if (addUp) {
  16895. this.userData.drawTimes += val;
  16896. }
  16897. else {
  16898. this.userData.drawTimes = val;
  16899. }
  16900. this.saveUserData();
  16901. }
  16902. static getDrawAwardTimes() {
  16903. return this.userData.drawAwardTimes;
  16904. }
  16905. static setDrawAwardTimes(val) {
  16906. this.userData.drawAwardTimes = val;
  16907. this.saveUserData();
  16908. }
  16909. static getDailyfreeDrawTimes() {
  16910. return this.userData.dailyfreeDrawTimes;
  16911. }
  16912. static setDailyfreeDrawTimes(val) {
  16913. this.userData.dailyfreeDrawTimes = val;
  16914. this.saveUserData();
  16915. }
  16916. static setPower(val, addUp = true) {
  16917. if (addUp)
  16918. this.userData.power += val;
  16919. else
  16920. this.userData.power = val;
  16921. if (this.userData.power >= xGame.common.maxPower) {
  16922. this.userData.power = xGame.common.maxPower;
  16923. }
  16924. xGame.eventMgr.event(POWER_CHANGE, val);
  16925. this.saveUserData();
  16926. }
  16927. static getPower() {
  16928. return this.userData.power;
  16929. }
  16930. static setPowerTime(val) {
  16931. this.userData.powerTime = val;
  16932. this.saveUserData();
  16933. }
  16934. static getPowerTime() {
  16935. return this.userData.powerTime;
  16936. }
  16937. static powerEnough() {
  16938. return this.getPower() > 0;
  16939. }
  16940. static getChallengeTimes() {
  16941. return this.userData.challengeTimes;
  16942. }
  16943. static setChallengeTimes(val) {
  16944. this.userData.challengeTimes += val;
  16945. this.saveUserData();
  16946. }
  16947. static getExtraSign() {
  16948. return this.userData.extraSign;
  16949. }
  16950. static setExtraSign(val) {
  16951. this.userData.extraSign = val;
  16952. this.saveUserData();
  16953. }
  16954. static getClassicTimes() {
  16955. return this.userData.classicTimes;
  16956. }
  16957. static setClassicTimes() {
  16958. this.userData.classicTimes += 1;
  16959. this.saveUserData();
  16960. }
  16961. static getGuideHelpLine() {
  16962. return this.userData.guideHelpLine;
  16963. }
  16964. static setGuideHelpLine() {
  16965. this.userData.guideHelpLine = 1;
  16966. this.saveUserData();
  16967. }
  16968. static getNewUser() {
  16969. return this.userData.newUser;
  16970. }
  16971. static setNewUser() {
  16972. this.userData.newUser = false;
  16973. this.saveUserData();
  16974. }
  16975. static getRootBallFoul() {
  16976. return this.userData.rootBallFoul;
  16977. }
  16978. static setRootBallFoul() {
  16979. this.userData.rootBallFoul = 1;
  16980. this.saveUserData();
  16981. }
  16982. static getTimeoutFoul() {
  16983. return this.userData.timeoutFoul;
  16984. }
  16985. static setTimeoutFoul() {
  16986. this.userData.timeoutFoul = 1;
  16987. this.saveUserData();
  16988. }
  16989. static saveDiyGameData() {
  16990. if (this.diyGameSaving)
  16991. return;
  16992. this.diyGameSaving = true;
  16993. Laya.timer.once(500, this, () => {
  16994. this.diyGameSaving = false;
  16995. this.diyGameData.saveData();
  16996. });
  16997. }
  16998. static getChallengeMode_overLev() {
  16999. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  17000. return this.challengeMode_overLev;
  17001. }
  17002. static setChallengeMode_overLev(levNum) {
  17003. this.diyGameData.challengeMode_overLev = levNum;
  17004. this.saveDiyGameData();
  17005. }
  17006. }
  17007. DataMgr.isNewUser = false;
  17008. DataMgr.fristEnter = true;
  17009. DataMgr.levelType = 0;
  17010. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  17011. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  17012. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  17013. DataMgr.challengeMode_overLev = 0;
  17014. DataMgr.xszyForClassic = false;
  17015. DataMgr.xszyForChallenge = false;
  17016. DataMgr.awardId = 0;
  17017. DataMgr.awardCoin = 0;
  17018. DataMgr.sceneId = -1;
  17019. DataMgr.tryId = 0;
  17020. DataMgr.curLevel = 1;
  17021. DataMgr.vipLevel = 0;
  17022. DataMgr.maxLevel = 0;
  17023. DataMgr.awardRatio = 1;
  17024. DataMgr.gameList = [];
  17025. DataMgr.rankList = [];
  17026. DataMgr.recoverTime = 480000;
  17027. DataMgr.minScore = 0;
  17028. DataMgr.rankDis = 0;
  17029. DataMgr.userSaving = false;
  17030. DataMgr.gameSaving = false;
  17031. DataMgr.diyGameSaving = false;
  17032. class D3Tween extends Laya.Script3D {
  17033. constructor() {
  17034. super();
  17035. this.isInited = false;
  17036. }
  17037. ;
  17038. init() {
  17039. if (this.isInited)
  17040. return;
  17041. this.isInited = true;
  17042. this.gameObj = this.owner;
  17043. this.transform = this.gameObj.transform;
  17044. }
  17045. get rotX() {
  17046. return this.transform.localRotationEulerX;
  17047. }
  17048. set rotX(v) {
  17049. this.transform.localRotationEulerX = v;
  17050. }
  17051. get rotY() {
  17052. return this.transform.localRotationEulerY;
  17053. }
  17054. set rotY(v) {
  17055. this.transform.localRotationEulerY = v;
  17056. }
  17057. get rotZ() {
  17058. return this.transform.localRotationEulerZ;
  17059. }
  17060. set rotZ(v) {
  17061. this.transform.localRotationEulerZ = v;
  17062. }
  17063. get posX() {
  17064. return this.transform.localPositionX;
  17065. }
  17066. set posX(v) {
  17067. this.transform.localPositionX = v;
  17068. }
  17069. get posY() {
  17070. return this.transform.localPositionY;
  17071. }
  17072. set posY(v) {
  17073. this.transform.localPositionY = v;
  17074. }
  17075. get posZ() {
  17076. return this.transform.localPositionZ;
  17077. }
  17078. set posZ(v) {
  17079. this.transform.localPositionZ = v;
  17080. }
  17081. get rotation() {
  17082. return this.transform.localRotation;
  17083. }
  17084. set rotation(v) {
  17085. this.transform.localRotation = v;
  17086. }
  17087. }
  17088. class D2Hole extends Laya.Script {
  17089. constructor() { super(); }
  17090. onTriggerEnter(collider) {
  17091. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  17092. return;
  17093. }
  17094. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  17095. if (collider.owner["mySrc"].isRunSkillAni) {
  17096. return;
  17097. }
  17098. if (collider.owner["mySrc"].number != 0) {
  17099. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  17100. }
  17101. xGame.common.ballColliHole(collider);
  17102. xGame.common.recoverCameraView();
  17103. }
  17104. }
  17105. }
  17106. class Table extends Laya.Script3D {
  17107. constructor() {
  17108. super();
  17109. this.isSetBorder = false;
  17110. this.inited = false;
  17111. }
  17112. ;
  17113. onAwake() {
  17114. this.init();
  17115. }
  17116. init() {
  17117. if (this.inited)
  17118. return;
  17119. this.inited = true;
  17120. this.gameObj = this.owner;
  17121. this.border = this.gameObj.getChildByName("border");
  17122. }
  17123. setBorderPos() {
  17124. if (this.isSetBorder)
  17125. return;
  17126. this.isSetBorder = true;
  17127. let ui = xGame.common.gameUI.ui;
  17128. let bar1 = this.border.getChildByName("bar1");
  17129. let bar2 = this.border.getChildByName("bar2");
  17130. let bar3 = this.border.getChildByName("bar3");
  17131. let bar4 = this.border.getChildByName("bar4");
  17132. let bar5 = this.border.getChildByName("bar5");
  17133. let bar6 = this.border.getChildByName("bar6");
  17134. this.setInfo(bar1, ui.border.bar1, "box");
  17135. this.setInfo(bar2, ui.border.bar2, "box");
  17136. this.setInfo(bar3, ui.border.bar3, "box");
  17137. this.setInfo(bar4, ui.border.bar4, "box");
  17138. this.setInfo(bar5, ui.border.bar5, "box");
  17139. this.setInfo(bar6, ui.border.bar6, "box");
  17140. let circle1 = this.border.getChildByName("circle1");
  17141. let circle2 = this.border.getChildByName("circle2");
  17142. let circle3 = this.border.getChildByName("circle3");
  17143. let circle4 = this.border.getChildByName("circle4");
  17144. let circle5 = this.border.getChildByName("circle5");
  17145. let circle6 = this.border.getChildByName("circle6");
  17146. this.setInfo(circle1, ui.border.circle1, "circle");
  17147. this.setInfo(circle2, ui.border.circle2, "circle");
  17148. this.setInfo(circle3, ui.border.circle3, "circle");
  17149. this.setInfo(circle4, ui.border.circle4, "circle");
  17150. this.setInfo(circle5, ui.border.circle5, "circle");
  17151. this.setInfo(circle6, ui.border.circle6, "circle");
  17152. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  17153. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  17154. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  17155. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  17156. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  17157. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  17158. let arr = xGame.common.gameMgr.holePosList;
  17159. xGame.common.gameMgr.posObj = {
  17160. "1": arr[0],
  17161. "3": arr[2],
  17162. "4": arr[3],
  17163. "6": arr[5]
  17164. };
  17165. }
  17166. initHolePos(x, y) {
  17167. if (x < 300)
  17168. x += 25;
  17169. else if (x > 1000)
  17170. x -= 25;
  17171. else if (y > 200)
  17172. y -= 10;
  17173. else
  17174. y += 10;
  17175. if (y < 200)
  17176. y += 30;
  17177. else if (y > 500)
  17178. y -= 30;
  17179. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  17180. }
  17181. setInfo(d3Obj, d2Obj, type) {
  17182. let ui = xGame.common.gameUI.ui;
  17183. let sprite = new Laya.Sprite();
  17184. ui.border.displayObject.addChild(sprite);
  17185. let colli = xGame.common.getCollider(type);
  17186. sprite.addComponentIntance(colli);
  17187. let rigy = xGame.common.getRigbody();
  17188. rigy.type = "static";
  17189. sprite.addComponentIntance(rigy);
  17190. let d3Pos = d3Obj.transform.position;
  17191. xGame.common.pos3to2Convert(d3Pos);
  17192. let scaleX = d3Obj.transform.localScaleX;
  17193. let scaleZ = d3Obj.transform.localScaleZ;
  17194. let width = xGame.common.scale3to2Convert(scaleZ);
  17195. let height = xGame.common.scale3to2Convert(scaleX);
  17196. sprite.pivotX = width / 2;
  17197. sprite.pivotY = height / 2;
  17198. sprite.x = d3Pos.x;
  17199. sprite.y = d3Pos.y;
  17200. sprite.width = width;
  17201. sprite.height = height;
  17202. d2Obj.x = d3Pos.x;
  17203. d2Obj.y = d3Pos.y;
  17204. d2Obj.width = width;
  17205. d2Obj.height = height;
  17206. if (type == "box") {
  17207. colli.width = width;
  17208. colli.height = height;
  17209. colli.isSensor = false;
  17210. colli.label = "border";
  17211. }
  17212. else {
  17213. colli.radius = width / 2;
  17214. colli.isSensor = true;
  17215. colli.label = "hole";
  17216. sprite.addComponent(D2Hole);
  17217. }
  17218. }
  17219. }
  17220. class D3World extends Laya.Script3D {
  17221. constructor() {
  17222. super();
  17223. this.loadNum = 0;
  17224. this.setLoadNum = 7;
  17225. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  17226. }
  17227. onAwake() {
  17228. }
  17229. loadScene() {
  17230. this.scene = this.owner;
  17231. let url = `res/unityRes/root.lh`;
  17232. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  17233. this.scene.addChild(prefab);
  17234. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  17235. this.putCameraInfo();
  17236. this.camera.enableHDR = false;
  17237. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  17238. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  17239. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  17240. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  17241. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  17242. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  17243. this.knife.active = false;
  17244. this.loadD3Obj();
  17245. }));
  17246. }
  17247. putCameraInfo() {
  17248. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  17249. this.cameraObj = new cameraType();
  17250. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  17251. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  17252. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  17253. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  17254. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  17255. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  17256. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  17257. this.visitAngleChild.init();
  17258. this.visitRootObj.posX = this.visitAngleChild.posX;
  17259. this.visitRootObj.posY = this.visitAngleChild.posY;
  17260. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  17261. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  17262. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  17263. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  17264. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  17265. xGame.common.showOneCamera("mainCamera");
  17266. }
  17267. loadD3Obj() {
  17268. this.loadTable();
  17269. this.loadRoom();
  17270. this.loadInHoleParticial();
  17271. this.loadIceParticial();
  17272. this.loadHitParticial();
  17273. this.loadFireworksParticial();
  17274. this.loadBall();
  17275. }
  17276. loadInHoleParticial() {
  17277. this.loadD3Res("inHoleEft", "", (prefab) => {
  17278. prefab.addComponent(Partical);
  17279. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  17280. });
  17281. }
  17282. loadIceParticial() {
  17283. this.loadD3Res("iceEft", "", (prefab) => {
  17284. prefab.addComponent(Partical);
  17285. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  17286. });
  17287. }
  17288. loadHitParticial() {
  17289. this.loadD3Res("hitEft", "", (prefab) => {
  17290. prefab.addComponent(Partical);
  17291. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  17292. });
  17293. }
  17294. loadFireworksParticial() {
  17295. this.loadD3Res("fireworksEft", "", (prefab) => {
  17296. prefab.addComponent(Partical);
  17297. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  17298. });
  17299. }
  17300. loadBall(index = 1) {
  17301. this.loadD3Res("ball", index, (prefab) => {
  17302. this.ballPrefab = prefab;
  17303. this.ballPrefab.addComponent(Ball);
  17304. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  17305. });
  17306. }
  17307. loadTable(index = 1) {
  17308. this.loadD3Res("table", index, (prefab) => {
  17309. this.tableSrc = prefab.addComponent(Table);
  17310. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  17311. this.d3Hand.init();
  17312. this.tableRoot.addChild(prefab);
  17313. });
  17314. }
  17315. loadRoom(index = 1) {
  17316. this.loadD3Res("room", index, (prefab) => {
  17317. this.roomRoot.addChild(prefab);
  17318. });
  17319. }
  17320. loadD3Res(type, index, callback) {
  17321. let url = `res/unityRes/${type}${index}.lh`;
  17322. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  17323. callback && callback(prefab);
  17324. this.checkResLoad();
  17325. }));
  17326. }
  17327. checkResLoad() {
  17328. this.loadNum++;
  17329. if (this.loadNum >= this.setLoadNum) {
  17330. xGame.eventMgr.event(D3RES_LOADED);
  17331. }
  17332. }
  17333. prePlayEft() {
  17334. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  17335. eft.transform.localPositionX = 0;
  17336. eft.transform.localPositionY = -5;
  17337. eft.transform.localPositionZ = 0;
  17338. eft.active = true;
  17339. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  17340. ice.transform.localPositionX = 0;
  17341. ice.transform.localPositionY = -5;
  17342. ice.transform.localPositionZ = 0;
  17343. ice.active = true;
  17344. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  17345. hit.transform.localPositionX = 0;
  17346. hit.transform.localPositionY = -5;
  17347. hit.transform.localPositionZ = 0;
  17348. hit.active = true;
  17349. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  17350. fireworks.transform.localPositionX = 0;
  17351. fireworks.transform.localPositionY = -5;
  17352. fireworks.transform.localPositionZ = 0;
  17353. fireworks.active = true;
  17354. }
  17355. }
  17356. class cameraType {
  17357. }
  17358. class MoyuMgr$1 {
  17359. static initMoyu() {
  17360. this.moyuView = new MoyuView$1();
  17361. Laya.stage.addChild(this.moyuView.ui.displayObject);
  17362. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  17363. this.moyuView.ui.displayObject.zOrder = 1000;
  17364. this.moyuView.init();
  17365. this.moyuView.showTip(true);
  17366. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  17367. window['XApk'] = this;
  17368. }
  17369. static showAge(show) {
  17370. if (this.moyuView)
  17371. this.moyuView.showAge(show);
  17372. }
  17373. static onPlatMsg(idx) {
  17374. if (!MoyuMgr$1.moyuView)
  17375. return;
  17376. if (idx == '0') {
  17377. MoyuMgr$1.moyuView.showTip(false);
  17378. }
  17379. }
  17380. static showAgree(call) {
  17381. if (this.moyuView)
  17382. this.moyuView.showAgree(call);
  17383. else
  17384. call && call();
  17385. }
  17386. static showXy(type = 1) {
  17387. if (this.moyuView)
  17388. this.moyuView.showXy(type);
  17389. }
  17390. }
  17391. MoyuMgr$1.isAdvise = false;
  17392. class MoyuView$1 {
  17393. constructor() {
  17394. this.ysxyNum = 1;
  17395. this.ysJson = null;
  17396. this.ui = ui_UIMoyu.createInstance();
  17397. }
  17398. init() {
  17399. this.ui.mainBg.visible = false;
  17400. this.ui.xyNode.visible = false;
  17401. this.ui.ageNode.visible = false;
  17402. this.ui.tipNode.visible = false;
  17403. this.ui.rnNode.visible = false;
  17404. this.ui.fcmNode.visible = false;
  17405. this.ui.ageTip.visible = false;
  17406. this.ui.msgNode.visible = false;
  17407. this.ui.visible = false;
  17408. this.ui.xyNode.xyList.setVirtual();
  17409. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  17410. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  17411. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  17412. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  17413. this.ui.xyNode.btnKnown.visible = false;
  17414. this.ui.xyNode.xy1.visible = false;
  17415. this.ui.xyNode.xy2.visible = false;
  17416. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  17417. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  17418. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  17419. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  17420. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  17421. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  17422. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  17423. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  17424. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  17425. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  17426. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  17427. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  17428. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  17429. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  17430. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  17431. this.ysxyNum = 2;
  17432. }
  17433. }
  17434. onClick(obj) {
  17435. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  17436. switch (obj) {
  17437. case this.ui.ageTip:
  17438. if (Moyu.isTTApk) {
  17439. this.ui.ageNode.visible = true;
  17440. this.ui.mainBg.visible = true;
  17441. }
  17442. break;
  17443. case this.ui.tipNode:
  17444. this.showTip(false);
  17445. break;
  17446. case this.ui.ageNode.btnAge:
  17447. this.ui.ageNode.visible = false;
  17448. this.ui.mainBg.visible = false;
  17449. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  17450. this.ui.visible = false;
  17451. break;
  17452. case this.ui.xyNode.btnXy3:
  17453. case this.ui.xyNode.btnXy1:
  17454. this.loadXy(1);
  17455. break;
  17456. case this.ui.xyNode.btnXy2:
  17457. this.loadXy(2);
  17458. break;
  17459. case this.ui.xyNode.btnBack:
  17460. this.ui.xyNode.xy1.visible = true;
  17461. this.ui.xyNode.xy2.visible = false;
  17462. break;
  17463. case this.ui.xyNode.btnKnown:
  17464. this.ui.xyNode.visible = false;
  17465. this.ui.mainBg.visible = false;
  17466. this.ui.visible = false;
  17467. break;
  17468. case this.ui.rnNode.btnCheck:
  17469. this.check();
  17470. break;
  17471. case this.ui.rnNode.btnExit:
  17472. case this.ui.xyNode.btnNo:
  17473. this.ysxyNum--;
  17474. if (this.ysxyNum > 0)
  17475. this.showMsg("Refuse to quit the game once again");
  17476. else {
  17477. Moyu.userAgree(false);
  17478. Moyu.exit();
  17479. }
  17480. break;
  17481. case this.ui.xyNode.btnSure:
  17482. case this.ui.xyNode.btnYes:
  17483. DataMgr.userData.isAgree = true;
  17484. DataMgr.saveUserData();
  17485. this.onAgree();
  17486. break;
  17487. case this.ui.rnNode.btnDone:
  17488. this.ui.rnNode.visible = false;
  17489. this.ui.visible = false;
  17490. break;
  17491. case this.ui.fcmNode.btnRn:
  17492. this.showRn();
  17493. break;
  17494. }
  17495. }
  17496. showTip(show) {
  17497. if (!Moyu.isVVApk && !Moyu.isOPApk)
  17498. return;
  17499. if (show) {
  17500. MoyuMgr$1.isAdvise = true;
  17501. this.ui.visible = true;
  17502. this.ui.tipNode.visible = true;
  17503. this.ui.tipNode.alpha = 1;
  17504. Laya.timer.once(1000, this, this.showTip, [false]);
  17505. }
  17506. else {
  17507. this.ui.tipNode.alpha = 1;
  17508. this.ui.tipNode.visible = true;
  17509. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  17510. this.ui.tipNode.visible = false;
  17511. MoyuMgr$1.isAdvise = false;
  17512. }), 1000);
  17513. }
  17514. }
  17515. showAge(show, px = 0, py = 0) {
  17516. if (Moyu.platType > 10 && !Moyu.isIos) {
  17517. this.ui.ageTip.x = px;
  17518. this.ui.ageTip.y = py;
  17519. this.ui.ageTip.visible = show;
  17520. if (show)
  17521. this.ui.visible = true;
  17522. }
  17523. }
  17524. showAgree(call) {
  17525. this.agreeCall = call;
  17526. this.onAgree();
  17527. return;
  17528. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  17529. this.showXy(0);
  17530. }
  17531. else
  17532. this.onAgree();
  17533. }
  17534. onAgree() {
  17535. if (!this.ui.ageNode.visible)
  17536. this.ui.visible = false;
  17537. this.ui.xyNode.visible = false;
  17538. Moyu.userAgree(true);
  17539. this.showAge(false);
  17540. this.agreeCall && this.agreeCall();
  17541. this.showRn();
  17542. }
  17543. showMsg(txt) {
  17544. this.ui.msgNode.txtMsg.text = txt;
  17545. this.ui.msgNode.visible = true;
  17546. this.ui.msgNode.alpha = 1;
  17547. this.ui.visible = true;
  17548. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  17549. this.ui.msgNode.visible = false;
  17550. }), 2500, true);
  17551. }
  17552. showRn() {
  17553. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17554. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  17555. this.ui.rnNode.rn1.visible = true;
  17556. this.ui.rnNode.rn2.visible = false;
  17557. this.ui.rnNode.rn3.visible = false;
  17558. this.ui.rnNode.rn4.visible = false;
  17559. this.ui.rnNode.visible = true;
  17560. this.ui.mainBg.visible = true;
  17561. this.ui.rnNode.btnDone.visible = false;
  17562. this.ui.rnNode.btnExit.visible = true;
  17563. this.ui.rnNode.btnCheck.visible = true;
  17564. this.ui.fcmNode.visible = false;
  17565. this.ui.visible = true;
  17566. return;
  17567. }
  17568. }
  17569. this.showFcm();
  17570. }
  17571. showFcm() {
  17572. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17573. Moyu.initFCM(true);
  17574. if (Moyu.gameTime < 1)
  17575. this.fcmLoop();
  17576. else if (Moyu.gameTime < 999)
  17577. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  17578. }
  17579. }
  17580. fcmLoop() {
  17581. if (Moyu.gameTime < 1) {
  17582. this.ui.rnNode.visible = false;
  17583. this.ui.fcmNode.visible = true;
  17584. this.ui.mainBg.visible = true;
  17585. this.ui.visible = true;
  17586. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  17587. Laya.timer.clear(this.ui, this.fcmLoop);
  17588. }
  17589. }
  17590. check() {
  17591. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  17592. this.ui.rnNode.rn1.visible = false;
  17593. this.ui.rnNode.rn2.visible = false;
  17594. this.ui.rnNode.rn4.visible = true;
  17595. }
  17596. else if (this.ui.rnNode.rn4.visible) {
  17597. let name = this.ui.rnNode.inputName.text;
  17598. let code = this.ui.rnNode.inputCode.text;
  17599. if (code && code.length == 18) {
  17600. this.ui.rnNode.rn1.visible = false;
  17601. this.ui.rnNode.rn4.visible = false;
  17602. Moyu.authenticate(name, code, (res) => {
  17603. this.ui.rnNode.rn2.visible = !res;
  17604. this.ui.rnNode.rn3.visible = res;
  17605. this.ui.rnNode.btnDone.visible = res;
  17606. this.ui.rnNode.btnExit.visible = !res;
  17607. this.ui.rnNode.btnCheck.visible = !res;
  17608. if (res)
  17609. this.showFcm();
  17610. });
  17611. }
  17612. else
  17613. this.showMsg("信息填写不完整");
  17614. }
  17615. }
  17616. loadXy(type = 0) {
  17617. this.ui.xyNode.xy1.visible = false;
  17618. this.ui.xyNode.xy2.visible = true;
  17619. this.ui.xyNode.xyList.scrollToView(0);
  17620. if (type == 1) {
  17621. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  17622. }
  17623. else if (type == 2) {
  17624. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  17625. }
  17626. }
  17627. showXy(type = 0) {
  17628. this.xyBtn();
  17629. if (type == 0) {
  17630. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  17631. this.ui.xyNode.btnSure.visible = true;
  17632. }
  17633. else {
  17634. this.ui.xyNode.btnYes.visible = true;
  17635. this.ui.xyNode.btnNo.visible = true;
  17636. }
  17637. }
  17638. else {
  17639. this.ui.xyNode.btnKnown.visible = true;
  17640. this.ui.mainBg.visible = true;
  17641. }
  17642. this.ui.xyNode.xy1.visible = true;
  17643. this.ui.xyNode.xy2.visible = false;
  17644. this.ui.xyNode.visible = true;
  17645. this.ui.visible = true;
  17646. }
  17647. xyBtn() {
  17648. this.ui.xyNode.btnSure.visible = false;
  17649. this.ui.xyNode.btnYes.visible = false;
  17650. this.ui.xyNode.btnNo.visible = false;
  17651. this.ui.xyNode.btnKnown.visible = false;
  17652. {
  17653. this.ui.xyNode.btnXy3.visible = false;
  17654. this.ui.xyNode.btnXy2.visible = true;
  17655. this.ui.xyNode.btnXy1.visible = true;
  17656. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  17657. }
  17658. }
  17659. createXY(json) {
  17660. this.ysJson = json.content;
  17661. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  17662. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  17663. this.ui.xyNode.xy2.visible = true;
  17664. }
  17665. renderListItem(idx, cell) {
  17666. let xy = this.ysJson[idx];
  17667. cell.height = xy.line * 30;
  17668. cell.xyItem.text = xy.text;
  17669. }
  17670. onDestroy() {
  17671. this.agreeCall = null;
  17672. }
  17673. }
  17674. class UILoading extends UIBase {
  17675. constructor() {
  17676. super();
  17677. this.accTime = 0;
  17678. this.curNum = 0;
  17679. this.rate = 1;
  17680. this.loadSubOk = false;
  17681. this.loadResOK = false;
  17682. this.openLoading = true;
  17683. this.beginLoadRes = false;
  17684. this.finishD2 = false;
  17685. this.finishD3 = false;
  17686. }
  17687. onConstructor() {
  17688. this.ui = ui_UILoading.createInstance();
  17689. this.contentPane = this.ui;
  17690. this.isEject = false;
  17691. this._initUI();
  17692. this._addEvent();
  17693. }
  17694. _initUI() {
  17695. MoyuMgr$1.initMoyu();
  17696. }
  17697. _addEvent() {
  17698. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  17699. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  17700. }
  17701. show() {
  17702. super.show();
  17703. console.log('zh:加载分包资源');
  17704. loadSubRes(this.subResProgress.bind(this));
  17705. this.ui.txtLoad.text = "Loading...";
  17706. }
  17707. subResProgress(pro, finish) {
  17708. this.curNum = pro;
  17709. if (finish) {
  17710. this.curNum = 1;
  17711. this.loadSubOk = true;
  17712. }
  17713. }
  17714. laodD3Res() {
  17715. let scene3D = new Laya.Scene3D();
  17716. xGame.common.d3Scene = scene3D;
  17717. xGame.common.d3World = scene3D.addComponent(D3World);
  17718. xGame.common.d3World.loadScene();
  17719. }
  17720. loadD2Res() {
  17721. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  17722. this.finishD2 = true;
  17723. this.checkLoadAll();
  17724. this.curNum = 1;
  17725. }), Laya.Handler.create(this, (pro) => {
  17726. this.curNum = pro;
  17727. }, null, false));
  17728. }
  17729. d3ResFinish() {
  17730. this.finishD3 = true;
  17731. this.checkLoadAll();
  17732. }
  17733. checkLoadAll() {
  17734. if (this.finishD2 && this.finishD3) {
  17735. this.loadResOK = true;
  17736. }
  17737. }
  17738. loadRes() {
  17739. this.laodD3Res();
  17740. this.loadD2Res();
  17741. }
  17742. myUpdate(dt) {
  17743. if (!this.openLoading)
  17744. return;
  17745. this.accTime += dt * this.rate;
  17746. if (this.accTime >= this.curNum)
  17747. this.accTime = this.curNum;
  17748. this.ui.loadinfo.value = this.accTime * 100;
  17749. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  17750. if (!this.beginLoadRes) {
  17751. this.beginLoadRes = true;
  17752. this.ui.txtLoad.text = "Loading...";
  17753. this.curNum = 0;
  17754. this.accTime = 0;
  17755. this.loadRes();
  17756. }
  17757. if (this.loadResOK) {
  17758. this.openLoading = false;
  17759. Laya.timer.once(300, this, () => {
  17760. xGame.common.d3Scene.active = false;
  17761. MoyuMgr$1.showAgree(enterGame);
  17762. });
  17763. }
  17764. }
  17765. }
  17766. release() {
  17767. }
  17768. hide() {
  17769. super.hide();
  17770. this.release();
  17771. }
  17772. onClose() {
  17773. this.hide();
  17774. }
  17775. }
  17776. UILoading.uiName = "UILoading";
  17777. class UIRepentProp$1 extends UIBase {
  17778. constructor() {
  17779. super();
  17780. this.viewType = 0;
  17781. this.regretType = 0;
  17782. }
  17783. onConstructor() {
  17784. this.ui = ui_UIRepentProp.createInstance();
  17785. this.contentPane = this.ui;
  17786. this.isEject = false;
  17787. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17788. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17789. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17790. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17791. }
  17792. show(viewType, regretType, callback) {
  17793. PlatMgr.showInsert(true);
  17794. this.viewType = viewType;
  17795. this.regretType = regretType;
  17796. this.callback = callback;
  17797. super.show();
  17798. this.ui.t0.play();
  17799. this.ui.c1.selectedIndex = this.viewType;
  17800. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17801. if (this.viewType == 0) {
  17802. let guide = DataMgr.getGuideHelpLine();
  17803. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17804. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17805. }
  17806. xGame.common.gameMgr.gamePause = true;
  17807. }
  17808. hideSelf() {
  17809. xGame.common.gameMgr.gamePause = false;
  17810. this.callback && this.callback(false);
  17811. this.hide();
  17812. }
  17813. videoRegret() {
  17814. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  17815. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  17816. }
  17817. else {
  17818. console.log('zh:AD 失败,直接发放奖励');
  17819. this.qjff_AD_for_UIrepentProp_videoRegret();
  17820. }
  17821. }
  17822. qjff_AD_for_UIrepentProp_videoRegret() {
  17823. this.callback && this.callback(true);
  17824. this.hideSelf();
  17825. }
  17826. videoAddHelpLine() {
  17827. let guide = DataMgr.getGuideHelpLine();
  17828. if (guide == 0) {
  17829. this.callback && this.callback(true);
  17830. this.hideSelf();
  17831. DataMgr.setGuideHelpLine();
  17832. xGame.common.gameUI.ui.guideNode.visible = false;
  17833. }
  17834. else {
  17835. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  17836. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  17837. }
  17838. else {
  17839. console.log('zh:AD 失败,直接发放奖励');
  17840. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  17841. }
  17842. }
  17843. }
  17844. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  17845. this.callback && this.callback(true);
  17846. this.hideSelf();
  17847. }
  17848. }
  17849. UIRepentProp$1.uiName = "UIRepentProp";
  17850. class UIRodMethod$1 extends UIBase {
  17851. constructor() {
  17852. super();
  17853. this.isPressd = false;
  17854. }
  17855. onConstructor() {
  17856. this.ui = ui_UIRodMethod.createInstance();
  17857. this.contentPane = this.ui;
  17858. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17859. this.moveDir = new Laya.Vector2();
  17860. this.moveDest = new Laya.Vector2();
  17861. this.centerPos = new Laya.Vector2();
  17862. xGame.common.uiRodMethod = this;
  17863. }
  17864. show() {
  17865. super.show();
  17866. xGame.common.gameMgr.gamePause = true;
  17867. this.openPressDotEvent();
  17868. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17869. this.centerPos.x = this.ui.white.x;
  17870. this.centerPos.y = this.ui.white.y;
  17871. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17872. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17873. this.setDot();
  17874. }
  17875. setDot() {
  17876. this.ui.dot.x = this.moveDest.x;
  17877. this.ui.dot.y = this.moveDest.y;
  17878. }
  17879. closeSelf() {
  17880. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17881. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17882. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17883. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17884. xGame.common.gameMgr.gamePause = false;
  17885. this.hide();
  17886. }
  17887. openPressDotEvent() {
  17888. this.closePressDotEvent();
  17889. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17890. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17891. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17892. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17893. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17894. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17895. }
  17896. closePressDotEvent() {
  17897. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17898. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17899. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17900. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17901. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17902. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17903. }
  17904. onDown(e) {
  17905. if (e.type == Laya.Event.MOUSE_DOWN)
  17906. this.isPressd = true;
  17907. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17908. this.isPressd = false;
  17909. if (!this.isPressd)
  17910. return;
  17911. this.moveDest.x = e.stageX;
  17912. this.moveDest.y = e.stageY;
  17913. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17914. if (dis > 6724) {
  17915. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17916. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17917. }
  17918. this.setDot();
  17919. }
  17920. resetRod() {
  17921. this.ui.dot.x = this.ui.white.x;
  17922. this.ui.dot.y = this.ui.white.y;
  17923. this.gameRod.dot.x = this.gameRod.bg.x;
  17924. this.gameRod.dot.y = this.gameRod.bg.y;
  17925. xGame.common.rodOffest.x = 0;
  17926. xGame.common.rodOffest.y = 0;
  17927. }
  17928. }
  17929. UIRodMethod$1.uiName = "UIRodMethod";
  17930. class UIMsg$1 extends UIBase {
  17931. constructor() {
  17932. super();
  17933. }
  17934. onConstructor() {
  17935. this.ui = ui_UIMsg.createInstance();
  17936. this.contentPane = this.ui;
  17937. this.isEject = false;
  17938. this.isMuti = true;
  17939. }
  17940. show(msg, callback) {
  17941. super.show();
  17942. this.ui.tipsNode.msgTxt.text = msg;
  17943. this.ui.alpha = 1;
  17944. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17945. this.hide();
  17946. callback && callback();
  17947. }), 1000);
  17948. }
  17949. }
  17950. UIMsg$1.uiName = "UIMsg";
  17951. class UITips$1 extends UIBase {
  17952. constructor() {
  17953. super();
  17954. this.type = 0;
  17955. }
  17956. onConstructor() {
  17957. this.ui = ui_UITips.createInstance();
  17958. this.contentPane = this.ui;
  17959. this.isEject = false;
  17960. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17961. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17962. }
  17963. show(tipsTxt, womanTxt, type) {
  17964. super.show();
  17965. this.ui.t0.play();
  17966. this.ui.myNode.tipsTxt.text = tipsTxt;
  17967. this.ui.myNode.womanTxt.text = womanTxt;
  17968. PlatMgr.showInsert(true);
  17969. this.ui.myNode.c1.selectedIndex = type;
  17970. this.type = type;
  17971. switch (this.type) {
  17972. case TipsType.exitGame:
  17973. xGame.common.gameMgr.gamePause = true;
  17974. break;
  17975. case TipsType.foul:
  17976. Laya.timer.once(200, this, () => {
  17977. xGame.common.gameMgr.gamePause = true;
  17978. });
  17979. break;
  17980. default:
  17981. break;
  17982. }
  17983. }
  17984. clickLeftBtn() {
  17985. this.hide();
  17986. xGame.common.gameMgr.gamePause = false;
  17987. switch (this.type) {
  17988. case TipsType.exitGame:
  17989. break;
  17990. case TipsType.foul:
  17991. break;
  17992. default:
  17993. break;
  17994. }
  17995. }
  17996. clickRightBtn() {
  17997. this.hide();
  17998. switch (this.type) {
  17999. case TipsType.exitGame:
  18000. xGame.eventMgr.event(RESET_GAME);
  18001. xGame.uiMgr.Show(UIMain$1);
  18002. Moyu.recordEnd(this, null);
  18003. xGame.common.longHelpLine = false;
  18004. break;
  18005. case TipsType.foul:
  18006. xGame.common.gameMgr.gamePause = false;
  18007. Laya.timer.clearAll(this);
  18008. break;
  18009. default:
  18010. break;
  18011. }
  18012. }
  18013. }
  18014. UITips$1.uiName = "UITips";
  18015. class UIGame$1 extends UIBase {
  18016. constructor() {
  18017. super();
  18018. this.powerNum = 0;
  18019. this.isD3Inited = false;
  18020. this.isPrePlay = false;
  18021. this.isMoveRod = false;
  18022. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  18023. this.rulerDis = 20;
  18024. this.rulerOffset = 0;
  18025. }
  18026. onConstructor() {
  18027. this.ui = ui_UIGame.createInstance();
  18028. this.contentPane = this.ui;
  18029. this.ui.x += xGame.common.sysOffestNum;
  18030. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  18031. this.isEject = false;
  18032. xGame.common.gameUI = this;
  18033. this.initSelf();
  18034. }
  18035. isTurnSelf() {
  18036. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  18037. return true;
  18038. }
  18039. }
  18040. initSelf() {
  18041. let topUI = this.ui.topNode;
  18042. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  18043. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  18044. this.barInfo = {};
  18045. this.barInfo.curY = 0;
  18046. this.barInfo.height = this.ui.powerNode.height;
  18047. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  18048. this.barInfo.powerStartY = this.ui.powerNode.y;
  18049. xGame.common.aiPlayer = new AIPlayer();
  18050. xGame.common.gameMgr = new GameMgr();
  18051. xGame.common.skillMgr = new SkillMgr();
  18052. xGame.common.wordsMgr = new WordsMgr();
  18053. xGame.common.talkMgr = new TalkMgr();
  18054. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  18055. console.log("加载经典模式表情文件chenggon !");
  18056. });
  18057. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  18058. console.log("挑战模式奖励模式spine加载成功!");
  18059. });
  18060. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  18061. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  18062. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  18063. this.addUIClick(this.ui.returnBtn, this.returnHome);
  18064. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  18065. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  18066. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  18067. }
  18068. getGanZiImg() {
  18069. let index = DataMgr.getCurBallRod();
  18070. let data = cfgTable.ballrodData[index + 1];
  18071. let gan_url = xGame.common.getGameIconUrl(data.img);
  18072. console.log('zh:getGanZiImg gan_url==' + gan_url);
  18073. this.ui.powerNode.showImg.url = gan_url;
  18074. console.log('zh:修改杆子图标O K');
  18075. }
  18076. returnHome() {
  18077. let tips = "Are you sure to exit the game?";
  18078. let woman = "Boss, why don't you play for a while longer?";
  18079. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  18080. }
  18081. addRodMethodClick() {
  18082. if (this.isTurnSelf()) {
  18083. xGame.uiMgr.Show(UIRodMethod$1);
  18084. }
  18085. }
  18086. clickHelpLineBtn(force = false) {
  18087. if (!this.isTurnSelf())
  18088. return;
  18089. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  18090. if (success) {
  18091. xGame.common.longHelpLine = true;
  18092. xGame.common.d2World.getHelpLine();
  18093. Moyu.sendDataEvent("guideNum");
  18094. }
  18095. else {
  18096. }
  18097. });
  18098. }
  18099. renderSelfDisplayBalls(index, target) {
  18100. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  18101. target.myImg.url = xGame.common.getGameIconUrl(str);
  18102. }
  18103. renderAIDisplayBalls(index, target) {
  18104. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  18105. target.myImg.url = xGame.common.getGameIconUrl(str);
  18106. ;
  18107. }
  18108. updateMode() {
  18109. if (xGame.common.gameMode == GameMode.classic) {
  18110. this.ui.topNode.scoreNode.visible = false;
  18111. }
  18112. else if (xGame.common.gameMode == GameMode.bigMove) {
  18113. this.ui.topNode.scoreNode.visible = true;
  18114. }
  18115. }
  18116. show() {
  18117. super.show();
  18118. console.log("zh:uigame show AADD");
  18119. this.ui.alpha = 0;
  18120. this.updateSelf();
  18121. xGame.common.gameMgr.gamePause = false;
  18122. xGame.common.gameUI.ui.blackAni.visible = false;
  18123. xGame.common.gameUI.ui.whiteAni.visible = false;
  18124. this.ui.powerEft.visible = false;
  18125. this.ui.colorNode.visible = false;
  18126. this.updateHead();
  18127. let curUse = DataMgr.getCurBallRod();
  18128. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  18129. this.getGanZiImg();
  18130. }
  18131. updateSelf() {
  18132. if (xGame.common.gameMode == GameMode.classic) {
  18133. this.ui.c1.selectedIndex = 0;
  18134. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  18135. this.ui.topNode.middleNode.visible = true;
  18136. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  18137. }
  18138. else if (xGame.common.gameMode == GameMode.bigMove) {
  18139. this.ui.c1.selectedIndex = 0;
  18140. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  18141. this.ui.topNode.middleNode.visible = false;
  18142. let max = xGame.cfgMgr.getMaxBigMoveLength();
  18143. let rand = xGame.common.randomNum(1, max);
  18144. let guide = DataMgr.getSkillGuide();
  18145. if (guide == 0)
  18146. rand = 1;
  18147. xGame.common.bigMoveLevelIndex = rand;
  18148. }
  18149. else if (xGame.common.gameMode == GameMode.placeBall) {
  18150. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18151. this.ui.c1.selectedIndex = 1 + data.type;
  18152. this.ui.alpha = 1;
  18153. this.startGame();
  18154. }
  18155. this.updateMode();
  18156. this.initD3world();
  18157. this.initD2world();
  18158. }
  18159. startGame() {
  18160. this.ui.snowNode.visible = Math.random() <= 0.1;
  18161. this.ui.d2Node.visible = false;
  18162. xGame.common.d3World.d3Hand.gameObj.active = false;
  18163. xGame.common.d3World.tableSrc.init();
  18164. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  18165. this.cameraViewChange(() => {
  18166. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  18167. switch (xGame.common.gameMode) {
  18168. case GameMode.classic:
  18169. xGame.common.d3World.d3Hand.gameObj.active = true;
  18170. this.playPutBallD3Ani();
  18171. break;
  18172. case GameMode.bigMove:
  18173. this.enterGame();
  18174. Laya.timer.once(500, this, () => {
  18175. this.ui.topNode.middleNode.visible = true;
  18176. this.ui.topNode.middleNode.t0.play();
  18177. });
  18178. break;
  18179. case GameMode.placeBall:
  18180. this.enterGame();
  18181. break;
  18182. default:
  18183. break;
  18184. }
  18185. });
  18186. PlatMgr.showBanner(false);
  18187. }
  18188. enterGame() {
  18189. this.ui.d2Node.visible = true;
  18190. xGame.common.d3World.d3Hand.gameObj.active = false;
  18191. xGame.common.showOneCamera("mainCamera");
  18192. Moyu.recordGame(30, true);
  18193. if (!this.isPrePlay) {
  18194. this.isPrePlay = true;
  18195. xGame.common.d3World.prePlayEft();
  18196. }
  18197. xGame.common.gameMgr.gameReady();
  18198. this.openAllEvent();
  18199. this.ui.snowNode.visible = false;
  18200. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  18201. this.ui.helpBtn.visible = condition;
  18202. }
  18203. showHelpLineGuide() {
  18204. let longGuide = DataMgr.getGuideHelpLine();
  18205. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  18206. this.ui.helpBtn.visible = true;
  18207. this.ui.guideNode.visible = true;
  18208. }
  18209. }
  18210. setTurnAlpha(alpha) {
  18211. this.ui.keduNode.alpha = alpha;
  18212. this.ui.ganNode.alpha = alpha;
  18213. this.ui.rodMethodNode.alpha = alpha;
  18214. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  18215. }
  18216. cameraViewChange(callback) {
  18217. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  18218. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  18219. xGame.common.showOneCamera("visitAngle");
  18220. cameraSrc.localRotationEulerY = 180;
  18221. cameraSrc.localRotationEulerZ = 0;
  18222. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  18223. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  18224. callback && callback();
  18225. }));
  18226. }));
  18227. }
  18228. playPutBallD3Ani() {
  18229. xGame.common.showOneCamera("mainCamera");
  18230. let handSrc = xGame.common.d3World.d3Hand;
  18231. handSrc.gameObj.active = true;
  18232. handSrc.transform.localPositionZ = 3;
  18233. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  18234. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  18235. handSrc.gameObj.active = false;
  18236. this.enterGame();
  18237. }), 400);
  18238. }));
  18239. }
  18240. updateHead() {
  18241. let user = Moyu.getUserInfo();
  18242. this.ui.topNode.selfNameTxt.text = user.nickName;
  18243. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  18244. let aiData = xGame.cfgMgr.getRandomUserInfo();
  18245. if (DataMgr.getSkillGuide() < 1) {
  18246. this.ui.topNode.aiNameTxt.text = 'billiards';
  18247. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  18248. }
  18249. else {
  18250. this.ui.topNode.aiNameTxt.text = aiData.name;
  18251. let randNo = Math.floor(Math.random() * 10) + 1;
  18252. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  18253. }
  18254. }
  18255. initD2world() {
  18256. let node = this.ui.d2Root.displayObject;
  18257. let src = node.getComponent(D2World);
  18258. if (!src) {
  18259. xGame.common.d2World = node.addComponent(D2World);
  18260. }
  18261. xGame.common.d2World.initSelf();
  18262. }
  18263. initD3world() {
  18264. if (this.isD3Inited)
  18265. return;
  18266. this.isD3Inited = true;
  18267. let scene3D = xGame.common.d3Scene;
  18268. this.ui.d3Root.displayObject.addChild(scene3D);
  18269. scene3D.active = true;
  18270. xGame.common.d3World.tableSrc.setBorderPos();
  18271. }
  18272. onRootMove(e) {
  18273. let rootBall = xGame.common.d2World.rootBall;
  18274. this.ui.moveNode.x = e.x;
  18275. this.ui.moveNode.y = e.y;
  18276. rootBall.gameObj.x = e.x;
  18277. rootBall.gameObj.y = e.y;
  18278. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  18279. }
  18280. aiRootMove(move) {
  18281. if (move)
  18282. this.hideBallUI();
  18283. else {
  18284. this.showBallUI();
  18285. xGame.common.d2World.getHelpLine();
  18286. }
  18287. }
  18288. aiForce(type, force = 0) {
  18289. this.pressTarget = PressType.powerNode;
  18290. if (type == 1)
  18291. this.onEventUp({ force: true });
  18292. else if (type == 2)
  18293. this.onEventMove({ stageY: force, force: true });
  18294. }
  18295. onEventPress(e) {
  18296. if (e.stopPropagation)
  18297. e.stopPropagation();
  18298. if (!this.isTurnSelf())
  18299. return;
  18300. let target = e.target;
  18301. switch (target) {
  18302. case this.ui.myPowerNode.displayObject:
  18303. this.pressTarget = PressType.powerNode;
  18304. this.barInfo.curY = e.stageY;
  18305. this.updateBarInfo();
  18306. break;
  18307. case this.ui.moveNode.displayObject:
  18308. this.pressTarget = PressType.moveNode;
  18309. this.hideBallUI();
  18310. this.eventObj.curX = this.ui.moveNode.x;
  18311. this.eventObj.curY = this.ui.moveNode.y;
  18312. this.ui.moveNode.finger.visible = false;
  18313. this.eventObj.lastX = e.stageX;
  18314. this.eventObj.lastY = e.stageY;
  18315. break;
  18316. case this.ui.rulerClickNode.displayObject:
  18317. this.pressTarget = PressType.rulerNode;
  18318. this.eventObj.lastY = e.stageY;
  18319. break;
  18320. case this.ui.d2Root.displayObject:
  18321. this.pressTarget = PressType.d2Root;
  18322. this.eventObj.lastX = e.stageX;
  18323. this.eventObj.lastY = e.stageY;
  18324. this.eventObj.starX = e.stageX;
  18325. this.eventObj.starY = e.stageY;
  18326. this.eventObj.curX = 0;
  18327. this.eventObj.curY = 0;
  18328. xGame.common.d2World.d2Gan.setGanLastInfo();
  18329. this.rulerOffset = 0;
  18330. break;
  18331. default:
  18332. break;
  18333. }
  18334. }
  18335. onEventMove(e) {
  18336. if (e.stopPropagation)
  18337. e.stopPropagation();
  18338. if (e && e.force) {
  18339. }
  18340. else {
  18341. if (!this.isTurnSelf())
  18342. return;
  18343. }
  18344. switch (this.pressTarget) {
  18345. case PressType.powerNode:
  18346. this.barInfo.curY = e.stageY;
  18347. this.updateBarInfo();
  18348. this.isMoveRod = true;
  18349. break;
  18350. case PressType.moveNode:
  18351. let rootBall = xGame.common.d2World.rootBall;
  18352. let radius = rootBall.gameObj.width / 2;
  18353. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  18354. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  18355. let border = xGame.common.d2World.borderRect;
  18356. if (curX <= border.x + radius)
  18357. curX = border.x + radius;
  18358. else if (curX >= border.x + border.width - radius)
  18359. curX = border.x + border.width - radius;
  18360. if (curY <= border.y + radius)
  18361. curY = border.y + radius;
  18362. else if (curY >= border.y + border.height - radius)
  18363. curY = border.y + border.height - radius;
  18364. if (xGame.common.gameMgr.isOpenBall) {
  18365. if (curX >= border.x + border.openBallW - radius)
  18366. curX = border.x + border.openBallW - radius;
  18367. }
  18368. this.ui.moveNode.x = curX;
  18369. this.ui.moveNode.y = curY;
  18370. rootBall.gameObj.x = curX;
  18371. rootBall.gameObj.y = curY;
  18372. rootBall.d3BallSrc.setTransPos(curX, curY);
  18373. this.isMoveRod = true;
  18374. break;
  18375. case PressType.rulerNode:
  18376. let yy = e.stageY - this.eventObj.lastY;
  18377. this.eventObj.lastY = e.stageY;
  18378. let ruler1 = this.ui.rulerNode.img1;
  18379. let ruler2 = this.ui.rulerNode.img2;
  18380. ruler1.y += yy;
  18381. ruler2.y += yy;
  18382. this.rulerOffset += yy;
  18383. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  18384. this.rulerOffset = 0;
  18385. xGame.soundMgr.playSound("inch", 1, 10);
  18386. }
  18387. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  18388. let h = ruler1.height;
  18389. this.checkGuide();
  18390. this.isMoveRod = true;
  18391. if (ruler1.y >= h) {
  18392. ruler1.y = -h;
  18393. ruler2.y = 0;
  18394. return;
  18395. }
  18396. else if (ruler1.y <= -h) {
  18397. ruler1.y = h;
  18398. ruler2.y = 0;
  18399. return;
  18400. }
  18401. if (ruler2.y >= h) {
  18402. ruler2.y = -h;
  18403. ruler1.y = 0;
  18404. return;
  18405. }
  18406. else if (ruler2.y <= -h) {
  18407. ruler2.y = h;
  18408. ruler1.y = 0;
  18409. return;
  18410. }
  18411. break;
  18412. case PressType.d2Root:
  18413. this.eventObj.curX = e.stageX;
  18414. this.eventObj.curY = e.stageY;
  18415. let offset = this.checkRodMoveDir();
  18416. xGame.common.d2World.d2Gan.rotateSelf(offset);
  18417. this.eventObj.lastX = e.stageX;
  18418. this.eventObj.lastY = e.stageY;
  18419. break;
  18420. default:
  18421. break;
  18422. }
  18423. }
  18424. onEventUp(e) {
  18425. if (e.stopPropagation)
  18426. e.stopPropagation();
  18427. if (e && e.force) {
  18428. }
  18429. else {
  18430. if (!this.isTurnSelf())
  18431. return;
  18432. }
  18433. switch (this.pressTarget) {
  18434. case PressType.powerNode:
  18435. this.ui.powerNode.value = 0;
  18436. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18437. this.ui.powerTxt.text = "";
  18438. if (this.powerNum > 0) {
  18439. xGame.eventMgr.event(BALL_SHOOT);
  18440. xGame.common.d2World.shoot(this.powerNum);
  18441. xGame.common.d2World.d2Gan.shoot();
  18442. xGame.common.d2World.d2HelpLine.shoot();
  18443. this.finishGuide();
  18444. this.ui.powerEft.visible = false;
  18445. this.ui.colorNode.visible = false;
  18446. let ganStr = "";
  18447. if (this.powerNum <= 30) {
  18448. ganStr = "gan_30";
  18449. }
  18450. else if (this.powerNum <= 60) {
  18451. ganStr = "gan_50";
  18452. }
  18453. else {
  18454. ganStr = "gan_80";
  18455. }
  18456. xGame.soundMgr.playSound(ganStr);
  18457. }
  18458. break;
  18459. case PressType.moveNode:
  18460. let rootBall = xGame.common.d2World.rootBall;
  18461. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  18462. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  18463. let isIntersect = this.judgeBallIntersect();
  18464. if (isIntersect) {
  18465. this.ui.moveNode.x = lastX;
  18466. this.ui.moveNode.y = lastY;
  18467. rootBall.gameObj.x = lastX;
  18468. rootBall.gameObj.y = lastY;
  18469. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  18470. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  18471. }
  18472. else {
  18473. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  18474. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  18475. }
  18476. this.showBallUI();
  18477. this.ui.moveNode.finger.visible = true;
  18478. xGame.common.d2World.getHelpLine();
  18479. break;
  18480. case PressType.rulerNode:
  18481. break;
  18482. case PressType.d2Root:
  18483. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  18484. if (dis <= 25) {
  18485. this.moveToClickDot(e);
  18486. }
  18487. break;
  18488. default:
  18489. break;
  18490. }
  18491. this.pressTarget = -1;
  18492. }
  18493. checkGuide() {
  18494. let guide = DataMgr.getSkillGuide();
  18495. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  18496. xGame.common.guideStep++;
  18497. xGame.common.gameUI.ui.guide2.visible = false;
  18498. xGame.common.gameUI.ui.guide3.visible = true;
  18499. }
  18500. }
  18501. finishGuide() {
  18502. let guide = DataMgr.getSkillGuide();
  18503. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  18504. xGame.common.guideStep = 10;
  18505. this.closeAllGuide();
  18506. console.log('zh: 新手引导完毕');
  18507. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  18508. }
  18509. }
  18510. closeAllGuide() {
  18511. xGame.common.gameUI.ui.guide1.visible = false;
  18512. xGame.common.gameUI.ui.guide2.visible = false;
  18513. xGame.common.gameUI.ui.guide3.visible = false;
  18514. }
  18515. updateBarInfo() {
  18516. let star = this.ui.powerNode.y;
  18517. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  18518. if (rate >= 1)
  18519. rate = 1;
  18520. if (rate <= 0)
  18521. rate = 0;
  18522. this.powerNum = Math.ceil(rate * 100);
  18523. this.ui.powerNode.value = this.powerNum;
  18524. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  18525. this.ui.colorNode.value = this.powerNum;
  18526. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  18527. this.ui.powerEft.visible = this.powerNum != 0;
  18528. this.ui.colorNode.visible = this.powerNum != 0;
  18529. this.ui.powerTxt.text = this.powerNum + "";
  18530. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  18531. }
  18532. forceCancel() {
  18533. this.ui.powerNode.value = 0;
  18534. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18535. this.ui.powerTxt.text = "";
  18536. }
  18537. checkRodMoveDir() {
  18538. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  18539. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  18540. if (tempX >= 0 && tempY <= 0) {
  18541. return this.checkDir();
  18542. }
  18543. else if (tempX < 0 && tempY < 0) {
  18544. return this.checkDir(1, -1);
  18545. }
  18546. else if (tempX < 0 && tempY > 0) {
  18547. return this.checkDir(-1, -1);
  18548. }
  18549. else {
  18550. return this.checkDir(-1, 1);
  18551. }
  18552. }
  18553. checkDir(flagX = 1, flagY = 1) {
  18554. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  18555. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  18556. if (offsetY == 0) {
  18557. return offsetX * flagX;
  18558. }
  18559. if (offsetX == 0) {
  18560. return offsetY * flagY;
  18561. }
  18562. let angle = offsetY / offsetX;
  18563. if (Math.abs(angle) >= 1) {
  18564. return offsetY * flagY;
  18565. }
  18566. else {
  18567. return offsetX * flagX;
  18568. }
  18569. }
  18570. judgeBallIntersect() {
  18571. let rootBall = xGame.common.d2World.rootBall;
  18572. let ballArr = xGame.common.d2World.ballArr;
  18573. let radius = rootBall.gameObj.width / 2;
  18574. let temp;
  18575. let isIntersect = false;
  18576. for (let index = 0; index < ballArr.length; index++) {
  18577. temp = ballArr[index];
  18578. if (temp.number == rootBall.number)
  18579. continue;
  18580. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  18581. if (isIntersect) {
  18582. break;
  18583. }
  18584. }
  18585. return isIntersect;
  18586. }
  18587. hideBallUI() {
  18588. let d2Gan = xGame.common.d2World.d2Gan;
  18589. if (!d2Gan.ui.isDisposed)
  18590. d2Gan.ui.visible = false;
  18591. let d2Help = xGame.common.d2World.d2HelpLine;
  18592. if (!d2Help.ui.isDisposed)
  18593. d2Help.ui.visible = false;
  18594. let rootBall = xGame.common.d2World.rootBall;
  18595. if (!rootBall.destroyed) {
  18596. rootBall.gameObj.active = false;
  18597. }
  18598. }
  18599. showBallUI() {
  18600. let d2Gan = xGame.common.d2World.d2Gan;
  18601. if (!d2Gan.ui.isDisposed)
  18602. d2Gan.ui.visible = true;
  18603. let d2Help = xGame.common.d2World.d2HelpLine;
  18604. if (!d2Help.ui.isDisposed)
  18605. d2Help.ui.visible = true;
  18606. let rootBall = xGame.common.d2World.rootBall;
  18607. if (!rootBall.destroyed) {
  18608. rootBall.gameObj.active = true;
  18609. }
  18610. }
  18611. moveToClickDot(e) {
  18612. if (!this.isMoveRod && !xGame.common.clickedBall) {
  18613. let root = xGame.common.d2World.rootBall.gameObj;
  18614. let xx = e.stageX - xGame.common.sysOffestNum;
  18615. let yy = e.stageY;
  18616. let x = xx - root.x;
  18617. let y = yy - root.y;
  18618. let angle = xGame.common.getfguiRotation(x, y);
  18619. xGame.common.d2World.d2Gan.ui.rotation = angle;
  18620. xGame.common.d2World.getHelpLine();
  18621. }
  18622. this.isMoveRod = false;
  18623. xGame.common.clickedBall = false;
  18624. }
  18625. openAllEvent() {
  18626. this.closeAllEvent();
  18627. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18628. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18629. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18630. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18631. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18632. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18633. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18634. }
  18635. closeAllEvent() {
  18636. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18637. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18638. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18639. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18640. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18641. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18642. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18643. }
  18644. resetGame() {
  18645. this.closeAllEvent();
  18646. this.hideBallUI();
  18647. xGame.common.gameMgr.gamePause = true;
  18648. }
  18649. }
  18650. UIGame$1.uiName = "UIGame";
  18651. class UIAddCoin$1 extends UIBase {
  18652. constructor() {
  18653. super();
  18654. this.coinNum = 2000;
  18655. }
  18656. onConstructor() {
  18657. this.ui = ui_UIAddCoin.createInstance();
  18658. this.contentPane = this.ui;
  18659. this.isEject = false;
  18660. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18661. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  18662. }
  18663. show() {
  18664. super.show();
  18665. this.ui.t0.play();
  18666. }
  18667. videoAddCoin() {
  18668. console.log('zh:qjff_AD_for_UIAddCoin');
  18669. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  18670. }
  18671. else {
  18672. console.log('zh:AD 失败,直接发放奖励');
  18673. this.qjff_AD_for_UIAddCoin();
  18674. }
  18675. }
  18676. qjff_AD_for_UIAddCoin() {
  18677. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  18678. this.hide();
  18679. }
  18680. }
  18681. UIAddCoin$1.uiName = "UIAddCoin";
  18682. class UIInvitation$1 extends UIBase {
  18683. constructor() {
  18684. super();
  18685. }
  18686. onConstructor() {
  18687. this.ui = ui_UIInvitation.createInstance();
  18688. this.contentPane = this.ui;
  18689. this.isEject = false;
  18690. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  18691. }
  18692. show() {
  18693. super.show();
  18694. }
  18695. enterGame() {
  18696. xGame.common.gameMode = GameMode.classic;
  18697. DataMgr.setChallengeTimes(1);
  18698. xGame.common.passAwardCoin = 2000;
  18699. let need = xGame.common.classicNiceNeddCoin;
  18700. if (DataMgr.coinEnough(need)) {
  18701. DataMgr.setCoin(-need);
  18702. xGame.eventMgr.event(RESTART_GAME, true);
  18703. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  18704. }
  18705. else {
  18706. xGame.eventMgr.event(RESTART_GAME, true);
  18707. }
  18708. this.hide();
  18709. }
  18710. hide() {
  18711. super.hide();
  18712. }
  18713. }
  18714. UIInvitation$1.uiName = "UIInvitation";
  18715. class UIPower$1 extends UIBase {
  18716. constructor() {
  18717. super();
  18718. }
  18719. onConstructor() {
  18720. this.ui = ui_UIPower.createInstance();
  18721. this.contentPane = this.ui;
  18722. this.isEject = false;
  18723. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18724. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  18725. }
  18726. show() {
  18727. super.show();
  18728. this.ui.t0.play();
  18729. }
  18730. videoGetPower() {
  18731. console.log('zh:qjff_AD_for_uipower');
  18732. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  18733. }
  18734. else {
  18735. console.log('zh:AD 失败,直接发放奖励');
  18736. this.qjff_AD_for_uipower();
  18737. }
  18738. }
  18739. qjff_AD_for_uipower() {
  18740. DataMgr.setPower(xGame.common.videoPower, true);
  18741. xGame.eventMgr.event(POWER_TIME);
  18742. this.hide();
  18743. }
  18744. }
  18745. UIPower$1.uiName = "UIPower";
  18746. class UIGameEnd$1 extends UIBase {
  18747. constructor() {
  18748. super();
  18749. this.success = false;
  18750. this.awardCoinNum = 1000;
  18751. this.awardDiamondNum = 10;
  18752. }
  18753. onConstructor() {
  18754. this.ui = ui_UIGameEnd.createInstance();
  18755. this.contentPane = this.ui;
  18756. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  18757. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  18758. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  18759. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18760. this.ui.talkNode.visible = false;
  18761. if (Moyu.isKs)
  18762. this.ui.closeNode.closeBtn.x += 100;
  18763. }
  18764. updateType() {
  18765. switch (xGame.common.gameMode) {
  18766. case GameMode.classic:
  18767. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18768. this.ui.coinNode.visible = this.success;
  18769. if (!this.success) {
  18770. Laya.timer.once(500, this, () => {
  18771. xGame.uiMgr.Show(UIAddCoin$1);
  18772. });
  18773. }
  18774. else {
  18775. this.logEventForClassic_win();
  18776. }
  18777. this.ui.isGetAward.visible = false;
  18778. this.ui.leftBtn.c1.selectedIndex = 3;
  18779. this.ui.rightBtn.c1.selectedIndex = 0;
  18780. this.moneyNode.ui.c1.selectedIndex = 1;
  18781. break;
  18782. case GameMode.bigMove:
  18783. console.log('zh:招法模式 aaaaaa bigMove');
  18784. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18785. this.ui.coinNode.visible = this.success;
  18786. if (xGame.common.gameMode == GameMode.bigMove) {
  18787. if (this.success) {
  18788. DataMgr.setSkillSuccessTimes(1, true);
  18789. DataMgr.setSkillAccTimes(1);
  18790. }
  18791. else {
  18792. DataMgr.setSkillSuccessTimes(0, false);
  18793. }
  18794. }
  18795. this.logEventForRod_complete_N();
  18796. if (!this.success) {
  18797. Laya.timer.once(500, this, () => {
  18798. xGame.uiMgr.Show(UIAddCoin$1);
  18799. });
  18800. }
  18801. else {
  18802. this.logEventForRod_win();
  18803. }
  18804. this.ui.isGetAward.visible = false;
  18805. this.ui.leftBtn.c1.selectedIndex = 3;
  18806. this.ui.rightBtn.c1.selectedIndex = 0;
  18807. this.moneyNode.ui.c1.selectedIndex = 1;
  18808. break;
  18809. case GameMode.placeBall:
  18810. this.ui.coinNode.visible = false;
  18811. if (this.success) {
  18812. if (xGame.common.placeBallStarNum == 3) {
  18813. this.ui.c1.selectedIndex = 2;
  18814. }
  18815. else {
  18816. this.ui.c1.selectedIndex = 3;
  18817. }
  18818. let level = xGame.common.placeBallCurLevel;
  18819. if (level > 59) {
  18820. this.logEventForChallenge_level_complete(level);
  18821. }
  18822. else {
  18823. this.logEventForChallenge_level_N(level);
  18824. }
  18825. }
  18826. else {
  18827. this.ui.c1.selectedIndex = 4;
  18828. }
  18829. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18830. if (cfg.type == PlaceBallType.challenge) {
  18831. this.ui.c1.selectedIndex = 2;
  18832. }
  18833. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  18834. this.updatePlaceBallBtn();
  18835. this.updatePlaceBallStarNum();
  18836. this.updatePlaceBallAwardState();
  18837. this.moneyNode.ui.c1.selectedIndex = 2;
  18838. this.moneyNode.checkPowerTime();
  18839. this.moneyNode.powerChange();
  18840. DataMgr.upRankData();
  18841. break;
  18842. default:
  18843. break;
  18844. }
  18845. }
  18846. logEventForRod_complete_N() {
  18847. let gfmsIdx = xGame.common.curPlayerSkillType;
  18848. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  18849. let gfmc = 'Skyfall Shot';
  18850. if (gfmsIdx == 0) {
  18851. gfmc = 'Skyfall Shot';
  18852. }
  18853. if (gfmsIdx == 1) {
  18854. gfmc = 'Surging break';
  18855. }
  18856. if (gfmsIdx == 2) {
  18857. gfmc = 'Frost Lock';
  18858. }
  18859. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  18860. console.log('zh:logEventForRod_complete_N level = ' + level);
  18861. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  18862. let jsonStr = {
  18863. "count": 1,
  18864. "name": gfmc
  18865. };
  18866. if (LocalStorageManager.hasJosnKey(keyStr)) {
  18867. const d = LocalStorageManager.getItem(keyStr);
  18868. jsonStr.count = d.count + 1;
  18869. LocalStorageManager.setItem(keyStr, jsonStr);
  18870. }
  18871. else {
  18872. LocalStorageManager.setItem(keyStr, jsonStr);
  18873. }
  18874. const d2 = LocalStorageManager.getItem(keyStr);
  18875. let count = d2.count;
  18876. console.log('zh:logEventForRod_complete_N count = ' + count);
  18877. if (count % 5 == 0) {
  18878. const reqStr = JSON.stringify(jsonStr);
  18879. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  18880. }
  18881. }
  18882. logEventForRod_win() {
  18883. console.log('zh:logEventForRod_win,胜利');
  18884. let gfmsIdx = xGame.common.curPlayerSkillType;
  18885. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  18886. let gfmc = 'Skyfall Shot';
  18887. if (gfmsIdx == 0) {
  18888. gfmc = 'Skyfall Shot';
  18889. }
  18890. if (gfmsIdx == 1) {
  18891. gfmc = 'Surging break';
  18892. }
  18893. if (gfmsIdx == 2) {
  18894. gfmc = 'Frost Lock';
  18895. }
  18896. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  18897. console.log('zh:logEventForRod_win level = ' + level);
  18898. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  18899. let jsonStr = {
  18900. "count": 1,
  18901. "name": gfmc + ' Lev' + level
  18902. };
  18903. if (LocalStorageManager.hasJosnKey(keyStr)) {
  18904. const d = LocalStorageManager.getItem(keyStr);
  18905. jsonStr.count = d.count + 1;
  18906. LocalStorageManager.setItem(keyStr, jsonStr);
  18907. }
  18908. else {
  18909. LocalStorageManager.setItem(keyStr, jsonStr);
  18910. }
  18911. const reqStr = JSON.stringify(jsonStr);
  18912. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  18913. }
  18914. logEventForClassic_win() {
  18915. console.log('zh:logEventForClassic_win,胜利');
  18916. let rtype = xGame.common.classicRoomType;
  18917. let msmc = '';
  18918. if (rtype == 1) {
  18919. msmc = 'beginner';
  18920. }
  18921. if (rtype == 2) {
  18922. msmc = 'expert';
  18923. }
  18924. if (rtype == 3) {
  18925. msmc = 'master';
  18926. }
  18927. let keyStr = 'sjmd_classic_win_' + rtype;
  18928. let jsonStr = {
  18929. "difficulty": msmc,
  18930. "classic_count": 1,
  18931. "difficulty_count": 1
  18932. };
  18933. if (LocalStorageManager.hasJosnKey(keyStr)) {
  18934. const d = LocalStorageManager.getItem(keyStr);
  18935. jsonStr.classic_count = d.classic_count + 1;
  18936. jsonStr.difficulty_count = d.difficulty_count + 1;
  18937. LocalStorageManager.setItem(keyStr, jsonStr);
  18938. }
  18939. else {
  18940. LocalStorageManager.setItem(keyStr, jsonStr);
  18941. }
  18942. const reqStr = JSON.stringify(jsonStr);
  18943. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  18944. }
  18945. updatePlaceBallBtn() {
  18946. this.ui.leftBtn.c1.selectedIndex = 5;
  18947. if (this.success) {
  18948. this.ui.rightBtn.c1.selectedIndex = 14;
  18949. }
  18950. else {
  18951. if (xGame.common.placeBallStarNum == 3) {
  18952. this.ui.rightBtn.c1.selectedIndex = 14;
  18953. }
  18954. else {
  18955. this.ui.rightBtn.c1.selectedIndex = 1;
  18956. }
  18957. }
  18958. }
  18959. updatePlaceBallStarNum() {
  18960. let starNum = xGame.common.placeBallStarNum;
  18961. if (starNum == 0)
  18962. this.ui.starNumNode.c1.selectedIndex = 3;
  18963. else {
  18964. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18965. }
  18966. }
  18967. updatePlaceBallAwardState() {
  18968. let level = xGame.common.placeBallCurLevel;
  18969. let starNum = xGame.common.placeBallStarNum;
  18970. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18971. let data = cfgTable.placeballData[level].award;
  18972. let cfg = cfgTable.placeballData[level];
  18973. this.awardDiamondNum = data[1];
  18974. this.awardCoinNum = data[0];
  18975. if (cfg.type == PlaceBallType.challenge) {
  18976. this.awardDiamondNum = 0;
  18977. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18978. }
  18979. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18980. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18981. if (cfg.type == PlaceBallType.challenge) {
  18982. this.ui.awardNode.coinNode.visible = true;
  18983. }
  18984. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18985. this.ui.awardNode.diamondNode.x = 265;
  18986. this.ui.awardNode.coinNode.x = 354;
  18987. }
  18988. else {
  18989. this.ui.awardNode.diamondNode.x = 291;
  18990. this.ui.awardNode.coinNode.x = 291;
  18991. }
  18992. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18993. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18994. if (this.awardCoinNum == 0) {
  18995. this.ui.awardNode.coinNode.numTxt.text = "";
  18996. }
  18997. if (getAward) {
  18998. this.ui.isGetAward.visible = true;
  18999. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  19000. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  19001. }
  19002. else {
  19003. this.ui.isGetAward.visible = false;
  19004. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  19005. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  19006. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  19007. }
  19008. else {
  19009. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  19010. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  19011. }
  19012. }
  19013. }
  19014. show(success) {
  19015. super.show();
  19016. xGame.eventMgr.event(RESET_GAME);
  19017. this.success = success;
  19018. Laya.timer.clearAll(this);
  19019. this.playSecretaryAni();
  19020. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  19021. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  19022. offsetTime = Math.floor(offsetTime / 1000);
  19023. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  19024. this.updateType();
  19025. Laya.timer.once(200, this, () => {
  19026. this.addAward(() => {
  19027. this.updateType();
  19028. Laya.timer.once(500, this, () => {
  19029. this.showChallengeLevel();
  19030. });
  19031. });
  19032. });
  19033. if (this.success) {
  19034. JSBridgeUtils.instance.showInternAd('gameend_success');
  19035. console.log('zh:game end 成功');
  19036. xGame.soundMgr.playSound('slots_roll01');
  19037. xGame.soundMgr.playSound("s_win");
  19038. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19039. this.diyGameDataUtilForGameWin();
  19040. }
  19041. else {
  19042. JSBridgeUtils.instance.showInternAd('gameend_faill');
  19043. console.log('zh:game end失败');
  19044. xGame.soundMgr.playSound('matchwin01');
  19045. xGame.soundMgr.playSound("s_lose");
  19046. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19047. }
  19048. let challengeNum = DataMgr.getChallengeTimes();
  19049. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  19050. DataMgr.setChallengeTimes(1);
  19051. }
  19052. if (this.success && xGame.common.gameMode == GameMode.classic) {
  19053. DataMgr.setClassicTimes();
  19054. }
  19055. }
  19056. diyGameDataUtilForGameWin() {
  19057. console.log('zh: DiyGameDataUtilForGameWin diy ');
  19058. switch (xGame.common.gameMode) {
  19059. case GameMode.classic:
  19060. console.log('zh:DiyGameDataUtilForGameWin 111');
  19061. case GameMode.bigMove:
  19062. console.log('zh:DiyGameDataUtilForGameWin 222');
  19063. this.restartGame();
  19064. break;
  19065. case GameMode.placeBall:
  19066. console.log('zh:DiyGameDataUtilForGameWin 333');
  19067. var level = xGame.common.placeBallCurLevel;
  19068. console.log('zh:练习模式 联系了多少LEV=' + level);
  19069. let db_over_lev = DataMgr.getChallengeMode_overLev();
  19070. if (level > db_over_lev) {
  19071. DataMgr.setChallengeMode_overLev(level);
  19072. }
  19073. break;
  19074. default:
  19075. console.log('zh:DiyGameDataUtilForGameWin 444');
  19076. break;
  19077. }
  19078. }
  19079. showChallengeLevel() {
  19080. if (DataMgr.getChallengeTimes() != 0)
  19081. return;
  19082. let skill = DataMgr.getSkillAccTimes();
  19083. let put = DataMgr.getPlaceBallLevelList().length;
  19084. if (skill >= 3 || put >= 5) {
  19085. xGame.uiMgr.Show(UIInvitation$1);
  19086. this.hide();
  19087. }
  19088. }
  19089. addAward(callback) {
  19090. if (!this.success) {
  19091. callback && callback();
  19092. return;
  19093. }
  19094. switch (xGame.common.gameMode) {
  19095. case GameMode.classic:
  19096. this.awardCoinNum = xGame.common.passAwardCoin;
  19097. this.awardDiamondNum = 0;
  19098. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  19099. break;
  19100. case GameMode.bigMove:
  19101. this.awardCoinNum = xGame.common.passAwardCoin;
  19102. this.awardDiamondNum = 0;
  19103. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  19104. callback && callback();
  19105. break;
  19106. case GameMode.placeBall:
  19107. let level = xGame.common.placeBallCurLevel;
  19108. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  19109. if (xGame.common.placeBallStarNum != 3) {
  19110. callback && callback();
  19111. return;
  19112. }
  19113. else {
  19114. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  19115. if (getAward) {
  19116. callback && callback();
  19117. return;
  19118. }
  19119. }
  19120. let cfg = cfgTable.placeballData[level];
  19121. let data = cfgTable.placeballData[level].award;
  19122. this.awardCoinNum = data[0];
  19123. this.awardDiamondNum = data[1];
  19124. if (cfg.type == PlaceBallType.challenge) {
  19125. this.awardDiamondNum = 0;
  19126. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  19127. }
  19128. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  19129. let diamondAward;
  19130. if (this.awardDiamondNum > 0) {
  19131. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  19132. xGame.common.getAward([diamondAward, coinAward], callback);
  19133. }
  19134. else {
  19135. xGame.common.getAward([coinAward], callback);
  19136. }
  19137. if (cfg.type == PlaceBallType.normal) {
  19138. DataMgr.setPlaceBallAward(level);
  19139. }
  19140. break;
  19141. default:
  19142. break;
  19143. }
  19144. }
  19145. playSecretaryAni_old() {
  19146. let parent = this.ui.secretary.displayObject;
  19147. parent.destroyChildren();
  19148. let xx = this.ui.secretary.width / 2;
  19149. let yy = this.ui.secretary.height;
  19150. let scale = xGame.common.getSecretaryScale();
  19151. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19152. if (this.success) {
  19153. let rand = Math.random() <= 0.5 ? 2 : 3;
  19154. xGame.common.secretary.play(data, rand, false, parent, () => {
  19155. xGame.common.secretary.play(data, 1, true, parent);
  19156. });
  19157. }
  19158. else {
  19159. xGame.common.secretary.play(data, 0, true, parent);
  19160. }
  19161. }
  19162. playSecretaryAni() {
  19163. let parent = this.ui.secretary.displayObject;
  19164. parent.destroyChildren();
  19165. let xx = this.ui.secretary.width / 2;
  19166. let yy = this.ui.secretary.height;
  19167. let scale = xGame.common.getSecretaryScale();
  19168. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19169. if (this.success) {
  19170. let rand = 0;
  19171. xGame.common.secretary.play(data, 0, true, parent);
  19172. }
  19173. else {
  19174. xGame.common.secretary.play(data, 0, true, parent);
  19175. }
  19176. }
  19177. restartGame() {
  19178. switch (xGame.common.gameMode) {
  19179. case GameMode.classic:
  19180. xGame.eventMgr.event(RESTART_GAME);
  19181. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19182. break;
  19183. case GameMode.bigMove:
  19184. this.hide();
  19185. xGame.eventMgr.event(RESTART_GAME);
  19186. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19187. break;
  19188. default:
  19189. break;
  19190. }
  19191. }
  19192. hide() {
  19193. super.hide();
  19194. xGame.common.stopGirlPop(this.ui.talkNode);
  19195. PlatMgr.showBanner(false);
  19196. }
  19197. returnHome() {
  19198. this.hide();
  19199. let showFailWords = !this.success;
  19200. xGame.uiMgr.Show(UIMain$1, showFailWords);
  19201. }
  19202. clickLeftBtn() {
  19203. switch (xGame.common.gameMode) {
  19204. case GameMode.classic:
  19205. case GameMode.bigMove:
  19206. this.returnHome();
  19207. break;
  19208. case GameMode.placeBall:
  19209. let level = xGame.common.placeBallCurLevel;
  19210. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  19211. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19212. break;
  19213. default:
  19214. break;
  19215. }
  19216. }
  19217. powerStartPlaceBallLevel(level, btn) {
  19218. if (DataMgr.powerEnough()) {
  19219. btn.touchable = false;
  19220. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  19221. btn.touchable = true;
  19222. DataMgr.setPower(-1);
  19223. xGame.eventMgr.event(POWER_TIME);
  19224. this.startPlaceBallLevel(level);
  19225. this.logEventForChallenge_level_start(level);
  19226. }));
  19227. }
  19228. else {
  19229. xGame.uiMgr.Show(UIPower$1, 0);
  19230. }
  19231. }
  19232. clickRightBtn() {
  19233. switch (xGame.common.gameMode) {
  19234. case GameMode.classic:
  19235. console.log('zh:clickRightBtn 111');
  19236. case GameMode.bigMove:
  19237. console.log('zh:clickRightBtn 222');
  19238. this.restartGame();
  19239. break;
  19240. case GameMode.placeBall:
  19241. console.log('zh:clickRightBtn 333');
  19242. let level = xGame.common.placeBallCurLevel;
  19243. let data = DataMgr.getPlaceBallLevel(level);
  19244. let curPss = data.play && !data.isCur;
  19245. if (curPss) {
  19246. console.log('zh:clickRightBtn 333-111');
  19247. console.log('zh:当前LV=' + level);
  19248. if (level == 60) {
  19249. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  19250. Laya.timer.once(3000, this, () => {
  19251. this.returnHome();
  19252. });
  19253. }
  19254. else {
  19255. let lev = level + 1;
  19256. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  19257. }
  19258. }
  19259. else {
  19260. console.log('zh:clickRightBtn 333-000');
  19261. Moyu.sendDataEvent("placeBallNextLevel");
  19262. console.log('zh:qjff_AD_for_uiGameEnd');
  19263. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  19264. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  19265. }
  19266. else {
  19267. console.log('zh:AD 失败,直接发放奖励');
  19268. this.qjff_AD_for_uiGameEnd(level);
  19269. }
  19270. }
  19271. break;
  19272. default:
  19273. console.log('zh:clickRightBtn 444');
  19274. break;
  19275. }
  19276. }
  19277. logEventForChallenge_level_start(level) {
  19278. let keyStr = 'sjmd_challenge_level_start';
  19279. let jsonStr = {
  19280. "count": 0,
  19281. "gold_balance ": DataMgr.getCoin(),
  19282. "level": level,
  19283. "diamond_balance ": DataMgr.getDiamond()
  19284. };
  19285. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19286. const d = LocalStorageManager.getItem(keyStr);
  19287. if (level > d.level) {
  19288. jsonStr.count = d.count + 1;
  19289. LocalStorageManager.setItem(keyStr, jsonStr);
  19290. }
  19291. else {
  19292. }
  19293. }
  19294. else {
  19295. LocalStorageManager.setItem(keyStr, jsonStr);
  19296. }
  19297. const reqStr = JSON.stringify(jsonStr);
  19298. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  19299. }
  19300. qjff_AD_for_uiGameEnd(level) {
  19301. DataMgr.setPlaceBallLevel(level, 1);
  19302. this.startPlaceBallLevel(level + 1);
  19303. }
  19304. startPlaceBallLevel(level) {
  19305. xGame.common.gameMode = GameMode.placeBall;
  19306. xGame.common.placeBallCurLevel = level;
  19307. xGame.uiMgr.Show(UIGame$1);
  19308. this.hide();
  19309. }
  19310. logEventForChallenge_level_complete(level) {
  19311. let keyStr = 'sjmd_challenge_level_complete';
  19312. let jsonStr = {
  19313. "count": 1,
  19314. "gold_balance ": DataMgr.getCoin(),
  19315. "level": level,
  19316. "diamond_balance ": DataMgr.getDiamond()
  19317. };
  19318. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19319. const d = LocalStorageManager.getItem(keyStr);
  19320. jsonStr.count = d.count + 1;
  19321. LocalStorageManager.setItem(keyStr, jsonStr);
  19322. }
  19323. else {
  19324. LocalStorageManager.setItem(keyStr, jsonStr);
  19325. }
  19326. const reqStr = JSON.stringify(jsonStr);
  19327. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  19328. }
  19329. logEventForChallenge_level_N(level) {
  19330. console.log('zh:logEventForChallenge_level_N ' + level);
  19331. let keyStr = 'sjmd_challenge_level_N';
  19332. if (LocalStorageManager.hasKey(keyStr)) {
  19333. let lev = LocalStorageManager.getItem(keyStr);
  19334. if (level > lev) {
  19335. LocalStorageManager.setItem(keyStr, level);
  19336. }
  19337. if ((level) % 5 == 0) {
  19338. console.log('zh:每5关上报1次');
  19339. let sjmc = 'challenge_level_' + level;
  19340. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  19341. }
  19342. else {
  19343. console.log('zh:5 no 上报');
  19344. }
  19345. }
  19346. else {
  19347. LocalStorageManager.setItem(keyStr, level);
  19348. }
  19349. }
  19350. }
  19351. UIGameEnd$1.uiName = "UIGameEnd";
  19352. class ShowItem$1 {
  19353. constructor() {
  19354. this.ui = ui_ShowItem.createInstance();
  19355. }
  19356. destroySelf() {
  19357. if (!this.ui.isDisposed) {
  19358. this.ui.removeFromParent();
  19359. this.ui.dispose();
  19360. }
  19361. }
  19362. setParent(parent) {
  19363. parent.addChild(this.ui);
  19364. }
  19365. setPos(x, y) {
  19366. this.ui.x = x;
  19367. this.ui.y = y;
  19368. }
  19369. setUrl(index) {
  19370. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  19371. }
  19372. }
  19373. class UILevelProp$1 extends UIBase {
  19374. constructor() {
  19375. super();
  19376. this.firstPos = 385;
  19377. this.secondPos = 467;
  19378. this.showItemArr = [];
  19379. }
  19380. onFontLoaded() {
  19381. try {
  19382. this.ui.myNode.conditionTxt.font = "arial";
  19383. console.log("zh: onFontLoaded 设置arial字体成功");
  19384. }
  19385. catch (error) {
  19386. console.log("zh: constructor onFontLoaded加载arial字体失败");
  19387. }
  19388. }
  19389. onConstructor() {
  19390. this.ui = ui_UILevelProp.createInstance();
  19391. this.contentPane = this.ui;
  19392. this.isEject = false;
  19393. this.addUIClick(this.ui.closeBtn, this.hide);
  19394. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19395. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  19396. }
  19397. show(level) {
  19398. super.show();
  19399. this.ui.t1.play();
  19400. this.level = level;
  19401. this.data = cfgTable.placeballData[this.level];
  19402. this.updateSelf();
  19403. this.showPreView();
  19404. this.moneyNode.ui.c1.selectedIndex = 2;
  19405. this.moneyNode.checkPowerTime();
  19406. this.moneyNode.powerChange();
  19407. }
  19408. showPreView() {
  19409. let item;
  19410. let data;
  19411. for (let index = 0; index < this.showItemArr.length; index++) {
  19412. item = this.showItemArr[index];
  19413. item.destroySelf();
  19414. }
  19415. this.showItemArr = [];
  19416. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  19417. for (const key in cfgData) {
  19418. data = cfgData[key];
  19419. item = new ShowItem$1();
  19420. item.setParent(this.ui.myNode.displayRoot);
  19421. item.setPos(data.x, data.y);
  19422. item.setUrl(data.value);
  19423. this.showItemArr.push(item);
  19424. }
  19425. }
  19426. updateSelf() {
  19427. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  19428. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  19429. if (this.data.ball == -1) {
  19430. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  19431. }
  19432. else {
  19433. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  19434. }
  19435. let localData = DataMgr.getPlaceBallLevel(this.level);
  19436. let getAward = localData.getAward;
  19437. let cfg = cfgTable.placeballData[this.level];
  19438. let coin = this.data.award[0];
  19439. let diamond = this.data.award[1];
  19440. if (cfg.type == PlaceBallType.challenge) {
  19441. diamond = 0;
  19442. coin = 100;
  19443. }
  19444. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  19445. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  19446. this.ui.myNode.coinNode.numTxt.text = coin + "";
  19447. if (cfg.type == PlaceBallType.challenge) {
  19448. this.ui.myNode.coinNode.numTxt.text = "";
  19449. }
  19450. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  19451. if (coin > 0 && diamond > 0) {
  19452. this.ui.myNode.diamondNode.x = 385;
  19453. this.ui.myNode.coinNode.x = 467;
  19454. }
  19455. else {
  19456. this.ui.myNode.diamondNode.x = 385;
  19457. this.ui.myNode.coinNode.x = 385;
  19458. }
  19459. if (!getAward) {
  19460. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  19461. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  19462. }
  19463. else {
  19464. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  19465. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  19466. }
  19467. }
  19468. startGame() {
  19469. if (DataMgr.powerEnough()) {
  19470. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  19471. this.ui.myNode.startBtn.touchable = false;
  19472. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  19473. console.log('zh:startGame ');
  19474. this.ui.myNode.startBtn.touchable = true;
  19475. DataMgr.setPower(-1);
  19476. xGame.eventMgr.event(POWER_TIME);
  19477. xGame.common.gameMode = GameMode.placeBall;
  19478. xGame.common.placeBallCurLevel = this.level;
  19479. xGame.uiMgr.Show(UIGame$1);
  19480. this.logEventForChallenge_level_start(this.level);
  19481. xGame.uiMgr.Hide(UILevelDisplay$1);
  19482. xGame.uiMgr.Hide(UIMain$1);
  19483. this.hide();
  19484. }));
  19485. }
  19486. else {
  19487. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  19488. xGame.uiMgr.Show(UIPower$1);
  19489. }
  19490. }
  19491. logEventForChallenge_level_start(level) {
  19492. let keyStr = 'sjmd_challenge_level_start';
  19493. let jsonStr = {
  19494. "count": 0,
  19495. "gold_balance ": DataMgr.getCoin(),
  19496. "level": level,
  19497. "diamond_balance ": DataMgr.getDiamond()
  19498. };
  19499. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19500. const d = LocalStorageManager.getItem(keyStr);
  19501. if (level > d.level) {
  19502. jsonStr.count = d.count + 1;
  19503. LocalStorageManager.setItem(keyStr, jsonStr);
  19504. }
  19505. else {
  19506. }
  19507. }
  19508. else {
  19509. LocalStorageManager.setItem(keyStr, jsonStr);
  19510. }
  19511. const reqStr = JSON.stringify(jsonStr);
  19512. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  19513. }
  19514. hide() {
  19515. super.hide();
  19516. }
  19517. }
  19518. UILevelProp$1.uiName = "UILevelProp";
  19519. class PutBallLevelDisplay$1 {
  19520. constructor(ui, index) {
  19521. this.index = 0;
  19522. this.ui = ui;
  19523. this.index = index;
  19524. this.ui.onClick(this, this.clickSelf);
  19525. this.updateSelf();
  19526. this.ui.levelTxt.text = (this.index + 1) + "";
  19527. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  19528. this.ui.special.levelTxt.text = (this.index + 1) + "";
  19529. }
  19530. updateSelf() {
  19531. let level = this.index + 1;
  19532. this.data = DataMgr.getPlaceBallLevel(level);
  19533. this.ui.starNode.c1.selectedIndex = this.data.star;
  19534. let isChallenge = cfgTable.placeballData[level].type;
  19535. if (this.data.isCur) {
  19536. if (isChallenge) {
  19537. this.ui.c1.selectedIndex = 5;
  19538. }
  19539. else {
  19540. this.ui.c1.selectedIndex = 2;
  19541. }
  19542. }
  19543. else {
  19544. if (this.data.play) {
  19545. if (this.data.star == 3) {
  19546. this.ui.c1.selectedIndex = 0;
  19547. }
  19548. else {
  19549. this.ui.c1.selectedIndex = 1;
  19550. }
  19551. }
  19552. else {
  19553. if (isChallenge) {
  19554. this.ui.c1.selectedIndex = 4;
  19555. }
  19556. else {
  19557. this.ui.c1.selectedIndex = 3;
  19558. }
  19559. }
  19560. }
  19561. }
  19562. clickSelf() {
  19563. if (!this.data.play)
  19564. return;
  19565. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19566. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  19567. }
  19568. }
  19569. class UILevelDisplay$1 extends UIBase {
  19570. constructor() {
  19571. super();
  19572. }
  19573. onConstructor() {
  19574. this.ui = ui_UILevelDisplay.createInstance();
  19575. this.contentPane = this.ui;
  19576. this.isEject = false;
  19577. this.myList = this.ui.myNode.myList;
  19578. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  19579. this.levelItemArr = [];
  19580. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  19581. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  19582. this.myList.numItems = levelNum;
  19583. if (Moyu.isKs)
  19584. this.ui.closeNode.closeBtn.x += 100;
  19585. }
  19586. levelItemRender(index, target) {
  19587. let item = new PutBallLevelDisplay$1(target, index);
  19588. this.levelItemArr.push(item);
  19589. }
  19590. show() {
  19591. super.show();
  19592. this.updateLevel();
  19593. this.scrollToPlace();
  19594. }
  19595. updateLevel() {
  19596. let temp;
  19597. for (let index = 0; index < this.levelItemArr.length; index++) {
  19598. temp = this.levelItemArr[index];
  19599. temp.updateSelf();
  19600. }
  19601. }
  19602. scrollToPlace() {
  19603. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  19604. let passArr = DataMgr.getPlaceBallLevelList();
  19605. let offest = passArr.length;
  19606. if (offest >= maxNum - 1)
  19607. offest = maxNum - 1;
  19608. this.myList.scrollToView(offest, true, true);
  19609. }
  19610. hide() {
  19611. super.hide();
  19612. }
  19613. }
  19614. UILevelDisplay$1.uiName = "UILevelDisplay";
  19615. class UIMatching$1 extends UIBase {
  19616. constructor() {
  19617. super();
  19618. }
  19619. onConstructor() {
  19620. this.ui = ui_UIMatching.createInstance();
  19621. this.contentPane = this.ui;
  19622. this.isEject = false;
  19623. }
  19624. show(callback) {
  19625. super.show();
  19626. PlatMgr.showBanner(true);
  19627. this.callback = callback;
  19628. let user = Moyu.getUserInfo();
  19629. if (!this.selfPot) {
  19630. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  19631. }
  19632. if (!this.aiPot) {
  19633. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  19634. }
  19635. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  19636. this.ui.selfHead.nameTxt.text = user.nickName;
  19637. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  19638. this.ui.aiHead.nameTxt.text = "???";
  19639. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  19640. this.ui.selfHead.c1.selectedIndex = 0;
  19641. this.ui.aiHead.c1.selectedIndex = 0;
  19642. this.ui.selfHead.x = this.selfPot.x;
  19643. this.ui.selfHead.y = this.selfPot.y;
  19644. this.ui.aiHead.x = this.aiPot.x;
  19645. this.ui.aiHead.y = this.aiPot.y;
  19646. switch (xGame.common.gameMode) {
  19647. case GameMode.classic:
  19648. break;
  19649. case GameMode.bigMove:
  19650. this.initSkillData();
  19651. break;
  19652. default:
  19653. break;
  19654. }
  19655. this.ui.t1.play(Laya.Handler.create(this, () => {
  19656. this.ui.t2.play(Laya.Handler.create(this, () => {
  19657. switch (xGame.common.gameMode) {
  19658. case GameMode.classic:
  19659. this.waitingPeople();
  19660. break;
  19661. case GameMode.bigMove:
  19662. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  19663. break;
  19664. default:
  19665. break;
  19666. }
  19667. }));
  19668. }));
  19669. }
  19670. initSkillData() {
  19671. this.skillSelectData = [];
  19672. let skillUrl = xGame.common.skillIconList;
  19673. let skillName = xGame.common.skillNameList;
  19674. let skillLevel = DataMgr.getBigSkillList();
  19675. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  19676. for (let index = 0; index < 5; index++) {
  19677. let obj = {};
  19678. obj.skillImg = skillUrl[index];
  19679. obj.skillName = skillName[index];
  19680. obj.skillType = skillType[index];
  19681. obj.skillLevel = skillLevel[index];
  19682. this.skillSelectData.push(obj);
  19683. }
  19684. }
  19685. getAISkillLevel(myLevel) {
  19686. let video = xGame.common.upSkillLevel;
  19687. let aiLevel;
  19688. let temp;
  19689. if (video) {
  19690. temp = xGame.common.randomNum(-2, -1);
  19691. }
  19692. else {
  19693. if (myLevel <= 5) {
  19694. temp = xGame.common.randomNum(1, 3);
  19695. }
  19696. else if (myLevel <= 9) {
  19697. temp = xGame.common.randomNum(-2, 1);
  19698. }
  19699. else {
  19700. temp = xGame.common.randomNum(-4, 0);
  19701. }
  19702. }
  19703. aiLevel = temp + myLevel;
  19704. if (aiLevel <= 1)
  19705. aiLevel = 1;
  19706. if (aiLevel >= 10)
  19707. aiLevel = 10;
  19708. return aiLevel;
  19709. }
  19710. getAISkillType() {
  19711. return xGame.common.randomNum(1, 4);
  19712. let successTimes = DataMgr.getSkillSuccessTimes();
  19713. let info = cfgTable.aiskillData[successTimes];
  19714. if (!info) {
  19715. let max = Object.keys(cfgTable.aiskillData).length - 1;
  19716. info = cfgTable.aiskillData[max];
  19717. }
  19718. let dataArr = info.skillselect;
  19719. let myCfg = {};
  19720. for (let index = 0; index < dataArr.length; index++) {
  19721. let temp = dataArr[index].split('-');
  19722. myCfg[temp[0]] = {};
  19723. myCfg[temp[0]].id = parseInt(temp[0]);
  19724. myCfg[temp[0]].weight = parseInt(temp[1]);
  19725. }
  19726. let aiCfg = xGame.common.initWeight(myCfg);
  19727. let curData = xGame.common.getRandomWeightData(aiCfg);
  19728. return parseInt(curData.id);
  19729. }
  19730. getAISkillData(index) {
  19731. let myLevel = this.skillSelectData[index].skillLevel;
  19732. let aiLevel = this.getAISkillLevel(myLevel);
  19733. let aiType = this.getAISkillType() - 1;
  19734. return { aiLevel, aiType } = { aiLevel, aiType };
  19735. }
  19736. skillSelectFinish(index) {
  19737. let aiInfo = this.getAISkillData(index);
  19738. xGame.common.gameMgr.selfCurSkill = index;
  19739. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  19740. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  19741. this.ui.selfHead.c1.selectedIndex = 1;
  19742. this.ui.aiHead.c1.selectedIndex = 1;
  19743. let myData = this.skillSelectData[index];
  19744. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  19745. let guide = DataMgr.getSkillGuide();
  19746. if (guide == 0) {
  19747. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  19748. }
  19749. else {
  19750. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  19751. }
  19752. let aiData = this.skillSelectData[aiInfo.aiType];
  19753. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  19754. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  19755. this.waitingPeople();
  19756. }
  19757. waitingPeople() {
  19758. let time = xGame.common.randomNum(1000, 3000);
  19759. time += 1000;
  19760. Laya.timer.once(time, this, () => {
  19761. this.matchingSuccess();
  19762. });
  19763. }
  19764. matchingSuccess() {
  19765. let gameUI = xGame.common.gameUI;
  19766. let name = gameUI.ui.topNode.aiNameTxt.text;
  19767. let url = gameUI.ui.topNode.aiHeadLoader.url;
  19768. this.ui.aiHead.nameTxt.text = name;
  19769. this.ui.aiHead.headImg.url = url;
  19770. name = gameUI.ui.topNode.selfNameTxt.text;
  19771. url = gameUI.ui.topNode.selfHeadLoader.url;
  19772. this.ui.selfHead.nameTxt.text = name;
  19773. this.ui.selfHead.headImg.url = url;
  19774. this.ui.t3.play(Laya.Handler.create(this, () => {
  19775. this.callback && this.callback();
  19776. this.ui.t4.play(Laya.Handler.create(this, () => {
  19777. this.destroySelf();
  19778. }));
  19779. }));
  19780. }
  19781. destroySelf() {
  19782. this.callback = null;
  19783. this.skillSelectData = null;
  19784. this.selfPot = null;
  19785. this.aiPot = null;
  19786. if (!this.ui.isDisposed) {
  19787. this.ui.removeFromParent();
  19788. this.ui.dispose();
  19789. }
  19790. xGame.uiMgr.destroyUI(this);
  19791. }
  19792. }
  19793. UIMatching$1.uiName = "UIMatching";
  19794. class SkillDisplay$1 {
  19795. constructor(ui, data, uiIndex) {
  19796. this.starX = 0;
  19797. this.starY = 0;
  19798. this.index = 0;
  19799. this.ui = ui;
  19800. this.data = data;
  19801. this.index = uiIndex;
  19802. this.initSelf();
  19803. console.log('zh:SkillDisplay constructor this.skillData=', data);
  19804. }
  19805. initSelf() {
  19806. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  19807. this.ui.nameTxt.text = this.data.name;
  19808. this.ui.describeTxt.text = this.data.describe;
  19809. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  19810. this.ui.startBtn.onClick(this, this.startGame);
  19811. this.updateSelf();
  19812. }
  19813. updateSelf() {
  19814. this.checkTry();
  19815. let level = DataMgr.getBigSkillByIndex(this.index);
  19816. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  19817. }
  19818. checkTry() {
  19819. let index = this.index;
  19820. let level = DataMgr.getBigSkillByIndex(index);
  19821. if (level == null) {
  19822. DataMgr.setBigSkill(index, 1, false);
  19823. level = 1;
  19824. }
  19825. this.ui.levelTxt.text = "LV." + level;
  19826. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  19827. this.ui.tryNode.visible = true;
  19828. else
  19829. this.ui.tryNode.visible = false;
  19830. }
  19831. clickAddLevel() {
  19832. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19833. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  19834. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  19835. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  19836. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19837. }
  19838. else {
  19839. console.log('zh:AD 失败,直接发放奖励');
  19840. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19841. }
  19842. }
  19843. qjff_AD_for_skilldisplay_clickAddLevel() {
  19844. DataMgr.setBigSkill(this.data.index, 1);
  19845. this.updateSelf();
  19846. xGame.common.upSkillLevel = true;
  19847. }
  19848. startGame() {
  19849. console.log('zh:rod skill startgame');
  19850. if (this.data.index == 3) {
  19851. alert('Coming soon!');
  19852. return;
  19853. }
  19854. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19855. let needCoin = xGame.common.bigMoveNeedCoin;
  19856. xGame.common.passAwardCoin = 2000;
  19857. let guide = DataMgr.getSkillGuide();
  19858. console.log('zh:startGame guide=' + guide);
  19859. xGame.common.temSelfLevel = 0;
  19860. if (guide == 0) {
  19861. needCoin = 0;
  19862. xGame.common.temSelfLevel = 100;
  19863. }
  19864. if (DataMgr.coinEnough(needCoin)) {
  19865. DataMgr.setCoin(-needCoin);
  19866. xGame.common.curPlayerSkillType = this.index;
  19867. if (guide == 0)
  19868. xGame.common.curPlayerSkillType = 0;
  19869. console.log('zh: skilldisplay 1');
  19870. xGame.uiMgr.Show(UIGame$1);
  19871. xGame.uiMgr.Hide(UIMain$1);
  19872. xGame.uiMgr.Show(UIMatching$1, () => {
  19873. xGame.common.gameUI.ui.alpha = 1;
  19874. xGame.common.gameUI.startGame();
  19875. xGame.uiMgr.Hide(UISkill$1);
  19876. });
  19877. this.logEventForRod_start();
  19878. }
  19879. else {
  19880. console.log('zh: skilldisplay 2');
  19881. xGame.uiMgr.Show(UIAddProp$1, 0);
  19882. Moyu.sendDataEvent("AddCoinVideo");
  19883. }
  19884. }
  19885. logEventForRod_start() {
  19886. let gfmsIdx = xGame.common.curPlayerSkillType;
  19887. console.log('zh:选择的技能=' + gfmsIdx);
  19888. let gfmc = 'Skyfall Shot';
  19889. if (gfmsIdx == 0) {
  19890. gfmc = 'Skyfall Shot';
  19891. }
  19892. if (gfmsIdx == 1) {
  19893. gfmc = 'Surging break';
  19894. }
  19895. if (gfmsIdx == 2) {
  19896. gfmc = 'Frost Lock';
  19897. }
  19898. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  19899. let jsonStr = {
  19900. "count": 1,
  19901. "name": gfmc
  19902. };
  19903. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19904. const d = LocalStorageManager.getItem(keyStr);
  19905. jsonStr.count = d.count + 1;
  19906. LocalStorageManager.setItem(keyStr, jsonStr);
  19907. }
  19908. else {
  19909. LocalStorageManager.setItem(keyStr, jsonStr);
  19910. }
  19911. const reqStr = JSON.stringify(jsonStr);
  19912. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  19913. }
  19914. }
  19915. class UISkill$1 extends UIBase {
  19916. constructor() {
  19917. super();
  19918. this.skillData = [];
  19919. }
  19920. onConstructor() {
  19921. this.ui = ui_UISkill.createInstance();
  19922. this.contentPane = this.ui;
  19923. this.isEject = false;
  19924. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19925. this.initSkillData();
  19926. console.log('zh:aaaaaa1111111111');
  19927. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  19928. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  19929. console.log('zh:aaaaaa22222222');
  19930. this.displayList = [];
  19931. this.ui.skillNode.skillList.numItems = 3;
  19932. this.addUIClick(this.ui, this.interuptSecretary);
  19933. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  19934. this.ui.talkNode.visible = false;
  19935. if (Moyu.isKs)
  19936. this.ui.closeNode.closeBtn.x += 100;
  19937. }
  19938. show() {
  19939. super.show();
  19940. this.playSecretaryIdle();
  19941. this.moneyNode.ui.c1.selectedIndex = 1;
  19942. Laya.timer.clearAll(this);
  19943. xGame.soundMgr.playSound("s_start");
  19944. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19945. let guide = DataMgr.getSkillGuide();
  19946. this.ui.guideNode.visible = guide == 0;
  19947. let item = this.getSkillItemByUIIndex(0);
  19948. if (guide == 0) {
  19949. item.ui.c1.selectedIndex = 1;
  19950. }
  19951. else {
  19952. item.ui.c1.selectedIndex = 0;
  19953. }
  19954. this.ui.guideNode.guideBtn.visible = guide == 0;
  19955. for (let index = 0; index < this.displayList.length; index++) {
  19956. this.displayList[index].checkTry();
  19957. }
  19958. }
  19959. getSkillItemByUIIndex(cur) {
  19960. for (let index = 0; index < this.displayList.length; index++) {
  19961. if (this.displayList[index].index == cur) {
  19962. return this.displayList[index];
  19963. }
  19964. }
  19965. }
  19966. enterGuideLevel() {
  19967. let item = this.getSkillItemByUIIndex(0);
  19968. item.startGame();
  19969. if (DataMgr.getNewUser())
  19970. Moyu.sendDataEvent("gameStart1");
  19971. }
  19972. initSkillData() {
  19973. this.skillData = [];
  19974. let nameList = xGame.common.skillNameList;
  19975. let iconList = xGame.common.skillIconList;
  19976. let describeList = [
  19977. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  19978. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
  19979. "The power of frost descends—freezing the flow and taking full control of the game!"
  19980. ];
  19981. console.log('zh:initSkillData 111111111');
  19982. let data;
  19983. for (let index = 0; index < nameList.length; index++) {
  19984. data = {};
  19985. data.name = nameList[index];
  19986. data.icon = iconList[index];
  19987. data.describe = describeList[index];
  19988. data.index = index;
  19989. this.skillData.push(data);
  19990. }
  19991. }
  19992. updateSkillItem(index, target) {
  19993. if (this.displayList[index] == null) {
  19994. let uiIndex;
  19995. switch (index) {
  19996. case 0:
  19997. uiIndex = 1;
  19998. break;
  19999. case 1:
  20000. uiIndex = 0;
  20001. break;
  20002. case 2:
  20003. uiIndex = 2;
  20004. break;
  20005. case 3:
  20006. uiIndex = 3;
  20007. break;
  20008. default:
  20009. break;
  20010. }
  20011. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  20012. this.displayList.push(temp);
  20013. }
  20014. }
  20015. playSecretaryIdle() {
  20016. let parent = this.ui.secretary.displayObject;
  20017. parent.destroyChildren();
  20018. let xx = this.ui.secretary.width / 2;
  20019. let yy = this.ui.secretary.height;
  20020. let scale = xGame.common.getSecretaryScale();
  20021. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20022. xGame.common.secretary.play(data, 0, true, parent);
  20023. }
  20024. returnUIMain() {
  20025. this.hide();
  20026. xGame.common.stopGirlPop(this.ui.talkNode);
  20027. xGame.uiMgr.Show(UIMain$1);
  20028. }
  20029. interuptSecretary() {
  20030. Laya.timer.clearAll(this);
  20031. this.playSecretaryRandomSound();
  20032. }
  20033. playSecretaryRandomSound() {
  20034. if (this.isHide)
  20035. return;
  20036. let time = xGame.common.randomNum(45000, 60000);
  20037. Laya.timer.once(time, this, () => {
  20038. if (this.isHide)
  20039. return;
  20040. let index = xGame.common.randomNum(4, 7);
  20041. xGame.soundMgr.playSound("s_main0" + index);
  20042. let words = 1;
  20043. switch (index) {
  20044. case 4:
  20045. words = 5;
  20046. break;
  20047. case 5:
  20048. words = 3;
  20049. break;
  20050. case 6:
  20051. words = 6;
  20052. break;
  20053. case 7:
  20054. words = 7;
  20055. break;
  20056. default:
  20057. break;
  20058. }
  20059. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20060. this.playSecretaryRandomSound();
  20061. });
  20062. }
  20063. }
  20064. UISkill$1.uiName = "UISkill";
  20065. class UIAddProp$1 extends UIBase {
  20066. constructor() {
  20067. super();
  20068. this.curType = "";
  20069. }
  20070. onConstructor() {
  20071. this.ui = ui_UIAddProp.createInstance();
  20072. this.contentPane = this.ui;
  20073. this.isEject = false;
  20074. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  20075. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  20076. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  20077. this.updateUI();
  20078. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  20079. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  20080. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  20081. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  20082. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  20083. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  20084. }
  20085. show(type) {
  20086. super.show();
  20087. this.curType = type == 0 ? "coin" : "diamond";
  20088. this.switchBtn("");
  20089. this.ui.t0.play();
  20090. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  20091. PlatMgr.showInsert(true);
  20092. }
  20093. closeSelf() {
  20094. this.hide();
  20095. }
  20096. updateUI() {
  20097. let data = cfgTable.moneyData;
  20098. let temp;
  20099. let obj;
  20100. for (const key in data) {
  20101. temp = data[key];
  20102. obj = this.ui.myNode["node" + key];
  20103. if (parseInt(key) <= 2) {
  20104. obj.diamondTxt.text = "+" + temp.num;
  20105. }
  20106. else {
  20107. obj.coinTxt.text = temp.num;
  20108. obj.diamondTxt.text = temp.get.split('_')[1];
  20109. }
  20110. }
  20111. this.updateDiamondShare();
  20112. }
  20113. updateDiamondShare() {
  20114. let data = DataMgr.getShareDiamondTimes();
  20115. if (data >= xGame.common.maxShareDiamondTimes) {
  20116. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  20117. this.ui.myNode.node1.touchable = false;
  20118. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  20119. }
  20120. else {
  20121. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  20122. this.ui.myNode.node1.touchable = true;
  20123. }
  20124. }
  20125. switchBtn(type) {
  20126. if (type == "")
  20127. type = this.curType;
  20128. else {
  20129. if (this.curType == type) {
  20130. return;
  20131. }
  20132. else {
  20133. this.curType = type;
  20134. }
  20135. }
  20136. if (type == "coin") {
  20137. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  20138. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  20139. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  20140. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  20141. this.ui.myNode.c1.selectedIndex = 0;
  20142. }
  20143. else {
  20144. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  20145. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  20146. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  20147. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  20148. this.ui.myNode.c1.selectedIndex = 1;
  20149. }
  20150. }
  20151. convertCoin(index) {
  20152. let data = cfgTable.moneyData[index];
  20153. let coinNum = data.num;
  20154. let str = data.get.split('_')[1];
  20155. let needDiamond = parseInt(str);
  20156. if (DataMgr.diamondEnough(needDiamond)) {
  20157. DataMgr.setDiamond(-needDiamond);
  20158. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  20159. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  20160. }
  20161. else {
  20162. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  20163. this.switchBtn("diamond");
  20164. }
  20165. }
  20166. videoGetDiamond() {
  20167. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  20168. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  20169. }
  20170. else {
  20171. console.log('zh:AD 失败,直接发放奖励');
  20172. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  20173. }
  20174. }
  20175. qjff_AD_for_uiAddProp_videoGetDiamond() {
  20176. let num = cfgTable.moneyData[2].num;
  20177. xGame.common.playObjFlyAnim(num, Prop.diamond);
  20178. this.closeSelf();
  20179. }
  20180. videoGetCoin() {
  20181. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  20182. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  20183. }
  20184. else {
  20185. console.log('zh:AD 失败,直接发放奖励');
  20186. this.qjff_AD_for_uiAddProp_videoGetCoin();
  20187. }
  20188. }
  20189. qjff_AD_for_uiAddProp_videoGetCoin() {
  20190. xGame.common.playObjFlyAnim(2000, Prop.coin);
  20191. this.closeSelf();
  20192. }
  20193. shareGetDiamond() {
  20194. let times = DataMgr.getShareDiamondTimes();
  20195. if (times >= xGame.common.maxShareDiamondTimes) {
  20196. console.log('zh: 233333333333 maxShareDiamondTimes');
  20197. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  20198. }
  20199. else {
  20200. console.log('zh:33333333333333ad');
  20201. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  20202. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  20203. }
  20204. else {
  20205. console.log('zh:AD 失败,直接发放奖励');
  20206. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  20207. }
  20208. }
  20209. }
  20210. qjff_AD_for_uiAddProp_shareGetDiamond() {
  20211. let diamond = xGame.common.randomNum(50, 100);
  20212. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  20213. DataMgr.setShareDiamondTimes(1);
  20214. this.updateDiamondShare();
  20215. }
  20216. openPutBallView() {
  20217. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  20218. let skill = xGame.uiMgr.getUI(UISkill$1);
  20219. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  20220. let uigame = xGame.uiMgr.getUI(UIGame$1);
  20221. if (end && !end.isHide) {
  20222. xGame.uiMgr.Hide(UIGameEnd$1);
  20223. xGame.uiMgr.Show(UIMain$1);
  20224. }
  20225. if (skill && !skill.isHide)
  20226. xGame.uiMgr.Hide(UISkill$1);
  20227. if (uigame && !uigame.isHide)
  20228. xGame.uiMgr.Hide(UIGame$1);
  20229. if (level && !level.isHide) {
  20230. }
  20231. else {
  20232. xGame.uiMgr.Show(UILevelDisplay$1);
  20233. }
  20234. this.closeSelf();
  20235. }
  20236. }
  20237. UIAddProp$1.uiName = "UIAddProp";
  20238. class MoneyNode$1 {
  20239. constructor(ui) {
  20240. this.leftTime = 0;
  20241. this.ui = ui;
  20242. this.ui.addCoinBtn.onClick(this, this.addCoin);
  20243. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  20244. this.ui.addPowerBtn.onClick(this, this.addPower);
  20245. this.ui.c1.selectedIndex = 1;
  20246. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  20247. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  20248. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  20249. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  20250. this.coinChange();
  20251. this.diamondChange();
  20252. this.powerChange();
  20253. }
  20254. addPower() {
  20255. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20256. xGame.uiMgr.Show(UIPower$1);
  20257. }
  20258. powerChange() {
  20259. let powerNum = DataMgr.getPower();
  20260. this.ui.powerTxt.text = powerNum + "";
  20261. }
  20262. checkPowerTime() {
  20263. let cur = new Date().getTime();
  20264. let last = DataMgr.getPowerTime();
  20265. if (last == 0) {
  20266. last = cur;
  20267. DataMgr.setPowerTime(cur);
  20268. }
  20269. let power = DataMgr.getPower();
  20270. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  20271. Laya.timer.clearAll(this);
  20272. if (power >= xGame.common.natureMaxPower) {
  20273. this.ui.powerTimeTxt.text = "";
  20274. DataMgr.setPowerTime(cur);
  20275. return;
  20276. }
  20277. if (power + offset >= xGame.common.natureMaxPower) {
  20278. DataMgr.setPower(xGame.common.natureMaxPower, false);
  20279. this.ui.powerTimeTxt.text = "";
  20280. DataMgr.setPowerTime(cur);
  20281. }
  20282. else {
  20283. if (offset > 0) {
  20284. DataMgr.setPower(offset);
  20285. DataMgr.setPowerTime(cur);
  20286. }
  20287. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  20288. this.leftTime = xGame.common.powerRecoverNum - time;
  20289. if (this.leftTime <= 0)
  20290. this.leftTime = 0;
  20291. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  20292. Laya.timer.loop(1000, this, this.updatePowerTime);
  20293. }
  20294. }
  20295. updatePowerTime() {
  20296. this.leftTime -= 1;
  20297. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  20298. if (this.leftTime <= 0) {
  20299. this.checkPowerTime();
  20300. }
  20301. }
  20302. coinChange() {
  20303. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  20304. }
  20305. diamondChange() {
  20306. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  20307. }
  20308. addCoin() {
  20309. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20310. Moyu.sendDataEvent("AddCoinBtn");
  20311. xGame.uiMgr.Show(UIAddProp$1, 0);
  20312. }
  20313. addDiamond() {
  20314. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20315. Moyu.sendDataEvent("AddDiamondBtn");
  20316. xGame.uiMgr.Show(UIAddProp$1, 1);
  20317. }
  20318. }
  20319. class SettingNode$1 {
  20320. constructor(ui) {
  20321. this.showSetting = false;
  20322. this.openSound = true;
  20323. this.openShake = true;
  20324. this.ui = ui;
  20325. this.ui.soundBtn.onClick(this, this.switchSound);
  20326. this.ui.shakeBtn.onClick(this, this.switchShake);
  20327. this.ui.xyBtn.onClick(this, this.onXy);
  20328. this.ui.clickNode.onClick(this, this.changeSetting);
  20329. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  20330. this.ui.xyBtn.visible = false;
  20331. this.ui.shakeBtn.visible = false;
  20332. }
  20333. changeSetting() {
  20334. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20335. this.showSetting = !this.showSetting;
  20336. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  20337. }
  20338. switchSound() {
  20339. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20340. this.openSound = !this.openSound;
  20341. Moyu.onSetting(this.openSound, this.openShake);
  20342. xGame.soundMgr.onSetting(this.openSound);
  20343. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  20344. }
  20345. switchShake() {
  20346. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20347. this.openShake = !this.openShake;
  20348. Moyu.onSetting(this.openSound, this.openShake);
  20349. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  20350. }
  20351. onXy() {
  20352. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20353. MoyuMgr$1.showXy(1);
  20354. }
  20355. }
  20356. class UIDraw$1 extends UIBase {
  20357. constructor() {
  20358. super();
  20359. this.curKey = 0;
  20360. }
  20361. onConstructor() {
  20362. this.ui = ui_UIDraw.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.addUIClick(this.ui.drawBtn, this.startDraw);
  20368. this.initDraw();
  20369. this.initUI();
  20370. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  20371. if (Moyu.isKs)
  20372. this.ui.closeNode.closeBtn.x += 100;
  20373. }
  20374. show() {
  20375. super.show();
  20376. this.ui.t0.play();
  20377. this.playSecretaryIdle();
  20378. this.updateDraw();
  20379. this.checkFree();
  20380. if (PlatMgr.bannerDelay > 0) {
  20381. this.ui.closeNode.closeBtn.visible = false;
  20382. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  20383. this.ui.closeNode.closeBtn.visible = true;
  20384. });
  20385. }
  20386. PlatMgr.showRateBanner();
  20387. }
  20388. hide() {
  20389. Laya.timer.clearAll(this);
  20390. super.hide();
  20391. }
  20392. checkFree() {
  20393. let isFree = DataMgr.getDailyfreeDrawTimes();
  20394. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  20395. }
  20396. initDraw() {
  20397. this.drawObj = [];
  20398. let data = cfgTable.drawData;
  20399. let temp;
  20400. let weight = 0;
  20401. for (const key in data) {
  20402. temp = data[key];
  20403. weight += temp.weight;
  20404. this.drawObj.push(weight);
  20405. }
  20406. this.allWeight = weight;
  20407. }
  20408. initUI() {
  20409. let data = cfgTable.drawData;
  20410. let temp;
  20411. let img;
  20412. let txt;
  20413. for (const key in data) {
  20414. temp = data[key];
  20415. img = this.ui.myNode.rotNode["img" + key];
  20416. txt = this.ui.myNode.rotNode["txt" + key];
  20417. img.url = xGame.common.getGameIconUrl(temp.icon);
  20418. txt.visible = true;
  20419. if (temp.award > 2) {
  20420. img.rotation = 0;
  20421. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  20422. }
  20423. else {
  20424. img.rotation = temp.rotation;
  20425. txt.text = temp.num;
  20426. }
  20427. }
  20428. }
  20429. getCurkey() {
  20430. let rand = Math.random() * this.allWeight;
  20431. let temp;
  20432. for (let index = 0; index < this.drawObj.length - 1; index++) {
  20433. temp = this.drawObj[index];
  20434. if (index == 0) {
  20435. if (rand < temp) {
  20436. return index + 1;
  20437. }
  20438. }
  20439. else {
  20440. if (rand >= temp && rand < this.drawObj[index + 1]) {
  20441. return index + 1;
  20442. }
  20443. }
  20444. }
  20445. return 2;
  20446. }
  20447. startDraw() {
  20448. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  20449. if (freeTimes > 0) {
  20450. this.beginDraw();
  20451. DataMgr.setDailyfreeDrawTimes(0);
  20452. this.checkFree();
  20453. }
  20454. else {
  20455. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  20456. }
  20457. else {
  20458. console.log('zh:AD 失败,直接发放奖励');
  20459. this.qjff_chouJiang();
  20460. }
  20461. }
  20462. }
  20463. qjff_chouJiang() {
  20464. this.beginDraw();
  20465. }
  20466. beginDraw() {
  20467. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  20468. this.ui.drawBtn.touchable = false;
  20469. this.curKey = this.getCurkey();
  20470. console.log("当前key", this.curKey);
  20471. let cell = 60;
  20472. let lap = 3;
  20473. let angle = cell * (this.curKey - 1) + lap * 360;
  20474. let target = this.ui.myNode.rotNode;
  20475. target.rotation = 0;
  20476. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  20477. console.log("旋转完成");
  20478. this.ui.drawBtn.touchable = true;
  20479. this.getAward();
  20480. }));
  20481. }
  20482. getAward() {
  20483. let data = cfgTable.drawData[this.curKey];
  20484. let temp = new AwardType();
  20485. temp.type = data.award;
  20486. temp.num = data.num;
  20487. xGame.common.getAward([temp], () => {
  20488. DataMgr.setDrawTimes(1);
  20489. this.updateDraw();
  20490. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  20491. });
  20492. }
  20493. updateDraw() {
  20494. let drawTimes = DataMgr.getDrawTimes();
  20495. let awardTimes = DataMgr.getDrawAwardTimes();
  20496. if (Math.floor(drawTimes / 3) > awardTimes) {
  20497. this.ui.extraNode.boxBtn.t0.play(null, -1);
  20498. this.ui.extraNode.boxBtn.touchable = true;
  20499. this.ui.extraNode.tipsTxt.text = "3/3";
  20500. this.ui.extraNode.barNode.width = 265;
  20501. this.getExtraAward();
  20502. }
  20503. else {
  20504. this.ui.extraNode.boxBtn.t0.stop();
  20505. this.ui.extraNode.boxBtn.touchable = false;
  20506. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  20507. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  20508. }
  20509. let data = cfgTable.drawData[1];
  20510. if (awardTimes == 0) {
  20511. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  20512. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  20513. this.ui.myNode.rotNode.img1.rotation = 0;
  20514. }
  20515. else {
  20516. let award = data.nextid;
  20517. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  20518. this.ui.myNode.rotNode.txt1.text = award[1];
  20519. this.ui.myNode.rotNode.img1.rotation = 0;
  20520. }
  20521. }
  20522. getExtraAward() {
  20523. let drawTimes = DataMgr.getDrawTimes();
  20524. let awardTimes = DataMgr.getDrawAwardTimes();
  20525. let data = cfgTable.drawData[1];
  20526. let award = new AwardType();
  20527. if (awardTimes == 0) {
  20528. award.num = data.num;
  20529. award.type = data.award;
  20530. xGame.common.getAward([award], () => {
  20531. let all = Math.floor(drawTimes / 3);
  20532. DataMgr.setDrawAwardTimes(all);
  20533. this.updateDraw();
  20534. });
  20535. }
  20536. else {
  20537. award.num = parseInt(data.nextid[1]);
  20538. award.type = parseInt(data.nextid[0]);
  20539. xGame.common.getAward([award], () => {
  20540. let all = Math.floor(drawTimes / 3);
  20541. DataMgr.setDrawAwardTimes(all);
  20542. this.updateDraw();
  20543. });
  20544. }
  20545. }
  20546. closeSelf() {
  20547. this.hide();
  20548. }
  20549. playSecretaryIdle() {
  20550. let parent = this.ui.secretary.displayObject;
  20551. parent.destroyChildren();
  20552. let xx = this.ui.secretary.width / 2;
  20553. let yy = this.ui.secretary.height;
  20554. let scale = xGame.common.getSecretaryScale();
  20555. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20556. xGame.common.secretary.play(data, 0, true, parent);
  20557. }
  20558. }
  20559. UIDraw$1.uiName = "UIDraw";
  20560. class UIRanking$1 extends UIBase {
  20561. constructor() {
  20562. super();
  20563. this.showSelf = true;
  20564. this.rankType = 1;
  20565. this.rankList = [];
  20566. this.topX = 10;
  20567. this.myIndex = this.topX + 1;
  20568. this.myStar = 0;
  20569. }
  20570. onConstructor() {
  20571. this.ui = ui_UIRanking.createInstance();
  20572. this.contentPane = this.ui;
  20573. this.isEject = false;
  20574. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  20575. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  20576. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  20577. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  20578. this.ui.myNode.myList.setVirtual();
  20579. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  20580. }
  20581. show() {
  20582. super.show();
  20583. this.getPaiHangBangDataFormJosnFile();
  20584. this.updateSelf();
  20585. let self = Moyu.getUserInfo();
  20586. if (!self.isAuth) {
  20587. Moyu.initUser(this, () => {
  20588. DataMgr.upRankData();
  20589. });
  20590. }
  20591. }
  20592. getPaiHangBangDataFormJosnFile() {
  20593. const rankingList = cfgTable.paiHangBangData.list;
  20594. this.updateItemData(rankingList);
  20595. }
  20596. updateSelfItem() {
  20597. console.log('zh:Moyu.platType =' + Moyu.platType);
  20598. let self = Moyu.getUserInfo();
  20599. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  20600. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  20601. if (this.myIndex > this.topX) {
  20602. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  20603. }
  20604. else {
  20605. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  20606. }
  20607. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  20608. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  20609. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  20610. }
  20611. updateItemData(data) {
  20612. this.myStar = xGame.common.getAllStarNum();
  20613. if (this.rankList.length < 2) {
  20614. this.rankList = data;
  20615. let self = Moyu.getUserInfo();
  20616. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  20617. self.headIcon = self.headIcon;
  20618. for (let i = 0; i < data.length; i++) {
  20619. let data = this.rankList[i];
  20620. if (data.userId == self.userId) {
  20621. this.rankList.splice(i, 1);
  20622. break;
  20623. }
  20624. }
  20625. for (let i = 0; i < data.length; i++) {
  20626. let data = this.rankList[i];
  20627. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  20628. this.myIndex = i + 1;
  20629. let user = { headIcon: self.headIcon, nickName: "myself" };
  20630. let ud = { user: user, data: {} };
  20631. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  20632. console.log('zh:Moyu.platType = ' + Moyu.platType);
  20633. if (Moyu.platType < 11) {
  20634. user.headIcon = self.headIcon;
  20635. user.nickName = self.nickName;
  20636. }
  20637. this.rankList.splice(i, 0, md);
  20638. break;
  20639. }
  20640. }
  20641. }
  20642. this.updateSelfItem();
  20643. this.ui.myNode.myList.numItems = this.rankList.length;
  20644. }
  20645. updateItemUI(index, obj) {
  20646. let data = this.rankList[index];
  20647. let userData = JSON.parse(data.userData).user;
  20648. obj.nameTxt.text = userData.nickName.toString();
  20649. obj.valueTxt.text = data.rankScore;
  20650. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  20651. obj.rankTxt.text = index + 1;
  20652. switch (index) {
  20653. case 0:
  20654. this.setImg(obj, 1, 0, 0);
  20655. obj.rankTxt.color = "#FFC047";
  20656. break;
  20657. case 1:
  20658. this.setImg(obj, 0, 1, 0);
  20659. obj.rankTxt.color = "#ACACAC";
  20660. break;
  20661. case 2:
  20662. this.setImg(obj, 0, 0, 1);
  20663. obj.rankTxt.color = "#D09672";
  20664. break;
  20665. default:
  20666. this.setImg(obj, 0, 0, 0);
  20667. obj.rankTxt.color = "#496FAB";
  20668. break;
  20669. }
  20670. }
  20671. setImg(obj, a, b, c) {
  20672. obj.img1.visible = a ? true : false;
  20673. obj.img2.visible = b ? true : false;
  20674. obj.img3.visible = c ? true : false;
  20675. }
  20676. changeList(type) {
  20677. this.rankType = type;
  20678. this.updateSelf();
  20679. }
  20680. changeSelfNode() {
  20681. this.showSelf = !this.showSelf;
  20682. this.updateSelf();
  20683. }
  20684. updateSelf() {
  20685. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  20686. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  20687. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  20688. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  20689. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  20690. }
  20691. }
  20692. UIRanking$1.uiName = "UIRanking";
  20693. class UISecretary$1 extends UIBase {
  20694. constructor() {
  20695. super();
  20696. this.curIndex = 1;
  20697. }
  20698. onConstructor() {
  20699. this.ui = ui_UISecretary.createInstance();
  20700. this.contentPane = this.ui;
  20701. this.isEject = false;
  20702. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  20703. this.nodeObj = { left: null, right: null, cur: null };
  20704. this.nodeObj.cur = this.ui.myNode.gameNode3;
  20705. }
  20706. show() {
  20707. super.show();
  20708. this.ui.t0.play();
  20709. this.updateData();
  20710. }
  20711. addSecretarySpine(node, spineName) {
  20712. if (spineName == "mishu") {
  20713. if (this.secretarySpine1) {
  20714. node.displayObject.destroyChildren();
  20715. this.playWoman(this.secretarySpine1, node.displayObject);
  20716. }
  20717. else {
  20718. let spine1 = new SpineMgr("mishu", () => {
  20719. this.secretarySpine1 = spine1;
  20720. this.playWoman(this.secretarySpine1, node.displayObject);
  20721. });
  20722. }
  20723. }
  20724. else {
  20725. if (this.secretarySpine2) {
  20726. node.displayObject.destroyChildren();
  20727. this.playWoman(this.secretarySpine2, node.displayObject);
  20728. }
  20729. else {
  20730. let spine2 = new SpineMgr("xiaomishu2", () => {
  20731. this.secretarySpine2 = spine2;
  20732. this.playWoman(this.secretarySpine2, node.displayObject);
  20733. });
  20734. }
  20735. }
  20736. }
  20737. playWoman(node, parent) {
  20738. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  20739. let yy = this.ui.myNode.gameNode3.secretary.height;
  20740. let scale = 1.5;
  20741. if (node == this.secretarySpine2) {
  20742. scale = 1.2;
  20743. }
  20744. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20745. node.play(data, 0, true, parent);
  20746. }
  20747. turnLeft() {
  20748. this.curIndex--;
  20749. if (this.curIndex < 1) {
  20750. this.curIndex = 2;
  20751. }
  20752. let left = this.nodeObj.left;
  20753. let right = this.nodeObj.right;
  20754. let cur = this.nodeObj.cur;
  20755. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  20756. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  20757. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  20758. this.updateData();
  20759. }));
  20760. this.ui.myNode.setChildIndex(right, 2);
  20761. this.nodeObj.left = cur;
  20762. this.nodeObj.right = left;
  20763. this.nodeObj.cur = right;
  20764. }
  20765. turnRight() {
  20766. this.curIndex++;
  20767. if (this.curIndex > 2) {
  20768. this.curIndex = 1;
  20769. }
  20770. let left = this.nodeObj.left;
  20771. let right = this.nodeObj.right;
  20772. let cur = this.nodeObj.cur;
  20773. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  20774. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  20775. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  20776. this.updateData();
  20777. }));
  20778. this.ui.myNode.setChildIndex(left, 2);
  20779. this.nodeObj.left = right;
  20780. this.nodeObj.right = cur;
  20781. this.nodeObj.cur = left;
  20782. }
  20783. updateData() {
  20784. console.log('zh: updateData FFFFFFFFFF');
  20785. let data = cfgTable.secretaryshopData;
  20786. let children = this.ui.myNode._children;
  20787. let temp;
  20788. let curData;
  20789. for (let index = 0; index < children.length; index++) {
  20790. temp = children[index];
  20791. curData = data[1];
  20792. temp.heightTxt.text = curData.height;
  20793. temp.foodTxt.text = curData.food;
  20794. temp.historyTxt.text = curData.history;
  20795. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  20796. this.addSecretarySpine(temp.secretary, curData.spine);
  20797. let womanIndex = curData.id - 1;
  20798. let getWoman = DataMgr.getSecretary(womanIndex);
  20799. let curUse = DataMgr.getCurSecretary();
  20800. if (getWoman) {
  20801. if (curUse == womanIndex) {
  20802. temp.purchaseBtn.c1.selectedIndex = 1;
  20803. }
  20804. else {
  20805. temp.purchaseBtn.c1.selectedIndex = 2;
  20806. }
  20807. }
  20808. else {
  20809. temp.purchaseBtn.c1.selectedIndex = 0;
  20810. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  20811. }
  20812. temp.purchaseBtn.visible = false;
  20813. }
  20814. }
  20815. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  20816. console.log('zh: 点击了clickSecretary ');
  20817. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20818. if (getWoman) {
  20819. if (curUse != womanIndex) {
  20820. console.log();
  20821. DataMgr.setCurSecretary(womanIndex);
  20822. this.updateData();
  20823. }
  20824. }
  20825. else {
  20826. console.log('zh:点击购买了');
  20827. let need = needDiamond;
  20828. if (DataMgr.diamondEnough(need)) {
  20829. DataMgr.setDiamond(-need);
  20830. DataMgr.setSecretary(womanIndex, 1);
  20831. DataMgr.setCurSecretary(womanIndex);
  20832. this.updateData();
  20833. }
  20834. else {
  20835. xGame.uiMgr.Show(UIAddProp$1, 1);
  20836. }
  20837. }
  20838. }
  20839. closeSelf() {
  20840. this.hide();
  20841. }
  20842. }
  20843. UISecretary$1.uiName = "UISecretary";
  20844. class BallRodDisplay$1 {
  20845. constructor(ui, index) {
  20846. this.index = 0;
  20847. this.uiIndex = 0;
  20848. this.ui = ui;
  20849. this.index = index;
  20850. this.initData();
  20851. }
  20852. initData() {
  20853. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  20854. let data = cfgTable.ballrodData[this.index + 1];
  20855. this.ui.nameTxt.text = data.name;
  20856. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  20857. this.ui.levelNode.c1.selectedIndex = data.quality;
  20858. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  20859. if (data.spine) {
  20860. this.mySpine = new SpineMgr(data.spine, () => {
  20861. let xx = 150;
  20862. let yy = 70;
  20863. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  20864. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  20865. });
  20866. }
  20867. }
  20868. updateSelf() {
  20869. console.log('zh:updateSelf -------------- ');
  20870. let get = DataMgr.getBallRod(this.index);
  20871. if (get == null)
  20872. get = 1;
  20873. let curUse = DataMgr.getCurBallRod();
  20874. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20875. if (get) {
  20876. if (curUse == this.index) {
  20877. this.ui.purchaseBtn.c1.selectedIndex = 0;
  20878. }
  20879. else {
  20880. this.ui.purchaseBtn.c1.selectedIndex = 1;
  20881. }
  20882. }
  20883. else {
  20884. this.ui.purchaseBtn.c1.selectedIndex = 2;
  20885. }
  20886. }
  20887. buyBallRod() {
  20888. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20889. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  20890. switch (selectedIndex) {
  20891. case 0:
  20892. break;
  20893. case 1:
  20894. console.log('zh:点击了 USE THIS');
  20895. DataMgr.setCurBallRod(this.index);
  20896. DataMgr.setDiamond(99999);
  20897. let curUse = DataMgr.getCurBallRod();
  20898. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20899. let ui = xGame.uiMgr.getUI(UIShop$1);
  20900. ui.updateBallRod();
  20901. break;
  20902. case 2:
  20903. let data = cfgTable.ballrodData[this.index + 1];
  20904. let need = data.price;
  20905. if (DataMgr.diamondEnough(need)) {
  20906. DataMgr.setDiamond(-need);
  20907. DataMgr.setBallRod(this.index, 1);
  20908. DataMgr.setCurBallRod(this.index);
  20909. let ui = xGame.uiMgr.getUI(UIShop$1);
  20910. ui.updateBallRod();
  20911. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  20912. }
  20913. else {
  20914. xGame.uiMgr.Show(UIAddProp$1, 1);
  20915. }
  20916. break;
  20917. default:
  20918. break;
  20919. }
  20920. }
  20921. logEventForGouMaiGan(qiuGanName) {
  20922. const ev = {
  20923. value: qiuGanName
  20924. };
  20925. const jsonStr = JSON.stringify(ev);
  20926. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  20927. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  20928. }
  20929. }
  20930. class UIShop$1 extends UIBase {
  20931. constructor() {
  20932. super();
  20933. this.itemNums = 0;
  20934. }
  20935. onConstructor() {
  20936. this.ui = ui_UIShop.createInstance();
  20937. this.contentPane = this.ui;
  20938. this.isEject = false;
  20939. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20940. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20941. this.addUIClick(this.ui, this.interuptSecretary);
  20942. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  20943. this.ballRodArr = [];
  20944. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  20945. this.ui.myNode.myList.numItems = this.itemNums;
  20946. if (Moyu.isKs)
  20947. this.ui.closeNode.closeBtn.x += 100;
  20948. }
  20949. show() {
  20950. super.show();
  20951. this.playSecretaryIdle();
  20952. this.updateBallRod();
  20953. }
  20954. updateBallRod() {
  20955. for (let index = 0; index < this.ballRodArr.length; index++) {
  20956. this.ballRodArr[index].updateSelf();
  20957. }
  20958. }
  20959. renderBallRod(sort, obj) {
  20960. let index = this.getIndexBySort(sort + 1) - 1;
  20961. let ballRod = new BallRodDisplay$1(obj, index);
  20962. this.ballRodArr.push(ballRod);
  20963. }
  20964. getIndexBySort(sort) {
  20965. let object = cfgTable.ballrodData;
  20966. for (const key in object) {
  20967. if (object[key].sort == sort) {
  20968. return parseInt(key);
  20969. }
  20970. }
  20971. }
  20972. playSecretaryIdle() {
  20973. let parent = this.ui.secretary.displayObject;
  20974. parent.destroyChildren();
  20975. let xx = this.ui.secretary.width / 2;
  20976. let yy = this.ui.secretary.height;
  20977. let scale = xGame.common.getSecretaryScale();
  20978. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20979. xGame.common.secretary.play(data, 0, true, parent);
  20980. }
  20981. interuptSecretary() {
  20982. Laya.timer.clearAll(this);
  20983. this.playSecretaryRandomSound();
  20984. }
  20985. playSecretaryRandomSound() {
  20986. if (this.isHide)
  20987. return;
  20988. let time = xGame.common.randomNum(45000, 60000);
  20989. Laya.timer.once(time, this, () => {
  20990. if (this.isHide)
  20991. return;
  20992. let index = xGame.common.randomNum(4, 7);
  20993. xGame.soundMgr.playSound("s_main0" + index);
  20994. let words = 1;
  20995. switch (index) {
  20996. case 4:
  20997. words = 5;
  20998. break;
  20999. case 5:
  21000. words = 3;
  21001. break;
  21002. case 6:
  21003. words = 6;
  21004. break;
  21005. case 7:
  21006. words = 7;
  21007. break;
  21008. default:
  21009. break;
  21010. }
  21011. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21012. this.playSecretaryRandomSound();
  21013. });
  21014. }
  21015. closeSelf() {
  21016. this.hide();
  21017. }
  21018. }
  21019. UIShop$1.uiName = "UIShop";
  21020. class SignMax$1 {
  21021. constructor(ui) {
  21022. this.ui = ui;
  21023. }
  21024. updateSelf(index, sameDay, curDayIndex) {
  21025. let data = cfgTable.signData[index + 1];
  21026. this.ui.titleTxt.text = data.title;
  21027. let arr1 = data.award[0].split('-');
  21028. let arr2 = data.award[1].split('-');
  21029. let num1 = parseInt(arr1[1]);
  21030. let num2 = parseInt(arr2[1]);
  21031. this.ui.numTxt1.text = num1 + "";
  21032. this.ui.numTxt2.text = num2 + "";
  21033. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  21034. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  21035. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  21036. this.ui.numTxt1.visible = false;
  21037. }
  21038. else {
  21039. this.ui.numTxt1.visible = true;
  21040. }
  21041. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  21042. this.ui.numTxt2.visible = false;
  21043. }
  21044. else {
  21045. this.ui.numTxt2.visible = true;
  21046. }
  21047. if (index < curDayIndex) {
  21048. this.ui.c1.selectedIndex = 1;
  21049. }
  21050. else if (index == curDayIndex) {
  21051. if (sameDay) {
  21052. this.ui.c1.selectedIndex = 2;
  21053. }
  21054. else {
  21055. this.ui.c1.selectedIndex = 2;
  21056. }
  21057. }
  21058. else {
  21059. this.ui.c1.selectedIndex = 0;
  21060. }
  21061. }
  21062. }
  21063. class SignNormal$1 {
  21064. constructor(ui) {
  21065. this.ui = ui;
  21066. }
  21067. updateSelf(index, sameDay, curDayIndex) {
  21068. let data = cfgTable.signData[index + 1];
  21069. this.ui.titleTxt.text = data.title;
  21070. let arr = data.award[0].split('-');
  21071. let type = parseInt(arr[0]);
  21072. let num = parseInt(arr[1]);
  21073. this.ui.numTxt.text = num + "";
  21074. if (type > 2) {
  21075. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  21076. this.ui.myIcon.rotation = 0;
  21077. }
  21078. else {
  21079. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  21080. this.ui.myIcon.rotation = 0;
  21081. }
  21082. if (xGame.common.signAwardContainsRod(data.award)) {
  21083. this.ui.numTxt.visible = false;
  21084. }
  21085. else {
  21086. this.ui.numTxt.visible = true;
  21087. }
  21088. if (index < curDayIndex) {
  21089. this.ui.c1.selectedIndex = 1;
  21090. }
  21091. else if (index == curDayIndex) {
  21092. if (sameDay) {
  21093. this.ui.c1.selectedIndex = 2;
  21094. }
  21095. else {
  21096. this.ui.c1.selectedIndex = 2;
  21097. }
  21098. }
  21099. else {
  21100. this.ui.c1.selectedIndex = 0;
  21101. }
  21102. }
  21103. }
  21104. class UISign$1 extends UIBase {
  21105. constructor() {
  21106. super();
  21107. this.curDayIndex = 0;
  21108. this.starX = 0;
  21109. }
  21110. onConstructor() {
  21111. this.ui = ui_UISign.createInstance();
  21112. this.contentPane = this.ui;
  21113. this.isEject = false;
  21114. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21115. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21116. this.initSignItem();
  21117. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  21118. this.addUIClick(this.ui.againBtn, this.againGetAward);
  21119. }
  21120. show() {
  21121. super.show();
  21122. this.ui.t0.play();
  21123. this.playSecretaryIdle();
  21124. this.updateSign();
  21125. }
  21126. initSignItem() {
  21127. this.signArr = [];
  21128. for (let index = 0; index < 6; index++) {
  21129. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  21130. this.signArr.push(temp);
  21131. }
  21132. this.signMax = new SignMax$1(this.ui.myNode.day7);
  21133. if (Moyu.isKs)
  21134. this.ui.closeNode.closeBtn.x += 100;
  21135. }
  21136. updateSign() {
  21137. let sameDay = xGame.common.judgeSameDay();
  21138. let max = 7;
  21139. this.curDayIndex = DataMgr.getSignData();
  21140. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  21141. this.curDayIndex = 0;
  21142. if (!sameDay) {
  21143. this.ui.normalBtn.visible = true;
  21144. this.ui.tipsNode.visible = false;
  21145. this.ui.againBtn.visible = false;
  21146. }
  21147. else {
  21148. this.ui.normalBtn.visible = false;
  21149. let again = DataMgr.getExtraSign();
  21150. let isCurrency = false;
  21151. let index = this.curDayIndex;
  21152. if (index == 0)
  21153. index = 7;
  21154. let award = cfgTable.signData[index].award;
  21155. let num = award[0].split("-")[0];
  21156. if (num == "1" || num == "2")
  21157. isCurrency = true;
  21158. let showAgain = again == 0 && isCurrency;
  21159. this.ui.againBtn.visible = showAgain;
  21160. this.ui.tipsNode.visible = !showAgain;
  21161. }
  21162. for (let index = 0; index < this.signArr.length; index++) {
  21163. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  21164. }
  21165. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  21166. }
  21167. playSecretaryIdle() {
  21168. let parent = this.ui.secretary.displayObject;
  21169. parent.destroyChildren();
  21170. let xx = this.ui.secretary.width / 2;
  21171. let yy = this.ui.secretary.height;
  21172. let scale = xGame.common.getSecretaryScale();
  21173. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21174. xGame.common.secretary.play(data, 0, true, parent);
  21175. }
  21176. closeSelf() {
  21177. this.hide();
  21178. }
  21179. normalGetAward() {
  21180. let sameDay = xGame.common.judgeSameDay();
  21181. if (!sameDay) {
  21182. let award = cfgTable.signData[this.curDayIndex + 1].award;
  21183. let temp;
  21184. let type;
  21185. let num;
  21186. let arr = [];
  21187. for (let index = 0; index < award.length; index++) {
  21188. temp = award[index].split("-");
  21189. type = parseInt(temp[0]);
  21190. num = parseInt(temp[1]);
  21191. let awardType = new AwardType();
  21192. awardType.num = num;
  21193. awardType.type = type;
  21194. arr.push(awardType);
  21195. }
  21196. xGame.common.getAward(arr, (watchVideo) => {
  21197. this.curDayIndex++;
  21198. if (this.curDayIndex > 7)
  21199. this.curDayIndex = 0;
  21200. DataMgr.setSignData(this.curDayIndex);
  21201. DataMgr.setSignTime(new Date().getTime());
  21202. if (watchVideo) {
  21203. DataMgr.setExtraSign(1);
  21204. Moyu.sendDataEvent("signIn1");
  21205. }
  21206. this.updateSign();
  21207. });
  21208. }
  21209. }
  21210. againGetAward() {
  21211. Moyu.sendDataEvent("signIn2");
  21212. console.log('zh:qjff_AD_for_uisign');
  21213. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  21214. }
  21215. else {
  21216. console.log('zh:AD 失败,直接发放奖励');
  21217. this.qjff_AD_for_uisign();
  21218. }
  21219. }
  21220. qjff_AD_for_uisign() {
  21221. let index = this.curDayIndex;
  21222. if (index == 0)
  21223. index = 7;
  21224. let award = cfgTable.signData[index].award;
  21225. let temp;
  21226. let type;
  21227. let num;
  21228. for (let index = 0; index < award.length; index++) {
  21229. temp = award[index].split("-");
  21230. type = parseInt(temp[0]);
  21231. num = parseInt(temp[1]) * 3;
  21232. xGame.common.playObjFlyAnim(num, type);
  21233. }
  21234. DataMgr.setExtraSign(1);
  21235. this.updateSign();
  21236. }
  21237. }
  21238. UISign$1.uiName = "UISign";
  21239. class UIModeSelection$1 extends UIBase {
  21240. constructor() {
  21241. super();
  21242. }
  21243. onConstructor() {
  21244. this.ui = ui_UIModeSelection.createInstance();
  21245. this.contentPane = this.ui;
  21246. this.isEject = false;
  21247. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  21248. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  21249. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  21250. this.addUIClick(this.ui.closeBtn, this.hide);
  21251. this.peopleArr = [650, 6900, 3800];
  21252. this.peopleOffest = [50, 500, 200];
  21253. this.updateSelf();
  21254. }
  21255. show(callback) {
  21256. super.show();
  21257. this.ui.t0.play();
  21258. this.callback = callback;
  21259. }
  21260. updateSelf() {
  21261. let cfg = cfgTable.modeselectData;
  21262. for (let index = 1; index <= 3; index++) {
  21263. let node = this.ui.myNode["type" + index];
  21264. node.need.text = cfg[index].need;
  21265. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  21266. node.peopleTxt.text = this.getRandPeople(index - 1);
  21267. }
  21268. }
  21269. enterGame(type) {
  21270. console.log('zh: 进入经典模式 type: ' + type);
  21271. xGame.common.classicRoomType = type;
  21272. let cfg = cfgTable.modeselectData[type];
  21273. let need = cfg.need;
  21274. xGame.common.passAwardCoin = cfg.award;
  21275. if (DataMgr.coinEnough(need)) {
  21276. DataMgr.setCoin(-need);
  21277. this.ui.myNode["type" + type].t0.play();
  21278. Laya.timer.once(200, this, () => {
  21279. this.callback && this.callback();
  21280. });
  21281. this.logEventForClassic_start();
  21282. }
  21283. else {
  21284. Moyu.sendDataEvent("AddCoinVideo");
  21285. xGame.uiMgr.Show(UIAddProp$1, 0);
  21286. }
  21287. }
  21288. getRandPeople(index) {
  21289. let rand = this.peopleOffest[index];
  21290. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  21291. }
  21292. logEventForClassic_start() {
  21293. let rtype = xGame.common.classicRoomType;
  21294. let msmc = '';
  21295. if (rtype == 1) {
  21296. msmc = 'beginner';
  21297. }
  21298. if (rtype == 2) {
  21299. msmc = 'expert';
  21300. }
  21301. if (rtype == 3) {
  21302. msmc = 'master';
  21303. }
  21304. let keyStr = 'sjmd_classic_start_' + rtype;
  21305. let jsonStr = {
  21306. "difficulty": msmc,
  21307. "classic_count": 1,
  21308. "difficulty_count": 1
  21309. };
  21310. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21311. const d = LocalStorageManager.getItem(keyStr);
  21312. jsonStr.classic_count = d.classic_count + 1;
  21313. jsonStr.difficulty_count = d.difficulty_count + 1;
  21314. LocalStorageManager.setItem(keyStr, jsonStr);
  21315. }
  21316. else {
  21317. LocalStorageManager.setItem(keyStr, jsonStr);
  21318. }
  21319. const reqStr = JSON.stringify(jsonStr);
  21320. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  21321. }
  21322. }
  21323. UIModeSelection$1.uiName = "UIModeSelection";
  21324. class UITry$1 extends UIBase {
  21325. constructor() {
  21326. super();
  21327. this.closeTime = 0;
  21328. this.closeNum = 0;
  21329. this.skillUrl = xGame.common.skillIconList;
  21330. }
  21331. onConstructor() {
  21332. this.ui = ui_UITry.createInstance();
  21333. this.contentPane = this.ui;
  21334. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  21335. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  21336. }
  21337. show() {
  21338. super.show();
  21339. this.closeNum = 0;
  21340. this.closeTime = 15;
  21341. this.ui.t0.play();
  21342. PlatMgr.showRateBanner();
  21343. this.ui.myNode.txtTime.text = this.closeTime.toString();
  21344. Laya.timer.loop(1000, this, this.updateTime);
  21345. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  21346. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  21347. xGame.common.gameMgr.gamePause = true;
  21348. }
  21349. updateTime() {
  21350. if (this.closeTime > 1) {
  21351. this.closeTime--;
  21352. this.ui.myNode.txtTime.text = this.closeTime.toString();
  21353. }
  21354. else
  21355. this.hide();
  21356. }
  21357. hide() {
  21358. Laya.timer.clearAll(this);
  21359. Moyu.showBannerAd(false);
  21360. super.hide();
  21361. xGame.common.gameMgr.gamePause = false;
  21362. }
  21363. onTry() {
  21364. console.log('zh:qjff_AD_for_uitry');
  21365. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  21366. }
  21367. else {
  21368. console.log('zh:AD 失败,直接发放奖励');
  21369. this.qjff_AD_for_uitry();
  21370. }
  21371. }
  21372. qjff_AD_for_uitry() {
  21373. let select = xGame.common.curPlayerSkillType;
  21374. DataMgr.gameData.trySkill = select;
  21375. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  21376. DataMgr.saveGameData();
  21377. DataMgr.setBigSkill(select, 1);
  21378. xGame.showTip("Trial Successful");
  21379. this.hide();
  21380. }
  21381. onCancel() {
  21382. if (this.closeNum > 0) {
  21383. this.closeNum--;
  21384. if (this.closeNum < 2)
  21385. this.hide();
  21386. return;
  21387. }
  21388. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  21389. this.onTry();
  21390. }
  21391. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  21392. this.closeNum = 3;
  21393. }
  21394. else
  21395. this.hide();
  21396. }
  21397. }
  21398. UITry$1.uiName = "UITry";
  21399. class UIGetAward$1 extends UIBase {
  21400. constructor() {
  21401. super();
  21402. this.showTriple = true;
  21403. }
  21404. onConstructor() {
  21405. this.ui = ui_UIGetAward.createInstance();
  21406. this.contentPane = this.ui;
  21407. this.isEject = false;
  21408. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  21409. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  21410. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  21411. }
  21412. show(arr, showTriple, callback) {
  21413. super.show();
  21414. this.ui.t0.play();
  21415. this.ui.eftNode.visible = true;
  21416. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  21417. this.ui.eftNode.visible = false;
  21418. }), 1, 0, 0, 0.9);
  21419. this.awardArr = arr;
  21420. this.showTriple = showTriple;
  21421. this.callback = callback;
  21422. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  21423. this.ui.myList.numItems = arr.length;
  21424. xGame.soundMgr.playSound("getaward");
  21425. }
  21426. updateSelf(index, obj) {
  21427. let temp = this.awardArr[index];
  21428. let icon = this.getIcon(temp.type);
  21429. let str = icon;
  21430. if (temp.type > 2) {
  21431. str = "s" + icon;
  21432. }
  21433. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  21434. obj.myIcon.rotation = 0;
  21435. obj.numTxt.text = temp.num + "";
  21436. obj.numTxt.visible = temp.type > 2 ? false : true;
  21437. obj.nameTxt.text = this.getNameStr(temp.type);
  21438. }
  21439. renderItem(index, obj) {
  21440. this.updateSelf(index, obj);
  21441. }
  21442. tripleGetAward() {
  21443. console.log('zh:qjff_AD_for_uigetAward');
  21444. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  21445. }
  21446. else {
  21447. console.log('zh:AD 失败,直接发放奖励');
  21448. this.qjff_AD_for_uigetAward();
  21449. }
  21450. }
  21451. qjff_AD_for_uigetAward() {
  21452. this.getAward(3);
  21453. }
  21454. normalGetAward() {
  21455. if (PlatMgr.isMisVideo())
  21456. this.tripleGetAward();
  21457. else
  21458. this.getAward();
  21459. }
  21460. getAward(times = 1) {
  21461. this.hide();
  21462. for (let index = 0; index < this.awardArr.length; index++) {
  21463. this.awardArr[index].num *= times;
  21464. }
  21465. this.callback && this.callback(times != 1);
  21466. }
  21467. getIcon(type) {
  21468. switch (type) {
  21469. case Prop.diamond:
  21470. return "ty_zs";
  21471. case Prop.coin:
  21472. return "ty_jb";
  21473. case Prop.gan1:
  21474. return "qg1";
  21475. case Prop.gan2:
  21476. return "qg2";
  21477. case Prop.gan3:
  21478. return "qg3";
  21479. case Prop.gan4:
  21480. return "qg4";
  21481. default:
  21482. break;
  21483. }
  21484. }
  21485. getNameStr(type) {
  21486. switch (type) {
  21487. case Prop.diamond:
  21488. return "Diamond";
  21489. case Prop.coin:
  21490. return "Coins";
  21491. case Prop.gan1:
  21492. case Prop.gan2:
  21493. case Prop.gan3:
  21494. case Prop.gan4:
  21495. return cfgTable.ballrodData[type - 1].name;
  21496. default:
  21497. break;
  21498. }
  21499. }
  21500. }
  21501. UIGetAward$1.uiName = "UIGetAward";
  21502. class UIBox$1 extends UIBase {
  21503. constructor() {
  21504. super();
  21505. this.boxNum = 0;
  21506. this.boxMax = 10;
  21507. this.inAd = false;
  21508. this.isClose = false;
  21509. }
  21510. onConstructor() {
  21511. this.ui = ui_UIBox.createInstance();
  21512. this.contentPane = this.ui;
  21513. this.isEject = false;
  21514. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  21515. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  21516. Laya.timer.loop(1000, this, this.update);
  21517. }
  21518. update() {
  21519. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  21520. this.boxNum -= 1;
  21521. this.upBar();
  21522. }
  21523. }
  21524. upBar() {
  21525. if (this.boxNum > this.boxMax)
  21526. this.boxNum = this.boxMax;
  21527. this.ui.bar.value = this.boxNum * 10;
  21528. }
  21529. show() {
  21530. super.show();
  21531. this.isClose = false;
  21532. this.boxNum = 0;
  21533. this.inAd = false;
  21534. this.upBar();
  21535. this.ui.t0.play();
  21536. this.ui.closeBtn.visible = false;
  21537. Laya.timer.once(3000, this, () => {
  21538. this.ui.closeBtn.visible = true;
  21539. this.ui.bar.alpha = 1;
  21540. });
  21541. Laya.timer.once(500, this, () => {
  21542. this.ui.t1.play();
  21543. });
  21544. }
  21545. hide() {
  21546. Laya.timer.clearAll(this);
  21547. Moyu.showBannerAd(false);
  21548. super.hide();
  21549. }
  21550. onOpenBox() {
  21551. this.boxNum++;
  21552. if (this.boxNum < this.boxMax) {
  21553. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  21554. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  21555. }
  21556. }
  21557. else if (this.boxNum == this.boxMax) {
  21558. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  21559. this.ui.openBtn.c1.selectedIndex = 13;
  21560. this.inAd = true;
  21561. }
  21562. else
  21563. this.getAward();
  21564. }
  21565. else if (this.inAd) {
  21566. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  21567. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  21568. }
  21569. else {
  21570. console.log('zh:AD 失败,直接发放奖励');
  21571. this.qjff_AD_for_UIBOX_onOpenBox();
  21572. }
  21573. }
  21574. this.upBar();
  21575. }
  21576. qjff_AD_for_UIBOX_onOpenBox() {
  21577. this.getAward();
  21578. }
  21579. onCloseBox() {
  21580. if (this.isClose)
  21581. this.hide();
  21582. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  21583. this.isClose = true;
  21584. PlatMgr.showBanner(true, 0, 3000);
  21585. }
  21586. else
  21587. this.hide();
  21588. }
  21589. getAward() {
  21590. let str = "";
  21591. if (Math.random() < 0.5) {
  21592. let max = Moyu.isLegal ? 500 : 2500;
  21593. let num = xGame.tools.random(max, 500 + max);
  21594. DataMgr.setCoin(num);
  21595. str = "金币x" + num;
  21596. }
  21597. else {
  21598. let max = Moyu.isLegal ? 10 : 30;
  21599. let num = xGame.tools.random(max, 30 + max);
  21600. DataMgr.setDiamond(num);
  21601. str = "钻石x" + num;
  21602. }
  21603. xGame.showTip("恭喜获得-" + str);
  21604. this.hide();
  21605. }
  21606. }
  21607. UIBox$1.uiName = "UIBox";
  21608. class UIMain$1 extends UIBase {
  21609. constructor() {
  21610. super();
  21611. this.firstEnter = true;
  21612. }
  21613. nativeCallJs(msg) {
  21614. let t = msg;
  21615. console.log("zh: nativeCallJs 奖励开始发放:", t);
  21616. switch (t) {
  21617. case 'qjff_chouJiang':
  21618. let dui = xGame.uiMgr.getUI(UIDraw$1);
  21619. dui.qjff_chouJiang();
  21620. break;
  21621. case 'qjff_AD_for_uisign':
  21622. let dui2 = xGame.uiMgr.getUI(UISign$1);
  21623. dui2.qjff_AD_for_uisign();
  21624. break;
  21625. case 'qjff_AD_for_uitry':
  21626. let dui3 = xGame.uiMgr.getUI(UITry$1);
  21627. dui3.qjff_AD_for_uitry();
  21628. break;
  21629. case 'qjff_AD_for_uipower':
  21630. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  21631. dui4.qjff_AD_for_uipower();
  21632. break;
  21633. case 'qjff_AD_for_uigetAward':
  21634. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  21635. dui5.qjff_AD_for_uigetAward();
  21636. break;
  21637. case 'qjff_AD_for_uiGameEnd':
  21638. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  21639. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  21640. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  21641. break;
  21642. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  21643. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  21644. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  21645. break;
  21646. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  21647. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  21648. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  21649. break;
  21650. case 'qjff_AD_for_UIrepentProp_videoRegret':
  21651. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  21652. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  21653. break;
  21654. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  21655. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  21656. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  21657. break;
  21658. case 'qjff_AD_for_UIBOX_onOpenBox':
  21659. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  21660. dui11.qjff_AD_for_UIBOX_onOpenBox();
  21661. break;
  21662. case 'qjff_AD_for_UIAddCoin':
  21663. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  21664. dui12.qjff_AD_for_UIAddCoin();
  21665. break;
  21666. case '111a':
  21667. let dui14 = xGame.uiMgr.getUI(UISign$1);
  21668. dui14.qjff_AD_for_uisign();
  21669. break;
  21670. case '222a':
  21671. let dui15 = xGame.uiMgr.getUI(UISign$1);
  21672. dui15.qjff_AD_for_uisign();
  21673. break;
  21674. case '333a':
  21675. let dui16 = xGame.uiMgr.getUI(UISign$1);
  21676. dui16.qjff_AD_for_uisign();
  21677. break;
  21678. default:
  21679. console.log('zh:未知的方法名字' + t);
  21680. break;
  21681. }
  21682. }
  21683. onConstructor() {
  21684. console.log('zh: UIMain onConstructor');
  21685. this.ui = ui_UIMain.createInstance();
  21686. this.contentPane = this.ui;
  21687. this.isEject = false;
  21688. this.addEvent();
  21689. this.addClickSpine();
  21690. this.settingNode = new SettingNode$1(this.ui.settingNode);
  21691. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21692. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  21693. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  21694. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  21695. let curUse = DataMgr.getCurSecretary();
  21696. this.changeSecretary(curUse);
  21697. this.ui.talkNode.visible = false;
  21698. let guide = DataMgr.getSkillGuide();
  21699. if (xGame.common.isNewDay && guide == 1) {
  21700. xGame.common.isNewDay = false;
  21701. xGame.soundMgr.playSound("s_main01");
  21702. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21703. console.log("zh:播放小秘书每天语音");
  21704. }
  21705. this.ui.n83.visible = false;
  21706. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  21707. }
  21708. changeSecretary(curUse) {
  21709. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  21710. xGame.common.secretary && xGame.common.secretary.dispose();
  21711. this.addSecretarySpine(name);
  21712. }
  21713. addSecretarySpine(name) {
  21714. let spine = new SpineMgr(name, () => {
  21715. this.playSecretaryIdle();
  21716. });
  21717. xGame.common.secretary = spine;
  21718. }
  21719. addClickSpine() {
  21720. let clickSpine = new SpineMgr("dianji", () => {
  21721. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  21722. let parent = Laya.stage;
  21723. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  21724. clickSpine.play(data, 0, false, parent, (spine) => {
  21725. spine.destroy(true);
  21726. });
  21727. });
  21728. });
  21729. }
  21730. addEvent() {
  21731. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  21732. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  21733. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  21734. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  21735. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  21736. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  21737. this.addUIClick(this.ui, this.interuptSecretary);
  21738. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  21739. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  21740. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  21741. this.addUIClick(this.ui.shopBtn, this.openShopView);
  21742. this.addUIClick(this.ui.signBtn, this.openSignView);
  21743. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  21744. this.addUIClick(this.ui.rankBtn, this.openRanking);
  21745. }
  21746. show(showFailWords) {
  21747. super.show();
  21748. this.moneyNode.ui.c1.selectedIndex = 1;
  21749. this.playSecretaryIdle();
  21750. xGame.soundMgr.playMusic("caromhall01", 0);
  21751. Laya.timer.clearAll(this);
  21752. this.playSecretaryRandomSound();
  21753. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  21754. if (showFailWords) {
  21755. console.log('zh:uimain.ts ');
  21756. setTimeout(() => {
  21757. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  21758. let words = -1;
  21759. if (str == "s_main02") {
  21760. words = 2;
  21761. }
  21762. else {
  21763. words = 3;
  21764. }
  21765. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21766. xGame.soundMgr.playSound(str);
  21767. }, 300);
  21768. }
  21769. this.showGuide();
  21770. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  21771. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  21772. let guide = DataMgr.getSkillGuide();
  21773. if (guide == 1) {
  21774. let randTime = xGame.common.randomNum(300, 800);
  21775. if (this.firstEnter) {
  21776. console.log("zh: firstEnter");
  21777. this.firstEnter = false;
  21778. randTime += 900;
  21779. }
  21780. else {
  21781. console.log("zh: no firstEnter");
  21782. }
  21783. Laya.timer.once(randTime, this, () => {
  21784. xGame.common.autoPopUIView();
  21785. });
  21786. }
  21787. }
  21788. checkActive(show) {
  21789. }
  21790. showGuide() {
  21791. let guide = DataMgr.getSkillGuide();
  21792. this.ui.guideBtn.visible = guide == 0;
  21793. this.ui.enterGuide.visible = false;
  21794. this.ui.secretaryGuide.visible = guide == 0;
  21795. if (guide == 0) {
  21796. console.log("zh:显示引导");
  21797. xGame.soundMgr.playSound("s_guide");
  21798. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21799. }
  21800. else {
  21801. console.log("zh:不需要显示引导");
  21802. }
  21803. }
  21804. ensureSecretary() {
  21805. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  21806. this.ui.secretaryGuide.visible = false;
  21807. this.ui.enterGuide.visible = true;
  21808. this.ui.wordsNode.t0.play();
  21809. if (DataMgr.getNewUser())
  21810. Moyu.sendDataEvent("gameReady");
  21811. }
  21812. playSecretaryIdle() {
  21813. let parent = this.ui.secretary.displayObject;
  21814. parent.destroyChildren();
  21815. let xx = this.ui.secretary.width / 2;
  21816. let yy = this.ui.secretary.height;
  21817. let scale = xGame.common.getSecretaryScale();
  21818. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21819. console.log("zh:playSecretaryIdle", data);
  21820. xGame.common.secretary.play(data, 0, true, parent);
  21821. }
  21822. startGame(type) {
  21823. xGame.common.gameMode = type;
  21824. Moyu.sendDataEvent("PlayGame", { type: type });
  21825. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  21826. switch (xGame.common.gameMode) {
  21827. case GameMode.classic:
  21828. console.log('zh:进入经典模式111111111');
  21829. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  21830. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21831. console.log('zh:classic db_over_lev=', db_over_lev);
  21832. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  21833. console.log('zh:判断是否可以玩该模式classic =NO');
  21834. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  21835. xGame.uiMgr.Show(UIMsg$1, tipStr);
  21836. console.log('zh:返回');
  21837. return;
  21838. }
  21839. else {
  21840. console.log('zh:可以玩该模式classic 66666666666666');
  21841. this.beginGame();
  21842. }
  21843. }
  21844. else {
  21845. console.log('zh:不需要判断是否可以玩该classic');
  21846. let challengeTimes = DataMgr.getChallengeTimes();
  21847. if (challengeTimes == 0) {
  21848. xGame.uiMgr.Show(UIInvitation$1);
  21849. }
  21850. else {
  21851. this.beginGame();
  21852. }
  21853. break;
  21854. }
  21855. case GameMode.bigMove:
  21856. console.error('zh:bigMove check');
  21857. let guide = DataMgr.getSkillGuide();
  21858. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  21859. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21860. console.log('zh:bigMove db_over_lev=', db_over_lev);
  21861. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  21862. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  21863. xGame.uiMgr.Show(UIMsg$1, tipStr);
  21864. return;
  21865. }
  21866. else {
  21867. console.log('zh:可以玩该模式 bigMove');
  21868. this.beginGame();
  21869. if (DataMgr.getNewUser())
  21870. Moyu.sendDataEvent("gameStart0");
  21871. }
  21872. }
  21873. else {
  21874. this.beginGame();
  21875. if (DataMgr.getNewUser())
  21876. Moyu.sendDataEvent("gameStart0");
  21877. }
  21878. break;
  21879. default:
  21880. console.error('zh:未知错误!!!!');
  21881. break;
  21882. }
  21883. }
  21884. beginGame(isNice = false) {
  21885. console.log('zh:beginGame ');
  21886. let guide = DataMgr.getSkillGuide();
  21887. if (guide == 1) {
  21888. console.log('zh:非新手引导,showInternAd ');
  21889. JSBridgeUtils.instance.showInternAd('beginGame');
  21890. }
  21891. else {
  21892. console.log('zh:新手引导,不显示AD ');
  21893. }
  21894. console.log('zh:beginGame 2 go');
  21895. if (xGame.common.gameMode == GameMode.classic) {
  21896. if (isNice) {
  21897. this.enterClassic();
  21898. }
  21899. else {
  21900. xGame.uiMgr.Show(UIModeSelection$1, () => {
  21901. console.log('zh:BBBBBBBBBBBBBBB');
  21902. this.enterClassic();
  21903. });
  21904. }
  21905. }
  21906. else if (xGame.common.gameMode == GameMode.bigMove) {
  21907. this.ui.enterGuide.visible = false;
  21908. xGame.uiMgr.Show(UISkill$1);
  21909. }
  21910. }
  21911. enterClassic() {
  21912. xGame.uiMgr.Show(UIGame$1);
  21913. xGame.uiMgr.Show(UIMatching$1, () => {
  21914. if (!this.isHide)
  21915. this.hide();
  21916. xGame.common.gameUI.ui.alpha = 1;
  21917. xGame.common.gameUI.startGame();
  21918. xGame.uiMgr.Hide(UIGameEnd$1);
  21919. });
  21920. }
  21921. startGlobal() {
  21922. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21923. }
  21924. startWeekly() {
  21925. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21926. }
  21927. zhouSaiMonth() {
  21928. console.log('zh: zhouSaiMonth 被调用');
  21929. }
  21930. startPlaceBall() {
  21931. xGame.uiMgr.Show(UILevelDisplay$1);
  21932. }
  21933. hide() {
  21934. console.log('zh:uimain hide ...');
  21935. super.hide();
  21936. xGame.common.stopGirlPop(this.ui.talkNode);
  21937. }
  21938. onGetUserInfo(force = false) {
  21939. if (Moyu.isWx) {
  21940. let info = Moyu.getSystemInfo();
  21941. if (info)
  21942. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  21943. }
  21944. else {
  21945. Moyu.initUser(this, this.freshUser, force);
  21946. }
  21947. if (!Moyu.hasUserInfo) {
  21948. let user = Moyu.getUserInfo();
  21949. user.headIcon = 'res/ty_touxiang.png';
  21950. }
  21951. this.freshUser();
  21952. }
  21953. freshUser() {
  21954. let user = Moyu.getUserInfo();
  21955. if (!user.isAuth) {
  21956. user.headIcon = 'res/ty_touxiang.png';
  21957. }
  21958. else
  21959. DataMgr.upRankData();
  21960. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  21961. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  21962. }
  21963. interuptSecretary() {
  21964. Laya.timer.clearAll(this);
  21965. this.playSecretaryRandomSound();
  21966. }
  21967. playSecretaryRandomSound() {
  21968. if (this.isHide)
  21969. return;
  21970. let time = xGame.common.randomNum(45000, 60000);
  21971. Laya.timer.once(time, this, () => {
  21972. if (this.isHide)
  21973. return;
  21974. let index = xGame.common.randomNum(4, 7);
  21975. xGame.soundMgr.playSound("s_main0" + index);
  21976. let words = 1;
  21977. switch (index) {
  21978. case 4:
  21979. words = 5;
  21980. break;
  21981. case 5:
  21982. words = 3;
  21983. break;
  21984. case 6:
  21985. words = 6;
  21986. break;
  21987. case 7:
  21988. words = 7;
  21989. break;
  21990. default:
  21991. break;
  21992. }
  21993. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21994. this.playSecretaryRandomSound();
  21995. });
  21996. }
  21997. openSecretaryView() {
  21998. xGame.uiMgr.Show(UISecretary$1);
  21999. Moyu.sendDataEvent("secretary");
  22000. }
  22001. openShopView() {
  22002. xGame.uiMgr.Show(UIShop$1);
  22003. }
  22004. openSignView() {
  22005. xGame.uiMgr.Show(UISign$1);
  22006. }
  22007. openDrawView() {
  22008. xGame.uiMgr.Show(UIDraw$1);
  22009. }
  22010. openRanking() {
  22011. console.log('zh:phb openRanking');
  22012. xGame.uiMgr.Show(UIRanking$1);
  22013. Moyu.sendDataEvent("rankingList");
  22014. }
  22015. }
  22016. UIMain$1.uiName = "UIMain";
  22017. function InitShader() {
  22018. }
  22019. function appInit() {
  22020. xGame.context.init(getLoadingResList(), initCallback);
  22021. }
  22022. function getLoadingResList() {
  22023. return [
  22024. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  22025. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  22026. ];
  22027. }
  22028. function getGameResList() {
  22029. return [
  22030. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  22031. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  22032. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  22033. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  22034. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  22035. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  22036. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  22037. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  22038. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  22039. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  22040. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  22041. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  22042. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  22043. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  22044. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  22045. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  22046. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  22047. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  22048. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  22049. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  22050. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  22051. ];
  22052. }
  22053. function initCallback() {
  22054. window["DataMgr"] = DataMgr;
  22055. DataMgr.Init();
  22056. Moyu.init(getPlat(), this, () => {
  22057. DataMgr.isNewDay();
  22058. PlatMgr.initConfig();
  22059. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  22060. }, true);
  22061. console.log('zh:开始sm init1 start');
  22062. xGame.soundMgr.init();
  22063. console.log('zh:开始sm init1 end');
  22064. xGame.uiMgr.init();
  22065. xGame.uiMgr.clearTempData();
  22066. xGame.uiMgr.bindFUI(fguiRes.loading);
  22067. xGame.uiMgr.Show(UILoading);
  22068. }
  22069. function loadSubRes(callback) {
  22070. var tab = ["asset", "res", "spine"];
  22071. let subDone = 0;
  22072. for (var i = 0; i < tab.length; i++) {
  22073. let sub = tab[i];
  22074. Moyu.loadSubRes(sub, (pro) => {
  22075. callback && callback(pro, false);
  22076. }).then(() => {
  22077. subDone++;
  22078. if (subDone >= tab.length)
  22079. callback && callback(1, true);
  22080. });
  22081. }
  22082. }
  22083. function enterGame() {
  22084. xGame.cfgMgr.init();
  22085. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  22086. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  22087. xGame.uiMgr.Hide(UILoading);
  22088. fgui.UIPackage.removePackage(fguiRes.loading);
  22089. xGame.uiMgr.bindFUI(fguiRes.game);
  22090. xGame.uiMgr.Show(UIMain$1);
  22091. if (DataMgr.getNewUser())
  22092. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  22093. }
  22094. function getPlat() {
  22095. let cfg = new MoyuCfg();
  22096. cfg.plat = MoyuPlat.web;
  22097. cfg.myId = 180;
  22098. cfg.myKey = '8848a885774230a4';
  22099. cfg.version = 0;
  22100. if (window.hasOwnProperty("gamebox")) {
  22101. cfg.plat = MoyuPlat.f399;
  22102. cfg.version = 0;
  22103. }
  22104. else if (window.hasOwnProperty("ks")) {
  22105. cfg.plat = MoyuPlat.ks;
  22106. cfg.version = 0;
  22107. cfg.ads.ksVideoId = '2300002254_01';
  22108. cfg.ads.ksInsertId = '2300002254_02';
  22109. }
  22110. else if (Laya.Browser.onTTMiniGame) {
  22111. cfg.plat = MoyuPlat.tt;
  22112. cfg.version = 0;
  22113. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  22114. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  22115. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  22116. }
  22117. else if (Laya.Browser.onMiniGame) {
  22118. cfg.plat = MoyuPlat.wx;
  22119. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  22120. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  22121. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  22122. }
  22123. else if (Laya.Browser.onQQMiniGame) {
  22124. cfg.plat = MoyuPlat.qq;
  22125. }
  22126. else if (Laya.Browser.onQGMiniGame) {
  22127. cfg.plat = MoyuPlat.op;
  22128. cfg.ads.opVideoId = '455502';
  22129. cfg.ads.opBannerId = '455507';
  22130. }
  22131. else if (Laya.Browser.onVVMiniGame) {
  22132. cfg.plat = MoyuPlat.vv;
  22133. cfg.version = 0;
  22134. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  22135. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  22136. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  22137. }
  22138. else if (Laya.Browser.onHWMiniGame) {
  22139. cfg.plat = MoyuPlat.hw;
  22140. }
  22141. else if (window["mz"]) {
  22142. cfg.plat = MoyuPlat.mz;
  22143. }
  22144. else {
  22145. let cfg = window['conchConfig'];
  22146. if (cfg) {
  22147. var os = cfg.getOS();
  22148. if (os == "Conch-ios") {
  22149. cfg.plat = MoyuPlat.ios;
  22150. }
  22151. else if (os == "Conch-android") {
  22152. }
  22153. }
  22154. }
  22155. return cfg;
  22156. }
  22157. class Main {
  22158. constructor() {
  22159. if (window["Laya3D"])
  22160. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  22161. else {
  22162. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  22163. this.initMain();
  22164. }
  22165. }
  22166. initMain() {
  22167. Laya["Physics"] && Laya["Physics"].enable();
  22168. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  22169. Laya.stage.scaleMode = GameConfig.scaleMode;
  22170. Laya.stage.screenMode = GameConfig.screenMode;
  22171. Laya.stage.alignV = GameConfig.alignV;
  22172. Laya.stage.alignH = GameConfig.alignH;
  22173. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  22174. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  22175. Laya.enableDebugPanel();
  22176. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  22177. Laya["PhysicsDebugDraw"].enable();
  22178. if (GameConfig.stat)
  22179. Laya.Stat.show();
  22180. Laya.alertGlobalError(true);
  22181. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  22182. }
  22183. onVersionLoaded() {
  22184. appInit();
  22185. }
  22186. }
  22187. new Main();
  22188. }());
  22189. //# sourceMappingURL=bundle.js.map