bundle.js 841 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008
  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 UILevelProp extends UIBase {
  4739. constructor() {
  4740. super();
  4741. this.firstPos = 385;
  4742. this.secondPos = 467;
  4743. this.showItemArr = [];
  4744. }
  4745. onFontLoaded() {
  4746. try {
  4747. this.ui.myNode.conditionTxt.font = "arial";
  4748. console.log("zh: onFontLoaded 设置arial字体成功");
  4749. }
  4750. catch (error) {
  4751. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4752. }
  4753. }
  4754. onConstructor() {
  4755. this.ui = ui_UILevelProp.createInstance();
  4756. this.contentPane = this.ui;
  4757. this.isEject = false;
  4758. this.addUIClick(this.ui.closeBtn, this.hide);
  4759. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4760. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4761. }
  4762. show(level) {
  4763. super.show();
  4764. this.ui.t1.play();
  4765. this.level = level;
  4766. this.data = cfgTable.placeballData[this.level];
  4767. this.updateSelf();
  4768. this.showPreView();
  4769. this.moneyNode.ui.c1.selectedIndex = 2;
  4770. this.moneyNode.checkPowerTime();
  4771. this.moneyNode.powerChange();
  4772. }
  4773. showPreView() {
  4774. let item;
  4775. let data;
  4776. for (let index = 0; index < this.showItemArr.length; index++) {
  4777. item = this.showItemArr[index];
  4778. item.destroySelf();
  4779. }
  4780. this.showItemArr = [];
  4781. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4782. for (const key in cfgData) {
  4783. data = cfgData[key];
  4784. item = new ShowItem();
  4785. item.setParent(this.ui.myNode.displayRoot);
  4786. item.setPos(data.x, data.y);
  4787. item.setUrl(data.value);
  4788. this.showItemArr.push(item);
  4789. }
  4790. }
  4791. updateSelf() {
  4792. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4793. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4794. if (this.data.ball == -1) {
  4795. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4796. }
  4797. else {
  4798. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4799. }
  4800. let localData = DataMgr.getPlaceBallLevel(this.level);
  4801. let getAward = localData.getAward;
  4802. let cfg = cfgTable.placeballData[this.level];
  4803. let coin = this.data.award[0];
  4804. let diamond = this.data.award[1];
  4805. if (cfg.type == PlaceBallType.challenge) {
  4806. diamond = 0;
  4807. coin = 100;
  4808. }
  4809. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4810. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4811. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4812. if (cfg.type == PlaceBallType.challenge) {
  4813. this.ui.myNode.coinNode.numTxt.text = "";
  4814. }
  4815. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4816. if (coin > 0 && diamond > 0) {
  4817. this.ui.myNode.diamondNode.x = 385;
  4818. this.ui.myNode.coinNode.x = 467;
  4819. }
  4820. else {
  4821. this.ui.myNode.diamondNode.x = 385;
  4822. this.ui.myNode.coinNode.x = 385;
  4823. }
  4824. if (!getAward) {
  4825. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4826. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4827. }
  4828. else {
  4829. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4830. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4831. }
  4832. }
  4833. startGame() {
  4834. if (DataMgr.powerEnough()) {
  4835. this.ui.myNode.startBtn.touchable = false;
  4836. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4837. console.log('zh:startGame ');
  4838. this.ui.myNode.startBtn.touchable = true;
  4839. DataMgr.setPower(-1);
  4840. xGame.eventMgr.event(POWER_TIME);
  4841. xGame.common.gameMode = GameMode.placeBall;
  4842. xGame.common.placeBallCurLevel = this.level;
  4843. xGame.uiMgr.Show(UIGame);
  4844. xGame.uiMgr.Hide(UILevelDisplay);
  4845. xGame.uiMgr.Hide(UIMain);
  4846. this.hide();
  4847. }));
  4848. }
  4849. else {
  4850. console.log('zh:startGame no power');
  4851. xGame.uiMgr.Show(UIPower);
  4852. }
  4853. }
  4854. hide() {
  4855. super.hide();
  4856. }
  4857. }
  4858. UILevelProp.uiName = "UILevelProp";
  4859. class PutBallLevelDisplay {
  4860. constructor(ui, index) {
  4861. this.index = 0;
  4862. this.ui = ui;
  4863. this.index = index;
  4864. this.ui.onClick(this, this.clickSelf);
  4865. this.updateSelf();
  4866. this.ui.levelTxt.text = (this.index + 1) + "";
  4867. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4868. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4869. }
  4870. updateSelf() {
  4871. let level = this.index + 1;
  4872. this.data = DataMgr.getPlaceBallLevel(level);
  4873. this.ui.starNode.c1.selectedIndex = this.data.star;
  4874. let isChallenge = cfgTable.placeballData[level].type;
  4875. if (this.data.isCur) {
  4876. if (isChallenge) {
  4877. this.ui.c1.selectedIndex = 5;
  4878. }
  4879. else {
  4880. this.ui.c1.selectedIndex = 2;
  4881. }
  4882. }
  4883. else {
  4884. if (this.data.play) {
  4885. if (this.data.star == 3) {
  4886. this.ui.c1.selectedIndex = 0;
  4887. }
  4888. else {
  4889. this.ui.c1.selectedIndex = 1;
  4890. }
  4891. }
  4892. else {
  4893. if (isChallenge) {
  4894. this.ui.c1.selectedIndex = 4;
  4895. }
  4896. else {
  4897. this.ui.c1.selectedIndex = 3;
  4898. }
  4899. }
  4900. }
  4901. }
  4902. clickSelf() {
  4903. if (!this.data.play)
  4904. return;
  4905. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4906. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4907. }
  4908. }
  4909. class UILevelDisplay extends UIBase {
  4910. constructor() {
  4911. super();
  4912. }
  4913. onConstructor() {
  4914. this.ui = ui_UILevelDisplay.createInstance();
  4915. this.contentPane = this.ui;
  4916. this.isEject = false;
  4917. this.myList = this.ui.myNode.myList;
  4918. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4919. this.levelItemArr = [];
  4920. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4921. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4922. this.myList.numItems = levelNum;
  4923. if (Moyu.isKs)
  4924. this.ui.closeNode.closeBtn.x += 100;
  4925. }
  4926. levelItemRender(index, target) {
  4927. let item = new PutBallLevelDisplay(target, index);
  4928. this.levelItemArr.push(item);
  4929. }
  4930. show() {
  4931. super.show();
  4932. this.updateLevel();
  4933. this.scrollToPlace();
  4934. }
  4935. updateLevel() {
  4936. let temp;
  4937. for (let index = 0; index < this.levelItemArr.length; index++) {
  4938. temp = this.levelItemArr[index];
  4939. temp.updateSelf();
  4940. }
  4941. }
  4942. scrollToPlace() {
  4943. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4944. let passArr = DataMgr.getPlaceBallLevelList();
  4945. let offest = passArr.length;
  4946. if (offest >= maxNum - 1)
  4947. offest = maxNum - 1;
  4948. this.myList.scrollToView(offest, true, true);
  4949. }
  4950. hide() {
  4951. super.hide();
  4952. }
  4953. }
  4954. UILevelDisplay.uiName = "UILevelDisplay";
  4955. class ui_UIMatching extends fgui.GComponent {
  4956. static createInstance() {
  4957. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4958. }
  4959. onConstruct() {
  4960. this.n5 = (this.getChild("n5"));
  4961. this.n49 = (this.getChild("n49"));
  4962. this.n51 = (this.getChild("n51"));
  4963. this.n64 = (this.getChild("n64"));
  4964. this.n2 = (this.getChild("n2"));
  4965. this.n53 = (this.getChild("n53"));
  4966. this.n54 = (this.getChild("n54"));
  4967. this.n56 = (this.getChild("n56"));
  4968. this.n58 = (this.getChild("n58"));
  4969. this.n59 = (this.getChild("n59"));
  4970. this.n57 = (this.getChild("n57"));
  4971. this.n60 = (this.getChild("n60"));
  4972. this.n62 = (this.getChild("n62"));
  4973. this.awardTxt = (this.getChild("awardTxt"));
  4974. this.n61 = (this.getChild("n61"));
  4975. this.selfHead = (this.getChild("selfHead"));
  4976. this.aiHead = (this.getChild("aiHead"));
  4977. this.n82 = (this.getChild("n82"));
  4978. this.n84 = (this.getChild("n84"));
  4979. this.n83 = (this.getChild("n83"));
  4980. this.t1 = this.getTransition("t1");
  4981. this.t2 = this.getTransition("t2");
  4982. this.t3 = this.getTransition("t3");
  4983. this.t4 = this.getTransition("t4");
  4984. }
  4985. }
  4986. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4987. class UIMatching extends UIBase {
  4988. constructor() {
  4989. super();
  4990. }
  4991. onConstructor() {
  4992. this.ui = ui_UIMatching.createInstance();
  4993. this.contentPane = this.ui;
  4994. this.isEject = false;
  4995. }
  4996. show(callback) {
  4997. super.show();
  4998. PlatMgr.showBanner(true);
  4999. this.callback = callback;
  5000. let user = Moyu.getUserInfo();
  5001. if (!this.selfPot) {
  5002. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5003. }
  5004. if (!this.aiPot) {
  5005. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5006. }
  5007. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5008. this.ui.selfHead.nameTxt.text = user.nickName;
  5009. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5010. this.ui.aiHead.nameTxt.text = "???";
  5011. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5012. this.ui.selfHead.c1.selectedIndex = 0;
  5013. this.ui.aiHead.c1.selectedIndex = 0;
  5014. this.ui.selfHead.x = this.selfPot.x;
  5015. this.ui.selfHead.y = this.selfPot.y;
  5016. this.ui.aiHead.x = this.aiPot.x;
  5017. this.ui.aiHead.y = this.aiPot.y;
  5018. switch (xGame.common.gameMode) {
  5019. case GameMode.classic:
  5020. break;
  5021. case GameMode.bigMove:
  5022. this.initSkillData();
  5023. break;
  5024. default:
  5025. break;
  5026. }
  5027. this.ui.t1.play(Laya.Handler.create(this, () => {
  5028. this.ui.t2.play(Laya.Handler.create(this, () => {
  5029. switch (xGame.common.gameMode) {
  5030. case GameMode.classic:
  5031. this.waitingPeople();
  5032. break;
  5033. case GameMode.bigMove:
  5034. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5035. break;
  5036. default:
  5037. break;
  5038. }
  5039. }));
  5040. }));
  5041. }
  5042. initSkillData() {
  5043. this.skillSelectData = [];
  5044. let skillUrl = xGame.common.skillIconList;
  5045. let skillName = xGame.common.skillNameList;
  5046. let skillLevel = DataMgr.getBigSkillList();
  5047. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5048. for (let index = 0; index < 5; index++) {
  5049. let obj = {};
  5050. obj.skillImg = skillUrl[index];
  5051. obj.skillName = skillName[index];
  5052. obj.skillType = skillType[index];
  5053. obj.skillLevel = skillLevel[index];
  5054. this.skillSelectData.push(obj);
  5055. }
  5056. }
  5057. getAISkillLevel(myLevel) {
  5058. let video = xGame.common.upSkillLevel;
  5059. let aiLevel;
  5060. let temp;
  5061. if (video) {
  5062. temp = xGame.common.randomNum(-2, -1);
  5063. }
  5064. else {
  5065. if (myLevel <= 5) {
  5066. temp = xGame.common.randomNum(1, 3);
  5067. }
  5068. else if (myLevel <= 9) {
  5069. temp = xGame.common.randomNum(-2, 1);
  5070. }
  5071. else {
  5072. temp = xGame.common.randomNum(-4, 0);
  5073. }
  5074. }
  5075. aiLevel = temp + myLevel;
  5076. if (aiLevel <= 1)
  5077. aiLevel = 1;
  5078. if (aiLevel >= 10)
  5079. aiLevel = 10;
  5080. return aiLevel;
  5081. }
  5082. getAISkillType() {
  5083. return xGame.common.randomNum(1, 4);
  5084. let successTimes = DataMgr.getSkillSuccessTimes();
  5085. let info = cfgTable.aiskillData[successTimes];
  5086. if (!info) {
  5087. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5088. info = cfgTable.aiskillData[max];
  5089. }
  5090. let dataArr = info.skillselect;
  5091. let myCfg = {};
  5092. for (let index = 0; index < dataArr.length; index++) {
  5093. let temp = dataArr[index].split('-');
  5094. myCfg[temp[0]] = {};
  5095. myCfg[temp[0]].id = parseInt(temp[0]);
  5096. myCfg[temp[0]].weight = parseInt(temp[1]);
  5097. }
  5098. let aiCfg = xGame.common.initWeight(myCfg);
  5099. let curData = xGame.common.getRandomWeightData(aiCfg);
  5100. return parseInt(curData.id);
  5101. }
  5102. getAISkillData(index) {
  5103. let myLevel = this.skillSelectData[index].skillLevel;
  5104. let aiLevel = this.getAISkillLevel(myLevel);
  5105. let aiType = this.getAISkillType() - 1;
  5106. return { aiLevel, aiType } = { aiLevel, aiType };
  5107. }
  5108. skillSelectFinish(index) {
  5109. let aiInfo = this.getAISkillData(index);
  5110. xGame.common.gameMgr.selfCurSkill = index;
  5111. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5112. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5113. this.ui.selfHead.c1.selectedIndex = 1;
  5114. this.ui.aiHead.c1.selectedIndex = 1;
  5115. let myData = this.skillSelectData[index];
  5116. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5117. let guide = DataMgr.getSkillGuide();
  5118. if (guide == 0) {
  5119. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5120. }
  5121. else {
  5122. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5123. }
  5124. let aiData = this.skillSelectData[aiInfo.aiType];
  5125. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5126. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5127. this.waitingPeople();
  5128. }
  5129. waitingPeople() {
  5130. let time = xGame.common.randomNum(1000, 3000);
  5131. time += 1000;
  5132. Laya.timer.once(time, this, () => {
  5133. this.matchingSuccess();
  5134. });
  5135. }
  5136. matchingSuccess() {
  5137. let gameUI = xGame.common.gameUI;
  5138. let name = gameUI.ui.topNode.aiNameTxt.text;
  5139. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5140. this.ui.aiHead.nameTxt.text = name;
  5141. this.ui.aiHead.headImg.url = url;
  5142. name = gameUI.ui.topNode.selfNameTxt.text;
  5143. url = gameUI.ui.topNode.selfHeadLoader.url;
  5144. this.ui.selfHead.nameTxt.text = name;
  5145. this.ui.selfHead.headImg.url = url;
  5146. this.ui.t3.play(Laya.Handler.create(this, () => {
  5147. this.callback && this.callback();
  5148. this.ui.t4.play(Laya.Handler.create(this, () => {
  5149. this.destroySelf();
  5150. }));
  5151. }));
  5152. }
  5153. destroySelf() {
  5154. this.callback = null;
  5155. this.skillSelectData = null;
  5156. this.selfPot = null;
  5157. this.aiPot = null;
  5158. if (!this.ui.isDisposed) {
  5159. this.ui.removeFromParent();
  5160. this.ui.dispose();
  5161. }
  5162. xGame.uiMgr.destroyUI(this);
  5163. }
  5164. }
  5165. UIMatching.uiName = "UIMatching";
  5166. class ui_UIRanking extends fgui.GComponent {
  5167. static createInstance() {
  5168. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5169. }
  5170. onConstruct() {
  5171. this.n26 = (this.getChild("n26"));
  5172. this.myNode = (this.getChild("myNode"));
  5173. }
  5174. }
  5175. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5176. class UIRanking extends UIBase {
  5177. constructor() {
  5178. super();
  5179. this.showSelf = true;
  5180. this.rankType = 1;
  5181. this.rankList = [];
  5182. this.myIndex = 0;
  5183. this.myStar = 0;
  5184. }
  5185. onConstructor() {
  5186. this.ui = ui_UIRanking.createInstance();
  5187. this.contentPane = this.ui;
  5188. this.isEject = false;
  5189. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5190. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5191. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5192. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5193. this.ui.myNode.myList.setVirtual();
  5194. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5195. }
  5196. show() {
  5197. super.show();
  5198. this.myIndex = 51;
  5199. Moyu.getRankList({
  5200. rankId: xGame.common.curRankID,
  5201. type: MoyuRankType.total,
  5202. page: 1,
  5203. pageSize: 50,
  5204. }, this, this.updateItemData);
  5205. this.updateSelf();
  5206. let self = Moyu.getUserInfo();
  5207. if (!self.isAuth) {
  5208. Moyu.initUser(this, () => {
  5209. DataMgr.upRankData();
  5210. });
  5211. }
  5212. }
  5213. updateSelfItem() {
  5214. let self = Moyu.getUserInfo();
  5215. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5216. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  5217. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5218. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  5219. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5220. }
  5221. updateItemData(data) {
  5222. this.myStar = xGame.common.getAllStarNum();
  5223. if (this.rankList.length < 2) {
  5224. this.rankList = data;
  5225. let self = Moyu.getUserInfo();
  5226. for (let i = 0; i < data.length; i++) {
  5227. let data = this.rankList[i];
  5228. if (data.userId == self.userId) {
  5229. this.rankList.splice(i, 1);
  5230. break;
  5231. }
  5232. }
  5233. for (let i = 0; i < data.length; i++) {
  5234. let data = this.rankList[i];
  5235. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5236. this.myIndex = i + 1;
  5237. let user = { headIcon: self.headIcon, nickName: "myself" };
  5238. let ud = { user: user, data: {} };
  5239. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5240. if (Moyu.platType < 11) {
  5241. user.headIcon = self.headIcon;
  5242. user.nickName = self.nickName;
  5243. }
  5244. this.rankList.splice(i, 0, md);
  5245. break;
  5246. }
  5247. }
  5248. }
  5249. this.updateSelfItem();
  5250. this.ui.myNode.myList.numItems = this.rankList.length;
  5251. }
  5252. updateItemUI(index, obj) {
  5253. let data = this.rankList[index];
  5254. let userData = JSON.parse(data.userData).user;
  5255. obj.nameTxt.text = userData.nickName.toString();
  5256. obj.valueTxt.text = data.rankScore;
  5257. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5258. obj.rankTxt.text = index + 1;
  5259. switch (index) {
  5260. case 0:
  5261. this.setImg(obj, 1, 0, 0);
  5262. obj.rankTxt.color = "#FFC047";
  5263. break;
  5264. case 1:
  5265. this.setImg(obj, 0, 1, 0);
  5266. obj.rankTxt.color = "#ACACAC";
  5267. break;
  5268. case 2:
  5269. this.setImg(obj, 0, 0, 1);
  5270. obj.rankTxt.color = "#D09672";
  5271. break;
  5272. default:
  5273. this.setImg(obj, 0, 0, 0);
  5274. obj.rankTxt.color = "#496FAB";
  5275. break;
  5276. }
  5277. }
  5278. setImg(obj, a, b, c) {
  5279. obj.img1.visible = a ? true : false;
  5280. obj.img2.visible = b ? true : false;
  5281. obj.img3.visible = c ? true : false;
  5282. }
  5283. changeList(type) {
  5284. this.rankType = type;
  5285. this.updateSelf();
  5286. }
  5287. changeSelfNode() {
  5288. this.showSelf = !this.showSelf;
  5289. this.updateSelf();
  5290. }
  5291. updateSelf() {
  5292. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5293. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5294. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5295. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5296. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5297. }
  5298. }
  5299. UIRanking.uiName = "UIRanking";
  5300. class ui_UISecretary extends fgui.GComponent {
  5301. static createInstance() {
  5302. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5303. }
  5304. onConstruct() {
  5305. this.n0 = (this.getChild("n0"));
  5306. this.myNode = (this.getChild("myNode"));
  5307. this.closeBtn = (this.getChild("closeBtn"));
  5308. this.t0 = this.getTransition("t0");
  5309. }
  5310. }
  5311. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5312. class UISecretary extends UIBase {
  5313. constructor() {
  5314. super();
  5315. this.curIndex = 1;
  5316. }
  5317. onConstructor() {
  5318. this.ui = ui_UISecretary.createInstance();
  5319. this.contentPane = this.ui;
  5320. this.isEject = false;
  5321. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5322. this.nodeObj = { left: null, right: null, cur: null };
  5323. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5324. }
  5325. show() {
  5326. super.show();
  5327. this.ui.t0.play();
  5328. this.updateData();
  5329. }
  5330. addSecretarySpine(node, spineName) {
  5331. if (spineName == "mishu") {
  5332. if (this.secretarySpine1) {
  5333. node.displayObject.destroyChildren();
  5334. this.playWoman(this.secretarySpine1, node.displayObject);
  5335. }
  5336. else {
  5337. let spine1 = new SpineMgr("mishu", () => {
  5338. this.secretarySpine1 = spine1;
  5339. this.playWoman(this.secretarySpine1, node.displayObject);
  5340. });
  5341. }
  5342. }
  5343. else {
  5344. if (this.secretarySpine2) {
  5345. node.displayObject.destroyChildren();
  5346. this.playWoman(this.secretarySpine2, node.displayObject);
  5347. }
  5348. else {
  5349. let spine2 = new SpineMgr("xiaomishu2", () => {
  5350. this.secretarySpine2 = spine2;
  5351. this.playWoman(this.secretarySpine2, node.displayObject);
  5352. });
  5353. }
  5354. }
  5355. }
  5356. playWoman(node, parent) {
  5357. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5358. let yy = this.ui.myNode.gameNode3.secretary.height;
  5359. let scale = 1.5;
  5360. if (node == this.secretarySpine2) {
  5361. scale = 1.2;
  5362. }
  5363. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5364. node.play(data, 0, true, parent);
  5365. }
  5366. turnLeft() {
  5367. this.curIndex--;
  5368. if (this.curIndex < 1) {
  5369. this.curIndex = 2;
  5370. }
  5371. let left = this.nodeObj.left;
  5372. let right = this.nodeObj.right;
  5373. let cur = this.nodeObj.cur;
  5374. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5375. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5376. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5377. this.updateData();
  5378. }));
  5379. this.ui.myNode.setChildIndex(right, 2);
  5380. this.nodeObj.left = cur;
  5381. this.nodeObj.right = left;
  5382. this.nodeObj.cur = right;
  5383. }
  5384. turnRight() {
  5385. this.curIndex++;
  5386. if (this.curIndex > 2) {
  5387. this.curIndex = 1;
  5388. }
  5389. let left = this.nodeObj.left;
  5390. let right = this.nodeObj.right;
  5391. let cur = this.nodeObj.cur;
  5392. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5393. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5394. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5395. this.updateData();
  5396. }));
  5397. this.ui.myNode.setChildIndex(left, 2);
  5398. this.nodeObj.left = right;
  5399. this.nodeObj.right = cur;
  5400. this.nodeObj.cur = left;
  5401. }
  5402. updateData() {
  5403. console.log('zh: updateData FFFFFFFFFF');
  5404. let data = cfgTable.secretaryshopData;
  5405. let children = this.ui.myNode._children;
  5406. let temp;
  5407. let curData;
  5408. for (let index = 0; index < children.length; index++) {
  5409. temp = children[index];
  5410. curData = data[1];
  5411. temp.heightTxt.text = curData.height;
  5412. temp.foodTxt.text = curData.food;
  5413. temp.historyTxt.text = curData.history;
  5414. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5415. this.addSecretarySpine(temp.secretary, curData.spine);
  5416. let womanIndex = curData.id - 1;
  5417. let getWoman = DataMgr.getSecretary(womanIndex);
  5418. let curUse = DataMgr.getCurSecretary();
  5419. if (getWoman) {
  5420. if (curUse == womanIndex) {
  5421. temp.purchaseBtn.c1.selectedIndex = 1;
  5422. }
  5423. else {
  5424. temp.purchaseBtn.c1.selectedIndex = 2;
  5425. }
  5426. }
  5427. else {
  5428. temp.purchaseBtn.c1.selectedIndex = 0;
  5429. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5430. }
  5431. temp.purchaseBtn.visible = false;
  5432. }
  5433. }
  5434. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5435. console.log('zh: 点击了clickSecretary ');
  5436. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5437. if (getWoman) {
  5438. if (curUse != womanIndex) {
  5439. console.log();
  5440. DataMgr.setCurSecretary(womanIndex);
  5441. this.updateData();
  5442. }
  5443. }
  5444. else {
  5445. console.log('zh:点击购买了');
  5446. let need = needDiamond;
  5447. if (DataMgr.diamondEnough(need)) {
  5448. DataMgr.setDiamond(-need);
  5449. DataMgr.setSecretary(womanIndex, 1);
  5450. DataMgr.setCurSecretary(womanIndex);
  5451. this.updateData();
  5452. }
  5453. else {
  5454. xGame.uiMgr.Show(UIAddProp, 1);
  5455. }
  5456. }
  5457. }
  5458. closeSelf() {
  5459. this.hide();
  5460. }
  5461. }
  5462. UISecretary.uiName = "UISecretary";
  5463. class ui_UIShop extends fgui.GComponent {
  5464. static createInstance() {
  5465. return (fgui.UIPackage.createObject("game", "UIShop"));
  5466. }
  5467. onConstruct() {
  5468. this.n48 = (this.getChild("n48"));
  5469. this.n0 = (this.getChild("n0"));
  5470. this.secretary = (this.getChild("secretary"));
  5471. this.talkNode = (this.getChild("talkNode"));
  5472. this.closeNode = (this.getChild("closeNode"));
  5473. this.moneyNode = (this.getChild("moneyNode"));
  5474. this.myNode = (this.getChild("myNode"));
  5475. }
  5476. }
  5477. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5478. class BallRodDisplay {
  5479. constructor(ui, index) {
  5480. this.index = 0;
  5481. this.uiIndex = 0;
  5482. this.ui = ui;
  5483. this.index = index;
  5484. this.initData();
  5485. }
  5486. initData() {
  5487. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5488. let data = cfgTable.ballrodData[this.index + 1];
  5489. this.ui.nameTxt.text = data.name;
  5490. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5491. this.ui.levelNode.c1.selectedIndex = data.quality;
  5492. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5493. if (data.spine) {
  5494. this.mySpine = new SpineMgr(data.spine, () => {
  5495. let xx = 150;
  5496. let yy = 70;
  5497. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5498. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5499. });
  5500. }
  5501. }
  5502. updateSelf() {
  5503. console.log('zh:updateSelf -------------- ');
  5504. let get = DataMgr.getBallRod(this.index);
  5505. if (get == null)
  5506. get = 1;
  5507. let curUse = DataMgr.getCurBallRod();
  5508. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5509. if (get) {
  5510. if (curUse == this.index) {
  5511. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5512. }
  5513. else {
  5514. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5515. }
  5516. }
  5517. else {
  5518. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5519. }
  5520. }
  5521. buyBallRod() {
  5522. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5523. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5524. switch (selectedIndex) {
  5525. case 0:
  5526. break;
  5527. case 1:
  5528. console.log('zh:点击了 USE THIS');
  5529. DataMgr.setCurBallRod(this.index);
  5530. DataMgr.setDiamond(99999);
  5531. let curUse = DataMgr.getCurBallRod();
  5532. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5533. let ui = xGame.uiMgr.getUI(UIShop);
  5534. ui.updateBallRod();
  5535. break;
  5536. case 2:
  5537. let data = cfgTable.ballrodData[this.index + 1];
  5538. let need = data.price;
  5539. if (DataMgr.diamondEnough(need)) {
  5540. DataMgr.setDiamond(-need);
  5541. DataMgr.setBallRod(this.index, 1);
  5542. DataMgr.setCurBallRod(this.index);
  5543. let ui = xGame.uiMgr.getUI(UIShop);
  5544. ui.updateBallRod();
  5545. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5546. }
  5547. else {
  5548. xGame.uiMgr.Show(UIAddProp, 1);
  5549. }
  5550. break;
  5551. default:
  5552. break;
  5553. }
  5554. }
  5555. logEventForGouMaiGan(qiuGanName) {
  5556. const ev = {
  5557. value: qiuGanName
  5558. };
  5559. const jsonStr = JSON.stringify(ev);
  5560. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5561. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5562. }
  5563. }
  5564. class UIShop extends UIBase {
  5565. constructor() {
  5566. super();
  5567. this.itemNums = 0;
  5568. }
  5569. onConstructor() {
  5570. this.ui = ui_UIShop.createInstance();
  5571. this.contentPane = this.ui;
  5572. this.isEject = false;
  5573. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5574. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5575. this.addUIClick(this.ui, this.interuptSecretary);
  5576. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5577. this.ballRodArr = [];
  5578. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5579. this.ui.myNode.myList.numItems = this.itemNums;
  5580. if (Moyu.isKs)
  5581. this.ui.closeNode.closeBtn.x += 100;
  5582. }
  5583. show() {
  5584. super.show();
  5585. this.playSecretaryIdle();
  5586. this.updateBallRod();
  5587. }
  5588. updateBallRod() {
  5589. for (let index = 0; index < this.ballRodArr.length; index++) {
  5590. this.ballRodArr[index].updateSelf();
  5591. }
  5592. }
  5593. renderBallRod(sort, obj) {
  5594. let index = this.getIndexBySort(sort + 1) - 1;
  5595. let ballRod = new BallRodDisplay(obj, index);
  5596. this.ballRodArr.push(ballRod);
  5597. }
  5598. getIndexBySort(sort) {
  5599. let object = cfgTable.ballrodData;
  5600. for (const key in object) {
  5601. if (object[key].sort == sort) {
  5602. return parseInt(key);
  5603. }
  5604. }
  5605. }
  5606. playSecretaryIdle() {
  5607. let parent = this.ui.secretary.displayObject;
  5608. parent.destroyChildren();
  5609. let xx = this.ui.secretary.width / 2;
  5610. let yy = this.ui.secretary.height;
  5611. let scale = xGame.common.getSecretaryScale();
  5612. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5613. xGame.common.secretary.play(data, 0, true, parent);
  5614. }
  5615. interuptSecretary() {
  5616. Laya.timer.clearAll(this);
  5617. this.playSecretaryRandomSound();
  5618. }
  5619. playSecretaryRandomSound() {
  5620. if (this.isHide)
  5621. return;
  5622. let time = xGame.common.randomNum(45000, 60000);
  5623. Laya.timer.once(time, this, () => {
  5624. if (this.isHide)
  5625. return;
  5626. let index = xGame.common.randomNum(4, 7);
  5627. xGame.soundMgr.playSound("s_main0" + index);
  5628. let words = 1;
  5629. switch (index) {
  5630. case 4:
  5631. words = 5;
  5632. break;
  5633. case 5:
  5634. words = 3;
  5635. break;
  5636. case 6:
  5637. words = 6;
  5638. break;
  5639. case 7:
  5640. words = 7;
  5641. break;
  5642. default:
  5643. break;
  5644. }
  5645. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5646. this.playSecretaryRandomSound();
  5647. });
  5648. }
  5649. closeSelf() {
  5650. this.hide();
  5651. }
  5652. }
  5653. UIShop.uiName = "UIShop";
  5654. class ui_UISign extends fgui.GComponent {
  5655. static createInstance() {
  5656. return (fgui.UIPackage.createObject("game", "UISign"));
  5657. }
  5658. onConstruct() {
  5659. this.n6 = (this.getChild("n6"));
  5660. this.closeNode = (this.getChild("closeNode"));
  5661. this.myNode = (this.getChild("myNode"));
  5662. this.moneyNode = (this.getChild("moneyNode"));
  5663. this.secretary = (this.getChild("secretary"));
  5664. this.talkNode = (this.getChild("talkNode"));
  5665. this.tripleBtn = (this.getChild("tripleBtn"));
  5666. this.normalBtn = (this.getChild("normalBtn"));
  5667. this.tipsNode = (this.getChild("tipsNode"));
  5668. this.againBtn = (this.getChild("againBtn"));
  5669. this.t0 = this.getTransition("t0");
  5670. }
  5671. }
  5672. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5673. class SignMax {
  5674. constructor(ui) {
  5675. this.ui = ui;
  5676. }
  5677. updateSelf(index, sameDay, curDayIndex) {
  5678. let data = cfgTable.signData[index + 1];
  5679. this.ui.titleTxt.text = data.title;
  5680. let arr1 = data.award[0].split('-');
  5681. let arr2 = data.award[1].split('-');
  5682. let num1 = parseInt(arr1[1]);
  5683. let num2 = parseInt(arr2[1]);
  5684. this.ui.numTxt1.text = num1 + "";
  5685. this.ui.numTxt2.text = num2 + "";
  5686. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5687. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5688. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5689. this.ui.numTxt1.visible = false;
  5690. }
  5691. else {
  5692. this.ui.numTxt1.visible = true;
  5693. }
  5694. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5695. this.ui.numTxt2.visible = false;
  5696. }
  5697. else {
  5698. this.ui.numTxt2.visible = true;
  5699. }
  5700. if (index < curDayIndex) {
  5701. this.ui.c1.selectedIndex = 1;
  5702. }
  5703. else if (index == curDayIndex) {
  5704. if (sameDay) {
  5705. this.ui.c1.selectedIndex = 2;
  5706. }
  5707. else {
  5708. this.ui.c1.selectedIndex = 2;
  5709. }
  5710. }
  5711. else {
  5712. this.ui.c1.selectedIndex = 0;
  5713. }
  5714. }
  5715. }
  5716. class SignNormal {
  5717. constructor(ui) {
  5718. this.ui = ui;
  5719. }
  5720. updateSelf(index, sameDay, curDayIndex) {
  5721. let data = cfgTable.signData[index + 1];
  5722. this.ui.titleTxt.text = data.title;
  5723. let arr = data.award[0].split('-');
  5724. let type = parseInt(arr[0]);
  5725. let num = parseInt(arr[1]);
  5726. this.ui.numTxt.text = num + "";
  5727. if (type > 2) {
  5728. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5729. this.ui.myIcon.rotation = 0;
  5730. }
  5731. else {
  5732. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5733. this.ui.myIcon.rotation = 0;
  5734. }
  5735. if (xGame.common.signAwardContainsRod(data.award)) {
  5736. this.ui.numTxt.visible = false;
  5737. }
  5738. else {
  5739. this.ui.numTxt.visible = true;
  5740. }
  5741. if (index < curDayIndex) {
  5742. this.ui.c1.selectedIndex = 1;
  5743. }
  5744. else if (index == curDayIndex) {
  5745. if (sameDay) {
  5746. this.ui.c1.selectedIndex = 2;
  5747. }
  5748. else {
  5749. this.ui.c1.selectedIndex = 2;
  5750. }
  5751. }
  5752. else {
  5753. this.ui.c1.selectedIndex = 0;
  5754. }
  5755. }
  5756. }
  5757. class UISign extends UIBase {
  5758. constructor() {
  5759. super();
  5760. this.curDayIndex = 0;
  5761. this.starX = 0;
  5762. }
  5763. onConstructor() {
  5764. this.ui = ui_UISign.createInstance();
  5765. this.contentPane = this.ui;
  5766. this.isEject = false;
  5767. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5768. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5769. this.initSignItem();
  5770. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5771. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5772. }
  5773. show() {
  5774. super.show();
  5775. this.ui.t0.play();
  5776. this.playSecretaryIdle();
  5777. this.updateSign();
  5778. }
  5779. initSignItem() {
  5780. this.signArr = [];
  5781. for (let index = 0; index < 6; index++) {
  5782. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5783. this.signArr.push(temp);
  5784. }
  5785. this.signMax = new SignMax(this.ui.myNode.day7);
  5786. if (Moyu.isKs)
  5787. this.ui.closeNode.closeBtn.x += 100;
  5788. }
  5789. updateSign() {
  5790. let sameDay = xGame.common.judgeSameDay();
  5791. let max = 7;
  5792. this.curDayIndex = DataMgr.getSignData();
  5793. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5794. this.curDayIndex = 0;
  5795. if (!sameDay) {
  5796. this.ui.normalBtn.visible = true;
  5797. this.ui.tipsNode.visible = false;
  5798. this.ui.againBtn.visible = false;
  5799. }
  5800. else {
  5801. this.ui.normalBtn.visible = false;
  5802. let again = DataMgr.getExtraSign();
  5803. let isCurrency = false;
  5804. let index = this.curDayIndex;
  5805. if (index == 0)
  5806. index = 7;
  5807. let award = cfgTable.signData[index].award;
  5808. let num = award[0].split("-")[0];
  5809. if (num == "1" || num == "2")
  5810. isCurrency = true;
  5811. let showAgain = again == 0 && isCurrency;
  5812. this.ui.againBtn.visible = showAgain;
  5813. this.ui.tipsNode.visible = !showAgain;
  5814. }
  5815. for (let index = 0; index < this.signArr.length; index++) {
  5816. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5817. }
  5818. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5819. }
  5820. playSecretaryIdle() {
  5821. let parent = this.ui.secretary.displayObject;
  5822. parent.destroyChildren();
  5823. let xx = this.ui.secretary.width / 2;
  5824. let yy = this.ui.secretary.height;
  5825. let scale = xGame.common.getSecretaryScale();
  5826. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5827. xGame.common.secretary.play(data, 0, true, parent);
  5828. }
  5829. closeSelf() {
  5830. this.hide();
  5831. }
  5832. normalGetAward() {
  5833. let sameDay = xGame.common.judgeSameDay();
  5834. if (!sameDay) {
  5835. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5836. let temp;
  5837. let type;
  5838. let num;
  5839. let arr = [];
  5840. for (let index = 0; index < award.length; index++) {
  5841. temp = award[index].split("-");
  5842. type = parseInt(temp[0]);
  5843. num = parseInt(temp[1]);
  5844. let awardType = new AwardType();
  5845. awardType.num = num;
  5846. awardType.type = type;
  5847. arr.push(awardType);
  5848. }
  5849. xGame.common.getAward(arr, (watchVideo) => {
  5850. this.curDayIndex++;
  5851. if (this.curDayIndex > 7)
  5852. this.curDayIndex = 0;
  5853. DataMgr.setSignData(this.curDayIndex);
  5854. DataMgr.setSignTime(new Date().getTime());
  5855. if (watchVideo) {
  5856. DataMgr.setExtraSign(1);
  5857. Moyu.sendDataEvent("signIn1");
  5858. }
  5859. this.updateSign();
  5860. });
  5861. }
  5862. }
  5863. againGetAward() {
  5864. Moyu.sendDataEvent("signIn2");
  5865. console.log('zh:qjff_AD_for_uisign');
  5866. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  5867. }
  5868. else {
  5869. console.log('zh:AD 失败,直接发放奖励');
  5870. this.qjff_AD_for_uisign();
  5871. }
  5872. }
  5873. qjff_AD_for_uisign() {
  5874. let index = this.curDayIndex;
  5875. if (index == 0)
  5876. index = 7;
  5877. let award = cfgTable.signData[index].award;
  5878. let temp;
  5879. let type;
  5880. let num;
  5881. for (let index = 0; index < award.length; index++) {
  5882. temp = award[index].split("-");
  5883. type = parseInt(temp[0]);
  5884. num = parseInt(temp[1]) * 3;
  5885. xGame.common.playObjFlyAnim(num, type);
  5886. }
  5887. DataMgr.setExtraSign(1);
  5888. this.updateSign();
  5889. }
  5890. }
  5891. UISign.uiName = "UISign";
  5892. class ui_UISkill extends fgui.GComponent {
  5893. static createInstance() {
  5894. return (fgui.UIPackage.createObject("game", "UISkill"));
  5895. }
  5896. onConstruct() {
  5897. this.n48 = (this.getChild("n48"));
  5898. this.n0 = (this.getChild("n0"));
  5899. this.secretary = (this.getChild("secretary"));
  5900. this.talkNode = (this.getChild("talkNode"));
  5901. this.closeNode = (this.getChild("closeNode"));
  5902. this.moneyNode = (this.getChild("moneyNode"));
  5903. this.skillNode = (this.getChild("skillNode"));
  5904. this.guideNode = (this.getChild("guideNode"));
  5905. }
  5906. }
  5907. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5908. class SkillDisplay {
  5909. constructor(ui, data, uiIndex) {
  5910. this.starX = 0;
  5911. this.starY = 0;
  5912. this.index = 0;
  5913. this.ui = ui;
  5914. this.data = data;
  5915. this.index = uiIndex;
  5916. this.initSelf();
  5917. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5918. }
  5919. initSelf() {
  5920. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5921. this.ui.nameTxt.text = this.data.name;
  5922. this.ui.describeTxt.text = this.data.describe;
  5923. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5924. this.ui.startBtn.onClick(this, this.startGame);
  5925. this.updateSelf();
  5926. }
  5927. updateSelf() {
  5928. this.checkTry();
  5929. let level = DataMgr.getBigSkillByIndex(this.index);
  5930. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5931. }
  5932. checkTry() {
  5933. let index = this.index;
  5934. let level = DataMgr.getBigSkillByIndex(index);
  5935. if (level == null) {
  5936. DataMgr.setBigSkill(index, 1, false);
  5937. level = 1;
  5938. }
  5939. this.ui.levelTxt.text = "LV." + level;
  5940. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5941. this.ui.tryNode.visible = true;
  5942. else
  5943. this.ui.tryNode.visible = false;
  5944. }
  5945. clickAddLevel() {
  5946. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5947. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5948. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  5949. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  5950. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5951. }
  5952. else {
  5953. console.log('zh:AD 失败,直接发放奖励');
  5954. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5955. }
  5956. }
  5957. qjff_AD_for_skilldisplay_clickAddLevel() {
  5958. DataMgr.setBigSkill(this.data.index, 1);
  5959. this.updateSelf();
  5960. xGame.common.upSkillLevel = true;
  5961. }
  5962. startGame() {
  5963. if (this.data.index == 3) {
  5964. alert('Coming soon!');
  5965. return;
  5966. }
  5967. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5968. let needCoin = xGame.common.bigMoveNeedCoin;
  5969. xGame.common.passAwardCoin = 2000;
  5970. let guide = DataMgr.getSkillGuide();
  5971. console.log('zh:startGame guide=' + guide);
  5972. xGame.common.temSelfLevel = 0;
  5973. if (guide == 0) {
  5974. needCoin = 0;
  5975. xGame.common.temSelfLevel = 100;
  5976. }
  5977. if (DataMgr.coinEnough(needCoin)) {
  5978. DataMgr.setCoin(-needCoin);
  5979. xGame.common.curPlayerSkillType = this.index;
  5980. if (guide == 0)
  5981. xGame.common.curPlayerSkillType = 0;
  5982. xGame.uiMgr.Show(UIGame);
  5983. xGame.uiMgr.Hide(UIMain);
  5984. xGame.uiMgr.Show(UIMatching, () => {
  5985. xGame.common.gameUI.ui.alpha = 1;
  5986. xGame.common.gameUI.startGame();
  5987. xGame.uiMgr.Hide(UISkill);
  5988. });
  5989. }
  5990. else {
  5991. xGame.uiMgr.Show(UIAddProp, 0);
  5992. Moyu.sendDataEvent("AddCoinVideo");
  5993. }
  5994. }
  5995. }
  5996. class UISkill extends UIBase {
  5997. constructor() {
  5998. super();
  5999. this.skillData = [];
  6000. }
  6001. onConstructor() {
  6002. this.ui = ui_UISkill.createInstance();
  6003. this.contentPane = this.ui;
  6004. this.isEject = false;
  6005. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6006. this.initSkillData();
  6007. console.log('zh:aaaaaa1111111111');
  6008. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6009. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6010. console.log('zh:aaaaaa22222222');
  6011. this.displayList = [];
  6012. this.ui.skillNode.skillList.numItems = 3;
  6013. this.addUIClick(this.ui, this.interuptSecretary);
  6014. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6015. this.ui.talkNode.visible = false;
  6016. if (Moyu.isKs)
  6017. this.ui.closeNode.closeBtn.x += 100;
  6018. }
  6019. show() {
  6020. super.show();
  6021. this.playSecretaryIdle();
  6022. this.moneyNode.ui.c1.selectedIndex = 1;
  6023. Laya.timer.clearAll(this);
  6024. xGame.soundMgr.playSound("s_start");
  6025. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6026. let guide = DataMgr.getSkillGuide();
  6027. this.ui.guideNode.visible = guide == 0;
  6028. let item = this.getSkillItemByUIIndex(0);
  6029. if (guide == 0) {
  6030. item.ui.c1.selectedIndex = 1;
  6031. }
  6032. else {
  6033. item.ui.c1.selectedIndex = 0;
  6034. }
  6035. this.ui.guideNode.guideBtn.visible = guide == 0;
  6036. for (let index = 0; index < this.displayList.length; index++) {
  6037. this.displayList[index].checkTry();
  6038. }
  6039. }
  6040. getSkillItemByUIIndex(cur) {
  6041. for (let index = 0; index < this.displayList.length; index++) {
  6042. if (this.displayList[index].index == cur) {
  6043. return this.displayList[index];
  6044. }
  6045. }
  6046. }
  6047. enterGuideLevel() {
  6048. let item = this.getSkillItemByUIIndex(0);
  6049. item.startGame();
  6050. if (DataMgr.getNewUser())
  6051. Moyu.sendDataEvent("gameStart1");
  6052. }
  6053. initSkillData() {
  6054. this.skillData = [];
  6055. let nameList = xGame.common.skillNameList;
  6056. let iconList = xGame.common.skillIconList;
  6057. let describeList = [
  6058. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6059. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
  6060. "The power of frost descends—freezing the flow and taking full control of the game!"
  6061. ];
  6062. console.log('zh:initSkillData 111111111');
  6063. let data;
  6064. for (let index = 0; index < nameList.length; index++) {
  6065. data = {};
  6066. data.name = nameList[index];
  6067. data.icon = iconList[index];
  6068. data.describe = describeList[index];
  6069. data.index = index;
  6070. this.skillData.push(data);
  6071. }
  6072. }
  6073. updateSkillItem(index, target) {
  6074. if (this.displayList[index] == null) {
  6075. let uiIndex;
  6076. switch (index) {
  6077. case 0:
  6078. uiIndex = 1;
  6079. break;
  6080. case 1:
  6081. uiIndex = 0;
  6082. break;
  6083. case 2:
  6084. uiIndex = 2;
  6085. break;
  6086. case 3:
  6087. uiIndex = 3;
  6088. break;
  6089. default:
  6090. break;
  6091. }
  6092. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6093. this.displayList.push(temp);
  6094. }
  6095. }
  6096. playSecretaryIdle() {
  6097. let parent = this.ui.secretary.displayObject;
  6098. parent.destroyChildren();
  6099. let xx = this.ui.secretary.width / 2;
  6100. let yy = this.ui.secretary.height;
  6101. let scale = xGame.common.getSecretaryScale();
  6102. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6103. xGame.common.secretary.play(data, 0, true, parent);
  6104. }
  6105. returnUIMain() {
  6106. this.hide();
  6107. xGame.common.stopGirlPop(this.ui.talkNode);
  6108. xGame.uiMgr.Show(UIMain);
  6109. }
  6110. interuptSecretary() {
  6111. Laya.timer.clearAll(this);
  6112. this.playSecretaryRandomSound();
  6113. }
  6114. playSecretaryRandomSound() {
  6115. if (this.isHide)
  6116. return;
  6117. let time = xGame.common.randomNum(45000, 60000);
  6118. Laya.timer.once(time, this, () => {
  6119. if (this.isHide)
  6120. return;
  6121. let index = xGame.common.randomNum(4, 7);
  6122. xGame.soundMgr.playSound("s_main0" + index);
  6123. let words = 1;
  6124. switch (index) {
  6125. case 4:
  6126. words = 5;
  6127. break;
  6128. case 5:
  6129. words = 3;
  6130. break;
  6131. case 6:
  6132. words = 6;
  6133. break;
  6134. case 7:
  6135. words = 7;
  6136. break;
  6137. default:
  6138. break;
  6139. }
  6140. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6141. this.playSecretaryRandomSound();
  6142. });
  6143. }
  6144. }
  6145. UISkill.uiName = "UISkill";
  6146. class ui_UIMsg extends fgui.GComponent {
  6147. static createInstance() {
  6148. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6149. }
  6150. onConstruct() {
  6151. this.tipsNode = (this.getChild("tipsNode"));
  6152. }
  6153. }
  6154. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6155. class UIMsg extends UIBase {
  6156. constructor() {
  6157. super();
  6158. }
  6159. onConstructor() {
  6160. this.ui = ui_UIMsg.createInstance();
  6161. this.contentPane = this.ui;
  6162. this.isEject = false;
  6163. this.isMuti = true;
  6164. }
  6165. show(msg, callback) {
  6166. super.show();
  6167. this.ui.tipsNode.msgTxt.text = msg;
  6168. this.ui.alpha = 1;
  6169. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6170. this.hide();
  6171. callback && callback();
  6172. }), 1000);
  6173. }
  6174. }
  6175. UIMsg.uiName = "UIMsg";
  6176. class ui_UIModeSelection extends fgui.GComponent {
  6177. static createInstance() {
  6178. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6179. }
  6180. onConstruct() {
  6181. this.n19 = (this.getChild("n19"));
  6182. this.closeBtn = (this.getChild("closeBtn"));
  6183. this.myNode = (this.getChild("myNode"));
  6184. this.t0 = this.getTransition("t0");
  6185. }
  6186. }
  6187. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6188. class UIModeSelection extends UIBase {
  6189. constructor() {
  6190. super();
  6191. }
  6192. onConstructor() {
  6193. this.ui = ui_UIModeSelection.createInstance();
  6194. this.contentPane = this.ui;
  6195. this.isEject = false;
  6196. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6197. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6198. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6199. this.addUIClick(this.ui.closeBtn, this.hide);
  6200. this.peopleArr = [650, 6900, 3800];
  6201. this.peopleOffest = [50, 500, 200];
  6202. this.updateSelf();
  6203. }
  6204. show(callback) {
  6205. super.show();
  6206. this.ui.t0.play();
  6207. this.callback = callback;
  6208. }
  6209. updateSelf() {
  6210. let cfg = cfgTable.modeselectData;
  6211. for (let index = 1; index <= 3; index++) {
  6212. let node = this.ui.myNode["type" + index];
  6213. node.need.text = cfg[index].need;
  6214. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6215. node.peopleTxt.text = this.getRandPeople(index - 1);
  6216. }
  6217. }
  6218. enterGame(type) {
  6219. console.log('zh: 进入经典模式 type: ' + type);
  6220. xGame.common.classicRoomType = type;
  6221. let cfg = cfgTable.modeselectData[type];
  6222. let need = cfg.need;
  6223. xGame.common.passAwardCoin = cfg.award;
  6224. if (DataMgr.coinEnough(need)) {
  6225. DataMgr.setCoin(-need);
  6226. this.ui.myNode["type" + type].t0.play();
  6227. Laya.timer.once(200, this, () => {
  6228. this.callback && this.callback();
  6229. });
  6230. }
  6231. else {
  6232. Moyu.sendDataEvent("AddCoinVideo");
  6233. xGame.uiMgr.Show(UIAddProp, 0);
  6234. }
  6235. }
  6236. getRandPeople(index) {
  6237. let rand = this.peopleOffest[index];
  6238. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6239. }
  6240. }
  6241. UIModeSelection.uiName = "UIModeSelection";
  6242. class ui_UIGetAward extends fgui.GComponent {
  6243. static createInstance() {
  6244. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6245. }
  6246. onConstruct() {
  6247. this.n4 = (this.getChild("n4"));
  6248. this.n0 = (this.getChild("n0"));
  6249. this.myList = (this.getChild("myList"));
  6250. this.n1 = (this.getChild("n1"));
  6251. this.eftNode = (this.getChild("eftNode"));
  6252. this.btnNode = (this.getChild("btnNode"));
  6253. this.t0 = this.getTransition("t0");
  6254. }
  6255. }
  6256. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6257. class UIGetAward extends UIBase {
  6258. constructor() {
  6259. super();
  6260. this.showTriple = true;
  6261. }
  6262. onConstructor() {
  6263. this.ui = ui_UIGetAward.createInstance();
  6264. this.contentPane = this.ui;
  6265. this.isEject = false;
  6266. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6267. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6268. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6269. }
  6270. show(arr, showTriple, callback) {
  6271. super.show();
  6272. this.ui.t0.play();
  6273. this.ui.eftNode.visible = true;
  6274. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6275. this.ui.eftNode.visible = false;
  6276. }), 1, 0, 0, 0.9);
  6277. this.awardArr = arr;
  6278. this.showTriple = showTriple;
  6279. this.callback = callback;
  6280. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6281. this.ui.myList.numItems = arr.length;
  6282. xGame.soundMgr.playSound("getaward");
  6283. }
  6284. updateSelf(index, obj) {
  6285. let temp = this.awardArr[index];
  6286. let icon = this.getIcon(temp.type);
  6287. let str = icon;
  6288. if (temp.type > 2) {
  6289. str = "s" + icon;
  6290. }
  6291. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6292. obj.myIcon.rotation = 0;
  6293. obj.numTxt.text = temp.num + "";
  6294. obj.numTxt.visible = temp.type > 2 ? false : true;
  6295. obj.nameTxt.text = this.getNameStr(temp.type);
  6296. }
  6297. renderItem(index, obj) {
  6298. this.updateSelf(index, obj);
  6299. }
  6300. tripleGetAward() {
  6301. console.log('zh:qjff_AD_for_uigetAward');
  6302. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6303. }
  6304. else {
  6305. console.log('zh:AD 失败,直接发放奖励');
  6306. this.qjff_AD_for_uigetAward();
  6307. }
  6308. }
  6309. qjff_AD_for_uigetAward() {
  6310. this.getAward(3);
  6311. }
  6312. normalGetAward() {
  6313. if (PlatMgr.isMisVideo())
  6314. this.tripleGetAward();
  6315. else
  6316. this.getAward();
  6317. }
  6318. getAward(times = 1) {
  6319. this.hide();
  6320. for (let index = 0; index < this.awardArr.length; index++) {
  6321. this.awardArr[index].num *= times;
  6322. }
  6323. this.callback && this.callback(times != 1);
  6324. }
  6325. getIcon(type) {
  6326. switch (type) {
  6327. case Prop.diamond:
  6328. return "ty_zs";
  6329. case Prop.coin:
  6330. return "ty_jb";
  6331. case Prop.gan1:
  6332. return "qg1";
  6333. case Prop.gan2:
  6334. return "qg2";
  6335. case Prop.gan3:
  6336. return "qg3";
  6337. case Prop.gan4:
  6338. return "qg4";
  6339. default:
  6340. break;
  6341. }
  6342. }
  6343. getNameStr(type) {
  6344. switch (type) {
  6345. case Prop.diamond:
  6346. return "Diamond";
  6347. case Prop.coin:
  6348. return "Coins";
  6349. case Prop.gan1:
  6350. case Prop.gan2:
  6351. case Prop.gan3:
  6352. case Prop.gan4:
  6353. return cfgTable.ballrodData[type - 1].name;
  6354. default:
  6355. break;
  6356. }
  6357. }
  6358. }
  6359. UIGetAward.uiName = "UIGetAward";
  6360. class ui_UIRepentProp extends fgui.GComponent {
  6361. static createInstance() {
  6362. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6363. }
  6364. onConstruct() {
  6365. this.c1 = this.getController("c1");
  6366. this.n11 = (this.getChild("n11"));
  6367. this.regretNode = (this.getChild("regretNode"));
  6368. this.helpLineNode = (this.getChild("helpLineNode"));
  6369. this.t0 = this.getTransition("t0");
  6370. }
  6371. }
  6372. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6373. class UIRepentProp extends UIBase {
  6374. constructor() {
  6375. super();
  6376. this.viewType = 0;
  6377. this.regretType = 0;
  6378. }
  6379. onConstructor() {
  6380. this.ui = ui_UIRepentProp.createInstance();
  6381. this.contentPane = this.ui;
  6382. this.isEject = false;
  6383. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6384. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6385. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6386. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6387. }
  6388. show(viewType, regretType, callback) {
  6389. PlatMgr.showInsert(true);
  6390. this.viewType = viewType;
  6391. this.regretType = regretType;
  6392. this.callback = callback;
  6393. super.show();
  6394. this.ui.t0.play();
  6395. this.ui.c1.selectedIndex = this.viewType;
  6396. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6397. if (this.viewType == 0) {
  6398. let guide = DataMgr.getGuideHelpLine();
  6399. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6400. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6401. }
  6402. xGame.common.gameMgr.gamePause = true;
  6403. }
  6404. hideSelf() {
  6405. xGame.common.gameMgr.gamePause = false;
  6406. this.callback && this.callback(false);
  6407. this.hide();
  6408. }
  6409. videoRegret() {
  6410. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6411. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6412. }
  6413. else {
  6414. console.log('zh:AD 失败,直接发放奖励');
  6415. this.qjff_AD_for_UIrepentProp_videoRegret();
  6416. }
  6417. }
  6418. qjff_AD_for_UIrepentProp_videoRegret() {
  6419. this.callback && this.callback(true);
  6420. this.hideSelf();
  6421. }
  6422. videoAddHelpLine() {
  6423. let guide = DataMgr.getGuideHelpLine();
  6424. if (guide == 0) {
  6425. this.callback && this.callback(true);
  6426. this.hideSelf();
  6427. DataMgr.setGuideHelpLine();
  6428. xGame.common.gameUI.ui.guideNode.visible = false;
  6429. }
  6430. else {
  6431. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6432. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6433. }
  6434. else {
  6435. console.log('zh:AD 失败,直接发放奖励');
  6436. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6437. }
  6438. }
  6439. }
  6440. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6441. this.callback && this.callback(true);
  6442. this.hideSelf();
  6443. }
  6444. }
  6445. UIRepentProp.uiName = "UIRepentProp";
  6446. class UIMain extends UIBase {
  6447. constructor() {
  6448. super();
  6449. this.firstEnter = true;
  6450. }
  6451. nativeCallJs(msg) {
  6452. let t = msg;
  6453. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6454. switch (t) {
  6455. case 'qjff_chouJiang':
  6456. let dui = xGame.uiMgr.getUI(UIDraw);
  6457. dui.qjff_chouJiang();
  6458. break;
  6459. case 'qjff_AD_for_uisign':
  6460. let dui2 = xGame.uiMgr.getUI(UISign);
  6461. dui2.qjff_AD_for_uisign();
  6462. break;
  6463. case 'qjff_AD_for_uitry':
  6464. let dui3 = xGame.uiMgr.getUI(UITry);
  6465. dui3.qjff_AD_for_uitry();
  6466. break;
  6467. case 'qjff_AD_for_uipower':
  6468. let dui4 = xGame.uiMgr.getUI(UIPower);
  6469. dui4.qjff_AD_for_uipower();
  6470. break;
  6471. case 'qjff_AD_for_uigetAward':
  6472. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6473. dui5.qjff_AD_for_uigetAward();
  6474. break;
  6475. case 'qjff_AD_for_uiGameEnd':
  6476. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6477. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6478. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6479. break;
  6480. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6481. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6482. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6483. break;
  6484. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6485. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6486. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6487. break;
  6488. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6489. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6490. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6491. break;
  6492. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6493. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6494. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6495. break;
  6496. case 'qjff_AD_for_UIBOX_onOpenBox':
  6497. let dui11 = xGame.uiMgr.getUI(UIBox);
  6498. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6499. break;
  6500. case 'qjff_AD_for_UIAddCoin':
  6501. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6502. dui12.qjff_AD_for_UIAddCoin();
  6503. break;
  6504. case '111a':
  6505. let dui14 = xGame.uiMgr.getUI(UISign);
  6506. dui14.qjff_AD_for_uisign();
  6507. break;
  6508. case '222a':
  6509. let dui15 = xGame.uiMgr.getUI(UISign);
  6510. dui15.qjff_AD_for_uisign();
  6511. break;
  6512. case '333a':
  6513. let dui16 = xGame.uiMgr.getUI(UISign);
  6514. dui16.qjff_AD_for_uisign();
  6515. break;
  6516. default:
  6517. console.log('zh:未知的方法名字' + t);
  6518. break;
  6519. }
  6520. }
  6521. onConstructor() {
  6522. console.log('zh: UIMain onConstructor');
  6523. this.ui = ui_UIMain.createInstance();
  6524. this.contentPane = this.ui;
  6525. this.isEject = false;
  6526. this.addEvent();
  6527. this.addClickSpine();
  6528. this.settingNode = new SettingNode(this.ui.settingNode);
  6529. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6530. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6531. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6532. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6533. let curUse = DataMgr.getCurSecretary();
  6534. this.changeSecretary(curUse);
  6535. this.ui.rankBtn.visible = false;
  6536. this.ui.talkNode.visible = false;
  6537. let guide = DataMgr.getSkillGuide();
  6538. if (xGame.common.isNewDay && guide == 1) {
  6539. xGame.common.isNewDay = false;
  6540. xGame.soundMgr.playSound("s_main01");
  6541. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6542. console.log("zh:播放小秘书每天语音");
  6543. }
  6544. this.ui.n83.visible = false;
  6545. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6546. }
  6547. changeSecretary(curUse) {
  6548. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6549. xGame.common.secretary && xGame.common.secretary.dispose();
  6550. this.addSecretarySpine(name);
  6551. }
  6552. addSecretarySpine(name) {
  6553. let spine = new SpineMgr(name, () => {
  6554. this.playSecretaryIdle();
  6555. });
  6556. xGame.common.secretary = spine;
  6557. }
  6558. addClickSpine() {
  6559. let clickSpine = new SpineMgr("dianji", () => {
  6560. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6561. let parent = Laya.stage;
  6562. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6563. clickSpine.play(data, 0, false, parent, (spine) => {
  6564. spine.destroy(true);
  6565. });
  6566. });
  6567. });
  6568. }
  6569. addEvent() {
  6570. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6571. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6572. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6573. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6574. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6575. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6576. this.addUIClick(this.ui, this.interuptSecretary);
  6577. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6578. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6579. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6580. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6581. this.addUIClick(this.ui.signBtn, this.openSignView);
  6582. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6583. }
  6584. show(showFailWords) {
  6585. super.show();
  6586. this.moneyNode.ui.c1.selectedIndex = 1;
  6587. this.playSecretaryIdle();
  6588. xGame.soundMgr.playMusic("caromhall01", 0);
  6589. Laya.timer.clearAll(this);
  6590. this.playSecretaryRandomSound();
  6591. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  6592. if (showFailWords) {
  6593. console.log('zh:uimain.ts ');
  6594. setTimeout(() => {
  6595. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6596. let words = -1;
  6597. if (str == "s_main02") {
  6598. words = 2;
  6599. }
  6600. else {
  6601. words = 3;
  6602. }
  6603. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6604. xGame.soundMgr.playSound(str);
  6605. }, 300);
  6606. }
  6607. this.showGuide();
  6608. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6609. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6610. let guide = DataMgr.getSkillGuide();
  6611. if (guide == 1) {
  6612. let randTime = xGame.common.randomNum(300, 800);
  6613. if (this.firstEnter) {
  6614. console.log("zh: firstEnter");
  6615. this.firstEnter = false;
  6616. randTime += 900;
  6617. }
  6618. else {
  6619. console.log("zh: no firstEnter");
  6620. }
  6621. Laya.timer.once(randTime, this, () => {
  6622. xGame.common.autoPopUIView();
  6623. });
  6624. }
  6625. }
  6626. checkActive(show) {
  6627. }
  6628. showGuide() {
  6629. let guide = DataMgr.getSkillGuide();
  6630. this.ui.guideBtn.visible = guide == 0;
  6631. this.ui.enterGuide.visible = false;
  6632. this.ui.secretaryGuide.visible = guide == 0;
  6633. if (guide == 0) {
  6634. console.log("zh:显示引导");
  6635. xGame.soundMgr.playSound("s_guide");
  6636. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6637. }
  6638. else {
  6639. console.log("zh:不需要显示引导");
  6640. }
  6641. }
  6642. ensureSecretary() {
  6643. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6644. this.ui.secretaryGuide.visible = false;
  6645. this.ui.enterGuide.visible = true;
  6646. this.ui.wordsNode.t0.play();
  6647. if (DataMgr.getNewUser())
  6648. Moyu.sendDataEvent("gameReady");
  6649. }
  6650. playSecretaryIdle() {
  6651. let parent = this.ui.secretary.displayObject;
  6652. parent.destroyChildren();
  6653. let xx = this.ui.secretary.width / 2;
  6654. let yy = this.ui.secretary.height;
  6655. let scale = xGame.common.getSecretaryScale();
  6656. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6657. console.log("zh:playSecretaryIdle", data);
  6658. xGame.common.secretary.play(data, 0, true, parent);
  6659. }
  6660. startGame(type) {
  6661. xGame.common.gameMode = type;
  6662. Moyu.sendDataEvent("PlayGame", { type: type });
  6663. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  6664. switch (xGame.common.gameMode) {
  6665. case GameMode.classic:
  6666. console.log('zh:进入经典模式111111111');
  6667. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  6668. let db_over_lev = DataMgr.getChallengeMode_overLev();
  6669. console.log('zh:classic db_over_lev=', db_over_lev);
  6670. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  6671. console.log('zh:判断是否可以玩该模式classic =NO');
  6672. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  6673. xGame.uiMgr.Show(UIMsg, tipStr);
  6674. console.log('zh:返回');
  6675. return;
  6676. }
  6677. else {
  6678. console.log('zh:可以玩该模式classic 66666666666666');
  6679. this.beginGame();
  6680. }
  6681. }
  6682. else {
  6683. console.log('zh:不需要判断是否可以玩该classic');
  6684. let challengeTimes = DataMgr.getChallengeTimes();
  6685. if (challengeTimes == 0) {
  6686. xGame.uiMgr.Show(UIInvitation);
  6687. }
  6688. else {
  6689. this.beginGame();
  6690. }
  6691. break;
  6692. }
  6693. case GameMode.bigMove:
  6694. console.error('zh:bigMove check');
  6695. let guide = DataMgr.getSkillGuide();
  6696. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  6697. let db_over_lev = DataMgr.getChallengeMode_overLev();
  6698. console.log('zh:bigMove db_over_lev=', db_over_lev);
  6699. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  6700. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  6701. xGame.uiMgr.Show(UIMsg, tipStr);
  6702. return;
  6703. }
  6704. else {
  6705. console.log('zh:可以玩该模式 bigMove');
  6706. this.beginGame();
  6707. if (DataMgr.getNewUser())
  6708. Moyu.sendDataEvent("gameStart0");
  6709. }
  6710. }
  6711. else {
  6712. this.beginGame();
  6713. if (DataMgr.getNewUser())
  6714. Moyu.sendDataEvent("gameStart0");
  6715. }
  6716. break;
  6717. default:
  6718. console.error('zh:未知错误!!!!');
  6719. break;
  6720. }
  6721. }
  6722. beginGame(isNice = false) {
  6723. console.log('zh:beginGame ');
  6724. let guide = DataMgr.getSkillGuide();
  6725. if (guide == 1) {
  6726. console.log('zh:非新手引导,showInternAd ');
  6727. JSBridgeUtils.instance.showInternAd('beginGame');
  6728. }
  6729. else {
  6730. console.log('zh:新手引导,不显示AD ');
  6731. }
  6732. console.log('zh:beginGame 2 go');
  6733. if (xGame.common.gameMode == GameMode.classic) {
  6734. if (isNice) {
  6735. this.enterClassic();
  6736. }
  6737. else {
  6738. xGame.uiMgr.Show(UIModeSelection, () => {
  6739. console.log('zh:BBBBBBBBBBBBBBB');
  6740. this.enterClassic();
  6741. });
  6742. }
  6743. }
  6744. else if (xGame.common.gameMode == GameMode.bigMove) {
  6745. this.ui.enterGuide.visible = false;
  6746. xGame.uiMgr.Show(UISkill);
  6747. }
  6748. }
  6749. enterClassic() {
  6750. xGame.uiMgr.Show(UIGame);
  6751. xGame.uiMgr.Show(UIMatching, () => {
  6752. if (!this.isHide)
  6753. this.hide();
  6754. xGame.common.gameUI.ui.alpha = 1;
  6755. xGame.common.gameUI.startGame();
  6756. xGame.uiMgr.Hide(UIGameEnd);
  6757. });
  6758. }
  6759. startGlobal() {
  6760. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6761. }
  6762. startWeekly() {
  6763. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6764. }
  6765. zhouSaiMonth() {
  6766. console.log('zh: zhouSaiMonth 被调用');
  6767. }
  6768. startPlaceBall() {
  6769. xGame.uiMgr.Show(UILevelDisplay);
  6770. }
  6771. hide() {
  6772. console.log('zh:uimain hide ...');
  6773. super.hide();
  6774. xGame.common.stopGirlPop(this.ui.talkNode);
  6775. }
  6776. onGetUserInfo(force = false) {
  6777. if (Moyu.isWx) {
  6778. let info = Moyu.getSystemInfo();
  6779. if (info)
  6780. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6781. }
  6782. else {
  6783. Moyu.initUser(this, this.freshUser, force);
  6784. }
  6785. if (!Moyu.hasUserInfo) {
  6786. let user = Moyu.getUserInfo();
  6787. user.headIcon = 'res/ty_touxiang.png';
  6788. }
  6789. this.freshUser();
  6790. }
  6791. freshUser() {
  6792. let user = Moyu.getUserInfo();
  6793. if (!user.isAuth) {
  6794. user.headIcon = 'res/ty_touxiang.png';
  6795. }
  6796. else
  6797. DataMgr.upRankData();
  6798. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6799. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6800. }
  6801. interuptSecretary() {
  6802. Laya.timer.clearAll(this);
  6803. this.playSecretaryRandomSound();
  6804. }
  6805. playSecretaryRandomSound() {
  6806. if (this.isHide)
  6807. return;
  6808. let time = xGame.common.randomNum(45000, 60000);
  6809. Laya.timer.once(time, this, () => {
  6810. if (this.isHide)
  6811. return;
  6812. let index = xGame.common.randomNum(4, 7);
  6813. xGame.soundMgr.playSound("s_main0" + index);
  6814. let words = 1;
  6815. switch (index) {
  6816. case 4:
  6817. words = 5;
  6818. break;
  6819. case 5:
  6820. words = 3;
  6821. break;
  6822. case 6:
  6823. words = 6;
  6824. break;
  6825. case 7:
  6826. words = 7;
  6827. break;
  6828. default:
  6829. break;
  6830. }
  6831. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6832. this.playSecretaryRandomSound();
  6833. });
  6834. }
  6835. openSecretaryView() {
  6836. xGame.uiMgr.Show(UISecretary);
  6837. Moyu.sendDataEvent("secretary");
  6838. }
  6839. openShopView() {
  6840. xGame.uiMgr.Show(UIShop);
  6841. }
  6842. openSignView() {
  6843. xGame.uiMgr.Show(UISign);
  6844. }
  6845. openDrawView() {
  6846. xGame.uiMgr.Show(UIDraw);
  6847. }
  6848. openRanking() {
  6849. console.log('zh:phb openRanking');
  6850. xGame.uiMgr.Show(UIRanking);
  6851. Moyu.sendDataEvent("rankingList");
  6852. }
  6853. }
  6854. UIMain.uiName = "UIMain";
  6855. class UIGameEnd extends UIBase {
  6856. constructor() {
  6857. super();
  6858. this.success = false;
  6859. this.awardCoinNum = 1000;
  6860. this.awardDiamondNum = 10;
  6861. }
  6862. onConstructor() {
  6863. this.ui = ui_UIGameEnd.createInstance();
  6864. this.contentPane = this.ui;
  6865. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6866. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6867. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6868. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6869. this.ui.talkNode.visible = false;
  6870. if (Moyu.isKs)
  6871. this.ui.closeNode.closeBtn.x += 100;
  6872. }
  6873. updateType() {
  6874. switch (xGame.common.gameMode) {
  6875. case GameMode.classic:
  6876. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6877. this.ui.coinNode.visible = this.success;
  6878. if (!this.success) {
  6879. Laya.timer.once(500, this, () => {
  6880. xGame.uiMgr.Show(UIAddCoin);
  6881. });
  6882. }
  6883. this.ui.isGetAward.visible = false;
  6884. this.ui.leftBtn.c1.selectedIndex = 3;
  6885. this.ui.rightBtn.c1.selectedIndex = 0;
  6886. this.moneyNode.ui.c1.selectedIndex = 1;
  6887. break;
  6888. case GameMode.bigMove:
  6889. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6890. this.ui.coinNode.visible = this.success;
  6891. if (xGame.common.gameMode == GameMode.bigMove) {
  6892. if (this.success) {
  6893. DataMgr.setSkillSuccessTimes(1, true);
  6894. DataMgr.setSkillAccTimes(1);
  6895. }
  6896. else {
  6897. DataMgr.setSkillSuccessTimes(0, false);
  6898. }
  6899. }
  6900. if (!this.success) {
  6901. Laya.timer.once(500, this, () => {
  6902. xGame.uiMgr.Show(UIAddCoin);
  6903. });
  6904. }
  6905. this.ui.isGetAward.visible = false;
  6906. this.ui.leftBtn.c1.selectedIndex = 3;
  6907. this.ui.rightBtn.c1.selectedIndex = 0;
  6908. this.moneyNode.ui.c1.selectedIndex = 1;
  6909. break;
  6910. case GameMode.placeBall:
  6911. this.ui.coinNode.visible = false;
  6912. if (this.success) {
  6913. if (xGame.common.placeBallStarNum == 3) {
  6914. this.ui.c1.selectedIndex = 2;
  6915. }
  6916. else {
  6917. this.ui.c1.selectedIndex = 3;
  6918. }
  6919. }
  6920. else {
  6921. this.ui.c1.selectedIndex = 4;
  6922. }
  6923. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6924. if (cfg.type == PlaceBallType.challenge) {
  6925. this.ui.c1.selectedIndex = 2;
  6926. }
  6927. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6928. this.updatePlaceBallBtn();
  6929. this.updatePlaceBallStarNum();
  6930. this.updatePlaceBallAwardState();
  6931. this.moneyNode.ui.c1.selectedIndex = 2;
  6932. this.moneyNode.checkPowerTime();
  6933. this.moneyNode.powerChange();
  6934. DataMgr.upRankData();
  6935. break;
  6936. default:
  6937. break;
  6938. }
  6939. }
  6940. updatePlaceBallBtn() {
  6941. this.ui.leftBtn.c1.selectedIndex = 5;
  6942. if (this.success) {
  6943. this.ui.rightBtn.c1.selectedIndex = 14;
  6944. }
  6945. else {
  6946. if (xGame.common.placeBallStarNum == 3) {
  6947. this.ui.rightBtn.c1.selectedIndex = 14;
  6948. }
  6949. else {
  6950. this.ui.rightBtn.c1.selectedIndex = 1;
  6951. }
  6952. }
  6953. }
  6954. updatePlaceBallStarNum() {
  6955. let starNum = xGame.common.placeBallStarNum;
  6956. if (starNum == 0)
  6957. this.ui.starNumNode.c1.selectedIndex = 3;
  6958. else {
  6959. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6960. }
  6961. }
  6962. updatePlaceBallAwardState() {
  6963. let level = xGame.common.placeBallCurLevel;
  6964. let starNum = xGame.common.placeBallStarNum;
  6965. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6966. let data = cfgTable.placeballData[level].award;
  6967. let cfg = cfgTable.placeballData[level];
  6968. this.awardDiamondNum = data[1];
  6969. this.awardCoinNum = data[0];
  6970. if (cfg.type == PlaceBallType.challenge) {
  6971. this.awardDiamondNum = 0;
  6972. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6973. }
  6974. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6975. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6976. if (cfg.type == PlaceBallType.challenge) {
  6977. this.ui.awardNode.coinNode.visible = true;
  6978. }
  6979. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6980. this.ui.awardNode.diamondNode.x = 265;
  6981. this.ui.awardNode.coinNode.x = 354;
  6982. }
  6983. else {
  6984. this.ui.awardNode.diamondNode.x = 291;
  6985. this.ui.awardNode.coinNode.x = 291;
  6986. }
  6987. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6988. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6989. if (this.awardCoinNum == 0) {
  6990. this.ui.awardNode.coinNode.numTxt.text = "";
  6991. }
  6992. if (getAward) {
  6993. this.ui.isGetAward.visible = true;
  6994. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6995. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6996. }
  6997. else {
  6998. this.ui.isGetAward.visible = false;
  6999. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  7000. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  7001. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  7002. }
  7003. else {
  7004. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  7005. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  7006. }
  7007. }
  7008. }
  7009. show(success) {
  7010. super.show();
  7011. xGame.eventMgr.event(RESET_GAME);
  7012. this.success = success;
  7013. Laya.timer.clearAll(this);
  7014. this.playSecretaryAni();
  7015. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  7016. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  7017. offsetTime = Math.floor(offsetTime / 1000);
  7018. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  7019. this.updateType();
  7020. Laya.timer.once(200, this, () => {
  7021. this.addAward(() => {
  7022. this.updateType();
  7023. Laya.timer.once(500, this, () => {
  7024. this.showChallengeLevel();
  7025. });
  7026. });
  7027. });
  7028. if (this.success) {
  7029. JSBridgeUtils.instance.showInternAd('gameend_success');
  7030. console.log('zh:game end 成功');
  7031. xGame.soundMgr.playSound('slots_roll01');
  7032. xGame.soundMgr.playSound("s_win");
  7033. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7034. this.diyGameDataUtilForGameWin();
  7035. }
  7036. else {
  7037. JSBridgeUtils.instance.showInternAd('gameend_faill');
  7038. console.log('zh:game end失败');
  7039. xGame.soundMgr.playSound('matchwin01');
  7040. xGame.soundMgr.playSound("s_lose");
  7041. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7042. }
  7043. let challengeNum = DataMgr.getChallengeTimes();
  7044. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7045. DataMgr.setChallengeTimes(1);
  7046. }
  7047. if (this.success && xGame.common.gameMode == GameMode.classic) {
  7048. DataMgr.setClassicTimes();
  7049. }
  7050. }
  7051. diyGameDataUtilForGameWin() {
  7052. console.log('zh: DiyGameDataUtilForGameWin diy ');
  7053. switch (xGame.common.gameMode) {
  7054. case GameMode.classic:
  7055. console.log('zh:DiyGameDataUtilForGameWin 111');
  7056. case GameMode.bigMove:
  7057. console.log('zh:DiyGameDataUtilForGameWin 222');
  7058. this.restartGame();
  7059. break;
  7060. case GameMode.placeBall:
  7061. console.log('zh:DiyGameDataUtilForGameWin 333');
  7062. var level = xGame.common.placeBallCurLevel;
  7063. console.log('zh:练习模式 联系了多少LEV=' + level);
  7064. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7065. if (level > db_over_lev) {
  7066. DataMgr.setChallengeMode_overLev(level);
  7067. }
  7068. break;
  7069. default:
  7070. console.log('zh:DiyGameDataUtilForGameWin 444');
  7071. break;
  7072. }
  7073. }
  7074. showChallengeLevel() {
  7075. if (DataMgr.getChallengeTimes() != 0)
  7076. return;
  7077. let skill = DataMgr.getSkillAccTimes();
  7078. let put = DataMgr.getPlaceBallLevelList().length;
  7079. if (skill >= 3 || put >= 5) {
  7080. xGame.uiMgr.Show(UIInvitation);
  7081. this.hide();
  7082. }
  7083. }
  7084. addAward(callback) {
  7085. if (!this.success) {
  7086. callback && callback();
  7087. return;
  7088. }
  7089. switch (xGame.common.gameMode) {
  7090. case GameMode.classic:
  7091. this.awardCoinNum = xGame.common.passAwardCoin;
  7092. this.awardDiamondNum = 0;
  7093. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7094. break;
  7095. case GameMode.bigMove:
  7096. this.awardCoinNum = xGame.common.passAwardCoin;
  7097. this.awardDiamondNum = 0;
  7098. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7099. callback && callback();
  7100. break;
  7101. case GameMode.placeBall:
  7102. let level = xGame.common.placeBallCurLevel;
  7103. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  7104. if (xGame.common.placeBallStarNum != 3) {
  7105. callback && callback();
  7106. return;
  7107. }
  7108. else {
  7109. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7110. if (getAward) {
  7111. callback && callback();
  7112. return;
  7113. }
  7114. }
  7115. let cfg = cfgTable.placeballData[level];
  7116. let data = cfgTable.placeballData[level].award;
  7117. this.awardCoinNum = data[0];
  7118. this.awardDiamondNum = data[1];
  7119. if (cfg.type == PlaceBallType.challenge) {
  7120. this.awardDiamondNum = 0;
  7121. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7122. }
  7123. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  7124. let diamondAward;
  7125. if (this.awardDiamondNum > 0) {
  7126. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  7127. xGame.common.getAward([diamondAward, coinAward], callback);
  7128. }
  7129. else {
  7130. xGame.common.getAward([coinAward], callback);
  7131. }
  7132. if (cfg.type == PlaceBallType.normal) {
  7133. DataMgr.setPlaceBallAward(level);
  7134. }
  7135. break;
  7136. default:
  7137. break;
  7138. }
  7139. }
  7140. playSecretaryAni_old() {
  7141. let parent = this.ui.secretary.displayObject;
  7142. parent.destroyChildren();
  7143. let xx = this.ui.secretary.width / 2;
  7144. let yy = this.ui.secretary.height;
  7145. let scale = xGame.common.getSecretaryScale();
  7146. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7147. if (this.success) {
  7148. let rand = Math.random() <= 0.5 ? 2 : 3;
  7149. xGame.common.secretary.play(data, rand, false, parent, () => {
  7150. xGame.common.secretary.play(data, 1, true, parent);
  7151. });
  7152. }
  7153. else {
  7154. xGame.common.secretary.play(data, 0, true, parent);
  7155. }
  7156. }
  7157. playSecretaryAni() {
  7158. let parent = this.ui.secretary.displayObject;
  7159. parent.destroyChildren();
  7160. let xx = this.ui.secretary.width / 2;
  7161. let yy = this.ui.secretary.height;
  7162. let scale = xGame.common.getSecretaryScale();
  7163. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7164. if (this.success) {
  7165. let rand = 0;
  7166. xGame.common.secretary.play(data, 0, true, parent);
  7167. }
  7168. else {
  7169. xGame.common.secretary.play(data, 0, true, parent);
  7170. }
  7171. }
  7172. restartGame() {
  7173. switch (xGame.common.gameMode) {
  7174. case GameMode.classic:
  7175. xGame.eventMgr.event(RESTART_GAME);
  7176. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7177. break;
  7178. case GameMode.bigMove:
  7179. this.hide();
  7180. xGame.eventMgr.event(RESTART_GAME);
  7181. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7182. break;
  7183. default:
  7184. break;
  7185. }
  7186. }
  7187. hide() {
  7188. super.hide();
  7189. xGame.common.stopGirlPop(this.ui.talkNode);
  7190. PlatMgr.showBanner(false);
  7191. }
  7192. returnHome() {
  7193. this.hide();
  7194. let showFailWords = !this.success;
  7195. xGame.uiMgr.Show(UIMain, showFailWords);
  7196. }
  7197. clickLeftBtn() {
  7198. switch (xGame.common.gameMode) {
  7199. case GameMode.classic:
  7200. case GameMode.bigMove:
  7201. this.returnHome();
  7202. break;
  7203. case GameMode.placeBall:
  7204. let level = xGame.common.placeBallCurLevel;
  7205. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7206. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7207. break;
  7208. default:
  7209. break;
  7210. }
  7211. }
  7212. powerStartPlaceBallLevel(level, btn) {
  7213. if (DataMgr.powerEnough()) {
  7214. btn.touchable = false;
  7215. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7216. btn.touchable = true;
  7217. DataMgr.setPower(-1);
  7218. xGame.eventMgr.event(POWER_TIME);
  7219. this.startPlaceBallLevel(level);
  7220. }));
  7221. }
  7222. else {
  7223. xGame.uiMgr.Show(UIPower, 0);
  7224. }
  7225. }
  7226. clickRightBtn() {
  7227. switch (xGame.common.gameMode) {
  7228. case GameMode.classic:
  7229. console.log('zh:clickRightBtn 111');
  7230. case GameMode.bigMove:
  7231. console.log('zh:clickRightBtn 222');
  7232. this.restartGame();
  7233. break;
  7234. case GameMode.placeBall:
  7235. console.log('zh:clickRightBtn 333');
  7236. let level = xGame.common.placeBallCurLevel;
  7237. let data = DataMgr.getPlaceBallLevel(level);
  7238. let curPss = data.play && !data.isCur;
  7239. if (curPss) {
  7240. console.log('zh:clickRightBtn 333-111');
  7241. console.log('zh:当前LV=' + level);
  7242. if (level == 60) {
  7243. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7244. Laya.timer.once(3000, this, () => {
  7245. this.returnHome();
  7246. });
  7247. }
  7248. else {
  7249. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  7250. }
  7251. }
  7252. else {
  7253. console.log('zh:clickRightBtn 333-000');
  7254. Moyu.sendDataEvent("placeBallNextLevel");
  7255. console.log('zh:qjff_AD_for_uiGameEnd');
  7256. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7257. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7258. }
  7259. else {
  7260. console.log('zh:AD 失败,直接发放奖励');
  7261. this.qjff_AD_for_uiGameEnd(level);
  7262. }
  7263. }
  7264. break;
  7265. default:
  7266. console.log('zh:clickRightBtn 444');
  7267. break;
  7268. }
  7269. }
  7270. qjff_AD_for_uiGameEnd(level) {
  7271. DataMgr.setPlaceBallLevel(level, 1);
  7272. this.startPlaceBallLevel(level + 1);
  7273. }
  7274. startPlaceBallLevel(level) {
  7275. xGame.common.gameMode = GameMode.placeBall;
  7276. xGame.common.placeBallCurLevel = level;
  7277. xGame.uiMgr.Show(UIGame);
  7278. this.hide();
  7279. }
  7280. }
  7281. UIGameEnd.uiName = "UIGameEnd";
  7282. class ui_UIVideoShare extends fgui.GComponent {
  7283. static createInstance() {
  7284. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7285. }
  7286. onConstruct() {
  7287. this.n10 = (this.getChild("n10"));
  7288. this.myNode = (this.getChild("myNode"));
  7289. this.t0 = this.getTransition("t0");
  7290. }
  7291. }
  7292. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7293. class UIVideoShare extends UIBase {
  7294. constructor() {
  7295. super();
  7296. this.success = false;
  7297. this.awardNum = 0;
  7298. this.isShared = true;
  7299. }
  7300. onConstructor() {
  7301. this.ui = ui_UIVideoShare.createInstance();
  7302. this.contentPane = this.ui;
  7303. this.isEject = false;
  7304. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7305. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7306. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7307. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7308. }
  7309. show(success) {
  7310. super.show();
  7311. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7312. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7313. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7314. this.success = success;
  7315. let time = xGame.common.randomNum(600, 1500);
  7316. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  7317. if (success)
  7318. xGame.soundMgr.playSound("applause");
  7319. this.ui.t0.play();
  7320. this.checkShareState();
  7321. let times = DataMgr.getDailyVideoShareTimes();
  7322. this.awardNum = times == 0 ? 2000 : 200;
  7323. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  7324. }
  7325. checkShareState() {
  7326. if (PlatMgr.forceShare == 0) {
  7327. this.ui.myNode.closeBtn.visible = true;
  7328. this.ui.myNode.tipsNode.visible = false;
  7329. this.ui.myNode.closeBtn.x = 90;
  7330. this.ui.myNode.shareBtn.x = 342;
  7331. }
  7332. else if (PlatMgr.forceShare == 1) {
  7333. this.ui.myNode.closeBtn.visible = false;
  7334. this.ui.myNode.tipsNode.visible = true;
  7335. this.ui.myNode.shareBtn.x = 218;
  7336. this.isShared = true;
  7337. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7338. }
  7339. }
  7340. checkForceShare() {
  7341. this.isShared = !this.isShared;
  7342. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7343. }
  7344. videoShare() {
  7345. if (PlatMgr.forceShare == 1) {
  7346. if (this.isShared) {
  7347. this.shareGame();
  7348. }
  7349. else {
  7350. this.hideSelf();
  7351. }
  7352. }
  7353. else {
  7354. this.shareGame();
  7355. }
  7356. }
  7357. shareGame() {
  7358. Moyu.sendDataEvent("VideoShare");
  7359. if (Moyu.canShare() > 100) {
  7360. Moyu.shareGame((success) => {
  7361. if (success) {
  7362. DataMgr.setDailyVideoShareTimes(1);
  7363. DataMgr.setCoin(this.awardNum);
  7364. }
  7365. this.hideSelf();
  7366. }, this);
  7367. }
  7368. else {
  7369. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  7370. this.hideSelf();
  7371. }
  7372. }
  7373. hideSelf() {
  7374. this.hide();
  7375. xGame.uiMgr.Show(UIGameEnd, this.success);
  7376. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  7377. xGame.common.screenImg.destroy();
  7378. xGame.common.screenImg = null;
  7379. }
  7380. }
  7381. }
  7382. UIVideoShare.uiName = "UIVideoShare";
  7383. class ui_UITips extends fgui.GComponent {
  7384. static createInstance() {
  7385. return (fgui.UIPackage.createObject("game", "UITips"));
  7386. }
  7387. onConstruct() {
  7388. this.n0 = (this.getChild("n0"));
  7389. this.myNode = (this.getChild("myNode"));
  7390. this.t0 = this.getTransition("t0");
  7391. }
  7392. }
  7393. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7394. class UITips extends UIBase {
  7395. constructor() {
  7396. super();
  7397. this.type = 0;
  7398. }
  7399. onConstructor() {
  7400. this.ui = ui_UITips.createInstance();
  7401. this.contentPane = this.ui;
  7402. this.isEject = false;
  7403. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7404. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7405. }
  7406. show(tipsTxt, womanTxt, type) {
  7407. super.show();
  7408. this.ui.t0.play();
  7409. this.ui.myNode.tipsTxt.text = tipsTxt;
  7410. this.ui.myNode.womanTxt.text = womanTxt;
  7411. PlatMgr.showInsert(true);
  7412. this.ui.myNode.c1.selectedIndex = type;
  7413. this.type = type;
  7414. switch (this.type) {
  7415. case TipsType.exitGame:
  7416. xGame.common.gameMgr.gamePause = true;
  7417. break;
  7418. case TipsType.foul:
  7419. Laya.timer.once(200, this, () => {
  7420. xGame.common.gameMgr.gamePause = true;
  7421. });
  7422. break;
  7423. default:
  7424. break;
  7425. }
  7426. }
  7427. clickLeftBtn() {
  7428. this.hide();
  7429. xGame.common.gameMgr.gamePause = false;
  7430. switch (this.type) {
  7431. case TipsType.exitGame:
  7432. break;
  7433. case TipsType.foul:
  7434. break;
  7435. default:
  7436. break;
  7437. }
  7438. }
  7439. clickRightBtn() {
  7440. this.hide();
  7441. switch (this.type) {
  7442. case TipsType.exitGame:
  7443. xGame.eventMgr.event(RESET_GAME);
  7444. xGame.uiMgr.Show(UIMain);
  7445. Moyu.recordEnd(this, null);
  7446. xGame.common.longHelpLine = false;
  7447. break;
  7448. case TipsType.foul:
  7449. xGame.common.gameMgr.gamePause = false;
  7450. Laya.timer.clearAll(this);
  7451. break;
  7452. default:
  7453. break;
  7454. }
  7455. }
  7456. }
  7457. UITips.uiName = "UITips";
  7458. class GameMgr {
  7459. constructor() {
  7460. this.selfCamp = "";
  7461. this.selfFoulNum = 0;
  7462. this.selfBallArr = [];
  7463. this.selfTimer = 0;
  7464. this.selfScore = 0;
  7465. this.aiCamp = "";
  7466. this.aiFoulNum = 0;
  7467. this.aiBallArr = [];
  7468. this.aiTimer = 0;
  7469. this.aiScore = 0;
  7470. this.aiSkillLevelNum = 1;
  7471. this.targertScore = 0;
  7472. this.setTime = 30;
  7473. this.selfTurnRate = 0.5;
  7474. this.accTime = 0;
  7475. this.curFoul = "";
  7476. this.maxFoulTimes = 3;
  7477. this.isFirstInGame = true;
  7478. this.firstColliObj = null;
  7479. this.inHoleBalls = [];
  7480. this.blackNum = 8;
  7481. this.success = false;
  7482. this.holePosList = [];
  7483. this.posObj = {};
  7484. this._selfTurn = false;
  7485. this.lastRootBallPos = new Laya.Vector2(311, 430);
  7486. this.ensureBallType = false;
  7487. this.isOpenBall = true;
  7488. this.finishOneShoot = true;
  7489. this.isEnd = false;
  7490. this.isChangeTurn = false;
  7491. this.isInterrupt = false;
  7492. this.aiPlayedBreakArmy = false;
  7493. this.isTouchedBall = false;
  7494. this.finishBalls = 0;
  7495. this.needBalls = 0;
  7496. this.allBallNum = 0;
  7497. this.placeBallPosData = {};
  7498. this.curHP = 0;
  7499. this.showLongView = false;
  7500. this.firstShoot = true;
  7501. this._gamePause = false;
  7502. this.trunCount = 0;
  7503. this.isBlackInHole = false;
  7504. this.isEnter = true;
  7505. xGame.eventMgr.offAll(ALL_BALL_STOP);
  7506. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  7507. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  7508. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  7509. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  7510. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  7511. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  7512. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  7513. }
  7514. get gamePause() {
  7515. return this._gamePause;
  7516. }
  7517. set gamePause(v) {
  7518. if (v) {
  7519. Laya.physicsTimer.pause();
  7520. }
  7521. else {
  7522. Laya.physicsTimer.resume();
  7523. }
  7524. this._gamePause = v;
  7525. }
  7526. get selfTurn() {
  7527. return this._selfTurn;
  7528. }
  7529. set selfTurn(val) {
  7530. this.trunCount++;
  7531. this._selfTurn = val;
  7532. if (val) {
  7533. xGame.common.d2World.d2Gan.ui.self.visible = true;
  7534. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7535. }
  7536. else {
  7537. xGame.common.d2World.d2Gan.ui.self.visible = false;
  7538. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  7539. if (this.trunCount > 1)
  7540. PlatMgr.openBox();
  7541. }
  7542. }
  7543. resetGame() {
  7544. this.inHoleBalls = [];
  7545. this.isFirstInGame = true;
  7546. this.firstColliObj = null;
  7547. this.aiCamp = "";
  7548. this.selfCamp = "";
  7549. this.aiFoulNum = 0;
  7550. this.selfFoulNum = 0;
  7551. this.selfBallArr = [];
  7552. this.aiBallArr = [];
  7553. this.gamePause = false;
  7554. this.ensureBallType = false;
  7555. this.isInterrupt = false;
  7556. this.updateLeftBall();
  7557. this.clearTime();
  7558. this.aiPlayedBreakArmy = false;
  7559. this.isBlackInHole = false;
  7560. this.placeBallPosData = {};
  7561. if (xGame.common.d3World.knifeRoot) {
  7562. xGame.common.d3World.knifeRoot.destroyChildren();
  7563. }
  7564. }
  7565. gameReady() {
  7566. this.trunCount = 0;
  7567. this.firstColliObj = null;
  7568. this.isFirstInGame = true;
  7569. this.selfTurn = Math.random() <= this.selfTurnRate;
  7570. let challengeNum = DataMgr.getChallengeTimes();
  7571. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7572. this.selfTurn = true;
  7573. }
  7574. if (xGame.common.gameMode == GameMode.placeBall)
  7575. this.selfTurn = true;
  7576. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7577. this.selfTurn = true;
  7578. }
  7579. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7580. this.checkGuide();
  7581. if (xGame.common.uiRodMethod)
  7582. xGame.common.uiRodMethod.resetRod();
  7583. xGame.common.d2World.getHelpLine();
  7584. this.isOpenBall = true;
  7585. this.isTouchedBall = false;
  7586. xGame.common.aiPlayer.stopRun();
  7587. this.setTime = 30;
  7588. let ui = xGame.common.gameUI.ui;
  7589. switch (xGame.common.gameMode) {
  7590. case GameMode.classic:
  7591. xGame.common.aiPlayer.init();
  7592. this.blackNum = 8;
  7593. this.placeRootBall();
  7594. this.peoplePlay(9, 10);
  7595. ui.wordsBtn.visible = true;
  7596. ui.aiWordsBtn.visible = true;
  7597. xGame.common.talkMgr.changeAIState(true);
  7598. DataMgr.gameData.gameCount++;
  7599. DataMgr.saveGameData();
  7600. break;
  7601. case GameMode.bigMove:
  7602. this.blackNum = -1;
  7603. this.selfScore = 0;
  7604. this.aiScore = 0;
  7605. xGame.common.aiPlayer.init();
  7606. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7607. this.updateSelfScore();
  7608. this.updateAIScore();
  7609. this.updateTargetSroce();
  7610. this.placeRootBall();
  7611. this.peoplePlay(9, 10);
  7612. ui.wordsBtn.visible = true;
  7613. ui.aiWordsBtn.visible = true;
  7614. xGame.common.talkMgr.changeAIState(true);
  7615. if (DataMgr.getSkillGuide() < 1)
  7616. DataMgr.gameData.gameCount = 0;
  7617. else {
  7618. DataMgr.gameData.gameCount++;
  7619. DataMgr.saveGameData();
  7620. PlatMgr.openTry();
  7621. }
  7622. if (xGame.common.d3World.knifeRoot) {
  7623. xGame.common.d3World.knifeRoot.destroyChildren();
  7624. }
  7625. break;
  7626. case GameMode.placeBall:
  7627. this.blackNum = -1;
  7628. this.selfTurn = true;
  7629. this.setTime = 10000;
  7630. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7631. this.curHP = this.placeBallData.hp;
  7632. if (this.placeBallData.ball == -1)
  7633. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7634. else
  7635. this.needBalls = this.placeBallData.ball;
  7636. console.log("需要的进球数目", this.needBalls);
  7637. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7638. this.finishBalls = 0;
  7639. this.placeBallPosData = {};
  7640. this.updatePlaceBallPos();
  7641. this.updatePlaceBallState();
  7642. this.finishOneShoot = true;
  7643. xGame.common.gameUI.ui.moveNode.visible = false;
  7644. this.isOpenBall = false;
  7645. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7646. ui.wordsBtn.visible = false;
  7647. ui.aiWordsBtn.visible = false;
  7648. xGame.common.talkMgr.changeAIState(false);
  7649. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7650. PlatMgr.openBox();
  7651. });
  7652. break;
  7653. default:
  7654. break;
  7655. }
  7656. this.showLongView = false;
  7657. xGame.common.wordsMgr.comboTimes = 1;
  7658. let guide = DataMgr.getSkillGuide();
  7659. if (guide)
  7660. xGame.eventMgr.event(WAIT_SHOOT);
  7661. xGame.common.upSkillLevel = false;
  7662. xGame.common.gameStartTime = new Date().getTime();
  7663. this.firstShoot = true;
  7664. }
  7665. checkGuide() {
  7666. let guide = DataMgr.getSkillGuide();
  7667. let gameUI = xGame.common.gameUI.ui;
  7668. gameUI.guide1.visible = false;
  7669. gameUI.guide2.visible = false;
  7670. gameUI.guide3.visible = false;
  7671. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7672. this.selfTurn = true;
  7673. }
  7674. else {
  7675. return;
  7676. }
  7677. let oneBall = this.getOneBall();
  7678. gameUI.guide1.visible = true;
  7679. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7680. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7681. }
  7682. getOneBall() {
  7683. let arr = xGame.common.d2World.ballArr;
  7684. for (let index = 0; index < arr.length; index++) {
  7685. if (arr[index].number == 0)
  7686. continue;
  7687. return arr[index];
  7688. }
  7689. }
  7690. updateSelfScore() {
  7691. let ui = xGame.common.gameUI.ui.topNode;
  7692. ui.selfScoreTxt.text = this.selfScore + "";
  7693. }
  7694. updateAIScore() {
  7695. let ui = xGame.common.gameUI.ui.topNode;
  7696. ui.aiScoreTxt.text = this.aiScore + "";
  7697. }
  7698. updateTargetSroce() {
  7699. let ui = xGame.common.gameUI.ui.topNode;
  7700. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7701. }
  7702. updateLeftBall() {
  7703. let topUI = xGame.common.gameUI.ui.topNode;
  7704. topUI.selfBallList.numItems = this.selfBallArr.length;
  7705. topUI.aiBallList.numItems = this.aiBallArr.length;
  7706. }
  7707. ballShoot() {
  7708. this.clearTime();
  7709. this.finishOneShoot = false;
  7710. xGame.common.gameUI.ui.moveNode.visible = false;
  7711. if (xGame.common.gameUI.ui.guideNode.visible) {
  7712. xGame.common.gameUI.ui.guideNode.visible = false;
  7713. }
  7714. if (this.firstShoot) {
  7715. this.firstShoot = false;
  7716. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7717. }
  7718. }
  7719. ensureCamp(number) {
  7720. this.ensureBallType = true;
  7721. this.isOpenBall = false;
  7722. if (xGame.common.gameMode != GameMode.classic)
  7723. return;
  7724. let full = [1, 2, 3, 4, 5, 6, 7];
  7725. let flower = [9, 10, 11, 12, 13, 14, 15];
  7726. let sayWords = "";
  7727. if (this.selfTurn) {
  7728. if (number <= 7) {
  7729. this.selfCamp = ballCamp.full;
  7730. this.selfBallArr = full;
  7731. this.aiCamp = ballCamp.flower;
  7732. this.aiBallArr = flower;
  7733. sayWords = cfgTable.wordsData[3].msg;
  7734. }
  7735. else {
  7736. this.selfCamp = ballCamp.flower;
  7737. this.selfBallArr = flower;
  7738. this.aiCamp = ballCamp.full;
  7739. this.aiBallArr = full;
  7740. sayWords = cfgTable.wordsData[4].msg;
  7741. }
  7742. }
  7743. else {
  7744. if (number <= 7) {
  7745. this.selfCamp = ballCamp.flower;
  7746. this.selfBallArr = flower;
  7747. this.aiCamp = ballCamp.full;
  7748. this.aiBallArr = full;
  7749. sayWords = cfgTable.wordsData[2].msg;
  7750. }
  7751. else {
  7752. this.selfCamp = ballCamp.full;
  7753. this.selfBallArr = full;
  7754. this.aiCamp = ballCamp.flower;
  7755. this.aiBallArr = flower;
  7756. sayWords = cfgTable.wordsData[1].msg;
  7757. }
  7758. }
  7759. this.updateLeftBall();
  7760. xGame.uiMgr.Show(UIMsg, sayWords);
  7761. }
  7762. updatePlaceBallState() {
  7763. let ui = xGame.common.gameUI.ui;
  7764. switch (this.placeBallData.type) {
  7765. case PlaceBallType.normal:
  7766. let normal = ui.placeNormalNode;
  7767. normal.hpTxt.text = this.curHP + "";
  7768. this.updatePlaceBallStar(normal);
  7769. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7770. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7771. break;
  7772. case PlaceBallType.challenge:
  7773. let challenge = ui.placeChallengeNode;
  7774. challenge.hpTxt.text = "Shots:" + this.curHP;
  7775. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7776. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7777. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7778. break;
  7779. default:
  7780. break;
  7781. }
  7782. }
  7783. playSubHpAni() {
  7784. let ui = xGame.common.gameUI.ui;
  7785. switch (this.placeBallData.type) {
  7786. case PlaceBallType.normal:
  7787. let normal = ui.placeNormalNode;
  7788. normal.hpTxt.visible = false;
  7789. normal.starAni.c1.selectedIndex = 1;
  7790. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7791. normal.hpTxt.visible = true;
  7792. normal.starAni.c1.selectedIndex = 0;
  7793. }));
  7794. break;
  7795. default:
  7796. break;
  7797. }
  7798. }
  7799. getEndStarNum() {
  7800. let num;
  7801. let level = xGame.common.placeBallCurLevel;
  7802. if (this.curHP == this.placeBallData.hp) {
  7803. num = 3;
  7804. }
  7805. else if (this.curHP <= 1) {
  7806. num = 1;
  7807. }
  7808. else {
  7809. num = 2;
  7810. }
  7811. if (!this.success) {
  7812. num = 0;
  7813. }
  7814. else {
  7815. DataMgr.setPlaceBallLevel(level, num);
  7816. }
  7817. let myType = cfgTable.placeballData[level].type;
  7818. if (this.success && myType == 1) {
  7819. num = 3;
  7820. }
  7821. xGame.common.placeBallStarNum = num;
  7822. }
  7823. updatePlaceBallStar(node) {
  7824. let star = 0;
  7825. if (this.curHP == this.placeBallData.hp) {
  7826. star = 3;
  7827. }
  7828. else if (this.curHP >= 2) {
  7829. star = 2;
  7830. }
  7831. else if (this.curHP == 1) {
  7832. star = 1;
  7833. }
  7834. else {
  7835. star = 0;
  7836. }
  7837. let temp;
  7838. for (let index = 1; index <= 3; index++) {
  7839. temp = node["star" + index];
  7840. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7841. }
  7842. node.myProgress.value = (star / 3) * 100;
  7843. }
  7844. openRegretView(isFoul, GoalNum, challenge = false) {
  7845. let regretType = -1;
  7846. if (isFoul) {
  7847. regretType = 1;
  7848. }
  7849. else {
  7850. if (GoalNum <= 0) {
  7851. regretType = 0;
  7852. }
  7853. }
  7854. if (challenge) {
  7855. regretType = 1;
  7856. }
  7857. if (regretType != -1) {
  7858. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7859. if (success) {
  7860. this.curHP++;
  7861. this.updatePlaceBallState();
  7862. this.setPlaceBallAllPos();
  7863. xGame.common.gameUI.ui.moveNode.visible = false;
  7864. }
  7865. else {
  7866. if (this.curHP <= 0) {
  7867. this.success = false;
  7868. this.gameEnd();
  7869. }
  7870. this.playSubHpAni();
  7871. }
  7872. this.updatePlaceBallState();
  7873. this.updatePlaceBallPos();
  7874. });
  7875. }
  7876. }
  7877. setPlaceBallAllPos() {
  7878. let allBall = xGame.common.d2World.ballArr;
  7879. let cfgArr = this.placeBallPosData;
  7880. let temp;
  7881. let obj;
  7882. for (let index = 0; index < allBall.length; index++) {
  7883. temp = allBall[index];
  7884. if (temp.destroyed)
  7885. continue;
  7886. obj = cfgArr[temp.myUNID];
  7887. if (obj && obj.src && !obj.src.destroyed) {
  7888. temp.gameObj.x = obj.posX;
  7889. temp.gameObj.y = obj.posY;
  7890. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7891. }
  7892. }
  7893. xGame.common.d2World.getHelpLine();
  7894. }
  7895. updatePlaceBallPos() {
  7896. let arr = xGame.common.d2World.ballArr;
  7897. let temp;
  7898. for (let index = 0; index < arr.length; index++) {
  7899. temp = arr[index];
  7900. if (!this.placeBallPosData[temp.myUNID]) {
  7901. this.placeBallPosData[temp.myUNID] = {
  7902. src: temp,
  7903. posX: temp.gameObj.x,
  7904. posY: temp.gameObj.y
  7905. };
  7906. }
  7907. else {
  7908. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7909. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7910. }
  7911. }
  7912. let check;
  7913. for (const key in this.placeBallPosData) {
  7914. check = this.placeBallPosData[key];
  7915. if (check.src.destroyed) {
  7916. delete this.placeBallPosData[key];
  7917. }
  7918. }
  7919. }
  7920. gameRun(type) {
  7921. if (this.gamePause)
  7922. return;
  7923. this.curFoul = this.getFoulType();
  7924. if (type) {
  7925. xGame.common.d2World.d2Gan.shoot();
  7926. xGame.common.gameUI.forceCancel();
  7927. this.curFoul = type;
  7928. }
  7929. this.isEnd = false;
  7930. this.isChangeTurn = true;
  7931. if (xGame.common.gameMode == GameMode.classic) {
  7932. this.judgeClassic(this.curFoul);
  7933. this.checkClassicWords(() => {
  7934. xGame.common.destroyClassicEmotion();
  7935. if (this.isEnd) {
  7936. if (this.isBlackInHole) {
  7937. xGame.common.gameUI.ui.blackAni.visible = true;
  7938. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7939. xGame.common.gameUI.ui.blackAni.visible = false;
  7940. this.gameEnd();
  7941. }));
  7942. }
  7943. else {
  7944. this.gameEnd();
  7945. }
  7946. }
  7947. else {
  7948. this.waitShoot();
  7949. xGame.eventMgr.event(WAIT_SHOOT);
  7950. }
  7951. });
  7952. }
  7953. else if (xGame.common.gameMode == GameMode.bigMove) {
  7954. xGame.common.aiPlayer.stopRun();
  7955. let scoreArr = this.getScore(this.curFoul);
  7956. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7957. this.isEnd = true;
  7958. }
  7959. this.checkBigSkillWords(() => {
  7960. if (this.isEnd) {
  7961. this.gameEnd();
  7962. }
  7963. else {
  7964. this.waitShoot();
  7965. xGame.eventMgr.event(WAIT_SHOOT);
  7966. }
  7967. });
  7968. }
  7969. else if (xGame.common.gameMode == GameMode.placeBall) {
  7970. xGame.common.destroyAwardSpine();
  7971. let isFoul = this.curFoul == FoulType.rootHole;
  7972. let GoalNum = this.inHoleBalls.length;
  7973. if (this.inHoleBalls.indexOf(0) > -1)
  7974. GoalNum -= 1;
  7975. if (isFoul) {
  7976. this.placeRootBall();
  7977. }
  7978. console.log("neeballs", this.needBalls);
  7979. console.log("当前完成的goalNum", GoalNum);
  7980. this.finishBalls += GoalNum;
  7981. console.log("当前完成的finishballs", this.finishBalls);
  7982. let need = this.needBalls;
  7983. if (this.placeBallData.type == PlaceBallType.challenge) {
  7984. need += 100;
  7985. }
  7986. if (this.finishBalls >= need) {
  7987. this.success = true;
  7988. this.gameEnd();
  7989. }
  7990. else {
  7991. switch (this.placeBallData.type) {
  7992. case PlaceBallType.normal:
  7993. if (!isFoul && GoalNum > 0) {
  7994. this.updatePlaceBallPos();
  7995. this.updatePlaceBallState();
  7996. }
  7997. else {
  7998. this.curHP--;
  7999. this.openRegretView(isFoul, GoalNum);
  8000. }
  8001. this.waitShoot();
  8002. xGame.eventMgr.event(WAIT_SHOOT);
  8003. break;
  8004. case PlaceBallType.challenge:
  8005. this.curHP--;
  8006. this.updatePlaceBallState();
  8007. if (isFoul) {
  8008. this.openRegretView(isFoul, GoalNum, true);
  8009. }
  8010. else {
  8011. this.updatePlaceBallPos();
  8012. if (this.curHP <= 0) {
  8013. this.success = true;
  8014. this.gameEnd();
  8015. }
  8016. }
  8017. this.waitShoot();
  8018. xGame.eventMgr.event(WAIT_SHOOT);
  8019. break;
  8020. default:
  8021. break;
  8022. }
  8023. }
  8024. }
  8025. }
  8026. checkClassicWords(callback) {
  8027. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  8028. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  8029. let type = this.getClassicWordsType();
  8030. if (condition && type != -1) {
  8031. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  8032. xGame.soundMgr.playSound(str);
  8033. xGame.common.wordsMgr.playClassicWords(type, callback);
  8034. }
  8035. else {
  8036. Laya.timer.once(300, this, () => {
  8037. callback && callback();
  8038. });
  8039. }
  8040. }
  8041. getClassicWordsType() {
  8042. let d2world = xGame.common.d2World;
  8043. let type = -1;
  8044. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  8045. type = ClassicWordsType.perfectShow;
  8046. return type;
  8047. }
  8048. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  8049. type = ClassicWordsType.directShoot;
  8050. return type;
  8051. }
  8052. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  8053. type = ClassicWordsType.anotherShoot;
  8054. return type;
  8055. }
  8056. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  8057. type = ClassicWordsType.bigPower;
  8058. return type;
  8059. }
  8060. let minSpeed = 1;
  8061. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  8062. type = ClassicWordsType.hardShoot;
  8063. return type;
  8064. }
  8065. if (this.inHoleBalls.length > 0) {
  8066. type = ClassicWordsType.directShoot;
  8067. return type;
  8068. }
  8069. return type;
  8070. }
  8071. checkBigSkillWords(callback) {
  8072. if (this.curFoul == FoulType.timeOut) {
  8073. callback && callback();
  8074. }
  8075. else {
  8076. let playSkill = false;
  8077. if (this.selfTurn) {
  8078. playSkill = true;
  8079. }
  8080. else {
  8081. if (!this.aiPlayedBreakArmy) {
  8082. this.aiPlayedBreakArmy = true;
  8083. playSkill = true;
  8084. }
  8085. if (this.aiCurSkill != SkillType.breakArmy) {
  8086. playSkill = true;
  8087. }
  8088. }
  8089. if (xGame.common.skillMgr.playedLastSkill) {
  8090. xGame.common.skillMgr.playedLastSkill = false;
  8091. playSkill = false;
  8092. }
  8093. if (playSkill) {
  8094. xGame.common.skillMgr.runBigSkill((extraScore) => {
  8095. let selfExtra = 0;
  8096. let aiExtra = 0;
  8097. if (this.selfTurn)
  8098. selfExtra += extraScore;
  8099. else
  8100. aiExtra += extraScore;
  8101. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  8102. this.isEnd = true;
  8103. }
  8104. this.playBigSkillTimes(callback);
  8105. });
  8106. }
  8107. else {
  8108. this.playBigSkillTimes(callback);
  8109. }
  8110. }
  8111. }
  8112. playBigSkillTimes(callback) {
  8113. let length = this.inHoleBalls.length;
  8114. if (this.inHoleBalls.indexOf(0) > -1) {
  8115. length = this.inHoleBalls.length - 1;
  8116. }
  8117. if (length <= 0) {
  8118. callback && callback();
  8119. return;
  8120. }
  8121. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  8122. callback && callback();
  8123. });
  8124. }
  8125. playSkillTips() {
  8126. let levelNum = 0;
  8127. let curType;
  8128. if (this.selfTurn) {
  8129. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  8130. curType = this.selfCurSkill;
  8131. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8132. levelNum += 5;
  8133. }
  8134. }
  8135. else {
  8136. levelNum = this.aiSkillLevelNum;
  8137. curType = this.aiCurSkill;
  8138. }
  8139. let str = ``;
  8140. switch (curType) {
  8141. case SkillType.highSpace:
  8142. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8143. break;
  8144. case SkillType.breakArmy:
  8145. str = `You pocketed ${levelNum} extra balls`;
  8146. break;
  8147. case SkillType.ice:
  8148. str = `${levelNum * 2} extra balls were frozen`;
  8149. break;
  8150. case SkillType.fireworks:
  8151. str = `${levelNum} extra balls exploded `;
  8152. break;
  8153. case SkillType.GuanYu:
  8154. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8155. break;
  8156. default:
  8157. break;
  8158. }
  8159. xGame.uiMgr.Show(UIMsg, str);
  8160. }
  8161. getFoulType() {
  8162. let foulType = "";
  8163. if (this.firstColliObj == null) {
  8164. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8165. return FoulType.rootHole;
  8166. }
  8167. return FoulType.notTouch;
  8168. }
  8169. else {
  8170. if (this.selfTurn) {
  8171. if (this.selfBallArr.length > 0) {
  8172. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8173. foulType = FoulType.wrongTouch;
  8174. }
  8175. }
  8176. else {
  8177. if (this.ensureBallType) {
  8178. }
  8179. else {
  8180. if (this.firstColliObj == this.blackNum) {
  8181. foulType = FoulType.wrongTouch;
  8182. }
  8183. }
  8184. }
  8185. }
  8186. else {
  8187. if (this.aiBallArr.length > 0) {
  8188. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8189. foulType = FoulType.wrongTouch;
  8190. }
  8191. }
  8192. else {
  8193. if (this.ensureBallType) {
  8194. }
  8195. else {
  8196. if (this.firstColliObj == this.blackNum) {
  8197. foulType = FoulType.wrongTouch;
  8198. }
  8199. }
  8200. }
  8201. }
  8202. if (this.inHoleBalls.length <= 0) {
  8203. return foulType;
  8204. }
  8205. let temp;
  8206. if (this.inHoleBalls.indexOf(0) > -1) {
  8207. foulType = FoulType.rootHole;
  8208. }
  8209. else {
  8210. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8211. temp = this.inHoleBalls[index];
  8212. if (this.selfTurn) {
  8213. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8214. foulType = FoulType.wrongHole;
  8215. break;
  8216. }
  8217. }
  8218. else {
  8219. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8220. foulType = FoulType.wrongHole;
  8221. break;
  8222. }
  8223. }
  8224. }
  8225. }
  8226. let foo;
  8227. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8228. temp = this.inHoleBalls[index];
  8229. foo = this.selfBallArr.indexOf(temp);
  8230. if (foo > -1) {
  8231. this.selfBallArr.splice(foo, 1);
  8232. }
  8233. foo = this.aiBallArr.indexOf(temp);
  8234. if (foo > -1) {
  8235. this.aiBallArr.splice(foo, 1);
  8236. }
  8237. }
  8238. this.updateLeftBall();
  8239. }
  8240. return foulType;
  8241. }
  8242. judgeGameEndByBlack(arr) {
  8243. if (this.selfTurn) {
  8244. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8245. this.selfFoulNum = this.maxFoulTimes;
  8246. return true;
  8247. }
  8248. }
  8249. else {
  8250. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8251. this.aiFoulNum = this.maxFoulTimes;
  8252. return true;
  8253. }
  8254. }
  8255. }
  8256. judgeClassic(type) {
  8257. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8258. xGame.common.aiPlayer.stopRun();
  8259. if (this.judgeNormalSuccess()) {
  8260. this.isEnd = true;
  8261. return;
  8262. }
  8263. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8264. if (this.selfTurn) {
  8265. if (isFoul) {
  8266. this.selfFoulNum++;
  8267. }
  8268. if (this.selfFoulNum >= this.maxFoulTimes) {
  8269. this.success = false;
  8270. this.isEnd = true;
  8271. return;
  8272. }
  8273. }
  8274. else {
  8275. if (isFoul)
  8276. this.aiFoulNum++;
  8277. if (this.aiFoulNum >= this.maxFoulTimes) {
  8278. this.success = true;
  8279. this.isEnd = true;
  8280. return;
  8281. }
  8282. }
  8283. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8284. this.isChangeTurn = false;
  8285. }
  8286. else {
  8287. this.isInterrupt = true;
  8288. }
  8289. }
  8290. waitShoot() {
  8291. if (xGame.common.gameMode == GameMode.classic) {
  8292. switch (this.curFoul) {
  8293. case FoulType.timeOut:
  8294. case FoulType.rootHole:
  8295. this.selfTurn = !this.selfTurn;
  8296. this.peoplePlay(5, 6, true);
  8297. break;
  8298. case FoulType.notTouch:
  8299. this.selfTurn = !this.selfTurn;
  8300. this.peoplePlay(7, 7);
  8301. break;
  8302. case FoulType.wrongHole:
  8303. this.selfTurn = !this.selfTurn;
  8304. this.peoplePlay(11, 11);
  8305. break;
  8306. default:
  8307. if (this.inHoleBalls.length > 0) {
  8308. this.peoplePlay(0, 0, false, false);
  8309. }
  8310. else {
  8311. this.selfTurn = !this.selfTurn;
  8312. this.peoplePlay(7, 7);
  8313. }
  8314. break;
  8315. }
  8316. }
  8317. else if (xGame.common.gameMode == GameMode.bigMove) {
  8318. if (this.curFoul == FoulType.timeOut) {
  8319. this.selfTurn = !this.selfTurn;
  8320. this.peoplePlay(14, 15);
  8321. this.placeRootBall();
  8322. }
  8323. else {
  8324. this.selfTurn = !this.selfTurn;
  8325. if (this.curFoul == FoulType.rootHole) {
  8326. this.peoplePlay(12, 13);
  8327. this.placeRootBall();
  8328. }
  8329. else {
  8330. this.peoplePlay(0, 0, false, false);
  8331. }
  8332. }
  8333. }
  8334. else if (xGame.common.gameMode == GameMode.placeBall) {
  8335. this.finishOneShoot = true;
  8336. }
  8337. this.gameResult();
  8338. }
  8339. gameResult() {
  8340. this.firstColliObj = null;
  8341. this.inHoleBalls = [];
  8342. let curX = xGame.common.d2World.rootBall.gameObj.x;
  8343. let curY = xGame.common.d2World.rootBall.gameObj.y;
  8344. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  8345. if (xGame.common.uiRodMethod)
  8346. xGame.common.uiRodMethod.resetRod();
  8347. xGame.common.d2World.rootBall.showSelf();
  8348. this.clearIceSkill();
  8349. if (this.selfTurn) {
  8350. console.log("zh:处理一杆结束后的逻辑 gameResult");
  8351. PlatMgr.gameInsert();
  8352. }
  8353. xGame.common.d3World.knifeRoot.destroyChildren();
  8354. if (this.selfTurn) {
  8355. xGame.common.gameUI.showHelpLineGuide();
  8356. xGame.common.gameUI.setTurnAlpha(true);
  8357. }
  8358. else {
  8359. xGame.common.gameUI.setTurnAlpha(false);
  8360. }
  8361. }
  8362. getScore(type) {
  8363. let selfAdd = 0;
  8364. let aiAdd = 0;
  8365. if (type == FoulType.timeOut) {
  8366. if (this.selfTurn)
  8367. aiAdd += 3;
  8368. else
  8369. selfAdd += 3;
  8370. }
  8371. else {
  8372. if (this.inHoleBalls.length > 0) {
  8373. if (this.selfTurn) {
  8374. if (type == FoulType.rootHole) {
  8375. aiAdd += 3;
  8376. if (this.inHoleBalls.length - 1 > 0) {
  8377. selfAdd += this.inHoleBalls.length - 1;
  8378. }
  8379. }
  8380. else {
  8381. selfAdd += this.inHoleBalls.length;
  8382. }
  8383. }
  8384. else {
  8385. if (type == FoulType.rootHole) {
  8386. selfAdd += 3;
  8387. if (this.inHoleBalls.length - 1 > 0) {
  8388. aiAdd += this.inHoleBalls.length - 1;
  8389. }
  8390. }
  8391. else {
  8392. aiAdd += this.inHoleBalls.length;
  8393. }
  8394. }
  8395. }
  8396. }
  8397. return [selfAdd, aiAdd];
  8398. }
  8399. judgeScoreEnd(selfAdd, aiAdd) {
  8400. this.selfScore += selfAdd;
  8401. this.aiScore += aiAdd;
  8402. this.updateAIScore();
  8403. this.updateSelfScore();
  8404. if (this.selfScore >= this.targertScore) {
  8405. this.success = true;
  8406. return true;
  8407. }
  8408. if (this.aiScore >= this.targertScore) {
  8409. this.success = false;
  8410. return true;
  8411. }
  8412. let ballArr = xGame.common.d2World.ballArr;
  8413. if (ballArr.length == 1 && ballArr[0].number == 0) {
  8414. if (this.selfScore > this.aiScore) {
  8415. this.success = true;
  8416. return true;
  8417. }
  8418. else if (this.selfScore < this.aiScore) {
  8419. this.success = false;
  8420. return true;
  8421. }
  8422. else {
  8423. if (this.selfTurn) {
  8424. this.success = false;
  8425. }
  8426. else {
  8427. this.success = true;
  8428. }
  8429. return true;
  8430. }
  8431. }
  8432. }
  8433. clearIceSkill() {
  8434. let arr = xGame.common.d2World.ballArr;
  8435. let temp;
  8436. if (this.selfTurn) {
  8437. if (this.selfCurSkill == SkillType.ice) {
  8438. for (let index = 0; index < arr.length; index++) {
  8439. temp = arr[index];
  8440. if (temp.ballFunc == "ice") {
  8441. temp.setBallFunc("normal", "self");
  8442. }
  8443. }
  8444. }
  8445. }
  8446. else {
  8447. if (this.aiCurSkill == SkillType.ice) {
  8448. for (let index = 0; index < arr.length; index++) {
  8449. temp = arr[index];
  8450. if (temp.ballFunc == "ice") {
  8451. temp.setBallFunc("normal", "ai");
  8452. }
  8453. }
  8454. }
  8455. }
  8456. }
  8457. judgeNormalSuccess() {
  8458. if (this.selfTurn) {
  8459. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8460. this.success = true;
  8461. return true;
  8462. }
  8463. }
  8464. else {
  8465. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8466. this.success = false;
  8467. return true;
  8468. }
  8469. }
  8470. }
  8471. gameEnd() {
  8472. if (Moyu.isTT) {
  8473. xGame.common.screenImg = getScreenImg();
  8474. }
  8475. console.log("游戏结束", this.success);
  8476. xGame.common.aiPlayer.stopRun();
  8477. if (xGame.common.gameMode == GameMode.placeBall) {
  8478. this.getEndStarNum();
  8479. this.updatePlaceBallState();
  8480. }
  8481. this.isEnter = false;
  8482. Moyu.recordEnd(this, () => {
  8483. if (this.isEnter)
  8484. return;
  8485. this.isEnter = true;
  8486. console.log("进入录结束回调");
  8487. this.enterNext();
  8488. });
  8489. Laya.timer.once(1000, this, () => {
  8490. if (this.isEnter)
  8491. return;
  8492. this.isEnter = true;
  8493. this.enterNext();
  8494. });
  8495. xGame.common.longHelpLine = false;
  8496. }
  8497. enterNext() {
  8498. Laya.timer.clearAll(this);
  8499. if (Moyu.canShare() > 100 || Moyu.isKs) {
  8500. xGame.uiMgr.Show(UIVideoShare, this.success);
  8501. }
  8502. else {
  8503. xGame.uiMgr.Show(UIGameEnd, this.success);
  8504. }
  8505. }
  8506. aiLeave() {
  8507. let ui = xGame.common.gameUI.ui;
  8508. ui.topNode.aiNameTxt.text = "offline";
  8509. }
  8510. aiGameEnd(suc) {
  8511. this.success = suc;
  8512. xGame.common.aiPlayer.stopRun();
  8513. if (this.success) {
  8514. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  8515. Laya.timer.once(1000, this, () => {
  8516. this.clearTime();
  8517. this.gameEnd();
  8518. });
  8519. }
  8520. }
  8521. openTimer() {
  8522. let src = xGame.common.gameUI;
  8523. if (this.selfTurn) {
  8524. src.ui.topNode.selfProgress.visible = true;
  8525. src.ui.topNode.aiProgress.visible = false;
  8526. this.curTimer = src.ui.topNode.selfProgress;
  8527. }
  8528. else {
  8529. src.ui.topNode.selfProgress.visible = false;
  8530. src.ui.topNode.aiProgress.visible = true;
  8531. this.curTimer = src.ui.topNode.aiProgress;
  8532. }
  8533. this.accTime = 0;
  8534. Laya.timer.clearAll(this);
  8535. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  8536. this.curTimer.value = 100;
  8537. }
  8538. updateTime(dt) {
  8539. if (this.gamePause)
  8540. return;
  8541. this.accTime += dt;
  8542. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8543. if (this.accTime >= this.setTime) {
  8544. this.clearTime();
  8545. console.log("时钟进入了gameRun");
  8546. this.gameRun(FoulType.timeOut);
  8547. }
  8548. }
  8549. clearTime() {
  8550. let src = xGame.common.gameUI;
  8551. src.ui.topNode.selfProgress.visible = false;
  8552. src.ui.topNode.aiProgress.visible = false;
  8553. Laya.timer.clearAll(this);
  8554. }
  8555. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8556. let ui = xGame.common.gameUI.ui;
  8557. let selfMsg, aiMsg;
  8558. if (sayWords) {
  8559. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8560. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8561. if (Foul) {
  8562. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8563. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8564. this.placeRootBall();
  8565. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8566. if (this.curFoul == FoulType.rootHole) {
  8567. if (!DataMgr.getRootBallFoul()) {
  8568. DataMgr.setRootBallFoul();
  8569. aiMsg = "";
  8570. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8571. let woman = "Boss, pay attention next time~";
  8572. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8573. }
  8574. }
  8575. else if (this.curFoul == FoulType.timeOut) {
  8576. if (!DataMgr.getTimeoutFoul()) {
  8577. DataMgr.setTimeoutFoul();
  8578. aiMsg = "";
  8579. let tips = "Game timeout, 3 fouls, this game failed.";
  8580. let woman = "Boss, pay attention to the timeline~";
  8581. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8582. }
  8583. }
  8584. }
  8585. }
  8586. }
  8587. if (this.selfTurn) {
  8588. if (sayWords) {
  8589. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8590. ui.selfTurn.visible = true;
  8591. ui.aiTurn.visible = false;
  8592. ui.selfTurn.t0.play();
  8593. Moyu.vibration();
  8594. });
  8595. }
  8596. }
  8597. else {
  8598. let aiNum = xGame.tools.random(1, 11);
  8599. let challengeNum = DataMgr.getChallengeTimes();
  8600. let delay = false;
  8601. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8602. aiNum = 9;
  8603. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8604. aiNum = 3;
  8605. if (challengeNum == 3) {
  8606. if (!this.showLongView) {
  8607. this.showLongView = true;
  8608. delay = true;
  8609. }
  8610. }
  8611. }
  8612. }
  8613. if (delay) {
  8614. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8615. if (success) {
  8616. xGame.common.longHelpLine = true;
  8617. xGame.common.d2World.getHelpLine();
  8618. }
  8619. else {
  8620. aiNum = 10;
  8621. }
  8622. xGame.common.aiPlayer.setAiLevel(aiNum);
  8623. if (sayWords) {
  8624. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8625. xGame.common.aiPlayer.runAI();
  8626. ui.selfTurn.visible = false;
  8627. ui.aiTurn.visible = true;
  8628. ui.aiTurn.t0.play();
  8629. });
  8630. }
  8631. else {
  8632. xGame.common.aiPlayer.runAI();
  8633. }
  8634. this.openTimer();
  8635. this.finishOneShoot = true;
  8636. if (this.selfTurn) {
  8637. ui.topNode.selfKuang.visible = true;
  8638. ui.topNode.aiKuang.visible = false;
  8639. ui.topNode.selfTips.visible = true;
  8640. ui.topNode.aiTips.visible = false;
  8641. }
  8642. else {
  8643. ui.topNode.selfKuang.visible = false;
  8644. ui.topNode.aiKuang.visible = true;
  8645. ui.topNode.selfTips.visible = false;
  8646. ui.topNode.aiTips.visible = true;
  8647. }
  8648. });
  8649. return;
  8650. }
  8651. if (xGame.common.gameMode == GameMode.classic) {
  8652. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8653. if (cfg) {
  8654. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8655. aiNum = aiLevel;
  8656. }
  8657. }
  8658. xGame.common.aiPlayer.setAiLevel(aiNum);
  8659. if (sayWords) {
  8660. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8661. xGame.common.aiPlayer.runAI();
  8662. ui.selfTurn.visible = false;
  8663. ui.aiTurn.visible = true;
  8664. ui.aiTurn.t0.play();
  8665. });
  8666. }
  8667. else {
  8668. xGame.common.aiPlayer.runAI();
  8669. }
  8670. }
  8671. this.openTimer();
  8672. this.finishOneShoot = true;
  8673. if (this.selfTurn) {
  8674. ui.topNode.selfKuang.visible = true;
  8675. ui.topNode.aiKuang.visible = false;
  8676. ui.topNode.selfTips.visible = true;
  8677. ui.topNode.aiTips.visible = false;
  8678. }
  8679. else {
  8680. ui.topNode.selfKuang.visible = false;
  8681. ui.topNode.aiKuang.visible = true;
  8682. ui.topNode.selfTips.visible = false;
  8683. ui.topNode.aiTips.visible = true;
  8684. }
  8685. }
  8686. placeRootBall() {
  8687. let rootBall = xGame.common.d2World.rootBall;
  8688. if (!rootBall)
  8689. return;
  8690. rootBall.gameObj.x = this.lastRootBallPos.x;
  8691. rootBall.gameObj.y = this.lastRootBallPos.y;
  8692. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8693. let moveNode = xGame.common.gameUI.ui.moveNode;
  8694. moveNode.visible = true;
  8695. moveNode.x = this.lastRootBallPos.x;
  8696. moveNode.y = this.lastRootBallPos.y;
  8697. if (!this.selfTurn) {
  8698. xGame.common.aiPlayer.resetRoot();
  8699. }
  8700. }
  8701. }
  8702. class ui_guanyuAni extends fgui.GComponent {
  8703. static createInstance() {
  8704. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8705. }
  8706. onConstruct() {
  8707. this.n0 = (this.getChild("n0"));
  8708. }
  8709. }
  8710. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8711. class UIFireworks extends UIBase {
  8712. constructor() {
  8713. super();
  8714. }
  8715. onConstructor() {
  8716. this.isEject = false;
  8717. }
  8718. show(callback) {
  8719. super.show();
  8720. }
  8721. }
  8722. UIFireworks.uiName = "UIFireworks";
  8723. class ui_UIGuanYu extends fgui.GComponent {
  8724. static createInstance() {
  8725. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8726. }
  8727. onConstruct() {
  8728. this.n2 = (this.getChild("n2"));
  8729. this.n1 = (this.getChild("n1"));
  8730. this.n3 = (this.getChild("n3"));
  8731. this.n4 = (this.getChild("n4"));
  8732. this.n5 = (this.getChild("n5"));
  8733. this.n6 = (this.getChild("n6"));
  8734. this.n8 = (this.getChild("n8"));
  8735. this.n7 = (this.getChild("n7"));
  8736. this.t0 = this.getTransition("t0");
  8737. }
  8738. }
  8739. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8740. class UIGuanYu extends UIBase {
  8741. constructor() {
  8742. super();
  8743. }
  8744. onConstructor() {
  8745. this.ui = ui_UIGuanYu.createInstance();
  8746. this.contentPane = this.ui;
  8747. this.isEject = false;
  8748. }
  8749. show(callback) {
  8750. super.show();
  8751. this.ui.t0.play(Laya.Handler.create(this, () => {
  8752. callback && callback();
  8753. this.hide();
  8754. }));
  8755. }
  8756. }
  8757. UIGuanYu.uiName = "UIGuanYu";
  8758. class SkillMgr {
  8759. constructor() {
  8760. this.leveNum = 0;
  8761. this.extraScore = 0;
  8762. this.selfTurn = false;
  8763. this.playedLastSkill = false;
  8764. this.tweenArr = [];
  8765. this._finishNum = 0;
  8766. this._curFinish = 0;
  8767. this._rootX = 0;
  8768. this._rootY = 0;
  8769. this.knifeTimes = 0;
  8770. this.knifeV2 = new Laya.Vector2();
  8771. this.knifeV3 = new Laya.Vector3();
  8772. this.rtStarX = 0;
  8773. this.rtStarY = 0;
  8774. this.addBigSkillSpine();
  8775. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8776. }
  8777. addBigSkillSpine() {
  8778. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8779. console.log("extra2 success");
  8780. });
  8781. }
  8782. runBigSkill(callback) {
  8783. this.tweenArr = [];
  8784. this.callback = callback;
  8785. this.judgeSkill();
  8786. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8787. let guide = DataMgr.getSkillGuide();
  8788. if (!xGame.common.gameMgr.selfTurn) {
  8789. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8790. }
  8791. else {
  8792. if (xGame.common.temSelfLevel != 0) {
  8793. this.leveNum = xGame.common.temSelfLevel;
  8794. }
  8795. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8796. this.leveNum += 5;
  8797. }
  8798. }
  8799. if (guide == 0) {
  8800. DataMgr.setSkillGuide(1);
  8801. if (DataMgr.getNewUser()) {
  8802. Moyu.sendDataEvent("gameFirstPlay");
  8803. DataMgr.setNewUser();
  8804. }
  8805. }
  8806. this.playSpineAni(() => {
  8807. switch (this.curSkill) {
  8808. case SkillType.highSpace:
  8809. this.runHighSpace();
  8810. break;
  8811. case SkillType.breakArmy:
  8812. this.runBreakArmy();
  8813. break;
  8814. case SkillType.ice:
  8815. this.runIce();
  8816. break;
  8817. case SkillType.fireworks:
  8818. this.runFireworks();
  8819. break;
  8820. case SkillType.GuanYu:
  8821. this.runGuanYu();
  8822. break;
  8823. default:
  8824. break;
  8825. }
  8826. });
  8827. }
  8828. judgeSkill() {
  8829. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8830. let gameMgr = xGame.common.gameMgr;
  8831. let type;
  8832. for (let index = 0; index < typeArr.length; index++) {
  8833. type = typeArr[index];
  8834. if (gameMgr.selfTurn) {
  8835. if (gameMgr.selfCurSkill == type) {
  8836. this.selfTurn = true;
  8837. this.curSkill = type;
  8838. return;
  8839. }
  8840. }
  8841. else {
  8842. if (gameMgr.aiCurSkill == type) {
  8843. this.selfTurn = false;
  8844. this.curSkill = type;
  8845. return;
  8846. }
  8847. }
  8848. }
  8849. }
  8850. playSpineAni(callback) {
  8851. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8852. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8853. parent.destroyChildren();
  8854. let aniIndex = 0;
  8855. let skillSpine;
  8856. switch (this.curSkill) {
  8857. case SkillType.highSpace:
  8858. aniIndex = 1;
  8859. xGame.soundMgr.playSound("skill01");
  8860. skillSpine = this.skillSpine2;
  8861. data.scaleX = 0.5;
  8862. data.scaleY = 0.5;
  8863. skillSpine.play(data, 1, false, parent, () => {
  8864. callback && callback();
  8865. });
  8866. break;
  8867. case SkillType.breakArmy:
  8868. aniIndex = 2;
  8869. xGame.soundMgr.playSound("skill02");
  8870. skillSpine = this.skillSpine2;
  8871. data.scaleX = 0.5;
  8872. data.scaleY = 0.5;
  8873. skillSpine.play(data, 2, false, parent, () => {
  8874. callback && callback();
  8875. });
  8876. break;
  8877. case SkillType.ice:
  8878. aniIndex = 0;
  8879. xGame.soundMgr.playSound("skill03");
  8880. skillSpine = this.skillSpine2;
  8881. data.scaleX = 0.5;
  8882. data.scaleY = 0.5;
  8883. skillSpine.play(data, 0, false, parent, () => {
  8884. callback && callback();
  8885. });
  8886. break;
  8887. case SkillType.fireworks:
  8888. xGame.soundMgr.playSound("skill_04_01");
  8889. xGame.soundMgr.playSound("skill04");
  8890. xGame.uiMgr.Show(UIFireworks, callback);
  8891. break;
  8892. case SkillType.GuanYu:
  8893. xGame.soundMgr.playSound("skill05_1");
  8894. xGame.soundMgr.playSound("skill05");
  8895. xGame.uiMgr.Show(UIGuanYu, callback);
  8896. break;
  8897. default:
  8898. break;
  8899. }
  8900. }
  8901. getAllBallArr() {
  8902. let arr = xGame.common.d2World.ballArr;
  8903. let outArr = [];
  8904. for (let index = 0; index < arr.length; index++) {
  8905. if (arr[index] instanceof D2RootBallSrc)
  8906. continue;
  8907. if (arr[index].ballFunc == "ice")
  8908. continue;
  8909. if (arr[index].destroyed)
  8910. continue;
  8911. outArr.push(arr[index]);
  8912. }
  8913. return outArr;
  8914. }
  8915. getOneArr(deletObj) {
  8916. let allArr = this.getAllBallArr();
  8917. let temp;
  8918. for (let index = 0; index < allArr.length; index++) {
  8919. temp = allArr[index];
  8920. if (temp.id == deletObj.id) {
  8921. allArr.splice(index, 1);
  8922. break;
  8923. }
  8924. }
  8925. return allArr;
  8926. }
  8927. getNearBallBag(ball) {
  8928. let ui = xGame.common.gameUI.ui;
  8929. let circleArr = [];
  8930. for (let index = 1; index <= 6; index++) {
  8931. circleArr.push(ui.border["circle" + index]);
  8932. }
  8933. let outIndex = 0;
  8934. let temp;
  8935. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8936. ;
  8937. let dis = 0;
  8938. for (let index = 1; index < circleArr.length; index++) {
  8939. temp = circleArr[index];
  8940. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8941. if (dis < min) {
  8942. min = dis;
  8943. outIndex = index;
  8944. }
  8945. }
  8946. return [circleArr[outIndex], outIndex];
  8947. }
  8948. ballFlyToBag(ballArr, time = 300) {
  8949. let temp;
  8950. let hole;
  8951. this._finishNum = ballArr.length;
  8952. this._curFinish = 0;
  8953. let holeObj = {};
  8954. let holeCfg = {
  8955. "1": 0,
  8956. "2": 0,
  8957. "3": 0,
  8958. "4": 0,
  8959. "5": 0,
  8960. "6": 0
  8961. };
  8962. for (let index = 0; index < ballArr.length; index++) {
  8963. temp = ballArr[index];
  8964. temp.outColli.isSensor = true;
  8965. temp.innerColli.isSensor = true;
  8966. temp.isRunSkillAni = true;
  8967. let holeArr = this.getNearBallBag(temp);
  8968. hole = holeArr[0];
  8969. holeObj[index] = holeArr[1];
  8970. temp.d3BallSrc.scaleXYZ = 0.5;
  8971. this.tweenArr.push(temp.d3BallSrc, temp);
  8972. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8973. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8974. }));
  8975. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8976. let mIndex = holeObj[this._curFinish];
  8977. let isDone = holeCfg[mIndex];
  8978. if (isDone) {
  8979. ballArr[this._curFinish].checkWrongBall(false);
  8980. }
  8981. else {
  8982. holeCfg[mIndex] = 1;
  8983. ballArr[this._curFinish].checkWrongBall();
  8984. }
  8985. this._curFinish++;
  8986. if (this._curFinish >= this._finishNum) {
  8987. if (this.curSkill == SkillType.highSpace) {
  8988. }
  8989. else if (this.curSkill == SkillType.breakArmy) {
  8990. let rootBall = xGame.common.d2World.rootBall;
  8991. rootBall.gameObj.x = this._rootX;
  8992. rootBall.gameObj.y = this._rootY;
  8993. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8994. xGame.common.d2World.d2Gan.ui.visible = true;
  8995. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8996. xGame.common.d2World.getHelpLine();
  8997. this.callback && this.callback(this.extraScore);
  8998. }
  8999. }
  9000. }));
  9001. }
  9002. }
  9003. runHighSpace() {
  9004. let rootBall = xGame.common.d2World.rootBall;
  9005. rootBall.showSelf();
  9006. let d3Src = rootBall.d3BallSrc;
  9007. let allArr = this.getAllBallArr();
  9008. if (allArr.length <= 0) {
  9009. this.callback && this.callback(0);
  9010. return;
  9011. }
  9012. let selectBall = xGame.common.d2World.targetBall;
  9013. let wrong = selectBall && selectBall.destroyed;
  9014. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  9015. selectBall = xGame.common.getRandArrEle(allArr);
  9016. }
  9017. let targetD3Src = selectBall.d3BallSrc;
  9018. xGame.common.d2World.d2Gan.ui.visible = false;
  9019. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9020. d3Src.scaleXYZ = 0.5;
  9021. this.tweenArr.push(d3Src);
  9022. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9023. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9024. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  9025. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  9026. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  9027. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  9028. let outArr = [selectBall];
  9029. let other = this.leveNum - 1;
  9030. if (other > 0) {
  9031. let nearArr = this.getOneArr(selectBall);
  9032. if (nearArr.length > 0) {
  9033. xGame.common.botherArr(nearArr);
  9034. if (other >= nearArr.length)
  9035. other = nearArr.length;
  9036. for (let index = 0; index < other; index++) {
  9037. outArr.push(nearArr[index]);
  9038. }
  9039. }
  9040. }
  9041. xGame.common.extraMoveNum = other + 1;
  9042. this.extraScore = other + 1;
  9043. this._rootX = selectBall.gameObj.x;
  9044. this._rootY = selectBall.gameObj.y;
  9045. rootBall.gameObj.x = this._rootX;
  9046. rootBall.gameObj.y = this._rootY;
  9047. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9048. Laya.Tween.clearAll(d3Src);
  9049. this.addRandomForce(outArr);
  9050. }));
  9051. }));
  9052. }
  9053. addRandomForce(outArr) {
  9054. if (outArr.length > 0) {
  9055. xGame.common.d2World.openCheckStill = true;
  9056. this.playedLastSkill = true;
  9057. }
  9058. let temp;
  9059. for (let index = 0; index < outArr.length; index++) {
  9060. let angle = xGame.common.randomNum(0, 360);
  9061. let linearPercent = xGame.common.randomNum(65, 100);
  9062. temp = outArr[index];
  9063. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  9064. }
  9065. }
  9066. setLinearSpeed(angle, rigy, linearPercent) {
  9067. let sin = Math.sin(angle * Math.PI / 180);
  9068. let cos = Math.cos(angle * Math.PI / 180);
  9069. let maxSpeed = 4;
  9070. let speed = new Laya.Vector2();
  9071. speed.x = maxSpeed * linearPercent * sin;
  9072. speed.y = -maxSpeed * linearPercent * cos;
  9073. rigy.applyLinearImpulseToCenter(speed);
  9074. }
  9075. runBreakArmy() {
  9076. xGame.common.d2World.d2Gan.ui.visible = false;
  9077. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9078. let gameUI = xGame.common.gameUI.ui;
  9079. gameUI.skillRod.visible = true;
  9080. gameUI.skillRod.rotation = 110;
  9081. let outArr = this.getAllBallArr();
  9082. if (outArr.length <= 0) {
  9083. gameUI.skillRod.visible = false;
  9084. this.callback && this.callback(0);
  9085. return;
  9086. }
  9087. xGame.common.botherArr(outArr);
  9088. if (this.leveNum >= outArr.length)
  9089. this.leveNum = outArr.length;
  9090. let deleteNum = outArr.length - this.leveNum;
  9091. outArr.splice(0, deleteNum);
  9092. this.extraScore = this.leveNum;
  9093. let potX = gameUI.skillRod.x;
  9094. let potY = gameUI.skillRod.y;
  9095. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  9096. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  9097. let disArr = [];
  9098. for (let index = 0; index < outArr.length; index++) {
  9099. let obj = outArr[index];
  9100. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  9101. dis = Math.pow(dis, 0.5);
  9102. disArr.push(dis);
  9103. }
  9104. this.tweenArr.push(gameUI.skillRod);
  9105. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9106. })).update = Laya.Handler.create(this, (e, t, c) => {
  9107. let angle = gameUI.skillRod.rotation;
  9108. let xx;
  9109. let yy;
  9110. let temp;
  9111. for (let index = 0; index < outArr.length; index++) {
  9112. temp = outArr[index];
  9113. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  9114. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  9115. yy -= 20;
  9116. temp.gameObj.x = xx;
  9117. temp.gameObj.y = yy;
  9118. temp.d3BallSrc.setTransPos(xx, yy);
  9119. }
  9120. if (angle <= 60) {
  9121. Laya.Tween.clearAll(gameUI.skillRod);
  9122. this.ballFlyToBag(outArr, 150);
  9123. gameUI.skillRod.visible = false;
  9124. }
  9125. }, null, false);
  9126. }
  9127. runIce() {
  9128. let ballArr = xGame.common.d2World.ballArr;
  9129. this.leveNum *= 2;
  9130. if (this.leveNum >= ballArr.length - 1)
  9131. this.leveNum = ballArr.length - 1;
  9132. let tempArr = [];
  9133. let outArr = [];
  9134. for (let index = 0; index < ballArr.length; index++) {
  9135. if (ballArr[index] instanceof D2RootBallSrc)
  9136. continue;
  9137. tempArr.push(ballArr[index]);
  9138. }
  9139. if (tempArr.length <= 0) {
  9140. this.callback && this.callback(0);
  9141. return;
  9142. }
  9143. xGame.common.botherArr(tempArr);
  9144. for (let index = 0; index < this.leveNum; index++) {
  9145. outArr.push(tempArr[index]);
  9146. }
  9147. this.extraScore = this.leveNum;
  9148. let temp;
  9149. for (let index = 0; index < outArr.length; index++) {
  9150. temp = outArr[index];
  9151. temp.d3BallSrc.playIceEft();
  9152. }
  9153. Laya.timer.once(2000, this, () => {
  9154. for (let index = 0; index < outArr.length; index++) {
  9155. temp = outArr[index];
  9156. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9157. temp.setBallFunc("ice", str);
  9158. }
  9159. this.callback && this.callback(0);
  9160. });
  9161. }
  9162. runFireworks() {
  9163. let allArr = this.getAllBallArr();
  9164. if (allArr.length <= 0) {
  9165. this.callback && this.callback(0);
  9166. return;
  9167. }
  9168. xGame.common.d2World.d2Gan.ui.visible = false;
  9169. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9170. let outArr = [];
  9171. let other = this.leveNum;
  9172. if (other > 0) {
  9173. if (allArr.length > 0) {
  9174. xGame.common.botherArr(allArr);
  9175. if (other >= allArr.length)
  9176. other = allArr.length;
  9177. for (let index = 0; index < other; index++) {
  9178. outArr.push(allArr[index]);
  9179. }
  9180. }
  9181. }
  9182. xGame.common.extraMoveNum = other;
  9183. this.extraScore = other;
  9184. this.addRandmomFireworks(outArr);
  9185. }
  9186. addRandmomFireworks(outArr) {
  9187. Laya.timer.once(1100, this, () => {
  9188. if (outArr.length > 0) {
  9189. xGame.common.d2World.openCheckStill = true;
  9190. this.playedLastSkill = true;
  9191. }
  9192. });
  9193. xGame.soundMgr.playSound("skill_04_02");
  9194. let temp;
  9195. let delay = -200;
  9196. for (let index = 0; index < outArr.length; index++) {
  9197. temp = outArr[index];
  9198. delay += 200;
  9199. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9200. let angle = xGame.common.randomNum(0, 360);
  9201. angle = this.getFireworksAngle(obj);
  9202. let linearPercent = xGame.common.randomNum(45, 80);
  9203. if (!obj.destroyed)
  9204. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9205. });
  9206. }
  9207. }
  9208. getFireworksAngle(obj) {
  9209. let rootBall = xGame.common.d2World.rootBall;
  9210. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9211. }
  9212. resetGame() {
  9213. Laya.timer.clearAll(this);
  9214. if (this.tweenArr) {
  9215. for (let index = 0; index < this.tweenArr.length; index++) {
  9216. Laya.Tween.clearAll(this.tweenArr[index]);
  9217. }
  9218. }
  9219. this.tweenArr = null;
  9220. }
  9221. runGuanYu() {
  9222. xGame.common.d2World.d2Gan.ui.visible = false;
  9223. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9224. let rootBall = xGame.common.d2World.rootBall;
  9225. if (rootBall.isInHole) {
  9226. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9227. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9228. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9229. rootBall.showSelf();
  9230. }
  9231. this.rtStarX = rootBall.gameObj.x;
  9232. this.rtStarY = rootBall.gameObj.y;
  9233. this.knifeTimes = 0;
  9234. this.playedLastSkill = true;
  9235. rootBall.forceRun = true;
  9236. rootBall.rigy.type = "static";
  9237. xGame.common.d2World.openCheckStill = true;
  9238. this.guanyuRandomKnife();
  9239. }
  9240. guanyuRandomKnife() {
  9241. let rootBall = xGame.common.d2World.rootBall;
  9242. let dir = this.getRandDir();
  9243. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9244. console.log("当前angle", angle);
  9245. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9246. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9247. let dis = 324;
  9248. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9249. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9250. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9251. this.rtStarX = rootBall.gameObj.x;
  9252. this.rtStarY = rootBall.gameObj.y;
  9253. this.knifeTimes++;
  9254. let skillLevel;
  9255. if (xGame.common.gameMgr.selfTurn) {
  9256. skillLevel = DataMgr.getBigSkillByIndex(4);
  9257. }
  9258. else {
  9259. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9260. }
  9261. if (!skillLevel)
  9262. skillLevel = 1;
  9263. skillLevel += 2;
  9264. if (this.knifeTimes < skillLevel) {
  9265. Laya.timer.once(400, this, () => {
  9266. this.guanyuRandomKnife();
  9267. });
  9268. }
  9269. else {
  9270. rootBall.forceRun = false;
  9271. rootBall.rigy.type = "dynamic";
  9272. xGame.common.extraMoveNum = skillLevel;
  9273. }
  9274. }));
  9275. }
  9276. getRandDir() {
  9277. let rootBall = xGame.common.d2World.rootBall;
  9278. let allBall = this.getAllBallArr();
  9279. let target = xGame.common.getRandArrEle(allBall);
  9280. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9281. return this.knifeV2;
  9282. }
  9283. cloneKnife(x, y, rotation) {
  9284. let parent = xGame.common.d3World.knifeRoot;
  9285. let prefab = xGame.common.d3World.knife;
  9286. let clone = prefab.clone();
  9287. parent.addChild(clone);
  9288. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9289. clone.transform.localPositionX = this.knifeV3.x;
  9290. clone.transform.localPositionY = 0;
  9291. clone.transform.localPositionZ = this.knifeV3.z;
  9292. clone.transform.localRotationEulerX = 0;
  9293. clone.transform.localRotationEulerY = rotation;
  9294. clone.transform.localRotationEulerZ = 0;
  9295. clone.active = true;
  9296. return clone;
  9297. }
  9298. cloneGuanYuEft(x, y, angle) {
  9299. return;
  9300. let parent = xGame.common.gameUI.ui.guanyuNode;
  9301. let eft = new ui_guanyuAni();
  9302. eft.parent = parent;
  9303. eft.x = x;
  9304. eft.y = y;
  9305. eft.rotation = angle;
  9306. }
  9307. }
  9308. class ui_UIWordsList extends fgui.GComponent {
  9309. static createInstance() {
  9310. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9311. }
  9312. onConstruct() {
  9313. this.c1 = this.getController("c1");
  9314. this.n74 = (this.getChild("n74"));
  9315. this.clickNode = (this.getChild("clickNode"));
  9316. this.myNode = (this.getChild("myNode"));
  9317. this.n68 = (this.getChild("n68"));
  9318. this.n66 = (this.getChild("n66"));
  9319. this.n55 = (this.getChild("n55"));
  9320. this.wordsBtn = (this.getChild("wordsBtn"));
  9321. this.emotionBtn = (this.getChild("emotionBtn"));
  9322. this.mybggg = (this.getChild("mybggg"));
  9323. this.wordsList = (this.getChild("wordsList"));
  9324. this.emotionList = (this.getChild("emotionList"));
  9325. this.myRoot = (this.getChild("myRoot"));
  9326. }
  9327. }
  9328. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  9329. class EmotionDisplay {
  9330. constructor(index, ui) {
  9331. this.ui = ui;
  9332. this.index = index;
  9333. this.ui.onClick(this, this.clickSelf);
  9334. this.updateSelf();
  9335. }
  9336. updateSelf() {
  9337. let data = cfgTable.emotionData[this.index + 1];
  9338. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  9339. }
  9340. clickSelf() {
  9341. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9342. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  9343. xGame.common.talkMgr.closeTalkView();
  9344. }
  9345. }
  9346. class WordsDisplay {
  9347. constructor(index, ui) {
  9348. this.ui = ui;
  9349. this.index = index;
  9350. this.ui.onClick(this, this.clickSelf);
  9351. this.updateSelf();
  9352. }
  9353. updateSelf() {
  9354. let data = cfgTable.talkwordsData[this.index + 1];
  9355. this.ui.txt.text = data.msg;
  9356. }
  9357. clickSelf() {
  9358. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9359. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  9360. xGame.common.talkMgr.closeTalkView();
  9361. }
  9362. }
  9363. class UIWordsList extends UIBase {
  9364. constructor() {
  9365. super();
  9366. }
  9367. onConstructor() {
  9368. this.ui = ui_UIWordsList.createInstance();
  9369. this.contentPane = this.ui;
  9370. this.isEject = false;
  9371. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  9372. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  9373. this.addUIClick(this.ui.clickNode, this.hide);
  9374. this.initTalkList();
  9375. this.initEmotionList();
  9376. }
  9377. show() {
  9378. super.show();
  9379. }
  9380. initTalkList() {
  9381. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  9382. let data = cfgTable.talkwordsData;
  9383. let length = Object.keys(data).length;
  9384. this.ui.wordsList.numItems = length;
  9385. }
  9386. initEmotionList() {
  9387. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  9388. let data = cfgTable.emotionData;
  9389. let length = Object.keys(data).length;
  9390. this.ui.emotionList.numItems = length;
  9391. }
  9392. renderTalkItem(index, obj) {
  9393. let temp = new WordsDisplay(index, obj);
  9394. }
  9395. renderEmotionItem(index, obj) {
  9396. let temp = new EmotionDisplay(index, obj);
  9397. }
  9398. openTalkList() {
  9399. this.ui.c1.selectedIndex = 0;
  9400. }
  9401. openEmotionList() {
  9402. this.ui.c1.selectedIndex = 1;
  9403. }
  9404. }
  9405. UIWordsList.uiName = "UIWordsList";
  9406. class TalkMgr {
  9407. constructor() {
  9408. this.aiSpeak = true;
  9409. this.emotionList = [];
  9410. this.talkList = [];
  9411. this.addEvent();
  9412. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9413. this.emotionList = [];
  9414. this.talkList = [];
  9415. for (let k in cfgTable.emotionData) {
  9416. this.emotionList.push(cfgTable.emotionData[k].id);
  9417. }
  9418. for (let k in cfgTable.talkwordsData) {
  9419. this.talkList.push(cfgTable.talkwordsData[k].id);
  9420. }
  9421. }
  9422. addEvent() {
  9423. let ui = xGame.common.gameUI.ui;
  9424. ui.wordsBtn.visible = true;
  9425. ui.wordsBtn.onClick(this, this.openTalkView);
  9426. ui.aiWordsBtn.visible = true;
  9427. ui.aiWordsBtn.onClick(this, this.clickAIState);
  9428. }
  9429. openTalkView() {
  9430. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9431. xGame.uiMgr.Show(UIWordsList);
  9432. }
  9433. closeTalkView() {
  9434. xGame.uiMgr.Hide(UIWordsList);
  9435. }
  9436. clickAIState() {
  9437. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9438. this.aiSpeak = !this.aiSpeak;
  9439. this.changeAIState(this.aiSpeak);
  9440. }
  9441. changeAIState(speak) {
  9442. this.aiSpeak = speak;
  9443. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  9444. if (speak) {
  9445. btn.c1.selectedIndex = 0;
  9446. }
  9447. else {
  9448. btn.c1.selectedIndex = 1;
  9449. }
  9450. }
  9451. showSelfTalk(wordsId) {
  9452. let ui = xGame.common.gameUI.ui;
  9453. ui.selfTalk.visible = true;
  9454. ui.selfTalk.myNode.c1.selectedIndex = 1;
  9455. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9456. ui.selfTalk.t0.play();
  9457. }
  9458. showSelfEmotion(emotionId) {
  9459. let ui = xGame.common.gameUI.ui;
  9460. ui.selfTalk.visible = true;
  9461. ui.selfTalk.myNode.c1.selectedIndex = 0;
  9462. this.selfSpine && this.selfSpine.dispose();
  9463. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9464. let spineData = cfgTable.emotionData[emotionId].spine;
  9465. this.selfSpine = new SpineMgr(spineData, () => {
  9466. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  9467. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  9468. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9469. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  9470. });
  9471. ui.selfTalk.t0.play();
  9472. }
  9473. showAITalk(wordsId) {
  9474. if (!this.aiSpeak)
  9475. return;
  9476. if (DataMgr.gameData.gameCount < 2)
  9477. return;
  9478. if (wordsId < 1)
  9479. wordsId = this.getRandTalk();
  9480. let ui = xGame.common.gameUI.ui;
  9481. ui.aiTalk.visible = true;
  9482. ui.aiTalk.myNode.c1.selectedIndex = 1;
  9483. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9484. ui.aiTalk.t0.play();
  9485. }
  9486. getRandTalk() {
  9487. let rand = xGame.tools.random(0, this.talkList.length);
  9488. return this.emotionList[rand];
  9489. }
  9490. getRandEmotion() {
  9491. let rand = xGame.tools.random(0, this.emotionList.length);
  9492. return this.emotionList[rand];
  9493. }
  9494. showAIEmotion(emotionId) {
  9495. if (!this.aiSpeak)
  9496. return;
  9497. if (DataMgr.gameData.gameCount < 2)
  9498. return;
  9499. if (emotionId < 1)
  9500. emotionId = this.getRandEmotion();
  9501. let ui = xGame.common.gameUI.ui;
  9502. ui.aiTalk.visible = true;
  9503. ui.aiTalk.myNode.c1.selectedIndex = 0;
  9504. this.aiSpine && this.aiSpine.dispose();
  9505. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9506. let spineData = cfgTable.emotionData[emotionId].spine;
  9507. this.aiSpine = new SpineMgr(spineData, () => {
  9508. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  9509. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  9510. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9511. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  9512. });
  9513. ui.aiTalk.t0.play();
  9514. }
  9515. resetGame() {
  9516. let ui = xGame.common.gameUI.ui;
  9517. ui.aiTalk.visible = false;
  9518. ui.selfTalk.visible = false;
  9519. this.aiSpine && this.aiSpine.dispose();
  9520. this.selfSpine && this.selfSpine.dispose();
  9521. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9522. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9523. this.closeTalkView();
  9524. }
  9525. }
  9526. class WordsMgr {
  9527. constructor() {
  9528. this.comboTimes = 1;
  9529. this.skillTimes = 0;
  9530. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  9531. this.comboSpine = new SpineMgr("yxz_liangan");
  9532. this.skillSpine = new SpineMgr("yiganxqiu");
  9533. this.scoreSpine = new SpineMgr("defen");
  9534. }
  9535. setClassicCombo(isInterrupt) {
  9536. if (isInterrupt) {
  9537. this.comboTimes = 0;
  9538. }
  9539. }
  9540. playClassicWords(type, callback) {
  9541. this.callback = callback;
  9542. let aniIndex = type;
  9543. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9544. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9545. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9546. mySpine.destroy(true);
  9547. this.playClassicTimes();
  9548. });
  9549. }
  9550. playClassicTimes() {
  9551. this.comboTimes++;
  9552. if (this.comboTimes <= 1) {
  9553. this.callback && this.callback();
  9554. }
  9555. else {
  9556. let aniIndex = this.comboTimes - 1;
  9557. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9558. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9559. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9560. mySpine.destroy(true);
  9561. this.callback && this.callback();
  9562. });
  9563. }
  9564. }
  9565. playBigSkillTimes(times, callback) {
  9566. if (times <= 0) {
  9567. callback && callback();
  9568. return;
  9569. }
  9570. this.callback = callback;
  9571. let pre = "sz_0";
  9572. let aniIndex = 0;
  9573. this.getWordsImg(times, pre, () => {
  9574. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9575. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9576. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9577. let r1 = ``;
  9578. let r2 = ``;
  9579. if (times <= 9) {
  9580. r1 = `res/d2Res/${pre}${times}.png`;
  9581. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9582. aniIndex = 0;
  9583. }
  9584. else {
  9585. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9586. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9587. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9588. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9589. aniIndex = 1;
  9590. }
  9591. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9592. mySpine.destroy(true);
  9593. xGame.common.gameMgr.playSkillTips();
  9594. this.playScore(times);
  9595. xGame.common.playRandomMutiBallBigSkillSound();
  9596. }, mySpine);
  9597. });
  9598. }
  9599. playScore(score) {
  9600. let pre = "sz_";
  9601. let aniIndex = 0;
  9602. this.getWordsImg(score, pre, () => {
  9603. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9604. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9605. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9606. let r1 = ``;
  9607. let r2 = ``;
  9608. if (score <= 9) {
  9609. r1 = `res/d2Res/${pre}${score}.png`;
  9610. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9611. aniIndex = 0;
  9612. }
  9613. else {
  9614. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9615. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9616. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9617. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9618. aniIndex = 1;
  9619. }
  9620. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9621. mySpine.destroy(true);
  9622. this.callback && this.callback();
  9623. }, mySpine);
  9624. });
  9625. }
  9626. getWordsImg(number, pre = "", callback) {
  9627. let arr = [];
  9628. if (number <= 9) {
  9629. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9630. }
  9631. else {
  9632. 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 });
  9633. }
  9634. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9635. callback && callback();
  9636. }));
  9637. }
  9638. }
  9639. class ui_UIRodMethod extends fgui.GComponent {
  9640. static createInstance() {
  9641. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9642. }
  9643. onConstruct() {
  9644. this.n24 = (this.getChild("n24"));
  9645. this.white = (this.getChild("white"));
  9646. this.dot = (this.getChild("dot"));
  9647. this.sureBtn = (this.getChild("sureBtn"));
  9648. this.n20 = (this.getChild("n20"));
  9649. this.n21 = (this.getChild("n21"));
  9650. this.n22 = (this.getChild("n22"));
  9651. this.n23 = (this.getChild("n23"));
  9652. this.n5 = (this.getChild("n5"));
  9653. this.n14 = (this.getChild("n14"));
  9654. this.t0 = this.getTransition("t0");
  9655. }
  9656. }
  9657. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9658. class UIRodMethod extends UIBase {
  9659. constructor() {
  9660. super();
  9661. this.isPressd = false;
  9662. }
  9663. onConstructor() {
  9664. this.ui = ui_UIRodMethod.createInstance();
  9665. this.contentPane = this.ui;
  9666. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9667. this.moveDir = new Laya.Vector2();
  9668. this.moveDest = new Laya.Vector2();
  9669. this.centerPos = new Laya.Vector2();
  9670. xGame.common.uiRodMethod = this;
  9671. }
  9672. show() {
  9673. super.show();
  9674. xGame.common.gameMgr.gamePause = true;
  9675. this.openPressDotEvent();
  9676. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9677. this.centerPos.x = this.ui.white.x;
  9678. this.centerPos.y = this.ui.white.y;
  9679. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9680. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9681. this.setDot();
  9682. }
  9683. setDot() {
  9684. this.ui.dot.x = this.moveDest.x;
  9685. this.ui.dot.y = this.moveDest.y;
  9686. }
  9687. closeSelf() {
  9688. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9689. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9690. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9691. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9692. xGame.common.gameMgr.gamePause = false;
  9693. this.hide();
  9694. }
  9695. openPressDotEvent() {
  9696. this.closePressDotEvent();
  9697. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9698. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9699. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9700. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9701. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9702. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9703. }
  9704. closePressDotEvent() {
  9705. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9706. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9707. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9708. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9709. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9710. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9711. }
  9712. onDown(e) {
  9713. if (e.type == Laya.Event.MOUSE_DOWN)
  9714. this.isPressd = true;
  9715. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9716. this.isPressd = false;
  9717. if (!this.isPressd)
  9718. return;
  9719. this.moveDest.x = e.stageX;
  9720. this.moveDest.y = e.stageY;
  9721. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9722. if (dis > 6724) {
  9723. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9724. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9725. }
  9726. this.setDot();
  9727. }
  9728. resetRod() {
  9729. this.ui.dot.x = this.ui.white.x;
  9730. this.ui.dot.y = this.ui.white.y;
  9731. this.gameRod.dot.x = this.gameRod.bg.x;
  9732. this.gameRod.dot.y = this.gameRod.bg.y;
  9733. xGame.common.rodOffest.x = 0;
  9734. xGame.common.rodOffest.y = 0;
  9735. }
  9736. }
  9737. UIRodMethod.uiName = "UIRodMethod";
  9738. class UIGame extends UIBase {
  9739. constructor() {
  9740. super();
  9741. this.powerNum = 0;
  9742. this.isD3Inited = false;
  9743. this.isPrePlay = false;
  9744. this.isMoveRod = false;
  9745. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9746. this.rulerDis = 20;
  9747. this.rulerOffset = 0;
  9748. }
  9749. onConstructor() {
  9750. this.ui = ui_UIGame.createInstance();
  9751. this.contentPane = this.ui;
  9752. this.ui.x += xGame.common.sysOffestNum;
  9753. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9754. this.isEject = false;
  9755. xGame.common.gameUI = this;
  9756. this.initSelf();
  9757. }
  9758. isTurnSelf() {
  9759. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9760. return true;
  9761. }
  9762. }
  9763. initSelf() {
  9764. let topUI = this.ui.topNode;
  9765. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9766. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9767. this.barInfo = {};
  9768. this.barInfo.curY = 0;
  9769. this.barInfo.height = this.ui.powerNode.height;
  9770. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9771. this.barInfo.powerStartY = this.ui.powerNode.y;
  9772. xGame.common.aiPlayer = new AIPlayer();
  9773. xGame.common.gameMgr = new GameMgr();
  9774. xGame.common.skillMgr = new SkillMgr();
  9775. xGame.common.wordsMgr = new WordsMgr();
  9776. xGame.common.talkMgr = new TalkMgr();
  9777. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9778. console.log("加载经典模式表情文件chenggon !");
  9779. });
  9780. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9781. console.log("挑战模式奖励模式spine加载成功!");
  9782. });
  9783. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9784. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9785. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9786. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9787. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9788. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9789. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9790. }
  9791. getGanZiImg() {
  9792. let index = DataMgr.getCurBallRod();
  9793. let data = cfgTable.ballrodData[index + 1];
  9794. let gan_url = xGame.common.getGameIconUrl(data.img);
  9795. console.log('zh:getGanZiImg gan_url==' + gan_url);
  9796. this.ui.powerNode.showImg.url = gan_url;
  9797. console.log('zh:修改杆子图标O K');
  9798. }
  9799. returnHome() {
  9800. let tips = "Are you sure to exit the game?";
  9801. let woman = "Boss, why don't you play for a while longer?";
  9802. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9803. }
  9804. addRodMethodClick() {
  9805. if (this.isTurnSelf()) {
  9806. xGame.uiMgr.Show(UIRodMethod);
  9807. }
  9808. }
  9809. clickHelpLineBtn(force = false) {
  9810. if (!this.isTurnSelf())
  9811. return;
  9812. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9813. if (success) {
  9814. xGame.common.longHelpLine = true;
  9815. xGame.common.d2World.getHelpLine();
  9816. Moyu.sendDataEvent("guideNum");
  9817. }
  9818. else {
  9819. }
  9820. });
  9821. }
  9822. renderSelfDisplayBalls(index, target) {
  9823. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9824. target.myImg.url = xGame.common.getGameIconUrl(str);
  9825. }
  9826. renderAIDisplayBalls(index, target) {
  9827. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9828. target.myImg.url = xGame.common.getGameIconUrl(str);
  9829. ;
  9830. }
  9831. updateMode() {
  9832. if (xGame.common.gameMode == GameMode.classic) {
  9833. this.ui.topNode.scoreNode.visible = false;
  9834. }
  9835. else if (xGame.common.gameMode == GameMode.bigMove) {
  9836. this.ui.topNode.scoreNode.visible = true;
  9837. }
  9838. }
  9839. show() {
  9840. super.show();
  9841. console.log("zh:uigame show AADD");
  9842. this.ui.alpha = 0;
  9843. this.updateSelf();
  9844. xGame.common.gameMgr.gamePause = false;
  9845. xGame.common.gameUI.ui.blackAni.visible = false;
  9846. xGame.common.gameUI.ui.whiteAni.visible = false;
  9847. this.ui.powerEft.visible = false;
  9848. this.ui.colorNode.visible = false;
  9849. this.updateHead();
  9850. let curUse = DataMgr.getCurBallRod();
  9851. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  9852. this.getGanZiImg();
  9853. }
  9854. updateSelf() {
  9855. if (xGame.common.gameMode == GameMode.classic) {
  9856. this.ui.c1.selectedIndex = 0;
  9857. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9858. this.ui.topNode.middleNode.visible = true;
  9859. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9860. }
  9861. else if (xGame.common.gameMode == GameMode.bigMove) {
  9862. this.ui.c1.selectedIndex = 0;
  9863. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9864. this.ui.topNode.middleNode.visible = false;
  9865. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9866. let rand = xGame.common.randomNum(1, max);
  9867. let guide = DataMgr.getSkillGuide();
  9868. if (guide == 0)
  9869. rand = 1;
  9870. xGame.common.bigMoveLevelIndex = rand;
  9871. }
  9872. else if (xGame.common.gameMode == GameMode.placeBall) {
  9873. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9874. this.ui.c1.selectedIndex = 1 + data.type;
  9875. this.ui.alpha = 1;
  9876. this.startGame();
  9877. }
  9878. this.updateMode();
  9879. this.initD3world();
  9880. this.initD2world();
  9881. }
  9882. startGame() {
  9883. this.ui.snowNode.visible = Math.random() <= 0.1;
  9884. this.ui.d2Node.visible = false;
  9885. xGame.common.d3World.d3Hand.gameObj.active = false;
  9886. xGame.common.d3World.tableSrc.init();
  9887. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9888. this.cameraViewChange(() => {
  9889. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9890. switch (xGame.common.gameMode) {
  9891. case GameMode.classic:
  9892. xGame.common.d3World.d3Hand.gameObj.active = true;
  9893. this.playPutBallD3Ani();
  9894. break;
  9895. case GameMode.bigMove:
  9896. this.enterGame();
  9897. Laya.timer.once(500, this, () => {
  9898. this.ui.topNode.middleNode.visible = true;
  9899. this.ui.topNode.middleNode.t0.play();
  9900. });
  9901. break;
  9902. case GameMode.placeBall:
  9903. this.enterGame();
  9904. break;
  9905. default:
  9906. break;
  9907. }
  9908. });
  9909. PlatMgr.showBanner(false);
  9910. }
  9911. enterGame() {
  9912. this.ui.d2Node.visible = true;
  9913. xGame.common.d3World.d3Hand.gameObj.active = false;
  9914. xGame.common.showOneCamera("mainCamera");
  9915. Moyu.recordGame(30, true);
  9916. if (!this.isPrePlay) {
  9917. this.isPrePlay = true;
  9918. xGame.common.d3World.prePlayEft();
  9919. }
  9920. xGame.common.gameMgr.gameReady();
  9921. this.openAllEvent();
  9922. this.ui.snowNode.visible = false;
  9923. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9924. this.ui.helpBtn.visible = condition;
  9925. }
  9926. showHelpLineGuide() {
  9927. let longGuide = DataMgr.getGuideHelpLine();
  9928. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9929. this.ui.helpBtn.visible = true;
  9930. this.ui.guideNode.visible = true;
  9931. }
  9932. }
  9933. setTurnAlpha(alpha) {
  9934. this.ui.keduNode.alpha = alpha;
  9935. this.ui.ganNode.alpha = alpha;
  9936. this.ui.rodMethodNode.alpha = alpha;
  9937. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9938. }
  9939. cameraViewChange(callback) {
  9940. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9941. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9942. xGame.common.showOneCamera("visitAngle");
  9943. cameraSrc.localRotationEulerY = 180;
  9944. cameraSrc.localRotationEulerZ = 0;
  9945. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9946. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9947. callback && callback();
  9948. }));
  9949. }));
  9950. }
  9951. playPutBallD3Ani() {
  9952. xGame.common.showOneCamera("mainCamera");
  9953. let handSrc = xGame.common.d3World.d3Hand;
  9954. handSrc.gameObj.active = true;
  9955. handSrc.transform.localPositionZ = 3;
  9956. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9957. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9958. handSrc.gameObj.active = false;
  9959. this.enterGame();
  9960. }), 400);
  9961. }));
  9962. }
  9963. updateHead() {
  9964. let user = Moyu.getUserInfo();
  9965. this.ui.topNode.selfNameTxt.text = user.nickName;
  9966. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9967. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9968. if (DataMgr.getSkillGuide() < 1) {
  9969. this.ui.topNode.aiNameTxt.text = 'billiards';
  9970. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9971. }
  9972. else {
  9973. this.ui.topNode.aiNameTxt.text = aiData.name;
  9974. let randNo = Math.floor(Math.random() * 10) + 1;
  9975. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9976. }
  9977. }
  9978. initD2world() {
  9979. let node = this.ui.d2Root.displayObject;
  9980. let src = node.getComponent(D2World);
  9981. if (!src) {
  9982. xGame.common.d2World = node.addComponent(D2World);
  9983. }
  9984. xGame.common.d2World.initSelf();
  9985. }
  9986. initD3world() {
  9987. if (this.isD3Inited)
  9988. return;
  9989. this.isD3Inited = true;
  9990. let scene3D = xGame.common.d3Scene;
  9991. this.ui.d3Root.displayObject.addChild(scene3D);
  9992. scene3D.active = true;
  9993. xGame.common.d3World.tableSrc.setBorderPos();
  9994. }
  9995. onRootMove(e) {
  9996. let rootBall = xGame.common.d2World.rootBall;
  9997. this.ui.moveNode.x = e.x;
  9998. this.ui.moveNode.y = e.y;
  9999. rootBall.gameObj.x = e.x;
  10000. rootBall.gameObj.y = e.y;
  10001. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  10002. }
  10003. aiRootMove(move) {
  10004. if (move)
  10005. this.hideBallUI();
  10006. else {
  10007. this.showBallUI();
  10008. xGame.common.d2World.getHelpLine();
  10009. }
  10010. }
  10011. aiForce(type, force = 0) {
  10012. this.pressTarget = PressType.powerNode;
  10013. if (type == 1)
  10014. this.onEventUp({ force: true });
  10015. else if (type == 2)
  10016. this.onEventMove({ stageY: force, force: true });
  10017. }
  10018. onEventPress(e) {
  10019. if (e.stopPropagation)
  10020. e.stopPropagation();
  10021. if (!this.isTurnSelf())
  10022. return;
  10023. let target = e.target;
  10024. switch (target) {
  10025. case this.ui.myPowerNode.displayObject:
  10026. this.pressTarget = PressType.powerNode;
  10027. this.barInfo.curY = e.stageY;
  10028. this.updateBarInfo();
  10029. break;
  10030. case this.ui.moveNode.displayObject:
  10031. this.pressTarget = PressType.moveNode;
  10032. this.hideBallUI();
  10033. this.eventObj.curX = this.ui.moveNode.x;
  10034. this.eventObj.curY = this.ui.moveNode.y;
  10035. this.ui.moveNode.finger.visible = false;
  10036. this.eventObj.lastX = e.stageX;
  10037. this.eventObj.lastY = e.stageY;
  10038. break;
  10039. case this.ui.rulerClickNode.displayObject:
  10040. this.pressTarget = PressType.rulerNode;
  10041. this.eventObj.lastY = e.stageY;
  10042. break;
  10043. case this.ui.d2Root.displayObject:
  10044. this.pressTarget = PressType.d2Root;
  10045. this.eventObj.lastX = e.stageX;
  10046. this.eventObj.lastY = e.stageY;
  10047. this.eventObj.starX = e.stageX;
  10048. this.eventObj.starY = e.stageY;
  10049. this.eventObj.curX = 0;
  10050. this.eventObj.curY = 0;
  10051. xGame.common.d2World.d2Gan.setGanLastInfo();
  10052. this.rulerOffset = 0;
  10053. break;
  10054. default:
  10055. break;
  10056. }
  10057. }
  10058. onEventMove(e) {
  10059. if (e.stopPropagation)
  10060. e.stopPropagation();
  10061. if (e && e.force) {
  10062. }
  10063. else {
  10064. if (!this.isTurnSelf())
  10065. return;
  10066. }
  10067. switch (this.pressTarget) {
  10068. case PressType.powerNode:
  10069. this.barInfo.curY = e.stageY;
  10070. this.updateBarInfo();
  10071. this.isMoveRod = true;
  10072. break;
  10073. case PressType.moveNode:
  10074. let rootBall = xGame.common.d2World.rootBall;
  10075. let radius = rootBall.gameObj.width / 2;
  10076. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  10077. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  10078. let border = xGame.common.d2World.borderRect;
  10079. if (curX <= border.x + radius)
  10080. curX = border.x + radius;
  10081. else if (curX >= border.x + border.width - radius)
  10082. curX = border.x + border.width - radius;
  10083. if (curY <= border.y + radius)
  10084. curY = border.y + radius;
  10085. else if (curY >= border.y + border.height - radius)
  10086. curY = border.y + border.height - radius;
  10087. if (xGame.common.gameMgr.isOpenBall) {
  10088. if (curX >= border.x + border.openBallW - radius)
  10089. curX = border.x + border.openBallW - radius;
  10090. }
  10091. this.ui.moveNode.x = curX;
  10092. this.ui.moveNode.y = curY;
  10093. rootBall.gameObj.x = curX;
  10094. rootBall.gameObj.y = curY;
  10095. rootBall.d3BallSrc.setTransPos(curX, curY);
  10096. this.isMoveRod = true;
  10097. break;
  10098. case PressType.rulerNode:
  10099. let yy = e.stageY - this.eventObj.lastY;
  10100. this.eventObj.lastY = e.stageY;
  10101. let ruler1 = this.ui.rulerNode.img1;
  10102. let ruler2 = this.ui.rulerNode.img2;
  10103. ruler1.y += yy;
  10104. ruler2.y += yy;
  10105. this.rulerOffset += yy;
  10106. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  10107. this.rulerOffset = 0;
  10108. xGame.soundMgr.playSound("inch", 1, 10);
  10109. }
  10110. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  10111. let h = ruler1.height;
  10112. this.checkGuide();
  10113. this.isMoveRod = true;
  10114. if (ruler1.y >= h) {
  10115. ruler1.y = -h;
  10116. ruler2.y = 0;
  10117. return;
  10118. }
  10119. else if (ruler1.y <= -h) {
  10120. ruler1.y = h;
  10121. ruler2.y = 0;
  10122. return;
  10123. }
  10124. if (ruler2.y >= h) {
  10125. ruler2.y = -h;
  10126. ruler1.y = 0;
  10127. return;
  10128. }
  10129. else if (ruler2.y <= -h) {
  10130. ruler2.y = h;
  10131. ruler1.y = 0;
  10132. return;
  10133. }
  10134. break;
  10135. case PressType.d2Root:
  10136. this.eventObj.curX = e.stageX;
  10137. this.eventObj.curY = e.stageY;
  10138. let offset = this.checkRodMoveDir();
  10139. xGame.common.d2World.d2Gan.rotateSelf(offset);
  10140. this.eventObj.lastX = e.stageX;
  10141. this.eventObj.lastY = e.stageY;
  10142. break;
  10143. default:
  10144. break;
  10145. }
  10146. }
  10147. onEventUp(e) {
  10148. if (e.stopPropagation)
  10149. e.stopPropagation();
  10150. if (e && e.force) {
  10151. }
  10152. else {
  10153. if (!this.isTurnSelf())
  10154. return;
  10155. }
  10156. switch (this.pressTarget) {
  10157. case PressType.powerNode:
  10158. this.ui.powerNode.value = 0;
  10159. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10160. this.ui.powerTxt.text = "";
  10161. if (this.powerNum > 0) {
  10162. xGame.eventMgr.event(BALL_SHOOT);
  10163. xGame.common.d2World.shoot(this.powerNum);
  10164. xGame.common.d2World.d2Gan.shoot();
  10165. xGame.common.d2World.d2HelpLine.shoot();
  10166. this.finishGuide();
  10167. this.ui.powerEft.visible = false;
  10168. this.ui.colorNode.visible = false;
  10169. let ganStr = "";
  10170. if (this.powerNum <= 30) {
  10171. ganStr = "gan_30";
  10172. }
  10173. else if (this.powerNum <= 60) {
  10174. ganStr = "gan_50";
  10175. }
  10176. else {
  10177. ganStr = "gan_80";
  10178. }
  10179. xGame.soundMgr.playSound(ganStr);
  10180. }
  10181. break;
  10182. case PressType.moveNode:
  10183. let rootBall = xGame.common.d2World.rootBall;
  10184. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10185. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10186. let isIntersect = this.judgeBallIntersect();
  10187. if (isIntersect) {
  10188. this.ui.moveNode.x = lastX;
  10189. this.ui.moveNode.y = lastY;
  10190. rootBall.gameObj.x = lastX;
  10191. rootBall.gameObj.y = lastY;
  10192. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10193. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10194. }
  10195. else {
  10196. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10197. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10198. }
  10199. this.showBallUI();
  10200. this.ui.moveNode.finger.visible = true;
  10201. xGame.common.d2World.getHelpLine();
  10202. break;
  10203. case PressType.rulerNode:
  10204. break;
  10205. case PressType.d2Root:
  10206. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10207. if (dis <= 25) {
  10208. this.moveToClickDot(e);
  10209. }
  10210. break;
  10211. default:
  10212. break;
  10213. }
  10214. this.pressTarget = -1;
  10215. }
  10216. checkGuide() {
  10217. let guide = DataMgr.getSkillGuide();
  10218. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10219. xGame.common.guideStep++;
  10220. xGame.common.gameUI.ui.guide2.visible = false;
  10221. xGame.common.gameUI.ui.guide3.visible = true;
  10222. }
  10223. }
  10224. finishGuide() {
  10225. let guide = DataMgr.getSkillGuide();
  10226. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10227. xGame.common.guideStep = 10;
  10228. this.closeAllGuide();
  10229. console.log('zh: 新手引导完毕');
  10230. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  10231. }
  10232. }
  10233. closeAllGuide() {
  10234. xGame.common.gameUI.ui.guide1.visible = false;
  10235. xGame.common.gameUI.ui.guide2.visible = false;
  10236. xGame.common.gameUI.ui.guide3.visible = false;
  10237. }
  10238. updateBarInfo() {
  10239. let star = this.ui.powerNode.y;
  10240. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10241. if (rate >= 1)
  10242. rate = 1;
  10243. if (rate <= 0)
  10244. rate = 0;
  10245. this.powerNum = Math.ceil(rate * 100);
  10246. this.ui.powerNode.value = this.powerNum;
  10247. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10248. this.ui.colorNode.value = this.powerNum;
  10249. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10250. this.ui.powerEft.visible = this.powerNum != 0;
  10251. this.ui.colorNode.visible = this.powerNum != 0;
  10252. this.ui.powerTxt.text = this.powerNum + "";
  10253. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10254. }
  10255. forceCancel() {
  10256. this.ui.powerNode.value = 0;
  10257. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10258. this.ui.powerTxt.text = "";
  10259. }
  10260. checkRodMoveDir() {
  10261. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10262. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10263. if (tempX >= 0 && tempY <= 0) {
  10264. return this.checkDir();
  10265. }
  10266. else if (tempX < 0 && tempY < 0) {
  10267. return this.checkDir(1, -1);
  10268. }
  10269. else if (tempX < 0 && tempY > 0) {
  10270. return this.checkDir(-1, -1);
  10271. }
  10272. else {
  10273. return this.checkDir(-1, 1);
  10274. }
  10275. }
  10276. checkDir(flagX = 1, flagY = 1) {
  10277. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10278. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10279. if (offsetY == 0) {
  10280. return offsetX * flagX;
  10281. }
  10282. if (offsetX == 0) {
  10283. return offsetY * flagY;
  10284. }
  10285. let angle = offsetY / offsetX;
  10286. if (Math.abs(angle) >= 1) {
  10287. return offsetY * flagY;
  10288. }
  10289. else {
  10290. return offsetX * flagX;
  10291. }
  10292. }
  10293. judgeBallIntersect() {
  10294. let rootBall = xGame.common.d2World.rootBall;
  10295. let ballArr = xGame.common.d2World.ballArr;
  10296. let radius = rootBall.gameObj.width / 2;
  10297. let temp;
  10298. let isIntersect = false;
  10299. for (let index = 0; index < ballArr.length; index++) {
  10300. temp = ballArr[index];
  10301. if (temp.number == rootBall.number)
  10302. continue;
  10303. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10304. if (isIntersect) {
  10305. break;
  10306. }
  10307. }
  10308. return isIntersect;
  10309. }
  10310. hideBallUI() {
  10311. let d2Gan = xGame.common.d2World.d2Gan;
  10312. if (!d2Gan.ui.isDisposed)
  10313. d2Gan.ui.visible = false;
  10314. let d2Help = xGame.common.d2World.d2HelpLine;
  10315. if (!d2Help.ui.isDisposed)
  10316. d2Help.ui.visible = false;
  10317. let rootBall = xGame.common.d2World.rootBall;
  10318. if (!rootBall.destroyed) {
  10319. rootBall.gameObj.active = false;
  10320. }
  10321. }
  10322. showBallUI() {
  10323. let d2Gan = xGame.common.d2World.d2Gan;
  10324. if (!d2Gan.ui.isDisposed)
  10325. d2Gan.ui.visible = true;
  10326. let d2Help = xGame.common.d2World.d2HelpLine;
  10327. if (!d2Help.ui.isDisposed)
  10328. d2Help.ui.visible = true;
  10329. let rootBall = xGame.common.d2World.rootBall;
  10330. if (!rootBall.destroyed) {
  10331. rootBall.gameObj.active = true;
  10332. }
  10333. }
  10334. moveToClickDot(e) {
  10335. if (!this.isMoveRod && !xGame.common.clickedBall) {
  10336. let root = xGame.common.d2World.rootBall.gameObj;
  10337. let xx = e.stageX - xGame.common.sysOffestNum;
  10338. let yy = e.stageY;
  10339. let x = xx - root.x;
  10340. let y = yy - root.y;
  10341. let angle = xGame.common.getfguiRotation(x, y);
  10342. xGame.common.d2World.d2Gan.ui.rotation = angle;
  10343. xGame.common.d2World.getHelpLine();
  10344. }
  10345. this.isMoveRod = false;
  10346. xGame.common.clickedBall = false;
  10347. }
  10348. openAllEvent() {
  10349. this.closeAllEvent();
  10350. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10351. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10352. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10353. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10354. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10355. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10356. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10357. }
  10358. closeAllEvent() {
  10359. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10360. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10361. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10362. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10363. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10364. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10365. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10366. }
  10367. resetGame() {
  10368. this.closeAllEvent();
  10369. this.hideBallUI();
  10370. xGame.common.gameMgr.gamePause = true;
  10371. }
  10372. }
  10373. UIGame.uiName = "UIGame";
  10374. class UIAddProp extends UIBase {
  10375. constructor() {
  10376. super();
  10377. this.curType = "";
  10378. }
  10379. onConstructor() {
  10380. this.ui = ui_UIAddProp.createInstance();
  10381. this.contentPane = this.ui;
  10382. this.isEject = false;
  10383. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  10384. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  10385. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  10386. this.updateUI();
  10387. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  10388. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  10389. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  10390. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  10391. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  10392. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  10393. }
  10394. show(type) {
  10395. super.show();
  10396. this.curType = type == 0 ? "coin" : "diamond";
  10397. this.switchBtn("");
  10398. this.ui.t0.play();
  10399. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  10400. PlatMgr.showInsert(true);
  10401. }
  10402. closeSelf() {
  10403. this.hide();
  10404. }
  10405. updateUI() {
  10406. let data = cfgTable.moneyData;
  10407. let temp;
  10408. let obj;
  10409. for (const key in data) {
  10410. temp = data[key];
  10411. obj = this.ui.myNode["node" + key];
  10412. if (parseInt(key) <= 2) {
  10413. obj.diamondTxt.text = "+" + temp.num;
  10414. }
  10415. else {
  10416. obj.coinTxt.text = temp.num;
  10417. obj.diamondTxt.text = temp.get.split('_')[1];
  10418. }
  10419. }
  10420. this.updateDiamondShare();
  10421. }
  10422. updateDiamondShare() {
  10423. let data = DataMgr.getShareDiamondTimes();
  10424. if (data >= xGame.common.maxShareDiamondTimes) {
  10425. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  10426. this.ui.myNode.node1.touchable = false;
  10427. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10428. }
  10429. else {
  10430. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  10431. this.ui.myNode.node1.touchable = true;
  10432. }
  10433. }
  10434. switchBtn(type) {
  10435. if (type == "")
  10436. type = this.curType;
  10437. else {
  10438. if (this.curType == type) {
  10439. return;
  10440. }
  10441. else {
  10442. this.curType = type;
  10443. }
  10444. }
  10445. if (type == "coin") {
  10446. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  10447. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  10448. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  10449. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  10450. this.ui.myNode.c1.selectedIndex = 0;
  10451. }
  10452. else {
  10453. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  10454. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  10455. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  10456. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  10457. this.ui.myNode.c1.selectedIndex = 1;
  10458. }
  10459. }
  10460. convertCoin(index) {
  10461. let data = cfgTable.moneyData[index];
  10462. let coinNum = data.num;
  10463. let str = data.get.split('_')[1];
  10464. let needDiamond = parseInt(str);
  10465. if (DataMgr.diamondEnough(needDiamond)) {
  10466. DataMgr.setDiamond(-needDiamond);
  10467. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  10468. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  10469. }
  10470. else {
  10471. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  10472. this.switchBtn("diamond");
  10473. }
  10474. }
  10475. videoGetDiamond() {
  10476. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  10477. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  10478. }
  10479. else {
  10480. console.log('zh:AD 失败,直接发放奖励');
  10481. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  10482. }
  10483. }
  10484. qjff_AD_for_uiAddProp_videoGetDiamond() {
  10485. let num = cfgTable.moneyData[2].num;
  10486. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10487. this.closeSelf();
  10488. }
  10489. videoGetCoin() {
  10490. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  10491. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  10492. }
  10493. else {
  10494. console.log('zh:AD 失败,直接发放奖励');
  10495. this.qjff_AD_for_uiAddProp_videoGetCoin();
  10496. }
  10497. }
  10498. qjff_AD_for_uiAddProp_videoGetCoin() {
  10499. xGame.common.playObjFlyAnim(2000, Prop.coin);
  10500. this.closeSelf();
  10501. }
  10502. shareGetDiamond() {
  10503. let times = DataMgr.getShareDiamondTimes();
  10504. if (times >= xGame.common.maxShareDiamondTimes) {
  10505. console.log('zh: 233333333333 maxShareDiamondTimes');
  10506. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10507. }
  10508. else {
  10509. console.log('zh:33333333333333ad');
  10510. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  10511. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  10512. }
  10513. else {
  10514. console.log('zh:AD 失败,直接发放奖励');
  10515. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  10516. }
  10517. }
  10518. }
  10519. qjff_AD_for_uiAddProp_shareGetDiamond() {
  10520. let diamond = xGame.common.randomNum(50, 100);
  10521. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  10522. DataMgr.setShareDiamondTimes(1);
  10523. this.updateDiamondShare();
  10524. }
  10525. openPutBallView() {
  10526. let end = xGame.uiMgr.getUI(UIGameEnd);
  10527. let skill = xGame.uiMgr.getUI(UISkill);
  10528. let level = xGame.uiMgr.getUI(UILevelDisplay);
  10529. let uigame = xGame.uiMgr.getUI(UIGame);
  10530. if (end && !end.isHide) {
  10531. xGame.uiMgr.Hide(UIGameEnd);
  10532. xGame.uiMgr.Show(UIMain);
  10533. }
  10534. if (skill && !skill.isHide)
  10535. xGame.uiMgr.Hide(UISkill);
  10536. if (uigame && !uigame.isHide)
  10537. xGame.uiMgr.Hide(UIGame);
  10538. if (level && !level.isHide) {
  10539. }
  10540. else {
  10541. xGame.uiMgr.Show(UILevelDisplay);
  10542. }
  10543. this.closeSelf();
  10544. }
  10545. }
  10546. UIAddProp.uiName = "UIAddProp";
  10547. class MoneyNode {
  10548. constructor(ui) {
  10549. this.leftTime = 0;
  10550. this.ui = ui;
  10551. this.ui.addCoinBtn.onClick(this, this.addCoin);
  10552. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  10553. this.ui.addPowerBtn.onClick(this, this.addPower);
  10554. this.ui.c1.selectedIndex = 1;
  10555. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  10556. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  10557. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  10558. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10559. this.coinChange();
  10560. this.diamondChange();
  10561. this.powerChange();
  10562. }
  10563. addPower() {
  10564. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10565. xGame.uiMgr.Show(UIPower);
  10566. }
  10567. powerChange() {
  10568. let powerNum = DataMgr.getPower();
  10569. this.ui.powerTxt.text = powerNum + "";
  10570. }
  10571. checkPowerTime() {
  10572. let cur = new Date().getTime();
  10573. let last = DataMgr.getPowerTime();
  10574. if (last == 0) {
  10575. last = cur;
  10576. DataMgr.setPowerTime(cur);
  10577. }
  10578. let power = DataMgr.getPower();
  10579. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10580. Laya.timer.clearAll(this);
  10581. if (power >= xGame.common.natureMaxPower) {
  10582. this.ui.powerTimeTxt.text = "";
  10583. DataMgr.setPowerTime(cur);
  10584. return;
  10585. }
  10586. if (power + offset >= xGame.common.natureMaxPower) {
  10587. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10588. this.ui.powerTimeTxt.text = "";
  10589. DataMgr.setPowerTime(cur);
  10590. }
  10591. else {
  10592. if (offset > 0) {
  10593. DataMgr.setPower(offset);
  10594. DataMgr.setPowerTime(cur);
  10595. }
  10596. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10597. this.leftTime = xGame.common.powerRecoverNum - time;
  10598. if (this.leftTime <= 0)
  10599. this.leftTime = 0;
  10600. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10601. Laya.timer.loop(1000, this, this.updatePowerTime);
  10602. }
  10603. }
  10604. updatePowerTime() {
  10605. this.leftTime -= 1;
  10606. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10607. if (this.leftTime <= 0) {
  10608. this.checkPowerTime();
  10609. }
  10610. }
  10611. coinChange() {
  10612. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10613. }
  10614. diamondChange() {
  10615. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10616. }
  10617. addCoin() {
  10618. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10619. Moyu.sendDataEvent("AddCoinBtn");
  10620. xGame.uiMgr.Show(UIAddProp, 0);
  10621. }
  10622. addDiamond() {
  10623. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10624. Moyu.sendDataEvent("AddDiamondBtn");
  10625. xGame.uiMgr.Show(UIAddProp, 1);
  10626. }
  10627. }
  10628. class UIDraw extends UIBase {
  10629. constructor() {
  10630. super();
  10631. this.curKey = 0;
  10632. }
  10633. onConstructor() {
  10634. this.ui = ui_UIDraw.createInstance();
  10635. this.contentPane = this.ui;
  10636. this.isEject = false;
  10637. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10638. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10639. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10640. this.initDraw();
  10641. this.initUI();
  10642. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10643. if (Moyu.isKs)
  10644. this.ui.closeNode.closeBtn.x += 100;
  10645. }
  10646. show() {
  10647. super.show();
  10648. this.ui.t0.play();
  10649. this.playSecretaryIdle();
  10650. this.updateDraw();
  10651. this.checkFree();
  10652. if (PlatMgr.bannerDelay > 0) {
  10653. this.ui.closeNode.closeBtn.visible = false;
  10654. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10655. this.ui.closeNode.closeBtn.visible = true;
  10656. });
  10657. }
  10658. PlatMgr.showRateBanner();
  10659. }
  10660. hide() {
  10661. Laya.timer.clearAll(this);
  10662. super.hide();
  10663. }
  10664. checkFree() {
  10665. let isFree = DataMgr.getDailyfreeDrawTimes();
  10666. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10667. }
  10668. initDraw() {
  10669. this.drawObj = [];
  10670. let data = cfgTable.drawData;
  10671. let temp;
  10672. let weight = 0;
  10673. for (const key in data) {
  10674. temp = data[key];
  10675. weight += temp.weight;
  10676. this.drawObj.push(weight);
  10677. }
  10678. this.allWeight = weight;
  10679. }
  10680. initUI() {
  10681. let data = cfgTable.drawData;
  10682. let temp;
  10683. let img;
  10684. let txt;
  10685. for (const key in data) {
  10686. temp = data[key];
  10687. img = this.ui.myNode.rotNode["img" + key];
  10688. txt = this.ui.myNode.rotNode["txt" + key];
  10689. img.url = xGame.common.getGameIconUrl(temp.icon);
  10690. txt.visible = true;
  10691. if (temp.award > 2) {
  10692. img.rotation = 0;
  10693. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10694. }
  10695. else {
  10696. img.rotation = temp.rotation;
  10697. txt.text = temp.num;
  10698. }
  10699. }
  10700. }
  10701. getCurkey() {
  10702. let rand = Math.random() * this.allWeight;
  10703. let temp;
  10704. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10705. temp = this.drawObj[index];
  10706. if (index == 0) {
  10707. if (rand < temp) {
  10708. return index + 1;
  10709. }
  10710. }
  10711. else {
  10712. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10713. return index + 1;
  10714. }
  10715. }
  10716. }
  10717. return 2;
  10718. }
  10719. startDraw() {
  10720. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10721. if (freeTimes > 0) {
  10722. this.beginDraw();
  10723. DataMgr.setDailyfreeDrawTimes(0);
  10724. this.checkFree();
  10725. }
  10726. else {
  10727. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  10728. }
  10729. else {
  10730. console.log('zh:AD 失败,直接发放奖励');
  10731. this.qjff_chouJiang();
  10732. }
  10733. }
  10734. }
  10735. qjff_chouJiang() {
  10736. this.beginDraw();
  10737. }
  10738. beginDraw() {
  10739. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10740. this.ui.drawBtn.touchable = false;
  10741. this.curKey = this.getCurkey();
  10742. console.log("当前key", this.curKey);
  10743. let cell = 60;
  10744. let lap = 3;
  10745. let angle = cell * (this.curKey - 1) + lap * 360;
  10746. let target = this.ui.myNode.rotNode;
  10747. target.rotation = 0;
  10748. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10749. console.log("旋转完成");
  10750. this.ui.drawBtn.touchable = true;
  10751. this.getAward();
  10752. }));
  10753. }
  10754. getAward() {
  10755. let data = cfgTable.drawData[this.curKey];
  10756. let temp = new AwardType();
  10757. temp.type = data.award;
  10758. temp.num = data.num;
  10759. xGame.common.getAward([temp], () => {
  10760. DataMgr.setDrawTimes(1);
  10761. this.updateDraw();
  10762. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10763. });
  10764. }
  10765. updateDraw() {
  10766. let drawTimes = DataMgr.getDrawTimes();
  10767. let awardTimes = DataMgr.getDrawAwardTimes();
  10768. if (Math.floor(drawTimes / 3) > awardTimes) {
  10769. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10770. this.ui.extraNode.boxBtn.touchable = true;
  10771. this.ui.extraNode.tipsTxt.text = "3/3";
  10772. this.ui.extraNode.barNode.width = 265;
  10773. this.getExtraAward();
  10774. }
  10775. else {
  10776. this.ui.extraNode.boxBtn.t0.stop();
  10777. this.ui.extraNode.boxBtn.touchable = false;
  10778. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10779. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10780. }
  10781. let data = cfgTable.drawData[1];
  10782. if (awardTimes == 0) {
  10783. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10784. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10785. this.ui.myNode.rotNode.img1.rotation = 0;
  10786. }
  10787. else {
  10788. let award = data.nextid;
  10789. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10790. this.ui.myNode.rotNode.txt1.text = award[1];
  10791. this.ui.myNode.rotNode.img1.rotation = 0;
  10792. }
  10793. }
  10794. getExtraAward() {
  10795. let drawTimes = DataMgr.getDrawTimes();
  10796. let awardTimes = DataMgr.getDrawAwardTimes();
  10797. let data = cfgTable.drawData[1];
  10798. let award = new AwardType();
  10799. if (awardTimes == 0) {
  10800. award.num = data.num;
  10801. award.type = data.award;
  10802. xGame.common.getAward([award], () => {
  10803. let all = Math.floor(drawTimes / 3);
  10804. DataMgr.setDrawAwardTimes(all);
  10805. this.updateDraw();
  10806. });
  10807. }
  10808. else {
  10809. award.num = parseInt(data.nextid[1]);
  10810. award.type = parseInt(data.nextid[0]);
  10811. xGame.common.getAward([award], () => {
  10812. let all = Math.floor(drawTimes / 3);
  10813. DataMgr.setDrawAwardTimes(all);
  10814. this.updateDraw();
  10815. });
  10816. }
  10817. }
  10818. closeSelf() {
  10819. this.hide();
  10820. }
  10821. playSecretaryIdle() {
  10822. let parent = this.ui.secretary.displayObject;
  10823. parent.destroyChildren();
  10824. let xx = this.ui.secretary.width / 2;
  10825. let yy = this.ui.secretary.height;
  10826. let scale = xGame.common.getSecretaryScale();
  10827. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10828. xGame.common.secretary.play(data, 0, true, parent);
  10829. }
  10830. }
  10831. UIDraw.uiName = "UIDraw";
  10832. class ui_UIFlyEft extends fgui.GComponent {
  10833. static createInstance() {
  10834. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10835. }
  10836. onConstruct() {
  10837. this.n0 = (this.getChild("n0"));
  10838. this.n1 = (this.getChild("n1"));
  10839. this.n2 = (this.getChild("n2"));
  10840. this.n3 = (this.getChild("n3"));
  10841. this.n4 = (this.getChild("n4"));
  10842. this.n5 = (this.getChild("n5"));
  10843. this.n6 = (this.getChild("n6"));
  10844. this.n7 = (this.getChild("n7"));
  10845. this.iconNode = (this.getChild("iconNode"));
  10846. this.txt = (this.getChild("txt"));
  10847. this.txtNode = (this.getChild("txtNode"));
  10848. }
  10849. }
  10850. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10851. class UIFlyEft extends UIBase {
  10852. constructor() {
  10853. super();
  10854. this.max = 8;
  10855. this.delay = 0;
  10856. }
  10857. onConstructor() {
  10858. this.ui = ui_UIFlyEft.createInstance();
  10859. this.contentPane = this.ui;
  10860. this.isEject = false;
  10861. this.isMuti = true;
  10862. this.ui.x += xGame.common.sysOffestNum;
  10863. }
  10864. getArrPos() {
  10865. if (this.iconPos && this.iconPos.length > 0)
  10866. return;
  10867. this.iconPos = [];
  10868. let temp;
  10869. for (let index = 0; index < this.max; index++) {
  10870. temp = this.ui["n" + index];
  10871. this.iconPos.push([temp.x, temp.y]);
  10872. }
  10873. }
  10874. show(stPos, edPos, num, type, callback) {
  10875. super.show();
  10876. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10877. this.getArrPos();
  10878. this.updateUI(type);
  10879. this.updatePos();
  10880. this.runFly(edPos, callback);
  10881. this.runWorlds(stPos, num);
  10882. }
  10883. updateUI(type) {
  10884. let temp;
  10885. let str;
  10886. for (let index = 0; index < this.max; index++) {
  10887. temp = this.ui["n" + index];
  10888. str = this.getIconStr(type);
  10889. temp.url = xGame.common.getGameIconUrl(str);
  10890. }
  10891. }
  10892. getIconStr(type) {
  10893. switch (type) {
  10894. case Prop.diamond:
  10895. return "ty_zs";
  10896. case Prop.coin:
  10897. return "ty_jb";
  10898. default:
  10899. break;
  10900. }
  10901. }
  10902. updatePos() {
  10903. let temp;
  10904. for (let index = 0; index < this.max; index++) {
  10905. temp = this.ui["n" + index];
  10906. temp.x = this.iconPos[index][0];
  10907. temp.y = this.iconPos[index][1];
  10908. }
  10909. }
  10910. runFly(endPos, callback) {
  10911. let all = 0;
  10912. let temp;
  10913. for (let index = 0; index < this.max; index++) {
  10914. temp = this.ui["n" + index];
  10915. temp.visible = true;
  10916. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10917. temp.visible = false;
  10918. all++;
  10919. if (all >= this.max) {
  10920. callback && callback();
  10921. }
  10922. }), 20 * index);
  10923. }
  10924. }
  10925. runWorlds(stPos, num) {
  10926. let str = "+" + num;
  10927. this.ui.txt.text = str;
  10928. let starX = stPos.x;
  10929. let starY = stPos.y + 50;
  10930. this.ui.txt.x = starX;
  10931. this.ui.txt.y = starY;
  10932. this.ui.txt.visible = true;
  10933. this.ui.txt.alpha = 1;
  10934. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10935. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10936. this.ui.txt.visible = false;
  10937. this.hide();
  10938. }));
  10939. }));
  10940. }
  10941. }
  10942. UIFlyEft.uiName = "UIFlyEft";
  10943. class Common {
  10944. constructor() {
  10945. this.convertNum = 0.025;
  10946. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10947. this.scaleV3One = new Laya.Vector3();
  10948. this.scaleV3Two = new Laya.Vector3();
  10949. this.posV4 = new Laya.Vector4();
  10950. this.showDebug = false;
  10951. this.openGuide = true;
  10952. this.rodOffest = new Laya.Vector2(0, 0);
  10953. this.rodAngle = 0;
  10954. this.gameMode = GameMode.classic;
  10955. this.bigMoveLevelIndex = 1;
  10956. this.bigMoveNeedCoin = 1000;
  10957. this.classicNiceNeddCoin = 1000;
  10958. this.passAwardCoin = 2000;
  10959. this.classicRoomType = 1;
  10960. this.maxPower = 20;
  10961. this.natureMaxPower = 5;
  10962. this.videoPower = 2;
  10963. this.powerRecoverNum = 900;
  10964. this.curPlayerSkillType = 0;
  10965. this.isNewDay = false;
  10966. this.clickedBall = false;
  10967. this.placeBallCurLevel = 0;
  10968. this.placeBallStarNum = 0;
  10969. this.longHelpLine = false;
  10970. this.maxShareDiamondTimes = 3;
  10971. this.guideStep = 0;
  10972. this.temSelfLevel = 0;
  10973. this.extraMoveNum = 0;
  10974. this.curRankID = 0;
  10975. this.rankID = {
  10976. normalStar: 12000,
  10977. wxStar: 12001
  10978. };
  10979. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  10980. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  10981. this.btnClickStr = "buttonclick";
  10982. this.maxSkillLevel = 10;
  10983. this.upSkillLevel = false;
  10984. this.gameStartTime = 0;
  10985. this._sysOffestNum = 0;
  10986. this.angleV2 = new Laya.Vector2();
  10987. this.rootV = new Laya.Vector2(0, 1);
  10988. this.tempDir1 = new Laya.Vector2();
  10989. this.tempDir2 = new Laya.Vector2();
  10990. this.ballSize = 33;
  10991. this.stPos = new Laya.Point();
  10992. this.edPos = new Laya.Point();
  10993. Common._instance = this;
  10994. window["common"] = this;
  10995. }
  10996. static getInstance() {
  10997. if (!this._instance) {
  10998. this._instance = new Common();
  10999. }
  11000. return this._instance;
  11001. }
  11002. get sysOffestNum() {
  11003. if (this._sysOffestNum == 0) {
  11004. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  11005. }
  11006. return this._sysOffestNum;
  11007. }
  11008. testShader() {
  11009. let test = new LightShader();
  11010. test.texture = "res/d3Res/ballTexture/ball1.png";
  11011. Laya.stage.addChild(test);
  11012. }
  11013. playScale(node) {
  11014. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  11015. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  11016. }));
  11017. }));
  11018. }
  11019. setGroup(colli, ...group) {
  11020. let out = 0;
  11021. for (let index = 0; index < group.length; index++) {
  11022. if (index == 0) {
  11023. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11024. }
  11025. else {
  11026. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11027. }
  11028. }
  11029. colli.collisionGroup = out;
  11030. }
  11031. setCanGroupWith(colli, ...group) {
  11032. let out = 0;
  11033. for (let index = 0; index < group.length; index++) {
  11034. if (index == 0) {
  11035. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11036. }
  11037. else {
  11038. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11039. }
  11040. }
  11041. colli.canCollideWith = out;
  11042. }
  11043. loadPrefab(name, callback) {
  11044. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  11045. let prefab = new Laya.Prefab();
  11046. prefab.json = obj;
  11047. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  11048. callback && callback(img);
  11049. }));
  11050. }
  11051. pos2to3Convert(x, y, d3Pos) {
  11052. x = x + this.sysOffestNum;
  11053. d3Pos.setValue(x, y, 0);
  11054. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  11055. if (success) {
  11056. }
  11057. else {
  11058. console.error("转换出错了。。。。。。。。");
  11059. }
  11060. }
  11061. scale2to3Convert(num) {
  11062. this.scaleV3One.setValue(0, 0, 0);
  11063. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  11064. this.scaleV3Two.setValue(0, num, 0);
  11065. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  11066. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  11067. return outNum;
  11068. }
  11069. pos3to2Convert(d3Pos) {
  11070. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  11071. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  11072. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  11073. d3Pos.x -= this.sysOffestNum;
  11074. }
  11075. scale3to2Convert(num) {
  11076. let scale = this.scale2to3Convert(1);
  11077. let d2Out = num / scale;
  11078. return d2Out;
  11079. }
  11080. getCollider(type, restitution = 0.9, density = 10) {
  11081. let colli;
  11082. if (type == "box")
  11083. colli = new Laya.BoxCollider();
  11084. else
  11085. colli = new Laya.CircleCollider();
  11086. colli.friction = 0;
  11087. colli.restitution = restitution;
  11088. colli.density = density;
  11089. return colli;
  11090. }
  11091. getRigbody() {
  11092. let rigy = new Laya.RigidBody();
  11093. rigy.bullet = true;
  11094. rigy.allowRotation = false;
  11095. rigy.allowSleep = false;
  11096. rigy.gravityScale = 0;
  11097. return rigy;
  11098. }
  11099. getfguiRotation(x, y) {
  11100. this.angleV2.setValue(x, y);
  11101. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11102. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11103. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  11104. angle = -angle;
  11105. }
  11106. return 180 + angle;
  11107. }
  11108. getAngle(x, y) {
  11109. this.angleV2.setValue(x, y);
  11110. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11111. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11112. return angle;
  11113. }
  11114. randomNum(a, b) {
  11115. return a + Math.floor((b - a + 1) * Math.random());
  11116. }
  11117. getRandArrEle(arr) {
  11118. return arr[Math.floor(arr.length * Math.random())];
  11119. }
  11120. getSign(val) {
  11121. return val >= 0 ? 1 : -1;
  11122. }
  11123. botherArr(arr) {
  11124. let times = arr.length + 2;
  11125. let length = arr.length;
  11126. let a;
  11127. let b;
  11128. let temp;
  11129. for (let index = 0; index < times; index++) {
  11130. a = Math.floor(Math.random() * length);
  11131. b = Math.floor(Math.random() * length);
  11132. temp = arr[a];
  11133. arr[a] = arr[b];
  11134. arr[b] = temp;
  11135. }
  11136. }
  11137. getGameIconUrl(id) {
  11138. return "ui://game/" + id;
  11139. }
  11140. getComponentUrl(id) {
  11141. return "ui://game/" + id;
  11142. }
  11143. getAnimation() {
  11144. }
  11145. judgeSkillType(type = SkillType.highSpace) {
  11146. if (this.gameMode == GameMode.classic)
  11147. return;
  11148. let gameMgr = this.gameMgr;
  11149. if (gameMgr.selfTurn) {
  11150. if (gameMgr.selfCurSkill == type) {
  11151. return true;
  11152. }
  11153. }
  11154. else {
  11155. if (gameMgr.aiCurSkill == type) {
  11156. return true;
  11157. }
  11158. }
  11159. }
  11160. ballColliHole(collider) {
  11161. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11162. xGame.common.gameMgr.isFirstInGame = false;
  11163. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11164. }
  11165. collider.owner.mySrc.checkWrongBall();
  11166. }
  11167. getArrMaxEle(arr) {
  11168. let max = -Infinity;
  11169. for (let index = 0; index < arr.length; index++) {
  11170. max = Math.max(arr[index], max);
  11171. }
  11172. return max;
  11173. }
  11174. getArrMinEle(arr) {
  11175. let min = Infinity;
  11176. for (let index = 0; index < arr.length; index++) {
  11177. min = Math.min(arr[index], min);
  11178. }
  11179. return min;
  11180. }
  11181. playRandomMutiBallBigSkillSound() {
  11182. if (Math.random() <= 0.5)
  11183. return;
  11184. let rand = this.randomNum(1, 6);
  11185. let str = "ganfa0" + rand;
  11186. xGame.soundMgr.playSound(str);
  11187. }
  11188. showOneCamera(type) {
  11189. let object = xGame.common.d3World.cameraObj;
  11190. for (const key in object) {
  11191. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11192. object[key].init();
  11193. object[key].owner.active = key == type;
  11194. }
  11195. }
  11196. }
  11197. checkBallOverBorder(x, y) {
  11198. let radius = 17;
  11199. let condition = this._checkBorder(x + radius, y) ||
  11200. this._checkBorder(x - radius, y) ||
  11201. this._checkBorder(x, y + radius) ||
  11202. this._checkBorder(x, y - radius);
  11203. if (condition) {
  11204. return true;
  11205. }
  11206. }
  11207. _checkBorder(x, y) {
  11208. let borderRect = this.d2World.borderRect;
  11209. let xOffest = 20;
  11210. let yOffest = 20;
  11211. if (y <= borderRect.y - yOffest) {
  11212. return true;
  11213. }
  11214. if (y >= borderRect.y + borderRect.height + yOffest) {
  11215. return true;
  11216. }
  11217. if (x <= borderRect.x - xOffest) {
  11218. return true;
  11219. }
  11220. if (x >= borderRect.x + borderRect.width + xOffest) {
  11221. return true;
  11222. }
  11223. }
  11224. initWeight(cfg) {
  11225. let allCfgData = { data: {}, allWeightNum: 0 };
  11226. let weightCfg = allCfgData.data;
  11227. let weight = 0;
  11228. for (const key in cfg) {
  11229. weightCfg[key] = {};
  11230. weightCfg[key].id = cfg[key].id;
  11231. weightCfg[key].minWeight = weight;
  11232. weight += cfg[key].weight;
  11233. weightCfg[key].maxWeight = weight;
  11234. }
  11235. allCfgData.allWeightNum = weight;
  11236. return allCfgData;
  11237. }
  11238. getRandomWeightData(cfg) {
  11239. let weightCfg = cfg.data;
  11240. let allWeightNum = cfg.allWeightNum;
  11241. let rand = Math.floor(Math.random() * allWeightNum);
  11242. for (const key in weightCfg) {
  11243. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11244. return weightCfg[key];
  11245. }
  11246. }
  11247. return weightCfg[1];
  11248. }
  11249. showGirlTalkPop(wordsIndex, node, msgNode) {
  11250. node.visible = true;
  11251. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11252. node.t0.play(Laya.Handler.create(this, () => {
  11253. node.visible = false;
  11254. }));
  11255. }
  11256. stopGirlPop(node) {
  11257. node.t0.stop();
  11258. node.visible = false;
  11259. }
  11260. createHead(loader, url, size = 107) {
  11261. if (Laya.Browser.name == "Browser") {
  11262. loader.url = url;
  11263. return;
  11264. }
  11265. if (Moyu.isTT) {
  11266. let localImage = new Image();
  11267. localImage.src = url;
  11268. localImage.onload = () => {
  11269. let t2d = new Laya.Texture2D();
  11270. t2d.width = size;
  11271. t2d.height = size;
  11272. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  11273. t2d.loadImageSource(localImage);
  11274. };
  11275. }
  11276. else {
  11277. console.log('zh:url=', url);
  11278. loader.url = url;
  11279. }
  11280. }
  11281. addTestCoin(num) {
  11282. DataMgr.setCoin(num);
  11283. }
  11284. addTestDiamond(num) {
  11285. DataMgr.setDiamond(num);
  11286. }
  11287. addTestSkill() {
  11288. DataMgr.setBigSkill(0, 99);
  11289. DataMgr.setBigSkill(1, 99);
  11290. DataMgr.setBigSkill(2, 99);
  11291. }
  11292. playClassicEmotion(number, x, y) {
  11293. if (this.gameMode == GameMode.bigMove)
  11294. return;
  11295. let randIndex = this.randomNum(0, 2);
  11296. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11297. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11298. if (this.gameMgr.selfTurn) {
  11299. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11300. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11301. }
  11302. else {
  11303. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11304. }
  11305. else {
  11306. if (number == this.gameMgr.blackNum) {
  11307. if (this.gameMgr.selfBallArr.length == 0) {
  11308. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11309. }
  11310. else {
  11311. }
  11312. }
  11313. else {
  11314. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11315. }
  11316. }
  11317. }
  11318. }
  11319. else {
  11320. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11321. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11322. }
  11323. else {
  11324. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11325. }
  11326. else {
  11327. if (number == this.gameMgr.blackNum) {
  11328. if (this.gameMgr.aiBallArr.length == 0) {
  11329. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11330. }
  11331. else {
  11332. }
  11333. }
  11334. else {
  11335. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11336. }
  11337. }
  11338. }
  11339. }
  11340. }
  11341. playHappySound(number) {
  11342. if (this.gameMode != GameMode.classic)
  11343. return;
  11344. if (number == 8)
  11345. return;
  11346. let play = false;
  11347. if (this.gameMgr.selfTurn) {
  11348. if (this.gameMgr.ensureBallType) {
  11349. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11350. play = true;
  11351. }
  11352. }
  11353. else {
  11354. play = true;
  11355. }
  11356. }
  11357. else {
  11358. if (this.gameMgr.ensureBallType) {
  11359. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11360. play = true;
  11361. }
  11362. }
  11363. else {
  11364. play = true;
  11365. }
  11366. }
  11367. if (play)
  11368. xGame.soundMgr.playSound("applause");
  11369. }
  11370. destroyClassicEmotion() {
  11371. if (this.gameMode == GameMode.bigMove)
  11372. return;
  11373. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11374. parent.destroyChildren();
  11375. }
  11376. playAwardSpine(x, y) {
  11377. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11378. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11379. this.awardSpine.play(data, 0, false, parent);
  11380. }
  11381. destroyAwardSpine() {
  11382. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11383. parent.destroyChildren();
  11384. }
  11385. isBlock(bx, by, hx, hy, except = null) {
  11386. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  11387. let balls = xGame.common.d2World.ballArr;
  11388. let outArr = [];
  11389. for (let index = 0; index < balls.length; index++) {
  11390. let obj = balls[index];
  11391. if (obj.number == 0)
  11392. continue;
  11393. if (obj == except)
  11394. continue;
  11395. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  11396. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  11397. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  11398. if (num >= 1)
  11399. num = 1;
  11400. if (num < 0)
  11401. continue;
  11402. let gap = Math.sin(Math.acos(num)) * dis;
  11403. if (gap < this.ballSize) {
  11404. outArr.push({
  11405. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  11406. disHon: Math.cos(Math.acos(num)) * dis,
  11407. disVer: Math.sin(Math.acos(num)) * dis,
  11408. src: balls[index],
  11409. dir: this.tempDir1
  11410. });
  11411. }
  11412. }
  11413. if (outArr.length > 0) {
  11414. outArr.sort((a, b) => { return a.dis - b.dis; });
  11415. return outArr[0];
  11416. }
  11417. }
  11418. AngleBetween(vector1, vector2) {
  11419. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  11420. return rad * (180 / Math.PI);
  11421. }
  11422. getSecretaryScale() {
  11423. if (this.secretary.spineName == "mishu") {
  11424. return 1.28;
  11425. }
  11426. else {
  11427. return 1.024;
  11428. }
  11429. }
  11430. signAwardContainsRod(arr) {
  11431. let temp;
  11432. for (let index = 0; index < arr.length; index++) {
  11433. temp = arr[index].split('-')[0];
  11434. if (parseInt(temp) > 2) {
  11435. return true;
  11436. }
  11437. }
  11438. }
  11439. judgeSameDay() {
  11440. let lastTime = DataMgr.getSignTime();
  11441. let curTime = new Date().getTime();
  11442. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  11443. return true;
  11444. }
  11445. return false;
  11446. }
  11447. getAward(arr, callback) {
  11448. let showTriple = arr[0].type <= 2;
  11449. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  11450. let temp;
  11451. for (let index = 0; index < arr.length; index++) {
  11452. temp = arr[index];
  11453. switch (temp.type) {
  11454. case 1:
  11455. this.playObjFlyAnim(temp.num, temp.type);
  11456. break;
  11457. case 2:
  11458. this.playObjFlyAnim(temp.num, temp.type);
  11459. break;
  11460. case 3:
  11461. case 4:
  11462. case 5:
  11463. case 6:
  11464. DataMgr.setBallRod(temp.type - 2, 1);
  11465. DataMgr.setCurBallRod(temp.type - 2);
  11466. break;
  11467. default:
  11468. break;
  11469. }
  11470. }
  11471. callback && callback(watchVideo);
  11472. });
  11473. }
  11474. getMoneyNode() {
  11475. let moneyNode;
  11476. let sign = xGame.uiMgr.getUI(UISign);
  11477. let draw = xGame.uiMgr.getUI(UIDraw);
  11478. let end = xGame.uiMgr.getUI(UIGameEnd);
  11479. let skill = xGame.uiMgr.getUI(UISkill);
  11480. if (sign && !sign.isHide)
  11481. moneyNode = sign.ui.moneyNode;
  11482. if (draw && !draw.isHide)
  11483. moneyNode = draw.ui.moneyNode;
  11484. if (end && !end.isHide)
  11485. moneyNode = end.ui.moneyNode;
  11486. if (skill && !skill.isHide)
  11487. moneyNode = skill.ui.moneyNode;
  11488. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11489. let main = xGame.uiMgr.getUI(UIMain);
  11490. if (condition1 && main && !main.isHide) {
  11491. moneyNode = main.ui.moneyNode;
  11492. }
  11493. return moneyNode;
  11494. }
  11495. playObjFlyAnim(num, type, callback = null) {
  11496. this.stPos.x = Laya.stage.width / 2;
  11497. this.stPos.y = Laya.stage.height / 2;
  11498. let moneyNode = this.getMoneyNode();
  11499. switch (type) {
  11500. case Prop.diamond:
  11501. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11502. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11503. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11504. this.edPos.x /= 2;
  11505. this.edPos.y /= 2;
  11506. break;
  11507. case Prop.coin:
  11508. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11509. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11510. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11511. this.edPos.x /= 2;
  11512. this.edPos.y /= 2;
  11513. break;
  11514. default:
  11515. break;
  11516. }
  11517. xGame.soundMgr.playSound("coinbag");
  11518. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11519. switch (type) {
  11520. case Prop.diamond:
  11521. DataMgr.setDiamond(num);
  11522. break;
  11523. case Prop.coin:
  11524. DataMgr.setCoin(num);
  11525. break;
  11526. default:
  11527. break;
  11528. }
  11529. callback && callback();
  11530. });
  11531. }
  11532. autoPopUIView() {
  11533. let arr = [];
  11534. let sign = this.judgeSameDay() ? false : true;
  11535. if (sign)
  11536. arr.push("sign");
  11537. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11538. if (draw)
  11539. arr.push("draw");
  11540. if (arr.length <= 0)
  11541. return;
  11542. let str = this.getRandArrEle(arr);
  11543. switch (str) {
  11544. case "sign":
  11545. xGame.uiMgr.Show(UISign);
  11546. break;
  11547. case "draw":
  11548. xGame.uiMgr.Show(UIDraw);
  11549. break;
  11550. default:
  11551. break;
  11552. }
  11553. }
  11554. getMSTime(time) {
  11555. let min = Math.floor(time / 60);
  11556. let sec = Math.floor((time - min * 60));
  11557. if (sec < 10)
  11558. sec = "0" + sec;
  11559. if (min < 10)
  11560. min = "0" + min;
  11561. return `${min}:${sec}`;
  11562. }
  11563. testPower() {
  11564. DataMgr.setPower(0, false);
  11565. }
  11566. getAllStarNum() {
  11567. let data = DataMgr.getPlaceBallLevelList();
  11568. let out = 0;
  11569. for (let index = 0; index < data.length; index++) {
  11570. out += data[index].star;
  11571. }
  11572. return out;
  11573. }
  11574. recoverCameraView() {
  11575. Laya.timer.once(900, this, () => {
  11576. xGame.common.showOneCamera("mainCamera");
  11577. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11578. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11579. xGame.common.gameUI.ui.border.alpha = 0;
  11580. if (Laya.physicsTimer.scale < 1) {
  11581. Laya.physicsTimer.scale = 1;
  11582. }
  11583. }
  11584. });
  11585. }
  11586. getClassicLevel() {
  11587. let successTimes = DataMgr.getClassicTimes();
  11588. let needKey = "";
  11589. let lastKey = "";
  11590. let cfg = cfgTable.classictimesData;
  11591. let data;
  11592. for (const key in cfg) {
  11593. data = cfg[key];
  11594. if (successTimes <= data.times) {
  11595. needKey = key;
  11596. }
  11597. lastKey = key;
  11598. }
  11599. if (needKey == "")
  11600. needKey = lastKey;
  11601. return cfg[needKey];
  11602. }
  11603. }
  11604. Common._instance = null;
  11605. class ui_Component92 extends fgui.GComponent {
  11606. static createInstance() {
  11607. return (fgui.UIPackage.createObject("game", "Component92"));
  11608. }
  11609. onConstruct() {
  11610. this.n0 = (this.getChild("n0"));
  11611. }
  11612. }
  11613. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11614. class ui_Component129 extends fgui.GProgressBar {
  11615. static createInstance() {
  11616. return (fgui.UIPackage.createObject("game", "Component129"));
  11617. }
  11618. onConstruct() {
  11619. this.bar_v = (this.getChild("bar_v"));
  11620. this.n84 = (this.getChild("n84"));
  11621. }
  11622. }
  11623. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11624. class ui_Component130 extends fgui.GComponent {
  11625. static createInstance() {
  11626. return (fgui.UIPackage.createObject("game", "Component130"));
  11627. }
  11628. onConstruct() {
  11629. this.ani = (this.getChild("ani"));
  11630. this.t0 = this.getTransition("t0");
  11631. }
  11632. }
  11633. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11634. class ui_powerEft extends fgui.GComponent {
  11635. static createInstance() {
  11636. return (fgui.UIPackage.createObject("game", "powerEft"));
  11637. }
  11638. onConstruct() {
  11639. this.ani = (this.getChild("ani"));
  11640. this.n88 = (this.getChild("n88"));
  11641. this.n89 = (this.getChild("n89"));
  11642. }
  11643. }
  11644. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11645. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11646. static createInstance() {
  11647. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11648. }
  11649. onConstruct() {
  11650. this.c1 = this.getController("c1");
  11651. this.n2 = (this.getChild("n2"));
  11652. this.n22 = (this.getChild("n22"));
  11653. this.n23 = (this.getChild("n23"));
  11654. this.n15 = (this.getChild("n15"));
  11655. this.challenge = (this.getChild("challenge"));
  11656. this.n17 = (this.getChild("n17"));
  11657. this.n3 = (this.getChild("n3"));
  11658. this.starNode = (this.getChild("starNode"));
  11659. this.levelTxt = (this.getChild("levelTxt"));
  11660. this.n14 = (this.getChild("n14"));
  11661. this.n19 = (this.getChild("n19"));
  11662. this.n20 = (this.getChild("n20"));
  11663. this.n21 = (this.getChild("n21"));
  11664. this.special = (this.getChild("special"));
  11665. }
  11666. }
  11667. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11668. class ui_Component79 extends fgui.GComponent {
  11669. static createInstance() {
  11670. return (fgui.UIPackage.createObject("game", "Component79"));
  11671. }
  11672. onConstruct() {
  11673. this.c1 = this.getController("c1");
  11674. this.n7 = (this.getChild("n7"));
  11675. this.n8 = (this.getChild("n8"));
  11676. this.n9 = (this.getChild("n9"));
  11677. this.n10 = (this.getChild("n10"));
  11678. this.n11 = (this.getChild("n11"));
  11679. this.n12 = (this.getChild("n12"));
  11680. }
  11681. }
  11682. ui_Component79.URL = "ui://isxx5ak7avag477";
  11683. class ui_Component80 extends fgui.GComponent {
  11684. static createInstance() {
  11685. return (fgui.UIPackage.createObject("game", "Component80"));
  11686. }
  11687. onConstruct() {
  11688. this.n0 = (this.getChild("n0"));
  11689. this.n1 = (this.getChild("n1"));
  11690. this.myList = (this.getChild("myList"));
  11691. this.t0 = this.getTransition("t0");
  11692. }
  11693. }
  11694. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11695. class ui_SignNormal extends fgui.GComponent {
  11696. static createInstance() {
  11697. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11698. }
  11699. onConstruct() {
  11700. this.c1 = this.getController("c1");
  11701. this.n7 = (this.getChild("n7"));
  11702. this.n15 = (this.getChild("n15"));
  11703. this.titleTxt = (this.getChild("titleTxt"));
  11704. this.n8 = (this.getChild("n8"));
  11705. this.myIcon = (this.getChild("myIcon"));
  11706. this.numTxt = (this.getChild("numTxt"));
  11707. this.n12 = (this.getChild("n12"));
  11708. this.n13 = (this.getChild("n13"));
  11709. this.n17 = (this.getChild("n17"));
  11710. this.n14 = (this.getChild("n14"));
  11711. }
  11712. }
  11713. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11714. class ui_screenNode extends fgui.GComponent {
  11715. static createInstance() {
  11716. return (fgui.UIPackage.createObject("game", "screenNode"));
  11717. }
  11718. onConstruct() {
  11719. this.n9 = (this.getChild("n9"));
  11720. this.screenImg = (this.getChild("screenImg"));
  11721. }
  11722. }
  11723. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11724. class ui_GetAwrad_com1 extends fgui.GComponent {
  11725. static createInstance() {
  11726. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11727. }
  11728. onConstruct() {
  11729. this.n38 = (this.getChild("n38"));
  11730. this.n39 = (this.getChild("n39"));
  11731. this.n40 = (this.getChild("n40"));
  11732. this.t0 = this.getTransition("t0");
  11733. this.t1 = this.getTransition("t1");
  11734. }
  11735. }
  11736. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11737. class ui_GetAwrad_com2 extends fgui.GComponent {
  11738. static createInstance() {
  11739. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11740. }
  11741. onConstruct() {
  11742. this.n39 = (this.getChild("n39"));
  11743. this.n40 = (this.getChild("n40"));
  11744. this.t0 = this.getTransition("t0");
  11745. }
  11746. }
  11747. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11748. class ui_Component128 extends fgui.GComponent {
  11749. static createInstance() {
  11750. return (fgui.UIPackage.createObject("game", "Component128"));
  11751. }
  11752. onConstruct() {
  11753. this.n38 = (this.getChild("n38"));
  11754. this.n40 = (this.getChild("n40"));
  11755. }
  11756. }
  11757. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11758. class ui_Component100_1 extends fgui.GComponent {
  11759. static createInstance() {
  11760. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11761. }
  11762. onConstruct() {
  11763. this.myNode = (this.getChild("myNode"));
  11764. this.t0 = this.getTransition("t0");
  11765. }
  11766. }
  11767. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11768. class ui_Component142 extends fgui.GComponent {
  11769. static createInstance() {
  11770. return (fgui.UIPackage.createObject("game", "Component142"));
  11771. }
  11772. onConstruct() {
  11773. this.n41 = (this.getChild("n41"));
  11774. this.n42 = (this.getChild("n42"));
  11775. }
  11776. }
  11777. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11778. class ui_main_guang extends fgui.GComponent {
  11779. static createInstance() {
  11780. return (fgui.UIPackage.createObject("game", "main_guang"));
  11781. }
  11782. onConstruct() {
  11783. this.n1 = (this.getChild("n1"));
  11784. this.n2 = (this.getChild("n2"));
  11785. this.n3 = (this.getChild("n3"));
  11786. this.n4 = (this.getChild("n4"));
  11787. this.n5 = (this.getChild("n5"));
  11788. this.n6 = (this.getChild("n6"));
  11789. this.n8 = (this.getChild("n8"));
  11790. this.t0 = this.getTransition("t0");
  11791. }
  11792. }
  11793. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11794. class ui_try_com1 extends fgui.GComponent {
  11795. static createInstance() {
  11796. return (fgui.UIPackage.createObject("game", "try_com1"));
  11797. }
  11798. onConstruct() {
  11799. this.c1 = this.getController("c1");
  11800. this.n0 = (this.getChild("n0"));
  11801. this.n2 = (this.getChild("n2"));
  11802. this.cancelBtn = (this.getChild("cancelBtn"));
  11803. this.videoBtn = (this.getChild("videoBtn"));
  11804. this.n9 = (this.getChild("n9"));
  11805. this.n24 = (this.getChild("n24"));
  11806. this.titleTxt = (this.getChild("titleTxt"));
  11807. this.n32 = (this.getChild("n32"));
  11808. this.n29 = (this.getChild("n29"));
  11809. this.n36 = (this.getChild("n36"));
  11810. this.txtTime = (this.getChild("txtTime"));
  11811. this.t0 = this.getTransition("t0");
  11812. }
  11813. }
  11814. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11815. class ui_try_com2 extends fgui.GComponent {
  11816. static createInstance() {
  11817. return (fgui.UIPackage.createObject("game", "try_com2"));
  11818. }
  11819. onConstruct() {
  11820. this.skillicon = (this.getChild("skillicon"));
  11821. this.n35 = (this.getChild("n35"));
  11822. this.n31 = (this.getChild("n31"));
  11823. this.n32 = (this.getChild("n32"));
  11824. this.n33 = (this.getChild("n33"));
  11825. this.n34 = (this.getChild("n34"));
  11826. }
  11827. }
  11828. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11829. class ui_try_com3 extends fgui.GComponent {
  11830. static createInstance() {
  11831. return (fgui.UIPackage.createObject("game", "try_com3"));
  11832. }
  11833. onConstruct() {
  11834. this.n33 = (this.getChild("n33"));
  11835. this.n34 = (this.getChild("n34"));
  11836. this.n35 = (this.getChild("n35"));
  11837. this.t0 = this.getTransition("t0");
  11838. }
  11839. }
  11840. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11841. class ui_huihe1 extends fgui.GComponent {
  11842. static createInstance() {
  11843. return (fgui.UIPackage.createObject("game", "huihe1"));
  11844. }
  11845. onConstruct() {
  11846. this.n0 = (this.getChild("n0"));
  11847. this.n1 = (this.getChild("n1"));
  11848. this.t0 = this.getTransition("t0");
  11849. }
  11850. }
  11851. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11852. class ui_huihe2 extends fgui.GComponent {
  11853. static createInstance() {
  11854. return (fgui.UIPackage.createObject("game", "huihe2"));
  11855. }
  11856. onConstruct() {
  11857. this.n0 = (this.getChild("n0"));
  11858. this.n1 = (this.getChild("n1"));
  11859. this.t0 = this.getTransition("t0");
  11860. }
  11861. }
  11862. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11863. class ui_Component143 extends fgui.GComponent {
  11864. static createInstance() {
  11865. return (fgui.UIPackage.createObject("game", "Component143"));
  11866. }
  11867. onConstruct() {
  11868. this.n3 = (this.getChild("n3"));
  11869. this.n4 = (this.getChild("n4"));
  11870. this.n5 = (this.getChild("n5"));
  11871. this.n6 = (this.getChild("n6"));
  11872. this.n7 = (this.getChild("n7"));
  11873. this.n8 = (this.getChild("n8"));
  11874. this.n9 = (this.getChild("n9"));
  11875. this.n10 = (this.getChild("n10"));
  11876. this.t0 = this.getTransition("t0");
  11877. }
  11878. }
  11879. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11880. class ui_dh_jingbi2 extends fgui.GComponent {
  11881. static createInstance() {
  11882. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11883. }
  11884. onConstruct() {
  11885. this.n0 = (this.getChild("n0"));
  11886. this.n1 = (this.getChild("n1"));
  11887. this.n2 = (this.getChild("n2"));
  11888. this.n3 = (this.getChild("n3"));
  11889. this.n4 = (this.getChild("n4"));
  11890. this.n5 = (this.getChild("n5"));
  11891. this.n6 = (this.getChild("n6"));
  11892. this.n8 = (this.getChild("n8"));
  11893. this.n10 = (this.getChild("n10"));
  11894. this.t0 = this.getTransition("t0");
  11895. }
  11896. }
  11897. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11898. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11899. static createInstance() {
  11900. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11901. }
  11902. onConstruct() {
  11903. this.n1 = (this.getChild("n1"));
  11904. this.n4 = (this.getChild("n4"));
  11905. this.t0 = this.getTransition("t0");
  11906. }
  11907. }
  11908. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11909. class ui_dh_jingbi3 extends fgui.GComponent {
  11910. static createInstance() {
  11911. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11912. }
  11913. onConstruct() {
  11914. this.n0 = (this.getChild("n0"));
  11915. this.n1 = (this.getChild("n1"));
  11916. this.n2 = (this.getChild("n2"));
  11917. this.n3 = (this.getChild("n3"));
  11918. this.n4 = (this.getChild("n4"));
  11919. this.n5 = (this.getChild("n5"));
  11920. this.n6 = (this.getChild("n6"));
  11921. this.n8 = (this.getChild("n8"));
  11922. this.n10 = (this.getChild("n10"));
  11923. this.t0 = this.getTransition("t0");
  11924. }
  11925. }
  11926. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11927. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11928. static createInstance() {
  11929. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11930. }
  11931. onConstruct() {
  11932. this.n3 = (this.getChild("n3"));
  11933. this.n1 = (this.getChild("n1"));
  11934. this.t0 = this.getTransition("t0");
  11935. }
  11936. }
  11937. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11938. class ui_hb_jinbi1 extends fgui.GButton {
  11939. static createInstance() {
  11940. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11941. }
  11942. onConstruct() {
  11943. this.n20 = (this.getChild("n20"));
  11944. this.n25 = (this.getChild("n25"));
  11945. this.coinTxt = (this.getChild("coinTxt"));
  11946. this.n28 = (this.getChild("n28"));
  11947. this.n32 = (this.getChild("n32"));
  11948. this.n38 = (this.getChild("n38"));
  11949. this.n45 = (this.getChild("n45"));
  11950. this.getTips = (this.getChild("getTips"));
  11951. this.n39 = (this.getChild("n39"));
  11952. this.diamondTxt = (this.getChild("diamondTxt"));
  11953. this.n41 = (this.getChild("n41"));
  11954. this.n42 = (this.getChild("n42"));
  11955. this.n46 = (this.getChild("n46"));
  11956. this.n47 = (this.getChild("n47"));
  11957. this.n48 = (this.getChild("n48"));
  11958. this.t0 = this.getTransition("t0");
  11959. }
  11960. }
  11961. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11962. class ui_hb_jinbi2 extends fgui.GButton {
  11963. static createInstance() {
  11964. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11965. }
  11966. onConstruct() {
  11967. this.n20 = (this.getChild("n20"));
  11968. this.n25 = (this.getChild("n25"));
  11969. this.coinTxt = (this.getChild("coinTxt"));
  11970. this.n28 = (this.getChild("n28"));
  11971. this.n32 = (this.getChild("n32"));
  11972. this.n38 = (this.getChild("n38"));
  11973. this.n39 = (this.getChild("n39"));
  11974. this.diamondTxt = (this.getChild("diamondTxt"));
  11975. this.n41 = (this.getChild("n41"));
  11976. this.n42 = (this.getChild("n42"));
  11977. this.n43 = (this.getChild("n43"));
  11978. this.n44 = (this.getChild("n44"));
  11979. this.n45 = (this.getChild("n45"));
  11980. this.t0 = this.getTransition("t0");
  11981. }
  11982. }
  11983. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11984. class ui_hb_jinbi3 extends fgui.GButton {
  11985. static createInstance() {
  11986. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11987. }
  11988. onConstruct() {
  11989. this.n20 = (this.getChild("n20"));
  11990. this.n25 = (this.getChild("n25"));
  11991. this.coinTxt = (this.getChild("coinTxt"));
  11992. this.n28 = (this.getChild("n28"));
  11993. this.n32 = (this.getChild("n32"));
  11994. this.n38 = (this.getChild("n38"));
  11995. this.n39 = (this.getChild("n39"));
  11996. this.diamondTxt = (this.getChild("diamondTxt"));
  11997. this.n41 = (this.getChild("n41"));
  11998. this.n42 = (this.getChild("n42"));
  11999. this.n43 = (this.getChild("n43"));
  12000. this.n44 = (this.getChild("n44"));
  12001. this.n45 = (this.getChild("n45"));
  12002. this.t0 = this.getTransition("t0");
  12003. }
  12004. }
  12005. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  12006. class ui_Component104 extends fgui.GComponent {
  12007. static createInstance() {
  12008. return (fgui.UIPackage.createObject("game", "Component104"));
  12009. }
  12010. onConstruct() {
  12011. this.c1 = this.getController("c1");
  12012. this.n12 = (this.getChild("n12"));
  12013. this.coinBtn = (this.getChild("coinBtn"));
  12014. this.diamondBtn = (this.getChild("diamondBtn"));
  12015. this.node3 = (this.getChild("node3"));
  12016. this.node4 = (this.getChild("node4"));
  12017. this.node5 = (this.getChild("node5"));
  12018. this.node1 = (this.getChild("node1"));
  12019. this.node2 = (this.getChild("node2"));
  12020. this.node6 = (this.getChild("node6"));
  12021. this.t0 = this.getTransition("t0");
  12022. }
  12023. }
  12024. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  12025. class ui_Component105 extends fgui.GButton {
  12026. static createInstance() {
  12027. return (fgui.UIPackage.createObject("game", "Component105"));
  12028. }
  12029. onConstruct() {
  12030. this.c1 = this.getController("c1");
  12031. this.n49 = (this.getChild("n49"));
  12032. this.n18 = (this.getChild("n18"));
  12033. this.n46 = (this.getChild("n46"));
  12034. this.n48 = (this.getChild("n48"));
  12035. }
  12036. }
  12037. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  12038. class ui_Component106 extends fgui.GButton {
  12039. static createInstance() {
  12040. return (fgui.UIPackage.createObject("game", "Component106"));
  12041. }
  12042. onConstruct() {
  12043. this.c1 = this.getController("c1");
  12044. this.n49 = (this.getChild("n49"));
  12045. this.n18 = (this.getChild("n18"));
  12046. this.n46 = (this.getChild("n46"));
  12047. this.n48 = (this.getChild("n48"));
  12048. }
  12049. }
  12050. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  12051. class ui_hb_zs1 extends fgui.GButton {
  12052. static createInstance() {
  12053. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  12054. }
  12055. onConstruct() {
  12056. this.c1 = this.getController("c1");
  12057. this.n20 = (this.getChild("n20"));
  12058. this.n21 = (this.getChild("n21"));
  12059. this.n26 = (this.getChild("n26"));
  12060. this.n27 = (this.getChild("n27"));
  12061. this.shareTxt = (this.getChild("shareTxt"));
  12062. this.n32 = (this.getChild("n32"));
  12063. this.n38 = (this.getChild("n38"));
  12064. this.n39 = (this.getChild("n39"));
  12065. this.n44 = (this.getChild("n44"));
  12066. this.diamondTxt = (this.getChild("diamondTxt"));
  12067. this.n41 = (this.getChild("n41"));
  12068. this.n45 = (this.getChild("n45"));
  12069. this.n47 = (this.getChild("n47"));
  12070. this.n48 = (this.getChild("n48"));
  12071. this.randTxt = (this.getChild("randTxt"));
  12072. this.n50 = (this.getChild("n50"));
  12073. this.t0 = this.getTransition("t0");
  12074. }
  12075. }
  12076. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  12077. class ui_dh_zs1 extends fgui.GComponent {
  12078. static createInstance() {
  12079. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  12080. }
  12081. onConstruct() {
  12082. this.n10 = (this.getChild("n10"));
  12083. this.n9 = (this.getChild("n9"));
  12084. this.n1 = (this.getChild("n1"));
  12085. this.n2 = (this.getChild("n2"));
  12086. this.n3 = (this.getChild("n3"));
  12087. this.n4 = (this.getChild("n4"));
  12088. this.n5 = (this.getChild("n5"));
  12089. this.n6 = (this.getChild("n6"));
  12090. this.n8 = (this.getChild("n8"));
  12091. this.n11 = (this.getChild("n11"));
  12092. this.t0 = this.getTransition("t0");
  12093. }
  12094. }
  12095. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  12096. class ui_dh_zs1_1 extends fgui.GComponent {
  12097. static createInstance() {
  12098. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  12099. }
  12100. onConstruct() {
  12101. this.n3 = (this.getChild("n3"));
  12102. this.n1 = (this.getChild("n1"));
  12103. this.t0 = this.getTransition("t0");
  12104. }
  12105. }
  12106. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  12107. class ui_hb_zs2 extends fgui.GButton {
  12108. static createInstance() {
  12109. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  12110. }
  12111. onConstruct() {
  12112. this.n20 = (this.getChild("n20"));
  12113. this.n21 = (this.getChild("n21"));
  12114. this.n26 = (this.getChild("n26"));
  12115. this.n27 = (this.getChild("n27"));
  12116. this.n32 = (this.getChild("n32"));
  12117. this.n38 = (this.getChild("n38"));
  12118. this.n39 = (this.getChild("n39"));
  12119. this.n44 = (this.getChild("n44"));
  12120. this.diamondTxt = (this.getChild("diamondTxt"));
  12121. this.n41 = (this.getChild("n41"));
  12122. this.n45 = (this.getChild("n45"));
  12123. this.t0 = this.getTransition("t0");
  12124. }
  12125. }
  12126. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  12127. class ui_hb_zs3 extends fgui.GButton {
  12128. static createInstance() {
  12129. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  12130. }
  12131. onConstruct() {
  12132. this.n20 = (this.getChild("n20"));
  12133. this.n21 = (this.getChild("n21"));
  12134. this.n26 = (this.getChild("n26"));
  12135. this.n27 = (this.getChild("n27"));
  12136. this.n32 = (this.getChild("n32"));
  12137. this.n38 = (this.getChild("n38"));
  12138. this.n47 = (this.getChild("n47"));
  12139. this.t0 = this.getTransition("t0");
  12140. }
  12141. }
  12142. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12143. class ui_dh_zs2 extends fgui.GComponent {
  12144. static createInstance() {
  12145. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12146. }
  12147. onConstruct() {
  12148. this.n10 = (this.getChild("n10"));
  12149. this.n9 = (this.getChild("n9"));
  12150. this.n1 = (this.getChild("n1"));
  12151. this.n2 = (this.getChild("n2"));
  12152. this.n3 = (this.getChild("n3"));
  12153. this.n4 = (this.getChild("n4"));
  12154. this.n5 = (this.getChild("n5"));
  12155. this.n6 = (this.getChild("n6"));
  12156. this.n8 = (this.getChild("n8"));
  12157. this.n11 = (this.getChild("n11"));
  12158. this.t0 = this.getTransition("t0");
  12159. }
  12160. }
  12161. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12162. class ui_dh_zs2_1 extends fgui.GComponent {
  12163. static createInstance() {
  12164. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12165. }
  12166. onConstruct() {
  12167. this.n3 = (this.getChild("n3"));
  12168. this.n1 = (this.getChild("n1"));
  12169. this.t0 = this.getTransition("t0");
  12170. }
  12171. }
  12172. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12173. class ui_dh_zs3 extends fgui.GComponent {
  12174. static createInstance() {
  12175. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12176. }
  12177. onConstruct() {
  12178. this.n10 = (this.getChild("n10"));
  12179. this.n9 = (this.getChild("n9"));
  12180. this.n1 = (this.getChild("n1"));
  12181. this.n2 = (this.getChild("n2"));
  12182. this.n3 = (this.getChild("n3"));
  12183. this.n4 = (this.getChild("n4"));
  12184. this.n5 = (this.getChild("n5"));
  12185. this.n6 = (this.getChild("n6"));
  12186. this.n8 = (this.getChild("n8"));
  12187. this.n11 = (this.getChild("n11"));
  12188. this.t0 = this.getTransition("t0");
  12189. }
  12190. }
  12191. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12192. class ui_dh_zs3_1 extends fgui.GComponent {
  12193. static createInstance() {
  12194. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12195. }
  12196. onConstruct() {
  12197. this.n3 = (this.getChild("n3"));
  12198. this.n1 = (this.getChild("n1"));
  12199. this.t0 = this.getTransition("t0");
  12200. }
  12201. }
  12202. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12203. class ui_Component107 extends fgui.GComponent {
  12204. static createInstance() {
  12205. return (fgui.UIPackage.createObject("game", "Component107"));
  12206. }
  12207. onConstruct() {
  12208. this.n18 = (this.getChild("n18"));
  12209. this.n19 = (this.getChild("n19"));
  12210. this.n20 = (this.getChild("n20"));
  12211. this.n21 = (this.getChild("n21"));
  12212. this.n22 = (this.getChild("n22"));
  12213. this.levelTxt = (this.getChild("levelTxt"));
  12214. this.t0 = this.getTransition("t0");
  12215. }
  12216. }
  12217. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12218. class ui_box_com1 extends fgui.GComponent {
  12219. static createInstance() {
  12220. return (fgui.UIPackage.createObject("game", "box_com1"));
  12221. }
  12222. onConstruct() {
  12223. this.n14 = (this.getChild("n14"));
  12224. this.n6 = (this.getChild("n6"));
  12225. this.t0 = this.getTransition("t0");
  12226. }
  12227. }
  12228. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12229. class ui_box_com2 extends fgui.GProgressBar {
  12230. static createInstance() {
  12231. return (fgui.UIPackage.createObject("game", "box_com2"));
  12232. }
  12233. onConstruct() {
  12234. this.bg0 = (this.getChild("bg0"));
  12235. this.bg = (this.getChild("bg"));
  12236. this.bar = (this.getChild("bar"));
  12237. this.n7 = (this.getChild("n7"));
  12238. this.n8 = (this.getChild("n8"));
  12239. this.n10 = (this.getChild("n10"));
  12240. this.n11 = (this.getChild("n11"));
  12241. this.n12 = (this.getChild("n12"));
  12242. }
  12243. }
  12244. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12245. class ui_box_com4 extends fgui.GComponent {
  12246. static createInstance() {
  12247. return (fgui.UIPackage.createObject("game", "box_com4"));
  12248. }
  12249. onConstruct() {
  12250. this.n8 = (this.getChild("n8"));
  12251. this.t0 = this.getTransition("t0");
  12252. }
  12253. }
  12254. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12255. class ui_box_com3 extends fgui.GComponent {
  12256. static createInstance() {
  12257. return (fgui.UIPackage.createObject("game", "box_com3"));
  12258. }
  12259. onConstruct() {
  12260. this.n2 = (this.getChild("n2"));
  12261. this.n3 = (this.getChild("n3"));
  12262. this.n4 = (this.getChild("n4"));
  12263. this.n5 = (this.getChild("n5"));
  12264. this.t0 = this.getTransition("t0");
  12265. this.t1 = this.getTransition("t1");
  12266. }
  12267. }
  12268. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12269. class ui_Component97 extends fgui.GComponent {
  12270. static createInstance() {
  12271. return (fgui.UIPackage.createObject("game", "Component97"));
  12272. }
  12273. onConstruct() {
  12274. this.c1 = this.getController("c1");
  12275. this.n46 = (this.getChild("n46"));
  12276. this.diamondNode = (this.getChild("diamondNode"));
  12277. this.coinNode = (this.getChild("coinNode"));
  12278. this.t0 = this.getTransition("t0");
  12279. }
  12280. }
  12281. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12282. class ui_Component98 extends fgui.GButton {
  12283. static createInstance() {
  12284. return (fgui.UIPackage.createObject("game", "Component98"));
  12285. }
  12286. onConstruct() {
  12287. this.n8 = (this.getChild("n8"));
  12288. this.n40 = (this.getChild("n40"));
  12289. }
  12290. }
  12291. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12292. class ui_Component28_11 extends fgui.GButton {
  12293. static createInstance() {
  12294. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12295. }
  12296. onConstruct() {
  12297. this.c1 = this.getController("c1");
  12298. this.n12 = (this.getChild("n12"));
  12299. this.n17 = (this.getChild("n17"));
  12300. this.n13 = (this.getChild("n13"));
  12301. this.diamondTxt = (this.getChild("diamondTxt"));
  12302. this.n15 = (this.getChild("n15"));
  12303. this.n16 = (this.getChild("n16"));
  12304. }
  12305. }
  12306. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12307. class ui_Component58_11 extends fgui.GComponent {
  12308. static createInstance() {
  12309. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12310. }
  12311. onConstruct() {
  12312. this.n23 = (this.getChild("n23"));
  12313. this.n41 = (this.getChild("n41"));
  12314. this.myList = (this.getChild("myList"));
  12315. this.n45 = (this.getChild("n45"));
  12316. this.n44 = (this.getChild("n44"));
  12317. this.t0 = this.getTransition("t0");
  12318. }
  12319. }
  12320. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12321. class ui_Component100 extends fgui.GComponent {
  12322. static createInstance() {
  12323. return (fgui.UIPackage.createObject("game", "Component100"));
  12324. }
  12325. onConstruct() {
  12326. this.c1 = this.getController("c1");
  12327. this.n75 = (this.getChild("n75"));
  12328. this.n76 = (this.getChild("n76"));
  12329. this.n80 = (this.getChild("n80"));
  12330. this.txt = (this.getChild("txt"));
  12331. this.spineRoot = (this.getChild("spineRoot"));
  12332. }
  12333. }
  12334. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12335. class ui_Component101 extends fgui.GComponent {
  12336. static createInstance() {
  12337. return (fgui.UIPackage.createObject("game", "Component101"));
  12338. }
  12339. onConstruct() {
  12340. this.c1 = this.getController("c1");
  12341. this.n36 = (this.getChild("n36"));
  12342. this.n35 = (this.getChild("n35"));
  12343. this.n33 = (this.getChild("n33"));
  12344. this.n34 = (this.getChild("n34"));
  12345. }
  12346. }
  12347. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12348. class ui_Component53 extends fgui.GComponent {
  12349. static createInstance() {
  12350. return (fgui.UIPackage.createObject("game", "Component53"));
  12351. }
  12352. onConstruct() {
  12353. this.n0 = (this.getChild("n0"));
  12354. this.n1 = (this.getChild("n1"));
  12355. this.n2 = (this.getChild("n2"));
  12356. this.n3 = (this.getChild("n3"));
  12357. this.n4 = (this.getChild("n4"));
  12358. this.n5 = (this.getChild("n5"));
  12359. this.n6 = (this.getChild("n6"));
  12360. this.n7 = (this.getChild("n7"));
  12361. this.n8 = (this.getChild("n8"));
  12362. this.n9 = (this.getChild("n9"));
  12363. this.n10 = (this.getChild("n10"));
  12364. this.n11 = (this.getChild("n11"));
  12365. this.n12 = (this.getChild("n12"));
  12366. this.n13 = (this.getChild("n13"));
  12367. this.n14 = (this.getChild("n14"));
  12368. this.n15 = (this.getChild("n15"));
  12369. this.n16 = (this.getChild("n16"));
  12370. this.n19 = (this.getChild("n19"));
  12371. this.n20 = (this.getChild("n20"));
  12372. this.n21 = (this.getChild("n21"));
  12373. this.n22 = (this.getChild("n22"));
  12374. this.n23 = (this.getChild("n23"));
  12375. this.n24 = (this.getChild("n24"));
  12376. this.n25 = (this.getChild("n25"));
  12377. this.n26 = (this.getChild("n26"));
  12378. this.n27 = (this.getChild("n27"));
  12379. this.n28 = (this.getChild("n28"));
  12380. this.n29 = (this.getChild("n29"));
  12381. this.n30 = (this.getChild("n30"));
  12382. this.n31 = (this.getChild("n31"));
  12383. this.n32 = (this.getChild("n32"));
  12384. this.n33 = (this.getChild("n33"));
  12385. this.n34 = (this.getChild("n34"));
  12386. this.n35 = (this.getChild("n35"));
  12387. this.t0 = this.getTransition("t0");
  12388. }
  12389. }
  12390. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12391. class ui_Component58 extends fgui.GComponent {
  12392. static createInstance() {
  12393. return (fgui.UIPackage.createObject("game", "Component58"));
  12394. }
  12395. onConstruct() {
  12396. this.n23 = (this.getChild("n23"));
  12397. this.n41 = (this.getChild("n41"));
  12398. this.n8 = (this.getChild("n8"));
  12399. this.skillList = (this.getChild("skillList"));
  12400. this.t0 = this.getTransition("t0");
  12401. }
  12402. }
  12403. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12404. class ui_Component59 extends fgui.GComponent {
  12405. static createInstance() {
  12406. return (fgui.UIPackage.createObject("game", "Component59"));
  12407. }
  12408. onConstruct() {
  12409. this.n3 = (this.getChild("n3"));
  12410. this.msgTxt = (this.getChild("msgTxt"));
  12411. this.t0 = this.getTransition("t0");
  12412. }
  12413. }
  12414. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12415. class ui_RulerNode extends fgui.GComponent {
  12416. static createInstance() {
  12417. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12418. }
  12419. onConstruct() {
  12420. this.n6 = (this.getChild("n6"));
  12421. this.n4 = (this.getChild("n4"));
  12422. this.img1 = (this.getChild("img1"));
  12423. this.img2 = (this.getChild("img2"));
  12424. }
  12425. }
  12426. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12427. class ui_Component108 extends fgui.GComponent {
  12428. static createInstance() {
  12429. return (fgui.UIPackage.createObject("game", "Component108"));
  12430. }
  12431. onConstruct() {
  12432. this.n19 = (this.getChild("n19"));
  12433. this.t0 = this.getTransition("t0");
  12434. }
  12435. }
  12436. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12437. class ui_Component63 extends fgui.GComponent {
  12438. static createInstance() {
  12439. return (fgui.UIPackage.createObject("game", "Component63"));
  12440. }
  12441. onConstruct() {
  12442. this.n66 = (this.getChild("n66"));
  12443. this.n56 = (this.getChild("n56"));
  12444. this.n63 = (this.getChild("n63"));
  12445. this.n65 = (this.getChild("n65"));
  12446. this.t0 = this.getTransition("t0");
  12447. }
  12448. }
  12449. ui_Component63.URL = "ui://isxx5ak7h657452";
  12450. class ui_topNode extends fgui.GComponent {
  12451. static createInstance() {
  12452. return (fgui.UIPackage.createObject("game", "topNode"));
  12453. }
  12454. onConstruct() {
  12455. this.selfProgress = (this.getChild("selfProgress"));
  12456. this.aiProgress = (this.getChild("aiProgress"));
  12457. this.selfKuang = (this.getChild("selfKuang"));
  12458. this.aiKuang = (this.getChild("aiKuang"));
  12459. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12460. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12461. this.n33 = (this.getChild("n33"));
  12462. this.n34 = (this.getChild("n34"));
  12463. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12464. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12465. this.selfBallList = (this.getChild("selfBallList"));
  12466. this.aiBallList = (this.getChild("aiBallList"));
  12467. this.middleNode = (this.getChild("middleNode"));
  12468. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12469. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12470. this.scoreNode = (this.getChild("scoreNode"));
  12471. this.selfTips = (this.getChild("selfTips"));
  12472. this.aiTips = (this.getChild("aiTips"));
  12473. }
  12474. }
  12475. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12476. class ui_selfProgress extends fgui.GProgressBar {
  12477. static createInstance() {
  12478. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12479. }
  12480. onConstruct() {
  12481. this.n3 = (this.getChild("n3"));
  12482. this.bar = (this.getChild("bar"));
  12483. }
  12484. }
  12485. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12486. class ui_aiProgress extends fgui.GProgressBar {
  12487. static createInstance() {
  12488. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12489. }
  12490. onConstruct() {
  12491. this.n3 = (this.getChild("n3"));
  12492. this.bar = (this.getChild("bar"));
  12493. }
  12494. }
  12495. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12496. class ui_ballDisplay extends fgui.GComponent {
  12497. static createInstance() {
  12498. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12499. }
  12500. onConstruct() {
  12501. this.myImg = (this.getChild("myImg"));
  12502. }
  12503. }
  12504. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12505. class ui_moveNode extends fgui.GComponent {
  12506. static createInstance() {
  12507. return (fgui.UIPackage.createObject("game", "moveNode"));
  12508. }
  12509. onConstruct() {
  12510. this.n8 = (this.getChild("n8"));
  12511. this.finger = (this.getChild("finger"));
  12512. }
  12513. }
  12514. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12515. class ui_cancelBtn extends fgui.GButton {
  12516. static createInstance() {
  12517. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12518. }
  12519. onConstruct() {
  12520. this.c1 = this.getController("c1");
  12521. this.n0 = (this.getChild("n0"));
  12522. this.n1 = (this.getChild("n1"));
  12523. }
  12524. }
  12525. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12526. class ui_shareBtn extends fgui.GButton {
  12527. static createInstance() {
  12528. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12529. }
  12530. onConstruct() {
  12531. this.c1 = this.getController("c1");
  12532. this.n2 = (this.getChild("n2"));
  12533. this.n1 = (this.getChild("n1"));
  12534. this.n3 = (this.getChild("n3"));
  12535. this.n4 = (this.getChild("n4"));
  12536. this.n5 = (this.getChild("n5"));
  12537. this.n6 = (this.getChild("n6"));
  12538. }
  12539. }
  12540. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12541. class ui_share2Btn extends fgui.GButton {
  12542. static createInstance() {
  12543. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12544. }
  12545. onConstruct() {
  12546. this.n3 = (this.getChild("n3"));
  12547. }
  12548. }
  12549. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12550. class ui_rodMethodNode extends fgui.GComponent {
  12551. static createInstance() {
  12552. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12553. }
  12554. onConstruct() {
  12555. this.bg = (this.getChild("bg"));
  12556. this.dot = (this.getChild("dot"));
  12557. }
  12558. }
  12559. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12560. class ui_sureBtn extends fgui.GButton {
  12561. static createInstance() {
  12562. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12563. }
  12564. onConstruct() {
  12565. this.n2 = (this.getChild("n2"));
  12566. this.n1 = (this.getChild("n1"));
  12567. }
  12568. }
  12569. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12570. class ui_Component18 extends fgui.GComponent {
  12571. static createInstance() {
  12572. return (fgui.UIPackage.createObject("game", "Component18"));
  12573. }
  12574. onConstruct() {
  12575. this.c1 = this.getController("c1");
  12576. this.nameTxt = (this.getChild("nameTxt"));
  12577. this.headImg = (this.getChild("headImg"));
  12578. this.n24 = (this.getChild("n24"));
  12579. this.skillImg = (this.getChild("skillImg"));
  12580. this.skillTxt = (this.getChild("skillTxt"));
  12581. }
  12582. }
  12583. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12584. class ui_Component45 extends fgui.GComponent {
  12585. static createInstance() {
  12586. return (fgui.UIPackage.createObject("game", "Component45"));
  12587. }
  12588. onConstruct() {
  12589. this.c1 = this.getController("c1");
  12590. this.n40 = (this.getChild("n40"));
  12591. this.n41 = (this.getChild("n41"));
  12592. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12593. this.n42 = (this.getChild("n42"));
  12594. this.awardTxt = (this.getChild("awardTxt"));
  12595. this.n44 = (this.getChild("n44"));
  12596. this.t0 = this.getTransition("t0");
  12597. }
  12598. }
  12599. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12600. class ui_emotionDisplay extends fgui.GButton {
  12601. static createInstance() {
  12602. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12603. }
  12604. onConstruct() {
  12605. this.myIcon = (this.getChild("myIcon"));
  12606. }
  12607. }
  12608. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12609. class ui_Component49 extends fgui.GButton {
  12610. static createInstance() {
  12611. return (fgui.UIPackage.createObject("game", "Component49"));
  12612. }
  12613. onConstruct() {
  12614. this.n69 = (this.getChild("n69"));
  12615. this.n56 = (this.getChild("n56"));
  12616. }
  12617. }
  12618. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12619. class ui_Component50 extends fgui.GButton {
  12620. static createInstance() {
  12621. return (fgui.UIPackage.createObject("game", "Component50"));
  12622. }
  12623. onConstruct() {
  12624. this.n54 = (this.getChild("n54"));
  12625. this.n65 = (this.getChild("n65"));
  12626. }
  12627. }
  12628. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12629. class ui_Component51 extends fgui.GButton {
  12630. static createInstance() {
  12631. return (fgui.UIPackage.createObject("game", "Component51"));
  12632. }
  12633. onConstruct() {
  12634. this.c1 = this.getController("c1");
  12635. this.n51 = (this.getChild("n51"));
  12636. this.n54 = (this.getChild("n54"));
  12637. }
  12638. }
  12639. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12640. class ui_Button5 extends fgui.GButton {
  12641. static createInstance() {
  12642. return (fgui.UIPackage.createObject("game", "Button5"));
  12643. }
  12644. onConstruct() {
  12645. this.c1 = this.getController("c1");
  12646. this.n0 = (this.getChild("n0"));
  12647. this.n2 = (this.getChild("n2"));
  12648. }
  12649. }
  12650. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12651. class ui_Component124 extends fgui.GComponent {
  12652. static createInstance() {
  12653. return (fgui.UIPackage.createObject("game", "Component124"));
  12654. }
  12655. onConstruct() {
  12656. this.n22 = (this.getChild("n22"));
  12657. this.shareNode = (this.getChild("shareNode"));
  12658. }
  12659. }
  12660. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12661. class ui_Component125 extends fgui.GComponent {
  12662. static createInstance() {
  12663. return (fgui.UIPackage.createObject("game", "Component125"));
  12664. }
  12665. onConstruct() {
  12666. this.n29 = (this.getChild("n29"));
  12667. this.coinTxt = (this.getChild("coinTxt"));
  12668. }
  12669. }
  12670. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12671. class ui_Component52 extends fgui.GButton {
  12672. static createInstance() {
  12673. return (fgui.UIPackage.createObject("game", "Component52"));
  12674. }
  12675. onConstruct() {
  12676. this.n35 = (this.getChild("n35"));
  12677. this.n36 = (this.getChild("n36"));
  12678. }
  12679. }
  12680. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12681. class ui_drawBtn extends fgui.GButton {
  12682. static createInstance() {
  12683. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12684. }
  12685. onConstruct() {
  12686. this.c1 = this.getController("c1");
  12687. this.n2 = (this.getChild("n2"));
  12688. this.n1 = (this.getChild("n1"));
  12689. this.n5 = (this.getChild("n5"));
  12690. }
  12691. }
  12692. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12693. class ui_Component43 extends fgui.GButton {
  12694. static createInstance() {
  12695. return (fgui.UIPackage.createObject("game", "Component43"));
  12696. }
  12697. onConstruct() {
  12698. this.n49 = (this.getChild("n49"));
  12699. }
  12700. }
  12701. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12702. class ui_wordsDisplay extends fgui.GComponent {
  12703. static createInstance() {
  12704. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12705. }
  12706. onConstruct() {
  12707. this.txt = (this.getChild("txt"));
  12708. this.n63 = (this.getChild("n63"));
  12709. }
  12710. }
  12711. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12712. class ui_Component_phb extends fgui.GComponent {
  12713. static createInstance() {
  12714. return (fgui.UIPackage.createObject("game", "Component_phb"));
  12715. }
  12716. onConstruct() {
  12717. this.n3 = (this.getChild("n3"));
  12718. this.n4 = (this.getChild("n4"));
  12719. }
  12720. }
  12721. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  12722. class ui_Component3 extends fgui.GComponent {
  12723. static createInstance() {
  12724. return (fgui.UIPackage.createObject("game", "Component3"));
  12725. }
  12726. onConstruct() {
  12727. this.n26 = (this.getChild("n26"));
  12728. this.n24 = (this.getChild("n24"));
  12729. this.nameTxt = (this.getChild("nameTxt"));
  12730. this.headRoot = (this.getChild("headRoot"));
  12731. }
  12732. }
  12733. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12734. class ui_Component4 extends fgui.GComponent {
  12735. static createInstance() {
  12736. return (fgui.UIPackage.createObject("game", "Component4"));
  12737. }
  12738. onConstruct() {
  12739. this.headImg = (this.getChild("headImg"));
  12740. }
  12741. }
  12742. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12743. class ui_Component7 extends fgui.GButton {
  12744. static createInstance() {
  12745. return (fgui.UIPackage.createObject("game", "Component7"));
  12746. }
  12747. onConstruct() {
  12748. this.n17 = (this.getChild("n17"));
  12749. }
  12750. }
  12751. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12752. class ui_Component8 extends fgui.GButton {
  12753. static createInstance() {
  12754. return (fgui.UIPackage.createObject("game", "Component8"));
  12755. }
  12756. onConstruct() {
  12757. this.n19 = (this.getChild("n19"));
  12758. }
  12759. }
  12760. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12761. class ui_Component10 extends fgui.GButton {
  12762. static createInstance() {
  12763. return (fgui.UIPackage.createObject("game", "Component10"));
  12764. }
  12765. onConstruct() {
  12766. this.c1 = this.getController("c1");
  12767. this.n40 = (this.getChild("n40"));
  12768. }
  12769. }
  12770. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12771. class ui_Component11 extends fgui.GButton {
  12772. static createInstance() {
  12773. return (fgui.UIPackage.createObject("game", "Component11"));
  12774. }
  12775. onConstruct() {
  12776. this.n34 = (this.getChild("n34"));
  12777. }
  12778. }
  12779. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12780. class ui_Component12 extends fgui.GButton {
  12781. static createInstance() {
  12782. return (fgui.UIPackage.createObject("game", "Component12"));
  12783. }
  12784. onConstruct() {
  12785. this.n35 = (this.getChild("n35"));
  12786. }
  12787. }
  12788. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12789. class ui_Component13 extends fgui.GButton {
  12790. static createInstance() {
  12791. return (fgui.UIPackage.createObject("game", "Component13"));
  12792. }
  12793. onConstruct() {
  12794. this.n27 = (this.getChild("n27"));
  12795. this.n36 = (this.getChild("n36"));
  12796. }
  12797. }
  12798. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12799. class ui_dh_js_tuowei extends fgui.GComponent {
  12800. static createInstance() {
  12801. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12802. }
  12803. onConstruct() {
  12804. this.n19 = (this.getChild("n19"));
  12805. this.n18 = (this.getChild("n18"));
  12806. this.n0 = (this.getChild("n0"));
  12807. this.n3 = (this.getChild("n3"));
  12808. this.n4 = (this.getChild("n4"));
  12809. this.n5 = (this.getChild("n5"));
  12810. this.n6 = (this.getChild("n6"));
  12811. this.n8 = (this.getChild("n8"));
  12812. this.n9 = (this.getChild("n9"));
  12813. this.n10 = (this.getChild("n10"));
  12814. this.n11 = (this.getChild("n11"));
  12815. this.n12 = (this.getChild("n12"));
  12816. this.n13 = (this.getChild("n13"));
  12817. this.n14 = (this.getChild("n14"));
  12818. this.n15 = (this.getChild("n15"));
  12819. this.n20 = (this.getChild("n20"));
  12820. this.t0 = this.getTransition("t0");
  12821. this.t1 = this.getTransition("t1");
  12822. }
  12823. }
  12824. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12825. class ui_dh_js_tw_g extends fgui.GComponent {
  12826. static createInstance() {
  12827. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12828. }
  12829. onConstruct() {
  12830. this.n0 = (this.getChild("n0"));
  12831. this.n1 = (this.getChild("n1"));
  12832. this.t0 = this.getTransition("t0");
  12833. }
  12834. }
  12835. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12836. class ui_dh_js_xingxing extends fgui.GComponent {
  12837. static createInstance() {
  12838. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12839. }
  12840. onConstruct() {
  12841. this.n1 = (this.getChild("n1"));
  12842. this.n2 = (this.getChild("n2"));
  12843. this.n3 = (this.getChild("n3"));
  12844. this.n4 = (this.getChild("n4"));
  12845. this.n0 = (this.getChild("n0"));
  12846. this.t2 = this.getTransition("t2");
  12847. this.t1 = this.getTransition("t1");
  12848. }
  12849. }
  12850. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12851. class ui_dh_zy_jiazai extends fgui.GComponent {
  12852. static createInstance() {
  12853. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12854. }
  12855. onConstruct() {
  12856. this.c1 = this.getController("c1");
  12857. this.n0 = (this.getChild("n0"));
  12858. this.n1 = (this.getChild("n1"));
  12859. this.n2 = (this.getChild("n2"));
  12860. this.n4 = (this.getChild("n4"));
  12861. this.n5 = (this.getChild("n5"));
  12862. this.n6 = (this.getChild("n6"));
  12863. this.n8 = (this.getChild("n8"));
  12864. this.n7 = (this.getChild("n7"));
  12865. this.t0 = this.getTransition("t0");
  12866. }
  12867. }
  12868. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12869. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12870. static createInstance() {
  12871. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12872. }
  12873. onConstruct() {
  12874. this.c1 = this.getController("c1");
  12875. this.n3 = (this.getChild("n3"));
  12876. this.n5 = (this.getChild("n5"));
  12877. this.n4 = (this.getChild("n4"));
  12878. this.n0 = (this.getChild("n0"));
  12879. this.n1 = (this.getChild("n1"));
  12880. this.n2 = (this.getChild("n2"));
  12881. }
  12882. }
  12883. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12884. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12885. static createInstance() {
  12886. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12887. }
  12888. onConstruct() {
  12889. this.n19 = (this.getChild("n19"));
  12890. this.n21 = (this.getChild("n21"));
  12891. this.n0 = (this.getChild("n0"));
  12892. this.n3 = (this.getChild("n3"));
  12893. this.n4 = (this.getChild("n4"));
  12894. this.n5 = (this.getChild("n5"));
  12895. this.n6 = (this.getChild("n6"));
  12896. this.n8 = (this.getChild("n8"));
  12897. this.n9 = (this.getChild("n9"));
  12898. this.n10 = (this.getChild("n10"));
  12899. this.n11 = (this.getChild("n11"));
  12900. this.n12 = (this.getChild("n12"));
  12901. this.n13 = (this.getChild("n13"));
  12902. this.n14 = (this.getChild("n14"));
  12903. this.n15 = (this.getChild("n15"));
  12904. this.n23 = (this.getChild("n23"));
  12905. this.t0 = this.getTransition("t0");
  12906. this.t1 = this.getTransition("t1");
  12907. }
  12908. }
  12909. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12910. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12911. static createInstance() {
  12912. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12913. }
  12914. onConstruct() {
  12915. this.n1 = (this.getChild("n1"));
  12916. this.n2 = (this.getChild("n2"));
  12917. this.t0 = this.getTransition("t0");
  12918. }
  12919. }
  12920. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12921. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12922. static createInstance() {
  12923. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12924. }
  12925. onConstruct() {
  12926. this.n4 = (this.getChild("n4"));
  12927. this.n2 = (this.getChild("n2"));
  12928. this.n3 = (this.getChild("n3"));
  12929. this.idle = this.getTransition("idle");
  12930. this.attack = this.getTransition("attack");
  12931. }
  12932. }
  12933. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12934. class ui_special extends fgui.GComponent {
  12935. static createInstance() {
  12936. return (fgui.UIPackage.createObject("game", "special"));
  12937. }
  12938. onConstruct() {
  12939. this.n18 = (this.getChild("n18"));
  12940. this.n19 = (this.getChild("n19"));
  12941. this.n20 = (this.getChild("n20"));
  12942. this.n21 = (this.getChild("n21"));
  12943. this.n22 = (this.getChild("n22"));
  12944. this.levelTxt = (this.getChild("levelTxt"));
  12945. this.n24 = (this.getChild("n24"));
  12946. this.n25 = (this.getChild("n25"));
  12947. this.t0 = this.getTransition("t0");
  12948. }
  12949. }
  12950. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12951. class ui_Component145 extends fgui.GComponent {
  12952. static createInstance() {
  12953. return (fgui.UIPackage.createObject("game", "Component145"));
  12954. }
  12955. onConstruct() {
  12956. this.guanyuNode = (this.getChild("guanyuNode"));
  12957. }
  12958. }
  12959. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12960. class ui_longBtn extends fgui.GButton {
  12961. static createInstance() {
  12962. return (fgui.UIPackage.createObject("game", "longBtn"));
  12963. }
  12964. onConstruct() {
  12965. this.c1 = this.getController("c1");
  12966. this.n2 = (this.getChild("n2"));
  12967. this.n1 = (this.getChild("n1"));
  12968. this.n4 = (this.getChild("n4"));
  12969. }
  12970. }
  12971. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12972. class ui_Component146 extends fgui.GComponent {
  12973. static createInstance() {
  12974. return (fgui.UIPackage.createObject("game", "Component146"));
  12975. }
  12976. onConstruct() {
  12977. this.n89 = (this.getChild("n89"));
  12978. this.n90 = (this.getChild("n90"));
  12979. this.guideBtn = (this.getChild("guideBtn"));
  12980. }
  12981. }
  12982. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12983. class ui_Component146_11 extends fgui.GComponent {
  12984. static createInstance() {
  12985. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12986. }
  12987. onConstruct() {
  12988. this.n89 = (this.getChild("n89"));
  12989. this.n90 = (this.getChild("n90"));
  12990. this.guideBtn = (this.getChild("guideBtn"));
  12991. }
  12992. }
  12993. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12994. class ui_Component111_1 extends fgui.GComponent {
  12995. static createInstance() {
  12996. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12997. }
  12998. onConstruct() {
  12999. this.n68 = (this.getChild("n68"));
  13000. this.myMask = (this.getChild("myMask"));
  13001. }
  13002. }
  13003. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  13004. class ui_Component64_1 extends fgui.GComponent {
  13005. static createInstance() {
  13006. return (fgui.UIPackage.createObject("game", "Component64_1"));
  13007. }
  13008. onConstruct() {
  13009. this.n57 = (this.getChild("n57"));
  13010. this.n54 = (this.getChild("n54"));
  13011. this.n55 = (this.getChild("n55"));
  13012. this.n56 = (this.getChild("n56"));
  13013. this.t1 = this.getTransition("t1");
  13014. }
  13015. }
  13016. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  13017. class ui_ModeSelection_com123 extends fgui.GComponent {
  13018. static createInstance() {
  13019. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  13020. }
  13021. onConstruct() {
  13022. this.type1 = (this.getChild("type1"));
  13023. this.type2 = (this.getChild("type2"));
  13024. this.type3 = (this.getChild("type3"));
  13025. this.n38 = (this.getChild("n38"));
  13026. this.t0 = this.getTransition("t0");
  13027. }
  13028. }
  13029. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  13030. class ui_Component132_2 extends fgui.GComponent {
  13031. static createInstance() {
  13032. return (fgui.UIPackage.createObject("game", "Component132_2"));
  13033. }
  13034. onConstruct() {
  13035. this.n25 = (this.getChild("n25"));
  13036. this.n26 = (this.getChild("n26"));
  13037. this.n27 = (this.getChild("n27"));
  13038. this.t0 = this.getTransition("t0");
  13039. }
  13040. }
  13041. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  13042. class ui_UIPower$1 extends fgui.GComponent {
  13043. static createInstance() {
  13044. return (fgui.UIPackage.createObject("game", "UIPower"));
  13045. }
  13046. onConstruct() {
  13047. this.n11 = (this.getChild("n11"));
  13048. this.myNode = (this.getChild("myNode"));
  13049. this.t0 = this.getTransition("t0");
  13050. }
  13051. }
  13052. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  13053. class ui_Component133 extends fgui.GComponent {
  13054. static createInstance() {
  13055. return (fgui.UIPackage.createObject("game", "Component133"));
  13056. }
  13057. onConstruct() {
  13058. this.n29 = (this.getChild("n29"));
  13059. this.n30 = (this.getChild("n30"));
  13060. }
  13061. }
  13062. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  13063. class ui_Component134 extends fgui.GComponent {
  13064. static createInstance() {
  13065. return (fgui.UIPackage.createObject("game", "Component134"));
  13066. }
  13067. onConstruct() {
  13068. this.n30 = (this.getChild("n30"));
  13069. this.n31 = (this.getChild("n31"));
  13070. this.t0 = this.getTransition("t0");
  13071. }
  13072. }
  13073. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  13074. class ui_Component135 extends fgui.GComponent {
  13075. static createInstance() {
  13076. return (fgui.UIPackage.createObject("game", "Component135"));
  13077. }
  13078. onConstruct() {
  13079. this.n30 = (this.getChild("n30"));
  13080. this.t0 = this.getTransition("t0");
  13081. }
  13082. }
  13083. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  13084. class ui_Component137 extends fgui.GComponent {
  13085. static createInstance() {
  13086. return (fgui.UIPackage.createObject("game", "Component137"));
  13087. }
  13088. onConstruct() {
  13089. this.n28 = (this.getChild("n28"));
  13090. this.n29 = (this.getChild("n29"));
  13091. this.n30 = (this.getChild("n30"));
  13092. this.n32 = (this.getChild("n32"));
  13093. }
  13094. }
  13095. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  13096. class ui_dh_zuanshi extends fgui.GButton {
  13097. static createInstance() {
  13098. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  13099. }
  13100. onConstruct() {
  13101. this.n1 = (this.getChild("n1"));
  13102. this.n2 = (this.getChild("n2"));
  13103. this.n0 = (this.getChild("n0"));
  13104. this.n3 = (this.getChild("n3"));
  13105. this.n4 = (this.getChild("n4"));
  13106. }
  13107. }
  13108. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  13109. class ui_Component138 extends fgui.GComponent {
  13110. static createInstance() {
  13111. return (fgui.UIPackage.createObject("game", "Component138"));
  13112. }
  13113. onConstruct() {
  13114. this.n1 = (this.getChild("n1"));
  13115. this.n2 = (this.getChild("n2"));
  13116. this.t0 = this.getTransition("t0");
  13117. }
  13118. }
  13119. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  13120. class ui_Component139 extends fgui.GComponent {
  13121. static createInstance() {
  13122. return (fgui.UIPackage.createObject("game", "Component139"));
  13123. }
  13124. onConstruct() {
  13125. this.n0 = (this.getChild("n0"));
  13126. this.t0 = this.getTransition("t0");
  13127. }
  13128. }
  13129. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  13130. class ui_Component140 extends fgui.GComponent {
  13131. static createInstance() {
  13132. return (fgui.UIPackage.createObject("game", "Component140"));
  13133. }
  13134. onConstruct() {
  13135. this.n2 = (this.getChild("n2"));
  13136. this.n3 = (this.getChild("n3"));
  13137. this.t0 = this.getTransition("t0");
  13138. }
  13139. }
  13140. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  13141. class ui_Component141 extends fgui.GComponent {
  13142. static createInstance() {
  13143. return (fgui.UIPackage.createObject("game", "Component141"));
  13144. }
  13145. onConstruct() {
  13146. this.n0 = (this.getChild("n0"));
  13147. this.t0 = this.getTransition("t0");
  13148. }
  13149. }
  13150. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  13151. class ui_powerNode extends fgui.GProgressBar {
  13152. static createInstance() {
  13153. return (fgui.UIPackage.createObject("game", "powerNode"));
  13154. }
  13155. onConstruct() {
  13156. this.n2 = (this.getChild("n2"));
  13157. this.bar_v = (this.getChild("bar_v"));
  13158. this.showImg = (this.getChild("showImg"));
  13159. this.n12 = (this.getChild("n12"));
  13160. }
  13161. }
  13162. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13163. class ui_dh_jingbi1 extends fgui.GComponent {
  13164. static createInstance() {
  13165. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13166. }
  13167. onConstruct() {
  13168. this.n0 = (this.getChild("n0"));
  13169. this.n1 = (this.getChild("n1"));
  13170. this.n2 = (this.getChild("n2"));
  13171. this.n3 = (this.getChild("n3"));
  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.t0 = this.getTransition("t0");
  13177. }
  13178. }
  13179. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13180. class ui_Component94 extends fgui.GButton {
  13181. static createInstance() {
  13182. return (fgui.UIPackage.createObject("game", "Component94"));
  13183. }
  13184. onConstruct() {
  13185. this.n77 = (this.getChild("n77"));
  13186. }
  13187. }
  13188. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13189. class ui_Component95 extends fgui.GButton {
  13190. static createInstance() {
  13191. return (fgui.UIPackage.createObject("game", "Component95"));
  13192. }
  13193. onConstruct() {
  13194. this.n77 = (this.getChild("n77"));
  13195. }
  13196. }
  13197. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13198. class ui_Component126 extends fgui.GComponent {
  13199. static createInstance() {
  13200. return (fgui.UIPackage.createObject("game", "Component126"));
  13201. }
  13202. onConstruct() {
  13203. this.c1 = this.getController("c1");
  13204. this.normalBtn = (this.getChild("normalBtn"));
  13205. this.tripleBtn = (this.getChild("tripleBtn"));
  13206. }
  13207. }
  13208. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13209. class ui_Component60 extends fgui.GComponent {
  13210. static createInstance() {
  13211. return (fgui.UIPackage.createObject("game", "Component60"));
  13212. }
  13213. onConstruct() {
  13214. this.c1 = this.getController("c1");
  13215. this.n48 = (this.getChild("n48"));
  13216. this.womanTxt = (this.getChild("womanTxt"));
  13217. this.t0 = this.getTransition("t0");
  13218. }
  13219. }
  13220. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13221. class ui_Component98_3 extends fgui.GButton {
  13222. static createInstance() {
  13223. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13224. }
  13225. onConstruct() {
  13226. this.c1 = this.getController("c1");
  13227. this.n8 = (this.getChild("n8"));
  13228. this.n41 = (this.getChild("n41"));
  13229. this.n40 = (this.getChild("n40"));
  13230. }
  13231. }
  13232. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13233. class ui_ModeSelection_com1 extends fgui.GButton {
  13234. static createInstance() {
  13235. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13236. }
  13237. onConstruct() {
  13238. this.n34 = (this.getChild("n34"));
  13239. this.n36 = (this.getChild("n36"));
  13240. this.n22 = (this.getChild("n22"));
  13241. this.n20 = (this.getChild("n20"));
  13242. this.n23 = (this.getChild("n23"));
  13243. this.n24 = (this.getChild("n24"));
  13244. this.n26 = (this.getChild("n26"));
  13245. this.n33 = (this.getChild("n33"));
  13246. this.coinImg = (this.getChild("coinImg"));
  13247. this.need = (this.getChild("need"));
  13248. this.n35 = (this.getChild("n35"));
  13249. this.n29 = (this.getChild("n29"));
  13250. this.tipsTxt = (this.getChild("tipsTxt"));
  13251. this.n30 = (this.getChild("n30"));
  13252. this.peopleTxt = (this.getChild("peopleTxt"));
  13253. this.t0 = this.getTransition("t0");
  13254. }
  13255. }
  13256. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13257. class ui_ModeSelection_com2 extends fgui.GButton {
  13258. static createInstance() {
  13259. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13260. }
  13261. onConstruct() {
  13262. this.n36 = (this.getChild("n36"));
  13263. this.n34 = (this.getChild("n34"));
  13264. this.n22 = (this.getChild("n22"));
  13265. this.n20 = (this.getChild("n20"));
  13266. this.n23 = (this.getChild("n23"));
  13267. this.n24 = (this.getChild("n24"));
  13268. this.n26 = (this.getChild("n26"));
  13269. this.n33 = (this.getChild("n33"));
  13270. this.coinImg = (this.getChild("coinImg"));
  13271. this.need = (this.getChild("need"));
  13272. this.n35 = (this.getChild("n35"));
  13273. this.n29 = (this.getChild("n29"));
  13274. this.tipsTxt = (this.getChild("tipsTxt"));
  13275. this.n30 = (this.getChild("n30"));
  13276. this.peopleTxt = (this.getChild("peopleTxt"));
  13277. this.t0 = this.getTransition("t0");
  13278. }
  13279. }
  13280. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13281. class ui_ModeSelection_com3 extends fgui.GButton {
  13282. static createInstance() {
  13283. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13284. }
  13285. onConstruct() {
  13286. this.n34 = (this.getChild("n34"));
  13287. this.n36 = (this.getChild("n36"));
  13288. this.n22 = (this.getChild("n22"));
  13289. this.n20 = (this.getChild("n20"));
  13290. this.n23 = (this.getChild("n23"));
  13291. this.n24 = (this.getChild("n24"));
  13292. this.n26 = (this.getChild("n26"));
  13293. this.n33 = (this.getChild("n33"));
  13294. this.coinImg = (this.getChild("coinImg"));
  13295. this.need = (this.getChild("need"));
  13296. this.n35 = (this.getChild("n35"));
  13297. this.n29 = (this.getChild("n29"));
  13298. this.tipsTxt = (this.getChild("tipsTxt"));
  13299. this.n30 = (this.getChild("n30"));
  13300. this.peopleTxt = (this.getChild("peopleTxt"));
  13301. this.t0 = this.getTransition("t0");
  13302. }
  13303. }
  13304. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13305. class ui_Invitation_com1 extends fgui.GComponent {
  13306. static createInstance() {
  13307. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13308. }
  13309. onConstruct() {
  13310. this.n14 = (this.getChild("n14"));
  13311. this.n13 = (this.getChild("n13"));
  13312. this.n3 = (this.getChild("n3"));
  13313. this.n1 = (this.getChild("n1"));
  13314. this.n6 = (this.getChild("n6"));
  13315. this.n7 = (this.getChild("n7"));
  13316. this.enterBtn = (this.getChild("enterBtn"));
  13317. this.n11 = (this.getChild("n11"));
  13318. this.n12 = (this.getChild("n12"));
  13319. this.n15 = (this.getChild("n15"));
  13320. this.t0 = this.getTransition("t0");
  13321. this.t1 = this.getTransition("t1");
  13322. }
  13323. }
  13324. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13325. class ui_Component87_1 extends fgui.GComponent {
  13326. static createInstance() {
  13327. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13328. }
  13329. onConstruct() {
  13330. this.n74 = (this.getChild("n74"));
  13331. this.n73 = (this.getChild("n73"));
  13332. this.ballTxt = (this.getChild("ballTxt"));
  13333. this.n76 = (this.getChild("n76"));
  13334. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13335. this.levelTxt = (this.getChild("levelTxt"));
  13336. this.n87 = (this.getChild("n87"));
  13337. this.n84 = (this.getChild("n84"));
  13338. this.hpTxt = (this.getChild("hpTxt"));
  13339. this.n89 = (this.getChild("n89"));
  13340. this.tipsTxt = (this.getChild("tipsTxt"));
  13341. }
  13342. }
  13343. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13344. class ui_sqg1 extends fgui.GComponent {
  13345. static createInstance() {
  13346. return (fgui.UIPackage.createObject("game", "sqg1"));
  13347. }
  13348. onConstruct() {
  13349. this.n1 = (this.getChild("n1"));
  13350. this.n0 = (this.getChild("n0"));
  13351. }
  13352. }
  13353. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  13354. class ui_sqg2 extends fgui.GComponent {
  13355. static createInstance() {
  13356. return (fgui.UIPackage.createObject("game", "sqg2"));
  13357. }
  13358. onConstruct() {
  13359. this.n1 = (this.getChild("n1"));
  13360. this.n0 = (this.getChild("n0"));
  13361. }
  13362. }
  13363. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  13364. class ui_sqg3 extends fgui.GComponent {
  13365. static createInstance() {
  13366. return (fgui.UIPackage.createObject("game", "sqg3"));
  13367. }
  13368. onConstruct() {
  13369. this.n1 = (this.getChild("n1"));
  13370. this.n0 = (this.getChild("n0"));
  13371. }
  13372. }
  13373. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  13374. class ui_sqg4 extends fgui.GComponent {
  13375. static createInstance() {
  13376. return (fgui.UIPackage.createObject("game", "sqg4"));
  13377. }
  13378. onConstruct() {
  13379. this.n1 = (this.getChild("n1"));
  13380. this.n0 = (this.getChild("n0"));
  13381. }
  13382. }
  13383. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  13384. class ui_Component36 extends fgui.GButton {
  13385. static createInstance() {
  13386. return (fgui.UIPackage.createObject("game", "Component36"));
  13387. }
  13388. onConstruct() {
  13389. this.c1 = this.getController("c1");
  13390. this.n53 = (this.getChild("n53"));
  13391. this.n56 = (this.getChild("n56"));
  13392. }
  13393. }
  13394. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  13395. class ui_Component37 extends fgui.GButton {
  13396. static createInstance() {
  13397. return (fgui.UIPackage.createObject("game", "Component37"));
  13398. }
  13399. onConstruct() {
  13400. this.c1 = this.getController("c1");
  13401. this.n52 = (this.getChild("n52"));
  13402. this.n54 = (this.getChild("n54"));
  13403. }
  13404. }
  13405. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  13406. class ui_UISetting extends fgui.GComponent {
  13407. static createInstance() {
  13408. return (fgui.UIPackage.createObject("game", "UISetting"));
  13409. }
  13410. onConstruct() {
  13411. this.c1 = this.getController("c1");
  13412. this.n4 = (this.getChild("n4"));
  13413. this.soundBtn = (this.getChild("soundBtn"));
  13414. this.shakeBtn = (this.getChild("shakeBtn"));
  13415. this.clickNode = (this.getChild("clickNode"));
  13416. this.xyBtn = (this.getChild("xyBtn"));
  13417. }
  13418. }
  13419. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  13420. class ui_Component39 extends fgui.GComponent {
  13421. static createInstance() {
  13422. return (fgui.UIPackage.createObject("game", "Component39"));
  13423. }
  13424. onConstruct() {
  13425. this.n5 = (this.getChild("n5"));
  13426. this.n6 = (this.getChild("n6"));
  13427. this.n7 = (this.getChild("n7"));
  13428. this.t0 = this.getTransition("t0");
  13429. }
  13430. }
  13431. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  13432. class ui_Component40 extends fgui.GButton {
  13433. static createInstance() {
  13434. return (fgui.UIPackage.createObject("game", "Component40"));
  13435. }
  13436. onConstruct() {
  13437. this.n46 = (this.getChild("n46"));
  13438. this.n47 = (this.getChild("n47"));
  13439. }
  13440. }
  13441. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13442. class ui_Component41 extends fgui.GComponent {
  13443. static createInstance() {
  13444. return (fgui.UIPackage.createObject("game", "Component41"));
  13445. }
  13446. onConstruct() {
  13447. this.c1 = this.getController("c1");
  13448. this.n0 = (this.getChild("n0"));
  13449. this.titleTxt = (this.getChild("titleTxt"));
  13450. this.n2 = (this.getChild("n2"));
  13451. this.msgTips = (this.getChild("msgTips"));
  13452. this.numTxt = (this.getChild("numTxt"));
  13453. this.n18 = (this.getChild("n18"));
  13454. this.cancelBtn = (this.getChild("cancelBtn"));
  13455. this.videoBtn = (this.getChild("videoBtn"));
  13456. this.n10 = (this.getChild("n10"));
  13457. }
  13458. }
  13459. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13460. class ui_Component42 extends fgui.GComponent {
  13461. static createInstance() {
  13462. return (fgui.UIPackage.createObject("game", "Component42"));
  13463. }
  13464. onConstruct() {
  13465. this.c1 = this.getController("c1");
  13466. this.n1 = (this.getChild("n1"));
  13467. this.n2 = (this.getChild("n2"));
  13468. this.n3 = (this.getChild("n3"));
  13469. this.tipsTxt = (this.getChild("tipsTxt"));
  13470. this.cancelBtn = (this.getChild("cancelBtn"));
  13471. this.sureBtn = (this.getChild("sureBtn"));
  13472. this.n11 = (this.getChild("n11"));
  13473. this.n13 = (this.getChild("n13"));
  13474. this.n14 = (this.getChild("n14"));
  13475. this.womanTxt = (this.getChild("womanTxt"));
  13476. this.t0 = this.getTransition("t0");
  13477. }
  13478. }
  13479. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13480. class ui_dh_js_shengli extends fgui.GComponent {
  13481. static createInstance() {
  13482. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13483. }
  13484. onConstruct() {
  13485. this.n3 = (this.getChild("n3"));
  13486. this.n4 = (this.getChild("n4"));
  13487. this.n1 = (this.getChild("n1"));
  13488. this.n2 = (this.getChild("n2"));
  13489. this.n5 = (this.getChild("n5"));
  13490. this.n6 = (this.getChild("n6"));
  13491. this.n7 = (this.getChild("n7"));
  13492. this.n8 = (this.getChild("n8"));
  13493. this.attack = this.getTransition("attack");
  13494. this.idle = this.getTransition("idle");
  13495. }
  13496. }
  13497. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13498. class ui_dh_js_shengli_g extends fgui.GComponent {
  13499. static createInstance() {
  13500. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13501. }
  13502. onConstruct() {
  13503. this.n3 = (this.getChild("n3"));
  13504. this.n1 = (this.getChild("n1"));
  13505. this.t0 = this.getTransition("t0");
  13506. }
  13507. }
  13508. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13509. class ui_dh_js_shibai extends fgui.GComponent {
  13510. static createInstance() {
  13511. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13512. }
  13513. onConstruct() {
  13514. this.n0 = (this.getChild("n0"));
  13515. this.n1 = (this.getChild("n1"));
  13516. this.n2 = (this.getChild("n2"));
  13517. this.n3 = (this.getChild("n3"));
  13518. this.idle = this.getTransition("idle");
  13519. this.attack = this.getTransition("attack");
  13520. }
  13521. }
  13522. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13523. class ui_dh_zy_ganfa extends fgui.GButton {
  13524. static createInstance() {
  13525. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13526. }
  13527. onConstruct() {
  13528. this.n0 = (this.getChild("n0"));
  13529. }
  13530. }
  13531. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13532. class ui_dh_zy_sc_guang extends fgui.GButton {
  13533. static createInstance() {
  13534. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13535. }
  13536. onConstruct() {
  13537. this.n0 = (this.getChild("n0"));
  13538. this.n2 = (this.getChild("n2"));
  13539. }
  13540. }
  13541. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13542. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13543. static createInstance() {
  13544. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13545. }
  13546. onConstruct() {
  13547. this.n0 = (this.getChild("n0"));
  13548. this.n3 = (this.getChild("n3"));
  13549. this.t0 = this.getTransition("t0");
  13550. }
  13551. }
  13552. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13553. class ui_dh_zy_wanfa extends fgui.GButton {
  13554. static createInstance() {
  13555. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13556. }
  13557. onConstruct() {
  13558. this.n0 = (this.getChild("n0"));
  13559. }
  13560. }
  13561. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13562. class ui_Component53_1 extends fgui.GComponent {
  13563. static createInstance() {
  13564. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13565. }
  13566. onConstruct() {
  13567. this.n0 = (this.getChild("n0"));
  13568. this.n1 = (this.getChild("n1"));
  13569. this.n2 = (this.getChild("n2"));
  13570. this.n3 = (this.getChild("n3"));
  13571. this.n4 = (this.getChild("n4"));
  13572. this.n5 = (this.getChild("n5"));
  13573. this.n6 = (this.getChild("n6"));
  13574. this.n7 = (this.getChild("n7"));
  13575. this.n8 = (this.getChild("n8"));
  13576. this.n9 = (this.getChild("n9"));
  13577. this.n10 = (this.getChild("n10"));
  13578. this.n11 = (this.getChild("n11"));
  13579. this.n12 = (this.getChild("n12"));
  13580. this.n13 = (this.getChild("n13"));
  13581. this.n14 = (this.getChild("n14"));
  13582. this.n15 = (this.getChild("n15"));
  13583. this.n16 = (this.getChild("n16"));
  13584. this.n19 = (this.getChild("n19"));
  13585. this.n20 = (this.getChild("n20"));
  13586. this.n21 = (this.getChild("n21"));
  13587. this.n22 = (this.getChild("n22"));
  13588. this.n23 = (this.getChild("n23"));
  13589. this.n24 = (this.getChild("n24"));
  13590. this.n25 = (this.getChild("n25"));
  13591. this.n26 = (this.getChild("n26"));
  13592. this.n27 = (this.getChild("n27"));
  13593. this.n28 = (this.getChild("n28"));
  13594. this.n29 = (this.getChild("n29"));
  13595. this.n30 = (this.getChild("n30"));
  13596. this.n31 = (this.getChild("n31"));
  13597. this.n32 = (this.getChild("n32"));
  13598. this.n33 = (this.getChild("n33"));
  13599. this.n34 = (this.getChild("n34"));
  13600. this.n35 = (this.getChild("n35"));
  13601. this.t0 = this.getTransition("t0");
  13602. }
  13603. }
  13604. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13605. class ui_Component30 extends fgui.GComponent {
  13606. static createInstance() {
  13607. return (fgui.UIPackage.createObject("game", "Component30"));
  13608. }
  13609. onConstruct() {
  13610. this.c1 = this.getController("c1");
  13611. this.n46 = (this.getChild("n46"));
  13612. this.n47 = (this.getChild("n47"));
  13613. this.numTxt = (this.getChild("numTxt"));
  13614. this.n50 = (this.getChild("n50"));
  13615. this.n53 = (this.getChild("n53"));
  13616. this.n54 = (this.getChild("n54"));
  13617. this.n55 = (this.getChild("n55"));
  13618. this.n56 = (this.getChild("n56"));
  13619. }
  13620. }
  13621. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13622. class ui_Component30_1 extends fgui.GComponent {
  13623. static createInstance() {
  13624. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13625. }
  13626. onConstruct() {
  13627. this.c1 = this.getController("c1");
  13628. this.n46 = (this.getChild("n46"));
  13629. this.n47 = (this.getChild("n47"));
  13630. this.numTxt = (this.getChild("numTxt"));
  13631. this.n50 = (this.getChild("n50"));
  13632. this.n51 = (this.getChild("n51"));
  13633. this.n52 = (this.getChild("n52"));
  13634. this.n53 = (this.getChild("n53"));
  13635. this.n54 = (this.getChild("n54"));
  13636. }
  13637. }
  13638. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13639. class ui_Component31 extends fgui.GComponent {
  13640. static createInstance() {
  13641. return (fgui.UIPackage.createObject("game", "Component31"));
  13642. }
  13643. onConstruct() {
  13644. this.n55 = (this.getChild("n55"));
  13645. this.n54 = (this.getChild("n54"));
  13646. this.conditionTxt = (this.getChild("conditionTxt"));
  13647. this.n57 = (this.getChild("n57"));
  13648. this.t0 = this.getTransition("t0");
  13649. }
  13650. }
  13651. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13652. class ui_Component32 extends fgui.GComponent {
  13653. static createInstance() {
  13654. return (fgui.UIPackage.createObject("game", "Component32"));
  13655. }
  13656. onConstruct() {
  13657. this.n5 = (this.getChild("n5"));
  13658. this.n6 = (this.getChild("n6"));
  13659. this.n7 = (this.getChild("n7"));
  13660. this.t0 = this.getTransition("t0");
  13661. }
  13662. }
  13663. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13664. class ui_AwardItem extends fgui.GComponent {
  13665. static createInstance() {
  13666. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13667. }
  13668. onConstruct() {
  13669. this.n9 = (this.getChild("n9"));
  13670. this.myIcon = (this.getChild("myIcon"));
  13671. this.numTxt = (this.getChild("numTxt"));
  13672. this.nameTxt = (this.getChild("nameTxt"));
  13673. this.n16 = (this.getChild("n16"));
  13674. this.n17 = (this.getChild("n17"));
  13675. }
  13676. }
  13677. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13678. class ui_ranking_com1 extends fgui.GButton {
  13679. static createInstance() {
  13680. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13681. }
  13682. onConstruct() {
  13683. this.c1 = this.getController("c1");
  13684. this.n49 = (this.getChild("n49"));
  13685. this.n18 = (this.getChild("n18"));
  13686. this.n46 = (this.getChild("n46"));
  13687. this.n48 = (this.getChild("n48"));
  13688. this.n50 = (this.getChild("n50"));
  13689. }
  13690. }
  13691. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13692. class ui_ranking_com2 extends fgui.GButton {
  13693. static createInstance() {
  13694. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13695. }
  13696. onConstruct() {
  13697. this.c1 = this.getController("c1");
  13698. this.n49 = (this.getChild("n49"));
  13699. this.n18 = (this.getChild("n18"));
  13700. this.n46 = (this.getChild("n46"));
  13701. this.n48 = (this.getChild("n48"));
  13702. this.n50 = (this.getChild("n50"));
  13703. }
  13704. }
  13705. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13706. class ui_ranking_com3 extends fgui.GComponent {
  13707. static createInstance() {
  13708. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13709. }
  13710. onConstruct() {
  13711. this.n17 = (this.getChild("n17"));
  13712. this.myIcon = (this.getChild("myIcon"));
  13713. }
  13714. }
  13715. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13716. class ui_ranking_com4 extends fgui.GComponent {
  13717. static createInstance() {
  13718. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13719. }
  13720. onConstruct() {
  13721. this.n16 = (this.getChild("n16"));
  13722. this.head = (this.getChild("head"));
  13723. }
  13724. }
  13725. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13726. class ui_ranking_com5 extends fgui.GComponent {
  13727. static createInstance() {
  13728. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13729. }
  13730. onConstruct() {
  13731. this.c1 = this.getController("c1");
  13732. this.c2 = this.getController("c2");
  13733. this.n2 = (this.getChild("n2"));
  13734. this.n3 = (this.getChild("n3"));
  13735. this.levelBtn = (this.getChild("levelBtn"));
  13736. this.starBtn = (this.getChild("starBtn"));
  13737. this.n23 = (this.getChild("n23"));
  13738. this.n24 = (this.getChild("n24"));
  13739. this.n25 = (this.getChild("n25"));
  13740. this.myList = (this.getChild("myList"));
  13741. this.selfNode = (this.getChild("selfNode"));
  13742. this.n9 = (this.getChild("n9"));
  13743. this.n12 = (this.getChild("n12"));
  13744. this.n13 = (this.getChild("n13"));
  13745. this.n14 = (this.getChild("n14"));
  13746. this.n39 = (this.getChild("n39"));
  13747. this.n41 = (this.getChild("n41"));
  13748. this.n42 = (this.getChild("n42"));
  13749. this.n45 = (this.getChild("n45"));
  13750. this.changeBtn = (this.getChild("changeBtn"));
  13751. this.closeBtn = (this.getChild("closeBtn"));
  13752. this.t0 = this.getTransition("t0");
  13753. }
  13754. }
  13755. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13756. class ui_RankItem extends fgui.GComponent {
  13757. static createInstance() {
  13758. return (fgui.UIPackage.createObject("game", "RankItem"));
  13759. }
  13760. onConstruct() {
  13761. this.n10 = (this.getChild("n10"));
  13762. this.n11 = (this.getChild("n11"));
  13763. this.rankTxt = (this.getChild("rankTxt"));
  13764. this.headNode = (this.getChild("headNode"));
  13765. this.nameTxt = (this.getChild("nameTxt"));
  13766. this.n19 = (this.getChild("n19"));
  13767. this.valueTxt = (this.getChild("valueTxt"));
  13768. this.img1 = (this.getChild("img1"));
  13769. this.img2 = (this.getChild("img2"));
  13770. this.img3 = (this.getChild("img3"));
  13771. }
  13772. }
  13773. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13774. class ui_ranking_com9 extends fgui.GComponent {
  13775. static createInstance() {
  13776. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13777. }
  13778. onConstruct() {
  13779. this.c1 = this.getController("c1");
  13780. this.n27 = (this.getChild("n27"));
  13781. this.n28 = (this.getChild("n28"));
  13782. this.headNode = (this.getChild("headNode"));
  13783. this.rankTxt = (this.getChild("rankTxt"));
  13784. this.nameTxt = (this.getChild("nameTxt"));
  13785. this.n34 = (this.getChild("n34"));
  13786. this.valueTxt = (this.getChild("valueTxt"));
  13787. this.n36 = (this.getChild("n36"));
  13788. this.n37 = (this.getChild("n37"));
  13789. this.n38 = (this.getChild("n38"));
  13790. this.n39 = (this.getChild("n39"));
  13791. this.n40 = (this.getChild("n40"));
  13792. }
  13793. }
  13794. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13795. class ui_ranking_com10 extends fgui.GComponent {
  13796. static createInstance() {
  13797. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13798. }
  13799. onConstruct() {
  13800. this.n23 = (this.getChild("n23"));
  13801. this.n24 = (this.getChild("n24"));
  13802. }
  13803. }
  13804. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13805. class ui_ranking_com11 extends fgui.GComponent {
  13806. static createInstance() {
  13807. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13808. }
  13809. onConstruct() {
  13810. this.n24 = (this.getChild("n24"));
  13811. this.n25 = (this.getChild("n25"));
  13812. this.t0 = this.getTransition("t0");
  13813. }
  13814. }
  13815. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13816. class ui_ranking_com13 extends fgui.GButton {
  13817. static createInstance() {
  13818. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13819. }
  13820. onConstruct() {
  13821. this.c1 = this.getController("c1");
  13822. this.n44 = (this.getChild("n44"));
  13823. this.n45 = (this.getChild("n45"));
  13824. this.n46 = (this.getChild("n46"));
  13825. }
  13826. }
  13827. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13828. class ui_Component122 extends fgui.GComponent {
  13829. static createInstance() {
  13830. return (fgui.UIPackage.createObject("game", "Component122"));
  13831. }
  13832. onConstruct() {
  13833. this.gameNode3 = (this.getChild("gameNode3"));
  13834. }
  13835. }
  13836. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13837. class ui_skillItem extends fgui.GComponent {
  13838. static createInstance() {
  13839. return (fgui.UIPackage.createObject("game", "skillItem"));
  13840. }
  13841. onConstruct() {
  13842. this.c1 = this.getController("c1");
  13843. this.n31 = (this.getChild("n31"));
  13844. this.n6 = (this.getChild("n6"));
  13845. this.skillImg = (this.getChild("skillImg"));
  13846. this.nameTxt = (this.getChild("nameTxt"));
  13847. this.levelTxt = (this.getChild("levelTxt"));
  13848. this.n28 = (this.getChild("n28"));
  13849. this.describeTxt = (this.getChild("describeTxt"));
  13850. this.n32 = (this.getChild("n32"));
  13851. this.mutiBtn = (this.getChild("mutiBtn"));
  13852. this.tryNode = (this.getChild("tryNode"));
  13853. this.normalBtn = (this.getChild("normalBtn"));
  13854. this.startBtn = (this.getChild("startBtn"));
  13855. this.n42 = (this.getChild("n42"));
  13856. this.n43 = (this.getChild("n43"));
  13857. this.n44 = (this.getChild("n44"));
  13858. }
  13859. }
  13860. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13861. class ui_Component26 extends fgui.GButton {
  13862. static createInstance() {
  13863. return (fgui.UIPackage.createObject("game", "Component26"));
  13864. }
  13865. onConstruct() {
  13866. this.n11 = (this.getChild("n11"));
  13867. this.n30 = (this.getChild("n30"));
  13868. this.n34 = (this.getChild("n34"));
  13869. }
  13870. }
  13871. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13872. class ui_Component28 extends fgui.GButton {
  13873. static createInstance() {
  13874. return (fgui.UIPackage.createObject("game", "Component28"));
  13875. }
  13876. onConstruct() {
  13877. this.n12 = (this.getChild("n12"));
  13878. this.n31 = (this.getChild("n31"));
  13879. this.curTxt = (this.getChild("curTxt"));
  13880. this.n33 = (this.getChild("n33"));
  13881. }
  13882. }
  13883. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13884. class ui_Component1302 extends fgui.GComponent {
  13885. static createInstance() {
  13886. return (fgui.UIPackage.createObject("game", "Component1302"));
  13887. }
  13888. onConstruct() {
  13889. this.n2 = (this.getChild("n2"));
  13890. this.n3 = (this.getChild("n3"));
  13891. }
  13892. }
  13893. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13894. class ui_Component113 extends fgui.GComponent {
  13895. static createInstance() {
  13896. return (fgui.UIPackage.createObject("game", "Component113"));
  13897. }
  13898. onConstruct() {
  13899. this.n85 = (this.getChild("n85"));
  13900. this.n86 = (this.getChild("n86"));
  13901. this.n77 = (this.getChild("n77"));
  13902. this.n79 = (this.getChild("n79"));
  13903. this.n80 = (this.getChild("n80"));
  13904. this.n81 = (this.getChild("n81"));
  13905. this.n82 = (this.getChild("n82"));
  13906. this.n84 = (this.getChild("n84"));
  13907. this.n87 = (this.getChild("n87"));
  13908. this.t0 = this.getTransition("t0");
  13909. }
  13910. }
  13911. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13912. class ui_Component114 extends fgui.GComponent {
  13913. static createInstance() {
  13914. return (fgui.UIPackage.createObject("game", "Component114"));
  13915. }
  13916. onConstruct() {
  13917. this.n77 = (this.getChild("n77"));
  13918. this.t0 = this.getTransition("t0");
  13919. }
  13920. }
  13921. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13922. class ui_Component115 extends fgui.GComponent {
  13923. static createInstance() {
  13924. return (fgui.UIPackage.createObject("game", "Component115"));
  13925. }
  13926. onConstruct() {
  13927. this.n83 = (this.getChild("n83"));
  13928. this.fingerNode = (this.getChild("fingerNode"));
  13929. this.n84 = (this.getChild("n84"));
  13930. }
  13931. }
  13932. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13933. class ui_Component117 extends fgui.GComponent {
  13934. static createInstance() {
  13935. return (fgui.UIPackage.createObject("game", "Component117"));
  13936. }
  13937. onConstruct() {
  13938. this.n87 = (this.getChild("n87"));
  13939. this.n88 = (this.getChild("n88"));
  13940. this.n84 = (this.getChild("n84"));
  13941. this.n85 = (this.getChild("n85"));
  13942. this.n86 = (this.getChild("n86"));
  13943. this.t0 = this.getTransition("t0");
  13944. }
  13945. }
  13946. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13947. class ui_Component98_1 extends fgui.GButton {
  13948. static createInstance() {
  13949. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13950. }
  13951. onConstruct() {
  13952. this.c1 = this.getController("c1");
  13953. this.n8 = (this.getChild("n8"));
  13954. this.n41 = (this.getChild("n41"));
  13955. this.n40 = (this.getChild("n40"));
  13956. }
  13957. }
  13958. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13959. class ui_Component61 extends fgui.GComponent {
  13960. static createInstance() {
  13961. return (fgui.UIPackage.createObject("game", "Component61"));
  13962. }
  13963. onConstruct() {
  13964. this.n14 = (this.getChild("n14"));
  13965. this.n6 = (this.getChild("n6"));
  13966. this.t0 = this.getTransition("t0");
  13967. }
  13968. }
  13969. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13970. class ui_Component62 extends fgui.GComponent {
  13971. static createInstance() {
  13972. return (fgui.UIPackage.createObject("game", "Component62"));
  13973. }
  13974. onConstruct() {
  13975. this.n66 = (this.getChild("n66"));
  13976. this.n56 = (this.getChild("n56"));
  13977. this.n63 = (this.getChild("n63"));
  13978. this.n65 = (this.getChild("n65"));
  13979. this.t0 = this.getTransition("t0");
  13980. }
  13981. }
  13982. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13983. class ui_d3Root extends fgui.GComponent {
  13984. static createInstance() {
  13985. return (fgui.UIPackage.createObject("game", "d3Root"));
  13986. }
  13987. onConstruct() {
  13988. }
  13989. }
  13990. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13991. class ui_d2Root extends fgui.GComponent {
  13992. static createInstance() {
  13993. return (fgui.UIPackage.createObject("game", "d2Root"));
  13994. }
  13995. onConstruct() {
  13996. }
  13997. }
  13998. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13999. class ui_ballNode extends fgui.GComponent {
  14000. static createInstance() {
  14001. return (fgui.UIPackage.createObject("game", "ballNode"));
  14002. }
  14003. onConstruct() {
  14004. }
  14005. }
  14006. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  14007. class ui_border extends fgui.GComponent {
  14008. static createInstance() {
  14009. return (fgui.UIPackage.createObject("game", "border"));
  14010. }
  14011. onConstruct() {
  14012. this.bar1 = (this.getChild("bar1"));
  14013. this.bar2 = (this.getChild("bar2"));
  14014. this.bar3 = (this.getChild("bar3"));
  14015. this.bar4 = (this.getChild("bar4"));
  14016. this.bar5 = (this.getChild("bar5"));
  14017. this.bar6 = (this.getChild("bar6"));
  14018. this.circle1 = (this.getChild("circle1"));
  14019. this.circle2 = (this.getChild("circle2"));
  14020. this.circle3 = (this.getChild("circle3"));
  14021. this.circle4 = (this.getChild("circle4"));
  14022. this.circle5 = (this.getChild("circle5"));
  14023. this.circle6 = (this.getChild("circle6"));
  14024. this.n28 = (this.getChild("n28"));
  14025. }
  14026. }
  14027. ui_border.URL = "ui://isxx5ak7sdh33qq";
  14028. class ui_Component41_2 extends fgui.GComponent {
  14029. static createInstance() {
  14030. return (fgui.UIPackage.createObject("game", "Component41_2"));
  14031. }
  14032. onConstruct() {
  14033. this.c1 = this.getController("c1");
  14034. this.n0 = (this.getChild("n0"));
  14035. this.n2 = (this.getChild("n2"));
  14036. this.n19 = (this.getChild("n19"));
  14037. this.cancelBtn = (this.getChild("cancelBtn"));
  14038. this.videoBtn = (this.getChild("videoBtn"));
  14039. this.n9 = (this.getChild("n9"));
  14040. this.n22 = (this.getChild("n22"));
  14041. this.tipsTxt = (this.getChild("tipsTxt"));
  14042. this.n23 = (this.getChild("n23"));
  14043. this.n24 = (this.getChild("n24"));
  14044. this.n26 = (this.getChild("n26"));
  14045. this.n27 = (this.getChild("n27"));
  14046. this.titleTxt = (this.getChild("titleTxt"));
  14047. }
  14048. }
  14049. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  14050. class ui_Component41_1 extends fgui.GComponent {
  14051. static createInstance() {
  14052. return (fgui.UIPackage.createObject("game", "Component41_1"));
  14053. }
  14054. onConstruct() {
  14055. this.c1 = this.getController("c1");
  14056. this.n0 = (this.getChild("n0"));
  14057. this.n2 = (this.getChild("n2"));
  14058. this.cancelBtn = (this.getChild("cancelBtn"));
  14059. this.videoBtn = (this.getChild("videoBtn"));
  14060. this.n27 = (this.getChild("n27"));
  14061. this.n30 = (this.getChild("n30"));
  14062. this.n31 = (this.getChild("n31"));
  14063. this.n32 = (this.getChild("n32"));
  14064. this.n33 = (this.getChild("n33"));
  14065. this.n34 = (this.getChild("n34"));
  14066. this.n35 = (this.getChild("n35"));
  14067. this.n36 = (this.getChild("n36"));
  14068. this.n1 = (this.getChild("n1"));
  14069. this.n37 = (this.getChild("n37"));
  14070. this.t0 = this.getTransition("t0");
  14071. this.t1 = this.getTransition("t1");
  14072. this.t2 = this.getTransition("t2");
  14073. this.t3 = this.getTransition("t3");
  14074. }
  14075. }
  14076. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  14077. class ui_againBtn extends fgui.GButton {
  14078. static createInstance() {
  14079. return (fgui.UIPackage.createObject("game", "againBtn"));
  14080. }
  14081. onConstruct() {
  14082. this.n2 = (this.getChild("n2"));
  14083. this.n1 = (this.getChild("n1"));
  14084. this.n5 = (this.getChild("n5"));
  14085. }
  14086. }
  14087. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  14088. class ui_Component118 extends fgui.GButton {
  14089. static createInstance() {
  14090. return (fgui.UIPackage.createObject("game", "Component118"));
  14091. }
  14092. onConstruct() {
  14093. this.c1 = this.getController("c1");
  14094. this.n14 = (this.getChild("n14"));
  14095. this.n9 = (this.getChild("n9"));
  14096. this.n10 = (this.getChild("n10"));
  14097. this.diamondTxt = (this.getChild("diamondTxt"));
  14098. this.n13 = (this.getChild("n13"));
  14099. this.n15 = (this.getChild("n15"));
  14100. }
  14101. }
  14102. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  14103. class ui_Component119 extends fgui.GComponent {
  14104. static createInstance() {
  14105. return (fgui.UIPackage.createObject("game", "Component119"));
  14106. }
  14107. onConstruct() {
  14108. this.n1 = (this.getChild("n1"));
  14109. this.n2 = (this.getChild("n2"));
  14110. this.n13 = (this.getChild("n13"));
  14111. this.n6 = (this.getChild("n6"));
  14112. this.screenNode = (this.getChild("screenNode"));
  14113. this.n15 = (this.getChild("n15"));
  14114. this.closeBtn = (this.getChild("closeBtn"));
  14115. this.share2Btn = (this.getChild("share2Btn"));
  14116. this.shareBtn = (this.getChild("shareBtn"));
  14117. this.tipsNode = (this.getChild("tipsNode"));
  14118. this.awardNode = (this.getChild("awardNode"));
  14119. }
  14120. }
  14121. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  14122. class ui_Component132_1 extends fgui.GComponent {
  14123. static createInstance() {
  14124. return (fgui.UIPackage.createObject("game", "Component132_1"));
  14125. }
  14126. onConstruct() {
  14127. this.n25 = (this.getChild("n25"));
  14128. this.n26 = (this.getChild("n26"));
  14129. this.n27 = (this.getChild("n27"));
  14130. this.t0 = this.getTransition("t0");
  14131. }
  14132. }
  14133. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  14134. class ui_SecretaryDisplay extends fgui.GComponent {
  14135. static createInstance() {
  14136. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  14137. }
  14138. onConstruct() {
  14139. this.n2 = (this.getChild("n2"));
  14140. this.levelTxt = (this.getChild("levelTxt"));
  14141. this.n4 = (this.getChild("n4"));
  14142. this.secretary = (this.getChild("secretary"));
  14143. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14144. this.n16 = (this.getChild("n16"));
  14145. this.n37 = (this.getChild("n37"));
  14146. this.n41 = (this.getChild("n41"));
  14147. this.n14 = (this.getChild("n14"));
  14148. this.n17 = (this.getChild("n17"));
  14149. this.heightTxt = (this.getChild("heightTxt"));
  14150. this.n46 = (this.getChild("n46"));
  14151. this.n36 = (this.getChild("n36"));
  14152. this.n38 = (this.getChild("n38"));
  14153. this.foodTxt = (this.getChild("foodTxt"));
  14154. this.n47 = (this.getChild("n47"));
  14155. this.n40 = (this.getChild("n40"));
  14156. this.n42 = (this.getChild("n42"));
  14157. this.historyTxt = (this.getChild("historyTxt"));
  14158. this.n48 = (this.getChild("n48"));
  14159. this.nameImg = (this.getChild("nameImg"));
  14160. this.n12 = (this.getChild("n12"));
  14161. this.n49 = (this.getChild("n49"));
  14162. this.t0 = this.getTransition("t0");
  14163. }
  14164. }
  14165. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14166. class ui_BallRodDisplay extends fgui.GComponent {
  14167. static createInstance() {
  14168. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14169. }
  14170. onConstruct() {
  14171. this.c1 = this.getController("c1");
  14172. this.n31 = (this.getChild("n31"));
  14173. this.n6 = (this.getChild("n6"));
  14174. this.nameTxt = (this.getChild("nameTxt"));
  14175. this.rodImg = (this.getChild("rodImg"));
  14176. this.levelNode = (this.getChild("levelNode"));
  14177. this.eftRod = (this.getChild("eftRod"));
  14178. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14179. }
  14180. }
  14181. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14182. class ui_Component111_11 extends fgui.GComponent {
  14183. static createInstance() {
  14184. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14185. }
  14186. onConstruct() {
  14187. this.n68 = (this.getChild("n68"));
  14188. this.n69 = (this.getChild("n69"));
  14189. }
  14190. }
  14191. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14192. class ui_Component112 extends fgui.GComponent {
  14193. static createInstance() {
  14194. return (fgui.UIPackage.createObject("game", "Component112"));
  14195. }
  14196. onConstruct() {
  14197. this.n68 = (this.getChild("n68"));
  14198. this.n70 = (this.getChild("n70"));
  14199. this.myMask = (this.getChild("myMask"));
  14200. }
  14201. }
  14202. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14203. class ui_Component111 extends fgui.GComponent {
  14204. static createInstance() {
  14205. return (fgui.UIPackage.createObject("game", "Component111"));
  14206. }
  14207. onConstruct() {
  14208. this.n68 = (this.getChild("n68"));
  14209. this.myMask = (this.getChild("myMask"));
  14210. }
  14211. }
  14212. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14213. class ui_Component144 extends fgui.GButton {
  14214. static createInstance() {
  14215. return (fgui.UIPackage.createObject("game", "Component144"));
  14216. }
  14217. onConstruct() {
  14218. this.n8 = (this.getChild("n8"));
  14219. }
  14220. }
  14221. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14222. class ui_Sign_com2 extends fgui.GComponent {
  14223. static createInstance() {
  14224. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14225. }
  14226. onConstruct() {
  14227. this.n0 = (this.getChild("n0"));
  14228. this.n1 = (this.getChild("n1"));
  14229. this.t0 = this.getTransition("t0");
  14230. }
  14231. }
  14232. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14233. class ui_Sign_guang extends fgui.GComponent {
  14234. static createInstance() {
  14235. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14236. }
  14237. onConstruct() {
  14238. this.n1 = (this.getChild("n1"));
  14239. this.n2 = (this.getChild("n2"));
  14240. this.n3 = (this.getChild("n3"));
  14241. this.n4 = (this.getChild("n4"));
  14242. this.n5 = (this.getChild("n5"));
  14243. this.n6 = (this.getChild("n6"));
  14244. this.n8 = (this.getChild("n8"));
  14245. }
  14246. }
  14247. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14248. class ui_SignMax extends fgui.GComponent {
  14249. static createInstance() {
  14250. return (fgui.UIPackage.createObject("game", "SignMax"));
  14251. }
  14252. onConstruct() {
  14253. this.c1 = this.getController("c1");
  14254. this.n7 = (this.getChild("n7"));
  14255. this.n15 = (this.getChild("n15"));
  14256. this.n8 = (this.getChild("n8"));
  14257. this.titleTxt = (this.getChild("titleTxt"));
  14258. this.myIcon1 = (this.getChild("myIcon1"));
  14259. this.numTxt1 = (this.getChild("numTxt1"));
  14260. this.myIcon2 = (this.getChild("myIcon2"));
  14261. this.n20 = (this.getChild("n20"));
  14262. this.n17 = (this.getChild("n17"));
  14263. this.numTxt2 = (this.getChild("numTxt2"));
  14264. this.n12 = (this.getChild("n12"));
  14265. this.n13 = (this.getChild("n13"));
  14266. this.n21 = (this.getChild("n21"));
  14267. this.n14 = (this.getChild("n14"));
  14268. }
  14269. }
  14270. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14271. class ui_Sign_com2_1 extends fgui.GComponent {
  14272. static createInstance() {
  14273. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14274. }
  14275. onConstruct() {
  14276. this.n0 = (this.getChild("n0"));
  14277. this.n1 = (this.getChild("n1"));
  14278. this.t0 = this.getTransition("t0");
  14279. }
  14280. }
  14281. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14282. class ui_Sign_com5 extends fgui.GComponent {
  14283. static createInstance() {
  14284. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14285. }
  14286. onConstruct() {
  14287. this.n3 = (this.getChild("n3"));
  14288. this.n29 = (this.getChild("n29"));
  14289. this.n4 = (this.getChild("n4"));
  14290. this.day1 = (this.getChild("day1"));
  14291. this.day2 = (this.getChild("day2"));
  14292. this.day3 = (this.getChild("day3"));
  14293. this.day4 = (this.getChild("day4"));
  14294. this.day5 = (this.getChild("day5"));
  14295. this.day6 = (this.getChild("day6"));
  14296. this.day7 = (this.getChild("day7"));
  14297. this.t0 = this.getTransition("t0");
  14298. }
  14299. }
  14300. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  14301. class ui_Sign_com8 extends fgui.GComponent {
  14302. static createInstance() {
  14303. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  14304. }
  14305. onConstruct() {
  14306. this.n48 = (this.getChild("n48"));
  14307. this.womanTxt = (this.getChild("womanTxt"));
  14308. this.t0 = this.getTransition("t0");
  14309. }
  14310. }
  14311. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  14312. class ui_Sign_com6 extends fgui.GComponent {
  14313. static createInstance() {
  14314. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  14315. }
  14316. onConstruct() {
  14317. this.n2 = (this.getChild("n2"));
  14318. this.n3 = (this.getChild("n3"));
  14319. this.t0 = this.getTransition("t0");
  14320. }
  14321. }
  14322. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  14323. class ui_Sign_com7 extends fgui.GComponent {
  14324. static createInstance() {
  14325. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  14326. }
  14327. onConstruct() {
  14328. this.n29 = (this.getChild("n29"));
  14329. this.n2 = (this.getChild("n2"));
  14330. }
  14331. }
  14332. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  14333. class ui_UITurntable_com1_2 extends fgui.GComponent {
  14334. static createInstance() {
  14335. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  14336. }
  14337. onConstruct() {
  14338. this.n5 = (this.getChild("n5"));
  14339. this.n4 = (this.getChild("n4"));
  14340. this.t0 = this.getTransition("t0");
  14341. }
  14342. }
  14343. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  14344. class ui_UITurntable_com2 extends fgui.GComponent {
  14345. static createInstance() {
  14346. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  14347. }
  14348. onConstruct() {
  14349. this.c1 = this.getController("c1");
  14350. this.n4 = (this.getChild("n4"));
  14351. this.n6 = (this.getChild("n6"));
  14352. this.n10 = (this.getChild("n10"));
  14353. this.n11 = (this.getChild("n11"));
  14354. this.n12 = (this.getChild("n12"));
  14355. this.n13 = (this.getChild("n13"));
  14356. this.n14 = (this.getChild("n14"));
  14357. this.n15 = (this.getChild("n15"));
  14358. this.n16 = (this.getChild("n16"));
  14359. this.n17 = (this.getChild("n17"));
  14360. this.n18 = (this.getChild("n18"));
  14361. this.n19 = (this.getChild("n19"));
  14362. this.n20 = (this.getChild("n20"));
  14363. this.n21 = (this.getChild("n21"));
  14364. this.n22 = (this.getChild("n22"));
  14365. this.n23 = (this.getChild("n23"));
  14366. this.n24 = (this.getChild("n24"));
  14367. this.n25 = (this.getChild("n25"));
  14368. this.n26 = (this.getChild("n26"));
  14369. this.n27 = (this.getChild("n27"));
  14370. this.n28 = (this.getChild("n28"));
  14371. this.n29 = (this.getChild("n29"));
  14372. this.n30 = (this.getChild("n30"));
  14373. this.n31 = (this.getChild("n31"));
  14374. this.n32 = (this.getChild("n32"));
  14375. this.n33 = (this.getChild("n33"));
  14376. }
  14377. }
  14378. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  14379. class ui_UITurntable_com1_1 extends fgui.GComponent {
  14380. static createInstance() {
  14381. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  14382. }
  14383. onConstruct() {
  14384. this.n5 = (this.getChild("n5"));
  14385. this.n4 = (this.getChild("n4"));
  14386. this.t0 = this.getTransition("t0");
  14387. }
  14388. }
  14389. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  14390. class ui_UITurntable_com5 extends fgui.GComponent {
  14391. static createInstance() {
  14392. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  14393. }
  14394. onConstruct() {
  14395. this.flashNode = (this.getChild("flashNode"));
  14396. this.rotNode = (this.getChild("rotNode"));
  14397. this.n3 = (this.getChild("n3"));
  14398. this.n21 = (this.getChild("n21"));
  14399. this.t0 = this.getTransition("t0");
  14400. }
  14401. }
  14402. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14403. class ui_UITurntable_com7 extends fgui.GComponent {
  14404. static createInstance() {
  14405. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14406. }
  14407. onConstruct() {
  14408. this.n2 = (this.getChild("n2"));
  14409. this.n35 = (this.getChild("n35"));
  14410. this.img1 = (this.getChild("img1"));
  14411. this.img2 = (this.getChild("img2"));
  14412. this.img3 = (this.getChild("img3"));
  14413. this.img4 = (this.getChild("img4"));
  14414. this.img6 = (this.getChild("img6"));
  14415. this.img5 = (this.getChild("img5"));
  14416. this.txt1 = (this.getChild("txt1"));
  14417. this.txt2 = (this.getChild("txt2"));
  14418. this.txt3 = (this.getChild("txt3"));
  14419. this.txt4 = (this.getChild("txt4"));
  14420. this.txt5 = (this.getChild("txt5"));
  14421. this.txt6 = (this.getChild("txt6"));
  14422. }
  14423. }
  14424. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14425. class ui_UITurntable_com9 extends fgui.GComponent {
  14426. static createInstance() {
  14427. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14428. }
  14429. onConstruct() {
  14430. this.n38 = (this.getChild("n38"));
  14431. this.n39 = (this.getChild("n39"));
  14432. }
  14433. }
  14434. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14435. class ui_UITurntable_com10 extends fgui.GComponent {
  14436. static createInstance() {
  14437. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14438. }
  14439. onConstruct() {
  14440. this.n39 = (this.getChild("n39"));
  14441. this.n40 = (this.getChild("n40"));
  14442. this.t0 = this.getTransition("t0");
  14443. }
  14444. }
  14445. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14446. class ui_UITurntable_com11 extends fgui.GComponent {
  14447. static createInstance() {
  14448. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14449. }
  14450. onConstruct() {
  14451. this.n38 = (this.getChild("n38"));
  14452. this.n39 = (this.getChild("n39"));
  14453. this.n40 = (this.getChild("n40"));
  14454. this.t0 = this.getTransition("t0");
  14455. }
  14456. }
  14457. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14458. class ui_UITurntable_com12 extends fgui.GComponent {
  14459. static createInstance() {
  14460. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14461. }
  14462. onConstruct() {
  14463. this.n43 = (this.getChild("n43"));
  14464. this.barNode = (this.getChild("barNode"));
  14465. this.tipsTxt = (this.getChild("tipsTxt"));
  14466. this.n45 = (this.getChild("n45"));
  14467. this.boxBtn = (this.getChild("boxBtn"));
  14468. }
  14469. }
  14470. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14471. class ui_UITurntable_com1 extends fgui.GButton {
  14472. static createInstance() {
  14473. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14474. }
  14475. onConstruct() {
  14476. this.n41 = (this.getChild("n41"));
  14477. this.n42 = (this.getChild("n42"));
  14478. this.t0 = this.getTransition("t0");
  14479. }
  14480. }
  14481. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14482. class ui_UITurntable_com3 extends fgui.GComponent {
  14483. static createInstance() {
  14484. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14485. }
  14486. onConstruct() {
  14487. this.n48 = (this.getChild("n48"));
  14488. this.womanTxt = (this.getChild("womanTxt"));
  14489. this.t0 = this.getTransition("t0");
  14490. }
  14491. }
  14492. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14493. class ui_cancelBtn2 extends fgui.GButton {
  14494. static createInstance() {
  14495. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14496. }
  14497. onConstruct() {
  14498. this.c1 = this.getController("c1");
  14499. this.n0 = (this.getChild("n0"));
  14500. this.n1 = (this.getChild("n1"));
  14501. this.n2 = (this.getChild("n2"));
  14502. this.n3 = (this.getChild("n3"));
  14503. this.n4 = (this.getChild("n4"));
  14504. this.n5 = (this.getChild("n5"));
  14505. this.n6 = (this.getChild("n6"));
  14506. this.n7 = (this.getChild("n7"));
  14507. this.n8 = (this.getChild("n8"));
  14508. this.powerEft = (this.getChild("powerEft"));
  14509. }
  14510. }
  14511. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14512. class ui_shareBtn2 extends fgui.GButton {
  14513. static createInstance() {
  14514. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14515. }
  14516. onConstruct() {
  14517. this.c1 = this.getController("c1");
  14518. this.n2 = (this.getChild("n2"));
  14519. this.n24 = (this.getChild("n24"));
  14520. this.n1 = (this.getChild("n1"));
  14521. this.n3 = (this.getChild("n3"));
  14522. this.n23 = (this.getChild("n23"));
  14523. this.n4 = (this.getChild("n4"));
  14524. this.n5 = (this.getChild("n5"));
  14525. this.n6 = (this.getChild("n6"));
  14526. this.n20 = (this.getChild("n20"));
  14527. this.n21 = (this.getChild("n21"));
  14528. this.n22 = (this.getChild("n22"));
  14529. this.powerEft = (this.getChild("powerEft"));
  14530. }
  14531. }
  14532. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14533. class ui_UIMoney extends fgui.GComponent {
  14534. static createInstance() {
  14535. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14536. }
  14537. onConstruct() {
  14538. this.c1 = this.getController("c1");
  14539. this.n4 = (this.getChild("n4"));
  14540. this.coinImg = (this.getChild("coinImg"));
  14541. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14542. this.coinTxt = (this.getChild("coinTxt"));
  14543. this.n7 = (this.getChild("n7"));
  14544. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14545. this.diamondTxt = (this.getChild("diamondTxt"));
  14546. this.diamondImg = (this.getChild("diamondImg"));
  14547. this.n12 = (this.getChild("n12"));
  14548. this.powerImg = (this.getChild("powerImg"));
  14549. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14550. this.powerTxt = (this.getChild("powerTxt"));
  14551. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14552. }
  14553. }
  14554. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14555. class ui_backBtn extends fgui.GButton {
  14556. static createInstance() {
  14557. return (fgui.UIPackage.createObject("game", "backBtn"));
  14558. }
  14559. onConstruct() {
  14560. this.n0 = (this.getChild("n0"));
  14561. this.t0 = this.getTransition("t0");
  14562. this.t1 = this.getTransition("t1");
  14563. }
  14564. }
  14565. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14566. class ui_MoneyBtn extends fgui.GButton {
  14567. static createInstance() {
  14568. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14569. }
  14570. onConstruct() {
  14571. this.button = this.getController("button");
  14572. this.n0 = (this.getChild("n0"));
  14573. }
  14574. }
  14575. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14576. class ui_UIMoneyBtn extends fgui.GComponent {
  14577. static createInstance() {
  14578. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14579. }
  14580. onConstruct() {
  14581. this.n1 = (this.getChild("n1"));
  14582. this.closeBtn = (this.getChild("closeBtn"));
  14583. }
  14584. }
  14585. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14586. class ui_Component64 extends fgui.GComponent {
  14587. static createInstance() {
  14588. return (fgui.UIPackage.createObject("game", "Component64"));
  14589. }
  14590. onConstruct() {
  14591. this.n57 = (this.getChild("n57"));
  14592. this.n54 = (this.getChild("n54"));
  14593. this.n55 = (this.getChild("n55"));
  14594. this.n56 = (this.getChild("n56"));
  14595. this.t1 = this.getTransition("t1");
  14596. }
  14597. }
  14598. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14599. class ui_Component41_3 extends fgui.GComponent {
  14600. static createInstance() {
  14601. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14602. }
  14603. onConstruct() {
  14604. this.c1 = this.getController("c1");
  14605. this.n0 = (this.getChild("n0"));
  14606. this.n2 = (this.getChild("n2"));
  14607. this.cancelBtn = (this.getChild("cancelBtn"));
  14608. this.videoBtn = (this.getChild("videoBtn"));
  14609. this.n9 = (this.getChild("n9"));
  14610. this.n24 = (this.getChild("n24"));
  14611. this.n27 = (this.getChild("n27"));
  14612. this.titleTxt = (this.getChild("titleTxt"));
  14613. this.n28 = (this.getChild("n28"));
  14614. this.t0 = this.getTransition("t0");
  14615. }
  14616. }
  14617. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14618. class ui_dh_zs_4 extends fgui.GComponent {
  14619. static createInstance() {
  14620. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14621. }
  14622. onConstruct() {
  14623. this.n1 = (this.getChild("n1"));
  14624. this.n2 = (this.getChild("n2"));
  14625. this.n3 = (this.getChild("n3"));
  14626. this.n4 = (this.getChild("n4"));
  14627. this.n5 = (this.getChild("n5"));
  14628. this.n6 = (this.getChild("n6"));
  14629. this.n8 = (this.getChild("n8"));
  14630. this.t0 = this.getTransition("t0");
  14631. }
  14632. }
  14633. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14634. class ui_Component71_1 extends fgui.GButton {
  14635. static createInstance() {
  14636. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14637. }
  14638. onConstruct() {
  14639. this.n17 = (this.getChild("n17"));
  14640. this.t0 = this.getTransition("t0");
  14641. }
  14642. }
  14643. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14644. class ui_Component83 extends fgui.GComponent {
  14645. static createInstance() {
  14646. return (fgui.UIPackage.createObject("game", "Component83"));
  14647. }
  14648. onConstruct() {
  14649. this.c1 = this.getController("c1");
  14650. this.n17 = (this.getChild("n17"));
  14651. this.n19 = (this.getChild("n19"));
  14652. this.n20 = (this.getChild("n20"));
  14653. }
  14654. }
  14655. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14656. class ui_Component84 extends fgui.GComponent {
  14657. static createInstance() {
  14658. return (fgui.UIPackage.createObject("game", "Component84"));
  14659. }
  14660. onConstruct() {
  14661. this.c1 = this.getController("c1");
  14662. this.n4 = (this.getChild("n4"));
  14663. this.n22 = (this.getChild("n22"));
  14664. this.n23 = (this.getChild("n23"));
  14665. this.numTxt = (this.getChild("numTxt"));
  14666. this.n25 = (this.getChild("n25"));
  14667. this.n26 = (this.getChild("n26"));
  14668. }
  14669. }
  14670. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14671. class ui_Component84_1 extends fgui.GComponent {
  14672. static createInstance() {
  14673. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14674. }
  14675. onConstruct() {
  14676. this.c1 = this.getController("c1");
  14677. this.n4 = (this.getChild("n4"));
  14678. this.n22 = (this.getChild("n22"));
  14679. this.n23 = (this.getChild("n23"));
  14680. this.numTxt = (this.getChild("numTxt"));
  14681. this.n25 = (this.getChild("n25"));
  14682. this.n26 = (this.getChild("n26"));
  14683. }
  14684. }
  14685. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14686. class ui_Component85 extends fgui.GComponent {
  14687. static createInstance() {
  14688. return (fgui.UIPackage.createObject("game", "Component85"));
  14689. }
  14690. onConstruct() {
  14691. this.n1 = (this.getChild("n1"));
  14692. this.n6 = (this.getChild("n6"));
  14693. this.n2 = (this.getChild("n2"));
  14694. this.n3 = (this.getChild("n3"));
  14695. this.levelTxt = (this.getChild("levelTxt"));
  14696. this.n10 = (this.getChild("n10"));
  14697. this.n11 = (this.getChild("n11"));
  14698. this.n12 = (this.getChild("n12"));
  14699. this.n13 = (this.getChild("n13"));
  14700. this.n14 = (this.getChild("n14"));
  14701. this.modeNode = (this.getChild("modeNode"));
  14702. this.n18 = (this.getChild("n18"));
  14703. this.conditionTxt = (this.getChild("conditionTxt"));
  14704. this.diamondNode = (this.getChild("diamondNode"));
  14705. this.coinNode = (this.getChild("coinNode"));
  14706. this.startBtn = (this.getChild("startBtn"));
  14707. this.n28 = (this.getChild("n28"));
  14708. this.displayRoot = (this.getChild("displayRoot"));
  14709. this.t0 = this.getTransition("t0");
  14710. }
  14711. }
  14712. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14713. class ui_Component86 extends fgui.GButton {
  14714. static createInstance() {
  14715. return (fgui.UIPackage.createObject("game", "Component86"));
  14716. }
  14717. onConstruct() {
  14718. this.n15 = (this.getChild("n15"));
  14719. this.t0 = this.getTransition("t0");
  14720. }
  14721. }
  14722. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14723. class ui_Component87 extends fgui.GComponent {
  14724. static createInstance() {
  14725. return (fgui.UIPackage.createObject("game", "Component87"));
  14726. }
  14727. onConstruct() {
  14728. this.n66 = (this.getChild("n66"));
  14729. this.myProgress = (this.getChild("myProgress"));
  14730. this.starAni = (this.getChild("starAni"));
  14731. this.hpTxt = (this.getChild("hpTxt"));
  14732. this.n74 = (this.getChild("n74"));
  14733. this.n73 = (this.getChild("n73"));
  14734. this.ballTxt = (this.getChild("ballTxt"));
  14735. this.n76 = (this.getChild("n76"));
  14736. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14737. this.levelTxt = (this.getChild("levelTxt"));
  14738. this.star1 = (this.getChild("star1"));
  14739. this.star2 = (this.getChild("star2"));
  14740. this.star3 = (this.getChild("star3"));
  14741. }
  14742. }
  14743. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14744. class ui_Component88 extends fgui.GProgressBar {
  14745. static createInstance() {
  14746. return (fgui.UIPackage.createObject("game", "Component88"));
  14747. }
  14748. onConstruct() {
  14749. this.n68 = (this.getChild("n68"));
  14750. this.bar = (this.getChild("bar"));
  14751. }
  14752. }
  14753. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14754. class ui_Component89 extends fgui.GComponent {
  14755. static createInstance() {
  14756. return (fgui.UIPackage.createObject("game", "Component89"));
  14757. }
  14758. onConstruct() {
  14759. this.c1 = this.getController("c1");
  14760. this.n71 = (this.getChild("n71"));
  14761. this.n72 = (this.getChild("n72"));
  14762. }
  14763. }
  14764. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14765. class ui_Component90 extends fgui.GComponent {
  14766. static createInstance() {
  14767. return (fgui.UIPackage.createObject("game", "Component90"));
  14768. }
  14769. onConstruct() {
  14770. this.c1 = this.getController("c1");
  14771. this.n64 = (this.getChild("n64"));
  14772. this.n65 = (this.getChild("n65"));
  14773. this.n66 = (this.getChild("n66"));
  14774. this.t0 = this.getTransition("t0");
  14775. }
  14776. }
  14777. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14778. class ui_Component127 extends fgui.GButton {
  14779. static createInstance() {
  14780. return (fgui.UIPackage.createObject("game", "Component127"));
  14781. }
  14782. onConstruct() {
  14783. this.n5 = (this.getChild("n5"));
  14784. }
  14785. }
  14786. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14787. class gameBinder {
  14788. static bindAll() {
  14789. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14790. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14791. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14792. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14793. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14794. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14795. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14796. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14797. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14798. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14799. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14800. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14801. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14802. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14803. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14804. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14805. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14806. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14807. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14808. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14809. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14810. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14811. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14812. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14813. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14814. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14815. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14816. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14817. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14818. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14819. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14820. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14821. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14822. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14823. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14824. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14825. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14826. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14827. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14828. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14829. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14830. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14831. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14832. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14833. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14834. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14835. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14836. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14837. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14838. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14839. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14840. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14841. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14842. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14843. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14844. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14845. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14846. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14847. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14848. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14849. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14850. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14851. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14852. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14853. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14854. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14855. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14856. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14857. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14858. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14859. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14860. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14861. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14862. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14863. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14864. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14865. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14866. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14867. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14868. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14869. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14870. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14871. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14872. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14873. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14874. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14875. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14876. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14877. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14878. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14879. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14880. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14881. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  14882. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14883. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14884. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14885. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14886. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14887. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14888. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14889. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14890. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14891. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14892. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14893. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14894. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14895. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14896. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14897. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14898. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14899. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14900. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14901. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14902. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14903. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14904. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14905. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14906. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14907. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14908. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14909. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14910. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14911. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14912. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14913. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14914. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14915. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14916. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14917. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14918. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14919. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14920. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14921. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14922. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14923. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14924. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14925. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14926. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14927. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14928. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14929. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14930. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14931. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14932. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14933. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14934. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14935. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14936. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14937. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14938. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14939. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14940. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14941. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14942. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14943. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14944. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14945. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14946. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14947. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14948. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14949. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14950. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14951. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14952. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14953. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14954. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14955. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14956. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14957. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14958. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14959. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14960. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14961. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14962. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14963. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14964. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14965. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14966. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14967. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14968. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14969. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14970. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14971. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14972. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14973. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14974. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14975. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14976. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14977. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14978. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14979. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14980. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14981. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14982. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14983. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14984. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14985. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14986. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14987. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14988. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14989. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14990. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14991. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14992. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14993. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14994. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14995. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14996. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14997. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14998. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14999. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  15000. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  15001. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  15002. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  15003. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  15004. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  15005. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  15006. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  15007. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  15008. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  15009. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  15010. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  15011. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  15012. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  15013. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  15014. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  15015. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  15016. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  15017. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  15018. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  15019. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  15020. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  15021. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  15022. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  15023. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  15024. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  15025. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  15026. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  15027. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  15028. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  15029. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  15030. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  15031. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  15032. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  15033. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  15034. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  15035. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  15036. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  15037. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  15038. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  15039. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  15040. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  15041. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  15042. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  15043. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  15044. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  15045. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  15046. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  15047. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  15048. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  15049. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  15050. }
  15051. }
  15052. class ui_btn6 extends fgui.GButton {
  15053. static createInstance() {
  15054. return (fgui.UIPackage.createObject("loading", "btn6"));
  15055. }
  15056. onConstruct() {
  15057. this.n6 = (this.getChild("n6"));
  15058. this.n1 = (this.getChild("n1"));
  15059. }
  15060. }
  15061. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  15062. class ui_xyItem extends fgui.GComponent {
  15063. static createInstance() {
  15064. return (fgui.UIPackage.createObject("loading", "xyItem"));
  15065. }
  15066. onConstruct() {
  15067. this.xyItem = (this.getChild("xyItem"));
  15068. }
  15069. }
  15070. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  15071. class ui_loadinfo extends fgui.GProgressBar {
  15072. static createInstance() {
  15073. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  15074. }
  15075. onConstruct() {
  15076. this.bg = (this.getChild("bg"));
  15077. this.bar = (this.getChild("bar"));
  15078. this.title = (this.getChild("title"));
  15079. this.ani = (this.getChild("ani"));
  15080. }
  15081. }
  15082. ui_loadinfo.URL = "ui://37nctnhwis36c";
  15083. class ui_xyNode extends fgui.GComponent {
  15084. static createInstance() {
  15085. return (fgui.UIPackage.createObject("loading", "xyNode"));
  15086. }
  15087. onConstruct() {
  15088. this.n0 = (this.getChild("n0"));
  15089. this.btnYes = (this.getChild("btnYes"));
  15090. this.btnNo = (this.getChild("btnNo"));
  15091. this.btnKnown = (this.getChild("btnKnown"));
  15092. this.btnSure = (this.getChild("btnSure"));
  15093. this.txtWelcom = (this.getChild("txtWelcom"));
  15094. this.txtXy = (this.getChild("txtXy"));
  15095. this.n75 = (this.getChild("n75"));
  15096. this.btnXy1 = (this.getChild("btnXy1"));
  15097. this.btnXy3 = (this.getChild("btnXy3"));
  15098. this.btnXy2 = (this.getChild("btnXy2"));
  15099. this.n74 = (this.getChild("n74"));
  15100. this.xy1 = (this.getChild("xy1"));
  15101. this.txtTitle = (this.getChild("txtTitle"));
  15102. this.btnBack = (this.getChild("btnBack"));
  15103. this.xyList = (this.getChild("xyList"));
  15104. this.xy2 = (this.getChild("xy2"));
  15105. this.xyNode = (this.getChild("xyNode"));
  15106. }
  15107. }
  15108. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  15109. class ui_ageNode extends fgui.GComponent {
  15110. static createInstance() {
  15111. return (fgui.UIPackage.createObject("loading", "ageNode"));
  15112. }
  15113. onConstruct() {
  15114. this.n3 = (this.getChild("n3"));
  15115. this.n7 = (this.getChild("n7"));
  15116. this.n4 = (this.getChild("n4"));
  15117. this.btnAge = (this.getChild("btnAge"));
  15118. this.ageNode = (this.getChild("ageNode"));
  15119. }
  15120. }
  15121. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  15122. class ui_rnNode extends fgui.GComponent {
  15123. static createInstance() {
  15124. return (fgui.UIPackage.createObject("loading", "rnNode"));
  15125. }
  15126. onConstruct() {
  15127. this.n28 = (this.getChild("n28"));
  15128. this.n30 = (this.getChild("n30"));
  15129. this.n33 = (this.getChild("n33"));
  15130. this.rn1 = (this.getChild("rn1"));
  15131. this.n40 = (this.getChild("n40"));
  15132. this.n41 = (this.getChild("n41"));
  15133. this.rn3 = (this.getChild("rn3"));
  15134. this.n37 = (this.getChild("n37"));
  15135. this.n39 = (this.getChild("n39"));
  15136. this.rn2 = (this.getChild("rn2"));
  15137. this.n47 = (this.getChild("n47"));
  15138. this.n49 = (this.getChild("n49"));
  15139. this.n44 = (this.getChild("n44"));
  15140. this.inputCode = (this.getChild("inputCode"));
  15141. this.inputName = (this.getChild("inputName"));
  15142. this.n48 = (this.getChild("n48"));
  15143. this.n50 = (this.getChild("n50"));
  15144. this.rn4 = (this.getChild("rn4"));
  15145. this.btnCheck = (this.getChild("btnCheck"));
  15146. this.btnExit = (this.getChild("btnExit"));
  15147. this.btnDone = (this.getChild("btnDone"));
  15148. this.rnNode = (this.getChild("rnNode"));
  15149. }
  15150. }
  15151. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  15152. class ui_tipNode extends fgui.GComponent {
  15153. static createInstance() {
  15154. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15155. }
  15156. onConstruct() {
  15157. this.bg = (this.getChild("bg"));
  15158. this.n55 = (this.getChild("n55"));
  15159. this.n56 = (this.getChild("n56"));
  15160. this.tipNode = (this.getChild("tipNode"));
  15161. }
  15162. }
  15163. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15164. class ui_fcmNode extends fgui.GComponent {
  15165. static createInstance() {
  15166. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15167. }
  15168. onConstruct() {
  15169. this.n63 = (this.getChild("n63"));
  15170. this.n62 = (this.getChild("n62"));
  15171. this.btnRn = (this.getChild("btnRn"));
  15172. this.n61 = (this.getChild("n61"));
  15173. this.n58 = (this.getChild("n58"));
  15174. this.fcmNode = (this.getChild("fcmNode"));
  15175. }
  15176. }
  15177. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15178. class ui_msgNode extends fgui.GComponent {
  15179. static createInstance() {
  15180. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15181. }
  15182. onConstruct() {
  15183. this.n69 = (this.getChild("n69"));
  15184. this.txtMsg = (this.getChild("txtMsg"));
  15185. this.msgNode = (this.getChild("msgNode"));
  15186. }
  15187. }
  15188. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15189. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15190. static createInstance() {
  15191. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15192. }
  15193. onConstruct() {
  15194. this.n1 = (this.getChild("n1"));
  15195. this.n13 = (this.getChild("n13"));
  15196. this.n14 = (this.getChild("n14"));
  15197. this.n15 = (this.getChild("n15"));
  15198. this.n3 = (this.getChild("n3"));
  15199. this.n4 = (this.getChild("n4"));
  15200. this.n5 = (this.getChild("n5"));
  15201. this.n6 = (this.getChild("n6"));
  15202. this.n7 = (this.getChild("n7"));
  15203. this.n8 = (this.getChild("n8"));
  15204. this.n9 = (this.getChild("n9"));
  15205. this.n10 = (this.getChild("n10"));
  15206. this.n12 = (this.getChild("n12"));
  15207. this.n11 = (this.getChild("n11"));
  15208. this.n16 = (this.getChild("n16"));
  15209. this.n17 = (this.getChild("n17"));
  15210. this.n18 = (this.getChild("n18"));
  15211. this.n20 = (this.getChild("n20"));
  15212. this.n21 = (this.getChild("n21"));
  15213. this.t0 = this.getTransition("t0");
  15214. }
  15215. }
  15216. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15217. class ui_btn5 extends fgui.GButton {
  15218. static createInstance() {
  15219. return (fgui.UIPackage.createObject("loading", "btn5"));
  15220. }
  15221. onConstruct() {
  15222. this.n9 = (this.getChild("n9"));
  15223. this.n1 = (this.getChild("n1"));
  15224. }
  15225. }
  15226. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15227. class ui_UILoading extends fgui.GComponent {
  15228. static createInstance() {
  15229. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15230. }
  15231. onConstruct() {
  15232. this.n12 = (this.getChild("n12"));
  15233. this.loadinfo = (this.getChild("loadinfo"));
  15234. this.n13 = (this.getChild("n13"));
  15235. this.txtLoad = (this.getChild("txtLoad"));
  15236. this.n18 = (this.getChild("n18"));
  15237. }
  15238. }
  15239. ui_UILoading.URL = "ui://37nctnhwphc33";
  15240. class ui_AgeItem extends fgui.GComponent {
  15241. static createInstance() {
  15242. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15243. }
  15244. onConstruct() {
  15245. this.txtAge = (this.getChild("txtAge"));
  15246. }
  15247. }
  15248. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15249. class ui_btn1 extends fgui.GButton {
  15250. static createInstance() {
  15251. return (fgui.UIPackage.createObject("loading", "btn1"));
  15252. }
  15253. onConstruct() {
  15254. this.n6 = (this.getChild("n6"));
  15255. this.n1 = (this.getChild("n1"));
  15256. }
  15257. }
  15258. ui_btn1.URL = "ui://37nctnhwxe622p";
  15259. class ui_btn3 extends fgui.GButton {
  15260. static createInstance() {
  15261. return (fgui.UIPackage.createObject("loading", "btn3"));
  15262. }
  15263. onConstruct() {
  15264. this.n9 = (this.getChild("n9"));
  15265. this.n1 = (this.getChild("n1"));
  15266. }
  15267. }
  15268. ui_btn3.URL = "ui://37nctnhwxe622s";
  15269. class ui_btn2 extends fgui.GButton {
  15270. static createInstance() {
  15271. return (fgui.UIPackage.createObject("loading", "btn2"));
  15272. }
  15273. onConstruct() {
  15274. this.n6 = (this.getChild("n6"));
  15275. this.n1 = (this.getChild("n1"));
  15276. }
  15277. }
  15278. ui_btn2.URL = "ui://37nctnhwxe622t";
  15279. class ui_btnBack extends fgui.GButton {
  15280. static createInstance() {
  15281. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15282. }
  15283. onConstruct() {
  15284. this.n6 = (this.getChild("n6"));
  15285. this.n7 = (this.getChild("n7"));
  15286. }
  15287. }
  15288. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15289. class ui_btnXy1 extends fgui.GButton {
  15290. static createInstance() {
  15291. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15292. }
  15293. onConstruct() {
  15294. this.n1 = (this.getChild("n1"));
  15295. }
  15296. }
  15297. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15298. class ui_btnXy2 extends fgui.GButton {
  15299. static createInstance() {
  15300. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15301. }
  15302. onConstruct() {
  15303. this.n1 = (this.getChild("n1"));
  15304. }
  15305. }
  15306. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  15307. class ui_btnXy3 extends fgui.GButton {
  15308. static createInstance() {
  15309. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15310. }
  15311. onConstruct() {
  15312. this.n1 = (this.getChild("n1"));
  15313. }
  15314. }
  15315. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15316. class ui_btn4 extends fgui.GButton {
  15317. static createInstance() {
  15318. return (fgui.UIPackage.createObject("loading", "btn4"));
  15319. }
  15320. onConstruct() {
  15321. this.n9 = (this.getChild("n9"));
  15322. this.n1 = (this.getChild("n1"));
  15323. }
  15324. }
  15325. ui_btn4.URL = "ui://37nctnhwxe622z";
  15326. class loadingBinder {
  15327. static bindAll() {
  15328. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15329. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15330. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15331. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15332. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15333. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15334. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15335. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15336. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15337. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15338. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15339. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15340. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15341. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15342. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15343. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15344. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15345. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15346. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15347. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15348. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15349. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15350. }
  15351. }
  15352. class UIMgr {
  15353. constructor() {
  15354. this._stage = null;
  15355. this._uiList = [];
  15356. this._showList = [];
  15357. this._bindPkgList = [];
  15358. this.uiIndex = 0;
  15359. }
  15360. static get inst() {
  15361. if (UIMgr._inst == null) {
  15362. UIMgr._inst = new UIMgr();
  15363. }
  15364. return UIMgr._inst;
  15365. }
  15366. setStage(s) {
  15367. if (this._stage) {
  15368. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15369. return;
  15370. }
  15371. this._stage = s;
  15372. }
  15373. clearTempData() {
  15374. console.log('zh:clearTempData start');
  15375. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  15376. console.log('zh:clearTempData end');
  15377. }
  15378. init() {
  15379. this.setStage(Laya.stage);
  15380. fairygui.UIConfig.defaultFont = "微软雅黑";
  15381. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15382. fairygui.UIConfig.packageFileExtension = "obj";
  15383. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15384. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15385. fairygui.GRoot.inst.width = Laya.stage.width;
  15386. fairygui.GRoot.inst.height = Laya.stage.height;
  15387. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15388. }
  15389. addAllUpdate() {
  15390. this.uiIndex = 0;
  15391. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15392. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15393. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15394. }
  15395. }
  15396. }
  15397. bindFUI(pkgname) {
  15398. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15399. return;
  15400. }
  15401. switch (pkgname) {
  15402. case fguiRes.loading:
  15403. fairygui.UIPackage.addPackage(pkgname);
  15404. loadingBinder.bindAll();
  15405. this._bindPkgList.push(pkgname);
  15406. break;
  15407. case fguiRes.game:
  15408. fairygui.UIPackage.addPackage(pkgname);
  15409. gameBinder.bindAll();
  15410. this._bindPkgList.push(pkgname);
  15411. break;
  15412. default:
  15413. break;
  15414. }
  15415. }
  15416. Show(cls, ...param) {
  15417. let nameStr = cls.uiName;
  15418. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15419. let temp = this._uiList[i];
  15420. let str = temp.className;
  15421. if (str == nameStr) {
  15422. if (temp.isMuti) {
  15423. if (temp.isHide) {
  15424. temp.show(...param);
  15425. this._uiList.splice(i, 1);
  15426. this._uiList.push(temp);
  15427. return temp;
  15428. }
  15429. }
  15430. else {
  15431. temp.show(...param);
  15432. this._uiList.splice(i, 1);
  15433. this._uiList.push(temp);
  15434. return temp;
  15435. }
  15436. }
  15437. }
  15438. let ui = new cls();
  15439. ui.className = nameStr;
  15440. this._showUI(ui, param);
  15441. return ui;
  15442. }
  15443. destroyUI(ui) {
  15444. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15445. let temp = this._uiList[i].className;
  15446. if (temp == ui.className) {
  15447. this._uiList.splice(i, 1);
  15448. break;
  15449. }
  15450. }
  15451. this.checkUIState();
  15452. }
  15453. _showUI(ui, param) {
  15454. this._uiList.push(ui);
  15455. ui.show(...param);
  15456. }
  15457. Hide(uiClass) {
  15458. let ui = this.getUI(uiClass);
  15459. if (ui && !ui.isHide) {
  15460. ui.hide();
  15461. }
  15462. }
  15463. getUI(ui) {
  15464. let nameStr = ui.uiName;
  15465. for (let index = 0; index < this._uiList.length; index++) {
  15466. let temp = this._uiList[index];
  15467. if (temp.className == nameStr) {
  15468. return temp;
  15469. }
  15470. }
  15471. return null;
  15472. }
  15473. isShow(cls) {
  15474. for (var i of this._uiList) {
  15475. if (i instanceof cls) {
  15476. return i.isShowing;
  15477. }
  15478. }
  15479. return false;
  15480. }
  15481. showUINum() {
  15482. let num = 0;
  15483. for (var i of this._uiList) {
  15484. if (i.isShowing) {
  15485. num++;
  15486. }
  15487. }
  15488. return num;
  15489. }
  15490. checkUIState() {
  15491. Laya.timer.clear(this, this._uiCheck);
  15492. Laya.timer.once(400, this, this._uiCheck);
  15493. }
  15494. _uiCheck() {
  15495. let showList = [];
  15496. for (var i of this._uiList) {
  15497. if (!i.isHide) {
  15498. showList.push(i);
  15499. }
  15500. }
  15501. for (let index = 0; index < showList.length; index++) {
  15502. if (index == showList.length - 1) {
  15503. showList[index].checkActive(true);
  15504. }
  15505. else {
  15506. showList[index].checkActive(false);
  15507. }
  15508. }
  15509. }
  15510. showTip(msg, time = 600, size = 30) {
  15511. }
  15512. }
  15513. class UIShowList {
  15514. }
  15515. class SoundMgr {
  15516. constructor() {
  15517. this.soundMax = 4;
  15518. this.isLoad = false;
  15519. this.soundMap = {};
  15520. this.isSound = true;
  15521. this.openShake = true;
  15522. SoundMgr._instance = this;
  15523. }
  15524. static getInstance() {
  15525. if (!this._instance) {
  15526. this._instance = new SoundMgr();
  15527. }
  15528. return this._instance;
  15529. }
  15530. init() {
  15531. console.log('zh:sm init 1');
  15532. Laya.SoundManager.autoReleaseSound = true;
  15533. Laya.SoundManager.autoStopMusic = true;
  15534. Laya.SoundManager.musicVolume = 0.3;
  15535. Laya.SoundManager.soundVolume = 0.5;
  15536. this.musicPlayed = false;
  15537. this.audioUrl = "asset/sound/ogg/";
  15538. console.log('zh:sm init 2');
  15539. console.log('zh:dev type ');
  15540. if (Laya.Browser.onAndroid) {
  15541. console.log('zh:dev type android');
  15542. this.audioUrl = "asset/sound/ogg/";
  15543. this.isLoad = true;
  15544. }
  15545. else {
  15546. console.log('zh:dev type not android');
  15547. this.audioUrl = "asset/sound/mp3/";
  15548. this.isLoad = true;
  15549. }
  15550. }
  15551. onSetting(isS) {
  15552. this.isSound = isS;
  15553. this.mute(!this.isSound);
  15554. }
  15555. clearCount() {
  15556. for (var key in this.soundMap) {
  15557. delete this.soundMap[key];
  15558. }
  15559. }
  15560. playMusic(path, loop = 0) {
  15561. console.log('zh:playMusic 1 PATH=' + path);
  15562. this.musicPath = path;
  15563. if (!this.isLoad) {
  15564. return;
  15565. }
  15566. if (!path || path == "") {
  15567. return;
  15568. }
  15569. if (!this.isSound) {
  15570. return;
  15571. }
  15572. this.musicPlayed = true;
  15573. let url = this.getUrl(path);
  15574. if (!Laya.Browser.onAndroid) {
  15575. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15576. this.play(url, loop);
  15577. }));
  15578. }
  15579. else {
  15580. this.play(url, loop);
  15581. }
  15582. }
  15583. play(url, loop) {
  15584. Laya.SoundManager.playMusic(url, loop);
  15585. }
  15586. getUrl(path) {
  15587. let url = this.audioUrl + path;
  15588. if (Laya.Browser.onAndroid) {
  15589. url += ".ogg";
  15590. }
  15591. else {
  15592. url += ".mp3";
  15593. }
  15594. return url;
  15595. }
  15596. pauseMusic(pause) {
  15597. if (pause) {
  15598. this.mute(true);
  15599. }
  15600. else if (this.isSound)
  15601. this.mute(false);
  15602. }
  15603. stopMusic() {
  15604. Laya.SoundManager.stopMusic();
  15605. if (Moyu.isNeedPlatAudio) {
  15606. Moyu.stopMusic();
  15607. }
  15608. }
  15609. mute(mute) {
  15610. if (Moyu.isNeedPlatAudio) {
  15611. Moyu.pauseMusic(mute);
  15612. }
  15613. else {
  15614. Laya.SoundManager.musicMuted = mute;
  15615. if (!mute && !this.musicPlayed && this.musicPath) {
  15616. this.playMusic(this.musicPath);
  15617. }
  15618. }
  15619. }
  15620. stopSound(path) {
  15621. let url = this.getUrl(path);
  15622. Laya.SoundManager.stopSound(url);
  15623. }
  15624. playSound(path, loop = 1, soundMax = this.soundMax) {
  15625. if (!this.isLoad)
  15626. return;
  15627. if (!this.isSound)
  15628. return;
  15629. if (!path || path == "")
  15630. return;
  15631. let url = this.getUrl(path);
  15632. if (Moyu.isNeedPlatAudio) {
  15633. Moyu.playSound(path, loop == 0);
  15634. }
  15635. else {
  15636. let count = 1;
  15637. if (this.soundMap[path])
  15638. count = this.soundMap[path] + 1;
  15639. if (count > soundMax)
  15640. return;
  15641. this.soundMap[path] = count;
  15642. Laya.SoundManager.playSound(url, loop);
  15643. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15644. }
  15645. }
  15646. removePath(path) {
  15647. if (this.soundMap[path]) {
  15648. let count = this.soundMap[path];
  15649. count--;
  15650. if (count < 1)
  15651. delete this.soundMap[path];
  15652. else
  15653. this.soundMap[path] = count;
  15654. }
  15655. }
  15656. playBtnSound() {
  15657. this.playSound("btn");
  15658. }
  15659. playGetSound() {
  15660. }
  15661. playCloseUISound() {
  15662. }
  15663. }
  15664. SoundMgr._instance = null;
  15665. var Handler$1 = Laya.Handler;
  15666. var EResType;
  15667. (function (EResType) {
  15668. EResType[EResType["none"] = 0] = "none";
  15669. EResType[EResType["nromal"] = 1] = "nromal";
  15670. EResType[EResType["td"] = 2] = "td";
  15671. EResType[EResType["sk"] = 3] = "sk";
  15672. })(EResType || (EResType = {}));
  15673. class CResLoader {
  15674. constructor(doneCall, proCall) {
  15675. this.completrCall = doneCall;
  15676. this.progressCall = proCall;
  15677. this.progressHander = new Handler$1(this, this.onProgress);
  15678. this.tdResMap = {};
  15679. }
  15680. load(resList) {
  15681. this.resCount = 0;
  15682. this.loadCount = 0;
  15683. for (let i = 0; i < resList.length; i++) {
  15684. let path = resList[i];
  15685. if (!path)
  15686. continue;
  15687. this.resCount++;
  15688. let type = this.getResType(path);
  15689. if (type == EResType.nromal)
  15690. this.loadNromal(path);
  15691. else if (type == EResType.td)
  15692. this.loadTd(path);
  15693. }
  15694. }
  15695. getRes(path) {
  15696. let type = this.getResType(path);
  15697. if (type == EResType.nromal)
  15698. return Laya.loader.getRes(path);
  15699. else if (type == EResType.td) {
  15700. let res = this.tdResMap[path];
  15701. if (res)
  15702. return res.clone();
  15703. return null;
  15704. }
  15705. }
  15706. destroy() {
  15707. this.progressHander.clear();
  15708. this.progressHander = null;
  15709. }
  15710. clearRes(path) {
  15711. let type = this.getResType(path);
  15712. if (type == EResType.nromal)
  15713. Laya.loader.clearRes(path);
  15714. else if (type == EResType.td) {
  15715. let obj = this.tdResMap[path];
  15716. if (obj)
  15717. obj.destroy();
  15718. delete this.tdResMap[path];
  15719. }
  15720. }
  15721. getResType(path) {
  15722. let exs = this.getExtension(path);
  15723. if (exs == "sk")
  15724. return EResType.sk;
  15725. if (exs == "ls" || exs == "lh" || exs == "lm")
  15726. return EResType.td;
  15727. else
  15728. return EResType.nromal;
  15729. }
  15730. getExtension(res) {
  15731. var index = res.lastIndexOf(".");
  15732. return res.substr(index + 1);
  15733. }
  15734. loadNromal(path) {
  15735. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15736. if (res) {
  15737. this.onLoad();
  15738. }
  15739. else
  15740. console.log("load res fail:" + path);
  15741. }), this.progressHander);
  15742. }
  15743. loadSk() {
  15744. }
  15745. loadTd(path) {
  15746. if (this.tdResMap[path]) {
  15747. this.onLoad();
  15748. return;
  15749. }
  15750. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15751. if (res) {
  15752. this.tdResMap[path] = res;
  15753. this.onLoad();
  15754. }
  15755. else
  15756. console.log("load res fail:" + path);
  15757. }));
  15758. }
  15759. onLoad() {
  15760. this.loadCount++;
  15761. this.onProgress(1);
  15762. if (this.loadCount >= this.resCount) {
  15763. this.completrCall.run();
  15764. }
  15765. }
  15766. onProgress(pro) {
  15767. let progress = (this.loadCount + pro) / this.resCount;
  15768. this.progressCall.runWith(progress);
  15769. }
  15770. }
  15771. var Handler$2 = Laya.Handler;
  15772. class ResInfo {
  15773. constructor() {
  15774. this.index = 0;
  15775. }
  15776. }
  15777. class ResMgr {
  15778. constructor() {
  15779. this.resList = [];
  15780. this.doneList = [];
  15781. this.resMap = {};
  15782. this.currentLoad = null;
  15783. this.completeHandler = new Handler$2(this, this.onComplete);
  15784. this.progressHandler = new Handler$2(this, this.onProgress);
  15785. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15786. }
  15787. static getInstance() {
  15788. if (ResMgr._instance == null) {
  15789. ResMgr._instance = new ResMgr();
  15790. }
  15791. return ResMgr._instance;
  15792. }
  15793. loadList(list, completeHandler, progressHandler) {
  15794. if (list.length < 1) {
  15795. completeHandler.run();
  15796. return;
  15797. }
  15798. let info = this.getResInfo();
  15799. info.resList = list;
  15800. info.completeHandler = completeHandler;
  15801. info.progressHandler = progressHandler;
  15802. this.resList.push(info);
  15803. this.startLoad();
  15804. }
  15805. loadFguiRes(list, completeHandler, progressHandler) {
  15806. Laya.loader.load(list, completeHandler, progressHandler);
  15807. }
  15808. loadAny(list, completeHandler, progressHandler) {
  15809. Laya.loader.load(list, completeHandler, progressHandler);
  15810. }
  15811. load(path, completeHandler, progressHandler) {
  15812. let count = this.resMap[path];
  15813. if (count && count > 0) {
  15814. if (completeHandler)
  15815. completeHandler.run();
  15816. }
  15817. else
  15818. this.loadList([path], completeHandler, progressHandler);
  15819. }
  15820. getRes(path) {
  15821. let res = this.resMap[path];
  15822. if (!res)
  15823. this.showLog("资源不存在:" + path);
  15824. else
  15825. return this.loader.getRes(path);
  15826. }
  15827. clearList(list, force = false) {
  15828. if (!list || list.length < 1)
  15829. return;
  15830. let cr = () => {
  15831. for (const k in list) {
  15832. let v = list[k];
  15833. if (!v)
  15834. continue;
  15835. if (force) {
  15836. this.loader.clearRes(v);
  15837. delete this.resMap[v];
  15838. }
  15839. else {
  15840. let count = this.resMap[v];
  15841. if (count && count > 1) {
  15842. count--;
  15843. this.resMap[v] = count;
  15844. }
  15845. else {
  15846. this.loader.clearRes(v);
  15847. delete this.resMap[v];
  15848. }
  15849. }
  15850. }
  15851. if (!window.hasOwnProperty("ks"))
  15852. Laya.Resource.destroyUnusedResources();
  15853. };
  15854. Laya.timer.clearAll(this);
  15855. Laya.timer.once(2000, this, cr);
  15856. }
  15857. clear3D() {
  15858. for (const k in this.loader.tdResMap) {
  15859. this.loader.clearRes(k);
  15860. if (this.resMap[k])
  15861. delete this.resMap[k];
  15862. }
  15863. if (!window.hasOwnProperty("ks"))
  15864. Laya.Resource.destroyUnusedResources();
  15865. }
  15866. clear(path, force = false) {
  15867. this.clearList([path], force);
  15868. }
  15869. getResInfo() {
  15870. if (this.doneList.length > 0)
  15871. return this.doneList.pop();
  15872. else
  15873. return new ResInfo();
  15874. }
  15875. startLoad() {
  15876. if (this.currentLoad)
  15877. return;
  15878. this.currentLoad = this.resList.pop();
  15879. if (this.currentLoad) {
  15880. this.loader.load(this.currentLoad.resList);
  15881. }
  15882. }
  15883. onComplete() {
  15884. if (!this.currentLoad)
  15885. return;
  15886. for (const k in this.currentLoad.resList) {
  15887. let v = this.currentLoad.resList[k];
  15888. let count = this.resMap[v];
  15889. if (count)
  15890. count++;
  15891. else
  15892. count = 1;
  15893. this.resMap[v] = count;
  15894. }
  15895. if (this.currentLoad.completeHandler)
  15896. this.currentLoad.completeHandler.run();
  15897. this.doneList.push(this.currentLoad);
  15898. this.currentLoad = null;
  15899. this.startLoad();
  15900. }
  15901. onProgress(pro) {
  15902. if (!this.currentLoad)
  15903. return;
  15904. if (this.currentLoad.progressHandler)
  15905. this.currentLoad.progressHandler.runWith(pro);
  15906. }
  15907. showLog(str, ...args) {
  15908. console.log("[ResLoader] " + str);
  15909. }
  15910. }
  15911. ResMgr._instance = null;
  15912. class EventMgr extends Laya.EventDispatcher {
  15913. }
  15914. let eventMgr = new EventMgr();
  15915. class ConfigMgr {
  15916. static getInstance() {
  15917. if (!this._instance) {
  15918. this._instance = new ConfigMgr();
  15919. }
  15920. return this._instance;
  15921. }
  15922. init() {
  15923. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15924. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15925. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15926. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15927. }
  15928. getUserInfoByIndex(index) {
  15929. return this.npcJson[index];
  15930. }
  15931. getRandomUserInfo() {
  15932. let index = xGame.tools.random(0, this.npcJson.length);
  15933. return this.npcJson[index];
  15934. }
  15935. getMaxBigMoveLength() {
  15936. return Object.keys(this.levelCfg).length;
  15937. }
  15938. getBigMoveLevelByIndex(index) {
  15939. let cfg = this.levelCfg;
  15940. cfg = cfg[index];
  15941. return cfg;
  15942. }
  15943. getRandomClassicLevel() {
  15944. let cfg = this.classicCfg;
  15945. let num = Object.keys(cfg).length;
  15946. let rand = xGame.common.randomNum(1, num);
  15947. return cfg[rand];
  15948. }
  15949. getPlaceBallByLevel(level) {
  15950. return this.placeBallCfg[level];
  15951. }
  15952. getMaxPlaceBall() {
  15953. return Object.keys(this.placeBallCfg).length;
  15954. }
  15955. }
  15956. class PoolD3Mgr {
  15957. constructor() {
  15958. this.pool = {};
  15959. }
  15960. static get ins() {
  15961. return this._ins || (this._ins = new PoolD3Mgr);
  15962. }
  15963. createList(key, prefab, parent) {
  15964. if (!this.pool[key]) {
  15965. this.pool[key] = {};
  15966. this.pool[key].prefab = prefab;
  15967. this.pool[key].list = [];
  15968. this.pool[key].parent = parent;
  15969. }
  15970. }
  15971. getItem(key) {
  15972. if (!this.pool[key]) {
  15973. return;
  15974. }
  15975. let temp;
  15976. if (this.pool[key].list.length > 0) {
  15977. temp = this.pool[key].list.pop();
  15978. }
  15979. else {
  15980. temp = this.pool[key].prefab.clone();
  15981. if (this.pool[key].parent) {
  15982. this.pool[key].parent.addChild(temp);
  15983. }
  15984. }
  15985. temp.active = true;
  15986. return temp;
  15987. }
  15988. putItem(key, obj) {
  15989. if (!this.pool[key]) {
  15990. return;
  15991. }
  15992. obj.active = false;
  15993. this.pool[key].list.push(obj);
  15994. }
  15995. }
  15996. let context$1 = context;
  15997. let uiMgr = UIMgr.inst;
  15998. let soundMgr = SoundMgr.getInstance();
  15999. let resMgr = ResMgr.getInstance();
  16000. let httpMgr = HttpMgr.getInstance();
  16001. let common = Common.getInstance();
  16002. let cfgMgr = ConfigMgr.getInstance();
  16003. let poolD3Mgr = PoolD3Mgr.ins;
  16004. let d3TexUrl = "res/d3Res/";
  16005. let d3ModeUrl = "res/unityRes/";
  16006. function setStageSize(view) {
  16007. if (view.width) {
  16008. view.width = Laya.stage.width;
  16009. view.height = Laya.stage.height;
  16010. }
  16011. }
  16012. function filledBg(view) {
  16013. let wh = Laya.stage.height / Laya.stage.width;
  16014. if (wh > 16 / 9) {
  16015. view.height = Laya.stage.height;
  16016. view.width = Laya.stage.height / 1334 * 750;
  16017. }
  16018. else {
  16019. view.width = Laya.stage.width;
  16020. view.height = Laya.stage.width / 750 * 1334;
  16021. }
  16022. }
  16023. function setNotch(view) {
  16024. if (view.height) {
  16025. view.y += context$1.notchHeight;
  16026. }
  16027. }
  16028. function showTip(str) {
  16029. uiMgr.Show(UIMsg, str);
  16030. }
  16031. function log(...args) {
  16032. console.log(args);
  16033. }
  16034. let xGame = {
  16035. context: context$1,
  16036. eventMgr,
  16037. resMgr,
  16038. uiMgr,
  16039. soundMgr,
  16040. define,
  16041. tools,
  16042. httpMgr,
  16043. d3TexUrl,
  16044. d3ModeUrl,
  16045. common,
  16046. cfgMgr,
  16047. poolD3Mgr,
  16048. setStageSize,
  16049. filledBg,
  16050. setNotch,
  16051. showTip,
  16052. log,
  16053. };
  16054. window["xGame"] = xGame;
  16055. let dataName = 'tBall_';
  16056. class UserData {
  16057. constructor() {
  16058. this.userId = "";
  16059. this.isAgree = false;
  16060. this.coinNum = 0;
  16061. this.gemNum = 0;
  16062. this.sound = true;
  16063. this.vibration = true;
  16064. this.currentDate = 0;
  16065. this.createTime = 0;
  16066. this.awardTime = 0;
  16067. this.roleId = 1;
  16068. this.roleList = [];
  16069. this.roleAds = [];
  16070. this.dressId = 101;
  16071. this.itemId = 201;
  16072. this.bigSkills = [1, 1, 1, 1, 1];
  16073. this.coin = 4000;
  16074. this.diamond = 0;
  16075. this.skillSuccessTimes = 0;
  16076. this.skillGuide = 0;
  16077. this.skillAccTimes = 0;
  16078. this.placeBallData = [];
  16079. this.shareDiamondTimes = 0;
  16080. this.dailyVideoShareTimes = 0;
  16081. this.secretary = [1, 0];
  16082. this.curSecretary = 0;
  16083. this.ballRod = [1, 0, 0, 0, 0, 1];
  16084. this.curBallRod = 5;
  16085. this.signData = 0;
  16086. this.signTime = 0;
  16087. this.drawTimes = 0;
  16088. this.drawAwardTimes = 0;
  16089. this.dailyfreeDrawTimes = 1;
  16090. this.power = 5;
  16091. this.powerTime = 0;
  16092. this.challengeTimes = 0;
  16093. this.extraSign = 0;
  16094. this.classicTimes = 0;
  16095. this.guideHelpLine = 0;
  16096. this.newUser = true;
  16097. this.rootBallFoul = 0;
  16098. this.timeoutFoul = 0;
  16099. this.roleList = [1];
  16100. }
  16101. saveData() {
  16102. let data = {};
  16103. for (let k in this) {
  16104. data[k.toString()] = this[k];
  16105. }
  16106. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  16107. }
  16108. getData() {
  16109. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  16110. if (ld) {
  16111. let localData = JSON.parse(ld);
  16112. if (localData) {
  16113. for (let k in this) {
  16114. let key = k.toString();
  16115. let data = localData[key];
  16116. if (data != undefined) {
  16117. this[k] = data;
  16118. }
  16119. }
  16120. }
  16121. }
  16122. }
  16123. }
  16124. class ItemData {
  16125. constructor() {
  16126. this.itemList = {};
  16127. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  16128. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  16129. }
  16130. saveData() {
  16131. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  16132. }
  16133. getData() {
  16134. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  16135. if (ld) {
  16136. let localData = JSON.parse(ld);
  16137. if (localData) {
  16138. this.itemList = localData;
  16139. }
  16140. }
  16141. }
  16142. }
  16143. class GameData {
  16144. constructor() {
  16145. this.curLevel = 0;
  16146. this.gameType = 1;
  16147. this.signIdx = 0;
  16148. this.signMax = 0;
  16149. this.rotaryTime = 0;
  16150. this.rotaryCount = 0;
  16151. this.rotaryList = [];
  16152. this.diyCount = 3;
  16153. this.awardIdx = 0;
  16154. this.shareNum = 2;
  16155. this.rankWeek = 0;
  16156. this.rankScore = 0;
  16157. this.gameCount = 0;
  16158. this.trySkill = -1;
  16159. this.tryTime = 0;
  16160. }
  16161. saveData() {
  16162. let data = {};
  16163. for (let k in this) {
  16164. data[k.toString()] = this[k];
  16165. }
  16166. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  16167. }
  16168. getData() {
  16169. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  16170. if (ld) {
  16171. let localData = JSON.parse(ld);
  16172. if (localData) {
  16173. for (let k in this) {
  16174. let key = k.toString();
  16175. let data = localData[key];
  16176. if (data != undefined) {
  16177. this[k] = data;
  16178. }
  16179. }
  16180. }
  16181. }
  16182. }
  16183. }
  16184. class Diy2025GameData {
  16185. constructor() {
  16186. this.challengeMode_overLev = 0;
  16187. this.xszyForClassic = false;
  16188. this.xszyForChallenge = false;
  16189. }
  16190. saveData() {
  16191. let data = {};
  16192. for (let k in this) {
  16193. data[k.toString()] = this[k];
  16194. }
  16195. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  16196. }
  16197. getData() {
  16198. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  16199. if (ld) {
  16200. let localData = JSON.parse(ld);
  16201. if (localData) {
  16202. for (let k in this) {
  16203. let key = k.toString();
  16204. let data = localData[key];
  16205. if (data != undefined) {
  16206. this[k] = data;
  16207. }
  16208. }
  16209. }
  16210. }
  16211. }
  16212. }
  16213. class DataMgr {
  16214. static Init() {
  16215. this.userData = new UserData();
  16216. this.gameData = new GameData();
  16217. this.itemData = new ItemData();
  16218. this.diyGameData = new Diy2025GameData();
  16219. this.userData.getData();
  16220. this.gameData.getData();
  16221. this.itemData.getData();
  16222. this.diyGameData.getData();
  16223. this.roleId = this.userData.roleId;
  16224. this.resetUse();
  16225. }
  16226. static isNewDay() {
  16227. Moyu.isNewDay(this, (isnew) => {
  16228. xGame.common.isNewDay = isnew;
  16229. if (!isnew)
  16230. return;
  16231. DataMgr.setShareDiamondTimes(0, false);
  16232. DataMgr.setDailyVideoShareTimes(0, false);
  16233. DataMgr.setDailyfreeDrawTimes(1);
  16234. DataMgr.setExtraSign(0);
  16235. });
  16236. }
  16237. static deletData() {
  16238. Laya.LocalStorage.clear();
  16239. }
  16240. static upRankData() {
  16241. let num = xGame.common.getAllStarNum();
  16242. if (num > 0)
  16243. Moyu.upRankData(xGame.common.curRankID, num);
  16244. }
  16245. static addItem(id, count = 1) {
  16246. let v = this.itemData.itemList[id];
  16247. if (!v)
  16248. v = { id: id, count: count, adnum: 0, active: true };
  16249. else {
  16250. if (v.active) {
  16251. v.count += count;
  16252. }
  16253. else {
  16254. v.count = count;
  16255. v.active = true;
  16256. }
  16257. }
  16258. this.itemData.itemList[id] = v;
  16259. xGame.soundMgr.playGetSound();
  16260. this.saveItemData();
  16261. }
  16262. static hasItem(id) {
  16263. let v = this.itemData.itemList[id];
  16264. if (v && v.active)
  16265. return true;
  16266. return false;
  16267. }
  16268. static getItem(id) {
  16269. let v = this.itemData.itemList[id];
  16270. return v;
  16271. }
  16272. static getItemCount(id) {
  16273. let v = this.itemData.itemList[id];
  16274. if (v && v.active)
  16275. return v.count;
  16276. return 0;
  16277. }
  16278. static getItemAd(id) {
  16279. let v = this.itemData.itemList[id];
  16280. if (v) {
  16281. return v.adnum;
  16282. }
  16283. return 0;
  16284. }
  16285. static onItemAd(id, num = 1) {
  16286. let v = this.itemData.itemList[id];
  16287. if (!v)
  16288. v = { id: id, count: 1, adnum: num, active: false };
  16289. else
  16290. v.adnum += num;
  16291. this.itemData.itemList[id] = v;
  16292. this.saveItemData();
  16293. }
  16294. static costItem(id, count) {
  16295. let v = this.itemData.itemList[id];
  16296. if (v && v.active) {
  16297. if (v.count < count)
  16298. return false;
  16299. else {
  16300. v.count -= count;
  16301. this.itemData.itemList[id] = v;
  16302. return true;
  16303. }
  16304. }
  16305. return false;
  16306. }
  16307. static resetUse() {
  16308. this.dressId = this.userData.dressId;
  16309. this.itemId = this.userData.itemId;
  16310. }
  16311. static passLevel() {
  16312. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  16313. this.gameData.curLevel++;
  16314. this.curLevel = this.gameData.curLevel;
  16315. this.saveGameData();
  16316. }
  16317. static useRole(id) {
  16318. this.roleId = id;
  16319. if (this.hasRole(id)) {
  16320. this.userData.roleId = id;
  16321. this.saveUserData();
  16322. }
  16323. }
  16324. static addRole(id) {
  16325. if (this.hasRole(id))
  16326. return;
  16327. this.userData.roleList.push(id);
  16328. this.saveUserData();
  16329. }
  16330. static hasRole(id) {
  16331. return this.userData.roleList.indexOf(id) >= 0;
  16332. }
  16333. static gemEnough(num) {
  16334. return this.userData.gemNum >= num;
  16335. }
  16336. static roleHasAd(id) {
  16337. let count = this.userData.roleAds[id];
  16338. if (count != undefined && count >= 0)
  16339. return true;
  16340. else
  16341. return false;
  16342. }
  16343. static saveUserData(time = 500, event, arg) {
  16344. if (this.userSaving)
  16345. return;
  16346. this.userSaving = true;
  16347. Laya.timer.once(time, this, () => {
  16348. this.userSaving = false;
  16349. this.userData.saveData();
  16350. if (event)
  16351. xGame.eventMgr.event(event, arg);
  16352. });
  16353. }
  16354. static saveGameData() {
  16355. if (this.gameSaving)
  16356. return;
  16357. this.gameSaving = true;
  16358. Laya.timer.once(1000, this, () => {
  16359. this.gameSaving = false;
  16360. this.gameData.saveData();
  16361. });
  16362. }
  16363. static saveItemData() {
  16364. let fun = () => {
  16365. this.itemData.saveData();
  16366. };
  16367. Laya.timer.clear(this, fun);
  16368. Laya.timer.once(500, this, fun);
  16369. }
  16370. static saveData() {
  16371. this.saveUserData();
  16372. this.saveGameData();
  16373. }
  16374. static getBigSkillList() {
  16375. return this.userData.bigSkills;
  16376. }
  16377. static getBigSkillByIndex(index) {
  16378. return this.userData.bigSkills[index];
  16379. }
  16380. static setBigSkill(index, val, addUp = true) {
  16381. if (addUp) {
  16382. this.userData.bigSkills[index] += val;
  16383. }
  16384. else {
  16385. this.userData.bigSkills[index] = val;
  16386. }
  16387. this.saveUserData();
  16388. }
  16389. static coinEnough(need) {
  16390. if (typeof need != "number") {
  16391. console.error("金币格式错误");
  16392. return;
  16393. }
  16394. return this.userData.coin >= need;
  16395. }
  16396. static setCoin(val) {
  16397. if (typeof val != "number") {
  16398. return;
  16399. }
  16400. this.userData.coin += val;
  16401. this.saveUserData();
  16402. xGame.eventMgr.event(COIN_CHANGE);
  16403. }
  16404. static getCoin() {
  16405. return this.userData.coin;
  16406. }
  16407. static diamondEnough(need) {
  16408. if (typeof need != "number") {
  16409. console.error("金币格式错误");
  16410. return;
  16411. }
  16412. return this.userData.diamond >= need;
  16413. }
  16414. static setDiamond(val) {
  16415. if (typeof val != "number") {
  16416. return;
  16417. }
  16418. this.userData.diamond += val;
  16419. this.saveUserData();
  16420. xGame.eventMgr.event(DIAMOND_CHANGE);
  16421. }
  16422. static getDiamond() {
  16423. return this.userData.diamond;
  16424. }
  16425. static getSkillSuccessTimes() {
  16426. return this.userData.skillSuccessTimes;
  16427. }
  16428. static setSkillSuccessTimes(val, addUp = true) {
  16429. if (addUp)
  16430. this.userData.skillSuccessTimes += val;
  16431. else
  16432. this.userData.skillSuccessTimes = val;
  16433. this.saveUserData();
  16434. }
  16435. static getSkillAccTimes() {
  16436. return this.userData.skillAccTimes;
  16437. }
  16438. static setSkillAccTimes(val) {
  16439. this.userData.skillAccTimes += val;
  16440. this.saveUserData();
  16441. }
  16442. static getSkillGuide() {
  16443. if (!xGame.common.openGuide) {
  16444. return 1;
  16445. }
  16446. return this.userData.skillGuide;
  16447. }
  16448. static setSkillGuide(val) {
  16449. this.userData.skillGuide = val;
  16450. this.saveUserData();
  16451. }
  16452. static getPlaceBallLevelList() {
  16453. return this.userData.placeBallData;
  16454. }
  16455. static getPlaceBallLevel(level) {
  16456. let arr = this.userData.placeBallData;
  16457. let index = level - 1;
  16458. let out;
  16459. if (arr[index]) {
  16460. out = arr[index];
  16461. }
  16462. else {
  16463. let max = arr.length;
  16464. if (max == index) {
  16465. out = {
  16466. star: 0,
  16467. play: true,
  16468. isCur: true,
  16469. getAward: false
  16470. };
  16471. }
  16472. else {
  16473. out = {
  16474. star: 0,
  16475. play: false,
  16476. getAward: false
  16477. };
  16478. }
  16479. }
  16480. return out;
  16481. }
  16482. static setPlaceBallLevel(level, star) {
  16483. let arr = this.userData.placeBallData;
  16484. let index = level - 1;
  16485. if (arr[index]) {
  16486. arr[index].star = Math.max(arr[index].star, star);
  16487. }
  16488. else {
  16489. let max = arr.length;
  16490. if (max == index) {
  16491. arr.push({
  16492. star: star,
  16493. play: true,
  16494. getAward: false
  16495. });
  16496. }
  16497. else {
  16498. console.error("关卡存储出错");
  16499. }
  16500. }
  16501. this.saveUserData();
  16502. }
  16503. static setPlaceBallAward(level) {
  16504. let arr = this.userData.placeBallData;
  16505. let index = level - 1;
  16506. if (arr[index]) {
  16507. arr[index].getAward = true;
  16508. }
  16509. this.saveUserData();
  16510. }
  16511. static getShareDiamondTimes() {
  16512. return this.userData.shareDiamondTimes;
  16513. }
  16514. static setShareDiamondTimes(val, addUp = true) {
  16515. if (addUp) {
  16516. this.userData.shareDiamondTimes += val;
  16517. }
  16518. else {
  16519. this.userData.shareDiamondTimes = val;
  16520. }
  16521. this.saveUserData();
  16522. }
  16523. static getDailyVideoShareTimes() {
  16524. return this.userData.dailyVideoShareTimes;
  16525. }
  16526. static setDailyVideoShareTimes(val, addUp = true) {
  16527. if (addUp) {
  16528. this.userData.dailyVideoShareTimes += val;
  16529. }
  16530. else {
  16531. this.userData.dailyVideoShareTimes = val;
  16532. }
  16533. this.saveUserData();
  16534. }
  16535. static getSecretary(index) {
  16536. return this.userData.secretary[index];
  16537. }
  16538. static setSecretary(index, val) {
  16539. this.userData.secretary[index] = val;
  16540. this.saveUserData();
  16541. }
  16542. static getCurSecretary() {
  16543. return this.userData.curSecretary;
  16544. }
  16545. static setCurSecretary(index) {
  16546. this.userData.curSecretary = index;
  16547. this.saveUserData();
  16548. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16549. }
  16550. static getBallRod(index) {
  16551. return this.userData.ballRod[index];
  16552. }
  16553. static setBallRod(index, val) {
  16554. this.userData.ballRod[index] = val;
  16555. this.saveUserData();
  16556. }
  16557. static getCurBallRod() {
  16558. return this.userData.curBallRod;
  16559. }
  16560. static setCurBallRod(index) {
  16561. this.userData.curBallRod = index;
  16562. this.saveUserData();
  16563. }
  16564. static setSignData(val) {
  16565. this.userData.signData = val;
  16566. this.saveUserData();
  16567. }
  16568. static getSignData() {
  16569. return this.userData.signData;
  16570. }
  16571. static setSignTime(val) {
  16572. this.userData.signTime = val;
  16573. this.saveUserData();
  16574. }
  16575. static getSignTime() {
  16576. return this.userData.signTime;
  16577. }
  16578. static getDrawTimes() {
  16579. return this.userData.drawTimes;
  16580. }
  16581. static setDrawTimes(val, addUp = true) {
  16582. if (addUp) {
  16583. this.userData.drawTimes += val;
  16584. }
  16585. else {
  16586. this.userData.drawTimes = val;
  16587. }
  16588. this.saveUserData();
  16589. }
  16590. static getDrawAwardTimes() {
  16591. return this.userData.drawAwardTimes;
  16592. }
  16593. static setDrawAwardTimes(val) {
  16594. this.userData.drawAwardTimes = val;
  16595. this.saveUserData();
  16596. }
  16597. static getDailyfreeDrawTimes() {
  16598. return this.userData.dailyfreeDrawTimes;
  16599. }
  16600. static setDailyfreeDrawTimes(val) {
  16601. this.userData.dailyfreeDrawTimes = val;
  16602. this.saveUserData();
  16603. }
  16604. static setPower(val, addUp = true) {
  16605. if (addUp)
  16606. this.userData.power += val;
  16607. else
  16608. this.userData.power = val;
  16609. if (this.userData.power >= xGame.common.maxPower) {
  16610. this.userData.power = xGame.common.maxPower;
  16611. }
  16612. xGame.eventMgr.event(POWER_CHANGE, val);
  16613. this.saveUserData();
  16614. }
  16615. static getPower() {
  16616. return this.userData.power;
  16617. }
  16618. static setPowerTime(val) {
  16619. this.userData.powerTime = val;
  16620. this.saveUserData();
  16621. }
  16622. static getPowerTime() {
  16623. return this.userData.powerTime;
  16624. }
  16625. static powerEnough() {
  16626. return this.getPower() > 0;
  16627. }
  16628. static getChallengeTimes() {
  16629. return this.userData.challengeTimes;
  16630. }
  16631. static setChallengeTimes(val) {
  16632. this.userData.challengeTimes += val;
  16633. this.saveUserData();
  16634. }
  16635. static getExtraSign() {
  16636. return this.userData.extraSign;
  16637. }
  16638. static setExtraSign(val) {
  16639. this.userData.extraSign = val;
  16640. this.saveUserData();
  16641. }
  16642. static getClassicTimes() {
  16643. return this.userData.classicTimes;
  16644. }
  16645. static setClassicTimes() {
  16646. this.userData.classicTimes += 1;
  16647. this.saveUserData();
  16648. }
  16649. static getGuideHelpLine() {
  16650. return this.userData.guideHelpLine;
  16651. }
  16652. static setGuideHelpLine() {
  16653. this.userData.guideHelpLine = 1;
  16654. this.saveUserData();
  16655. }
  16656. static getNewUser() {
  16657. return this.userData.newUser;
  16658. }
  16659. static setNewUser() {
  16660. this.userData.newUser = false;
  16661. this.saveUserData();
  16662. }
  16663. static getRootBallFoul() {
  16664. return this.userData.rootBallFoul;
  16665. }
  16666. static setRootBallFoul() {
  16667. this.userData.rootBallFoul = 1;
  16668. this.saveUserData();
  16669. }
  16670. static getTimeoutFoul() {
  16671. return this.userData.timeoutFoul;
  16672. }
  16673. static setTimeoutFoul() {
  16674. this.userData.timeoutFoul = 1;
  16675. this.saveUserData();
  16676. }
  16677. static saveDiyGameData() {
  16678. if (this.diyGameSaving)
  16679. return;
  16680. this.diyGameSaving = true;
  16681. Laya.timer.once(500, this, () => {
  16682. this.diyGameSaving = false;
  16683. this.diyGameData.saveData();
  16684. });
  16685. }
  16686. static getChallengeMode_overLev() {
  16687. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  16688. return this.challengeMode_overLev;
  16689. }
  16690. static setChallengeMode_overLev(levNum) {
  16691. this.diyGameData.challengeMode_overLev = levNum;
  16692. this.saveDiyGameData();
  16693. }
  16694. }
  16695. DataMgr.isNewUser = false;
  16696. DataMgr.fristEnter = true;
  16697. DataMgr.levelType = 0;
  16698. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  16699. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  16700. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  16701. DataMgr.challengeMode_overLev = 0;
  16702. DataMgr.xszyForClassic = false;
  16703. DataMgr.xszyForChallenge = false;
  16704. DataMgr.awardId = 0;
  16705. DataMgr.awardCoin = 0;
  16706. DataMgr.sceneId = -1;
  16707. DataMgr.tryId = 0;
  16708. DataMgr.curLevel = 1;
  16709. DataMgr.vipLevel = 0;
  16710. DataMgr.maxLevel = 0;
  16711. DataMgr.awardRatio = 1;
  16712. DataMgr.gameList = [];
  16713. DataMgr.rankList = [];
  16714. DataMgr.recoverTime = 480000;
  16715. DataMgr.minScore = 0;
  16716. DataMgr.rankDis = 0;
  16717. DataMgr.userSaving = false;
  16718. DataMgr.gameSaving = false;
  16719. DataMgr.diyGameSaving = false;
  16720. class D3Tween extends Laya.Script3D {
  16721. constructor() {
  16722. super();
  16723. this.isInited = false;
  16724. }
  16725. ;
  16726. init() {
  16727. if (this.isInited)
  16728. return;
  16729. this.isInited = true;
  16730. this.gameObj = this.owner;
  16731. this.transform = this.gameObj.transform;
  16732. }
  16733. get rotX() {
  16734. return this.transform.localRotationEulerX;
  16735. }
  16736. set rotX(v) {
  16737. this.transform.localRotationEulerX = v;
  16738. }
  16739. get rotY() {
  16740. return this.transform.localRotationEulerY;
  16741. }
  16742. set rotY(v) {
  16743. this.transform.localRotationEulerY = v;
  16744. }
  16745. get rotZ() {
  16746. return this.transform.localRotationEulerZ;
  16747. }
  16748. set rotZ(v) {
  16749. this.transform.localRotationEulerZ = v;
  16750. }
  16751. get posX() {
  16752. return this.transform.localPositionX;
  16753. }
  16754. set posX(v) {
  16755. this.transform.localPositionX = v;
  16756. }
  16757. get posY() {
  16758. return this.transform.localPositionY;
  16759. }
  16760. set posY(v) {
  16761. this.transform.localPositionY = v;
  16762. }
  16763. get posZ() {
  16764. return this.transform.localPositionZ;
  16765. }
  16766. set posZ(v) {
  16767. this.transform.localPositionZ = v;
  16768. }
  16769. get rotation() {
  16770. return this.transform.localRotation;
  16771. }
  16772. set rotation(v) {
  16773. this.transform.localRotation = v;
  16774. }
  16775. }
  16776. class D2Hole extends Laya.Script {
  16777. constructor() { super(); }
  16778. onTriggerEnter(collider) {
  16779. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16780. return;
  16781. }
  16782. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16783. if (collider.owner["mySrc"].isRunSkillAni) {
  16784. return;
  16785. }
  16786. if (collider.owner["mySrc"].number != 0) {
  16787. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16788. }
  16789. xGame.common.ballColliHole(collider);
  16790. xGame.common.recoverCameraView();
  16791. }
  16792. }
  16793. }
  16794. class Table extends Laya.Script3D {
  16795. constructor() {
  16796. super();
  16797. this.isSetBorder = false;
  16798. this.inited = false;
  16799. }
  16800. ;
  16801. onAwake() {
  16802. this.init();
  16803. }
  16804. init() {
  16805. if (this.inited)
  16806. return;
  16807. this.inited = true;
  16808. this.gameObj = this.owner;
  16809. this.border = this.gameObj.getChildByName("border");
  16810. }
  16811. setBorderPos() {
  16812. if (this.isSetBorder)
  16813. return;
  16814. this.isSetBorder = true;
  16815. let ui = xGame.common.gameUI.ui;
  16816. let bar1 = this.border.getChildByName("bar1");
  16817. let bar2 = this.border.getChildByName("bar2");
  16818. let bar3 = this.border.getChildByName("bar3");
  16819. let bar4 = this.border.getChildByName("bar4");
  16820. let bar5 = this.border.getChildByName("bar5");
  16821. let bar6 = this.border.getChildByName("bar6");
  16822. this.setInfo(bar1, ui.border.bar1, "box");
  16823. this.setInfo(bar2, ui.border.bar2, "box");
  16824. this.setInfo(bar3, ui.border.bar3, "box");
  16825. this.setInfo(bar4, ui.border.bar4, "box");
  16826. this.setInfo(bar5, ui.border.bar5, "box");
  16827. this.setInfo(bar6, ui.border.bar6, "box");
  16828. let circle1 = this.border.getChildByName("circle1");
  16829. let circle2 = this.border.getChildByName("circle2");
  16830. let circle3 = this.border.getChildByName("circle3");
  16831. let circle4 = this.border.getChildByName("circle4");
  16832. let circle5 = this.border.getChildByName("circle5");
  16833. let circle6 = this.border.getChildByName("circle6");
  16834. this.setInfo(circle1, ui.border.circle1, "circle");
  16835. this.setInfo(circle2, ui.border.circle2, "circle");
  16836. this.setInfo(circle3, ui.border.circle3, "circle");
  16837. this.setInfo(circle4, ui.border.circle4, "circle");
  16838. this.setInfo(circle5, ui.border.circle5, "circle");
  16839. this.setInfo(circle6, ui.border.circle6, "circle");
  16840. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16841. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16842. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16843. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16844. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16845. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16846. let arr = xGame.common.gameMgr.holePosList;
  16847. xGame.common.gameMgr.posObj = {
  16848. "1": arr[0],
  16849. "3": arr[2],
  16850. "4": arr[3],
  16851. "6": arr[5]
  16852. };
  16853. }
  16854. initHolePos(x, y) {
  16855. if (x < 300)
  16856. x += 25;
  16857. else if (x > 1000)
  16858. x -= 25;
  16859. else if (y > 200)
  16860. y -= 10;
  16861. else
  16862. y += 10;
  16863. if (y < 200)
  16864. y += 30;
  16865. else if (y > 500)
  16866. y -= 30;
  16867. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16868. }
  16869. setInfo(d3Obj, d2Obj, type) {
  16870. let ui = xGame.common.gameUI.ui;
  16871. let sprite = new Laya.Sprite();
  16872. ui.border.displayObject.addChild(sprite);
  16873. let colli = xGame.common.getCollider(type);
  16874. sprite.addComponentIntance(colli);
  16875. let rigy = xGame.common.getRigbody();
  16876. rigy.type = "static";
  16877. sprite.addComponentIntance(rigy);
  16878. let d3Pos = d3Obj.transform.position;
  16879. xGame.common.pos3to2Convert(d3Pos);
  16880. let scaleX = d3Obj.transform.localScaleX;
  16881. let scaleZ = d3Obj.transform.localScaleZ;
  16882. let width = xGame.common.scale3to2Convert(scaleZ);
  16883. let height = xGame.common.scale3to2Convert(scaleX);
  16884. sprite.pivotX = width / 2;
  16885. sprite.pivotY = height / 2;
  16886. sprite.x = d3Pos.x;
  16887. sprite.y = d3Pos.y;
  16888. sprite.width = width;
  16889. sprite.height = height;
  16890. d2Obj.x = d3Pos.x;
  16891. d2Obj.y = d3Pos.y;
  16892. d2Obj.width = width;
  16893. d2Obj.height = height;
  16894. if (type == "box") {
  16895. colli.width = width;
  16896. colli.height = height;
  16897. colli.isSensor = false;
  16898. colli.label = "border";
  16899. }
  16900. else {
  16901. colli.radius = width / 2;
  16902. colli.isSensor = true;
  16903. colli.label = "hole";
  16904. sprite.addComponent(D2Hole);
  16905. }
  16906. }
  16907. }
  16908. class D3World extends Laya.Script3D {
  16909. constructor() {
  16910. super();
  16911. this.loadNum = 0;
  16912. this.setLoadNum = 7;
  16913. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16914. }
  16915. onAwake() {
  16916. }
  16917. loadScene() {
  16918. this.scene = this.owner;
  16919. let url = `res/unityRes/root.lh`;
  16920. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16921. this.scene.addChild(prefab);
  16922. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16923. this.putCameraInfo();
  16924. this.camera.enableHDR = false;
  16925. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16926. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16927. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16928. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16929. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16930. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16931. this.knife.active = false;
  16932. this.loadD3Obj();
  16933. }));
  16934. }
  16935. putCameraInfo() {
  16936. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16937. this.cameraObj = new cameraType();
  16938. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16939. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16940. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16941. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16942. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16943. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16944. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16945. this.visitAngleChild.init();
  16946. this.visitRootObj.posX = this.visitAngleChild.posX;
  16947. this.visitRootObj.posY = this.visitAngleChild.posY;
  16948. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16949. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16950. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16951. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16952. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16953. xGame.common.showOneCamera("mainCamera");
  16954. }
  16955. loadD3Obj() {
  16956. this.loadTable();
  16957. this.loadRoom();
  16958. this.loadInHoleParticial();
  16959. this.loadIceParticial();
  16960. this.loadHitParticial();
  16961. this.loadFireworksParticial();
  16962. this.loadBall();
  16963. }
  16964. loadInHoleParticial() {
  16965. this.loadD3Res("inHoleEft", "", (prefab) => {
  16966. prefab.addComponent(Partical);
  16967. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16968. });
  16969. }
  16970. loadIceParticial() {
  16971. this.loadD3Res("iceEft", "", (prefab) => {
  16972. prefab.addComponent(Partical);
  16973. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16974. });
  16975. }
  16976. loadHitParticial() {
  16977. this.loadD3Res("hitEft", "", (prefab) => {
  16978. prefab.addComponent(Partical);
  16979. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16980. });
  16981. }
  16982. loadFireworksParticial() {
  16983. this.loadD3Res("fireworksEft", "", (prefab) => {
  16984. prefab.addComponent(Partical);
  16985. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16986. });
  16987. }
  16988. loadBall(index = 1) {
  16989. this.loadD3Res("ball", index, (prefab) => {
  16990. this.ballPrefab = prefab;
  16991. this.ballPrefab.addComponent(Ball);
  16992. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16993. });
  16994. }
  16995. loadTable(index = 1) {
  16996. this.loadD3Res("table", index, (prefab) => {
  16997. this.tableSrc = prefab.addComponent(Table);
  16998. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16999. this.d3Hand.init();
  17000. this.tableRoot.addChild(prefab);
  17001. });
  17002. }
  17003. loadRoom(index = 1) {
  17004. this.loadD3Res("room", index, (prefab) => {
  17005. this.roomRoot.addChild(prefab);
  17006. });
  17007. }
  17008. loadD3Res(type, index, callback) {
  17009. let url = `res/unityRes/${type}${index}.lh`;
  17010. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  17011. callback && callback(prefab);
  17012. this.checkResLoad();
  17013. }));
  17014. }
  17015. checkResLoad() {
  17016. this.loadNum++;
  17017. if (this.loadNum >= this.setLoadNum) {
  17018. xGame.eventMgr.event(D3RES_LOADED);
  17019. }
  17020. }
  17021. prePlayEft() {
  17022. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  17023. eft.transform.localPositionX = 0;
  17024. eft.transform.localPositionY = -5;
  17025. eft.transform.localPositionZ = 0;
  17026. eft.active = true;
  17027. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  17028. ice.transform.localPositionX = 0;
  17029. ice.transform.localPositionY = -5;
  17030. ice.transform.localPositionZ = 0;
  17031. ice.active = true;
  17032. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  17033. hit.transform.localPositionX = 0;
  17034. hit.transform.localPositionY = -5;
  17035. hit.transform.localPositionZ = 0;
  17036. hit.active = true;
  17037. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  17038. fireworks.transform.localPositionX = 0;
  17039. fireworks.transform.localPositionY = -5;
  17040. fireworks.transform.localPositionZ = 0;
  17041. fireworks.active = true;
  17042. }
  17043. }
  17044. class cameraType {
  17045. }
  17046. class MoyuMgr$1 {
  17047. static initMoyu() {
  17048. this.moyuView = new MoyuView$1();
  17049. Laya.stage.addChild(this.moyuView.ui.displayObject);
  17050. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  17051. this.moyuView.ui.displayObject.zOrder = 1000;
  17052. this.moyuView.init();
  17053. this.moyuView.showTip(true);
  17054. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  17055. window['XApk'] = this;
  17056. }
  17057. static showAge(show) {
  17058. if (this.moyuView)
  17059. this.moyuView.showAge(show);
  17060. }
  17061. static onPlatMsg(idx) {
  17062. if (!MoyuMgr$1.moyuView)
  17063. return;
  17064. if (idx == '0') {
  17065. MoyuMgr$1.moyuView.showTip(false);
  17066. }
  17067. }
  17068. static showAgree(call) {
  17069. if (this.moyuView)
  17070. this.moyuView.showAgree(call);
  17071. else
  17072. call && call();
  17073. }
  17074. static showXy(type = 1) {
  17075. if (this.moyuView)
  17076. this.moyuView.showXy(type);
  17077. }
  17078. }
  17079. MoyuMgr$1.isAdvise = false;
  17080. class MoyuView$1 {
  17081. constructor() {
  17082. this.ysxyNum = 1;
  17083. this.ysJson = null;
  17084. this.ui = ui_UIMoyu.createInstance();
  17085. }
  17086. init() {
  17087. this.ui.mainBg.visible = false;
  17088. this.ui.xyNode.visible = false;
  17089. this.ui.ageNode.visible = false;
  17090. this.ui.tipNode.visible = false;
  17091. this.ui.rnNode.visible = false;
  17092. this.ui.fcmNode.visible = false;
  17093. this.ui.ageTip.visible = false;
  17094. this.ui.msgNode.visible = false;
  17095. this.ui.visible = false;
  17096. this.ui.xyNode.xyList.setVirtual();
  17097. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  17098. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  17099. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  17100. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  17101. this.ui.xyNode.btnKnown.visible = false;
  17102. this.ui.xyNode.xy1.visible = false;
  17103. this.ui.xyNode.xy2.visible = false;
  17104. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  17105. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  17106. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  17107. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  17108. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  17109. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  17110. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  17111. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  17112. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  17113. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  17114. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  17115. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  17116. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  17117. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  17118. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  17119. this.ysxyNum = 2;
  17120. }
  17121. }
  17122. onClick(obj) {
  17123. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  17124. switch (obj) {
  17125. case this.ui.ageTip:
  17126. if (Moyu.isTTApk) {
  17127. this.ui.ageNode.visible = true;
  17128. this.ui.mainBg.visible = true;
  17129. }
  17130. break;
  17131. case this.ui.tipNode:
  17132. this.showTip(false);
  17133. break;
  17134. case this.ui.ageNode.btnAge:
  17135. this.ui.ageNode.visible = false;
  17136. this.ui.mainBg.visible = false;
  17137. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  17138. this.ui.visible = false;
  17139. break;
  17140. case this.ui.xyNode.btnXy3:
  17141. case this.ui.xyNode.btnXy1:
  17142. this.loadXy(1);
  17143. break;
  17144. case this.ui.xyNode.btnXy2:
  17145. this.loadXy(2);
  17146. break;
  17147. case this.ui.xyNode.btnBack:
  17148. this.ui.xyNode.xy1.visible = true;
  17149. this.ui.xyNode.xy2.visible = false;
  17150. break;
  17151. case this.ui.xyNode.btnKnown:
  17152. this.ui.xyNode.visible = false;
  17153. this.ui.mainBg.visible = false;
  17154. this.ui.visible = false;
  17155. break;
  17156. case this.ui.rnNode.btnCheck:
  17157. this.check();
  17158. break;
  17159. case this.ui.rnNode.btnExit:
  17160. case this.ui.xyNode.btnNo:
  17161. this.ysxyNum--;
  17162. if (this.ysxyNum > 0)
  17163. this.showMsg("Refuse to quit the game once again");
  17164. else {
  17165. Moyu.userAgree(false);
  17166. Moyu.exit();
  17167. }
  17168. break;
  17169. case this.ui.xyNode.btnSure:
  17170. case this.ui.xyNode.btnYes:
  17171. DataMgr.userData.isAgree = true;
  17172. DataMgr.saveUserData();
  17173. this.onAgree();
  17174. break;
  17175. case this.ui.rnNode.btnDone:
  17176. this.ui.rnNode.visible = false;
  17177. this.ui.visible = false;
  17178. break;
  17179. case this.ui.fcmNode.btnRn:
  17180. this.showRn();
  17181. break;
  17182. }
  17183. }
  17184. showTip(show) {
  17185. if (!Moyu.isVVApk && !Moyu.isOPApk)
  17186. return;
  17187. if (show) {
  17188. MoyuMgr$1.isAdvise = true;
  17189. this.ui.visible = true;
  17190. this.ui.tipNode.visible = true;
  17191. this.ui.tipNode.alpha = 1;
  17192. Laya.timer.once(1000, this, this.showTip, [false]);
  17193. }
  17194. else {
  17195. this.ui.tipNode.alpha = 1;
  17196. this.ui.tipNode.visible = true;
  17197. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  17198. this.ui.tipNode.visible = false;
  17199. MoyuMgr$1.isAdvise = false;
  17200. }), 1000);
  17201. }
  17202. }
  17203. showAge(show, px = 0, py = 0) {
  17204. if (Moyu.platType > 10 && !Moyu.isIos) {
  17205. this.ui.ageTip.x = px;
  17206. this.ui.ageTip.y = py;
  17207. this.ui.ageTip.visible = show;
  17208. if (show)
  17209. this.ui.visible = true;
  17210. }
  17211. }
  17212. showAgree(call) {
  17213. this.agreeCall = call;
  17214. this.onAgree();
  17215. return;
  17216. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  17217. this.showXy(0);
  17218. }
  17219. else
  17220. this.onAgree();
  17221. }
  17222. onAgree() {
  17223. if (!this.ui.ageNode.visible)
  17224. this.ui.visible = false;
  17225. this.ui.xyNode.visible = false;
  17226. Moyu.userAgree(true);
  17227. this.showAge(false);
  17228. this.agreeCall && this.agreeCall();
  17229. this.showRn();
  17230. }
  17231. showMsg(txt) {
  17232. this.ui.msgNode.txtMsg.text = txt;
  17233. this.ui.msgNode.visible = true;
  17234. this.ui.msgNode.alpha = 1;
  17235. this.ui.visible = true;
  17236. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  17237. this.ui.msgNode.visible = false;
  17238. }), 2500, true);
  17239. }
  17240. showRn() {
  17241. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17242. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  17243. this.ui.rnNode.rn1.visible = true;
  17244. this.ui.rnNode.rn2.visible = false;
  17245. this.ui.rnNode.rn3.visible = false;
  17246. this.ui.rnNode.rn4.visible = false;
  17247. this.ui.rnNode.visible = true;
  17248. this.ui.mainBg.visible = true;
  17249. this.ui.rnNode.btnDone.visible = false;
  17250. this.ui.rnNode.btnExit.visible = true;
  17251. this.ui.rnNode.btnCheck.visible = true;
  17252. this.ui.fcmNode.visible = false;
  17253. this.ui.visible = true;
  17254. return;
  17255. }
  17256. }
  17257. this.showFcm();
  17258. }
  17259. showFcm() {
  17260. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17261. Moyu.initFCM(true);
  17262. if (Moyu.gameTime < 1)
  17263. this.fcmLoop();
  17264. else if (Moyu.gameTime < 999)
  17265. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  17266. }
  17267. }
  17268. fcmLoop() {
  17269. if (Moyu.gameTime < 1) {
  17270. this.ui.rnNode.visible = false;
  17271. this.ui.fcmNode.visible = true;
  17272. this.ui.mainBg.visible = true;
  17273. this.ui.visible = true;
  17274. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  17275. Laya.timer.clear(this.ui, this.fcmLoop);
  17276. }
  17277. }
  17278. check() {
  17279. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  17280. this.ui.rnNode.rn1.visible = false;
  17281. this.ui.rnNode.rn2.visible = false;
  17282. this.ui.rnNode.rn4.visible = true;
  17283. }
  17284. else if (this.ui.rnNode.rn4.visible) {
  17285. let name = this.ui.rnNode.inputName.text;
  17286. let code = this.ui.rnNode.inputCode.text;
  17287. if (code && code.length == 18) {
  17288. this.ui.rnNode.rn1.visible = false;
  17289. this.ui.rnNode.rn4.visible = false;
  17290. Moyu.authenticate(name, code, (res) => {
  17291. this.ui.rnNode.rn2.visible = !res;
  17292. this.ui.rnNode.rn3.visible = res;
  17293. this.ui.rnNode.btnDone.visible = res;
  17294. this.ui.rnNode.btnExit.visible = !res;
  17295. this.ui.rnNode.btnCheck.visible = !res;
  17296. if (res)
  17297. this.showFcm();
  17298. });
  17299. }
  17300. else
  17301. this.showMsg("信息填写不完整");
  17302. }
  17303. }
  17304. loadXy(type = 0) {
  17305. this.ui.xyNode.xy1.visible = false;
  17306. this.ui.xyNode.xy2.visible = true;
  17307. this.ui.xyNode.xyList.scrollToView(0);
  17308. if (type == 1) {
  17309. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  17310. }
  17311. else if (type == 2) {
  17312. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  17313. }
  17314. }
  17315. showXy(type = 0) {
  17316. this.xyBtn();
  17317. if (type == 0) {
  17318. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  17319. this.ui.xyNode.btnSure.visible = true;
  17320. }
  17321. else {
  17322. this.ui.xyNode.btnYes.visible = true;
  17323. this.ui.xyNode.btnNo.visible = true;
  17324. }
  17325. }
  17326. else {
  17327. this.ui.xyNode.btnKnown.visible = true;
  17328. this.ui.mainBg.visible = true;
  17329. }
  17330. this.ui.xyNode.xy1.visible = true;
  17331. this.ui.xyNode.xy2.visible = false;
  17332. this.ui.xyNode.visible = true;
  17333. this.ui.visible = true;
  17334. }
  17335. xyBtn() {
  17336. this.ui.xyNode.btnSure.visible = false;
  17337. this.ui.xyNode.btnYes.visible = false;
  17338. this.ui.xyNode.btnNo.visible = false;
  17339. this.ui.xyNode.btnKnown.visible = false;
  17340. {
  17341. this.ui.xyNode.btnXy3.visible = false;
  17342. this.ui.xyNode.btnXy2.visible = true;
  17343. this.ui.xyNode.btnXy1.visible = true;
  17344. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  17345. }
  17346. }
  17347. createXY(json) {
  17348. this.ysJson = json.content;
  17349. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  17350. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  17351. this.ui.xyNode.xy2.visible = true;
  17352. }
  17353. renderListItem(idx, cell) {
  17354. let xy = this.ysJson[idx];
  17355. cell.height = xy.line * 30;
  17356. cell.xyItem.text = xy.text;
  17357. }
  17358. onDestroy() {
  17359. this.agreeCall = null;
  17360. }
  17361. }
  17362. class UILoading extends UIBase {
  17363. constructor() {
  17364. super();
  17365. this.accTime = 0;
  17366. this.curNum = 0;
  17367. this.rate = 1;
  17368. this.loadSubOk = false;
  17369. this.loadResOK = false;
  17370. this.openLoading = true;
  17371. this.beginLoadRes = false;
  17372. this.finishD2 = false;
  17373. this.finishD3 = false;
  17374. }
  17375. onConstructor() {
  17376. this.ui = ui_UILoading.createInstance();
  17377. this.contentPane = this.ui;
  17378. this.isEject = false;
  17379. this._initUI();
  17380. this._addEvent();
  17381. }
  17382. _initUI() {
  17383. MoyuMgr$1.initMoyu();
  17384. }
  17385. _addEvent() {
  17386. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  17387. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  17388. }
  17389. show() {
  17390. super.show();
  17391. console.log('zh:加载分包资源');
  17392. loadSubRes(this.subResProgress.bind(this));
  17393. this.ui.txtLoad.text = "Loading...";
  17394. }
  17395. subResProgress(pro, finish) {
  17396. this.curNum = pro;
  17397. if (finish) {
  17398. this.curNum = 1;
  17399. this.loadSubOk = true;
  17400. }
  17401. }
  17402. laodD3Res() {
  17403. let scene3D = new Laya.Scene3D();
  17404. xGame.common.d3Scene = scene3D;
  17405. xGame.common.d3World = scene3D.addComponent(D3World);
  17406. xGame.common.d3World.loadScene();
  17407. }
  17408. loadD2Res() {
  17409. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  17410. this.finishD2 = true;
  17411. this.checkLoadAll();
  17412. this.curNum = 1;
  17413. }), Laya.Handler.create(this, (pro) => {
  17414. this.curNum = pro;
  17415. }, null, false));
  17416. }
  17417. d3ResFinish() {
  17418. this.finishD3 = true;
  17419. this.checkLoadAll();
  17420. }
  17421. checkLoadAll() {
  17422. if (this.finishD2 && this.finishD3) {
  17423. this.loadResOK = true;
  17424. }
  17425. }
  17426. loadRes() {
  17427. this.laodD3Res();
  17428. this.loadD2Res();
  17429. }
  17430. myUpdate(dt) {
  17431. if (!this.openLoading)
  17432. return;
  17433. this.accTime += dt * this.rate;
  17434. if (this.accTime >= this.curNum)
  17435. this.accTime = this.curNum;
  17436. this.ui.loadinfo.value = this.accTime * 100;
  17437. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  17438. if (!this.beginLoadRes) {
  17439. this.beginLoadRes = true;
  17440. this.ui.txtLoad.text = "Loading...";
  17441. this.curNum = 0;
  17442. this.accTime = 0;
  17443. this.loadRes();
  17444. }
  17445. if (this.loadResOK) {
  17446. this.openLoading = false;
  17447. Laya.timer.once(300, this, () => {
  17448. xGame.common.d3Scene.active = false;
  17449. MoyuMgr$1.showAgree(enterGame);
  17450. });
  17451. }
  17452. }
  17453. }
  17454. release() {
  17455. }
  17456. hide() {
  17457. super.hide();
  17458. this.release();
  17459. }
  17460. onClose() {
  17461. this.hide();
  17462. }
  17463. }
  17464. UILoading.uiName = "UILoading";
  17465. class UIRepentProp$1 extends UIBase {
  17466. constructor() {
  17467. super();
  17468. this.viewType = 0;
  17469. this.regretType = 0;
  17470. }
  17471. onConstructor() {
  17472. this.ui = ui_UIRepentProp.createInstance();
  17473. this.contentPane = this.ui;
  17474. this.isEject = false;
  17475. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17476. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17477. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17478. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17479. }
  17480. show(viewType, regretType, callback) {
  17481. PlatMgr.showInsert(true);
  17482. this.viewType = viewType;
  17483. this.regretType = regretType;
  17484. this.callback = callback;
  17485. super.show();
  17486. this.ui.t0.play();
  17487. this.ui.c1.selectedIndex = this.viewType;
  17488. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17489. if (this.viewType == 0) {
  17490. let guide = DataMgr.getGuideHelpLine();
  17491. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17492. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17493. }
  17494. xGame.common.gameMgr.gamePause = true;
  17495. }
  17496. hideSelf() {
  17497. xGame.common.gameMgr.gamePause = false;
  17498. this.callback && this.callback(false);
  17499. this.hide();
  17500. }
  17501. videoRegret() {
  17502. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  17503. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  17504. }
  17505. else {
  17506. console.log('zh:AD 失败,直接发放奖励');
  17507. this.qjff_AD_for_UIrepentProp_videoRegret();
  17508. }
  17509. }
  17510. qjff_AD_for_UIrepentProp_videoRegret() {
  17511. this.callback && this.callback(true);
  17512. this.hideSelf();
  17513. }
  17514. videoAddHelpLine() {
  17515. let guide = DataMgr.getGuideHelpLine();
  17516. if (guide == 0) {
  17517. this.callback && this.callback(true);
  17518. this.hideSelf();
  17519. DataMgr.setGuideHelpLine();
  17520. xGame.common.gameUI.ui.guideNode.visible = false;
  17521. }
  17522. else {
  17523. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  17524. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  17525. }
  17526. else {
  17527. console.log('zh:AD 失败,直接发放奖励');
  17528. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  17529. }
  17530. }
  17531. }
  17532. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  17533. this.callback && this.callback(true);
  17534. this.hideSelf();
  17535. }
  17536. }
  17537. UIRepentProp$1.uiName = "UIRepentProp";
  17538. class UIRodMethod$1 extends UIBase {
  17539. constructor() {
  17540. super();
  17541. this.isPressd = false;
  17542. }
  17543. onConstructor() {
  17544. this.ui = ui_UIRodMethod.createInstance();
  17545. this.contentPane = this.ui;
  17546. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17547. this.moveDir = new Laya.Vector2();
  17548. this.moveDest = new Laya.Vector2();
  17549. this.centerPos = new Laya.Vector2();
  17550. xGame.common.uiRodMethod = this;
  17551. }
  17552. show() {
  17553. super.show();
  17554. xGame.common.gameMgr.gamePause = true;
  17555. this.openPressDotEvent();
  17556. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17557. this.centerPos.x = this.ui.white.x;
  17558. this.centerPos.y = this.ui.white.y;
  17559. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17560. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17561. this.setDot();
  17562. }
  17563. setDot() {
  17564. this.ui.dot.x = this.moveDest.x;
  17565. this.ui.dot.y = this.moveDest.y;
  17566. }
  17567. closeSelf() {
  17568. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17569. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17570. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17571. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17572. xGame.common.gameMgr.gamePause = false;
  17573. this.hide();
  17574. }
  17575. openPressDotEvent() {
  17576. this.closePressDotEvent();
  17577. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17578. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17579. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17580. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17581. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17582. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17583. }
  17584. closePressDotEvent() {
  17585. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17586. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17587. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17588. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17589. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17590. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17591. }
  17592. onDown(e) {
  17593. if (e.type == Laya.Event.MOUSE_DOWN)
  17594. this.isPressd = true;
  17595. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17596. this.isPressd = false;
  17597. if (!this.isPressd)
  17598. return;
  17599. this.moveDest.x = e.stageX;
  17600. this.moveDest.y = e.stageY;
  17601. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17602. if (dis > 6724) {
  17603. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17604. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17605. }
  17606. this.setDot();
  17607. }
  17608. resetRod() {
  17609. this.ui.dot.x = this.ui.white.x;
  17610. this.ui.dot.y = this.ui.white.y;
  17611. this.gameRod.dot.x = this.gameRod.bg.x;
  17612. this.gameRod.dot.y = this.gameRod.bg.y;
  17613. xGame.common.rodOffest.x = 0;
  17614. xGame.common.rodOffest.y = 0;
  17615. }
  17616. }
  17617. UIRodMethod$1.uiName = "UIRodMethod";
  17618. class UIMsg$1 extends UIBase {
  17619. constructor() {
  17620. super();
  17621. }
  17622. onConstructor() {
  17623. this.ui = ui_UIMsg.createInstance();
  17624. this.contentPane = this.ui;
  17625. this.isEject = false;
  17626. this.isMuti = true;
  17627. }
  17628. show(msg, callback) {
  17629. super.show();
  17630. this.ui.tipsNode.msgTxt.text = msg;
  17631. this.ui.alpha = 1;
  17632. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17633. this.hide();
  17634. callback && callback();
  17635. }), 1000);
  17636. }
  17637. }
  17638. UIMsg$1.uiName = "UIMsg";
  17639. class UITips$1 extends UIBase {
  17640. constructor() {
  17641. super();
  17642. this.type = 0;
  17643. }
  17644. onConstructor() {
  17645. this.ui = ui_UITips.createInstance();
  17646. this.contentPane = this.ui;
  17647. this.isEject = false;
  17648. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17649. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17650. }
  17651. show(tipsTxt, womanTxt, type) {
  17652. super.show();
  17653. this.ui.t0.play();
  17654. this.ui.myNode.tipsTxt.text = tipsTxt;
  17655. this.ui.myNode.womanTxt.text = womanTxt;
  17656. PlatMgr.showInsert(true);
  17657. this.ui.myNode.c1.selectedIndex = type;
  17658. this.type = type;
  17659. switch (this.type) {
  17660. case TipsType.exitGame:
  17661. xGame.common.gameMgr.gamePause = true;
  17662. break;
  17663. case TipsType.foul:
  17664. Laya.timer.once(200, this, () => {
  17665. xGame.common.gameMgr.gamePause = true;
  17666. });
  17667. break;
  17668. default:
  17669. break;
  17670. }
  17671. }
  17672. clickLeftBtn() {
  17673. this.hide();
  17674. xGame.common.gameMgr.gamePause = false;
  17675. switch (this.type) {
  17676. case TipsType.exitGame:
  17677. break;
  17678. case TipsType.foul:
  17679. break;
  17680. default:
  17681. break;
  17682. }
  17683. }
  17684. clickRightBtn() {
  17685. this.hide();
  17686. switch (this.type) {
  17687. case TipsType.exitGame:
  17688. xGame.eventMgr.event(RESET_GAME);
  17689. xGame.uiMgr.Show(UIMain$1);
  17690. Moyu.recordEnd(this, null);
  17691. xGame.common.longHelpLine = false;
  17692. break;
  17693. case TipsType.foul:
  17694. xGame.common.gameMgr.gamePause = false;
  17695. Laya.timer.clearAll(this);
  17696. break;
  17697. default:
  17698. break;
  17699. }
  17700. }
  17701. }
  17702. UITips$1.uiName = "UITips";
  17703. class UIGame$1 extends UIBase {
  17704. constructor() {
  17705. super();
  17706. this.powerNum = 0;
  17707. this.isD3Inited = false;
  17708. this.isPrePlay = false;
  17709. this.isMoveRod = false;
  17710. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17711. this.rulerDis = 20;
  17712. this.rulerOffset = 0;
  17713. }
  17714. onConstructor() {
  17715. this.ui = ui_UIGame.createInstance();
  17716. this.contentPane = this.ui;
  17717. this.ui.x += xGame.common.sysOffestNum;
  17718. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17719. this.isEject = false;
  17720. xGame.common.gameUI = this;
  17721. this.initSelf();
  17722. }
  17723. isTurnSelf() {
  17724. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17725. return true;
  17726. }
  17727. }
  17728. initSelf() {
  17729. let topUI = this.ui.topNode;
  17730. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17731. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17732. this.barInfo = {};
  17733. this.barInfo.curY = 0;
  17734. this.barInfo.height = this.ui.powerNode.height;
  17735. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17736. this.barInfo.powerStartY = this.ui.powerNode.y;
  17737. xGame.common.aiPlayer = new AIPlayer();
  17738. xGame.common.gameMgr = new GameMgr();
  17739. xGame.common.skillMgr = new SkillMgr();
  17740. xGame.common.wordsMgr = new WordsMgr();
  17741. xGame.common.talkMgr = new TalkMgr();
  17742. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17743. console.log("加载经典模式表情文件chenggon !");
  17744. });
  17745. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17746. console.log("挑战模式奖励模式spine加载成功!");
  17747. });
  17748. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17749. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17750. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17751. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17752. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17753. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17754. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17755. }
  17756. getGanZiImg() {
  17757. let index = DataMgr.getCurBallRod();
  17758. let data = cfgTable.ballrodData[index + 1];
  17759. let gan_url = xGame.common.getGameIconUrl(data.img);
  17760. console.log('zh:getGanZiImg gan_url==' + gan_url);
  17761. this.ui.powerNode.showImg.url = gan_url;
  17762. console.log('zh:修改杆子图标O K');
  17763. }
  17764. returnHome() {
  17765. let tips = "Are you sure to exit the game?";
  17766. let woman = "Boss, why don't you play for a while longer?";
  17767. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17768. }
  17769. addRodMethodClick() {
  17770. if (this.isTurnSelf()) {
  17771. xGame.uiMgr.Show(UIRodMethod$1);
  17772. }
  17773. }
  17774. clickHelpLineBtn(force = false) {
  17775. if (!this.isTurnSelf())
  17776. return;
  17777. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17778. if (success) {
  17779. xGame.common.longHelpLine = true;
  17780. xGame.common.d2World.getHelpLine();
  17781. Moyu.sendDataEvent("guideNum");
  17782. }
  17783. else {
  17784. }
  17785. });
  17786. }
  17787. renderSelfDisplayBalls(index, target) {
  17788. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17789. target.myImg.url = xGame.common.getGameIconUrl(str);
  17790. }
  17791. renderAIDisplayBalls(index, target) {
  17792. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17793. target.myImg.url = xGame.common.getGameIconUrl(str);
  17794. ;
  17795. }
  17796. updateMode() {
  17797. if (xGame.common.gameMode == GameMode.classic) {
  17798. this.ui.topNode.scoreNode.visible = false;
  17799. }
  17800. else if (xGame.common.gameMode == GameMode.bigMove) {
  17801. this.ui.topNode.scoreNode.visible = true;
  17802. }
  17803. }
  17804. show() {
  17805. super.show();
  17806. console.log("zh:uigame show AADD");
  17807. this.ui.alpha = 0;
  17808. this.updateSelf();
  17809. xGame.common.gameMgr.gamePause = false;
  17810. xGame.common.gameUI.ui.blackAni.visible = false;
  17811. xGame.common.gameUI.ui.whiteAni.visible = false;
  17812. this.ui.powerEft.visible = false;
  17813. this.ui.colorNode.visible = false;
  17814. this.updateHead();
  17815. let curUse = DataMgr.getCurBallRod();
  17816. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  17817. this.getGanZiImg();
  17818. }
  17819. updateSelf() {
  17820. if (xGame.common.gameMode == GameMode.classic) {
  17821. this.ui.c1.selectedIndex = 0;
  17822. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17823. this.ui.topNode.middleNode.visible = true;
  17824. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17825. }
  17826. else if (xGame.common.gameMode == GameMode.bigMove) {
  17827. this.ui.c1.selectedIndex = 0;
  17828. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17829. this.ui.topNode.middleNode.visible = false;
  17830. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17831. let rand = xGame.common.randomNum(1, max);
  17832. let guide = DataMgr.getSkillGuide();
  17833. if (guide == 0)
  17834. rand = 1;
  17835. xGame.common.bigMoveLevelIndex = rand;
  17836. }
  17837. else if (xGame.common.gameMode == GameMode.placeBall) {
  17838. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17839. this.ui.c1.selectedIndex = 1 + data.type;
  17840. this.ui.alpha = 1;
  17841. this.startGame();
  17842. }
  17843. this.updateMode();
  17844. this.initD3world();
  17845. this.initD2world();
  17846. }
  17847. startGame() {
  17848. this.ui.snowNode.visible = Math.random() <= 0.1;
  17849. this.ui.d2Node.visible = false;
  17850. xGame.common.d3World.d3Hand.gameObj.active = false;
  17851. xGame.common.d3World.tableSrc.init();
  17852. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17853. this.cameraViewChange(() => {
  17854. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17855. switch (xGame.common.gameMode) {
  17856. case GameMode.classic:
  17857. xGame.common.d3World.d3Hand.gameObj.active = true;
  17858. this.playPutBallD3Ani();
  17859. break;
  17860. case GameMode.bigMove:
  17861. this.enterGame();
  17862. Laya.timer.once(500, this, () => {
  17863. this.ui.topNode.middleNode.visible = true;
  17864. this.ui.topNode.middleNode.t0.play();
  17865. });
  17866. break;
  17867. case GameMode.placeBall:
  17868. this.enterGame();
  17869. break;
  17870. default:
  17871. break;
  17872. }
  17873. });
  17874. PlatMgr.showBanner(false);
  17875. }
  17876. enterGame() {
  17877. this.ui.d2Node.visible = true;
  17878. xGame.common.d3World.d3Hand.gameObj.active = false;
  17879. xGame.common.showOneCamera("mainCamera");
  17880. Moyu.recordGame(30, true);
  17881. if (!this.isPrePlay) {
  17882. this.isPrePlay = true;
  17883. xGame.common.d3World.prePlayEft();
  17884. }
  17885. xGame.common.gameMgr.gameReady();
  17886. this.openAllEvent();
  17887. this.ui.snowNode.visible = false;
  17888. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17889. this.ui.helpBtn.visible = condition;
  17890. }
  17891. showHelpLineGuide() {
  17892. let longGuide = DataMgr.getGuideHelpLine();
  17893. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17894. this.ui.helpBtn.visible = true;
  17895. this.ui.guideNode.visible = true;
  17896. }
  17897. }
  17898. setTurnAlpha(alpha) {
  17899. this.ui.keduNode.alpha = alpha;
  17900. this.ui.ganNode.alpha = alpha;
  17901. this.ui.rodMethodNode.alpha = alpha;
  17902. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17903. }
  17904. cameraViewChange(callback) {
  17905. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17906. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17907. xGame.common.showOneCamera("visitAngle");
  17908. cameraSrc.localRotationEulerY = 180;
  17909. cameraSrc.localRotationEulerZ = 0;
  17910. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17911. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17912. callback && callback();
  17913. }));
  17914. }));
  17915. }
  17916. playPutBallD3Ani() {
  17917. xGame.common.showOneCamera("mainCamera");
  17918. let handSrc = xGame.common.d3World.d3Hand;
  17919. handSrc.gameObj.active = true;
  17920. handSrc.transform.localPositionZ = 3;
  17921. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17922. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17923. handSrc.gameObj.active = false;
  17924. this.enterGame();
  17925. }), 400);
  17926. }));
  17927. }
  17928. updateHead() {
  17929. let user = Moyu.getUserInfo();
  17930. this.ui.topNode.selfNameTxt.text = user.nickName;
  17931. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17932. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17933. if (DataMgr.getSkillGuide() < 1) {
  17934. this.ui.topNode.aiNameTxt.text = 'billiards';
  17935. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17936. }
  17937. else {
  17938. this.ui.topNode.aiNameTxt.text = aiData.name;
  17939. let randNo = Math.floor(Math.random() * 10) + 1;
  17940. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17941. }
  17942. }
  17943. initD2world() {
  17944. let node = this.ui.d2Root.displayObject;
  17945. let src = node.getComponent(D2World);
  17946. if (!src) {
  17947. xGame.common.d2World = node.addComponent(D2World);
  17948. }
  17949. xGame.common.d2World.initSelf();
  17950. }
  17951. initD3world() {
  17952. if (this.isD3Inited)
  17953. return;
  17954. this.isD3Inited = true;
  17955. let scene3D = xGame.common.d3Scene;
  17956. this.ui.d3Root.displayObject.addChild(scene3D);
  17957. scene3D.active = true;
  17958. xGame.common.d3World.tableSrc.setBorderPos();
  17959. }
  17960. onRootMove(e) {
  17961. let rootBall = xGame.common.d2World.rootBall;
  17962. this.ui.moveNode.x = e.x;
  17963. this.ui.moveNode.y = e.y;
  17964. rootBall.gameObj.x = e.x;
  17965. rootBall.gameObj.y = e.y;
  17966. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17967. }
  17968. aiRootMove(move) {
  17969. if (move)
  17970. this.hideBallUI();
  17971. else {
  17972. this.showBallUI();
  17973. xGame.common.d2World.getHelpLine();
  17974. }
  17975. }
  17976. aiForce(type, force = 0) {
  17977. this.pressTarget = PressType.powerNode;
  17978. if (type == 1)
  17979. this.onEventUp({ force: true });
  17980. else if (type == 2)
  17981. this.onEventMove({ stageY: force, force: true });
  17982. }
  17983. onEventPress(e) {
  17984. if (e.stopPropagation)
  17985. e.stopPropagation();
  17986. if (!this.isTurnSelf())
  17987. return;
  17988. let target = e.target;
  17989. switch (target) {
  17990. case this.ui.myPowerNode.displayObject:
  17991. this.pressTarget = PressType.powerNode;
  17992. this.barInfo.curY = e.stageY;
  17993. this.updateBarInfo();
  17994. break;
  17995. case this.ui.moveNode.displayObject:
  17996. this.pressTarget = PressType.moveNode;
  17997. this.hideBallUI();
  17998. this.eventObj.curX = this.ui.moveNode.x;
  17999. this.eventObj.curY = this.ui.moveNode.y;
  18000. this.ui.moveNode.finger.visible = false;
  18001. this.eventObj.lastX = e.stageX;
  18002. this.eventObj.lastY = e.stageY;
  18003. break;
  18004. case this.ui.rulerClickNode.displayObject:
  18005. this.pressTarget = PressType.rulerNode;
  18006. this.eventObj.lastY = e.stageY;
  18007. break;
  18008. case this.ui.d2Root.displayObject:
  18009. this.pressTarget = PressType.d2Root;
  18010. this.eventObj.lastX = e.stageX;
  18011. this.eventObj.lastY = e.stageY;
  18012. this.eventObj.starX = e.stageX;
  18013. this.eventObj.starY = e.stageY;
  18014. this.eventObj.curX = 0;
  18015. this.eventObj.curY = 0;
  18016. xGame.common.d2World.d2Gan.setGanLastInfo();
  18017. this.rulerOffset = 0;
  18018. break;
  18019. default:
  18020. break;
  18021. }
  18022. }
  18023. onEventMove(e) {
  18024. if (e.stopPropagation)
  18025. e.stopPropagation();
  18026. if (e && e.force) {
  18027. }
  18028. else {
  18029. if (!this.isTurnSelf())
  18030. return;
  18031. }
  18032. switch (this.pressTarget) {
  18033. case PressType.powerNode:
  18034. this.barInfo.curY = e.stageY;
  18035. this.updateBarInfo();
  18036. this.isMoveRod = true;
  18037. break;
  18038. case PressType.moveNode:
  18039. let rootBall = xGame.common.d2World.rootBall;
  18040. let radius = rootBall.gameObj.width / 2;
  18041. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  18042. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  18043. let border = xGame.common.d2World.borderRect;
  18044. if (curX <= border.x + radius)
  18045. curX = border.x + radius;
  18046. else if (curX >= border.x + border.width - radius)
  18047. curX = border.x + border.width - radius;
  18048. if (curY <= border.y + radius)
  18049. curY = border.y + radius;
  18050. else if (curY >= border.y + border.height - radius)
  18051. curY = border.y + border.height - radius;
  18052. if (xGame.common.gameMgr.isOpenBall) {
  18053. if (curX >= border.x + border.openBallW - radius)
  18054. curX = border.x + border.openBallW - radius;
  18055. }
  18056. this.ui.moveNode.x = curX;
  18057. this.ui.moveNode.y = curY;
  18058. rootBall.gameObj.x = curX;
  18059. rootBall.gameObj.y = curY;
  18060. rootBall.d3BallSrc.setTransPos(curX, curY);
  18061. this.isMoveRod = true;
  18062. break;
  18063. case PressType.rulerNode:
  18064. let yy = e.stageY - this.eventObj.lastY;
  18065. this.eventObj.lastY = e.stageY;
  18066. let ruler1 = this.ui.rulerNode.img1;
  18067. let ruler2 = this.ui.rulerNode.img2;
  18068. ruler1.y += yy;
  18069. ruler2.y += yy;
  18070. this.rulerOffset += yy;
  18071. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  18072. this.rulerOffset = 0;
  18073. xGame.soundMgr.playSound("inch", 1, 10);
  18074. }
  18075. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  18076. let h = ruler1.height;
  18077. this.checkGuide();
  18078. this.isMoveRod = true;
  18079. if (ruler1.y >= h) {
  18080. ruler1.y = -h;
  18081. ruler2.y = 0;
  18082. return;
  18083. }
  18084. else if (ruler1.y <= -h) {
  18085. ruler1.y = h;
  18086. ruler2.y = 0;
  18087. return;
  18088. }
  18089. if (ruler2.y >= h) {
  18090. ruler2.y = -h;
  18091. ruler1.y = 0;
  18092. return;
  18093. }
  18094. else if (ruler2.y <= -h) {
  18095. ruler2.y = h;
  18096. ruler1.y = 0;
  18097. return;
  18098. }
  18099. break;
  18100. case PressType.d2Root:
  18101. this.eventObj.curX = e.stageX;
  18102. this.eventObj.curY = e.stageY;
  18103. let offset = this.checkRodMoveDir();
  18104. xGame.common.d2World.d2Gan.rotateSelf(offset);
  18105. this.eventObj.lastX = e.stageX;
  18106. this.eventObj.lastY = e.stageY;
  18107. break;
  18108. default:
  18109. break;
  18110. }
  18111. }
  18112. onEventUp(e) {
  18113. if (e.stopPropagation)
  18114. e.stopPropagation();
  18115. if (e && e.force) {
  18116. }
  18117. else {
  18118. if (!this.isTurnSelf())
  18119. return;
  18120. }
  18121. switch (this.pressTarget) {
  18122. case PressType.powerNode:
  18123. this.ui.powerNode.value = 0;
  18124. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18125. this.ui.powerTxt.text = "";
  18126. if (this.powerNum > 0) {
  18127. xGame.eventMgr.event(BALL_SHOOT);
  18128. xGame.common.d2World.shoot(this.powerNum);
  18129. xGame.common.d2World.d2Gan.shoot();
  18130. xGame.common.d2World.d2HelpLine.shoot();
  18131. this.finishGuide();
  18132. this.ui.powerEft.visible = false;
  18133. this.ui.colorNode.visible = false;
  18134. let ganStr = "";
  18135. if (this.powerNum <= 30) {
  18136. ganStr = "gan_30";
  18137. }
  18138. else if (this.powerNum <= 60) {
  18139. ganStr = "gan_50";
  18140. }
  18141. else {
  18142. ganStr = "gan_80";
  18143. }
  18144. xGame.soundMgr.playSound(ganStr);
  18145. }
  18146. break;
  18147. case PressType.moveNode:
  18148. let rootBall = xGame.common.d2World.rootBall;
  18149. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  18150. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  18151. let isIntersect = this.judgeBallIntersect();
  18152. if (isIntersect) {
  18153. this.ui.moveNode.x = lastX;
  18154. this.ui.moveNode.y = lastY;
  18155. rootBall.gameObj.x = lastX;
  18156. rootBall.gameObj.y = lastY;
  18157. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  18158. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  18159. }
  18160. else {
  18161. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  18162. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  18163. }
  18164. this.showBallUI();
  18165. this.ui.moveNode.finger.visible = true;
  18166. xGame.common.d2World.getHelpLine();
  18167. break;
  18168. case PressType.rulerNode:
  18169. break;
  18170. case PressType.d2Root:
  18171. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  18172. if (dis <= 25) {
  18173. this.moveToClickDot(e);
  18174. }
  18175. break;
  18176. default:
  18177. break;
  18178. }
  18179. this.pressTarget = -1;
  18180. }
  18181. checkGuide() {
  18182. let guide = DataMgr.getSkillGuide();
  18183. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  18184. xGame.common.guideStep++;
  18185. xGame.common.gameUI.ui.guide2.visible = false;
  18186. xGame.common.gameUI.ui.guide3.visible = true;
  18187. }
  18188. }
  18189. finishGuide() {
  18190. let guide = DataMgr.getSkillGuide();
  18191. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  18192. xGame.common.guideStep = 10;
  18193. this.closeAllGuide();
  18194. console.log('zh: 新手引导完毕');
  18195. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  18196. }
  18197. }
  18198. closeAllGuide() {
  18199. xGame.common.gameUI.ui.guide1.visible = false;
  18200. xGame.common.gameUI.ui.guide2.visible = false;
  18201. xGame.common.gameUI.ui.guide3.visible = false;
  18202. }
  18203. updateBarInfo() {
  18204. let star = this.ui.powerNode.y;
  18205. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  18206. if (rate >= 1)
  18207. rate = 1;
  18208. if (rate <= 0)
  18209. rate = 0;
  18210. this.powerNum = Math.ceil(rate * 100);
  18211. this.ui.powerNode.value = this.powerNum;
  18212. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  18213. this.ui.colorNode.value = this.powerNum;
  18214. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  18215. this.ui.powerEft.visible = this.powerNum != 0;
  18216. this.ui.colorNode.visible = this.powerNum != 0;
  18217. this.ui.powerTxt.text = this.powerNum + "";
  18218. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  18219. }
  18220. forceCancel() {
  18221. this.ui.powerNode.value = 0;
  18222. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18223. this.ui.powerTxt.text = "";
  18224. }
  18225. checkRodMoveDir() {
  18226. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  18227. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  18228. if (tempX >= 0 && tempY <= 0) {
  18229. return this.checkDir();
  18230. }
  18231. else if (tempX < 0 && tempY < 0) {
  18232. return this.checkDir(1, -1);
  18233. }
  18234. else if (tempX < 0 && tempY > 0) {
  18235. return this.checkDir(-1, -1);
  18236. }
  18237. else {
  18238. return this.checkDir(-1, 1);
  18239. }
  18240. }
  18241. checkDir(flagX = 1, flagY = 1) {
  18242. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  18243. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  18244. if (offsetY == 0) {
  18245. return offsetX * flagX;
  18246. }
  18247. if (offsetX == 0) {
  18248. return offsetY * flagY;
  18249. }
  18250. let angle = offsetY / offsetX;
  18251. if (Math.abs(angle) >= 1) {
  18252. return offsetY * flagY;
  18253. }
  18254. else {
  18255. return offsetX * flagX;
  18256. }
  18257. }
  18258. judgeBallIntersect() {
  18259. let rootBall = xGame.common.d2World.rootBall;
  18260. let ballArr = xGame.common.d2World.ballArr;
  18261. let radius = rootBall.gameObj.width / 2;
  18262. let temp;
  18263. let isIntersect = false;
  18264. for (let index = 0; index < ballArr.length; index++) {
  18265. temp = ballArr[index];
  18266. if (temp.number == rootBall.number)
  18267. continue;
  18268. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  18269. if (isIntersect) {
  18270. break;
  18271. }
  18272. }
  18273. return isIntersect;
  18274. }
  18275. hideBallUI() {
  18276. let d2Gan = xGame.common.d2World.d2Gan;
  18277. if (!d2Gan.ui.isDisposed)
  18278. d2Gan.ui.visible = false;
  18279. let d2Help = xGame.common.d2World.d2HelpLine;
  18280. if (!d2Help.ui.isDisposed)
  18281. d2Help.ui.visible = false;
  18282. let rootBall = xGame.common.d2World.rootBall;
  18283. if (!rootBall.destroyed) {
  18284. rootBall.gameObj.active = false;
  18285. }
  18286. }
  18287. showBallUI() {
  18288. let d2Gan = xGame.common.d2World.d2Gan;
  18289. if (!d2Gan.ui.isDisposed)
  18290. d2Gan.ui.visible = true;
  18291. let d2Help = xGame.common.d2World.d2HelpLine;
  18292. if (!d2Help.ui.isDisposed)
  18293. d2Help.ui.visible = true;
  18294. let rootBall = xGame.common.d2World.rootBall;
  18295. if (!rootBall.destroyed) {
  18296. rootBall.gameObj.active = true;
  18297. }
  18298. }
  18299. moveToClickDot(e) {
  18300. if (!this.isMoveRod && !xGame.common.clickedBall) {
  18301. let root = xGame.common.d2World.rootBall.gameObj;
  18302. let xx = e.stageX - xGame.common.sysOffestNum;
  18303. let yy = e.stageY;
  18304. let x = xx - root.x;
  18305. let y = yy - root.y;
  18306. let angle = xGame.common.getfguiRotation(x, y);
  18307. xGame.common.d2World.d2Gan.ui.rotation = angle;
  18308. xGame.common.d2World.getHelpLine();
  18309. }
  18310. this.isMoveRod = false;
  18311. xGame.common.clickedBall = false;
  18312. }
  18313. openAllEvent() {
  18314. this.closeAllEvent();
  18315. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18316. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18317. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18318. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18319. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18320. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18321. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18322. }
  18323. closeAllEvent() {
  18324. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18325. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18326. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18327. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18328. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18329. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18330. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18331. }
  18332. resetGame() {
  18333. this.closeAllEvent();
  18334. this.hideBallUI();
  18335. xGame.common.gameMgr.gamePause = true;
  18336. }
  18337. }
  18338. UIGame$1.uiName = "UIGame";
  18339. class UIAddCoin$1 extends UIBase {
  18340. constructor() {
  18341. super();
  18342. this.coinNum = 2000;
  18343. }
  18344. onConstructor() {
  18345. this.ui = ui_UIAddCoin.createInstance();
  18346. this.contentPane = this.ui;
  18347. this.isEject = false;
  18348. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18349. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  18350. }
  18351. show() {
  18352. super.show();
  18353. this.ui.t0.play();
  18354. }
  18355. videoAddCoin() {
  18356. console.log('zh:qjff_AD_for_UIAddCoin');
  18357. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  18358. }
  18359. else {
  18360. console.log('zh:AD 失败,直接发放奖励');
  18361. this.qjff_AD_for_UIAddCoin();
  18362. }
  18363. }
  18364. qjff_AD_for_UIAddCoin() {
  18365. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  18366. this.hide();
  18367. }
  18368. }
  18369. UIAddCoin$1.uiName = "UIAddCoin";
  18370. class UIInvitation$1 extends UIBase {
  18371. constructor() {
  18372. super();
  18373. }
  18374. onConstructor() {
  18375. this.ui = ui_UIInvitation.createInstance();
  18376. this.contentPane = this.ui;
  18377. this.isEject = false;
  18378. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  18379. }
  18380. show() {
  18381. super.show();
  18382. }
  18383. enterGame() {
  18384. xGame.common.gameMode = GameMode.classic;
  18385. DataMgr.setChallengeTimes(1);
  18386. xGame.common.passAwardCoin = 2000;
  18387. let need = xGame.common.classicNiceNeddCoin;
  18388. if (DataMgr.coinEnough(need)) {
  18389. DataMgr.setCoin(-need);
  18390. xGame.eventMgr.event(RESTART_GAME, true);
  18391. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  18392. }
  18393. else {
  18394. xGame.eventMgr.event(RESTART_GAME, true);
  18395. }
  18396. this.hide();
  18397. }
  18398. hide() {
  18399. super.hide();
  18400. }
  18401. }
  18402. UIInvitation$1.uiName = "UIInvitation";
  18403. class UIPower$1 extends UIBase {
  18404. constructor() {
  18405. super();
  18406. }
  18407. onConstructor() {
  18408. this.ui = ui_UIPower.createInstance();
  18409. this.contentPane = this.ui;
  18410. this.isEject = false;
  18411. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18412. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  18413. }
  18414. show() {
  18415. super.show();
  18416. this.ui.t0.play();
  18417. }
  18418. videoGetPower() {
  18419. console.log('zh:qjff_AD_for_uipower');
  18420. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  18421. }
  18422. else {
  18423. console.log('zh:AD 失败,直接发放奖励');
  18424. this.qjff_AD_for_uipower();
  18425. }
  18426. }
  18427. qjff_AD_for_uipower() {
  18428. DataMgr.setPower(xGame.common.videoPower, true);
  18429. xGame.eventMgr.event(POWER_TIME);
  18430. this.hide();
  18431. }
  18432. }
  18433. UIPower$1.uiName = "UIPower";
  18434. class UIGameEnd$1 extends UIBase {
  18435. constructor() {
  18436. super();
  18437. this.success = false;
  18438. this.awardCoinNum = 1000;
  18439. this.awardDiamondNum = 10;
  18440. }
  18441. onConstructor() {
  18442. this.ui = ui_UIGameEnd.createInstance();
  18443. this.contentPane = this.ui;
  18444. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  18445. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  18446. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  18447. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18448. this.ui.talkNode.visible = false;
  18449. if (Moyu.isKs)
  18450. this.ui.closeNode.closeBtn.x += 100;
  18451. }
  18452. updateType() {
  18453. switch (xGame.common.gameMode) {
  18454. case GameMode.classic:
  18455. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18456. this.ui.coinNode.visible = this.success;
  18457. if (!this.success) {
  18458. Laya.timer.once(500, this, () => {
  18459. xGame.uiMgr.Show(UIAddCoin$1);
  18460. });
  18461. }
  18462. this.ui.isGetAward.visible = false;
  18463. this.ui.leftBtn.c1.selectedIndex = 3;
  18464. this.ui.rightBtn.c1.selectedIndex = 0;
  18465. this.moneyNode.ui.c1.selectedIndex = 1;
  18466. break;
  18467. case GameMode.bigMove:
  18468. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18469. this.ui.coinNode.visible = this.success;
  18470. if (xGame.common.gameMode == GameMode.bigMove) {
  18471. if (this.success) {
  18472. DataMgr.setSkillSuccessTimes(1, true);
  18473. DataMgr.setSkillAccTimes(1);
  18474. }
  18475. else {
  18476. DataMgr.setSkillSuccessTimes(0, false);
  18477. }
  18478. }
  18479. if (!this.success) {
  18480. Laya.timer.once(500, this, () => {
  18481. xGame.uiMgr.Show(UIAddCoin$1);
  18482. });
  18483. }
  18484. this.ui.isGetAward.visible = false;
  18485. this.ui.leftBtn.c1.selectedIndex = 3;
  18486. this.ui.rightBtn.c1.selectedIndex = 0;
  18487. this.moneyNode.ui.c1.selectedIndex = 1;
  18488. break;
  18489. case GameMode.placeBall:
  18490. this.ui.coinNode.visible = false;
  18491. if (this.success) {
  18492. if (xGame.common.placeBallStarNum == 3) {
  18493. this.ui.c1.selectedIndex = 2;
  18494. }
  18495. else {
  18496. this.ui.c1.selectedIndex = 3;
  18497. }
  18498. }
  18499. else {
  18500. this.ui.c1.selectedIndex = 4;
  18501. }
  18502. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18503. if (cfg.type == PlaceBallType.challenge) {
  18504. this.ui.c1.selectedIndex = 2;
  18505. }
  18506. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  18507. this.updatePlaceBallBtn();
  18508. this.updatePlaceBallStarNum();
  18509. this.updatePlaceBallAwardState();
  18510. this.moneyNode.ui.c1.selectedIndex = 2;
  18511. this.moneyNode.checkPowerTime();
  18512. this.moneyNode.powerChange();
  18513. DataMgr.upRankData();
  18514. break;
  18515. default:
  18516. break;
  18517. }
  18518. }
  18519. updatePlaceBallBtn() {
  18520. this.ui.leftBtn.c1.selectedIndex = 5;
  18521. if (this.success) {
  18522. this.ui.rightBtn.c1.selectedIndex = 14;
  18523. }
  18524. else {
  18525. if (xGame.common.placeBallStarNum == 3) {
  18526. this.ui.rightBtn.c1.selectedIndex = 14;
  18527. }
  18528. else {
  18529. this.ui.rightBtn.c1.selectedIndex = 1;
  18530. }
  18531. }
  18532. }
  18533. updatePlaceBallStarNum() {
  18534. let starNum = xGame.common.placeBallStarNum;
  18535. if (starNum == 0)
  18536. this.ui.starNumNode.c1.selectedIndex = 3;
  18537. else {
  18538. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18539. }
  18540. }
  18541. updatePlaceBallAwardState() {
  18542. let level = xGame.common.placeBallCurLevel;
  18543. let starNum = xGame.common.placeBallStarNum;
  18544. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18545. let data = cfgTable.placeballData[level].award;
  18546. let cfg = cfgTable.placeballData[level];
  18547. this.awardDiamondNum = data[1];
  18548. this.awardCoinNum = data[0];
  18549. if (cfg.type == PlaceBallType.challenge) {
  18550. this.awardDiamondNum = 0;
  18551. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18552. }
  18553. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18554. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18555. if (cfg.type == PlaceBallType.challenge) {
  18556. this.ui.awardNode.coinNode.visible = true;
  18557. }
  18558. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18559. this.ui.awardNode.diamondNode.x = 265;
  18560. this.ui.awardNode.coinNode.x = 354;
  18561. }
  18562. else {
  18563. this.ui.awardNode.diamondNode.x = 291;
  18564. this.ui.awardNode.coinNode.x = 291;
  18565. }
  18566. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18567. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18568. if (this.awardCoinNum == 0) {
  18569. this.ui.awardNode.coinNode.numTxt.text = "";
  18570. }
  18571. if (getAward) {
  18572. this.ui.isGetAward.visible = true;
  18573. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18574. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18575. }
  18576. else {
  18577. this.ui.isGetAward.visible = false;
  18578. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18579. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18580. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18581. }
  18582. else {
  18583. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18584. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18585. }
  18586. }
  18587. }
  18588. show(success) {
  18589. super.show();
  18590. xGame.eventMgr.event(RESET_GAME);
  18591. this.success = success;
  18592. Laya.timer.clearAll(this);
  18593. this.playSecretaryAni();
  18594. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18595. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18596. offsetTime = Math.floor(offsetTime / 1000);
  18597. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18598. this.updateType();
  18599. Laya.timer.once(200, this, () => {
  18600. this.addAward(() => {
  18601. this.updateType();
  18602. Laya.timer.once(500, this, () => {
  18603. this.showChallengeLevel();
  18604. });
  18605. });
  18606. });
  18607. if (this.success) {
  18608. JSBridgeUtils.instance.showInternAd('gameend_success');
  18609. console.log('zh:game end 成功');
  18610. xGame.soundMgr.playSound('slots_roll01');
  18611. xGame.soundMgr.playSound("s_win");
  18612. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18613. this.diyGameDataUtilForGameWin();
  18614. }
  18615. else {
  18616. JSBridgeUtils.instance.showInternAd('gameend_faill');
  18617. console.log('zh:game end失败');
  18618. xGame.soundMgr.playSound('matchwin01');
  18619. xGame.soundMgr.playSound("s_lose");
  18620. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18621. }
  18622. let challengeNum = DataMgr.getChallengeTimes();
  18623. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18624. DataMgr.setChallengeTimes(1);
  18625. }
  18626. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18627. DataMgr.setClassicTimes();
  18628. }
  18629. }
  18630. diyGameDataUtilForGameWin() {
  18631. console.log('zh: DiyGameDataUtilForGameWin diy ');
  18632. switch (xGame.common.gameMode) {
  18633. case GameMode.classic:
  18634. console.log('zh:DiyGameDataUtilForGameWin 111');
  18635. case GameMode.bigMove:
  18636. console.log('zh:DiyGameDataUtilForGameWin 222');
  18637. this.restartGame();
  18638. break;
  18639. case GameMode.placeBall:
  18640. console.log('zh:DiyGameDataUtilForGameWin 333');
  18641. var level = xGame.common.placeBallCurLevel;
  18642. console.log('zh:练习模式 联系了多少LEV=' + level);
  18643. let db_over_lev = DataMgr.getChallengeMode_overLev();
  18644. if (level > db_over_lev) {
  18645. DataMgr.setChallengeMode_overLev(level);
  18646. }
  18647. break;
  18648. default:
  18649. console.log('zh:DiyGameDataUtilForGameWin 444');
  18650. break;
  18651. }
  18652. }
  18653. showChallengeLevel() {
  18654. if (DataMgr.getChallengeTimes() != 0)
  18655. return;
  18656. let skill = DataMgr.getSkillAccTimes();
  18657. let put = DataMgr.getPlaceBallLevelList().length;
  18658. if (skill >= 3 || put >= 5) {
  18659. xGame.uiMgr.Show(UIInvitation$1);
  18660. this.hide();
  18661. }
  18662. }
  18663. addAward(callback) {
  18664. if (!this.success) {
  18665. callback && callback();
  18666. return;
  18667. }
  18668. switch (xGame.common.gameMode) {
  18669. case GameMode.classic:
  18670. this.awardCoinNum = xGame.common.passAwardCoin;
  18671. this.awardDiamondNum = 0;
  18672. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18673. break;
  18674. case GameMode.bigMove:
  18675. this.awardCoinNum = xGame.common.passAwardCoin;
  18676. this.awardDiamondNum = 0;
  18677. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18678. callback && callback();
  18679. break;
  18680. case GameMode.placeBall:
  18681. let level = xGame.common.placeBallCurLevel;
  18682. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18683. if (xGame.common.placeBallStarNum != 3) {
  18684. callback && callback();
  18685. return;
  18686. }
  18687. else {
  18688. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18689. if (getAward) {
  18690. callback && callback();
  18691. return;
  18692. }
  18693. }
  18694. let cfg = cfgTable.placeballData[level];
  18695. let data = cfgTable.placeballData[level].award;
  18696. this.awardCoinNum = data[0];
  18697. this.awardDiamondNum = data[1];
  18698. if (cfg.type == PlaceBallType.challenge) {
  18699. this.awardDiamondNum = 0;
  18700. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18701. }
  18702. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18703. let diamondAward;
  18704. if (this.awardDiamondNum > 0) {
  18705. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18706. xGame.common.getAward([diamondAward, coinAward], callback);
  18707. }
  18708. else {
  18709. xGame.common.getAward([coinAward], callback);
  18710. }
  18711. if (cfg.type == PlaceBallType.normal) {
  18712. DataMgr.setPlaceBallAward(level);
  18713. }
  18714. break;
  18715. default:
  18716. break;
  18717. }
  18718. }
  18719. playSecretaryAni_old() {
  18720. let parent = this.ui.secretary.displayObject;
  18721. parent.destroyChildren();
  18722. let xx = this.ui.secretary.width / 2;
  18723. let yy = this.ui.secretary.height;
  18724. let scale = xGame.common.getSecretaryScale();
  18725. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18726. if (this.success) {
  18727. let rand = Math.random() <= 0.5 ? 2 : 3;
  18728. xGame.common.secretary.play(data, rand, false, parent, () => {
  18729. xGame.common.secretary.play(data, 1, true, parent);
  18730. });
  18731. }
  18732. else {
  18733. xGame.common.secretary.play(data, 0, true, parent);
  18734. }
  18735. }
  18736. playSecretaryAni() {
  18737. let parent = this.ui.secretary.displayObject;
  18738. parent.destroyChildren();
  18739. let xx = this.ui.secretary.width / 2;
  18740. let yy = this.ui.secretary.height;
  18741. let scale = xGame.common.getSecretaryScale();
  18742. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18743. if (this.success) {
  18744. let rand = 0;
  18745. xGame.common.secretary.play(data, 0, true, parent);
  18746. }
  18747. else {
  18748. xGame.common.secretary.play(data, 0, true, parent);
  18749. }
  18750. }
  18751. restartGame() {
  18752. switch (xGame.common.gameMode) {
  18753. case GameMode.classic:
  18754. xGame.eventMgr.event(RESTART_GAME);
  18755. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18756. break;
  18757. case GameMode.bigMove:
  18758. this.hide();
  18759. xGame.eventMgr.event(RESTART_GAME);
  18760. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18761. break;
  18762. default:
  18763. break;
  18764. }
  18765. }
  18766. hide() {
  18767. super.hide();
  18768. xGame.common.stopGirlPop(this.ui.talkNode);
  18769. PlatMgr.showBanner(false);
  18770. }
  18771. returnHome() {
  18772. this.hide();
  18773. let showFailWords = !this.success;
  18774. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18775. }
  18776. clickLeftBtn() {
  18777. switch (xGame.common.gameMode) {
  18778. case GameMode.classic:
  18779. case GameMode.bigMove:
  18780. this.returnHome();
  18781. break;
  18782. case GameMode.placeBall:
  18783. let level = xGame.common.placeBallCurLevel;
  18784. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18785. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18786. break;
  18787. default:
  18788. break;
  18789. }
  18790. }
  18791. powerStartPlaceBallLevel(level, btn) {
  18792. if (DataMgr.powerEnough()) {
  18793. btn.touchable = false;
  18794. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18795. btn.touchable = true;
  18796. DataMgr.setPower(-1);
  18797. xGame.eventMgr.event(POWER_TIME);
  18798. this.startPlaceBallLevel(level);
  18799. }));
  18800. }
  18801. else {
  18802. xGame.uiMgr.Show(UIPower$1, 0);
  18803. }
  18804. }
  18805. clickRightBtn() {
  18806. switch (xGame.common.gameMode) {
  18807. case GameMode.classic:
  18808. console.log('zh:clickRightBtn 111');
  18809. case GameMode.bigMove:
  18810. console.log('zh:clickRightBtn 222');
  18811. this.restartGame();
  18812. break;
  18813. case GameMode.placeBall:
  18814. console.log('zh:clickRightBtn 333');
  18815. let level = xGame.common.placeBallCurLevel;
  18816. let data = DataMgr.getPlaceBallLevel(level);
  18817. let curPss = data.play && !data.isCur;
  18818. if (curPss) {
  18819. console.log('zh:clickRightBtn 333-111');
  18820. console.log('zh:当前LV=' + level);
  18821. if (level == 60) {
  18822. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  18823. Laya.timer.once(3000, this, () => {
  18824. this.returnHome();
  18825. });
  18826. }
  18827. else {
  18828. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18829. }
  18830. }
  18831. else {
  18832. console.log('zh:clickRightBtn 333-000');
  18833. Moyu.sendDataEvent("placeBallNextLevel");
  18834. console.log('zh:qjff_AD_for_uiGameEnd');
  18835. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  18836. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  18837. }
  18838. else {
  18839. console.log('zh:AD 失败,直接发放奖励');
  18840. this.qjff_AD_for_uiGameEnd(level);
  18841. }
  18842. }
  18843. break;
  18844. default:
  18845. console.log('zh:clickRightBtn 444');
  18846. break;
  18847. }
  18848. }
  18849. qjff_AD_for_uiGameEnd(level) {
  18850. DataMgr.setPlaceBallLevel(level, 1);
  18851. this.startPlaceBallLevel(level + 1);
  18852. }
  18853. startPlaceBallLevel(level) {
  18854. xGame.common.gameMode = GameMode.placeBall;
  18855. xGame.common.placeBallCurLevel = level;
  18856. xGame.uiMgr.Show(UIGame$1);
  18857. this.hide();
  18858. }
  18859. }
  18860. UIGameEnd$1.uiName = "UIGameEnd";
  18861. class ShowItem$1 {
  18862. constructor() {
  18863. this.ui = ui_ShowItem.createInstance();
  18864. }
  18865. destroySelf() {
  18866. if (!this.ui.isDisposed) {
  18867. this.ui.removeFromParent();
  18868. this.ui.dispose();
  18869. }
  18870. }
  18871. setParent(parent) {
  18872. parent.addChild(this.ui);
  18873. }
  18874. setPos(x, y) {
  18875. this.ui.x = x;
  18876. this.ui.y = y;
  18877. }
  18878. setUrl(index) {
  18879. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18880. }
  18881. }
  18882. class UILevelProp$1 extends UIBase {
  18883. constructor() {
  18884. super();
  18885. this.firstPos = 385;
  18886. this.secondPos = 467;
  18887. this.showItemArr = [];
  18888. }
  18889. onFontLoaded() {
  18890. try {
  18891. this.ui.myNode.conditionTxt.font = "arial";
  18892. console.log("zh: onFontLoaded 设置arial字体成功");
  18893. }
  18894. catch (error) {
  18895. console.log("zh: constructor onFontLoaded加载arial字体失败");
  18896. }
  18897. }
  18898. onConstructor() {
  18899. this.ui = ui_UILevelProp.createInstance();
  18900. this.contentPane = this.ui;
  18901. this.isEject = false;
  18902. this.addUIClick(this.ui.closeBtn, this.hide);
  18903. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18904. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18905. }
  18906. show(level) {
  18907. super.show();
  18908. this.ui.t1.play();
  18909. this.level = level;
  18910. this.data = cfgTable.placeballData[this.level];
  18911. this.updateSelf();
  18912. this.showPreView();
  18913. this.moneyNode.ui.c1.selectedIndex = 2;
  18914. this.moneyNode.checkPowerTime();
  18915. this.moneyNode.powerChange();
  18916. }
  18917. showPreView() {
  18918. let item;
  18919. let data;
  18920. for (let index = 0; index < this.showItemArr.length; index++) {
  18921. item = this.showItemArr[index];
  18922. item.destroySelf();
  18923. }
  18924. this.showItemArr = [];
  18925. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18926. for (const key in cfgData) {
  18927. data = cfgData[key];
  18928. item = new ShowItem$1();
  18929. item.setParent(this.ui.myNode.displayRoot);
  18930. item.setPos(data.x, data.y);
  18931. item.setUrl(data.value);
  18932. this.showItemArr.push(item);
  18933. }
  18934. }
  18935. updateSelf() {
  18936. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18937. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18938. if (this.data.ball == -1) {
  18939. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18940. }
  18941. else {
  18942. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  18943. }
  18944. let localData = DataMgr.getPlaceBallLevel(this.level);
  18945. let getAward = localData.getAward;
  18946. let cfg = cfgTable.placeballData[this.level];
  18947. let coin = this.data.award[0];
  18948. let diamond = this.data.award[1];
  18949. if (cfg.type == PlaceBallType.challenge) {
  18950. diamond = 0;
  18951. coin = 100;
  18952. }
  18953. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18954. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18955. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18956. if (cfg.type == PlaceBallType.challenge) {
  18957. this.ui.myNode.coinNode.numTxt.text = "";
  18958. }
  18959. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18960. if (coin > 0 && diamond > 0) {
  18961. this.ui.myNode.diamondNode.x = 385;
  18962. this.ui.myNode.coinNode.x = 467;
  18963. }
  18964. else {
  18965. this.ui.myNode.diamondNode.x = 385;
  18966. this.ui.myNode.coinNode.x = 385;
  18967. }
  18968. if (!getAward) {
  18969. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18970. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18971. }
  18972. else {
  18973. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18974. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18975. }
  18976. }
  18977. startGame() {
  18978. if (DataMgr.powerEnough()) {
  18979. this.ui.myNode.startBtn.touchable = false;
  18980. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18981. console.log('zh:startGame ');
  18982. this.ui.myNode.startBtn.touchable = true;
  18983. DataMgr.setPower(-1);
  18984. xGame.eventMgr.event(POWER_TIME);
  18985. xGame.common.gameMode = GameMode.placeBall;
  18986. xGame.common.placeBallCurLevel = this.level;
  18987. xGame.uiMgr.Show(UIGame$1);
  18988. xGame.uiMgr.Hide(UILevelDisplay$1);
  18989. xGame.uiMgr.Hide(UIMain$1);
  18990. this.hide();
  18991. }));
  18992. }
  18993. else {
  18994. console.log('zh:startGame no power');
  18995. xGame.uiMgr.Show(UIPower$1);
  18996. }
  18997. }
  18998. hide() {
  18999. super.hide();
  19000. }
  19001. }
  19002. UILevelProp$1.uiName = "UILevelProp";
  19003. class PutBallLevelDisplay$1 {
  19004. constructor(ui, index) {
  19005. this.index = 0;
  19006. this.ui = ui;
  19007. this.index = index;
  19008. this.ui.onClick(this, this.clickSelf);
  19009. this.updateSelf();
  19010. this.ui.levelTxt.text = (this.index + 1) + "";
  19011. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  19012. this.ui.special.levelTxt.text = (this.index + 1) + "";
  19013. }
  19014. updateSelf() {
  19015. let level = this.index + 1;
  19016. this.data = DataMgr.getPlaceBallLevel(level);
  19017. this.ui.starNode.c1.selectedIndex = this.data.star;
  19018. let isChallenge = cfgTable.placeballData[level].type;
  19019. if (this.data.isCur) {
  19020. if (isChallenge) {
  19021. this.ui.c1.selectedIndex = 5;
  19022. }
  19023. else {
  19024. this.ui.c1.selectedIndex = 2;
  19025. }
  19026. }
  19027. else {
  19028. if (this.data.play) {
  19029. if (this.data.star == 3) {
  19030. this.ui.c1.selectedIndex = 0;
  19031. }
  19032. else {
  19033. this.ui.c1.selectedIndex = 1;
  19034. }
  19035. }
  19036. else {
  19037. if (isChallenge) {
  19038. this.ui.c1.selectedIndex = 4;
  19039. }
  19040. else {
  19041. this.ui.c1.selectedIndex = 3;
  19042. }
  19043. }
  19044. }
  19045. }
  19046. clickSelf() {
  19047. if (!this.data.play)
  19048. return;
  19049. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19050. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  19051. }
  19052. }
  19053. class UILevelDisplay$1 extends UIBase {
  19054. constructor() {
  19055. super();
  19056. }
  19057. onConstructor() {
  19058. this.ui = ui_UILevelDisplay.createInstance();
  19059. this.contentPane = this.ui;
  19060. this.isEject = false;
  19061. this.myList = this.ui.myNode.myList;
  19062. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  19063. this.levelItemArr = [];
  19064. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  19065. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  19066. this.myList.numItems = levelNum;
  19067. if (Moyu.isKs)
  19068. this.ui.closeNode.closeBtn.x += 100;
  19069. }
  19070. levelItemRender(index, target) {
  19071. let item = new PutBallLevelDisplay$1(target, index);
  19072. this.levelItemArr.push(item);
  19073. }
  19074. show() {
  19075. super.show();
  19076. this.updateLevel();
  19077. this.scrollToPlace();
  19078. }
  19079. updateLevel() {
  19080. let temp;
  19081. for (let index = 0; index < this.levelItemArr.length; index++) {
  19082. temp = this.levelItemArr[index];
  19083. temp.updateSelf();
  19084. }
  19085. }
  19086. scrollToPlace() {
  19087. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  19088. let passArr = DataMgr.getPlaceBallLevelList();
  19089. let offest = passArr.length;
  19090. if (offest >= maxNum - 1)
  19091. offest = maxNum - 1;
  19092. this.myList.scrollToView(offest, true, true);
  19093. }
  19094. hide() {
  19095. super.hide();
  19096. }
  19097. }
  19098. UILevelDisplay$1.uiName = "UILevelDisplay";
  19099. class UIMatching$1 extends UIBase {
  19100. constructor() {
  19101. super();
  19102. }
  19103. onConstructor() {
  19104. this.ui = ui_UIMatching.createInstance();
  19105. this.contentPane = this.ui;
  19106. this.isEject = false;
  19107. }
  19108. show(callback) {
  19109. super.show();
  19110. PlatMgr.showBanner(true);
  19111. this.callback = callback;
  19112. let user = Moyu.getUserInfo();
  19113. if (!this.selfPot) {
  19114. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  19115. }
  19116. if (!this.aiPot) {
  19117. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  19118. }
  19119. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  19120. this.ui.selfHead.nameTxt.text = user.nickName;
  19121. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  19122. this.ui.aiHead.nameTxt.text = "???";
  19123. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  19124. this.ui.selfHead.c1.selectedIndex = 0;
  19125. this.ui.aiHead.c1.selectedIndex = 0;
  19126. this.ui.selfHead.x = this.selfPot.x;
  19127. this.ui.selfHead.y = this.selfPot.y;
  19128. this.ui.aiHead.x = this.aiPot.x;
  19129. this.ui.aiHead.y = this.aiPot.y;
  19130. switch (xGame.common.gameMode) {
  19131. case GameMode.classic:
  19132. break;
  19133. case GameMode.bigMove:
  19134. this.initSkillData();
  19135. break;
  19136. default:
  19137. break;
  19138. }
  19139. this.ui.t1.play(Laya.Handler.create(this, () => {
  19140. this.ui.t2.play(Laya.Handler.create(this, () => {
  19141. switch (xGame.common.gameMode) {
  19142. case GameMode.classic:
  19143. this.waitingPeople();
  19144. break;
  19145. case GameMode.bigMove:
  19146. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  19147. break;
  19148. default:
  19149. break;
  19150. }
  19151. }));
  19152. }));
  19153. }
  19154. initSkillData() {
  19155. this.skillSelectData = [];
  19156. let skillUrl = xGame.common.skillIconList;
  19157. let skillName = xGame.common.skillNameList;
  19158. let skillLevel = DataMgr.getBigSkillList();
  19159. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  19160. for (let index = 0; index < 5; index++) {
  19161. let obj = {};
  19162. obj.skillImg = skillUrl[index];
  19163. obj.skillName = skillName[index];
  19164. obj.skillType = skillType[index];
  19165. obj.skillLevel = skillLevel[index];
  19166. this.skillSelectData.push(obj);
  19167. }
  19168. }
  19169. getAISkillLevel(myLevel) {
  19170. let video = xGame.common.upSkillLevel;
  19171. let aiLevel;
  19172. let temp;
  19173. if (video) {
  19174. temp = xGame.common.randomNum(-2, -1);
  19175. }
  19176. else {
  19177. if (myLevel <= 5) {
  19178. temp = xGame.common.randomNum(1, 3);
  19179. }
  19180. else if (myLevel <= 9) {
  19181. temp = xGame.common.randomNum(-2, 1);
  19182. }
  19183. else {
  19184. temp = xGame.common.randomNum(-4, 0);
  19185. }
  19186. }
  19187. aiLevel = temp + myLevel;
  19188. if (aiLevel <= 1)
  19189. aiLevel = 1;
  19190. if (aiLevel >= 10)
  19191. aiLevel = 10;
  19192. return aiLevel;
  19193. }
  19194. getAISkillType() {
  19195. return xGame.common.randomNum(1, 4);
  19196. let successTimes = DataMgr.getSkillSuccessTimes();
  19197. let info = cfgTable.aiskillData[successTimes];
  19198. if (!info) {
  19199. let max = Object.keys(cfgTable.aiskillData).length - 1;
  19200. info = cfgTable.aiskillData[max];
  19201. }
  19202. let dataArr = info.skillselect;
  19203. let myCfg = {};
  19204. for (let index = 0; index < dataArr.length; index++) {
  19205. let temp = dataArr[index].split('-');
  19206. myCfg[temp[0]] = {};
  19207. myCfg[temp[0]].id = parseInt(temp[0]);
  19208. myCfg[temp[0]].weight = parseInt(temp[1]);
  19209. }
  19210. let aiCfg = xGame.common.initWeight(myCfg);
  19211. let curData = xGame.common.getRandomWeightData(aiCfg);
  19212. return parseInt(curData.id);
  19213. }
  19214. getAISkillData(index) {
  19215. let myLevel = this.skillSelectData[index].skillLevel;
  19216. let aiLevel = this.getAISkillLevel(myLevel);
  19217. let aiType = this.getAISkillType() - 1;
  19218. return { aiLevel, aiType } = { aiLevel, aiType };
  19219. }
  19220. skillSelectFinish(index) {
  19221. let aiInfo = this.getAISkillData(index);
  19222. xGame.common.gameMgr.selfCurSkill = index;
  19223. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  19224. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  19225. this.ui.selfHead.c1.selectedIndex = 1;
  19226. this.ui.aiHead.c1.selectedIndex = 1;
  19227. let myData = this.skillSelectData[index];
  19228. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  19229. let guide = DataMgr.getSkillGuide();
  19230. if (guide == 0) {
  19231. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  19232. }
  19233. else {
  19234. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  19235. }
  19236. let aiData = this.skillSelectData[aiInfo.aiType];
  19237. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  19238. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  19239. this.waitingPeople();
  19240. }
  19241. waitingPeople() {
  19242. let time = xGame.common.randomNum(1000, 3000);
  19243. time += 1000;
  19244. Laya.timer.once(time, this, () => {
  19245. this.matchingSuccess();
  19246. });
  19247. }
  19248. matchingSuccess() {
  19249. let gameUI = xGame.common.gameUI;
  19250. let name = gameUI.ui.topNode.aiNameTxt.text;
  19251. let url = gameUI.ui.topNode.aiHeadLoader.url;
  19252. this.ui.aiHead.nameTxt.text = name;
  19253. this.ui.aiHead.headImg.url = url;
  19254. name = gameUI.ui.topNode.selfNameTxt.text;
  19255. url = gameUI.ui.topNode.selfHeadLoader.url;
  19256. this.ui.selfHead.nameTxt.text = name;
  19257. this.ui.selfHead.headImg.url = url;
  19258. this.ui.t3.play(Laya.Handler.create(this, () => {
  19259. this.callback && this.callback();
  19260. this.ui.t4.play(Laya.Handler.create(this, () => {
  19261. this.destroySelf();
  19262. }));
  19263. }));
  19264. }
  19265. destroySelf() {
  19266. this.callback = null;
  19267. this.skillSelectData = null;
  19268. this.selfPot = null;
  19269. this.aiPot = null;
  19270. if (!this.ui.isDisposed) {
  19271. this.ui.removeFromParent();
  19272. this.ui.dispose();
  19273. }
  19274. xGame.uiMgr.destroyUI(this);
  19275. }
  19276. }
  19277. UIMatching$1.uiName = "UIMatching";
  19278. class SkillDisplay$1 {
  19279. constructor(ui, data, uiIndex) {
  19280. this.starX = 0;
  19281. this.starY = 0;
  19282. this.index = 0;
  19283. this.ui = ui;
  19284. this.data = data;
  19285. this.index = uiIndex;
  19286. this.initSelf();
  19287. console.log('zh:SkillDisplay constructor this.skillData=', data);
  19288. }
  19289. initSelf() {
  19290. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  19291. this.ui.nameTxt.text = this.data.name;
  19292. this.ui.describeTxt.text = this.data.describe;
  19293. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  19294. this.ui.startBtn.onClick(this, this.startGame);
  19295. this.updateSelf();
  19296. }
  19297. updateSelf() {
  19298. this.checkTry();
  19299. let level = DataMgr.getBigSkillByIndex(this.index);
  19300. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  19301. }
  19302. checkTry() {
  19303. let index = this.index;
  19304. let level = DataMgr.getBigSkillByIndex(index);
  19305. if (level == null) {
  19306. DataMgr.setBigSkill(index, 1, false);
  19307. level = 1;
  19308. }
  19309. this.ui.levelTxt.text = "LV." + level;
  19310. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  19311. this.ui.tryNode.visible = true;
  19312. else
  19313. this.ui.tryNode.visible = false;
  19314. }
  19315. clickAddLevel() {
  19316. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19317. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  19318. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  19319. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  19320. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19321. }
  19322. else {
  19323. console.log('zh:AD 失败,直接发放奖励');
  19324. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19325. }
  19326. }
  19327. qjff_AD_for_skilldisplay_clickAddLevel() {
  19328. DataMgr.setBigSkill(this.data.index, 1);
  19329. this.updateSelf();
  19330. xGame.common.upSkillLevel = true;
  19331. }
  19332. startGame() {
  19333. if (this.data.index == 3) {
  19334. alert('Coming soon!');
  19335. return;
  19336. }
  19337. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19338. let needCoin = xGame.common.bigMoveNeedCoin;
  19339. xGame.common.passAwardCoin = 2000;
  19340. let guide = DataMgr.getSkillGuide();
  19341. console.log('zh:startGame guide=' + guide);
  19342. xGame.common.temSelfLevel = 0;
  19343. if (guide == 0) {
  19344. needCoin = 0;
  19345. xGame.common.temSelfLevel = 100;
  19346. }
  19347. if (DataMgr.coinEnough(needCoin)) {
  19348. DataMgr.setCoin(-needCoin);
  19349. xGame.common.curPlayerSkillType = this.index;
  19350. if (guide == 0)
  19351. xGame.common.curPlayerSkillType = 0;
  19352. xGame.uiMgr.Show(UIGame$1);
  19353. xGame.uiMgr.Hide(UIMain$1);
  19354. xGame.uiMgr.Show(UIMatching$1, () => {
  19355. xGame.common.gameUI.ui.alpha = 1;
  19356. xGame.common.gameUI.startGame();
  19357. xGame.uiMgr.Hide(UISkill$1);
  19358. });
  19359. }
  19360. else {
  19361. xGame.uiMgr.Show(UIAddProp$1, 0);
  19362. Moyu.sendDataEvent("AddCoinVideo");
  19363. }
  19364. }
  19365. }
  19366. class UISkill$1 extends UIBase {
  19367. constructor() {
  19368. super();
  19369. this.skillData = [];
  19370. }
  19371. onConstructor() {
  19372. this.ui = ui_UISkill.createInstance();
  19373. this.contentPane = this.ui;
  19374. this.isEject = false;
  19375. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19376. this.initSkillData();
  19377. console.log('zh:aaaaaa1111111111');
  19378. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  19379. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  19380. console.log('zh:aaaaaa22222222');
  19381. this.displayList = [];
  19382. this.ui.skillNode.skillList.numItems = 3;
  19383. this.addUIClick(this.ui, this.interuptSecretary);
  19384. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  19385. this.ui.talkNode.visible = false;
  19386. if (Moyu.isKs)
  19387. this.ui.closeNode.closeBtn.x += 100;
  19388. }
  19389. show() {
  19390. super.show();
  19391. this.playSecretaryIdle();
  19392. this.moneyNode.ui.c1.selectedIndex = 1;
  19393. Laya.timer.clearAll(this);
  19394. xGame.soundMgr.playSound("s_start");
  19395. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19396. let guide = DataMgr.getSkillGuide();
  19397. this.ui.guideNode.visible = guide == 0;
  19398. let item = this.getSkillItemByUIIndex(0);
  19399. if (guide == 0) {
  19400. item.ui.c1.selectedIndex = 1;
  19401. }
  19402. else {
  19403. item.ui.c1.selectedIndex = 0;
  19404. }
  19405. this.ui.guideNode.guideBtn.visible = guide == 0;
  19406. for (let index = 0; index < this.displayList.length; index++) {
  19407. this.displayList[index].checkTry();
  19408. }
  19409. }
  19410. getSkillItemByUIIndex(cur) {
  19411. for (let index = 0; index < this.displayList.length; index++) {
  19412. if (this.displayList[index].index == cur) {
  19413. return this.displayList[index];
  19414. }
  19415. }
  19416. }
  19417. enterGuideLevel() {
  19418. let item = this.getSkillItemByUIIndex(0);
  19419. item.startGame();
  19420. if (DataMgr.getNewUser())
  19421. Moyu.sendDataEvent("gameStart1");
  19422. }
  19423. initSkillData() {
  19424. this.skillData = [];
  19425. let nameList = xGame.common.skillNameList;
  19426. let iconList = xGame.common.skillIconList;
  19427. let describeList = [
  19428. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  19429. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
  19430. "The power of frost descends—freezing the flow and taking full control of the game!"
  19431. ];
  19432. console.log('zh:initSkillData 111111111');
  19433. let data;
  19434. for (let index = 0; index < nameList.length; index++) {
  19435. data = {};
  19436. data.name = nameList[index];
  19437. data.icon = iconList[index];
  19438. data.describe = describeList[index];
  19439. data.index = index;
  19440. this.skillData.push(data);
  19441. }
  19442. }
  19443. updateSkillItem(index, target) {
  19444. if (this.displayList[index] == null) {
  19445. let uiIndex;
  19446. switch (index) {
  19447. case 0:
  19448. uiIndex = 1;
  19449. break;
  19450. case 1:
  19451. uiIndex = 0;
  19452. break;
  19453. case 2:
  19454. uiIndex = 2;
  19455. break;
  19456. case 3:
  19457. uiIndex = 3;
  19458. break;
  19459. default:
  19460. break;
  19461. }
  19462. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  19463. this.displayList.push(temp);
  19464. }
  19465. }
  19466. playSecretaryIdle() {
  19467. let parent = this.ui.secretary.displayObject;
  19468. parent.destroyChildren();
  19469. let xx = this.ui.secretary.width / 2;
  19470. let yy = this.ui.secretary.height;
  19471. let scale = xGame.common.getSecretaryScale();
  19472. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19473. xGame.common.secretary.play(data, 0, true, parent);
  19474. }
  19475. returnUIMain() {
  19476. this.hide();
  19477. xGame.common.stopGirlPop(this.ui.talkNode);
  19478. xGame.uiMgr.Show(UIMain$1);
  19479. }
  19480. interuptSecretary() {
  19481. Laya.timer.clearAll(this);
  19482. this.playSecretaryRandomSound();
  19483. }
  19484. playSecretaryRandomSound() {
  19485. if (this.isHide)
  19486. return;
  19487. let time = xGame.common.randomNum(45000, 60000);
  19488. Laya.timer.once(time, this, () => {
  19489. if (this.isHide)
  19490. return;
  19491. let index = xGame.common.randomNum(4, 7);
  19492. xGame.soundMgr.playSound("s_main0" + index);
  19493. let words = 1;
  19494. switch (index) {
  19495. case 4:
  19496. words = 5;
  19497. break;
  19498. case 5:
  19499. words = 3;
  19500. break;
  19501. case 6:
  19502. words = 6;
  19503. break;
  19504. case 7:
  19505. words = 7;
  19506. break;
  19507. default:
  19508. break;
  19509. }
  19510. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19511. this.playSecretaryRandomSound();
  19512. });
  19513. }
  19514. }
  19515. UISkill$1.uiName = "UISkill";
  19516. class UIAddProp$1 extends UIBase {
  19517. constructor() {
  19518. super();
  19519. this.curType = "";
  19520. }
  19521. onConstructor() {
  19522. this.ui = ui_UIAddProp.createInstance();
  19523. this.contentPane = this.ui;
  19524. this.isEject = false;
  19525. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19526. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  19527. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  19528. this.updateUI();
  19529. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  19530. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  19531. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  19532. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  19533. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  19534. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  19535. }
  19536. show(type) {
  19537. super.show();
  19538. this.curType = type == 0 ? "coin" : "diamond";
  19539. this.switchBtn("");
  19540. this.ui.t0.play();
  19541. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  19542. PlatMgr.showInsert(true);
  19543. }
  19544. closeSelf() {
  19545. this.hide();
  19546. }
  19547. updateUI() {
  19548. let data = cfgTable.moneyData;
  19549. let temp;
  19550. let obj;
  19551. for (const key in data) {
  19552. temp = data[key];
  19553. obj = this.ui.myNode["node" + key];
  19554. if (parseInt(key) <= 2) {
  19555. obj.diamondTxt.text = "+" + temp.num;
  19556. }
  19557. else {
  19558. obj.coinTxt.text = temp.num;
  19559. obj.diamondTxt.text = temp.get.split('_')[1];
  19560. }
  19561. }
  19562. this.updateDiamondShare();
  19563. }
  19564. updateDiamondShare() {
  19565. let data = DataMgr.getShareDiamondTimes();
  19566. if (data >= xGame.common.maxShareDiamondTimes) {
  19567. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  19568. this.ui.myNode.node1.touchable = false;
  19569. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19570. }
  19571. else {
  19572. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  19573. this.ui.myNode.node1.touchable = true;
  19574. }
  19575. }
  19576. switchBtn(type) {
  19577. if (type == "")
  19578. type = this.curType;
  19579. else {
  19580. if (this.curType == type) {
  19581. return;
  19582. }
  19583. else {
  19584. this.curType = type;
  19585. }
  19586. }
  19587. if (type == "coin") {
  19588. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  19589. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  19590. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  19591. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  19592. this.ui.myNode.c1.selectedIndex = 0;
  19593. }
  19594. else {
  19595. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  19596. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  19597. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  19598. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  19599. this.ui.myNode.c1.selectedIndex = 1;
  19600. }
  19601. }
  19602. convertCoin(index) {
  19603. let data = cfgTable.moneyData[index];
  19604. let coinNum = data.num;
  19605. let str = data.get.split('_')[1];
  19606. let needDiamond = parseInt(str);
  19607. if (DataMgr.diamondEnough(needDiamond)) {
  19608. DataMgr.setDiamond(-needDiamond);
  19609. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  19610. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  19611. }
  19612. else {
  19613. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  19614. this.switchBtn("diamond");
  19615. }
  19616. }
  19617. videoGetDiamond() {
  19618. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  19619. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  19620. }
  19621. else {
  19622. console.log('zh:AD 失败,直接发放奖励');
  19623. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  19624. }
  19625. }
  19626. qjff_AD_for_uiAddProp_videoGetDiamond() {
  19627. let num = cfgTable.moneyData[2].num;
  19628. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19629. this.closeSelf();
  19630. }
  19631. videoGetCoin() {
  19632. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  19633. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  19634. }
  19635. else {
  19636. console.log('zh:AD 失败,直接发放奖励');
  19637. this.qjff_AD_for_uiAddProp_videoGetCoin();
  19638. }
  19639. }
  19640. qjff_AD_for_uiAddProp_videoGetCoin() {
  19641. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19642. this.closeSelf();
  19643. }
  19644. shareGetDiamond() {
  19645. let times = DataMgr.getShareDiamondTimes();
  19646. if (times >= xGame.common.maxShareDiamondTimes) {
  19647. console.log('zh: 233333333333 maxShareDiamondTimes');
  19648. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19649. }
  19650. else {
  19651. console.log('zh:33333333333333ad');
  19652. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  19653. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  19654. }
  19655. else {
  19656. console.log('zh:AD 失败,直接发放奖励');
  19657. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  19658. }
  19659. }
  19660. }
  19661. qjff_AD_for_uiAddProp_shareGetDiamond() {
  19662. let diamond = xGame.common.randomNum(50, 100);
  19663. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19664. DataMgr.setShareDiamondTimes(1);
  19665. this.updateDiamondShare();
  19666. }
  19667. openPutBallView() {
  19668. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19669. let skill = xGame.uiMgr.getUI(UISkill$1);
  19670. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19671. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19672. if (end && !end.isHide) {
  19673. xGame.uiMgr.Hide(UIGameEnd$1);
  19674. xGame.uiMgr.Show(UIMain$1);
  19675. }
  19676. if (skill && !skill.isHide)
  19677. xGame.uiMgr.Hide(UISkill$1);
  19678. if (uigame && !uigame.isHide)
  19679. xGame.uiMgr.Hide(UIGame$1);
  19680. if (level && !level.isHide) {
  19681. }
  19682. else {
  19683. xGame.uiMgr.Show(UILevelDisplay$1);
  19684. }
  19685. this.closeSelf();
  19686. }
  19687. }
  19688. UIAddProp$1.uiName = "UIAddProp";
  19689. class MoneyNode$1 {
  19690. constructor(ui) {
  19691. this.leftTime = 0;
  19692. this.ui = ui;
  19693. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19694. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19695. this.ui.addPowerBtn.onClick(this, this.addPower);
  19696. this.ui.c1.selectedIndex = 1;
  19697. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19698. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19699. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19700. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19701. this.coinChange();
  19702. this.diamondChange();
  19703. this.powerChange();
  19704. }
  19705. addPower() {
  19706. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19707. xGame.uiMgr.Show(UIPower$1);
  19708. }
  19709. powerChange() {
  19710. let powerNum = DataMgr.getPower();
  19711. this.ui.powerTxt.text = powerNum + "";
  19712. }
  19713. checkPowerTime() {
  19714. let cur = new Date().getTime();
  19715. let last = DataMgr.getPowerTime();
  19716. if (last == 0) {
  19717. last = cur;
  19718. DataMgr.setPowerTime(cur);
  19719. }
  19720. let power = DataMgr.getPower();
  19721. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19722. Laya.timer.clearAll(this);
  19723. if (power >= xGame.common.natureMaxPower) {
  19724. this.ui.powerTimeTxt.text = "";
  19725. DataMgr.setPowerTime(cur);
  19726. return;
  19727. }
  19728. if (power + offset >= xGame.common.natureMaxPower) {
  19729. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19730. this.ui.powerTimeTxt.text = "";
  19731. DataMgr.setPowerTime(cur);
  19732. }
  19733. else {
  19734. if (offset > 0) {
  19735. DataMgr.setPower(offset);
  19736. DataMgr.setPowerTime(cur);
  19737. }
  19738. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19739. this.leftTime = xGame.common.powerRecoverNum - time;
  19740. if (this.leftTime <= 0)
  19741. this.leftTime = 0;
  19742. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19743. Laya.timer.loop(1000, this, this.updatePowerTime);
  19744. }
  19745. }
  19746. updatePowerTime() {
  19747. this.leftTime -= 1;
  19748. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19749. if (this.leftTime <= 0) {
  19750. this.checkPowerTime();
  19751. }
  19752. }
  19753. coinChange() {
  19754. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19755. }
  19756. diamondChange() {
  19757. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19758. }
  19759. addCoin() {
  19760. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19761. Moyu.sendDataEvent("AddCoinBtn");
  19762. xGame.uiMgr.Show(UIAddProp$1, 0);
  19763. }
  19764. addDiamond() {
  19765. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19766. Moyu.sendDataEvent("AddDiamondBtn");
  19767. xGame.uiMgr.Show(UIAddProp$1, 1);
  19768. }
  19769. }
  19770. class SettingNode$1 {
  19771. constructor(ui) {
  19772. this.showSetting = false;
  19773. this.openSound = true;
  19774. this.openShake = true;
  19775. this.ui = ui;
  19776. this.ui.soundBtn.onClick(this, this.switchSound);
  19777. this.ui.shakeBtn.onClick(this, this.switchShake);
  19778. this.ui.xyBtn.onClick(this, this.onXy);
  19779. this.ui.clickNode.onClick(this, this.changeSetting);
  19780. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19781. this.ui.xyBtn.visible = false;
  19782. this.ui.shakeBtn.visible = false;
  19783. }
  19784. changeSetting() {
  19785. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19786. this.showSetting = !this.showSetting;
  19787. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19788. }
  19789. switchSound() {
  19790. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19791. this.openSound = !this.openSound;
  19792. Moyu.onSetting(this.openSound, this.openShake);
  19793. xGame.soundMgr.onSetting(this.openSound);
  19794. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19795. }
  19796. switchShake() {
  19797. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19798. this.openShake = !this.openShake;
  19799. Moyu.onSetting(this.openSound, this.openShake);
  19800. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19801. }
  19802. onXy() {
  19803. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19804. MoyuMgr$1.showXy(1);
  19805. }
  19806. }
  19807. class UIDraw$1 extends UIBase {
  19808. constructor() {
  19809. super();
  19810. this.curKey = 0;
  19811. }
  19812. onConstructor() {
  19813. this.ui = ui_UIDraw.createInstance();
  19814. this.contentPane = this.ui;
  19815. this.isEject = false;
  19816. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19817. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19818. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19819. this.initDraw();
  19820. this.initUI();
  19821. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19822. if (Moyu.isKs)
  19823. this.ui.closeNode.closeBtn.x += 100;
  19824. }
  19825. show() {
  19826. super.show();
  19827. this.ui.t0.play();
  19828. this.playSecretaryIdle();
  19829. this.updateDraw();
  19830. this.checkFree();
  19831. if (PlatMgr.bannerDelay > 0) {
  19832. this.ui.closeNode.closeBtn.visible = false;
  19833. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19834. this.ui.closeNode.closeBtn.visible = true;
  19835. });
  19836. }
  19837. PlatMgr.showRateBanner();
  19838. }
  19839. hide() {
  19840. Laya.timer.clearAll(this);
  19841. super.hide();
  19842. }
  19843. checkFree() {
  19844. let isFree = DataMgr.getDailyfreeDrawTimes();
  19845. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19846. }
  19847. initDraw() {
  19848. this.drawObj = [];
  19849. let data = cfgTable.drawData;
  19850. let temp;
  19851. let weight = 0;
  19852. for (const key in data) {
  19853. temp = data[key];
  19854. weight += temp.weight;
  19855. this.drawObj.push(weight);
  19856. }
  19857. this.allWeight = weight;
  19858. }
  19859. initUI() {
  19860. let data = cfgTable.drawData;
  19861. let temp;
  19862. let img;
  19863. let txt;
  19864. for (const key in data) {
  19865. temp = data[key];
  19866. img = this.ui.myNode.rotNode["img" + key];
  19867. txt = this.ui.myNode.rotNode["txt" + key];
  19868. img.url = xGame.common.getGameIconUrl(temp.icon);
  19869. txt.visible = true;
  19870. if (temp.award > 2) {
  19871. img.rotation = 0;
  19872. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19873. }
  19874. else {
  19875. img.rotation = temp.rotation;
  19876. txt.text = temp.num;
  19877. }
  19878. }
  19879. }
  19880. getCurkey() {
  19881. let rand = Math.random() * this.allWeight;
  19882. let temp;
  19883. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19884. temp = this.drawObj[index];
  19885. if (index == 0) {
  19886. if (rand < temp) {
  19887. return index + 1;
  19888. }
  19889. }
  19890. else {
  19891. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19892. return index + 1;
  19893. }
  19894. }
  19895. }
  19896. return 2;
  19897. }
  19898. startDraw() {
  19899. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19900. if (freeTimes > 0) {
  19901. this.beginDraw();
  19902. DataMgr.setDailyfreeDrawTimes(0);
  19903. this.checkFree();
  19904. }
  19905. else {
  19906. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  19907. }
  19908. else {
  19909. console.log('zh:AD 失败,直接发放奖励');
  19910. this.qjff_chouJiang();
  19911. }
  19912. }
  19913. }
  19914. qjff_chouJiang() {
  19915. this.beginDraw();
  19916. }
  19917. beginDraw() {
  19918. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19919. this.ui.drawBtn.touchable = false;
  19920. this.curKey = this.getCurkey();
  19921. console.log("当前key", this.curKey);
  19922. let cell = 60;
  19923. let lap = 3;
  19924. let angle = cell * (this.curKey - 1) + lap * 360;
  19925. let target = this.ui.myNode.rotNode;
  19926. target.rotation = 0;
  19927. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19928. console.log("旋转完成");
  19929. this.ui.drawBtn.touchable = true;
  19930. this.getAward();
  19931. }));
  19932. }
  19933. getAward() {
  19934. let data = cfgTable.drawData[this.curKey];
  19935. let temp = new AwardType();
  19936. temp.type = data.award;
  19937. temp.num = data.num;
  19938. xGame.common.getAward([temp], () => {
  19939. DataMgr.setDrawTimes(1);
  19940. this.updateDraw();
  19941. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19942. });
  19943. }
  19944. updateDraw() {
  19945. let drawTimes = DataMgr.getDrawTimes();
  19946. let awardTimes = DataMgr.getDrawAwardTimes();
  19947. if (Math.floor(drawTimes / 3) > awardTimes) {
  19948. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19949. this.ui.extraNode.boxBtn.touchable = true;
  19950. this.ui.extraNode.tipsTxt.text = "3/3";
  19951. this.ui.extraNode.barNode.width = 265;
  19952. this.getExtraAward();
  19953. }
  19954. else {
  19955. this.ui.extraNode.boxBtn.t0.stop();
  19956. this.ui.extraNode.boxBtn.touchable = false;
  19957. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19958. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19959. }
  19960. let data = cfgTable.drawData[1];
  19961. if (awardTimes == 0) {
  19962. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19963. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19964. this.ui.myNode.rotNode.img1.rotation = 0;
  19965. }
  19966. else {
  19967. let award = data.nextid;
  19968. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19969. this.ui.myNode.rotNode.txt1.text = award[1];
  19970. this.ui.myNode.rotNode.img1.rotation = 0;
  19971. }
  19972. }
  19973. getExtraAward() {
  19974. let drawTimes = DataMgr.getDrawTimes();
  19975. let awardTimes = DataMgr.getDrawAwardTimes();
  19976. let data = cfgTable.drawData[1];
  19977. let award = new AwardType();
  19978. if (awardTimes == 0) {
  19979. award.num = data.num;
  19980. award.type = data.award;
  19981. xGame.common.getAward([award], () => {
  19982. let all = Math.floor(drawTimes / 3);
  19983. DataMgr.setDrawAwardTimes(all);
  19984. this.updateDraw();
  19985. });
  19986. }
  19987. else {
  19988. award.num = parseInt(data.nextid[1]);
  19989. award.type = parseInt(data.nextid[0]);
  19990. xGame.common.getAward([award], () => {
  19991. let all = Math.floor(drawTimes / 3);
  19992. DataMgr.setDrawAwardTimes(all);
  19993. this.updateDraw();
  19994. });
  19995. }
  19996. }
  19997. closeSelf() {
  19998. this.hide();
  19999. }
  20000. playSecretaryIdle() {
  20001. let parent = this.ui.secretary.displayObject;
  20002. parent.destroyChildren();
  20003. let xx = this.ui.secretary.width / 2;
  20004. let yy = this.ui.secretary.height;
  20005. let scale = xGame.common.getSecretaryScale();
  20006. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20007. xGame.common.secretary.play(data, 0, true, parent);
  20008. }
  20009. }
  20010. UIDraw$1.uiName = "UIDraw";
  20011. class UIRanking$1 extends UIBase {
  20012. constructor() {
  20013. super();
  20014. this.showSelf = true;
  20015. this.rankType = 1;
  20016. this.rankList = [];
  20017. this.myIndex = 0;
  20018. this.myStar = 0;
  20019. }
  20020. onConstructor() {
  20021. this.ui = ui_UIRanking.createInstance();
  20022. this.contentPane = this.ui;
  20023. this.isEject = false;
  20024. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  20025. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  20026. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  20027. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  20028. this.ui.myNode.myList.setVirtual();
  20029. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  20030. }
  20031. show() {
  20032. super.show();
  20033. this.myIndex = 51;
  20034. Moyu.getRankList({
  20035. rankId: xGame.common.curRankID,
  20036. type: MoyuRankType.total,
  20037. page: 1,
  20038. pageSize: 50,
  20039. }, this, this.updateItemData);
  20040. this.updateSelf();
  20041. let self = Moyu.getUserInfo();
  20042. if (!self.isAuth) {
  20043. Moyu.initUser(this, () => {
  20044. DataMgr.upRankData();
  20045. });
  20046. }
  20047. }
  20048. updateSelfItem() {
  20049. let self = Moyu.getUserInfo();
  20050. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  20051. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  20052. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  20053. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  20054. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  20055. }
  20056. updateItemData(data) {
  20057. this.myStar = xGame.common.getAllStarNum();
  20058. if (this.rankList.length < 2) {
  20059. this.rankList = data;
  20060. let self = Moyu.getUserInfo();
  20061. for (let i = 0; i < data.length; i++) {
  20062. let data = this.rankList[i];
  20063. if (data.userId == self.userId) {
  20064. this.rankList.splice(i, 1);
  20065. break;
  20066. }
  20067. }
  20068. for (let i = 0; i < data.length; i++) {
  20069. let data = this.rankList[i];
  20070. if (data.rankScore < this.myStar && this.myIndex > 50) {
  20071. this.myIndex = i + 1;
  20072. let user = { headIcon: self.headIcon, nickName: "myself" };
  20073. let ud = { user: user, data: {} };
  20074. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  20075. if (Moyu.platType < 11) {
  20076. user.headIcon = self.headIcon;
  20077. user.nickName = self.nickName;
  20078. }
  20079. this.rankList.splice(i, 0, md);
  20080. break;
  20081. }
  20082. }
  20083. }
  20084. this.updateSelfItem();
  20085. this.ui.myNode.myList.numItems = this.rankList.length;
  20086. }
  20087. updateItemUI(index, obj) {
  20088. let data = this.rankList[index];
  20089. let userData = JSON.parse(data.userData).user;
  20090. obj.nameTxt.text = userData.nickName.toString();
  20091. obj.valueTxt.text = data.rankScore;
  20092. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  20093. obj.rankTxt.text = index + 1;
  20094. switch (index) {
  20095. case 0:
  20096. this.setImg(obj, 1, 0, 0);
  20097. obj.rankTxt.color = "#FFC047";
  20098. break;
  20099. case 1:
  20100. this.setImg(obj, 0, 1, 0);
  20101. obj.rankTxt.color = "#ACACAC";
  20102. break;
  20103. case 2:
  20104. this.setImg(obj, 0, 0, 1);
  20105. obj.rankTxt.color = "#D09672";
  20106. break;
  20107. default:
  20108. this.setImg(obj, 0, 0, 0);
  20109. obj.rankTxt.color = "#496FAB";
  20110. break;
  20111. }
  20112. }
  20113. setImg(obj, a, b, c) {
  20114. obj.img1.visible = a ? true : false;
  20115. obj.img2.visible = b ? true : false;
  20116. obj.img3.visible = c ? true : false;
  20117. }
  20118. changeList(type) {
  20119. this.rankType = type;
  20120. this.updateSelf();
  20121. }
  20122. changeSelfNode() {
  20123. this.showSelf = !this.showSelf;
  20124. this.updateSelf();
  20125. }
  20126. updateSelf() {
  20127. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  20128. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  20129. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  20130. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  20131. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  20132. }
  20133. }
  20134. UIRanking$1.uiName = "UIRanking";
  20135. class UISecretary$1 extends UIBase {
  20136. constructor() {
  20137. super();
  20138. this.curIndex = 1;
  20139. }
  20140. onConstructor() {
  20141. this.ui = ui_UISecretary.createInstance();
  20142. this.contentPane = this.ui;
  20143. this.isEject = false;
  20144. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  20145. this.nodeObj = { left: null, right: null, cur: null };
  20146. this.nodeObj.cur = this.ui.myNode.gameNode3;
  20147. }
  20148. show() {
  20149. super.show();
  20150. this.ui.t0.play();
  20151. this.updateData();
  20152. }
  20153. addSecretarySpine(node, spineName) {
  20154. if (spineName == "mishu") {
  20155. if (this.secretarySpine1) {
  20156. node.displayObject.destroyChildren();
  20157. this.playWoman(this.secretarySpine1, node.displayObject);
  20158. }
  20159. else {
  20160. let spine1 = new SpineMgr("mishu", () => {
  20161. this.secretarySpine1 = spine1;
  20162. this.playWoman(this.secretarySpine1, node.displayObject);
  20163. });
  20164. }
  20165. }
  20166. else {
  20167. if (this.secretarySpine2) {
  20168. node.displayObject.destroyChildren();
  20169. this.playWoman(this.secretarySpine2, node.displayObject);
  20170. }
  20171. else {
  20172. let spine2 = new SpineMgr("xiaomishu2", () => {
  20173. this.secretarySpine2 = spine2;
  20174. this.playWoman(this.secretarySpine2, node.displayObject);
  20175. });
  20176. }
  20177. }
  20178. }
  20179. playWoman(node, parent) {
  20180. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  20181. let yy = this.ui.myNode.gameNode3.secretary.height;
  20182. let scale = 1.5;
  20183. if (node == this.secretarySpine2) {
  20184. scale = 1.2;
  20185. }
  20186. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20187. node.play(data, 0, true, parent);
  20188. }
  20189. turnLeft() {
  20190. this.curIndex--;
  20191. if (this.curIndex < 1) {
  20192. this.curIndex = 2;
  20193. }
  20194. let left = this.nodeObj.left;
  20195. let right = this.nodeObj.right;
  20196. let cur = this.nodeObj.cur;
  20197. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  20198. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  20199. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  20200. this.updateData();
  20201. }));
  20202. this.ui.myNode.setChildIndex(right, 2);
  20203. this.nodeObj.left = cur;
  20204. this.nodeObj.right = left;
  20205. this.nodeObj.cur = right;
  20206. }
  20207. turnRight() {
  20208. this.curIndex++;
  20209. if (this.curIndex > 2) {
  20210. this.curIndex = 1;
  20211. }
  20212. let left = this.nodeObj.left;
  20213. let right = this.nodeObj.right;
  20214. let cur = this.nodeObj.cur;
  20215. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  20216. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  20217. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  20218. this.updateData();
  20219. }));
  20220. this.ui.myNode.setChildIndex(left, 2);
  20221. this.nodeObj.left = right;
  20222. this.nodeObj.right = cur;
  20223. this.nodeObj.cur = left;
  20224. }
  20225. updateData() {
  20226. console.log('zh: updateData FFFFFFFFFF');
  20227. let data = cfgTable.secretaryshopData;
  20228. let children = this.ui.myNode._children;
  20229. let temp;
  20230. let curData;
  20231. for (let index = 0; index < children.length; index++) {
  20232. temp = children[index];
  20233. curData = data[1];
  20234. temp.heightTxt.text = curData.height;
  20235. temp.foodTxt.text = curData.food;
  20236. temp.historyTxt.text = curData.history;
  20237. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  20238. this.addSecretarySpine(temp.secretary, curData.spine);
  20239. let womanIndex = curData.id - 1;
  20240. let getWoman = DataMgr.getSecretary(womanIndex);
  20241. let curUse = DataMgr.getCurSecretary();
  20242. if (getWoman) {
  20243. if (curUse == womanIndex) {
  20244. temp.purchaseBtn.c1.selectedIndex = 1;
  20245. }
  20246. else {
  20247. temp.purchaseBtn.c1.selectedIndex = 2;
  20248. }
  20249. }
  20250. else {
  20251. temp.purchaseBtn.c1.selectedIndex = 0;
  20252. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  20253. }
  20254. temp.purchaseBtn.visible = false;
  20255. }
  20256. }
  20257. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  20258. console.log('zh: 点击了clickSecretary ');
  20259. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20260. if (getWoman) {
  20261. if (curUse != womanIndex) {
  20262. console.log();
  20263. DataMgr.setCurSecretary(womanIndex);
  20264. this.updateData();
  20265. }
  20266. }
  20267. else {
  20268. console.log('zh:点击购买了');
  20269. let need = needDiamond;
  20270. if (DataMgr.diamondEnough(need)) {
  20271. DataMgr.setDiamond(-need);
  20272. DataMgr.setSecretary(womanIndex, 1);
  20273. DataMgr.setCurSecretary(womanIndex);
  20274. this.updateData();
  20275. }
  20276. else {
  20277. xGame.uiMgr.Show(UIAddProp$1, 1);
  20278. }
  20279. }
  20280. }
  20281. closeSelf() {
  20282. this.hide();
  20283. }
  20284. }
  20285. UISecretary$1.uiName = "UISecretary";
  20286. class BallRodDisplay$1 {
  20287. constructor(ui, index) {
  20288. this.index = 0;
  20289. this.uiIndex = 0;
  20290. this.ui = ui;
  20291. this.index = index;
  20292. this.initData();
  20293. }
  20294. initData() {
  20295. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  20296. let data = cfgTable.ballrodData[this.index + 1];
  20297. this.ui.nameTxt.text = data.name;
  20298. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  20299. this.ui.levelNode.c1.selectedIndex = data.quality;
  20300. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  20301. if (data.spine) {
  20302. this.mySpine = new SpineMgr(data.spine, () => {
  20303. let xx = 150;
  20304. let yy = 70;
  20305. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  20306. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  20307. });
  20308. }
  20309. }
  20310. updateSelf() {
  20311. console.log('zh:updateSelf -------------- ');
  20312. let get = DataMgr.getBallRod(this.index);
  20313. if (get == null)
  20314. get = 1;
  20315. let curUse = DataMgr.getCurBallRod();
  20316. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20317. if (get) {
  20318. if (curUse == this.index) {
  20319. this.ui.purchaseBtn.c1.selectedIndex = 0;
  20320. }
  20321. else {
  20322. this.ui.purchaseBtn.c1.selectedIndex = 1;
  20323. }
  20324. }
  20325. else {
  20326. this.ui.purchaseBtn.c1.selectedIndex = 2;
  20327. }
  20328. }
  20329. buyBallRod() {
  20330. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20331. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  20332. switch (selectedIndex) {
  20333. case 0:
  20334. break;
  20335. case 1:
  20336. console.log('zh:点击了 USE THIS');
  20337. DataMgr.setCurBallRod(this.index);
  20338. DataMgr.setDiamond(99999);
  20339. let curUse = DataMgr.getCurBallRod();
  20340. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20341. let ui = xGame.uiMgr.getUI(UIShop$1);
  20342. ui.updateBallRod();
  20343. break;
  20344. case 2:
  20345. let data = cfgTable.ballrodData[this.index + 1];
  20346. let need = data.price;
  20347. if (DataMgr.diamondEnough(need)) {
  20348. DataMgr.setDiamond(-need);
  20349. DataMgr.setBallRod(this.index, 1);
  20350. DataMgr.setCurBallRod(this.index);
  20351. let ui = xGame.uiMgr.getUI(UIShop$1);
  20352. ui.updateBallRod();
  20353. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  20354. }
  20355. else {
  20356. xGame.uiMgr.Show(UIAddProp$1, 1);
  20357. }
  20358. break;
  20359. default:
  20360. break;
  20361. }
  20362. }
  20363. logEventForGouMaiGan(qiuGanName) {
  20364. const ev = {
  20365. value: qiuGanName
  20366. };
  20367. const jsonStr = JSON.stringify(ev);
  20368. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  20369. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  20370. }
  20371. }
  20372. class UIShop$1 extends UIBase {
  20373. constructor() {
  20374. super();
  20375. this.itemNums = 0;
  20376. }
  20377. onConstructor() {
  20378. this.ui = ui_UIShop.createInstance();
  20379. this.contentPane = this.ui;
  20380. this.isEject = false;
  20381. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20382. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20383. this.addUIClick(this.ui, this.interuptSecretary);
  20384. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  20385. this.ballRodArr = [];
  20386. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  20387. this.ui.myNode.myList.numItems = this.itemNums;
  20388. if (Moyu.isKs)
  20389. this.ui.closeNode.closeBtn.x += 100;
  20390. }
  20391. show() {
  20392. super.show();
  20393. this.playSecretaryIdle();
  20394. this.updateBallRod();
  20395. }
  20396. updateBallRod() {
  20397. for (let index = 0; index < this.ballRodArr.length; index++) {
  20398. this.ballRodArr[index].updateSelf();
  20399. }
  20400. }
  20401. renderBallRod(sort, obj) {
  20402. let index = this.getIndexBySort(sort + 1) - 1;
  20403. let ballRod = new BallRodDisplay$1(obj, index);
  20404. this.ballRodArr.push(ballRod);
  20405. }
  20406. getIndexBySort(sort) {
  20407. let object = cfgTable.ballrodData;
  20408. for (const key in object) {
  20409. if (object[key].sort == sort) {
  20410. return parseInt(key);
  20411. }
  20412. }
  20413. }
  20414. playSecretaryIdle() {
  20415. let parent = this.ui.secretary.displayObject;
  20416. parent.destroyChildren();
  20417. let xx = this.ui.secretary.width / 2;
  20418. let yy = this.ui.secretary.height;
  20419. let scale = xGame.common.getSecretaryScale();
  20420. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20421. xGame.common.secretary.play(data, 0, true, parent);
  20422. }
  20423. interuptSecretary() {
  20424. Laya.timer.clearAll(this);
  20425. this.playSecretaryRandomSound();
  20426. }
  20427. playSecretaryRandomSound() {
  20428. if (this.isHide)
  20429. return;
  20430. let time = xGame.common.randomNum(45000, 60000);
  20431. Laya.timer.once(time, this, () => {
  20432. if (this.isHide)
  20433. return;
  20434. let index = xGame.common.randomNum(4, 7);
  20435. xGame.soundMgr.playSound("s_main0" + index);
  20436. let words = 1;
  20437. switch (index) {
  20438. case 4:
  20439. words = 5;
  20440. break;
  20441. case 5:
  20442. words = 3;
  20443. break;
  20444. case 6:
  20445. words = 6;
  20446. break;
  20447. case 7:
  20448. words = 7;
  20449. break;
  20450. default:
  20451. break;
  20452. }
  20453. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20454. this.playSecretaryRandomSound();
  20455. });
  20456. }
  20457. closeSelf() {
  20458. this.hide();
  20459. }
  20460. }
  20461. UIShop$1.uiName = "UIShop";
  20462. class SignMax$1 {
  20463. constructor(ui) {
  20464. this.ui = ui;
  20465. }
  20466. updateSelf(index, sameDay, curDayIndex) {
  20467. let data = cfgTable.signData[index + 1];
  20468. this.ui.titleTxt.text = data.title;
  20469. let arr1 = data.award[0].split('-');
  20470. let arr2 = data.award[1].split('-');
  20471. let num1 = parseInt(arr1[1]);
  20472. let num2 = parseInt(arr2[1]);
  20473. this.ui.numTxt1.text = num1 + "";
  20474. this.ui.numTxt2.text = num2 + "";
  20475. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  20476. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  20477. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  20478. this.ui.numTxt1.visible = false;
  20479. }
  20480. else {
  20481. this.ui.numTxt1.visible = true;
  20482. }
  20483. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  20484. this.ui.numTxt2.visible = false;
  20485. }
  20486. else {
  20487. this.ui.numTxt2.visible = true;
  20488. }
  20489. if (index < curDayIndex) {
  20490. this.ui.c1.selectedIndex = 1;
  20491. }
  20492. else if (index == curDayIndex) {
  20493. if (sameDay) {
  20494. this.ui.c1.selectedIndex = 2;
  20495. }
  20496. else {
  20497. this.ui.c1.selectedIndex = 2;
  20498. }
  20499. }
  20500. else {
  20501. this.ui.c1.selectedIndex = 0;
  20502. }
  20503. }
  20504. }
  20505. class SignNormal$1 {
  20506. constructor(ui) {
  20507. this.ui = ui;
  20508. }
  20509. updateSelf(index, sameDay, curDayIndex) {
  20510. let data = cfgTable.signData[index + 1];
  20511. this.ui.titleTxt.text = data.title;
  20512. let arr = data.award[0].split('-');
  20513. let type = parseInt(arr[0]);
  20514. let num = parseInt(arr[1]);
  20515. this.ui.numTxt.text = num + "";
  20516. if (type > 2) {
  20517. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  20518. this.ui.myIcon.rotation = 0;
  20519. }
  20520. else {
  20521. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  20522. this.ui.myIcon.rotation = 0;
  20523. }
  20524. if (xGame.common.signAwardContainsRod(data.award)) {
  20525. this.ui.numTxt.visible = false;
  20526. }
  20527. else {
  20528. this.ui.numTxt.visible = true;
  20529. }
  20530. if (index < curDayIndex) {
  20531. this.ui.c1.selectedIndex = 1;
  20532. }
  20533. else if (index == curDayIndex) {
  20534. if (sameDay) {
  20535. this.ui.c1.selectedIndex = 2;
  20536. }
  20537. else {
  20538. this.ui.c1.selectedIndex = 2;
  20539. }
  20540. }
  20541. else {
  20542. this.ui.c1.selectedIndex = 0;
  20543. }
  20544. }
  20545. }
  20546. class UISign$1 extends UIBase {
  20547. constructor() {
  20548. super();
  20549. this.curDayIndex = 0;
  20550. this.starX = 0;
  20551. }
  20552. onConstructor() {
  20553. this.ui = ui_UISign.createInstance();
  20554. this.contentPane = this.ui;
  20555. this.isEject = false;
  20556. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20557. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20558. this.initSignItem();
  20559. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  20560. this.addUIClick(this.ui.againBtn, this.againGetAward);
  20561. }
  20562. show() {
  20563. super.show();
  20564. this.ui.t0.play();
  20565. this.playSecretaryIdle();
  20566. this.updateSign();
  20567. }
  20568. initSignItem() {
  20569. this.signArr = [];
  20570. for (let index = 0; index < 6; index++) {
  20571. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  20572. this.signArr.push(temp);
  20573. }
  20574. this.signMax = new SignMax$1(this.ui.myNode.day7);
  20575. if (Moyu.isKs)
  20576. this.ui.closeNode.closeBtn.x += 100;
  20577. }
  20578. updateSign() {
  20579. let sameDay = xGame.common.judgeSameDay();
  20580. let max = 7;
  20581. this.curDayIndex = DataMgr.getSignData();
  20582. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  20583. this.curDayIndex = 0;
  20584. if (!sameDay) {
  20585. this.ui.normalBtn.visible = true;
  20586. this.ui.tipsNode.visible = false;
  20587. this.ui.againBtn.visible = false;
  20588. }
  20589. else {
  20590. this.ui.normalBtn.visible = false;
  20591. let again = DataMgr.getExtraSign();
  20592. let isCurrency = false;
  20593. let index = this.curDayIndex;
  20594. if (index == 0)
  20595. index = 7;
  20596. let award = cfgTable.signData[index].award;
  20597. let num = award[0].split("-")[0];
  20598. if (num == "1" || num == "2")
  20599. isCurrency = true;
  20600. let showAgain = again == 0 && isCurrency;
  20601. this.ui.againBtn.visible = showAgain;
  20602. this.ui.tipsNode.visible = !showAgain;
  20603. }
  20604. for (let index = 0; index < this.signArr.length; index++) {
  20605. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  20606. }
  20607. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  20608. }
  20609. playSecretaryIdle() {
  20610. let parent = this.ui.secretary.displayObject;
  20611. parent.destroyChildren();
  20612. let xx = this.ui.secretary.width / 2;
  20613. let yy = this.ui.secretary.height;
  20614. let scale = xGame.common.getSecretaryScale();
  20615. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20616. xGame.common.secretary.play(data, 0, true, parent);
  20617. }
  20618. closeSelf() {
  20619. this.hide();
  20620. }
  20621. normalGetAward() {
  20622. let sameDay = xGame.common.judgeSameDay();
  20623. if (!sameDay) {
  20624. let award = cfgTable.signData[this.curDayIndex + 1].award;
  20625. let temp;
  20626. let type;
  20627. let num;
  20628. let arr = [];
  20629. for (let index = 0; index < award.length; index++) {
  20630. temp = award[index].split("-");
  20631. type = parseInt(temp[0]);
  20632. num = parseInt(temp[1]);
  20633. let awardType = new AwardType();
  20634. awardType.num = num;
  20635. awardType.type = type;
  20636. arr.push(awardType);
  20637. }
  20638. xGame.common.getAward(arr, (watchVideo) => {
  20639. this.curDayIndex++;
  20640. if (this.curDayIndex > 7)
  20641. this.curDayIndex = 0;
  20642. DataMgr.setSignData(this.curDayIndex);
  20643. DataMgr.setSignTime(new Date().getTime());
  20644. if (watchVideo) {
  20645. DataMgr.setExtraSign(1);
  20646. Moyu.sendDataEvent("signIn1");
  20647. }
  20648. this.updateSign();
  20649. });
  20650. }
  20651. }
  20652. againGetAward() {
  20653. Moyu.sendDataEvent("signIn2");
  20654. console.log('zh:qjff_AD_for_uisign');
  20655. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  20656. }
  20657. else {
  20658. console.log('zh:AD 失败,直接发放奖励');
  20659. this.qjff_AD_for_uisign();
  20660. }
  20661. }
  20662. qjff_AD_for_uisign() {
  20663. let index = this.curDayIndex;
  20664. if (index == 0)
  20665. index = 7;
  20666. let award = cfgTable.signData[index].award;
  20667. let temp;
  20668. let type;
  20669. let num;
  20670. for (let index = 0; index < award.length; index++) {
  20671. temp = award[index].split("-");
  20672. type = parseInt(temp[0]);
  20673. num = parseInt(temp[1]) * 3;
  20674. xGame.common.playObjFlyAnim(num, type);
  20675. }
  20676. DataMgr.setExtraSign(1);
  20677. this.updateSign();
  20678. }
  20679. }
  20680. UISign$1.uiName = "UISign";
  20681. class UIModeSelection$1 extends UIBase {
  20682. constructor() {
  20683. super();
  20684. }
  20685. onConstructor() {
  20686. this.ui = ui_UIModeSelection.createInstance();
  20687. this.contentPane = this.ui;
  20688. this.isEject = false;
  20689. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20690. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20691. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20692. this.addUIClick(this.ui.closeBtn, this.hide);
  20693. this.peopleArr = [650, 6900, 3800];
  20694. this.peopleOffest = [50, 500, 200];
  20695. this.updateSelf();
  20696. }
  20697. show(callback) {
  20698. super.show();
  20699. this.ui.t0.play();
  20700. this.callback = callback;
  20701. }
  20702. updateSelf() {
  20703. let cfg = cfgTable.modeselectData;
  20704. for (let index = 1; index <= 3; index++) {
  20705. let node = this.ui.myNode["type" + index];
  20706. node.need.text = cfg[index].need;
  20707. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20708. node.peopleTxt.text = this.getRandPeople(index - 1);
  20709. }
  20710. }
  20711. enterGame(type) {
  20712. console.log('zh: 进入经典模式 type: ' + type);
  20713. xGame.common.classicRoomType = type;
  20714. let cfg = cfgTable.modeselectData[type];
  20715. let need = cfg.need;
  20716. xGame.common.passAwardCoin = cfg.award;
  20717. if (DataMgr.coinEnough(need)) {
  20718. DataMgr.setCoin(-need);
  20719. this.ui.myNode["type" + type].t0.play();
  20720. Laya.timer.once(200, this, () => {
  20721. this.callback && this.callback();
  20722. });
  20723. }
  20724. else {
  20725. Moyu.sendDataEvent("AddCoinVideo");
  20726. xGame.uiMgr.Show(UIAddProp$1, 0);
  20727. }
  20728. }
  20729. getRandPeople(index) {
  20730. let rand = this.peopleOffest[index];
  20731. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20732. }
  20733. }
  20734. UIModeSelection$1.uiName = "UIModeSelection";
  20735. class UITry$1 extends UIBase {
  20736. constructor() {
  20737. super();
  20738. this.closeTime = 0;
  20739. this.closeNum = 0;
  20740. this.skillUrl = xGame.common.skillIconList;
  20741. }
  20742. onConstructor() {
  20743. this.ui = ui_UITry.createInstance();
  20744. this.contentPane = this.ui;
  20745. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  20746. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  20747. }
  20748. show() {
  20749. super.show();
  20750. this.closeNum = 0;
  20751. this.closeTime = 15;
  20752. this.ui.t0.play();
  20753. PlatMgr.showRateBanner();
  20754. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20755. Laya.timer.loop(1000, this, this.updateTime);
  20756. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  20757. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  20758. xGame.common.gameMgr.gamePause = true;
  20759. }
  20760. updateTime() {
  20761. if (this.closeTime > 1) {
  20762. this.closeTime--;
  20763. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20764. }
  20765. else
  20766. this.hide();
  20767. }
  20768. hide() {
  20769. Laya.timer.clearAll(this);
  20770. Moyu.showBannerAd(false);
  20771. super.hide();
  20772. xGame.common.gameMgr.gamePause = false;
  20773. }
  20774. onTry() {
  20775. console.log('zh:qjff_AD_for_uitry');
  20776. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  20777. }
  20778. else {
  20779. console.log('zh:AD 失败,直接发放奖励');
  20780. this.qjff_AD_for_uitry();
  20781. }
  20782. }
  20783. qjff_AD_for_uitry() {
  20784. let select = xGame.common.curPlayerSkillType;
  20785. DataMgr.gameData.trySkill = select;
  20786. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  20787. DataMgr.saveGameData();
  20788. DataMgr.setBigSkill(select, 1);
  20789. xGame.showTip("Trial Successful");
  20790. this.hide();
  20791. }
  20792. onCancel() {
  20793. if (this.closeNum > 0) {
  20794. this.closeNum--;
  20795. if (this.closeNum < 2)
  20796. this.hide();
  20797. return;
  20798. }
  20799. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  20800. this.onTry();
  20801. }
  20802. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  20803. this.closeNum = 3;
  20804. }
  20805. else
  20806. this.hide();
  20807. }
  20808. }
  20809. UITry$1.uiName = "UITry";
  20810. class UIGetAward$1 extends UIBase {
  20811. constructor() {
  20812. super();
  20813. this.showTriple = true;
  20814. }
  20815. onConstructor() {
  20816. this.ui = ui_UIGetAward.createInstance();
  20817. this.contentPane = this.ui;
  20818. this.isEject = false;
  20819. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  20820. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  20821. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  20822. }
  20823. show(arr, showTriple, callback) {
  20824. super.show();
  20825. this.ui.t0.play();
  20826. this.ui.eftNode.visible = true;
  20827. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  20828. this.ui.eftNode.visible = false;
  20829. }), 1, 0, 0, 0.9);
  20830. this.awardArr = arr;
  20831. this.showTriple = showTriple;
  20832. this.callback = callback;
  20833. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  20834. this.ui.myList.numItems = arr.length;
  20835. xGame.soundMgr.playSound("getaward");
  20836. }
  20837. updateSelf(index, obj) {
  20838. let temp = this.awardArr[index];
  20839. let icon = this.getIcon(temp.type);
  20840. let str = icon;
  20841. if (temp.type > 2) {
  20842. str = "s" + icon;
  20843. }
  20844. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  20845. obj.myIcon.rotation = 0;
  20846. obj.numTxt.text = temp.num + "";
  20847. obj.numTxt.visible = temp.type > 2 ? false : true;
  20848. obj.nameTxt.text = this.getNameStr(temp.type);
  20849. }
  20850. renderItem(index, obj) {
  20851. this.updateSelf(index, obj);
  20852. }
  20853. tripleGetAward() {
  20854. console.log('zh:qjff_AD_for_uigetAward');
  20855. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  20856. }
  20857. else {
  20858. console.log('zh:AD 失败,直接发放奖励');
  20859. this.qjff_AD_for_uigetAward();
  20860. }
  20861. }
  20862. qjff_AD_for_uigetAward() {
  20863. this.getAward(3);
  20864. }
  20865. normalGetAward() {
  20866. if (PlatMgr.isMisVideo())
  20867. this.tripleGetAward();
  20868. else
  20869. this.getAward();
  20870. }
  20871. getAward(times = 1) {
  20872. this.hide();
  20873. for (let index = 0; index < this.awardArr.length; index++) {
  20874. this.awardArr[index].num *= times;
  20875. }
  20876. this.callback && this.callback(times != 1);
  20877. }
  20878. getIcon(type) {
  20879. switch (type) {
  20880. case Prop.diamond:
  20881. return "ty_zs";
  20882. case Prop.coin:
  20883. return "ty_jb";
  20884. case Prop.gan1:
  20885. return "qg1";
  20886. case Prop.gan2:
  20887. return "qg2";
  20888. case Prop.gan3:
  20889. return "qg3";
  20890. case Prop.gan4:
  20891. return "qg4";
  20892. default:
  20893. break;
  20894. }
  20895. }
  20896. getNameStr(type) {
  20897. switch (type) {
  20898. case Prop.diamond:
  20899. return "Diamond";
  20900. case Prop.coin:
  20901. return "Coins";
  20902. case Prop.gan1:
  20903. case Prop.gan2:
  20904. case Prop.gan3:
  20905. case Prop.gan4:
  20906. return cfgTable.ballrodData[type - 1].name;
  20907. default:
  20908. break;
  20909. }
  20910. }
  20911. }
  20912. UIGetAward$1.uiName = "UIGetAward";
  20913. class UIBox$1 extends UIBase {
  20914. constructor() {
  20915. super();
  20916. this.boxNum = 0;
  20917. this.boxMax = 10;
  20918. this.inAd = false;
  20919. this.isClose = false;
  20920. }
  20921. onConstructor() {
  20922. this.ui = ui_UIBox.createInstance();
  20923. this.contentPane = this.ui;
  20924. this.isEject = false;
  20925. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  20926. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  20927. Laya.timer.loop(1000, this, this.update);
  20928. }
  20929. update() {
  20930. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  20931. this.boxNum -= 1;
  20932. this.upBar();
  20933. }
  20934. }
  20935. upBar() {
  20936. if (this.boxNum > this.boxMax)
  20937. this.boxNum = this.boxMax;
  20938. this.ui.bar.value = this.boxNum * 10;
  20939. }
  20940. show() {
  20941. super.show();
  20942. this.isClose = false;
  20943. this.boxNum = 0;
  20944. this.inAd = false;
  20945. this.upBar();
  20946. this.ui.t0.play();
  20947. this.ui.closeBtn.visible = false;
  20948. Laya.timer.once(3000, this, () => {
  20949. this.ui.closeBtn.visible = true;
  20950. this.ui.bar.alpha = 1;
  20951. });
  20952. Laya.timer.once(500, this, () => {
  20953. this.ui.t1.play();
  20954. });
  20955. }
  20956. hide() {
  20957. Laya.timer.clearAll(this);
  20958. Moyu.showBannerAd(false);
  20959. super.hide();
  20960. }
  20961. onOpenBox() {
  20962. this.boxNum++;
  20963. if (this.boxNum < this.boxMax) {
  20964. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  20965. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  20966. }
  20967. }
  20968. else if (this.boxNum == this.boxMax) {
  20969. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  20970. this.ui.openBtn.c1.selectedIndex = 13;
  20971. this.inAd = true;
  20972. }
  20973. else
  20974. this.getAward();
  20975. }
  20976. else if (this.inAd) {
  20977. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  20978. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  20979. }
  20980. else {
  20981. console.log('zh:AD 失败,直接发放奖励');
  20982. this.qjff_AD_for_UIBOX_onOpenBox();
  20983. }
  20984. }
  20985. this.upBar();
  20986. }
  20987. qjff_AD_for_UIBOX_onOpenBox() {
  20988. this.getAward();
  20989. }
  20990. onCloseBox() {
  20991. if (this.isClose)
  20992. this.hide();
  20993. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  20994. this.isClose = true;
  20995. PlatMgr.showBanner(true, 0, 3000);
  20996. }
  20997. else
  20998. this.hide();
  20999. }
  21000. getAward() {
  21001. let str = "";
  21002. if (Math.random() < 0.5) {
  21003. let max = Moyu.isLegal ? 500 : 2500;
  21004. let num = xGame.tools.random(max, 500 + max);
  21005. DataMgr.setCoin(num);
  21006. str = "金币x" + num;
  21007. }
  21008. else {
  21009. let max = Moyu.isLegal ? 10 : 30;
  21010. let num = xGame.tools.random(max, 30 + max);
  21011. DataMgr.setDiamond(num);
  21012. str = "钻石x" + num;
  21013. }
  21014. xGame.showTip("恭喜获得-" + str);
  21015. this.hide();
  21016. }
  21017. }
  21018. UIBox$1.uiName = "UIBox";
  21019. class UIMain$1 extends UIBase {
  21020. constructor() {
  21021. super();
  21022. this.firstEnter = true;
  21023. }
  21024. nativeCallJs(msg) {
  21025. let t = msg;
  21026. console.log("zh: nativeCallJs 奖励开始发放:", t);
  21027. switch (t) {
  21028. case 'qjff_chouJiang':
  21029. let dui = xGame.uiMgr.getUI(UIDraw$1);
  21030. dui.qjff_chouJiang();
  21031. break;
  21032. case 'qjff_AD_for_uisign':
  21033. let dui2 = xGame.uiMgr.getUI(UISign$1);
  21034. dui2.qjff_AD_for_uisign();
  21035. break;
  21036. case 'qjff_AD_for_uitry':
  21037. let dui3 = xGame.uiMgr.getUI(UITry$1);
  21038. dui3.qjff_AD_for_uitry();
  21039. break;
  21040. case 'qjff_AD_for_uipower':
  21041. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  21042. dui4.qjff_AD_for_uipower();
  21043. break;
  21044. case 'qjff_AD_for_uigetAward':
  21045. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  21046. dui5.qjff_AD_for_uigetAward();
  21047. break;
  21048. case 'qjff_AD_for_uiGameEnd':
  21049. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  21050. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  21051. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  21052. break;
  21053. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  21054. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  21055. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  21056. break;
  21057. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  21058. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  21059. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  21060. break;
  21061. case 'qjff_AD_for_UIrepentProp_videoRegret':
  21062. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  21063. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  21064. break;
  21065. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  21066. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  21067. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  21068. break;
  21069. case 'qjff_AD_for_UIBOX_onOpenBox':
  21070. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  21071. dui11.qjff_AD_for_UIBOX_onOpenBox();
  21072. break;
  21073. case 'qjff_AD_for_UIAddCoin':
  21074. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  21075. dui12.qjff_AD_for_UIAddCoin();
  21076. break;
  21077. case '111a':
  21078. let dui14 = xGame.uiMgr.getUI(UISign$1);
  21079. dui14.qjff_AD_for_uisign();
  21080. break;
  21081. case '222a':
  21082. let dui15 = xGame.uiMgr.getUI(UISign$1);
  21083. dui15.qjff_AD_for_uisign();
  21084. break;
  21085. case '333a':
  21086. let dui16 = xGame.uiMgr.getUI(UISign$1);
  21087. dui16.qjff_AD_for_uisign();
  21088. break;
  21089. default:
  21090. console.log('zh:未知的方法名字' + t);
  21091. break;
  21092. }
  21093. }
  21094. onConstructor() {
  21095. console.log('zh: UIMain onConstructor');
  21096. this.ui = ui_UIMain.createInstance();
  21097. this.contentPane = this.ui;
  21098. this.isEject = false;
  21099. this.addEvent();
  21100. this.addClickSpine();
  21101. this.settingNode = new SettingNode$1(this.ui.settingNode);
  21102. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21103. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  21104. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  21105. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  21106. let curUse = DataMgr.getCurSecretary();
  21107. this.changeSecretary(curUse);
  21108. this.ui.rankBtn.visible = false;
  21109. this.ui.talkNode.visible = false;
  21110. let guide = DataMgr.getSkillGuide();
  21111. if (xGame.common.isNewDay && guide == 1) {
  21112. xGame.common.isNewDay = false;
  21113. xGame.soundMgr.playSound("s_main01");
  21114. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21115. console.log("zh:播放小秘书每天语音");
  21116. }
  21117. this.ui.n83.visible = false;
  21118. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  21119. }
  21120. changeSecretary(curUse) {
  21121. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  21122. xGame.common.secretary && xGame.common.secretary.dispose();
  21123. this.addSecretarySpine(name);
  21124. }
  21125. addSecretarySpine(name) {
  21126. let spine = new SpineMgr(name, () => {
  21127. this.playSecretaryIdle();
  21128. });
  21129. xGame.common.secretary = spine;
  21130. }
  21131. addClickSpine() {
  21132. let clickSpine = new SpineMgr("dianji", () => {
  21133. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  21134. let parent = Laya.stage;
  21135. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  21136. clickSpine.play(data, 0, false, parent, (spine) => {
  21137. spine.destroy(true);
  21138. });
  21139. });
  21140. });
  21141. }
  21142. addEvent() {
  21143. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  21144. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  21145. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  21146. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  21147. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  21148. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  21149. this.addUIClick(this.ui, this.interuptSecretary);
  21150. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  21151. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  21152. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  21153. this.addUIClick(this.ui.shopBtn, this.openShopView);
  21154. this.addUIClick(this.ui.signBtn, this.openSignView);
  21155. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  21156. }
  21157. show(showFailWords) {
  21158. super.show();
  21159. this.moneyNode.ui.c1.selectedIndex = 1;
  21160. this.playSecretaryIdle();
  21161. xGame.soundMgr.playMusic("caromhall01", 0);
  21162. Laya.timer.clearAll(this);
  21163. this.playSecretaryRandomSound();
  21164. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  21165. if (showFailWords) {
  21166. console.log('zh:uimain.ts ');
  21167. setTimeout(() => {
  21168. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  21169. let words = -1;
  21170. if (str == "s_main02") {
  21171. words = 2;
  21172. }
  21173. else {
  21174. words = 3;
  21175. }
  21176. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21177. xGame.soundMgr.playSound(str);
  21178. }, 300);
  21179. }
  21180. this.showGuide();
  21181. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  21182. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  21183. let guide = DataMgr.getSkillGuide();
  21184. if (guide == 1) {
  21185. let randTime = xGame.common.randomNum(300, 800);
  21186. if (this.firstEnter) {
  21187. console.log("zh: firstEnter");
  21188. this.firstEnter = false;
  21189. randTime += 900;
  21190. }
  21191. else {
  21192. console.log("zh: no firstEnter");
  21193. }
  21194. Laya.timer.once(randTime, this, () => {
  21195. xGame.common.autoPopUIView();
  21196. });
  21197. }
  21198. }
  21199. checkActive(show) {
  21200. }
  21201. showGuide() {
  21202. let guide = DataMgr.getSkillGuide();
  21203. this.ui.guideBtn.visible = guide == 0;
  21204. this.ui.enterGuide.visible = false;
  21205. this.ui.secretaryGuide.visible = guide == 0;
  21206. if (guide == 0) {
  21207. console.log("zh:显示引导");
  21208. xGame.soundMgr.playSound("s_guide");
  21209. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21210. }
  21211. else {
  21212. console.log("zh:不需要显示引导");
  21213. }
  21214. }
  21215. ensureSecretary() {
  21216. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  21217. this.ui.secretaryGuide.visible = false;
  21218. this.ui.enterGuide.visible = true;
  21219. this.ui.wordsNode.t0.play();
  21220. if (DataMgr.getNewUser())
  21221. Moyu.sendDataEvent("gameReady");
  21222. }
  21223. playSecretaryIdle() {
  21224. let parent = this.ui.secretary.displayObject;
  21225. parent.destroyChildren();
  21226. let xx = this.ui.secretary.width / 2;
  21227. let yy = this.ui.secretary.height;
  21228. let scale = xGame.common.getSecretaryScale();
  21229. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21230. console.log("zh:playSecretaryIdle", data);
  21231. xGame.common.secretary.play(data, 0, true, parent);
  21232. }
  21233. startGame(type) {
  21234. xGame.common.gameMode = type;
  21235. Moyu.sendDataEvent("PlayGame", { type: type });
  21236. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  21237. switch (xGame.common.gameMode) {
  21238. case GameMode.classic:
  21239. console.log('zh:进入经典模式111111111');
  21240. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  21241. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21242. console.log('zh:classic db_over_lev=', db_over_lev);
  21243. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  21244. console.log('zh:判断是否可以玩该模式classic =NO');
  21245. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  21246. xGame.uiMgr.Show(UIMsg$1, tipStr);
  21247. console.log('zh:返回');
  21248. return;
  21249. }
  21250. else {
  21251. console.log('zh:可以玩该模式classic 66666666666666');
  21252. this.beginGame();
  21253. }
  21254. }
  21255. else {
  21256. console.log('zh:不需要判断是否可以玩该classic');
  21257. let challengeTimes = DataMgr.getChallengeTimes();
  21258. if (challengeTimes == 0) {
  21259. xGame.uiMgr.Show(UIInvitation$1);
  21260. }
  21261. else {
  21262. this.beginGame();
  21263. }
  21264. break;
  21265. }
  21266. case GameMode.bigMove:
  21267. console.error('zh:bigMove check');
  21268. let guide = DataMgr.getSkillGuide();
  21269. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  21270. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21271. console.log('zh:bigMove db_over_lev=', db_over_lev);
  21272. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  21273. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  21274. xGame.uiMgr.Show(UIMsg$1, tipStr);
  21275. return;
  21276. }
  21277. else {
  21278. console.log('zh:可以玩该模式 bigMove');
  21279. this.beginGame();
  21280. if (DataMgr.getNewUser())
  21281. Moyu.sendDataEvent("gameStart0");
  21282. }
  21283. }
  21284. else {
  21285. this.beginGame();
  21286. if (DataMgr.getNewUser())
  21287. Moyu.sendDataEvent("gameStart0");
  21288. }
  21289. break;
  21290. default:
  21291. console.error('zh:未知错误!!!!');
  21292. break;
  21293. }
  21294. }
  21295. beginGame(isNice = false) {
  21296. console.log('zh:beginGame ');
  21297. let guide = DataMgr.getSkillGuide();
  21298. if (guide == 1) {
  21299. console.log('zh:非新手引导,showInternAd ');
  21300. JSBridgeUtils.instance.showInternAd('beginGame');
  21301. }
  21302. else {
  21303. console.log('zh:新手引导,不显示AD ');
  21304. }
  21305. console.log('zh:beginGame 2 go');
  21306. if (xGame.common.gameMode == GameMode.classic) {
  21307. if (isNice) {
  21308. this.enterClassic();
  21309. }
  21310. else {
  21311. xGame.uiMgr.Show(UIModeSelection$1, () => {
  21312. console.log('zh:BBBBBBBBBBBBBBB');
  21313. this.enterClassic();
  21314. });
  21315. }
  21316. }
  21317. else if (xGame.common.gameMode == GameMode.bigMove) {
  21318. this.ui.enterGuide.visible = false;
  21319. xGame.uiMgr.Show(UISkill$1);
  21320. }
  21321. }
  21322. enterClassic() {
  21323. xGame.uiMgr.Show(UIGame$1);
  21324. xGame.uiMgr.Show(UIMatching$1, () => {
  21325. if (!this.isHide)
  21326. this.hide();
  21327. xGame.common.gameUI.ui.alpha = 1;
  21328. xGame.common.gameUI.startGame();
  21329. xGame.uiMgr.Hide(UIGameEnd$1);
  21330. });
  21331. }
  21332. startGlobal() {
  21333. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21334. }
  21335. startWeekly() {
  21336. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21337. }
  21338. zhouSaiMonth() {
  21339. console.log('zh: zhouSaiMonth 被调用');
  21340. }
  21341. startPlaceBall() {
  21342. xGame.uiMgr.Show(UILevelDisplay$1);
  21343. }
  21344. hide() {
  21345. console.log('zh:uimain hide ...');
  21346. super.hide();
  21347. xGame.common.stopGirlPop(this.ui.talkNode);
  21348. }
  21349. onGetUserInfo(force = false) {
  21350. if (Moyu.isWx) {
  21351. let info = Moyu.getSystemInfo();
  21352. if (info)
  21353. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  21354. }
  21355. else {
  21356. Moyu.initUser(this, this.freshUser, force);
  21357. }
  21358. if (!Moyu.hasUserInfo) {
  21359. let user = Moyu.getUserInfo();
  21360. user.headIcon = 'res/ty_touxiang.png';
  21361. }
  21362. this.freshUser();
  21363. }
  21364. freshUser() {
  21365. let user = Moyu.getUserInfo();
  21366. if (!user.isAuth) {
  21367. user.headIcon = 'res/ty_touxiang.png';
  21368. }
  21369. else
  21370. DataMgr.upRankData();
  21371. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  21372. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  21373. }
  21374. interuptSecretary() {
  21375. Laya.timer.clearAll(this);
  21376. this.playSecretaryRandomSound();
  21377. }
  21378. playSecretaryRandomSound() {
  21379. if (this.isHide)
  21380. return;
  21381. let time = xGame.common.randomNum(45000, 60000);
  21382. Laya.timer.once(time, this, () => {
  21383. if (this.isHide)
  21384. return;
  21385. let index = xGame.common.randomNum(4, 7);
  21386. xGame.soundMgr.playSound("s_main0" + index);
  21387. let words = 1;
  21388. switch (index) {
  21389. case 4:
  21390. words = 5;
  21391. break;
  21392. case 5:
  21393. words = 3;
  21394. break;
  21395. case 6:
  21396. words = 6;
  21397. break;
  21398. case 7:
  21399. words = 7;
  21400. break;
  21401. default:
  21402. break;
  21403. }
  21404. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21405. this.playSecretaryRandomSound();
  21406. });
  21407. }
  21408. openSecretaryView() {
  21409. xGame.uiMgr.Show(UISecretary$1);
  21410. Moyu.sendDataEvent("secretary");
  21411. }
  21412. openShopView() {
  21413. xGame.uiMgr.Show(UIShop$1);
  21414. }
  21415. openSignView() {
  21416. xGame.uiMgr.Show(UISign$1);
  21417. }
  21418. openDrawView() {
  21419. xGame.uiMgr.Show(UIDraw$1);
  21420. }
  21421. openRanking() {
  21422. console.log('zh:phb openRanking');
  21423. xGame.uiMgr.Show(UIRanking$1);
  21424. Moyu.sendDataEvent("rankingList");
  21425. }
  21426. }
  21427. UIMain$1.uiName = "UIMain";
  21428. function InitShader() {
  21429. }
  21430. function appInit() {
  21431. xGame.context.init(getLoadingResList(), initCallback);
  21432. }
  21433. function getLoadingResList() {
  21434. return [
  21435. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  21436. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  21437. ];
  21438. }
  21439. function getGameResList() {
  21440. return [
  21441. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  21442. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  21443. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  21444. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  21445. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  21446. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  21447. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  21448. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  21449. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  21450. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  21451. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  21452. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  21453. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  21454. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  21455. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  21456. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  21457. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  21458. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  21459. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  21460. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  21461. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  21462. ];
  21463. }
  21464. function initCallback() {
  21465. window["DataMgr"] = DataMgr;
  21466. DataMgr.Init();
  21467. Moyu.init(getPlat(), this, () => {
  21468. DataMgr.isNewDay();
  21469. PlatMgr.initConfig();
  21470. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  21471. }, true);
  21472. console.log('zh:开始sm init1 start');
  21473. xGame.soundMgr.init();
  21474. console.log('zh:开始sm init1 end');
  21475. xGame.uiMgr.init();
  21476. xGame.uiMgr.clearTempData();
  21477. xGame.uiMgr.bindFUI(fguiRes.loading);
  21478. xGame.uiMgr.Show(UILoading);
  21479. }
  21480. function loadSubRes(callback) {
  21481. var tab = ["asset", "res", "spine"];
  21482. let subDone = 0;
  21483. for (var i = 0; i < tab.length; i++) {
  21484. let sub = tab[i];
  21485. Moyu.loadSubRes(sub, (pro) => {
  21486. callback && callback(pro, false);
  21487. }).then(() => {
  21488. subDone++;
  21489. if (subDone >= tab.length)
  21490. callback && callback(1, true);
  21491. });
  21492. }
  21493. }
  21494. function enterGame() {
  21495. xGame.cfgMgr.init();
  21496. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  21497. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  21498. xGame.uiMgr.Hide(UILoading);
  21499. fgui.UIPackage.removePackage(fguiRes.loading);
  21500. xGame.uiMgr.bindFUI(fguiRes.game);
  21501. xGame.uiMgr.Show(UIMain$1);
  21502. if (DataMgr.getNewUser())
  21503. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  21504. }
  21505. function getPlat() {
  21506. let cfg = new MoyuCfg();
  21507. cfg.plat = MoyuPlat.web;
  21508. cfg.myId = 120;
  21509. cfg.myKey = '8848a885774230a4';
  21510. cfg.version = 0;
  21511. if (window.hasOwnProperty("gamebox")) {
  21512. cfg.plat = MoyuPlat.f399;
  21513. cfg.version = 0;
  21514. }
  21515. else if (window.hasOwnProperty("ks")) {
  21516. cfg.plat = MoyuPlat.ks;
  21517. cfg.version = 0;
  21518. cfg.ads.ksVideoId = '2300002254_01';
  21519. cfg.ads.ksInsertId = '2300002254_02';
  21520. }
  21521. else if (Laya.Browser.onTTMiniGame) {
  21522. cfg.plat = MoyuPlat.tt;
  21523. cfg.version = 0;
  21524. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  21525. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  21526. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  21527. }
  21528. else if (Laya.Browser.onMiniGame) {
  21529. cfg.plat = MoyuPlat.wx;
  21530. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  21531. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  21532. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  21533. }
  21534. else if (Laya.Browser.onQQMiniGame) {
  21535. cfg.plat = MoyuPlat.qq;
  21536. }
  21537. else if (Laya.Browser.onQGMiniGame) {
  21538. cfg.plat = MoyuPlat.op;
  21539. cfg.ads.opVideoId = '455502';
  21540. cfg.ads.opBannerId = '455507';
  21541. }
  21542. else if (Laya.Browser.onVVMiniGame) {
  21543. cfg.plat = MoyuPlat.vv;
  21544. cfg.version = 0;
  21545. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  21546. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  21547. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  21548. }
  21549. else if (Laya.Browser.onHWMiniGame) {
  21550. cfg.plat = MoyuPlat.hw;
  21551. }
  21552. else if (window["mz"]) {
  21553. cfg.plat = MoyuPlat.mz;
  21554. }
  21555. else {
  21556. let cfg = window['conchConfig'];
  21557. if (cfg) {
  21558. var os = cfg.getOS();
  21559. if (os == "Conch-ios") {
  21560. cfg.plat = MoyuPlat.ios;
  21561. }
  21562. else if (os == "Conch-android") {
  21563. }
  21564. }
  21565. }
  21566. return cfg;
  21567. }
  21568. class Main {
  21569. constructor() {
  21570. if (window["Laya3D"])
  21571. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  21572. else {
  21573. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  21574. this.initMain();
  21575. }
  21576. }
  21577. initMain() {
  21578. Laya["Physics"] && Laya["Physics"].enable();
  21579. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  21580. Laya.stage.scaleMode = GameConfig.scaleMode;
  21581. Laya.stage.screenMode = GameConfig.screenMode;
  21582. Laya.stage.alignV = GameConfig.alignV;
  21583. Laya.stage.alignH = GameConfig.alignH;
  21584. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  21585. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  21586. Laya.enableDebugPanel();
  21587. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  21588. Laya["PhysicsDebugDraw"].enable();
  21589. if (GameConfig.stat)
  21590. Laya.Stat.show();
  21591. Laya.alertGlobalError(true);
  21592. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  21593. }
  21594. onVersionLoaded() {
  21595. appInit();
  21596. }
  21597. }
  21598. new Main();
  21599. }());
  21600. //# sourceMappingURL=bundle.js.map