bundle.js 842 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033
  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.getPaiHangBangDataFormJosnFile();
  5199. this.updateSelf();
  5200. let self = Moyu.getUserInfo();
  5201. if (!self.isAuth) {
  5202. Moyu.initUser(this, () => {
  5203. DataMgr.upRankData();
  5204. });
  5205. }
  5206. }
  5207. getPaiHangBangDataFormJosnFile() {
  5208. const rankingList = cfgTable.paiHangBangData.list;
  5209. this.updateItemData(rankingList);
  5210. }
  5211. updateSelfItem() {
  5212. console.log('zh:Moyu.platType =' + Moyu.platType);
  5213. let self = Moyu.getUserInfo();
  5214. let topX = 10;
  5215. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5216. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > topX ? "No Rank" : this.myIndex.toString();
  5217. if (this.myIndex > topX) {
  5218. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5219. }
  5220. else {
  5221. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5222. }
  5223. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5224. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5225. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5226. }
  5227. updateItemData(data) {
  5228. this.myStar = xGame.common.getAllStarNum();
  5229. this.myStar = 10;
  5230. this.myIndex = 3;
  5231. if (this.rankList.length < 2) {
  5232. this.rankList = data;
  5233. let self = Moyu.getUserInfo();
  5234. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5235. console.log('zh:myself headIcon= ' + self.headIcon);
  5236. for (let i = 0; i < data.length; i++) {
  5237. let data = this.rankList[i];
  5238. if (data.userId == self.userId) {
  5239. this.rankList.splice(i, 1);
  5240. break;
  5241. }
  5242. }
  5243. for (let i = 0; i < data.length; i++) {
  5244. let data = this.rankList[i];
  5245. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5246. this.myIndex = i + 1;
  5247. let user = { headIcon: self.headIcon, nickName: "myself" };
  5248. let ud = { user: user, data: {} };
  5249. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5250. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5251. if (Moyu.platType < 11) {
  5252. user.headIcon = self.headIcon;
  5253. user.nickName = self.nickName;
  5254. }
  5255. this.rankList.splice(i, 0, md);
  5256. break;
  5257. }
  5258. }
  5259. }
  5260. this.updateSelfItem();
  5261. this.ui.myNode.myList.numItems = this.rankList.length;
  5262. }
  5263. updateItemUI(index, obj) {
  5264. let data = this.rankList[index];
  5265. console.log('zh:updateItemui idex = ' + JSON.stringify(data));
  5266. let userData = JSON.parse(data.userData).user;
  5267. obj.nameTxt.text = userData.nickName.toString();
  5268. obj.valueTxt.text = data.rankScore;
  5269. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5270. obj.rankTxt.text = index + 1;
  5271. switch (index) {
  5272. case 0:
  5273. this.setImg(obj, 1, 0, 0);
  5274. obj.rankTxt.color = "#FFC047";
  5275. break;
  5276. case 1:
  5277. this.setImg(obj, 0, 1, 0);
  5278. obj.rankTxt.color = "#ACACAC";
  5279. break;
  5280. case 2:
  5281. this.setImg(obj, 0, 0, 1);
  5282. obj.rankTxt.color = "#D09672";
  5283. break;
  5284. default:
  5285. this.setImg(obj, 0, 0, 0);
  5286. obj.rankTxt.color = "#496FAB";
  5287. break;
  5288. }
  5289. }
  5290. setImg(obj, a, b, c) {
  5291. obj.img1.visible = a ? true : false;
  5292. obj.img2.visible = b ? true : false;
  5293. obj.img3.visible = c ? true : false;
  5294. }
  5295. changeList(type) {
  5296. this.rankType = type;
  5297. this.updateSelf();
  5298. }
  5299. changeSelfNode() {
  5300. this.showSelf = !this.showSelf;
  5301. this.updateSelf();
  5302. }
  5303. updateSelf() {
  5304. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5305. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5306. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5307. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5308. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5309. }
  5310. }
  5311. UIRanking.uiName = "UIRanking";
  5312. class ui_UISecretary extends fgui.GComponent {
  5313. static createInstance() {
  5314. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5315. }
  5316. onConstruct() {
  5317. this.n0 = (this.getChild("n0"));
  5318. this.myNode = (this.getChild("myNode"));
  5319. this.closeBtn = (this.getChild("closeBtn"));
  5320. this.t0 = this.getTransition("t0");
  5321. }
  5322. }
  5323. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5324. class UISecretary extends UIBase {
  5325. constructor() {
  5326. super();
  5327. this.curIndex = 1;
  5328. }
  5329. onConstructor() {
  5330. this.ui = ui_UISecretary.createInstance();
  5331. this.contentPane = this.ui;
  5332. this.isEject = false;
  5333. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5334. this.nodeObj = { left: null, right: null, cur: null };
  5335. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5336. }
  5337. show() {
  5338. super.show();
  5339. this.ui.t0.play();
  5340. this.updateData();
  5341. }
  5342. addSecretarySpine(node, spineName) {
  5343. if (spineName == "mishu") {
  5344. if (this.secretarySpine1) {
  5345. node.displayObject.destroyChildren();
  5346. this.playWoman(this.secretarySpine1, node.displayObject);
  5347. }
  5348. else {
  5349. let spine1 = new SpineMgr("mishu", () => {
  5350. this.secretarySpine1 = spine1;
  5351. this.playWoman(this.secretarySpine1, node.displayObject);
  5352. });
  5353. }
  5354. }
  5355. else {
  5356. if (this.secretarySpine2) {
  5357. node.displayObject.destroyChildren();
  5358. this.playWoman(this.secretarySpine2, node.displayObject);
  5359. }
  5360. else {
  5361. let spine2 = new SpineMgr("xiaomishu2", () => {
  5362. this.secretarySpine2 = spine2;
  5363. this.playWoman(this.secretarySpine2, node.displayObject);
  5364. });
  5365. }
  5366. }
  5367. }
  5368. playWoman(node, parent) {
  5369. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5370. let yy = this.ui.myNode.gameNode3.secretary.height;
  5371. let scale = 1.5;
  5372. if (node == this.secretarySpine2) {
  5373. scale = 1.2;
  5374. }
  5375. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5376. node.play(data, 0, true, parent);
  5377. }
  5378. turnLeft() {
  5379. this.curIndex--;
  5380. if (this.curIndex < 1) {
  5381. this.curIndex = 2;
  5382. }
  5383. let left = this.nodeObj.left;
  5384. let right = this.nodeObj.right;
  5385. let cur = this.nodeObj.cur;
  5386. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5387. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5388. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5389. this.updateData();
  5390. }));
  5391. this.ui.myNode.setChildIndex(right, 2);
  5392. this.nodeObj.left = cur;
  5393. this.nodeObj.right = left;
  5394. this.nodeObj.cur = right;
  5395. }
  5396. turnRight() {
  5397. this.curIndex++;
  5398. if (this.curIndex > 2) {
  5399. this.curIndex = 1;
  5400. }
  5401. let left = this.nodeObj.left;
  5402. let right = this.nodeObj.right;
  5403. let cur = this.nodeObj.cur;
  5404. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5405. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5406. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5407. this.updateData();
  5408. }));
  5409. this.ui.myNode.setChildIndex(left, 2);
  5410. this.nodeObj.left = right;
  5411. this.nodeObj.right = cur;
  5412. this.nodeObj.cur = left;
  5413. }
  5414. updateData() {
  5415. console.log('zh: updateData FFFFFFFFFF');
  5416. let data = cfgTable.secretaryshopData;
  5417. let children = this.ui.myNode._children;
  5418. let temp;
  5419. let curData;
  5420. for (let index = 0; index < children.length; index++) {
  5421. temp = children[index];
  5422. curData = data[1];
  5423. temp.heightTxt.text = curData.height;
  5424. temp.foodTxt.text = curData.food;
  5425. temp.historyTxt.text = curData.history;
  5426. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5427. this.addSecretarySpine(temp.secretary, curData.spine);
  5428. let womanIndex = curData.id - 1;
  5429. let getWoman = DataMgr.getSecretary(womanIndex);
  5430. let curUse = DataMgr.getCurSecretary();
  5431. if (getWoman) {
  5432. if (curUse == womanIndex) {
  5433. temp.purchaseBtn.c1.selectedIndex = 1;
  5434. }
  5435. else {
  5436. temp.purchaseBtn.c1.selectedIndex = 2;
  5437. }
  5438. }
  5439. else {
  5440. temp.purchaseBtn.c1.selectedIndex = 0;
  5441. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5442. }
  5443. temp.purchaseBtn.visible = false;
  5444. }
  5445. }
  5446. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5447. console.log('zh: 点击了clickSecretary ');
  5448. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5449. if (getWoman) {
  5450. if (curUse != womanIndex) {
  5451. console.log();
  5452. DataMgr.setCurSecretary(womanIndex);
  5453. this.updateData();
  5454. }
  5455. }
  5456. else {
  5457. console.log('zh:点击购买了');
  5458. let need = needDiamond;
  5459. if (DataMgr.diamondEnough(need)) {
  5460. DataMgr.setDiamond(-need);
  5461. DataMgr.setSecretary(womanIndex, 1);
  5462. DataMgr.setCurSecretary(womanIndex);
  5463. this.updateData();
  5464. }
  5465. else {
  5466. xGame.uiMgr.Show(UIAddProp, 1);
  5467. }
  5468. }
  5469. }
  5470. closeSelf() {
  5471. this.hide();
  5472. }
  5473. }
  5474. UISecretary.uiName = "UISecretary";
  5475. class ui_UIShop extends fgui.GComponent {
  5476. static createInstance() {
  5477. return (fgui.UIPackage.createObject("game", "UIShop"));
  5478. }
  5479. onConstruct() {
  5480. this.n48 = (this.getChild("n48"));
  5481. this.n0 = (this.getChild("n0"));
  5482. this.secretary = (this.getChild("secretary"));
  5483. this.talkNode = (this.getChild("talkNode"));
  5484. this.closeNode = (this.getChild("closeNode"));
  5485. this.moneyNode = (this.getChild("moneyNode"));
  5486. this.myNode = (this.getChild("myNode"));
  5487. }
  5488. }
  5489. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5490. class BallRodDisplay {
  5491. constructor(ui, index) {
  5492. this.index = 0;
  5493. this.uiIndex = 0;
  5494. this.ui = ui;
  5495. this.index = index;
  5496. this.initData();
  5497. }
  5498. initData() {
  5499. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5500. let data = cfgTable.ballrodData[this.index + 1];
  5501. this.ui.nameTxt.text = data.name;
  5502. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5503. this.ui.levelNode.c1.selectedIndex = data.quality;
  5504. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5505. if (data.spine) {
  5506. this.mySpine = new SpineMgr(data.spine, () => {
  5507. let xx = 150;
  5508. let yy = 70;
  5509. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5510. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5511. });
  5512. }
  5513. }
  5514. updateSelf() {
  5515. console.log('zh:updateSelf -------------- ');
  5516. let get = DataMgr.getBallRod(this.index);
  5517. if (get == null)
  5518. get = 1;
  5519. let curUse = DataMgr.getCurBallRod();
  5520. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5521. if (get) {
  5522. if (curUse == this.index) {
  5523. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5524. }
  5525. else {
  5526. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5527. }
  5528. }
  5529. else {
  5530. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5531. }
  5532. }
  5533. buyBallRod() {
  5534. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5535. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5536. switch (selectedIndex) {
  5537. case 0:
  5538. break;
  5539. case 1:
  5540. console.log('zh:点击了 USE THIS');
  5541. DataMgr.setCurBallRod(this.index);
  5542. DataMgr.setDiamond(99999);
  5543. let curUse = DataMgr.getCurBallRod();
  5544. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5545. let ui = xGame.uiMgr.getUI(UIShop);
  5546. ui.updateBallRod();
  5547. break;
  5548. case 2:
  5549. let data = cfgTable.ballrodData[this.index + 1];
  5550. let need = data.price;
  5551. if (DataMgr.diamondEnough(need)) {
  5552. DataMgr.setDiamond(-need);
  5553. DataMgr.setBallRod(this.index, 1);
  5554. DataMgr.setCurBallRod(this.index);
  5555. let ui = xGame.uiMgr.getUI(UIShop);
  5556. ui.updateBallRod();
  5557. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5558. }
  5559. else {
  5560. xGame.uiMgr.Show(UIAddProp, 1);
  5561. }
  5562. break;
  5563. default:
  5564. break;
  5565. }
  5566. }
  5567. logEventForGouMaiGan(qiuGanName) {
  5568. const ev = {
  5569. value: qiuGanName
  5570. };
  5571. const jsonStr = JSON.stringify(ev);
  5572. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5573. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5574. }
  5575. }
  5576. class UIShop extends UIBase {
  5577. constructor() {
  5578. super();
  5579. this.itemNums = 0;
  5580. }
  5581. onConstructor() {
  5582. this.ui = ui_UIShop.createInstance();
  5583. this.contentPane = this.ui;
  5584. this.isEject = false;
  5585. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5586. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5587. this.addUIClick(this.ui, this.interuptSecretary);
  5588. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5589. this.ballRodArr = [];
  5590. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5591. this.ui.myNode.myList.numItems = this.itemNums;
  5592. if (Moyu.isKs)
  5593. this.ui.closeNode.closeBtn.x += 100;
  5594. }
  5595. show() {
  5596. super.show();
  5597. this.playSecretaryIdle();
  5598. this.updateBallRod();
  5599. }
  5600. updateBallRod() {
  5601. for (let index = 0; index < this.ballRodArr.length; index++) {
  5602. this.ballRodArr[index].updateSelf();
  5603. }
  5604. }
  5605. renderBallRod(sort, obj) {
  5606. let index = this.getIndexBySort(sort + 1) - 1;
  5607. let ballRod = new BallRodDisplay(obj, index);
  5608. this.ballRodArr.push(ballRod);
  5609. }
  5610. getIndexBySort(sort) {
  5611. let object = cfgTable.ballrodData;
  5612. for (const key in object) {
  5613. if (object[key].sort == sort) {
  5614. return parseInt(key);
  5615. }
  5616. }
  5617. }
  5618. playSecretaryIdle() {
  5619. let parent = this.ui.secretary.displayObject;
  5620. parent.destroyChildren();
  5621. let xx = this.ui.secretary.width / 2;
  5622. let yy = this.ui.secretary.height;
  5623. let scale = xGame.common.getSecretaryScale();
  5624. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5625. xGame.common.secretary.play(data, 0, true, parent);
  5626. }
  5627. interuptSecretary() {
  5628. Laya.timer.clearAll(this);
  5629. this.playSecretaryRandomSound();
  5630. }
  5631. playSecretaryRandomSound() {
  5632. if (this.isHide)
  5633. return;
  5634. let time = xGame.common.randomNum(45000, 60000);
  5635. Laya.timer.once(time, this, () => {
  5636. if (this.isHide)
  5637. return;
  5638. let index = xGame.common.randomNum(4, 7);
  5639. xGame.soundMgr.playSound("s_main0" + index);
  5640. let words = 1;
  5641. switch (index) {
  5642. case 4:
  5643. words = 5;
  5644. break;
  5645. case 5:
  5646. words = 3;
  5647. break;
  5648. case 6:
  5649. words = 6;
  5650. break;
  5651. case 7:
  5652. words = 7;
  5653. break;
  5654. default:
  5655. break;
  5656. }
  5657. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5658. this.playSecretaryRandomSound();
  5659. });
  5660. }
  5661. closeSelf() {
  5662. this.hide();
  5663. }
  5664. }
  5665. UIShop.uiName = "UIShop";
  5666. class ui_UISign extends fgui.GComponent {
  5667. static createInstance() {
  5668. return (fgui.UIPackage.createObject("game", "UISign"));
  5669. }
  5670. onConstruct() {
  5671. this.n6 = (this.getChild("n6"));
  5672. this.closeNode = (this.getChild("closeNode"));
  5673. this.myNode = (this.getChild("myNode"));
  5674. this.moneyNode = (this.getChild("moneyNode"));
  5675. this.secretary = (this.getChild("secretary"));
  5676. this.talkNode = (this.getChild("talkNode"));
  5677. this.tripleBtn = (this.getChild("tripleBtn"));
  5678. this.normalBtn = (this.getChild("normalBtn"));
  5679. this.tipsNode = (this.getChild("tipsNode"));
  5680. this.againBtn = (this.getChild("againBtn"));
  5681. this.t0 = this.getTransition("t0");
  5682. }
  5683. }
  5684. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5685. class SignMax {
  5686. constructor(ui) {
  5687. this.ui = ui;
  5688. }
  5689. updateSelf(index, sameDay, curDayIndex) {
  5690. let data = cfgTable.signData[index + 1];
  5691. this.ui.titleTxt.text = data.title;
  5692. let arr1 = data.award[0].split('-');
  5693. let arr2 = data.award[1].split('-');
  5694. let num1 = parseInt(arr1[1]);
  5695. let num2 = parseInt(arr2[1]);
  5696. this.ui.numTxt1.text = num1 + "";
  5697. this.ui.numTxt2.text = num2 + "";
  5698. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5699. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5700. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5701. this.ui.numTxt1.visible = false;
  5702. }
  5703. else {
  5704. this.ui.numTxt1.visible = true;
  5705. }
  5706. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5707. this.ui.numTxt2.visible = false;
  5708. }
  5709. else {
  5710. this.ui.numTxt2.visible = true;
  5711. }
  5712. if (index < curDayIndex) {
  5713. this.ui.c1.selectedIndex = 1;
  5714. }
  5715. else if (index == curDayIndex) {
  5716. if (sameDay) {
  5717. this.ui.c1.selectedIndex = 2;
  5718. }
  5719. else {
  5720. this.ui.c1.selectedIndex = 2;
  5721. }
  5722. }
  5723. else {
  5724. this.ui.c1.selectedIndex = 0;
  5725. }
  5726. }
  5727. }
  5728. class SignNormal {
  5729. constructor(ui) {
  5730. this.ui = ui;
  5731. }
  5732. updateSelf(index, sameDay, curDayIndex) {
  5733. let data = cfgTable.signData[index + 1];
  5734. this.ui.titleTxt.text = data.title;
  5735. let arr = data.award[0].split('-');
  5736. let type = parseInt(arr[0]);
  5737. let num = parseInt(arr[1]);
  5738. this.ui.numTxt.text = num + "";
  5739. if (type > 2) {
  5740. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5741. this.ui.myIcon.rotation = 0;
  5742. }
  5743. else {
  5744. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5745. this.ui.myIcon.rotation = 0;
  5746. }
  5747. if (xGame.common.signAwardContainsRod(data.award)) {
  5748. this.ui.numTxt.visible = false;
  5749. }
  5750. else {
  5751. this.ui.numTxt.visible = true;
  5752. }
  5753. if (index < curDayIndex) {
  5754. this.ui.c1.selectedIndex = 1;
  5755. }
  5756. else if (index == curDayIndex) {
  5757. if (sameDay) {
  5758. this.ui.c1.selectedIndex = 2;
  5759. }
  5760. else {
  5761. this.ui.c1.selectedIndex = 2;
  5762. }
  5763. }
  5764. else {
  5765. this.ui.c1.selectedIndex = 0;
  5766. }
  5767. }
  5768. }
  5769. class UISign extends UIBase {
  5770. constructor() {
  5771. super();
  5772. this.curDayIndex = 0;
  5773. this.starX = 0;
  5774. }
  5775. onConstructor() {
  5776. this.ui = ui_UISign.createInstance();
  5777. this.contentPane = this.ui;
  5778. this.isEject = false;
  5779. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5780. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5781. this.initSignItem();
  5782. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5783. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5784. }
  5785. show() {
  5786. super.show();
  5787. this.ui.t0.play();
  5788. this.playSecretaryIdle();
  5789. this.updateSign();
  5790. }
  5791. initSignItem() {
  5792. this.signArr = [];
  5793. for (let index = 0; index < 6; index++) {
  5794. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5795. this.signArr.push(temp);
  5796. }
  5797. this.signMax = new SignMax(this.ui.myNode.day7);
  5798. if (Moyu.isKs)
  5799. this.ui.closeNode.closeBtn.x += 100;
  5800. }
  5801. updateSign() {
  5802. let sameDay = xGame.common.judgeSameDay();
  5803. let max = 7;
  5804. this.curDayIndex = DataMgr.getSignData();
  5805. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5806. this.curDayIndex = 0;
  5807. if (!sameDay) {
  5808. this.ui.normalBtn.visible = true;
  5809. this.ui.tipsNode.visible = false;
  5810. this.ui.againBtn.visible = false;
  5811. }
  5812. else {
  5813. this.ui.normalBtn.visible = false;
  5814. let again = DataMgr.getExtraSign();
  5815. let isCurrency = false;
  5816. let index = this.curDayIndex;
  5817. if (index == 0)
  5818. index = 7;
  5819. let award = cfgTable.signData[index].award;
  5820. let num = award[0].split("-")[0];
  5821. if (num == "1" || num == "2")
  5822. isCurrency = true;
  5823. let showAgain = again == 0 && isCurrency;
  5824. this.ui.againBtn.visible = showAgain;
  5825. this.ui.tipsNode.visible = !showAgain;
  5826. }
  5827. for (let index = 0; index < this.signArr.length; index++) {
  5828. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5829. }
  5830. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5831. }
  5832. playSecretaryIdle() {
  5833. let parent = this.ui.secretary.displayObject;
  5834. parent.destroyChildren();
  5835. let xx = this.ui.secretary.width / 2;
  5836. let yy = this.ui.secretary.height;
  5837. let scale = xGame.common.getSecretaryScale();
  5838. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5839. xGame.common.secretary.play(data, 0, true, parent);
  5840. }
  5841. closeSelf() {
  5842. this.hide();
  5843. }
  5844. normalGetAward() {
  5845. let sameDay = xGame.common.judgeSameDay();
  5846. if (!sameDay) {
  5847. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5848. let temp;
  5849. let type;
  5850. let num;
  5851. let arr = [];
  5852. for (let index = 0; index < award.length; index++) {
  5853. temp = award[index].split("-");
  5854. type = parseInt(temp[0]);
  5855. num = parseInt(temp[1]);
  5856. let awardType = new AwardType();
  5857. awardType.num = num;
  5858. awardType.type = type;
  5859. arr.push(awardType);
  5860. }
  5861. xGame.common.getAward(arr, (watchVideo) => {
  5862. this.curDayIndex++;
  5863. if (this.curDayIndex > 7)
  5864. this.curDayIndex = 0;
  5865. DataMgr.setSignData(this.curDayIndex);
  5866. DataMgr.setSignTime(new Date().getTime());
  5867. if (watchVideo) {
  5868. DataMgr.setExtraSign(1);
  5869. Moyu.sendDataEvent("signIn1");
  5870. }
  5871. this.updateSign();
  5872. });
  5873. }
  5874. }
  5875. againGetAward() {
  5876. Moyu.sendDataEvent("signIn2");
  5877. console.log('zh:qjff_AD_for_uisign');
  5878. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  5879. }
  5880. else {
  5881. console.log('zh:AD 失败,直接发放奖励');
  5882. this.qjff_AD_for_uisign();
  5883. }
  5884. }
  5885. qjff_AD_for_uisign() {
  5886. let index = this.curDayIndex;
  5887. if (index == 0)
  5888. index = 7;
  5889. let award = cfgTable.signData[index].award;
  5890. let temp;
  5891. let type;
  5892. let num;
  5893. for (let index = 0; index < award.length; index++) {
  5894. temp = award[index].split("-");
  5895. type = parseInt(temp[0]);
  5896. num = parseInt(temp[1]) * 3;
  5897. xGame.common.playObjFlyAnim(num, type);
  5898. }
  5899. DataMgr.setExtraSign(1);
  5900. this.updateSign();
  5901. }
  5902. }
  5903. UISign.uiName = "UISign";
  5904. class ui_UISkill extends fgui.GComponent {
  5905. static createInstance() {
  5906. return (fgui.UIPackage.createObject("game", "UISkill"));
  5907. }
  5908. onConstruct() {
  5909. this.n48 = (this.getChild("n48"));
  5910. this.n0 = (this.getChild("n0"));
  5911. this.secretary = (this.getChild("secretary"));
  5912. this.talkNode = (this.getChild("talkNode"));
  5913. this.closeNode = (this.getChild("closeNode"));
  5914. this.moneyNode = (this.getChild("moneyNode"));
  5915. this.skillNode = (this.getChild("skillNode"));
  5916. this.guideNode = (this.getChild("guideNode"));
  5917. }
  5918. }
  5919. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5920. class SkillDisplay {
  5921. constructor(ui, data, uiIndex) {
  5922. this.starX = 0;
  5923. this.starY = 0;
  5924. this.index = 0;
  5925. this.ui = ui;
  5926. this.data = data;
  5927. this.index = uiIndex;
  5928. this.initSelf();
  5929. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5930. }
  5931. initSelf() {
  5932. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5933. this.ui.nameTxt.text = this.data.name;
  5934. this.ui.describeTxt.text = this.data.describe;
  5935. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5936. this.ui.startBtn.onClick(this, this.startGame);
  5937. this.updateSelf();
  5938. }
  5939. updateSelf() {
  5940. this.checkTry();
  5941. let level = DataMgr.getBigSkillByIndex(this.index);
  5942. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5943. }
  5944. checkTry() {
  5945. let index = this.index;
  5946. let level = DataMgr.getBigSkillByIndex(index);
  5947. if (level == null) {
  5948. DataMgr.setBigSkill(index, 1, false);
  5949. level = 1;
  5950. }
  5951. this.ui.levelTxt.text = "LV." + level;
  5952. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5953. this.ui.tryNode.visible = true;
  5954. else
  5955. this.ui.tryNode.visible = false;
  5956. }
  5957. clickAddLevel() {
  5958. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5959. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5960. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  5961. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  5962. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5963. }
  5964. else {
  5965. console.log('zh:AD 失败,直接发放奖励');
  5966. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5967. }
  5968. }
  5969. qjff_AD_for_skilldisplay_clickAddLevel() {
  5970. DataMgr.setBigSkill(this.data.index, 1);
  5971. this.updateSelf();
  5972. xGame.common.upSkillLevel = true;
  5973. }
  5974. startGame() {
  5975. if (this.data.index == 3) {
  5976. alert('Coming soon!');
  5977. return;
  5978. }
  5979. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5980. let needCoin = xGame.common.bigMoveNeedCoin;
  5981. xGame.common.passAwardCoin = 2000;
  5982. let guide = DataMgr.getSkillGuide();
  5983. console.log('zh:startGame guide=' + guide);
  5984. xGame.common.temSelfLevel = 0;
  5985. if (guide == 0) {
  5986. needCoin = 0;
  5987. xGame.common.temSelfLevel = 100;
  5988. }
  5989. if (DataMgr.coinEnough(needCoin)) {
  5990. DataMgr.setCoin(-needCoin);
  5991. xGame.common.curPlayerSkillType = this.index;
  5992. if (guide == 0)
  5993. xGame.common.curPlayerSkillType = 0;
  5994. xGame.uiMgr.Show(UIGame);
  5995. xGame.uiMgr.Hide(UIMain);
  5996. xGame.uiMgr.Show(UIMatching, () => {
  5997. xGame.common.gameUI.ui.alpha = 1;
  5998. xGame.common.gameUI.startGame();
  5999. xGame.uiMgr.Hide(UISkill);
  6000. });
  6001. }
  6002. else {
  6003. xGame.uiMgr.Show(UIAddProp, 0);
  6004. Moyu.sendDataEvent("AddCoinVideo");
  6005. }
  6006. }
  6007. }
  6008. class UISkill extends UIBase {
  6009. constructor() {
  6010. super();
  6011. this.skillData = [];
  6012. }
  6013. onConstructor() {
  6014. this.ui = ui_UISkill.createInstance();
  6015. this.contentPane = this.ui;
  6016. this.isEject = false;
  6017. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6018. this.initSkillData();
  6019. console.log('zh:aaaaaa1111111111');
  6020. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6021. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6022. console.log('zh:aaaaaa22222222');
  6023. this.displayList = [];
  6024. this.ui.skillNode.skillList.numItems = 3;
  6025. this.addUIClick(this.ui, this.interuptSecretary);
  6026. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6027. this.ui.talkNode.visible = false;
  6028. if (Moyu.isKs)
  6029. this.ui.closeNode.closeBtn.x += 100;
  6030. }
  6031. show() {
  6032. super.show();
  6033. this.playSecretaryIdle();
  6034. this.moneyNode.ui.c1.selectedIndex = 1;
  6035. Laya.timer.clearAll(this);
  6036. xGame.soundMgr.playSound("s_start");
  6037. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6038. let guide = DataMgr.getSkillGuide();
  6039. this.ui.guideNode.visible = guide == 0;
  6040. let item = this.getSkillItemByUIIndex(0);
  6041. if (guide == 0) {
  6042. item.ui.c1.selectedIndex = 1;
  6043. }
  6044. else {
  6045. item.ui.c1.selectedIndex = 0;
  6046. }
  6047. this.ui.guideNode.guideBtn.visible = guide == 0;
  6048. for (let index = 0; index < this.displayList.length; index++) {
  6049. this.displayList[index].checkTry();
  6050. }
  6051. }
  6052. getSkillItemByUIIndex(cur) {
  6053. for (let index = 0; index < this.displayList.length; index++) {
  6054. if (this.displayList[index].index == cur) {
  6055. return this.displayList[index];
  6056. }
  6057. }
  6058. }
  6059. enterGuideLevel() {
  6060. let item = this.getSkillItemByUIIndex(0);
  6061. item.startGame();
  6062. if (DataMgr.getNewUser())
  6063. Moyu.sendDataEvent("gameStart1");
  6064. }
  6065. initSkillData() {
  6066. this.skillData = [];
  6067. let nameList = xGame.common.skillNameList;
  6068. let iconList = xGame.common.skillIconList;
  6069. let describeList = [
  6070. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6071. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
  6072. "The power of frost descends—freezing the flow and taking full control of the game!"
  6073. ];
  6074. console.log('zh:initSkillData 111111111');
  6075. let data;
  6076. for (let index = 0; index < nameList.length; index++) {
  6077. data = {};
  6078. data.name = nameList[index];
  6079. data.icon = iconList[index];
  6080. data.describe = describeList[index];
  6081. data.index = index;
  6082. this.skillData.push(data);
  6083. }
  6084. }
  6085. updateSkillItem(index, target) {
  6086. if (this.displayList[index] == null) {
  6087. let uiIndex;
  6088. switch (index) {
  6089. case 0:
  6090. uiIndex = 1;
  6091. break;
  6092. case 1:
  6093. uiIndex = 0;
  6094. break;
  6095. case 2:
  6096. uiIndex = 2;
  6097. break;
  6098. case 3:
  6099. uiIndex = 3;
  6100. break;
  6101. default:
  6102. break;
  6103. }
  6104. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6105. this.displayList.push(temp);
  6106. }
  6107. }
  6108. playSecretaryIdle() {
  6109. let parent = this.ui.secretary.displayObject;
  6110. parent.destroyChildren();
  6111. let xx = this.ui.secretary.width / 2;
  6112. let yy = this.ui.secretary.height;
  6113. let scale = xGame.common.getSecretaryScale();
  6114. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6115. xGame.common.secretary.play(data, 0, true, parent);
  6116. }
  6117. returnUIMain() {
  6118. this.hide();
  6119. xGame.common.stopGirlPop(this.ui.talkNode);
  6120. xGame.uiMgr.Show(UIMain);
  6121. }
  6122. interuptSecretary() {
  6123. Laya.timer.clearAll(this);
  6124. this.playSecretaryRandomSound();
  6125. }
  6126. playSecretaryRandomSound() {
  6127. if (this.isHide)
  6128. return;
  6129. let time = xGame.common.randomNum(45000, 60000);
  6130. Laya.timer.once(time, this, () => {
  6131. if (this.isHide)
  6132. return;
  6133. let index = xGame.common.randomNum(4, 7);
  6134. xGame.soundMgr.playSound("s_main0" + index);
  6135. let words = 1;
  6136. switch (index) {
  6137. case 4:
  6138. words = 5;
  6139. break;
  6140. case 5:
  6141. words = 3;
  6142. break;
  6143. case 6:
  6144. words = 6;
  6145. break;
  6146. case 7:
  6147. words = 7;
  6148. break;
  6149. default:
  6150. break;
  6151. }
  6152. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6153. this.playSecretaryRandomSound();
  6154. });
  6155. }
  6156. }
  6157. UISkill.uiName = "UISkill";
  6158. class ui_UIMsg extends fgui.GComponent {
  6159. static createInstance() {
  6160. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6161. }
  6162. onConstruct() {
  6163. this.tipsNode = (this.getChild("tipsNode"));
  6164. }
  6165. }
  6166. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6167. class UIMsg extends UIBase {
  6168. constructor() {
  6169. super();
  6170. }
  6171. onConstructor() {
  6172. this.ui = ui_UIMsg.createInstance();
  6173. this.contentPane = this.ui;
  6174. this.isEject = false;
  6175. this.isMuti = true;
  6176. }
  6177. show(msg, callback) {
  6178. super.show();
  6179. this.ui.tipsNode.msgTxt.text = msg;
  6180. this.ui.alpha = 1;
  6181. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6182. this.hide();
  6183. callback && callback();
  6184. }), 1000);
  6185. }
  6186. }
  6187. UIMsg.uiName = "UIMsg";
  6188. class ui_UIModeSelection extends fgui.GComponent {
  6189. static createInstance() {
  6190. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6191. }
  6192. onConstruct() {
  6193. this.n19 = (this.getChild("n19"));
  6194. this.closeBtn = (this.getChild("closeBtn"));
  6195. this.myNode = (this.getChild("myNode"));
  6196. this.t0 = this.getTransition("t0");
  6197. }
  6198. }
  6199. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6200. class UIModeSelection extends UIBase {
  6201. constructor() {
  6202. super();
  6203. }
  6204. onConstructor() {
  6205. this.ui = ui_UIModeSelection.createInstance();
  6206. this.contentPane = this.ui;
  6207. this.isEject = false;
  6208. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6209. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6210. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6211. this.addUIClick(this.ui.closeBtn, this.hide);
  6212. this.peopleArr = [650, 6900, 3800];
  6213. this.peopleOffest = [50, 500, 200];
  6214. this.updateSelf();
  6215. }
  6216. show(callback) {
  6217. super.show();
  6218. this.ui.t0.play();
  6219. this.callback = callback;
  6220. }
  6221. updateSelf() {
  6222. let cfg = cfgTable.modeselectData;
  6223. for (let index = 1; index <= 3; index++) {
  6224. let node = this.ui.myNode["type" + index];
  6225. node.need.text = cfg[index].need;
  6226. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6227. node.peopleTxt.text = this.getRandPeople(index - 1);
  6228. }
  6229. }
  6230. enterGame(type) {
  6231. console.log('zh: 进入经典模式 type: ' + type);
  6232. xGame.common.classicRoomType = type;
  6233. let cfg = cfgTable.modeselectData[type];
  6234. let need = cfg.need;
  6235. xGame.common.passAwardCoin = cfg.award;
  6236. if (DataMgr.coinEnough(need)) {
  6237. DataMgr.setCoin(-need);
  6238. this.ui.myNode["type" + type].t0.play();
  6239. Laya.timer.once(200, this, () => {
  6240. this.callback && this.callback();
  6241. });
  6242. }
  6243. else {
  6244. Moyu.sendDataEvent("AddCoinVideo");
  6245. xGame.uiMgr.Show(UIAddProp, 0);
  6246. }
  6247. }
  6248. getRandPeople(index) {
  6249. let rand = this.peopleOffest[index];
  6250. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6251. }
  6252. }
  6253. UIModeSelection.uiName = "UIModeSelection";
  6254. class ui_UIGetAward extends fgui.GComponent {
  6255. static createInstance() {
  6256. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6257. }
  6258. onConstruct() {
  6259. this.n4 = (this.getChild("n4"));
  6260. this.n0 = (this.getChild("n0"));
  6261. this.myList = (this.getChild("myList"));
  6262. this.n1 = (this.getChild("n1"));
  6263. this.eftNode = (this.getChild("eftNode"));
  6264. this.btnNode = (this.getChild("btnNode"));
  6265. this.t0 = this.getTransition("t0");
  6266. }
  6267. }
  6268. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6269. class UIGetAward extends UIBase {
  6270. constructor() {
  6271. super();
  6272. this.showTriple = true;
  6273. }
  6274. onConstructor() {
  6275. this.ui = ui_UIGetAward.createInstance();
  6276. this.contentPane = this.ui;
  6277. this.isEject = false;
  6278. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6279. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6280. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6281. }
  6282. show(arr, showTriple, callback) {
  6283. super.show();
  6284. this.ui.t0.play();
  6285. this.ui.eftNode.visible = true;
  6286. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6287. this.ui.eftNode.visible = false;
  6288. }), 1, 0, 0, 0.9);
  6289. this.awardArr = arr;
  6290. this.showTriple = showTriple;
  6291. this.callback = callback;
  6292. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6293. this.ui.myList.numItems = arr.length;
  6294. xGame.soundMgr.playSound("getaward");
  6295. }
  6296. updateSelf(index, obj) {
  6297. let temp = this.awardArr[index];
  6298. let icon = this.getIcon(temp.type);
  6299. let str = icon;
  6300. if (temp.type > 2) {
  6301. str = "s" + icon;
  6302. }
  6303. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6304. obj.myIcon.rotation = 0;
  6305. obj.numTxt.text = temp.num + "";
  6306. obj.numTxt.visible = temp.type > 2 ? false : true;
  6307. obj.nameTxt.text = this.getNameStr(temp.type);
  6308. }
  6309. renderItem(index, obj) {
  6310. this.updateSelf(index, obj);
  6311. }
  6312. tripleGetAward() {
  6313. console.log('zh:qjff_AD_for_uigetAward');
  6314. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6315. }
  6316. else {
  6317. console.log('zh:AD 失败,直接发放奖励');
  6318. this.qjff_AD_for_uigetAward();
  6319. }
  6320. }
  6321. qjff_AD_for_uigetAward() {
  6322. this.getAward(3);
  6323. }
  6324. normalGetAward() {
  6325. if (PlatMgr.isMisVideo())
  6326. this.tripleGetAward();
  6327. else
  6328. this.getAward();
  6329. }
  6330. getAward(times = 1) {
  6331. this.hide();
  6332. for (let index = 0; index < this.awardArr.length; index++) {
  6333. this.awardArr[index].num *= times;
  6334. }
  6335. this.callback && this.callback(times != 1);
  6336. }
  6337. getIcon(type) {
  6338. switch (type) {
  6339. case Prop.diamond:
  6340. return "ty_zs";
  6341. case Prop.coin:
  6342. return "ty_jb";
  6343. case Prop.gan1:
  6344. return "qg1";
  6345. case Prop.gan2:
  6346. return "qg2";
  6347. case Prop.gan3:
  6348. return "qg3";
  6349. case Prop.gan4:
  6350. return "qg4";
  6351. default:
  6352. break;
  6353. }
  6354. }
  6355. getNameStr(type) {
  6356. switch (type) {
  6357. case Prop.diamond:
  6358. return "Diamond";
  6359. case Prop.coin:
  6360. return "Coins";
  6361. case Prop.gan1:
  6362. case Prop.gan2:
  6363. case Prop.gan3:
  6364. case Prop.gan4:
  6365. return cfgTable.ballrodData[type - 1].name;
  6366. default:
  6367. break;
  6368. }
  6369. }
  6370. }
  6371. UIGetAward.uiName = "UIGetAward";
  6372. class ui_UIRepentProp extends fgui.GComponent {
  6373. static createInstance() {
  6374. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6375. }
  6376. onConstruct() {
  6377. this.c1 = this.getController("c1");
  6378. this.n11 = (this.getChild("n11"));
  6379. this.regretNode = (this.getChild("regretNode"));
  6380. this.helpLineNode = (this.getChild("helpLineNode"));
  6381. this.t0 = this.getTransition("t0");
  6382. }
  6383. }
  6384. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6385. class UIRepentProp extends UIBase {
  6386. constructor() {
  6387. super();
  6388. this.viewType = 0;
  6389. this.regretType = 0;
  6390. }
  6391. onConstructor() {
  6392. this.ui = ui_UIRepentProp.createInstance();
  6393. this.contentPane = this.ui;
  6394. this.isEject = false;
  6395. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6396. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6397. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6398. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6399. }
  6400. show(viewType, regretType, callback) {
  6401. PlatMgr.showInsert(true);
  6402. this.viewType = viewType;
  6403. this.regretType = regretType;
  6404. this.callback = callback;
  6405. super.show();
  6406. this.ui.t0.play();
  6407. this.ui.c1.selectedIndex = this.viewType;
  6408. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6409. if (this.viewType == 0) {
  6410. let guide = DataMgr.getGuideHelpLine();
  6411. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6412. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6413. }
  6414. xGame.common.gameMgr.gamePause = true;
  6415. }
  6416. hideSelf() {
  6417. xGame.common.gameMgr.gamePause = false;
  6418. this.callback && this.callback(false);
  6419. this.hide();
  6420. }
  6421. videoRegret() {
  6422. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6423. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6424. }
  6425. else {
  6426. console.log('zh:AD 失败,直接发放奖励');
  6427. this.qjff_AD_for_UIrepentProp_videoRegret();
  6428. }
  6429. }
  6430. qjff_AD_for_UIrepentProp_videoRegret() {
  6431. this.callback && this.callback(true);
  6432. this.hideSelf();
  6433. }
  6434. videoAddHelpLine() {
  6435. let guide = DataMgr.getGuideHelpLine();
  6436. if (guide == 0) {
  6437. this.callback && this.callback(true);
  6438. this.hideSelf();
  6439. DataMgr.setGuideHelpLine();
  6440. xGame.common.gameUI.ui.guideNode.visible = false;
  6441. }
  6442. else {
  6443. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6444. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6445. }
  6446. else {
  6447. console.log('zh:AD 失败,直接发放奖励');
  6448. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6449. }
  6450. }
  6451. }
  6452. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6453. this.callback && this.callback(true);
  6454. this.hideSelf();
  6455. }
  6456. }
  6457. UIRepentProp.uiName = "UIRepentProp";
  6458. class UIMain extends UIBase {
  6459. constructor() {
  6460. super();
  6461. this.firstEnter = true;
  6462. }
  6463. nativeCallJs(msg) {
  6464. let t = msg;
  6465. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6466. switch (t) {
  6467. case 'qjff_chouJiang':
  6468. let dui = xGame.uiMgr.getUI(UIDraw);
  6469. dui.qjff_chouJiang();
  6470. break;
  6471. case 'qjff_AD_for_uisign':
  6472. let dui2 = xGame.uiMgr.getUI(UISign);
  6473. dui2.qjff_AD_for_uisign();
  6474. break;
  6475. case 'qjff_AD_for_uitry':
  6476. let dui3 = xGame.uiMgr.getUI(UITry);
  6477. dui3.qjff_AD_for_uitry();
  6478. break;
  6479. case 'qjff_AD_for_uipower':
  6480. let dui4 = xGame.uiMgr.getUI(UIPower);
  6481. dui4.qjff_AD_for_uipower();
  6482. break;
  6483. case 'qjff_AD_for_uigetAward':
  6484. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6485. dui5.qjff_AD_for_uigetAward();
  6486. break;
  6487. case 'qjff_AD_for_uiGameEnd':
  6488. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6489. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6490. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6491. break;
  6492. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6493. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6494. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6495. break;
  6496. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6497. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6498. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6499. break;
  6500. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6501. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6502. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6503. break;
  6504. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6505. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6506. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6507. break;
  6508. case 'qjff_AD_for_UIBOX_onOpenBox':
  6509. let dui11 = xGame.uiMgr.getUI(UIBox);
  6510. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6511. break;
  6512. case 'qjff_AD_for_UIAddCoin':
  6513. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6514. dui12.qjff_AD_for_UIAddCoin();
  6515. break;
  6516. case '111a':
  6517. let dui14 = xGame.uiMgr.getUI(UISign);
  6518. dui14.qjff_AD_for_uisign();
  6519. break;
  6520. case '222a':
  6521. let dui15 = xGame.uiMgr.getUI(UISign);
  6522. dui15.qjff_AD_for_uisign();
  6523. break;
  6524. case '333a':
  6525. let dui16 = xGame.uiMgr.getUI(UISign);
  6526. dui16.qjff_AD_for_uisign();
  6527. break;
  6528. default:
  6529. console.log('zh:未知的方法名字' + t);
  6530. break;
  6531. }
  6532. }
  6533. onConstructor() {
  6534. console.log('zh: UIMain onConstructor');
  6535. this.ui = ui_UIMain.createInstance();
  6536. this.contentPane = this.ui;
  6537. this.isEject = false;
  6538. this.addEvent();
  6539. this.addClickSpine();
  6540. this.settingNode = new SettingNode(this.ui.settingNode);
  6541. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6542. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6543. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6544. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6545. let curUse = DataMgr.getCurSecretary();
  6546. this.changeSecretary(curUse);
  6547. this.ui.talkNode.visible = false;
  6548. let guide = DataMgr.getSkillGuide();
  6549. if (xGame.common.isNewDay && guide == 1) {
  6550. xGame.common.isNewDay = false;
  6551. xGame.soundMgr.playSound("s_main01");
  6552. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6553. console.log("zh:播放小秘书每天语音");
  6554. }
  6555. this.ui.n83.visible = false;
  6556. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6557. }
  6558. changeSecretary(curUse) {
  6559. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6560. xGame.common.secretary && xGame.common.secretary.dispose();
  6561. this.addSecretarySpine(name);
  6562. }
  6563. addSecretarySpine(name) {
  6564. let spine = new SpineMgr(name, () => {
  6565. this.playSecretaryIdle();
  6566. });
  6567. xGame.common.secretary = spine;
  6568. }
  6569. addClickSpine() {
  6570. let clickSpine = new SpineMgr("dianji", () => {
  6571. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6572. let parent = Laya.stage;
  6573. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6574. clickSpine.play(data, 0, false, parent, (spine) => {
  6575. spine.destroy(true);
  6576. });
  6577. });
  6578. });
  6579. }
  6580. addEvent() {
  6581. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6582. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6583. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6584. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6585. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6586. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6587. this.addUIClick(this.ui, this.interuptSecretary);
  6588. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6589. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6590. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6591. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6592. this.addUIClick(this.ui.signBtn, this.openSignView);
  6593. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6594. this.addUIClick(this.ui.rankBtn, this.openRanking);
  6595. }
  6596. show(showFailWords) {
  6597. super.show();
  6598. this.moneyNode.ui.c1.selectedIndex = 1;
  6599. this.playSecretaryIdle();
  6600. xGame.soundMgr.playMusic("caromhall01", 0);
  6601. Laya.timer.clearAll(this);
  6602. this.playSecretaryRandomSound();
  6603. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  6604. if (showFailWords) {
  6605. console.log('zh:uimain.ts ');
  6606. setTimeout(() => {
  6607. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6608. let words = -1;
  6609. if (str == "s_main02") {
  6610. words = 2;
  6611. }
  6612. else {
  6613. words = 3;
  6614. }
  6615. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6616. xGame.soundMgr.playSound(str);
  6617. }, 300);
  6618. }
  6619. this.showGuide();
  6620. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6621. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6622. let guide = DataMgr.getSkillGuide();
  6623. if (guide == 1) {
  6624. let randTime = xGame.common.randomNum(300, 800);
  6625. if (this.firstEnter) {
  6626. console.log("zh: firstEnter");
  6627. this.firstEnter = false;
  6628. randTime += 900;
  6629. }
  6630. else {
  6631. console.log("zh: no firstEnter");
  6632. }
  6633. Laya.timer.once(randTime, this, () => {
  6634. xGame.common.autoPopUIView();
  6635. });
  6636. }
  6637. }
  6638. checkActive(show) {
  6639. }
  6640. showGuide() {
  6641. let guide = DataMgr.getSkillGuide();
  6642. this.ui.guideBtn.visible = guide == 0;
  6643. this.ui.enterGuide.visible = false;
  6644. this.ui.secretaryGuide.visible = guide == 0;
  6645. if (guide == 0) {
  6646. console.log("zh:显示引导");
  6647. xGame.soundMgr.playSound("s_guide");
  6648. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6649. }
  6650. else {
  6651. console.log("zh:不需要显示引导");
  6652. }
  6653. }
  6654. ensureSecretary() {
  6655. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6656. this.ui.secretaryGuide.visible = false;
  6657. this.ui.enterGuide.visible = true;
  6658. this.ui.wordsNode.t0.play();
  6659. if (DataMgr.getNewUser())
  6660. Moyu.sendDataEvent("gameReady");
  6661. }
  6662. playSecretaryIdle() {
  6663. let parent = this.ui.secretary.displayObject;
  6664. parent.destroyChildren();
  6665. let xx = this.ui.secretary.width / 2;
  6666. let yy = this.ui.secretary.height;
  6667. let scale = xGame.common.getSecretaryScale();
  6668. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6669. console.log("zh:playSecretaryIdle", data);
  6670. xGame.common.secretary.play(data, 0, true, parent);
  6671. }
  6672. startGame(type) {
  6673. xGame.common.gameMode = type;
  6674. Moyu.sendDataEvent("PlayGame", { type: type });
  6675. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  6676. switch (xGame.common.gameMode) {
  6677. case GameMode.classic:
  6678. console.log('zh:进入经典模式111111111');
  6679. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  6680. let db_over_lev = DataMgr.getChallengeMode_overLev();
  6681. console.log('zh:classic db_over_lev=', db_over_lev);
  6682. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  6683. console.log('zh:判断是否可以玩该模式classic =NO');
  6684. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  6685. xGame.uiMgr.Show(UIMsg, tipStr);
  6686. console.log('zh:返回');
  6687. return;
  6688. }
  6689. else {
  6690. console.log('zh:可以玩该模式classic 66666666666666');
  6691. this.beginGame();
  6692. }
  6693. }
  6694. else {
  6695. console.log('zh:不需要判断是否可以玩该classic');
  6696. let challengeTimes = DataMgr.getChallengeTimes();
  6697. if (challengeTimes == 0) {
  6698. xGame.uiMgr.Show(UIInvitation);
  6699. }
  6700. else {
  6701. this.beginGame();
  6702. }
  6703. break;
  6704. }
  6705. case GameMode.bigMove:
  6706. console.error('zh:bigMove check');
  6707. let guide = DataMgr.getSkillGuide();
  6708. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  6709. let db_over_lev = DataMgr.getChallengeMode_overLev();
  6710. console.log('zh:bigMove db_over_lev=', db_over_lev);
  6711. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  6712. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  6713. xGame.uiMgr.Show(UIMsg, tipStr);
  6714. return;
  6715. }
  6716. else {
  6717. console.log('zh:可以玩该模式 bigMove');
  6718. this.beginGame();
  6719. if (DataMgr.getNewUser())
  6720. Moyu.sendDataEvent("gameStart0");
  6721. }
  6722. }
  6723. else {
  6724. this.beginGame();
  6725. if (DataMgr.getNewUser())
  6726. Moyu.sendDataEvent("gameStart0");
  6727. }
  6728. break;
  6729. default:
  6730. console.error('zh:未知错误!!!!');
  6731. break;
  6732. }
  6733. }
  6734. beginGame(isNice = false) {
  6735. console.log('zh:beginGame ');
  6736. let guide = DataMgr.getSkillGuide();
  6737. if (guide == 1) {
  6738. console.log('zh:非新手引导,showInternAd ');
  6739. JSBridgeUtils.instance.showInternAd('beginGame');
  6740. }
  6741. else {
  6742. console.log('zh:新手引导,不显示AD ');
  6743. }
  6744. console.log('zh:beginGame 2 go');
  6745. if (xGame.common.gameMode == GameMode.classic) {
  6746. if (isNice) {
  6747. this.enterClassic();
  6748. }
  6749. else {
  6750. xGame.uiMgr.Show(UIModeSelection, () => {
  6751. console.log('zh:BBBBBBBBBBBBBBB');
  6752. this.enterClassic();
  6753. });
  6754. }
  6755. }
  6756. else if (xGame.common.gameMode == GameMode.bigMove) {
  6757. this.ui.enterGuide.visible = false;
  6758. xGame.uiMgr.Show(UISkill);
  6759. }
  6760. }
  6761. enterClassic() {
  6762. xGame.uiMgr.Show(UIGame);
  6763. xGame.uiMgr.Show(UIMatching, () => {
  6764. if (!this.isHide)
  6765. this.hide();
  6766. xGame.common.gameUI.ui.alpha = 1;
  6767. xGame.common.gameUI.startGame();
  6768. xGame.uiMgr.Hide(UIGameEnd);
  6769. });
  6770. }
  6771. startGlobal() {
  6772. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6773. }
  6774. startWeekly() {
  6775. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6776. }
  6777. zhouSaiMonth() {
  6778. console.log('zh: zhouSaiMonth 被调用');
  6779. }
  6780. startPlaceBall() {
  6781. xGame.uiMgr.Show(UILevelDisplay);
  6782. }
  6783. hide() {
  6784. console.log('zh:uimain hide ...');
  6785. super.hide();
  6786. xGame.common.stopGirlPop(this.ui.talkNode);
  6787. }
  6788. onGetUserInfo(force = false) {
  6789. if (Moyu.isWx) {
  6790. let info = Moyu.getSystemInfo();
  6791. if (info)
  6792. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6793. }
  6794. else {
  6795. Moyu.initUser(this, this.freshUser, force);
  6796. }
  6797. if (!Moyu.hasUserInfo) {
  6798. let user = Moyu.getUserInfo();
  6799. user.headIcon = 'res/ty_touxiang.png';
  6800. }
  6801. this.freshUser();
  6802. }
  6803. freshUser() {
  6804. let user = Moyu.getUserInfo();
  6805. if (!user.isAuth) {
  6806. user.headIcon = 'res/ty_touxiang.png';
  6807. }
  6808. else
  6809. DataMgr.upRankData();
  6810. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6811. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6812. }
  6813. interuptSecretary() {
  6814. Laya.timer.clearAll(this);
  6815. this.playSecretaryRandomSound();
  6816. }
  6817. playSecretaryRandomSound() {
  6818. if (this.isHide)
  6819. return;
  6820. let time = xGame.common.randomNum(45000, 60000);
  6821. Laya.timer.once(time, this, () => {
  6822. if (this.isHide)
  6823. return;
  6824. let index = xGame.common.randomNum(4, 7);
  6825. xGame.soundMgr.playSound("s_main0" + index);
  6826. let words = 1;
  6827. switch (index) {
  6828. case 4:
  6829. words = 5;
  6830. break;
  6831. case 5:
  6832. words = 3;
  6833. break;
  6834. case 6:
  6835. words = 6;
  6836. break;
  6837. case 7:
  6838. words = 7;
  6839. break;
  6840. default:
  6841. break;
  6842. }
  6843. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6844. this.playSecretaryRandomSound();
  6845. });
  6846. }
  6847. openSecretaryView() {
  6848. xGame.uiMgr.Show(UISecretary);
  6849. Moyu.sendDataEvent("secretary");
  6850. }
  6851. openShopView() {
  6852. xGame.uiMgr.Show(UIShop);
  6853. }
  6854. openSignView() {
  6855. xGame.uiMgr.Show(UISign);
  6856. }
  6857. openDrawView() {
  6858. xGame.uiMgr.Show(UIDraw);
  6859. }
  6860. openRanking() {
  6861. console.log('zh:phb openRanking');
  6862. xGame.uiMgr.Show(UIRanking);
  6863. Moyu.sendDataEvent("rankingList");
  6864. }
  6865. }
  6866. UIMain.uiName = "UIMain";
  6867. class UIGameEnd extends UIBase {
  6868. constructor() {
  6869. super();
  6870. this.success = false;
  6871. this.awardCoinNum = 1000;
  6872. this.awardDiamondNum = 10;
  6873. }
  6874. onConstructor() {
  6875. this.ui = ui_UIGameEnd.createInstance();
  6876. this.contentPane = this.ui;
  6877. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6878. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6879. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6880. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6881. this.ui.talkNode.visible = false;
  6882. if (Moyu.isKs)
  6883. this.ui.closeNode.closeBtn.x += 100;
  6884. }
  6885. updateType() {
  6886. switch (xGame.common.gameMode) {
  6887. case GameMode.classic:
  6888. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6889. this.ui.coinNode.visible = this.success;
  6890. if (!this.success) {
  6891. Laya.timer.once(500, this, () => {
  6892. xGame.uiMgr.Show(UIAddCoin);
  6893. });
  6894. }
  6895. this.ui.isGetAward.visible = false;
  6896. this.ui.leftBtn.c1.selectedIndex = 3;
  6897. this.ui.rightBtn.c1.selectedIndex = 0;
  6898. this.moneyNode.ui.c1.selectedIndex = 1;
  6899. break;
  6900. case GameMode.bigMove:
  6901. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6902. this.ui.coinNode.visible = this.success;
  6903. if (xGame.common.gameMode == GameMode.bigMove) {
  6904. if (this.success) {
  6905. DataMgr.setSkillSuccessTimes(1, true);
  6906. DataMgr.setSkillAccTimes(1);
  6907. }
  6908. else {
  6909. DataMgr.setSkillSuccessTimes(0, false);
  6910. }
  6911. }
  6912. if (!this.success) {
  6913. Laya.timer.once(500, this, () => {
  6914. xGame.uiMgr.Show(UIAddCoin);
  6915. });
  6916. }
  6917. this.ui.isGetAward.visible = false;
  6918. this.ui.leftBtn.c1.selectedIndex = 3;
  6919. this.ui.rightBtn.c1.selectedIndex = 0;
  6920. this.moneyNode.ui.c1.selectedIndex = 1;
  6921. break;
  6922. case GameMode.placeBall:
  6923. this.ui.coinNode.visible = false;
  6924. if (this.success) {
  6925. if (xGame.common.placeBallStarNum == 3) {
  6926. this.ui.c1.selectedIndex = 2;
  6927. }
  6928. else {
  6929. this.ui.c1.selectedIndex = 3;
  6930. }
  6931. }
  6932. else {
  6933. this.ui.c1.selectedIndex = 4;
  6934. }
  6935. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6936. if (cfg.type == PlaceBallType.challenge) {
  6937. this.ui.c1.selectedIndex = 2;
  6938. }
  6939. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6940. this.updatePlaceBallBtn();
  6941. this.updatePlaceBallStarNum();
  6942. this.updatePlaceBallAwardState();
  6943. this.moneyNode.ui.c1.selectedIndex = 2;
  6944. this.moneyNode.checkPowerTime();
  6945. this.moneyNode.powerChange();
  6946. DataMgr.upRankData();
  6947. break;
  6948. default:
  6949. break;
  6950. }
  6951. }
  6952. updatePlaceBallBtn() {
  6953. this.ui.leftBtn.c1.selectedIndex = 5;
  6954. if (this.success) {
  6955. this.ui.rightBtn.c1.selectedIndex = 14;
  6956. }
  6957. else {
  6958. if (xGame.common.placeBallStarNum == 3) {
  6959. this.ui.rightBtn.c1.selectedIndex = 14;
  6960. }
  6961. else {
  6962. this.ui.rightBtn.c1.selectedIndex = 1;
  6963. }
  6964. }
  6965. }
  6966. updatePlaceBallStarNum() {
  6967. let starNum = xGame.common.placeBallStarNum;
  6968. if (starNum == 0)
  6969. this.ui.starNumNode.c1.selectedIndex = 3;
  6970. else {
  6971. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6972. }
  6973. }
  6974. updatePlaceBallAwardState() {
  6975. let level = xGame.common.placeBallCurLevel;
  6976. let starNum = xGame.common.placeBallStarNum;
  6977. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6978. let data = cfgTable.placeballData[level].award;
  6979. let cfg = cfgTable.placeballData[level];
  6980. this.awardDiamondNum = data[1];
  6981. this.awardCoinNum = data[0];
  6982. if (cfg.type == PlaceBallType.challenge) {
  6983. this.awardDiamondNum = 0;
  6984. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6985. }
  6986. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6987. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6988. if (cfg.type == PlaceBallType.challenge) {
  6989. this.ui.awardNode.coinNode.visible = true;
  6990. }
  6991. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6992. this.ui.awardNode.diamondNode.x = 265;
  6993. this.ui.awardNode.coinNode.x = 354;
  6994. }
  6995. else {
  6996. this.ui.awardNode.diamondNode.x = 291;
  6997. this.ui.awardNode.coinNode.x = 291;
  6998. }
  6999. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  7000. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  7001. if (this.awardCoinNum == 0) {
  7002. this.ui.awardNode.coinNode.numTxt.text = "";
  7003. }
  7004. if (getAward) {
  7005. this.ui.isGetAward.visible = true;
  7006. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  7007. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  7008. }
  7009. else {
  7010. this.ui.isGetAward.visible = false;
  7011. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  7012. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  7013. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  7014. }
  7015. else {
  7016. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  7017. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  7018. }
  7019. }
  7020. }
  7021. show(success) {
  7022. super.show();
  7023. xGame.eventMgr.event(RESET_GAME);
  7024. this.success = success;
  7025. Laya.timer.clearAll(this);
  7026. this.playSecretaryAni();
  7027. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  7028. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  7029. offsetTime = Math.floor(offsetTime / 1000);
  7030. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  7031. this.updateType();
  7032. Laya.timer.once(200, this, () => {
  7033. this.addAward(() => {
  7034. this.updateType();
  7035. Laya.timer.once(500, this, () => {
  7036. this.showChallengeLevel();
  7037. });
  7038. });
  7039. });
  7040. if (this.success) {
  7041. JSBridgeUtils.instance.showInternAd('gameend_success');
  7042. console.log('zh:game end 成功');
  7043. xGame.soundMgr.playSound('slots_roll01');
  7044. xGame.soundMgr.playSound("s_win");
  7045. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7046. this.diyGameDataUtilForGameWin();
  7047. }
  7048. else {
  7049. JSBridgeUtils.instance.showInternAd('gameend_faill');
  7050. console.log('zh:game end失败');
  7051. xGame.soundMgr.playSound('matchwin01');
  7052. xGame.soundMgr.playSound("s_lose");
  7053. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7054. }
  7055. let challengeNum = DataMgr.getChallengeTimes();
  7056. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7057. DataMgr.setChallengeTimes(1);
  7058. }
  7059. if (this.success && xGame.common.gameMode == GameMode.classic) {
  7060. DataMgr.setClassicTimes();
  7061. }
  7062. }
  7063. diyGameDataUtilForGameWin() {
  7064. console.log('zh: DiyGameDataUtilForGameWin diy ');
  7065. switch (xGame.common.gameMode) {
  7066. case GameMode.classic:
  7067. console.log('zh:DiyGameDataUtilForGameWin 111');
  7068. case GameMode.bigMove:
  7069. console.log('zh:DiyGameDataUtilForGameWin 222');
  7070. this.restartGame();
  7071. break;
  7072. case GameMode.placeBall:
  7073. console.log('zh:DiyGameDataUtilForGameWin 333');
  7074. var level = xGame.common.placeBallCurLevel;
  7075. console.log('zh:练习模式 联系了多少LEV=' + level);
  7076. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7077. if (level > db_over_lev) {
  7078. DataMgr.setChallengeMode_overLev(level);
  7079. }
  7080. break;
  7081. default:
  7082. console.log('zh:DiyGameDataUtilForGameWin 444');
  7083. break;
  7084. }
  7085. }
  7086. showChallengeLevel() {
  7087. if (DataMgr.getChallengeTimes() != 0)
  7088. return;
  7089. let skill = DataMgr.getSkillAccTimes();
  7090. let put = DataMgr.getPlaceBallLevelList().length;
  7091. if (skill >= 3 || put >= 5) {
  7092. xGame.uiMgr.Show(UIInvitation);
  7093. this.hide();
  7094. }
  7095. }
  7096. addAward(callback) {
  7097. if (!this.success) {
  7098. callback && callback();
  7099. return;
  7100. }
  7101. switch (xGame.common.gameMode) {
  7102. case GameMode.classic:
  7103. this.awardCoinNum = xGame.common.passAwardCoin;
  7104. this.awardDiamondNum = 0;
  7105. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7106. break;
  7107. case GameMode.bigMove:
  7108. this.awardCoinNum = xGame.common.passAwardCoin;
  7109. this.awardDiamondNum = 0;
  7110. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7111. callback && callback();
  7112. break;
  7113. case GameMode.placeBall:
  7114. let level = xGame.common.placeBallCurLevel;
  7115. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  7116. if (xGame.common.placeBallStarNum != 3) {
  7117. callback && callback();
  7118. return;
  7119. }
  7120. else {
  7121. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7122. if (getAward) {
  7123. callback && callback();
  7124. return;
  7125. }
  7126. }
  7127. let cfg = cfgTable.placeballData[level];
  7128. let data = cfgTable.placeballData[level].award;
  7129. this.awardCoinNum = data[0];
  7130. this.awardDiamondNum = data[1];
  7131. if (cfg.type == PlaceBallType.challenge) {
  7132. this.awardDiamondNum = 0;
  7133. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7134. }
  7135. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  7136. let diamondAward;
  7137. if (this.awardDiamondNum > 0) {
  7138. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  7139. xGame.common.getAward([diamondAward, coinAward], callback);
  7140. }
  7141. else {
  7142. xGame.common.getAward([coinAward], callback);
  7143. }
  7144. if (cfg.type == PlaceBallType.normal) {
  7145. DataMgr.setPlaceBallAward(level);
  7146. }
  7147. break;
  7148. default:
  7149. break;
  7150. }
  7151. }
  7152. playSecretaryAni_old() {
  7153. let parent = this.ui.secretary.displayObject;
  7154. parent.destroyChildren();
  7155. let xx = this.ui.secretary.width / 2;
  7156. let yy = this.ui.secretary.height;
  7157. let scale = xGame.common.getSecretaryScale();
  7158. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7159. if (this.success) {
  7160. let rand = Math.random() <= 0.5 ? 2 : 3;
  7161. xGame.common.secretary.play(data, rand, false, parent, () => {
  7162. xGame.common.secretary.play(data, 1, true, parent);
  7163. });
  7164. }
  7165. else {
  7166. xGame.common.secretary.play(data, 0, true, parent);
  7167. }
  7168. }
  7169. playSecretaryAni() {
  7170. let parent = this.ui.secretary.displayObject;
  7171. parent.destroyChildren();
  7172. let xx = this.ui.secretary.width / 2;
  7173. let yy = this.ui.secretary.height;
  7174. let scale = xGame.common.getSecretaryScale();
  7175. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7176. if (this.success) {
  7177. let rand = 0;
  7178. xGame.common.secretary.play(data, 0, true, parent);
  7179. }
  7180. else {
  7181. xGame.common.secretary.play(data, 0, true, parent);
  7182. }
  7183. }
  7184. restartGame() {
  7185. switch (xGame.common.gameMode) {
  7186. case GameMode.classic:
  7187. xGame.eventMgr.event(RESTART_GAME);
  7188. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7189. break;
  7190. case GameMode.bigMove:
  7191. this.hide();
  7192. xGame.eventMgr.event(RESTART_GAME);
  7193. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7194. break;
  7195. default:
  7196. break;
  7197. }
  7198. }
  7199. hide() {
  7200. super.hide();
  7201. xGame.common.stopGirlPop(this.ui.talkNode);
  7202. PlatMgr.showBanner(false);
  7203. }
  7204. returnHome() {
  7205. this.hide();
  7206. let showFailWords = !this.success;
  7207. xGame.uiMgr.Show(UIMain, showFailWords);
  7208. }
  7209. clickLeftBtn() {
  7210. switch (xGame.common.gameMode) {
  7211. case GameMode.classic:
  7212. case GameMode.bigMove:
  7213. this.returnHome();
  7214. break;
  7215. case GameMode.placeBall:
  7216. let level = xGame.common.placeBallCurLevel;
  7217. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7218. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7219. break;
  7220. default:
  7221. break;
  7222. }
  7223. }
  7224. powerStartPlaceBallLevel(level, btn) {
  7225. if (DataMgr.powerEnough()) {
  7226. btn.touchable = false;
  7227. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7228. btn.touchable = true;
  7229. DataMgr.setPower(-1);
  7230. xGame.eventMgr.event(POWER_TIME);
  7231. this.startPlaceBallLevel(level);
  7232. }));
  7233. }
  7234. else {
  7235. xGame.uiMgr.Show(UIPower, 0);
  7236. }
  7237. }
  7238. clickRightBtn() {
  7239. switch (xGame.common.gameMode) {
  7240. case GameMode.classic:
  7241. console.log('zh:clickRightBtn 111');
  7242. case GameMode.bigMove:
  7243. console.log('zh:clickRightBtn 222');
  7244. this.restartGame();
  7245. break;
  7246. case GameMode.placeBall:
  7247. console.log('zh:clickRightBtn 333');
  7248. let level = xGame.common.placeBallCurLevel;
  7249. let data = DataMgr.getPlaceBallLevel(level);
  7250. let curPss = data.play && !data.isCur;
  7251. if (curPss) {
  7252. console.log('zh:clickRightBtn 333-111');
  7253. console.log('zh:当前LV=' + level);
  7254. if (level == 60) {
  7255. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7256. Laya.timer.once(3000, this, () => {
  7257. this.returnHome();
  7258. });
  7259. }
  7260. else {
  7261. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  7262. }
  7263. }
  7264. else {
  7265. console.log('zh:clickRightBtn 333-000');
  7266. Moyu.sendDataEvent("placeBallNextLevel");
  7267. console.log('zh:qjff_AD_for_uiGameEnd');
  7268. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7269. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7270. }
  7271. else {
  7272. console.log('zh:AD 失败,直接发放奖励');
  7273. this.qjff_AD_for_uiGameEnd(level);
  7274. }
  7275. }
  7276. break;
  7277. default:
  7278. console.log('zh:clickRightBtn 444');
  7279. break;
  7280. }
  7281. }
  7282. qjff_AD_for_uiGameEnd(level) {
  7283. DataMgr.setPlaceBallLevel(level, 1);
  7284. this.startPlaceBallLevel(level + 1);
  7285. }
  7286. startPlaceBallLevel(level) {
  7287. xGame.common.gameMode = GameMode.placeBall;
  7288. xGame.common.placeBallCurLevel = level;
  7289. xGame.uiMgr.Show(UIGame);
  7290. this.hide();
  7291. }
  7292. }
  7293. UIGameEnd.uiName = "UIGameEnd";
  7294. class ui_UIVideoShare extends fgui.GComponent {
  7295. static createInstance() {
  7296. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7297. }
  7298. onConstruct() {
  7299. this.n10 = (this.getChild("n10"));
  7300. this.myNode = (this.getChild("myNode"));
  7301. this.t0 = this.getTransition("t0");
  7302. }
  7303. }
  7304. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7305. class UIVideoShare extends UIBase {
  7306. constructor() {
  7307. super();
  7308. this.success = false;
  7309. this.awardNum = 0;
  7310. this.isShared = true;
  7311. }
  7312. onConstructor() {
  7313. this.ui = ui_UIVideoShare.createInstance();
  7314. this.contentPane = this.ui;
  7315. this.isEject = false;
  7316. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7317. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7318. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7319. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7320. }
  7321. show(success) {
  7322. super.show();
  7323. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7324. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7325. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7326. this.success = success;
  7327. let time = xGame.common.randomNum(600, 1500);
  7328. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  7329. if (success)
  7330. xGame.soundMgr.playSound("applause");
  7331. this.ui.t0.play();
  7332. this.checkShareState();
  7333. let times = DataMgr.getDailyVideoShareTimes();
  7334. this.awardNum = times == 0 ? 2000 : 200;
  7335. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  7336. }
  7337. checkShareState() {
  7338. if (PlatMgr.forceShare == 0) {
  7339. this.ui.myNode.closeBtn.visible = true;
  7340. this.ui.myNode.tipsNode.visible = false;
  7341. this.ui.myNode.closeBtn.x = 90;
  7342. this.ui.myNode.shareBtn.x = 342;
  7343. }
  7344. else if (PlatMgr.forceShare == 1) {
  7345. this.ui.myNode.closeBtn.visible = false;
  7346. this.ui.myNode.tipsNode.visible = true;
  7347. this.ui.myNode.shareBtn.x = 218;
  7348. this.isShared = true;
  7349. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7350. }
  7351. }
  7352. checkForceShare() {
  7353. this.isShared = !this.isShared;
  7354. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7355. }
  7356. videoShare() {
  7357. if (PlatMgr.forceShare == 1) {
  7358. if (this.isShared) {
  7359. this.shareGame();
  7360. }
  7361. else {
  7362. this.hideSelf();
  7363. }
  7364. }
  7365. else {
  7366. this.shareGame();
  7367. }
  7368. }
  7369. shareGame() {
  7370. Moyu.sendDataEvent("VideoShare");
  7371. if (Moyu.canShare() > 100) {
  7372. Moyu.shareGame((success) => {
  7373. if (success) {
  7374. DataMgr.setDailyVideoShareTimes(1);
  7375. DataMgr.setCoin(this.awardNum);
  7376. }
  7377. this.hideSelf();
  7378. }, this);
  7379. }
  7380. else {
  7381. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  7382. this.hideSelf();
  7383. }
  7384. }
  7385. hideSelf() {
  7386. this.hide();
  7387. xGame.uiMgr.Show(UIGameEnd, this.success);
  7388. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  7389. xGame.common.screenImg.destroy();
  7390. xGame.common.screenImg = null;
  7391. }
  7392. }
  7393. }
  7394. UIVideoShare.uiName = "UIVideoShare";
  7395. class ui_UITips extends fgui.GComponent {
  7396. static createInstance() {
  7397. return (fgui.UIPackage.createObject("game", "UITips"));
  7398. }
  7399. onConstruct() {
  7400. this.n0 = (this.getChild("n0"));
  7401. this.myNode = (this.getChild("myNode"));
  7402. this.t0 = this.getTransition("t0");
  7403. }
  7404. }
  7405. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7406. class UITips extends UIBase {
  7407. constructor() {
  7408. super();
  7409. this.type = 0;
  7410. }
  7411. onConstructor() {
  7412. this.ui = ui_UITips.createInstance();
  7413. this.contentPane = this.ui;
  7414. this.isEject = false;
  7415. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7416. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7417. }
  7418. show(tipsTxt, womanTxt, type) {
  7419. super.show();
  7420. this.ui.t0.play();
  7421. this.ui.myNode.tipsTxt.text = tipsTxt;
  7422. this.ui.myNode.womanTxt.text = womanTxt;
  7423. PlatMgr.showInsert(true);
  7424. this.ui.myNode.c1.selectedIndex = type;
  7425. this.type = type;
  7426. switch (this.type) {
  7427. case TipsType.exitGame:
  7428. xGame.common.gameMgr.gamePause = true;
  7429. break;
  7430. case TipsType.foul:
  7431. Laya.timer.once(200, this, () => {
  7432. xGame.common.gameMgr.gamePause = true;
  7433. });
  7434. break;
  7435. default:
  7436. break;
  7437. }
  7438. }
  7439. clickLeftBtn() {
  7440. this.hide();
  7441. xGame.common.gameMgr.gamePause = false;
  7442. switch (this.type) {
  7443. case TipsType.exitGame:
  7444. break;
  7445. case TipsType.foul:
  7446. break;
  7447. default:
  7448. break;
  7449. }
  7450. }
  7451. clickRightBtn() {
  7452. this.hide();
  7453. switch (this.type) {
  7454. case TipsType.exitGame:
  7455. xGame.eventMgr.event(RESET_GAME);
  7456. xGame.uiMgr.Show(UIMain);
  7457. Moyu.recordEnd(this, null);
  7458. xGame.common.longHelpLine = false;
  7459. break;
  7460. case TipsType.foul:
  7461. xGame.common.gameMgr.gamePause = false;
  7462. Laya.timer.clearAll(this);
  7463. break;
  7464. default:
  7465. break;
  7466. }
  7467. }
  7468. }
  7469. UITips.uiName = "UITips";
  7470. class GameMgr {
  7471. constructor() {
  7472. this.selfCamp = "";
  7473. this.selfFoulNum = 0;
  7474. this.selfBallArr = [];
  7475. this.selfTimer = 0;
  7476. this.selfScore = 0;
  7477. this.aiCamp = "";
  7478. this.aiFoulNum = 0;
  7479. this.aiBallArr = [];
  7480. this.aiTimer = 0;
  7481. this.aiScore = 0;
  7482. this.aiSkillLevelNum = 1;
  7483. this.targertScore = 0;
  7484. this.setTime = 30;
  7485. this.selfTurnRate = 0.5;
  7486. this.accTime = 0;
  7487. this.curFoul = "";
  7488. this.maxFoulTimes = 3;
  7489. this.isFirstInGame = true;
  7490. this.firstColliObj = null;
  7491. this.inHoleBalls = [];
  7492. this.blackNum = 8;
  7493. this.success = false;
  7494. this.holePosList = [];
  7495. this.posObj = {};
  7496. this._selfTurn = false;
  7497. this.lastRootBallPos = new Laya.Vector2(311, 430);
  7498. this.ensureBallType = false;
  7499. this.isOpenBall = true;
  7500. this.finishOneShoot = true;
  7501. this.isEnd = false;
  7502. this.isChangeTurn = false;
  7503. this.isInterrupt = false;
  7504. this.aiPlayedBreakArmy = false;
  7505. this.isTouchedBall = false;
  7506. this.finishBalls = 0;
  7507. this.needBalls = 0;
  7508. this.allBallNum = 0;
  7509. this.placeBallPosData = {};
  7510. this.curHP = 0;
  7511. this.showLongView = false;
  7512. this.firstShoot = true;
  7513. this._gamePause = false;
  7514. this.trunCount = 0;
  7515. this.isBlackInHole = false;
  7516. this.isEnter = true;
  7517. xGame.eventMgr.offAll(ALL_BALL_STOP);
  7518. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  7519. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  7520. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  7521. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  7522. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  7523. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  7524. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  7525. }
  7526. get gamePause() {
  7527. return this._gamePause;
  7528. }
  7529. set gamePause(v) {
  7530. if (v) {
  7531. Laya.physicsTimer.pause();
  7532. }
  7533. else {
  7534. Laya.physicsTimer.resume();
  7535. }
  7536. this._gamePause = v;
  7537. }
  7538. get selfTurn() {
  7539. return this._selfTurn;
  7540. }
  7541. set selfTurn(val) {
  7542. this.trunCount++;
  7543. this._selfTurn = val;
  7544. if (val) {
  7545. xGame.common.d2World.d2Gan.ui.self.visible = true;
  7546. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7547. }
  7548. else {
  7549. xGame.common.d2World.d2Gan.ui.self.visible = false;
  7550. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  7551. if (this.trunCount > 1)
  7552. PlatMgr.openBox();
  7553. }
  7554. }
  7555. resetGame() {
  7556. this.inHoleBalls = [];
  7557. this.isFirstInGame = true;
  7558. this.firstColliObj = null;
  7559. this.aiCamp = "";
  7560. this.selfCamp = "";
  7561. this.aiFoulNum = 0;
  7562. this.selfFoulNum = 0;
  7563. this.selfBallArr = [];
  7564. this.aiBallArr = [];
  7565. this.gamePause = false;
  7566. this.ensureBallType = false;
  7567. this.isInterrupt = false;
  7568. this.updateLeftBall();
  7569. this.clearTime();
  7570. this.aiPlayedBreakArmy = false;
  7571. this.isBlackInHole = false;
  7572. this.placeBallPosData = {};
  7573. if (xGame.common.d3World.knifeRoot) {
  7574. xGame.common.d3World.knifeRoot.destroyChildren();
  7575. }
  7576. }
  7577. gameReady() {
  7578. this.trunCount = 0;
  7579. this.firstColliObj = null;
  7580. this.isFirstInGame = true;
  7581. this.selfTurn = Math.random() <= this.selfTurnRate;
  7582. let challengeNum = DataMgr.getChallengeTimes();
  7583. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7584. this.selfTurn = true;
  7585. }
  7586. if (xGame.common.gameMode == GameMode.placeBall)
  7587. this.selfTurn = true;
  7588. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7589. this.selfTurn = true;
  7590. }
  7591. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7592. this.checkGuide();
  7593. if (xGame.common.uiRodMethod)
  7594. xGame.common.uiRodMethod.resetRod();
  7595. xGame.common.d2World.getHelpLine();
  7596. this.isOpenBall = true;
  7597. this.isTouchedBall = false;
  7598. xGame.common.aiPlayer.stopRun();
  7599. this.setTime = 30;
  7600. let ui = xGame.common.gameUI.ui;
  7601. switch (xGame.common.gameMode) {
  7602. case GameMode.classic:
  7603. xGame.common.aiPlayer.init();
  7604. this.blackNum = 8;
  7605. this.placeRootBall();
  7606. this.peoplePlay(9, 10);
  7607. ui.wordsBtn.visible = true;
  7608. ui.aiWordsBtn.visible = true;
  7609. xGame.common.talkMgr.changeAIState(true);
  7610. DataMgr.gameData.gameCount++;
  7611. DataMgr.saveGameData();
  7612. break;
  7613. case GameMode.bigMove:
  7614. this.blackNum = -1;
  7615. this.selfScore = 0;
  7616. this.aiScore = 0;
  7617. xGame.common.aiPlayer.init();
  7618. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7619. this.updateSelfScore();
  7620. this.updateAIScore();
  7621. this.updateTargetSroce();
  7622. this.placeRootBall();
  7623. this.peoplePlay(9, 10);
  7624. ui.wordsBtn.visible = true;
  7625. ui.aiWordsBtn.visible = true;
  7626. xGame.common.talkMgr.changeAIState(true);
  7627. if (DataMgr.getSkillGuide() < 1)
  7628. DataMgr.gameData.gameCount = 0;
  7629. else {
  7630. DataMgr.gameData.gameCount++;
  7631. DataMgr.saveGameData();
  7632. PlatMgr.openTry();
  7633. }
  7634. if (xGame.common.d3World.knifeRoot) {
  7635. xGame.common.d3World.knifeRoot.destroyChildren();
  7636. }
  7637. break;
  7638. case GameMode.placeBall:
  7639. this.blackNum = -1;
  7640. this.selfTurn = true;
  7641. this.setTime = 10000;
  7642. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7643. this.curHP = this.placeBallData.hp;
  7644. if (this.placeBallData.ball == -1)
  7645. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7646. else
  7647. this.needBalls = this.placeBallData.ball;
  7648. console.log("需要的进球数目", this.needBalls);
  7649. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7650. this.finishBalls = 0;
  7651. this.placeBallPosData = {};
  7652. this.updatePlaceBallPos();
  7653. this.updatePlaceBallState();
  7654. this.finishOneShoot = true;
  7655. xGame.common.gameUI.ui.moveNode.visible = false;
  7656. this.isOpenBall = false;
  7657. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7658. ui.wordsBtn.visible = false;
  7659. ui.aiWordsBtn.visible = false;
  7660. xGame.common.talkMgr.changeAIState(false);
  7661. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7662. PlatMgr.openBox();
  7663. });
  7664. break;
  7665. default:
  7666. break;
  7667. }
  7668. this.showLongView = false;
  7669. xGame.common.wordsMgr.comboTimes = 1;
  7670. let guide = DataMgr.getSkillGuide();
  7671. if (guide)
  7672. xGame.eventMgr.event(WAIT_SHOOT);
  7673. xGame.common.upSkillLevel = false;
  7674. xGame.common.gameStartTime = new Date().getTime();
  7675. this.firstShoot = true;
  7676. }
  7677. checkGuide() {
  7678. let guide = DataMgr.getSkillGuide();
  7679. let gameUI = xGame.common.gameUI.ui;
  7680. gameUI.guide1.visible = false;
  7681. gameUI.guide2.visible = false;
  7682. gameUI.guide3.visible = false;
  7683. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7684. this.selfTurn = true;
  7685. }
  7686. else {
  7687. return;
  7688. }
  7689. let oneBall = this.getOneBall();
  7690. gameUI.guide1.visible = true;
  7691. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7692. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7693. }
  7694. getOneBall() {
  7695. let arr = xGame.common.d2World.ballArr;
  7696. for (let index = 0; index < arr.length; index++) {
  7697. if (arr[index].number == 0)
  7698. continue;
  7699. return arr[index];
  7700. }
  7701. }
  7702. updateSelfScore() {
  7703. let ui = xGame.common.gameUI.ui.topNode;
  7704. ui.selfScoreTxt.text = this.selfScore + "";
  7705. }
  7706. updateAIScore() {
  7707. let ui = xGame.common.gameUI.ui.topNode;
  7708. ui.aiScoreTxt.text = this.aiScore + "";
  7709. }
  7710. updateTargetSroce() {
  7711. let ui = xGame.common.gameUI.ui.topNode;
  7712. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7713. }
  7714. updateLeftBall() {
  7715. let topUI = xGame.common.gameUI.ui.topNode;
  7716. topUI.selfBallList.numItems = this.selfBallArr.length;
  7717. topUI.aiBallList.numItems = this.aiBallArr.length;
  7718. }
  7719. ballShoot() {
  7720. this.clearTime();
  7721. this.finishOneShoot = false;
  7722. xGame.common.gameUI.ui.moveNode.visible = false;
  7723. if (xGame.common.gameUI.ui.guideNode.visible) {
  7724. xGame.common.gameUI.ui.guideNode.visible = false;
  7725. }
  7726. if (this.firstShoot) {
  7727. this.firstShoot = false;
  7728. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7729. }
  7730. }
  7731. ensureCamp(number) {
  7732. this.ensureBallType = true;
  7733. this.isOpenBall = false;
  7734. if (xGame.common.gameMode != GameMode.classic)
  7735. return;
  7736. let full = [1, 2, 3, 4, 5, 6, 7];
  7737. let flower = [9, 10, 11, 12, 13, 14, 15];
  7738. let sayWords = "";
  7739. if (this.selfTurn) {
  7740. if (number <= 7) {
  7741. this.selfCamp = ballCamp.full;
  7742. this.selfBallArr = full;
  7743. this.aiCamp = ballCamp.flower;
  7744. this.aiBallArr = flower;
  7745. sayWords = cfgTable.wordsData[3].msg;
  7746. }
  7747. else {
  7748. this.selfCamp = ballCamp.flower;
  7749. this.selfBallArr = flower;
  7750. this.aiCamp = ballCamp.full;
  7751. this.aiBallArr = full;
  7752. sayWords = cfgTable.wordsData[4].msg;
  7753. }
  7754. }
  7755. else {
  7756. if (number <= 7) {
  7757. this.selfCamp = ballCamp.flower;
  7758. this.selfBallArr = flower;
  7759. this.aiCamp = ballCamp.full;
  7760. this.aiBallArr = full;
  7761. sayWords = cfgTable.wordsData[2].msg;
  7762. }
  7763. else {
  7764. this.selfCamp = ballCamp.full;
  7765. this.selfBallArr = full;
  7766. this.aiCamp = ballCamp.flower;
  7767. this.aiBallArr = flower;
  7768. sayWords = cfgTable.wordsData[1].msg;
  7769. }
  7770. }
  7771. this.updateLeftBall();
  7772. xGame.uiMgr.Show(UIMsg, sayWords);
  7773. }
  7774. updatePlaceBallState() {
  7775. let ui = xGame.common.gameUI.ui;
  7776. switch (this.placeBallData.type) {
  7777. case PlaceBallType.normal:
  7778. let normal = ui.placeNormalNode;
  7779. normal.hpTxt.text = this.curHP + "";
  7780. this.updatePlaceBallStar(normal);
  7781. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7782. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7783. break;
  7784. case PlaceBallType.challenge:
  7785. let challenge = ui.placeChallengeNode;
  7786. challenge.hpTxt.text = "Shots:" + this.curHP;
  7787. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7788. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7789. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7790. break;
  7791. default:
  7792. break;
  7793. }
  7794. }
  7795. playSubHpAni() {
  7796. let ui = xGame.common.gameUI.ui;
  7797. switch (this.placeBallData.type) {
  7798. case PlaceBallType.normal:
  7799. let normal = ui.placeNormalNode;
  7800. normal.hpTxt.visible = false;
  7801. normal.starAni.c1.selectedIndex = 1;
  7802. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7803. normal.hpTxt.visible = true;
  7804. normal.starAni.c1.selectedIndex = 0;
  7805. }));
  7806. break;
  7807. default:
  7808. break;
  7809. }
  7810. }
  7811. getEndStarNum() {
  7812. let num;
  7813. let level = xGame.common.placeBallCurLevel;
  7814. if (this.curHP == this.placeBallData.hp) {
  7815. num = 3;
  7816. }
  7817. else if (this.curHP <= 1) {
  7818. num = 1;
  7819. }
  7820. else {
  7821. num = 2;
  7822. }
  7823. if (!this.success) {
  7824. num = 0;
  7825. }
  7826. else {
  7827. DataMgr.setPlaceBallLevel(level, num);
  7828. }
  7829. let myType = cfgTable.placeballData[level].type;
  7830. if (this.success && myType == 1) {
  7831. num = 3;
  7832. }
  7833. xGame.common.placeBallStarNum = num;
  7834. }
  7835. updatePlaceBallStar(node) {
  7836. let star = 0;
  7837. if (this.curHP == this.placeBallData.hp) {
  7838. star = 3;
  7839. }
  7840. else if (this.curHP >= 2) {
  7841. star = 2;
  7842. }
  7843. else if (this.curHP == 1) {
  7844. star = 1;
  7845. }
  7846. else {
  7847. star = 0;
  7848. }
  7849. let temp;
  7850. for (let index = 1; index <= 3; index++) {
  7851. temp = node["star" + index];
  7852. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7853. }
  7854. node.myProgress.value = (star / 3) * 100;
  7855. }
  7856. openRegretView(isFoul, GoalNum, challenge = false) {
  7857. let regretType = -1;
  7858. if (isFoul) {
  7859. regretType = 1;
  7860. }
  7861. else {
  7862. if (GoalNum <= 0) {
  7863. regretType = 0;
  7864. }
  7865. }
  7866. if (challenge) {
  7867. regretType = 1;
  7868. }
  7869. if (regretType != -1) {
  7870. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7871. if (success) {
  7872. this.curHP++;
  7873. this.updatePlaceBallState();
  7874. this.setPlaceBallAllPos();
  7875. xGame.common.gameUI.ui.moveNode.visible = false;
  7876. }
  7877. else {
  7878. if (this.curHP <= 0) {
  7879. this.success = false;
  7880. this.gameEnd();
  7881. }
  7882. this.playSubHpAni();
  7883. }
  7884. this.updatePlaceBallState();
  7885. this.updatePlaceBallPos();
  7886. });
  7887. }
  7888. }
  7889. setPlaceBallAllPos() {
  7890. let allBall = xGame.common.d2World.ballArr;
  7891. let cfgArr = this.placeBallPosData;
  7892. let temp;
  7893. let obj;
  7894. for (let index = 0; index < allBall.length; index++) {
  7895. temp = allBall[index];
  7896. if (temp.destroyed)
  7897. continue;
  7898. obj = cfgArr[temp.myUNID];
  7899. if (obj && obj.src && !obj.src.destroyed) {
  7900. temp.gameObj.x = obj.posX;
  7901. temp.gameObj.y = obj.posY;
  7902. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7903. }
  7904. }
  7905. xGame.common.d2World.getHelpLine();
  7906. }
  7907. updatePlaceBallPos() {
  7908. let arr = xGame.common.d2World.ballArr;
  7909. let temp;
  7910. for (let index = 0; index < arr.length; index++) {
  7911. temp = arr[index];
  7912. if (!this.placeBallPosData[temp.myUNID]) {
  7913. this.placeBallPosData[temp.myUNID] = {
  7914. src: temp,
  7915. posX: temp.gameObj.x,
  7916. posY: temp.gameObj.y
  7917. };
  7918. }
  7919. else {
  7920. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7921. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7922. }
  7923. }
  7924. let check;
  7925. for (const key in this.placeBallPosData) {
  7926. check = this.placeBallPosData[key];
  7927. if (check.src.destroyed) {
  7928. delete this.placeBallPosData[key];
  7929. }
  7930. }
  7931. }
  7932. gameRun(type) {
  7933. if (this.gamePause)
  7934. return;
  7935. this.curFoul = this.getFoulType();
  7936. if (type) {
  7937. xGame.common.d2World.d2Gan.shoot();
  7938. xGame.common.gameUI.forceCancel();
  7939. this.curFoul = type;
  7940. }
  7941. this.isEnd = false;
  7942. this.isChangeTurn = true;
  7943. if (xGame.common.gameMode == GameMode.classic) {
  7944. this.judgeClassic(this.curFoul);
  7945. this.checkClassicWords(() => {
  7946. xGame.common.destroyClassicEmotion();
  7947. if (this.isEnd) {
  7948. if (this.isBlackInHole) {
  7949. xGame.common.gameUI.ui.blackAni.visible = true;
  7950. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7951. xGame.common.gameUI.ui.blackAni.visible = false;
  7952. this.gameEnd();
  7953. }));
  7954. }
  7955. else {
  7956. this.gameEnd();
  7957. }
  7958. }
  7959. else {
  7960. this.waitShoot();
  7961. xGame.eventMgr.event(WAIT_SHOOT);
  7962. }
  7963. });
  7964. }
  7965. else if (xGame.common.gameMode == GameMode.bigMove) {
  7966. xGame.common.aiPlayer.stopRun();
  7967. let scoreArr = this.getScore(this.curFoul);
  7968. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7969. this.isEnd = true;
  7970. }
  7971. this.checkBigSkillWords(() => {
  7972. if (this.isEnd) {
  7973. this.gameEnd();
  7974. }
  7975. else {
  7976. this.waitShoot();
  7977. xGame.eventMgr.event(WAIT_SHOOT);
  7978. }
  7979. });
  7980. }
  7981. else if (xGame.common.gameMode == GameMode.placeBall) {
  7982. xGame.common.destroyAwardSpine();
  7983. let isFoul = this.curFoul == FoulType.rootHole;
  7984. let GoalNum = this.inHoleBalls.length;
  7985. if (this.inHoleBalls.indexOf(0) > -1)
  7986. GoalNum -= 1;
  7987. if (isFoul) {
  7988. this.placeRootBall();
  7989. }
  7990. console.log("neeballs", this.needBalls);
  7991. console.log("当前完成的goalNum", GoalNum);
  7992. this.finishBalls += GoalNum;
  7993. console.log("当前完成的finishballs", this.finishBalls);
  7994. let need = this.needBalls;
  7995. if (this.placeBallData.type == PlaceBallType.challenge) {
  7996. need += 100;
  7997. }
  7998. if (this.finishBalls >= need) {
  7999. this.success = true;
  8000. this.gameEnd();
  8001. }
  8002. else {
  8003. switch (this.placeBallData.type) {
  8004. case PlaceBallType.normal:
  8005. if (!isFoul && GoalNum > 0) {
  8006. this.updatePlaceBallPos();
  8007. this.updatePlaceBallState();
  8008. }
  8009. else {
  8010. this.curHP--;
  8011. this.openRegretView(isFoul, GoalNum);
  8012. }
  8013. this.waitShoot();
  8014. xGame.eventMgr.event(WAIT_SHOOT);
  8015. break;
  8016. case PlaceBallType.challenge:
  8017. this.curHP--;
  8018. this.updatePlaceBallState();
  8019. if (isFoul) {
  8020. this.openRegretView(isFoul, GoalNum, true);
  8021. }
  8022. else {
  8023. this.updatePlaceBallPos();
  8024. if (this.curHP <= 0) {
  8025. this.success = true;
  8026. this.gameEnd();
  8027. }
  8028. }
  8029. this.waitShoot();
  8030. xGame.eventMgr.event(WAIT_SHOOT);
  8031. break;
  8032. default:
  8033. break;
  8034. }
  8035. }
  8036. }
  8037. }
  8038. checkClassicWords(callback) {
  8039. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  8040. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  8041. let type = this.getClassicWordsType();
  8042. if (condition && type != -1) {
  8043. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  8044. xGame.soundMgr.playSound(str);
  8045. xGame.common.wordsMgr.playClassicWords(type, callback);
  8046. }
  8047. else {
  8048. Laya.timer.once(300, this, () => {
  8049. callback && callback();
  8050. });
  8051. }
  8052. }
  8053. getClassicWordsType() {
  8054. let d2world = xGame.common.d2World;
  8055. let type = -1;
  8056. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  8057. type = ClassicWordsType.perfectShow;
  8058. return type;
  8059. }
  8060. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  8061. type = ClassicWordsType.directShoot;
  8062. return type;
  8063. }
  8064. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  8065. type = ClassicWordsType.anotherShoot;
  8066. return type;
  8067. }
  8068. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  8069. type = ClassicWordsType.bigPower;
  8070. return type;
  8071. }
  8072. let minSpeed = 1;
  8073. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  8074. type = ClassicWordsType.hardShoot;
  8075. return type;
  8076. }
  8077. if (this.inHoleBalls.length > 0) {
  8078. type = ClassicWordsType.directShoot;
  8079. return type;
  8080. }
  8081. return type;
  8082. }
  8083. checkBigSkillWords(callback) {
  8084. if (this.curFoul == FoulType.timeOut) {
  8085. callback && callback();
  8086. }
  8087. else {
  8088. let playSkill = false;
  8089. if (this.selfTurn) {
  8090. playSkill = true;
  8091. }
  8092. else {
  8093. if (!this.aiPlayedBreakArmy) {
  8094. this.aiPlayedBreakArmy = true;
  8095. playSkill = true;
  8096. }
  8097. if (this.aiCurSkill != SkillType.breakArmy) {
  8098. playSkill = true;
  8099. }
  8100. }
  8101. if (xGame.common.skillMgr.playedLastSkill) {
  8102. xGame.common.skillMgr.playedLastSkill = false;
  8103. playSkill = false;
  8104. }
  8105. if (playSkill) {
  8106. xGame.common.skillMgr.runBigSkill((extraScore) => {
  8107. let selfExtra = 0;
  8108. let aiExtra = 0;
  8109. if (this.selfTurn)
  8110. selfExtra += extraScore;
  8111. else
  8112. aiExtra += extraScore;
  8113. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  8114. this.isEnd = true;
  8115. }
  8116. this.playBigSkillTimes(callback);
  8117. });
  8118. }
  8119. else {
  8120. this.playBigSkillTimes(callback);
  8121. }
  8122. }
  8123. }
  8124. playBigSkillTimes(callback) {
  8125. let length = this.inHoleBalls.length;
  8126. if (this.inHoleBalls.indexOf(0) > -1) {
  8127. length = this.inHoleBalls.length - 1;
  8128. }
  8129. if (length <= 0) {
  8130. callback && callback();
  8131. return;
  8132. }
  8133. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  8134. callback && callback();
  8135. });
  8136. }
  8137. playSkillTips() {
  8138. let levelNum = 0;
  8139. let curType;
  8140. if (this.selfTurn) {
  8141. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  8142. curType = this.selfCurSkill;
  8143. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8144. levelNum += 5;
  8145. }
  8146. }
  8147. else {
  8148. levelNum = this.aiSkillLevelNum;
  8149. curType = this.aiCurSkill;
  8150. }
  8151. let str = ``;
  8152. switch (curType) {
  8153. case SkillType.highSpace:
  8154. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8155. break;
  8156. case SkillType.breakArmy:
  8157. str = `You pocketed ${levelNum} extra balls`;
  8158. break;
  8159. case SkillType.ice:
  8160. str = `${levelNum * 2} extra balls were frozen`;
  8161. break;
  8162. case SkillType.fireworks:
  8163. str = `${levelNum} extra balls exploded `;
  8164. break;
  8165. case SkillType.GuanYu:
  8166. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8167. break;
  8168. default:
  8169. break;
  8170. }
  8171. xGame.uiMgr.Show(UIMsg, str);
  8172. }
  8173. getFoulType() {
  8174. let foulType = "";
  8175. if (this.firstColliObj == null) {
  8176. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8177. return FoulType.rootHole;
  8178. }
  8179. return FoulType.notTouch;
  8180. }
  8181. else {
  8182. if (this.selfTurn) {
  8183. if (this.selfBallArr.length > 0) {
  8184. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8185. foulType = FoulType.wrongTouch;
  8186. }
  8187. }
  8188. else {
  8189. if (this.ensureBallType) {
  8190. }
  8191. else {
  8192. if (this.firstColliObj == this.blackNum) {
  8193. foulType = FoulType.wrongTouch;
  8194. }
  8195. }
  8196. }
  8197. }
  8198. else {
  8199. if (this.aiBallArr.length > 0) {
  8200. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8201. foulType = FoulType.wrongTouch;
  8202. }
  8203. }
  8204. else {
  8205. if (this.ensureBallType) {
  8206. }
  8207. else {
  8208. if (this.firstColliObj == this.blackNum) {
  8209. foulType = FoulType.wrongTouch;
  8210. }
  8211. }
  8212. }
  8213. }
  8214. if (this.inHoleBalls.length <= 0) {
  8215. return foulType;
  8216. }
  8217. let temp;
  8218. if (this.inHoleBalls.indexOf(0) > -1) {
  8219. foulType = FoulType.rootHole;
  8220. }
  8221. else {
  8222. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8223. temp = this.inHoleBalls[index];
  8224. if (this.selfTurn) {
  8225. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8226. foulType = FoulType.wrongHole;
  8227. break;
  8228. }
  8229. }
  8230. else {
  8231. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8232. foulType = FoulType.wrongHole;
  8233. break;
  8234. }
  8235. }
  8236. }
  8237. }
  8238. let foo;
  8239. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8240. temp = this.inHoleBalls[index];
  8241. foo = this.selfBallArr.indexOf(temp);
  8242. if (foo > -1) {
  8243. this.selfBallArr.splice(foo, 1);
  8244. }
  8245. foo = this.aiBallArr.indexOf(temp);
  8246. if (foo > -1) {
  8247. this.aiBallArr.splice(foo, 1);
  8248. }
  8249. }
  8250. this.updateLeftBall();
  8251. }
  8252. return foulType;
  8253. }
  8254. judgeGameEndByBlack(arr) {
  8255. if (this.selfTurn) {
  8256. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8257. this.selfFoulNum = this.maxFoulTimes;
  8258. return true;
  8259. }
  8260. }
  8261. else {
  8262. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8263. this.aiFoulNum = this.maxFoulTimes;
  8264. return true;
  8265. }
  8266. }
  8267. }
  8268. judgeClassic(type) {
  8269. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8270. xGame.common.aiPlayer.stopRun();
  8271. if (this.judgeNormalSuccess()) {
  8272. this.isEnd = true;
  8273. return;
  8274. }
  8275. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8276. if (this.selfTurn) {
  8277. if (isFoul) {
  8278. this.selfFoulNum++;
  8279. }
  8280. if (this.selfFoulNum >= this.maxFoulTimes) {
  8281. this.success = false;
  8282. this.isEnd = true;
  8283. return;
  8284. }
  8285. }
  8286. else {
  8287. if (isFoul)
  8288. this.aiFoulNum++;
  8289. if (this.aiFoulNum >= this.maxFoulTimes) {
  8290. this.success = true;
  8291. this.isEnd = true;
  8292. return;
  8293. }
  8294. }
  8295. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8296. this.isChangeTurn = false;
  8297. }
  8298. else {
  8299. this.isInterrupt = true;
  8300. }
  8301. }
  8302. waitShoot() {
  8303. if (xGame.common.gameMode == GameMode.classic) {
  8304. switch (this.curFoul) {
  8305. case FoulType.timeOut:
  8306. case FoulType.rootHole:
  8307. this.selfTurn = !this.selfTurn;
  8308. this.peoplePlay(5, 6, true);
  8309. break;
  8310. case FoulType.notTouch:
  8311. this.selfTurn = !this.selfTurn;
  8312. this.peoplePlay(7, 7);
  8313. break;
  8314. case FoulType.wrongHole:
  8315. this.selfTurn = !this.selfTurn;
  8316. this.peoplePlay(11, 11);
  8317. break;
  8318. default:
  8319. if (this.inHoleBalls.length > 0) {
  8320. this.peoplePlay(0, 0, false, false);
  8321. }
  8322. else {
  8323. this.selfTurn = !this.selfTurn;
  8324. this.peoplePlay(7, 7);
  8325. }
  8326. break;
  8327. }
  8328. }
  8329. else if (xGame.common.gameMode == GameMode.bigMove) {
  8330. if (this.curFoul == FoulType.timeOut) {
  8331. this.selfTurn = !this.selfTurn;
  8332. this.peoplePlay(14, 15);
  8333. this.placeRootBall();
  8334. }
  8335. else {
  8336. this.selfTurn = !this.selfTurn;
  8337. if (this.curFoul == FoulType.rootHole) {
  8338. this.peoplePlay(12, 13);
  8339. this.placeRootBall();
  8340. }
  8341. else {
  8342. this.peoplePlay(0, 0, false, false);
  8343. }
  8344. }
  8345. }
  8346. else if (xGame.common.gameMode == GameMode.placeBall) {
  8347. this.finishOneShoot = true;
  8348. }
  8349. this.gameResult();
  8350. }
  8351. gameResult() {
  8352. this.firstColliObj = null;
  8353. this.inHoleBalls = [];
  8354. let curX = xGame.common.d2World.rootBall.gameObj.x;
  8355. let curY = xGame.common.d2World.rootBall.gameObj.y;
  8356. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  8357. if (xGame.common.uiRodMethod)
  8358. xGame.common.uiRodMethod.resetRod();
  8359. xGame.common.d2World.rootBall.showSelf();
  8360. this.clearIceSkill();
  8361. if (this.selfTurn) {
  8362. console.log("zh:处理一杆结束后的逻辑 gameResult");
  8363. PlatMgr.gameInsert();
  8364. }
  8365. xGame.common.d3World.knifeRoot.destroyChildren();
  8366. if (this.selfTurn) {
  8367. xGame.common.gameUI.showHelpLineGuide();
  8368. xGame.common.gameUI.setTurnAlpha(true);
  8369. }
  8370. else {
  8371. xGame.common.gameUI.setTurnAlpha(false);
  8372. }
  8373. }
  8374. getScore(type) {
  8375. let selfAdd = 0;
  8376. let aiAdd = 0;
  8377. if (type == FoulType.timeOut) {
  8378. if (this.selfTurn)
  8379. aiAdd += 3;
  8380. else
  8381. selfAdd += 3;
  8382. }
  8383. else {
  8384. if (this.inHoleBalls.length > 0) {
  8385. if (this.selfTurn) {
  8386. if (type == FoulType.rootHole) {
  8387. aiAdd += 3;
  8388. if (this.inHoleBalls.length - 1 > 0) {
  8389. selfAdd += this.inHoleBalls.length - 1;
  8390. }
  8391. }
  8392. else {
  8393. selfAdd += this.inHoleBalls.length;
  8394. }
  8395. }
  8396. else {
  8397. if (type == FoulType.rootHole) {
  8398. selfAdd += 3;
  8399. if (this.inHoleBalls.length - 1 > 0) {
  8400. aiAdd += this.inHoleBalls.length - 1;
  8401. }
  8402. }
  8403. else {
  8404. aiAdd += this.inHoleBalls.length;
  8405. }
  8406. }
  8407. }
  8408. }
  8409. return [selfAdd, aiAdd];
  8410. }
  8411. judgeScoreEnd(selfAdd, aiAdd) {
  8412. this.selfScore += selfAdd;
  8413. this.aiScore += aiAdd;
  8414. this.updateAIScore();
  8415. this.updateSelfScore();
  8416. if (this.selfScore >= this.targertScore) {
  8417. this.success = true;
  8418. return true;
  8419. }
  8420. if (this.aiScore >= this.targertScore) {
  8421. this.success = false;
  8422. return true;
  8423. }
  8424. let ballArr = xGame.common.d2World.ballArr;
  8425. if (ballArr.length == 1 && ballArr[0].number == 0) {
  8426. if (this.selfScore > this.aiScore) {
  8427. this.success = true;
  8428. return true;
  8429. }
  8430. else if (this.selfScore < this.aiScore) {
  8431. this.success = false;
  8432. return true;
  8433. }
  8434. else {
  8435. if (this.selfTurn) {
  8436. this.success = false;
  8437. }
  8438. else {
  8439. this.success = true;
  8440. }
  8441. return true;
  8442. }
  8443. }
  8444. }
  8445. clearIceSkill() {
  8446. let arr = xGame.common.d2World.ballArr;
  8447. let temp;
  8448. if (this.selfTurn) {
  8449. if (this.selfCurSkill == SkillType.ice) {
  8450. for (let index = 0; index < arr.length; index++) {
  8451. temp = arr[index];
  8452. if (temp.ballFunc == "ice") {
  8453. temp.setBallFunc("normal", "self");
  8454. }
  8455. }
  8456. }
  8457. }
  8458. else {
  8459. if (this.aiCurSkill == SkillType.ice) {
  8460. for (let index = 0; index < arr.length; index++) {
  8461. temp = arr[index];
  8462. if (temp.ballFunc == "ice") {
  8463. temp.setBallFunc("normal", "ai");
  8464. }
  8465. }
  8466. }
  8467. }
  8468. }
  8469. judgeNormalSuccess() {
  8470. if (this.selfTurn) {
  8471. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8472. this.success = true;
  8473. return true;
  8474. }
  8475. }
  8476. else {
  8477. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8478. this.success = false;
  8479. return true;
  8480. }
  8481. }
  8482. }
  8483. gameEnd() {
  8484. if (Moyu.isTT) {
  8485. xGame.common.screenImg = getScreenImg();
  8486. }
  8487. console.log("游戏结束", this.success);
  8488. xGame.common.aiPlayer.stopRun();
  8489. if (xGame.common.gameMode == GameMode.placeBall) {
  8490. this.getEndStarNum();
  8491. this.updatePlaceBallState();
  8492. }
  8493. this.isEnter = false;
  8494. Moyu.recordEnd(this, () => {
  8495. if (this.isEnter)
  8496. return;
  8497. this.isEnter = true;
  8498. console.log("进入录结束回调");
  8499. this.enterNext();
  8500. });
  8501. Laya.timer.once(1000, this, () => {
  8502. if (this.isEnter)
  8503. return;
  8504. this.isEnter = true;
  8505. this.enterNext();
  8506. });
  8507. xGame.common.longHelpLine = false;
  8508. }
  8509. enterNext() {
  8510. Laya.timer.clearAll(this);
  8511. if (Moyu.canShare() > 100 || Moyu.isKs) {
  8512. xGame.uiMgr.Show(UIVideoShare, this.success);
  8513. }
  8514. else {
  8515. xGame.uiMgr.Show(UIGameEnd, this.success);
  8516. }
  8517. }
  8518. aiLeave() {
  8519. let ui = xGame.common.gameUI.ui;
  8520. ui.topNode.aiNameTxt.text = "offline";
  8521. }
  8522. aiGameEnd(suc) {
  8523. this.success = suc;
  8524. xGame.common.aiPlayer.stopRun();
  8525. if (this.success) {
  8526. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  8527. Laya.timer.once(1000, this, () => {
  8528. this.clearTime();
  8529. this.gameEnd();
  8530. });
  8531. }
  8532. }
  8533. openTimer() {
  8534. let src = xGame.common.gameUI;
  8535. if (this.selfTurn) {
  8536. src.ui.topNode.selfProgress.visible = true;
  8537. src.ui.topNode.aiProgress.visible = false;
  8538. this.curTimer = src.ui.topNode.selfProgress;
  8539. }
  8540. else {
  8541. src.ui.topNode.selfProgress.visible = false;
  8542. src.ui.topNode.aiProgress.visible = true;
  8543. this.curTimer = src.ui.topNode.aiProgress;
  8544. }
  8545. this.accTime = 0;
  8546. Laya.timer.clearAll(this);
  8547. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  8548. this.curTimer.value = 100;
  8549. }
  8550. updateTime(dt) {
  8551. if (this.gamePause)
  8552. return;
  8553. this.accTime += dt;
  8554. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8555. if (this.accTime >= this.setTime) {
  8556. this.clearTime();
  8557. console.log("时钟进入了gameRun");
  8558. this.gameRun(FoulType.timeOut);
  8559. }
  8560. }
  8561. clearTime() {
  8562. let src = xGame.common.gameUI;
  8563. src.ui.topNode.selfProgress.visible = false;
  8564. src.ui.topNode.aiProgress.visible = false;
  8565. Laya.timer.clearAll(this);
  8566. }
  8567. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8568. let ui = xGame.common.gameUI.ui;
  8569. let selfMsg, aiMsg;
  8570. if (sayWords) {
  8571. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8572. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8573. if (Foul) {
  8574. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8575. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8576. this.placeRootBall();
  8577. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8578. if (this.curFoul == FoulType.rootHole) {
  8579. if (!DataMgr.getRootBallFoul()) {
  8580. DataMgr.setRootBallFoul();
  8581. aiMsg = "";
  8582. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8583. let woman = "Boss, pay attention next time~";
  8584. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8585. }
  8586. }
  8587. else if (this.curFoul == FoulType.timeOut) {
  8588. if (!DataMgr.getTimeoutFoul()) {
  8589. DataMgr.setTimeoutFoul();
  8590. aiMsg = "";
  8591. let tips = "Game timeout, 3 fouls, this game failed.";
  8592. let woman = "Boss, pay attention to the timeline~";
  8593. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8594. }
  8595. }
  8596. }
  8597. }
  8598. }
  8599. if (this.selfTurn) {
  8600. if (sayWords) {
  8601. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8602. ui.selfTurn.visible = true;
  8603. ui.aiTurn.visible = false;
  8604. ui.selfTurn.t0.play();
  8605. Moyu.vibration();
  8606. });
  8607. }
  8608. }
  8609. else {
  8610. let aiNum = xGame.tools.random(1, 11);
  8611. let challengeNum = DataMgr.getChallengeTimes();
  8612. let delay = false;
  8613. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8614. aiNum = 9;
  8615. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8616. aiNum = 3;
  8617. if (challengeNum == 3) {
  8618. if (!this.showLongView) {
  8619. this.showLongView = true;
  8620. delay = true;
  8621. }
  8622. }
  8623. }
  8624. }
  8625. if (delay) {
  8626. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8627. if (success) {
  8628. xGame.common.longHelpLine = true;
  8629. xGame.common.d2World.getHelpLine();
  8630. }
  8631. else {
  8632. aiNum = 10;
  8633. }
  8634. xGame.common.aiPlayer.setAiLevel(aiNum);
  8635. if (sayWords) {
  8636. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8637. xGame.common.aiPlayer.runAI();
  8638. ui.selfTurn.visible = false;
  8639. ui.aiTurn.visible = true;
  8640. ui.aiTurn.t0.play();
  8641. });
  8642. }
  8643. else {
  8644. xGame.common.aiPlayer.runAI();
  8645. }
  8646. this.openTimer();
  8647. this.finishOneShoot = true;
  8648. if (this.selfTurn) {
  8649. ui.topNode.selfKuang.visible = true;
  8650. ui.topNode.aiKuang.visible = false;
  8651. ui.topNode.selfTips.visible = true;
  8652. ui.topNode.aiTips.visible = false;
  8653. }
  8654. else {
  8655. ui.topNode.selfKuang.visible = false;
  8656. ui.topNode.aiKuang.visible = true;
  8657. ui.topNode.selfTips.visible = false;
  8658. ui.topNode.aiTips.visible = true;
  8659. }
  8660. });
  8661. return;
  8662. }
  8663. if (xGame.common.gameMode == GameMode.classic) {
  8664. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8665. if (cfg) {
  8666. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8667. aiNum = aiLevel;
  8668. }
  8669. }
  8670. xGame.common.aiPlayer.setAiLevel(aiNum);
  8671. if (sayWords) {
  8672. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8673. xGame.common.aiPlayer.runAI();
  8674. ui.selfTurn.visible = false;
  8675. ui.aiTurn.visible = true;
  8676. ui.aiTurn.t0.play();
  8677. });
  8678. }
  8679. else {
  8680. xGame.common.aiPlayer.runAI();
  8681. }
  8682. }
  8683. this.openTimer();
  8684. this.finishOneShoot = true;
  8685. if (this.selfTurn) {
  8686. ui.topNode.selfKuang.visible = true;
  8687. ui.topNode.aiKuang.visible = false;
  8688. ui.topNode.selfTips.visible = true;
  8689. ui.topNode.aiTips.visible = false;
  8690. }
  8691. else {
  8692. ui.topNode.selfKuang.visible = false;
  8693. ui.topNode.aiKuang.visible = true;
  8694. ui.topNode.selfTips.visible = false;
  8695. ui.topNode.aiTips.visible = true;
  8696. }
  8697. }
  8698. placeRootBall() {
  8699. let rootBall = xGame.common.d2World.rootBall;
  8700. if (!rootBall)
  8701. return;
  8702. rootBall.gameObj.x = this.lastRootBallPos.x;
  8703. rootBall.gameObj.y = this.lastRootBallPos.y;
  8704. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8705. let moveNode = xGame.common.gameUI.ui.moveNode;
  8706. moveNode.visible = true;
  8707. moveNode.x = this.lastRootBallPos.x;
  8708. moveNode.y = this.lastRootBallPos.y;
  8709. if (!this.selfTurn) {
  8710. xGame.common.aiPlayer.resetRoot();
  8711. }
  8712. }
  8713. }
  8714. class ui_guanyuAni extends fgui.GComponent {
  8715. static createInstance() {
  8716. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8717. }
  8718. onConstruct() {
  8719. this.n0 = (this.getChild("n0"));
  8720. }
  8721. }
  8722. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8723. class UIFireworks extends UIBase {
  8724. constructor() {
  8725. super();
  8726. }
  8727. onConstructor() {
  8728. this.isEject = false;
  8729. }
  8730. show(callback) {
  8731. super.show();
  8732. }
  8733. }
  8734. UIFireworks.uiName = "UIFireworks";
  8735. class ui_UIGuanYu extends fgui.GComponent {
  8736. static createInstance() {
  8737. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8738. }
  8739. onConstruct() {
  8740. this.n2 = (this.getChild("n2"));
  8741. this.n1 = (this.getChild("n1"));
  8742. this.n3 = (this.getChild("n3"));
  8743. this.n4 = (this.getChild("n4"));
  8744. this.n5 = (this.getChild("n5"));
  8745. this.n6 = (this.getChild("n6"));
  8746. this.n8 = (this.getChild("n8"));
  8747. this.n7 = (this.getChild("n7"));
  8748. this.t0 = this.getTransition("t0");
  8749. }
  8750. }
  8751. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8752. class UIGuanYu extends UIBase {
  8753. constructor() {
  8754. super();
  8755. }
  8756. onConstructor() {
  8757. this.ui = ui_UIGuanYu.createInstance();
  8758. this.contentPane = this.ui;
  8759. this.isEject = false;
  8760. }
  8761. show(callback) {
  8762. super.show();
  8763. this.ui.t0.play(Laya.Handler.create(this, () => {
  8764. callback && callback();
  8765. this.hide();
  8766. }));
  8767. }
  8768. }
  8769. UIGuanYu.uiName = "UIGuanYu";
  8770. class SkillMgr {
  8771. constructor() {
  8772. this.leveNum = 0;
  8773. this.extraScore = 0;
  8774. this.selfTurn = false;
  8775. this.playedLastSkill = false;
  8776. this.tweenArr = [];
  8777. this._finishNum = 0;
  8778. this._curFinish = 0;
  8779. this._rootX = 0;
  8780. this._rootY = 0;
  8781. this.knifeTimes = 0;
  8782. this.knifeV2 = new Laya.Vector2();
  8783. this.knifeV3 = new Laya.Vector3();
  8784. this.rtStarX = 0;
  8785. this.rtStarY = 0;
  8786. this.addBigSkillSpine();
  8787. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8788. }
  8789. addBigSkillSpine() {
  8790. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8791. console.log("extra2 success");
  8792. });
  8793. }
  8794. runBigSkill(callback) {
  8795. this.tweenArr = [];
  8796. this.callback = callback;
  8797. this.judgeSkill();
  8798. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8799. let guide = DataMgr.getSkillGuide();
  8800. if (!xGame.common.gameMgr.selfTurn) {
  8801. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8802. }
  8803. else {
  8804. if (xGame.common.temSelfLevel != 0) {
  8805. this.leveNum = xGame.common.temSelfLevel;
  8806. }
  8807. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8808. this.leveNum += 5;
  8809. }
  8810. }
  8811. if (guide == 0) {
  8812. DataMgr.setSkillGuide(1);
  8813. if (DataMgr.getNewUser()) {
  8814. Moyu.sendDataEvent("gameFirstPlay");
  8815. DataMgr.setNewUser();
  8816. }
  8817. }
  8818. this.playSpineAni(() => {
  8819. switch (this.curSkill) {
  8820. case SkillType.highSpace:
  8821. this.runHighSpace();
  8822. break;
  8823. case SkillType.breakArmy:
  8824. this.runBreakArmy();
  8825. break;
  8826. case SkillType.ice:
  8827. this.runIce();
  8828. break;
  8829. case SkillType.fireworks:
  8830. this.runFireworks();
  8831. break;
  8832. case SkillType.GuanYu:
  8833. this.runGuanYu();
  8834. break;
  8835. default:
  8836. break;
  8837. }
  8838. });
  8839. }
  8840. judgeSkill() {
  8841. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8842. let gameMgr = xGame.common.gameMgr;
  8843. let type;
  8844. for (let index = 0; index < typeArr.length; index++) {
  8845. type = typeArr[index];
  8846. if (gameMgr.selfTurn) {
  8847. if (gameMgr.selfCurSkill == type) {
  8848. this.selfTurn = true;
  8849. this.curSkill = type;
  8850. return;
  8851. }
  8852. }
  8853. else {
  8854. if (gameMgr.aiCurSkill == type) {
  8855. this.selfTurn = false;
  8856. this.curSkill = type;
  8857. return;
  8858. }
  8859. }
  8860. }
  8861. }
  8862. playSpineAni(callback) {
  8863. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8864. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8865. parent.destroyChildren();
  8866. let aniIndex = 0;
  8867. let skillSpine;
  8868. switch (this.curSkill) {
  8869. case SkillType.highSpace:
  8870. aniIndex = 1;
  8871. xGame.soundMgr.playSound("skill01");
  8872. skillSpine = this.skillSpine2;
  8873. data.scaleX = 0.5;
  8874. data.scaleY = 0.5;
  8875. skillSpine.play(data, 1, false, parent, () => {
  8876. callback && callback();
  8877. });
  8878. break;
  8879. case SkillType.breakArmy:
  8880. aniIndex = 2;
  8881. xGame.soundMgr.playSound("skill02");
  8882. skillSpine = this.skillSpine2;
  8883. data.scaleX = 0.5;
  8884. data.scaleY = 0.5;
  8885. skillSpine.play(data, 2, false, parent, () => {
  8886. callback && callback();
  8887. });
  8888. break;
  8889. case SkillType.ice:
  8890. aniIndex = 0;
  8891. xGame.soundMgr.playSound("skill03");
  8892. skillSpine = this.skillSpine2;
  8893. data.scaleX = 0.5;
  8894. data.scaleY = 0.5;
  8895. skillSpine.play(data, 0, false, parent, () => {
  8896. callback && callback();
  8897. });
  8898. break;
  8899. case SkillType.fireworks:
  8900. xGame.soundMgr.playSound("skill_04_01");
  8901. xGame.soundMgr.playSound("skill04");
  8902. xGame.uiMgr.Show(UIFireworks, callback);
  8903. break;
  8904. case SkillType.GuanYu:
  8905. xGame.soundMgr.playSound("skill05_1");
  8906. xGame.soundMgr.playSound("skill05");
  8907. xGame.uiMgr.Show(UIGuanYu, callback);
  8908. break;
  8909. default:
  8910. break;
  8911. }
  8912. }
  8913. getAllBallArr() {
  8914. let arr = xGame.common.d2World.ballArr;
  8915. let outArr = [];
  8916. for (let index = 0; index < arr.length; index++) {
  8917. if (arr[index] instanceof D2RootBallSrc)
  8918. continue;
  8919. if (arr[index].ballFunc == "ice")
  8920. continue;
  8921. if (arr[index].destroyed)
  8922. continue;
  8923. outArr.push(arr[index]);
  8924. }
  8925. return outArr;
  8926. }
  8927. getOneArr(deletObj) {
  8928. let allArr = this.getAllBallArr();
  8929. let temp;
  8930. for (let index = 0; index < allArr.length; index++) {
  8931. temp = allArr[index];
  8932. if (temp.id == deletObj.id) {
  8933. allArr.splice(index, 1);
  8934. break;
  8935. }
  8936. }
  8937. return allArr;
  8938. }
  8939. getNearBallBag(ball) {
  8940. let ui = xGame.common.gameUI.ui;
  8941. let circleArr = [];
  8942. for (let index = 1; index <= 6; index++) {
  8943. circleArr.push(ui.border["circle" + index]);
  8944. }
  8945. let outIndex = 0;
  8946. let temp;
  8947. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8948. ;
  8949. let dis = 0;
  8950. for (let index = 1; index < circleArr.length; index++) {
  8951. temp = circleArr[index];
  8952. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8953. if (dis < min) {
  8954. min = dis;
  8955. outIndex = index;
  8956. }
  8957. }
  8958. return [circleArr[outIndex], outIndex];
  8959. }
  8960. ballFlyToBag(ballArr, time = 300) {
  8961. let temp;
  8962. let hole;
  8963. this._finishNum = ballArr.length;
  8964. this._curFinish = 0;
  8965. let holeObj = {};
  8966. let holeCfg = {
  8967. "1": 0,
  8968. "2": 0,
  8969. "3": 0,
  8970. "4": 0,
  8971. "5": 0,
  8972. "6": 0
  8973. };
  8974. for (let index = 0; index < ballArr.length; index++) {
  8975. temp = ballArr[index];
  8976. temp.outColli.isSensor = true;
  8977. temp.innerColli.isSensor = true;
  8978. temp.isRunSkillAni = true;
  8979. let holeArr = this.getNearBallBag(temp);
  8980. hole = holeArr[0];
  8981. holeObj[index] = holeArr[1];
  8982. temp.d3BallSrc.scaleXYZ = 0.5;
  8983. this.tweenArr.push(temp.d3BallSrc, temp);
  8984. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8985. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8986. }));
  8987. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8988. let mIndex = holeObj[this._curFinish];
  8989. let isDone = holeCfg[mIndex];
  8990. if (isDone) {
  8991. ballArr[this._curFinish].checkWrongBall(false);
  8992. }
  8993. else {
  8994. holeCfg[mIndex] = 1;
  8995. ballArr[this._curFinish].checkWrongBall();
  8996. }
  8997. this._curFinish++;
  8998. if (this._curFinish >= this._finishNum) {
  8999. if (this.curSkill == SkillType.highSpace) {
  9000. }
  9001. else if (this.curSkill == SkillType.breakArmy) {
  9002. let rootBall = xGame.common.d2World.rootBall;
  9003. rootBall.gameObj.x = this._rootX;
  9004. rootBall.gameObj.y = this._rootY;
  9005. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9006. xGame.common.d2World.d2Gan.ui.visible = true;
  9007. xGame.common.d2World.d2HelpLine.ui.visible = true;
  9008. xGame.common.d2World.getHelpLine();
  9009. this.callback && this.callback(this.extraScore);
  9010. }
  9011. }
  9012. }));
  9013. }
  9014. }
  9015. runHighSpace() {
  9016. let rootBall = xGame.common.d2World.rootBall;
  9017. rootBall.showSelf();
  9018. let d3Src = rootBall.d3BallSrc;
  9019. let allArr = this.getAllBallArr();
  9020. if (allArr.length <= 0) {
  9021. this.callback && this.callback(0);
  9022. return;
  9023. }
  9024. let selectBall = xGame.common.d2World.targetBall;
  9025. let wrong = selectBall && selectBall.destroyed;
  9026. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  9027. selectBall = xGame.common.getRandArrEle(allArr);
  9028. }
  9029. let targetD3Src = selectBall.d3BallSrc;
  9030. xGame.common.d2World.d2Gan.ui.visible = false;
  9031. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9032. d3Src.scaleXYZ = 0.5;
  9033. this.tweenArr.push(d3Src);
  9034. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9035. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9036. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  9037. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  9038. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  9039. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  9040. let outArr = [selectBall];
  9041. let other = this.leveNum - 1;
  9042. if (other > 0) {
  9043. let nearArr = this.getOneArr(selectBall);
  9044. if (nearArr.length > 0) {
  9045. xGame.common.botherArr(nearArr);
  9046. if (other >= nearArr.length)
  9047. other = nearArr.length;
  9048. for (let index = 0; index < other; index++) {
  9049. outArr.push(nearArr[index]);
  9050. }
  9051. }
  9052. }
  9053. xGame.common.extraMoveNum = other + 1;
  9054. this.extraScore = other + 1;
  9055. this._rootX = selectBall.gameObj.x;
  9056. this._rootY = selectBall.gameObj.y;
  9057. rootBall.gameObj.x = this._rootX;
  9058. rootBall.gameObj.y = this._rootY;
  9059. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9060. Laya.Tween.clearAll(d3Src);
  9061. this.addRandomForce(outArr);
  9062. }));
  9063. }));
  9064. }
  9065. addRandomForce(outArr) {
  9066. if (outArr.length > 0) {
  9067. xGame.common.d2World.openCheckStill = true;
  9068. this.playedLastSkill = true;
  9069. }
  9070. let temp;
  9071. for (let index = 0; index < outArr.length; index++) {
  9072. let angle = xGame.common.randomNum(0, 360);
  9073. let linearPercent = xGame.common.randomNum(65, 100);
  9074. temp = outArr[index];
  9075. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  9076. }
  9077. }
  9078. setLinearSpeed(angle, rigy, linearPercent) {
  9079. let sin = Math.sin(angle * Math.PI / 180);
  9080. let cos = Math.cos(angle * Math.PI / 180);
  9081. let maxSpeed = 4;
  9082. let speed = new Laya.Vector2();
  9083. speed.x = maxSpeed * linearPercent * sin;
  9084. speed.y = -maxSpeed * linearPercent * cos;
  9085. rigy.applyLinearImpulseToCenter(speed);
  9086. }
  9087. runBreakArmy() {
  9088. xGame.common.d2World.d2Gan.ui.visible = false;
  9089. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9090. let gameUI = xGame.common.gameUI.ui;
  9091. gameUI.skillRod.visible = true;
  9092. gameUI.skillRod.rotation = 110;
  9093. let outArr = this.getAllBallArr();
  9094. if (outArr.length <= 0) {
  9095. gameUI.skillRod.visible = false;
  9096. this.callback && this.callback(0);
  9097. return;
  9098. }
  9099. xGame.common.botherArr(outArr);
  9100. if (this.leveNum >= outArr.length)
  9101. this.leveNum = outArr.length;
  9102. let deleteNum = outArr.length - this.leveNum;
  9103. outArr.splice(0, deleteNum);
  9104. this.extraScore = this.leveNum;
  9105. let potX = gameUI.skillRod.x;
  9106. let potY = gameUI.skillRod.y;
  9107. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  9108. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  9109. let disArr = [];
  9110. for (let index = 0; index < outArr.length; index++) {
  9111. let obj = outArr[index];
  9112. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  9113. dis = Math.pow(dis, 0.5);
  9114. disArr.push(dis);
  9115. }
  9116. this.tweenArr.push(gameUI.skillRod);
  9117. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9118. })).update = Laya.Handler.create(this, (e, t, c) => {
  9119. let angle = gameUI.skillRod.rotation;
  9120. let xx;
  9121. let yy;
  9122. let temp;
  9123. for (let index = 0; index < outArr.length; index++) {
  9124. temp = outArr[index];
  9125. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  9126. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  9127. yy -= 20;
  9128. temp.gameObj.x = xx;
  9129. temp.gameObj.y = yy;
  9130. temp.d3BallSrc.setTransPos(xx, yy);
  9131. }
  9132. if (angle <= 60) {
  9133. Laya.Tween.clearAll(gameUI.skillRod);
  9134. this.ballFlyToBag(outArr, 150);
  9135. gameUI.skillRod.visible = false;
  9136. }
  9137. }, null, false);
  9138. }
  9139. runIce() {
  9140. let ballArr = xGame.common.d2World.ballArr;
  9141. this.leveNum *= 2;
  9142. if (this.leveNum >= ballArr.length - 1)
  9143. this.leveNum = ballArr.length - 1;
  9144. let tempArr = [];
  9145. let outArr = [];
  9146. for (let index = 0; index < ballArr.length; index++) {
  9147. if (ballArr[index] instanceof D2RootBallSrc)
  9148. continue;
  9149. tempArr.push(ballArr[index]);
  9150. }
  9151. if (tempArr.length <= 0) {
  9152. this.callback && this.callback(0);
  9153. return;
  9154. }
  9155. xGame.common.botherArr(tempArr);
  9156. for (let index = 0; index < this.leveNum; index++) {
  9157. outArr.push(tempArr[index]);
  9158. }
  9159. this.extraScore = this.leveNum;
  9160. let temp;
  9161. for (let index = 0; index < outArr.length; index++) {
  9162. temp = outArr[index];
  9163. temp.d3BallSrc.playIceEft();
  9164. }
  9165. Laya.timer.once(2000, this, () => {
  9166. for (let index = 0; index < outArr.length; index++) {
  9167. temp = outArr[index];
  9168. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9169. temp.setBallFunc("ice", str);
  9170. }
  9171. this.callback && this.callback(0);
  9172. });
  9173. }
  9174. runFireworks() {
  9175. let allArr = this.getAllBallArr();
  9176. if (allArr.length <= 0) {
  9177. this.callback && this.callback(0);
  9178. return;
  9179. }
  9180. xGame.common.d2World.d2Gan.ui.visible = false;
  9181. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9182. let outArr = [];
  9183. let other = this.leveNum;
  9184. if (other > 0) {
  9185. if (allArr.length > 0) {
  9186. xGame.common.botherArr(allArr);
  9187. if (other >= allArr.length)
  9188. other = allArr.length;
  9189. for (let index = 0; index < other; index++) {
  9190. outArr.push(allArr[index]);
  9191. }
  9192. }
  9193. }
  9194. xGame.common.extraMoveNum = other;
  9195. this.extraScore = other;
  9196. this.addRandmomFireworks(outArr);
  9197. }
  9198. addRandmomFireworks(outArr) {
  9199. Laya.timer.once(1100, this, () => {
  9200. if (outArr.length > 0) {
  9201. xGame.common.d2World.openCheckStill = true;
  9202. this.playedLastSkill = true;
  9203. }
  9204. });
  9205. xGame.soundMgr.playSound("skill_04_02");
  9206. let temp;
  9207. let delay = -200;
  9208. for (let index = 0; index < outArr.length; index++) {
  9209. temp = outArr[index];
  9210. delay += 200;
  9211. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9212. let angle = xGame.common.randomNum(0, 360);
  9213. angle = this.getFireworksAngle(obj);
  9214. let linearPercent = xGame.common.randomNum(45, 80);
  9215. if (!obj.destroyed)
  9216. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9217. });
  9218. }
  9219. }
  9220. getFireworksAngle(obj) {
  9221. let rootBall = xGame.common.d2World.rootBall;
  9222. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9223. }
  9224. resetGame() {
  9225. Laya.timer.clearAll(this);
  9226. if (this.tweenArr) {
  9227. for (let index = 0; index < this.tweenArr.length; index++) {
  9228. Laya.Tween.clearAll(this.tweenArr[index]);
  9229. }
  9230. }
  9231. this.tweenArr = null;
  9232. }
  9233. runGuanYu() {
  9234. xGame.common.d2World.d2Gan.ui.visible = false;
  9235. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9236. let rootBall = xGame.common.d2World.rootBall;
  9237. if (rootBall.isInHole) {
  9238. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9239. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9240. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9241. rootBall.showSelf();
  9242. }
  9243. this.rtStarX = rootBall.gameObj.x;
  9244. this.rtStarY = rootBall.gameObj.y;
  9245. this.knifeTimes = 0;
  9246. this.playedLastSkill = true;
  9247. rootBall.forceRun = true;
  9248. rootBall.rigy.type = "static";
  9249. xGame.common.d2World.openCheckStill = true;
  9250. this.guanyuRandomKnife();
  9251. }
  9252. guanyuRandomKnife() {
  9253. let rootBall = xGame.common.d2World.rootBall;
  9254. let dir = this.getRandDir();
  9255. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9256. console.log("当前angle", angle);
  9257. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9258. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9259. let dis = 324;
  9260. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9261. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9262. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9263. this.rtStarX = rootBall.gameObj.x;
  9264. this.rtStarY = rootBall.gameObj.y;
  9265. this.knifeTimes++;
  9266. let skillLevel;
  9267. if (xGame.common.gameMgr.selfTurn) {
  9268. skillLevel = DataMgr.getBigSkillByIndex(4);
  9269. }
  9270. else {
  9271. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9272. }
  9273. if (!skillLevel)
  9274. skillLevel = 1;
  9275. skillLevel += 2;
  9276. if (this.knifeTimes < skillLevel) {
  9277. Laya.timer.once(400, this, () => {
  9278. this.guanyuRandomKnife();
  9279. });
  9280. }
  9281. else {
  9282. rootBall.forceRun = false;
  9283. rootBall.rigy.type = "dynamic";
  9284. xGame.common.extraMoveNum = skillLevel;
  9285. }
  9286. }));
  9287. }
  9288. getRandDir() {
  9289. let rootBall = xGame.common.d2World.rootBall;
  9290. let allBall = this.getAllBallArr();
  9291. let target = xGame.common.getRandArrEle(allBall);
  9292. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9293. return this.knifeV2;
  9294. }
  9295. cloneKnife(x, y, rotation) {
  9296. let parent = xGame.common.d3World.knifeRoot;
  9297. let prefab = xGame.common.d3World.knife;
  9298. let clone = prefab.clone();
  9299. parent.addChild(clone);
  9300. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9301. clone.transform.localPositionX = this.knifeV3.x;
  9302. clone.transform.localPositionY = 0;
  9303. clone.transform.localPositionZ = this.knifeV3.z;
  9304. clone.transform.localRotationEulerX = 0;
  9305. clone.transform.localRotationEulerY = rotation;
  9306. clone.transform.localRotationEulerZ = 0;
  9307. clone.active = true;
  9308. return clone;
  9309. }
  9310. cloneGuanYuEft(x, y, angle) {
  9311. return;
  9312. let parent = xGame.common.gameUI.ui.guanyuNode;
  9313. let eft = new ui_guanyuAni();
  9314. eft.parent = parent;
  9315. eft.x = x;
  9316. eft.y = y;
  9317. eft.rotation = angle;
  9318. }
  9319. }
  9320. class ui_UIWordsList extends fgui.GComponent {
  9321. static createInstance() {
  9322. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9323. }
  9324. onConstruct() {
  9325. this.c1 = this.getController("c1");
  9326. this.n74 = (this.getChild("n74"));
  9327. this.clickNode = (this.getChild("clickNode"));
  9328. this.myNode = (this.getChild("myNode"));
  9329. this.n68 = (this.getChild("n68"));
  9330. this.n66 = (this.getChild("n66"));
  9331. this.n55 = (this.getChild("n55"));
  9332. this.wordsBtn = (this.getChild("wordsBtn"));
  9333. this.emotionBtn = (this.getChild("emotionBtn"));
  9334. this.mybggg = (this.getChild("mybggg"));
  9335. this.wordsList = (this.getChild("wordsList"));
  9336. this.emotionList = (this.getChild("emotionList"));
  9337. this.myRoot = (this.getChild("myRoot"));
  9338. }
  9339. }
  9340. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  9341. class EmotionDisplay {
  9342. constructor(index, ui) {
  9343. this.ui = ui;
  9344. this.index = index;
  9345. this.ui.onClick(this, this.clickSelf);
  9346. this.updateSelf();
  9347. }
  9348. updateSelf() {
  9349. let data = cfgTable.emotionData[this.index + 1];
  9350. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  9351. }
  9352. clickSelf() {
  9353. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9354. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  9355. xGame.common.talkMgr.closeTalkView();
  9356. }
  9357. }
  9358. class WordsDisplay {
  9359. constructor(index, ui) {
  9360. this.ui = ui;
  9361. this.index = index;
  9362. this.ui.onClick(this, this.clickSelf);
  9363. this.updateSelf();
  9364. }
  9365. updateSelf() {
  9366. let data = cfgTable.talkwordsData[this.index + 1];
  9367. this.ui.txt.text = data.msg;
  9368. }
  9369. clickSelf() {
  9370. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9371. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  9372. xGame.common.talkMgr.closeTalkView();
  9373. }
  9374. }
  9375. class UIWordsList extends UIBase {
  9376. constructor() {
  9377. super();
  9378. }
  9379. onConstructor() {
  9380. this.ui = ui_UIWordsList.createInstance();
  9381. this.contentPane = this.ui;
  9382. this.isEject = false;
  9383. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  9384. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  9385. this.addUIClick(this.ui.clickNode, this.hide);
  9386. this.initTalkList();
  9387. this.initEmotionList();
  9388. }
  9389. show() {
  9390. super.show();
  9391. }
  9392. initTalkList() {
  9393. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  9394. let data = cfgTable.talkwordsData;
  9395. let length = Object.keys(data).length;
  9396. this.ui.wordsList.numItems = length;
  9397. }
  9398. initEmotionList() {
  9399. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  9400. let data = cfgTable.emotionData;
  9401. let length = Object.keys(data).length;
  9402. this.ui.emotionList.numItems = length;
  9403. }
  9404. renderTalkItem(index, obj) {
  9405. let temp = new WordsDisplay(index, obj);
  9406. }
  9407. renderEmotionItem(index, obj) {
  9408. let temp = new EmotionDisplay(index, obj);
  9409. }
  9410. openTalkList() {
  9411. this.ui.c1.selectedIndex = 0;
  9412. }
  9413. openEmotionList() {
  9414. this.ui.c1.selectedIndex = 1;
  9415. }
  9416. }
  9417. UIWordsList.uiName = "UIWordsList";
  9418. class TalkMgr {
  9419. constructor() {
  9420. this.aiSpeak = true;
  9421. this.emotionList = [];
  9422. this.talkList = [];
  9423. this.addEvent();
  9424. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9425. this.emotionList = [];
  9426. this.talkList = [];
  9427. for (let k in cfgTable.emotionData) {
  9428. this.emotionList.push(cfgTable.emotionData[k].id);
  9429. }
  9430. for (let k in cfgTable.talkwordsData) {
  9431. this.talkList.push(cfgTable.talkwordsData[k].id);
  9432. }
  9433. }
  9434. addEvent() {
  9435. let ui = xGame.common.gameUI.ui;
  9436. ui.wordsBtn.visible = true;
  9437. ui.wordsBtn.onClick(this, this.openTalkView);
  9438. ui.aiWordsBtn.visible = true;
  9439. ui.aiWordsBtn.onClick(this, this.clickAIState);
  9440. }
  9441. openTalkView() {
  9442. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9443. xGame.uiMgr.Show(UIWordsList);
  9444. }
  9445. closeTalkView() {
  9446. xGame.uiMgr.Hide(UIWordsList);
  9447. }
  9448. clickAIState() {
  9449. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9450. this.aiSpeak = !this.aiSpeak;
  9451. this.changeAIState(this.aiSpeak);
  9452. }
  9453. changeAIState(speak) {
  9454. this.aiSpeak = speak;
  9455. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  9456. if (speak) {
  9457. btn.c1.selectedIndex = 0;
  9458. }
  9459. else {
  9460. btn.c1.selectedIndex = 1;
  9461. }
  9462. }
  9463. showSelfTalk(wordsId) {
  9464. let ui = xGame.common.gameUI.ui;
  9465. ui.selfTalk.visible = true;
  9466. ui.selfTalk.myNode.c1.selectedIndex = 1;
  9467. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9468. ui.selfTalk.t0.play();
  9469. }
  9470. showSelfEmotion(emotionId) {
  9471. let ui = xGame.common.gameUI.ui;
  9472. ui.selfTalk.visible = true;
  9473. ui.selfTalk.myNode.c1.selectedIndex = 0;
  9474. this.selfSpine && this.selfSpine.dispose();
  9475. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9476. let spineData = cfgTable.emotionData[emotionId].spine;
  9477. this.selfSpine = new SpineMgr(spineData, () => {
  9478. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  9479. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  9480. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9481. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  9482. });
  9483. ui.selfTalk.t0.play();
  9484. }
  9485. showAITalk(wordsId) {
  9486. if (!this.aiSpeak)
  9487. return;
  9488. if (DataMgr.gameData.gameCount < 2)
  9489. return;
  9490. if (wordsId < 1)
  9491. wordsId = this.getRandTalk();
  9492. let ui = xGame.common.gameUI.ui;
  9493. ui.aiTalk.visible = true;
  9494. ui.aiTalk.myNode.c1.selectedIndex = 1;
  9495. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9496. ui.aiTalk.t0.play();
  9497. }
  9498. getRandTalk() {
  9499. let rand = xGame.tools.random(0, this.talkList.length);
  9500. return this.emotionList[rand];
  9501. }
  9502. getRandEmotion() {
  9503. let rand = xGame.tools.random(0, this.emotionList.length);
  9504. return this.emotionList[rand];
  9505. }
  9506. showAIEmotion(emotionId) {
  9507. if (!this.aiSpeak)
  9508. return;
  9509. if (DataMgr.gameData.gameCount < 2)
  9510. return;
  9511. if (emotionId < 1)
  9512. emotionId = this.getRandEmotion();
  9513. let ui = xGame.common.gameUI.ui;
  9514. ui.aiTalk.visible = true;
  9515. ui.aiTalk.myNode.c1.selectedIndex = 0;
  9516. this.aiSpine && this.aiSpine.dispose();
  9517. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9518. let spineData = cfgTable.emotionData[emotionId].spine;
  9519. this.aiSpine = new SpineMgr(spineData, () => {
  9520. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  9521. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  9522. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9523. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  9524. });
  9525. ui.aiTalk.t0.play();
  9526. }
  9527. resetGame() {
  9528. let ui = xGame.common.gameUI.ui;
  9529. ui.aiTalk.visible = false;
  9530. ui.selfTalk.visible = false;
  9531. this.aiSpine && this.aiSpine.dispose();
  9532. this.selfSpine && this.selfSpine.dispose();
  9533. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9534. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9535. this.closeTalkView();
  9536. }
  9537. }
  9538. class WordsMgr {
  9539. constructor() {
  9540. this.comboTimes = 1;
  9541. this.skillTimes = 0;
  9542. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  9543. this.comboSpine = new SpineMgr("yxz_liangan");
  9544. this.skillSpine = new SpineMgr("yiganxqiu");
  9545. this.scoreSpine = new SpineMgr("defen");
  9546. }
  9547. setClassicCombo(isInterrupt) {
  9548. if (isInterrupt) {
  9549. this.comboTimes = 0;
  9550. }
  9551. }
  9552. playClassicWords(type, callback) {
  9553. this.callback = callback;
  9554. let aniIndex = type;
  9555. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9556. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9557. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9558. mySpine.destroy(true);
  9559. this.playClassicTimes();
  9560. });
  9561. }
  9562. playClassicTimes() {
  9563. this.comboTimes++;
  9564. if (this.comboTimes <= 1) {
  9565. this.callback && this.callback();
  9566. }
  9567. else {
  9568. let aniIndex = this.comboTimes - 1;
  9569. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9570. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9571. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9572. mySpine.destroy(true);
  9573. this.callback && this.callback();
  9574. });
  9575. }
  9576. }
  9577. playBigSkillTimes(times, callback) {
  9578. if (times <= 0) {
  9579. callback && callback();
  9580. return;
  9581. }
  9582. this.callback = callback;
  9583. let pre = "sz_0";
  9584. let aniIndex = 0;
  9585. this.getWordsImg(times, pre, () => {
  9586. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9587. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9588. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9589. let r1 = ``;
  9590. let r2 = ``;
  9591. if (times <= 9) {
  9592. r1 = `res/d2Res/${pre}${times}.png`;
  9593. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9594. aniIndex = 0;
  9595. }
  9596. else {
  9597. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9598. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9599. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9600. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9601. aniIndex = 1;
  9602. }
  9603. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9604. mySpine.destroy(true);
  9605. xGame.common.gameMgr.playSkillTips();
  9606. this.playScore(times);
  9607. xGame.common.playRandomMutiBallBigSkillSound();
  9608. }, mySpine);
  9609. });
  9610. }
  9611. playScore(score) {
  9612. let pre = "sz_";
  9613. let aniIndex = 0;
  9614. this.getWordsImg(score, pre, () => {
  9615. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9616. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9617. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9618. let r1 = ``;
  9619. let r2 = ``;
  9620. if (score <= 9) {
  9621. r1 = `res/d2Res/${pre}${score}.png`;
  9622. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9623. aniIndex = 0;
  9624. }
  9625. else {
  9626. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9627. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9628. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9629. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9630. aniIndex = 1;
  9631. }
  9632. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9633. mySpine.destroy(true);
  9634. this.callback && this.callback();
  9635. }, mySpine);
  9636. });
  9637. }
  9638. getWordsImg(number, pre = "", callback) {
  9639. let arr = [];
  9640. if (number <= 9) {
  9641. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9642. }
  9643. else {
  9644. 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 });
  9645. }
  9646. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9647. callback && callback();
  9648. }));
  9649. }
  9650. }
  9651. class ui_UIRodMethod extends fgui.GComponent {
  9652. static createInstance() {
  9653. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9654. }
  9655. onConstruct() {
  9656. this.n24 = (this.getChild("n24"));
  9657. this.white = (this.getChild("white"));
  9658. this.dot = (this.getChild("dot"));
  9659. this.sureBtn = (this.getChild("sureBtn"));
  9660. this.n20 = (this.getChild("n20"));
  9661. this.n21 = (this.getChild("n21"));
  9662. this.n22 = (this.getChild("n22"));
  9663. this.n23 = (this.getChild("n23"));
  9664. this.n5 = (this.getChild("n5"));
  9665. this.n14 = (this.getChild("n14"));
  9666. this.t0 = this.getTransition("t0");
  9667. }
  9668. }
  9669. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9670. class UIRodMethod extends UIBase {
  9671. constructor() {
  9672. super();
  9673. this.isPressd = false;
  9674. }
  9675. onConstructor() {
  9676. this.ui = ui_UIRodMethod.createInstance();
  9677. this.contentPane = this.ui;
  9678. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9679. this.moveDir = new Laya.Vector2();
  9680. this.moveDest = new Laya.Vector2();
  9681. this.centerPos = new Laya.Vector2();
  9682. xGame.common.uiRodMethod = this;
  9683. }
  9684. show() {
  9685. super.show();
  9686. xGame.common.gameMgr.gamePause = true;
  9687. this.openPressDotEvent();
  9688. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9689. this.centerPos.x = this.ui.white.x;
  9690. this.centerPos.y = this.ui.white.y;
  9691. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9692. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9693. this.setDot();
  9694. }
  9695. setDot() {
  9696. this.ui.dot.x = this.moveDest.x;
  9697. this.ui.dot.y = this.moveDest.y;
  9698. }
  9699. closeSelf() {
  9700. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9701. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9702. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9703. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9704. xGame.common.gameMgr.gamePause = false;
  9705. this.hide();
  9706. }
  9707. openPressDotEvent() {
  9708. this.closePressDotEvent();
  9709. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9710. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9711. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9712. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9713. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9714. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9715. }
  9716. closePressDotEvent() {
  9717. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9718. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9719. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9720. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9721. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9722. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9723. }
  9724. onDown(e) {
  9725. if (e.type == Laya.Event.MOUSE_DOWN)
  9726. this.isPressd = true;
  9727. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9728. this.isPressd = false;
  9729. if (!this.isPressd)
  9730. return;
  9731. this.moveDest.x = e.stageX;
  9732. this.moveDest.y = e.stageY;
  9733. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9734. if (dis > 6724) {
  9735. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9736. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9737. }
  9738. this.setDot();
  9739. }
  9740. resetRod() {
  9741. this.ui.dot.x = this.ui.white.x;
  9742. this.ui.dot.y = this.ui.white.y;
  9743. this.gameRod.dot.x = this.gameRod.bg.x;
  9744. this.gameRod.dot.y = this.gameRod.bg.y;
  9745. xGame.common.rodOffest.x = 0;
  9746. xGame.common.rodOffest.y = 0;
  9747. }
  9748. }
  9749. UIRodMethod.uiName = "UIRodMethod";
  9750. class UIGame extends UIBase {
  9751. constructor() {
  9752. super();
  9753. this.powerNum = 0;
  9754. this.isD3Inited = false;
  9755. this.isPrePlay = false;
  9756. this.isMoveRod = false;
  9757. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9758. this.rulerDis = 20;
  9759. this.rulerOffset = 0;
  9760. }
  9761. onConstructor() {
  9762. this.ui = ui_UIGame.createInstance();
  9763. this.contentPane = this.ui;
  9764. this.ui.x += xGame.common.sysOffestNum;
  9765. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9766. this.isEject = false;
  9767. xGame.common.gameUI = this;
  9768. this.initSelf();
  9769. }
  9770. isTurnSelf() {
  9771. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9772. return true;
  9773. }
  9774. }
  9775. initSelf() {
  9776. let topUI = this.ui.topNode;
  9777. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9778. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9779. this.barInfo = {};
  9780. this.barInfo.curY = 0;
  9781. this.barInfo.height = this.ui.powerNode.height;
  9782. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9783. this.barInfo.powerStartY = this.ui.powerNode.y;
  9784. xGame.common.aiPlayer = new AIPlayer();
  9785. xGame.common.gameMgr = new GameMgr();
  9786. xGame.common.skillMgr = new SkillMgr();
  9787. xGame.common.wordsMgr = new WordsMgr();
  9788. xGame.common.talkMgr = new TalkMgr();
  9789. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9790. console.log("加载经典模式表情文件chenggon !");
  9791. });
  9792. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9793. console.log("挑战模式奖励模式spine加载成功!");
  9794. });
  9795. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9796. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9797. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9798. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9799. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9800. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9801. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9802. }
  9803. getGanZiImg() {
  9804. let index = DataMgr.getCurBallRod();
  9805. let data = cfgTable.ballrodData[index + 1];
  9806. let gan_url = xGame.common.getGameIconUrl(data.img);
  9807. console.log('zh:getGanZiImg gan_url==' + gan_url);
  9808. this.ui.powerNode.showImg.url = gan_url;
  9809. console.log('zh:修改杆子图标O K');
  9810. }
  9811. returnHome() {
  9812. let tips = "Are you sure to exit the game?";
  9813. let woman = "Boss, why don't you play for a while longer?";
  9814. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9815. }
  9816. addRodMethodClick() {
  9817. if (this.isTurnSelf()) {
  9818. xGame.uiMgr.Show(UIRodMethod);
  9819. }
  9820. }
  9821. clickHelpLineBtn(force = false) {
  9822. if (!this.isTurnSelf())
  9823. return;
  9824. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9825. if (success) {
  9826. xGame.common.longHelpLine = true;
  9827. xGame.common.d2World.getHelpLine();
  9828. Moyu.sendDataEvent("guideNum");
  9829. }
  9830. else {
  9831. }
  9832. });
  9833. }
  9834. renderSelfDisplayBalls(index, target) {
  9835. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9836. target.myImg.url = xGame.common.getGameIconUrl(str);
  9837. }
  9838. renderAIDisplayBalls(index, target) {
  9839. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9840. target.myImg.url = xGame.common.getGameIconUrl(str);
  9841. ;
  9842. }
  9843. updateMode() {
  9844. if (xGame.common.gameMode == GameMode.classic) {
  9845. this.ui.topNode.scoreNode.visible = false;
  9846. }
  9847. else if (xGame.common.gameMode == GameMode.bigMove) {
  9848. this.ui.topNode.scoreNode.visible = true;
  9849. }
  9850. }
  9851. show() {
  9852. super.show();
  9853. console.log("zh:uigame show AADD");
  9854. this.ui.alpha = 0;
  9855. this.updateSelf();
  9856. xGame.common.gameMgr.gamePause = false;
  9857. xGame.common.gameUI.ui.blackAni.visible = false;
  9858. xGame.common.gameUI.ui.whiteAni.visible = false;
  9859. this.ui.powerEft.visible = false;
  9860. this.ui.colorNode.visible = false;
  9861. this.updateHead();
  9862. let curUse = DataMgr.getCurBallRod();
  9863. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  9864. this.getGanZiImg();
  9865. }
  9866. updateSelf() {
  9867. if (xGame.common.gameMode == GameMode.classic) {
  9868. this.ui.c1.selectedIndex = 0;
  9869. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9870. this.ui.topNode.middleNode.visible = true;
  9871. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9872. }
  9873. else if (xGame.common.gameMode == GameMode.bigMove) {
  9874. this.ui.c1.selectedIndex = 0;
  9875. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9876. this.ui.topNode.middleNode.visible = false;
  9877. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9878. let rand = xGame.common.randomNum(1, max);
  9879. let guide = DataMgr.getSkillGuide();
  9880. if (guide == 0)
  9881. rand = 1;
  9882. xGame.common.bigMoveLevelIndex = rand;
  9883. }
  9884. else if (xGame.common.gameMode == GameMode.placeBall) {
  9885. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9886. this.ui.c1.selectedIndex = 1 + data.type;
  9887. this.ui.alpha = 1;
  9888. this.startGame();
  9889. }
  9890. this.updateMode();
  9891. this.initD3world();
  9892. this.initD2world();
  9893. }
  9894. startGame() {
  9895. this.ui.snowNode.visible = Math.random() <= 0.1;
  9896. this.ui.d2Node.visible = false;
  9897. xGame.common.d3World.d3Hand.gameObj.active = false;
  9898. xGame.common.d3World.tableSrc.init();
  9899. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9900. this.cameraViewChange(() => {
  9901. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9902. switch (xGame.common.gameMode) {
  9903. case GameMode.classic:
  9904. xGame.common.d3World.d3Hand.gameObj.active = true;
  9905. this.playPutBallD3Ani();
  9906. break;
  9907. case GameMode.bigMove:
  9908. this.enterGame();
  9909. Laya.timer.once(500, this, () => {
  9910. this.ui.topNode.middleNode.visible = true;
  9911. this.ui.topNode.middleNode.t0.play();
  9912. });
  9913. break;
  9914. case GameMode.placeBall:
  9915. this.enterGame();
  9916. break;
  9917. default:
  9918. break;
  9919. }
  9920. });
  9921. PlatMgr.showBanner(false);
  9922. }
  9923. enterGame() {
  9924. this.ui.d2Node.visible = true;
  9925. xGame.common.d3World.d3Hand.gameObj.active = false;
  9926. xGame.common.showOneCamera("mainCamera");
  9927. Moyu.recordGame(30, true);
  9928. if (!this.isPrePlay) {
  9929. this.isPrePlay = true;
  9930. xGame.common.d3World.prePlayEft();
  9931. }
  9932. xGame.common.gameMgr.gameReady();
  9933. this.openAllEvent();
  9934. this.ui.snowNode.visible = false;
  9935. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9936. this.ui.helpBtn.visible = condition;
  9937. }
  9938. showHelpLineGuide() {
  9939. let longGuide = DataMgr.getGuideHelpLine();
  9940. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9941. this.ui.helpBtn.visible = true;
  9942. this.ui.guideNode.visible = true;
  9943. }
  9944. }
  9945. setTurnAlpha(alpha) {
  9946. this.ui.keduNode.alpha = alpha;
  9947. this.ui.ganNode.alpha = alpha;
  9948. this.ui.rodMethodNode.alpha = alpha;
  9949. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9950. }
  9951. cameraViewChange(callback) {
  9952. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9953. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9954. xGame.common.showOneCamera("visitAngle");
  9955. cameraSrc.localRotationEulerY = 180;
  9956. cameraSrc.localRotationEulerZ = 0;
  9957. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9958. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9959. callback && callback();
  9960. }));
  9961. }));
  9962. }
  9963. playPutBallD3Ani() {
  9964. xGame.common.showOneCamera("mainCamera");
  9965. let handSrc = xGame.common.d3World.d3Hand;
  9966. handSrc.gameObj.active = true;
  9967. handSrc.transform.localPositionZ = 3;
  9968. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9969. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9970. handSrc.gameObj.active = false;
  9971. this.enterGame();
  9972. }), 400);
  9973. }));
  9974. }
  9975. updateHead() {
  9976. let user = Moyu.getUserInfo();
  9977. this.ui.topNode.selfNameTxt.text = user.nickName;
  9978. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9979. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9980. if (DataMgr.getSkillGuide() < 1) {
  9981. this.ui.topNode.aiNameTxt.text = 'billiards';
  9982. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9983. }
  9984. else {
  9985. this.ui.topNode.aiNameTxt.text = aiData.name;
  9986. let randNo = Math.floor(Math.random() * 10) + 1;
  9987. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9988. }
  9989. }
  9990. initD2world() {
  9991. let node = this.ui.d2Root.displayObject;
  9992. let src = node.getComponent(D2World);
  9993. if (!src) {
  9994. xGame.common.d2World = node.addComponent(D2World);
  9995. }
  9996. xGame.common.d2World.initSelf();
  9997. }
  9998. initD3world() {
  9999. if (this.isD3Inited)
  10000. return;
  10001. this.isD3Inited = true;
  10002. let scene3D = xGame.common.d3Scene;
  10003. this.ui.d3Root.displayObject.addChild(scene3D);
  10004. scene3D.active = true;
  10005. xGame.common.d3World.tableSrc.setBorderPos();
  10006. }
  10007. onRootMove(e) {
  10008. let rootBall = xGame.common.d2World.rootBall;
  10009. this.ui.moveNode.x = e.x;
  10010. this.ui.moveNode.y = e.y;
  10011. rootBall.gameObj.x = e.x;
  10012. rootBall.gameObj.y = e.y;
  10013. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  10014. }
  10015. aiRootMove(move) {
  10016. if (move)
  10017. this.hideBallUI();
  10018. else {
  10019. this.showBallUI();
  10020. xGame.common.d2World.getHelpLine();
  10021. }
  10022. }
  10023. aiForce(type, force = 0) {
  10024. this.pressTarget = PressType.powerNode;
  10025. if (type == 1)
  10026. this.onEventUp({ force: true });
  10027. else if (type == 2)
  10028. this.onEventMove({ stageY: force, force: true });
  10029. }
  10030. onEventPress(e) {
  10031. if (e.stopPropagation)
  10032. e.stopPropagation();
  10033. if (!this.isTurnSelf())
  10034. return;
  10035. let target = e.target;
  10036. switch (target) {
  10037. case this.ui.myPowerNode.displayObject:
  10038. this.pressTarget = PressType.powerNode;
  10039. this.barInfo.curY = e.stageY;
  10040. this.updateBarInfo();
  10041. break;
  10042. case this.ui.moveNode.displayObject:
  10043. this.pressTarget = PressType.moveNode;
  10044. this.hideBallUI();
  10045. this.eventObj.curX = this.ui.moveNode.x;
  10046. this.eventObj.curY = this.ui.moveNode.y;
  10047. this.ui.moveNode.finger.visible = false;
  10048. this.eventObj.lastX = e.stageX;
  10049. this.eventObj.lastY = e.stageY;
  10050. break;
  10051. case this.ui.rulerClickNode.displayObject:
  10052. this.pressTarget = PressType.rulerNode;
  10053. this.eventObj.lastY = e.stageY;
  10054. break;
  10055. case this.ui.d2Root.displayObject:
  10056. this.pressTarget = PressType.d2Root;
  10057. this.eventObj.lastX = e.stageX;
  10058. this.eventObj.lastY = e.stageY;
  10059. this.eventObj.starX = e.stageX;
  10060. this.eventObj.starY = e.stageY;
  10061. this.eventObj.curX = 0;
  10062. this.eventObj.curY = 0;
  10063. xGame.common.d2World.d2Gan.setGanLastInfo();
  10064. this.rulerOffset = 0;
  10065. break;
  10066. default:
  10067. break;
  10068. }
  10069. }
  10070. onEventMove(e) {
  10071. if (e.stopPropagation)
  10072. e.stopPropagation();
  10073. if (e && e.force) {
  10074. }
  10075. else {
  10076. if (!this.isTurnSelf())
  10077. return;
  10078. }
  10079. switch (this.pressTarget) {
  10080. case PressType.powerNode:
  10081. this.barInfo.curY = e.stageY;
  10082. this.updateBarInfo();
  10083. this.isMoveRod = true;
  10084. break;
  10085. case PressType.moveNode:
  10086. let rootBall = xGame.common.d2World.rootBall;
  10087. let radius = rootBall.gameObj.width / 2;
  10088. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  10089. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  10090. let border = xGame.common.d2World.borderRect;
  10091. if (curX <= border.x + radius)
  10092. curX = border.x + radius;
  10093. else if (curX >= border.x + border.width - radius)
  10094. curX = border.x + border.width - radius;
  10095. if (curY <= border.y + radius)
  10096. curY = border.y + radius;
  10097. else if (curY >= border.y + border.height - radius)
  10098. curY = border.y + border.height - radius;
  10099. if (xGame.common.gameMgr.isOpenBall) {
  10100. if (curX >= border.x + border.openBallW - radius)
  10101. curX = border.x + border.openBallW - radius;
  10102. }
  10103. this.ui.moveNode.x = curX;
  10104. this.ui.moveNode.y = curY;
  10105. rootBall.gameObj.x = curX;
  10106. rootBall.gameObj.y = curY;
  10107. rootBall.d3BallSrc.setTransPos(curX, curY);
  10108. this.isMoveRod = true;
  10109. break;
  10110. case PressType.rulerNode:
  10111. let yy = e.stageY - this.eventObj.lastY;
  10112. this.eventObj.lastY = e.stageY;
  10113. let ruler1 = this.ui.rulerNode.img1;
  10114. let ruler2 = this.ui.rulerNode.img2;
  10115. ruler1.y += yy;
  10116. ruler2.y += yy;
  10117. this.rulerOffset += yy;
  10118. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  10119. this.rulerOffset = 0;
  10120. xGame.soundMgr.playSound("inch", 1, 10);
  10121. }
  10122. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  10123. let h = ruler1.height;
  10124. this.checkGuide();
  10125. this.isMoveRod = true;
  10126. if (ruler1.y >= h) {
  10127. ruler1.y = -h;
  10128. ruler2.y = 0;
  10129. return;
  10130. }
  10131. else if (ruler1.y <= -h) {
  10132. ruler1.y = h;
  10133. ruler2.y = 0;
  10134. return;
  10135. }
  10136. if (ruler2.y >= h) {
  10137. ruler2.y = -h;
  10138. ruler1.y = 0;
  10139. return;
  10140. }
  10141. else if (ruler2.y <= -h) {
  10142. ruler2.y = h;
  10143. ruler1.y = 0;
  10144. return;
  10145. }
  10146. break;
  10147. case PressType.d2Root:
  10148. this.eventObj.curX = e.stageX;
  10149. this.eventObj.curY = e.stageY;
  10150. let offset = this.checkRodMoveDir();
  10151. xGame.common.d2World.d2Gan.rotateSelf(offset);
  10152. this.eventObj.lastX = e.stageX;
  10153. this.eventObj.lastY = e.stageY;
  10154. break;
  10155. default:
  10156. break;
  10157. }
  10158. }
  10159. onEventUp(e) {
  10160. if (e.stopPropagation)
  10161. e.stopPropagation();
  10162. if (e && e.force) {
  10163. }
  10164. else {
  10165. if (!this.isTurnSelf())
  10166. return;
  10167. }
  10168. switch (this.pressTarget) {
  10169. case PressType.powerNode:
  10170. this.ui.powerNode.value = 0;
  10171. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10172. this.ui.powerTxt.text = "";
  10173. if (this.powerNum > 0) {
  10174. xGame.eventMgr.event(BALL_SHOOT);
  10175. xGame.common.d2World.shoot(this.powerNum);
  10176. xGame.common.d2World.d2Gan.shoot();
  10177. xGame.common.d2World.d2HelpLine.shoot();
  10178. this.finishGuide();
  10179. this.ui.powerEft.visible = false;
  10180. this.ui.colorNode.visible = false;
  10181. let ganStr = "";
  10182. if (this.powerNum <= 30) {
  10183. ganStr = "gan_30";
  10184. }
  10185. else if (this.powerNum <= 60) {
  10186. ganStr = "gan_50";
  10187. }
  10188. else {
  10189. ganStr = "gan_80";
  10190. }
  10191. xGame.soundMgr.playSound(ganStr);
  10192. }
  10193. break;
  10194. case PressType.moveNode:
  10195. let rootBall = xGame.common.d2World.rootBall;
  10196. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10197. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10198. let isIntersect = this.judgeBallIntersect();
  10199. if (isIntersect) {
  10200. this.ui.moveNode.x = lastX;
  10201. this.ui.moveNode.y = lastY;
  10202. rootBall.gameObj.x = lastX;
  10203. rootBall.gameObj.y = lastY;
  10204. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10205. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10206. }
  10207. else {
  10208. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10209. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10210. }
  10211. this.showBallUI();
  10212. this.ui.moveNode.finger.visible = true;
  10213. xGame.common.d2World.getHelpLine();
  10214. break;
  10215. case PressType.rulerNode:
  10216. break;
  10217. case PressType.d2Root:
  10218. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10219. if (dis <= 25) {
  10220. this.moveToClickDot(e);
  10221. }
  10222. break;
  10223. default:
  10224. break;
  10225. }
  10226. this.pressTarget = -1;
  10227. }
  10228. checkGuide() {
  10229. let guide = DataMgr.getSkillGuide();
  10230. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10231. xGame.common.guideStep++;
  10232. xGame.common.gameUI.ui.guide2.visible = false;
  10233. xGame.common.gameUI.ui.guide3.visible = true;
  10234. }
  10235. }
  10236. finishGuide() {
  10237. let guide = DataMgr.getSkillGuide();
  10238. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10239. xGame.common.guideStep = 10;
  10240. this.closeAllGuide();
  10241. console.log('zh: 新手引导完毕');
  10242. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  10243. }
  10244. }
  10245. closeAllGuide() {
  10246. xGame.common.gameUI.ui.guide1.visible = false;
  10247. xGame.common.gameUI.ui.guide2.visible = false;
  10248. xGame.common.gameUI.ui.guide3.visible = false;
  10249. }
  10250. updateBarInfo() {
  10251. let star = this.ui.powerNode.y;
  10252. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10253. if (rate >= 1)
  10254. rate = 1;
  10255. if (rate <= 0)
  10256. rate = 0;
  10257. this.powerNum = Math.ceil(rate * 100);
  10258. this.ui.powerNode.value = this.powerNum;
  10259. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10260. this.ui.colorNode.value = this.powerNum;
  10261. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10262. this.ui.powerEft.visible = this.powerNum != 0;
  10263. this.ui.colorNode.visible = this.powerNum != 0;
  10264. this.ui.powerTxt.text = this.powerNum + "";
  10265. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10266. }
  10267. forceCancel() {
  10268. this.ui.powerNode.value = 0;
  10269. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10270. this.ui.powerTxt.text = "";
  10271. }
  10272. checkRodMoveDir() {
  10273. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10274. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10275. if (tempX >= 0 && tempY <= 0) {
  10276. return this.checkDir();
  10277. }
  10278. else if (tempX < 0 && tempY < 0) {
  10279. return this.checkDir(1, -1);
  10280. }
  10281. else if (tempX < 0 && tempY > 0) {
  10282. return this.checkDir(-1, -1);
  10283. }
  10284. else {
  10285. return this.checkDir(-1, 1);
  10286. }
  10287. }
  10288. checkDir(flagX = 1, flagY = 1) {
  10289. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10290. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10291. if (offsetY == 0) {
  10292. return offsetX * flagX;
  10293. }
  10294. if (offsetX == 0) {
  10295. return offsetY * flagY;
  10296. }
  10297. let angle = offsetY / offsetX;
  10298. if (Math.abs(angle) >= 1) {
  10299. return offsetY * flagY;
  10300. }
  10301. else {
  10302. return offsetX * flagX;
  10303. }
  10304. }
  10305. judgeBallIntersect() {
  10306. let rootBall = xGame.common.d2World.rootBall;
  10307. let ballArr = xGame.common.d2World.ballArr;
  10308. let radius = rootBall.gameObj.width / 2;
  10309. let temp;
  10310. let isIntersect = false;
  10311. for (let index = 0; index < ballArr.length; index++) {
  10312. temp = ballArr[index];
  10313. if (temp.number == rootBall.number)
  10314. continue;
  10315. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10316. if (isIntersect) {
  10317. break;
  10318. }
  10319. }
  10320. return isIntersect;
  10321. }
  10322. hideBallUI() {
  10323. let d2Gan = xGame.common.d2World.d2Gan;
  10324. if (!d2Gan.ui.isDisposed)
  10325. d2Gan.ui.visible = false;
  10326. let d2Help = xGame.common.d2World.d2HelpLine;
  10327. if (!d2Help.ui.isDisposed)
  10328. d2Help.ui.visible = false;
  10329. let rootBall = xGame.common.d2World.rootBall;
  10330. if (!rootBall.destroyed) {
  10331. rootBall.gameObj.active = false;
  10332. }
  10333. }
  10334. showBallUI() {
  10335. let d2Gan = xGame.common.d2World.d2Gan;
  10336. if (!d2Gan.ui.isDisposed)
  10337. d2Gan.ui.visible = true;
  10338. let d2Help = xGame.common.d2World.d2HelpLine;
  10339. if (!d2Help.ui.isDisposed)
  10340. d2Help.ui.visible = true;
  10341. let rootBall = xGame.common.d2World.rootBall;
  10342. if (!rootBall.destroyed) {
  10343. rootBall.gameObj.active = true;
  10344. }
  10345. }
  10346. moveToClickDot(e) {
  10347. if (!this.isMoveRod && !xGame.common.clickedBall) {
  10348. let root = xGame.common.d2World.rootBall.gameObj;
  10349. let xx = e.stageX - xGame.common.sysOffestNum;
  10350. let yy = e.stageY;
  10351. let x = xx - root.x;
  10352. let y = yy - root.y;
  10353. let angle = xGame.common.getfguiRotation(x, y);
  10354. xGame.common.d2World.d2Gan.ui.rotation = angle;
  10355. xGame.common.d2World.getHelpLine();
  10356. }
  10357. this.isMoveRod = false;
  10358. xGame.common.clickedBall = false;
  10359. }
  10360. openAllEvent() {
  10361. this.closeAllEvent();
  10362. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10363. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10364. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10365. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10366. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10367. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10368. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10369. }
  10370. closeAllEvent() {
  10371. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10372. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10373. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10374. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10375. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10376. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10377. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10378. }
  10379. resetGame() {
  10380. this.closeAllEvent();
  10381. this.hideBallUI();
  10382. xGame.common.gameMgr.gamePause = true;
  10383. }
  10384. }
  10385. UIGame.uiName = "UIGame";
  10386. class UIAddProp extends UIBase {
  10387. constructor() {
  10388. super();
  10389. this.curType = "";
  10390. }
  10391. onConstructor() {
  10392. this.ui = ui_UIAddProp.createInstance();
  10393. this.contentPane = this.ui;
  10394. this.isEject = false;
  10395. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  10396. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  10397. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  10398. this.updateUI();
  10399. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  10400. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  10401. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  10402. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  10403. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  10404. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  10405. }
  10406. show(type) {
  10407. super.show();
  10408. this.curType = type == 0 ? "coin" : "diamond";
  10409. this.switchBtn("");
  10410. this.ui.t0.play();
  10411. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  10412. PlatMgr.showInsert(true);
  10413. }
  10414. closeSelf() {
  10415. this.hide();
  10416. }
  10417. updateUI() {
  10418. let data = cfgTable.moneyData;
  10419. let temp;
  10420. let obj;
  10421. for (const key in data) {
  10422. temp = data[key];
  10423. obj = this.ui.myNode["node" + key];
  10424. if (parseInt(key) <= 2) {
  10425. obj.diamondTxt.text = "+" + temp.num;
  10426. }
  10427. else {
  10428. obj.coinTxt.text = temp.num;
  10429. obj.diamondTxt.text = temp.get.split('_')[1];
  10430. }
  10431. }
  10432. this.updateDiamondShare();
  10433. }
  10434. updateDiamondShare() {
  10435. let data = DataMgr.getShareDiamondTimes();
  10436. if (data >= xGame.common.maxShareDiamondTimes) {
  10437. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  10438. this.ui.myNode.node1.touchable = false;
  10439. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10440. }
  10441. else {
  10442. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  10443. this.ui.myNode.node1.touchable = true;
  10444. }
  10445. }
  10446. switchBtn(type) {
  10447. if (type == "")
  10448. type = this.curType;
  10449. else {
  10450. if (this.curType == type) {
  10451. return;
  10452. }
  10453. else {
  10454. this.curType = type;
  10455. }
  10456. }
  10457. if (type == "coin") {
  10458. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  10459. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  10460. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  10461. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  10462. this.ui.myNode.c1.selectedIndex = 0;
  10463. }
  10464. else {
  10465. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  10466. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  10467. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  10468. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  10469. this.ui.myNode.c1.selectedIndex = 1;
  10470. }
  10471. }
  10472. convertCoin(index) {
  10473. let data = cfgTable.moneyData[index];
  10474. let coinNum = data.num;
  10475. let str = data.get.split('_')[1];
  10476. let needDiamond = parseInt(str);
  10477. if (DataMgr.diamondEnough(needDiamond)) {
  10478. DataMgr.setDiamond(-needDiamond);
  10479. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  10480. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  10481. }
  10482. else {
  10483. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  10484. this.switchBtn("diamond");
  10485. }
  10486. }
  10487. videoGetDiamond() {
  10488. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  10489. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  10490. }
  10491. else {
  10492. console.log('zh:AD 失败,直接发放奖励');
  10493. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  10494. }
  10495. }
  10496. qjff_AD_for_uiAddProp_videoGetDiamond() {
  10497. let num = cfgTable.moneyData[2].num;
  10498. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10499. this.closeSelf();
  10500. }
  10501. videoGetCoin() {
  10502. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  10503. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  10504. }
  10505. else {
  10506. console.log('zh:AD 失败,直接发放奖励');
  10507. this.qjff_AD_for_uiAddProp_videoGetCoin();
  10508. }
  10509. }
  10510. qjff_AD_for_uiAddProp_videoGetCoin() {
  10511. xGame.common.playObjFlyAnim(2000, Prop.coin);
  10512. this.closeSelf();
  10513. }
  10514. shareGetDiamond() {
  10515. let times = DataMgr.getShareDiamondTimes();
  10516. if (times >= xGame.common.maxShareDiamondTimes) {
  10517. console.log('zh: 233333333333 maxShareDiamondTimes');
  10518. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10519. }
  10520. else {
  10521. console.log('zh:33333333333333ad');
  10522. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  10523. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  10524. }
  10525. else {
  10526. console.log('zh:AD 失败,直接发放奖励');
  10527. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  10528. }
  10529. }
  10530. }
  10531. qjff_AD_for_uiAddProp_shareGetDiamond() {
  10532. let diamond = xGame.common.randomNum(50, 100);
  10533. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  10534. DataMgr.setShareDiamondTimes(1);
  10535. this.updateDiamondShare();
  10536. }
  10537. openPutBallView() {
  10538. let end = xGame.uiMgr.getUI(UIGameEnd);
  10539. let skill = xGame.uiMgr.getUI(UISkill);
  10540. let level = xGame.uiMgr.getUI(UILevelDisplay);
  10541. let uigame = xGame.uiMgr.getUI(UIGame);
  10542. if (end && !end.isHide) {
  10543. xGame.uiMgr.Hide(UIGameEnd);
  10544. xGame.uiMgr.Show(UIMain);
  10545. }
  10546. if (skill && !skill.isHide)
  10547. xGame.uiMgr.Hide(UISkill);
  10548. if (uigame && !uigame.isHide)
  10549. xGame.uiMgr.Hide(UIGame);
  10550. if (level && !level.isHide) {
  10551. }
  10552. else {
  10553. xGame.uiMgr.Show(UILevelDisplay);
  10554. }
  10555. this.closeSelf();
  10556. }
  10557. }
  10558. UIAddProp.uiName = "UIAddProp";
  10559. class MoneyNode {
  10560. constructor(ui) {
  10561. this.leftTime = 0;
  10562. this.ui = ui;
  10563. this.ui.addCoinBtn.onClick(this, this.addCoin);
  10564. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  10565. this.ui.addPowerBtn.onClick(this, this.addPower);
  10566. this.ui.c1.selectedIndex = 1;
  10567. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  10568. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  10569. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  10570. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10571. this.coinChange();
  10572. this.diamondChange();
  10573. this.powerChange();
  10574. }
  10575. addPower() {
  10576. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10577. xGame.uiMgr.Show(UIPower);
  10578. }
  10579. powerChange() {
  10580. let powerNum = DataMgr.getPower();
  10581. this.ui.powerTxt.text = powerNum + "";
  10582. }
  10583. checkPowerTime() {
  10584. let cur = new Date().getTime();
  10585. let last = DataMgr.getPowerTime();
  10586. if (last == 0) {
  10587. last = cur;
  10588. DataMgr.setPowerTime(cur);
  10589. }
  10590. let power = DataMgr.getPower();
  10591. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10592. Laya.timer.clearAll(this);
  10593. if (power >= xGame.common.natureMaxPower) {
  10594. this.ui.powerTimeTxt.text = "";
  10595. DataMgr.setPowerTime(cur);
  10596. return;
  10597. }
  10598. if (power + offset >= xGame.common.natureMaxPower) {
  10599. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10600. this.ui.powerTimeTxt.text = "";
  10601. DataMgr.setPowerTime(cur);
  10602. }
  10603. else {
  10604. if (offset > 0) {
  10605. DataMgr.setPower(offset);
  10606. DataMgr.setPowerTime(cur);
  10607. }
  10608. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10609. this.leftTime = xGame.common.powerRecoverNum - time;
  10610. if (this.leftTime <= 0)
  10611. this.leftTime = 0;
  10612. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10613. Laya.timer.loop(1000, this, this.updatePowerTime);
  10614. }
  10615. }
  10616. updatePowerTime() {
  10617. this.leftTime -= 1;
  10618. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10619. if (this.leftTime <= 0) {
  10620. this.checkPowerTime();
  10621. }
  10622. }
  10623. coinChange() {
  10624. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10625. }
  10626. diamondChange() {
  10627. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10628. }
  10629. addCoin() {
  10630. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10631. Moyu.sendDataEvent("AddCoinBtn");
  10632. xGame.uiMgr.Show(UIAddProp, 0);
  10633. }
  10634. addDiamond() {
  10635. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10636. Moyu.sendDataEvent("AddDiamondBtn");
  10637. xGame.uiMgr.Show(UIAddProp, 1);
  10638. }
  10639. }
  10640. class UIDraw extends UIBase {
  10641. constructor() {
  10642. super();
  10643. this.curKey = 0;
  10644. }
  10645. onConstructor() {
  10646. this.ui = ui_UIDraw.createInstance();
  10647. this.contentPane = this.ui;
  10648. this.isEject = false;
  10649. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10650. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10651. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10652. this.initDraw();
  10653. this.initUI();
  10654. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10655. if (Moyu.isKs)
  10656. this.ui.closeNode.closeBtn.x += 100;
  10657. }
  10658. show() {
  10659. super.show();
  10660. this.ui.t0.play();
  10661. this.playSecretaryIdle();
  10662. this.updateDraw();
  10663. this.checkFree();
  10664. if (PlatMgr.bannerDelay > 0) {
  10665. this.ui.closeNode.closeBtn.visible = false;
  10666. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10667. this.ui.closeNode.closeBtn.visible = true;
  10668. });
  10669. }
  10670. PlatMgr.showRateBanner();
  10671. }
  10672. hide() {
  10673. Laya.timer.clearAll(this);
  10674. super.hide();
  10675. }
  10676. checkFree() {
  10677. let isFree = DataMgr.getDailyfreeDrawTimes();
  10678. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10679. }
  10680. initDraw() {
  10681. this.drawObj = [];
  10682. let data = cfgTable.drawData;
  10683. let temp;
  10684. let weight = 0;
  10685. for (const key in data) {
  10686. temp = data[key];
  10687. weight += temp.weight;
  10688. this.drawObj.push(weight);
  10689. }
  10690. this.allWeight = weight;
  10691. }
  10692. initUI() {
  10693. let data = cfgTable.drawData;
  10694. let temp;
  10695. let img;
  10696. let txt;
  10697. for (const key in data) {
  10698. temp = data[key];
  10699. img = this.ui.myNode.rotNode["img" + key];
  10700. txt = this.ui.myNode.rotNode["txt" + key];
  10701. img.url = xGame.common.getGameIconUrl(temp.icon);
  10702. txt.visible = true;
  10703. if (temp.award > 2) {
  10704. img.rotation = 0;
  10705. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10706. }
  10707. else {
  10708. img.rotation = temp.rotation;
  10709. txt.text = temp.num;
  10710. }
  10711. }
  10712. }
  10713. getCurkey() {
  10714. let rand = Math.random() * this.allWeight;
  10715. let temp;
  10716. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10717. temp = this.drawObj[index];
  10718. if (index == 0) {
  10719. if (rand < temp) {
  10720. return index + 1;
  10721. }
  10722. }
  10723. else {
  10724. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10725. return index + 1;
  10726. }
  10727. }
  10728. }
  10729. return 2;
  10730. }
  10731. startDraw() {
  10732. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10733. if (freeTimes > 0) {
  10734. this.beginDraw();
  10735. DataMgr.setDailyfreeDrawTimes(0);
  10736. this.checkFree();
  10737. }
  10738. else {
  10739. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  10740. }
  10741. else {
  10742. console.log('zh:AD 失败,直接发放奖励');
  10743. this.qjff_chouJiang();
  10744. }
  10745. }
  10746. }
  10747. qjff_chouJiang() {
  10748. this.beginDraw();
  10749. }
  10750. beginDraw() {
  10751. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10752. this.ui.drawBtn.touchable = false;
  10753. this.curKey = this.getCurkey();
  10754. console.log("当前key", this.curKey);
  10755. let cell = 60;
  10756. let lap = 3;
  10757. let angle = cell * (this.curKey - 1) + lap * 360;
  10758. let target = this.ui.myNode.rotNode;
  10759. target.rotation = 0;
  10760. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10761. console.log("旋转完成");
  10762. this.ui.drawBtn.touchable = true;
  10763. this.getAward();
  10764. }));
  10765. }
  10766. getAward() {
  10767. let data = cfgTable.drawData[this.curKey];
  10768. let temp = new AwardType();
  10769. temp.type = data.award;
  10770. temp.num = data.num;
  10771. xGame.common.getAward([temp], () => {
  10772. DataMgr.setDrawTimes(1);
  10773. this.updateDraw();
  10774. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10775. });
  10776. }
  10777. updateDraw() {
  10778. let drawTimes = DataMgr.getDrawTimes();
  10779. let awardTimes = DataMgr.getDrawAwardTimes();
  10780. if (Math.floor(drawTimes / 3) > awardTimes) {
  10781. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10782. this.ui.extraNode.boxBtn.touchable = true;
  10783. this.ui.extraNode.tipsTxt.text = "3/3";
  10784. this.ui.extraNode.barNode.width = 265;
  10785. this.getExtraAward();
  10786. }
  10787. else {
  10788. this.ui.extraNode.boxBtn.t0.stop();
  10789. this.ui.extraNode.boxBtn.touchable = false;
  10790. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10791. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10792. }
  10793. let data = cfgTable.drawData[1];
  10794. if (awardTimes == 0) {
  10795. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10796. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10797. this.ui.myNode.rotNode.img1.rotation = 0;
  10798. }
  10799. else {
  10800. let award = data.nextid;
  10801. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10802. this.ui.myNode.rotNode.txt1.text = award[1];
  10803. this.ui.myNode.rotNode.img1.rotation = 0;
  10804. }
  10805. }
  10806. getExtraAward() {
  10807. let drawTimes = DataMgr.getDrawTimes();
  10808. let awardTimes = DataMgr.getDrawAwardTimes();
  10809. let data = cfgTable.drawData[1];
  10810. let award = new AwardType();
  10811. if (awardTimes == 0) {
  10812. award.num = data.num;
  10813. award.type = data.award;
  10814. xGame.common.getAward([award], () => {
  10815. let all = Math.floor(drawTimes / 3);
  10816. DataMgr.setDrawAwardTimes(all);
  10817. this.updateDraw();
  10818. });
  10819. }
  10820. else {
  10821. award.num = parseInt(data.nextid[1]);
  10822. award.type = parseInt(data.nextid[0]);
  10823. xGame.common.getAward([award], () => {
  10824. let all = Math.floor(drawTimes / 3);
  10825. DataMgr.setDrawAwardTimes(all);
  10826. this.updateDraw();
  10827. });
  10828. }
  10829. }
  10830. closeSelf() {
  10831. this.hide();
  10832. }
  10833. playSecretaryIdle() {
  10834. let parent = this.ui.secretary.displayObject;
  10835. parent.destroyChildren();
  10836. let xx = this.ui.secretary.width / 2;
  10837. let yy = this.ui.secretary.height;
  10838. let scale = xGame.common.getSecretaryScale();
  10839. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10840. xGame.common.secretary.play(data, 0, true, parent);
  10841. }
  10842. }
  10843. UIDraw.uiName = "UIDraw";
  10844. class ui_UIFlyEft extends fgui.GComponent {
  10845. static createInstance() {
  10846. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10847. }
  10848. onConstruct() {
  10849. this.n0 = (this.getChild("n0"));
  10850. this.n1 = (this.getChild("n1"));
  10851. this.n2 = (this.getChild("n2"));
  10852. this.n3 = (this.getChild("n3"));
  10853. this.n4 = (this.getChild("n4"));
  10854. this.n5 = (this.getChild("n5"));
  10855. this.n6 = (this.getChild("n6"));
  10856. this.n7 = (this.getChild("n7"));
  10857. this.iconNode = (this.getChild("iconNode"));
  10858. this.txt = (this.getChild("txt"));
  10859. this.txtNode = (this.getChild("txtNode"));
  10860. }
  10861. }
  10862. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10863. class UIFlyEft extends UIBase {
  10864. constructor() {
  10865. super();
  10866. this.max = 8;
  10867. this.delay = 0;
  10868. }
  10869. onConstructor() {
  10870. this.ui = ui_UIFlyEft.createInstance();
  10871. this.contentPane = this.ui;
  10872. this.isEject = false;
  10873. this.isMuti = true;
  10874. this.ui.x += xGame.common.sysOffestNum;
  10875. }
  10876. getArrPos() {
  10877. if (this.iconPos && this.iconPos.length > 0)
  10878. return;
  10879. this.iconPos = [];
  10880. let temp;
  10881. for (let index = 0; index < this.max; index++) {
  10882. temp = this.ui["n" + index];
  10883. this.iconPos.push([temp.x, temp.y]);
  10884. }
  10885. }
  10886. show(stPos, edPos, num, type, callback) {
  10887. super.show();
  10888. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10889. this.getArrPos();
  10890. this.updateUI(type);
  10891. this.updatePos();
  10892. this.runFly(edPos, callback);
  10893. this.runWorlds(stPos, num);
  10894. }
  10895. updateUI(type) {
  10896. let temp;
  10897. let str;
  10898. for (let index = 0; index < this.max; index++) {
  10899. temp = this.ui["n" + index];
  10900. str = this.getIconStr(type);
  10901. temp.url = xGame.common.getGameIconUrl(str);
  10902. }
  10903. }
  10904. getIconStr(type) {
  10905. switch (type) {
  10906. case Prop.diamond:
  10907. return "ty_zs";
  10908. case Prop.coin:
  10909. return "ty_jb";
  10910. default:
  10911. break;
  10912. }
  10913. }
  10914. updatePos() {
  10915. let temp;
  10916. for (let index = 0; index < this.max; index++) {
  10917. temp = this.ui["n" + index];
  10918. temp.x = this.iconPos[index][0];
  10919. temp.y = this.iconPos[index][1];
  10920. }
  10921. }
  10922. runFly(endPos, callback) {
  10923. let all = 0;
  10924. let temp;
  10925. for (let index = 0; index < this.max; index++) {
  10926. temp = this.ui["n" + index];
  10927. temp.visible = true;
  10928. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10929. temp.visible = false;
  10930. all++;
  10931. if (all >= this.max) {
  10932. callback && callback();
  10933. }
  10934. }), 20 * index);
  10935. }
  10936. }
  10937. runWorlds(stPos, num) {
  10938. let str = "+" + num;
  10939. this.ui.txt.text = str;
  10940. let starX = stPos.x;
  10941. let starY = stPos.y + 50;
  10942. this.ui.txt.x = starX;
  10943. this.ui.txt.y = starY;
  10944. this.ui.txt.visible = true;
  10945. this.ui.txt.alpha = 1;
  10946. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10947. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10948. this.ui.txt.visible = false;
  10949. this.hide();
  10950. }));
  10951. }));
  10952. }
  10953. }
  10954. UIFlyEft.uiName = "UIFlyEft";
  10955. class Common {
  10956. constructor() {
  10957. this.convertNum = 0.025;
  10958. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10959. this.scaleV3One = new Laya.Vector3();
  10960. this.scaleV3Two = new Laya.Vector3();
  10961. this.posV4 = new Laya.Vector4();
  10962. this.showDebug = false;
  10963. this.openGuide = true;
  10964. this.rodOffest = new Laya.Vector2(0, 0);
  10965. this.rodAngle = 0;
  10966. this.gameMode = GameMode.classic;
  10967. this.bigMoveLevelIndex = 1;
  10968. this.bigMoveNeedCoin = 1000;
  10969. this.classicNiceNeddCoin = 1000;
  10970. this.passAwardCoin = 2000;
  10971. this.classicRoomType = 1;
  10972. this.maxPower = 20;
  10973. this.natureMaxPower = 5;
  10974. this.videoPower = 2;
  10975. this.powerRecoverNum = 900;
  10976. this.curPlayerSkillType = 0;
  10977. this.isNewDay = false;
  10978. this.clickedBall = false;
  10979. this.placeBallCurLevel = 0;
  10980. this.placeBallStarNum = 0;
  10981. this.longHelpLine = false;
  10982. this.maxShareDiamondTimes = 3;
  10983. this.guideStep = 0;
  10984. this.temSelfLevel = 0;
  10985. this.extraMoveNum = 0;
  10986. this.curRankID = 0;
  10987. this.rankID = {
  10988. normalStar: 12000,
  10989. wxStar: 12001
  10990. };
  10991. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  10992. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  10993. this.btnClickStr = "buttonclick";
  10994. this.maxSkillLevel = 10;
  10995. this.upSkillLevel = false;
  10996. this.gameStartTime = 0;
  10997. this._sysOffestNum = 0;
  10998. this.angleV2 = new Laya.Vector2();
  10999. this.rootV = new Laya.Vector2(0, 1);
  11000. this.tempDir1 = new Laya.Vector2();
  11001. this.tempDir2 = new Laya.Vector2();
  11002. this.ballSize = 33;
  11003. this.stPos = new Laya.Point();
  11004. this.edPos = new Laya.Point();
  11005. Common._instance = this;
  11006. window["common"] = this;
  11007. }
  11008. static getInstance() {
  11009. if (!this._instance) {
  11010. this._instance = new Common();
  11011. }
  11012. return this._instance;
  11013. }
  11014. get sysOffestNum() {
  11015. if (this._sysOffestNum == 0) {
  11016. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  11017. }
  11018. return this._sysOffestNum;
  11019. }
  11020. testShader() {
  11021. let test = new LightShader();
  11022. test.texture = "res/d3Res/ballTexture/ball1.png";
  11023. Laya.stage.addChild(test);
  11024. }
  11025. playScale(node) {
  11026. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  11027. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  11028. }));
  11029. }));
  11030. }
  11031. setGroup(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.collisionGroup = out;
  11042. }
  11043. setCanGroupWith(colli, ...group) {
  11044. let out = 0;
  11045. for (let index = 0; index < group.length; index++) {
  11046. if (index == 0) {
  11047. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11048. }
  11049. else {
  11050. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11051. }
  11052. }
  11053. colli.canCollideWith = out;
  11054. }
  11055. loadPrefab(name, callback) {
  11056. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  11057. let prefab = new Laya.Prefab();
  11058. prefab.json = obj;
  11059. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  11060. callback && callback(img);
  11061. }));
  11062. }
  11063. pos2to3Convert(x, y, d3Pos) {
  11064. x = x + this.sysOffestNum;
  11065. d3Pos.setValue(x, y, 0);
  11066. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  11067. if (success) {
  11068. }
  11069. else {
  11070. console.error("转换出错了。。。。。。。。");
  11071. }
  11072. }
  11073. scale2to3Convert(num) {
  11074. this.scaleV3One.setValue(0, 0, 0);
  11075. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  11076. this.scaleV3Two.setValue(0, num, 0);
  11077. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  11078. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  11079. return outNum;
  11080. }
  11081. pos3to2Convert(d3Pos) {
  11082. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  11083. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  11084. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  11085. d3Pos.x -= this.sysOffestNum;
  11086. }
  11087. scale3to2Convert(num) {
  11088. let scale = this.scale2to3Convert(1);
  11089. let d2Out = num / scale;
  11090. return d2Out;
  11091. }
  11092. getCollider(type, restitution = 0.9, density = 10) {
  11093. let colli;
  11094. if (type == "box")
  11095. colli = new Laya.BoxCollider();
  11096. else
  11097. colli = new Laya.CircleCollider();
  11098. colli.friction = 0;
  11099. colli.restitution = restitution;
  11100. colli.density = density;
  11101. return colli;
  11102. }
  11103. getRigbody() {
  11104. let rigy = new Laya.RigidBody();
  11105. rigy.bullet = true;
  11106. rigy.allowRotation = false;
  11107. rigy.allowSleep = false;
  11108. rigy.gravityScale = 0;
  11109. return rigy;
  11110. }
  11111. getfguiRotation(x, y) {
  11112. this.angleV2.setValue(x, y);
  11113. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11114. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11115. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  11116. angle = -angle;
  11117. }
  11118. return 180 + angle;
  11119. }
  11120. getAngle(x, y) {
  11121. this.angleV2.setValue(x, y);
  11122. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11123. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11124. return angle;
  11125. }
  11126. randomNum(a, b) {
  11127. return a + Math.floor((b - a + 1) * Math.random());
  11128. }
  11129. getRandArrEle(arr) {
  11130. return arr[Math.floor(arr.length * Math.random())];
  11131. }
  11132. getSign(val) {
  11133. return val >= 0 ? 1 : -1;
  11134. }
  11135. botherArr(arr) {
  11136. let times = arr.length + 2;
  11137. let length = arr.length;
  11138. let a;
  11139. let b;
  11140. let temp;
  11141. for (let index = 0; index < times; index++) {
  11142. a = Math.floor(Math.random() * length);
  11143. b = Math.floor(Math.random() * length);
  11144. temp = arr[a];
  11145. arr[a] = arr[b];
  11146. arr[b] = temp;
  11147. }
  11148. }
  11149. getGameIconUrl(id) {
  11150. return "ui://game/" + id;
  11151. }
  11152. getComponentUrl(id) {
  11153. return "ui://game/" + id;
  11154. }
  11155. getAnimation() {
  11156. }
  11157. judgeSkillType(type = SkillType.highSpace) {
  11158. if (this.gameMode == GameMode.classic)
  11159. return;
  11160. let gameMgr = this.gameMgr;
  11161. if (gameMgr.selfTurn) {
  11162. if (gameMgr.selfCurSkill == type) {
  11163. return true;
  11164. }
  11165. }
  11166. else {
  11167. if (gameMgr.aiCurSkill == type) {
  11168. return true;
  11169. }
  11170. }
  11171. }
  11172. ballColliHole(collider) {
  11173. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11174. xGame.common.gameMgr.isFirstInGame = false;
  11175. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11176. }
  11177. collider.owner.mySrc.checkWrongBall();
  11178. }
  11179. getArrMaxEle(arr) {
  11180. let max = -Infinity;
  11181. for (let index = 0; index < arr.length; index++) {
  11182. max = Math.max(arr[index], max);
  11183. }
  11184. return max;
  11185. }
  11186. getArrMinEle(arr) {
  11187. let min = Infinity;
  11188. for (let index = 0; index < arr.length; index++) {
  11189. min = Math.min(arr[index], min);
  11190. }
  11191. return min;
  11192. }
  11193. playRandomMutiBallBigSkillSound() {
  11194. if (Math.random() <= 0.5)
  11195. return;
  11196. let rand = this.randomNum(1, 6);
  11197. let str = "ganfa0" + rand;
  11198. xGame.soundMgr.playSound(str);
  11199. }
  11200. showOneCamera(type) {
  11201. let object = xGame.common.d3World.cameraObj;
  11202. for (const key in object) {
  11203. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11204. object[key].init();
  11205. object[key].owner.active = key == type;
  11206. }
  11207. }
  11208. }
  11209. checkBallOverBorder(x, y) {
  11210. let radius = 17;
  11211. let condition = this._checkBorder(x + radius, y) ||
  11212. this._checkBorder(x - radius, y) ||
  11213. this._checkBorder(x, y + radius) ||
  11214. this._checkBorder(x, y - radius);
  11215. if (condition) {
  11216. return true;
  11217. }
  11218. }
  11219. _checkBorder(x, y) {
  11220. let borderRect = this.d2World.borderRect;
  11221. let xOffest = 20;
  11222. let yOffest = 20;
  11223. if (y <= borderRect.y - yOffest) {
  11224. return true;
  11225. }
  11226. if (y >= borderRect.y + borderRect.height + yOffest) {
  11227. return true;
  11228. }
  11229. if (x <= borderRect.x - xOffest) {
  11230. return true;
  11231. }
  11232. if (x >= borderRect.x + borderRect.width + xOffest) {
  11233. return true;
  11234. }
  11235. }
  11236. initWeight(cfg) {
  11237. let allCfgData = { data: {}, allWeightNum: 0 };
  11238. let weightCfg = allCfgData.data;
  11239. let weight = 0;
  11240. for (const key in cfg) {
  11241. weightCfg[key] = {};
  11242. weightCfg[key].id = cfg[key].id;
  11243. weightCfg[key].minWeight = weight;
  11244. weight += cfg[key].weight;
  11245. weightCfg[key].maxWeight = weight;
  11246. }
  11247. allCfgData.allWeightNum = weight;
  11248. return allCfgData;
  11249. }
  11250. getRandomWeightData(cfg) {
  11251. let weightCfg = cfg.data;
  11252. let allWeightNum = cfg.allWeightNum;
  11253. let rand = Math.floor(Math.random() * allWeightNum);
  11254. for (const key in weightCfg) {
  11255. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11256. return weightCfg[key];
  11257. }
  11258. }
  11259. return weightCfg[1];
  11260. }
  11261. showGirlTalkPop(wordsIndex, node, msgNode) {
  11262. node.visible = true;
  11263. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11264. node.t0.play(Laya.Handler.create(this, () => {
  11265. node.visible = false;
  11266. }));
  11267. }
  11268. stopGirlPop(node) {
  11269. node.t0.stop();
  11270. node.visible = false;
  11271. }
  11272. createHead(loader, url, size = 107) {
  11273. console.log('zh:createHead url=', url);
  11274. if (Laya.Browser.name == "Browser") {
  11275. loader.url = url;
  11276. return;
  11277. }
  11278. if (Moyu.isTT) {
  11279. let localImage = new Image();
  11280. localImage.src = url;
  11281. localImage.onload = () => {
  11282. let t2d = new Laya.Texture2D();
  11283. t2d.width = size;
  11284. t2d.height = size;
  11285. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  11286. t2d.loadImageSource(localImage);
  11287. };
  11288. }
  11289. else {
  11290. console.log('zh:url=', url);
  11291. loader.url = url;
  11292. }
  11293. }
  11294. addTestCoin(num) {
  11295. DataMgr.setCoin(num);
  11296. }
  11297. addTestDiamond(num) {
  11298. DataMgr.setDiamond(num);
  11299. }
  11300. addTestSkill() {
  11301. DataMgr.setBigSkill(0, 99);
  11302. DataMgr.setBigSkill(1, 99);
  11303. DataMgr.setBigSkill(2, 99);
  11304. }
  11305. playClassicEmotion(number, x, y) {
  11306. if (this.gameMode == GameMode.bigMove)
  11307. return;
  11308. let randIndex = this.randomNum(0, 2);
  11309. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11310. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11311. if (this.gameMgr.selfTurn) {
  11312. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11313. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11314. }
  11315. else {
  11316. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11317. }
  11318. else {
  11319. if (number == this.gameMgr.blackNum) {
  11320. if (this.gameMgr.selfBallArr.length == 0) {
  11321. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11322. }
  11323. else {
  11324. }
  11325. }
  11326. else {
  11327. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11328. }
  11329. }
  11330. }
  11331. }
  11332. else {
  11333. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11334. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11335. }
  11336. else {
  11337. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11338. }
  11339. else {
  11340. if (number == this.gameMgr.blackNum) {
  11341. if (this.gameMgr.aiBallArr.length == 0) {
  11342. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11343. }
  11344. else {
  11345. }
  11346. }
  11347. else {
  11348. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11349. }
  11350. }
  11351. }
  11352. }
  11353. }
  11354. playHappySound(number) {
  11355. if (this.gameMode != GameMode.classic)
  11356. return;
  11357. if (number == 8)
  11358. return;
  11359. let play = false;
  11360. if (this.gameMgr.selfTurn) {
  11361. if (this.gameMgr.ensureBallType) {
  11362. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11363. play = true;
  11364. }
  11365. }
  11366. else {
  11367. play = true;
  11368. }
  11369. }
  11370. else {
  11371. if (this.gameMgr.ensureBallType) {
  11372. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11373. play = true;
  11374. }
  11375. }
  11376. else {
  11377. play = true;
  11378. }
  11379. }
  11380. if (play)
  11381. xGame.soundMgr.playSound("applause");
  11382. }
  11383. destroyClassicEmotion() {
  11384. if (this.gameMode == GameMode.bigMove)
  11385. return;
  11386. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11387. parent.destroyChildren();
  11388. }
  11389. playAwardSpine(x, y) {
  11390. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11391. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11392. this.awardSpine.play(data, 0, false, parent);
  11393. }
  11394. destroyAwardSpine() {
  11395. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11396. parent.destroyChildren();
  11397. }
  11398. isBlock(bx, by, hx, hy, except = null) {
  11399. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  11400. let balls = xGame.common.d2World.ballArr;
  11401. let outArr = [];
  11402. for (let index = 0; index < balls.length; index++) {
  11403. let obj = balls[index];
  11404. if (obj.number == 0)
  11405. continue;
  11406. if (obj == except)
  11407. continue;
  11408. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  11409. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  11410. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  11411. if (num >= 1)
  11412. num = 1;
  11413. if (num < 0)
  11414. continue;
  11415. let gap = Math.sin(Math.acos(num)) * dis;
  11416. if (gap < this.ballSize) {
  11417. outArr.push({
  11418. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  11419. disHon: Math.cos(Math.acos(num)) * dis,
  11420. disVer: Math.sin(Math.acos(num)) * dis,
  11421. src: balls[index],
  11422. dir: this.tempDir1
  11423. });
  11424. }
  11425. }
  11426. if (outArr.length > 0) {
  11427. outArr.sort((a, b) => { return a.dis - b.dis; });
  11428. return outArr[0];
  11429. }
  11430. }
  11431. AngleBetween(vector1, vector2) {
  11432. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  11433. return rad * (180 / Math.PI);
  11434. }
  11435. getSecretaryScale() {
  11436. if (this.secretary.spineName == "mishu") {
  11437. return 1.28;
  11438. }
  11439. else {
  11440. return 1.024;
  11441. }
  11442. }
  11443. signAwardContainsRod(arr) {
  11444. let temp;
  11445. for (let index = 0; index < arr.length; index++) {
  11446. temp = arr[index].split('-')[0];
  11447. if (parseInt(temp) > 2) {
  11448. return true;
  11449. }
  11450. }
  11451. }
  11452. judgeSameDay() {
  11453. let lastTime = DataMgr.getSignTime();
  11454. let curTime = new Date().getTime();
  11455. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  11456. return true;
  11457. }
  11458. return false;
  11459. }
  11460. getAward(arr, callback) {
  11461. let showTriple = arr[0].type <= 2;
  11462. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  11463. let temp;
  11464. for (let index = 0; index < arr.length; index++) {
  11465. temp = arr[index];
  11466. switch (temp.type) {
  11467. case 1:
  11468. this.playObjFlyAnim(temp.num, temp.type);
  11469. break;
  11470. case 2:
  11471. this.playObjFlyAnim(temp.num, temp.type);
  11472. break;
  11473. case 3:
  11474. case 4:
  11475. case 5:
  11476. case 6:
  11477. DataMgr.setBallRod(temp.type - 2, 1);
  11478. DataMgr.setCurBallRod(temp.type - 2);
  11479. break;
  11480. default:
  11481. break;
  11482. }
  11483. }
  11484. callback && callback(watchVideo);
  11485. });
  11486. }
  11487. getMoneyNode() {
  11488. let moneyNode;
  11489. let sign = xGame.uiMgr.getUI(UISign);
  11490. let draw = xGame.uiMgr.getUI(UIDraw);
  11491. let end = xGame.uiMgr.getUI(UIGameEnd);
  11492. let skill = xGame.uiMgr.getUI(UISkill);
  11493. if (sign && !sign.isHide)
  11494. moneyNode = sign.ui.moneyNode;
  11495. if (draw && !draw.isHide)
  11496. moneyNode = draw.ui.moneyNode;
  11497. if (end && !end.isHide)
  11498. moneyNode = end.ui.moneyNode;
  11499. if (skill && !skill.isHide)
  11500. moneyNode = skill.ui.moneyNode;
  11501. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11502. let main = xGame.uiMgr.getUI(UIMain);
  11503. if (condition1 && main && !main.isHide) {
  11504. moneyNode = main.ui.moneyNode;
  11505. }
  11506. return moneyNode;
  11507. }
  11508. playObjFlyAnim(num, type, callback = null) {
  11509. this.stPos.x = Laya.stage.width / 2;
  11510. this.stPos.y = Laya.stage.height / 2;
  11511. let moneyNode = this.getMoneyNode();
  11512. switch (type) {
  11513. case Prop.diamond:
  11514. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11515. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11516. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11517. this.edPos.x /= 2;
  11518. this.edPos.y /= 2;
  11519. break;
  11520. case Prop.coin:
  11521. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11522. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11523. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11524. this.edPos.x /= 2;
  11525. this.edPos.y /= 2;
  11526. break;
  11527. default:
  11528. break;
  11529. }
  11530. xGame.soundMgr.playSound("coinbag");
  11531. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11532. switch (type) {
  11533. case Prop.diamond:
  11534. DataMgr.setDiamond(num);
  11535. break;
  11536. case Prop.coin:
  11537. DataMgr.setCoin(num);
  11538. break;
  11539. default:
  11540. break;
  11541. }
  11542. callback && callback();
  11543. });
  11544. }
  11545. autoPopUIView() {
  11546. let arr = [];
  11547. let sign = this.judgeSameDay() ? false : true;
  11548. if (sign)
  11549. arr.push("sign");
  11550. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11551. if (draw)
  11552. arr.push("draw");
  11553. if (arr.length <= 0)
  11554. return;
  11555. let str = this.getRandArrEle(arr);
  11556. switch (str) {
  11557. case "sign":
  11558. xGame.uiMgr.Show(UISign);
  11559. break;
  11560. case "draw":
  11561. xGame.uiMgr.Show(UIDraw);
  11562. break;
  11563. default:
  11564. break;
  11565. }
  11566. }
  11567. getMSTime(time) {
  11568. let min = Math.floor(time / 60);
  11569. let sec = Math.floor((time - min * 60));
  11570. if (sec < 10)
  11571. sec = "0" + sec;
  11572. if (min < 10)
  11573. min = "0" + min;
  11574. return `${min}:${sec}`;
  11575. }
  11576. testPower() {
  11577. DataMgr.setPower(0, false);
  11578. }
  11579. getAllStarNum() {
  11580. let data = DataMgr.getPlaceBallLevelList();
  11581. let out = 0;
  11582. for (let index = 0; index < data.length; index++) {
  11583. out += data[index].star;
  11584. }
  11585. return out;
  11586. }
  11587. recoverCameraView() {
  11588. Laya.timer.once(900, this, () => {
  11589. xGame.common.showOneCamera("mainCamera");
  11590. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11591. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11592. xGame.common.gameUI.ui.border.alpha = 0;
  11593. if (Laya.physicsTimer.scale < 1) {
  11594. Laya.physicsTimer.scale = 1;
  11595. }
  11596. }
  11597. });
  11598. }
  11599. getClassicLevel() {
  11600. let successTimes = DataMgr.getClassicTimes();
  11601. let needKey = "";
  11602. let lastKey = "";
  11603. let cfg = cfgTable.classictimesData;
  11604. let data;
  11605. for (const key in cfg) {
  11606. data = cfg[key];
  11607. if (successTimes <= data.times) {
  11608. needKey = key;
  11609. }
  11610. lastKey = key;
  11611. }
  11612. if (needKey == "")
  11613. needKey = lastKey;
  11614. return cfg[needKey];
  11615. }
  11616. }
  11617. Common._instance = null;
  11618. class ui_Component92 extends fgui.GComponent {
  11619. static createInstance() {
  11620. return (fgui.UIPackage.createObject("game", "Component92"));
  11621. }
  11622. onConstruct() {
  11623. this.n0 = (this.getChild("n0"));
  11624. }
  11625. }
  11626. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11627. class ui_Component129 extends fgui.GProgressBar {
  11628. static createInstance() {
  11629. return (fgui.UIPackage.createObject("game", "Component129"));
  11630. }
  11631. onConstruct() {
  11632. this.bar_v = (this.getChild("bar_v"));
  11633. this.n84 = (this.getChild("n84"));
  11634. }
  11635. }
  11636. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11637. class ui_Component130 extends fgui.GComponent {
  11638. static createInstance() {
  11639. return (fgui.UIPackage.createObject("game", "Component130"));
  11640. }
  11641. onConstruct() {
  11642. this.ani = (this.getChild("ani"));
  11643. this.t0 = this.getTransition("t0");
  11644. }
  11645. }
  11646. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11647. class ui_powerEft extends fgui.GComponent {
  11648. static createInstance() {
  11649. return (fgui.UIPackage.createObject("game", "powerEft"));
  11650. }
  11651. onConstruct() {
  11652. this.ani = (this.getChild("ani"));
  11653. this.n88 = (this.getChild("n88"));
  11654. this.n89 = (this.getChild("n89"));
  11655. }
  11656. }
  11657. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11658. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11659. static createInstance() {
  11660. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11661. }
  11662. onConstruct() {
  11663. this.c1 = this.getController("c1");
  11664. this.n2 = (this.getChild("n2"));
  11665. this.n22 = (this.getChild("n22"));
  11666. this.n23 = (this.getChild("n23"));
  11667. this.n15 = (this.getChild("n15"));
  11668. this.challenge = (this.getChild("challenge"));
  11669. this.n17 = (this.getChild("n17"));
  11670. this.n3 = (this.getChild("n3"));
  11671. this.starNode = (this.getChild("starNode"));
  11672. this.levelTxt = (this.getChild("levelTxt"));
  11673. this.n14 = (this.getChild("n14"));
  11674. this.n19 = (this.getChild("n19"));
  11675. this.n20 = (this.getChild("n20"));
  11676. this.n21 = (this.getChild("n21"));
  11677. this.special = (this.getChild("special"));
  11678. }
  11679. }
  11680. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11681. class ui_Component79 extends fgui.GComponent {
  11682. static createInstance() {
  11683. return (fgui.UIPackage.createObject("game", "Component79"));
  11684. }
  11685. onConstruct() {
  11686. this.c1 = this.getController("c1");
  11687. this.n7 = (this.getChild("n7"));
  11688. this.n8 = (this.getChild("n8"));
  11689. this.n9 = (this.getChild("n9"));
  11690. this.n10 = (this.getChild("n10"));
  11691. this.n11 = (this.getChild("n11"));
  11692. this.n12 = (this.getChild("n12"));
  11693. }
  11694. }
  11695. ui_Component79.URL = "ui://isxx5ak7avag477";
  11696. class ui_Component80 extends fgui.GComponent {
  11697. static createInstance() {
  11698. return (fgui.UIPackage.createObject("game", "Component80"));
  11699. }
  11700. onConstruct() {
  11701. this.n0 = (this.getChild("n0"));
  11702. this.n1 = (this.getChild("n1"));
  11703. this.myList = (this.getChild("myList"));
  11704. this.t0 = this.getTransition("t0");
  11705. }
  11706. }
  11707. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11708. class ui_SignNormal extends fgui.GComponent {
  11709. static createInstance() {
  11710. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11711. }
  11712. onConstruct() {
  11713. this.c1 = this.getController("c1");
  11714. this.n7 = (this.getChild("n7"));
  11715. this.n15 = (this.getChild("n15"));
  11716. this.titleTxt = (this.getChild("titleTxt"));
  11717. this.n8 = (this.getChild("n8"));
  11718. this.myIcon = (this.getChild("myIcon"));
  11719. this.numTxt = (this.getChild("numTxt"));
  11720. this.n12 = (this.getChild("n12"));
  11721. this.n13 = (this.getChild("n13"));
  11722. this.n17 = (this.getChild("n17"));
  11723. this.n14 = (this.getChild("n14"));
  11724. }
  11725. }
  11726. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11727. class ui_screenNode extends fgui.GComponent {
  11728. static createInstance() {
  11729. return (fgui.UIPackage.createObject("game", "screenNode"));
  11730. }
  11731. onConstruct() {
  11732. this.n9 = (this.getChild("n9"));
  11733. this.screenImg = (this.getChild("screenImg"));
  11734. }
  11735. }
  11736. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11737. class ui_GetAwrad_com1 extends fgui.GComponent {
  11738. static createInstance() {
  11739. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11740. }
  11741. onConstruct() {
  11742. this.n38 = (this.getChild("n38"));
  11743. this.n39 = (this.getChild("n39"));
  11744. this.n40 = (this.getChild("n40"));
  11745. this.t0 = this.getTransition("t0");
  11746. this.t1 = this.getTransition("t1");
  11747. }
  11748. }
  11749. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11750. class ui_GetAwrad_com2 extends fgui.GComponent {
  11751. static createInstance() {
  11752. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11753. }
  11754. onConstruct() {
  11755. this.n39 = (this.getChild("n39"));
  11756. this.n40 = (this.getChild("n40"));
  11757. this.t0 = this.getTransition("t0");
  11758. }
  11759. }
  11760. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11761. class ui_Component128 extends fgui.GComponent {
  11762. static createInstance() {
  11763. return (fgui.UIPackage.createObject("game", "Component128"));
  11764. }
  11765. onConstruct() {
  11766. this.n38 = (this.getChild("n38"));
  11767. this.n40 = (this.getChild("n40"));
  11768. }
  11769. }
  11770. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11771. class ui_Component100_1 extends fgui.GComponent {
  11772. static createInstance() {
  11773. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11774. }
  11775. onConstruct() {
  11776. this.myNode = (this.getChild("myNode"));
  11777. this.t0 = this.getTransition("t0");
  11778. }
  11779. }
  11780. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11781. class ui_Component142 extends fgui.GComponent {
  11782. static createInstance() {
  11783. return (fgui.UIPackage.createObject("game", "Component142"));
  11784. }
  11785. onConstruct() {
  11786. this.n41 = (this.getChild("n41"));
  11787. this.n42 = (this.getChild("n42"));
  11788. }
  11789. }
  11790. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11791. class ui_main_guang extends fgui.GComponent {
  11792. static createInstance() {
  11793. return (fgui.UIPackage.createObject("game", "main_guang"));
  11794. }
  11795. onConstruct() {
  11796. this.n1 = (this.getChild("n1"));
  11797. this.n2 = (this.getChild("n2"));
  11798. this.n3 = (this.getChild("n3"));
  11799. this.n4 = (this.getChild("n4"));
  11800. this.n5 = (this.getChild("n5"));
  11801. this.n6 = (this.getChild("n6"));
  11802. this.n8 = (this.getChild("n8"));
  11803. this.t0 = this.getTransition("t0");
  11804. }
  11805. }
  11806. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11807. class ui_try_com1 extends fgui.GComponent {
  11808. static createInstance() {
  11809. return (fgui.UIPackage.createObject("game", "try_com1"));
  11810. }
  11811. onConstruct() {
  11812. this.c1 = this.getController("c1");
  11813. this.n0 = (this.getChild("n0"));
  11814. this.n2 = (this.getChild("n2"));
  11815. this.cancelBtn = (this.getChild("cancelBtn"));
  11816. this.videoBtn = (this.getChild("videoBtn"));
  11817. this.n9 = (this.getChild("n9"));
  11818. this.n24 = (this.getChild("n24"));
  11819. this.titleTxt = (this.getChild("titleTxt"));
  11820. this.n32 = (this.getChild("n32"));
  11821. this.n29 = (this.getChild("n29"));
  11822. this.n36 = (this.getChild("n36"));
  11823. this.txtTime = (this.getChild("txtTime"));
  11824. this.t0 = this.getTransition("t0");
  11825. }
  11826. }
  11827. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11828. class ui_try_com2 extends fgui.GComponent {
  11829. static createInstance() {
  11830. return (fgui.UIPackage.createObject("game", "try_com2"));
  11831. }
  11832. onConstruct() {
  11833. this.skillicon = (this.getChild("skillicon"));
  11834. this.n35 = (this.getChild("n35"));
  11835. this.n31 = (this.getChild("n31"));
  11836. this.n32 = (this.getChild("n32"));
  11837. this.n33 = (this.getChild("n33"));
  11838. this.n34 = (this.getChild("n34"));
  11839. }
  11840. }
  11841. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11842. class ui_try_com3 extends fgui.GComponent {
  11843. static createInstance() {
  11844. return (fgui.UIPackage.createObject("game", "try_com3"));
  11845. }
  11846. onConstruct() {
  11847. this.n33 = (this.getChild("n33"));
  11848. this.n34 = (this.getChild("n34"));
  11849. this.n35 = (this.getChild("n35"));
  11850. this.t0 = this.getTransition("t0");
  11851. }
  11852. }
  11853. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11854. class ui_huihe1 extends fgui.GComponent {
  11855. static createInstance() {
  11856. return (fgui.UIPackage.createObject("game", "huihe1"));
  11857. }
  11858. onConstruct() {
  11859. this.n0 = (this.getChild("n0"));
  11860. this.n1 = (this.getChild("n1"));
  11861. this.t0 = this.getTransition("t0");
  11862. }
  11863. }
  11864. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11865. class ui_huihe2 extends fgui.GComponent {
  11866. static createInstance() {
  11867. return (fgui.UIPackage.createObject("game", "huihe2"));
  11868. }
  11869. onConstruct() {
  11870. this.n0 = (this.getChild("n0"));
  11871. this.n1 = (this.getChild("n1"));
  11872. this.t0 = this.getTransition("t0");
  11873. }
  11874. }
  11875. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11876. class ui_Component143 extends fgui.GComponent {
  11877. static createInstance() {
  11878. return (fgui.UIPackage.createObject("game", "Component143"));
  11879. }
  11880. onConstruct() {
  11881. this.n3 = (this.getChild("n3"));
  11882. this.n4 = (this.getChild("n4"));
  11883. this.n5 = (this.getChild("n5"));
  11884. this.n6 = (this.getChild("n6"));
  11885. this.n7 = (this.getChild("n7"));
  11886. this.n8 = (this.getChild("n8"));
  11887. this.n9 = (this.getChild("n9"));
  11888. this.n10 = (this.getChild("n10"));
  11889. this.t0 = this.getTransition("t0");
  11890. }
  11891. }
  11892. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11893. class ui_dh_jingbi2 extends fgui.GComponent {
  11894. static createInstance() {
  11895. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11896. }
  11897. onConstruct() {
  11898. this.n0 = (this.getChild("n0"));
  11899. this.n1 = (this.getChild("n1"));
  11900. this.n2 = (this.getChild("n2"));
  11901. this.n3 = (this.getChild("n3"));
  11902. this.n4 = (this.getChild("n4"));
  11903. this.n5 = (this.getChild("n5"));
  11904. this.n6 = (this.getChild("n6"));
  11905. this.n8 = (this.getChild("n8"));
  11906. this.n10 = (this.getChild("n10"));
  11907. this.t0 = this.getTransition("t0");
  11908. }
  11909. }
  11910. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11911. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11912. static createInstance() {
  11913. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11914. }
  11915. onConstruct() {
  11916. this.n1 = (this.getChild("n1"));
  11917. this.n4 = (this.getChild("n4"));
  11918. this.t0 = this.getTransition("t0");
  11919. }
  11920. }
  11921. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11922. class ui_dh_jingbi3 extends fgui.GComponent {
  11923. static createInstance() {
  11924. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11925. }
  11926. onConstruct() {
  11927. this.n0 = (this.getChild("n0"));
  11928. this.n1 = (this.getChild("n1"));
  11929. this.n2 = (this.getChild("n2"));
  11930. this.n3 = (this.getChild("n3"));
  11931. this.n4 = (this.getChild("n4"));
  11932. this.n5 = (this.getChild("n5"));
  11933. this.n6 = (this.getChild("n6"));
  11934. this.n8 = (this.getChild("n8"));
  11935. this.n10 = (this.getChild("n10"));
  11936. this.t0 = this.getTransition("t0");
  11937. }
  11938. }
  11939. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11940. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11941. static createInstance() {
  11942. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11943. }
  11944. onConstruct() {
  11945. this.n3 = (this.getChild("n3"));
  11946. this.n1 = (this.getChild("n1"));
  11947. this.t0 = this.getTransition("t0");
  11948. }
  11949. }
  11950. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11951. class ui_hb_jinbi1 extends fgui.GButton {
  11952. static createInstance() {
  11953. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11954. }
  11955. onConstruct() {
  11956. this.n20 = (this.getChild("n20"));
  11957. this.n25 = (this.getChild("n25"));
  11958. this.coinTxt = (this.getChild("coinTxt"));
  11959. this.n28 = (this.getChild("n28"));
  11960. this.n32 = (this.getChild("n32"));
  11961. this.n38 = (this.getChild("n38"));
  11962. this.n45 = (this.getChild("n45"));
  11963. this.getTips = (this.getChild("getTips"));
  11964. this.n39 = (this.getChild("n39"));
  11965. this.diamondTxt = (this.getChild("diamondTxt"));
  11966. this.n41 = (this.getChild("n41"));
  11967. this.n42 = (this.getChild("n42"));
  11968. this.n46 = (this.getChild("n46"));
  11969. this.n47 = (this.getChild("n47"));
  11970. this.n48 = (this.getChild("n48"));
  11971. this.t0 = this.getTransition("t0");
  11972. }
  11973. }
  11974. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11975. class ui_hb_jinbi2 extends fgui.GButton {
  11976. static createInstance() {
  11977. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11978. }
  11979. onConstruct() {
  11980. this.n20 = (this.getChild("n20"));
  11981. this.n25 = (this.getChild("n25"));
  11982. this.coinTxt = (this.getChild("coinTxt"));
  11983. this.n28 = (this.getChild("n28"));
  11984. this.n32 = (this.getChild("n32"));
  11985. this.n38 = (this.getChild("n38"));
  11986. this.n39 = (this.getChild("n39"));
  11987. this.diamondTxt = (this.getChild("diamondTxt"));
  11988. this.n41 = (this.getChild("n41"));
  11989. this.n42 = (this.getChild("n42"));
  11990. this.n43 = (this.getChild("n43"));
  11991. this.n44 = (this.getChild("n44"));
  11992. this.n45 = (this.getChild("n45"));
  11993. this.t0 = this.getTransition("t0");
  11994. }
  11995. }
  11996. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11997. class ui_hb_jinbi3 extends fgui.GButton {
  11998. static createInstance() {
  11999. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  12000. }
  12001. onConstruct() {
  12002. this.n20 = (this.getChild("n20"));
  12003. this.n25 = (this.getChild("n25"));
  12004. this.coinTxt = (this.getChild("coinTxt"));
  12005. this.n28 = (this.getChild("n28"));
  12006. this.n32 = (this.getChild("n32"));
  12007. this.n38 = (this.getChild("n38"));
  12008. this.n39 = (this.getChild("n39"));
  12009. this.diamondTxt = (this.getChild("diamondTxt"));
  12010. this.n41 = (this.getChild("n41"));
  12011. this.n42 = (this.getChild("n42"));
  12012. this.n43 = (this.getChild("n43"));
  12013. this.n44 = (this.getChild("n44"));
  12014. this.n45 = (this.getChild("n45"));
  12015. this.t0 = this.getTransition("t0");
  12016. }
  12017. }
  12018. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  12019. class ui_Component104 extends fgui.GComponent {
  12020. static createInstance() {
  12021. return (fgui.UIPackage.createObject("game", "Component104"));
  12022. }
  12023. onConstruct() {
  12024. this.c1 = this.getController("c1");
  12025. this.n12 = (this.getChild("n12"));
  12026. this.coinBtn = (this.getChild("coinBtn"));
  12027. this.diamondBtn = (this.getChild("diamondBtn"));
  12028. this.node3 = (this.getChild("node3"));
  12029. this.node4 = (this.getChild("node4"));
  12030. this.node5 = (this.getChild("node5"));
  12031. this.node1 = (this.getChild("node1"));
  12032. this.node2 = (this.getChild("node2"));
  12033. this.node6 = (this.getChild("node6"));
  12034. this.t0 = this.getTransition("t0");
  12035. }
  12036. }
  12037. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  12038. class ui_Component105 extends fgui.GButton {
  12039. static createInstance() {
  12040. return (fgui.UIPackage.createObject("game", "Component105"));
  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_Component105.URL = "ui://isxx5ak7ehtov4gh";
  12051. class ui_Component106 extends fgui.GButton {
  12052. static createInstance() {
  12053. return (fgui.UIPackage.createObject("game", "Component106"));
  12054. }
  12055. onConstruct() {
  12056. this.c1 = this.getController("c1");
  12057. this.n49 = (this.getChild("n49"));
  12058. this.n18 = (this.getChild("n18"));
  12059. this.n46 = (this.getChild("n46"));
  12060. this.n48 = (this.getChild("n48"));
  12061. }
  12062. }
  12063. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  12064. class ui_hb_zs1 extends fgui.GButton {
  12065. static createInstance() {
  12066. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  12067. }
  12068. onConstruct() {
  12069. this.c1 = this.getController("c1");
  12070. this.n20 = (this.getChild("n20"));
  12071. this.n21 = (this.getChild("n21"));
  12072. this.n26 = (this.getChild("n26"));
  12073. this.n27 = (this.getChild("n27"));
  12074. this.shareTxt = (this.getChild("shareTxt"));
  12075. this.n32 = (this.getChild("n32"));
  12076. this.n38 = (this.getChild("n38"));
  12077. this.n39 = (this.getChild("n39"));
  12078. this.n44 = (this.getChild("n44"));
  12079. this.diamondTxt = (this.getChild("diamondTxt"));
  12080. this.n41 = (this.getChild("n41"));
  12081. this.n45 = (this.getChild("n45"));
  12082. this.n47 = (this.getChild("n47"));
  12083. this.n48 = (this.getChild("n48"));
  12084. this.randTxt = (this.getChild("randTxt"));
  12085. this.n50 = (this.getChild("n50"));
  12086. this.t0 = this.getTransition("t0");
  12087. }
  12088. }
  12089. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  12090. class ui_dh_zs1 extends fgui.GComponent {
  12091. static createInstance() {
  12092. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  12093. }
  12094. onConstruct() {
  12095. this.n10 = (this.getChild("n10"));
  12096. this.n9 = (this.getChild("n9"));
  12097. this.n1 = (this.getChild("n1"));
  12098. this.n2 = (this.getChild("n2"));
  12099. this.n3 = (this.getChild("n3"));
  12100. this.n4 = (this.getChild("n4"));
  12101. this.n5 = (this.getChild("n5"));
  12102. this.n6 = (this.getChild("n6"));
  12103. this.n8 = (this.getChild("n8"));
  12104. this.n11 = (this.getChild("n11"));
  12105. this.t0 = this.getTransition("t0");
  12106. }
  12107. }
  12108. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  12109. class ui_dh_zs1_1 extends fgui.GComponent {
  12110. static createInstance() {
  12111. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  12112. }
  12113. onConstruct() {
  12114. this.n3 = (this.getChild("n3"));
  12115. this.n1 = (this.getChild("n1"));
  12116. this.t0 = this.getTransition("t0");
  12117. }
  12118. }
  12119. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  12120. class ui_hb_zs2 extends fgui.GButton {
  12121. static createInstance() {
  12122. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  12123. }
  12124. onConstruct() {
  12125. this.n20 = (this.getChild("n20"));
  12126. this.n21 = (this.getChild("n21"));
  12127. this.n26 = (this.getChild("n26"));
  12128. this.n27 = (this.getChild("n27"));
  12129. this.n32 = (this.getChild("n32"));
  12130. this.n38 = (this.getChild("n38"));
  12131. this.n39 = (this.getChild("n39"));
  12132. this.n44 = (this.getChild("n44"));
  12133. this.diamondTxt = (this.getChild("diamondTxt"));
  12134. this.n41 = (this.getChild("n41"));
  12135. this.n45 = (this.getChild("n45"));
  12136. this.t0 = this.getTransition("t0");
  12137. }
  12138. }
  12139. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  12140. class ui_hb_zs3 extends fgui.GButton {
  12141. static createInstance() {
  12142. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  12143. }
  12144. onConstruct() {
  12145. this.n20 = (this.getChild("n20"));
  12146. this.n21 = (this.getChild("n21"));
  12147. this.n26 = (this.getChild("n26"));
  12148. this.n27 = (this.getChild("n27"));
  12149. this.n32 = (this.getChild("n32"));
  12150. this.n38 = (this.getChild("n38"));
  12151. this.n47 = (this.getChild("n47"));
  12152. this.t0 = this.getTransition("t0");
  12153. }
  12154. }
  12155. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12156. class ui_dh_zs2 extends fgui.GComponent {
  12157. static createInstance() {
  12158. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12159. }
  12160. onConstruct() {
  12161. this.n10 = (this.getChild("n10"));
  12162. this.n9 = (this.getChild("n9"));
  12163. this.n1 = (this.getChild("n1"));
  12164. this.n2 = (this.getChild("n2"));
  12165. this.n3 = (this.getChild("n3"));
  12166. this.n4 = (this.getChild("n4"));
  12167. this.n5 = (this.getChild("n5"));
  12168. this.n6 = (this.getChild("n6"));
  12169. this.n8 = (this.getChild("n8"));
  12170. this.n11 = (this.getChild("n11"));
  12171. this.t0 = this.getTransition("t0");
  12172. }
  12173. }
  12174. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12175. class ui_dh_zs2_1 extends fgui.GComponent {
  12176. static createInstance() {
  12177. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12178. }
  12179. onConstruct() {
  12180. this.n3 = (this.getChild("n3"));
  12181. this.n1 = (this.getChild("n1"));
  12182. this.t0 = this.getTransition("t0");
  12183. }
  12184. }
  12185. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12186. class ui_dh_zs3 extends fgui.GComponent {
  12187. static createInstance() {
  12188. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12189. }
  12190. onConstruct() {
  12191. this.n10 = (this.getChild("n10"));
  12192. this.n9 = (this.getChild("n9"));
  12193. this.n1 = (this.getChild("n1"));
  12194. this.n2 = (this.getChild("n2"));
  12195. this.n3 = (this.getChild("n3"));
  12196. this.n4 = (this.getChild("n4"));
  12197. this.n5 = (this.getChild("n5"));
  12198. this.n6 = (this.getChild("n6"));
  12199. this.n8 = (this.getChild("n8"));
  12200. this.n11 = (this.getChild("n11"));
  12201. this.t0 = this.getTransition("t0");
  12202. }
  12203. }
  12204. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12205. class ui_dh_zs3_1 extends fgui.GComponent {
  12206. static createInstance() {
  12207. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12208. }
  12209. onConstruct() {
  12210. this.n3 = (this.getChild("n3"));
  12211. this.n1 = (this.getChild("n1"));
  12212. this.t0 = this.getTransition("t0");
  12213. }
  12214. }
  12215. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12216. class ui_Component107 extends fgui.GComponent {
  12217. static createInstance() {
  12218. return (fgui.UIPackage.createObject("game", "Component107"));
  12219. }
  12220. onConstruct() {
  12221. this.n18 = (this.getChild("n18"));
  12222. this.n19 = (this.getChild("n19"));
  12223. this.n20 = (this.getChild("n20"));
  12224. this.n21 = (this.getChild("n21"));
  12225. this.n22 = (this.getChild("n22"));
  12226. this.levelTxt = (this.getChild("levelTxt"));
  12227. this.t0 = this.getTransition("t0");
  12228. }
  12229. }
  12230. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12231. class ui_box_com1 extends fgui.GComponent {
  12232. static createInstance() {
  12233. return (fgui.UIPackage.createObject("game", "box_com1"));
  12234. }
  12235. onConstruct() {
  12236. this.n14 = (this.getChild("n14"));
  12237. this.n6 = (this.getChild("n6"));
  12238. this.t0 = this.getTransition("t0");
  12239. }
  12240. }
  12241. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12242. class ui_box_com2 extends fgui.GProgressBar {
  12243. static createInstance() {
  12244. return (fgui.UIPackage.createObject("game", "box_com2"));
  12245. }
  12246. onConstruct() {
  12247. this.bg0 = (this.getChild("bg0"));
  12248. this.bg = (this.getChild("bg"));
  12249. this.bar = (this.getChild("bar"));
  12250. this.n7 = (this.getChild("n7"));
  12251. this.n8 = (this.getChild("n8"));
  12252. this.n10 = (this.getChild("n10"));
  12253. this.n11 = (this.getChild("n11"));
  12254. this.n12 = (this.getChild("n12"));
  12255. }
  12256. }
  12257. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12258. class ui_box_com4 extends fgui.GComponent {
  12259. static createInstance() {
  12260. return (fgui.UIPackage.createObject("game", "box_com4"));
  12261. }
  12262. onConstruct() {
  12263. this.n8 = (this.getChild("n8"));
  12264. this.t0 = this.getTransition("t0");
  12265. }
  12266. }
  12267. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12268. class ui_box_com3 extends fgui.GComponent {
  12269. static createInstance() {
  12270. return (fgui.UIPackage.createObject("game", "box_com3"));
  12271. }
  12272. onConstruct() {
  12273. this.n2 = (this.getChild("n2"));
  12274. this.n3 = (this.getChild("n3"));
  12275. this.n4 = (this.getChild("n4"));
  12276. this.n5 = (this.getChild("n5"));
  12277. this.t0 = this.getTransition("t0");
  12278. this.t1 = this.getTransition("t1");
  12279. }
  12280. }
  12281. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12282. class ui_Component97 extends fgui.GComponent {
  12283. static createInstance() {
  12284. return (fgui.UIPackage.createObject("game", "Component97"));
  12285. }
  12286. onConstruct() {
  12287. this.c1 = this.getController("c1");
  12288. this.n46 = (this.getChild("n46"));
  12289. this.diamondNode = (this.getChild("diamondNode"));
  12290. this.coinNode = (this.getChild("coinNode"));
  12291. this.t0 = this.getTransition("t0");
  12292. }
  12293. }
  12294. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12295. class ui_Component98 extends fgui.GButton {
  12296. static createInstance() {
  12297. return (fgui.UIPackage.createObject("game", "Component98"));
  12298. }
  12299. onConstruct() {
  12300. this.n8 = (this.getChild("n8"));
  12301. this.n40 = (this.getChild("n40"));
  12302. }
  12303. }
  12304. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12305. class ui_Component28_11 extends fgui.GButton {
  12306. static createInstance() {
  12307. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12308. }
  12309. onConstruct() {
  12310. this.c1 = this.getController("c1");
  12311. this.n12 = (this.getChild("n12"));
  12312. this.n17 = (this.getChild("n17"));
  12313. this.n13 = (this.getChild("n13"));
  12314. this.diamondTxt = (this.getChild("diamondTxt"));
  12315. this.n15 = (this.getChild("n15"));
  12316. this.n16 = (this.getChild("n16"));
  12317. }
  12318. }
  12319. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12320. class ui_Component58_11 extends fgui.GComponent {
  12321. static createInstance() {
  12322. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12323. }
  12324. onConstruct() {
  12325. this.n23 = (this.getChild("n23"));
  12326. this.n41 = (this.getChild("n41"));
  12327. this.myList = (this.getChild("myList"));
  12328. this.n45 = (this.getChild("n45"));
  12329. this.n44 = (this.getChild("n44"));
  12330. this.t0 = this.getTransition("t0");
  12331. }
  12332. }
  12333. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12334. class ui_Component100 extends fgui.GComponent {
  12335. static createInstance() {
  12336. return (fgui.UIPackage.createObject("game", "Component100"));
  12337. }
  12338. onConstruct() {
  12339. this.c1 = this.getController("c1");
  12340. this.n75 = (this.getChild("n75"));
  12341. this.n76 = (this.getChild("n76"));
  12342. this.n80 = (this.getChild("n80"));
  12343. this.txt = (this.getChild("txt"));
  12344. this.spineRoot = (this.getChild("spineRoot"));
  12345. }
  12346. }
  12347. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12348. class ui_Component101 extends fgui.GComponent {
  12349. static createInstance() {
  12350. return (fgui.UIPackage.createObject("game", "Component101"));
  12351. }
  12352. onConstruct() {
  12353. this.c1 = this.getController("c1");
  12354. this.n36 = (this.getChild("n36"));
  12355. this.n35 = (this.getChild("n35"));
  12356. this.n33 = (this.getChild("n33"));
  12357. this.n34 = (this.getChild("n34"));
  12358. }
  12359. }
  12360. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12361. class ui_Component53 extends fgui.GComponent {
  12362. static createInstance() {
  12363. return (fgui.UIPackage.createObject("game", "Component53"));
  12364. }
  12365. onConstruct() {
  12366. this.n0 = (this.getChild("n0"));
  12367. this.n1 = (this.getChild("n1"));
  12368. this.n2 = (this.getChild("n2"));
  12369. this.n3 = (this.getChild("n3"));
  12370. this.n4 = (this.getChild("n4"));
  12371. this.n5 = (this.getChild("n5"));
  12372. this.n6 = (this.getChild("n6"));
  12373. this.n7 = (this.getChild("n7"));
  12374. this.n8 = (this.getChild("n8"));
  12375. this.n9 = (this.getChild("n9"));
  12376. this.n10 = (this.getChild("n10"));
  12377. this.n11 = (this.getChild("n11"));
  12378. this.n12 = (this.getChild("n12"));
  12379. this.n13 = (this.getChild("n13"));
  12380. this.n14 = (this.getChild("n14"));
  12381. this.n15 = (this.getChild("n15"));
  12382. this.n16 = (this.getChild("n16"));
  12383. this.n19 = (this.getChild("n19"));
  12384. this.n20 = (this.getChild("n20"));
  12385. this.n21 = (this.getChild("n21"));
  12386. this.n22 = (this.getChild("n22"));
  12387. this.n23 = (this.getChild("n23"));
  12388. this.n24 = (this.getChild("n24"));
  12389. this.n25 = (this.getChild("n25"));
  12390. this.n26 = (this.getChild("n26"));
  12391. this.n27 = (this.getChild("n27"));
  12392. this.n28 = (this.getChild("n28"));
  12393. this.n29 = (this.getChild("n29"));
  12394. this.n30 = (this.getChild("n30"));
  12395. this.n31 = (this.getChild("n31"));
  12396. this.n32 = (this.getChild("n32"));
  12397. this.n33 = (this.getChild("n33"));
  12398. this.n34 = (this.getChild("n34"));
  12399. this.n35 = (this.getChild("n35"));
  12400. this.t0 = this.getTransition("t0");
  12401. }
  12402. }
  12403. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12404. class ui_Component58 extends fgui.GComponent {
  12405. static createInstance() {
  12406. return (fgui.UIPackage.createObject("game", "Component58"));
  12407. }
  12408. onConstruct() {
  12409. this.n23 = (this.getChild("n23"));
  12410. this.n41 = (this.getChild("n41"));
  12411. this.n8 = (this.getChild("n8"));
  12412. this.skillList = (this.getChild("skillList"));
  12413. this.t0 = this.getTransition("t0");
  12414. }
  12415. }
  12416. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12417. class ui_Component59 extends fgui.GComponent {
  12418. static createInstance() {
  12419. return (fgui.UIPackage.createObject("game", "Component59"));
  12420. }
  12421. onConstruct() {
  12422. this.n3 = (this.getChild("n3"));
  12423. this.msgTxt = (this.getChild("msgTxt"));
  12424. this.t0 = this.getTransition("t0");
  12425. }
  12426. }
  12427. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12428. class ui_RulerNode extends fgui.GComponent {
  12429. static createInstance() {
  12430. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12431. }
  12432. onConstruct() {
  12433. this.n6 = (this.getChild("n6"));
  12434. this.n4 = (this.getChild("n4"));
  12435. this.img1 = (this.getChild("img1"));
  12436. this.img2 = (this.getChild("img2"));
  12437. }
  12438. }
  12439. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12440. class ui_Component108 extends fgui.GComponent {
  12441. static createInstance() {
  12442. return (fgui.UIPackage.createObject("game", "Component108"));
  12443. }
  12444. onConstruct() {
  12445. this.n19 = (this.getChild("n19"));
  12446. this.t0 = this.getTransition("t0");
  12447. }
  12448. }
  12449. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12450. class ui_Component63 extends fgui.GComponent {
  12451. static createInstance() {
  12452. return (fgui.UIPackage.createObject("game", "Component63"));
  12453. }
  12454. onConstruct() {
  12455. this.n66 = (this.getChild("n66"));
  12456. this.n56 = (this.getChild("n56"));
  12457. this.n63 = (this.getChild("n63"));
  12458. this.n65 = (this.getChild("n65"));
  12459. this.t0 = this.getTransition("t0");
  12460. }
  12461. }
  12462. ui_Component63.URL = "ui://isxx5ak7h657452";
  12463. class ui_topNode extends fgui.GComponent {
  12464. static createInstance() {
  12465. return (fgui.UIPackage.createObject("game", "topNode"));
  12466. }
  12467. onConstruct() {
  12468. this.selfProgress = (this.getChild("selfProgress"));
  12469. this.aiProgress = (this.getChild("aiProgress"));
  12470. this.selfKuang = (this.getChild("selfKuang"));
  12471. this.aiKuang = (this.getChild("aiKuang"));
  12472. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12473. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12474. this.n33 = (this.getChild("n33"));
  12475. this.n34 = (this.getChild("n34"));
  12476. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12477. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12478. this.selfBallList = (this.getChild("selfBallList"));
  12479. this.aiBallList = (this.getChild("aiBallList"));
  12480. this.middleNode = (this.getChild("middleNode"));
  12481. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12482. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12483. this.scoreNode = (this.getChild("scoreNode"));
  12484. this.selfTips = (this.getChild("selfTips"));
  12485. this.aiTips = (this.getChild("aiTips"));
  12486. }
  12487. }
  12488. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12489. class ui_selfProgress extends fgui.GProgressBar {
  12490. static createInstance() {
  12491. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12492. }
  12493. onConstruct() {
  12494. this.n3 = (this.getChild("n3"));
  12495. this.bar = (this.getChild("bar"));
  12496. }
  12497. }
  12498. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12499. class ui_aiProgress extends fgui.GProgressBar {
  12500. static createInstance() {
  12501. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12502. }
  12503. onConstruct() {
  12504. this.n3 = (this.getChild("n3"));
  12505. this.bar = (this.getChild("bar"));
  12506. }
  12507. }
  12508. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12509. class ui_ballDisplay extends fgui.GComponent {
  12510. static createInstance() {
  12511. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12512. }
  12513. onConstruct() {
  12514. this.myImg = (this.getChild("myImg"));
  12515. }
  12516. }
  12517. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12518. class ui_moveNode extends fgui.GComponent {
  12519. static createInstance() {
  12520. return (fgui.UIPackage.createObject("game", "moveNode"));
  12521. }
  12522. onConstruct() {
  12523. this.n8 = (this.getChild("n8"));
  12524. this.finger = (this.getChild("finger"));
  12525. }
  12526. }
  12527. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12528. class ui_cancelBtn extends fgui.GButton {
  12529. static createInstance() {
  12530. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12531. }
  12532. onConstruct() {
  12533. this.c1 = this.getController("c1");
  12534. this.n0 = (this.getChild("n0"));
  12535. this.n1 = (this.getChild("n1"));
  12536. }
  12537. }
  12538. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12539. class ui_shareBtn extends fgui.GButton {
  12540. static createInstance() {
  12541. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12542. }
  12543. onConstruct() {
  12544. this.c1 = this.getController("c1");
  12545. this.n2 = (this.getChild("n2"));
  12546. this.n1 = (this.getChild("n1"));
  12547. this.n3 = (this.getChild("n3"));
  12548. this.n4 = (this.getChild("n4"));
  12549. this.n5 = (this.getChild("n5"));
  12550. this.n6 = (this.getChild("n6"));
  12551. }
  12552. }
  12553. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12554. class ui_share2Btn extends fgui.GButton {
  12555. static createInstance() {
  12556. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12557. }
  12558. onConstruct() {
  12559. this.n3 = (this.getChild("n3"));
  12560. }
  12561. }
  12562. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12563. class ui_rodMethodNode extends fgui.GComponent {
  12564. static createInstance() {
  12565. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12566. }
  12567. onConstruct() {
  12568. this.bg = (this.getChild("bg"));
  12569. this.dot = (this.getChild("dot"));
  12570. }
  12571. }
  12572. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12573. class ui_sureBtn extends fgui.GButton {
  12574. static createInstance() {
  12575. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12576. }
  12577. onConstruct() {
  12578. this.n2 = (this.getChild("n2"));
  12579. this.n1 = (this.getChild("n1"));
  12580. }
  12581. }
  12582. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12583. class ui_Component18 extends fgui.GComponent {
  12584. static createInstance() {
  12585. return (fgui.UIPackage.createObject("game", "Component18"));
  12586. }
  12587. onConstruct() {
  12588. this.c1 = this.getController("c1");
  12589. this.nameTxt = (this.getChild("nameTxt"));
  12590. this.headImg = (this.getChild("headImg"));
  12591. this.n24 = (this.getChild("n24"));
  12592. this.skillImg = (this.getChild("skillImg"));
  12593. this.skillTxt = (this.getChild("skillTxt"));
  12594. }
  12595. }
  12596. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12597. class ui_Component45 extends fgui.GComponent {
  12598. static createInstance() {
  12599. return (fgui.UIPackage.createObject("game", "Component45"));
  12600. }
  12601. onConstruct() {
  12602. this.c1 = this.getController("c1");
  12603. this.n40 = (this.getChild("n40"));
  12604. this.n41 = (this.getChild("n41"));
  12605. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12606. this.n42 = (this.getChild("n42"));
  12607. this.awardTxt = (this.getChild("awardTxt"));
  12608. this.n44 = (this.getChild("n44"));
  12609. this.t0 = this.getTransition("t0");
  12610. }
  12611. }
  12612. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12613. class ui_emotionDisplay extends fgui.GButton {
  12614. static createInstance() {
  12615. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12616. }
  12617. onConstruct() {
  12618. this.myIcon = (this.getChild("myIcon"));
  12619. }
  12620. }
  12621. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12622. class ui_Component49 extends fgui.GButton {
  12623. static createInstance() {
  12624. return (fgui.UIPackage.createObject("game", "Component49"));
  12625. }
  12626. onConstruct() {
  12627. this.n69 = (this.getChild("n69"));
  12628. this.n56 = (this.getChild("n56"));
  12629. }
  12630. }
  12631. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12632. class ui_Component50 extends fgui.GButton {
  12633. static createInstance() {
  12634. return (fgui.UIPackage.createObject("game", "Component50"));
  12635. }
  12636. onConstruct() {
  12637. this.n54 = (this.getChild("n54"));
  12638. this.n65 = (this.getChild("n65"));
  12639. }
  12640. }
  12641. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12642. class ui_Component51 extends fgui.GButton {
  12643. static createInstance() {
  12644. return (fgui.UIPackage.createObject("game", "Component51"));
  12645. }
  12646. onConstruct() {
  12647. this.c1 = this.getController("c1");
  12648. this.n51 = (this.getChild("n51"));
  12649. this.n54 = (this.getChild("n54"));
  12650. }
  12651. }
  12652. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12653. class ui_Button5 extends fgui.GButton {
  12654. static createInstance() {
  12655. return (fgui.UIPackage.createObject("game", "Button5"));
  12656. }
  12657. onConstruct() {
  12658. this.c1 = this.getController("c1");
  12659. this.n0 = (this.getChild("n0"));
  12660. this.n2 = (this.getChild("n2"));
  12661. }
  12662. }
  12663. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12664. class ui_Component124 extends fgui.GComponent {
  12665. static createInstance() {
  12666. return (fgui.UIPackage.createObject("game", "Component124"));
  12667. }
  12668. onConstruct() {
  12669. this.n22 = (this.getChild("n22"));
  12670. this.shareNode = (this.getChild("shareNode"));
  12671. }
  12672. }
  12673. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12674. class ui_Component125 extends fgui.GComponent {
  12675. static createInstance() {
  12676. return (fgui.UIPackage.createObject("game", "Component125"));
  12677. }
  12678. onConstruct() {
  12679. this.n29 = (this.getChild("n29"));
  12680. this.coinTxt = (this.getChild("coinTxt"));
  12681. }
  12682. }
  12683. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12684. class ui_Component52 extends fgui.GButton {
  12685. static createInstance() {
  12686. return (fgui.UIPackage.createObject("game", "Component52"));
  12687. }
  12688. onConstruct() {
  12689. this.n35 = (this.getChild("n35"));
  12690. this.n36 = (this.getChild("n36"));
  12691. }
  12692. }
  12693. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12694. class ui_drawBtn extends fgui.GButton {
  12695. static createInstance() {
  12696. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12697. }
  12698. onConstruct() {
  12699. this.c1 = this.getController("c1");
  12700. this.n2 = (this.getChild("n2"));
  12701. this.n1 = (this.getChild("n1"));
  12702. this.n5 = (this.getChild("n5"));
  12703. }
  12704. }
  12705. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12706. class ui_Component43 extends fgui.GButton {
  12707. static createInstance() {
  12708. return (fgui.UIPackage.createObject("game", "Component43"));
  12709. }
  12710. onConstruct() {
  12711. this.n49 = (this.getChild("n49"));
  12712. }
  12713. }
  12714. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12715. class ui_wordsDisplay extends fgui.GComponent {
  12716. static createInstance() {
  12717. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12718. }
  12719. onConstruct() {
  12720. this.txt = (this.getChild("txt"));
  12721. this.n63 = (this.getChild("n63"));
  12722. }
  12723. }
  12724. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12725. class ui_Component_phb extends fgui.GComponent {
  12726. static createInstance() {
  12727. return (fgui.UIPackage.createObject("game", "Component_phb"));
  12728. }
  12729. onConstruct() {
  12730. this.n3 = (this.getChild("n3"));
  12731. this.n4 = (this.getChild("n4"));
  12732. }
  12733. }
  12734. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  12735. class ui_Component3 extends fgui.GComponent {
  12736. static createInstance() {
  12737. return (fgui.UIPackage.createObject("game", "Component3"));
  12738. }
  12739. onConstruct() {
  12740. this.n26 = (this.getChild("n26"));
  12741. this.n24 = (this.getChild("n24"));
  12742. this.nameTxt = (this.getChild("nameTxt"));
  12743. this.headRoot = (this.getChild("headRoot"));
  12744. }
  12745. }
  12746. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12747. class ui_Component4 extends fgui.GComponent {
  12748. static createInstance() {
  12749. return (fgui.UIPackage.createObject("game", "Component4"));
  12750. }
  12751. onConstruct() {
  12752. this.headImg = (this.getChild("headImg"));
  12753. }
  12754. }
  12755. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12756. class ui_Component7 extends fgui.GButton {
  12757. static createInstance() {
  12758. return (fgui.UIPackage.createObject("game", "Component7"));
  12759. }
  12760. onConstruct() {
  12761. this.n17 = (this.getChild("n17"));
  12762. }
  12763. }
  12764. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12765. class ui_Component8 extends fgui.GButton {
  12766. static createInstance() {
  12767. return (fgui.UIPackage.createObject("game", "Component8"));
  12768. }
  12769. onConstruct() {
  12770. this.n19 = (this.getChild("n19"));
  12771. }
  12772. }
  12773. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12774. class ui_Component10 extends fgui.GButton {
  12775. static createInstance() {
  12776. return (fgui.UIPackage.createObject("game", "Component10"));
  12777. }
  12778. onConstruct() {
  12779. this.c1 = this.getController("c1");
  12780. this.n40 = (this.getChild("n40"));
  12781. }
  12782. }
  12783. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12784. class ui_Component11 extends fgui.GButton {
  12785. static createInstance() {
  12786. return (fgui.UIPackage.createObject("game", "Component11"));
  12787. }
  12788. onConstruct() {
  12789. this.n34 = (this.getChild("n34"));
  12790. }
  12791. }
  12792. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12793. class ui_Component12 extends fgui.GButton {
  12794. static createInstance() {
  12795. return (fgui.UIPackage.createObject("game", "Component12"));
  12796. }
  12797. onConstruct() {
  12798. this.n35 = (this.getChild("n35"));
  12799. }
  12800. }
  12801. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12802. class ui_Component13 extends fgui.GButton {
  12803. static createInstance() {
  12804. return (fgui.UIPackage.createObject("game", "Component13"));
  12805. }
  12806. onConstruct() {
  12807. this.n27 = (this.getChild("n27"));
  12808. this.n36 = (this.getChild("n36"));
  12809. }
  12810. }
  12811. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12812. class ui_dh_js_tuowei extends fgui.GComponent {
  12813. static createInstance() {
  12814. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12815. }
  12816. onConstruct() {
  12817. this.n19 = (this.getChild("n19"));
  12818. this.n18 = (this.getChild("n18"));
  12819. this.n0 = (this.getChild("n0"));
  12820. this.n3 = (this.getChild("n3"));
  12821. this.n4 = (this.getChild("n4"));
  12822. this.n5 = (this.getChild("n5"));
  12823. this.n6 = (this.getChild("n6"));
  12824. this.n8 = (this.getChild("n8"));
  12825. this.n9 = (this.getChild("n9"));
  12826. this.n10 = (this.getChild("n10"));
  12827. this.n11 = (this.getChild("n11"));
  12828. this.n12 = (this.getChild("n12"));
  12829. this.n13 = (this.getChild("n13"));
  12830. this.n14 = (this.getChild("n14"));
  12831. this.n15 = (this.getChild("n15"));
  12832. this.n20 = (this.getChild("n20"));
  12833. this.t0 = this.getTransition("t0");
  12834. this.t1 = this.getTransition("t1");
  12835. }
  12836. }
  12837. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12838. class ui_dh_js_tw_g extends fgui.GComponent {
  12839. static createInstance() {
  12840. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12841. }
  12842. onConstruct() {
  12843. this.n0 = (this.getChild("n0"));
  12844. this.n1 = (this.getChild("n1"));
  12845. this.t0 = this.getTransition("t0");
  12846. }
  12847. }
  12848. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12849. class ui_dh_js_xingxing extends fgui.GComponent {
  12850. static createInstance() {
  12851. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12852. }
  12853. onConstruct() {
  12854. this.n1 = (this.getChild("n1"));
  12855. this.n2 = (this.getChild("n2"));
  12856. this.n3 = (this.getChild("n3"));
  12857. this.n4 = (this.getChild("n4"));
  12858. this.n0 = (this.getChild("n0"));
  12859. this.t2 = this.getTransition("t2");
  12860. this.t1 = this.getTransition("t1");
  12861. }
  12862. }
  12863. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12864. class ui_dh_zy_jiazai extends fgui.GComponent {
  12865. static createInstance() {
  12866. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12867. }
  12868. onConstruct() {
  12869. this.c1 = this.getController("c1");
  12870. this.n0 = (this.getChild("n0"));
  12871. this.n1 = (this.getChild("n1"));
  12872. this.n2 = (this.getChild("n2"));
  12873. this.n4 = (this.getChild("n4"));
  12874. this.n5 = (this.getChild("n5"));
  12875. this.n6 = (this.getChild("n6"));
  12876. this.n8 = (this.getChild("n8"));
  12877. this.n7 = (this.getChild("n7"));
  12878. this.t0 = this.getTransition("t0");
  12879. }
  12880. }
  12881. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12882. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12883. static createInstance() {
  12884. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12885. }
  12886. onConstruct() {
  12887. this.c1 = this.getController("c1");
  12888. this.n3 = (this.getChild("n3"));
  12889. this.n5 = (this.getChild("n5"));
  12890. this.n4 = (this.getChild("n4"));
  12891. this.n0 = (this.getChild("n0"));
  12892. this.n1 = (this.getChild("n1"));
  12893. this.n2 = (this.getChild("n2"));
  12894. }
  12895. }
  12896. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12897. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12898. static createInstance() {
  12899. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12900. }
  12901. onConstruct() {
  12902. this.n19 = (this.getChild("n19"));
  12903. this.n21 = (this.getChild("n21"));
  12904. this.n0 = (this.getChild("n0"));
  12905. this.n3 = (this.getChild("n3"));
  12906. this.n4 = (this.getChild("n4"));
  12907. this.n5 = (this.getChild("n5"));
  12908. this.n6 = (this.getChild("n6"));
  12909. this.n8 = (this.getChild("n8"));
  12910. this.n9 = (this.getChild("n9"));
  12911. this.n10 = (this.getChild("n10"));
  12912. this.n11 = (this.getChild("n11"));
  12913. this.n12 = (this.getChild("n12"));
  12914. this.n13 = (this.getChild("n13"));
  12915. this.n14 = (this.getChild("n14"));
  12916. this.n15 = (this.getChild("n15"));
  12917. this.n23 = (this.getChild("n23"));
  12918. this.t0 = this.getTransition("t0");
  12919. this.t1 = this.getTransition("t1");
  12920. }
  12921. }
  12922. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12923. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12924. static createInstance() {
  12925. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12926. }
  12927. onConstruct() {
  12928. this.n1 = (this.getChild("n1"));
  12929. this.n2 = (this.getChild("n2"));
  12930. this.t0 = this.getTransition("t0");
  12931. }
  12932. }
  12933. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12934. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12935. static createInstance() {
  12936. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12937. }
  12938. onConstruct() {
  12939. this.n4 = (this.getChild("n4"));
  12940. this.n2 = (this.getChild("n2"));
  12941. this.n3 = (this.getChild("n3"));
  12942. this.idle = this.getTransition("idle");
  12943. this.attack = this.getTransition("attack");
  12944. }
  12945. }
  12946. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12947. class ui_special extends fgui.GComponent {
  12948. static createInstance() {
  12949. return (fgui.UIPackage.createObject("game", "special"));
  12950. }
  12951. onConstruct() {
  12952. this.n18 = (this.getChild("n18"));
  12953. this.n19 = (this.getChild("n19"));
  12954. this.n20 = (this.getChild("n20"));
  12955. this.n21 = (this.getChild("n21"));
  12956. this.n22 = (this.getChild("n22"));
  12957. this.levelTxt = (this.getChild("levelTxt"));
  12958. this.n24 = (this.getChild("n24"));
  12959. this.n25 = (this.getChild("n25"));
  12960. this.t0 = this.getTransition("t0");
  12961. }
  12962. }
  12963. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12964. class ui_Component145 extends fgui.GComponent {
  12965. static createInstance() {
  12966. return (fgui.UIPackage.createObject("game", "Component145"));
  12967. }
  12968. onConstruct() {
  12969. this.guanyuNode = (this.getChild("guanyuNode"));
  12970. }
  12971. }
  12972. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12973. class ui_longBtn extends fgui.GButton {
  12974. static createInstance() {
  12975. return (fgui.UIPackage.createObject("game", "longBtn"));
  12976. }
  12977. onConstruct() {
  12978. this.c1 = this.getController("c1");
  12979. this.n2 = (this.getChild("n2"));
  12980. this.n1 = (this.getChild("n1"));
  12981. this.n4 = (this.getChild("n4"));
  12982. }
  12983. }
  12984. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12985. class ui_Component146 extends fgui.GComponent {
  12986. static createInstance() {
  12987. return (fgui.UIPackage.createObject("game", "Component146"));
  12988. }
  12989. onConstruct() {
  12990. this.n89 = (this.getChild("n89"));
  12991. this.n90 = (this.getChild("n90"));
  12992. this.guideBtn = (this.getChild("guideBtn"));
  12993. }
  12994. }
  12995. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12996. class ui_Component146_11 extends fgui.GComponent {
  12997. static createInstance() {
  12998. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12999. }
  13000. onConstruct() {
  13001. this.n89 = (this.getChild("n89"));
  13002. this.n90 = (this.getChild("n90"));
  13003. this.guideBtn = (this.getChild("guideBtn"));
  13004. }
  13005. }
  13006. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  13007. class ui_Component111_1 extends fgui.GComponent {
  13008. static createInstance() {
  13009. return (fgui.UIPackage.createObject("game", "Component111_1"));
  13010. }
  13011. onConstruct() {
  13012. this.n68 = (this.getChild("n68"));
  13013. this.myMask = (this.getChild("myMask"));
  13014. }
  13015. }
  13016. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  13017. class ui_Component64_1 extends fgui.GComponent {
  13018. static createInstance() {
  13019. return (fgui.UIPackage.createObject("game", "Component64_1"));
  13020. }
  13021. onConstruct() {
  13022. this.n57 = (this.getChild("n57"));
  13023. this.n54 = (this.getChild("n54"));
  13024. this.n55 = (this.getChild("n55"));
  13025. this.n56 = (this.getChild("n56"));
  13026. this.t1 = this.getTransition("t1");
  13027. }
  13028. }
  13029. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  13030. class ui_ModeSelection_com123 extends fgui.GComponent {
  13031. static createInstance() {
  13032. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  13033. }
  13034. onConstruct() {
  13035. this.type1 = (this.getChild("type1"));
  13036. this.type2 = (this.getChild("type2"));
  13037. this.type3 = (this.getChild("type3"));
  13038. this.n38 = (this.getChild("n38"));
  13039. this.t0 = this.getTransition("t0");
  13040. }
  13041. }
  13042. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  13043. class ui_Component132_2 extends fgui.GComponent {
  13044. static createInstance() {
  13045. return (fgui.UIPackage.createObject("game", "Component132_2"));
  13046. }
  13047. onConstruct() {
  13048. this.n25 = (this.getChild("n25"));
  13049. this.n26 = (this.getChild("n26"));
  13050. this.n27 = (this.getChild("n27"));
  13051. this.t0 = this.getTransition("t0");
  13052. }
  13053. }
  13054. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  13055. class ui_UIPower$1 extends fgui.GComponent {
  13056. static createInstance() {
  13057. return (fgui.UIPackage.createObject("game", "UIPower"));
  13058. }
  13059. onConstruct() {
  13060. this.n11 = (this.getChild("n11"));
  13061. this.myNode = (this.getChild("myNode"));
  13062. this.t0 = this.getTransition("t0");
  13063. }
  13064. }
  13065. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  13066. class ui_Component133 extends fgui.GComponent {
  13067. static createInstance() {
  13068. return (fgui.UIPackage.createObject("game", "Component133"));
  13069. }
  13070. onConstruct() {
  13071. this.n29 = (this.getChild("n29"));
  13072. this.n30 = (this.getChild("n30"));
  13073. }
  13074. }
  13075. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  13076. class ui_Component134 extends fgui.GComponent {
  13077. static createInstance() {
  13078. return (fgui.UIPackage.createObject("game", "Component134"));
  13079. }
  13080. onConstruct() {
  13081. this.n30 = (this.getChild("n30"));
  13082. this.n31 = (this.getChild("n31"));
  13083. this.t0 = this.getTransition("t0");
  13084. }
  13085. }
  13086. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  13087. class ui_Component135 extends fgui.GComponent {
  13088. static createInstance() {
  13089. return (fgui.UIPackage.createObject("game", "Component135"));
  13090. }
  13091. onConstruct() {
  13092. this.n30 = (this.getChild("n30"));
  13093. this.t0 = this.getTransition("t0");
  13094. }
  13095. }
  13096. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  13097. class ui_Component137 extends fgui.GComponent {
  13098. static createInstance() {
  13099. return (fgui.UIPackage.createObject("game", "Component137"));
  13100. }
  13101. onConstruct() {
  13102. this.n28 = (this.getChild("n28"));
  13103. this.n29 = (this.getChild("n29"));
  13104. this.n30 = (this.getChild("n30"));
  13105. this.n32 = (this.getChild("n32"));
  13106. }
  13107. }
  13108. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  13109. class ui_dh_zuanshi extends fgui.GButton {
  13110. static createInstance() {
  13111. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  13112. }
  13113. onConstruct() {
  13114. this.n1 = (this.getChild("n1"));
  13115. this.n2 = (this.getChild("n2"));
  13116. this.n0 = (this.getChild("n0"));
  13117. this.n3 = (this.getChild("n3"));
  13118. this.n4 = (this.getChild("n4"));
  13119. }
  13120. }
  13121. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  13122. class ui_Component138 extends fgui.GComponent {
  13123. static createInstance() {
  13124. return (fgui.UIPackage.createObject("game", "Component138"));
  13125. }
  13126. onConstruct() {
  13127. this.n1 = (this.getChild("n1"));
  13128. this.n2 = (this.getChild("n2"));
  13129. this.t0 = this.getTransition("t0");
  13130. }
  13131. }
  13132. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  13133. class ui_Component139 extends fgui.GComponent {
  13134. static createInstance() {
  13135. return (fgui.UIPackage.createObject("game", "Component139"));
  13136. }
  13137. onConstruct() {
  13138. this.n0 = (this.getChild("n0"));
  13139. this.t0 = this.getTransition("t0");
  13140. }
  13141. }
  13142. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  13143. class ui_Component140 extends fgui.GComponent {
  13144. static createInstance() {
  13145. return (fgui.UIPackage.createObject("game", "Component140"));
  13146. }
  13147. onConstruct() {
  13148. this.n2 = (this.getChild("n2"));
  13149. this.n3 = (this.getChild("n3"));
  13150. this.t0 = this.getTransition("t0");
  13151. }
  13152. }
  13153. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  13154. class ui_Component141 extends fgui.GComponent {
  13155. static createInstance() {
  13156. return (fgui.UIPackage.createObject("game", "Component141"));
  13157. }
  13158. onConstruct() {
  13159. this.n0 = (this.getChild("n0"));
  13160. this.t0 = this.getTransition("t0");
  13161. }
  13162. }
  13163. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  13164. class ui_powerNode extends fgui.GProgressBar {
  13165. static createInstance() {
  13166. return (fgui.UIPackage.createObject("game", "powerNode"));
  13167. }
  13168. onConstruct() {
  13169. this.n2 = (this.getChild("n2"));
  13170. this.bar_v = (this.getChild("bar_v"));
  13171. this.showImg = (this.getChild("showImg"));
  13172. this.n12 = (this.getChild("n12"));
  13173. }
  13174. }
  13175. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13176. class ui_dh_jingbi1 extends fgui.GComponent {
  13177. static createInstance() {
  13178. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13179. }
  13180. onConstruct() {
  13181. this.n0 = (this.getChild("n0"));
  13182. this.n1 = (this.getChild("n1"));
  13183. this.n2 = (this.getChild("n2"));
  13184. this.n3 = (this.getChild("n3"));
  13185. this.n4 = (this.getChild("n4"));
  13186. this.n5 = (this.getChild("n5"));
  13187. this.n6 = (this.getChild("n6"));
  13188. this.n8 = (this.getChild("n8"));
  13189. this.t0 = this.getTransition("t0");
  13190. }
  13191. }
  13192. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13193. class ui_Component94 extends fgui.GButton {
  13194. static createInstance() {
  13195. return (fgui.UIPackage.createObject("game", "Component94"));
  13196. }
  13197. onConstruct() {
  13198. this.n77 = (this.getChild("n77"));
  13199. }
  13200. }
  13201. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13202. class ui_Component95 extends fgui.GButton {
  13203. static createInstance() {
  13204. return (fgui.UIPackage.createObject("game", "Component95"));
  13205. }
  13206. onConstruct() {
  13207. this.n77 = (this.getChild("n77"));
  13208. }
  13209. }
  13210. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13211. class ui_Component126 extends fgui.GComponent {
  13212. static createInstance() {
  13213. return (fgui.UIPackage.createObject("game", "Component126"));
  13214. }
  13215. onConstruct() {
  13216. this.c1 = this.getController("c1");
  13217. this.normalBtn = (this.getChild("normalBtn"));
  13218. this.tripleBtn = (this.getChild("tripleBtn"));
  13219. }
  13220. }
  13221. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13222. class ui_Component60 extends fgui.GComponent {
  13223. static createInstance() {
  13224. return (fgui.UIPackage.createObject("game", "Component60"));
  13225. }
  13226. onConstruct() {
  13227. this.c1 = this.getController("c1");
  13228. this.n48 = (this.getChild("n48"));
  13229. this.womanTxt = (this.getChild("womanTxt"));
  13230. this.t0 = this.getTransition("t0");
  13231. }
  13232. }
  13233. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13234. class ui_Component98_3 extends fgui.GButton {
  13235. static createInstance() {
  13236. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13237. }
  13238. onConstruct() {
  13239. this.c1 = this.getController("c1");
  13240. this.n8 = (this.getChild("n8"));
  13241. this.n41 = (this.getChild("n41"));
  13242. this.n40 = (this.getChild("n40"));
  13243. }
  13244. }
  13245. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13246. class ui_ModeSelection_com1 extends fgui.GButton {
  13247. static createInstance() {
  13248. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13249. }
  13250. onConstruct() {
  13251. this.n34 = (this.getChild("n34"));
  13252. this.n36 = (this.getChild("n36"));
  13253. this.n22 = (this.getChild("n22"));
  13254. this.n20 = (this.getChild("n20"));
  13255. this.n23 = (this.getChild("n23"));
  13256. this.n24 = (this.getChild("n24"));
  13257. this.n26 = (this.getChild("n26"));
  13258. this.n33 = (this.getChild("n33"));
  13259. this.coinImg = (this.getChild("coinImg"));
  13260. this.need = (this.getChild("need"));
  13261. this.n35 = (this.getChild("n35"));
  13262. this.n29 = (this.getChild("n29"));
  13263. this.tipsTxt = (this.getChild("tipsTxt"));
  13264. this.n30 = (this.getChild("n30"));
  13265. this.peopleTxt = (this.getChild("peopleTxt"));
  13266. this.t0 = this.getTransition("t0");
  13267. }
  13268. }
  13269. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13270. class ui_ModeSelection_com2 extends fgui.GButton {
  13271. static createInstance() {
  13272. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13273. }
  13274. onConstruct() {
  13275. this.n36 = (this.getChild("n36"));
  13276. this.n34 = (this.getChild("n34"));
  13277. this.n22 = (this.getChild("n22"));
  13278. this.n20 = (this.getChild("n20"));
  13279. this.n23 = (this.getChild("n23"));
  13280. this.n24 = (this.getChild("n24"));
  13281. this.n26 = (this.getChild("n26"));
  13282. this.n33 = (this.getChild("n33"));
  13283. this.coinImg = (this.getChild("coinImg"));
  13284. this.need = (this.getChild("need"));
  13285. this.n35 = (this.getChild("n35"));
  13286. this.n29 = (this.getChild("n29"));
  13287. this.tipsTxt = (this.getChild("tipsTxt"));
  13288. this.n30 = (this.getChild("n30"));
  13289. this.peopleTxt = (this.getChild("peopleTxt"));
  13290. this.t0 = this.getTransition("t0");
  13291. }
  13292. }
  13293. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13294. class ui_ModeSelection_com3 extends fgui.GButton {
  13295. static createInstance() {
  13296. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13297. }
  13298. onConstruct() {
  13299. this.n34 = (this.getChild("n34"));
  13300. this.n36 = (this.getChild("n36"));
  13301. this.n22 = (this.getChild("n22"));
  13302. this.n20 = (this.getChild("n20"));
  13303. this.n23 = (this.getChild("n23"));
  13304. this.n24 = (this.getChild("n24"));
  13305. this.n26 = (this.getChild("n26"));
  13306. this.n33 = (this.getChild("n33"));
  13307. this.coinImg = (this.getChild("coinImg"));
  13308. this.need = (this.getChild("need"));
  13309. this.n35 = (this.getChild("n35"));
  13310. this.n29 = (this.getChild("n29"));
  13311. this.tipsTxt = (this.getChild("tipsTxt"));
  13312. this.n30 = (this.getChild("n30"));
  13313. this.peopleTxt = (this.getChild("peopleTxt"));
  13314. this.t0 = this.getTransition("t0");
  13315. }
  13316. }
  13317. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13318. class ui_Invitation_com1 extends fgui.GComponent {
  13319. static createInstance() {
  13320. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13321. }
  13322. onConstruct() {
  13323. this.n14 = (this.getChild("n14"));
  13324. this.n13 = (this.getChild("n13"));
  13325. this.n3 = (this.getChild("n3"));
  13326. this.n1 = (this.getChild("n1"));
  13327. this.n6 = (this.getChild("n6"));
  13328. this.n7 = (this.getChild("n7"));
  13329. this.enterBtn = (this.getChild("enterBtn"));
  13330. this.n11 = (this.getChild("n11"));
  13331. this.n12 = (this.getChild("n12"));
  13332. this.n15 = (this.getChild("n15"));
  13333. this.t0 = this.getTransition("t0");
  13334. this.t1 = this.getTransition("t1");
  13335. }
  13336. }
  13337. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13338. class ui_Component87_1 extends fgui.GComponent {
  13339. static createInstance() {
  13340. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13341. }
  13342. onConstruct() {
  13343. this.n74 = (this.getChild("n74"));
  13344. this.n73 = (this.getChild("n73"));
  13345. this.ballTxt = (this.getChild("ballTxt"));
  13346. this.n76 = (this.getChild("n76"));
  13347. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13348. this.levelTxt = (this.getChild("levelTxt"));
  13349. this.n87 = (this.getChild("n87"));
  13350. this.n84 = (this.getChild("n84"));
  13351. this.hpTxt = (this.getChild("hpTxt"));
  13352. this.n89 = (this.getChild("n89"));
  13353. this.tipsTxt = (this.getChild("tipsTxt"));
  13354. }
  13355. }
  13356. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13357. class ui_sqg1 extends fgui.GComponent {
  13358. static createInstance() {
  13359. return (fgui.UIPackage.createObject("game", "sqg1"));
  13360. }
  13361. onConstruct() {
  13362. this.n1 = (this.getChild("n1"));
  13363. this.n0 = (this.getChild("n0"));
  13364. }
  13365. }
  13366. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  13367. class ui_sqg2 extends fgui.GComponent {
  13368. static createInstance() {
  13369. return (fgui.UIPackage.createObject("game", "sqg2"));
  13370. }
  13371. onConstruct() {
  13372. this.n1 = (this.getChild("n1"));
  13373. this.n0 = (this.getChild("n0"));
  13374. }
  13375. }
  13376. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  13377. class ui_sqg3 extends fgui.GComponent {
  13378. static createInstance() {
  13379. return (fgui.UIPackage.createObject("game", "sqg3"));
  13380. }
  13381. onConstruct() {
  13382. this.n1 = (this.getChild("n1"));
  13383. this.n0 = (this.getChild("n0"));
  13384. }
  13385. }
  13386. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  13387. class ui_sqg4 extends fgui.GComponent {
  13388. static createInstance() {
  13389. return (fgui.UIPackage.createObject("game", "sqg4"));
  13390. }
  13391. onConstruct() {
  13392. this.n1 = (this.getChild("n1"));
  13393. this.n0 = (this.getChild("n0"));
  13394. }
  13395. }
  13396. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  13397. class ui_Component36 extends fgui.GButton {
  13398. static createInstance() {
  13399. return (fgui.UIPackage.createObject("game", "Component36"));
  13400. }
  13401. onConstruct() {
  13402. this.c1 = this.getController("c1");
  13403. this.n53 = (this.getChild("n53"));
  13404. this.n56 = (this.getChild("n56"));
  13405. }
  13406. }
  13407. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  13408. class ui_Component37 extends fgui.GButton {
  13409. static createInstance() {
  13410. return (fgui.UIPackage.createObject("game", "Component37"));
  13411. }
  13412. onConstruct() {
  13413. this.c1 = this.getController("c1");
  13414. this.n52 = (this.getChild("n52"));
  13415. this.n54 = (this.getChild("n54"));
  13416. }
  13417. }
  13418. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  13419. class ui_UISetting extends fgui.GComponent {
  13420. static createInstance() {
  13421. return (fgui.UIPackage.createObject("game", "UISetting"));
  13422. }
  13423. onConstruct() {
  13424. this.c1 = this.getController("c1");
  13425. this.n4 = (this.getChild("n4"));
  13426. this.soundBtn = (this.getChild("soundBtn"));
  13427. this.shakeBtn = (this.getChild("shakeBtn"));
  13428. this.clickNode = (this.getChild("clickNode"));
  13429. this.xyBtn = (this.getChild("xyBtn"));
  13430. }
  13431. }
  13432. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  13433. class ui_Component39 extends fgui.GComponent {
  13434. static createInstance() {
  13435. return (fgui.UIPackage.createObject("game", "Component39"));
  13436. }
  13437. onConstruct() {
  13438. this.n5 = (this.getChild("n5"));
  13439. this.n6 = (this.getChild("n6"));
  13440. this.n7 = (this.getChild("n7"));
  13441. this.t0 = this.getTransition("t0");
  13442. }
  13443. }
  13444. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  13445. class ui_Component40 extends fgui.GButton {
  13446. static createInstance() {
  13447. return (fgui.UIPackage.createObject("game", "Component40"));
  13448. }
  13449. onConstruct() {
  13450. this.n46 = (this.getChild("n46"));
  13451. this.n47 = (this.getChild("n47"));
  13452. }
  13453. }
  13454. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13455. class ui_Component41 extends fgui.GComponent {
  13456. static createInstance() {
  13457. return (fgui.UIPackage.createObject("game", "Component41"));
  13458. }
  13459. onConstruct() {
  13460. this.c1 = this.getController("c1");
  13461. this.n0 = (this.getChild("n0"));
  13462. this.titleTxt = (this.getChild("titleTxt"));
  13463. this.n2 = (this.getChild("n2"));
  13464. this.msgTips = (this.getChild("msgTips"));
  13465. this.numTxt = (this.getChild("numTxt"));
  13466. this.n18 = (this.getChild("n18"));
  13467. this.cancelBtn = (this.getChild("cancelBtn"));
  13468. this.videoBtn = (this.getChild("videoBtn"));
  13469. this.n10 = (this.getChild("n10"));
  13470. }
  13471. }
  13472. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13473. class ui_Component42 extends fgui.GComponent {
  13474. static createInstance() {
  13475. return (fgui.UIPackage.createObject("game", "Component42"));
  13476. }
  13477. onConstruct() {
  13478. this.c1 = this.getController("c1");
  13479. this.n1 = (this.getChild("n1"));
  13480. this.n2 = (this.getChild("n2"));
  13481. this.n3 = (this.getChild("n3"));
  13482. this.tipsTxt = (this.getChild("tipsTxt"));
  13483. this.cancelBtn = (this.getChild("cancelBtn"));
  13484. this.sureBtn = (this.getChild("sureBtn"));
  13485. this.n11 = (this.getChild("n11"));
  13486. this.n13 = (this.getChild("n13"));
  13487. this.n14 = (this.getChild("n14"));
  13488. this.womanTxt = (this.getChild("womanTxt"));
  13489. this.t0 = this.getTransition("t0");
  13490. }
  13491. }
  13492. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13493. class ui_dh_js_shengli extends fgui.GComponent {
  13494. static createInstance() {
  13495. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13496. }
  13497. onConstruct() {
  13498. this.n3 = (this.getChild("n3"));
  13499. this.n4 = (this.getChild("n4"));
  13500. this.n1 = (this.getChild("n1"));
  13501. this.n2 = (this.getChild("n2"));
  13502. this.n5 = (this.getChild("n5"));
  13503. this.n6 = (this.getChild("n6"));
  13504. this.n7 = (this.getChild("n7"));
  13505. this.n8 = (this.getChild("n8"));
  13506. this.attack = this.getTransition("attack");
  13507. this.idle = this.getTransition("idle");
  13508. }
  13509. }
  13510. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13511. class ui_dh_js_shengli_g extends fgui.GComponent {
  13512. static createInstance() {
  13513. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13514. }
  13515. onConstruct() {
  13516. this.n3 = (this.getChild("n3"));
  13517. this.n1 = (this.getChild("n1"));
  13518. this.t0 = this.getTransition("t0");
  13519. }
  13520. }
  13521. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13522. class ui_dh_js_shibai extends fgui.GComponent {
  13523. static createInstance() {
  13524. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13525. }
  13526. onConstruct() {
  13527. this.n0 = (this.getChild("n0"));
  13528. this.n1 = (this.getChild("n1"));
  13529. this.n2 = (this.getChild("n2"));
  13530. this.n3 = (this.getChild("n3"));
  13531. this.idle = this.getTransition("idle");
  13532. this.attack = this.getTransition("attack");
  13533. }
  13534. }
  13535. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13536. class ui_dh_zy_ganfa extends fgui.GButton {
  13537. static createInstance() {
  13538. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13539. }
  13540. onConstruct() {
  13541. this.n0 = (this.getChild("n0"));
  13542. }
  13543. }
  13544. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13545. class ui_dh_zy_sc_guang extends fgui.GButton {
  13546. static createInstance() {
  13547. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13548. }
  13549. onConstruct() {
  13550. this.n0 = (this.getChild("n0"));
  13551. this.n2 = (this.getChild("n2"));
  13552. }
  13553. }
  13554. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13555. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13556. static createInstance() {
  13557. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13558. }
  13559. onConstruct() {
  13560. this.n0 = (this.getChild("n0"));
  13561. this.n3 = (this.getChild("n3"));
  13562. this.t0 = this.getTransition("t0");
  13563. }
  13564. }
  13565. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13566. class ui_dh_zy_wanfa extends fgui.GButton {
  13567. static createInstance() {
  13568. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13569. }
  13570. onConstruct() {
  13571. this.n0 = (this.getChild("n0"));
  13572. }
  13573. }
  13574. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13575. class ui_Component53_1 extends fgui.GComponent {
  13576. static createInstance() {
  13577. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13578. }
  13579. onConstruct() {
  13580. this.n0 = (this.getChild("n0"));
  13581. this.n1 = (this.getChild("n1"));
  13582. this.n2 = (this.getChild("n2"));
  13583. this.n3 = (this.getChild("n3"));
  13584. this.n4 = (this.getChild("n4"));
  13585. this.n5 = (this.getChild("n5"));
  13586. this.n6 = (this.getChild("n6"));
  13587. this.n7 = (this.getChild("n7"));
  13588. this.n8 = (this.getChild("n8"));
  13589. this.n9 = (this.getChild("n9"));
  13590. this.n10 = (this.getChild("n10"));
  13591. this.n11 = (this.getChild("n11"));
  13592. this.n12 = (this.getChild("n12"));
  13593. this.n13 = (this.getChild("n13"));
  13594. this.n14 = (this.getChild("n14"));
  13595. this.n15 = (this.getChild("n15"));
  13596. this.n16 = (this.getChild("n16"));
  13597. this.n19 = (this.getChild("n19"));
  13598. this.n20 = (this.getChild("n20"));
  13599. this.n21 = (this.getChild("n21"));
  13600. this.n22 = (this.getChild("n22"));
  13601. this.n23 = (this.getChild("n23"));
  13602. this.n24 = (this.getChild("n24"));
  13603. this.n25 = (this.getChild("n25"));
  13604. this.n26 = (this.getChild("n26"));
  13605. this.n27 = (this.getChild("n27"));
  13606. this.n28 = (this.getChild("n28"));
  13607. this.n29 = (this.getChild("n29"));
  13608. this.n30 = (this.getChild("n30"));
  13609. this.n31 = (this.getChild("n31"));
  13610. this.n32 = (this.getChild("n32"));
  13611. this.n33 = (this.getChild("n33"));
  13612. this.n34 = (this.getChild("n34"));
  13613. this.n35 = (this.getChild("n35"));
  13614. this.t0 = this.getTransition("t0");
  13615. }
  13616. }
  13617. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13618. class ui_Component30 extends fgui.GComponent {
  13619. static createInstance() {
  13620. return (fgui.UIPackage.createObject("game", "Component30"));
  13621. }
  13622. onConstruct() {
  13623. this.c1 = this.getController("c1");
  13624. this.n46 = (this.getChild("n46"));
  13625. this.n47 = (this.getChild("n47"));
  13626. this.numTxt = (this.getChild("numTxt"));
  13627. this.n50 = (this.getChild("n50"));
  13628. this.n53 = (this.getChild("n53"));
  13629. this.n54 = (this.getChild("n54"));
  13630. this.n55 = (this.getChild("n55"));
  13631. this.n56 = (this.getChild("n56"));
  13632. }
  13633. }
  13634. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13635. class ui_Component30_1 extends fgui.GComponent {
  13636. static createInstance() {
  13637. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13638. }
  13639. onConstruct() {
  13640. this.c1 = this.getController("c1");
  13641. this.n46 = (this.getChild("n46"));
  13642. this.n47 = (this.getChild("n47"));
  13643. this.numTxt = (this.getChild("numTxt"));
  13644. this.n50 = (this.getChild("n50"));
  13645. this.n51 = (this.getChild("n51"));
  13646. this.n52 = (this.getChild("n52"));
  13647. this.n53 = (this.getChild("n53"));
  13648. this.n54 = (this.getChild("n54"));
  13649. }
  13650. }
  13651. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13652. class ui_Component31 extends fgui.GComponent {
  13653. static createInstance() {
  13654. return (fgui.UIPackage.createObject("game", "Component31"));
  13655. }
  13656. onConstruct() {
  13657. this.n55 = (this.getChild("n55"));
  13658. this.n54 = (this.getChild("n54"));
  13659. this.conditionTxt = (this.getChild("conditionTxt"));
  13660. this.n57 = (this.getChild("n57"));
  13661. this.t0 = this.getTransition("t0");
  13662. }
  13663. }
  13664. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13665. class ui_Component32 extends fgui.GComponent {
  13666. static createInstance() {
  13667. return (fgui.UIPackage.createObject("game", "Component32"));
  13668. }
  13669. onConstruct() {
  13670. this.n5 = (this.getChild("n5"));
  13671. this.n6 = (this.getChild("n6"));
  13672. this.n7 = (this.getChild("n7"));
  13673. this.t0 = this.getTransition("t0");
  13674. }
  13675. }
  13676. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13677. class ui_AwardItem extends fgui.GComponent {
  13678. static createInstance() {
  13679. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13680. }
  13681. onConstruct() {
  13682. this.n9 = (this.getChild("n9"));
  13683. this.myIcon = (this.getChild("myIcon"));
  13684. this.numTxt = (this.getChild("numTxt"));
  13685. this.nameTxt = (this.getChild("nameTxt"));
  13686. this.n16 = (this.getChild("n16"));
  13687. this.n17 = (this.getChild("n17"));
  13688. }
  13689. }
  13690. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13691. class ui_ranking_com1 extends fgui.GButton {
  13692. static createInstance() {
  13693. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13694. }
  13695. onConstruct() {
  13696. this.c1 = this.getController("c1");
  13697. this.n49 = (this.getChild("n49"));
  13698. this.n18 = (this.getChild("n18"));
  13699. this.n46 = (this.getChild("n46"));
  13700. this.n48 = (this.getChild("n48"));
  13701. this.n50 = (this.getChild("n50"));
  13702. }
  13703. }
  13704. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13705. class ui_ranking_com2 extends fgui.GButton {
  13706. static createInstance() {
  13707. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13708. }
  13709. onConstruct() {
  13710. this.c1 = this.getController("c1");
  13711. this.n49 = (this.getChild("n49"));
  13712. this.n18 = (this.getChild("n18"));
  13713. this.n46 = (this.getChild("n46"));
  13714. this.n48 = (this.getChild("n48"));
  13715. this.n50 = (this.getChild("n50"));
  13716. }
  13717. }
  13718. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13719. class ui_ranking_com3 extends fgui.GComponent {
  13720. static createInstance() {
  13721. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13722. }
  13723. onConstruct() {
  13724. this.n17 = (this.getChild("n17"));
  13725. this.myIcon = (this.getChild("myIcon"));
  13726. }
  13727. }
  13728. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13729. class ui_ranking_com4 extends fgui.GComponent {
  13730. static createInstance() {
  13731. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13732. }
  13733. onConstruct() {
  13734. this.n16 = (this.getChild("n16"));
  13735. this.head = (this.getChild("head"));
  13736. }
  13737. }
  13738. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13739. class ui_ranking_com5 extends fgui.GComponent {
  13740. static createInstance() {
  13741. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13742. }
  13743. onConstruct() {
  13744. this.c1 = this.getController("c1");
  13745. this.c2 = this.getController("c2");
  13746. this.n2 = (this.getChild("n2"));
  13747. this.n3 = (this.getChild("n3"));
  13748. this.levelBtn = (this.getChild("levelBtn"));
  13749. this.starBtn = (this.getChild("starBtn"));
  13750. this.n23 = (this.getChild("n23"));
  13751. this.n24 = (this.getChild("n24"));
  13752. this.n25 = (this.getChild("n25"));
  13753. this.myList = (this.getChild("myList"));
  13754. this.selfNode = (this.getChild("selfNode"));
  13755. this.n9 = (this.getChild("n9"));
  13756. this.n12 = (this.getChild("n12"));
  13757. this.n13 = (this.getChild("n13"));
  13758. this.n14 = (this.getChild("n14"));
  13759. this.n39 = (this.getChild("n39"));
  13760. this.n41 = (this.getChild("n41"));
  13761. this.n42 = (this.getChild("n42"));
  13762. this.n45 = (this.getChild("n45"));
  13763. this.changeBtn = (this.getChild("changeBtn"));
  13764. this.closeBtn = (this.getChild("closeBtn"));
  13765. this.t0 = this.getTransition("t0");
  13766. }
  13767. }
  13768. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13769. class ui_RankItem extends fgui.GComponent {
  13770. static createInstance() {
  13771. return (fgui.UIPackage.createObject("game", "RankItem"));
  13772. }
  13773. onConstruct() {
  13774. this.n10 = (this.getChild("n10"));
  13775. this.n11 = (this.getChild("n11"));
  13776. this.rankTxt = (this.getChild("rankTxt"));
  13777. this.headNode = (this.getChild("headNode"));
  13778. this.nameTxt = (this.getChild("nameTxt"));
  13779. this.n19 = (this.getChild("n19"));
  13780. this.valueTxt = (this.getChild("valueTxt"));
  13781. this.img1 = (this.getChild("img1"));
  13782. this.img2 = (this.getChild("img2"));
  13783. this.img3 = (this.getChild("img3"));
  13784. }
  13785. }
  13786. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13787. class ui_ranking_com9 extends fgui.GComponent {
  13788. static createInstance() {
  13789. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13790. }
  13791. onConstruct() {
  13792. this.c1 = this.getController("c1");
  13793. this.n27 = (this.getChild("n27"));
  13794. this.n28 = (this.getChild("n28"));
  13795. this.headNode = (this.getChild("headNode"));
  13796. this.rankTxt = (this.getChild("rankTxt"));
  13797. this.nameTxt = (this.getChild("nameTxt"));
  13798. this.n34 = (this.getChild("n34"));
  13799. this.valueTxt = (this.getChild("valueTxt"));
  13800. this.n36 = (this.getChild("n36"));
  13801. this.n37 = (this.getChild("n37"));
  13802. this.n38 = (this.getChild("n38"));
  13803. this.n39 = (this.getChild("n39"));
  13804. this.n40 = (this.getChild("n40"));
  13805. }
  13806. }
  13807. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13808. class ui_ranking_com10 extends fgui.GComponent {
  13809. static createInstance() {
  13810. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13811. }
  13812. onConstruct() {
  13813. this.n23 = (this.getChild("n23"));
  13814. this.n24 = (this.getChild("n24"));
  13815. }
  13816. }
  13817. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13818. class ui_ranking_com11 extends fgui.GComponent {
  13819. static createInstance() {
  13820. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13821. }
  13822. onConstruct() {
  13823. this.n24 = (this.getChild("n24"));
  13824. this.n25 = (this.getChild("n25"));
  13825. this.t0 = this.getTransition("t0");
  13826. }
  13827. }
  13828. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13829. class ui_ranking_com13 extends fgui.GButton {
  13830. static createInstance() {
  13831. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13832. }
  13833. onConstruct() {
  13834. this.c1 = this.getController("c1");
  13835. this.n44 = (this.getChild("n44"));
  13836. this.n45 = (this.getChild("n45"));
  13837. this.n46 = (this.getChild("n46"));
  13838. }
  13839. }
  13840. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13841. class ui_Component122 extends fgui.GComponent {
  13842. static createInstance() {
  13843. return (fgui.UIPackage.createObject("game", "Component122"));
  13844. }
  13845. onConstruct() {
  13846. this.gameNode3 = (this.getChild("gameNode3"));
  13847. }
  13848. }
  13849. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13850. class ui_skillItem extends fgui.GComponent {
  13851. static createInstance() {
  13852. return (fgui.UIPackage.createObject("game", "skillItem"));
  13853. }
  13854. onConstruct() {
  13855. this.c1 = this.getController("c1");
  13856. this.n31 = (this.getChild("n31"));
  13857. this.n6 = (this.getChild("n6"));
  13858. this.skillImg = (this.getChild("skillImg"));
  13859. this.nameTxt = (this.getChild("nameTxt"));
  13860. this.levelTxt = (this.getChild("levelTxt"));
  13861. this.n28 = (this.getChild("n28"));
  13862. this.describeTxt = (this.getChild("describeTxt"));
  13863. this.n32 = (this.getChild("n32"));
  13864. this.mutiBtn = (this.getChild("mutiBtn"));
  13865. this.tryNode = (this.getChild("tryNode"));
  13866. this.normalBtn = (this.getChild("normalBtn"));
  13867. this.startBtn = (this.getChild("startBtn"));
  13868. this.n42 = (this.getChild("n42"));
  13869. this.n43 = (this.getChild("n43"));
  13870. this.n44 = (this.getChild("n44"));
  13871. }
  13872. }
  13873. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13874. class ui_Component26 extends fgui.GButton {
  13875. static createInstance() {
  13876. return (fgui.UIPackage.createObject("game", "Component26"));
  13877. }
  13878. onConstruct() {
  13879. this.n11 = (this.getChild("n11"));
  13880. this.n30 = (this.getChild("n30"));
  13881. this.n34 = (this.getChild("n34"));
  13882. }
  13883. }
  13884. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13885. class ui_Component28 extends fgui.GButton {
  13886. static createInstance() {
  13887. return (fgui.UIPackage.createObject("game", "Component28"));
  13888. }
  13889. onConstruct() {
  13890. this.n12 = (this.getChild("n12"));
  13891. this.n31 = (this.getChild("n31"));
  13892. this.curTxt = (this.getChild("curTxt"));
  13893. this.n33 = (this.getChild("n33"));
  13894. }
  13895. }
  13896. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13897. class ui_Component1302 extends fgui.GComponent {
  13898. static createInstance() {
  13899. return (fgui.UIPackage.createObject("game", "Component1302"));
  13900. }
  13901. onConstruct() {
  13902. this.n2 = (this.getChild("n2"));
  13903. this.n3 = (this.getChild("n3"));
  13904. }
  13905. }
  13906. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13907. class ui_Component113 extends fgui.GComponent {
  13908. static createInstance() {
  13909. return (fgui.UIPackage.createObject("game", "Component113"));
  13910. }
  13911. onConstruct() {
  13912. this.n85 = (this.getChild("n85"));
  13913. this.n86 = (this.getChild("n86"));
  13914. this.n77 = (this.getChild("n77"));
  13915. this.n79 = (this.getChild("n79"));
  13916. this.n80 = (this.getChild("n80"));
  13917. this.n81 = (this.getChild("n81"));
  13918. this.n82 = (this.getChild("n82"));
  13919. this.n84 = (this.getChild("n84"));
  13920. this.n87 = (this.getChild("n87"));
  13921. this.t0 = this.getTransition("t0");
  13922. }
  13923. }
  13924. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13925. class ui_Component114 extends fgui.GComponent {
  13926. static createInstance() {
  13927. return (fgui.UIPackage.createObject("game", "Component114"));
  13928. }
  13929. onConstruct() {
  13930. this.n77 = (this.getChild("n77"));
  13931. this.t0 = this.getTransition("t0");
  13932. }
  13933. }
  13934. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13935. class ui_Component115 extends fgui.GComponent {
  13936. static createInstance() {
  13937. return (fgui.UIPackage.createObject("game", "Component115"));
  13938. }
  13939. onConstruct() {
  13940. this.n83 = (this.getChild("n83"));
  13941. this.fingerNode = (this.getChild("fingerNode"));
  13942. this.n84 = (this.getChild("n84"));
  13943. }
  13944. }
  13945. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13946. class ui_Component117 extends fgui.GComponent {
  13947. static createInstance() {
  13948. return (fgui.UIPackage.createObject("game", "Component117"));
  13949. }
  13950. onConstruct() {
  13951. this.n87 = (this.getChild("n87"));
  13952. this.n88 = (this.getChild("n88"));
  13953. this.n84 = (this.getChild("n84"));
  13954. this.n85 = (this.getChild("n85"));
  13955. this.n86 = (this.getChild("n86"));
  13956. this.t0 = this.getTransition("t0");
  13957. }
  13958. }
  13959. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13960. class ui_Component98_1 extends fgui.GButton {
  13961. static createInstance() {
  13962. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13963. }
  13964. onConstruct() {
  13965. this.c1 = this.getController("c1");
  13966. this.n8 = (this.getChild("n8"));
  13967. this.n41 = (this.getChild("n41"));
  13968. this.n40 = (this.getChild("n40"));
  13969. }
  13970. }
  13971. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13972. class ui_Component61 extends fgui.GComponent {
  13973. static createInstance() {
  13974. return (fgui.UIPackage.createObject("game", "Component61"));
  13975. }
  13976. onConstruct() {
  13977. this.n14 = (this.getChild("n14"));
  13978. this.n6 = (this.getChild("n6"));
  13979. this.t0 = this.getTransition("t0");
  13980. }
  13981. }
  13982. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13983. class ui_Component62 extends fgui.GComponent {
  13984. static createInstance() {
  13985. return (fgui.UIPackage.createObject("game", "Component62"));
  13986. }
  13987. onConstruct() {
  13988. this.n66 = (this.getChild("n66"));
  13989. this.n56 = (this.getChild("n56"));
  13990. this.n63 = (this.getChild("n63"));
  13991. this.n65 = (this.getChild("n65"));
  13992. this.t0 = this.getTransition("t0");
  13993. }
  13994. }
  13995. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13996. class ui_d3Root extends fgui.GComponent {
  13997. static createInstance() {
  13998. return (fgui.UIPackage.createObject("game", "d3Root"));
  13999. }
  14000. onConstruct() {
  14001. }
  14002. }
  14003. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  14004. class ui_d2Root extends fgui.GComponent {
  14005. static createInstance() {
  14006. return (fgui.UIPackage.createObject("game", "d2Root"));
  14007. }
  14008. onConstruct() {
  14009. }
  14010. }
  14011. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  14012. class ui_ballNode extends fgui.GComponent {
  14013. static createInstance() {
  14014. return (fgui.UIPackage.createObject("game", "ballNode"));
  14015. }
  14016. onConstruct() {
  14017. }
  14018. }
  14019. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  14020. class ui_border extends fgui.GComponent {
  14021. static createInstance() {
  14022. return (fgui.UIPackage.createObject("game", "border"));
  14023. }
  14024. onConstruct() {
  14025. this.bar1 = (this.getChild("bar1"));
  14026. this.bar2 = (this.getChild("bar2"));
  14027. this.bar3 = (this.getChild("bar3"));
  14028. this.bar4 = (this.getChild("bar4"));
  14029. this.bar5 = (this.getChild("bar5"));
  14030. this.bar6 = (this.getChild("bar6"));
  14031. this.circle1 = (this.getChild("circle1"));
  14032. this.circle2 = (this.getChild("circle2"));
  14033. this.circle3 = (this.getChild("circle3"));
  14034. this.circle4 = (this.getChild("circle4"));
  14035. this.circle5 = (this.getChild("circle5"));
  14036. this.circle6 = (this.getChild("circle6"));
  14037. this.n28 = (this.getChild("n28"));
  14038. }
  14039. }
  14040. ui_border.URL = "ui://isxx5ak7sdh33qq";
  14041. class ui_Component41_2 extends fgui.GComponent {
  14042. static createInstance() {
  14043. return (fgui.UIPackage.createObject("game", "Component41_2"));
  14044. }
  14045. onConstruct() {
  14046. this.c1 = this.getController("c1");
  14047. this.n0 = (this.getChild("n0"));
  14048. this.n2 = (this.getChild("n2"));
  14049. this.n19 = (this.getChild("n19"));
  14050. this.cancelBtn = (this.getChild("cancelBtn"));
  14051. this.videoBtn = (this.getChild("videoBtn"));
  14052. this.n9 = (this.getChild("n9"));
  14053. this.n22 = (this.getChild("n22"));
  14054. this.tipsTxt = (this.getChild("tipsTxt"));
  14055. this.n23 = (this.getChild("n23"));
  14056. this.n24 = (this.getChild("n24"));
  14057. this.n26 = (this.getChild("n26"));
  14058. this.n27 = (this.getChild("n27"));
  14059. this.titleTxt = (this.getChild("titleTxt"));
  14060. }
  14061. }
  14062. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  14063. class ui_Component41_1 extends fgui.GComponent {
  14064. static createInstance() {
  14065. return (fgui.UIPackage.createObject("game", "Component41_1"));
  14066. }
  14067. onConstruct() {
  14068. this.c1 = this.getController("c1");
  14069. this.n0 = (this.getChild("n0"));
  14070. this.n2 = (this.getChild("n2"));
  14071. this.cancelBtn = (this.getChild("cancelBtn"));
  14072. this.videoBtn = (this.getChild("videoBtn"));
  14073. this.n27 = (this.getChild("n27"));
  14074. this.n30 = (this.getChild("n30"));
  14075. this.n31 = (this.getChild("n31"));
  14076. this.n32 = (this.getChild("n32"));
  14077. this.n33 = (this.getChild("n33"));
  14078. this.n34 = (this.getChild("n34"));
  14079. this.n35 = (this.getChild("n35"));
  14080. this.n36 = (this.getChild("n36"));
  14081. this.n1 = (this.getChild("n1"));
  14082. this.n37 = (this.getChild("n37"));
  14083. this.t0 = this.getTransition("t0");
  14084. this.t1 = this.getTransition("t1");
  14085. this.t2 = this.getTransition("t2");
  14086. this.t3 = this.getTransition("t3");
  14087. }
  14088. }
  14089. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  14090. class ui_againBtn extends fgui.GButton {
  14091. static createInstance() {
  14092. return (fgui.UIPackage.createObject("game", "againBtn"));
  14093. }
  14094. onConstruct() {
  14095. this.n2 = (this.getChild("n2"));
  14096. this.n1 = (this.getChild("n1"));
  14097. this.n5 = (this.getChild("n5"));
  14098. }
  14099. }
  14100. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  14101. class ui_Component118 extends fgui.GButton {
  14102. static createInstance() {
  14103. return (fgui.UIPackage.createObject("game", "Component118"));
  14104. }
  14105. onConstruct() {
  14106. this.c1 = this.getController("c1");
  14107. this.n14 = (this.getChild("n14"));
  14108. this.n9 = (this.getChild("n9"));
  14109. this.n10 = (this.getChild("n10"));
  14110. this.diamondTxt = (this.getChild("diamondTxt"));
  14111. this.n13 = (this.getChild("n13"));
  14112. this.n15 = (this.getChild("n15"));
  14113. }
  14114. }
  14115. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  14116. class ui_Component119 extends fgui.GComponent {
  14117. static createInstance() {
  14118. return (fgui.UIPackage.createObject("game", "Component119"));
  14119. }
  14120. onConstruct() {
  14121. this.n1 = (this.getChild("n1"));
  14122. this.n2 = (this.getChild("n2"));
  14123. this.n13 = (this.getChild("n13"));
  14124. this.n6 = (this.getChild("n6"));
  14125. this.screenNode = (this.getChild("screenNode"));
  14126. this.n15 = (this.getChild("n15"));
  14127. this.closeBtn = (this.getChild("closeBtn"));
  14128. this.share2Btn = (this.getChild("share2Btn"));
  14129. this.shareBtn = (this.getChild("shareBtn"));
  14130. this.tipsNode = (this.getChild("tipsNode"));
  14131. this.awardNode = (this.getChild("awardNode"));
  14132. }
  14133. }
  14134. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  14135. class ui_Component132_1 extends fgui.GComponent {
  14136. static createInstance() {
  14137. return (fgui.UIPackage.createObject("game", "Component132_1"));
  14138. }
  14139. onConstruct() {
  14140. this.n25 = (this.getChild("n25"));
  14141. this.n26 = (this.getChild("n26"));
  14142. this.n27 = (this.getChild("n27"));
  14143. this.t0 = this.getTransition("t0");
  14144. }
  14145. }
  14146. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  14147. class ui_SecretaryDisplay extends fgui.GComponent {
  14148. static createInstance() {
  14149. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  14150. }
  14151. onConstruct() {
  14152. this.n2 = (this.getChild("n2"));
  14153. this.levelTxt = (this.getChild("levelTxt"));
  14154. this.n4 = (this.getChild("n4"));
  14155. this.secretary = (this.getChild("secretary"));
  14156. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14157. this.n16 = (this.getChild("n16"));
  14158. this.n37 = (this.getChild("n37"));
  14159. this.n41 = (this.getChild("n41"));
  14160. this.n14 = (this.getChild("n14"));
  14161. this.n17 = (this.getChild("n17"));
  14162. this.heightTxt = (this.getChild("heightTxt"));
  14163. this.n46 = (this.getChild("n46"));
  14164. this.n36 = (this.getChild("n36"));
  14165. this.n38 = (this.getChild("n38"));
  14166. this.foodTxt = (this.getChild("foodTxt"));
  14167. this.n47 = (this.getChild("n47"));
  14168. this.n40 = (this.getChild("n40"));
  14169. this.n42 = (this.getChild("n42"));
  14170. this.historyTxt = (this.getChild("historyTxt"));
  14171. this.n48 = (this.getChild("n48"));
  14172. this.nameImg = (this.getChild("nameImg"));
  14173. this.n12 = (this.getChild("n12"));
  14174. this.n49 = (this.getChild("n49"));
  14175. this.t0 = this.getTransition("t0");
  14176. }
  14177. }
  14178. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14179. class ui_BallRodDisplay extends fgui.GComponent {
  14180. static createInstance() {
  14181. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14182. }
  14183. onConstruct() {
  14184. this.c1 = this.getController("c1");
  14185. this.n31 = (this.getChild("n31"));
  14186. this.n6 = (this.getChild("n6"));
  14187. this.nameTxt = (this.getChild("nameTxt"));
  14188. this.rodImg = (this.getChild("rodImg"));
  14189. this.levelNode = (this.getChild("levelNode"));
  14190. this.eftRod = (this.getChild("eftRod"));
  14191. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14192. }
  14193. }
  14194. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14195. class ui_Component111_11 extends fgui.GComponent {
  14196. static createInstance() {
  14197. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14198. }
  14199. onConstruct() {
  14200. this.n68 = (this.getChild("n68"));
  14201. this.n69 = (this.getChild("n69"));
  14202. }
  14203. }
  14204. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14205. class ui_Component112 extends fgui.GComponent {
  14206. static createInstance() {
  14207. return (fgui.UIPackage.createObject("game", "Component112"));
  14208. }
  14209. onConstruct() {
  14210. this.n68 = (this.getChild("n68"));
  14211. this.n70 = (this.getChild("n70"));
  14212. this.myMask = (this.getChild("myMask"));
  14213. }
  14214. }
  14215. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14216. class ui_Component111 extends fgui.GComponent {
  14217. static createInstance() {
  14218. return (fgui.UIPackage.createObject("game", "Component111"));
  14219. }
  14220. onConstruct() {
  14221. this.n68 = (this.getChild("n68"));
  14222. this.myMask = (this.getChild("myMask"));
  14223. }
  14224. }
  14225. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14226. class ui_Component144 extends fgui.GButton {
  14227. static createInstance() {
  14228. return (fgui.UIPackage.createObject("game", "Component144"));
  14229. }
  14230. onConstruct() {
  14231. this.n8 = (this.getChild("n8"));
  14232. }
  14233. }
  14234. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14235. class ui_Sign_com2 extends fgui.GComponent {
  14236. static createInstance() {
  14237. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14238. }
  14239. onConstruct() {
  14240. this.n0 = (this.getChild("n0"));
  14241. this.n1 = (this.getChild("n1"));
  14242. this.t0 = this.getTransition("t0");
  14243. }
  14244. }
  14245. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14246. class ui_Sign_guang extends fgui.GComponent {
  14247. static createInstance() {
  14248. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14249. }
  14250. onConstruct() {
  14251. this.n1 = (this.getChild("n1"));
  14252. this.n2 = (this.getChild("n2"));
  14253. this.n3 = (this.getChild("n3"));
  14254. this.n4 = (this.getChild("n4"));
  14255. this.n5 = (this.getChild("n5"));
  14256. this.n6 = (this.getChild("n6"));
  14257. this.n8 = (this.getChild("n8"));
  14258. }
  14259. }
  14260. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14261. class ui_SignMax extends fgui.GComponent {
  14262. static createInstance() {
  14263. return (fgui.UIPackage.createObject("game", "SignMax"));
  14264. }
  14265. onConstruct() {
  14266. this.c1 = this.getController("c1");
  14267. this.n7 = (this.getChild("n7"));
  14268. this.n15 = (this.getChild("n15"));
  14269. this.n8 = (this.getChild("n8"));
  14270. this.titleTxt = (this.getChild("titleTxt"));
  14271. this.myIcon1 = (this.getChild("myIcon1"));
  14272. this.numTxt1 = (this.getChild("numTxt1"));
  14273. this.myIcon2 = (this.getChild("myIcon2"));
  14274. this.n20 = (this.getChild("n20"));
  14275. this.n17 = (this.getChild("n17"));
  14276. this.numTxt2 = (this.getChild("numTxt2"));
  14277. this.n12 = (this.getChild("n12"));
  14278. this.n13 = (this.getChild("n13"));
  14279. this.n21 = (this.getChild("n21"));
  14280. this.n14 = (this.getChild("n14"));
  14281. }
  14282. }
  14283. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14284. class ui_Sign_com2_1 extends fgui.GComponent {
  14285. static createInstance() {
  14286. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14287. }
  14288. onConstruct() {
  14289. this.n0 = (this.getChild("n0"));
  14290. this.n1 = (this.getChild("n1"));
  14291. this.t0 = this.getTransition("t0");
  14292. }
  14293. }
  14294. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14295. class ui_Sign_com5 extends fgui.GComponent {
  14296. static createInstance() {
  14297. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14298. }
  14299. onConstruct() {
  14300. this.n3 = (this.getChild("n3"));
  14301. this.n29 = (this.getChild("n29"));
  14302. this.n4 = (this.getChild("n4"));
  14303. this.day1 = (this.getChild("day1"));
  14304. this.day2 = (this.getChild("day2"));
  14305. this.day3 = (this.getChild("day3"));
  14306. this.day4 = (this.getChild("day4"));
  14307. this.day5 = (this.getChild("day5"));
  14308. this.day6 = (this.getChild("day6"));
  14309. this.day7 = (this.getChild("day7"));
  14310. this.t0 = this.getTransition("t0");
  14311. }
  14312. }
  14313. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  14314. class ui_Sign_com8 extends fgui.GComponent {
  14315. static createInstance() {
  14316. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  14317. }
  14318. onConstruct() {
  14319. this.n48 = (this.getChild("n48"));
  14320. this.womanTxt = (this.getChild("womanTxt"));
  14321. this.t0 = this.getTransition("t0");
  14322. }
  14323. }
  14324. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  14325. class ui_Sign_com6 extends fgui.GComponent {
  14326. static createInstance() {
  14327. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  14328. }
  14329. onConstruct() {
  14330. this.n2 = (this.getChild("n2"));
  14331. this.n3 = (this.getChild("n3"));
  14332. this.t0 = this.getTransition("t0");
  14333. }
  14334. }
  14335. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  14336. class ui_Sign_com7 extends fgui.GComponent {
  14337. static createInstance() {
  14338. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  14339. }
  14340. onConstruct() {
  14341. this.n29 = (this.getChild("n29"));
  14342. this.n2 = (this.getChild("n2"));
  14343. }
  14344. }
  14345. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  14346. class ui_UITurntable_com1_2 extends fgui.GComponent {
  14347. static createInstance() {
  14348. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  14349. }
  14350. onConstruct() {
  14351. this.n5 = (this.getChild("n5"));
  14352. this.n4 = (this.getChild("n4"));
  14353. this.t0 = this.getTransition("t0");
  14354. }
  14355. }
  14356. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  14357. class ui_UITurntable_com2 extends fgui.GComponent {
  14358. static createInstance() {
  14359. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  14360. }
  14361. onConstruct() {
  14362. this.c1 = this.getController("c1");
  14363. this.n4 = (this.getChild("n4"));
  14364. this.n6 = (this.getChild("n6"));
  14365. this.n10 = (this.getChild("n10"));
  14366. this.n11 = (this.getChild("n11"));
  14367. this.n12 = (this.getChild("n12"));
  14368. this.n13 = (this.getChild("n13"));
  14369. this.n14 = (this.getChild("n14"));
  14370. this.n15 = (this.getChild("n15"));
  14371. this.n16 = (this.getChild("n16"));
  14372. this.n17 = (this.getChild("n17"));
  14373. this.n18 = (this.getChild("n18"));
  14374. this.n19 = (this.getChild("n19"));
  14375. this.n20 = (this.getChild("n20"));
  14376. this.n21 = (this.getChild("n21"));
  14377. this.n22 = (this.getChild("n22"));
  14378. this.n23 = (this.getChild("n23"));
  14379. this.n24 = (this.getChild("n24"));
  14380. this.n25 = (this.getChild("n25"));
  14381. this.n26 = (this.getChild("n26"));
  14382. this.n27 = (this.getChild("n27"));
  14383. this.n28 = (this.getChild("n28"));
  14384. this.n29 = (this.getChild("n29"));
  14385. this.n30 = (this.getChild("n30"));
  14386. this.n31 = (this.getChild("n31"));
  14387. this.n32 = (this.getChild("n32"));
  14388. this.n33 = (this.getChild("n33"));
  14389. }
  14390. }
  14391. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  14392. class ui_UITurntable_com1_1 extends fgui.GComponent {
  14393. static createInstance() {
  14394. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  14395. }
  14396. onConstruct() {
  14397. this.n5 = (this.getChild("n5"));
  14398. this.n4 = (this.getChild("n4"));
  14399. this.t0 = this.getTransition("t0");
  14400. }
  14401. }
  14402. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  14403. class ui_UITurntable_com5 extends fgui.GComponent {
  14404. static createInstance() {
  14405. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  14406. }
  14407. onConstruct() {
  14408. this.flashNode = (this.getChild("flashNode"));
  14409. this.rotNode = (this.getChild("rotNode"));
  14410. this.n3 = (this.getChild("n3"));
  14411. this.n21 = (this.getChild("n21"));
  14412. this.t0 = this.getTransition("t0");
  14413. }
  14414. }
  14415. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14416. class ui_UITurntable_com7 extends fgui.GComponent {
  14417. static createInstance() {
  14418. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14419. }
  14420. onConstruct() {
  14421. this.n2 = (this.getChild("n2"));
  14422. this.n35 = (this.getChild("n35"));
  14423. this.img1 = (this.getChild("img1"));
  14424. this.img2 = (this.getChild("img2"));
  14425. this.img3 = (this.getChild("img3"));
  14426. this.img4 = (this.getChild("img4"));
  14427. this.img6 = (this.getChild("img6"));
  14428. this.img5 = (this.getChild("img5"));
  14429. this.txt1 = (this.getChild("txt1"));
  14430. this.txt2 = (this.getChild("txt2"));
  14431. this.txt3 = (this.getChild("txt3"));
  14432. this.txt4 = (this.getChild("txt4"));
  14433. this.txt5 = (this.getChild("txt5"));
  14434. this.txt6 = (this.getChild("txt6"));
  14435. }
  14436. }
  14437. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14438. class ui_UITurntable_com9 extends fgui.GComponent {
  14439. static createInstance() {
  14440. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14441. }
  14442. onConstruct() {
  14443. this.n38 = (this.getChild("n38"));
  14444. this.n39 = (this.getChild("n39"));
  14445. }
  14446. }
  14447. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14448. class ui_UITurntable_com10 extends fgui.GComponent {
  14449. static createInstance() {
  14450. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14451. }
  14452. onConstruct() {
  14453. this.n39 = (this.getChild("n39"));
  14454. this.n40 = (this.getChild("n40"));
  14455. this.t0 = this.getTransition("t0");
  14456. }
  14457. }
  14458. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14459. class ui_UITurntable_com11 extends fgui.GComponent {
  14460. static createInstance() {
  14461. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14462. }
  14463. onConstruct() {
  14464. this.n38 = (this.getChild("n38"));
  14465. this.n39 = (this.getChild("n39"));
  14466. this.n40 = (this.getChild("n40"));
  14467. this.t0 = this.getTransition("t0");
  14468. }
  14469. }
  14470. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14471. class ui_UITurntable_com12 extends fgui.GComponent {
  14472. static createInstance() {
  14473. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14474. }
  14475. onConstruct() {
  14476. this.n43 = (this.getChild("n43"));
  14477. this.barNode = (this.getChild("barNode"));
  14478. this.tipsTxt = (this.getChild("tipsTxt"));
  14479. this.n45 = (this.getChild("n45"));
  14480. this.boxBtn = (this.getChild("boxBtn"));
  14481. }
  14482. }
  14483. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14484. class ui_UITurntable_com1 extends fgui.GButton {
  14485. static createInstance() {
  14486. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14487. }
  14488. onConstruct() {
  14489. this.n41 = (this.getChild("n41"));
  14490. this.n42 = (this.getChild("n42"));
  14491. this.t0 = this.getTransition("t0");
  14492. }
  14493. }
  14494. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14495. class ui_UITurntable_com3 extends fgui.GComponent {
  14496. static createInstance() {
  14497. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14498. }
  14499. onConstruct() {
  14500. this.n48 = (this.getChild("n48"));
  14501. this.womanTxt = (this.getChild("womanTxt"));
  14502. this.t0 = this.getTransition("t0");
  14503. }
  14504. }
  14505. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14506. class ui_cancelBtn2 extends fgui.GButton {
  14507. static createInstance() {
  14508. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14509. }
  14510. onConstruct() {
  14511. this.c1 = this.getController("c1");
  14512. this.n0 = (this.getChild("n0"));
  14513. this.n1 = (this.getChild("n1"));
  14514. this.n2 = (this.getChild("n2"));
  14515. this.n3 = (this.getChild("n3"));
  14516. this.n4 = (this.getChild("n4"));
  14517. this.n5 = (this.getChild("n5"));
  14518. this.n6 = (this.getChild("n6"));
  14519. this.n7 = (this.getChild("n7"));
  14520. this.n8 = (this.getChild("n8"));
  14521. this.powerEft = (this.getChild("powerEft"));
  14522. }
  14523. }
  14524. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14525. class ui_shareBtn2 extends fgui.GButton {
  14526. static createInstance() {
  14527. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14528. }
  14529. onConstruct() {
  14530. this.c1 = this.getController("c1");
  14531. this.n2 = (this.getChild("n2"));
  14532. this.n24 = (this.getChild("n24"));
  14533. this.n1 = (this.getChild("n1"));
  14534. this.n3 = (this.getChild("n3"));
  14535. this.n23 = (this.getChild("n23"));
  14536. this.n4 = (this.getChild("n4"));
  14537. this.n5 = (this.getChild("n5"));
  14538. this.n6 = (this.getChild("n6"));
  14539. this.n20 = (this.getChild("n20"));
  14540. this.n21 = (this.getChild("n21"));
  14541. this.n22 = (this.getChild("n22"));
  14542. this.powerEft = (this.getChild("powerEft"));
  14543. }
  14544. }
  14545. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14546. class ui_UIMoney extends fgui.GComponent {
  14547. static createInstance() {
  14548. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14549. }
  14550. onConstruct() {
  14551. this.c1 = this.getController("c1");
  14552. this.n4 = (this.getChild("n4"));
  14553. this.coinImg = (this.getChild("coinImg"));
  14554. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14555. this.coinTxt = (this.getChild("coinTxt"));
  14556. this.n7 = (this.getChild("n7"));
  14557. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14558. this.diamondTxt = (this.getChild("diamondTxt"));
  14559. this.diamondImg = (this.getChild("diamondImg"));
  14560. this.n12 = (this.getChild("n12"));
  14561. this.powerImg = (this.getChild("powerImg"));
  14562. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14563. this.powerTxt = (this.getChild("powerTxt"));
  14564. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14565. }
  14566. }
  14567. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14568. class ui_backBtn extends fgui.GButton {
  14569. static createInstance() {
  14570. return (fgui.UIPackage.createObject("game", "backBtn"));
  14571. }
  14572. onConstruct() {
  14573. this.n0 = (this.getChild("n0"));
  14574. this.t0 = this.getTransition("t0");
  14575. this.t1 = this.getTransition("t1");
  14576. }
  14577. }
  14578. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14579. class ui_MoneyBtn extends fgui.GButton {
  14580. static createInstance() {
  14581. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14582. }
  14583. onConstruct() {
  14584. this.button = this.getController("button");
  14585. this.n0 = (this.getChild("n0"));
  14586. }
  14587. }
  14588. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14589. class ui_UIMoneyBtn extends fgui.GComponent {
  14590. static createInstance() {
  14591. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14592. }
  14593. onConstruct() {
  14594. this.n1 = (this.getChild("n1"));
  14595. this.closeBtn = (this.getChild("closeBtn"));
  14596. }
  14597. }
  14598. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14599. class ui_Component64 extends fgui.GComponent {
  14600. static createInstance() {
  14601. return (fgui.UIPackage.createObject("game", "Component64"));
  14602. }
  14603. onConstruct() {
  14604. this.n57 = (this.getChild("n57"));
  14605. this.n54 = (this.getChild("n54"));
  14606. this.n55 = (this.getChild("n55"));
  14607. this.n56 = (this.getChild("n56"));
  14608. this.t1 = this.getTransition("t1");
  14609. }
  14610. }
  14611. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14612. class ui_Component41_3 extends fgui.GComponent {
  14613. static createInstance() {
  14614. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14615. }
  14616. onConstruct() {
  14617. this.c1 = this.getController("c1");
  14618. this.n0 = (this.getChild("n0"));
  14619. this.n2 = (this.getChild("n2"));
  14620. this.cancelBtn = (this.getChild("cancelBtn"));
  14621. this.videoBtn = (this.getChild("videoBtn"));
  14622. this.n9 = (this.getChild("n9"));
  14623. this.n24 = (this.getChild("n24"));
  14624. this.n27 = (this.getChild("n27"));
  14625. this.titleTxt = (this.getChild("titleTxt"));
  14626. this.n28 = (this.getChild("n28"));
  14627. this.t0 = this.getTransition("t0");
  14628. }
  14629. }
  14630. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14631. class ui_dh_zs_4 extends fgui.GComponent {
  14632. static createInstance() {
  14633. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14634. }
  14635. onConstruct() {
  14636. this.n1 = (this.getChild("n1"));
  14637. this.n2 = (this.getChild("n2"));
  14638. this.n3 = (this.getChild("n3"));
  14639. this.n4 = (this.getChild("n4"));
  14640. this.n5 = (this.getChild("n5"));
  14641. this.n6 = (this.getChild("n6"));
  14642. this.n8 = (this.getChild("n8"));
  14643. this.t0 = this.getTransition("t0");
  14644. }
  14645. }
  14646. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14647. class ui_Component71_1 extends fgui.GButton {
  14648. static createInstance() {
  14649. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14650. }
  14651. onConstruct() {
  14652. this.n17 = (this.getChild("n17"));
  14653. this.t0 = this.getTransition("t0");
  14654. }
  14655. }
  14656. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14657. class ui_Component83 extends fgui.GComponent {
  14658. static createInstance() {
  14659. return (fgui.UIPackage.createObject("game", "Component83"));
  14660. }
  14661. onConstruct() {
  14662. this.c1 = this.getController("c1");
  14663. this.n17 = (this.getChild("n17"));
  14664. this.n19 = (this.getChild("n19"));
  14665. this.n20 = (this.getChild("n20"));
  14666. }
  14667. }
  14668. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14669. class ui_Component84 extends fgui.GComponent {
  14670. static createInstance() {
  14671. return (fgui.UIPackage.createObject("game", "Component84"));
  14672. }
  14673. onConstruct() {
  14674. this.c1 = this.getController("c1");
  14675. this.n4 = (this.getChild("n4"));
  14676. this.n22 = (this.getChild("n22"));
  14677. this.n23 = (this.getChild("n23"));
  14678. this.numTxt = (this.getChild("numTxt"));
  14679. this.n25 = (this.getChild("n25"));
  14680. this.n26 = (this.getChild("n26"));
  14681. }
  14682. }
  14683. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14684. class ui_Component84_1 extends fgui.GComponent {
  14685. static createInstance() {
  14686. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14687. }
  14688. onConstruct() {
  14689. this.c1 = this.getController("c1");
  14690. this.n4 = (this.getChild("n4"));
  14691. this.n22 = (this.getChild("n22"));
  14692. this.n23 = (this.getChild("n23"));
  14693. this.numTxt = (this.getChild("numTxt"));
  14694. this.n25 = (this.getChild("n25"));
  14695. this.n26 = (this.getChild("n26"));
  14696. }
  14697. }
  14698. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14699. class ui_Component85 extends fgui.GComponent {
  14700. static createInstance() {
  14701. return (fgui.UIPackage.createObject("game", "Component85"));
  14702. }
  14703. onConstruct() {
  14704. this.n1 = (this.getChild("n1"));
  14705. this.n6 = (this.getChild("n6"));
  14706. this.n2 = (this.getChild("n2"));
  14707. this.n3 = (this.getChild("n3"));
  14708. this.levelTxt = (this.getChild("levelTxt"));
  14709. this.n10 = (this.getChild("n10"));
  14710. this.n11 = (this.getChild("n11"));
  14711. this.n12 = (this.getChild("n12"));
  14712. this.n13 = (this.getChild("n13"));
  14713. this.n14 = (this.getChild("n14"));
  14714. this.modeNode = (this.getChild("modeNode"));
  14715. this.n18 = (this.getChild("n18"));
  14716. this.conditionTxt = (this.getChild("conditionTxt"));
  14717. this.diamondNode = (this.getChild("diamondNode"));
  14718. this.coinNode = (this.getChild("coinNode"));
  14719. this.startBtn = (this.getChild("startBtn"));
  14720. this.n28 = (this.getChild("n28"));
  14721. this.displayRoot = (this.getChild("displayRoot"));
  14722. this.t0 = this.getTransition("t0");
  14723. }
  14724. }
  14725. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14726. class ui_Component86 extends fgui.GButton {
  14727. static createInstance() {
  14728. return (fgui.UIPackage.createObject("game", "Component86"));
  14729. }
  14730. onConstruct() {
  14731. this.n15 = (this.getChild("n15"));
  14732. this.t0 = this.getTransition("t0");
  14733. }
  14734. }
  14735. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14736. class ui_Component87 extends fgui.GComponent {
  14737. static createInstance() {
  14738. return (fgui.UIPackage.createObject("game", "Component87"));
  14739. }
  14740. onConstruct() {
  14741. this.n66 = (this.getChild("n66"));
  14742. this.myProgress = (this.getChild("myProgress"));
  14743. this.starAni = (this.getChild("starAni"));
  14744. this.hpTxt = (this.getChild("hpTxt"));
  14745. this.n74 = (this.getChild("n74"));
  14746. this.n73 = (this.getChild("n73"));
  14747. this.ballTxt = (this.getChild("ballTxt"));
  14748. this.n76 = (this.getChild("n76"));
  14749. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14750. this.levelTxt = (this.getChild("levelTxt"));
  14751. this.star1 = (this.getChild("star1"));
  14752. this.star2 = (this.getChild("star2"));
  14753. this.star3 = (this.getChild("star3"));
  14754. }
  14755. }
  14756. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14757. class ui_Component88 extends fgui.GProgressBar {
  14758. static createInstance() {
  14759. return (fgui.UIPackage.createObject("game", "Component88"));
  14760. }
  14761. onConstruct() {
  14762. this.n68 = (this.getChild("n68"));
  14763. this.bar = (this.getChild("bar"));
  14764. }
  14765. }
  14766. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14767. class ui_Component89 extends fgui.GComponent {
  14768. static createInstance() {
  14769. return (fgui.UIPackage.createObject("game", "Component89"));
  14770. }
  14771. onConstruct() {
  14772. this.c1 = this.getController("c1");
  14773. this.n71 = (this.getChild("n71"));
  14774. this.n72 = (this.getChild("n72"));
  14775. }
  14776. }
  14777. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14778. class ui_Component90 extends fgui.GComponent {
  14779. static createInstance() {
  14780. return (fgui.UIPackage.createObject("game", "Component90"));
  14781. }
  14782. onConstruct() {
  14783. this.c1 = this.getController("c1");
  14784. this.n64 = (this.getChild("n64"));
  14785. this.n65 = (this.getChild("n65"));
  14786. this.n66 = (this.getChild("n66"));
  14787. this.t0 = this.getTransition("t0");
  14788. }
  14789. }
  14790. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14791. class ui_Component127 extends fgui.GButton {
  14792. static createInstance() {
  14793. return (fgui.UIPackage.createObject("game", "Component127"));
  14794. }
  14795. onConstruct() {
  14796. this.n5 = (this.getChild("n5"));
  14797. }
  14798. }
  14799. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14800. class gameBinder {
  14801. static bindAll() {
  14802. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14803. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14804. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14805. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14806. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14807. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14808. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14809. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14810. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14811. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14812. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14813. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14814. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14815. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14816. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14817. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14818. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14819. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14820. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14821. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14822. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14823. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14824. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14825. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14826. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14827. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14828. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14829. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14830. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14831. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14832. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14833. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14834. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14835. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14836. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14837. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14838. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14839. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14840. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14841. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14842. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14843. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14844. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14845. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14846. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14847. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14848. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14849. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14850. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14851. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14852. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14853. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14854. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14855. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14856. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14857. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14858. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14859. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14860. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14861. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14862. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14863. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14864. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14865. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14866. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14867. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14868. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14869. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14870. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14871. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14872. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14873. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14874. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14875. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14876. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14877. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14878. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14879. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14880. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14881. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14882. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14883. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14884. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14885. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14886. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14887. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14888. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14889. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14890. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14891. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14892. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14893. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14894. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  14895. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14896. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14897. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14898. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14899. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14900. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14901. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14902. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14903. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14904. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14905. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14906. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14907. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14908. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14909. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14910. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14911. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14912. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14913. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14914. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14915. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14916. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14917. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14918. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14919. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14920. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14921. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14922. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14923. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14924. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14925. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14926. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14927. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14928. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14929. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14930. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14931. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14932. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14933. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14934. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14935. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14936. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14937. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14938. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14939. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14940. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14941. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14942. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14943. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14944. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14945. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14946. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14947. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14948. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14949. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14950. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14951. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14952. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14953. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14954. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14955. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14956. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14957. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14958. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14959. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14960. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14961. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14962. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14963. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14964. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14965. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14966. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14967. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14968. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14969. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14970. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14971. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14972. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14973. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14974. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14975. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14976. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14977. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14978. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14979. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14980. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14981. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14982. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14983. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14984. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14985. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14986. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14987. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14988. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14989. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14990. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14991. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14992. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14993. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14994. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14995. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14996. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14997. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14998. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14999. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  15000. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  15001. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  15002. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  15003. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  15004. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  15005. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  15006. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  15007. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  15008. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  15009. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  15010. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  15011. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  15012. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  15013. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  15014. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  15015. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  15016. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  15017. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  15018. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  15019. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  15020. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  15021. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  15022. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  15023. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  15024. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  15025. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  15026. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  15027. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  15028. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  15029. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  15030. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  15031. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  15032. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  15033. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  15034. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  15035. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  15036. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  15037. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  15038. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  15039. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  15040. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  15041. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  15042. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  15043. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  15044. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  15045. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  15046. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  15047. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  15048. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  15049. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  15050. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  15051. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  15052. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  15053. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  15054. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  15055. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  15056. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  15057. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  15058. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  15059. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  15060. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  15061. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  15062. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  15063. }
  15064. }
  15065. class ui_btn6 extends fgui.GButton {
  15066. static createInstance() {
  15067. return (fgui.UIPackage.createObject("loading", "btn6"));
  15068. }
  15069. onConstruct() {
  15070. this.n6 = (this.getChild("n6"));
  15071. this.n1 = (this.getChild("n1"));
  15072. }
  15073. }
  15074. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  15075. class ui_xyItem extends fgui.GComponent {
  15076. static createInstance() {
  15077. return (fgui.UIPackage.createObject("loading", "xyItem"));
  15078. }
  15079. onConstruct() {
  15080. this.xyItem = (this.getChild("xyItem"));
  15081. }
  15082. }
  15083. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  15084. class ui_loadinfo extends fgui.GProgressBar {
  15085. static createInstance() {
  15086. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  15087. }
  15088. onConstruct() {
  15089. this.bg = (this.getChild("bg"));
  15090. this.bar = (this.getChild("bar"));
  15091. this.title = (this.getChild("title"));
  15092. this.ani = (this.getChild("ani"));
  15093. }
  15094. }
  15095. ui_loadinfo.URL = "ui://37nctnhwis36c";
  15096. class ui_xyNode extends fgui.GComponent {
  15097. static createInstance() {
  15098. return (fgui.UIPackage.createObject("loading", "xyNode"));
  15099. }
  15100. onConstruct() {
  15101. this.n0 = (this.getChild("n0"));
  15102. this.btnYes = (this.getChild("btnYes"));
  15103. this.btnNo = (this.getChild("btnNo"));
  15104. this.btnKnown = (this.getChild("btnKnown"));
  15105. this.btnSure = (this.getChild("btnSure"));
  15106. this.txtWelcom = (this.getChild("txtWelcom"));
  15107. this.txtXy = (this.getChild("txtXy"));
  15108. this.n75 = (this.getChild("n75"));
  15109. this.btnXy1 = (this.getChild("btnXy1"));
  15110. this.btnXy3 = (this.getChild("btnXy3"));
  15111. this.btnXy2 = (this.getChild("btnXy2"));
  15112. this.n74 = (this.getChild("n74"));
  15113. this.xy1 = (this.getChild("xy1"));
  15114. this.txtTitle = (this.getChild("txtTitle"));
  15115. this.btnBack = (this.getChild("btnBack"));
  15116. this.xyList = (this.getChild("xyList"));
  15117. this.xy2 = (this.getChild("xy2"));
  15118. this.xyNode = (this.getChild("xyNode"));
  15119. }
  15120. }
  15121. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  15122. class ui_ageNode extends fgui.GComponent {
  15123. static createInstance() {
  15124. return (fgui.UIPackage.createObject("loading", "ageNode"));
  15125. }
  15126. onConstruct() {
  15127. this.n3 = (this.getChild("n3"));
  15128. this.n7 = (this.getChild("n7"));
  15129. this.n4 = (this.getChild("n4"));
  15130. this.btnAge = (this.getChild("btnAge"));
  15131. this.ageNode = (this.getChild("ageNode"));
  15132. }
  15133. }
  15134. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  15135. class ui_rnNode extends fgui.GComponent {
  15136. static createInstance() {
  15137. return (fgui.UIPackage.createObject("loading", "rnNode"));
  15138. }
  15139. onConstruct() {
  15140. this.n28 = (this.getChild("n28"));
  15141. this.n30 = (this.getChild("n30"));
  15142. this.n33 = (this.getChild("n33"));
  15143. this.rn1 = (this.getChild("rn1"));
  15144. this.n40 = (this.getChild("n40"));
  15145. this.n41 = (this.getChild("n41"));
  15146. this.rn3 = (this.getChild("rn3"));
  15147. this.n37 = (this.getChild("n37"));
  15148. this.n39 = (this.getChild("n39"));
  15149. this.rn2 = (this.getChild("rn2"));
  15150. this.n47 = (this.getChild("n47"));
  15151. this.n49 = (this.getChild("n49"));
  15152. this.n44 = (this.getChild("n44"));
  15153. this.inputCode = (this.getChild("inputCode"));
  15154. this.inputName = (this.getChild("inputName"));
  15155. this.n48 = (this.getChild("n48"));
  15156. this.n50 = (this.getChild("n50"));
  15157. this.rn4 = (this.getChild("rn4"));
  15158. this.btnCheck = (this.getChild("btnCheck"));
  15159. this.btnExit = (this.getChild("btnExit"));
  15160. this.btnDone = (this.getChild("btnDone"));
  15161. this.rnNode = (this.getChild("rnNode"));
  15162. }
  15163. }
  15164. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  15165. class ui_tipNode extends fgui.GComponent {
  15166. static createInstance() {
  15167. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15168. }
  15169. onConstruct() {
  15170. this.bg = (this.getChild("bg"));
  15171. this.n55 = (this.getChild("n55"));
  15172. this.n56 = (this.getChild("n56"));
  15173. this.tipNode = (this.getChild("tipNode"));
  15174. }
  15175. }
  15176. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15177. class ui_fcmNode extends fgui.GComponent {
  15178. static createInstance() {
  15179. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15180. }
  15181. onConstruct() {
  15182. this.n63 = (this.getChild("n63"));
  15183. this.n62 = (this.getChild("n62"));
  15184. this.btnRn = (this.getChild("btnRn"));
  15185. this.n61 = (this.getChild("n61"));
  15186. this.n58 = (this.getChild("n58"));
  15187. this.fcmNode = (this.getChild("fcmNode"));
  15188. }
  15189. }
  15190. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15191. class ui_msgNode extends fgui.GComponent {
  15192. static createInstance() {
  15193. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15194. }
  15195. onConstruct() {
  15196. this.n69 = (this.getChild("n69"));
  15197. this.txtMsg = (this.getChild("txtMsg"));
  15198. this.msgNode = (this.getChild("msgNode"));
  15199. }
  15200. }
  15201. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15202. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15203. static createInstance() {
  15204. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15205. }
  15206. onConstruct() {
  15207. this.n1 = (this.getChild("n1"));
  15208. this.n13 = (this.getChild("n13"));
  15209. this.n14 = (this.getChild("n14"));
  15210. this.n15 = (this.getChild("n15"));
  15211. this.n3 = (this.getChild("n3"));
  15212. this.n4 = (this.getChild("n4"));
  15213. this.n5 = (this.getChild("n5"));
  15214. this.n6 = (this.getChild("n6"));
  15215. this.n7 = (this.getChild("n7"));
  15216. this.n8 = (this.getChild("n8"));
  15217. this.n9 = (this.getChild("n9"));
  15218. this.n10 = (this.getChild("n10"));
  15219. this.n12 = (this.getChild("n12"));
  15220. this.n11 = (this.getChild("n11"));
  15221. this.n16 = (this.getChild("n16"));
  15222. this.n17 = (this.getChild("n17"));
  15223. this.n18 = (this.getChild("n18"));
  15224. this.n20 = (this.getChild("n20"));
  15225. this.n21 = (this.getChild("n21"));
  15226. this.t0 = this.getTransition("t0");
  15227. }
  15228. }
  15229. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15230. class ui_btn5 extends fgui.GButton {
  15231. static createInstance() {
  15232. return (fgui.UIPackage.createObject("loading", "btn5"));
  15233. }
  15234. onConstruct() {
  15235. this.n9 = (this.getChild("n9"));
  15236. this.n1 = (this.getChild("n1"));
  15237. }
  15238. }
  15239. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15240. class ui_UILoading extends fgui.GComponent {
  15241. static createInstance() {
  15242. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15243. }
  15244. onConstruct() {
  15245. this.n12 = (this.getChild("n12"));
  15246. this.loadinfo = (this.getChild("loadinfo"));
  15247. this.n13 = (this.getChild("n13"));
  15248. this.txtLoad = (this.getChild("txtLoad"));
  15249. this.n18 = (this.getChild("n18"));
  15250. }
  15251. }
  15252. ui_UILoading.URL = "ui://37nctnhwphc33";
  15253. class ui_AgeItem extends fgui.GComponent {
  15254. static createInstance() {
  15255. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15256. }
  15257. onConstruct() {
  15258. this.txtAge = (this.getChild("txtAge"));
  15259. }
  15260. }
  15261. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15262. class ui_btn1 extends fgui.GButton {
  15263. static createInstance() {
  15264. return (fgui.UIPackage.createObject("loading", "btn1"));
  15265. }
  15266. onConstruct() {
  15267. this.n6 = (this.getChild("n6"));
  15268. this.n1 = (this.getChild("n1"));
  15269. }
  15270. }
  15271. ui_btn1.URL = "ui://37nctnhwxe622p";
  15272. class ui_btn3 extends fgui.GButton {
  15273. static createInstance() {
  15274. return (fgui.UIPackage.createObject("loading", "btn3"));
  15275. }
  15276. onConstruct() {
  15277. this.n9 = (this.getChild("n9"));
  15278. this.n1 = (this.getChild("n1"));
  15279. }
  15280. }
  15281. ui_btn3.URL = "ui://37nctnhwxe622s";
  15282. class ui_btn2 extends fgui.GButton {
  15283. static createInstance() {
  15284. return (fgui.UIPackage.createObject("loading", "btn2"));
  15285. }
  15286. onConstruct() {
  15287. this.n6 = (this.getChild("n6"));
  15288. this.n1 = (this.getChild("n1"));
  15289. }
  15290. }
  15291. ui_btn2.URL = "ui://37nctnhwxe622t";
  15292. class ui_btnBack extends fgui.GButton {
  15293. static createInstance() {
  15294. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15295. }
  15296. onConstruct() {
  15297. this.n6 = (this.getChild("n6"));
  15298. this.n7 = (this.getChild("n7"));
  15299. }
  15300. }
  15301. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15302. class ui_btnXy1 extends fgui.GButton {
  15303. static createInstance() {
  15304. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15305. }
  15306. onConstruct() {
  15307. this.n1 = (this.getChild("n1"));
  15308. }
  15309. }
  15310. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15311. class ui_btnXy2 extends fgui.GButton {
  15312. static createInstance() {
  15313. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15314. }
  15315. onConstruct() {
  15316. this.n1 = (this.getChild("n1"));
  15317. }
  15318. }
  15319. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  15320. class ui_btnXy3 extends fgui.GButton {
  15321. static createInstance() {
  15322. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15323. }
  15324. onConstruct() {
  15325. this.n1 = (this.getChild("n1"));
  15326. }
  15327. }
  15328. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15329. class ui_btn4 extends fgui.GButton {
  15330. static createInstance() {
  15331. return (fgui.UIPackage.createObject("loading", "btn4"));
  15332. }
  15333. onConstruct() {
  15334. this.n9 = (this.getChild("n9"));
  15335. this.n1 = (this.getChild("n1"));
  15336. }
  15337. }
  15338. ui_btn4.URL = "ui://37nctnhwxe622z";
  15339. class loadingBinder {
  15340. static bindAll() {
  15341. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15342. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15343. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15344. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15345. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15346. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15347. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15348. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15349. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15350. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15351. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15352. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15353. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15354. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15355. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15356. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15357. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15358. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15359. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15360. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15361. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15362. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15363. }
  15364. }
  15365. class UIMgr {
  15366. constructor() {
  15367. this._stage = null;
  15368. this._uiList = [];
  15369. this._showList = [];
  15370. this._bindPkgList = [];
  15371. this.uiIndex = 0;
  15372. }
  15373. static get inst() {
  15374. if (UIMgr._inst == null) {
  15375. UIMgr._inst = new UIMgr();
  15376. }
  15377. return UIMgr._inst;
  15378. }
  15379. setStage(s) {
  15380. if (this._stage) {
  15381. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15382. return;
  15383. }
  15384. this._stage = s;
  15385. }
  15386. clearTempData() {
  15387. console.log('zh:clearTempData start');
  15388. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  15389. console.log('zh:clearTempData end');
  15390. }
  15391. init() {
  15392. this.setStage(Laya.stage);
  15393. fairygui.UIConfig.defaultFont = "微软雅黑";
  15394. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15395. fairygui.UIConfig.packageFileExtension = "obj";
  15396. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15397. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15398. fairygui.GRoot.inst.width = Laya.stage.width;
  15399. fairygui.GRoot.inst.height = Laya.stage.height;
  15400. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15401. }
  15402. addAllUpdate() {
  15403. this.uiIndex = 0;
  15404. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15405. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15406. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15407. }
  15408. }
  15409. }
  15410. bindFUI(pkgname) {
  15411. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15412. return;
  15413. }
  15414. switch (pkgname) {
  15415. case fguiRes.loading:
  15416. fairygui.UIPackage.addPackage(pkgname);
  15417. loadingBinder.bindAll();
  15418. this._bindPkgList.push(pkgname);
  15419. break;
  15420. case fguiRes.game:
  15421. fairygui.UIPackage.addPackage(pkgname);
  15422. gameBinder.bindAll();
  15423. this._bindPkgList.push(pkgname);
  15424. break;
  15425. default:
  15426. break;
  15427. }
  15428. }
  15429. Show(cls, ...param) {
  15430. let nameStr = cls.uiName;
  15431. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15432. let temp = this._uiList[i];
  15433. let str = temp.className;
  15434. if (str == nameStr) {
  15435. if (temp.isMuti) {
  15436. if (temp.isHide) {
  15437. temp.show(...param);
  15438. this._uiList.splice(i, 1);
  15439. this._uiList.push(temp);
  15440. return temp;
  15441. }
  15442. }
  15443. else {
  15444. temp.show(...param);
  15445. this._uiList.splice(i, 1);
  15446. this._uiList.push(temp);
  15447. return temp;
  15448. }
  15449. }
  15450. }
  15451. let ui = new cls();
  15452. ui.className = nameStr;
  15453. this._showUI(ui, param);
  15454. return ui;
  15455. }
  15456. destroyUI(ui) {
  15457. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15458. let temp = this._uiList[i].className;
  15459. if (temp == ui.className) {
  15460. this._uiList.splice(i, 1);
  15461. break;
  15462. }
  15463. }
  15464. this.checkUIState();
  15465. }
  15466. _showUI(ui, param) {
  15467. this._uiList.push(ui);
  15468. ui.show(...param);
  15469. }
  15470. Hide(uiClass) {
  15471. let ui = this.getUI(uiClass);
  15472. if (ui && !ui.isHide) {
  15473. ui.hide();
  15474. }
  15475. }
  15476. getUI(ui) {
  15477. let nameStr = ui.uiName;
  15478. for (let index = 0; index < this._uiList.length; index++) {
  15479. let temp = this._uiList[index];
  15480. if (temp.className == nameStr) {
  15481. return temp;
  15482. }
  15483. }
  15484. return null;
  15485. }
  15486. isShow(cls) {
  15487. for (var i of this._uiList) {
  15488. if (i instanceof cls) {
  15489. return i.isShowing;
  15490. }
  15491. }
  15492. return false;
  15493. }
  15494. showUINum() {
  15495. let num = 0;
  15496. for (var i of this._uiList) {
  15497. if (i.isShowing) {
  15498. num++;
  15499. }
  15500. }
  15501. return num;
  15502. }
  15503. checkUIState() {
  15504. Laya.timer.clear(this, this._uiCheck);
  15505. Laya.timer.once(400, this, this._uiCheck);
  15506. }
  15507. _uiCheck() {
  15508. let showList = [];
  15509. for (var i of this._uiList) {
  15510. if (!i.isHide) {
  15511. showList.push(i);
  15512. }
  15513. }
  15514. for (let index = 0; index < showList.length; index++) {
  15515. if (index == showList.length - 1) {
  15516. showList[index].checkActive(true);
  15517. }
  15518. else {
  15519. showList[index].checkActive(false);
  15520. }
  15521. }
  15522. }
  15523. showTip(msg, time = 600, size = 30) {
  15524. }
  15525. }
  15526. class UIShowList {
  15527. }
  15528. class SoundMgr {
  15529. constructor() {
  15530. this.soundMax = 4;
  15531. this.isLoad = false;
  15532. this.soundMap = {};
  15533. this.isSound = true;
  15534. this.openShake = true;
  15535. SoundMgr._instance = this;
  15536. }
  15537. static getInstance() {
  15538. if (!this._instance) {
  15539. this._instance = new SoundMgr();
  15540. }
  15541. return this._instance;
  15542. }
  15543. init() {
  15544. console.log('zh:sm init 1');
  15545. Laya.SoundManager.autoReleaseSound = true;
  15546. Laya.SoundManager.autoStopMusic = true;
  15547. Laya.SoundManager.musicVolume = 0.3;
  15548. Laya.SoundManager.soundVolume = 0.5;
  15549. this.musicPlayed = false;
  15550. this.audioUrl = "asset/sound/ogg/";
  15551. console.log('zh:sm init 2');
  15552. console.log('zh:dev type ');
  15553. if (Laya.Browser.onAndroid) {
  15554. console.log('zh:dev type android');
  15555. this.audioUrl = "asset/sound/ogg/";
  15556. this.isLoad = true;
  15557. }
  15558. else {
  15559. console.log('zh:dev type not android');
  15560. this.audioUrl = "asset/sound/mp3/";
  15561. this.isLoad = true;
  15562. }
  15563. }
  15564. onSetting(isS) {
  15565. this.isSound = isS;
  15566. this.mute(!this.isSound);
  15567. }
  15568. clearCount() {
  15569. for (var key in this.soundMap) {
  15570. delete this.soundMap[key];
  15571. }
  15572. }
  15573. playMusic(path, loop = 0) {
  15574. console.log('zh:playMusic 1 PATH=' + path);
  15575. this.musicPath = path;
  15576. if (!this.isLoad) {
  15577. return;
  15578. }
  15579. if (!path || path == "") {
  15580. return;
  15581. }
  15582. if (!this.isSound) {
  15583. return;
  15584. }
  15585. this.musicPlayed = true;
  15586. let url = this.getUrl(path);
  15587. if (!Laya.Browser.onAndroid) {
  15588. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15589. this.play(url, loop);
  15590. }));
  15591. }
  15592. else {
  15593. this.play(url, loop);
  15594. }
  15595. }
  15596. play(url, loop) {
  15597. Laya.SoundManager.playMusic(url, loop);
  15598. }
  15599. getUrl(path) {
  15600. let url = this.audioUrl + path;
  15601. if (Laya.Browser.onAndroid) {
  15602. url += ".ogg";
  15603. }
  15604. else {
  15605. url += ".mp3";
  15606. }
  15607. return url;
  15608. }
  15609. pauseMusic(pause) {
  15610. if (pause) {
  15611. this.mute(true);
  15612. }
  15613. else if (this.isSound)
  15614. this.mute(false);
  15615. }
  15616. stopMusic() {
  15617. Laya.SoundManager.stopMusic();
  15618. if (Moyu.isNeedPlatAudio) {
  15619. Moyu.stopMusic();
  15620. }
  15621. }
  15622. mute(mute) {
  15623. if (Moyu.isNeedPlatAudio) {
  15624. Moyu.pauseMusic(mute);
  15625. }
  15626. else {
  15627. Laya.SoundManager.musicMuted = mute;
  15628. if (!mute && !this.musicPlayed && this.musicPath) {
  15629. this.playMusic(this.musicPath);
  15630. }
  15631. }
  15632. }
  15633. stopSound(path) {
  15634. let url = this.getUrl(path);
  15635. Laya.SoundManager.stopSound(url);
  15636. }
  15637. playSound(path, loop = 1, soundMax = this.soundMax) {
  15638. if (!this.isLoad)
  15639. return;
  15640. if (!this.isSound)
  15641. return;
  15642. if (!path || path == "")
  15643. return;
  15644. let url = this.getUrl(path);
  15645. if (Moyu.isNeedPlatAudio) {
  15646. Moyu.playSound(path, loop == 0);
  15647. }
  15648. else {
  15649. let count = 1;
  15650. if (this.soundMap[path])
  15651. count = this.soundMap[path] + 1;
  15652. if (count > soundMax)
  15653. return;
  15654. this.soundMap[path] = count;
  15655. Laya.SoundManager.playSound(url, loop);
  15656. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15657. }
  15658. }
  15659. removePath(path) {
  15660. if (this.soundMap[path]) {
  15661. let count = this.soundMap[path];
  15662. count--;
  15663. if (count < 1)
  15664. delete this.soundMap[path];
  15665. else
  15666. this.soundMap[path] = count;
  15667. }
  15668. }
  15669. playBtnSound() {
  15670. this.playSound("btn");
  15671. }
  15672. playGetSound() {
  15673. }
  15674. playCloseUISound() {
  15675. }
  15676. }
  15677. SoundMgr._instance = null;
  15678. var Handler$1 = Laya.Handler;
  15679. var EResType;
  15680. (function (EResType) {
  15681. EResType[EResType["none"] = 0] = "none";
  15682. EResType[EResType["nromal"] = 1] = "nromal";
  15683. EResType[EResType["td"] = 2] = "td";
  15684. EResType[EResType["sk"] = 3] = "sk";
  15685. })(EResType || (EResType = {}));
  15686. class CResLoader {
  15687. constructor(doneCall, proCall) {
  15688. this.completrCall = doneCall;
  15689. this.progressCall = proCall;
  15690. this.progressHander = new Handler$1(this, this.onProgress);
  15691. this.tdResMap = {};
  15692. }
  15693. load(resList) {
  15694. this.resCount = 0;
  15695. this.loadCount = 0;
  15696. for (let i = 0; i < resList.length; i++) {
  15697. let path = resList[i];
  15698. if (!path)
  15699. continue;
  15700. this.resCount++;
  15701. let type = this.getResType(path);
  15702. if (type == EResType.nromal)
  15703. this.loadNromal(path);
  15704. else if (type == EResType.td)
  15705. this.loadTd(path);
  15706. }
  15707. }
  15708. getRes(path) {
  15709. let type = this.getResType(path);
  15710. if (type == EResType.nromal)
  15711. return Laya.loader.getRes(path);
  15712. else if (type == EResType.td) {
  15713. let res = this.tdResMap[path];
  15714. if (res)
  15715. return res.clone();
  15716. return null;
  15717. }
  15718. }
  15719. destroy() {
  15720. this.progressHander.clear();
  15721. this.progressHander = null;
  15722. }
  15723. clearRes(path) {
  15724. let type = this.getResType(path);
  15725. if (type == EResType.nromal)
  15726. Laya.loader.clearRes(path);
  15727. else if (type == EResType.td) {
  15728. let obj = this.tdResMap[path];
  15729. if (obj)
  15730. obj.destroy();
  15731. delete this.tdResMap[path];
  15732. }
  15733. }
  15734. getResType(path) {
  15735. let exs = this.getExtension(path);
  15736. if (exs == "sk")
  15737. return EResType.sk;
  15738. if (exs == "ls" || exs == "lh" || exs == "lm")
  15739. return EResType.td;
  15740. else
  15741. return EResType.nromal;
  15742. }
  15743. getExtension(res) {
  15744. var index = res.lastIndexOf(".");
  15745. return res.substr(index + 1);
  15746. }
  15747. loadNromal(path) {
  15748. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15749. if (res) {
  15750. this.onLoad();
  15751. }
  15752. else
  15753. console.log("load res fail:" + path);
  15754. }), this.progressHander);
  15755. }
  15756. loadSk() {
  15757. }
  15758. loadTd(path) {
  15759. if (this.tdResMap[path]) {
  15760. this.onLoad();
  15761. return;
  15762. }
  15763. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15764. if (res) {
  15765. this.tdResMap[path] = res;
  15766. this.onLoad();
  15767. }
  15768. else
  15769. console.log("load res fail:" + path);
  15770. }));
  15771. }
  15772. onLoad() {
  15773. this.loadCount++;
  15774. this.onProgress(1);
  15775. if (this.loadCount >= this.resCount) {
  15776. this.completrCall.run();
  15777. }
  15778. }
  15779. onProgress(pro) {
  15780. let progress = (this.loadCount + pro) / this.resCount;
  15781. this.progressCall.runWith(progress);
  15782. }
  15783. }
  15784. var Handler$2 = Laya.Handler;
  15785. class ResInfo {
  15786. constructor() {
  15787. this.index = 0;
  15788. }
  15789. }
  15790. class ResMgr {
  15791. constructor() {
  15792. this.resList = [];
  15793. this.doneList = [];
  15794. this.resMap = {};
  15795. this.currentLoad = null;
  15796. this.completeHandler = new Handler$2(this, this.onComplete);
  15797. this.progressHandler = new Handler$2(this, this.onProgress);
  15798. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15799. }
  15800. static getInstance() {
  15801. if (ResMgr._instance == null) {
  15802. ResMgr._instance = new ResMgr();
  15803. }
  15804. return ResMgr._instance;
  15805. }
  15806. loadList(list, completeHandler, progressHandler) {
  15807. if (list.length < 1) {
  15808. completeHandler.run();
  15809. return;
  15810. }
  15811. let info = this.getResInfo();
  15812. info.resList = list;
  15813. info.completeHandler = completeHandler;
  15814. info.progressHandler = progressHandler;
  15815. this.resList.push(info);
  15816. this.startLoad();
  15817. }
  15818. loadFguiRes(list, completeHandler, progressHandler) {
  15819. Laya.loader.load(list, completeHandler, progressHandler);
  15820. }
  15821. loadAny(list, completeHandler, progressHandler) {
  15822. Laya.loader.load(list, completeHandler, progressHandler);
  15823. }
  15824. load(path, completeHandler, progressHandler) {
  15825. let count = this.resMap[path];
  15826. if (count && count > 0) {
  15827. if (completeHandler)
  15828. completeHandler.run();
  15829. }
  15830. else
  15831. this.loadList([path], completeHandler, progressHandler);
  15832. }
  15833. getRes(path) {
  15834. let res = this.resMap[path];
  15835. if (!res)
  15836. this.showLog("资源不存在:" + path);
  15837. else
  15838. return this.loader.getRes(path);
  15839. }
  15840. clearList(list, force = false) {
  15841. if (!list || list.length < 1)
  15842. return;
  15843. let cr = () => {
  15844. for (const k in list) {
  15845. let v = list[k];
  15846. if (!v)
  15847. continue;
  15848. if (force) {
  15849. this.loader.clearRes(v);
  15850. delete this.resMap[v];
  15851. }
  15852. else {
  15853. let count = this.resMap[v];
  15854. if (count && count > 1) {
  15855. count--;
  15856. this.resMap[v] = count;
  15857. }
  15858. else {
  15859. this.loader.clearRes(v);
  15860. delete this.resMap[v];
  15861. }
  15862. }
  15863. }
  15864. if (!window.hasOwnProperty("ks"))
  15865. Laya.Resource.destroyUnusedResources();
  15866. };
  15867. Laya.timer.clearAll(this);
  15868. Laya.timer.once(2000, this, cr);
  15869. }
  15870. clear3D() {
  15871. for (const k in this.loader.tdResMap) {
  15872. this.loader.clearRes(k);
  15873. if (this.resMap[k])
  15874. delete this.resMap[k];
  15875. }
  15876. if (!window.hasOwnProperty("ks"))
  15877. Laya.Resource.destroyUnusedResources();
  15878. }
  15879. clear(path, force = false) {
  15880. this.clearList([path], force);
  15881. }
  15882. getResInfo() {
  15883. if (this.doneList.length > 0)
  15884. return this.doneList.pop();
  15885. else
  15886. return new ResInfo();
  15887. }
  15888. startLoad() {
  15889. if (this.currentLoad)
  15890. return;
  15891. this.currentLoad = this.resList.pop();
  15892. if (this.currentLoad) {
  15893. this.loader.load(this.currentLoad.resList);
  15894. }
  15895. }
  15896. onComplete() {
  15897. if (!this.currentLoad)
  15898. return;
  15899. for (const k in this.currentLoad.resList) {
  15900. let v = this.currentLoad.resList[k];
  15901. let count = this.resMap[v];
  15902. if (count)
  15903. count++;
  15904. else
  15905. count = 1;
  15906. this.resMap[v] = count;
  15907. }
  15908. if (this.currentLoad.completeHandler)
  15909. this.currentLoad.completeHandler.run();
  15910. this.doneList.push(this.currentLoad);
  15911. this.currentLoad = null;
  15912. this.startLoad();
  15913. }
  15914. onProgress(pro) {
  15915. if (!this.currentLoad)
  15916. return;
  15917. if (this.currentLoad.progressHandler)
  15918. this.currentLoad.progressHandler.runWith(pro);
  15919. }
  15920. showLog(str, ...args) {
  15921. console.log("[ResLoader] " + str);
  15922. }
  15923. }
  15924. ResMgr._instance = null;
  15925. class EventMgr extends Laya.EventDispatcher {
  15926. }
  15927. let eventMgr = new EventMgr();
  15928. class ConfigMgr {
  15929. static getInstance() {
  15930. if (!this._instance) {
  15931. this._instance = new ConfigMgr();
  15932. }
  15933. return this._instance;
  15934. }
  15935. init() {
  15936. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15937. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15938. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15939. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15940. }
  15941. getUserInfoByIndex(index) {
  15942. return this.npcJson[index];
  15943. }
  15944. getRandomUserInfo() {
  15945. let index = xGame.tools.random(0, this.npcJson.length);
  15946. return this.npcJson[index];
  15947. }
  15948. getMaxBigMoveLength() {
  15949. return Object.keys(this.levelCfg).length;
  15950. }
  15951. getBigMoveLevelByIndex(index) {
  15952. let cfg = this.levelCfg;
  15953. cfg = cfg[index];
  15954. return cfg;
  15955. }
  15956. getRandomClassicLevel() {
  15957. let cfg = this.classicCfg;
  15958. let num = Object.keys(cfg).length;
  15959. let rand = xGame.common.randomNum(1, num);
  15960. return cfg[rand];
  15961. }
  15962. getPlaceBallByLevel(level) {
  15963. return this.placeBallCfg[level];
  15964. }
  15965. getMaxPlaceBall() {
  15966. return Object.keys(this.placeBallCfg).length;
  15967. }
  15968. }
  15969. class PoolD3Mgr {
  15970. constructor() {
  15971. this.pool = {};
  15972. }
  15973. static get ins() {
  15974. return this._ins || (this._ins = new PoolD3Mgr);
  15975. }
  15976. createList(key, prefab, parent) {
  15977. if (!this.pool[key]) {
  15978. this.pool[key] = {};
  15979. this.pool[key].prefab = prefab;
  15980. this.pool[key].list = [];
  15981. this.pool[key].parent = parent;
  15982. }
  15983. }
  15984. getItem(key) {
  15985. if (!this.pool[key]) {
  15986. return;
  15987. }
  15988. let temp;
  15989. if (this.pool[key].list.length > 0) {
  15990. temp = this.pool[key].list.pop();
  15991. }
  15992. else {
  15993. temp = this.pool[key].prefab.clone();
  15994. if (this.pool[key].parent) {
  15995. this.pool[key].parent.addChild(temp);
  15996. }
  15997. }
  15998. temp.active = true;
  15999. return temp;
  16000. }
  16001. putItem(key, obj) {
  16002. if (!this.pool[key]) {
  16003. return;
  16004. }
  16005. obj.active = false;
  16006. this.pool[key].list.push(obj);
  16007. }
  16008. }
  16009. let context$1 = context;
  16010. let uiMgr = UIMgr.inst;
  16011. let soundMgr = SoundMgr.getInstance();
  16012. let resMgr = ResMgr.getInstance();
  16013. let httpMgr = HttpMgr.getInstance();
  16014. let common = Common.getInstance();
  16015. let cfgMgr = ConfigMgr.getInstance();
  16016. let poolD3Mgr = PoolD3Mgr.ins;
  16017. let d3TexUrl = "res/d3Res/";
  16018. let d3ModeUrl = "res/unityRes/";
  16019. function setStageSize(view) {
  16020. if (view.width) {
  16021. view.width = Laya.stage.width;
  16022. view.height = Laya.stage.height;
  16023. }
  16024. }
  16025. function filledBg(view) {
  16026. let wh = Laya.stage.height / Laya.stage.width;
  16027. if (wh > 16 / 9) {
  16028. view.height = Laya.stage.height;
  16029. view.width = Laya.stage.height / 1334 * 750;
  16030. }
  16031. else {
  16032. view.width = Laya.stage.width;
  16033. view.height = Laya.stage.width / 750 * 1334;
  16034. }
  16035. }
  16036. function setNotch(view) {
  16037. if (view.height) {
  16038. view.y += context$1.notchHeight;
  16039. }
  16040. }
  16041. function showTip(str) {
  16042. uiMgr.Show(UIMsg, str);
  16043. }
  16044. function log(...args) {
  16045. console.log(args);
  16046. }
  16047. let xGame = {
  16048. context: context$1,
  16049. eventMgr,
  16050. resMgr,
  16051. uiMgr,
  16052. soundMgr,
  16053. define,
  16054. tools,
  16055. httpMgr,
  16056. d3TexUrl,
  16057. d3ModeUrl,
  16058. common,
  16059. cfgMgr,
  16060. poolD3Mgr,
  16061. setStageSize,
  16062. filledBg,
  16063. setNotch,
  16064. showTip,
  16065. log,
  16066. };
  16067. window["xGame"] = xGame;
  16068. let dataName = 'tBall_';
  16069. class UserData {
  16070. constructor() {
  16071. this.userId = "";
  16072. this.isAgree = false;
  16073. this.coinNum = 0;
  16074. this.gemNum = 0;
  16075. this.sound = true;
  16076. this.vibration = true;
  16077. this.currentDate = 0;
  16078. this.createTime = 0;
  16079. this.awardTime = 0;
  16080. this.roleId = 1;
  16081. this.roleList = [];
  16082. this.roleAds = [];
  16083. this.dressId = 101;
  16084. this.itemId = 201;
  16085. this.bigSkills = [1, 1, 1, 1, 1];
  16086. this.coin = 4000;
  16087. this.diamond = 0;
  16088. this.skillSuccessTimes = 0;
  16089. this.skillGuide = 0;
  16090. this.skillAccTimes = 0;
  16091. this.placeBallData = [];
  16092. this.shareDiamondTimes = 0;
  16093. this.dailyVideoShareTimes = 0;
  16094. this.secretary = [1, 0];
  16095. this.curSecretary = 0;
  16096. this.ballRod = [1, 0, 0, 0, 0, 1];
  16097. this.curBallRod = 5;
  16098. this.signData = 0;
  16099. this.signTime = 0;
  16100. this.drawTimes = 0;
  16101. this.drawAwardTimes = 0;
  16102. this.dailyfreeDrawTimes = 1;
  16103. this.power = 5;
  16104. this.powerTime = 0;
  16105. this.challengeTimes = 0;
  16106. this.extraSign = 0;
  16107. this.classicTimes = 0;
  16108. this.guideHelpLine = 0;
  16109. this.newUser = true;
  16110. this.rootBallFoul = 0;
  16111. this.timeoutFoul = 0;
  16112. this.roleList = [1];
  16113. }
  16114. saveData() {
  16115. let data = {};
  16116. for (let k in this) {
  16117. data[k.toString()] = this[k];
  16118. }
  16119. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  16120. }
  16121. getData() {
  16122. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  16123. if (ld) {
  16124. let localData = JSON.parse(ld);
  16125. if (localData) {
  16126. for (let k in this) {
  16127. let key = k.toString();
  16128. let data = localData[key];
  16129. if (data != undefined) {
  16130. this[k] = data;
  16131. }
  16132. }
  16133. }
  16134. }
  16135. }
  16136. }
  16137. class ItemData {
  16138. constructor() {
  16139. this.itemList = {};
  16140. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  16141. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  16142. }
  16143. saveData() {
  16144. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  16145. }
  16146. getData() {
  16147. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  16148. if (ld) {
  16149. let localData = JSON.parse(ld);
  16150. if (localData) {
  16151. this.itemList = localData;
  16152. }
  16153. }
  16154. }
  16155. }
  16156. class GameData {
  16157. constructor() {
  16158. this.curLevel = 0;
  16159. this.gameType = 1;
  16160. this.signIdx = 0;
  16161. this.signMax = 0;
  16162. this.rotaryTime = 0;
  16163. this.rotaryCount = 0;
  16164. this.rotaryList = [];
  16165. this.diyCount = 3;
  16166. this.awardIdx = 0;
  16167. this.shareNum = 2;
  16168. this.rankWeek = 0;
  16169. this.rankScore = 0;
  16170. this.gameCount = 0;
  16171. this.trySkill = -1;
  16172. this.tryTime = 0;
  16173. }
  16174. saveData() {
  16175. let data = {};
  16176. for (let k in this) {
  16177. data[k.toString()] = this[k];
  16178. }
  16179. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  16180. }
  16181. getData() {
  16182. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  16183. if (ld) {
  16184. let localData = JSON.parse(ld);
  16185. if (localData) {
  16186. for (let k in this) {
  16187. let key = k.toString();
  16188. let data = localData[key];
  16189. if (data != undefined) {
  16190. this[k] = data;
  16191. }
  16192. }
  16193. }
  16194. }
  16195. }
  16196. }
  16197. class Diy2025GameData {
  16198. constructor() {
  16199. this.challengeMode_overLev = 0;
  16200. this.xszyForClassic = false;
  16201. this.xszyForChallenge = false;
  16202. }
  16203. saveData() {
  16204. let data = {};
  16205. for (let k in this) {
  16206. data[k.toString()] = this[k];
  16207. }
  16208. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  16209. }
  16210. getData() {
  16211. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  16212. if (ld) {
  16213. let localData = JSON.parse(ld);
  16214. if (localData) {
  16215. for (let k in this) {
  16216. let key = k.toString();
  16217. let data = localData[key];
  16218. if (data != undefined) {
  16219. this[k] = data;
  16220. }
  16221. }
  16222. }
  16223. }
  16224. }
  16225. }
  16226. class DataMgr {
  16227. static Init() {
  16228. this.userData = new UserData();
  16229. this.gameData = new GameData();
  16230. this.itemData = new ItemData();
  16231. this.diyGameData = new Diy2025GameData();
  16232. this.userData.getData();
  16233. this.gameData.getData();
  16234. this.itemData.getData();
  16235. this.diyGameData.getData();
  16236. this.roleId = this.userData.roleId;
  16237. this.resetUse();
  16238. }
  16239. static isNewDay() {
  16240. Moyu.isNewDay(this, (isnew) => {
  16241. xGame.common.isNewDay = isnew;
  16242. if (!isnew)
  16243. return;
  16244. DataMgr.setShareDiamondTimes(0, false);
  16245. DataMgr.setDailyVideoShareTimes(0, false);
  16246. DataMgr.setDailyfreeDrawTimes(1);
  16247. DataMgr.setExtraSign(0);
  16248. });
  16249. }
  16250. static deletData() {
  16251. Laya.LocalStorage.clear();
  16252. }
  16253. static upRankData() {
  16254. let num = xGame.common.getAllStarNum();
  16255. if (num > 0)
  16256. Moyu.upRankData(xGame.common.curRankID, num);
  16257. }
  16258. static addItem(id, count = 1) {
  16259. let v = this.itemData.itemList[id];
  16260. if (!v)
  16261. v = { id: id, count: count, adnum: 0, active: true };
  16262. else {
  16263. if (v.active) {
  16264. v.count += count;
  16265. }
  16266. else {
  16267. v.count = count;
  16268. v.active = true;
  16269. }
  16270. }
  16271. this.itemData.itemList[id] = v;
  16272. xGame.soundMgr.playGetSound();
  16273. this.saveItemData();
  16274. }
  16275. static hasItem(id) {
  16276. let v = this.itemData.itemList[id];
  16277. if (v && v.active)
  16278. return true;
  16279. return false;
  16280. }
  16281. static getItem(id) {
  16282. let v = this.itemData.itemList[id];
  16283. return v;
  16284. }
  16285. static getItemCount(id) {
  16286. let v = this.itemData.itemList[id];
  16287. if (v && v.active)
  16288. return v.count;
  16289. return 0;
  16290. }
  16291. static getItemAd(id) {
  16292. let v = this.itemData.itemList[id];
  16293. if (v) {
  16294. return v.adnum;
  16295. }
  16296. return 0;
  16297. }
  16298. static onItemAd(id, num = 1) {
  16299. let v = this.itemData.itemList[id];
  16300. if (!v)
  16301. v = { id: id, count: 1, adnum: num, active: false };
  16302. else
  16303. v.adnum += num;
  16304. this.itemData.itemList[id] = v;
  16305. this.saveItemData();
  16306. }
  16307. static costItem(id, count) {
  16308. let v = this.itemData.itemList[id];
  16309. if (v && v.active) {
  16310. if (v.count < count)
  16311. return false;
  16312. else {
  16313. v.count -= count;
  16314. this.itemData.itemList[id] = v;
  16315. return true;
  16316. }
  16317. }
  16318. return false;
  16319. }
  16320. static resetUse() {
  16321. this.dressId = this.userData.dressId;
  16322. this.itemId = this.userData.itemId;
  16323. }
  16324. static passLevel() {
  16325. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  16326. this.gameData.curLevel++;
  16327. this.curLevel = this.gameData.curLevel;
  16328. this.saveGameData();
  16329. }
  16330. static useRole(id) {
  16331. this.roleId = id;
  16332. if (this.hasRole(id)) {
  16333. this.userData.roleId = id;
  16334. this.saveUserData();
  16335. }
  16336. }
  16337. static addRole(id) {
  16338. if (this.hasRole(id))
  16339. return;
  16340. this.userData.roleList.push(id);
  16341. this.saveUserData();
  16342. }
  16343. static hasRole(id) {
  16344. return this.userData.roleList.indexOf(id) >= 0;
  16345. }
  16346. static gemEnough(num) {
  16347. return this.userData.gemNum >= num;
  16348. }
  16349. static roleHasAd(id) {
  16350. let count = this.userData.roleAds[id];
  16351. if (count != undefined && count >= 0)
  16352. return true;
  16353. else
  16354. return false;
  16355. }
  16356. static saveUserData(time = 500, event, arg) {
  16357. if (this.userSaving)
  16358. return;
  16359. this.userSaving = true;
  16360. Laya.timer.once(time, this, () => {
  16361. this.userSaving = false;
  16362. this.userData.saveData();
  16363. if (event)
  16364. xGame.eventMgr.event(event, arg);
  16365. });
  16366. }
  16367. static saveGameData() {
  16368. if (this.gameSaving)
  16369. return;
  16370. this.gameSaving = true;
  16371. Laya.timer.once(1000, this, () => {
  16372. this.gameSaving = false;
  16373. this.gameData.saveData();
  16374. });
  16375. }
  16376. static saveItemData() {
  16377. let fun = () => {
  16378. this.itemData.saveData();
  16379. };
  16380. Laya.timer.clear(this, fun);
  16381. Laya.timer.once(500, this, fun);
  16382. }
  16383. static saveData() {
  16384. this.saveUserData();
  16385. this.saveGameData();
  16386. }
  16387. static getBigSkillList() {
  16388. return this.userData.bigSkills;
  16389. }
  16390. static getBigSkillByIndex(index) {
  16391. return this.userData.bigSkills[index];
  16392. }
  16393. static setBigSkill(index, val, addUp = true) {
  16394. if (addUp) {
  16395. this.userData.bigSkills[index] += val;
  16396. }
  16397. else {
  16398. this.userData.bigSkills[index] = val;
  16399. }
  16400. this.saveUserData();
  16401. }
  16402. static coinEnough(need) {
  16403. if (typeof need != "number") {
  16404. console.error("金币格式错误");
  16405. return;
  16406. }
  16407. return this.userData.coin >= need;
  16408. }
  16409. static setCoin(val) {
  16410. if (typeof val != "number") {
  16411. return;
  16412. }
  16413. this.userData.coin += val;
  16414. this.saveUserData();
  16415. xGame.eventMgr.event(COIN_CHANGE);
  16416. }
  16417. static getCoin() {
  16418. return this.userData.coin;
  16419. }
  16420. static diamondEnough(need) {
  16421. if (typeof need != "number") {
  16422. console.error("金币格式错误");
  16423. return;
  16424. }
  16425. return this.userData.diamond >= need;
  16426. }
  16427. static setDiamond(val) {
  16428. if (typeof val != "number") {
  16429. return;
  16430. }
  16431. this.userData.diamond += val;
  16432. this.saveUserData();
  16433. xGame.eventMgr.event(DIAMOND_CHANGE);
  16434. }
  16435. static getDiamond() {
  16436. return this.userData.diamond;
  16437. }
  16438. static getSkillSuccessTimes() {
  16439. return this.userData.skillSuccessTimes;
  16440. }
  16441. static setSkillSuccessTimes(val, addUp = true) {
  16442. if (addUp)
  16443. this.userData.skillSuccessTimes += val;
  16444. else
  16445. this.userData.skillSuccessTimes = val;
  16446. this.saveUserData();
  16447. }
  16448. static getSkillAccTimes() {
  16449. return this.userData.skillAccTimes;
  16450. }
  16451. static setSkillAccTimes(val) {
  16452. this.userData.skillAccTimes += val;
  16453. this.saveUserData();
  16454. }
  16455. static getSkillGuide() {
  16456. if (!xGame.common.openGuide) {
  16457. return 1;
  16458. }
  16459. return this.userData.skillGuide;
  16460. }
  16461. static setSkillGuide(val) {
  16462. this.userData.skillGuide = val;
  16463. this.saveUserData();
  16464. }
  16465. static getPlaceBallLevelList() {
  16466. return this.userData.placeBallData;
  16467. }
  16468. static getPlaceBallLevel(level) {
  16469. let arr = this.userData.placeBallData;
  16470. let index = level - 1;
  16471. let out;
  16472. if (arr[index]) {
  16473. out = arr[index];
  16474. }
  16475. else {
  16476. let max = arr.length;
  16477. if (max == index) {
  16478. out = {
  16479. star: 0,
  16480. play: true,
  16481. isCur: true,
  16482. getAward: false
  16483. };
  16484. }
  16485. else {
  16486. out = {
  16487. star: 0,
  16488. play: false,
  16489. getAward: false
  16490. };
  16491. }
  16492. }
  16493. return out;
  16494. }
  16495. static setPlaceBallLevel(level, star) {
  16496. let arr = this.userData.placeBallData;
  16497. let index = level - 1;
  16498. if (arr[index]) {
  16499. arr[index].star = Math.max(arr[index].star, star);
  16500. }
  16501. else {
  16502. let max = arr.length;
  16503. if (max == index) {
  16504. arr.push({
  16505. star: star,
  16506. play: true,
  16507. getAward: false
  16508. });
  16509. }
  16510. else {
  16511. console.error("关卡存储出错");
  16512. }
  16513. }
  16514. this.saveUserData();
  16515. }
  16516. static setPlaceBallAward(level) {
  16517. let arr = this.userData.placeBallData;
  16518. let index = level - 1;
  16519. if (arr[index]) {
  16520. arr[index].getAward = true;
  16521. }
  16522. this.saveUserData();
  16523. }
  16524. static getShareDiamondTimes() {
  16525. return this.userData.shareDiamondTimes;
  16526. }
  16527. static setShareDiamondTimes(val, addUp = true) {
  16528. if (addUp) {
  16529. this.userData.shareDiamondTimes += val;
  16530. }
  16531. else {
  16532. this.userData.shareDiamondTimes = val;
  16533. }
  16534. this.saveUserData();
  16535. }
  16536. static getDailyVideoShareTimes() {
  16537. return this.userData.dailyVideoShareTimes;
  16538. }
  16539. static setDailyVideoShareTimes(val, addUp = true) {
  16540. if (addUp) {
  16541. this.userData.dailyVideoShareTimes += val;
  16542. }
  16543. else {
  16544. this.userData.dailyVideoShareTimes = val;
  16545. }
  16546. this.saveUserData();
  16547. }
  16548. static getSecretary(index) {
  16549. return this.userData.secretary[index];
  16550. }
  16551. static setSecretary(index, val) {
  16552. this.userData.secretary[index] = val;
  16553. this.saveUserData();
  16554. }
  16555. static getCurSecretary() {
  16556. return this.userData.curSecretary;
  16557. }
  16558. static setCurSecretary(index) {
  16559. this.userData.curSecretary = index;
  16560. this.saveUserData();
  16561. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16562. }
  16563. static getBallRod(index) {
  16564. return this.userData.ballRod[index];
  16565. }
  16566. static setBallRod(index, val) {
  16567. this.userData.ballRod[index] = val;
  16568. this.saveUserData();
  16569. }
  16570. static getCurBallRod() {
  16571. return this.userData.curBallRod;
  16572. }
  16573. static setCurBallRod(index) {
  16574. this.userData.curBallRod = index;
  16575. this.saveUserData();
  16576. }
  16577. static setSignData(val) {
  16578. this.userData.signData = val;
  16579. this.saveUserData();
  16580. }
  16581. static getSignData() {
  16582. return this.userData.signData;
  16583. }
  16584. static setSignTime(val) {
  16585. this.userData.signTime = val;
  16586. this.saveUserData();
  16587. }
  16588. static getSignTime() {
  16589. return this.userData.signTime;
  16590. }
  16591. static getDrawTimes() {
  16592. return this.userData.drawTimes;
  16593. }
  16594. static setDrawTimes(val, addUp = true) {
  16595. if (addUp) {
  16596. this.userData.drawTimes += val;
  16597. }
  16598. else {
  16599. this.userData.drawTimes = val;
  16600. }
  16601. this.saveUserData();
  16602. }
  16603. static getDrawAwardTimes() {
  16604. return this.userData.drawAwardTimes;
  16605. }
  16606. static setDrawAwardTimes(val) {
  16607. this.userData.drawAwardTimes = val;
  16608. this.saveUserData();
  16609. }
  16610. static getDailyfreeDrawTimes() {
  16611. return this.userData.dailyfreeDrawTimes;
  16612. }
  16613. static setDailyfreeDrawTimes(val) {
  16614. this.userData.dailyfreeDrawTimes = val;
  16615. this.saveUserData();
  16616. }
  16617. static setPower(val, addUp = true) {
  16618. if (addUp)
  16619. this.userData.power += val;
  16620. else
  16621. this.userData.power = val;
  16622. if (this.userData.power >= xGame.common.maxPower) {
  16623. this.userData.power = xGame.common.maxPower;
  16624. }
  16625. xGame.eventMgr.event(POWER_CHANGE, val);
  16626. this.saveUserData();
  16627. }
  16628. static getPower() {
  16629. return this.userData.power;
  16630. }
  16631. static setPowerTime(val) {
  16632. this.userData.powerTime = val;
  16633. this.saveUserData();
  16634. }
  16635. static getPowerTime() {
  16636. return this.userData.powerTime;
  16637. }
  16638. static powerEnough() {
  16639. return this.getPower() > 0;
  16640. }
  16641. static getChallengeTimes() {
  16642. return this.userData.challengeTimes;
  16643. }
  16644. static setChallengeTimes(val) {
  16645. this.userData.challengeTimes += val;
  16646. this.saveUserData();
  16647. }
  16648. static getExtraSign() {
  16649. return this.userData.extraSign;
  16650. }
  16651. static setExtraSign(val) {
  16652. this.userData.extraSign = val;
  16653. this.saveUserData();
  16654. }
  16655. static getClassicTimes() {
  16656. return this.userData.classicTimes;
  16657. }
  16658. static setClassicTimes() {
  16659. this.userData.classicTimes += 1;
  16660. this.saveUserData();
  16661. }
  16662. static getGuideHelpLine() {
  16663. return this.userData.guideHelpLine;
  16664. }
  16665. static setGuideHelpLine() {
  16666. this.userData.guideHelpLine = 1;
  16667. this.saveUserData();
  16668. }
  16669. static getNewUser() {
  16670. return this.userData.newUser;
  16671. }
  16672. static setNewUser() {
  16673. this.userData.newUser = false;
  16674. this.saveUserData();
  16675. }
  16676. static getRootBallFoul() {
  16677. return this.userData.rootBallFoul;
  16678. }
  16679. static setRootBallFoul() {
  16680. this.userData.rootBallFoul = 1;
  16681. this.saveUserData();
  16682. }
  16683. static getTimeoutFoul() {
  16684. return this.userData.timeoutFoul;
  16685. }
  16686. static setTimeoutFoul() {
  16687. this.userData.timeoutFoul = 1;
  16688. this.saveUserData();
  16689. }
  16690. static saveDiyGameData() {
  16691. if (this.diyGameSaving)
  16692. return;
  16693. this.diyGameSaving = true;
  16694. Laya.timer.once(500, this, () => {
  16695. this.diyGameSaving = false;
  16696. this.diyGameData.saveData();
  16697. });
  16698. }
  16699. static getChallengeMode_overLev() {
  16700. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  16701. return this.challengeMode_overLev;
  16702. }
  16703. static setChallengeMode_overLev(levNum) {
  16704. this.diyGameData.challengeMode_overLev = levNum;
  16705. this.saveDiyGameData();
  16706. }
  16707. }
  16708. DataMgr.isNewUser = false;
  16709. DataMgr.fristEnter = true;
  16710. DataMgr.levelType = 0;
  16711. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  16712. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  16713. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  16714. DataMgr.challengeMode_overLev = 0;
  16715. DataMgr.xszyForClassic = false;
  16716. DataMgr.xszyForChallenge = false;
  16717. DataMgr.awardId = 0;
  16718. DataMgr.awardCoin = 0;
  16719. DataMgr.sceneId = -1;
  16720. DataMgr.tryId = 0;
  16721. DataMgr.curLevel = 1;
  16722. DataMgr.vipLevel = 0;
  16723. DataMgr.maxLevel = 0;
  16724. DataMgr.awardRatio = 1;
  16725. DataMgr.gameList = [];
  16726. DataMgr.rankList = [];
  16727. DataMgr.recoverTime = 480000;
  16728. DataMgr.minScore = 0;
  16729. DataMgr.rankDis = 0;
  16730. DataMgr.userSaving = false;
  16731. DataMgr.gameSaving = false;
  16732. DataMgr.diyGameSaving = false;
  16733. class D3Tween extends Laya.Script3D {
  16734. constructor() {
  16735. super();
  16736. this.isInited = false;
  16737. }
  16738. ;
  16739. init() {
  16740. if (this.isInited)
  16741. return;
  16742. this.isInited = true;
  16743. this.gameObj = this.owner;
  16744. this.transform = this.gameObj.transform;
  16745. }
  16746. get rotX() {
  16747. return this.transform.localRotationEulerX;
  16748. }
  16749. set rotX(v) {
  16750. this.transform.localRotationEulerX = v;
  16751. }
  16752. get rotY() {
  16753. return this.transform.localRotationEulerY;
  16754. }
  16755. set rotY(v) {
  16756. this.transform.localRotationEulerY = v;
  16757. }
  16758. get rotZ() {
  16759. return this.transform.localRotationEulerZ;
  16760. }
  16761. set rotZ(v) {
  16762. this.transform.localRotationEulerZ = v;
  16763. }
  16764. get posX() {
  16765. return this.transform.localPositionX;
  16766. }
  16767. set posX(v) {
  16768. this.transform.localPositionX = v;
  16769. }
  16770. get posY() {
  16771. return this.transform.localPositionY;
  16772. }
  16773. set posY(v) {
  16774. this.transform.localPositionY = v;
  16775. }
  16776. get posZ() {
  16777. return this.transform.localPositionZ;
  16778. }
  16779. set posZ(v) {
  16780. this.transform.localPositionZ = v;
  16781. }
  16782. get rotation() {
  16783. return this.transform.localRotation;
  16784. }
  16785. set rotation(v) {
  16786. this.transform.localRotation = v;
  16787. }
  16788. }
  16789. class D2Hole extends Laya.Script {
  16790. constructor() { super(); }
  16791. onTriggerEnter(collider) {
  16792. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16793. return;
  16794. }
  16795. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16796. if (collider.owner["mySrc"].isRunSkillAni) {
  16797. return;
  16798. }
  16799. if (collider.owner["mySrc"].number != 0) {
  16800. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16801. }
  16802. xGame.common.ballColliHole(collider);
  16803. xGame.common.recoverCameraView();
  16804. }
  16805. }
  16806. }
  16807. class Table extends Laya.Script3D {
  16808. constructor() {
  16809. super();
  16810. this.isSetBorder = false;
  16811. this.inited = false;
  16812. }
  16813. ;
  16814. onAwake() {
  16815. this.init();
  16816. }
  16817. init() {
  16818. if (this.inited)
  16819. return;
  16820. this.inited = true;
  16821. this.gameObj = this.owner;
  16822. this.border = this.gameObj.getChildByName("border");
  16823. }
  16824. setBorderPos() {
  16825. if (this.isSetBorder)
  16826. return;
  16827. this.isSetBorder = true;
  16828. let ui = xGame.common.gameUI.ui;
  16829. let bar1 = this.border.getChildByName("bar1");
  16830. let bar2 = this.border.getChildByName("bar2");
  16831. let bar3 = this.border.getChildByName("bar3");
  16832. let bar4 = this.border.getChildByName("bar4");
  16833. let bar5 = this.border.getChildByName("bar5");
  16834. let bar6 = this.border.getChildByName("bar6");
  16835. this.setInfo(bar1, ui.border.bar1, "box");
  16836. this.setInfo(bar2, ui.border.bar2, "box");
  16837. this.setInfo(bar3, ui.border.bar3, "box");
  16838. this.setInfo(bar4, ui.border.bar4, "box");
  16839. this.setInfo(bar5, ui.border.bar5, "box");
  16840. this.setInfo(bar6, ui.border.bar6, "box");
  16841. let circle1 = this.border.getChildByName("circle1");
  16842. let circle2 = this.border.getChildByName("circle2");
  16843. let circle3 = this.border.getChildByName("circle3");
  16844. let circle4 = this.border.getChildByName("circle4");
  16845. let circle5 = this.border.getChildByName("circle5");
  16846. let circle6 = this.border.getChildByName("circle6");
  16847. this.setInfo(circle1, ui.border.circle1, "circle");
  16848. this.setInfo(circle2, ui.border.circle2, "circle");
  16849. this.setInfo(circle3, ui.border.circle3, "circle");
  16850. this.setInfo(circle4, ui.border.circle4, "circle");
  16851. this.setInfo(circle5, ui.border.circle5, "circle");
  16852. this.setInfo(circle6, ui.border.circle6, "circle");
  16853. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16854. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16855. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16856. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16857. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16858. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16859. let arr = xGame.common.gameMgr.holePosList;
  16860. xGame.common.gameMgr.posObj = {
  16861. "1": arr[0],
  16862. "3": arr[2],
  16863. "4": arr[3],
  16864. "6": arr[5]
  16865. };
  16866. }
  16867. initHolePos(x, y) {
  16868. if (x < 300)
  16869. x += 25;
  16870. else if (x > 1000)
  16871. x -= 25;
  16872. else if (y > 200)
  16873. y -= 10;
  16874. else
  16875. y += 10;
  16876. if (y < 200)
  16877. y += 30;
  16878. else if (y > 500)
  16879. y -= 30;
  16880. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16881. }
  16882. setInfo(d3Obj, d2Obj, type) {
  16883. let ui = xGame.common.gameUI.ui;
  16884. let sprite = new Laya.Sprite();
  16885. ui.border.displayObject.addChild(sprite);
  16886. let colli = xGame.common.getCollider(type);
  16887. sprite.addComponentIntance(colli);
  16888. let rigy = xGame.common.getRigbody();
  16889. rigy.type = "static";
  16890. sprite.addComponentIntance(rigy);
  16891. let d3Pos = d3Obj.transform.position;
  16892. xGame.common.pos3to2Convert(d3Pos);
  16893. let scaleX = d3Obj.transform.localScaleX;
  16894. let scaleZ = d3Obj.transform.localScaleZ;
  16895. let width = xGame.common.scale3to2Convert(scaleZ);
  16896. let height = xGame.common.scale3to2Convert(scaleX);
  16897. sprite.pivotX = width / 2;
  16898. sprite.pivotY = height / 2;
  16899. sprite.x = d3Pos.x;
  16900. sprite.y = d3Pos.y;
  16901. sprite.width = width;
  16902. sprite.height = height;
  16903. d2Obj.x = d3Pos.x;
  16904. d2Obj.y = d3Pos.y;
  16905. d2Obj.width = width;
  16906. d2Obj.height = height;
  16907. if (type == "box") {
  16908. colli.width = width;
  16909. colli.height = height;
  16910. colli.isSensor = false;
  16911. colli.label = "border";
  16912. }
  16913. else {
  16914. colli.radius = width / 2;
  16915. colli.isSensor = true;
  16916. colli.label = "hole";
  16917. sprite.addComponent(D2Hole);
  16918. }
  16919. }
  16920. }
  16921. class D3World extends Laya.Script3D {
  16922. constructor() {
  16923. super();
  16924. this.loadNum = 0;
  16925. this.setLoadNum = 7;
  16926. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16927. }
  16928. onAwake() {
  16929. }
  16930. loadScene() {
  16931. this.scene = this.owner;
  16932. let url = `res/unityRes/root.lh`;
  16933. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16934. this.scene.addChild(prefab);
  16935. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16936. this.putCameraInfo();
  16937. this.camera.enableHDR = false;
  16938. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16939. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16940. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16941. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16942. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16943. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16944. this.knife.active = false;
  16945. this.loadD3Obj();
  16946. }));
  16947. }
  16948. putCameraInfo() {
  16949. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16950. this.cameraObj = new cameraType();
  16951. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16952. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16953. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16954. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16955. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16956. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16957. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16958. this.visitAngleChild.init();
  16959. this.visitRootObj.posX = this.visitAngleChild.posX;
  16960. this.visitRootObj.posY = this.visitAngleChild.posY;
  16961. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16962. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16963. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16964. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16965. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16966. xGame.common.showOneCamera("mainCamera");
  16967. }
  16968. loadD3Obj() {
  16969. this.loadTable();
  16970. this.loadRoom();
  16971. this.loadInHoleParticial();
  16972. this.loadIceParticial();
  16973. this.loadHitParticial();
  16974. this.loadFireworksParticial();
  16975. this.loadBall();
  16976. }
  16977. loadInHoleParticial() {
  16978. this.loadD3Res("inHoleEft", "", (prefab) => {
  16979. prefab.addComponent(Partical);
  16980. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16981. });
  16982. }
  16983. loadIceParticial() {
  16984. this.loadD3Res("iceEft", "", (prefab) => {
  16985. prefab.addComponent(Partical);
  16986. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16987. });
  16988. }
  16989. loadHitParticial() {
  16990. this.loadD3Res("hitEft", "", (prefab) => {
  16991. prefab.addComponent(Partical);
  16992. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16993. });
  16994. }
  16995. loadFireworksParticial() {
  16996. this.loadD3Res("fireworksEft", "", (prefab) => {
  16997. prefab.addComponent(Partical);
  16998. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16999. });
  17000. }
  17001. loadBall(index = 1) {
  17002. this.loadD3Res("ball", index, (prefab) => {
  17003. this.ballPrefab = prefab;
  17004. this.ballPrefab.addComponent(Ball);
  17005. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  17006. });
  17007. }
  17008. loadTable(index = 1) {
  17009. this.loadD3Res("table", index, (prefab) => {
  17010. this.tableSrc = prefab.addComponent(Table);
  17011. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  17012. this.d3Hand.init();
  17013. this.tableRoot.addChild(prefab);
  17014. });
  17015. }
  17016. loadRoom(index = 1) {
  17017. this.loadD3Res("room", index, (prefab) => {
  17018. this.roomRoot.addChild(prefab);
  17019. });
  17020. }
  17021. loadD3Res(type, index, callback) {
  17022. let url = `res/unityRes/${type}${index}.lh`;
  17023. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  17024. callback && callback(prefab);
  17025. this.checkResLoad();
  17026. }));
  17027. }
  17028. checkResLoad() {
  17029. this.loadNum++;
  17030. if (this.loadNum >= this.setLoadNum) {
  17031. xGame.eventMgr.event(D3RES_LOADED);
  17032. }
  17033. }
  17034. prePlayEft() {
  17035. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  17036. eft.transform.localPositionX = 0;
  17037. eft.transform.localPositionY = -5;
  17038. eft.transform.localPositionZ = 0;
  17039. eft.active = true;
  17040. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  17041. ice.transform.localPositionX = 0;
  17042. ice.transform.localPositionY = -5;
  17043. ice.transform.localPositionZ = 0;
  17044. ice.active = true;
  17045. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  17046. hit.transform.localPositionX = 0;
  17047. hit.transform.localPositionY = -5;
  17048. hit.transform.localPositionZ = 0;
  17049. hit.active = true;
  17050. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  17051. fireworks.transform.localPositionX = 0;
  17052. fireworks.transform.localPositionY = -5;
  17053. fireworks.transform.localPositionZ = 0;
  17054. fireworks.active = true;
  17055. }
  17056. }
  17057. class cameraType {
  17058. }
  17059. class MoyuMgr$1 {
  17060. static initMoyu() {
  17061. this.moyuView = new MoyuView$1();
  17062. Laya.stage.addChild(this.moyuView.ui.displayObject);
  17063. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  17064. this.moyuView.ui.displayObject.zOrder = 1000;
  17065. this.moyuView.init();
  17066. this.moyuView.showTip(true);
  17067. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  17068. window['XApk'] = this;
  17069. }
  17070. static showAge(show) {
  17071. if (this.moyuView)
  17072. this.moyuView.showAge(show);
  17073. }
  17074. static onPlatMsg(idx) {
  17075. if (!MoyuMgr$1.moyuView)
  17076. return;
  17077. if (idx == '0') {
  17078. MoyuMgr$1.moyuView.showTip(false);
  17079. }
  17080. }
  17081. static showAgree(call) {
  17082. if (this.moyuView)
  17083. this.moyuView.showAgree(call);
  17084. else
  17085. call && call();
  17086. }
  17087. static showXy(type = 1) {
  17088. if (this.moyuView)
  17089. this.moyuView.showXy(type);
  17090. }
  17091. }
  17092. MoyuMgr$1.isAdvise = false;
  17093. class MoyuView$1 {
  17094. constructor() {
  17095. this.ysxyNum = 1;
  17096. this.ysJson = null;
  17097. this.ui = ui_UIMoyu.createInstance();
  17098. }
  17099. init() {
  17100. this.ui.mainBg.visible = false;
  17101. this.ui.xyNode.visible = false;
  17102. this.ui.ageNode.visible = false;
  17103. this.ui.tipNode.visible = false;
  17104. this.ui.rnNode.visible = false;
  17105. this.ui.fcmNode.visible = false;
  17106. this.ui.ageTip.visible = false;
  17107. this.ui.msgNode.visible = false;
  17108. this.ui.visible = false;
  17109. this.ui.xyNode.xyList.setVirtual();
  17110. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  17111. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  17112. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  17113. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  17114. this.ui.xyNode.btnKnown.visible = false;
  17115. this.ui.xyNode.xy1.visible = false;
  17116. this.ui.xyNode.xy2.visible = false;
  17117. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  17118. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  17119. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  17120. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  17121. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  17122. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  17123. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  17124. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  17125. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  17126. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  17127. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  17128. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  17129. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  17130. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  17131. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  17132. this.ysxyNum = 2;
  17133. }
  17134. }
  17135. onClick(obj) {
  17136. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  17137. switch (obj) {
  17138. case this.ui.ageTip:
  17139. if (Moyu.isTTApk) {
  17140. this.ui.ageNode.visible = true;
  17141. this.ui.mainBg.visible = true;
  17142. }
  17143. break;
  17144. case this.ui.tipNode:
  17145. this.showTip(false);
  17146. break;
  17147. case this.ui.ageNode.btnAge:
  17148. this.ui.ageNode.visible = false;
  17149. this.ui.mainBg.visible = false;
  17150. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  17151. this.ui.visible = false;
  17152. break;
  17153. case this.ui.xyNode.btnXy3:
  17154. case this.ui.xyNode.btnXy1:
  17155. this.loadXy(1);
  17156. break;
  17157. case this.ui.xyNode.btnXy2:
  17158. this.loadXy(2);
  17159. break;
  17160. case this.ui.xyNode.btnBack:
  17161. this.ui.xyNode.xy1.visible = true;
  17162. this.ui.xyNode.xy2.visible = false;
  17163. break;
  17164. case this.ui.xyNode.btnKnown:
  17165. this.ui.xyNode.visible = false;
  17166. this.ui.mainBg.visible = false;
  17167. this.ui.visible = false;
  17168. break;
  17169. case this.ui.rnNode.btnCheck:
  17170. this.check();
  17171. break;
  17172. case this.ui.rnNode.btnExit:
  17173. case this.ui.xyNode.btnNo:
  17174. this.ysxyNum--;
  17175. if (this.ysxyNum > 0)
  17176. this.showMsg("Refuse to quit the game once again");
  17177. else {
  17178. Moyu.userAgree(false);
  17179. Moyu.exit();
  17180. }
  17181. break;
  17182. case this.ui.xyNode.btnSure:
  17183. case this.ui.xyNode.btnYes:
  17184. DataMgr.userData.isAgree = true;
  17185. DataMgr.saveUserData();
  17186. this.onAgree();
  17187. break;
  17188. case this.ui.rnNode.btnDone:
  17189. this.ui.rnNode.visible = false;
  17190. this.ui.visible = false;
  17191. break;
  17192. case this.ui.fcmNode.btnRn:
  17193. this.showRn();
  17194. break;
  17195. }
  17196. }
  17197. showTip(show) {
  17198. if (!Moyu.isVVApk && !Moyu.isOPApk)
  17199. return;
  17200. if (show) {
  17201. MoyuMgr$1.isAdvise = true;
  17202. this.ui.visible = true;
  17203. this.ui.tipNode.visible = true;
  17204. this.ui.tipNode.alpha = 1;
  17205. Laya.timer.once(1000, this, this.showTip, [false]);
  17206. }
  17207. else {
  17208. this.ui.tipNode.alpha = 1;
  17209. this.ui.tipNode.visible = true;
  17210. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  17211. this.ui.tipNode.visible = false;
  17212. MoyuMgr$1.isAdvise = false;
  17213. }), 1000);
  17214. }
  17215. }
  17216. showAge(show, px = 0, py = 0) {
  17217. if (Moyu.platType > 10 && !Moyu.isIos) {
  17218. this.ui.ageTip.x = px;
  17219. this.ui.ageTip.y = py;
  17220. this.ui.ageTip.visible = show;
  17221. if (show)
  17222. this.ui.visible = true;
  17223. }
  17224. }
  17225. showAgree(call) {
  17226. this.agreeCall = call;
  17227. this.onAgree();
  17228. return;
  17229. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  17230. this.showXy(0);
  17231. }
  17232. else
  17233. this.onAgree();
  17234. }
  17235. onAgree() {
  17236. if (!this.ui.ageNode.visible)
  17237. this.ui.visible = false;
  17238. this.ui.xyNode.visible = false;
  17239. Moyu.userAgree(true);
  17240. this.showAge(false);
  17241. this.agreeCall && this.agreeCall();
  17242. this.showRn();
  17243. }
  17244. showMsg(txt) {
  17245. this.ui.msgNode.txtMsg.text = txt;
  17246. this.ui.msgNode.visible = true;
  17247. this.ui.msgNode.alpha = 1;
  17248. this.ui.visible = true;
  17249. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  17250. this.ui.msgNode.visible = false;
  17251. }), 2500, true);
  17252. }
  17253. showRn() {
  17254. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17255. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  17256. this.ui.rnNode.rn1.visible = true;
  17257. this.ui.rnNode.rn2.visible = false;
  17258. this.ui.rnNode.rn3.visible = false;
  17259. this.ui.rnNode.rn4.visible = false;
  17260. this.ui.rnNode.visible = true;
  17261. this.ui.mainBg.visible = true;
  17262. this.ui.rnNode.btnDone.visible = false;
  17263. this.ui.rnNode.btnExit.visible = true;
  17264. this.ui.rnNode.btnCheck.visible = true;
  17265. this.ui.fcmNode.visible = false;
  17266. this.ui.visible = true;
  17267. return;
  17268. }
  17269. }
  17270. this.showFcm();
  17271. }
  17272. showFcm() {
  17273. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17274. Moyu.initFCM(true);
  17275. if (Moyu.gameTime < 1)
  17276. this.fcmLoop();
  17277. else if (Moyu.gameTime < 999)
  17278. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  17279. }
  17280. }
  17281. fcmLoop() {
  17282. if (Moyu.gameTime < 1) {
  17283. this.ui.rnNode.visible = false;
  17284. this.ui.fcmNode.visible = true;
  17285. this.ui.mainBg.visible = true;
  17286. this.ui.visible = true;
  17287. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  17288. Laya.timer.clear(this.ui, this.fcmLoop);
  17289. }
  17290. }
  17291. check() {
  17292. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  17293. this.ui.rnNode.rn1.visible = false;
  17294. this.ui.rnNode.rn2.visible = false;
  17295. this.ui.rnNode.rn4.visible = true;
  17296. }
  17297. else if (this.ui.rnNode.rn4.visible) {
  17298. let name = this.ui.rnNode.inputName.text;
  17299. let code = this.ui.rnNode.inputCode.text;
  17300. if (code && code.length == 18) {
  17301. this.ui.rnNode.rn1.visible = false;
  17302. this.ui.rnNode.rn4.visible = false;
  17303. Moyu.authenticate(name, code, (res) => {
  17304. this.ui.rnNode.rn2.visible = !res;
  17305. this.ui.rnNode.rn3.visible = res;
  17306. this.ui.rnNode.btnDone.visible = res;
  17307. this.ui.rnNode.btnExit.visible = !res;
  17308. this.ui.rnNode.btnCheck.visible = !res;
  17309. if (res)
  17310. this.showFcm();
  17311. });
  17312. }
  17313. else
  17314. this.showMsg("信息填写不完整");
  17315. }
  17316. }
  17317. loadXy(type = 0) {
  17318. this.ui.xyNode.xy1.visible = false;
  17319. this.ui.xyNode.xy2.visible = true;
  17320. this.ui.xyNode.xyList.scrollToView(0);
  17321. if (type == 1) {
  17322. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  17323. }
  17324. else if (type == 2) {
  17325. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  17326. }
  17327. }
  17328. showXy(type = 0) {
  17329. this.xyBtn();
  17330. if (type == 0) {
  17331. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  17332. this.ui.xyNode.btnSure.visible = true;
  17333. }
  17334. else {
  17335. this.ui.xyNode.btnYes.visible = true;
  17336. this.ui.xyNode.btnNo.visible = true;
  17337. }
  17338. }
  17339. else {
  17340. this.ui.xyNode.btnKnown.visible = true;
  17341. this.ui.mainBg.visible = true;
  17342. }
  17343. this.ui.xyNode.xy1.visible = true;
  17344. this.ui.xyNode.xy2.visible = false;
  17345. this.ui.xyNode.visible = true;
  17346. this.ui.visible = true;
  17347. }
  17348. xyBtn() {
  17349. this.ui.xyNode.btnSure.visible = false;
  17350. this.ui.xyNode.btnYes.visible = false;
  17351. this.ui.xyNode.btnNo.visible = false;
  17352. this.ui.xyNode.btnKnown.visible = false;
  17353. {
  17354. this.ui.xyNode.btnXy3.visible = false;
  17355. this.ui.xyNode.btnXy2.visible = true;
  17356. this.ui.xyNode.btnXy1.visible = true;
  17357. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  17358. }
  17359. }
  17360. createXY(json) {
  17361. this.ysJson = json.content;
  17362. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  17363. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  17364. this.ui.xyNode.xy2.visible = true;
  17365. }
  17366. renderListItem(idx, cell) {
  17367. let xy = this.ysJson[idx];
  17368. cell.height = xy.line * 30;
  17369. cell.xyItem.text = xy.text;
  17370. }
  17371. onDestroy() {
  17372. this.agreeCall = null;
  17373. }
  17374. }
  17375. class UILoading extends UIBase {
  17376. constructor() {
  17377. super();
  17378. this.accTime = 0;
  17379. this.curNum = 0;
  17380. this.rate = 1;
  17381. this.loadSubOk = false;
  17382. this.loadResOK = false;
  17383. this.openLoading = true;
  17384. this.beginLoadRes = false;
  17385. this.finishD2 = false;
  17386. this.finishD3 = false;
  17387. }
  17388. onConstructor() {
  17389. this.ui = ui_UILoading.createInstance();
  17390. this.contentPane = this.ui;
  17391. this.isEject = false;
  17392. this._initUI();
  17393. this._addEvent();
  17394. }
  17395. _initUI() {
  17396. MoyuMgr$1.initMoyu();
  17397. }
  17398. _addEvent() {
  17399. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  17400. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  17401. }
  17402. show() {
  17403. super.show();
  17404. console.log('zh:加载分包资源');
  17405. loadSubRes(this.subResProgress.bind(this));
  17406. this.ui.txtLoad.text = "Loading...";
  17407. }
  17408. subResProgress(pro, finish) {
  17409. this.curNum = pro;
  17410. if (finish) {
  17411. this.curNum = 1;
  17412. this.loadSubOk = true;
  17413. }
  17414. }
  17415. laodD3Res() {
  17416. let scene3D = new Laya.Scene3D();
  17417. xGame.common.d3Scene = scene3D;
  17418. xGame.common.d3World = scene3D.addComponent(D3World);
  17419. xGame.common.d3World.loadScene();
  17420. }
  17421. loadD2Res() {
  17422. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  17423. this.finishD2 = true;
  17424. this.checkLoadAll();
  17425. this.curNum = 1;
  17426. }), Laya.Handler.create(this, (pro) => {
  17427. this.curNum = pro;
  17428. }, null, false));
  17429. }
  17430. d3ResFinish() {
  17431. this.finishD3 = true;
  17432. this.checkLoadAll();
  17433. }
  17434. checkLoadAll() {
  17435. if (this.finishD2 && this.finishD3) {
  17436. this.loadResOK = true;
  17437. }
  17438. }
  17439. loadRes() {
  17440. this.laodD3Res();
  17441. this.loadD2Res();
  17442. }
  17443. myUpdate(dt) {
  17444. if (!this.openLoading)
  17445. return;
  17446. this.accTime += dt * this.rate;
  17447. if (this.accTime >= this.curNum)
  17448. this.accTime = this.curNum;
  17449. this.ui.loadinfo.value = this.accTime * 100;
  17450. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  17451. if (!this.beginLoadRes) {
  17452. this.beginLoadRes = true;
  17453. this.ui.txtLoad.text = "Loading...";
  17454. this.curNum = 0;
  17455. this.accTime = 0;
  17456. this.loadRes();
  17457. }
  17458. if (this.loadResOK) {
  17459. this.openLoading = false;
  17460. Laya.timer.once(300, this, () => {
  17461. xGame.common.d3Scene.active = false;
  17462. MoyuMgr$1.showAgree(enterGame);
  17463. });
  17464. }
  17465. }
  17466. }
  17467. release() {
  17468. }
  17469. hide() {
  17470. super.hide();
  17471. this.release();
  17472. }
  17473. onClose() {
  17474. this.hide();
  17475. }
  17476. }
  17477. UILoading.uiName = "UILoading";
  17478. class UIRepentProp$1 extends UIBase {
  17479. constructor() {
  17480. super();
  17481. this.viewType = 0;
  17482. this.regretType = 0;
  17483. }
  17484. onConstructor() {
  17485. this.ui = ui_UIRepentProp.createInstance();
  17486. this.contentPane = this.ui;
  17487. this.isEject = false;
  17488. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17489. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17490. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17491. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17492. }
  17493. show(viewType, regretType, callback) {
  17494. PlatMgr.showInsert(true);
  17495. this.viewType = viewType;
  17496. this.regretType = regretType;
  17497. this.callback = callback;
  17498. super.show();
  17499. this.ui.t0.play();
  17500. this.ui.c1.selectedIndex = this.viewType;
  17501. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17502. if (this.viewType == 0) {
  17503. let guide = DataMgr.getGuideHelpLine();
  17504. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17505. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17506. }
  17507. xGame.common.gameMgr.gamePause = true;
  17508. }
  17509. hideSelf() {
  17510. xGame.common.gameMgr.gamePause = false;
  17511. this.callback && this.callback(false);
  17512. this.hide();
  17513. }
  17514. videoRegret() {
  17515. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  17516. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  17517. }
  17518. else {
  17519. console.log('zh:AD 失败,直接发放奖励');
  17520. this.qjff_AD_for_UIrepentProp_videoRegret();
  17521. }
  17522. }
  17523. qjff_AD_for_UIrepentProp_videoRegret() {
  17524. this.callback && this.callback(true);
  17525. this.hideSelf();
  17526. }
  17527. videoAddHelpLine() {
  17528. let guide = DataMgr.getGuideHelpLine();
  17529. if (guide == 0) {
  17530. this.callback && this.callback(true);
  17531. this.hideSelf();
  17532. DataMgr.setGuideHelpLine();
  17533. xGame.common.gameUI.ui.guideNode.visible = false;
  17534. }
  17535. else {
  17536. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  17537. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  17538. }
  17539. else {
  17540. console.log('zh:AD 失败,直接发放奖励');
  17541. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  17542. }
  17543. }
  17544. }
  17545. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  17546. this.callback && this.callback(true);
  17547. this.hideSelf();
  17548. }
  17549. }
  17550. UIRepentProp$1.uiName = "UIRepentProp";
  17551. class UIRodMethod$1 extends UIBase {
  17552. constructor() {
  17553. super();
  17554. this.isPressd = false;
  17555. }
  17556. onConstructor() {
  17557. this.ui = ui_UIRodMethod.createInstance();
  17558. this.contentPane = this.ui;
  17559. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17560. this.moveDir = new Laya.Vector2();
  17561. this.moveDest = new Laya.Vector2();
  17562. this.centerPos = new Laya.Vector2();
  17563. xGame.common.uiRodMethod = this;
  17564. }
  17565. show() {
  17566. super.show();
  17567. xGame.common.gameMgr.gamePause = true;
  17568. this.openPressDotEvent();
  17569. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17570. this.centerPos.x = this.ui.white.x;
  17571. this.centerPos.y = this.ui.white.y;
  17572. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17573. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17574. this.setDot();
  17575. }
  17576. setDot() {
  17577. this.ui.dot.x = this.moveDest.x;
  17578. this.ui.dot.y = this.moveDest.y;
  17579. }
  17580. closeSelf() {
  17581. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17582. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17583. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17584. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17585. xGame.common.gameMgr.gamePause = false;
  17586. this.hide();
  17587. }
  17588. openPressDotEvent() {
  17589. this.closePressDotEvent();
  17590. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17591. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17592. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17593. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17594. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17595. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17596. }
  17597. closePressDotEvent() {
  17598. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17599. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17600. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17601. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17602. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17603. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17604. }
  17605. onDown(e) {
  17606. if (e.type == Laya.Event.MOUSE_DOWN)
  17607. this.isPressd = true;
  17608. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17609. this.isPressd = false;
  17610. if (!this.isPressd)
  17611. return;
  17612. this.moveDest.x = e.stageX;
  17613. this.moveDest.y = e.stageY;
  17614. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17615. if (dis > 6724) {
  17616. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17617. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17618. }
  17619. this.setDot();
  17620. }
  17621. resetRod() {
  17622. this.ui.dot.x = this.ui.white.x;
  17623. this.ui.dot.y = this.ui.white.y;
  17624. this.gameRod.dot.x = this.gameRod.bg.x;
  17625. this.gameRod.dot.y = this.gameRod.bg.y;
  17626. xGame.common.rodOffest.x = 0;
  17627. xGame.common.rodOffest.y = 0;
  17628. }
  17629. }
  17630. UIRodMethod$1.uiName = "UIRodMethod";
  17631. class UIMsg$1 extends UIBase {
  17632. constructor() {
  17633. super();
  17634. }
  17635. onConstructor() {
  17636. this.ui = ui_UIMsg.createInstance();
  17637. this.contentPane = this.ui;
  17638. this.isEject = false;
  17639. this.isMuti = true;
  17640. }
  17641. show(msg, callback) {
  17642. super.show();
  17643. this.ui.tipsNode.msgTxt.text = msg;
  17644. this.ui.alpha = 1;
  17645. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17646. this.hide();
  17647. callback && callback();
  17648. }), 1000);
  17649. }
  17650. }
  17651. UIMsg$1.uiName = "UIMsg";
  17652. class UITips$1 extends UIBase {
  17653. constructor() {
  17654. super();
  17655. this.type = 0;
  17656. }
  17657. onConstructor() {
  17658. this.ui = ui_UITips.createInstance();
  17659. this.contentPane = this.ui;
  17660. this.isEject = false;
  17661. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17662. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17663. }
  17664. show(tipsTxt, womanTxt, type) {
  17665. super.show();
  17666. this.ui.t0.play();
  17667. this.ui.myNode.tipsTxt.text = tipsTxt;
  17668. this.ui.myNode.womanTxt.text = womanTxt;
  17669. PlatMgr.showInsert(true);
  17670. this.ui.myNode.c1.selectedIndex = type;
  17671. this.type = type;
  17672. switch (this.type) {
  17673. case TipsType.exitGame:
  17674. xGame.common.gameMgr.gamePause = true;
  17675. break;
  17676. case TipsType.foul:
  17677. Laya.timer.once(200, this, () => {
  17678. xGame.common.gameMgr.gamePause = true;
  17679. });
  17680. break;
  17681. default:
  17682. break;
  17683. }
  17684. }
  17685. clickLeftBtn() {
  17686. this.hide();
  17687. xGame.common.gameMgr.gamePause = false;
  17688. switch (this.type) {
  17689. case TipsType.exitGame:
  17690. break;
  17691. case TipsType.foul:
  17692. break;
  17693. default:
  17694. break;
  17695. }
  17696. }
  17697. clickRightBtn() {
  17698. this.hide();
  17699. switch (this.type) {
  17700. case TipsType.exitGame:
  17701. xGame.eventMgr.event(RESET_GAME);
  17702. xGame.uiMgr.Show(UIMain$1);
  17703. Moyu.recordEnd(this, null);
  17704. xGame.common.longHelpLine = false;
  17705. break;
  17706. case TipsType.foul:
  17707. xGame.common.gameMgr.gamePause = false;
  17708. Laya.timer.clearAll(this);
  17709. break;
  17710. default:
  17711. break;
  17712. }
  17713. }
  17714. }
  17715. UITips$1.uiName = "UITips";
  17716. class UIGame$1 extends UIBase {
  17717. constructor() {
  17718. super();
  17719. this.powerNum = 0;
  17720. this.isD3Inited = false;
  17721. this.isPrePlay = false;
  17722. this.isMoveRod = false;
  17723. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17724. this.rulerDis = 20;
  17725. this.rulerOffset = 0;
  17726. }
  17727. onConstructor() {
  17728. this.ui = ui_UIGame.createInstance();
  17729. this.contentPane = this.ui;
  17730. this.ui.x += xGame.common.sysOffestNum;
  17731. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17732. this.isEject = false;
  17733. xGame.common.gameUI = this;
  17734. this.initSelf();
  17735. }
  17736. isTurnSelf() {
  17737. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17738. return true;
  17739. }
  17740. }
  17741. initSelf() {
  17742. let topUI = this.ui.topNode;
  17743. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17744. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17745. this.barInfo = {};
  17746. this.barInfo.curY = 0;
  17747. this.barInfo.height = this.ui.powerNode.height;
  17748. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17749. this.barInfo.powerStartY = this.ui.powerNode.y;
  17750. xGame.common.aiPlayer = new AIPlayer();
  17751. xGame.common.gameMgr = new GameMgr();
  17752. xGame.common.skillMgr = new SkillMgr();
  17753. xGame.common.wordsMgr = new WordsMgr();
  17754. xGame.common.talkMgr = new TalkMgr();
  17755. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17756. console.log("加载经典模式表情文件chenggon !");
  17757. });
  17758. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17759. console.log("挑战模式奖励模式spine加载成功!");
  17760. });
  17761. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17762. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17763. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17764. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17765. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17766. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17767. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17768. }
  17769. getGanZiImg() {
  17770. let index = DataMgr.getCurBallRod();
  17771. let data = cfgTable.ballrodData[index + 1];
  17772. let gan_url = xGame.common.getGameIconUrl(data.img);
  17773. console.log('zh:getGanZiImg gan_url==' + gan_url);
  17774. this.ui.powerNode.showImg.url = gan_url;
  17775. console.log('zh:修改杆子图标O K');
  17776. }
  17777. returnHome() {
  17778. let tips = "Are you sure to exit the game?";
  17779. let woman = "Boss, why don't you play for a while longer?";
  17780. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17781. }
  17782. addRodMethodClick() {
  17783. if (this.isTurnSelf()) {
  17784. xGame.uiMgr.Show(UIRodMethod$1);
  17785. }
  17786. }
  17787. clickHelpLineBtn(force = false) {
  17788. if (!this.isTurnSelf())
  17789. return;
  17790. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17791. if (success) {
  17792. xGame.common.longHelpLine = true;
  17793. xGame.common.d2World.getHelpLine();
  17794. Moyu.sendDataEvent("guideNum");
  17795. }
  17796. else {
  17797. }
  17798. });
  17799. }
  17800. renderSelfDisplayBalls(index, target) {
  17801. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17802. target.myImg.url = xGame.common.getGameIconUrl(str);
  17803. }
  17804. renderAIDisplayBalls(index, target) {
  17805. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17806. target.myImg.url = xGame.common.getGameIconUrl(str);
  17807. ;
  17808. }
  17809. updateMode() {
  17810. if (xGame.common.gameMode == GameMode.classic) {
  17811. this.ui.topNode.scoreNode.visible = false;
  17812. }
  17813. else if (xGame.common.gameMode == GameMode.bigMove) {
  17814. this.ui.topNode.scoreNode.visible = true;
  17815. }
  17816. }
  17817. show() {
  17818. super.show();
  17819. console.log("zh:uigame show AADD");
  17820. this.ui.alpha = 0;
  17821. this.updateSelf();
  17822. xGame.common.gameMgr.gamePause = false;
  17823. xGame.common.gameUI.ui.blackAni.visible = false;
  17824. xGame.common.gameUI.ui.whiteAni.visible = false;
  17825. this.ui.powerEft.visible = false;
  17826. this.ui.colorNode.visible = false;
  17827. this.updateHead();
  17828. let curUse = DataMgr.getCurBallRod();
  17829. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  17830. this.getGanZiImg();
  17831. }
  17832. updateSelf() {
  17833. if (xGame.common.gameMode == GameMode.classic) {
  17834. this.ui.c1.selectedIndex = 0;
  17835. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17836. this.ui.topNode.middleNode.visible = true;
  17837. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17838. }
  17839. else if (xGame.common.gameMode == GameMode.bigMove) {
  17840. this.ui.c1.selectedIndex = 0;
  17841. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17842. this.ui.topNode.middleNode.visible = false;
  17843. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17844. let rand = xGame.common.randomNum(1, max);
  17845. let guide = DataMgr.getSkillGuide();
  17846. if (guide == 0)
  17847. rand = 1;
  17848. xGame.common.bigMoveLevelIndex = rand;
  17849. }
  17850. else if (xGame.common.gameMode == GameMode.placeBall) {
  17851. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17852. this.ui.c1.selectedIndex = 1 + data.type;
  17853. this.ui.alpha = 1;
  17854. this.startGame();
  17855. }
  17856. this.updateMode();
  17857. this.initD3world();
  17858. this.initD2world();
  17859. }
  17860. startGame() {
  17861. this.ui.snowNode.visible = Math.random() <= 0.1;
  17862. this.ui.d2Node.visible = false;
  17863. xGame.common.d3World.d3Hand.gameObj.active = false;
  17864. xGame.common.d3World.tableSrc.init();
  17865. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17866. this.cameraViewChange(() => {
  17867. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17868. switch (xGame.common.gameMode) {
  17869. case GameMode.classic:
  17870. xGame.common.d3World.d3Hand.gameObj.active = true;
  17871. this.playPutBallD3Ani();
  17872. break;
  17873. case GameMode.bigMove:
  17874. this.enterGame();
  17875. Laya.timer.once(500, this, () => {
  17876. this.ui.topNode.middleNode.visible = true;
  17877. this.ui.topNode.middleNode.t0.play();
  17878. });
  17879. break;
  17880. case GameMode.placeBall:
  17881. this.enterGame();
  17882. break;
  17883. default:
  17884. break;
  17885. }
  17886. });
  17887. PlatMgr.showBanner(false);
  17888. }
  17889. enterGame() {
  17890. this.ui.d2Node.visible = true;
  17891. xGame.common.d3World.d3Hand.gameObj.active = false;
  17892. xGame.common.showOneCamera("mainCamera");
  17893. Moyu.recordGame(30, true);
  17894. if (!this.isPrePlay) {
  17895. this.isPrePlay = true;
  17896. xGame.common.d3World.prePlayEft();
  17897. }
  17898. xGame.common.gameMgr.gameReady();
  17899. this.openAllEvent();
  17900. this.ui.snowNode.visible = false;
  17901. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17902. this.ui.helpBtn.visible = condition;
  17903. }
  17904. showHelpLineGuide() {
  17905. let longGuide = DataMgr.getGuideHelpLine();
  17906. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17907. this.ui.helpBtn.visible = true;
  17908. this.ui.guideNode.visible = true;
  17909. }
  17910. }
  17911. setTurnAlpha(alpha) {
  17912. this.ui.keduNode.alpha = alpha;
  17913. this.ui.ganNode.alpha = alpha;
  17914. this.ui.rodMethodNode.alpha = alpha;
  17915. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17916. }
  17917. cameraViewChange(callback) {
  17918. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17919. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17920. xGame.common.showOneCamera("visitAngle");
  17921. cameraSrc.localRotationEulerY = 180;
  17922. cameraSrc.localRotationEulerZ = 0;
  17923. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17924. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17925. callback && callback();
  17926. }));
  17927. }));
  17928. }
  17929. playPutBallD3Ani() {
  17930. xGame.common.showOneCamera("mainCamera");
  17931. let handSrc = xGame.common.d3World.d3Hand;
  17932. handSrc.gameObj.active = true;
  17933. handSrc.transform.localPositionZ = 3;
  17934. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17935. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17936. handSrc.gameObj.active = false;
  17937. this.enterGame();
  17938. }), 400);
  17939. }));
  17940. }
  17941. updateHead() {
  17942. let user = Moyu.getUserInfo();
  17943. this.ui.topNode.selfNameTxt.text = user.nickName;
  17944. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17945. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17946. if (DataMgr.getSkillGuide() < 1) {
  17947. this.ui.topNode.aiNameTxt.text = 'billiards';
  17948. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17949. }
  17950. else {
  17951. this.ui.topNode.aiNameTxt.text = aiData.name;
  17952. let randNo = Math.floor(Math.random() * 10) + 1;
  17953. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17954. }
  17955. }
  17956. initD2world() {
  17957. let node = this.ui.d2Root.displayObject;
  17958. let src = node.getComponent(D2World);
  17959. if (!src) {
  17960. xGame.common.d2World = node.addComponent(D2World);
  17961. }
  17962. xGame.common.d2World.initSelf();
  17963. }
  17964. initD3world() {
  17965. if (this.isD3Inited)
  17966. return;
  17967. this.isD3Inited = true;
  17968. let scene3D = xGame.common.d3Scene;
  17969. this.ui.d3Root.displayObject.addChild(scene3D);
  17970. scene3D.active = true;
  17971. xGame.common.d3World.tableSrc.setBorderPos();
  17972. }
  17973. onRootMove(e) {
  17974. let rootBall = xGame.common.d2World.rootBall;
  17975. this.ui.moveNode.x = e.x;
  17976. this.ui.moveNode.y = e.y;
  17977. rootBall.gameObj.x = e.x;
  17978. rootBall.gameObj.y = e.y;
  17979. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17980. }
  17981. aiRootMove(move) {
  17982. if (move)
  17983. this.hideBallUI();
  17984. else {
  17985. this.showBallUI();
  17986. xGame.common.d2World.getHelpLine();
  17987. }
  17988. }
  17989. aiForce(type, force = 0) {
  17990. this.pressTarget = PressType.powerNode;
  17991. if (type == 1)
  17992. this.onEventUp({ force: true });
  17993. else if (type == 2)
  17994. this.onEventMove({ stageY: force, force: true });
  17995. }
  17996. onEventPress(e) {
  17997. if (e.stopPropagation)
  17998. e.stopPropagation();
  17999. if (!this.isTurnSelf())
  18000. return;
  18001. let target = e.target;
  18002. switch (target) {
  18003. case this.ui.myPowerNode.displayObject:
  18004. this.pressTarget = PressType.powerNode;
  18005. this.barInfo.curY = e.stageY;
  18006. this.updateBarInfo();
  18007. break;
  18008. case this.ui.moveNode.displayObject:
  18009. this.pressTarget = PressType.moveNode;
  18010. this.hideBallUI();
  18011. this.eventObj.curX = this.ui.moveNode.x;
  18012. this.eventObj.curY = this.ui.moveNode.y;
  18013. this.ui.moveNode.finger.visible = false;
  18014. this.eventObj.lastX = e.stageX;
  18015. this.eventObj.lastY = e.stageY;
  18016. break;
  18017. case this.ui.rulerClickNode.displayObject:
  18018. this.pressTarget = PressType.rulerNode;
  18019. this.eventObj.lastY = e.stageY;
  18020. break;
  18021. case this.ui.d2Root.displayObject:
  18022. this.pressTarget = PressType.d2Root;
  18023. this.eventObj.lastX = e.stageX;
  18024. this.eventObj.lastY = e.stageY;
  18025. this.eventObj.starX = e.stageX;
  18026. this.eventObj.starY = e.stageY;
  18027. this.eventObj.curX = 0;
  18028. this.eventObj.curY = 0;
  18029. xGame.common.d2World.d2Gan.setGanLastInfo();
  18030. this.rulerOffset = 0;
  18031. break;
  18032. default:
  18033. break;
  18034. }
  18035. }
  18036. onEventMove(e) {
  18037. if (e.stopPropagation)
  18038. e.stopPropagation();
  18039. if (e && e.force) {
  18040. }
  18041. else {
  18042. if (!this.isTurnSelf())
  18043. return;
  18044. }
  18045. switch (this.pressTarget) {
  18046. case PressType.powerNode:
  18047. this.barInfo.curY = e.stageY;
  18048. this.updateBarInfo();
  18049. this.isMoveRod = true;
  18050. break;
  18051. case PressType.moveNode:
  18052. let rootBall = xGame.common.d2World.rootBall;
  18053. let radius = rootBall.gameObj.width / 2;
  18054. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  18055. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  18056. let border = xGame.common.d2World.borderRect;
  18057. if (curX <= border.x + radius)
  18058. curX = border.x + radius;
  18059. else if (curX >= border.x + border.width - radius)
  18060. curX = border.x + border.width - radius;
  18061. if (curY <= border.y + radius)
  18062. curY = border.y + radius;
  18063. else if (curY >= border.y + border.height - radius)
  18064. curY = border.y + border.height - radius;
  18065. if (xGame.common.gameMgr.isOpenBall) {
  18066. if (curX >= border.x + border.openBallW - radius)
  18067. curX = border.x + border.openBallW - radius;
  18068. }
  18069. this.ui.moveNode.x = curX;
  18070. this.ui.moveNode.y = curY;
  18071. rootBall.gameObj.x = curX;
  18072. rootBall.gameObj.y = curY;
  18073. rootBall.d3BallSrc.setTransPos(curX, curY);
  18074. this.isMoveRod = true;
  18075. break;
  18076. case PressType.rulerNode:
  18077. let yy = e.stageY - this.eventObj.lastY;
  18078. this.eventObj.lastY = e.stageY;
  18079. let ruler1 = this.ui.rulerNode.img1;
  18080. let ruler2 = this.ui.rulerNode.img2;
  18081. ruler1.y += yy;
  18082. ruler2.y += yy;
  18083. this.rulerOffset += yy;
  18084. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  18085. this.rulerOffset = 0;
  18086. xGame.soundMgr.playSound("inch", 1, 10);
  18087. }
  18088. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  18089. let h = ruler1.height;
  18090. this.checkGuide();
  18091. this.isMoveRod = true;
  18092. if (ruler1.y >= h) {
  18093. ruler1.y = -h;
  18094. ruler2.y = 0;
  18095. return;
  18096. }
  18097. else if (ruler1.y <= -h) {
  18098. ruler1.y = h;
  18099. ruler2.y = 0;
  18100. return;
  18101. }
  18102. if (ruler2.y >= h) {
  18103. ruler2.y = -h;
  18104. ruler1.y = 0;
  18105. return;
  18106. }
  18107. else if (ruler2.y <= -h) {
  18108. ruler2.y = h;
  18109. ruler1.y = 0;
  18110. return;
  18111. }
  18112. break;
  18113. case PressType.d2Root:
  18114. this.eventObj.curX = e.stageX;
  18115. this.eventObj.curY = e.stageY;
  18116. let offset = this.checkRodMoveDir();
  18117. xGame.common.d2World.d2Gan.rotateSelf(offset);
  18118. this.eventObj.lastX = e.stageX;
  18119. this.eventObj.lastY = e.stageY;
  18120. break;
  18121. default:
  18122. break;
  18123. }
  18124. }
  18125. onEventUp(e) {
  18126. if (e.stopPropagation)
  18127. e.stopPropagation();
  18128. if (e && e.force) {
  18129. }
  18130. else {
  18131. if (!this.isTurnSelf())
  18132. return;
  18133. }
  18134. switch (this.pressTarget) {
  18135. case PressType.powerNode:
  18136. this.ui.powerNode.value = 0;
  18137. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18138. this.ui.powerTxt.text = "";
  18139. if (this.powerNum > 0) {
  18140. xGame.eventMgr.event(BALL_SHOOT);
  18141. xGame.common.d2World.shoot(this.powerNum);
  18142. xGame.common.d2World.d2Gan.shoot();
  18143. xGame.common.d2World.d2HelpLine.shoot();
  18144. this.finishGuide();
  18145. this.ui.powerEft.visible = false;
  18146. this.ui.colorNode.visible = false;
  18147. let ganStr = "";
  18148. if (this.powerNum <= 30) {
  18149. ganStr = "gan_30";
  18150. }
  18151. else if (this.powerNum <= 60) {
  18152. ganStr = "gan_50";
  18153. }
  18154. else {
  18155. ganStr = "gan_80";
  18156. }
  18157. xGame.soundMgr.playSound(ganStr);
  18158. }
  18159. break;
  18160. case PressType.moveNode:
  18161. let rootBall = xGame.common.d2World.rootBall;
  18162. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  18163. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  18164. let isIntersect = this.judgeBallIntersect();
  18165. if (isIntersect) {
  18166. this.ui.moveNode.x = lastX;
  18167. this.ui.moveNode.y = lastY;
  18168. rootBall.gameObj.x = lastX;
  18169. rootBall.gameObj.y = lastY;
  18170. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  18171. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  18172. }
  18173. else {
  18174. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  18175. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  18176. }
  18177. this.showBallUI();
  18178. this.ui.moveNode.finger.visible = true;
  18179. xGame.common.d2World.getHelpLine();
  18180. break;
  18181. case PressType.rulerNode:
  18182. break;
  18183. case PressType.d2Root:
  18184. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  18185. if (dis <= 25) {
  18186. this.moveToClickDot(e);
  18187. }
  18188. break;
  18189. default:
  18190. break;
  18191. }
  18192. this.pressTarget = -1;
  18193. }
  18194. checkGuide() {
  18195. let guide = DataMgr.getSkillGuide();
  18196. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  18197. xGame.common.guideStep++;
  18198. xGame.common.gameUI.ui.guide2.visible = false;
  18199. xGame.common.gameUI.ui.guide3.visible = true;
  18200. }
  18201. }
  18202. finishGuide() {
  18203. let guide = DataMgr.getSkillGuide();
  18204. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  18205. xGame.common.guideStep = 10;
  18206. this.closeAllGuide();
  18207. console.log('zh: 新手引导完毕');
  18208. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  18209. }
  18210. }
  18211. closeAllGuide() {
  18212. xGame.common.gameUI.ui.guide1.visible = false;
  18213. xGame.common.gameUI.ui.guide2.visible = false;
  18214. xGame.common.gameUI.ui.guide3.visible = false;
  18215. }
  18216. updateBarInfo() {
  18217. let star = this.ui.powerNode.y;
  18218. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  18219. if (rate >= 1)
  18220. rate = 1;
  18221. if (rate <= 0)
  18222. rate = 0;
  18223. this.powerNum = Math.ceil(rate * 100);
  18224. this.ui.powerNode.value = this.powerNum;
  18225. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  18226. this.ui.colorNode.value = this.powerNum;
  18227. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  18228. this.ui.powerEft.visible = this.powerNum != 0;
  18229. this.ui.colorNode.visible = this.powerNum != 0;
  18230. this.ui.powerTxt.text = this.powerNum + "";
  18231. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  18232. }
  18233. forceCancel() {
  18234. this.ui.powerNode.value = 0;
  18235. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18236. this.ui.powerTxt.text = "";
  18237. }
  18238. checkRodMoveDir() {
  18239. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  18240. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  18241. if (tempX >= 0 && tempY <= 0) {
  18242. return this.checkDir();
  18243. }
  18244. else if (tempX < 0 && tempY < 0) {
  18245. return this.checkDir(1, -1);
  18246. }
  18247. else if (tempX < 0 && tempY > 0) {
  18248. return this.checkDir(-1, -1);
  18249. }
  18250. else {
  18251. return this.checkDir(-1, 1);
  18252. }
  18253. }
  18254. checkDir(flagX = 1, flagY = 1) {
  18255. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  18256. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  18257. if (offsetY == 0) {
  18258. return offsetX * flagX;
  18259. }
  18260. if (offsetX == 0) {
  18261. return offsetY * flagY;
  18262. }
  18263. let angle = offsetY / offsetX;
  18264. if (Math.abs(angle) >= 1) {
  18265. return offsetY * flagY;
  18266. }
  18267. else {
  18268. return offsetX * flagX;
  18269. }
  18270. }
  18271. judgeBallIntersect() {
  18272. let rootBall = xGame.common.d2World.rootBall;
  18273. let ballArr = xGame.common.d2World.ballArr;
  18274. let radius = rootBall.gameObj.width / 2;
  18275. let temp;
  18276. let isIntersect = false;
  18277. for (let index = 0; index < ballArr.length; index++) {
  18278. temp = ballArr[index];
  18279. if (temp.number == rootBall.number)
  18280. continue;
  18281. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  18282. if (isIntersect) {
  18283. break;
  18284. }
  18285. }
  18286. return isIntersect;
  18287. }
  18288. hideBallUI() {
  18289. let d2Gan = xGame.common.d2World.d2Gan;
  18290. if (!d2Gan.ui.isDisposed)
  18291. d2Gan.ui.visible = false;
  18292. let d2Help = xGame.common.d2World.d2HelpLine;
  18293. if (!d2Help.ui.isDisposed)
  18294. d2Help.ui.visible = false;
  18295. let rootBall = xGame.common.d2World.rootBall;
  18296. if (!rootBall.destroyed) {
  18297. rootBall.gameObj.active = false;
  18298. }
  18299. }
  18300. showBallUI() {
  18301. let d2Gan = xGame.common.d2World.d2Gan;
  18302. if (!d2Gan.ui.isDisposed)
  18303. d2Gan.ui.visible = true;
  18304. let d2Help = xGame.common.d2World.d2HelpLine;
  18305. if (!d2Help.ui.isDisposed)
  18306. d2Help.ui.visible = true;
  18307. let rootBall = xGame.common.d2World.rootBall;
  18308. if (!rootBall.destroyed) {
  18309. rootBall.gameObj.active = true;
  18310. }
  18311. }
  18312. moveToClickDot(e) {
  18313. if (!this.isMoveRod && !xGame.common.clickedBall) {
  18314. let root = xGame.common.d2World.rootBall.gameObj;
  18315. let xx = e.stageX - xGame.common.sysOffestNum;
  18316. let yy = e.stageY;
  18317. let x = xx - root.x;
  18318. let y = yy - root.y;
  18319. let angle = xGame.common.getfguiRotation(x, y);
  18320. xGame.common.d2World.d2Gan.ui.rotation = angle;
  18321. xGame.common.d2World.getHelpLine();
  18322. }
  18323. this.isMoveRod = false;
  18324. xGame.common.clickedBall = false;
  18325. }
  18326. openAllEvent() {
  18327. this.closeAllEvent();
  18328. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18329. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18330. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18331. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18332. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18333. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18334. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18335. }
  18336. closeAllEvent() {
  18337. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18338. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18339. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18340. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18341. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18342. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18343. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18344. }
  18345. resetGame() {
  18346. this.closeAllEvent();
  18347. this.hideBallUI();
  18348. xGame.common.gameMgr.gamePause = true;
  18349. }
  18350. }
  18351. UIGame$1.uiName = "UIGame";
  18352. class UIAddCoin$1 extends UIBase {
  18353. constructor() {
  18354. super();
  18355. this.coinNum = 2000;
  18356. }
  18357. onConstructor() {
  18358. this.ui = ui_UIAddCoin.createInstance();
  18359. this.contentPane = this.ui;
  18360. this.isEject = false;
  18361. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18362. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  18363. }
  18364. show() {
  18365. super.show();
  18366. this.ui.t0.play();
  18367. }
  18368. videoAddCoin() {
  18369. console.log('zh:qjff_AD_for_UIAddCoin');
  18370. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  18371. }
  18372. else {
  18373. console.log('zh:AD 失败,直接发放奖励');
  18374. this.qjff_AD_for_UIAddCoin();
  18375. }
  18376. }
  18377. qjff_AD_for_UIAddCoin() {
  18378. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  18379. this.hide();
  18380. }
  18381. }
  18382. UIAddCoin$1.uiName = "UIAddCoin";
  18383. class UIInvitation$1 extends UIBase {
  18384. constructor() {
  18385. super();
  18386. }
  18387. onConstructor() {
  18388. this.ui = ui_UIInvitation.createInstance();
  18389. this.contentPane = this.ui;
  18390. this.isEject = false;
  18391. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  18392. }
  18393. show() {
  18394. super.show();
  18395. }
  18396. enterGame() {
  18397. xGame.common.gameMode = GameMode.classic;
  18398. DataMgr.setChallengeTimes(1);
  18399. xGame.common.passAwardCoin = 2000;
  18400. let need = xGame.common.classicNiceNeddCoin;
  18401. if (DataMgr.coinEnough(need)) {
  18402. DataMgr.setCoin(-need);
  18403. xGame.eventMgr.event(RESTART_GAME, true);
  18404. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  18405. }
  18406. else {
  18407. xGame.eventMgr.event(RESTART_GAME, true);
  18408. }
  18409. this.hide();
  18410. }
  18411. hide() {
  18412. super.hide();
  18413. }
  18414. }
  18415. UIInvitation$1.uiName = "UIInvitation";
  18416. class UIPower$1 extends UIBase {
  18417. constructor() {
  18418. super();
  18419. }
  18420. onConstructor() {
  18421. this.ui = ui_UIPower.createInstance();
  18422. this.contentPane = this.ui;
  18423. this.isEject = false;
  18424. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18425. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  18426. }
  18427. show() {
  18428. super.show();
  18429. this.ui.t0.play();
  18430. }
  18431. videoGetPower() {
  18432. console.log('zh:qjff_AD_for_uipower');
  18433. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  18434. }
  18435. else {
  18436. console.log('zh:AD 失败,直接发放奖励');
  18437. this.qjff_AD_for_uipower();
  18438. }
  18439. }
  18440. qjff_AD_for_uipower() {
  18441. DataMgr.setPower(xGame.common.videoPower, true);
  18442. xGame.eventMgr.event(POWER_TIME);
  18443. this.hide();
  18444. }
  18445. }
  18446. UIPower$1.uiName = "UIPower";
  18447. class UIGameEnd$1 extends UIBase {
  18448. constructor() {
  18449. super();
  18450. this.success = false;
  18451. this.awardCoinNum = 1000;
  18452. this.awardDiamondNum = 10;
  18453. }
  18454. onConstructor() {
  18455. this.ui = ui_UIGameEnd.createInstance();
  18456. this.contentPane = this.ui;
  18457. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  18458. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  18459. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  18460. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18461. this.ui.talkNode.visible = false;
  18462. if (Moyu.isKs)
  18463. this.ui.closeNode.closeBtn.x += 100;
  18464. }
  18465. updateType() {
  18466. switch (xGame.common.gameMode) {
  18467. case GameMode.classic:
  18468. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18469. this.ui.coinNode.visible = this.success;
  18470. if (!this.success) {
  18471. Laya.timer.once(500, this, () => {
  18472. xGame.uiMgr.Show(UIAddCoin$1);
  18473. });
  18474. }
  18475. this.ui.isGetAward.visible = false;
  18476. this.ui.leftBtn.c1.selectedIndex = 3;
  18477. this.ui.rightBtn.c1.selectedIndex = 0;
  18478. this.moneyNode.ui.c1.selectedIndex = 1;
  18479. break;
  18480. case GameMode.bigMove:
  18481. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18482. this.ui.coinNode.visible = this.success;
  18483. if (xGame.common.gameMode == GameMode.bigMove) {
  18484. if (this.success) {
  18485. DataMgr.setSkillSuccessTimes(1, true);
  18486. DataMgr.setSkillAccTimes(1);
  18487. }
  18488. else {
  18489. DataMgr.setSkillSuccessTimes(0, false);
  18490. }
  18491. }
  18492. if (!this.success) {
  18493. Laya.timer.once(500, this, () => {
  18494. xGame.uiMgr.Show(UIAddCoin$1);
  18495. });
  18496. }
  18497. this.ui.isGetAward.visible = false;
  18498. this.ui.leftBtn.c1.selectedIndex = 3;
  18499. this.ui.rightBtn.c1.selectedIndex = 0;
  18500. this.moneyNode.ui.c1.selectedIndex = 1;
  18501. break;
  18502. case GameMode.placeBall:
  18503. this.ui.coinNode.visible = false;
  18504. if (this.success) {
  18505. if (xGame.common.placeBallStarNum == 3) {
  18506. this.ui.c1.selectedIndex = 2;
  18507. }
  18508. else {
  18509. this.ui.c1.selectedIndex = 3;
  18510. }
  18511. }
  18512. else {
  18513. this.ui.c1.selectedIndex = 4;
  18514. }
  18515. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18516. if (cfg.type == PlaceBallType.challenge) {
  18517. this.ui.c1.selectedIndex = 2;
  18518. }
  18519. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  18520. this.updatePlaceBallBtn();
  18521. this.updatePlaceBallStarNum();
  18522. this.updatePlaceBallAwardState();
  18523. this.moneyNode.ui.c1.selectedIndex = 2;
  18524. this.moneyNode.checkPowerTime();
  18525. this.moneyNode.powerChange();
  18526. DataMgr.upRankData();
  18527. break;
  18528. default:
  18529. break;
  18530. }
  18531. }
  18532. updatePlaceBallBtn() {
  18533. this.ui.leftBtn.c1.selectedIndex = 5;
  18534. if (this.success) {
  18535. this.ui.rightBtn.c1.selectedIndex = 14;
  18536. }
  18537. else {
  18538. if (xGame.common.placeBallStarNum == 3) {
  18539. this.ui.rightBtn.c1.selectedIndex = 14;
  18540. }
  18541. else {
  18542. this.ui.rightBtn.c1.selectedIndex = 1;
  18543. }
  18544. }
  18545. }
  18546. updatePlaceBallStarNum() {
  18547. let starNum = xGame.common.placeBallStarNum;
  18548. if (starNum == 0)
  18549. this.ui.starNumNode.c1.selectedIndex = 3;
  18550. else {
  18551. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18552. }
  18553. }
  18554. updatePlaceBallAwardState() {
  18555. let level = xGame.common.placeBallCurLevel;
  18556. let starNum = xGame.common.placeBallStarNum;
  18557. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18558. let data = cfgTable.placeballData[level].award;
  18559. let cfg = cfgTable.placeballData[level];
  18560. this.awardDiamondNum = data[1];
  18561. this.awardCoinNum = data[0];
  18562. if (cfg.type == PlaceBallType.challenge) {
  18563. this.awardDiamondNum = 0;
  18564. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18565. }
  18566. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18567. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18568. if (cfg.type == PlaceBallType.challenge) {
  18569. this.ui.awardNode.coinNode.visible = true;
  18570. }
  18571. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18572. this.ui.awardNode.diamondNode.x = 265;
  18573. this.ui.awardNode.coinNode.x = 354;
  18574. }
  18575. else {
  18576. this.ui.awardNode.diamondNode.x = 291;
  18577. this.ui.awardNode.coinNode.x = 291;
  18578. }
  18579. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18580. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18581. if (this.awardCoinNum == 0) {
  18582. this.ui.awardNode.coinNode.numTxt.text = "";
  18583. }
  18584. if (getAward) {
  18585. this.ui.isGetAward.visible = true;
  18586. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18587. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18588. }
  18589. else {
  18590. this.ui.isGetAward.visible = false;
  18591. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18592. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18593. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18594. }
  18595. else {
  18596. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18597. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18598. }
  18599. }
  18600. }
  18601. show(success) {
  18602. super.show();
  18603. xGame.eventMgr.event(RESET_GAME);
  18604. this.success = success;
  18605. Laya.timer.clearAll(this);
  18606. this.playSecretaryAni();
  18607. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18608. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18609. offsetTime = Math.floor(offsetTime / 1000);
  18610. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18611. this.updateType();
  18612. Laya.timer.once(200, this, () => {
  18613. this.addAward(() => {
  18614. this.updateType();
  18615. Laya.timer.once(500, this, () => {
  18616. this.showChallengeLevel();
  18617. });
  18618. });
  18619. });
  18620. if (this.success) {
  18621. JSBridgeUtils.instance.showInternAd('gameend_success');
  18622. console.log('zh:game end 成功');
  18623. xGame.soundMgr.playSound('slots_roll01');
  18624. xGame.soundMgr.playSound("s_win");
  18625. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18626. this.diyGameDataUtilForGameWin();
  18627. }
  18628. else {
  18629. JSBridgeUtils.instance.showInternAd('gameend_faill');
  18630. console.log('zh:game end失败');
  18631. xGame.soundMgr.playSound('matchwin01');
  18632. xGame.soundMgr.playSound("s_lose");
  18633. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18634. }
  18635. let challengeNum = DataMgr.getChallengeTimes();
  18636. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18637. DataMgr.setChallengeTimes(1);
  18638. }
  18639. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18640. DataMgr.setClassicTimes();
  18641. }
  18642. }
  18643. diyGameDataUtilForGameWin() {
  18644. console.log('zh: DiyGameDataUtilForGameWin diy ');
  18645. switch (xGame.common.gameMode) {
  18646. case GameMode.classic:
  18647. console.log('zh:DiyGameDataUtilForGameWin 111');
  18648. case GameMode.bigMove:
  18649. console.log('zh:DiyGameDataUtilForGameWin 222');
  18650. this.restartGame();
  18651. break;
  18652. case GameMode.placeBall:
  18653. console.log('zh:DiyGameDataUtilForGameWin 333');
  18654. var level = xGame.common.placeBallCurLevel;
  18655. console.log('zh:练习模式 联系了多少LEV=' + level);
  18656. let db_over_lev = DataMgr.getChallengeMode_overLev();
  18657. if (level > db_over_lev) {
  18658. DataMgr.setChallengeMode_overLev(level);
  18659. }
  18660. break;
  18661. default:
  18662. console.log('zh:DiyGameDataUtilForGameWin 444');
  18663. break;
  18664. }
  18665. }
  18666. showChallengeLevel() {
  18667. if (DataMgr.getChallengeTimes() != 0)
  18668. return;
  18669. let skill = DataMgr.getSkillAccTimes();
  18670. let put = DataMgr.getPlaceBallLevelList().length;
  18671. if (skill >= 3 || put >= 5) {
  18672. xGame.uiMgr.Show(UIInvitation$1);
  18673. this.hide();
  18674. }
  18675. }
  18676. addAward(callback) {
  18677. if (!this.success) {
  18678. callback && callback();
  18679. return;
  18680. }
  18681. switch (xGame.common.gameMode) {
  18682. case GameMode.classic:
  18683. this.awardCoinNum = xGame.common.passAwardCoin;
  18684. this.awardDiamondNum = 0;
  18685. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18686. break;
  18687. case GameMode.bigMove:
  18688. this.awardCoinNum = xGame.common.passAwardCoin;
  18689. this.awardDiamondNum = 0;
  18690. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18691. callback && callback();
  18692. break;
  18693. case GameMode.placeBall:
  18694. let level = xGame.common.placeBallCurLevel;
  18695. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18696. if (xGame.common.placeBallStarNum != 3) {
  18697. callback && callback();
  18698. return;
  18699. }
  18700. else {
  18701. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18702. if (getAward) {
  18703. callback && callback();
  18704. return;
  18705. }
  18706. }
  18707. let cfg = cfgTable.placeballData[level];
  18708. let data = cfgTable.placeballData[level].award;
  18709. this.awardCoinNum = data[0];
  18710. this.awardDiamondNum = data[1];
  18711. if (cfg.type == PlaceBallType.challenge) {
  18712. this.awardDiamondNum = 0;
  18713. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18714. }
  18715. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18716. let diamondAward;
  18717. if (this.awardDiamondNum > 0) {
  18718. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18719. xGame.common.getAward([diamondAward, coinAward], callback);
  18720. }
  18721. else {
  18722. xGame.common.getAward([coinAward], callback);
  18723. }
  18724. if (cfg.type == PlaceBallType.normal) {
  18725. DataMgr.setPlaceBallAward(level);
  18726. }
  18727. break;
  18728. default:
  18729. break;
  18730. }
  18731. }
  18732. playSecretaryAni_old() {
  18733. let parent = this.ui.secretary.displayObject;
  18734. parent.destroyChildren();
  18735. let xx = this.ui.secretary.width / 2;
  18736. let yy = this.ui.secretary.height;
  18737. let scale = xGame.common.getSecretaryScale();
  18738. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18739. if (this.success) {
  18740. let rand = Math.random() <= 0.5 ? 2 : 3;
  18741. xGame.common.secretary.play(data, rand, false, parent, () => {
  18742. xGame.common.secretary.play(data, 1, true, parent);
  18743. });
  18744. }
  18745. else {
  18746. xGame.common.secretary.play(data, 0, true, parent);
  18747. }
  18748. }
  18749. playSecretaryAni() {
  18750. let parent = this.ui.secretary.displayObject;
  18751. parent.destroyChildren();
  18752. let xx = this.ui.secretary.width / 2;
  18753. let yy = this.ui.secretary.height;
  18754. let scale = xGame.common.getSecretaryScale();
  18755. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18756. if (this.success) {
  18757. let rand = 0;
  18758. xGame.common.secretary.play(data, 0, true, parent);
  18759. }
  18760. else {
  18761. xGame.common.secretary.play(data, 0, true, parent);
  18762. }
  18763. }
  18764. restartGame() {
  18765. switch (xGame.common.gameMode) {
  18766. case GameMode.classic:
  18767. xGame.eventMgr.event(RESTART_GAME);
  18768. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18769. break;
  18770. case GameMode.bigMove:
  18771. this.hide();
  18772. xGame.eventMgr.event(RESTART_GAME);
  18773. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18774. break;
  18775. default:
  18776. break;
  18777. }
  18778. }
  18779. hide() {
  18780. super.hide();
  18781. xGame.common.stopGirlPop(this.ui.talkNode);
  18782. PlatMgr.showBanner(false);
  18783. }
  18784. returnHome() {
  18785. this.hide();
  18786. let showFailWords = !this.success;
  18787. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18788. }
  18789. clickLeftBtn() {
  18790. switch (xGame.common.gameMode) {
  18791. case GameMode.classic:
  18792. case GameMode.bigMove:
  18793. this.returnHome();
  18794. break;
  18795. case GameMode.placeBall:
  18796. let level = xGame.common.placeBallCurLevel;
  18797. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18798. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18799. break;
  18800. default:
  18801. break;
  18802. }
  18803. }
  18804. powerStartPlaceBallLevel(level, btn) {
  18805. if (DataMgr.powerEnough()) {
  18806. btn.touchable = false;
  18807. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18808. btn.touchable = true;
  18809. DataMgr.setPower(-1);
  18810. xGame.eventMgr.event(POWER_TIME);
  18811. this.startPlaceBallLevel(level);
  18812. }));
  18813. }
  18814. else {
  18815. xGame.uiMgr.Show(UIPower$1, 0);
  18816. }
  18817. }
  18818. clickRightBtn() {
  18819. switch (xGame.common.gameMode) {
  18820. case GameMode.classic:
  18821. console.log('zh:clickRightBtn 111');
  18822. case GameMode.bigMove:
  18823. console.log('zh:clickRightBtn 222');
  18824. this.restartGame();
  18825. break;
  18826. case GameMode.placeBall:
  18827. console.log('zh:clickRightBtn 333');
  18828. let level = xGame.common.placeBallCurLevel;
  18829. let data = DataMgr.getPlaceBallLevel(level);
  18830. let curPss = data.play && !data.isCur;
  18831. if (curPss) {
  18832. console.log('zh:clickRightBtn 333-111');
  18833. console.log('zh:当前LV=' + level);
  18834. if (level == 60) {
  18835. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  18836. Laya.timer.once(3000, this, () => {
  18837. this.returnHome();
  18838. });
  18839. }
  18840. else {
  18841. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18842. }
  18843. }
  18844. else {
  18845. console.log('zh:clickRightBtn 333-000');
  18846. Moyu.sendDataEvent("placeBallNextLevel");
  18847. console.log('zh:qjff_AD_for_uiGameEnd');
  18848. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  18849. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  18850. }
  18851. else {
  18852. console.log('zh:AD 失败,直接发放奖励');
  18853. this.qjff_AD_for_uiGameEnd(level);
  18854. }
  18855. }
  18856. break;
  18857. default:
  18858. console.log('zh:clickRightBtn 444');
  18859. break;
  18860. }
  18861. }
  18862. qjff_AD_for_uiGameEnd(level) {
  18863. DataMgr.setPlaceBallLevel(level, 1);
  18864. this.startPlaceBallLevel(level + 1);
  18865. }
  18866. startPlaceBallLevel(level) {
  18867. xGame.common.gameMode = GameMode.placeBall;
  18868. xGame.common.placeBallCurLevel = level;
  18869. xGame.uiMgr.Show(UIGame$1);
  18870. this.hide();
  18871. }
  18872. }
  18873. UIGameEnd$1.uiName = "UIGameEnd";
  18874. class ShowItem$1 {
  18875. constructor() {
  18876. this.ui = ui_ShowItem.createInstance();
  18877. }
  18878. destroySelf() {
  18879. if (!this.ui.isDisposed) {
  18880. this.ui.removeFromParent();
  18881. this.ui.dispose();
  18882. }
  18883. }
  18884. setParent(parent) {
  18885. parent.addChild(this.ui);
  18886. }
  18887. setPos(x, y) {
  18888. this.ui.x = x;
  18889. this.ui.y = y;
  18890. }
  18891. setUrl(index) {
  18892. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18893. }
  18894. }
  18895. class UILevelProp$1 extends UIBase {
  18896. constructor() {
  18897. super();
  18898. this.firstPos = 385;
  18899. this.secondPos = 467;
  18900. this.showItemArr = [];
  18901. }
  18902. onFontLoaded() {
  18903. try {
  18904. this.ui.myNode.conditionTxt.font = "arial";
  18905. console.log("zh: onFontLoaded 设置arial字体成功");
  18906. }
  18907. catch (error) {
  18908. console.log("zh: constructor onFontLoaded加载arial字体失败");
  18909. }
  18910. }
  18911. onConstructor() {
  18912. this.ui = ui_UILevelProp.createInstance();
  18913. this.contentPane = this.ui;
  18914. this.isEject = false;
  18915. this.addUIClick(this.ui.closeBtn, this.hide);
  18916. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18917. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18918. }
  18919. show(level) {
  18920. super.show();
  18921. this.ui.t1.play();
  18922. this.level = level;
  18923. this.data = cfgTable.placeballData[this.level];
  18924. this.updateSelf();
  18925. this.showPreView();
  18926. this.moneyNode.ui.c1.selectedIndex = 2;
  18927. this.moneyNode.checkPowerTime();
  18928. this.moneyNode.powerChange();
  18929. }
  18930. showPreView() {
  18931. let item;
  18932. let data;
  18933. for (let index = 0; index < this.showItemArr.length; index++) {
  18934. item = this.showItemArr[index];
  18935. item.destroySelf();
  18936. }
  18937. this.showItemArr = [];
  18938. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18939. for (const key in cfgData) {
  18940. data = cfgData[key];
  18941. item = new ShowItem$1();
  18942. item.setParent(this.ui.myNode.displayRoot);
  18943. item.setPos(data.x, data.y);
  18944. item.setUrl(data.value);
  18945. this.showItemArr.push(item);
  18946. }
  18947. }
  18948. updateSelf() {
  18949. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18950. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18951. if (this.data.ball == -1) {
  18952. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18953. }
  18954. else {
  18955. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  18956. }
  18957. let localData = DataMgr.getPlaceBallLevel(this.level);
  18958. let getAward = localData.getAward;
  18959. let cfg = cfgTable.placeballData[this.level];
  18960. let coin = this.data.award[0];
  18961. let diamond = this.data.award[1];
  18962. if (cfg.type == PlaceBallType.challenge) {
  18963. diamond = 0;
  18964. coin = 100;
  18965. }
  18966. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18967. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18968. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18969. if (cfg.type == PlaceBallType.challenge) {
  18970. this.ui.myNode.coinNode.numTxt.text = "";
  18971. }
  18972. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18973. if (coin > 0 && diamond > 0) {
  18974. this.ui.myNode.diamondNode.x = 385;
  18975. this.ui.myNode.coinNode.x = 467;
  18976. }
  18977. else {
  18978. this.ui.myNode.diamondNode.x = 385;
  18979. this.ui.myNode.coinNode.x = 385;
  18980. }
  18981. if (!getAward) {
  18982. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18983. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18984. }
  18985. else {
  18986. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18987. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18988. }
  18989. }
  18990. startGame() {
  18991. if (DataMgr.powerEnough()) {
  18992. this.ui.myNode.startBtn.touchable = false;
  18993. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18994. console.log('zh:startGame ');
  18995. this.ui.myNode.startBtn.touchable = true;
  18996. DataMgr.setPower(-1);
  18997. xGame.eventMgr.event(POWER_TIME);
  18998. xGame.common.gameMode = GameMode.placeBall;
  18999. xGame.common.placeBallCurLevel = this.level;
  19000. xGame.uiMgr.Show(UIGame$1);
  19001. xGame.uiMgr.Hide(UILevelDisplay$1);
  19002. xGame.uiMgr.Hide(UIMain$1);
  19003. this.hide();
  19004. }));
  19005. }
  19006. else {
  19007. console.log('zh:startGame no power');
  19008. xGame.uiMgr.Show(UIPower$1);
  19009. }
  19010. }
  19011. hide() {
  19012. super.hide();
  19013. }
  19014. }
  19015. UILevelProp$1.uiName = "UILevelProp";
  19016. class PutBallLevelDisplay$1 {
  19017. constructor(ui, index) {
  19018. this.index = 0;
  19019. this.ui = ui;
  19020. this.index = index;
  19021. this.ui.onClick(this, this.clickSelf);
  19022. this.updateSelf();
  19023. this.ui.levelTxt.text = (this.index + 1) + "";
  19024. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  19025. this.ui.special.levelTxt.text = (this.index + 1) + "";
  19026. }
  19027. updateSelf() {
  19028. let level = this.index + 1;
  19029. this.data = DataMgr.getPlaceBallLevel(level);
  19030. this.ui.starNode.c1.selectedIndex = this.data.star;
  19031. let isChallenge = cfgTable.placeballData[level].type;
  19032. if (this.data.isCur) {
  19033. if (isChallenge) {
  19034. this.ui.c1.selectedIndex = 5;
  19035. }
  19036. else {
  19037. this.ui.c1.selectedIndex = 2;
  19038. }
  19039. }
  19040. else {
  19041. if (this.data.play) {
  19042. if (this.data.star == 3) {
  19043. this.ui.c1.selectedIndex = 0;
  19044. }
  19045. else {
  19046. this.ui.c1.selectedIndex = 1;
  19047. }
  19048. }
  19049. else {
  19050. if (isChallenge) {
  19051. this.ui.c1.selectedIndex = 4;
  19052. }
  19053. else {
  19054. this.ui.c1.selectedIndex = 3;
  19055. }
  19056. }
  19057. }
  19058. }
  19059. clickSelf() {
  19060. if (!this.data.play)
  19061. return;
  19062. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19063. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  19064. }
  19065. }
  19066. class UILevelDisplay$1 extends UIBase {
  19067. constructor() {
  19068. super();
  19069. }
  19070. onConstructor() {
  19071. this.ui = ui_UILevelDisplay.createInstance();
  19072. this.contentPane = this.ui;
  19073. this.isEject = false;
  19074. this.myList = this.ui.myNode.myList;
  19075. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  19076. this.levelItemArr = [];
  19077. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  19078. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  19079. this.myList.numItems = levelNum;
  19080. if (Moyu.isKs)
  19081. this.ui.closeNode.closeBtn.x += 100;
  19082. }
  19083. levelItemRender(index, target) {
  19084. let item = new PutBallLevelDisplay$1(target, index);
  19085. this.levelItemArr.push(item);
  19086. }
  19087. show() {
  19088. super.show();
  19089. this.updateLevel();
  19090. this.scrollToPlace();
  19091. }
  19092. updateLevel() {
  19093. let temp;
  19094. for (let index = 0; index < this.levelItemArr.length; index++) {
  19095. temp = this.levelItemArr[index];
  19096. temp.updateSelf();
  19097. }
  19098. }
  19099. scrollToPlace() {
  19100. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  19101. let passArr = DataMgr.getPlaceBallLevelList();
  19102. let offest = passArr.length;
  19103. if (offest >= maxNum - 1)
  19104. offest = maxNum - 1;
  19105. this.myList.scrollToView(offest, true, true);
  19106. }
  19107. hide() {
  19108. super.hide();
  19109. }
  19110. }
  19111. UILevelDisplay$1.uiName = "UILevelDisplay";
  19112. class UIMatching$1 extends UIBase {
  19113. constructor() {
  19114. super();
  19115. }
  19116. onConstructor() {
  19117. this.ui = ui_UIMatching.createInstance();
  19118. this.contentPane = this.ui;
  19119. this.isEject = false;
  19120. }
  19121. show(callback) {
  19122. super.show();
  19123. PlatMgr.showBanner(true);
  19124. this.callback = callback;
  19125. let user = Moyu.getUserInfo();
  19126. if (!this.selfPot) {
  19127. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  19128. }
  19129. if (!this.aiPot) {
  19130. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  19131. }
  19132. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  19133. this.ui.selfHead.nameTxt.text = user.nickName;
  19134. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  19135. this.ui.aiHead.nameTxt.text = "???";
  19136. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  19137. this.ui.selfHead.c1.selectedIndex = 0;
  19138. this.ui.aiHead.c1.selectedIndex = 0;
  19139. this.ui.selfHead.x = this.selfPot.x;
  19140. this.ui.selfHead.y = this.selfPot.y;
  19141. this.ui.aiHead.x = this.aiPot.x;
  19142. this.ui.aiHead.y = this.aiPot.y;
  19143. switch (xGame.common.gameMode) {
  19144. case GameMode.classic:
  19145. break;
  19146. case GameMode.bigMove:
  19147. this.initSkillData();
  19148. break;
  19149. default:
  19150. break;
  19151. }
  19152. this.ui.t1.play(Laya.Handler.create(this, () => {
  19153. this.ui.t2.play(Laya.Handler.create(this, () => {
  19154. switch (xGame.common.gameMode) {
  19155. case GameMode.classic:
  19156. this.waitingPeople();
  19157. break;
  19158. case GameMode.bigMove:
  19159. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  19160. break;
  19161. default:
  19162. break;
  19163. }
  19164. }));
  19165. }));
  19166. }
  19167. initSkillData() {
  19168. this.skillSelectData = [];
  19169. let skillUrl = xGame.common.skillIconList;
  19170. let skillName = xGame.common.skillNameList;
  19171. let skillLevel = DataMgr.getBigSkillList();
  19172. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  19173. for (let index = 0; index < 5; index++) {
  19174. let obj = {};
  19175. obj.skillImg = skillUrl[index];
  19176. obj.skillName = skillName[index];
  19177. obj.skillType = skillType[index];
  19178. obj.skillLevel = skillLevel[index];
  19179. this.skillSelectData.push(obj);
  19180. }
  19181. }
  19182. getAISkillLevel(myLevel) {
  19183. let video = xGame.common.upSkillLevel;
  19184. let aiLevel;
  19185. let temp;
  19186. if (video) {
  19187. temp = xGame.common.randomNum(-2, -1);
  19188. }
  19189. else {
  19190. if (myLevel <= 5) {
  19191. temp = xGame.common.randomNum(1, 3);
  19192. }
  19193. else if (myLevel <= 9) {
  19194. temp = xGame.common.randomNum(-2, 1);
  19195. }
  19196. else {
  19197. temp = xGame.common.randomNum(-4, 0);
  19198. }
  19199. }
  19200. aiLevel = temp + myLevel;
  19201. if (aiLevel <= 1)
  19202. aiLevel = 1;
  19203. if (aiLevel >= 10)
  19204. aiLevel = 10;
  19205. return aiLevel;
  19206. }
  19207. getAISkillType() {
  19208. return xGame.common.randomNum(1, 4);
  19209. let successTimes = DataMgr.getSkillSuccessTimes();
  19210. let info = cfgTable.aiskillData[successTimes];
  19211. if (!info) {
  19212. let max = Object.keys(cfgTable.aiskillData).length - 1;
  19213. info = cfgTable.aiskillData[max];
  19214. }
  19215. let dataArr = info.skillselect;
  19216. let myCfg = {};
  19217. for (let index = 0; index < dataArr.length; index++) {
  19218. let temp = dataArr[index].split('-');
  19219. myCfg[temp[0]] = {};
  19220. myCfg[temp[0]].id = parseInt(temp[0]);
  19221. myCfg[temp[0]].weight = parseInt(temp[1]);
  19222. }
  19223. let aiCfg = xGame.common.initWeight(myCfg);
  19224. let curData = xGame.common.getRandomWeightData(aiCfg);
  19225. return parseInt(curData.id);
  19226. }
  19227. getAISkillData(index) {
  19228. let myLevel = this.skillSelectData[index].skillLevel;
  19229. let aiLevel = this.getAISkillLevel(myLevel);
  19230. let aiType = this.getAISkillType() - 1;
  19231. return { aiLevel, aiType } = { aiLevel, aiType };
  19232. }
  19233. skillSelectFinish(index) {
  19234. let aiInfo = this.getAISkillData(index);
  19235. xGame.common.gameMgr.selfCurSkill = index;
  19236. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  19237. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  19238. this.ui.selfHead.c1.selectedIndex = 1;
  19239. this.ui.aiHead.c1.selectedIndex = 1;
  19240. let myData = this.skillSelectData[index];
  19241. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  19242. let guide = DataMgr.getSkillGuide();
  19243. if (guide == 0) {
  19244. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  19245. }
  19246. else {
  19247. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  19248. }
  19249. let aiData = this.skillSelectData[aiInfo.aiType];
  19250. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  19251. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  19252. this.waitingPeople();
  19253. }
  19254. waitingPeople() {
  19255. let time = xGame.common.randomNum(1000, 3000);
  19256. time += 1000;
  19257. Laya.timer.once(time, this, () => {
  19258. this.matchingSuccess();
  19259. });
  19260. }
  19261. matchingSuccess() {
  19262. let gameUI = xGame.common.gameUI;
  19263. let name = gameUI.ui.topNode.aiNameTxt.text;
  19264. let url = gameUI.ui.topNode.aiHeadLoader.url;
  19265. this.ui.aiHead.nameTxt.text = name;
  19266. this.ui.aiHead.headImg.url = url;
  19267. name = gameUI.ui.topNode.selfNameTxt.text;
  19268. url = gameUI.ui.topNode.selfHeadLoader.url;
  19269. this.ui.selfHead.nameTxt.text = name;
  19270. this.ui.selfHead.headImg.url = url;
  19271. this.ui.t3.play(Laya.Handler.create(this, () => {
  19272. this.callback && this.callback();
  19273. this.ui.t4.play(Laya.Handler.create(this, () => {
  19274. this.destroySelf();
  19275. }));
  19276. }));
  19277. }
  19278. destroySelf() {
  19279. this.callback = null;
  19280. this.skillSelectData = null;
  19281. this.selfPot = null;
  19282. this.aiPot = null;
  19283. if (!this.ui.isDisposed) {
  19284. this.ui.removeFromParent();
  19285. this.ui.dispose();
  19286. }
  19287. xGame.uiMgr.destroyUI(this);
  19288. }
  19289. }
  19290. UIMatching$1.uiName = "UIMatching";
  19291. class SkillDisplay$1 {
  19292. constructor(ui, data, uiIndex) {
  19293. this.starX = 0;
  19294. this.starY = 0;
  19295. this.index = 0;
  19296. this.ui = ui;
  19297. this.data = data;
  19298. this.index = uiIndex;
  19299. this.initSelf();
  19300. console.log('zh:SkillDisplay constructor this.skillData=', data);
  19301. }
  19302. initSelf() {
  19303. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  19304. this.ui.nameTxt.text = this.data.name;
  19305. this.ui.describeTxt.text = this.data.describe;
  19306. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  19307. this.ui.startBtn.onClick(this, this.startGame);
  19308. this.updateSelf();
  19309. }
  19310. updateSelf() {
  19311. this.checkTry();
  19312. let level = DataMgr.getBigSkillByIndex(this.index);
  19313. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  19314. }
  19315. checkTry() {
  19316. let index = this.index;
  19317. let level = DataMgr.getBigSkillByIndex(index);
  19318. if (level == null) {
  19319. DataMgr.setBigSkill(index, 1, false);
  19320. level = 1;
  19321. }
  19322. this.ui.levelTxt.text = "LV." + level;
  19323. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  19324. this.ui.tryNode.visible = true;
  19325. else
  19326. this.ui.tryNode.visible = false;
  19327. }
  19328. clickAddLevel() {
  19329. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19330. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  19331. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  19332. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  19333. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19334. }
  19335. else {
  19336. console.log('zh:AD 失败,直接发放奖励');
  19337. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19338. }
  19339. }
  19340. qjff_AD_for_skilldisplay_clickAddLevel() {
  19341. DataMgr.setBigSkill(this.data.index, 1);
  19342. this.updateSelf();
  19343. xGame.common.upSkillLevel = true;
  19344. }
  19345. startGame() {
  19346. if (this.data.index == 3) {
  19347. alert('Coming soon!');
  19348. return;
  19349. }
  19350. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19351. let needCoin = xGame.common.bigMoveNeedCoin;
  19352. xGame.common.passAwardCoin = 2000;
  19353. let guide = DataMgr.getSkillGuide();
  19354. console.log('zh:startGame guide=' + guide);
  19355. xGame.common.temSelfLevel = 0;
  19356. if (guide == 0) {
  19357. needCoin = 0;
  19358. xGame.common.temSelfLevel = 100;
  19359. }
  19360. if (DataMgr.coinEnough(needCoin)) {
  19361. DataMgr.setCoin(-needCoin);
  19362. xGame.common.curPlayerSkillType = this.index;
  19363. if (guide == 0)
  19364. xGame.common.curPlayerSkillType = 0;
  19365. xGame.uiMgr.Show(UIGame$1);
  19366. xGame.uiMgr.Hide(UIMain$1);
  19367. xGame.uiMgr.Show(UIMatching$1, () => {
  19368. xGame.common.gameUI.ui.alpha = 1;
  19369. xGame.common.gameUI.startGame();
  19370. xGame.uiMgr.Hide(UISkill$1);
  19371. });
  19372. }
  19373. else {
  19374. xGame.uiMgr.Show(UIAddProp$1, 0);
  19375. Moyu.sendDataEvent("AddCoinVideo");
  19376. }
  19377. }
  19378. }
  19379. class UISkill$1 extends UIBase {
  19380. constructor() {
  19381. super();
  19382. this.skillData = [];
  19383. }
  19384. onConstructor() {
  19385. this.ui = ui_UISkill.createInstance();
  19386. this.contentPane = this.ui;
  19387. this.isEject = false;
  19388. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19389. this.initSkillData();
  19390. console.log('zh:aaaaaa1111111111');
  19391. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  19392. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  19393. console.log('zh:aaaaaa22222222');
  19394. this.displayList = [];
  19395. this.ui.skillNode.skillList.numItems = 3;
  19396. this.addUIClick(this.ui, this.interuptSecretary);
  19397. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  19398. this.ui.talkNode.visible = false;
  19399. if (Moyu.isKs)
  19400. this.ui.closeNode.closeBtn.x += 100;
  19401. }
  19402. show() {
  19403. super.show();
  19404. this.playSecretaryIdle();
  19405. this.moneyNode.ui.c1.selectedIndex = 1;
  19406. Laya.timer.clearAll(this);
  19407. xGame.soundMgr.playSound("s_start");
  19408. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19409. let guide = DataMgr.getSkillGuide();
  19410. this.ui.guideNode.visible = guide == 0;
  19411. let item = this.getSkillItemByUIIndex(0);
  19412. if (guide == 0) {
  19413. item.ui.c1.selectedIndex = 1;
  19414. }
  19415. else {
  19416. item.ui.c1.selectedIndex = 0;
  19417. }
  19418. this.ui.guideNode.guideBtn.visible = guide == 0;
  19419. for (let index = 0; index < this.displayList.length; index++) {
  19420. this.displayList[index].checkTry();
  19421. }
  19422. }
  19423. getSkillItemByUIIndex(cur) {
  19424. for (let index = 0; index < this.displayList.length; index++) {
  19425. if (this.displayList[index].index == cur) {
  19426. return this.displayList[index];
  19427. }
  19428. }
  19429. }
  19430. enterGuideLevel() {
  19431. let item = this.getSkillItemByUIIndex(0);
  19432. item.startGame();
  19433. if (DataMgr.getNewUser())
  19434. Moyu.sendDataEvent("gameStart1");
  19435. }
  19436. initSkillData() {
  19437. this.skillData = [];
  19438. let nameList = xGame.common.skillNameList;
  19439. let iconList = xGame.common.skillIconList;
  19440. let describeList = [
  19441. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  19442. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
  19443. "The power of frost descends—freezing the flow and taking full control of the game!"
  19444. ];
  19445. console.log('zh:initSkillData 111111111');
  19446. let data;
  19447. for (let index = 0; index < nameList.length; index++) {
  19448. data = {};
  19449. data.name = nameList[index];
  19450. data.icon = iconList[index];
  19451. data.describe = describeList[index];
  19452. data.index = index;
  19453. this.skillData.push(data);
  19454. }
  19455. }
  19456. updateSkillItem(index, target) {
  19457. if (this.displayList[index] == null) {
  19458. let uiIndex;
  19459. switch (index) {
  19460. case 0:
  19461. uiIndex = 1;
  19462. break;
  19463. case 1:
  19464. uiIndex = 0;
  19465. break;
  19466. case 2:
  19467. uiIndex = 2;
  19468. break;
  19469. case 3:
  19470. uiIndex = 3;
  19471. break;
  19472. default:
  19473. break;
  19474. }
  19475. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  19476. this.displayList.push(temp);
  19477. }
  19478. }
  19479. playSecretaryIdle() {
  19480. let parent = this.ui.secretary.displayObject;
  19481. parent.destroyChildren();
  19482. let xx = this.ui.secretary.width / 2;
  19483. let yy = this.ui.secretary.height;
  19484. let scale = xGame.common.getSecretaryScale();
  19485. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19486. xGame.common.secretary.play(data, 0, true, parent);
  19487. }
  19488. returnUIMain() {
  19489. this.hide();
  19490. xGame.common.stopGirlPop(this.ui.talkNode);
  19491. xGame.uiMgr.Show(UIMain$1);
  19492. }
  19493. interuptSecretary() {
  19494. Laya.timer.clearAll(this);
  19495. this.playSecretaryRandomSound();
  19496. }
  19497. playSecretaryRandomSound() {
  19498. if (this.isHide)
  19499. return;
  19500. let time = xGame.common.randomNum(45000, 60000);
  19501. Laya.timer.once(time, this, () => {
  19502. if (this.isHide)
  19503. return;
  19504. let index = xGame.common.randomNum(4, 7);
  19505. xGame.soundMgr.playSound("s_main0" + index);
  19506. let words = 1;
  19507. switch (index) {
  19508. case 4:
  19509. words = 5;
  19510. break;
  19511. case 5:
  19512. words = 3;
  19513. break;
  19514. case 6:
  19515. words = 6;
  19516. break;
  19517. case 7:
  19518. words = 7;
  19519. break;
  19520. default:
  19521. break;
  19522. }
  19523. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19524. this.playSecretaryRandomSound();
  19525. });
  19526. }
  19527. }
  19528. UISkill$1.uiName = "UISkill";
  19529. class UIAddProp$1 extends UIBase {
  19530. constructor() {
  19531. super();
  19532. this.curType = "";
  19533. }
  19534. onConstructor() {
  19535. this.ui = ui_UIAddProp.createInstance();
  19536. this.contentPane = this.ui;
  19537. this.isEject = false;
  19538. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19539. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  19540. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  19541. this.updateUI();
  19542. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  19543. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  19544. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  19545. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  19546. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  19547. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  19548. }
  19549. show(type) {
  19550. super.show();
  19551. this.curType = type == 0 ? "coin" : "diamond";
  19552. this.switchBtn("");
  19553. this.ui.t0.play();
  19554. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  19555. PlatMgr.showInsert(true);
  19556. }
  19557. closeSelf() {
  19558. this.hide();
  19559. }
  19560. updateUI() {
  19561. let data = cfgTable.moneyData;
  19562. let temp;
  19563. let obj;
  19564. for (const key in data) {
  19565. temp = data[key];
  19566. obj = this.ui.myNode["node" + key];
  19567. if (parseInt(key) <= 2) {
  19568. obj.diamondTxt.text = "+" + temp.num;
  19569. }
  19570. else {
  19571. obj.coinTxt.text = temp.num;
  19572. obj.diamondTxt.text = temp.get.split('_')[1];
  19573. }
  19574. }
  19575. this.updateDiamondShare();
  19576. }
  19577. updateDiamondShare() {
  19578. let data = DataMgr.getShareDiamondTimes();
  19579. if (data >= xGame.common.maxShareDiamondTimes) {
  19580. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  19581. this.ui.myNode.node1.touchable = false;
  19582. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19583. }
  19584. else {
  19585. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  19586. this.ui.myNode.node1.touchable = true;
  19587. }
  19588. }
  19589. switchBtn(type) {
  19590. if (type == "")
  19591. type = this.curType;
  19592. else {
  19593. if (this.curType == type) {
  19594. return;
  19595. }
  19596. else {
  19597. this.curType = type;
  19598. }
  19599. }
  19600. if (type == "coin") {
  19601. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  19602. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  19603. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  19604. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  19605. this.ui.myNode.c1.selectedIndex = 0;
  19606. }
  19607. else {
  19608. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  19609. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  19610. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  19611. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  19612. this.ui.myNode.c1.selectedIndex = 1;
  19613. }
  19614. }
  19615. convertCoin(index) {
  19616. let data = cfgTable.moneyData[index];
  19617. let coinNum = data.num;
  19618. let str = data.get.split('_')[1];
  19619. let needDiamond = parseInt(str);
  19620. if (DataMgr.diamondEnough(needDiamond)) {
  19621. DataMgr.setDiamond(-needDiamond);
  19622. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  19623. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  19624. }
  19625. else {
  19626. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  19627. this.switchBtn("diamond");
  19628. }
  19629. }
  19630. videoGetDiamond() {
  19631. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  19632. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  19633. }
  19634. else {
  19635. console.log('zh:AD 失败,直接发放奖励');
  19636. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  19637. }
  19638. }
  19639. qjff_AD_for_uiAddProp_videoGetDiamond() {
  19640. let num = cfgTable.moneyData[2].num;
  19641. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19642. this.closeSelf();
  19643. }
  19644. videoGetCoin() {
  19645. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  19646. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  19647. }
  19648. else {
  19649. console.log('zh:AD 失败,直接发放奖励');
  19650. this.qjff_AD_for_uiAddProp_videoGetCoin();
  19651. }
  19652. }
  19653. qjff_AD_for_uiAddProp_videoGetCoin() {
  19654. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19655. this.closeSelf();
  19656. }
  19657. shareGetDiamond() {
  19658. let times = DataMgr.getShareDiamondTimes();
  19659. if (times >= xGame.common.maxShareDiamondTimes) {
  19660. console.log('zh: 233333333333 maxShareDiamondTimes');
  19661. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19662. }
  19663. else {
  19664. console.log('zh:33333333333333ad');
  19665. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  19666. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  19667. }
  19668. else {
  19669. console.log('zh:AD 失败,直接发放奖励');
  19670. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  19671. }
  19672. }
  19673. }
  19674. qjff_AD_for_uiAddProp_shareGetDiamond() {
  19675. let diamond = xGame.common.randomNum(50, 100);
  19676. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19677. DataMgr.setShareDiamondTimes(1);
  19678. this.updateDiamondShare();
  19679. }
  19680. openPutBallView() {
  19681. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19682. let skill = xGame.uiMgr.getUI(UISkill$1);
  19683. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19684. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19685. if (end && !end.isHide) {
  19686. xGame.uiMgr.Hide(UIGameEnd$1);
  19687. xGame.uiMgr.Show(UIMain$1);
  19688. }
  19689. if (skill && !skill.isHide)
  19690. xGame.uiMgr.Hide(UISkill$1);
  19691. if (uigame && !uigame.isHide)
  19692. xGame.uiMgr.Hide(UIGame$1);
  19693. if (level && !level.isHide) {
  19694. }
  19695. else {
  19696. xGame.uiMgr.Show(UILevelDisplay$1);
  19697. }
  19698. this.closeSelf();
  19699. }
  19700. }
  19701. UIAddProp$1.uiName = "UIAddProp";
  19702. class MoneyNode$1 {
  19703. constructor(ui) {
  19704. this.leftTime = 0;
  19705. this.ui = ui;
  19706. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19707. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19708. this.ui.addPowerBtn.onClick(this, this.addPower);
  19709. this.ui.c1.selectedIndex = 1;
  19710. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19711. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19712. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19713. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19714. this.coinChange();
  19715. this.diamondChange();
  19716. this.powerChange();
  19717. }
  19718. addPower() {
  19719. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19720. xGame.uiMgr.Show(UIPower$1);
  19721. }
  19722. powerChange() {
  19723. let powerNum = DataMgr.getPower();
  19724. this.ui.powerTxt.text = powerNum + "";
  19725. }
  19726. checkPowerTime() {
  19727. let cur = new Date().getTime();
  19728. let last = DataMgr.getPowerTime();
  19729. if (last == 0) {
  19730. last = cur;
  19731. DataMgr.setPowerTime(cur);
  19732. }
  19733. let power = DataMgr.getPower();
  19734. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19735. Laya.timer.clearAll(this);
  19736. if (power >= xGame.common.natureMaxPower) {
  19737. this.ui.powerTimeTxt.text = "";
  19738. DataMgr.setPowerTime(cur);
  19739. return;
  19740. }
  19741. if (power + offset >= xGame.common.natureMaxPower) {
  19742. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19743. this.ui.powerTimeTxt.text = "";
  19744. DataMgr.setPowerTime(cur);
  19745. }
  19746. else {
  19747. if (offset > 0) {
  19748. DataMgr.setPower(offset);
  19749. DataMgr.setPowerTime(cur);
  19750. }
  19751. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19752. this.leftTime = xGame.common.powerRecoverNum - time;
  19753. if (this.leftTime <= 0)
  19754. this.leftTime = 0;
  19755. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19756. Laya.timer.loop(1000, this, this.updatePowerTime);
  19757. }
  19758. }
  19759. updatePowerTime() {
  19760. this.leftTime -= 1;
  19761. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19762. if (this.leftTime <= 0) {
  19763. this.checkPowerTime();
  19764. }
  19765. }
  19766. coinChange() {
  19767. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19768. }
  19769. diamondChange() {
  19770. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19771. }
  19772. addCoin() {
  19773. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19774. Moyu.sendDataEvent("AddCoinBtn");
  19775. xGame.uiMgr.Show(UIAddProp$1, 0);
  19776. }
  19777. addDiamond() {
  19778. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19779. Moyu.sendDataEvent("AddDiamondBtn");
  19780. xGame.uiMgr.Show(UIAddProp$1, 1);
  19781. }
  19782. }
  19783. class SettingNode$1 {
  19784. constructor(ui) {
  19785. this.showSetting = false;
  19786. this.openSound = true;
  19787. this.openShake = true;
  19788. this.ui = ui;
  19789. this.ui.soundBtn.onClick(this, this.switchSound);
  19790. this.ui.shakeBtn.onClick(this, this.switchShake);
  19791. this.ui.xyBtn.onClick(this, this.onXy);
  19792. this.ui.clickNode.onClick(this, this.changeSetting);
  19793. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19794. this.ui.xyBtn.visible = false;
  19795. this.ui.shakeBtn.visible = false;
  19796. }
  19797. changeSetting() {
  19798. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19799. this.showSetting = !this.showSetting;
  19800. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19801. }
  19802. switchSound() {
  19803. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19804. this.openSound = !this.openSound;
  19805. Moyu.onSetting(this.openSound, this.openShake);
  19806. xGame.soundMgr.onSetting(this.openSound);
  19807. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19808. }
  19809. switchShake() {
  19810. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19811. this.openShake = !this.openShake;
  19812. Moyu.onSetting(this.openSound, this.openShake);
  19813. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19814. }
  19815. onXy() {
  19816. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19817. MoyuMgr$1.showXy(1);
  19818. }
  19819. }
  19820. class UIDraw$1 extends UIBase {
  19821. constructor() {
  19822. super();
  19823. this.curKey = 0;
  19824. }
  19825. onConstructor() {
  19826. this.ui = ui_UIDraw.createInstance();
  19827. this.contentPane = this.ui;
  19828. this.isEject = false;
  19829. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19830. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19831. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19832. this.initDraw();
  19833. this.initUI();
  19834. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19835. if (Moyu.isKs)
  19836. this.ui.closeNode.closeBtn.x += 100;
  19837. }
  19838. show() {
  19839. super.show();
  19840. this.ui.t0.play();
  19841. this.playSecretaryIdle();
  19842. this.updateDraw();
  19843. this.checkFree();
  19844. if (PlatMgr.bannerDelay > 0) {
  19845. this.ui.closeNode.closeBtn.visible = false;
  19846. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19847. this.ui.closeNode.closeBtn.visible = true;
  19848. });
  19849. }
  19850. PlatMgr.showRateBanner();
  19851. }
  19852. hide() {
  19853. Laya.timer.clearAll(this);
  19854. super.hide();
  19855. }
  19856. checkFree() {
  19857. let isFree = DataMgr.getDailyfreeDrawTimes();
  19858. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19859. }
  19860. initDraw() {
  19861. this.drawObj = [];
  19862. let data = cfgTable.drawData;
  19863. let temp;
  19864. let weight = 0;
  19865. for (const key in data) {
  19866. temp = data[key];
  19867. weight += temp.weight;
  19868. this.drawObj.push(weight);
  19869. }
  19870. this.allWeight = weight;
  19871. }
  19872. initUI() {
  19873. let data = cfgTable.drawData;
  19874. let temp;
  19875. let img;
  19876. let txt;
  19877. for (const key in data) {
  19878. temp = data[key];
  19879. img = this.ui.myNode.rotNode["img" + key];
  19880. txt = this.ui.myNode.rotNode["txt" + key];
  19881. img.url = xGame.common.getGameIconUrl(temp.icon);
  19882. txt.visible = true;
  19883. if (temp.award > 2) {
  19884. img.rotation = 0;
  19885. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19886. }
  19887. else {
  19888. img.rotation = temp.rotation;
  19889. txt.text = temp.num;
  19890. }
  19891. }
  19892. }
  19893. getCurkey() {
  19894. let rand = Math.random() * this.allWeight;
  19895. let temp;
  19896. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19897. temp = this.drawObj[index];
  19898. if (index == 0) {
  19899. if (rand < temp) {
  19900. return index + 1;
  19901. }
  19902. }
  19903. else {
  19904. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19905. return index + 1;
  19906. }
  19907. }
  19908. }
  19909. return 2;
  19910. }
  19911. startDraw() {
  19912. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19913. if (freeTimes > 0) {
  19914. this.beginDraw();
  19915. DataMgr.setDailyfreeDrawTimes(0);
  19916. this.checkFree();
  19917. }
  19918. else {
  19919. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  19920. }
  19921. else {
  19922. console.log('zh:AD 失败,直接发放奖励');
  19923. this.qjff_chouJiang();
  19924. }
  19925. }
  19926. }
  19927. qjff_chouJiang() {
  19928. this.beginDraw();
  19929. }
  19930. beginDraw() {
  19931. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19932. this.ui.drawBtn.touchable = false;
  19933. this.curKey = this.getCurkey();
  19934. console.log("当前key", this.curKey);
  19935. let cell = 60;
  19936. let lap = 3;
  19937. let angle = cell * (this.curKey - 1) + lap * 360;
  19938. let target = this.ui.myNode.rotNode;
  19939. target.rotation = 0;
  19940. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19941. console.log("旋转完成");
  19942. this.ui.drawBtn.touchable = true;
  19943. this.getAward();
  19944. }));
  19945. }
  19946. getAward() {
  19947. let data = cfgTable.drawData[this.curKey];
  19948. let temp = new AwardType();
  19949. temp.type = data.award;
  19950. temp.num = data.num;
  19951. xGame.common.getAward([temp], () => {
  19952. DataMgr.setDrawTimes(1);
  19953. this.updateDraw();
  19954. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19955. });
  19956. }
  19957. updateDraw() {
  19958. let drawTimes = DataMgr.getDrawTimes();
  19959. let awardTimes = DataMgr.getDrawAwardTimes();
  19960. if (Math.floor(drawTimes / 3) > awardTimes) {
  19961. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19962. this.ui.extraNode.boxBtn.touchable = true;
  19963. this.ui.extraNode.tipsTxt.text = "3/3";
  19964. this.ui.extraNode.barNode.width = 265;
  19965. this.getExtraAward();
  19966. }
  19967. else {
  19968. this.ui.extraNode.boxBtn.t0.stop();
  19969. this.ui.extraNode.boxBtn.touchable = false;
  19970. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19971. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19972. }
  19973. let data = cfgTable.drawData[1];
  19974. if (awardTimes == 0) {
  19975. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19976. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19977. this.ui.myNode.rotNode.img1.rotation = 0;
  19978. }
  19979. else {
  19980. let award = data.nextid;
  19981. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19982. this.ui.myNode.rotNode.txt1.text = award[1];
  19983. this.ui.myNode.rotNode.img1.rotation = 0;
  19984. }
  19985. }
  19986. getExtraAward() {
  19987. let drawTimes = DataMgr.getDrawTimes();
  19988. let awardTimes = DataMgr.getDrawAwardTimes();
  19989. let data = cfgTable.drawData[1];
  19990. let award = new AwardType();
  19991. if (awardTimes == 0) {
  19992. award.num = data.num;
  19993. award.type = data.award;
  19994. xGame.common.getAward([award], () => {
  19995. let all = Math.floor(drawTimes / 3);
  19996. DataMgr.setDrawAwardTimes(all);
  19997. this.updateDraw();
  19998. });
  19999. }
  20000. else {
  20001. award.num = parseInt(data.nextid[1]);
  20002. award.type = parseInt(data.nextid[0]);
  20003. xGame.common.getAward([award], () => {
  20004. let all = Math.floor(drawTimes / 3);
  20005. DataMgr.setDrawAwardTimes(all);
  20006. this.updateDraw();
  20007. });
  20008. }
  20009. }
  20010. closeSelf() {
  20011. this.hide();
  20012. }
  20013. playSecretaryIdle() {
  20014. let parent = this.ui.secretary.displayObject;
  20015. parent.destroyChildren();
  20016. let xx = this.ui.secretary.width / 2;
  20017. let yy = this.ui.secretary.height;
  20018. let scale = xGame.common.getSecretaryScale();
  20019. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20020. xGame.common.secretary.play(data, 0, true, parent);
  20021. }
  20022. }
  20023. UIDraw$1.uiName = "UIDraw";
  20024. class UIRanking$1 extends UIBase {
  20025. constructor() {
  20026. super();
  20027. this.showSelf = true;
  20028. this.rankType = 1;
  20029. this.rankList = [];
  20030. this.myIndex = 0;
  20031. this.myStar = 0;
  20032. }
  20033. onConstructor() {
  20034. this.ui = ui_UIRanking.createInstance();
  20035. this.contentPane = this.ui;
  20036. this.isEject = false;
  20037. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  20038. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  20039. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  20040. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  20041. this.ui.myNode.myList.setVirtual();
  20042. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  20043. }
  20044. show() {
  20045. super.show();
  20046. this.getPaiHangBangDataFormJosnFile();
  20047. this.updateSelf();
  20048. let self = Moyu.getUserInfo();
  20049. if (!self.isAuth) {
  20050. Moyu.initUser(this, () => {
  20051. DataMgr.upRankData();
  20052. });
  20053. }
  20054. }
  20055. getPaiHangBangDataFormJosnFile() {
  20056. const rankingList = cfgTable.paiHangBangData.list;
  20057. this.updateItemData(rankingList);
  20058. }
  20059. updateSelfItem() {
  20060. console.log('zh:Moyu.platType =' + Moyu.platType);
  20061. let self = Moyu.getUserInfo();
  20062. let topX = 10;
  20063. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  20064. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > topX ? "No Rank" : this.myIndex.toString();
  20065. if (this.myIndex > topX) {
  20066. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  20067. }
  20068. else {
  20069. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  20070. }
  20071. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  20072. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  20073. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  20074. }
  20075. updateItemData(data) {
  20076. this.myStar = xGame.common.getAllStarNum();
  20077. this.myStar = 10;
  20078. this.myIndex = 3;
  20079. if (this.rankList.length < 2) {
  20080. this.rankList = data;
  20081. let self = Moyu.getUserInfo();
  20082. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  20083. console.log('zh:myself headIcon= ' + self.headIcon);
  20084. for (let i = 0; i < data.length; i++) {
  20085. let data = this.rankList[i];
  20086. if (data.userId == self.userId) {
  20087. this.rankList.splice(i, 1);
  20088. break;
  20089. }
  20090. }
  20091. for (let i = 0; i < data.length; i++) {
  20092. let data = this.rankList[i];
  20093. if (data.rankScore < this.myStar && this.myIndex > 50) {
  20094. this.myIndex = i + 1;
  20095. let user = { headIcon: self.headIcon, nickName: "myself" };
  20096. let ud = { user: user, data: {} };
  20097. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  20098. console.log('zh:Moyu.platType = ' + Moyu.platType);
  20099. if (Moyu.platType < 11) {
  20100. user.headIcon = self.headIcon;
  20101. user.nickName = self.nickName;
  20102. }
  20103. this.rankList.splice(i, 0, md);
  20104. break;
  20105. }
  20106. }
  20107. }
  20108. this.updateSelfItem();
  20109. this.ui.myNode.myList.numItems = this.rankList.length;
  20110. }
  20111. updateItemUI(index, obj) {
  20112. let data = this.rankList[index];
  20113. console.log('zh:updateItemui idex = ' + JSON.stringify(data));
  20114. let userData = JSON.parse(data.userData).user;
  20115. obj.nameTxt.text = userData.nickName.toString();
  20116. obj.valueTxt.text = data.rankScore;
  20117. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  20118. obj.rankTxt.text = index + 1;
  20119. switch (index) {
  20120. case 0:
  20121. this.setImg(obj, 1, 0, 0);
  20122. obj.rankTxt.color = "#FFC047";
  20123. break;
  20124. case 1:
  20125. this.setImg(obj, 0, 1, 0);
  20126. obj.rankTxt.color = "#ACACAC";
  20127. break;
  20128. case 2:
  20129. this.setImg(obj, 0, 0, 1);
  20130. obj.rankTxt.color = "#D09672";
  20131. break;
  20132. default:
  20133. this.setImg(obj, 0, 0, 0);
  20134. obj.rankTxt.color = "#496FAB";
  20135. break;
  20136. }
  20137. }
  20138. setImg(obj, a, b, c) {
  20139. obj.img1.visible = a ? true : false;
  20140. obj.img2.visible = b ? true : false;
  20141. obj.img3.visible = c ? true : false;
  20142. }
  20143. changeList(type) {
  20144. this.rankType = type;
  20145. this.updateSelf();
  20146. }
  20147. changeSelfNode() {
  20148. this.showSelf = !this.showSelf;
  20149. this.updateSelf();
  20150. }
  20151. updateSelf() {
  20152. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  20153. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  20154. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  20155. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  20156. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  20157. }
  20158. }
  20159. UIRanking$1.uiName = "UIRanking";
  20160. class UISecretary$1 extends UIBase {
  20161. constructor() {
  20162. super();
  20163. this.curIndex = 1;
  20164. }
  20165. onConstructor() {
  20166. this.ui = ui_UISecretary.createInstance();
  20167. this.contentPane = this.ui;
  20168. this.isEject = false;
  20169. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  20170. this.nodeObj = { left: null, right: null, cur: null };
  20171. this.nodeObj.cur = this.ui.myNode.gameNode3;
  20172. }
  20173. show() {
  20174. super.show();
  20175. this.ui.t0.play();
  20176. this.updateData();
  20177. }
  20178. addSecretarySpine(node, spineName) {
  20179. if (spineName == "mishu") {
  20180. if (this.secretarySpine1) {
  20181. node.displayObject.destroyChildren();
  20182. this.playWoman(this.secretarySpine1, node.displayObject);
  20183. }
  20184. else {
  20185. let spine1 = new SpineMgr("mishu", () => {
  20186. this.secretarySpine1 = spine1;
  20187. this.playWoman(this.secretarySpine1, node.displayObject);
  20188. });
  20189. }
  20190. }
  20191. else {
  20192. if (this.secretarySpine2) {
  20193. node.displayObject.destroyChildren();
  20194. this.playWoman(this.secretarySpine2, node.displayObject);
  20195. }
  20196. else {
  20197. let spine2 = new SpineMgr("xiaomishu2", () => {
  20198. this.secretarySpine2 = spine2;
  20199. this.playWoman(this.secretarySpine2, node.displayObject);
  20200. });
  20201. }
  20202. }
  20203. }
  20204. playWoman(node, parent) {
  20205. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  20206. let yy = this.ui.myNode.gameNode3.secretary.height;
  20207. let scale = 1.5;
  20208. if (node == this.secretarySpine2) {
  20209. scale = 1.2;
  20210. }
  20211. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20212. node.play(data, 0, true, parent);
  20213. }
  20214. turnLeft() {
  20215. this.curIndex--;
  20216. if (this.curIndex < 1) {
  20217. this.curIndex = 2;
  20218. }
  20219. let left = this.nodeObj.left;
  20220. let right = this.nodeObj.right;
  20221. let cur = this.nodeObj.cur;
  20222. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  20223. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  20224. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  20225. this.updateData();
  20226. }));
  20227. this.ui.myNode.setChildIndex(right, 2);
  20228. this.nodeObj.left = cur;
  20229. this.nodeObj.right = left;
  20230. this.nodeObj.cur = right;
  20231. }
  20232. turnRight() {
  20233. this.curIndex++;
  20234. if (this.curIndex > 2) {
  20235. this.curIndex = 1;
  20236. }
  20237. let left = this.nodeObj.left;
  20238. let right = this.nodeObj.right;
  20239. let cur = this.nodeObj.cur;
  20240. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  20241. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  20242. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  20243. this.updateData();
  20244. }));
  20245. this.ui.myNode.setChildIndex(left, 2);
  20246. this.nodeObj.left = right;
  20247. this.nodeObj.right = cur;
  20248. this.nodeObj.cur = left;
  20249. }
  20250. updateData() {
  20251. console.log('zh: updateData FFFFFFFFFF');
  20252. let data = cfgTable.secretaryshopData;
  20253. let children = this.ui.myNode._children;
  20254. let temp;
  20255. let curData;
  20256. for (let index = 0; index < children.length; index++) {
  20257. temp = children[index];
  20258. curData = data[1];
  20259. temp.heightTxt.text = curData.height;
  20260. temp.foodTxt.text = curData.food;
  20261. temp.historyTxt.text = curData.history;
  20262. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  20263. this.addSecretarySpine(temp.secretary, curData.spine);
  20264. let womanIndex = curData.id - 1;
  20265. let getWoman = DataMgr.getSecretary(womanIndex);
  20266. let curUse = DataMgr.getCurSecretary();
  20267. if (getWoman) {
  20268. if (curUse == womanIndex) {
  20269. temp.purchaseBtn.c1.selectedIndex = 1;
  20270. }
  20271. else {
  20272. temp.purchaseBtn.c1.selectedIndex = 2;
  20273. }
  20274. }
  20275. else {
  20276. temp.purchaseBtn.c1.selectedIndex = 0;
  20277. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  20278. }
  20279. temp.purchaseBtn.visible = false;
  20280. }
  20281. }
  20282. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  20283. console.log('zh: 点击了clickSecretary ');
  20284. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20285. if (getWoman) {
  20286. if (curUse != womanIndex) {
  20287. console.log();
  20288. DataMgr.setCurSecretary(womanIndex);
  20289. this.updateData();
  20290. }
  20291. }
  20292. else {
  20293. console.log('zh:点击购买了');
  20294. let need = needDiamond;
  20295. if (DataMgr.diamondEnough(need)) {
  20296. DataMgr.setDiamond(-need);
  20297. DataMgr.setSecretary(womanIndex, 1);
  20298. DataMgr.setCurSecretary(womanIndex);
  20299. this.updateData();
  20300. }
  20301. else {
  20302. xGame.uiMgr.Show(UIAddProp$1, 1);
  20303. }
  20304. }
  20305. }
  20306. closeSelf() {
  20307. this.hide();
  20308. }
  20309. }
  20310. UISecretary$1.uiName = "UISecretary";
  20311. class BallRodDisplay$1 {
  20312. constructor(ui, index) {
  20313. this.index = 0;
  20314. this.uiIndex = 0;
  20315. this.ui = ui;
  20316. this.index = index;
  20317. this.initData();
  20318. }
  20319. initData() {
  20320. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  20321. let data = cfgTable.ballrodData[this.index + 1];
  20322. this.ui.nameTxt.text = data.name;
  20323. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  20324. this.ui.levelNode.c1.selectedIndex = data.quality;
  20325. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  20326. if (data.spine) {
  20327. this.mySpine = new SpineMgr(data.spine, () => {
  20328. let xx = 150;
  20329. let yy = 70;
  20330. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  20331. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  20332. });
  20333. }
  20334. }
  20335. updateSelf() {
  20336. console.log('zh:updateSelf -------------- ');
  20337. let get = DataMgr.getBallRod(this.index);
  20338. if (get == null)
  20339. get = 1;
  20340. let curUse = DataMgr.getCurBallRod();
  20341. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20342. if (get) {
  20343. if (curUse == this.index) {
  20344. this.ui.purchaseBtn.c1.selectedIndex = 0;
  20345. }
  20346. else {
  20347. this.ui.purchaseBtn.c1.selectedIndex = 1;
  20348. }
  20349. }
  20350. else {
  20351. this.ui.purchaseBtn.c1.selectedIndex = 2;
  20352. }
  20353. }
  20354. buyBallRod() {
  20355. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20356. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  20357. switch (selectedIndex) {
  20358. case 0:
  20359. break;
  20360. case 1:
  20361. console.log('zh:点击了 USE THIS');
  20362. DataMgr.setCurBallRod(this.index);
  20363. DataMgr.setDiamond(99999);
  20364. let curUse = DataMgr.getCurBallRod();
  20365. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20366. let ui = xGame.uiMgr.getUI(UIShop$1);
  20367. ui.updateBallRod();
  20368. break;
  20369. case 2:
  20370. let data = cfgTable.ballrodData[this.index + 1];
  20371. let need = data.price;
  20372. if (DataMgr.diamondEnough(need)) {
  20373. DataMgr.setDiamond(-need);
  20374. DataMgr.setBallRod(this.index, 1);
  20375. DataMgr.setCurBallRod(this.index);
  20376. let ui = xGame.uiMgr.getUI(UIShop$1);
  20377. ui.updateBallRod();
  20378. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  20379. }
  20380. else {
  20381. xGame.uiMgr.Show(UIAddProp$1, 1);
  20382. }
  20383. break;
  20384. default:
  20385. break;
  20386. }
  20387. }
  20388. logEventForGouMaiGan(qiuGanName) {
  20389. const ev = {
  20390. value: qiuGanName
  20391. };
  20392. const jsonStr = JSON.stringify(ev);
  20393. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  20394. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  20395. }
  20396. }
  20397. class UIShop$1 extends UIBase {
  20398. constructor() {
  20399. super();
  20400. this.itemNums = 0;
  20401. }
  20402. onConstructor() {
  20403. this.ui = ui_UIShop.createInstance();
  20404. this.contentPane = this.ui;
  20405. this.isEject = false;
  20406. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20407. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20408. this.addUIClick(this.ui, this.interuptSecretary);
  20409. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  20410. this.ballRodArr = [];
  20411. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  20412. this.ui.myNode.myList.numItems = this.itemNums;
  20413. if (Moyu.isKs)
  20414. this.ui.closeNode.closeBtn.x += 100;
  20415. }
  20416. show() {
  20417. super.show();
  20418. this.playSecretaryIdle();
  20419. this.updateBallRod();
  20420. }
  20421. updateBallRod() {
  20422. for (let index = 0; index < this.ballRodArr.length; index++) {
  20423. this.ballRodArr[index].updateSelf();
  20424. }
  20425. }
  20426. renderBallRod(sort, obj) {
  20427. let index = this.getIndexBySort(sort + 1) - 1;
  20428. let ballRod = new BallRodDisplay$1(obj, index);
  20429. this.ballRodArr.push(ballRod);
  20430. }
  20431. getIndexBySort(sort) {
  20432. let object = cfgTable.ballrodData;
  20433. for (const key in object) {
  20434. if (object[key].sort == sort) {
  20435. return parseInt(key);
  20436. }
  20437. }
  20438. }
  20439. playSecretaryIdle() {
  20440. let parent = this.ui.secretary.displayObject;
  20441. parent.destroyChildren();
  20442. let xx = this.ui.secretary.width / 2;
  20443. let yy = this.ui.secretary.height;
  20444. let scale = xGame.common.getSecretaryScale();
  20445. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20446. xGame.common.secretary.play(data, 0, true, parent);
  20447. }
  20448. interuptSecretary() {
  20449. Laya.timer.clearAll(this);
  20450. this.playSecretaryRandomSound();
  20451. }
  20452. playSecretaryRandomSound() {
  20453. if (this.isHide)
  20454. return;
  20455. let time = xGame.common.randomNum(45000, 60000);
  20456. Laya.timer.once(time, this, () => {
  20457. if (this.isHide)
  20458. return;
  20459. let index = xGame.common.randomNum(4, 7);
  20460. xGame.soundMgr.playSound("s_main0" + index);
  20461. let words = 1;
  20462. switch (index) {
  20463. case 4:
  20464. words = 5;
  20465. break;
  20466. case 5:
  20467. words = 3;
  20468. break;
  20469. case 6:
  20470. words = 6;
  20471. break;
  20472. case 7:
  20473. words = 7;
  20474. break;
  20475. default:
  20476. break;
  20477. }
  20478. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20479. this.playSecretaryRandomSound();
  20480. });
  20481. }
  20482. closeSelf() {
  20483. this.hide();
  20484. }
  20485. }
  20486. UIShop$1.uiName = "UIShop";
  20487. class SignMax$1 {
  20488. constructor(ui) {
  20489. this.ui = ui;
  20490. }
  20491. updateSelf(index, sameDay, curDayIndex) {
  20492. let data = cfgTable.signData[index + 1];
  20493. this.ui.titleTxt.text = data.title;
  20494. let arr1 = data.award[0].split('-');
  20495. let arr2 = data.award[1].split('-');
  20496. let num1 = parseInt(arr1[1]);
  20497. let num2 = parseInt(arr2[1]);
  20498. this.ui.numTxt1.text = num1 + "";
  20499. this.ui.numTxt2.text = num2 + "";
  20500. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  20501. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  20502. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  20503. this.ui.numTxt1.visible = false;
  20504. }
  20505. else {
  20506. this.ui.numTxt1.visible = true;
  20507. }
  20508. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  20509. this.ui.numTxt2.visible = false;
  20510. }
  20511. else {
  20512. this.ui.numTxt2.visible = true;
  20513. }
  20514. if (index < curDayIndex) {
  20515. this.ui.c1.selectedIndex = 1;
  20516. }
  20517. else if (index == curDayIndex) {
  20518. if (sameDay) {
  20519. this.ui.c1.selectedIndex = 2;
  20520. }
  20521. else {
  20522. this.ui.c1.selectedIndex = 2;
  20523. }
  20524. }
  20525. else {
  20526. this.ui.c1.selectedIndex = 0;
  20527. }
  20528. }
  20529. }
  20530. class SignNormal$1 {
  20531. constructor(ui) {
  20532. this.ui = ui;
  20533. }
  20534. updateSelf(index, sameDay, curDayIndex) {
  20535. let data = cfgTable.signData[index + 1];
  20536. this.ui.titleTxt.text = data.title;
  20537. let arr = data.award[0].split('-');
  20538. let type = parseInt(arr[0]);
  20539. let num = parseInt(arr[1]);
  20540. this.ui.numTxt.text = num + "";
  20541. if (type > 2) {
  20542. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  20543. this.ui.myIcon.rotation = 0;
  20544. }
  20545. else {
  20546. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  20547. this.ui.myIcon.rotation = 0;
  20548. }
  20549. if (xGame.common.signAwardContainsRod(data.award)) {
  20550. this.ui.numTxt.visible = false;
  20551. }
  20552. else {
  20553. this.ui.numTxt.visible = true;
  20554. }
  20555. if (index < curDayIndex) {
  20556. this.ui.c1.selectedIndex = 1;
  20557. }
  20558. else if (index == curDayIndex) {
  20559. if (sameDay) {
  20560. this.ui.c1.selectedIndex = 2;
  20561. }
  20562. else {
  20563. this.ui.c1.selectedIndex = 2;
  20564. }
  20565. }
  20566. else {
  20567. this.ui.c1.selectedIndex = 0;
  20568. }
  20569. }
  20570. }
  20571. class UISign$1 extends UIBase {
  20572. constructor() {
  20573. super();
  20574. this.curDayIndex = 0;
  20575. this.starX = 0;
  20576. }
  20577. onConstructor() {
  20578. this.ui = ui_UISign.createInstance();
  20579. this.contentPane = this.ui;
  20580. this.isEject = false;
  20581. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20582. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20583. this.initSignItem();
  20584. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  20585. this.addUIClick(this.ui.againBtn, this.againGetAward);
  20586. }
  20587. show() {
  20588. super.show();
  20589. this.ui.t0.play();
  20590. this.playSecretaryIdle();
  20591. this.updateSign();
  20592. }
  20593. initSignItem() {
  20594. this.signArr = [];
  20595. for (let index = 0; index < 6; index++) {
  20596. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  20597. this.signArr.push(temp);
  20598. }
  20599. this.signMax = new SignMax$1(this.ui.myNode.day7);
  20600. if (Moyu.isKs)
  20601. this.ui.closeNode.closeBtn.x += 100;
  20602. }
  20603. updateSign() {
  20604. let sameDay = xGame.common.judgeSameDay();
  20605. let max = 7;
  20606. this.curDayIndex = DataMgr.getSignData();
  20607. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  20608. this.curDayIndex = 0;
  20609. if (!sameDay) {
  20610. this.ui.normalBtn.visible = true;
  20611. this.ui.tipsNode.visible = false;
  20612. this.ui.againBtn.visible = false;
  20613. }
  20614. else {
  20615. this.ui.normalBtn.visible = false;
  20616. let again = DataMgr.getExtraSign();
  20617. let isCurrency = false;
  20618. let index = this.curDayIndex;
  20619. if (index == 0)
  20620. index = 7;
  20621. let award = cfgTable.signData[index].award;
  20622. let num = award[0].split("-")[0];
  20623. if (num == "1" || num == "2")
  20624. isCurrency = true;
  20625. let showAgain = again == 0 && isCurrency;
  20626. this.ui.againBtn.visible = showAgain;
  20627. this.ui.tipsNode.visible = !showAgain;
  20628. }
  20629. for (let index = 0; index < this.signArr.length; index++) {
  20630. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  20631. }
  20632. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  20633. }
  20634. playSecretaryIdle() {
  20635. let parent = this.ui.secretary.displayObject;
  20636. parent.destroyChildren();
  20637. let xx = this.ui.secretary.width / 2;
  20638. let yy = this.ui.secretary.height;
  20639. let scale = xGame.common.getSecretaryScale();
  20640. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20641. xGame.common.secretary.play(data, 0, true, parent);
  20642. }
  20643. closeSelf() {
  20644. this.hide();
  20645. }
  20646. normalGetAward() {
  20647. let sameDay = xGame.common.judgeSameDay();
  20648. if (!sameDay) {
  20649. let award = cfgTable.signData[this.curDayIndex + 1].award;
  20650. let temp;
  20651. let type;
  20652. let num;
  20653. let arr = [];
  20654. for (let index = 0; index < award.length; index++) {
  20655. temp = award[index].split("-");
  20656. type = parseInt(temp[0]);
  20657. num = parseInt(temp[1]);
  20658. let awardType = new AwardType();
  20659. awardType.num = num;
  20660. awardType.type = type;
  20661. arr.push(awardType);
  20662. }
  20663. xGame.common.getAward(arr, (watchVideo) => {
  20664. this.curDayIndex++;
  20665. if (this.curDayIndex > 7)
  20666. this.curDayIndex = 0;
  20667. DataMgr.setSignData(this.curDayIndex);
  20668. DataMgr.setSignTime(new Date().getTime());
  20669. if (watchVideo) {
  20670. DataMgr.setExtraSign(1);
  20671. Moyu.sendDataEvent("signIn1");
  20672. }
  20673. this.updateSign();
  20674. });
  20675. }
  20676. }
  20677. againGetAward() {
  20678. Moyu.sendDataEvent("signIn2");
  20679. console.log('zh:qjff_AD_for_uisign');
  20680. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  20681. }
  20682. else {
  20683. console.log('zh:AD 失败,直接发放奖励');
  20684. this.qjff_AD_for_uisign();
  20685. }
  20686. }
  20687. qjff_AD_for_uisign() {
  20688. let index = this.curDayIndex;
  20689. if (index == 0)
  20690. index = 7;
  20691. let award = cfgTable.signData[index].award;
  20692. let temp;
  20693. let type;
  20694. let num;
  20695. for (let index = 0; index < award.length; index++) {
  20696. temp = award[index].split("-");
  20697. type = parseInt(temp[0]);
  20698. num = parseInt(temp[1]) * 3;
  20699. xGame.common.playObjFlyAnim(num, type);
  20700. }
  20701. DataMgr.setExtraSign(1);
  20702. this.updateSign();
  20703. }
  20704. }
  20705. UISign$1.uiName = "UISign";
  20706. class UIModeSelection$1 extends UIBase {
  20707. constructor() {
  20708. super();
  20709. }
  20710. onConstructor() {
  20711. this.ui = ui_UIModeSelection.createInstance();
  20712. this.contentPane = this.ui;
  20713. this.isEject = false;
  20714. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20715. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20716. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20717. this.addUIClick(this.ui.closeBtn, this.hide);
  20718. this.peopleArr = [650, 6900, 3800];
  20719. this.peopleOffest = [50, 500, 200];
  20720. this.updateSelf();
  20721. }
  20722. show(callback) {
  20723. super.show();
  20724. this.ui.t0.play();
  20725. this.callback = callback;
  20726. }
  20727. updateSelf() {
  20728. let cfg = cfgTable.modeselectData;
  20729. for (let index = 1; index <= 3; index++) {
  20730. let node = this.ui.myNode["type" + index];
  20731. node.need.text = cfg[index].need;
  20732. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20733. node.peopleTxt.text = this.getRandPeople(index - 1);
  20734. }
  20735. }
  20736. enterGame(type) {
  20737. console.log('zh: 进入经典模式 type: ' + type);
  20738. xGame.common.classicRoomType = type;
  20739. let cfg = cfgTable.modeselectData[type];
  20740. let need = cfg.need;
  20741. xGame.common.passAwardCoin = cfg.award;
  20742. if (DataMgr.coinEnough(need)) {
  20743. DataMgr.setCoin(-need);
  20744. this.ui.myNode["type" + type].t0.play();
  20745. Laya.timer.once(200, this, () => {
  20746. this.callback && this.callback();
  20747. });
  20748. }
  20749. else {
  20750. Moyu.sendDataEvent("AddCoinVideo");
  20751. xGame.uiMgr.Show(UIAddProp$1, 0);
  20752. }
  20753. }
  20754. getRandPeople(index) {
  20755. let rand = this.peopleOffest[index];
  20756. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20757. }
  20758. }
  20759. UIModeSelection$1.uiName = "UIModeSelection";
  20760. class UITry$1 extends UIBase {
  20761. constructor() {
  20762. super();
  20763. this.closeTime = 0;
  20764. this.closeNum = 0;
  20765. this.skillUrl = xGame.common.skillIconList;
  20766. }
  20767. onConstructor() {
  20768. this.ui = ui_UITry.createInstance();
  20769. this.contentPane = this.ui;
  20770. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  20771. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  20772. }
  20773. show() {
  20774. super.show();
  20775. this.closeNum = 0;
  20776. this.closeTime = 15;
  20777. this.ui.t0.play();
  20778. PlatMgr.showRateBanner();
  20779. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20780. Laya.timer.loop(1000, this, this.updateTime);
  20781. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  20782. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  20783. xGame.common.gameMgr.gamePause = true;
  20784. }
  20785. updateTime() {
  20786. if (this.closeTime > 1) {
  20787. this.closeTime--;
  20788. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20789. }
  20790. else
  20791. this.hide();
  20792. }
  20793. hide() {
  20794. Laya.timer.clearAll(this);
  20795. Moyu.showBannerAd(false);
  20796. super.hide();
  20797. xGame.common.gameMgr.gamePause = false;
  20798. }
  20799. onTry() {
  20800. console.log('zh:qjff_AD_for_uitry');
  20801. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  20802. }
  20803. else {
  20804. console.log('zh:AD 失败,直接发放奖励');
  20805. this.qjff_AD_for_uitry();
  20806. }
  20807. }
  20808. qjff_AD_for_uitry() {
  20809. let select = xGame.common.curPlayerSkillType;
  20810. DataMgr.gameData.trySkill = select;
  20811. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  20812. DataMgr.saveGameData();
  20813. DataMgr.setBigSkill(select, 1);
  20814. xGame.showTip("Trial Successful");
  20815. this.hide();
  20816. }
  20817. onCancel() {
  20818. if (this.closeNum > 0) {
  20819. this.closeNum--;
  20820. if (this.closeNum < 2)
  20821. this.hide();
  20822. return;
  20823. }
  20824. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  20825. this.onTry();
  20826. }
  20827. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  20828. this.closeNum = 3;
  20829. }
  20830. else
  20831. this.hide();
  20832. }
  20833. }
  20834. UITry$1.uiName = "UITry";
  20835. class UIGetAward$1 extends UIBase {
  20836. constructor() {
  20837. super();
  20838. this.showTriple = true;
  20839. }
  20840. onConstructor() {
  20841. this.ui = ui_UIGetAward.createInstance();
  20842. this.contentPane = this.ui;
  20843. this.isEject = false;
  20844. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  20845. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  20846. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  20847. }
  20848. show(arr, showTriple, callback) {
  20849. super.show();
  20850. this.ui.t0.play();
  20851. this.ui.eftNode.visible = true;
  20852. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  20853. this.ui.eftNode.visible = false;
  20854. }), 1, 0, 0, 0.9);
  20855. this.awardArr = arr;
  20856. this.showTriple = showTriple;
  20857. this.callback = callback;
  20858. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  20859. this.ui.myList.numItems = arr.length;
  20860. xGame.soundMgr.playSound("getaward");
  20861. }
  20862. updateSelf(index, obj) {
  20863. let temp = this.awardArr[index];
  20864. let icon = this.getIcon(temp.type);
  20865. let str = icon;
  20866. if (temp.type > 2) {
  20867. str = "s" + icon;
  20868. }
  20869. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  20870. obj.myIcon.rotation = 0;
  20871. obj.numTxt.text = temp.num + "";
  20872. obj.numTxt.visible = temp.type > 2 ? false : true;
  20873. obj.nameTxt.text = this.getNameStr(temp.type);
  20874. }
  20875. renderItem(index, obj) {
  20876. this.updateSelf(index, obj);
  20877. }
  20878. tripleGetAward() {
  20879. console.log('zh:qjff_AD_for_uigetAward');
  20880. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  20881. }
  20882. else {
  20883. console.log('zh:AD 失败,直接发放奖励');
  20884. this.qjff_AD_for_uigetAward();
  20885. }
  20886. }
  20887. qjff_AD_for_uigetAward() {
  20888. this.getAward(3);
  20889. }
  20890. normalGetAward() {
  20891. if (PlatMgr.isMisVideo())
  20892. this.tripleGetAward();
  20893. else
  20894. this.getAward();
  20895. }
  20896. getAward(times = 1) {
  20897. this.hide();
  20898. for (let index = 0; index < this.awardArr.length; index++) {
  20899. this.awardArr[index].num *= times;
  20900. }
  20901. this.callback && this.callback(times != 1);
  20902. }
  20903. getIcon(type) {
  20904. switch (type) {
  20905. case Prop.diamond:
  20906. return "ty_zs";
  20907. case Prop.coin:
  20908. return "ty_jb";
  20909. case Prop.gan1:
  20910. return "qg1";
  20911. case Prop.gan2:
  20912. return "qg2";
  20913. case Prop.gan3:
  20914. return "qg3";
  20915. case Prop.gan4:
  20916. return "qg4";
  20917. default:
  20918. break;
  20919. }
  20920. }
  20921. getNameStr(type) {
  20922. switch (type) {
  20923. case Prop.diamond:
  20924. return "Diamond";
  20925. case Prop.coin:
  20926. return "Coins";
  20927. case Prop.gan1:
  20928. case Prop.gan2:
  20929. case Prop.gan3:
  20930. case Prop.gan4:
  20931. return cfgTable.ballrodData[type - 1].name;
  20932. default:
  20933. break;
  20934. }
  20935. }
  20936. }
  20937. UIGetAward$1.uiName = "UIGetAward";
  20938. class UIBox$1 extends UIBase {
  20939. constructor() {
  20940. super();
  20941. this.boxNum = 0;
  20942. this.boxMax = 10;
  20943. this.inAd = false;
  20944. this.isClose = false;
  20945. }
  20946. onConstructor() {
  20947. this.ui = ui_UIBox.createInstance();
  20948. this.contentPane = this.ui;
  20949. this.isEject = false;
  20950. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  20951. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  20952. Laya.timer.loop(1000, this, this.update);
  20953. }
  20954. update() {
  20955. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  20956. this.boxNum -= 1;
  20957. this.upBar();
  20958. }
  20959. }
  20960. upBar() {
  20961. if (this.boxNum > this.boxMax)
  20962. this.boxNum = this.boxMax;
  20963. this.ui.bar.value = this.boxNum * 10;
  20964. }
  20965. show() {
  20966. super.show();
  20967. this.isClose = false;
  20968. this.boxNum = 0;
  20969. this.inAd = false;
  20970. this.upBar();
  20971. this.ui.t0.play();
  20972. this.ui.closeBtn.visible = false;
  20973. Laya.timer.once(3000, this, () => {
  20974. this.ui.closeBtn.visible = true;
  20975. this.ui.bar.alpha = 1;
  20976. });
  20977. Laya.timer.once(500, this, () => {
  20978. this.ui.t1.play();
  20979. });
  20980. }
  20981. hide() {
  20982. Laya.timer.clearAll(this);
  20983. Moyu.showBannerAd(false);
  20984. super.hide();
  20985. }
  20986. onOpenBox() {
  20987. this.boxNum++;
  20988. if (this.boxNum < this.boxMax) {
  20989. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  20990. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  20991. }
  20992. }
  20993. else if (this.boxNum == this.boxMax) {
  20994. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  20995. this.ui.openBtn.c1.selectedIndex = 13;
  20996. this.inAd = true;
  20997. }
  20998. else
  20999. this.getAward();
  21000. }
  21001. else if (this.inAd) {
  21002. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  21003. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  21004. }
  21005. else {
  21006. console.log('zh:AD 失败,直接发放奖励');
  21007. this.qjff_AD_for_UIBOX_onOpenBox();
  21008. }
  21009. }
  21010. this.upBar();
  21011. }
  21012. qjff_AD_for_UIBOX_onOpenBox() {
  21013. this.getAward();
  21014. }
  21015. onCloseBox() {
  21016. if (this.isClose)
  21017. this.hide();
  21018. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  21019. this.isClose = true;
  21020. PlatMgr.showBanner(true, 0, 3000);
  21021. }
  21022. else
  21023. this.hide();
  21024. }
  21025. getAward() {
  21026. let str = "";
  21027. if (Math.random() < 0.5) {
  21028. let max = Moyu.isLegal ? 500 : 2500;
  21029. let num = xGame.tools.random(max, 500 + max);
  21030. DataMgr.setCoin(num);
  21031. str = "金币x" + num;
  21032. }
  21033. else {
  21034. let max = Moyu.isLegal ? 10 : 30;
  21035. let num = xGame.tools.random(max, 30 + max);
  21036. DataMgr.setDiamond(num);
  21037. str = "钻石x" + num;
  21038. }
  21039. xGame.showTip("恭喜获得-" + str);
  21040. this.hide();
  21041. }
  21042. }
  21043. UIBox$1.uiName = "UIBox";
  21044. class UIMain$1 extends UIBase {
  21045. constructor() {
  21046. super();
  21047. this.firstEnter = true;
  21048. }
  21049. nativeCallJs(msg) {
  21050. let t = msg;
  21051. console.log("zh: nativeCallJs 奖励开始发放:", t);
  21052. switch (t) {
  21053. case 'qjff_chouJiang':
  21054. let dui = xGame.uiMgr.getUI(UIDraw$1);
  21055. dui.qjff_chouJiang();
  21056. break;
  21057. case 'qjff_AD_for_uisign':
  21058. let dui2 = xGame.uiMgr.getUI(UISign$1);
  21059. dui2.qjff_AD_for_uisign();
  21060. break;
  21061. case 'qjff_AD_for_uitry':
  21062. let dui3 = xGame.uiMgr.getUI(UITry$1);
  21063. dui3.qjff_AD_for_uitry();
  21064. break;
  21065. case 'qjff_AD_for_uipower':
  21066. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  21067. dui4.qjff_AD_for_uipower();
  21068. break;
  21069. case 'qjff_AD_for_uigetAward':
  21070. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  21071. dui5.qjff_AD_for_uigetAward();
  21072. break;
  21073. case 'qjff_AD_for_uiGameEnd':
  21074. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  21075. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  21076. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  21077. break;
  21078. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  21079. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  21080. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  21081. break;
  21082. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  21083. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  21084. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  21085. break;
  21086. case 'qjff_AD_for_UIrepentProp_videoRegret':
  21087. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  21088. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  21089. break;
  21090. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  21091. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  21092. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  21093. break;
  21094. case 'qjff_AD_for_UIBOX_onOpenBox':
  21095. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  21096. dui11.qjff_AD_for_UIBOX_onOpenBox();
  21097. break;
  21098. case 'qjff_AD_for_UIAddCoin':
  21099. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  21100. dui12.qjff_AD_for_UIAddCoin();
  21101. break;
  21102. case '111a':
  21103. let dui14 = xGame.uiMgr.getUI(UISign$1);
  21104. dui14.qjff_AD_for_uisign();
  21105. break;
  21106. case '222a':
  21107. let dui15 = xGame.uiMgr.getUI(UISign$1);
  21108. dui15.qjff_AD_for_uisign();
  21109. break;
  21110. case '333a':
  21111. let dui16 = xGame.uiMgr.getUI(UISign$1);
  21112. dui16.qjff_AD_for_uisign();
  21113. break;
  21114. default:
  21115. console.log('zh:未知的方法名字' + t);
  21116. break;
  21117. }
  21118. }
  21119. onConstructor() {
  21120. console.log('zh: UIMain onConstructor');
  21121. this.ui = ui_UIMain.createInstance();
  21122. this.contentPane = this.ui;
  21123. this.isEject = false;
  21124. this.addEvent();
  21125. this.addClickSpine();
  21126. this.settingNode = new SettingNode$1(this.ui.settingNode);
  21127. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21128. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  21129. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  21130. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  21131. let curUse = DataMgr.getCurSecretary();
  21132. this.changeSecretary(curUse);
  21133. this.ui.talkNode.visible = false;
  21134. let guide = DataMgr.getSkillGuide();
  21135. if (xGame.common.isNewDay && guide == 1) {
  21136. xGame.common.isNewDay = false;
  21137. xGame.soundMgr.playSound("s_main01");
  21138. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21139. console.log("zh:播放小秘书每天语音");
  21140. }
  21141. this.ui.n83.visible = false;
  21142. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  21143. }
  21144. changeSecretary(curUse) {
  21145. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  21146. xGame.common.secretary && xGame.common.secretary.dispose();
  21147. this.addSecretarySpine(name);
  21148. }
  21149. addSecretarySpine(name) {
  21150. let spine = new SpineMgr(name, () => {
  21151. this.playSecretaryIdle();
  21152. });
  21153. xGame.common.secretary = spine;
  21154. }
  21155. addClickSpine() {
  21156. let clickSpine = new SpineMgr("dianji", () => {
  21157. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  21158. let parent = Laya.stage;
  21159. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  21160. clickSpine.play(data, 0, false, parent, (spine) => {
  21161. spine.destroy(true);
  21162. });
  21163. });
  21164. });
  21165. }
  21166. addEvent() {
  21167. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  21168. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  21169. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  21170. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  21171. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  21172. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  21173. this.addUIClick(this.ui, this.interuptSecretary);
  21174. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  21175. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  21176. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  21177. this.addUIClick(this.ui.shopBtn, this.openShopView);
  21178. this.addUIClick(this.ui.signBtn, this.openSignView);
  21179. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  21180. this.addUIClick(this.ui.rankBtn, this.openRanking);
  21181. }
  21182. show(showFailWords) {
  21183. super.show();
  21184. this.moneyNode.ui.c1.selectedIndex = 1;
  21185. this.playSecretaryIdle();
  21186. xGame.soundMgr.playMusic("caromhall01", 0);
  21187. Laya.timer.clearAll(this);
  21188. this.playSecretaryRandomSound();
  21189. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  21190. if (showFailWords) {
  21191. console.log('zh:uimain.ts ');
  21192. setTimeout(() => {
  21193. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  21194. let words = -1;
  21195. if (str == "s_main02") {
  21196. words = 2;
  21197. }
  21198. else {
  21199. words = 3;
  21200. }
  21201. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21202. xGame.soundMgr.playSound(str);
  21203. }, 300);
  21204. }
  21205. this.showGuide();
  21206. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  21207. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  21208. let guide = DataMgr.getSkillGuide();
  21209. if (guide == 1) {
  21210. let randTime = xGame.common.randomNum(300, 800);
  21211. if (this.firstEnter) {
  21212. console.log("zh: firstEnter");
  21213. this.firstEnter = false;
  21214. randTime += 900;
  21215. }
  21216. else {
  21217. console.log("zh: no firstEnter");
  21218. }
  21219. Laya.timer.once(randTime, this, () => {
  21220. xGame.common.autoPopUIView();
  21221. });
  21222. }
  21223. }
  21224. checkActive(show) {
  21225. }
  21226. showGuide() {
  21227. let guide = DataMgr.getSkillGuide();
  21228. this.ui.guideBtn.visible = guide == 0;
  21229. this.ui.enterGuide.visible = false;
  21230. this.ui.secretaryGuide.visible = guide == 0;
  21231. if (guide == 0) {
  21232. console.log("zh:显示引导");
  21233. xGame.soundMgr.playSound("s_guide");
  21234. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21235. }
  21236. else {
  21237. console.log("zh:不需要显示引导");
  21238. }
  21239. }
  21240. ensureSecretary() {
  21241. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  21242. this.ui.secretaryGuide.visible = false;
  21243. this.ui.enterGuide.visible = true;
  21244. this.ui.wordsNode.t0.play();
  21245. if (DataMgr.getNewUser())
  21246. Moyu.sendDataEvent("gameReady");
  21247. }
  21248. playSecretaryIdle() {
  21249. let parent = this.ui.secretary.displayObject;
  21250. parent.destroyChildren();
  21251. let xx = this.ui.secretary.width / 2;
  21252. let yy = this.ui.secretary.height;
  21253. let scale = xGame.common.getSecretaryScale();
  21254. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21255. console.log("zh:playSecretaryIdle", data);
  21256. xGame.common.secretary.play(data, 0, true, parent);
  21257. }
  21258. startGame(type) {
  21259. xGame.common.gameMode = type;
  21260. Moyu.sendDataEvent("PlayGame", { type: type });
  21261. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  21262. switch (xGame.common.gameMode) {
  21263. case GameMode.classic:
  21264. console.log('zh:进入经典模式111111111');
  21265. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  21266. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21267. console.log('zh:classic db_over_lev=', db_over_lev);
  21268. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  21269. console.log('zh:判断是否可以玩该模式classic =NO');
  21270. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  21271. xGame.uiMgr.Show(UIMsg$1, tipStr);
  21272. console.log('zh:返回');
  21273. return;
  21274. }
  21275. else {
  21276. console.log('zh:可以玩该模式classic 66666666666666');
  21277. this.beginGame();
  21278. }
  21279. }
  21280. else {
  21281. console.log('zh:不需要判断是否可以玩该classic');
  21282. let challengeTimes = DataMgr.getChallengeTimes();
  21283. if (challengeTimes == 0) {
  21284. xGame.uiMgr.Show(UIInvitation$1);
  21285. }
  21286. else {
  21287. this.beginGame();
  21288. }
  21289. break;
  21290. }
  21291. case GameMode.bigMove:
  21292. console.error('zh:bigMove check');
  21293. let guide = DataMgr.getSkillGuide();
  21294. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  21295. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21296. console.log('zh:bigMove db_over_lev=', db_over_lev);
  21297. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  21298. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  21299. xGame.uiMgr.Show(UIMsg$1, tipStr);
  21300. return;
  21301. }
  21302. else {
  21303. console.log('zh:可以玩该模式 bigMove');
  21304. this.beginGame();
  21305. if (DataMgr.getNewUser())
  21306. Moyu.sendDataEvent("gameStart0");
  21307. }
  21308. }
  21309. else {
  21310. this.beginGame();
  21311. if (DataMgr.getNewUser())
  21312. Moyu.sendDataEvent("gameStart0");
  21313. }
  21314. break;
  21315. default:
  21316. console.error('zh:未知错误!!!!');
  21317. break;
  21318. }
  21319. }
  21320. beginGame(isNice = false) {
  21321. console.log('zh:beginGame ');
  21322. let guide = DataMgr.getSkillGuide();
  21323. if (guide == 1) {
  21324. console.log('zh:非新手引导,showInternAd ');
  21325. JSBridgeUtils.instance.showInternAd('beginGame');
  21326. }
  21327. else {
  21328. console.log('zh:新手引导,不显示AD ');
  21329. }
  21330. console.log('zh:beginGame 2 go');
  21331. if (xGame.common.gameMode == GameMode.classic) {
  21332. if (isNice) {
  21333. this.enterClassic();
  21334. }
  21335. else {
  21336. xGame.uiMgr.Show(UIModeSelection$1, () => {
  21337. console.log('zh:BBBBBBBBBBBBBBB');
  21338. this.enterClassic();
  21339. });
  21340. }
  21341. }
  21342. else if (xGame.common.gameMode == GameMode.bigMove) {
  21343. this.ui.enterGuide.visible = false;
  21344. xGame.uiMgr.Show(UISkill$1);
  21345. }
  21346. }
  21347. enterClassic() {
  21348. xGame.uiMgr.Show(UIGame$1);
  21349. xGame.uiMgr.Show(UIMatching$1, () => {
  21350. if (!this.isHide)
  21351. this.hide();
  21352. xGame.common.gameUI.ui.alpha = 1;
  21353. xGame.common.gameUI.startGame();
  21354. xGame.uiMgr.Hide(UIGameEnd$1);
  21355. });
  21356. }
  21357. startGlobal() {
  21358. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21359. }
  21360. startWeekly() {
  21361. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21362. }
  21363. zhouSaiMonth() {
  21364. console.log('zh: zhouSaiMonth 被调用');
  21365. }
  21366. startPlaceBall() {
  21367. xGame.uiMgr.Show(UILevelDisplay$1);
  21368. }
  21369. hide() {
  21370. console.log('zh:uimain hide ...');
  21371. super.hide();
  21372. xGame.common.stopGirlPop(this.ui.talkNode);
  21373. }
  21374. onGetUserInfo(force = false) {
  21375. if (Moyu.isWx) {
  21376. let info = Moyu.getSystemInfo();
  21377. if (info)
  21378. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  21379. }
  21380. else {
  21381. Moyu.initUser(this, this.freshUser, force);
  21382. }
  21383. if (!Moyu.hasUserInfo) {
  21384. let user = Moyu.getUserInfo();
  21385. user.headIcon = 'res/ty_touxiang.png';
  21386. }
  21387. this.freshUser();
  21388. }
  21389. freshUser() {
  21390. let user = Moyu.getUserInfo();
  21391. if (!user.isAuth) {
  21392. user.headIcon = 'res/ty_touxiang.png';
  21393. }
  21394. else
  21395. DataMgr.upRankData();
  21396. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  21397. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  21398. }
  21399. interuptSecretary() {
  21400. Laya.timer.clearAll(this);
  21401. this.playSecretaryRandomSound();
  21402. }
  21403. playSecretaryRandomSound() {
  21404. if (this.isHide)
  21405. return;
  21406. let time = xGame.common.randomNum(45000, 60000);
  21407. Laya.timer.once(time, this, () => {
  21408. if (this.isHide)
  21409. return;
  21410. let index = xGame.common.randomNum(4, 7);
  21411. xGame.soundMgr.playSound("s_main0" + index);
  21412. let words = 1;
  21413. switch (index) {
  21414. case 4:
  21415. words = 5;
  21416. break;
  21417. case 5:
  21418. words = 3;
  21419. break;
  21420. case 6:
  21421. words = 6;
  21422. break;
  21423. case 7:
  21424. words = 7;
  21425. break;
  21426. default:
  21427. break;
  21428. }
  21429. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21430. this.playSecretaryRandomSound();
  21431. });
  21432. }
  21433. openSecretaryView() {
  21434. xGame.uiMgr.Show(UISecretary$1);
  21435. Moyu.sendDataEvent("secretary");
  21436. }
  21437. openShopView() {
  21438. xGame.uiMgr.Show(UIShop$1);
  21439. }
  21440. openSignView() {
  21441. xGame.uiMgr.Show(UISign$1);
  21442. }
  21443. openDrawView() {
  21444. xGame.uiMgr.Show(UIDraw$1);
  21445. }
  21446. openRanking() {
  21447. console.log('zh:phb openRanking');
  21448. xGame.uiMgr.Show(UIRanking$1);
  21449. Moyu.sendDataEvent("rankingList");
  21450. }
  21451. }
  21452. UIMain$1.uiName = "UIMain";
  21453. function InitShader() {
  21454. }
  21455. function appInit() {
  21456. xGame.context.init(getLoadingResList(), initCallback);
  21457. }
  21458. function getLoadingResList() {
  21459. return [
  21460. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  21461. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  21462. ];
  21463. }
  21464. function getGameResList() {
  21465. return [
  21466. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  21467. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  21468. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  21469. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  21470. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  21471. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  21472. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  21473. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  21474. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  21475. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  21476. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  21477. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  21478. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  21479. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  21480. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  21481. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  21482. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  21483. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  21484. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  21485. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  21486. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  21487. ];
  21488. }
  21489. function initCallback() {
  21490. window["DataMgr"] = DataMgr;
  21491. DataMgr.Init();
  21492. Moyu.init(getPlat(), this, () => {
  21493. DataMgr.isNewDay();
  21494. PlatMgr.initConfig();
  21495. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  21496. }, true);
  21497. console.log('zh:开始sm init1 start');
  21498. xGame.soundMgr.init();
  21499. console.log('zh:开始sm init1 end');
  21500. xGame.uiMgr.init();
  21501. xGame.uiMgr.clearTempData();
  21502. xGame.uiMgr.bindFUI(fguiRes.loading);
  21503. xGame.uiMgr.Show(UILoading);
  21504. }
  21505. function loadSubRes(callback) {
  21506. var tab = ["asset", "res", "spine"];
  21507. let subDone = 0;
  21508. for (var i = 0; i < tab.length; i++) {
  21509. let sub = tab[i];
  21510. Moyu.loadSubRes(sub, (pro) => {
  21511. callback && callback(pro, false);
  21512. }).then(() => {
  21513. subDone++;
  21514. if (subDone >= tab.length)
  21515. callback && callback(1, true);
  21516. });
  21517. }
  21518. }
  21519. function enterGame() {
  21520. xGame.cfgMgr.init();
  21521. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  21522. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  21523. xGame.uiMgr.Hide(UILoading);
  21524. fgui.UIPackage.removePackage(fguiRes.loading);
  21525. xGame.uiMgr.bindFUI(fguiRes.game);
  21526. xGame.uiMgr.Show(UIMain$1);
  21527. if (DataMgr.getNewUser())
  21528. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  21529. }
  21530. function getPlat() {
  21531. let cfg = new MoyuCfg();
  21532. cfg.plat = MoyuPlat.web;
  21533. cfg.myId = 180;
  21534. cfg.myKey = '8848a885774230a4';
  21535. cfg.version = 0;
  21536. if (window.hasOwnProperty("gamebox")) {
  21537. cfg.plat = MoyuPlat.f399;
  21538. cfg.version = 0;
  21539. }
  21540. else if (window.hasOwnProperty("ks")) {
  21541. cfg.plat = MoyuPlat.ks;
  21542. cfg.version = 0;
  21543. cfg.ads.ksVideoId = '2300002254_01';
  21544. cfg.ads.ksInsertId = '2300002254_02';
  21545. }
  21546. else if (Laya.Browser.onTTMiniGame) {
  21547. cfg.plat = MoyuPlat.tt;
  21548. cfg.version = 0;
  21549. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  21550. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  21551. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  21552. }
  21553. else if (Laya.Browser.onMiniGame) {
  21554. cfg.plat = MoyuPlat.wx;
  21555. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  21556. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  21557. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  21558. }
  21559. else if (Laya.Browser.onQQMiniGame) {
  21560. cfg.plat = MoyuPlat.qq;
  21561. }
  21562. else if (Laya.Browser.onQGMiniGame) {
  21563. cfg.plat = MoyuPlat.op;
  21564. cfg.ads.opVideoId = '455502';
  21565. cfg.ads.opBannerId = '455507';
  21566. }
  21567. else if (Laya.Browser.onVVMiniGame) {
  21568. cfg.plat = MoyuPlat.vv;
  21569. cfg.version = 0;
  21570. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  21571. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  21572. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  21573. }
  21574. else if (Laya.Browser.onHWMiniGame) {
  21575. cfg.plat = MoyuPlat.hw;
  21576. }
  21577. else if (window["mz"]) {
  21578. cfg.plat = MoyuPlat.mz;
  21579. }
  21580. else {
  21581. let cfg = window['conchConfig'];
  21582. if (cfg) {
  21583. var os = cfg.getOS();
  21584. if (os == "Conch-ios") {
  21585. cfg.plat = MoyuPlat.ios;
  21586. }
  21587. else if (os == "Conch-android") {
  21588. }
  21589. }
  21590. }
  21591. return cfg;
  21592. }
  21593. class Main {
  21594. constructor() {
  21595. if (window["Laya3D"])
  21596. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  21597. else {
  21598. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  21599. this.initMain();
  21600. }
  21601. }
  21602. initMain() {
  21603. Laya["Physics"] && Laya["Physics"].enable();
  21604. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  21605. Laya.stage.scaleMode = GameConfig.scaleMode;
  21606. Laya.stage.screenMode = GameConfig.screenMode;
  21607. Laya.stage.alignV = GameConfig.alignV;
  21608. Laya.stage.alignH = GameConfig.alignH;
  21609. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  21610. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  21611. Laya.enableDebugPanel();
  21612. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  21613. Laya["PhysicsDebugDraw"].enable();
  21614. if (GameConfig.stat)
  21615. Laya.Stat.show();
  21616. Laya.alertGlobalError(true);
  21617. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  21618. }
  21619. onVersionLoaded() {
  21620. appInit();
  21621. }
  21622. }
  21623. new Main();
  21624. }());
  21625. //# sourceMappingURL=bundle.js.map