1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722 |
- (function () {
- 'use strict';
- class GameConfig {
- constructor() {
- }
- static init() {
- var reg = Laya.ClassUtils.regClass;
- }
- }
- GameConfig.width = 1334;
- GameConfig.height = 750;
- GameConfig.scaleMode = "fixedheight";
- GameConfig.screenMode = "horizontal";
- GameConfig.alignV = "top";
- GameConfig.alignH = "left";
- GameConfig.startScene = "";
- GameConfig.sceneRoot = "";
- GameConfig.debug = false;
- GameConfig.stat = false;
- GameConfig.physicsDebug = false;
- GameConfig.exportSceneToJson = true;
- GameConfig.init();
- let fguiRes = {
- game: "asset/fgui/game",
- loading: "fgui/loading"
- };
- let ballCamp = {
- full: "full",
- flower: "flower"
- };
- let FoulType = {
- "timeOut": "1",
- "notTouch": "2",
- "wrongTouch": "3",
- "wrongHole": "4",
- "rootHole": "5",
- };
- let ALL_BALL_STOP = "ALL_BALL_STOP";
- let WAIT_SHOOT = "WAIT_SHOOT";
- let D3RES_LOADED = "D3RES_LOADED";
- let BALL_SHOOT = "BALL_SHOOT";
- let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
- let RESET_GAME = "RESET_GAME";
- let COIN_CHANGE = "COIN_CHANGE";
- let DIAMOND_CHANGE = "DIAMOND_CHANGE";
- let RESTART_GAME = "RESTART_GAME";
- let GET_USER_INFO = "GET_USER_INFO";
- let CHANGE_SECRETARY = "CHANGE_SECRETARY";
- let POWER_CHANGE = "POWER_CHANGE";
- let POWER_TIME = "POWER_TIME";
- let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
- let poolKey = {
- inHoleEft: "inHoleEft",
- d3ball: "d3ball",
- iceEft: "iceEft",
- hitEft: "hitEft",
- fireworksEft: "fireworksEft",
- };
- var GameMode;
- (function (GameMode) {
- GameMode[GameMode["classic"] = 0] = "classic";
- GameMode[GameMode["bigMove"] = 1] = "bigMove";
- GameMode[GameMode["placeBall"] = 2] = "placeBall";
- })(GameMode || (GameMode = {}));
- var SkillType;
- (function (SkillType) {
- SkillType[SkillType["highSpace"] = 0] = "highSpace";
- SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
- SkillType[SkillType["ice"] = 2] = "ice";
- SkillType[SkillType["fireworks"] = 3] = "fireworks";
- SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
- })(SkillType || (SkillType = {}));
- var ClassicWordsType;
- (function (ClassicWordsType) {
- ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
- ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
- ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
- ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
- ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
- })(ClassicWordsType || (ClassicWordsType = {}));
- var PressType;
- (function (PressType) {
- PressType[PressType["powerNode"] = 0] = "powerNode";
- PressType[PressType["d2Root"] = 1] = "d2Root";
- PressType[PressType["moveNode"] = 2] = "moveNode";
- PressType[PressType["rulerNode"] = 3] = "rulerNode";
- })(PressType || (PressType = {}));
- var PlaceBallType;
- (function (PlaceBallType) {
- PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
- PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
- })(PlaceBallType || (PlaceBallType = {}));
- var EAdType;
- (function (EAdType) {
- EAdType[EAdType["upSkill"] = 0] = "upSkill";
- EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
- EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
- EAdType[EAdType["regretBall"] = 3] = "regretBall";
- EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
- EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
- EAdType[EAdType["sign"] = 6] = "sign";
- EAdType[EAdType["draw"] = 7] = "draw";
- EAdType[EAdType["triple"] = 8] = "triple";
- EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
- EAdType[EAdType["getPower"] = 10] = "getPower";
- EAdType[EAdType["box"] = 11] = "box";
- EAdType[EAdType["try"] = 12] = "try";
- EAdType[EAdType["againSign"] = 13] = "againSign";
- EAdType[EAdType["addCoin"] = 14] = "addCoin";
- })(EAdType || (EAdType = {}));
- var Prop;
- (function (Prop) {
- Prop[Prop["diamond"] = 1] = "diamond";
- Prop[Prop["coin"] = 2] = "coin";
- Prop[Prop["gan1"] = 3] = "gan1";
- Prop[Prop["gan2"] = 4] = "gan2";
- Prop[Prop["gan3"] = 5] = "gan3";
- Prop[Prop["gan4"] = 6] = "gan4";
- })(Prop || (Prop = {}));
- var TipsType;
- (function (TipsType) {
- TipsType[TipsType["exitGame"] = 0] = "exitGame";
- TipsType[TipsType["foul"] = 1] = "foul";
- })(TipsType || (TipsType = {}));
- class AwardType {
- constructor(type, num) {
- this.type = type;
- this.num = num;
- }
- }
- var define = /*#__PURE__*/Object.freeze({
- fguiRes: fguiRes,
- ballCamp: ballCamp,
- FoulType: FoulType,
- ALL_BALL_STOP: ALL_BALL_STOP,
- WAIT_SHOOT: WAIT_SHOOT,
- D3RES_LOADED: D3RES_LOADED,
- BALL_SHOOT: BALL_SHOOT,
- FIRST_BALL_HOLE: FIRST_BALL_HOLE,
- RESET_GAME: RESET_GAME,
- COIN_CHANGE: COIN_CHANGE,
- DIAMOND_CHANGE: DIAMOND_CHANGE,
- RESTART_GAME: RESTART_GAME,
- GET_USER_INFO: GET_USER_INFO,
- CHANGE_SECRETARY: CHANGE_SECRETARY,
- POWER_CHANGE: POWER_CHANGE,
- POWER_TIME: POWER_TIME,
- baseHeadUrl: baseHeadUrl,
- poolKey: poolKey,
- get GameMode () { return GameMode; },
- get SkillType () { return SkillType; },
- get ClassicWordsType () { return ClassicWordsType; },
- get PressType () { return PressType; },
- get PlaceBallType () { return PlaceBallType; },
- get EAdType () { return EAdType; },
- get Prop () { return Prop; },
- get TipsType () { return TipsType; },
- AwardType: AwardType
- });
- class CContext {
- constructor() {
- this.winSize = { width: 0, height: 0 };
- this.notchHeight = 0;
- this.bannerHeight = 0;
- }
- init(resList, callback) {
- this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
- this.notchHeight = this.getNotchHeight();
- this.bannerHeight = this.getBannerHeight();
- Laya.loader.load(resList, Laya.Handler.create(this, () => {
- callback && callback();
- }));
- }
- getNotchHeight() {
- let notchHeight = 50;
- if (Laya.Browser.onMiniGame) {
- let deviceInfo = wx.getSystemInfoSync();
- if (Laya.Browser.onIOS) {
- if (deviceInfo.model.search('iPhone X') != -1) {
- notchHeight = deviceInfo.statusBarHeight - 10;
- }
- else {
- if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
- (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
- notchHeight = deviceInfo.statusBarHeight - 10;
- }
- }
- }
- else if (Laya.Browser.onAndroid) {
- if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
- notchHeight = deviceInfo.statusBarHeight;
- }
- }
- }
- return notchHeight;
- }
- getBannerHeight() {
- return 0;
- }
- }
- let context = new CContext();
- var Handler = Laya.Handler;
- var Tween = Laya.Tween;
- function playClickEffect(btn) {
- if (!btn)
- return;
- Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
- if (!btn)
- return;
- Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
- if (!btn)
- return;
- Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
- }), 0, true);
- }), 0, true);
- }
- function getNumList(strList) {
- let dataList = [];
- if (strList) {
- let list = strList;
- let array = list.split(',');
- for (var v in array) {
- dataList.push(Number(array[v]));
- }
- }
- return dataList;
- }
- function getStrList(strList) {
- let dataList = [];
- if (strList) {
- let list = strList;
- let array = list.split('|');
- for (var v in array) {
- dataList.push(String(array[v]));
- }
- }
- return dataList;
- }
- function getRandStr(len) {
- 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'];
- let str = "";
- for (let i = 0; i < len; i++) {
- let rand = random(0, list.length);
- str += list[rand];
- }
- return str;
- }
- function getUserId() {
- let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
- return str;
- }
- function formatPos(pos, len = 2) {
- let v = Math.pow(10, len);
- pos.x = Math.floor(pos.x * v) / v;
- pos.y = Math.floor(pos.y * v) / v;
- if (pos.z)
- pos.z = Math.floor(pos.z * v) / v;
- return pos;
- }
- function setPosInt(pos) {
- pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
- pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
- pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
- return pos;
- }
- function random(min, max) {
- var rang = max - min;
- var rand = Math.random() * rang;
- return Math.floor(rand) + min;
- }
- function randomList(list, num) {
- if (list.length <= num)
- return list;
- let arry = [];
- list.forEach(item => {
- arry.push(item);
- });
- let nums = [];
- for (let i = 0; i < num; i++) {
- let rand = random(0, arry.length);
- let v = arry[rand];
- nums.push(v);
- arry.splice(rand, 1);
- }
- return nums;
- }
- function worldToScreen(camera, point, pos) {
- camera.viewport.project(point, camera.projectionViewMatrix, pos);
- pos.x = pos.x / Laya.stage.clientScaleX;
- pos.y = pos.y / Laya.stage.clientScaleY;
- }
- function getStringLenght(str) {
- return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
- }
- function reviseString(str, len) {
- let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
- if (ld > len) {
- let sl = Math.floor(len / 2);
- let rs = str.substring(0, sl);
- let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
- while (d + 2 < len) {
- sl++;
- rs = str.substring(0, sl);
- d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
- }
- return rs + "...";
- }
- return str;
- }
- function getCoinString(coin) {
- if (coin < 10000)
- return coin.toString();
- else if (coin < 1000000) {
- let vh = Math.ceil(coin / 100);
- return (vh / 10) + "k";
- }
- else if (coin < 1000000000) {
- var vh = Math.ceil(coin / 100000);
- return (vh / 10) + "m";
- }
- else if (coin < 1000000000000) {
- var vh = Math.ceil(coin / 100000000);
- return (vh / 10) + "b";
- }
- else if (coin < 1000000000000000) {
- var vh = Math.ceil(coin / 100000000000);
- return (vh / 10) + "t";
- }
- }
- function getV3Dest(pos, dir, dis, dest) {
- dir.x *= dis;
- dir.y *= dis;
- dir.z *= dis;
- Laya.Vector3.add(pos, dir, dest);
- return dest;
- }
- function getV2Dest(x1, y1, dir, dis, dest) {
- dest.x = x1 + dir.x * dis;
- dest.y = y1 + dir.y * dis;
- return dest;
- }
- function getV2Dir(x1, y1, x2, y2, dir) {
- dir.x = x2 - x1;
- dir.y = y2 - y1;
- Laya.Vector2.normalize(dir, dir);
- return dir;
- }
- function getV3Dir(p1, p2, dir) {
- Laya.Vector3.subtract(p1, p2, dir);
- Laya.Vector3.normalize(dir, dir);
- return dir;
- }
- function copyPos(ip, op) {
- op.x = ip.x;
- op.y = ip.y;
- if (ip.z)
- op.z = ip.z;
- return op;
- }
- function getScreenImg() {
- let gl = Laya.WebGLContext.mainContext;
- let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
- gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
- let w = gl.drawingBufferWidth;
- let h = gl.drawingBufferHeight;
- let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
- texture2d.setPixels(pixels);
- return new Laya.Texture(texture2d);
- }
- function playMoveByPositions(sp, positions, v, completeCallback) {
- let p;
- let play = () => {
- if (positions.length == 0) {
- completeCallback();
- return;
- }
- p = positions[0];
- positions.splice(0, 1);
- 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, () => {
- play();
- }));
- };
- play();
- }
- function setStarPos(node, num, max) {
- for (let i = 1; i <= 5; i++) {
- let img = node.getChildAt(i - 1);
- img.width = img.height = 30;
- img.pivotX = img.pivotY = 0.5;
- img.gray = i > num;
- img.visible = i <= max;
- if (max == 3) {
- img.x = node.width / 2 + (i - 2) * 30 - 15;
- img.y = node.height - 40;
- if (i == 2)
- img.y = node.height - 30;
- }
- else if (max == 5) {
- let ly = Math.abs(i - 3);
- img.x = node.width / 2 + (i - 3) * 20 - 15;
- img.y = node.height - ly * 8 - 30;
- }
- }
- }
- function playLoopAnimRotate(sp, time, clockwise = true) {
- let rotation;
- sp.rotation = sp.rotation % 360;
- if (clockwise) {
- rotation = -360;
- }
- else {
- rotation = 360;
- }
- Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
- this.playLoopAnimRotate(sp, time, clockwise);
- }));
- }
- function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
- let x, y;
- if (isBig) {
- x = valueXMin;
- y = valueYMin;
- }
- else {
- x = valueXMax;
- y = valueYMax;
- }
- Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
- this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
- }));
- }
- function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
- let scale;
- if (isBig) {
- scale = valueMin;
- }
- else {
- scale = valueMax;
- }
- Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
- playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
- }));
- }
- function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
- let value;
- if (isBig) {
- value = valueMin;
- }
- else {
- value = valueMax;
- }
- if (count) {
- count--;
- Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
- playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
- }));
- }
- else {
- sp.rotation = 0;
- }
- }
- function inRect(rect, p) {
- if (p.x >= rect.x && p.x <= rect.x + rect.w) {
- if (p.y >= rect.y && p.y <= rect.y + rect.h) {
- return true;
- }
- }
- return false;
- }
- function getNumberK(number) {
- if (number < 1000) {
- return number.toString();
- }
- else {
- return (number / 1000).toFixed(1) + "k";
- }
- }
- function pointInsideCircle(point, circle, r) {
- if (r === 0)
- return false;
- var dx = circle.x - point.x;
- var dy = circle.y - point.y;
- return dx * dx + dy * dy <= r * r;
- }
- function formatString(str, data) {
- if (!str || data == undefined) {
- return str;
- }
- if (typeof data === "object") {
- for (var key in data) {
- if (data.hasOwnProperty(key)) {
- str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
- }
- }
- }
- else {
- var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
- return str.replace(reg, function (match, index) {
- return args[index - (-1)];
- });
- }
- return str;
- }
- function getIntersection(a, b) {
- let t = [];
- for (var i = 0; i < a.length; i++) {
- for (var j = 0; j < b.length; j++) {
- if (a[i] == b[j]) {
- t.push(a[i]);
- }
- }
- }
- return t;
- }
- function getComplement(a, b) {
- let t = [];
- let count = false;
- for (var i = 0; i < a.length; i++) {
- count = false;
- for (var j = 0; j < b.length; j++) {
- if (a[i] == b[j]) {
- count = true;
- break;
- }
- }
- if (!count) {
- t.push(a[i]);
- }
- }
- return t;
- }
- function geSpriteStageRect(sp) {
- var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
- let rect = {
- x: point.x,
- y: point.y,
- width: sp.width * sp.globalScaleX,
- height: sp.height * sp.globalScaleY
- };
- return rect;
- }
- function touchButton(button) {
- let event = new Laya.Event();
- button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
- }
- function setColor(sprite, r, g, b) {
- var redMat = [
- r / 255, 0, 0, 0, 0,
- g / 255, 0, 0, 0, 0,
- b / 255, 0, 0, 0, 0,
- 0, 0, 0, 1, 0,
- ];
- var filter = new Laya.ColorFilter(redMat);
- sprite.filters = [filter];
- }
- function clone(obj, newobj = {}) {
- for (var attr in obj) {
- if (typeof obj[attr] == "object") {
- newobj[attr] = clone(obj[attr], newobj[attr]);
- }
- else {
- newobj[attr] = obj[attr];
- }
- }
- return newobj;
- }
- function _ms(arr, compare, begin, end) {
- const size = end - begin;
- if (size <= 1) {
- return;
- }
- const middle = (end + begin) >> 1;
- _ms(arr, compare, begin, middle);
- _ms(arr, compare, middle, end);
- if (compare(arr[middle - 1], arr[middle]) <= 0) {
- return;
- }
- const merged = [];
- let leftIndex = begin, rightIndex = middle;
- while (merged.length < size) {
- if (leftIndex === middle) {
- merged.push(arr[rightIndex++]);
- }
- else if (rightIndex === end) {
- merged.push(arr[leftIndex++]);
- }
- else {
- const c = compare(arr[leftIndex], arr[rightIndex]);
- if (c <= 0) {
- merged.push(arr[leftIndex++]);
- }
- else {
- merged.push(arr[rightIndex++]);
- }
- }
- }
- arr.splice(begin, size, ...merged);
- }
- function sort(arr, compare) {
- if (!Array.isArray(arr)) {
- throw new Error('sort的参数必须为数组');
- }
- _ms(arr, compare, 0, arr.length);
- return arr;
- }
- function getLanguage(id) {
- }
- function getLanguageByTip(id) {
- }
- function toWeights(array) {
- let max = 0;
- for (var i = 0; i < array.length; i++) {
- max = max + array[i];
- if (array[i] == 0) {
- array[i] = 0;
- }
- else {
- array[i] = max;
- }
- }
- return array;
- }
- function unique(array) {
- var n = {}, r = [], len = array.length, val, type;
- for (var i = 0; i < array.length; i++) {
- val = array[i];
- type = typeof val;
- if (!n[val]) {
- n[val] = [type];
- r.push(val);
- }
- else if (n[val].indexOf(type) < 0) {
- n[val].push(type);
- r.push(val);
- }
- }
- return r;
- }
- function unique1(array) {
- var r = [];
- for (var i = 0, l = array.length; i < l; i++) {
- for (var j = i + 1; j < l; j++)
- if (array[i] == array[j])
- j == ++i;
- r.push(array[i]);
- }
- return r;
- }
- function getDistance(x1, y1, x2, y2) {
- return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
- }
- function getV2Dis(pos1, pos2) {
- return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
- }
- function getV2SqDis(pos1, pos2) {
- return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
- }
- function getDis(x1, y1, x2, y2) {
- return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
- }
- function getDeltaxy(x1, y1, x2, y2) {
- return Math.abs(x1 - x2) + Math.abs(y1 - y2);
- }
- function getSymbolNumber(num) {
- if (num > 0) {
- return "+" + num;
- }
- else if (num < 0) {
- return num.toString();
- }
- return num.toString();
- }
- function fixNumber(num, length) {
- return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
- }
- function toThousands(num) {
- return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
- }
- let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
- function fmtMoney(money) {
- money = toThousands(money.replace(/^0+/, ''));
- if (money.length == 0) {
- money = "0";
- }
- let unit = 0;
- for (var i = 0; i < money.length; i++) {
- if (money.charAt(i) == ",") {
- unit++;
- }
- }
- if (unit == 0) {
- return money;
- }
- else {
- let idx = money.indexOf(",");
- if (idx) {
- money = money.slice(0, idx + 2) + moneyUnitStr[unit];
- }
- return money.replace(",", ".");
- }
- }
- function flatten(arr) {
- while (arr.some(item => Array.isArray(item))) {
- arr = [].concat(...arr);
- }
- return arr;
- }
- function getDistanceByPoint(p1, p2) {
- return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
- }
- function getAngleByPoint(p1, p2) {
- return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
- }
- function toIntByArray(array) {
- for (var index = 0; index < array.length; index++) {
- array[index] = parseInt(array[index]);
- }
- return array;
- }
- function getAngle0To360(angle) {
- while (angle < 0) {
- angle += 360;
- }
- while (angle >= 360) {
- angle -= 360;
- }
- return angle;
- }
- function toAngle(radian) {
- return radian * 180 / Math.PI;
- }
- function toRadian(angle) {
- return angle * Math.PI / 180;
- }
- function getArrayValueRandom(array) {
- return array[random(0, array.length - 1)];
- }
- function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
- }
- function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
- }
- function fmtTimeMMSS(time) {
- if (time < 0) {
- time = 0;
- }
- else
- time = Math.floor(time);
- return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
- }
- function fmtTimeMS(time) {
- if (time < 0) {
- time = 0;
- }
- return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
- }
- function fmtTimeHHMM(time) {
- if (time < 0) {
- time = 0;
- }
- time = Math.floor(time / 1000);
- return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
- }
- let severTime = 0;
- function getServerTime() {
- return new Date(new Date().getTime() - severTime);
- }
- function setServerTime(data) {
- severTime = (new Date().getTime() - data);
- }
- var tools = /*#__PURE__*/Object.freeze({
- playClickEffect: playClickEffect,
- getNumList: getNumList,
- getStrList: getStrList,
- getRandStr: getRandStr,
- getUserId: getUserId,
- formatPos: formatPos,
- setPosInt: setPosInt,
- random: random,
- randomList: randomList,
- worldToScreen: worldToScreen,
- getStringLenght: getStringLenght,
- reviseString: reviseString,
- getCoinString: getCoinString,
- getV3Dest: getV3Dest,
- getV2Dest: getV2Dest,
- getV2Dir: getV2Dir,
- getV3Dir: getV3Dir,
- copyPos: copyPos,
- getScreenImg: getScreenImg,
- playMoveByPositions: playMoveByPositions,
- setStarPos: setStarPos,
- playLoopAnimRotate: playLoopAnimRotate,
- playLoopAnimPosition: playLoopAnimPosition,
- playLoopAnimScale: playLoopAnimScale,
- playLoopAnimRotation: playLoopAnimRotation,
- inRect: inRect,
- getNumberK: getNumberK,
- pointInsideCircle: pointInsideCircle,
- formatString: formatString,
- getIntersection: getIntersection,
- getComplement: getComplement,
- geSpriteStageRect: geSpriteStageRect,
- touchButton: touchButton,
- setColor: setColor,
- clone: clone,
- sort: sort,
- getLanguage: getLanguage,
- getLanguageByTip: getLanguageByTip,
- toWeights: toWeights,
- unique: unique,
- unique1: unique1,
- getDistance: getDistance,
- getV2Dis: getV2Dis,
- getV2SqDis: getV2SqDis,
- getDis: getDis,
- getDeltaxy: getDeltaxy,
- getSymbolNumber: getSymbolNumber,
- fixNumber: fixNumber,
- toThousands: toThousands,
- fmtMoney: fmtMoney,
- flatten: flatten,
- getDistanceByPoint: getDistanceByPoint,
- getAngleByPoint: getAngleByPoint,
- toIntByArray: toIntByArray,
- getAngle0To360: getAngle0To360,
- toAngle: toAngle,
- toRadian: toRadian,
- getArrayValueRandom: getArrayValueRandom,
- promptByTip: promptByTip,
- promptByErrorCode: promptByErrorCode,
- fmtTimeMMSS: fmtTimeMMSS,
- fmtTimeMS: fmtTimeMS,
- fmtTimeHHMM: fmtTimeHHMM,
- getServerTime: getServerTime,
- setServerTime: setServerTime
- });
- class HttpMgr {
- constructor() {
- HttpMgr._instance = this;
- }
- static getInstance() {
- if (!this._instance) {
- this._instance = new HttpMgr();
- }
- return this._instance;
- }
- sendPost(url, data, call) {
- let httpObj = new Laya.HttpRequest();
- httpObj.http.timeout = 5000;
- httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
- httpObj.once(Laya.Event.ERROR, this, errorHandler);
- httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
- function errorHandler(error) {
- console.log("errorHandler:" + error);
- }
- function completeHandler(data) {
- if (data && data.length > 0) {
- let jsonData = JSON.parse(data);
- if (call)
- call(jsonData);
- }
- }
- }
- sendGet(url, call) {
- let httpObj = new Laya.HttpRequest();
- httpObj.http.timeout = 5000;
- httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
- httpObj.once(Laya.Event.ERROR, this, errorHandler);
- httpObj.send(url, '', 'get');
- function errorHandler(error) {
- console.log("errorHandler:" + error);
- }
- function completeHandler(data) {
- if (data && data.length > 0) {
- if (call)
- call(data);
- }
- }
- }
- }
- HttpMgr._instance = null;
- class LightShader extends Laya.Sprite {
- constructor() {
- super();
- this._time = 0;
- this._sin = 0;
- this.initShader();
- }
- initShader() {
- var vs = `
- #define FSHIGHPRECISION
- attribute vec4 posuv;
- uniform vec2 size;
- varying vec4 v_texcoord;
- void main() {
- vec4 pos = vec4(posuv.xy,0.,1.);
- vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
- gl_Position=pos1;
- v_texcoord.xy = posuv.xy;
-
- }
- `;
- var ps = `
- #define FSHIGHPRECISION
- precision highp float;
- varying vec4 v_texcoord;
- uniform vec2 size;
- uniform sampler2D texture;
- uniform float u_Time;
- void main() {
- vec4 color= texture2D(texture, v_texcoord.xy);
- float width = 0.2;
- float start = u_Time;
- float offset = 1.0;
- vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
- if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
- {
- color.r=1.1;
- color.g=1.1;
- color.b=1.1;
- gl_FragColor = color;
- } else {
- gl_FragColor = color;
- }
- }
- `;
- this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
- this.customRenderEnable = true;
- this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
- }
- customRender(context, x, y) {
- this.onUpdate();
- if (!this.texture)
- return;
- let xx = x - this.pivotX;
- let yy = y - this.pivotY;
- context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
- }
- onUpdate() {
- this._time += 2 * Laya.timer.delta * 0.001;
- this._sin = Math.sin(this._time);
- if (this._sin > 0.99) {
- this._sin = 0;
- this._time = 0;
- }
- this.shaderValue['u_Time'] = this._sin;
- }
- }
- LightShader.DissolveSurfaceSaveName = 9997;
- class UIBase extends fairygui.Window {
- constructor() {
- super();
- this.isEject = true;
- this.isHide = true;
- this.showbanner = true;
- this.className = "";
- this.isMuti = false;
- this.showbanner = false;
- this.onConstructor();
- }
- checkActive(show) {
- }
- getUIName() {
- return UIBase.uiName;
- }
- onConstructor() {
- }
- onInit() {
- if (!!this.contentPane) {
- this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
- }
- this.setPivot(0.5, 0.5, false);
- }
- doShowAnimation() {
- if (!this.isEject)
- return;
- super.doShowAnimation();
- Laya.Tween.clearTween(this);
- this.scaleX = this.scaleY = 0.8;
- let tweenFunc1 = (func) => {
- Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
- };
- let tweenFunc2 = (func) => {
- Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
- };
- tweenFunc1(tweenFunc2);
- }
- show(...args) {
- super.show();
- this._openParam = args;
- this.isHide = false;
- xGame.uiMgr.checkUIState();
- }
- moveBannerButton() {
- }
- showBannerButton() {
- this.bannerButton.visible = true;
- Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
- this.bannerButton.touchable = true;
- }));
- }
- hide() {
- super.hide();
- this.isHide = true;
- xGame.uiMgr.checkUIState();
- }
- Dispose() {
- super.dispose();
- }
- myUpdate(delay) {
- }
- refresh() { }
- addUIClick(obj, func, arr = null) {
- obj.onClick(this, func, arr);
- obj.onClick(this, this.playBtnSound);
- }
- offUIClick(obj, func) {
- obj.offClick(this, func);
- }
- playBtnSound() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- }
- }
- UIBase.lastShowBanner = 0;
- UIBase.showBannerNum = 0;
- UIBase.uiName = "";
- class ui_UIDraw extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIDraw"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.extraNode = (this.getChild("extraNode"));
- this.myNode = (this.getChild("myNode"));
- this.closeNode = (this.getChild("closeNode"));
- this.moneyNode = (this.getChild("moneyNode"));
- this.n38 = (this.getChild("n38"));
- this.secretary = (this.getChild("secretary"));
- this.drawBtn = (this.getChild("drawBtn"));
- this.talkNode = (this.getChild("talkNode"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
- class ui_UIBox extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIBox"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n12 = (this.getChild("n12"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.bar = (this.getChild("bar"));
- this.closeBtn = (this.getChild("closeBtn"));
- this.openBtn = (this.getChild("openBtn"));
- this.t0 = this.getTransition("t0");
- this.t1 = this.getTransition("t1");
- }
- }
- ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
- class GlobalManager {
- constructor() {
- }
- registerMethod(name, method) {
- console.log('zh: 注册全局方法', name);
- this[name] = method;
- }
- callMethod(name, ...args) {
- console.log('zh: 调用全局方法', name);
- if (this[name]) {
- return this[name](...args);
- }
- else {
- console.error(`zh: 全局方法 Method ${name} not found`);
- }
- }
- }
- GlobalManager.instance = new GlobalManager();
- class JSBridgeUtils {
- constructor() { }
- static get instance() {
- if (!this._instance) {
- this._instance = new JSBridgeUtils();
- }
- return this._instance;
- }
- initBridge() {
- if (!Laya.Browser.onAndroid) {
- console.log('zh:非android dev');
- return;
- }
- let cfg = window['conchConfig'];
- if (cfg) {
- var os = cfg.getOS();
- if (os == "Conch-android") {
- this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
- if (this.bridge) {
- return true;
- }
- else {
- return false;
- }
- }
- else {
- return false;
- }
- }
- else {
- return false;
- }
- }
- testAd1() {
- if (!Laya.Browser.onAndroid) {
- console.log('zh:非android dev');
- return;
- }
- if (!this.initBridge()) {
- return;
- }
- let rs = this.bridge.call("testString", "hello");
- console.log('zh:testString rs=' + rs);
- }
- testAdCallBack() {
- if (!this.initBridge()) {
- return;
- }
- console.log("zh:testAdCallBack start");
- const defaultObj = { code: 200, msg: "req update Ui" };
- const reqObj = { code: 300, msg: "hello java ui" };
- this.bridge.callWithBack((rsStr) => {
- const rsObj = JSON.parse(rsStr);
- console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
- }, "testAsyncCallback", JSON.stringify(reqObj));
- }
- showInternAd(mark) {
- if (!Laya.Browser.onAndroid) {
- console.log('zh:非android dev');
- return false;
- }
- if (!this.initBridge()) {
- return false;
- }
- let rs = this.bridge.call("showInternAd", mark);
- console.log('zh:showInternAd rs= ' + rs + ' ,mark=' + mark);
- try {
- const result = JSON.parse(rs);
- if (result.code === 200) {
- console.log("zh:广告显示成功");
- return true;
- }
- else {
- console.warn("zh:广告显示失败:", result.msg);
- return false;
- }
- }
- catch (e) {
- console.error("zh:解析桥接返回值失败:", e);
- return false;
- }
- }
- showRewardAd(mark) {
- if (!Laya.Browser.onAndroid) {
- console.log('zh:非android dev');
- return false;
- }
- if (!this.initBridge()) {
- return false;
- }
- let rs = this.bridge.call("showRewardAd", mark);
- console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
- try {
- const result = JSON.parse(rs);
- if (result.code === 200) {
- console.log("zh:广告显示成功");
- return true;
- }
- else {
- console.warn("zh:广告显示失败:", result.msg);
- return false;
- }
- }
- catch (e) {
- console.error("zh:解析桥接返回值失败:", e);
- return false;
- }
- }
- nativeCallJs(msg) {
- console.log("zh:nativeCallJs received data: 1111", msg);
- if (msg === 'Ad1') {
- GlobalManager.instance.callMethod('Ad1');
- console.log("zh: Ad1 奖励发送成功");
- }
- else if (msg === 'Ad2') {
- GlobalManager.instance.callMethod('Ad2');
- console.log("zh: Ad2 奖励发送成功");
- }
- else if (msg === 'Ad3') {
- GlobalManager.instance.callMethod('Ad3');
- console.log("zh: Ad3 奖励发送成功");
- }
- else if (msg === 'Ad4') {
- GlobalManager.instance.callMethod('Ad4');
- console.log("zh: Ad4 奖励发送成功");
- }
- else if (msg === 'Ad5') {
- console.log("zh: Ad5 奖励发送成功");
- GlobalManager.instance.callMethod('Ad5');
- }
- }
- }
- class UIBox extends UIBase {
- constructor() {
- super();
- this.boxNum = 0;
- this.boxMax = 10;
- this.inAd = false;
- this.isClose = false;
- }
- onConstructor() {
- this.ui = ui_UIBox.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.closeBtn, this.onCloseBox);
- this.addUIClick(this.ui.openBtn, this.onOpenBox);
- Laya.timer.loop(1000, this, this.update);
- }
- update() {
- if (this.boxNum > 0 && this.boxNum < this.boxMax) {
- this.boxNum -= 1;
- this.upBar();
- }
- }
- upBar() {
- if (this.boxNum > this.boxMax)
- this.boxNum = this.boxMax;
- this.ui.bar.value = this.boxNum * 10;
- }
- show() {
- super.show();
- this.isClose = false;
- this.boxNum = 0;
- this.inAd = false;
- this.upBar();
- this.ui.t0.play();
- this.ui.closeBtn.visible = false;
- Laya.timer.once(3000, this, () => {
- this.ui.closeBtn.visible = true;
- this.ui.bar.alpha = 1;
- });
- Laya.timer.once(500, this, () => {
- this.ui.t1.play();
- });
- }
- hide() {
- Laya.timer.clearAll(this);
- Moyu.showBannerAd(false);
- super.hide();
- }
- onOpenBox() {
- this.boxNum++;
- if (this.boxNum < this.boxMax) {
- if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
- Moyu.showInsertAd(0, PlatMgr.insertGap);
- }
- else if (this.boxNum == this.boxMax) {
- if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
- this.ui.openBtn.c1.selectedIndex = 13;
- this.inAd = true;
- }
- else
- this.getAward();
- }
- else if (this.inAd) {
- console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_UIBOX_onOpenBox();
- }
- }
- this.upBar();
- }
- qjff_AD_for_UIBOX_onOpenBox() {
- this.getAward();
- }
- onCloseBox() {
- if (this.isClose)
- this.hide();
- else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
- this.isClose = true;
- PlatMgr.showBanner(true, 0, 3000);
- }
- else
- this.hide();
- }
- getAward() {
- let str = "";
- if (Math.random() < 0.5) {
- let max = Moyu.isLegal ? 500 : 2500;
- let num = xGame.tools.random(max, 500 + max);
- DataMgr.setCoin(num);
- str = "金币x" + num;
- }
- else {
- let max = Moyu.isLegal ? 10 : 30;
- let num = xGame.tools.random(max, 30 + max);
- DataMgr.setDiamond(num);
- str = "钻石x" + num;
- }
- xGame.showTip("恭喜获得-" + str);
- this.hide();
- }
- }
- UIBox.uiName = "UIBox";
- class ui_UITry extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UITry"));
- }
- onConstruct() {
- this.n11 = (this.getChild("n11"));
- this.myNode = (this.getChild("myNode"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
- class UITry extends UIBase {
- constructor() {
- super();
- this.closeTime = 0;
- this.closeNum = 0;
- this.skillUrl = xGame.common.skillIconList;
- }
- onConstructor() {
- this.ui = ui_UITry.createInstance();
- this.contentPane = this.ui;
- this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
- this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
- }
- show() {
- super.show();
- this.closeNum = 0;
- this.closeTime = 15;
- this.ui.t0.play();
- PlatMgr.showRateBanner();
- this.ui.myNode.txtTime.text = this.closeTime.toString();
- Laya.timer.loop(1000, this, this.updateTime);
- let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
- this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
- xGame.common.gameMgr.gamePause = true;
- }
- updateTime() {
- if (this.closeTime > 1) {
- this.closeTime--;
- this.ui.myNode.txtTime.text = this.closeTime.toString();
- }
- else
- this.hide();
- }
- hide() {
- Laya.timer.clearAll(this);
- Moyu.showBannerAd(false);
- super.hide();
- xGame.common.gameMgr.gamePause = false;
- }
- onTry() {
- console.log('zh:qjff_AD_for_uitry');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_uitry();
- }
- }
- qjff_AD_for_uitry() {
- let select = xGame.common.curPlayerSkillType;
- DataMgr.gameData.trySkill = select;
- DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
- DataMgr.saveGameData();
- DataMgr.setBigSkill(select, 1);
- xGame.showTip("Trial Successful");
- this.hide();
- }
- onCancel() {
- if (this.closeNum > 0) {
- this.closeNum--;
- if (this.closeNum < 2)
- this.hide();
- return;
- }
- else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
- this.onTry();
- }
- else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
- this.closeNum = 3;
- }
- else
- this.hide();
- }
- }
- UITry.uiName = "UITry";
- class PlatMgr {
- static initConfig() {
- this.lastVt = 0;
- if (!Moyu.platConfig)
- return;
- for (let k in Moyu.platConfig) {
- let pd = this[k];
- let pc = Moyu.platConfig[k];
- if (pd != undefined && pc != undefined)
- this[k] = pc;
- }
- Moyu.setBannerPos(0.5, 1);
- }
- static rand100(num) {
- return xGame.tools.random(0, 100) < num;
- }
- static isMisVideo() {
- let dt = Laya.timer.currTimer - this.lastVt;
- if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
- this.lastVt = Laya.timer.currTimer;
- return true;
- }
- else {
- if (this.rand100(this.fullVideoRate))
- Moyu.showInsertAd(0, 0, 'full');
- return false;
- }
- }
- static showVideo(call, type) {
- Moyu.showVideoAd(() => {
- this.lastVt = Laya.timer.currTimer;
- call && call();
- }, type);
- }
- static showInsert(delay = false) {
- if (this.getRand() < this.insertRate) {
- let dt = delay ? this.insertDelay : 0;
- Moyu.showInsertAd(dt, this.insertGap);
- }
- }
- static gameInsert() {
- if (this.getRand() < this.gameInsertRate) {
- console.log('zh: 游戏中插屏 hhhhhhhhhhhhhhhhhh');
- Moyu.showInsertAd(xGame.tools.random(2000, 5100), this.insertGap);
- }
- }
- static showRateBanner() {
- if (this.getRand() < this.bannerRate)
- this.showBanner(true, this.bannerDelay, 3000);
- }
- static showBanner(show, delay = 0, hide = 0) {
- if (!show)
- Moyu.showBannerAd(false);
- else {
- Laya.timer.clear(this, this.bannerShow);
- if (delay > 0)
- Laya.timer.once(delay, this, this.bannerShow, [true]);
- else
- this.bannerShow(true);
- if (hide > 0)
- Laya.timer.once(hide, this, this.bannerShow, [false]);
- }
- }
- static bannerShow(show) {
- Moyu.showBannerAd(show);
- console.log("showBanner" + show);
- }
- static getRand() {
- return xGame.tools.random(0, 100);
- }
- static openBox() {
- if (this.getRand() < this.boxRate)
- xGame.uiMgr.Show(UIBox);
- }
- static openTry() {
- if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
- return;
- if (this.getRand() < this.tryRate)
- xGame.uiMgr.Show(UITry);
- else if (DataMgr.gameData.gameCount == 1)
- xGame.uiMgr.Show(UITry);
- }
- }
- PlatMgr.forceShare = 0;
- PlatMgr.signAdRate = 0;
- PlatMgr.forceVideoRate = 0;
- PlatMgr.forceVideoGap = 0;
- PlatMgr.fullVideoRate = 0;
- PlatMgr.gameInsertRate = 0;
- PlatMgr.insertGap = 0;
- PlatMgr.insertDelay = 0;
- PlatMgr.insertRate = 0;
- PlatMgr.boxRate = 0;
- PlatMgr.boxVideoRate = 0;
- PlatMgr.boxInsertRate = 0;
- PlatMgr.boxBannerRate = 0;
- PlatMgr.tryRate = 0;
- PlatMgr.tryClose3Rate = 0;
- PlatMgr.tryVideoRate = 0;
- PlatMgr.bannerRate = 0;
- PlatMgr.lastVt = 0;
- class ui_UIAddProp extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIAddProp"));
- }
- onConstruct() {
- this.n11 = (this.getChild("n11"));
- this.myNode = (this.getChild("myNode"));
- this.closeBtn = (this.getChild("closeBtn"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
- class SpineMgr {
- constructor(name, loadCb = null) {
- this.loaded = false;
- this.spineName = '';
- this.loadedCallback = loadCb;
- this.templet = new Laya.Templet();
- this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
- this.templet.on(Laya.Event.ERROR, this, this.onError);
- if (name === 'mishu') {
- this.templet.loadAni('spine/nvmishu.sk');
- }
- else {
- this.templet.loadAni(`spine/${name}.sk`);
- }
- this.templet.lock = true;
- this.spineName = name;
- }
- onError() {
- console.log("zh:spine加载出错");
- }
- parseComplete() {
- this.loaded = true;
- this.loadedCallback && this.loadedCallback();
- }
- dispose() {
- if (this.templet && !this.templet.destroyed) {
- this.templet.destroy();
- }
- this.templet = null;
- }
- play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
- if (!this.loaded) {
- return;
- }
- let spine;
- if (mySpine) {
- spine = mySpine;
- }
- else {
- spine = this.createSpine(data, parent);
- }
- spine.play(aniIndex, isLoop, true, 0, 0, true);
- if (!isLoop) {
- spine.on(Laya.Event.STOPPED, this, () => {
- spine.offAll(Laya.Event.STOPPED);
- callback && callback(spine);
- });
- }
- return spine;
- }
- createSpine(data, parent, type = 1) {
- let spine;
- spine = this.templet.buildArmature(type);
- spine.showSkinByIndex(0);
- parent.addChild(spine);
- spine.pos(data.x, data.y);
- spine.scale(data.scaleX, data.scaleY, true);
- return spine;
- }
- }
- var AIState;
- (function (AIState) {
- AIState[AIState["none"] = 0] = "none";
- AIState[AIState["idle"] = 1] = "idle";
- AIState[AIState["reset"] = 2] = "reset";
- AIState[AIState["move"] = 3] = "move";
- AIState[AIState["wait"] = 4] = "wait";
- AIState[AIState["select"] = 5] = "select";
- AIState[AIState["turn"] = 6] = "turn";
- AIState[AIState["shoot"] = 7] = "shoot";
- AIState[AIState["leave"] = 8] = "leave";
- })(AIState || (AIState = {}));
- class AIPlayer {
- constructor() {
- this.dtime = 30;
- this.awayTime = 0;
- this.awayNum = 0;
- this.hideTime = 0;
- this.rootMoveTime = 0;
- this.isGuide = false;
- this.state = AIState.none;
- this.waitTime = 0;
- this.forceNum = 0;
- this.forceMax = 0;
- this.ballSize = 33;
- this.selectNum = 0;
- this.destRot = 0;
- this.aiLv = 10;
- this.kickBall = [];
- this.lineBall = [];
- this.scoreBall = [];
- this.holeBall = [];
- this.turnNum = 0;
- this.setNum = 0;
- this.setMax = 0;
- this.setRate = 0;
- this.rectL = 0;
- this.rectR = 0;
- this.rectT = 0;
- this.rectB = 0;
- this.rootPos = { x: 0, y: 0 };
- this.bestForce = 0;
- this.bestAngle = 180;
- this.bestPos = { x: 0, y: 0 };
- this.bestKick = { x: 0, y: 0 };
- this.posList = [];
- this.posIdx = 0;
- this.chatTime = 3000;
- this.tempDir1 = new Laya.Vector2();
- this.tempDir2 = new Laya.Vector2();
- this.tempDir3 = new Laya.Vector2();
- Laya.timer.loop(this.dtime, this, this.onUpdate);
- xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
- xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
- this.gameSrc = xGame.common.gameUI;
- this.hideTime = Laya.timer.currTimer;
- Moyu.setOnTipCall((id) => {
- if (id == 20012)
- this.hideTime = Laya.timer.currTimer;
- else
- (id == 20011);
- {
- let dt = Laya.timer.currTimer - this.hideTime;
- console.log("onshow" + dt);
- if (dt > 30000 && this.state > AIState.none)
- xGame.common.gameMgr.aiGameEnd(false);
- }
- }, this);
- }
- init() {
- this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
- this.awayTime = xGame.tools.random(5000, 10000);
- this.awayNum = 0;
- this.hideTime = Laya.timer.currTimer;
- let rect = xGame.common.d2World.borderRect;
- this.rectL = Math.ceil(rect.x) + 17;
- this.rectT = Math.ceil(rect.y) + 17;
- this.rectR = Math.floor(rect.x + rect.width) - 17;
- this.rectB = Math.floor(rect.y + rect.height) - 17;
- this.wBall = xGame.common.d2World.rootBall;
- this.ballSize = this.wBall.gameObj.width - 1;
- if (this.posList.length < 1) {
- let dp = 40;
- for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
- for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
- let dx = i < this.rectR ? i : this.rectR;
- let dy = j < this.rectB ? j : this.rectB;
- let order = xGame.tools.random(0, 1000);
- this.posList.push({ x: dx, y: dy, order: order });
- }
- }
- this.posList.sort(function (a, b) {
- return a.order - b.order;
- });
- this.setMax = this.posList.length;
- }
- this.state = AIState.idle;
- }
- setAiLevel(num) {
- this.aiLv = num;
- }
- initBall() {
- this.rootPos.x = this.wBall.gameObj.x;
- this.rootPos.y = this.wBall.gameObj.y;
- this.initHoleBall();
- }
- initHoleBall() {
- this.kickBall = [];
- this.lineBall = [];
- this.scoreBall = [];
- this.holeBall = [];
- this.selectNum = 0;
- this.forceNum = 0;
- this.forceMax = 0;
- this.turnNum = 0;
- let list = xGame.common.d2World.ballArr;
- if (list.length < 20 && !this.isGuide) {
- let holes = xGame.common.gameMgr.holePosList;
- for (let i = 0; i < list.length; i++) {
- let obj = list[i];
- if (!obj)
- continue;
- obj.kickPos.x = 0;
- obj.kickPos.y = 0;
- obj.poleAngle = 0;
- obj.hard = 0;
- obj.borderDis = 0;
- obj.kickAngle = 180;
- if (obj.number == 0)
- continue;
- if (obj.ballType == xGame.common.gameMgr.selfCamp)
- continue;
- if (obj.number == 8 && xGame.common.gameMode == 0) {
- if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
- continue;
- }
- let b = obj.gameObj;
- let wbp = this.rootPos;
- let bx = wbp.x - b.x;
- let by = wbp.y - b.y;
- obj.borderDis = xGame.tools.random(0, 100);
- this.kickBall.push(obj);
- if (!this.isLine(wbp, obj))
- continue;
- obj.kickAngle = xGame.tools.random(90, 180);
- obj.kickPos.x = b.x;
- obj.kickPos.y = b.y;
- this.lineBall.push(obj);
- let minDis = 999999;
- let hole = false;
- for (let j = 0; j < holes.length; j++) {
- let hp = holes[j];
- if (bx >= 0 && hp.x > b.x + 100)
- continue;
- if (bx <= 0 && hp.x < b.x - 100)
- continue;
- if (by < -10 && hp.y < wbp.y)
- continue;
- if (by > 10 && hp.y > wbp.y)
- continue;
- if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
- let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
- if (dis < minDis) {
- let dx = b.x - this.tempDir1.x * this.ballSize;
- let dy = b.y - this.tempDir1.y * this.ballSize;
- this.tempDir3.x = this.tempDir1.x;
- this.tempDir3.y = this.tempDir1.y;
- if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
- obj.kickPos.x = dx;
- obj.kickPos.y = dy;
- let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
- if (num > 1)
- num = 1;
- obj.kickAngle = Math.acos(num) * 57.3;
- if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
- dis = dis * 2;
- if (Math.abs(hp.x - 600) < 100)
- dis += 50;
- obj.hard = dis + obj.kickAngle * 3;
- hole = true;
- }
- }
- }
- }
- if (hole) {
- this.scoreBall.push(obj);
- this.holeBall.push(obj);
- }
- }
- this.scoreBall.sort(function (a, b) {
- return a.hard - b.hard;
- });
- this.holeBall.sort(function (a, b) {
- return a.kickAngle - b.kickAngle;
- });
- this.kickBall.sort(function (a, b) {
- return a.borderDis - b.borderDis;
- });
- }
- else {
- let max = list.length - 1;
- let i = xGame.tools.random(0, max);
- for (i; i <= max; i++) {
- let idx = i >= max ? i -= max : i;
- let obj = list[idx];
- if (obj && obj.number != 0) {
- obj.kickAngle = xGame.tools.random(90, 180);
- obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
- obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
- this.lineBall.push(obj);
- break;
- }
- }
- }
- }
- selectBall() {
- let ball = null;
- this.destRot = 0;
- let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
- let ai = 110 - this.aiLv * 10;
- let mis = xGame.tools.random(-ai, ai) * 0.005;
- let score = false;
- if (this.scoreBall.length < 1) {
- if (this.lineBall.length < 1) {
- for (let i = 0; i < this.kickBall.length; i++) {
- let list = [];
- let bo = this.kickBall[i];
- let bobj = bo.gameObj;
- let rect = xGame.common.d2World.borderRect;
- let mobj = this.wBall.gameObj;
- let minb = bobj.y - rect.y - 20;
- let minw = mobj.y - rect.y - 50;
- if (minb > 0 && minw > 0) {
- let dlenx = 0;
- let dleny = mobj.y - rect.y;
- let spx = mobj.x;
- let spy = rect.y - dleny;
- list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
- }
- minb = rect.y + rect.height - bobj.y - 20;
- minw = rect.y + rect.height - mobj.y - 50;
- if (minb > 0 && minw > 0) {
- let dlenx = 0;
- let dleny = rect.y + rect.height - mobj.y;
- let spx = mobj.x;
- let spy = rect.y + rect.height + dleny;
- list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
- }
- minb = bobj.x - rect.x - 20;
- minw = mobj.x - rect.x - 50;
- if (minb > 0 && minw > 0) {
- let dlenx = mobj.x - rect.x;
- let dleny = 0;
- let spx = rect.x - dlenx;
- let spy = mobj.y;
- list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
- }
- minb = rect.x + rect.width - bobj.x - 20;
- minw = rect.x + rect.width - mobj.x - 50;
- if (minb > 0 && minw > 0) {
- let dlenx = rect.x + rect.width - mobj.x;
- let dleny = 0;
- let spx = rect.x + rect.width + dlenx;
- let spy = mobj.y;
- list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
- }
- list.sort(function (a, b) {
- return a.order - b.order;
- });
- for (let i = 0; i < list.length; i++) {
- let data = list[i];
- let mx = mobj.x - bobj.x;
- let my = mobj.y - bobj.y;
- xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
- xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
- let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
- if (num > 1)
- num = 1;
- let cos = Math.acos(num);
- if (cos > 1.57)
- cos = 1.57;
- else if (cos < 0.01)
- cos = 0.01;
- let tan = Math.tan(cos);
- let dx = tan * data.dleny;
- let dy = tan * data.dlenx;
- let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
- if (Math.abs(bx - 667) < 40)
- continue;
- let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
- if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
- let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
- this.forceMax = dis * 0.08;
- this.destRot += mis * 0.1;
- this.setKick(bx, by);
- return true;
- }
- }
- }
- }
- else {
- ball = xGame.common.getRandArrEle(this.lineBall);
- }
- }
- else {
- for (let i = 0; i < this.scoreBall.length; i++) {
- if (i < this.scoreBall.length - 1) {
- let rand = 70 + this.aiLv * 10 + i * 10;
- if (xGame.tools.random(0, 100) < rand) {
- ball = this.scoreBall[i];
- break;
- }
- }
- else {
- ball = this.scoreBall[i];
- break;
- }
- }
- score = true;
- this.selectNum++;
- }
- if (!ball)
- ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
- if (this.selectNum >= max) {
- let dx = ball.gameObj.x;
- let dy = ball.gameObj.y;
- let kickAngle = 0;
- if (score) {
- dx = ball.kickPos.x;
- dy = ball.kickPos.y;
- this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
- this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
- let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
- if (adot > 1)
- adot = 1;
- kickAngle = Math.acos(adot) * 57.3;
- if (kickAngle > 45) {
- let kdx = ball.kickPos.x - ball.gameObj.x;
- let kdy = ball.kickPos.y - ball.gameObj.y;
- dx = ball.kickPos.x - kdx * mis * 0.3;
- dy = ball.kickPos.y - kdy * mis * 0.3;
- }
- else
- this.destRot += mis;
- }
- else if (ball.poleAngle != 0) {
- this.destRot += ball.poleAngle;
- }
- if (xGame.common.gameMode == 0) {
- let af = kickAngle * 0.08;
- this.forceMax = ball.hard * 0.1 + af * af;
- }
- this.setKick(dx, dy);
- }
- else {
- let rand = this.aiLv * 5 + 40;
- if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
- ball = xGame.common.getRandArrEle(this.scoreBall);
- else
- ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
- rand = this.aiLv * 3 + 40 + this.selectNum * 20;
- if (xGame.tools.random(0, 100) > rand) {
- this.selectNum = max;
- }
- this.setState(AIState.select, xGame.tools.random(500, 1000));
- this.selectNum++;
- }
- ball.onClick(0, true);
- }
- isBlock(bn, bx, by, hx, hy, dn = -1) {
- this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
- let balls = xGame.common.d2World.ballArr;
- let max = xGame.tools.getDis(hx, hy, bx, by);
- for (let index = 0; index < balls.length; index++) {
- let obj = balls[index];
- if (obj.number == 0)
- continue;
- if (obj.number == bn || obj.number == dn)
- continue;
- let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
- if (dis * dis > max)
- continue;
- this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
- let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
- if (num > 1)
- num = 1;
- if (num < 0)
- continue;
- let gap = Math.sin(Math.acos(num)) * dis;
- if (gap < this.ballSize)
- return true;
- }
- return false;
- }
- isLine(xy, ball) {
- let bx = xy.x;
- let by = xy.y;
- if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
- let dis = ball.getDestDis(xy);
- let angle = Math.asin((ball.gameObj.width - 3) / dis);
- let sin = Math.sin(angle);
- let cos = Math.cos(angle);
- this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
- this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
- this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
- let dx = bx + this.tempDir2.x * dis;
- let dy = by + this.tempDir2.y * dis;
- let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
- sin = Math.sin(-angle);
- cos = Math.cos(-angle);
- this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
- this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
- dx = bx + this.tempDir2.x * dis;
- dy = by + this.tempDir2.y * dis;
- let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
- if (isr && isl)
- return false;
- ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
- }
- return true;
- }
- turnPole() {
- this.turnNum++;
- let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
- let dr = rot - this.destRot;
- let abs = Math.abs(dr) % 360;
- if (abs > 180) {
- if (rot > 180)
- rot -= 360;
- if (this.destRot > 180)
- this.destRot -= 360;
- }
- let max = this.turnNum * 5 + this.aiLv * 5;
- if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
- xGame.common.d2World.d2Gan.rotDest(this.destRot);
- let at = xGame.tools.random(1000, 2000);
- if (!this.onAway(3))
- at += xGame.tools.random(10000, 15000);
- this.setState(AIState.shoot, at);
- }
- else {
- let mr = 0;
- if (abs > 3)
- mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
- else if (Math.random() > 0.6)
- mr = xGame.tools.random(1, 10) * 0.1;
- mr = dr > 0 ? -mr : mr;
- xGame.common.d2World.d2Gan.rotDest(rot + mr);
- }
- }
- setKick(dx, dy) {
- this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
- this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
- this.tempDir1.x = 0;
- this.tempDir1.y = 1;
- this.tempDir2.y = -this.tempDir2.y;
- let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
- if (num > 1)
- num = 1;
- let rot = Math.acos(num) * 57.3;
- if (this.tempDir2.x < 0)
- rot = 360 - rot;
- this.destRot += rot;
- if (!xGame.common.gameMgr.finishOneShoot) {
- this.forceMax += xGame.tools.random(10, 50);
- this.forceMax -= this.aiLv * 2;
- if (this.forceMax < 20)
- this.forceMax = 20;
- }
- if (this.forceMax > 100)
- this.forceMax = 101;
- else if (this.forceMax < 10)
- this.forceMax += xGame.tools.random(0, 10);
- if (xGame.common.gameMode == 1)
- this.forceMax = xGame.tools.random(80, 100);
- else
- this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
- let max = 2000 - this.aiLv * 100;
- if (Math.random() > 0.8)
- max += xGame.tools.random(100, 2000);
- this.setState(AIState.turn, xGame.tools.random(500, max));
- }
- shoot() {
- if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
- if (Math.random() > 0.8) {
- this.gameSrc.aiForce(1);
- this.setState(AIState.wait);
- }
- }
- else {
- let df = xGame.tools.random(3, 8);
- if (this.forceNum < this.forceMax)
- this.forceNum += df;
- else
- this.forceNum -= df;
- let startY = this.gameSrc.ui.powerNode.y;
- let height = this.gameSrc.ui.powerNode.height;
- let force = startY + height * this.forceNum * 0.01;
- this.gameSrc.aiForce(2, force);
- }
- }
- reset() {
- for (let i = 0; i < 4; i++) {
- this.setRate--;
- this.setNum++;
- let pos = this.posList[this.posIdx];
- this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
- this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
- if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
- this.rootPos.x = 387;
- if (this.rootPos.x < this.rectL)
- this.rootPos.x = this.rectL;
- else if (this.rootPos.x > this.rectR)
- this.rootPos.x = this.rectR;
- if (this.rootPos.y < this.rectT)
- this.rootPos.y = this.rectT;
- else if (this.rootPos.y > this.rectB)
- this.rootPos.y = this.rectB;
- this.posIdx++;
- let max = this.posList.length;
- if (this.posIdx >= max)
- this.posIdx -= max;
- this.initHoleBall();
- let ball = null;
- if (this.scoreBall.length > 0)
- ball = this.scoreBall[0];
- else if (this.lineBall.length > 0)
- ball = xGame.common.getRandArrEle(this.lineBall);
- if (ball && ball.kickAngle < this.bestAngle) {
- this.bestAngle = ball.kickAngle;
- this.bestKick.x = ball.kickPos.x;
- this.bestKick.y = ball.kickPos.y;
- this.bestPos.x = this.rootPos.x;
- this.bestPos.y = this.rootPos.y;
- this.bestForce = ball.hard * 0.08;
- }
- }
- if (this.setNum >= this.setMax)
- this.setMax = 0;
- if (this.setRate < 1) {
- this.setState(AIState.move, 0);
- this.rootMoveTime = Laya.timer.currTimer;
- this.gameSrc.aiRootMove(true);
- }
- }
- delayLine() {
- this.gameSrc.aiRootMove(false);
- }
- move() {
- if (this.bestPos.x < 1)
- this.bestPos = this.rootPos;
- let wObj = this.wBall.gameObj;
- let destx = wObj.x;
- let desty = wObj.y;
- let dx = Math.abs(destx - this.bestPos.x);
- let dy = Math.abs(desty - this.bestPos.y);
- let mx = 3 + dx * 0.03;
- let my = 3 + dy * 0.03;
- if (dx < 4 && dy < 4) {
- let dt = Laya.timer.currTimer - this.rootMoveTime;
- dt = dt < 1000 ? 1000 - dt : 0;
- if (this.setMax > 0) {
- let min = this.setMax * 0.3 + this.aiLv * 5;
- this.setRate = xGame.tools.random(min, this.setMax);
- this.setState(AIState.reset, 0);
- }
- else {
- this.destRot = 0;
- this.forceMax = this.bestForce;
- this.setKick(this.bestKick.x, this.bestKick.y);
- }
- if (dt > 100) {
- Laya.timer.clear(this, this.delayLine);
- Laya.timer.once(dt, this, this.delayLine);
- }
- else
- this.gameSrc.aiRootMove(false);
- }
- else {
- if (dx > 4)
- destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
- if (dy > 4)
- desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
- this.gameSrc.onRootMove({ x: destx, y: desty });
- }
- }
- resetRoot() {
- this.bestAngle = 180;
- this.bestForce = 0;
- this.setMax = this.posList.length;
- this.posIdx = xGame.tools.random(0, this.setMax);
- let min = this.setMax * 0.3 + this.aiLv * 5;
- this.setRate = xGame.tools.random(min, this.setMax);
- let max = 2000 - this.aiLv * 100;
- if (Math.random() > 0.8)
- max += xGame.tools.random(100, 1000);
- if (this.isGuide)
- this.setState(AIState.select, 500);
- else if (this.onAway(2))
- this.setState(AIState.reset, xGame.tools.random(400, max));
- else
- this.setState(AIState.none);
- if (xGame.common.gameMgr.finishOneShoot)
- this.chat();
- }
- runAI() {
- if (this.state > AIState.idle)
- return;
- this.initBall();
- this.onGame(2500);
- if (Math.random() > 0.6)
- this.chat();
- }
- stopRun() {
- this.setState(AIState.idle);
- }
- onGame(base) {
- let max = base - this.aiLv * 100;
- if (Math.random() > 0.8)
- max += xGame.tools.random(100, 1000);
- if (this.onAway(2))
- this.setState(AIState.select, xGame.tools.random(500, max));
- else
- this.setState(AIState.none);
- }
- setState(sta, wt = 0) {
- if (this.state == AIState.none)
- return;
- this.state = sta;
- this.waitTime = wt;
- }
- onUpdate() {
- if (this.state == AIState.none)
- return;
- this.awayTime -= this.dtime;
- if (this.awayTime < 1) {
- this.awayTime = xGame.tools.random(6000, 10000);
- this.awayNum += (11 - this.aiLv);
- this.onAway(1);
- }
- if (this.waitTime >= 0) {
- this.waitTime -= this.dtime;
- return;
- }
- switch (this.state) {
- case AIState.idle:
- this.chat();
- break;
- case AIState.reset:
- this.reset();
- break;
- case AIState.move:
- this.move();
- break;
- case AIState.leave:
- this.state = AIState.none;
- xGame.common.gameMgr.aiGameEnd(true);
- break;
- case AIState.select:
- this.selectBall();
- break;
- case AIState.turn:
- this.turnPole();
- break;
- case AIState.shoot:
- this.shoot();
- break;
- }
- }
- onAway(type) {
- if (type == 1) {
- let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
- let num = this.awayNum + db * 20;
- if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
- xGame.common.gameMgr.aiLeave();
- this.setState(AIState.leave, 6666);
- }
- }
- else if (type == 2) {
- let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
- let num = this.awayNum + db * 30;
- if (xGame.tools.random(0, 10000) < num)
- return false;
- }
- else if (type == 3) {
- let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
- let num = this.awayNum + db * 10;
- if (xGame.tools.random(0, 4000) < num)
- return false;
- }
- return true;
- }
- chat() {
- if (this.chatTime > 0) {
- this.chatTime -= this.dtime;
- return;
- }
- this.chatTime = xGame.tools.random(2000, 10000);
- let rand = xGame.tools.random(0, 100);
- if (rand < 15)
- this.talk();
- else if (rand < 35)
- this.emotion();
- }
- talk() {
- xGame.common.talkMgr.showAITalk(0);
- }
- emotion() {
- xGame.common.talkMgr.showAIEmotion(0);
- }
- resetAI() {
- this.stopRun();
- this.state = AIState.none;
- }
- }
- class Partical extends Laya.Script3D {
- constructor() {
- super();
- this.duration = 2000;
- }
- ;
- onAwake() {
- this.gameObj = this.owner;
- }
- onEnable() {
- this.openTimer();
- }
- openTimer() {
- Laya.timer.once(this.duration, this, this.disappear);
- }
- setCallback(obj, callback) {
- this.obj = obj;
- this.callback = callback;
- Laya.timer.clearAll(this);
- Laya.timer.once(this.duration, this, this.disappear);
- }
- disappear() {
- xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
- this.callback && this.callback(this.obj);
- }
- }
- class Ball extends Laya.Script3D {
- constructor() {
- super();
- this.posV3 = new Laya.Vector3();
- this.rotRate = 2.1;
- this.rotSpeed = new Laya.Vector3();
- this.myIndex = 0;
- }
- onAwake() {
- this.gameObj = this.owner;
- this.transform = this.gameObj.transform;
- this.ballNode = this.gameObj.getChildByName("Ball");
- this.shadowNode = this.gameObj.getChildByName("shadow");
- }
- initSelf(index, x, y, owner) {
- this.d2BallSrc = owner;
- this.myIndex = index;
- this.setAlbedoTexture();
- this.setTransPos(x, y);
- this.setScale();
- this.ballNode.transform.localRotationEulerX = 90;
- if (index == 0) {
- }
- }
- setAlbedoTexture(isIce = false) {
- let url;
- if (isIce) {
- url = `res/d3Res/ballTexture/ice.jpg`;
- }
- else {
- url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
- }
- Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
- this.ballNode.meshRenderer.material["albedoTexture"] = tex;
- }));
- }
- runFireworks(obj, delay, callback) {
- Laya.timer.clearAll(this);
- Laya.timer.once(delay + 1, this, () => {
- let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
- fire.transform.localPositionX = this.transform.localPositionX;
- fire.transform.localPositionY = this.transform.localPositionY;
- fire.transform.localPositionZ = this.transform.localPositionZ;
- let src = fire.getComponent(Partical);
- src.duration = 1000;
- src.setCallback(obj, callback);
- let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
- eft.transform.localPositionX = this.transform.localPositionX;
- eft.transform.localPositionY = this.transform.localPositionY;
- eft.transform.localPositionZ = this.transform.localPositionZ;
- });
- }
- setTransPos(x, y) {
- this.setRotation();
- xGame.common.pos2to3Convert(x, y, this.posV3);
- this.transform.localPositionX = this.posV3.x;
- this.transform.localPositionY = 0;
- this.transform.localPositionZ = this.posV3.z;
- this.transform.localRotationEulerX = 0;
- this.transform.localRotationEulerY = 0;
- this.transform.localRotationEulerZ = 0;
- this.shadowNode.transform.localPositionX = this.posV3.x / 30;
- this.shadowNode.transform.localPositionY = 0.1;
- this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
- }
- setRotation() {
- if (this.d2BallSrc.canRot) {
- let speed = this.d2BallSrc.rigy.linearVelocity;
- this.rotSpeed.x = speed.x * this.rotRate;
- this.rotSpeed.z = speed.y * this.rotRate;
- this.rotSpeed.y = this.d2BallSrc.rotY;
- this.ballNode.transform.rotate(this.rotSpeed, false, false);
- }
- else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
- this.rotSpeed.x = this.rotSpeed.y = 0;
- this.rotSpeed.y = this.d2BallSrc.rotY;
- this.ballNode.transform.rotate(this.rotSpeed, false, false);
- }
- }
- setScale() {
- let radius = xGame.common.d2World.rootBall.ui.width;
- let scale = xGame.common.scale2to3Convert(radius);
- this.transform.localScaleX = scale;
- this.transform.localScaleY = scale;
- this.transform.localScaleZ = scale;
- }
- playInHoleEft() {
- let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
- eft.transform.position = this.transform.position;
- }
- playIceEft() {
- let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
- eft.transform.position = this.transform.position;
- }
- get scaleXYZ() {
- return this.transform.localScaleX;
- }
- set scaleXYZ(val) {
- this.transform.localScaleX = val;
- this.transform.localScaleY = val;
- this.transform.localScaleZ = val;
- }
- get posX() {
- return this.transform.localPositionX;
- }
- set posX(val) {
- this.transform.localPositionX = val;
- }
- get posY() {
- return this.transform.localPositionY;
- }
- set posY(val) {
- this.transform.localPositionY = val;
- }
- get posZ() {
- return this.transform.localPositionZ;
- }
- set posZ(val) {
- this.transform.localPositionZ = val;
- }
- destroySelf() {
- this.posV3 = null;
- this.rotSpeed = null;
- this.d2BallSrc = null;
- this.ballNode = null;
- this.gameObj.destroy(true);
- this.transform = null;
- this.destroy();
- }
- }
- class ui_D2Ball extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "D2Ball"));
- }
- onConstruct() {
- this.myIcon = (this.getChild("myIcon"));
- this.inner = (this.getChild("inner"));
- this.n8 = (this.getChild("n8"));
- this.n4 = (this.getChild("n4"));
- this.wrongTips = (this.getChild("wrongTips"));
- this.rightTips = (this.getChild("rightTips"));
- this.breathAni = this.getTransition("breathAni");
- }
- }
- ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
- class D2BallSrc extends Laya.Script {
- constructor() {
- super();
- this.number = 0;
- this.startX = 0;
- this.startY = 0;
- this.angleV2 = new Laya.Vector2();
- this.isRootBall = false;
- this.isBlackBall = false;
- this.ballType = "";
- this.canRot = true;
- this.rotY = 0;
- this.poleAngle = 0;
- this.kickPos = { x: 0, y: 0 };
- this.hard = 0;
- this.kickAngle = 0;
- this.borderDis = 0;
- this.speedP10 = 5.6;
- this.lastSpeed = { x: 0, y: 0 };
- this.stillSpeed = 0.12;
- this.ballFunc = "normal";
- this.isRunSkillAni = false;
- this.isInHole = false;
- this.iceOwner = "";
- this.forceRun = false;
- this.myUNID = "";
- this.rectL = 0;
- this.rectR = 0;
- this.rectT = 0;
- this.rectB = 0;
- this.forceVec = new Laya.Vector2();
- this.lastDis = 0;
- this.helpOut = { type: "", x: 0, y: 0 };
- }
- initSelf(number, x, y, d3Ball) {
- if (!this.gameObj)
- this.gameObj = this.owner;
- this.number = number;
- this.startX = x;
- this.startY = y;
- this.d3Ball = d3Ball;
- this.isRootBall = false;
- this.isBlackBall = false;
- this.ballType = "";
- if (number == 0) {
- this.isRootBall = true;
- }
- else if (number == 8) {
- this.isBlackBall = true;
- }
- else {
- if (number <= 7) {
- this.ballType = ballCamp.full;
- }
- else {
- this.ballType = ballCamp.flower;
- }
- }
- this.setInfo();
- this.setD3Ball();
- this.owner["mySrc"] = this;
- this.rigy.linearDamping = 1;
- D2BallSrc._unid++;
- this.myUNID = "d2ball" + D2BallSrc._unid;
- let rect = xGame.common.d2World.borderRect;
- this.rectL = Math.ceil(rect.x) + 20;
- this.rectT = Math.ceil(rect.y) + 20;
- this.rectR = Math.floor(rect.x + rect.width) - 20;
- this.rectB = Math.floor(rect.y + rect.height) - 20;
- }
- setInfo() {
- this.gameObj.x = this.startX;
- this.gameObj.y = this.startY;
- let radius = this.ui.width / 2;
- this.gameObj.width = radius * 2;
- this.gameObj.height = radius * 2;
- if (xGame.common.showDebug) {
- this.ui.myIcon.alpha = 1;
- this.ui.inner.alpha = 1;
- }
- else {
- this.ui.myIcon.alpha = 0;
- this.ui.inner.alpha = 0;
- }
- }
- setD3Ball() {
- this.d3Ball = this.d3Ball;
- this.d3BallSrc = this.d3Ball.getComponent(Ball);
- this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
- }
- onUpdate() {
- if (xGame.common.gameMgr.gamePause)
- return;
- if (this.isInHole)
- return;
- if (!xGame.common.d2World.openCheckStill)
- return;
- this.runBall();
- }
- runBall() {
- this.lastSpeed.x = this.rigy.linearVelocity.x;
- this.lastSpeed.y = this.rigy.linearVelocity.y;
- this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
- this.judgeBorder();
- }
- getDestDis(dest) {
- return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
- }
- setmyXY(x, y) {
- this.d3BallSrc.setTransPos(x, y);
- }
- getSpeed() {
- let speed = this.rigy.linearVelocity;
- return speed.x * speed.x + speed.y * speed.y;
- }
- onTriggerEnter(collider) {
- if (!collider || !collider.owner)
- return;
- let coll = "collide";
- let speed = this.getSpeed();
- let sv2 = this.speedP10 * this.speedP10;
- if (collider.label == "ball") {
- if (speed < 9 && this.number != 0)
- coll = "";
- else if (speed < sv2)
- coll = "collide_4";
- else if (speed < sv2 * 6.2)
- coll = "collide_3";
- else if (speed < sv2 * 25)
- coll = "collide_2";
- else if (speed < sv2 * 56)
- coll = "collide_1";
- xGame.soundMgr.playSound(coll);
- if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
- if (collider.owner) {
- let rig = collider.owner.getComponent(D2BallSrc);
- if (Math.abs(rig.rigy.linearVelocity.x) > 0)
- rig.lastSpeed.x = rig.rigy.linearVelocity.x;
- if (Math.abs(rig.rigy.linearVelocity.y) > 0)
- rig.lastSpeed.y = rig.rigy.linearVelocity.y;
- let vx = Math.abs(rig.lastSpeed.x * 0.4);
- let vy = Math.abs(rig.lastSpeed.y * 0.5);
- let rx = 0;
- let ry = 0;
- if (this.gameObj.x < this.rectL)
- rx = vx;
- else if (this.gameObj.x > this.rectR)
- rx = -vx;
- else if (this.gameObj.y < this.rectT)
- ry = vy;
- else if (this.gameObj.y > this.rectB)
- ry = -vy;
- this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
- }
- }
- if (this.number != 0) {
- return;
- }
- else {
- if (this.forceRun) {
- console.log("randon force");
- this.applyForce(collider);
- }
- }
- if (xGame.common.d2World.isOnSameLine) {
- xGame.common.d2World.isOnSameLine = false;
- this.rigy.linearVelocity = { x: 0, y: 0 };
- }
- if (xGame.common.gameMgr.firstColliObj == null) {
- xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
- xGame.common.gameMgr.isTouchedBall = true;
- }
- }
- else {
- xGame.common.recoverCameraView();
- let wallStr = "";
- if (speed < 9) { }
- else if (speed < sv2) { }
- else if (speed < sv2 * 6.2)
- wallStr = "wall_30";
- else if (speed < sv2 * 25)
- wallStr = "wall_50";
- else if (speed < sv2 * 56)
- wallStr = "wall_80";
- xGame.soundMgr.playSound(wallStr);
- }
- }
- applyForce(collider) {
- let src = collider.owner.mySrc;
- this.forceVec.x = src.gameObj.x - this.gameObj.x;
- this.forceVec.y = src.gameObj.y - this.gameObj.y;
- Laya.Vector2.normalize(this.forceVec, this.forceVec);
- Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
- src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
- }
- checkWrongBall(playEft = true) {
- if (this.isInHole)
- return;
- xGame.common.gameMgr.inHoleBalls.push(this.number);
- if (this.number != 0 && playEft)
- this.d3BallSrc.playInHoleEft();
- let coll = "inpocket_1";
- let speed = this.getSpeed();
- let sv2 = this.speedP10 * this.speedP10 * 0.8;
- if (speed < 9 && this.number != 0)
- coll = "";
- else if (speed < sv2 * 6.2)
- coll = "inpocket_4";
- else if (speed < sv2 * 25)
- coll = "collide_3";
- else if (speed < sv2 * 56)
- coll = "collide_2";
- xGame.soundMgr.playSound(coll);
- this.isInHole = true;
- if (this.number == 0) {
- console.log("白球进了。。");
- this.reset();
- this.rigy.linearVelocity = { x: 0, y: 0 };
- this.hideSelf();
- xGame.common.gameUI.ui.whiteAni.visible = true;
- xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
- xGame.common.gameUI.ui.whiteAni.visible = false;
- }));
- }
- else {
- xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
- xGame.common.d2World.removeOneBall(this);
- this.destroySelf();
- xGame.common.playHappySound(this.number);
- this.runFlyEft();
- }
- }
- runFlyEft() {
- if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
- xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
- }
- }
- hideSelf() {
- if (this.d3Ball)
- this.d3Ball.active = false;
- }
- showSelf() {
- this.isInHole = false;
- if (this.d3Ball && !this.d3Ball.active)
- this.d3Ball.active = true;
- }
- isStill() {
- let speed = this.rigy.linearVelocity;
- if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
- this.rigy.linearVelocity = { x: 0, y: 0 };
- return true;
- }
- return false;
- }
- reset() {
- }
- destroySelf() {
- this.d3BallSrc.destroySelf();
- if (!this.ui.isDisposed) {
- this.ui.removeFromParent();
- this.ui.dispose();
- this.ui = null;
- }
- this.outColli = null;
- this.innerColli = null;
- this.rigy = null;
- this.d3Ball = null;
- this.d3BallSrc = null;
- this.angleV2 = null;
- this.gameObj.destroy(true);
- this.destroy();
- }
- judgeBorder() {
- if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
- return;
- }
- if (this.destroyed)
- return;
- if (xGame.common.gameMode == GameMode.classic)
- return;
- let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
- if (isOver) {
- this.checkWrongBall();
- }
- }
- onClick(e, force = false) {
- if (this.number == 0)
- return;
- if (force) {
- }
- else {
- if (xGame.common.d2World.openCheckStill)
- return;
- if (!xGame.common.gameMgr.selfTurn) {
- return;
- }
- }
- if (!xGame.common.gameMgr.finishOneShoot)
- return;
- let root = xGame.common.d2World.rootBall.gameObj;
- let x = this.gameObj.x - root.x;
- let y = this.gameObj.y - root.y;
- let angle = xGame.common.getfguiRotation(x, y);
- xGame.common.d2World.d2Gan.ui.rotation = angle;
- xGame.common.d2World.getHelpLine();
- xGame.common.clickedBall = true;
- this.checkGuide();
- }
- checkGuide() {
- let guide = DataMgr.getSkillGuide();
- if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
- xGame.common.guideStep++;
- xGame.common.gameUI.ui.guide1.visible = false;
- xGame.common.gameUI.ui.guide2.visible = true;
- }
- }
- checkDistance(disX, disY, angle) {
- let diameter = this.gameObj.width - 1;
- let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
- if (!this.lastDis)
- this.lastDis = dis;
- else {
- if (dis > this.lastDis) {
- this.helpOut.type = "remove";
- return this.helpOut;
- }
- }
- if (dis <= Math.pow(diameter, 2)) {
- let del = 0.01;
- let offest = 0;
- let realX = disX - this.gameObj.x;
- let realY = disY - this.gameObj.y;
- while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
- offest += del;
- realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
- realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
- }
- this.helpOut.type = "ok";
- this.helpOut.x = realX + this.gameObj.x;
- this.helpOut.y = realY + this.gameObj.y;
- return this.helpOut;
- }
- else {
- this.helpOut.type = "no";
- return this.helpOut;
- }
- }
- clearBallEft() {
- this.clearBallRightEft();
- this.clearBallWrongEft();
- }
- clearBallRightEft() {
- this.ui.breathAni.stop();
- this.ui.rightTips.visible = false;
- }
- clearBallWrongEft() {
- this.ui.wrongTips.visible = false;
- }
- showWrongEft() {
- if (!xGame.common.gameMgr.selfTurn)
- return;
- this.ui.wrongTips.visible = true;
- }
- showRightEft() {
- if (!xGame.common.gameMgr.selfTurn)
- return;
- this.ui.rightTips.visible = true;
- this.ui.rightTips.scaleX = 1;
- this.ui.rightTips.scaleY = 1;
- this.ui.breathAni.play();
- }
- setBallFunc(type, owner) {
- if (type == "ice") {
- this.ballFunc = type;
- this.d3BallSrc.setAlbedoTexture(true);
- this.rigy.type = "static";
- this.iceOwner = owner;
- }
- else {
- if (owner == this.iceOwner) {
- this.ballFunc = type;
- this.d3BallSrc.setAlbedoTexture(false);
- this.rigy.type = "dynamic";
- }
- }
- }
- }
- D2BallSrc._unid = 0;
- class D2RootBallSrc extends D2BallSrc {
- constructor() {
- super();
- this.maxSpeed = 0;
- this.classicMaxSpeed = 2.2;
- this.bigSkillMaxSpeed = 4;
- this.angle = 0;
- this.allPercent = 0;
- this.linearPercent = 0;
- this.anglePercent = 0;
- this.maxAngleRate = 0.6;
- this.baseRot = 7;
- this.angleMax = 0;
- this.speed = new Laya.Vector2();
- this.rotSpeed = new Laya.Vector2();
- }
- isStill() {
- let speed = this.rigy.linearVelocity;
- if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
- if (this.anglePercent <= 0.1) {
- this.rigy.linearVelocity = { x: 0, y: 0 };
- return true;
- }
- }
- return false;
- }
- reset() {
- this.linearPercent = 0;
- this.anglePercent = 0;
- }
- setSpeed(percent, angle) {
- this.allPercent = percent;
- this.angle = angle;
- this.setAngleSpeed();
- this.setLinearSpeed();
- let hit = "hit";
- if (percent < 25)
- hit = "hit03";
- else if (percent < 50)
- hit = "hit02";
- else if (percent < 75)
- hit = "hit01";
- xGame.soundMgr.playSound(hit);
- }
- setAngleSpeed() {
- let offest = xGame.common.rodOffest;
- let radius = 82;
- let rate = Math.abs(offest.y / radius) * 0.5;
- if (offest.y > 0)
- this.angleMax = -this.baseRot * 2;
- else
- this.angleMax = this.baseRot;
- this.rotY = -offest.x / radius * 100;
- this.anglePercent = this.maxAngleRate * rate * this.allPercent;
- this.linearPercent = this.allPercent - this.anglePercent;
- }
- setLinearSpeed() {
- if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
- if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
- if (!xGame.common.longHelpLine) {
- let offset = -150 + xGame.common.randomNum(0, 300);
- offset /= 100;
- this.angle += offset;
- }
- }
- }
- let sin = Math.sin(this.angle * Math.PI / 180);
- let cos = Math.cos(this.angle * Math.PI / 180);
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- this.maxSpeed = this.classicMaxSpeed;
- break;
- case GameMode.bigMove:
- this.maxSpeed = this.bigSkillMaxSpeed;
- break;
- case GameMode.placeBall:
- let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
- if (data.type == 1) {
- this.maxSpeed = this.bigSkillMaxSpeed;
- }
- else {
- this.maxSpeed = this.classicMaxSpeed;
- }
- break;
- default:
- break;
- }
- this.speed.x = this.maxSpeed * this.linearPercent * sin;
- this.speed.y = -this.maxSpeed * this.linearPercent * cos;
- this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
- this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
- this.rigy.applyLinearImpulseToCenter(this.speed);
- }
- onUpdate() {
- if (this.anglePercent > 0.1) {
- this.anglePercent *= 0.97;
- this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
- this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
- this.rigy.applyForceToCenter(this.rotSpeed);
- Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
- Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
- let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
- if (num > 0.9)
- this.canRot = true;
- }
- else
- this.canRot = true;
- if (Math.abs(this.rotY) > 0.1)
- this.rotY *= 0.98;
- super.onUpdate();
- }
- destroySelf() {
- super.destroySelf();
- this.speed = null;
- }
- }
- class D2Ball extends Laya.Sprite {
- constructor(isRootBall = false) {
- super();
- this.ui = ui_D2Ball.createInstance();
- this.pivotX = this.ui.width / 2;
- this.pivotY = this.ui.width / 2;
- this.x = 0;
- this.y = 0;
- this.addChild(this.ui.displayObject);
- this.ui.displayObject.x += this.ui.width / 2;
- this.ui.displayObject.y += this.ui.width / 2;
- if (isRootBall) {
- this.d2Src = this.addComponent(D2RootBallSrc);
- }
- else {
- this.d2Src = this.addComponent(D2BallSrc);
- }
- this.d2Src.ui = this.ui;
- this.addCircleCollider();
- this.addInnerCircleCollider();
- this.addRigyBody();
- }
- addCircleCollider() {
- let colli = xGame.common.getCollider("circle");
- colli.radius = this.ui.width / 2;
- this.addComponentIntance(colli);
- this.d2Src.outColli = colli;
- colli.label = "ball";
- }
- addInnerCircleCollider() {
- let colli = xGame.common.getCollider("circle");
- colli.radius = this.ui.inner.width / 2;
- colli.x = (this.ui.width - this.ui.inner.width) / 2;
- colli.y = (this.ui.width - this.ui.inner.width) / 2;
- this.addComponentIntance(colli);
- this.d2Src.innerColli = colli;
- colli.label = "inner";
- }
- addRigyBody() {
- let rigy = xGame.common.getRigbody();
- rigy.type = "dynamic";
- this.addComponentIntance(rigy);
- this.d2Src.rigy = rigy;
- }
- disposeSelf() {
- if (!this.ui.isDisposed) {
- this.ui.dispose();
- this.ui.removeFromParent();
- this.ui = null;
- }
- }
- }
- class ui_D2Gan extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "D2Gan"));
- }
- onConstruct() {
- this.myIcon = (this.getChild("myIcon"));
- this.selfRodIcon = (this.getChild("selfRodIcon"));
- this.selfEftRoot = (this.getChild("selfEftRoot"));
- this.self = (this.getChild("self"));
- this.aiRodIcon = (this.getChild("aiRodIcon"));
- this.aiEftRoot = (this.getChild("aiEftRoot"));
- this.ai = (this.getChild("ai"));
- }
- }
- ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
- class D2Gan {
- constructor() {
- this.offset = 0.15;
- this.cell = 1.5;
- this.onBallCell = 0.4;
- this.lastInfo = { x: 0, y: 0, rotation: 0 };
- this.moveNum = 70;
- this.rulerRate = 0.1;
- this.ui = ui_D2Gan.createInstance();
- this.changeSelfRod();
- this.changeAIRod();
- }
- changeSelfRod() {
- let index = DataMgr.getCurBallRod();
- let data = cfgTable.ballrodData[index + 1];
- this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
- this.selfMySpine && this.selfMySpine.dispose();
- this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
- if (data.spine) {
- this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
- this.selfMySpine = new SpineMgr(data.spine, () => {
- let xx = this.ui.selfEftRoot.width / 2;
- let yy = this.ui.selfEftRoot.height / 2;
- let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
- let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
- outSpine.rotation = -90;
- });
- }
- }
- changeAIRod() {
- let length = Object.keys(cfgTable.ballrodData).length;
- let rand = Math.floor(length * Math.random()) + 1;
- let data = cfgTable.ballrodData[rand];
- this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
- this.aiMySpine && this.aiMySpine.dispose();
- this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
- if (data.spine) {
- this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
- this.aiMySpine = new SpineMgr(data.spine, () => {
- let xx = this.ui.aiEftRoot.width / 2;
- let yy = this.ui.aiEftRoot.height / 2;
- let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
- let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
- outSpine.rotation = -90;
- });
- }
- }
- setGanLastInfo() {
- this.lastInfo.rotation = this.ui.rotation;
- this.lastInfo.x = this.ui.x;
- this.lastInfo.y = this.ui.y;
- }
- rotateSelf(flag, isRuler = false) {
- let angle;
- flag = flag * this.offset;
- if (xGame.common.d2World.isHelpLineOnBall) {
- angle = flag * this.onBallCell;
- }
- else {
- angle = flag * this.cell;
- }
- if (isRuler) {
- angle *= this.rulerRate;
- }
- this.ui.rotation += angle;
- xGame.common.d2World.getHelpLine();
- }
- checkDistance() {
- let target = xGame.common.d2World.targetBall;
- let root = xGame.common.d2World.rootBall;
- if (target == null) {
- return 1;
- }
- let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
- if (dis <= 2500) {
- return 5;
- }
- return 1;
- }
- rotDest(rot) {
- this.ui.rotation = rot;
- xGame.common.d2World.getHelpLine();
- }
- storagePower(powerNum) {
- let pos = (powerNum / 100) * this.moveNum;
- let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
- let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
- this.ui.x = this.lastInfo.x + xx;
- this.ui.y = this.lastInfo.y + yy;
- }
- shoot() {
- this.storagePower(0);
- this.ui.visible = false;
- }
- destroySelf() {
- this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
- this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
- this.selfMySpine && this.selfMySpine.dispose();
- this.aiMySpine && this.aiMySpine.dispose();
- this.lastInfo = null;
- if (!this.ui.isDisposed) {
- this.ui.removeFromParent();
- this.ui.dispose();
- }
- }
- }
- class ui_HelpLine extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "HelpLine"));
- }
- onConstruct() {
- this.n10 = (this.getChild("n10"));
- this.rect = (this.getChild("rect"));
- this.dir11 = (this.getChild("dir11"));
- this.dir = (this.getChild("dir"));
- this.rootDir = (this.getChild("rootDir"));
- this.dirDot = (this.getChild("dirDot"));
- }
- }
- ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
- class D2HelpLine {
- constructor() {
- this.starX = 0;
- this.starY = 0;
- this.ui = ui_HelpLine.createInstance();
- xGame.common.gameUI.ui.ballNode.addChild(this.ui);
- this.starX = this.ui.rect.x;
- this.starY = this.ui.rect.y;
- }
- shoot() {
- this.ui.visible = false;
- }
- destroySelf() {
- if (this.ui.isDisposed) {
- this.ui.removeFromParent();
- this.ui.dispose();
- }
- }
- }
- class D2World extends Laya.Script {
- constructor() {
- super();
- this.ballArr = [];
- this.openCheckStill = false;
- this.checkArr = [];
- this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
- this.isHelpLineOnBall = false;
- this.isOnSameLine = false;
- this.reflectAngle = 0;
- this.powerPercent = 0;
- this.inHolesSpeed = [];
- this.outDir = new Laya.Vector2();
- this.rootDir = new Laya.Vector2();
- this.aiLv = 0;
- this.rootPos = new Laya.Vector2();
- this.tempDir1 = new Laya.Vector2();
- this.tempDir2 = new Laya.Vector2();
- this.tempDir3 = new Laya.Vector2();
- this.ballSize = 33;
- this.destRot = 0;
- }
- initSelf() {
- this.createBalls();
- xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
- xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
- xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
- xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
- xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
- }
- setBorderRect() {
- let ui = xGame.common.gameUI.ui;
- let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
- let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
- let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
- let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
- this.borderRect.x = starX;
- this.borderRect.y = starY;
- this.borderRect.width = width;
- this.borderRect.height = height;
- }
- resetGame() {
- this.openCheckStill = false;
- let temp;
- for (let index = 0; index < this.ballArr.length; index++) {
- temp = this.ballArr[index];
- temp.destroySelf();
- }
- xGame.common.d3World.ballRoot.destroyChildren();
- xGame.common.gameUI.ui.ballNode.removeChildren();
- console.log("进入摧毁逻辑");
- this.d2Gan.destroySelf();
- this.d2HelpLine.destroySelf();
- this.ballArr = [];
- }
- setD2Gan() {
- let ballNode = this.rootBall.ui;
- let d2Gan = new D2Gan();
- this.d2Gan = d2Gan;
- let ganNode = d2Gan.ui;
- ballNode.addChild(ganNode);
- ganNode.pivotX = ganNode.pivotX;
- ganNode.pivotY = ganNode.pivotY;
- ganNode.x = ganNode.myIcon.width / 2;
- ganNode.y = this.rootBall.gameObj.width;
- d2Gan.setGanLastInfo();
- }
- setHelpLine() {
- let d2Help = new D2HelpLine();
- this.d2HelpLine = d2Help;
- }
- createBalls() {
- let cfg;
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- cfg = xGame.cfgMgr.getRandomClassicLevel();
- break;
- case GameMode.bigMove:
- cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
- break;
- case GameMode.placeBall:
- cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
- break;
- default:
- break;
- }
- cfg = JSON.parse(JSON.stringify(cfg));
- for (const key in cfg) {
- if (cfg[key].value == 0) {
- this.createRootBall(cfg[key]);
- delete cfg[key];
- break;
- }
- }
- this.createOtherBalls(cfg);
- }
- createRootBall(data) {
- let root = new D2Ball(true);
- xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
- this.rootBall = root.d2Src;
- let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
- let d3BallSrc = d3Ball.getComponent(Ball);
- xGame.common.d3World.rootBall = d3Ball;
- xGame.common.d3World.rootBallSrc = d3BallSrc;
- let xx = data.x;
- let yy = data.y;
- let numer = data.value;
- xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
- this.rootBall.initSelf(numer, xx, yy, d3Ball);
- this.ballArr.push(this.rootBall);
- this.setD2Gan();
- this.setHelpLine();
- }
- createOtherBalls(cfg) {
- let temp;
- let src;
- let data;
- for (const key in cfg) {
- data = cfg[key];
- temp = new D2Ball();
- xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
- src = temp.d2Src;
- let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
- src.initSelf(data.value, data.x, data.y, d3Ball);
- this.ballArr.push(src);
- }
- }
- shoot(percent) {
- this.powerPercent = percent;
- this.openCheckStill = true;
- let d2Angle = this.d2Gan.ui.rotation;
- this.rootBall.setSpeed(percent, d2Angle);
- this.clearBallAllEft();
- this.changePlayerView();
- }
- onUpdate() {
- if (!this.openCheckStill)
- return;
- this.checkStill();
- }
- checkStill() {
- for (let index = 0; index < this.ballArr.length; index++) {
- if (!this.ballArr[index].isStill()) {
- return;
- }
- }
- xGame.eventMgr.event(ALL_BALL_STOP);
- }
- allBallStop() {
- this.openCheckStill = false;
- xGame.common.recoverCameraView();
- }
- waitShoot() {
- if (!this.d2Gan.ui.isDisposed) {
- this.d2Gan.ui.visible = true;
- }
- if (!this.d2HelpLine.ui.isDisposed) {
- this.d2HelpLine.ui.visible = true;
- }
- this.clearBallAllEft();
- this.showBallRightEft();
- this.getHelpLine();
- this.inHolesSpeed = [];
- this.selectOneBall();
- }
- _getAllBallArr() {
- let arr = this.ballArr;
- let outArr = [];
- for (let index = 0; index < arr.length; index++) {
- if (arr[index] instanceof D2RootBallSrc)
- continue;
- if (arr[index].ballFunc == "ice")
- continue;
- if (arr[index].destroyed)
- continue;
- outArr.push(arr[index]);
- }
- return outArr;
- }
- _getBlackObj() {
- let arr = this.ballArr;
- for (let index = 0; index < arr.length; index++) {
- if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
- return arr[index];
- }
- }
- }
- selectOneBall() {
- let all = this._getAllBallArr();
- let target;
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- if (xGame.common.gameMgr.selfTurn) {
- let self = xGame.common.gameMgr.selfBallArr;
- let black = this._getBlackObj();
- if (xGame.common.gameMgr.ensureBallType) {
- if (self.length > 0) {
- let out = [];
- for (let j = 0; j < all.length; j++) {
- if (self.indexOf(all[j].number) > -1) {
- out.push(all[j]);
- }
- }
- target = this.selectBestEnterOne(out);
- }
- else {
- target = this.selectBestEnterOne([black]);
- }
- }
- else {
- target = this.selectBestEnterOne(all);
- }
- }
- else {
- target = this.selectBestEnterOne(all);
- }
- break;
- case GameMode.bigMove:
- target = this.selectBestEnterOne(all);
- break;
- case GameMode.placeBall:
- if (all.length > 0) {
- target = this.selectBestEnterOne(all);
- }
- break;
- default:
- break;
- }
- if (target && !target.destroyed && target.onClick) {
- target.onClick(0, true);
- let num = -200 + xGame.common.randomNum(0, 400);
- num /= 150;
- if (xGame.common.longHelpLine) {
- num = 0;
- }
- this.destRot += num;
- xGame.common.d2World.d2Gan.rotDest(this.destRot);
- }
- }
- removeOneBall(ball) {
- for (let index = 0; index < this.ballArr.length; index++) {
- if (this.ballArr[index].id == ball.id) {
- this.ballArr.splice(index, 1);
- break;
- }
- }
- }
- getHelpLine() {
- this.d2HelpLine.ui.dirDot.visible = false;
- this.isOnSameLine = false;
- let startX = this.rootBall.gameObj.x;
- let startY = this.rootBall.gameObj.y;
- let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
- if (dis == null) {
- this.d2HelpLine.ui.visible = false;
- console.error("辅助线异常");
- return;
- }
- this.d2HelpLine.ui.visible = true;
- let angle = this.d2Gan.ui.rotation;
- let radius = 16.5;
- let disX = startX + dis * Math.sin(angle * Math.PI / 180);
- let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
- let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
- if (colliObj == null) {
- this.getColliPos(disX, disY, radius, angle);
- xGame.common.d2World.isHelpLineOnBall = false;
- this.targetBall = null;
- this.reflectAngle = 0;
- this.showBallWrongEft();
- }
- else {
- let target = colliObj.src;
- let radius = 16.5;
- let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
- dis1 = Math.sqrt(dis1);
- let realDis = colliObj.disHon - dis1;
- let dir = colliObj.dir;
- let xx = startX + dir.x * realDis;
- let yy = startY + dir.y * realDis;
- this.getColliPos(xx, yy, radius, angle);
- let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
- if (Math.abs(reflectAngle - angle) <= 0.02) {
- let offset = xGame.common.rodOffest;
- if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
- this.isOnSameLine = true;
- }
- this.getRootDirLine(reflectAngle, angle, xx, yy, target);
- xGame.common.d2World.isHelpLineOnBall = true;
- this.targetBall = target;
- this.reflectAngle = reflectAngle;
- this.showBallWrongEft();
- if (xGame.common.longHelpLine) {
- this.delayReflectLine(target, reflectAngle);
- }
- }
- }
- getBorderDot(startX, startY, angle) {
- let radius = 17;
- let distance;
- let isDone;
- distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
- isDone = this.judgeUpDown(distance, angle, startX);
- if (isDone != null) {
- return isDone;
- }
- distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
- isDone = this.judgeUpDown(distance, angle, startX);
- if (isDone != null) {
- return isDone;
- }
- distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
- isDone = this.judgeLeftRight(distance, angle, startY);
- if (isDone != null) {
- return isDone;
- }
- distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
- isDone = this.judgeLeftRight(distance, angle, startY);
- if (isDone != null) {
- return isDone;
- }
- }
- judgeUpDown(distance, angle, startX) {
- let flag = Math.sin(angle * Math.PI / 180);
- let temp = startX + distance * Math.sin(angle * Math.PI / 180);
- if (distance >= 0) {
- if (flag > 0) {
- if (temp < this.borderRect.x + this.borderRect.width) {
- return distance;
- }
- }
- else {
- if (temp > this.borderRect.x) {
- return distance;
- }
- }
- }
- }
- judgeLeftRight(distance, angle, starY) {
- let flag = -Math.cos(angle * Math.PI / 180);
- let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
- if (distance >= 0) {
- if (flag > 0) {
- if (temp < this.borderRect.y + this.borderRect.height) {
- return distance;
- }
- }
- else {
- if (temp > this.borderRect.y) {
- return distance;
- }
- }
- }
- }
- clearBallAllEft() {
- let temp;
- for (let index = 0; index < this.ballArr.length; index++) {
- temp = this.ballArr[index];
- temp.clearBallEft();
- }
- }
- showBallRightEft() {
- let gameMgr = xGame.common.gameMgr;
- let temp;
- let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
- if (targetArr.length <= 0)
- return;
- for (let index = 0; index < this.ballArr.length; index++) {
- temp = this.ballArr[index];
- if (targetArr.indexOf(temp.number) > -1) {
- temp.showRightEft();
- }
- }
- }
- showBallWrongEft() {
- let gameMgr = xGame.common.gameMgr;
- let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
- if (targetArr.length <= 0)
- return;
- let temp;
- for (let index = 0; index < this.ballArr.length; index++) {
- temp = this.ballArr[index];
- if (this.targetBall && this.targetBall.number == temp.number) {
- if (targetArr.indexOf(temp.number) <= -1) {
- temp.showWrongEft();
- }
- else {
- temp.clearBallWrongEft();
- }
- }
- else {
- temp.clearBallWrongEft();
- }
- }
- }
- getColliPos(x, y, radius, angle) {
- this.d2HelpLine.ui.x = x;
- this.d2HelpLine.ui.y = y;
- let dirX = x - this.rootBall.gameObj.x;
- let dirY = y - this.rootBall.gameObj.y;
- let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
- if (rectH <= 0)
- rectH = 0;
- this.d2HelpLine.ui.rect.height = 0;
- this.d2HelpLine.ui.rect.height = rectH;
- this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
- if (rectH < this.rootBall.gameObj.width) {
- this.d2HelpLine.ui.rect.visible = false;
- }
- else {
- this.d2HelpLine.ui.rect.visible = true;
- }
- this.d2HelpLine.ui.dir.visible = false;
- this.d2HelpLine.ui.rootDir.visible = false;
- }
- getReflectLine(x, y, radius, target) {
- this.d2HelpLine.ui.dir.visible = true;
- let dirX = target.x - x;
- let dirY = target.y - y;
- let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
- this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
- this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
- this.d2HelpLine.ui.dir.height = 48;
- this.d2HelpLine.ui.dir.rotation = angle;
- this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
- this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
- return angle;
- }
- getRootDirLine(angle, rodAngle, xx, yy, target) {
- let rtX = xGame.common.d2World.rootBall.gameObj.x;
- let rtY = xGame.common.d2World.rootBall.gameObj.y;
- let targetX = target.gameObj.x;
- let targetY = target.gameObj.y;
- this.outDir.setValue(targetX - xx, targetY - yy);
- this.rootDir.setValue(rtX - xx, rtY - yy);
- let ver = Math.PI / 2;
- let sin = Math.sin(ver);
- let cos = Math.cos(ver);
- let outX = this.outDir.x * cos - this.outDir.y * sin;
- let outY = this.outDir.x * sin + this.outDir.y * cos;
- this.outDir.setValue(outX, outY);
- Laya.Vector2.normalize(this.rootDir, this.rootDir);
- Laya.Vector2.normalize(this.outDir, this.outDir);
- let result = Laya.Vector2.dot(this.rootDir, this.outDir);
- if (Math.abs(result) <= 0.08) {
- this.d2HelpLine.ui.rootDir.visible = false;
- return;
- }
- if (result > 0) {
- angle += 90;
- }
- else if (result < 0) {
- angle -= 90;
- }
- this.d2HelpLine.ui.rootDir.visible = true;
- this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
- this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
- this.d2HelpLine.ui.rootDir.rotation = angle;
- }
- delayReflectLine(obj, angle) {
- if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
- return;
- }
- this.isOnSameLine = false;
- let startX = obj.gameObj.x;
- let startY = obj.gameObj.y;
- let dis = this.getBorderDot(startX, startY, angle);
- if (dis == null) {
- this.d2HelpLine.ui.dirDot.visible = false;
- return;
- }
- this.d2HelpLine.ui.visible = true;
- let disX = startX + dis * Math.sin(angle * Math.PI / 180);
- let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
- let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
- if (colliObj == null) {
- this.setDelayLine(disX, disY, obj, angle);
- }
- else {
- let radius = 16;
- let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
- dis1 = Math.sqrt(dis1);
- let realDis = colliObj.disHon - dis1;
- let dir = colliObj.dir;
- let xx = startX + dir.x * realDis;
- let yy = startY + dir.y * realDis;
- this.setDelayLine(xx, yy, obj, angle);
- }
- }
- setDelayLine(x, y, obj, angle) {
- let dirX = x - obj.gameObj.x;
- let dirY = y - obj.gameObj.y;
- let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
- if (rectH <= 0)
- rectH = 0;
- this.d2HelpLine.ui.dir.height = rectH;
- this.d2HelpLine.ui.dirDot.visible = true;
- this.d2HelpLine.ui.dirDot.x = 17;
- this.d2HelpLine.ui.dirDot.y = 17;
- this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
- ;
- this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
- }
- changePlayerView() {
- if (Math.random() >= 0.7)
- return;
- if (!this.targetBall) {
- return;
- }
- if (!xGame.common.gameMgr.selfTurn)
- return;
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
- if (this.targetBall.number != 8) {
- return;
- }
- }
- break;
- case GameMode.bigMove:
- return;
- case GameMode.placeBall:
- break;
- default:
- break;
- }
- let startX = this.targetBall.gameObj.x;
- let startY = this.targetBall.gameObj.y;
- let angle = this.reflectAngle;
- let dis = this.getBorderDot(startX, startY, angle);
- let disX = startX + dis * Math.sin(angle * Math.PI / 180);
- let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
- let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
- if (colliObj) {
- return;
- }
- let offset = 40;
- let posObj = xGame.common.gameMgr.posObj;
- let temp;
- let radius;
- let tarX, tarY;
- for (const key in posObj) {
- temp = posObj[key];
- radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
- tarX = startX + radius * Math.sin(angle * Math.PI / 180);
- tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
- if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
- xGame.common.showOneCamera("angle" + key);
- xGame.common.gameUI.ui.d2Node.alpha = 0;
- Laya.physicsTimer.scale = 0.7;
- break;
- }
- }
- }
- selectBestEnterOne(arr) {
- this.aiLv = xGame.tools.random(1, 11);
- this.aiLv = 10;
- this.wBall = xGame.common.d2World.rootBall;
- this.rootPos.x = this.wBall.gameObj.x;
- this.rootPos.y = this.wBall.gameObj.y;
- this.initHoleBall(arr);
- return this.selectBall();
- }
- selectBall() {
- let ball = null;
- this.destRot = 0;
- let ai = 110 - this.aiLv * 10;
- let mis = xGame.tools.random(-ai, ai) * 0.005;
- let score = false;
- if (this.scoreBall.length < 1) {
- if (this.lineBall.length < 1) {
- for (let i = 0; i < this.kickBall.length; i++) {
- let list = [];
- let bo = this.kickBall[i];
- let bobj = bo.gameObj;
- let rect = xGame.common.d2World.borderRect;
- let mobj = this.wBall.gameObj;
- let minb = bobj.y - rect.y - 20;
- let minw = mobj.y - rect.y - 50;
- if (minb > 0 && minw > 0) {
- let dlenx = 0;
- let dleny = mobj.y - rect.y;
- let spx = mobj.x;
- let spy = rect.y - dleny;
- list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
- }
- minb = rect.y + rect.height - bobj.y - 20;
- minw = rect.y + rect.height - mobj.y - 50;
- if (minb > 0 && minw > 0) {
- let dlenx = 0;
- let dleny = rect.y + rect.height - mobj.y;
- let spx = mobj.x;
- let spy = rect.y + rect.height + dleny;
- list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
- }
- minb = bobj.x - rect.x - 20;
- minw = mobj.x - rect.x - 50;
- if (minb > 0 && minw > 0) {
- let dlenx = mobj.x - rect.x;
- let dleny = 0;
- let spx = rect.x - dlenx;
- let spy = mobj.y;
- list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
- }
- minb = rect.x + rect.width - bobj.x - 20;
- minw = rect.x + rect.width - mobj.x - 50;
- if (minb > 0 && minw > 0) {
- let dlenx = rect.x + rect.width - mobj.x;
- let dleny = 0;
- let spx = rect.x + rect.width + dlenx;
- let spy = mobj.y;
- list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
- }
- list.sort(function (a, b) {
- return a.order - b.order;
- });
- for (let i = 0; i < list.length; i++) {
- let data = list[i];
- let mx = mobj.x - bobj.x;
- let my = mobj.y - bobj.y;
- xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
- xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
- let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
- if (num > 1)
- num = 1;
- let cos = Math.acos(num);
- if (cos > 1.57)
- cos = 1.57;
- else if (cos < 0.01)
- cos = 0.01;
- let tan = Math.tan(cos);
- let dx = tan * data.dleny;
- let dy = tan * data.dlenx;
- let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
- if (Math.abs(bx - 667) < 40)
- continue;
- let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
- if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
- let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
- this.forceMax = dis * 0.08;
- this.destRot += mis * 0.1;
- this.setKick(bx, by);
- return true;
- }
- }
- }
- }
- else {
- ball = xGame.common.getRandArrEle(this.lineBall);
- }
- }
- else {
- for (let i = 0; i < this.scoreBall.length; i++) {
- if (i < this.scoreBall.length - 1) {
- let rand = 70 + this.aiLv * 10 + i * 10;
- if (xGame.tools.random(0, 100) < rand) {
- ball = this.scoreBall[i];
- break;
- }
- }
- else {
- ball = this.scoreBall[i];
- break;
- }
- }
- score = true;
- this.selectNum++;
- }
- if (!ball)
- ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
- let dx = ball.gameObj.x;
- let dy = ball.gameObj.y;
- let kickAngle = 0;
- if (score) {
- dx = ball.kickPos.x;
- dy = ball.kickPos.y;
- this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
- this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
- let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
- if (adot > 1)
- adot = 1;
- kickAngle = Math.acos(adot) * 57.3;
- if (kickAngle > 45) {
- let kdx = ball.kickPos.x - ball.gameObj.x;
- let kdy = ball.kickPos.y - ball.gameObj.y;
- dx = ball.kickPos.x - kdx * mis * 0.3;
- dy = ball.kickPos.y - kdy * mis * 0.3;
- }
- else
- this.destRot += mis;
- }
- else if (ball.poleAngle != 0) {
- this.destRot += ball.poleAngle;
- }
- if (xGame.common.gameMode == 0) {
- let af = kickAngle * 0.08;
- this.forceMax = ball.hard * 0.1 + af * af;
- }
- this.setKick(dx, dy);
- return ball;
- }
- initHoleBall(arr) {
- this.kickBall = [];
- this.lineBall = [];
- this.scoreBall = [];
- this.holeBall = [];
- this.selectNum = 0;
- this.forceNum = 0;
- this.forceMax = 0;
- this.turnNum = 0;
- let list = arr;
- let holes = xGame.common.gameMgr.holePosList;
- let self = xGame.common.aiPlayer;
- for (let i = 0; i < list.length; i++) {
- let obj = list[i];
- if (!obj)
- continue;
- obj.kickPos.x = 0;
- obj.kickPos.y = 0;
- obj.poleAngle = 0;
- obj.hard = 0;
- obj.borderDis = 0;
- obj.kickAngle = 180;
- let b = obj.gameObj;
- let wbp = this.rootPos;
- let bx = wbp.x - b.x;
- let by = wbp.y - b.y;
- obj.borderDis = xGame.tools.random(0, 100);
- this.kickBall.push(obj);
- if (!this.isLine(wbp, obj))
- continue;
- obj.kickAngle = xGame.tools.random(90, 180);
- obj.kickPos.x = b.x;
- obj.kickPos.y = b.y;
- this.lineBall.push(obj);
- let minDis = 999999;
- let hole = false;
- for (let j = 0; j < holes.length; j++) {
- let hp = holes[j];
- if (bx >= 0 && hp.x > b.x + 100)
- continue;
- if (bx <= 0 && hp.x < b.x - 100)
- continue;
- if (by < -10 && hp.y < wbp.y)
- continue;
- if (by > 10 && hp.y > wbp.y)
- continue;
- if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
- let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
- if (dis < minDis) {
- let dx = b.x - this.tempDir1.x * this.ballSize;
- let dy = b.y - this.tempDir1.y * this.ballSize;
- this.tempDir3.x = this.tempDir1.x;
- this.tempDir3.y = this.tempDir1.y;
- if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
- obj.kickPos.x = dx;
- obj.kickPos.y = dy;
- let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
- if (num > 1)
- num = 1;
- obj.kickAngle = Math.acos(num) * 57.3;
- if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
- dis = dis * 2;
- if (Math.abs(hp.x - 600) < 100)
- dis += 50;
- obj.hard = dis + obj.kickAngle * 3;
- hole = true;
- }
- }
- }
- }
- if (hole) {
- this.scoreBall.push(obj);
- this.holeBall.push(obj);
- }
- }
- this.scoreBall.sort(function (a, b) {
- return a.hard - b.hard;
- });
- this.holeBall.sort(function (a, b) {
- return a.kickAngle - b.kickAngle;
- });
- this.kickBall.sort(function (a, b) {
- return a.borderDis - b.borderDis;
- });
- }
- isBlock(bn, bx, by, hx, hy, dn = -1) {
- this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
- let balls = xGame.common.d2World.ballArr;
- let max = xGame.tools.getDis(hx, hy, bx, by);
- for (let index = 0; index < balls.length; index++) {
- let obj = balls[index];
- if (obj.number == 0)
- continue;
- if (obj.number == bn || obj.number == dn)
- continue;
- let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
- if (dis * dis > max)
- continue;
- this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
- let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
- if (num > 1)
- num = 1;
- if (num < 0)
- continue;
- let gap = Math.sin(Math.acos(num)) * dis;
- if (gap < this.ballSize)
- return true;
- }
- return false;
- }
- isLine(xy, ball) {
- let bx = xy.x;
- let by = xy.y;
- if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
- let dis = ball.getDestDis(xy);
- let angle = Math.asin((ball.gameObj.width - 3) / dis);
- let sin = Math.sin(angle);
- let cos = Math.cos(angle);
- this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
- this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
- this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
- let dx = bx + this.tempDir2.x * dis;
- let dy = by + this.tempDir2.y * dis;
- let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
- sin = Math.sin(-angle);
- cos = Math.cos(-angle);
- this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
- this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
- dx = bx + this.tempDir2.x * dis;
- dy = by + this.tempDir2.y * dis;
- let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
- if (isr && isl)
- return false;
- ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
- }
- return true;
- }
- setKick(dx, dy) {
- this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
- this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
- this.tempDir1.x = 0;
- this.tempDir1.y = 1;
- this.tempDir2.y = -this.tempDir2.y;
- let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
- if (num > 1)
- num = 1;
- let rot = Math.acos(num) * 57.3;
- if (this.tempDir2.x < 0)
- rot = 360 - rot;
- this.destRot += rot;
- }
- }
- class ui_UIGame extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIGame"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.d3Root = (this.getChild("d3Root"));
- this.clickNode = (this.getChild("clickNode"));
- this.d2Root = (this.getChild("d2Root"));
- this.topNode = (this.getChild("topNode"));
- this.n72 = (this.getChild("n72"));
- this.n40 = (this.getChild("n40"));
- this.rulerNode = (this.getChild("rulerNode"));
- this.rulerClickNode = (this.getChild("rulerClickNode"));
- this.n50 = (this.getChild("n50"));
- this.keduNode = (this.getChild("keduNode"));
- this.powerTxt = (this.getChild("powerTxt"));
- this.powerNode = (this.getChild("powerNode"));
- this.colorNode = (this.getChild("colorNode"));
- this.powerEft = (this.getChild("powerEft"));
- this.myPowerNode = (this.getChild("myPowerNode"));
- this.ganNode = (this.getChild("ganNode"));
- this.rodMethodNode = (this.getChild("rodMethodNode"));
- this.placeChallengeNode = (this.getChild("placeChallengeNode"));
- this.placeNormalNode = (this.getChild("placeNormalNode"));
- this.skillRod = (this.getChild("skillRod"));
- this.border = (this.getChild("border"));
- this.bigSkillNode = (this.getChild("bigSkillNode"));
- this.classicWorldsNode = (this.getChild("classicWorldsNode"));
- this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
- this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
- this.awardSpineNode = (this.getChild("awardSpineNode"));
- this.guanyuNode = (this.getChild("guanyuNode"));
- this.helpBtn = (this.getChild("helpBtn"));
- this.wordsBtn = (this.getChild("wordsBtn"));
- this.aiWordsBtn = (this.getChild("aiWordsBtn"));
- this.returnBtn = (this.getChild("returnBtn"));
- this.ballNode = (this.getChild("ballNode"));
- this.whiteAni = (this.getChild("whiteAni"));
- this.blackAni = (this.getChild("blackAni"));
- this.selfTurn = (this.getChild("selfTurn"));
- this.aiTurn = (this.getChild("aiTurn"));
- this.deskNode = (this.getChild("deskNode"));
- this.moveNode = (this.getChild("moveNode"));
- this.selfTalk = (this.getChild("selfTalk"));
- this.aiTalk = (this.getChild("aiTalk"));
- this.d2Node = (this.getChild("d2Node"));
- this.snowNode = (this.getChild("snowNode"));
- this.guide2 = (this.getChild("guide2"));
- this.guide1 = (this.getChild("guide1"));
- this.guide3 = (this.getChild("guide3"));
- this.guideNode = (this.getChild("guideNode"));
- }
- }
- ui_UIGame.URL = "ui://isxx5ak7kt443qg";
- class ui_UIGameEnd extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIGameEnd"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n22 = (this.getChild("n22"));
- this.n2 = (this.getChild("n2"));
- this.n52 = (this.getChild("n52"));
- this.n53 = (this.getChild("n53"));
- this.coinNode = (this.getChild("coinNode"));
- this.closeNode = (this.getChild("closeNode"));
- this.moneyNode = (this.getChild("moneyNode"));
- this.secretary = (this.getChild("secretary"));
- this.n27 = (this.getChild("n27"));
- this.n29 = (this.getChild("n29"));
- this.talkNode = (this.getChild("talkNode"));
- this.n38 = (this.getChild("n38"));
- this.n39 = (this.getChild("n39"));
- this.n40 = (this.getChild("n40"));
- this.awardNode = (this.getChild("awardNode"));
- this.starNumNode = (this.getChild("starNumNode"));
- this.n47 = (this.getChild("n47"));
- this.conditionNode = (this.getChild("conditionNode"));
- this.isGetAward = (this.getChild("isGetAward"));
- this.leftBtn = (this.getChild("leftBtn"));
- this.rightBtn = (this.getChild("rightBtn"));
- this.btnNode = (this.getChild("btnNode"));
- }
- }
- ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
- class ui_UIAddCoin extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIAddCoin"));
- }
- onConstruct() {
- this.n11 = (this.getChild("n11"));
- this.myNode = (this.getChild("myNode"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
- class UIAddCoin extends UIBase {
- constructor() {
- super();
- this.coinNum = 2000;
- }
- onConstructor() {
- this.ui = ui_UIAddCoin.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
- this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
- }
- show() {
- super.show();
- this.ui.t0.play();
- }
- videoAddCoin() {
- console.log('zh:qjff_AD_for_UIAddCoin');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_UIAddCoin();
- }
- }
- qjff_AD_for_UIAddCoin() {
- xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
- this.hide();
- }
- }
- UIAddCoin.uiName = "UIAddCoin";
- class ui_UIInvitation extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIInvitation"));
- }
- onConstruct() {
- this.n14 = (this.getChild("n14"));
- this.myNode = (this.getChild("myNode"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
- class UIInvitation extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UIInvitation.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
- }
- show() {
- super.show();
- }
- enterGame() {
- xGame.common.gameMode = GameMode.classic;
- DataMgr.setChallengeTimes(1);
- xGame.common.passAwardCoin = 2000;
- let need = xGame.common.classicNiceNeddCoin;
- if (DataMgr.coinEnough(need)) {
- DataMgr.setCoin(-need);
- xGame.eventMgr.event(RESTART_GAME, true);
- Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
- }
- else {
- xGame.eventMgr.event(RESTART_GAME, true);
- }
- this.hide();
- }
- hide() {
- super.hide();
- }
- }
- UIInvitation.uiName = "UIInvitation";
- class ui_UIMain extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIMain"));
- }
- onConstruct() {
- this.n47 = (this.getChild("n47"));
- this.n10 = (this.getChild("n10"));
- this.secretary = (this.getChild("secretary"));
- this.shopBtn = (this.getChild("shopBtn"));
- this.moneyNode = (this.getChild("moneyNode"));
- this.headNode = (this.getChild("headNode"));
- this.bigMoveBtn = (this.getChild("bigMoveBtn"));
- this.placeBallBtn = (this.getChild("placeBallBtn"));
- this.classicBtn = (this.getChild("classicBtn"));
- this.globalBtn = (this.getChild("globalBtn"));
- this.n44 = (this.getChild("n44"));
- this.signBtn = (this.getChild("signBtn"));
- this.drawBtn = (this.getChild("drawBtn"));
- this.settingNode = (this.getChild("settingNode"));
- this.n45 = (this.getChild("n45"));
- this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
- this.secretaryBtn = (this.getChild("secretaryBtn"));
- this.rankBtn = (this.getChild("rankBtn"));
- this.n46 = (this.getChild("n46"));
- this.liucheng1 = (this.getChild("liucheng1"));
- this.rightBtn = (this.getChild("rightBtn"));
- this.n75 = (this.getChild("n75"));
- this.secretaryGuide = (this.getChild("secretaryGuide"));
- this.liucheng2 = (this.getChild("liucheng2"));
- this.guideBtn = (this.getChild("guideBtn"));
- this.n73 = (this.getChild("n73"));
- this.wordsNode = (this.getChild("wordsNode"));
- this.enterGuide = (this.getChild("enterGuide"));
- this.talkNode = (this.getChild("talkNode"));
- this.n83 = (this.getChild("n83"));
- this.n84 = (this.getChild("n84"));
- }
- }
- ui_UIMain.URL = "ui://isxx5ak7kt443qc";
- class ui_UIMoyu extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "UIMoyu"));
- }
- onConstruct() {
- this.ageTip = (this.getChild("ageTip"));
- this.mainBg = (this.getChild("mainBg"));
- this.xyNode = (this.getChild("xyNode"));
- this.rnNode = (this.getChild("rnNode"));
- this.fcmNode = (this.getChild("fcmNode"));
- this.ageNode = (this.getChild("ageNode"));
- this.tipNode = (this.getChild("tipNode"));
- this.msgNode = (this.getChild("msgNode"));
- }
- }
- ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
- class MoyuMgr {
- static initMoyu() {
- this.moyuView = new MoyuView();
- Laya.stage.addChild(this.moyuView.ui.displayObject);
- this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
- this.moyuView.ui.displayObject.zOrder = 1000;
- this.moyuView.init();
- this.moyuView.showTip(true);
- this.moyuView.showAge(true, 0, Laya.stage.height - 320);
- window['XApk'] = this;
- }
- static showAge(show) {
- if (this.moyuView)
- this.moyuView.showAge(show);
- }
- static onPlatMsg(idx) {
- if (!MoyuMgr.moyuView)
- return;
- if (idx == '0') {
- MoyuMgr.moyuView.showTip(false);
- }
- }
- static showAgree(call) {
- if (this.moyuView)
- this.moyuView.showAgree(call);
- else
- call && call();
- }
- static showXy(type = 1) {
- if (this.moyuView)
- this.moyuView.showXy(type);
- }
- }
- MoyuMgr.isAdvise = false;
- class MoyuView {
- constructor() {
- this.ysxyNum = 1;
- this.ysJson = null;
- this.ui = ui_UIMoyu.createInstance();
- }
- init() {
- this.ui.mainBg.visible = false;
- this.ui.xyNode.visible = false;
- this.ui.ageNode.visible = false;
- this.ui.tipNode.visible = false;
- this.ui.rnNode.visible = false;
- this.ui.fcmNode.visible = false;
- this.ui.ageTip.visible = false;
- this.ui.msgNode.visible = false;
- this.ui.visible = false;
- this.ui.xyNode.xyList.setVirtual();
- this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
- this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
- this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
- this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
- this.ui.xyNode.btnKnown.visible = false;
- this.ui.xyNode.xy1.visible = false;
- this.ui.xyNode.xy2.visible = false;
- this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
- this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
- this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
- this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
- this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
- this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
- this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
- this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
- this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
- this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
- this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
- this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
- this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
- this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
- if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
- this.ysxyNum = 2;
- }
- }
- onClick(obj) {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- switch (obj) {
- case this.ui.ageTip:
- if (Moyu.isTTApk) {
- this.ui.ageNode.visible = true;
- this.ui.mainBg.visible = true;
- }
- break;
- case this.ui.tipNode:
- this.showTip(false);
- break;
- case this.ui.ageNode.btnAge:
- this.ui.ageNode.visible = false;
- this.ui.mainBg.visible = false;
- if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
- this.ui.visible = false;
- break;
- case this.ui.xyNode.btnXy3:
- case this.ui.xyNode.btnXy1:
- this.loadXy(1);
- break;
- case this.ui.xyNode.btnXy2:
- this.loadXy(2);
- break;
- case this.ui.xyNode.btnBack:
- this.ui.xyNode.xy1.visible = true;
- this.ui.xyNode.xy2.visible = false;
- break;
- case this.ui.xyNode.btnKnown:
- this.ui.xyNode.visible = false;
- this.ui.mainBg.visible = false;
- this.ui.visible = false;
- break;
- case this.ui.rnNode.btnCheck:
- this.check();
- break;
- case this.ui.rnNode.btnExit:
- case this.ui.xyNode.btnNo:
- this.ysxyNum--;
- if (this.ysxyNum > 0)
- this.showMsg("Refuse to quit the game once again");
- else {
- Moyu.userAgree(false);
- Moyu.exit();
- }
- break;
- case this.ui.xyNode.btnSure:
- case this.ui.xyNode.btnYes:
- DataMgr.userData.isAgree = true;
- DataMgr.saveUserData();
- this.onAgree();
- break;
- case this.ui.rnNode.btnDone:
- this.ui.rnNode.visible = false;
- this.ui.visible = false;
- break;
- case this.ui.fcmNode.btnRn:
- this.showRn();
- break;
- }
- }
- showTip(show) {
- if (!Moyu.isVVApk && !Moyu.isOPApk)
- return;
- if (show) {
- MoyuMgr.isAdvise = true;
- this.ui.visible = true;
- this.ui.tipNode.visible = true;
- this.ui.tipNode.alpha = 1;
- Laya.timer.once(1000, this, this.showTip, [false]);
- }
- else {
- this.ui.tipNode.alpha = 1;
- this.ui.tipNode.visible = true;
- Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
- this.ui.tipNode.visible = false;
- MoyuMgr.isAdvise = false;
- }), 1000);
- }
- }
- showAge(show, px = 0, py = 0) {
- if (Moyu.platType > 10 && !Moyu.isIos) {
- this.ui.ageTip.x = px;
- this.ui.ageTip.y = py;
- this.ui.ageTip.visible = show;
- if (show)
- this.ui.visible = true;
- }
- }
- showAgree(call) {
- this.agreeCall = call;
- this.onAgree();
- return;
- if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
- this.showXy(0);
- }
- else
- this.onAgree();
- }
- onAgree() {
- if (!this.ui.ageNode.visible)
- this.ui.visible = false;
- this.ui.xyNode.visible = false;
- Moyu.userAgree(true);
- this.showAge(false);
- this.agreeCall && this.agreeCall();
- this.showRn();
- }
- showMsg(txt) {
- this.ui.msgNode.txtMsg.text = txt;
- this.ui.msgNode.visible = true;
- this.ui.msgNode.alpha = 1;
- this.ui.visible = true;
- Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
- this.ui.msgNode.visible = false;
- }), 2500, true);
- }
- showRn() {
- if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
- if (!Moyu.isRealName || Moyu.gameTime < 999) {
- this.ui.rnNode.rn1.visible = true;
- this.ui.rnNode.rn2.visible = false;
- this.ui.rnNode.rn3.visible = false;
- this.ui.rnNode.rn4.visible = false;
- this.ui.rnNode.visible = true;
- this.ui.mainBg.visible = true;
- this.ui.rnNode.btnDone.visible = false;
- this.ui.rnNode.btnExit.visible = true;
- this.ui.rnNode.btnCheck.visible = true;
- this.ui.fcmNode.visible = false;
- this.ui.visible = true;
- return;
- }
- }
- this.showFcm();
- }
- showFcm() {
- if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
- Moyu.initFCM(true);
- if (Moyu.gameTime < 1)
- this.fcmLoop();
- else if (Moyu.gameTime < 999)
- Laya.timer.loop(10000, this.ui, this.fcmLoop);
- }
- }
- fcmLoop() {
- if (Moyu.gameTime < 1) {
- this.ui.rnNode.visible = false;
- this.ui.fcmNode.visible = true;
- this.ui.mainBg.visible = true;
- this.ui.visible = true;
- this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
- Laya.timer.clear(this.ui, this.fcmLoop);
- }
- }
- check() {
- if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
- this.ui.rnNode.rn1.visible = false;
- this.ui.rnNode.rn2.visible = false;
- this.ui.rnNode.rn4.visible = true;
- }
- else if (this.ui.rnNode.rn4.visible) {
- let name = this.ui.rnNode.inputName.text;
- let code = this.ui.rnNode.inputCode.text;
- if (code && code.length == 18) {
- this.ui.rnNode.rn1.visible = false;
- this.ui.rnNode.rn4.visible = false;
- Moyu.authenticate(name, code, (res) => {
- this.ui.rnNode.rn2.visible = !res;
- this.ui.rnNode.rn3.visible = res;
- this.ui.rnNode.btnDone.visible = res;
- this.ui.rnNode.btnExit.visible = !res;
- this.ui.rnNode.btnCheck.visible = !res;
- if (res)
- this.showFcm();
- });
- }
- else
- this.showMsg("信息填写不完整");
- }
- }
- loadXy(type = 0) {
- this.ui.xyNode.xy1.visible = false;
- this.ui.xyNode.xy2.visible = true;
- this.ui.xyNode.xyList.scrollToView(0);
- if (type == 1) {
- Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
- }
- else if (type == 2) {
- Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
- }
- }
- showXy(type = 0) {
- this.xyBtn();
- if (type == 0) {
- if (Moyu.isPlat(MoyuPlat.f399Apk)) {
- this.ui.xyNode.btnSure.visible = true;
- }
- else {
- this.ui.xyNode.btnYes.visible = true;
- this.ui.xyNode.btnNo.visible = true;
- }
- }
- else {
- this.ui.xyNode.btnKnown.visible = true;
- this.ui.mainBg.visible = true;
- }
- this.ui.xyNode.xy1.visible = true;
- this.ui.xyNode.xy2.visible = false;
- this.ui.xyNode.visible = true;
- this.ui.visible = true;
- }
- xyBtn() {
- this.ui.xyNode.btnSure.visible = false;
- this.ui.xyNode.btnYes.visible = false;
- this.ui.xyNode.btnNo.visible = false;
- this.ui.xyNode.btnKnown.visible = false;
- {
- this.ui.xyNode.btnXy3.visible = false;
- this.ui.xyNode.btnXy2.visible = true;
- this.ui.xyNode.btnXy1.visible = true;
- this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
- }
- }
- createXY(json) {
- this.ysJson = json.content;
- this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
- this.ui.xyNode.xyList.numItems = this.ysJson.length;
- this.ui.xyNode.xy2.visible = true;
- }
- renderListItem(idx, cell) {
- let xy = this.ysJson[idx];
- cell.height = xy.line * 30;
- cell.xyItem.text = xy.text;
- }
- onDestroy() {
- this.agreeCall = null;
- }
- }
- class SettingNode {
- constructor(ui) {
- this.showSetting = false;
- this.openSound = true;
- this.openShake = true;
- this.ui = ui;
- this.ui.soundBtn.onClick(this, this.switchSound);
- this.ui.shakeBtn.onClick(this, this.switchShake);
- this.ui.xyBtn.onClick(this, this.onXy);
- this.ui.clickNode.onClick(this, this.changeSetting);
- this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
- this.ui.xyBtn.visible = false;
- this.ui.shakeBtn.visible = false;
- }
- changeSetting() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- this.showSetting = !this.showSetting;
- this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
- }
- switchSound() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- this.openSound = !this.openSound;
- Moyu.onSetting(this.openSound, this.openShake);
- xGame.soundMgr.onSetting(this.openSound);
- this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
- }
- switchShake() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- this.openShake = !this.openShake;
- Moyu.onSetting(this.openSound, this.openShake);
- this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
- }
- onXy() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- MoyuMgr.showXy(1);
- }
- }
- class ui_UILevelDisplay extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
- }
- onConstruct() {
- this.n9 = (this.getChild("n9"));
- this.myNode = (this.getChild("myNode"));
- this.closeNode = (this.getChild("closeNode"));
- }
- }
- ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
- class ui_UILevelProp extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UILevelProp"));
- }
- onConstruct() {
- this.n16 = (this.getChild("n16"));
- this.myNode = (this.getChild("myNode"));
- this.closeBtn = (this.getChild("closeBtn"));
- this.moneyNode = (this.getChild("moneyNode"));
- this.t1 = this.getTransition("t1");
- }
- }
- ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
- class ui_ShowItem extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ShowItem"));
- }
- onConstruct() {
- this.myImg = (this.getChild("myImg"));
- }
- }
- ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
- class ShowItem {
- constructor() {
- this.ui = ui_ShowItem.createInstance();
- }
- destroySelf() {
- if (!this.ui.isDisposed) {
- this.ui.removeFromParent();
- this.ui.dispose();
- }
- }
- setParent(parent) {
- parent.addChild(this.ui);
- }
- setPos(x, y) {
- this.ui.x = x;
- this.ui.y = y;
- }
- setUrl(index) {
- this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
- }
- }
- class ui_UIPower extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIPower"));
- }
- onConstruct() {
- this.n11 = (this.getChild("n11"));
- this.myNode = (this.getChild("myNode"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
- class UIPower extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UIPower.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
- this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
- }
- show() {
- super.show();
- this.ui.t0.play();
- }
- videoGetPower() {
- console.log('zh:qjff_AD_for_uipower');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_uipower();
- }
- }
- qjff_AD_for_uipower() {
- DataMgr.setPower(xGame.common.videoPower, true);
- xGame.eventMgr.event(POWER_TIME);
- this.hide();
- }
- }
- UIPower.uiName = "UIPower";
- class UILevelProp extends UIBase {
- constructor() {
- super();
- this.firstPos = 385;
- this.secondPos = 467;
- this.showItemArr = [];
- }
- onFontLoaded() {
- try {
- this.ui.myNode.conditionTxt.font = "arial";
- console.log("zh: onFontLoaded 设置arial字体成功");
- }
- catch (error) {
- console.log("zh: constructor onFontLoaded加载arial字体失败");
- }
- }
- onConstructor() {
- this.ui = ui_UILevelProp.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.closeBtn, this.hide);
- this.moneyNode = new MoneyNode(this.ui.moneyNode);
- this.addUIClick(this.ui.myNode.startBtn, this.startGame);
- }
- show(level) {
- super.show();
- this.ui.t1.play();
- this.level = level;
- this.data = cfgTable.placeballData[this.level];
- this.updateSelf();
- this.showPreView();
- this.moneyNode.ui.c1.selectedIndex = 2;
- this.moneyNode.checkPowerTime();
- this.moneyNode.powerChange();
- }
- showPreView() {
- let item;
- let data;
- for (let index = 0; index < this.showItemArr.length; index++) {
- item = this.showItemArr[index];
- item.destroySelf();
- }
- this.showItemArr = [];
- let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
- for (const key in cfgData) {
- data = cfgData[key];
- item = new ShowItem();
- item.setParent(this.ui.myNode.displayRoot);
- item.setPos(data.x, data.y);
- item.setUrl(data.value);
- this.showItemArr.push(item);
- }
- }
- updateSelf() {
- this.ui.myNode.levelTxt.text = `Level ${this.level}`;
- this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
- if (this.data.ball == -1) {
- this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
- }
- else {
- this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
- }
- let localData = DataMgr.getPlaceBallLevel(this.level);
- let getAward = localData.getAward;
- let cfg = cfgTable.placeballData[this.level];
- let coin = this.data.award[0];
- let diamond = this.data.award[1];
- if (cfg.type == PlaceBallType.challenge) {
- diamond = 0;
- coin = 100;
- }
- this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
- this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
- this.ui.myNode.coinNode.numTxt.text = coin + "";
- if (cfg.type == PlaceBallType.challenge) {
- this.ui.myNode.coinNode.numTxt.text = "";
- }
- this.ui.myNode.diamondNode.numTxt.text = diamond + "";
- if (coin > 0 && diamond > 0) {
- this.ui.myNode.diamondNode.x = 385;
- this.ui.myNode.coinNode.x = 467;
- }
- else {
- this.ui.myNode.diamondNode.x = 385;
- this.ui.myNode.coinNode.x = 385;
- }
- if (!getAward) {
- this.ui.myNode.coinNode.c1.selectedIndex = 0;
- this.ui.myNode.diamondNode.c1.selectedIndex = 0;
- }
- else {
- this.ui.myNode.diamondNode.c1.selectedIndex = 1;
- this.ui.myNode.coinNode.c1.selectedIndex = 1;
- }
- }
- startGame() {
- if (DataMgr.powerEnough()) {
- this.ui.myNode.startBtn.touchable = false;
- this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
- console.log('zh:startGame ');
- this.ui.myNode.startBtn.touchable = true;
- DataMgr.setPower(-1);
- xGame.eventMgr.event(POWER_TIME);
- xGame.common.gameMode = GameMode.placeBall;
- xGame.common.placeBallCurLevel = this.level;
- xGame.uiMgr.Show(UIGame);
- xGame.uiMgr.Hide(UILevelDisplay);
- xGame.uiMgr.Hide(UIMain);
- this.hide();
- }));
- }
- else {
- console.log('zh:startGame no power');
- xGame.uiMgr.Show(UIPower);
- }
- }
- hide() {
- super.hide();
- }
- }
- UILevelProp.uiName = "UILevelProp";
- class PutBallLevelDisplay {
- constructor(ui, index) {
- this.index = 0;
- this.ui = ui;
- this.index = index;
- this.ui.onClick(this, this.clickSelf);
- this.updateSelf();
- this.ui.levelTxt.text = (this.index + 1) + "";
- this.ui.challenge.levelTxt.text = (this.index + 1) + "";
- this.ui.special.levelTxt.text = (this.index + 1) + "";
- }
- updateSelf() {
- let level = this.index + 1;
- this.data = DataMgr.getPlaceBallLevel(level);
- this.ui.starNode.c1.selectedIndex = this.data.star;
- let isChallenge = cfgTable.placeballData[level].type;
- if (this.data.isCur) {
- if (isChallenge) {
- this.ui.c1.selectedIndex = 5;
- }
- else {
- this.ui.c1.selectedIndex = 2;
- }
- }
- else {
- if (this.data.play) {
- if (this.data.star == 3) {
- this.ui.c1.selectedIndex = 0;
- }
- else {
- this.ui.c1.selectedIndex = 1;
- }
- }
- else {
- if (isChallenge) {
- this.ui.c1.selectedIndex = 4;
- }
- else {
- this.ui.c1.selectedIndex = 3;
- }
- }
- }
- }
- clickSelf() {
- if (!this.data.play)
- return;
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- xGame.uiMgr.Show(UILevelProp, this.index + 1);
- }
- }
- class UILevelDisplay extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UILevelDisplay.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.myList = this.ui.myNode.myList;
- this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
- this.levelItemArr = [];
- let levelNum = xGame.cfgMgr.getMaxPlaceBall();
- this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
- this.myList.numItems = levelNum;
- if (Moyu.isKs)
- this.ui.closeNode.closeBtn.x += 100;
- }
- levelItemRender(index, target) {
- let item = new PutBallLevelDisplay(target, index);
- this.levelItemArr.push(item);
- }
- show() {
- super.show();
- this.updateLevel();
- this.scrollToPlace();
- }
- updateLevel() {
- let temp;
- for (let index = 0; index < this.levelItemArr.length; index++) {
- temp = this.levelItemArr[index];
- temp.updateSelf();
- }
- }
- scrollToPlace() {
- let maxNum = xGame.cfgMgr.getMaxPlaceBall();
- let passArr = DataMgr.getPlaceBallLevelList();
- let offest = passArr.length;
- if (offest >= maxNum - 1)
- offest = maxNum - 1;
- this.myList.scrollToView(offest, true, true);
- }
- hide() {
- super.hide();
- }
- }
- UILevelDisplay.uiName = "UILevelDisplay";
- class ui_UIMatching extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIMatching"));
- }
- onConstruct() {
- this.n5 = (this.getChild("n5"));
- this.n49 = (this.getChild("n49"));
- this.n51 = (this.getChild("n51"));
- this.n64 = (this.getChild("n64"));
- this.n2 = (this.getChild("n2"));
- this.n53 = (this.getChild("n53"));
- this.n54 = (this.getChild("n54"));
- this.n56 = (this.getChild("n56"));
- this.n58 = (this.getChild("n58"));
- this.n59 = (this.getChild("n59"));
- this.n57 = (this.getChild("n57"));
- this.n60 = (this.getChild("n60"));
- this.n62 = (this.getChild("n62"));
- this.awardTxt = (this.getChild("awardTxt"));
- this.n61 = (this.getChild("n61"));
- this.selfHead = (this.getChild("selfHead"));
- this.aiHead = (this.getChild("aiHead"));
- this.n82 = (this.getChild("n82"));
- this.n84 = (this.getChild("n84"));
- this.n83 = (this.getChild("n83"));
- this.t1 = this.getTransition("t1");
- this.t2 = this.getTransition("t2");
- this.t3 = this.getTransition("t3");
- this.t4 = this.getTransition("t4");
- }
- }
- ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
- class UIMatching extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UIMatching.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- }
- show(callback) {
- super.show();
- PlatMgr.showBanner(true);
- this.callback = callback;
- let user = Moyu.getUserInfo();
- if (!this.selfPot) {
- this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
- }
- if (!this.aiPot) {
- this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
- }
- this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
- this.ui.selfHead.nameTxt.text = user.nickName;
- xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
- this.ui.aiHead.nameTxt.text = "???";
- this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
- this.ui.selfHead.c1.selectedIndex = 0;
- this.ui.aiHead.c1.selectedIndex = 0;
- this.ui.selfHead.x = this.selfPot.x;
- this.ui.selfHead.y = this.selfPot.y;
- this.ui.aiHead.x = this.aiPot.x;
- this.ui.aiHead.y = this.aiPot.y;
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- break;
- case GameMode.bigMove:
- this.initSkillData();
- break;
- default:
- break;
- }
- this.ui.t1.play(Laya.Handler.create(this, () => {
- this.ui.t2.play(Laya.Handler.create(this, () => {
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- this.waitingPeople();
- break;
- case GameMode.bigMove:
- this.skillSelectFinish(xGame.common.curPlayerSkillType);
- break;
- default:
- break;
- }
- }));
- }));
- }
- initSkillData() {
- this.skillSelectData = [];
- let skillUrl = xGame.common.skillIconList;
- let skillName = xGame.common.skillNameList;
- let skillLevel = DataMgr.getBigSkillList();
- let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
- for (let index = 0; index < 5; index++) {
- let obj = {};
- obj.skillImg = skillUrl[index];
- obj.skillName = skillName[index];
- obj.skillType = skillType[index];
- obj.skillLevel = skillLevel[index];
- this.skillSelectData.push(obj);
- }
- }
- getAISkillLevel(myLevel) {
- let video = xGame.common.upSkillLevel;
- let aiLevel;
- let temp;
- if (video) {
- temp = xGame.common.randomNum(-2, -1);
- }
- else {
- if (myLevel <= 5) {
- temp = xGame.common.randomNum(1, 3);
- }
- else if (myLevel <= 9) {
- temp = xGame.common.randomNum(-2, 1);
- }
- else {
- temp = xGame.common.randomNum(-4, 0);
- }
- }
- aiLevel = temp + myLevel;
- if (aiLevel <= 1)
- aiLevel = 1;
- if (aiLevel >= 10)
- aiLevel = 10;
- return aiLevel;
- }
- getAISkillType() {
- return xGame.common.randomNum(1, 4);
- let successTimes = DataMgr.getSkillSuccessTimes();
- let info = cfgTable.aiskillData[successTimes];
- if (!info) {
- let max = Object.keys(cfgTable.aiskillData).length - 1;
- info = cfgTable.aiskillData[max];
- }
- let dataArr = info.skillselect;
- let myCfg = {};
- for (let index = 0; index < dataArr.length; index++) {
- let temp = dataArr[index].split('-');
- myCfg[temp[0]] = {};
- myCfg[temp[0]].id = parseInt(temp[0]);
- myCfg[temp[0]].weight = parseInt(temp[1]);
- }
- let aiCfg = xGame.common.initWeight(myCfg);
- let curData = xGame.common.getRandomWeightData(aiCfg);
- return parseInt(curData.id);
- }
- getAISkillData(index) {
- let myLevel = this.skillSelectData[index].skillLevel;
- let aiLevel = this.getAISkillLevel(myLevel);
- let aiType = this.getAISkillType() - 1;
- return { aiLevel, aiType } = { aiLevel, aiType };
- }
- skillSelectFinish(index) {
- let aiInfo = this.getAISkillData(index);
- xGame.common.gameMgr.selfCurSkill = index;
- xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
- xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
- this.ui.selfHead.c1.selectedIndex = 1;
- this.ui.aiHead.c1.selectedIndex = 1;
- let myData = this.skillSelectData[index];
- this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
- let guide = DataMgr.getSkillGuide();
- if (guide == 0) {
- this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
- }
- else {
- this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
- }
- let aiData = this.skillSelectData[aiInfo.aiType];
- this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
- this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
- this.waitingPeople();
- }
- waitingPeople() {
- let time = xGame.common.randomNum(1000, 3000);
- time += 1000;
- Laya.timer.once(time, this, () => {
- this.matchingSuccess();
- });
- }
- matchingSuccess() {
- let gameUI = xGame.common.gameUI;
- let name = gameUI.ui.topNode.aiNameTxt.text;
- let url = gameUI.ui.topNode.aiHeadLoader.url;
- this.ui.aiHead.nameTxt.text = name;
- this.ui.aiHead.headImg.url = url;
- name = gameUI.ui.topNode.selfNameTxt.text;
- url = gameUI.ui.topNode.selfHeadLoader.url;
- this.ui.selfHead.nameTxt.text = name;
- this.ui.selfHead.headImg.url = url;
- this.ui.t3.play(Laya.Handler.create(this, () => {
- this.callback && this.callback();
- this.ui.t4.play(Laya.Handler.create(this, () => {
- this.destroySelf();
- }));
- }));
- }
- destroySelf() {
- this.callback = null;
- this.skillSelectData = null;
- this.selfPot = null;
- this.aiPot = null;
- if (!this.ui.isDisposed) {
- this.ui.removeFromParent();
- this.ui.dispose();
- }
- xGame.uiMgr.destroyUI(this);
- }
- }
- UIMatching.uiName = "UIMatching";
- class ui_UIRanking extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIRanking"));
- }
- onConstruct() {
- this.n26 = (this.getChild("n26"));
- this.myNode = (this.getChild("myNode"));
- }
- }
- ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
- class UIRanking extends UIBase {
- constructor() {
- super();
- this.showSelf = true;
- this.rankType = 1;
- this.rankList = [];
- this.myIndex = 0;
- this.myStar = 0;
- }
- onConstructor() {
- this.ui = ui_UIRanking.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.myNode.closeBtn, this.hide);
- this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
- this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
- this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
- this.ui.myNode.myList.setVirtual();
- this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
- }
- show() {
- super.show();
- this.myIndex = 51;
- Moyu.getRankList({
- rankId: xGame.common.curRankID,
- type: MoyuRankType.total,
- page: 1,
- pageSize: 50,
- }, this, this.updateItemData);
- this.updateSelf();
- let self = Moyu.getUserInfo();
- if (!self.isAuth) {
- Moyu.initUser(this, () => {
- DataMgr.upRankData();
- });
- }
- }
- updateSelfItem() {
- let self = Moyu.getUserInfo();
- this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
- this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
- this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
- this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
- xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
- }
- updateItemData(data) {
- this.myStar = xGame.common.getAllStarNum();
- if (this.rankList.length < 2) {
- this.rankList = data;
- let self = Moyu.getUserInfo();
- for (let i = 0; i < data.length; i++) {
- let data = this.rankList[i];
- if (data.userId == self.userId) {
- this.rankList.splice(i, 1);
- break;
- }
- }
- for (let i = 0; i < data.length; i++) {
- let data = this.rankList[i];
- if (data.rankScore < this.myStar && this.myIndex > 50) {
- this.myIndex = i + 1;
- let user = { headIcon: self.headIcon, nickName: "myself" };
- let ud = { user: user, data: {} };
- let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
- if (Moyu.platType < 11) {
- user.headIcon = self.headIcon;
- user.nickName = self.nickName;
- }
- this.rankList.splice(i, 0, md);
- break;
- }
- }
- }
- this.updateSelfItem();
- this.ui.myNode.myList.numItems = this.rankList.length;
- }
- updateItemUI(index, obj) {
- let data = this.rankList[index];
- let userData = JSON.parse(data.userData).user;
- obj.nameTxt.text = userData.nickName.toString();
- obj.valueTxt.text = data.rankScore;
- xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
- obj.rankTxt.text = index + 1;
- switch (index) {
- case 0:
- this.setImg(obj, 1, 0, 0);
- obj.rankTxt.color = "#FFC047";
- break;
- case 1:
- this.setImg(obj, 0, 1, 0);
- obj.rankTxt.color = "#ACACAC";
- break;
- case 2:
- this.setImg(obj, 0, 0, 1);
- obj.rankTxt.color = "#D09672";
- break;
- default:
- this.setImg(obj, 0, 0, 0);
- obj.rankTxt.color = "#496FAB";
- break;
- }
- }
- setImg(obj, a, b, c) {
- obj.img1.visible = a ? true : false;
- obj.img2.visible = b ? true : false;
- obj.img3.visible = c ? true : false;
- }
- changeList(type) {
- this.rankType = type;
- this.updateSelf();
- }
- changeSelfNode() {
- this.showSelf = !this.showSelf;
- this.updateSelf();
- }
- updateSelf() {
- this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
- this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
- this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
- this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
- this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
- }
- }
- UIRanking.uiName = "UIRanking";
- class ui_UISecretary extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UISecretary"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.myNode = (this.getChild("myNode"));
- this.closeBtn = (this.getChild("closeBtn"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
- class UISecretary extends UIBase {
- constructor() {
- super();
- this.curIndex = 1;
- }
- onConstructor() {
- this.ui = ui_UISecretary.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.closeBtn, this.closeSelf);
- this.nodeObj = { left: null, right: null, cur: null };
- this.nodeObj.cur = this.ui.myNode.gameNode3;
- }
- show() {
- super.show();
- this.ui.t0.play();
- this.updateData();
- }
- addSecretarySpine(node, spineName) {
- if (spineName == "mishu") {
- if (this.secretarySpine1) {
- node.displayObject.destroyChildren();
- this.playWoman(this.secretarySpine1, node.displayObject);
- }
- else {
- let spine1 = new SpineMgr("mishu", () => {
- this.secretarySpine1 = spine1;
- this.playWoman(this.secretarySpine1, node.displayObject);
- });
- }
- }
- else {
- if (this.secretarySpine2) {
- node.displayObject.destroyChildren();
- this.playWoman(this.secretarySpine2, node.displayObject);
- }
- else {
- let spine2 = new SpineMgr("xiaomishu2", () => {
- this.secretarySpine2 = spine2;
- this.playWoman(this.secretarySpine2, node.displayObject);
- });
- }
- }
- }
- playWoman(node, parent) {
- let xx = this.ui.myNode.gameNode3.secretary.width / 2;
- let yy = this.ui.myNode.gameNode3.secretary.height;
- let scale = 1.5;
- if (node == this.secretarySpine2) {
- scale = 1.2;
- }
- let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
- node.play(data, 0, true, parent);
- }
- turnLeft() {
- this.curIndex--;
- if (this.curIndex < 1) {
- this.curIndex = 2;
- }
- let left = this.nodeObj.left;
- let right = this.nodeObj.right;
- let cur = this.nodeObj.cur;
- Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
- Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
- Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
- this.updateData();
- }));
- this.ui.myNode.setChildIndex(right, 2);
- this.nodeObj.left = cur;
- this.nodeObj.right = left;
- this.nodeObj.cur = right;
- }
- turnRight() {
- this.curIndex++;
- if (this.curIndex > 2) {
- this.curIndex = 1;
- }
- let left = this.nodeObj.left;
- let right = this.nodeObj.right;
- let cur = this.nodeObj.cur;
- Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
- Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
- Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
- this.updateData();
- }));
- this.ui.myNode.setChildIndex(left, 2);
- this.nodeObj.left = right;
- this.nodeObj.right = cur;
- this.nodeObj.cur = left;
- }
- updateData() {
- console.log('zh: updateData FFFFFFFFFF');
- let data = cfgTable.secretaryshopData;
- let children = this.ui.myNode._children;
- let temp;
- let curData;
- for (let index = 0; index < children.length; index++) {
- temp = children[index];
- curData = data[1];
- temp.heightTxt.text = curData.height;
- temp.foodTxt.text = curData.food;
- temp.historyTxt.text = curData.history;
- temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
- this.addSecretarySpine(temp.secretary, curData.spine);
- let womanIndex = curData.id - 1;
- let getWoman = DataMgr.getSecretary(womanIndex);
- let curUse = DataMgr.getCurSecretary();
- if (getWoman) {
- if (curUse == womanIndex) {
- temp.purchaseBtn.c1.selectedIndex = 1;
- }
- else {
- temp.purchaseBtn.c1.selectedIndex = 2;
- }
- }
- else {
- temp.purchaseBtn.c1.selectedIndex = 0;
- temp.purchaseBtn.diamondTxt.text = curData.price + "";
- }
- temp.purchaseBtn.visible = false;
- }
- }
- clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
- console.log('zh: 点击了clickSecretary ');
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- if (getWoman) {
- if (curUse != womanIndex) {
- console.log();
- DataMgr.setCurSecretary(womanIndex);
- this.updateData();
- }
- }
- else {
- console.log('zh:点击购买了');
- let need = needDiamond;
- if (DataMgr.diamondEnough(need)) {
- DataMgr.setDiamond(-need);
- DataMgr.setSecretary(womanIndex, 1);
- DataMgr.setCurSecretary(womanIndex);
- this.updateData();
- }
- else {
- xGame.uiMgr.Show(UIAddProp, 1);
- }
- }
- }
- closeSelf() {
- this.hide();
- }
- }
- UISecretary.uiName = "UISecretary";
- class ui_UIShop extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIShop"));
- }
- onConstruct() {
- this.n48 = (this.getChild("n48"));
- this.n0 = (this.getChild("n0"));
- this.secretary = (this.getChild("secretary"));
- this.talkNode = (this.getChild("talkNode"));
- this.closeNode = (this.getChild("closeNode"));
- this.moneyNode = (this.getChild("moneyNode"));
- this.myNode = (this.getChild("myNode"));
- }
- }
- ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
- class BallRodDisplay {
- constructor(ui, index) {
- this.index = 0;
- this.uiIndex = 0;
- this.ui = ui;
- this.index = index;
- this.initData();
- }
- initData() {
- this.ui.purchaseBtn.onClick(this, this.buyBallRod);
- let data = cfgTable.ballrodData[this.index + 1];
- this.ui.nameTxt.text = data.name;
- this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
- this.ui.levelNode.c1.selectedIndex = data.quality;
- this.ui.purchaseBtn.diamondTxt.text = data.price + "";
- if (data.spine) {
- this.mySpine = new SpineMgr(data.spine, () => {
- let xx = 150;
- let yy = 70;
- let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
- this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
- });
- }
- }
- updateSelf() {
- console.log('zh:updateSelf -------------- ');
- let get = DataMgr.getBallRod(this.index);
- if (get == null)
- get = 1;
- let curUse = DataMgr.getCurBallRod();
- console.log('zh:updateSelf 选择的球杆 = ' + curUse);
- if (get) {
- if (curUse == this.index) {
- this.ui.purchaseBtn.c1.selectedIndex = 0;
- }
- else {
- this.ui.purchaseBtn.c1.selectedIndex = 1;
- }
- }
- else {
- this.ui.purchaseBtn.c1.selectedIndex = 2;
- }
- }
- buyBallRod() {
- console.log('zh:buyBallRod eeeeee');
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
- switch (selectedIndex) {
- case 0:
- break;
- case 1:
- console.log('zh:点击了 USE THIS');
- DataMgr.setCurBallRod(this.index);
- let curUse = DataMgr.getCurBallRod();
- console.log('zh:updateSelf 选择的球杆 = ' + curUse);
- let ui = xGame.uiMgr.getUI(UIShop);
- ui.updateBallRod();
- break;
- case 2:
- let data = cfgTable.ballrodData[this.index + 1];
- let need = data.price;
- if (DataMgr.diamondEnough(need)) {
- DataMgr.setDiamond(-need);
- DataMgr.setBallRod(this.index, 1);
- DataMgr.setCurBallRod(this.index);
- let ui = xGame.uiMgr.getUI(UIShop);
- ui.updateBallRod();
- }
- else {
- xGame.uiMgr.Show(UIAddProp, 1);
- }
- break;
- default:
- break;
- }
- }
- }
- class UIShop extends UIBase {
- constructor() {
- super();
- this.itemNums = 0;
- }
- onConstructor() {
- this.ui = ui_UIShop.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.moneyNode = new MoneyNode(this.ui.moneyNode);
- this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
- this.addUIClick(this.ui, this.interuptSecretary);
- this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
- this.ballRodArr = [];
- this.itemNums = Object.keys(cfgTable.ballrodData).length;
- this.ui.myNode.myList.numItems = this.itemNums;
- if (Moyu.isKs)
- this.ui.closeNode.closeBtn.x += 100;
- }
- show() {
- super.show();
- this.playSecretaryIdle();
- this.updateBallRod();
- }
- updateBallRod() {
- for (let index = 0; index < this.ballRodArr.length; index++) {
- this.ballRodArr[index].updateSelf();
- }
- }
- renderBallRod(sort, obj) {
- let index = this.getIndexBySort(sort + 1) - 1;
- let ballRod = new BallRodDisplay(obj, index);
- this.ballRodArr.push(ballRod);
- }
- getIndexBySort(sort) {
- let object = cfgTable.ballrodData;
- for (const key in object) {
- if (object[key].sort == sort) {
- return parseInt(key);
- }
- }
- }
- playSecretaryIdle() {
- let parent = this.ui.secretary.displayObject;
- parent.destroyChildren();
- let xx = this.ui.secretary.width / 2;
- let yy = this.ui.secretary.height;
- let scale = xGame.common.getSecretaryScale();
- let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
- xGame.common.secretary.play(data, 0, true, parent);
- }
- interuptSecretary() {
- Laya.timer.clearAll(this);
- this.playSecretaryRandomSound();
- }
- playSecretaryRandomSound() {
- if (this.isHide)
- return;
- let time = xGame.common.randomNum(45000, 60000);
- Laya.timer.once(time, this, () => {
- if (this.isHide)
- return;
- let index = xGame.common.randomNum(4, 7);
- xGame.soundMgr.playSound("s_main0" + index);
- let words = 1;
- switch (index) {
- case 4:
- words = 5;
- break;
- case 5:
- words = 3;
- break;
- case 6:
- words = 6;
- break;
- case 7:
- words = 7;
- break;
- default:
- break;
- }
- xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
- this.playSecretaryRandomSound();
- });
- }
- closeSelf() {
- this.hide();
- }
- }
- UIShop.uiName = "UIShop";
- class ui_UISign extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UISign"));
- }
- onConstruct() {
- this.n6 = (this.getChild("n6"));
- this.closeNode = (this.getChild("closeNode"));
- this.myNode = (this.getChild("myNode"));
- this.moneyNode = (this.getChild("moneyNode"));
- this.secretary = (this.getChild("secretary"));
- this.talkNode = (this.getChild("talkNode"));
- this.tripleBtn = (this.getChild("tripleBtn"));
- this.normalBtn = (this.getChild("normalBtn"));
- this.tipsNode = (this.getChild("tipsNode"));
- this.againBtn = (this.getChild("againBtn"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
- class SignMax {
- constructor(ui) {
- this.ui = ui;
- }
- updateSelf(index, sameDay, curDayIndex) {
- let data = cfgTable.signData[index + 1];
- this.ui.titleTxt.text = data.title;
- let arr1 = data.award[0].split('-');
- let arr2 = data.award[1].split('-');
- let num1 = parseInt(arr1[1]);
- let num2 = parseInt(arr2[1]);
- this.ui.numTxt1.text = num1 + "";
- this.ui.numTxt2.text = num2 + "";
- this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
- this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
- if (xGame.common.signAwardContainsRod([data.award[0]])) {
- this.ui.numTxt1.visible = false;
- }
- else {
- this.ui.numTxt1.visible = true;
- }
- if (xGame.common.signAwardContainsRod([data.award[1]])) {
- this.ui.numTxt2.visible = false;
- }
- else {
- this.ui.numTxt2.visible = true;
- }
- if (index < curDayIndex) {
- this.ui.c1.selectedIndex = 1;
- }
- else if (index == curDayIndex) {
- if (sameDay) {
- this.ui.c1.selectedIndex = 2;
- }
- else {
- this.ui.c1.selectedIndex = 2;
- }
- }
- else {
- this.ui.c1.selectedIndex = 0;
- }
- }
- }
- class SignNormal {
- constructor(ui) {
- this.ui = ui;
- }
- updateSelf(index, sameDay, curDayIndex) {
- let data = cfgTable.signData[index + 1];
- this.ui.titleTxt.text = data.title;
- let arr = data.award[0].split('-');
- let type = parseInt(arr[0]);
- let num = parseInt(arr[1]);
- this.ui.numTxt.text = num + "";
- if (type > 2) {
- this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
- this.ui.myIcon.rotation = 0;
- }
- else {
- this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
- this.ui.myIcon.rotation = 0;
- }
- if (xGame.common.signAwardContainsRod(data.award)) {
- this.ui.numTxt.visible = false;
- }
- else {
- this.ui.numTxt.visible = true;
- }
- if (index < curDayIndex) {
- this.ui.c1.selectedIndex = 1;
- }
- else if (index == curDayIndex) {
- if (sameDay) {
- this.ui.c1.selectedIndex = 2;
- }
- else {
- this.ui.c1.selectedIndex = 2;
- }
- }
- else {
- this.ui.c1.selectedIndex = 0;
- }
- }
- }
- class UISign extends UIBase {
- constructor() {
- super();
- this.curDayIndex = 0;
- this.starX = 0;
- }
- onConstructor() {
- this.ui = ui_UISign.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.moneyNode = new MoneyNode(this.ui.moneyNode);
- this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
- this.initSignItem();
- this.addUIClick(this.ui.normalBtn, this.normalGetAward);
- this.addUIClick(this.ui.againBtn, this.againGetAward);
- }
- show() {
- super.show();
- this.ui.t0.play();
- this.playSecretaryIdle();
- this.updateSign();
- }
- initSignItem() {
- this.signArr = [];
- for (let index = 0; index < 6; index++) {
- let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
- this.signArr.push(temp);
- }
- this.signMax = new SignMax(this.ui.myNode.day7);
- if (Moyu.isKs)
- this.ui.closeNode.closeBtn.x += 100;
- }
- updateSign() {
- let sameDay = xGame.common.judgeSameDay();
- let max = 7;
- this.curDayIndex = DataMgr.getSignData();
- if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
- this.curDayIndex = 0;
- if (!sameDay) {
- this.ui.normalBtn.visible = true;
- this.ui.tipsNode.visible = false;
- this.ui.againBtn.visible = false;
- }
- else {
- this.ui.normalBtn.visible = false;
- let again = DataMgr.getExtraSign();
- let isCurrency = false;
- let index = this.curDayIndex;
- if (index == 0)
- index = 7;
- let award = cfgTable.signData[index].award;
- let num = award[0].split("-")[0];
- if (num == "1" || num == "2")
- isCurrency = true;
- let showAgain = again == 0 && isCurrency;
- this.ui.againBtn.visible = showAgain;
- this.ui.tipsNode.visible = !showAgain;
- }
- for (let index = 0; index < this.signArr.length; index++) {
- this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
- }
- this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
- }
- playSecretaryIdle() {
- let parent = this.ui.secretary.displayObject;
- parent.destroyChildren();
- let xx = this.ui.secretary.width / 2;
- let yy = this.ui.secretary.height;
- let scale = xGame.common.getSecretaryScale();
- let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
- xGame.common.secretary.play(data, 0, true, parent);
- }
- closeSelf() {
- this.hide();
- }
- normalGetAward() {
- let sameDay = xGame.common.judgeSameDay();
- if (!sameDay) {
- let award = cfgTable.signData[this.curDayIndex + 1].award;
- let temp;
- let type;
- let num;
- let arr = [];
- for (let index = 0; index < award.length; index++) {
- temp = award[index].split("-");
- type = parseInt(temp[0]);
- num = parseInt(temp[1]);
- let awardType = new AwardType();
- awardType.num = num;
- awardType.type = type;
- arr.push(awardType);
- }
- xGame.common.getAward(arr, (watchVideo) => {
- this.curDayIndex++;
- if (this.curDayIndex > 7)
- this.curDayIndex = 0;
- DataMgr.setSignData(this.curDayIndex);
- DataMgr.setSignTime(new Date().getTime());
- if (watchVideo) {
- DataMgr.setExtraSign(1);
- Moyu.sendDataEvent("signIn1");
- }
- this.updateSign();
- });
- }
- }
- againGetAward() {
- Moyu.sendDataEvent("signIn2");
- console.log('zh:qjff_AD_for_uisign');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_uisign();
- }
- }
- qjff_AD_for_uisign() {
- let index = this.curDayIndex;
- if (index == 0)
- index = 7;
- let award = cfgTable.signData[index].award;
- let temp;
- let type;
- let num;
- for (let index = 0; index < award.length; index++) {
- temp = award[index].split("-");
- type = parseInt(temp[0]);
- num = parseInt(temp[1]) * 3;
- xGame.common.playObjFlyAnim(num, type);
- }
- DataMgr.setExtraSign(1);
- this.updateSign();
- }
- }
- UISign.uiName = "UISign";
- class ui_UISkill extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UISkill"));
- }
- onConstruct() {
- this.n48 = (this.getChild("n48"));
- this.n0 = (this.getChild("n0"));
- this.secretary = (this.getChild("secretary"));
- this.talkNode = (this.getChild("talkNode"));
- this.closeNode = (this.getChild("closeNode"));
- this.moneyNode = (this.getChild("moneyNode"));
- this.skillNode = (this.getChild("skillNode"));
- this.guideNode = (this.getChild("guideNode"));
- }
- }
- ui_UISkill.URL = "ui://isxx5ak7j69a40z";
- class SkillDisplay {
- constructor(ui, data, uiIndex) {
- this.starX = 0;
- this.starY = 0;
- this.index = 0;
- this.ui = ui;
- this.data = data;
- this.index = uiIndex;
- this.initSelf();
- console.log('zh:SkillDisplay constructor this.skillData=', data);
- }
- initSelf() {
- this.ui.normalBtn.onClick(this, this.clickAddLevel);
- this.ui.nameTxt.text = this.data.name;
- this.ui.describeTxt.text = this.data.describe;
- this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
- this.ui.startBtn.onClick(this, this.startGame);
- this.updateSelf();
- }
- updateSelf() {
- this.checkTry();
- let level = DataMgr.getBigSkillByIndex(this.index);
- this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
- }
- checkTry() {
- let index = this.index;
- let level = DataMgr.getBigSkillByIndex(index);
- if (level == null) {
- DataMgr.setBigSkill(index, 1, false);
- level = 1;
- }
- this.ui.levelTxt.text = "LV." + level;
- if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
- this.ui.tryNode.visible = true;
- else
- this.ui.tryNode.visible = false;
- }
- clickAddLevel() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- Moyu.sendDataEvent("UpSkill", { id: this.data.index });
- console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
- if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
- this.qjff_AD_for_skilldisplay_clickAddLevel();
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_skilldisplay_clickAddLevel();
- }
- }
- qjff_AD_for_skilldisplay_clickAddLevel() {
- DataMgr.setBigSkill(this.data.index, 1);
- this.updateSelf();
- xGame.common.upSkillLevel = true;
- }
- startGame() {
- if (this.data.index == 3) {
- alert('Coming soon!');
- return;
- }
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- let needCoin = xGame.common.bigMoveNeedCoin;
- xGame.common.passAwardCoin = 2000;
- let guide = DataMgr.getSkillGuide();
- console.log('zh:startGame guide=' + guide);
- xGame.common.temSelfLevel = 0;
- if (guide == 0) {
- needCoin = 0;
- xGame.common.temSelfLevel = 100;
- }
- if (DataMgr.coinEnough(needCoin)) {
- DataMgr.setCoin(-needCoin);
- xGame.common.curPlayerSkillType = this.index;
- if (guide == 0)
- xGame.common.curPlayerSkillType = 0;
- xGame.uiMgr.Show(UIGame);
- xGame.uiMgr.Hide(UIMain);
- xGame.uiMgr.Show(UIMatching, () => {
- xGame.common.gameUI.ui.alpha = 1;
- xGame.common.gameUI.startGame();
- xGame.uiMgr.Hide(UISkill);
- });
- }
- else {
- xGame.uiMgr.Show(UIAddProp, 0);
- Moyu.sendDataEvent("AddCoinVideo");
- }
- }
- }
- class UISkill extends UIBase {
- constructor() {
- super();
- this.skillData = [];
- }
- onConstructor() {
- this.ui = ui_UISkill.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.moneyNode = new MoneyNode(this.ui.moneyNode);
- this.initSkillData();
- console.log('zh:aaaaaa1111111111');
- this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
- this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
- console.log('zh:aaaaaa22222222');
- this.displayList = [];
- this.ui.skillNode.skillList.numItems = 3;
- this.addUIClick(this.ui, this.interuptSecretary);
- this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
- this.ui.talkNode.visible = false;
- if (Moyu.isKs)
- this.ui.closeNode.closeBtn.x += 100;
- }
- show() {
- super.show();
- this.playSecretaryIdle();
- this.moneyNode.ui.c1.selectedIndex = 1;
- Laya.timer.clearAll(this);
- xGame.soundMgr.playSound("s_start");
- xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
- let guide = DataMgr.getSkillGuide();
- this.ui.guideNode.visible = guide == 0;
- let item = this.getSkillItemByUIIndex(0);
- if (guide == 0) {
- item.ui.c1.selectedIndex = 1;
- }
- else {
- item.ui.c1.selectedIndex = 0;
- }
- this.ui.guideNode.guideBtn.visible = guide == 0;
- for (let index = 0; index < this.displayList.length; index++) {
- this.displayList[index].checkTry();
- }
- }
- getSkillItemByUIIndex(cur) {
- for (let index = 0; index < this.displayList.length; index++) {
- if (this.displayList[index].index == cur) {
- return this.displayList[index];
- }
- }
- }
- enterGuideLevel() {
- let item = this.getSkillItemByUIIndex(0);
- item.startGame();
- if (DataMgr.getNewUser())
- Moyu.sendDataEvent("gameStart1");
- }
- initSkillData() {
- this.skillData = [];
- let nameList = xGame.common.skillNameList;
- let iconList = xGame.common.skillIconList;
- let describeList = [
- "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
- "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
- "The power of frost descends—freezing the flow and taking full control of the game!"
- ];
- console.log('zh:initSkillData 111111111');
- let data;
- for (let index = 0; index < nameList.length; index++) {
- data = {};
- data.name = nameList[index];
- data.icon = iconList[index];
- data.describe = describeList[index];
- data.index = index;
- this.skillData.push(data);
- }
- }
- updateSkillItem(index, target) {
- if (this.displayList[index] == null) {
- let uiIndex;
- switch (index) {
- case 0:
- uiIndex = 1;
- break;
- case 1:
- uiIndex = 0;
- break;
- case 2:
- uiIndex = 2;
- break;
- case 3:
- uiIndex = 3;
- break;
- default:
- break;
- }
- let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
- this.displayList.push(temp);
- }
- }
- playSecretaryIdle() {
- let parent = this.ui.secretary.displayObject;
- parent.destroyChildren();
- let xx = this.ui.secretary.width / 2;
- let yy = this.ui.secretary.height;
- let scale = xGame.common.getSecretaryScale();
- let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
- xGame.common.secretary.play(data, 0, true, parent);
- }
- returnUIMain() {
- this.hide();
- xGame.common.stopGirlPop(this.ui.talkNode);
- xGame.uiMgr.Show(UIMain);
- }
- interuptSecretary() {
- Laya.timer.clearAll(this);
- this.playSecretaryRandomSound();
- }
- playSecretaryRandomSound() {
- if (this.isHide)
- return;
- let time = xGame.common.randomNum(45000, 60000);
- Laya.timer.once(time, this, () => {
- if (this.isHide)
- return;
- let index = xGame.common.randomNum(4, 7);
- xGame.soundMgr.playSound("s_main0" + index);
- let words = 1;
- switch (index) {
- case 4:
- words = 5;
- break;
- case 5:
- words = 3;
- break;
- case 6:
- words = 6;
- break;
- case 7:
- words = 7;
- break;
- default:
- break;
- }
- xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
- this.playSecretaryRandomSound();
- });
- }
- }
- UISkill.uiName = "UISkill";
- class ui_UIMsg extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIMsg"));
- }
- onConstruct() {
- this.tipsNode = (this.getChild("tipsNode"));
- }
- }
- ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
- class UIMsg extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UIMsg.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.isMuti = true;
- }
- show(msg, callback) {
- super.show();
- this.ui.tipsNode.msgTxt.text = msg;
- this.ui.alpha = 1;
- Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
- this.hide();
- callback && callback();
- }), 1000);
- }
- }
- UIMsg.uiName = "UIMsg";
- class ui_UIModeSelection extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIModeSelection"));
- }
- onConstruct() {
- this.n19 = (this.getChild("n19"));
- this.closeBtn = (this.getChild("closeBtn"));
- this.myNode = (this.getChild("myNode"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
- class UIModeSelection extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UIModeSelection.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
- this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
- this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
- this.addUIClick(this.ui.closeBtn, this.hide);
- this.peopleArr = [650, 6900, 3800];
- this.peopleOffest = [50, 500, 200];
- this.updateSelf();
- }
- show(callback) {
- super.show();
- this.ui.t0.play();
- this.callback = callback;
- }
- updateSelf() {
- let cfg = cfgTable.modeselectData;
- for (let index = 1; index <= 3; index++) {
- let node = this.ui.myNode["type" + index];
- node.need.text = cfg[index].need;
- node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
- node.peopleTxt.text = this.getRandPeople(index - 1);
- }
- }
- enterGame(type) {
- xGame.common.classicRoomType = type;
- let cfg = cfgTable.modeselectData[type];
- let need = cfg.need;
- xGame.common.passAwardCoin = cfg.award;
- if (DataMgr.coinEnough(need)) {
- DataMgr.setCoin(-need);
- this.ui.myNode["type" + type].t0.play();
- Laya.timer.once(200, this, () => {
- this.callback && this.callback();
- });
- }
- else {
- Moyu.sendDataEvent("AddCoinVideo");
- xGame.uiMgr.Show(UIAddProp, 0);
- }
- }
- getRandPeople(index) {
- let rand = this.peopleOffest[index];
- return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
- }
- }
- UIModeSelection.uiName = "UIModeSelection";
- class ui_UIGetAward extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIGetAward"));
- }
- onConstruct() {
- this.n4 = (this.getChild("n4"));
- this.n0 = (this.getChild("n0"));
- this.myList = (this.getChild("myList"));
- this.n1 = (this.getChild("n1"));
- this.eftNode = (this.getChild("eftNode"));
- this.btnNode = (this.getChild("btnNode"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
- class UIGetAward extends UIBase {
- constructor() {
- super();
- this.showTriple = true;
- }
- onConstructor() {
- this.ui = ui_UIGetAward.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
- this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
- this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
- }
- show(arr, showTriple, callback) {
- super.show();
- this.ui.t0.play();
- this.ui.eftNode.visible = true;
- this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
- this.ui.eftNode.visible = false;
- }), 1, 0, 0, 0.9);
- this.awardArr = arr;
- this.showTriple = showTriple;
- this.callback = callback;
- this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
- this.ui.myList.numItems = arr.length;
- xGame.soundMgr.playSound("getaward");
- }
- updateSelf(index, obj) {
- let temp = this.awardArr[index];
- let icon = this.getIcon(temp.type);
- let str = icon;
- if (temp.type > 2) {
- str = "s" + icon;
- }
- obj.myIcon.url = xGame.common.getGameIconUrl(str);
- obj.myIcon.rotation = 0;
- obj.numTxt.text = temp.num + "";
- obj.numTxt.visible = temp.type > 2 ? false : true;
- obj.nameTxt.text = this.getNameStr(temp.type);
- }
- renderItem(index, obj) {
- this.updateSelf(index, obj);
- }
- tripleGetAward() {
- console.log('zh:qjff_AD_for_uigetAward');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_uigetAward();
- }
- }
- qjff_AD_for_uigetAward() {
- this.getAward(3);
- }
- normalGetAward() {
- if (PlatMgr.isMisVideo())
- this.tripleGetAward();
- else
- this.getAward();
- }
- getAward(times = 1) {
- this.hide();
- for (let index = 0; index < this.awardArr.length; index++) {
- this.awardArr[index].num *= times;
- }
- this.callback && this.callback(times != 1);
- }
- getIcon(type) {
- switch (type) {
- case Prop.diamond:
- return "ty_zs";
- case Prop.coin:
- return "ty_jb";
- case Prop.gan1:
- return "qg1";
- case Prop.gan2:
- return "qg2";
- case Prop.gan3:
- return "qg3";
- case Prop.gan4:
- return "qg4";
- default:
- break;
- }
- }
- getNameStr(type) {
- switch (type) {
- case Prop.diamond:
- return "Diamond";
- case Prop.coin:
- return "Coins";
- case Prop.gan1:
- case Prop.gan2:
- case Prop.gan3:
- case Prop.gan4:
- return cfgTable.ballrodData[type - 1].name;
- default:
- break;
- }
- }
- }
- UIGetAward.uiName = "UIGetAward";
- class ui_UIRepentProp extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIRepentProp"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n11 = (this.getChild("n11"));
- this.regretNode = (this.getChild("regretNode"));
- this.helpLineNode = (this.getChild("helpLineNode"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
- class UIRepentProp extends UIBase {
- constructor() {
- super();
- this.viewType = 0;
- this.regretType = 0;
- }
- onConstructor() {
- this.ui = ui_UIRepentProp.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
- this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
- this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
- this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
- }
- show(viewType, regretType, callback) {
- PlatMgr.showInsert(true);
- this.viewType = viewType;
- this.regretType = regretType;
- this.callback = callback;
- super.show();
- this.ui.t0.play();
- this.ui.c1.selectedIndex = this.viewType;
- this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
- if (this.viewType == 0) {
- let guide = DataMgr.getGuideHelpLine();
- this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
- this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
- }
- xGame.common.gameMgr.gamePause = true;
- }
- hideSelf() {
- xGame.common.gameMgr.gamePause = false;
- this.callback && this.callback(false);
- this.hide();
- }
- videoRegret() {
- console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_UIrepentProp_videoRegret();
- }
- }
- qjff_AD_for_UIrepentProp_videoRegret() {
- this.callback && this.callback(true);
- this.hideSelf();
- }
- videoAddHelpLine() {
- let guide = DataMgr.getGuideHelpLine();
- if (guide == 0) {
- this.callback && this.callback(true);
- this.hideSelf();
- DataMgr.setGuideHelpLine();
- xGame.common.gameUI.ui.guideNode.visible = false;
- }
- else {
- console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
- }
- }
- }
- qjff_AD_for_UIrepentProp_videoAddHelpLine() {
- this.callback && this.callback(true);
- this.hideSelf();
- }
- }
- UIRepentProp.uiName = "UIRepentProp";
- class UIMain extends UIBase {
- constructor() {
- super();
- this.firstEnter = true;
- }
- nativeCallJs(msg) {
- let t = msg;
- console.log("zh: nativeCallJs 奖励开始发放:", t);
- switch (t) {
- case 'qjff_chouJiang':
- let dui = xGame.uiMgr.getUI(UIDraw);
- dui.qjff_chouJiang();
- break;
- case 'qjff_AD_for_uisign':
- let dui2 = xGame.uiMgr.getUI(UISign);
- dui2.qjff_AD_for_uisign();
- break;
- case 'qjff_AD_for_uitry':
- let dui3 = xGame.uiMgr.getUI(UITry);
- dui3.qjff_AD_for_uitry();
- break;
- case 'qjff_AD_for_uipower':
- let dui4 = xGame.uiMgr.getUI(UIPower);
- dui4.qjff_AD_for_uipower();
- break;
- case 'qjff_AD_for_uigetAward':
- let dui5 = xGame.uiMgr.getUI(UIGetAward);
- dui5.qjff_AD_for_uigetAward();
- break;
- case 'qjff_AD_for_uiGameEnd':
- let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
- let dui6 = xGame.uiMgr.getUI(UIGameEnd);
- dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
- break;
- case 'qjff_AD_for_uiAddProp_videoGetDiamond':
- let dui7 = xGame.uiMgr.getUI(UIAddProp);
- dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
- break;
- case 'qjff_AD_for_uiAddProp_videoGetCoin':
- let dui8 = xGame.uiMgr.getUI(UIAddProp);
- dui8.qjff_AD_for_uiAddProp_videoGetCoin();
- break;
- case 'qjff_AD_for_UIrepentProp_videoRegret':
- let dui9 = xGame.uiMgr.getUI(UIRepentProp);
- dui9.qjff_AD_for_UIrepentProp_videoRegret();
- break;
- case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
- let dui10 = xGame.uiMgr.getUI(UIRepentProp);
- dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
- break;
- case 'qjff_AD_for_UIBOX_onOpenBox':
- let dui11 = xGame.uiMgr.getUI(UIBox);
- dui11.qjff_AD_for_UIBOX_onOpenBox();
- break;
- case 'qjff_AD_for_UIAddCoin':
- let dui12 = xGame.uiMgr.getUI(UIAddCoin);
- dui12.qjff_AD_for_UIAddCoin();
- break;
- case '111a':
- let dui14 = xGame.uiMgr.getUI(UISign);
- dui14.qjff_AD_for_uisign();
- break;
- case '222a':
- let dui15 = xGame.uiMgr.getUI(UISign);
- dui15.qjff_AD_for_uisign();
- break;
- case '333a':
- let dui16 = xGame.uiMgr.getUI(UISign);
- dui16.qjff_AD_for_uisign();
- break;
- default:
- console.log('zh:未知的方法名字' + t);
- break;
- }
- }
- onConstructor() {
- console.log('zh: UIMain onConstructor');
- this.ui = ui_UIMain.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addEvent();
- this.addClickSpine();
- this.settingNode = new SettingNode(this.ui.settingNode);
- this.moneyNode = new MoneyNode(this.ui.moneyNode);
- xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
- xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
- xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
- let curUse = DataMgr.getCurSecretary();
- this.changeSecretary(curUse);
- this.ui.talkNode.visible = false;
- let guide = DataMgr.getSkillGuide();
- if (xGame.common.isNewDay && guide == 1) {
- xGame.common.isNewDay = false;
- xGame.soundMgr.playSound("s_main01");
- xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
- console.log("zh:播放小秘书每天语音");
- }
- this.ui.n83.visible = false;
- window['nativeCallJs'] = this.nativeCallJs.bind(this);
- }
- changeSecretary(curUse) {
- let name = cfgTable.secretaryshopData[curUse + 1].spine;
- xGame.common.secretary && xGame.common.secretary.dispose();
- this.addSecretarySpine(name);
- }
- addSecretarySpine(name) {
- let spine = new SpineMgr(name, () => {
- this.playSecretaryIdle();
- });
- xGame.common.secretary = spine;
- }
- addClickSpine() {
- let clickSpine = new SpineMgr("dianji", () => {
- Laya.stage.on(Laya.Event.CLICK, this, (e) => {
- let parent = Laya.stage;
- let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
- clickSpine.play(data, 0, false, parent, (spine) => {
- spine.destroy(true);
- });
- });
- });
- }
- addEvent() {
- this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
- this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
- this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
- this.addUIClick(this.ui.globalBtn, this.startGlobal);
- this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
- this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
- this.addUIClick(this.ui, this.interuptSecretary);
- this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
- this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
- this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
- this.addUIClick(this.ui.shopBtn, this.openShopView);
- this.addUIClick(this.ui.signBtn, this.openSignView);
- this.addUIClick(this.ui.drawBtn, this.openDrawView);
- this.addUIClick(this.ui.rankBtn, this.openRanking);
- }
- show(showFailWords) {
- super.show();
- this.moneyNode.ui.c1.selectedIndex = 1;
- this.playSecretaryIdle();
- xGame.soundMgr.playMusic("caromhall01", 0);
- Laya.timer.clearAll(this);
- this.playSecretaryRandomSound();
- console.log('zh:uimain.ts show show FailWords=', showFailWords);
- if (showFailWords) {
- console.log('zh:uimain.ts ');
- setTimeout(() => {
- let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
- let words = -1;
- if (str == "s_main02") {
- words = 2;
- }
- else {
- words = 3;
- }
- xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
- xGame.soundMgr.playSound(str);
- }, 300);
- }
- this.showGuide();
- this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
- this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
- let guide = DataMgr.getSkillGuide();
- if (guide == 1) {
- let randTime = xGame.common.randomNum(300, 800);
- if (this.firstEnter) {
- this.firstEnter = false;
- randTime += 900;
- }
- Laya.timer.once(randTime, this, () => {
- xGame.common.autoPopUIView();
- });
- }
- }
- checkActive(show) {
- }
- showGuide() {
- let guide = DataMgr.getSkillGuide();
- this.ui.guideBtn.visible = guide == 0;
- this.ui.enterGuide.visible = false;
- this.ui.secretaryGuide.visible = guide == 0;
- if (guide == 0) {
- xGame.soundMgr.playSound("s_guide");
- xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
- }
- }
- ensureSecretary() {
- console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
- this.ui.secretaryGuide.visible = false;
- this.ui.enterGuide.visible = true;
- this.ui.wordsNode.t0.play();
- if (DataMgr.getNewUser())
- Moyu.sendDataEvent("gameReady");
- }
- playSecretaryIdle() {
- let parent = this.ui.secretary.displayObject;
- parent.destroyChildren();
- let xx = this.ui.secretary.width / 2;
- let yy = this.ui.secretary.height;
- let scale = xGame.common.getSecretaryScale();
- let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
- console.log("zh:playSecretaryIdle", data);
- xGame.common.secretary.play(data, 0, true, parent);
- }
- startGame(type) {
- xGame.common.gameMode = type;
- Moyu.sendDataEvent("PlayGame", { type: type });
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- let challengeTimes = DataMgr.getChallengeTimes();
- if (challengeTimes == 0) {
- xGame.uiMgr.Show(UIInvitation);
- }
- else {
- this.beginGame();
- }
- break;
- case GameMode.bigMove:
- this.beginGame();
- if (DataMgr.getNewUser())
- Moyu.sendDataEvent("gameStart0");
- break;
- default:
- break;
- }
- }
- beginGame(isNice = false) {
- console.log('zh:beginGame beginGame beginGame');
- if (xGame.common.gameMode == GameMode.classic) {
- if (isNice) {
- this.enterClassic();
- }
- else {
- xGame.uiMgr.Show(UIModeSelection, () => {
- this.enterClassic();
- });
- }
- }
- else if (xGame.common.gameMode == GameMode.bigMove) {
- this.ui.enterGuide.visible = false;
- xGame.uiMgr.Show(UISkill);
- }
- }
- enterClassic() {
- xGame.uiMgr.Show(UIGame);
- xGame.uiMgr.Show(UIMatching, () => {
- if (!this.isHide)
- this.hide();
- xGame.common.gameUI.ui.alpha = 1;
- xGame.common.gameUI.startGame();
- xGame.uiMgr.Hide(UIGameEnd);
- });
- }
- startGlobal() {
- xGame.uiMgr.Show(UIMsg, "Coming Soon");
- }
- startWeekly() {
- xGame.uiMgr.Show(UIMsg, "Coming Soon");
- }
- zhouSaiMonth() {
- console.log('zh: zhouSaiMonth 被调用');
- }
- startPlaceBall() {
- xGame.uiMgr.Show(UILevelDisplay);
- }
- hide() {
- console.log('zh:uimain hide ...');
- super.hide();
- xGame.common.stopGirlPop(this.ui.talkNode);
- }
- onGetUserInfo(force = false) {
- if (Moyu.isWx) {
- let info = Moyu.getSystemInfo();
- if (info)
- Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
- }
- else {
- Moyu.initUser(this, this.freshUser, force);
- }
- if (!Moyu.hasUserInfo) {
- let user = Moyu.getUserInfo();
- user.headIcon = 'res/ty_touxiang.png';
- }
- this.freshUser();
- }
- freshUser() {
- let user = Moyu.getUserInfo();
- if (!user.isAuth) {
- user.headIcon = 'res/ty_touxiang.png';
- }
- else
- DataMgr.upRankData();
- this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
- xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
- }
- interuptSecretary() {
- Laya.timer.clearAll(this);
- this.playSecretaryRandomSound();
- }
- playSecretaryRandomSound() {
- if (this.isHide)
- return;
- let time = xGame.common.randomNum(45000, 60000);
- Laya.timer.once(time, this, () => {
- if (this.isHide)
- return;
- let index = xGame.common.randomNum(4, 7);
- xGame.soundMgr.playSound("s_main0" + index);
- let words = 1;
- switch (index) {
- case 4:
- words = 5;
- break;
- case 5:
- words = 3;
- break;
- case 6:
- words = 6;
- break;
- case 7:
- words = 7;
- break;
- default:
- break;
- }
- xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
- this.playSecretaryRandomSound();
- });
- }
- openSecretaryView() {
- xGame.uiMgr.Show(UISecretary);
- Moyu.sendDataEvent("secretary");
- }
- openShopView() {
- xGame.uiMgr.Show(UIShop);
- }
- openSignView() {
- xGame.uiMgr.Show(UISign);
- }
- openDrawView() {
- xGame.uiMgr.Show(UIDraw);
- }
- openRanking() {
- console.log('zh:phb openRanking');
- xGame.uiMgr.Show(UIRanking);
- Moyu.sendDataEvent("rankingList");
- }
- }
- UIMain.uiName = "UIMain";
- class UIGameEnd extends UIBase {
- constructor() {
- super();
- this.success = false;
- this.awardCoinNum = 1000;
- this.awardDiamondNum = 10;
- }
- onConstructor() {
- this.ui = ui_UIGameEnd.createInstance();
- this.contentPane = this.ui;
- this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
- this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
- this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
- this.moneyNode = new MoneyNode(this.ui.moneyNode);
- this.ui.talkNode.visible = false;
- if (Moyu.isKs)
- this.ui.closeNode.closeBtn.x += 100;
- }
- updateType() {
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- this.ui.c1.selectedIndex = this.success ? 0 : 1;
- this.ui.coinNode.visible = this.success;
- if (!this.success) {
- Laya.timer.once(500, this, () => {
- xGame.uiMgr.Show(UIAddCoin);
- });
- }
- this.ui.isGetAward.visible = false;
- this.ui.leftBtn.c1.selectedIndex = 3;
- this.ui.rightBtn.c1.selectedIndex = 0;
- this.moneyNode.ui.c1.selectedIndex = 1;
- break;
- case GameMode.bigMove:
- this.ui.c1.selectedIndex = this.success ? 0 : 1;
- this.ui.coinNode.visible = this.success;
- if (xGame.common.gameMode == GameMode.bigMove) {
- if (this.success) {
- DataMgr.setSkillSuccessTimes(1, true);
- DataMgr.setSkillAccTimes(1);
- }
- else {
- DataMgr.setSkillSuccessTimes(0, false);
- }
- }
- if (!this.success) {
- Laya.timer.once(500, this, () => {
- xGame.uiMgr.Show(UIAddCoin);
- });
- }
- this.ui.isGetAward.visible = false;
- this.ui.leftBtn.c1.selectedIndex = 3;
- this.ui.rightBtn.c1.selectedIndex = 0;
- this.moneyNode.ui.c1.selectedIndex = 1;
- break;
- case GameMode.placeBall:
- this.ui.coinNode.visible = false;
- if (this.success) {
- if (xGame.common.placeBallStarNum == 3) {
- this.ui.c1.selectedIndex = 2;
- }
- else {
- this.ui.c1.selectedIndex = 3;
- }
- }
- else {
- this.ui.c1.selectedIndex = 4;
- }
- let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
- if (cfg.type == PlaceBallType.challenge) {
- this.ui.c1.selectedIndex = 2;
- }
- this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
- this.updatePlaceBallBtn();
- this.updatePlaceBallStarNum();
- this.updatePlaceBallAwardState();
- this.moneyNode.ui.c1.selectedIndex = 2;
- this.moneyNode.checkPowerTime();
- this.moneyNode.powerChange();
- DataMgr.upRankData();
- break;
- default:
- break;
- }
- }
- updatePlaceBallBtn() {
- this.ui.leftBtn.c1.selectedIndex = 5;
- if (this.success) {
- this.ui.rightBtn.c1.selectedIndex = 14;
- }
- else {
- if (xGame.common.placeBallStarNum == 3) {
- this.ui.rightBtn.c1.selectedIndex = 14;
- }
- else {
- this.ui.rightBtn.c1.selectedIndex = 1;
- }
- }
- }
- updatePlaceBallStarNum() {
- let starNum = xGame.common.placeBallStarNum;
- if (starNum == 0)
- this.ui.starNumNode.c1.selectedIndex = 3;
- else {
- this.ui.starNumNode.c1.selectedIndex = starNum - 1;
- }
- }
- updatePlaceBallAwardState() {
- let level = xGame.common.placeBallCurLevel;
- let starNum = xGame.common.placeBallStarNum;
- let getAward = DataMgr.getPlaceBallLevel(level).getAward;
- let data = cfgTable.placeballData[level].award;
- let cfg = cfgTable.placeballData[level];
- this.awardDiamondNum = data[1];
- this.awardCoinNum = data[0];
- if (cfg.type == PlaceBallType.challenge) {
- this.awardDiamondNum = 0;
- this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
- }
- this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
- this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
- if (cfg.type == PlaceBallType.challenge) {
- this.ui.awardNode.coinNode.visible = true;
- }
- if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
- this.ui.awardNode.diamondNode.x = 265;
- this.ui.awardNode.coinNode.x = 354;
- }
- else {
- this.ui.awardNode.diamondNode.x = 291;
- this.ui.awardNode.coinNode.x = 291;
- }
- this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
- this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
- if (this.awardCoinNum == 0) {
- this.ui.awardNode.coinNode.numTxt.text = "";
- }
- if (getAward) {
- this.ui.isGetAward.visible = true;
- this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
- this.ui.awardNode.coinNode.c1.selectedIndex = 2;
- }
- else {
- this.ui.isGetAward.visible = false;
- if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
- this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
- this.ui.awardNode.coinNode.c1.selectedIndex = 0;
- }
- else {
- this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
- this.ui.awardNode.coinNode.c1.selectedIndex = 1;
- }
- }
- }
- show(success) {
- super.show();
- xGame.eventMgr.event(RESET_GAME);
- this.success = success;
- Laya.timer.clearAll(this);
- this.playSecretaryAni();
- Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
- let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
- offsetTime = Math.floor(offsetTime / 1000);
- Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
- this.updateType();
- Laya.timer.once(200, this, () => {
- this.addAward(() => {
- this.updateType();
- Laya.timer.once(500, this, () => {
- this.showChallengeLevel();
- });
- });
- });
- if (this.success) {
- xGame.soundMgr.playSound('slots_roll01');
- xGame.soundMgr.playSound("s_win");
- xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
- }
- else {
- xGame.soundMgr.playSound('matchwin01');
- xGame.soundMgr.playSound("s_lose");
- xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
- }
- if (!Moyu.isLegal)
- PlatMgr.showBanner(true);
- let challengeNum = DataMgr.getChallengeTimes();
- if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
- DataMgr.setChallengeTimes(1);
- }
- if (this.success && xGame.common.gameMode == GameMode.classic) {
- DataMgr.setClassicTimes();
- }
- }
- showChallengeLevel() {
- if (DataMgr.getChallengeTimes() != 0)
- return;
- let skill = DataMgr.getSkillAccTimes();
- let put = DataMgr.getPlaceBallLevelList().length;
- if (skill >= 3 || put >= 5) {
- xGame.uiMgr.Show(UIInvitation);
- this.hide();
- }
- }
- addAward(callback) {
- if (!this.success) {
- callback && callback();
- return;
- }
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- this.awardCoinNum = xGame.common.passAwardCoin;
- this.awardDiamondNum = 0;
- xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
- break;
- case GameMode.bigMove:
- this.awardCoinNum = xGame.common.passAwardCoin;
- this.awardDiamondNum = 0;
- xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
- callback && callback();
- break;
- case GameMode.placeBall:
- let level = xGame.common.placeBallCurLevel;
- Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
- if (xGame.common.placeBallStarNum != 3) {
- callback && callback();
- return;
- }
- else {
- let getAward = DataMgr.getPlaceBallLevel(level).getAward;
- if (getAward) {
- callback && callback();
- return;
- }
- }
- let cfg = cfgTable.placeballData[level];
- let data = cfgTable.placeballData[level].award;
- this.awardCoinNum = data[0];
- this.awardDiamondNum = data[1];
- if (cfg.type == PlaceBallType.challenge) {
- this.awardDiamondNum = 0;
- this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
- }
- let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
- let diamondAward;
- if (this.awardDiamondNum > 0) {
- diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
- xGame.common.getAward([diamondAward, coinAward], callback);
- }
- else {
- xGame.common.getAward([coinAward], callback);
- }
- if (cfg.type == PlaceBallType.normal) {
- DataMgr.setPlaceBallAward(level);
- }
- break;
- default:
- break;
- }
- }
- playSecretaryAni_old() {
- let parent = this.ui.secretary.displayObject;
- parent.destroyChildren();
- let xx = this.ui.secretary.width / 2;
- let yy = this.ui.secretary.height;
- let scale = xGame.common.getSecretaryScale();
- let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
- if (this.success) {
- let rand = Math.random() <= 0.5 ? 2 : 3;
- xGame.common.secretary.play(data, rand, false, parent, () => {
- xGame.common.secretary.play(data, 1, true, parent);
- });
- }
- else {
- xGame.common.secretary.play(data, 0, true, parent);
- }
- }
- playSecretaryAni() {
- let parent = this.ui.secretary.displayObject;
- parent.destroyChildren();
- let xx = this.ui.secretary.width / 2;
- let yy = this.ui.secretary.height;
- let scale = xGame.common.getSecretaryScale();
- let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
- if (this.success) {
- let rand = 0;
- xGame.common.secretary.play(data, 0, true, parent);
- }
- else {
- xGame.common.secretary.play(data, 0, true, parent);
- }
- }
- restartGame() {
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- xGame.eventMgr.event(RESTART_GAME);
- Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
- break;
- case GameMode.bigMove:
- this.hide();
- xGame.eventMgr.event(RESTART_GAME);
- Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
- break;
- default:
- break;
- }
- }
- hide() {
- super.hide();
- xGame.common.stopGirlPop(this.ui.talkNode);
- PlatMgr.showBanner(false);
- }
- returnHome() {
- this.hide();
- let showFailWords = !this.success;
- xGame.uiMgr.Show(UIMain, showFailWords);
- }
- clickLeftBtn() {
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- case GameMode.bigMove:
- this.returnHome();
- break;
- case GameMode.placeBall:
- let level = xGame.common.placeBallCurLevel;
- this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
- Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
- break;
- default:
- break;
- }
- }
- powerStartPlaceBallLevel(level, btn) {
- if (DataMgr.powerEnough()) {
- btn.touchable = false;
- btn.powerEft.t0.play(Laya.Handler.create(this, () => {
- btn.touchable = true;
- DataMgr.setPower(-1);
- xGame.eventMgr.event(POWER_TIME);
- this.startPlaceBallLevel(level);
- }));
- }
- else {
- xGame.uiMgr.Show(UIPower, 0);
- }
- }
- clickRightBtn() {
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- console.log('zh:clickRightBtn 111');
- case GameMode.bigMove:
- console.log('zh:clickRightBtn 222');
- this.restartGame();
- break;
- case GameMode.placeBall:
- console.log('zh:clickRightBtn 333');
- let level = xGame.common.placeBallCurLevel;
- let data = DataMgr.getPlaceBallLevel(level);
- let curPss = data.play && !data.isCur;
- if (curPss) {
- console.log('zh:clickRightBtn 333-111');
- console.log('zh:当前LV=' + level);
- if (level == 60) {
- xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
- Laya.timer.once(3000, this, () => {
- this.returnHome();
- });
- }
- else {
- this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
- }
- }
- else {
- console.log('zh:clickRightBtn 333-000');
- Moyu.sendDataEvent("placeBallNextLevel");
- console.log('zh:qjff_AD_for_uiGameEnd');
- Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_uiGameEnd(level);
- }
- }
- break;
- default:
- console.log('zh:clickRightBtn 444');
- break;
- }
- }
- qjff_AD_for_uiGameEnd(level) {
- DataMgr.setPlaceBallLevel(level, 1);
- this.startPlaceBallLevel(level + 1);
- }
- startPlaceBallLevel(level) {
- xGame.common.gameMode = GameMode.placeBall;
- xGame.common.placeBallCurLevel = level;
- xGame.uiMgr.Show(UIGame);
- this.hide();
- }
- }
- UIGameEnd.uiName = "UIGameEnd";
- class ui_UIVideoShare extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIVideoShare"));
- }
- onConstruct() {
- this.n10 = (this.getChild("n10"));
- this.myNode = (this.getChild("myNode"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
- class UIVideoShare extends UIBase {
- constructor() {
- super();
- this.success = false;
- this.awardNum = 0;
- this.isShared = true;
- }
- onConstructor() {
- this.ui = ui_UIVideoShare.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
- this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
- this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
- this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
- }
- show(success) {
- super.show();
- this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
- this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
- this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
- this.success = success;
- let time = xGame.common.randomNum(600, 1500);
- Moyu.showInsertAd(time, 60000);
- if (success)
- xGame.soundMgr.playSound("applause");
- this.ui.t0.play();
- this.checkShareState();
- let times = DataMgr.getDailyVideoShareTimes();
- this.awardNum = times == 0 ? 2000 : 200;
- this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
- }
- checkShareState() {
- if (PlatMgr.forceShare == 0) {
- this.ui.myNode.closeBtn.visible = true;
- this.ui.myNode.tipsNode.visible = false;
- this.ui.myNode.closeBtn.x = 90;
- this.ui.myNode.shareBtn.x = 342;
- }
- else if (PlatMgr.forceShare == 1) {
- this.ui.myNode.closeBtn.visible = false;
- this.ui.myNode.tipsNode.visible = true;
- this.ui.myNode.shareBtn.x = 218;
- this.isShared = true;
- this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
- }
- }
- checkForceShare() {
- this.isShared = !this.isShared;
- this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
- }
- videoShare() {
- if (PlatMgr.forceShare == 1) {
- if (this.isShared) {
- this.shareGame();
- }
- else {
- this.hideSelf();
- }
- }
- else {
- this.shareGame();
- }
- }
- shareGame() {
- Moyu.sendDataEvent("VideoShare");
- if (Moyu.canShare() > 100) {
- Moyu.shareGame((success) => {
- if (success) {
- DataMgr.setDailyVideoShareTimes(1);
- DataMgr.setCoin(this.awardNum);
- }
- this.hideSelf();
- }, this);
- }
- else {
- xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
- this.hideSelf();
- }
- }
- hideSelf() {
- this.hide();
- xGame.uiMgr.Show(UIGameEnd, this.success);
- if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
- xGame.common.screenImg.destroy();
- xGame.common.screenImg = null;
- }
- }
- }
- UIVideoShare.uiName = "UIVideoShare";
- class ui_UITips extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UITips"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.myNode = (this.getChild("myNode"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UITips.URL = "ui://isxx5ak7mnrs42z";
- class UITips extends UIBase {
- constructor() {
- super();
- this.type = 0;
- }
- onConstructor() {
- this.ui = ui_UITips.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
- this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
- }
- show(tipsTxt, womanTxt, type) {
- super.show();
- this.ui.t0.play();
- this.ui.myNode.tipsTxt.text = tipsTxt;
- this.ui.myNode.womanTxt.text = womanTxt;
- PlatMgr.showInsert(true);
- this.ui.myNode.c1.selectedIndex = type;
- this.type = type;
- switch (this.type) {
- case TipsType.exitGame:
- xGame.common.gameMgr.gamePause = true;
- break;
- case TipsType.foul:
- Laya.timer.once(200, this, () => {
- xGame.common.gameMgr.gamePause = true;
- });
- break;
- default:
- break;
- }
- }
- clickLeftBtn() {
- this.hide();
- xGame.common.gameMgr.gamePause = false;
- switch (this.type) {
- case TipsType.exitGame:
- break;
- case TipsType.foul:
- break;
- default:
- break;
- }
- }
- clickRightBtn() {
- this.hide();
- switch (this.type) {
- case TipsType.exitGame:
- xGame.eventMgr.event(RESET_GAME);
- xGame.uiMgr.Show(UIMain);
- Moyu.recordEnd(this, null);
- xGame.common.longHelpLine = false;
- break;
- case TipsType.foul:
- xGame.common.gameMgr.gamePause = false;
- Laya.timer.clearAll(this);
- break;
- default:
- break;
- }
- }
- }
- UITips.uiName = "UITips";
- class GameMgr {
- constructor() {
- this.selfCamp = "";
- this.selfFoulNum = 0;
- this.selfBallArr = [];
- this.selfTimer = 0;
- this.selfScore = 0;
- this.aiCamp = "";
- this.aiFoulNum = 0;
- this.aiBallArr = [];
- this.aiTimer = 0;
- this.aiScore = 0;
- this.aiSkillLevelNum = 1;
- this.targertScore = 0;
- this.setTime = 30;
- this.selfTurnRate = 0.5;
- this.accTime = 0;
- this.curFoul = "";
- this.maxFoulTimes = 3;
- this.isFirstInGame = true;
- this.firstColliObj = null;
- this.inHoleBalls = [];
- this.blackNum = 8;
- this.success = false;
- this.holePosList = [];
- this.posObj = {};
- this._selfTurn = false;
- this.lastRootBallPos = new Laya.Vector2(311, 430);
- this.ensureBallType = false;
- this.isOpenBall = true;
- this.finishOneShoot = true;
- this.isEnd = false;
- this.isChangeTurn = false;
- this.isInterrupt = false;
- this.aiPlayedBreakArmy = false;
- this.isTouchedBall = false;
- this.finishBalls = 0;
- this.needBalls = 0;
- this.allBallNum = 0;
- this.placeBallPosData = {};
- this.curHP = 0;
- this.showLongView = false;
- this.firstShoot = true;
- this._gamePause = false;
- this.trunCount = 0;
- this.isBlackInHole = false;
- this.isEnter = true;
- xGame.eventMgr.offAll(ALL_BALL_STOP);
- xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
- xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
- xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
- xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
- xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
- xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
- xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
- }
- get gamePause() {
- return this._gamePause;
- }
- set gamePause(v) {
- if (v) {
- Laya.physicsTimer.pause();
- }
- else {
- Laya.physicsTimer.resume();
- }
- this._gamePause = v;
- }
- get selfTurn() {
- return this._selfTurn;
- }
- set selfTurn(val) {
- this.trunCount++;
- this._selfTurn = val;
- if (val) {
- xGame.common.d2World.d2Gan.ui.self.visible = true;
- xGame.common.d2World.d2Gan.ui.ai.visible = false;
- }
- else {
- xGame.common.d2World.d2Gan.ui.self.visible = false;
- xGame.common.d2World.d2Gan.ui.ai.visible = true;
- if (this.trunCount > 1)
- PlatMgr.openBox();
- }
- }
- resetGame() {
- this.inHoleBalls = [];
- this.isFirstInGame = true;
- this.firstColliObj = null;
- this.aiCamp = "";
- this.selfCamp = "";
- this.aiFoulNum = 0;
- this.selfFoulNum = 0;
- this.selfBallArr = [];
- this.aiBallArr = [];
- this.gamePause = false;
- this.ensureBallType = false;
- this.isInterrupt = false;
- this.updateLeftBall();
- this.clearTime();
- this.aiPlayedBreakArmy = false;
- this.isBlackInHole = false;
- this.placeBallPosData = {};
- if (xGame.common.d3World.knifeRoot) {
- xGame.common.d3World.knifeRoot.destroyChildren();
- }
- }
- gameReady() {
- this.trunCount = 0;
- this.firstColliObj = null;
- this.isFirstInGame = true;
- this.selfTurn = Math.random() <= this.selfTurnRate;
- let challengeNum = DataMgr.getChallengeTimes();
- if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
- this.selfTurn = true;
- }
- if (xGame.common.gameMode == GameMode.placeBall)
- this.selfTurn = true;
- if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
- this.selfTurn = true;
- }
- xGame.common.gameUI.setTurnAlpha(this.selfTurn);
- this.checkGuide();
- if (xGame.common.uiRodMethod)
- xGame.common.uiRodMethod.resetRod();
- xGame.common.d2World.getHelpLine();
- this.isOpenBall = true;
- this.isTouchedBall = false;
- xGame.common.aiPlayer.stopRun();
- this.setTime = 30;
- let ui = xGame.common.gameUI.ui;
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- xGame.common.aiPlayer.init();
- this.blackNum = 8;
- this.placeRootBall();
- this.peoplePlay(9, 10);
- ui.wordsBtn.visible = true;
- ui.aiWordsBtn.visible = true;
- xGame.common.talkMgr.changeAIState(true);
- DataMgr.gameData.gameCount++;
- DataMgr.saveGameData();
- break;
- case GameMode.bigMove:
- this.blackNum = -1;
- this.selfScore = 0;
- this.aiScore = 0;
- xGame.common.aiPlayer.init();
- this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
- this.updateSelfScore();
- this.updateAIScore();
- this.updateTargetSroce();
- this.placeRootBall();
- this.peoplePlay(9, 10);
- ui.wordsBtn.visible = true;
- ui.aiWordsBtn.visible = true;
- xGame.common.talkMgr.changeAIState(true);
- if (DataMgr.getSkillGuide() < 1)
- DataMgr.gameData.gameCount = 0;
- else {
- DataMgr.gameData.gameCount++;
- DataMgr.saveGameData();
- PlatMgr.openTry();
- }
- if (xGame.common.d3World.knifeRoot) {
- xGame.common.d3World.knifeRoot.destroyChildren();
- }
- break;
- case GameMode.placeBall:
- this.blackNum = -1;
- this.selfTurn = true;
- this.setTime = 10000;
- this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
- this.curHP = this.placeBallData.hp;
- if (this.placeBallData.ball == -1)
- this.needBalls = xGame.common.d2World.ballArr.length - 1;
- else
- this.needBalls = this.placeBallData.ball;
- console.log("需要的进球数目", this.needBalls);
- this.allBallNum = xGame.common.d2World.ballArr.length - 1;
- this.finishBalls = 0;
- this.placeBallPosData = {};
- this.updatePlaceBallPos();
- this.updatePlaceBallState();
- this.finishOneShoot = true;
- xGame.common.gameUI.ui.moveNode.visible = false;
- this.isOpenBall = false;
- xGame.common.d2World.d2Gan.ui.ai.visible = false;
- ui.wordsBtn.visible = false;
- ui.aiWordsBtn.visible = false;
- xGame.common.talkMgr.changeAIState(false);
- Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
- PlatMgr.openBox();
- });
- break;
- default:
- break;
- }
- this.showLongView = false;
- xGame.common.wordsMgr.comboTimes = 1;
- let guide = DataMgr.getSkillGuide();
- if (guide)
- xGame.eventMgr.event(WAIT_SHOOT);
- xGame.common.upSkillLevel = false;
- xGame.common.gameStartTime = new Date().getTime();
- this.firstShoot = true;
- }
- checkGuide() {
- let guide = DataMgr.getSkillGuide();
- let gameUI = xGame.common.gameUI.ui;
- gameUI.guide1.visible = false;
- gameUI.guide2.visible = false;
- gameUI.guide3.visible = false;
- if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
- this.selfTurn = true;
- }
- else {
- return;
- }
- let oneBall = this.getOneBall();
- gameUI.guide1.visible = true;
- gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
- gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
- }
- getOneBall() {
- let arr = xGame.common.d2World.ballArr;
- for (let index = 0; index < arr.length; index++) {
- if (arr[index].number == 0)
- continue;
- return arr[index];
- }
- }
- updateSelfScore() {
- let ui = xGame.common.gameUI.ui.topNode;
- ui.selfScoreTxt.text = this.selfScore + "";
- }
- updateAIScore() {
- let ui = xGame.common.gameUI.ui.topNode;
- ui.aiScoreTxt.text = this.aiScore + "";
- }
- updateTargetSroce() {
- let ui = xGame.common.gameUI.ui.topNode;
- ui.middleNode.targetScoreTxt.text = this.targertScore + "";
- }
- updateLeftBall() {
- let topUI = xGame.common.gameUI.ui.topNode;
- topUI.selfBallList.numItems = this.selfBallArr.length;
- topUI.aiBallList.numItems = this.aiBallArr.length;
- }
- ballShoot() {
- this.clearTime();
- this.finishOneShoot = false;
- xGame.common.gameUI.ui.moveNode.visible = false;
- if (xGame.common.gameUI.ui.guideNode.visible) {
- xGame.common.gameUI.ui.guideNode.visible = false;
- }
- if (this.firstShoot) {
- this.firstShoot = false;
- Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
- }
- }
- ensureCamp(number) {
- this.ensureBallType = true;
- this.isOpenBall = false;
- if (xGame.common.gameMode != GameMode.classic)
- return;
- let full = [1, 2, 3, 4, 5, 6, 7];
- let flower = [9, 10, 11, 12, 13, 14, 15];
- let sayWords = "";
- if (this.selfTurn) {
- if (number <= 7) {
- this.selfCamp = ballCamp.full;
- this.selfBallArr = full;
- this.aiCamp = ballCamp.flower;
- this.aiBallArr = flower;
- sayWords = cfgTable.wordsData[3].msg;
- }
- else {
- this.selfCamp = ballCamp.flower;
- this.selfBallArr = flower;
- this.aiCamp = ballCamp.full;
- this.aiBallArr = full;
- sayWords = cfgTable.wordsData[4].msg;
- }
- }
- else {
- if (number <= 7) {
- this.selfCamp = ballCamp.flower;
- this.selfBallArr = flower;
- this.aiCamp = ballCamp.full;
- this.aiBallArr = full;
- sayWords = cfgTable.wordsData[2].msg;
- }
- else {
- this.selfCamp = ballCamp.full;
- this.selfBallArr = full;
- this.aiCamp = ballCamp.flower;
- this.aiBallArr = flower;
- sayWords = cfgTable.wordsData[1].msg;
- }
- }
- this.updateLeftBall();
- xGame.uiMgr.Show(UIMsg, sayWords);
- }
- updatePlaceBallState() {
- let ui = xGame.common.gameUI.ui;
- switch (this.placeBallData.type) {
- case PlaceBallType.normal:
- let normal = ui.placeNormalNode;
- normal.hpTxt.text = this.curHP + "";
- this.updatePlaceBallStar(normal);
- normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
- normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
- break;
- case PlaceBallType.challenge:
- let challenge = ui.placeChallengeNode;
- challenge.hpTxt.text = "Shots:" + this.curHP;
- challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
- challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
- challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
- break;
- default:
- break;
- }
- }
- playSubHpAni() {
- let ui = xGame.common.gameUI.ui;
- switch (this.placeBallData.type) {
- case PlaceBallType.normal:
- let normal = ui.placeNormalNode;
- normal.hpTxt.visible = false;
- normal.starAni.c1.selectedIndex = 1;
- normal.starAni.t0.play(Laya.Handler.create(this, () => {
- normal.hpTxt.visible = true;
- normal.starAni.c1.selectedIndex = 0;
- }));
- break;
- default:
- break;
- }
- }
- getEndStarNum() {
- let num;
- let level = xGame.common.placeBallCurLevel;
- if (this.curHP == this.placeBallData.hp) {
- num = 3;
- }
- else if (this.curHP <= 1) {
- num = 1;
- }
- else {
- num = 2;
- }
- if (!this.success) {
- num = 0;
- }
- else {
- DataMgr.setPlaceBallLevel(level, num);
- }
- let myType = cfgTable.placeballData[level].type;
- if (this.success && myType == 1) {
- num = 3;
- }
- xGame.common.placeBallStarNum = num;
- }
- updatePlaceBallStar(node) {
- let star = 0;
- if (this.curHP == this.placeBallData.hp) {
- star = 3;
- }
- else if (this.curHP >= 2) {
- star = 2;
- }
- else if (this.curHP == 1) {
- star = 1;
- }
- else {
- star = 0;
- }
- let temp;
- for (let index = 1; index <= 3; index++) {
- temp = node["star" + index];
- temp.c1.selectedIndex = star >= index ? 1 : 0;
- }
- node.myProgress.value = (star / 3) * 100;
- }
- openRegretView(isFoul, GoalNum, challenge = false) {
- let regretType = -1;
- if (isFoul) {
- regretType = 1;
- }
- else {
- if (GoalNum <= 0) {
- regretType = 0;
- }
- }
- if (challenge) {
- regretType = 1;
- }
- if (regretType != -1) {
- xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
- if (success) {
- this.curHP++;
- this.updatePlaceBallState();
- this.setPlaceBallAllPos();
- xGame.common.gameUI.ui.moveNode.visible = false;
- }
- else {
- if (this.curHP <= 0) {
- this.success = false;
- this.gameEnd();
- }
- this.playSubHpAni();
- }
- this.updatePlaceBallState();
- this.updatePlaceBallPos();
- });
- }
- }
- setPlaceBallAllPos() {
- let allBall = xGame.common.d2World.ballArr;
- let cfgArr = this.placeBallPosData;
- let temp;
- let obj;
- for (let index = 0; index < allBall.length; index++) {
- temp = allBall[index];
- if (temp.destroyed)
- continue;
- obj = cfgArr[temp.myUNID];
- if (obj && obj.src && !obj.src.destroyed) {
- temp.gameObj.x = obj.posX;
- temp.gameObj.y = obj.posY;
- temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
- }
- }
- xGame.common.d2World.getHelpLine();
- }
- updatePlaceBallPos() {
- let arr = xGame.common.d2World.ballArr;
- let temp;
- for (let index = 0; index < arr.length; index++) {
- temp = arr[index];
- if (!this.placeBallPosData[temp.myUNID]) {
- this.placeBallPosData[temp.myUNID] = {
- src: temp,
- posX: temp.gameObj.x,
- posY: temp.gameObj.y
- };
- }
- else {
- this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
- this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
- }
- }
- let check;
- for (const key in this.placeBallPosData) {
- check = this.placeBallPosData[key];
- if (check.src.destroyed) {
- delete this.placeBallPosData[key];
- }
- }
- }
- gameRun(type) {
- if (this.gamePause)
- return;
- this.curFoul = this.getFoulType();
- if (type) {
- xGame.common.d2World.d2Gan.shoot();
- xGame.common.gameUI.forceCancel();
- this.curFoul = type;
- }
- this.isEnd = false;
- this.isChangeTurn = true;
- if (xGame.common.gameMode == GameMode.classic) {
- this.judgeClassic(this.curFoul);
- this.checkClassicWords(() => {
- xGame.common.destroyClassicEmotion();
- if (this.isEnd) {
- if (this.isBlackInHole) {
- xGame.common.gameUI.ui.blackAni.visible = true;
- xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
- xGame.common.gameUI.ui.blackAni.visible = false;
- this.gameEnd();
- }));
- }
- else {
- this.gameEnd();
- }
- }
- else {
- this.waitShoot();
- xGame.eventMgr.event(WAIT_SHOOT);
- }
- });
- }
- else if (xGame.common.gameMode == GameMode.bigMove) {
- xGame.common.aiPlayer.stopRun();
- let scoreArr = this.getScore(this.curFoul);
- if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
- this.isEnd = true;
- }
- this.checkBigSkillWords(() => {
- if (this.isEnd) {
- this.gameEnd();
- }
- else {
- this.waitShoot();
- xGame.eventMgr.event(WAIT_SHOOT);
- }
- });
- }
- else if (xGame.common.gameMode == GameMode.placeBall) {
- xGame.common.destroyAwardSpine();
- let isFoul = this.curFoul == FoulType.rootHole;
- let GoalNum = this.inHoleBalls.length;
- if (this.inHoleBalls.indexOf(0) > -1)
- GoalNum -= 1;
- if (isFoul) {
- this.placeRootBall();
- }
- console.log("neeballs", this.needBalls);
- console.log("当前完成的goalNum", GoalNum);
- this.finishBalls += GoalNum;
- console.log("当前完成的finishballs", this.finishBalls);
- let need = this.needBalls;
- if (this.placeBallData.type == PlaceBallType.challenge) {
- need += 100;
- }
- if (this.finishBalls >= need) {
- this.success = true;
- this.gameEnd();
- }
- else {
- switch (this.placeBallData.type) {
- case PlaceBallType.normal:
- if (!isFoul && GoalNum > 0) {
- this.updatePlaceBallPos();
- this.updatePlaceBallState();
- }
- else {
- this.curHP--;
- this.openRegretView(isFoul, GoalNum);
- }
- this.waitShoot();
- xGame.eventMgr.event(WAIT_SHOOT);
- break;
- case PlaceBallType.challenge:
- this.curHP--;
- this.updatePlaceBallState();
- if (isFoul) {
- this.openRegretView(isFoul, GoalNum, true);
- }
- else {
- this.updatePlaceBallPos();
- if (this.curHP <= 0) {
- this.success = true;
- this.gameEnd();
- }
- }
- this.waitShoot();
- xGame.eventMgr.event(WAIT_SHOOT);
- break;
- default:
- break;
- }
- }
- }
- }
- checkClassicWords(callback) {
- xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
- let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
- let type = this.getClassicWordsType();
- if (condition && type != -1) {
- let str = Math.random() <= 0.5 ? "hint01" : "hint02";
- xGame.soundMgr.playSound(str);
- xGame.common.wordsMgr.playClassicWords(type, callback);
- }
- else {
- Laya.timer.once(300, this, () => {
- callback && callback();
- });
- }
- }
- getClassicWordsType() {
- let d2world = xGame.common.d2World;
- let type = -1;
- if (!this.isInterrupt && this.judgeNormalSuccess()) {
- type = ClassicWordsType.perfectShow;
- return type;
- }
- if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
- type = ClassicWordsType.directShoot;
- return type;
- }
- if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
- type = ClassicWordsType.anotherShoot;
- return type;
- }
- if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
- type = ClassicWordsType.bigPower;
- return type;
- }
- let minSpeed = 1;
- if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
- type = ClassicWordsType.hardShoot;
- return type;
- }
- if (this.inHoleBalls.length > 0) {
- type = ClassicWordsType.directShoot;
- return type;
- }
- return type;
- }
- checkBigSkillWords(callback) {
- if (this.curFoul == FoulType.timeOut) {
- callback && callback();
- }
- else {
- let playSkill = false;
- if (this.selfTurn) {
- playSkill = true;
- }
- else {
- if (!this.aiPlayedBreakArmy) {
- this.aiPlayedBreakArmy = true;
- playSkill = true;
- }
- if (this.aiCurSkill != SkillType.breakArmy) {
- playSkill = true;
- }
- }
- if (xGame.common.skillMgr.playedLastSkill) {
- xGame.common.skillMgr.playedLastSkill = false;
- playSkill = false;
- }
- if (playSkill) {
- xGame.common.skillMgr.runBigSkill((extraScore) => {
- let selfExtra = 0;
- let aiExtra = 0;
- if (this.selfTurn)
- selfExtra += extraScore;
- else
- aiExtra += extraScore;
- if (this.judgeScoreEnd(selfExtra, aiExtra)) {
- this.isEnd = true;
- }
- this.playBigSkillTimes(callback);
- });
- }
- else {
- this.playBigSkillTimes(callback);
- }
- }
- }
- playBigSkillTimes(callback) {
- let length = this.inHoleBalls.length;
- if (this.inHoleBalls.indexOf(0) > -1) {
- length = this.inHoleBalls.length - 1;
- }
- if (length <= 0) {
- callback && callback();
- return;
- }
- xGame.common.wordsMgr.playBigSkillTimes(length, () => {
- callback && callback();
- });
- }
- playSkillTips() {
- let levelNum = 0;
- let curType;
- if (this.selfTurn) {
- levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
- curType = this.selfCurSkill;
- if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
- levelNum += 5;
- }
- }
- else {
- levelNum = this.aiSkillLevelNum;
- curType = this.aiCurSkill;
- }
- let str = ``;
- switch (curType) {
- case SkillType.highSpace:
- str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
- break;
- case SkillType.breakArmy:
- str = `You pocketed ${levelNum} extra balls`;
- break;
- case SkillType.ice:
- str = `${levelNum * 2} extra balls were frozen`;
- break;
- case SkillType.fireworks:
- str = `${levelNum} extra balls exploded `;
- break;
- case SkillType.GuanYu:
- str = `There were ${xGame.common.extraMoveNum} displacement movements`;
- break;
- default:
- break;
- }
- xGame.uiMgr.Show(UIMsg, str);
- }
- getFoulType() {
- let foulType = "";
- if (this.firstColliObj == null) {
- if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
- return FoulType.rootHole;
- }
- return FoulType.notTouch;
- }
- else {
- if (this.selfTurn) {
- if (this.selfBallArr.length > 0) {
- if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
- foulType = FoulType.wrongTouch;
- }
- }
- else {
- if (this.ensureBallType) {
- }
- else {
- if (this.firstColliObj == this.blackNum) {
- foulType = FoulType.wrongTouch;
- }
- }
- }
- }
- else {
- if (this.aiBallArr.length > 0) {
- if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
- foulType = FoulType.wrongTouch;
- }
- }
- else {
- if (this.ensureBallType) {
- }
- else {
- if (this.firstColliObj == this.blackNum) {
- foulType = FoulType.wrongTouch;
- }
- }
- }
- }
- if (this.inHoleBalls.length <= 0) {
- return foulType;
- }
- let temp;
- if (this.inHoleBalls.indexOf(0) > -1) {
- foulType = FoulType.rootHole;
- }
- else {
- for (let index = 0; index < this.inHoleBalls.length; index++) {
- temp = this.inHoleBalls[index];
- if (this.selfTurn) {
- if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
- foulType = FoulType.wrongHole;
- break;
- }
- }
- else {
- if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
- foulType = FoulType.wrongHole;
- break;
- }
- }
- }
- }
- let foo;
- for (let index = 0; index < this.inHoleBalls.length; index++) {
- temp = this.inHoleBalls[index];
- foo = this.selfBallArr.indexOf(temp);
- if (foo > -1) {
- this.selfBallArr.splice(foo, 1);
- }
- foo = this.aiBallArr.indexOf(temp);
- if (foo > -1) {
- this.aiBallArr.splice(foo, 1);
- }
- }
- this.updateLeftBall();
- }
- return foulType;
- }
- judgeGameEndByBlack(arr) {
- if (this.selfTurn) {
- if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
- this.selfFoulNum = this.maxFoulTimes;
- return true;
- }
- }
- else {
- if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
- this.aiFoulNum = this.maxFoulTimes;
- return true;
- }
- }
- }
- judgeClassic(type) {
- this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
- xGame.common.aiPlayer.stopRun();
- if (this.judgeNormalSuccess()) {
- this.isEnd = true;
- return;
- }
- let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
- if (this.selfTurn) {
- if (isFoul) {
- this.selfFoulNum++;
- }
- if (this.selfFoulNum >= this.maxFoulTimes) {
- this.success = false;
- this.isEnd = true;
- return;
- }
- }
- else {
- if (isFoul)
- this.aiFoulNum++;
- if (this.aiFoulNum >= this.maxFoulTimes) {
- this.success = true;
- this.isEnd = true;
- return;
- }
- }
- if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
- this.isChangeTurn = false;
- }
- else {
- this.isInterrupt = true;
- }
- }
- waitShoot() {
- if (xGame.common.gameMode == GameMode.classic) {
- switch (this.curFoul) {
- case FoulType.timeOut:
- case FoulType.rootHole:
- this.selfTurn = !this.selfTurn;
- this.peoplePlay(5, 6, true);
- break;
- case FoulType.notTouch:
- this.selfTurn = !this.selfTurn;
- this.peoplePlay(7, 7);
- break;
- case FoulType.wrongHole:
- this.selfTurn = !this.selfTurn;
- this.peoplePlay(11, 11);
- break;
- default:
- if (this.inHoleBalls.length > 0) {
- this.peoplePlay(0, 0, false, false);
- }
- else {
- this.selfTurn = !this.selfTurn;
- this.peoplePlay(7, 7);
- }
- break;
- }
- }
- else if (xGame.common.gameMode == GameMode.bigMove) {
- if (this.curFoul == FoulType.timeOut) {
- this.selfTurn = !this.selfTurn;
- this.peoplePlay(14, 15);
- this.placeRootBall();
- }
- else {
- this.selfTurn = !this.selfTurn;
- if (this.curFoul == FoulType.rootHole) {
- this.peoplePlay(12, 13);
- this.placeRootBall();
- }
- else {
- this.peoplePlay(0, 0, false, false);
- }
- }
- }
- else if (xGame.common.gameMode == GameMode.placeBall) {
- this.finishOneShoot = true;
- }
- this.gameResult();
- }
- gameResult() {
- this.firstColliObj = null;
- this.inHoleBalls = [];
- let curX = xGame.common.d2World.rootBall.gameObj.x;
- let curY = xGame.common.d2World.rootBall.gameObj.y;
- xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
- if (xGame.common.uiRodMethod)
- xGame.common.uiRodMethod.resetRod();
- xGame.common.d2World.rootBall.showSelf();
- this.clearIceSkill();
- if (this.selfTurn) {
- console.log("gameResult");
- PlatMgr.gameInsert();
- }
- xGame.common.d3World.knifeRoot.destroyChildren();
- if (this.selfTurn) {
- xGame.common.gameUI.showHelpLineGuide();
- xGame.common.gameUI.setTurnAlpha(true);
- }
- else {
- xGame.common.gameUI.setTurnAlpha(false);
- }
- }
- getScore(type) {
- let selfAdd = 0;
- let aiAdd = 0;
- if (type == FoulType.timeOut) {
- if (this.selfTurn)
- aiAdd += 3;
- else
- selfAdd += 3;
- }
- else {
- if (this.inHoleBalls.length > 0) {
- if (this.selfTurn) {
- if (type == FoulType.rootHole) {
- aiAdd += 3;
- if (this.inHoleBalls.length - 1 > 0) {
- selfAdd += this.inHoleBalls.length - 1;
- }
- }
- else {
- selfAdd += this.inHoleBalls.length;
- }
- }
- else {
- if (type == FoulType.rootHole) {
- selfAdd += 3;
- if (this.inHoleBalls.length - 1 > 0) {
- aiAdd += this.inHoleBalls.length - 1;
- }
- }
- else {
- aiAdd += this.inHoleBalls.length;
- }
- }
- }
- }
- return [selfAdd, aiAdd];
- }
- judgeScoreEnd(selfAdd, aiAdd) {
- this.selfScore += selfAdd;
- this.aiScore += aiAdd;
- this.updateAIScore();
- this.updateSelfScore();
- if (this.selfScore >= this.targertScore) {
- this.success = true;
- return true;
- }
- if (this.aiScore >= this.targertScore) {
- this.success = false;
- return true;
- }
- let ballArr = xGame.common.d2World.ballArr;
- if (ballArr.length == 1 && ballArr[0].number == 0) {
- if (this.selfScore > this.aiScore) {
- this.success = true;
- return true;
- }
- else if (this.selfScore < this.aiScore) {
- this.success = false;
- return true;
- }
- else {
- if (this.selfTurn) {
- this.success = false;
- }
- else {
- this.success = true;
- }
- return true;
- }
- }
- }
- clearIceSkill() {
- let arr = xGame.common.d2World.ballArr;
- let temp;
- if (this.selfTurn) {
- if (this.selfCurSkill == SkillType.ice) {
- for (let index = 0; index < arr.length; index++) {
- temp = arr[index];
- if (temp.ballFunc == "ice") {
- temp.setBallFunc("normal", "self");
- }
- }
- }
- }
- else {
- if (this.aiCurSkill == SkillType.ice) {
- for (let index = 0; index < arr.length; index++) {
- temp = arr[index];
- if (temp.ballFunc == "ice") {
- temp.setBallFunc("normal", "ai");
- }
- }
- }
- }
- }
- judgeNormalSuccess() {
- if (this.selfTurn) {
- if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
- this.success = true;
- return true;
- }
- }
- else {
- if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
- this.success = false;
- return true;
- }
- }
- }
- gameEnd() {
- if (Moyu.isTT) {
- xGame.common.screenImg = getScreenImg();
- }
- console.log("游戏结束", this.success);
- xGame.common.aiPlayer.stopRun();
- if (xGame.common.gameMode == GameMode.placeBall) {
- this.getEndStarNum();
- this.updatePlaceBallState();
- }
- this.isEnter = false;
- Moyu.recordEnd(this, () => {
- if (this.isEnter)
- return;
- this.isEnter = true;
- console.log("进入录结束回调");
- this.enterNext();
- });
- Laya.timer.once(1000, this, () => {
- if (this.isEnter)
- return;
- this.isEnter = true;
- this.enterNext();
- });
- xGame.common.longHelpLine = false;
- }
- enterNext() {
- Laya.timer.clearAll(this);
- if (Moyu.canShare() > 100 || Moyu.isKs) {
- xGame.uiMgr.Show(UIVideoShare, this.success);
- }
- else {
- xGame.uiMgr.Show(UIGameEnd, this.success);
- }
- }
- aiLeave() {
- let ui = xGame.common.gameUI.ui;
- ui.topNode.aiNameTxt.text = "offline";
- }
- aiGameEnd(suc) {
- this.success = suc;
- xGame.common.aiPlayer.stopRun();
- if (this.success) {
- xGame.uiMgr.Show(UIMsg, "The opponent has fled");
- Laya.timer.once(1000, this, () => {
- this.clearTime();
- this.gameEnd();
- });
- }
- }
- openTimer() {
- let src = xGame.common.gameUI;
- if (this.selfTurn) {
- src.ui.topNode.selfProgress.visible = true;
- src.ui.topNode.aiProgress.visible = false;
- this.curTimer = src.ui.topNode.selfProgress;
- }
- else {
- src.ui.topNode.selfProgress.visible = false;
- src.ui.topNode.aiProgress.visible = true;
- this.curTimer = src.ui.topNode.aiProgress;
- }
- this.accTime = 0;
- Laya.timer.clearAll(this);
- Laya.timer.loop(20, this, this.updateTime, [0.02]);
- this.curTimer.value = 100;
- }
- updateTime(dt) {
- if (this.gamePause)
- return;
- this.accTime += dt;
- this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
- if (this.accTime >= this.setTime) {
- this.clearTime();
- console.log("时钟进入了gameRun");
- this.gameRun(FoulType.timeOut);
- }
- }
- clearTime() {
- let src = xGame.common.gameUI;
- src.ui.topNode.selfProgress.visible = false;
- src.ui.topNode.aiProgress.visible = false;
- Laya.timer.clearAll(this);
- }
- peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
- let ui = xGame.common.gameUI.ui;
- let selfMsg, aiMsg;
- if (sayWords) {
- selfMsg = cfgTable.wordsData[selfIndex].msg;
- aiMsg = cfgTable.wordsData[aiIndex].msg;
- if (Foul) {
- selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
- aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
- this.placeRootBall();
- if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
- if (this.curFoul == FoulType.rootHole) {
- if (!DataMgr.getRootBallFoul()) {
- DataMgr.setRootBallFoul();
- aiMsg = "";
- let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
- let woman = "Boss, pay attention next time~";
- xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
- }
- }
- else if (this.curFoul == FoulType.timeOut) {
- if (!DataMgr.getTimeoutFoul()) {
- DataMgr.setTimeoutFoul();
- aiMsg = "";
- let tips = "Game timeout, 3 fouls, this game failed.";
- let woman = "Boss, pay attention to the timeline~";
- xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
- }
- }
- }
- }
- }
- if (this.selfTurn) {
- if (sayWords) {
- xGame.uiMgr.Show(UIMsg, selfMsg, () => {
- ui.selfTurn.visible = true;
- ui.aiTurn.visible = false;
- ui.selfTurn.t0.play();
- Moyu.vibration();
- });
- }
- }
- else {
- let aiNum = xGame.tools.random(1, 11);
- let challengeNum = DataMgr.getChallengeTimes();
- let delay = false;
- if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
- aiNum = 9;
- if (this.aiBallArr.length <= 2 && this.ensureBallType) {
- aiNum = 3;
- if (challengeNum == 3) {
- if (!this.showLongView) {
- this.showLongView = true;
- delay = true;
- }
- }
- }
- }
- if (delay) {
- xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
- if (success) {
- xGame.common.longHelpLine = true;
- xGame.common.d2World.getHelpLine();
- }
- else {
- aiNum = 10;
- }
- xGame.common.aiPlayer.setAiLevel(aiNum);
- if (sayWords) {
- xGame.uiMgr.Show(UIMsg, aiMsg, () => {
- xGame.common.aiPlayer.runAI();
- ui.selfTurn.visible = false;
- ui.aiTurn.visible = true;
- ui.aiTurn.t0.play();
- });
- }
- else {
- xGame.common.aiPlayer.runAI();
- }
- this.openTimer();
- this.finishOneShoot = true;
- if (this.selfTurn) {
- ui.topNode.selfKuang.visible = true;
- ui.topNode.aiKuang.visible = false;
- ui.topNode.selfTips.visible = true;
- ui.topNode.aiTips.visible = false;
- }
- else {
- ui.topNode.selfKuang.visible = false;
- ui.topNode.aiKuang.visible = true;
- ui.topNode.selfTips.visible = false;
- ui.topNode.aiTips.visible = true;
- }
- });
- return;
- }
- if (xGame.common.gameMode == GameMode.classic) {
- let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
- if (cfg) {
- let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
- aiNum = aiLevel;
- }
- }
- xGame.common.aiPlayer.setAiLevel(aiNum);
- if (sayWords) {
- xGame.uiMgr.Show(UIMsg, aiMsg, () => {
- xGame.common.aiPlayer.runAI();
- ui.selfTurn.visible = false;
- ui.aiTurn.visible = true;
- ui.aiTurn.t0.play();
- });
- }
- else {
- xGame.common.aiPlayer.runAI();
- }
- }
- this.openTimer();
- this.finishOneShoot = true;
- if (this.selfTurn) {
- ui.topNode.selfKuang.visible = true;
- ui.topNode.aiKuang.visible = false;
- ui.topNode.selfTips.visible = true;
- ui.topNode.aiTips.visible = false;
- }
- else {
- ui.topNode.selfKuang.visible = false;
- ui.topNode.aiKuang.visible = true;
- ui.topNode.selfTips.visible = false;
- ui.topNode.aiTips.visible = true;
- }
- }
- placeRootBall() {
- let rootBall = xGame.common.d2World.rootBall;
- if (!rootBall)
- return;
- rootBall.gameObj.x = this.lastRootBallPos.x;
- rootBall.gameObj.y = this.lastRootBallPos.y;
- rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
- let moveNode = xGame.common.gameUI.ui.moveNode;
- moveNode.visible = true;
- moveNode.x = this.lastRootBallPos.x;
- moveNode.y = this.lastRootBallPos.y;
- if (!this.selfTurn) {
- xGame.common.aiPlayer.resetRoot();
- }
- }
- }
- class ui_guanyuAni extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "guanyuAni"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- }
- }
- ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
- class UIFireworks extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.isEject = false;
- }
- show(callback) {
- super.show();
- }
- }
- UIFireworks.uiName = "UIFireworks";
- class ui_UIGuanYu extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIGuanYu"));
- }
- onConstruct() {
- this.n2 = (this.getChild("n2"));
- this.n1 = (this.getChild("n1"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n8 = (this.getChild("n8"));
- this.n7 = (this.getChild("n7"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
- class UIGuanYu extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UIGuanYu.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- }
- show(callback) {
- super.show();
- this.ui.t0.play(Laya.Handler.create(this, () => {
- callback && callback();
- this.hide();
- }));
- }
- }
- UIGuanYu.uiName = "UIGuanYu";
- class SkillMgr {
- constructor() {
- this.leveNum = 0;
- this.extraScore = 0;
- this.selfTurn = false;
- this.playedLastSkill = false;
- this.tweenArr = [];
- this._finishNum = 0;
- this._curFinish = 0;
- this._rootX = 0;
- this._rootY = 0;
- this.knifeTimes = 0;
- this.knifeV2 = new Laya.Vector2();
- this.knifeV3 = new Laya.Vector3();
- this.rtStarX = 0;
- this.rtStarY = 0;
- this.addBigSkillSpine();
- xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
- }
- addBigSkillSpine() {
- this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
- console.log("extra2 success");
- });
- }
- runBigSkill(callback) {
- this.tweenArr = [];
- this.callback = callback;
- this.judgeSkill();
- this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
- let guide = DataMgr.getSkillGuide();
- if (!xGame.common.gameMgr.selfTurn) {
- this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
- }
- else {
- if (xGame.common.temSelfLevel != 0) {
- this.leveNum = xGame.common.temSelfLevel;
- }
- if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
- this.leveNum += 5;
- }
- }
- if (guide == 0) {
- DataMgr.setSkillGuide(1);
- if (DataMgr.getNewUser()) {
- Moyu.sendDataEvent("gameFirstPlay");
- DataMgr.setNewUser();
- }
- }
- this.playSpineAni(() => {
- switch (this.curSkill) {
- case SkillType.highSpace:
- this.runHighSpace();
- break;
- case SkillType.breakArmy:
- this.runBreakArmy();
- break;
- case SkillType.ice:
- this.runIce();
- break;
- case SkillType.fireworks:
- this.runFireworks();
- break;
- case SkillType.GuanYu:
- this.runGuanYu();
- break;
- default:
- break;
- }
- });
- }
- judgeSkill() {
- let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
- let gameMgr = xGame.common.gameMgr;
- let type;
- for (let index = 0; index < typeArr.length; index++) {
- type = typeArr[index];
- if (gameMgr.selfTurn) {
- if (gameMgr.selfCurSkill == type) {
- this.selfTurn = true;
- this.curSkill = type;
- return;
- }
- }
- else {
- if (gameMgr.aiCurSkill == type) {
- this.selfTurn = false;
- this.curSkill = type;
- return;
- }
- }
- }
- }
- playSpineAni(callback) {
- let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
- let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
- parent.destroyChildren();
- let aniIndex = 0;
- let skillSpine;
- switch (this.curSkill) {
- case SkillType.highSpace:
- aniIndex = 1;
- xGame.soundMgr.playSound("skill01");
- skillSpine = this.skillSpine2;
- data.scaleX = 0.5;
- data.scaleY = 0.5;
- skillSpine.play(data, 1, false, parent, () => {
- callback && callback();
- });
- break;
- case SkillType.breakArmy:
- aniIndex = 2;
- xGame.soundMgr.playSound("skill02");
- skillSpine = this.skillSpine2;
- data.scaleX = 0.5;
- data.scaleY = 0.5;
- skillSpine.play(data, 2, false, parent, () => {
- callback && callback();
- });
- break;
- case SkillType.ice:
- aniIndex = 0;
- xGame.soundMgr.playSound("skill03");
- skillSpine = this.skillSpine2;
- data.scaleX = 0.5;
- data.scaleY = 0.5;
- skillSpine.play(data, 0, false, parent, () => {
- callback && callback();
- });
- break;
- case SkillType.fireworks:
- xGame.soundMgr.playSound("skill_04_01");
- xGame.soundMgr.playSound("skill04");
- xGame.uiMgr.Show(UIFireworks, callback);
- break;
- case SkillType.GuanYu:
- xGame.soundMgr.playSound("skill05_1");
- xGame.soundMgr.playSound("skill05");
- xGame.uiMgr.Show(UIGuanYu, callback);
- break;
- default:
- break;
- }
- }
- getAllBallArr() {
- let arr = xGame.common.d2World.ballArr;
- let outArr = [];
- for (let index = 0; index < arr.length; index++) {
- if (arr[index] instanceof D2RootBallSrc)
- continue;
- if (arr[index].ballFunc == "ice")
- continue;
- if (arr[index].destroyed)
- continue;
- outArr.push(arr[index]);
- }
- return outArr;
- }
- getOneArr(deletObj) {
- let allArr = this.getAllBallArr();
- let temp;
- for (let index = 0; index < allArr.length; index++) {
- temp = allArr[index];
- if (temp.id == deletObj.id) {
- allArr.splice(index, 1);
- break;
- }
- }
- return allArr;
- }
- getNearBallBag(ball) {
- let ui = xGame.common.gameUI.ui;
- let circleArr = [];
- for (let index = 1; index <= 6; index++) {
- circleArr.push(ui.border["circle" + index]);
- }
- let outIndex = 0;
- let temp;
- let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
- ;
- let dis = 0;
- for (let index = 1; index < circleArr.length; index++) {
- temp = circleArr[index];
- dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
- if (dis < min) {
- min = dis;
- outIndex = index;
- }
- }
- return [circleArr[outIndex], outIndex];
- }
- ballFlyToBag(ballArr, time = 300) {
- let temp;
- let hole;
- this._finishNum = ballArr.length;
- this._curFinish = 0;
- let holeObj = {};
- let holeCfg = {
- "1": 0,
- "2": 0,
- "3": 0,
- "4": 0,
- "5": 0,
- "6": 0
- };
- for (let index = 0; index < ballArr.length; index++) {
- temp = ballArr[index];
- temp.outColli.isSensor = true;
- temp.innerColli.isSensor = true;
- temp.isRunSkillAni = true;
- let holeArr = this.getNearBallBag(temp);
- hole = holeArr[0];
- holeObj[index] = holeArr[1];
- temp.d3BallSrc.scaleXYZ = 0.5;
- this.tweenArr.push(temp.d3BallSrc, temp);
- Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
- Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
- }));
- Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
- let mIndex = holeObj[this._curFinish];
- let isDone = holeCfg[mIndex];
- if (isDone) {
- ballArr[this._curFinish].checkWrongBall(false);
- }
- else {
- holeCfg[mIndex] = 1;
- ballArr[this._curFinish].checkWrongBall();
- }
- this._curFinish++;
- if (this._curFinish >= this._finishNum) {
- if (this.curSkill == SkillType.highSpace) {
- }
- else if (this.curSkill == SkillType.breakArmy) {
- let rootBall = xGame.common.d2World.rootBall;
- rootBall.gameObj.x = this._rootX;
- rootBall.gameObj.y = this._rootY;
- rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
- xGame.common.d2World.d2Gan.ui.visible = true;
- xGame.common.d2World.d2HelpLine.ui.visible = true;
- xGame.common.d2World.getHelpLine();
- this.callback && this.callback(this.extraScore);
- }
- }
- }));
- }
- }
- runHighSpace() {
- let rootBall = xGame.common.d2World.rootBall;
- rootBall.showSelf();
- let d3Src = rootBall.d3BallSrc;
- let allArr = this.getAllBallArr();
- if (allArr.length <= 0) {
- this.callback && this.callback(0);
- return;
- }
- let selectBall = xGame.common.d2World.targetBall;
- let wrong = selectBall && selectBall.destroyed;
- if (!selectBall || wrong || selectBall.ballFunc == "ice") {
- selectBall = xGame.common.getRandArrEle(allArr);
- }
- let targetD3Src = selectBall.d3BallSrc;
- xGame.common.d2World.d2Gan.ui.visible = false;
- xGame.common.d2World.d2HelpLine.ui.visible = false;
- d3Src.scaleXYZ = 0.5;
- this.tweenArr.push(d3Src);
- Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
- Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
- let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
- hitEft.transform.localPositionX = d3Src.transform.localPositionX;
- hitEft.transform.localPositionY = d3Src.transform.localPositionY;
- hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
- let outArr = [selectBall];
- let other = this.leveNum - 1;
- if (other > 0) {
- let nearArr = this.getOneArr(selectBall);
- if (nearArr.length > 0) {
- xGame.common.botherArr(nearArr);
- if (other >= nearArr.length)
- other = nearArr.length;
- for (let index = 0; index < other; index++) {
- outArr.push(nearArr[index]);
- }
- }
- }
- xGame.common.extraMoveNum = other + 1;
- this.extraScore = other + 1;
- this._rootX = selectBall.gameObj.x;
- this._rootY = selectBall.gameObj.y;
- rootBall.gameObj.x = this._rootX;
- rootBall.gameObj.y = this._rootY;
- rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
- Laya.Tween.clearAll(d3Src);
- this.addRandomForce(outArr);
- }));
- }));
- }
- addRandomForce(outArr) {
- if (outArr.length > 0) {
- xGame.common.d2World.openCheckStill = true;
- this.playedLastSkill = true;
- }
- let temp;
- for (let index = 0; index < outArr.length; index++) {
- let angle = xGame.common.randomNum(0, 360);
- let linearPercent = xGame.common.randomNum(65, 100);
- temp = outArr[index];
- this.setLinearSpeed(angle, temp.rigy, linearPercent);
- }
- }
- setLinearSpeed(angle, rigy, linearPercent) {
- let sin = Math.sin(angle * Math.PI / 180);
- let cos = Math.cos(angle * Math.PI / 180);
- let maxSpeed = 4;
- let speed = new Laya.Vector2();
- speed.x = maxSpeed * linearPercent * sin;
- speed.y = -maxSpeed * linearPercent * cos;
- rigy.applyLinearImpulseToCenter(speed);
- }
- runBreakArmy() {
- xGame.common.d2World.d2Gan.ui.visible = false;
- xGame.common.d2World.d2HelpLine.ui.visible = false;
- let gameUI = xGame.common.gameUI.ui;
- gameUI.skillRod.visible = true;
- gameUI.skillRod.rotation = 110;
- let outArr = this.getAllBallArr();
- if (outArr.length <= 0) {
- gameUI.skillRod.visible = false;
- this.callback && this.callback(0);
- return;
- }
- xGame.common.botherArr(outArr);
- if (this.leveNum >= outArr.length)
- this.leveNum = outArr.length;
- let deleteNum = outArr.length - this.leveNum;
- outArr.splice(0, deleteNum);
- this.extraScore = this.leveNum;
- let potX = gameUI.skillRod.x;
- let potY = gameUI.skillRod.y;
- this._rootX = xGame.common.d2World.rootBall.gameObj.x;
- this._rootY = xGame.common.d2World.rootBall.gameObj.y;
- let disArr = [];
- for (let index = 0; index < outArr.length; index++) {
- let obj = outArr[index];
- let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
- dis = Math.pow(dis, 0.5);
- disArr.push(dis);
- }
- this.tweenArr.push(gameUI.skillRod);
- Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
- })).update = Laya.Handler.create(this, (e, t, c) => {
- let angle = gameUI.skillRod.rotation;
- let xx;
- let yy;
- let temp;
- for (let index = 0; index < outArr.length; index++) {
- temp = outArr[index];
- xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
- yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
- yy -= 20;
- temp.gameObj.x = xx;
- temp.gameObj.y = yy;
- temp.d3BallSrc.setTransPos(xx, yy);
- }
- if (angle <= 60) {
- Laya.Tween.clearAll(gameUI.skillRod);
- this.ballFlyToBag(outArr, 150);
- gameUI.skillRod.visible = false;
- }
- }, null, false);
- }
- runIce() {
- let ballArr = xGame.common.d2World.ballArr;
- this.leveNum *= 2;
- if (this.leveNum >= ballArr.length - 1)
- this.leveNum = ballArr.length - 1;
- let tempArr = [];
- let outArr = [];
- for (let index = 0; index < ballArr.length; index++) {
- if (ballArr[index] instanceof D2RootBallSrc)
- continue;
- tempArr.push(ballArr[index]);
- }
- if (tempArr.length <= 0) {
- this.callback && this.callback(0);
- return;
- }
- xGame.common.botherArr(tempArr);
- for (let index = 0; index < this.leveNum; index++) {
- outArr.push(tempArr[index]);
- }
- this.extraScore = this.leveNum;
- let temp;
- for (let index = 0; index < outArr.length; index++) {
- temp = outArr[index];
- temp.d3BallSrc.playIceEft();
- }
- Laya.timer.once(2000, this, () => {
- for (let index = 0; index < outArr.length; index++) {
- temp = outArr[index];
- let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
- temp.setBallFunc("ice", str);
- }
- this.callback && this.callback(0);
- });
- }
- runFireworks() {
- let allArr = this.getAllBallArr();
- if (allArr.length <= 0) {
- this.callback && this.callback(0);
- return;
- }
- xGame.common.d2World.d2Gan.ui.visible = false;
- xGame.common.d2World.d2HelpLine.ui.visible = false;
- let outArr = [];
- let other = this.leveNum;
- if (other > 0) {
- if (allArr.length > 0) {
- xGame.common.botherArr(allArr);
- if (other >= allArr.length)
- other = allArr.length;
- for (let index = 0; index < other; index++) {
- outArr.push(allArr[index]);
- }
- }
- }
- xGame.common.extraMoveNum = other;
- this.extraScore = other;
- this.addRandmomFireworks(outArr);
- }
- addRandmomFireworks(outArr) {
- Laya.timer.once(1100, this, () => {
- if (outArr.length > 0) {
- xGame.common.d2World.openCheckStill = true;
- this.playedLastSkill = true;
- }
- });
- xGame.soundMgr.playSound("skill_04_02");
- let temp;
- let delay = -200;
- for (let index = 0; index < outArr.length; index++) {
- temp = outArr[index];
- delay += 200;
- temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
- let angle = xGame.common.randomNum(0, 360);
- angle = this.getFireworksAngle(obj);
- let linearPercent = xGame.common.randomNum(45, 80);
- if (!obj.destroyed)
- this.setLinearSpeed(angle, obj.rigy, linearPercent);
- });
- }
- }
- getFireworksAngle(obj) {
- let rootBall = xGame.common.d2World.rootBall;
- return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
- }
- resetGame() {
- Laya.timer.clearAll(this);
- if (this.tweenArr) {
- for (let index = 0; index < this.tweenArr.length; index++) {
- Laya.Tween.clearAll(this.tweenArr[index]);
- }
- }
- this.tweenArr = null;
- }
- runGuanYu() {
- xGame.common.d2World.d2Gan.ui.visible = false;
- xGame.common.d2World.d2HelpLine.ui.visible = false;
- let rootBall = xGame.common.d2World.rootBall;
- if (rootBall.isInHole) {
- rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
- rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
- rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
- rootBall.showSelf();
- }
- this.rtStarX = rootBall.gameObj.x;
- this.rtStarY = rootBall.gameObj.y;
- this.knifeTimes = 0;
- this.playedLastSkill = true;
- rootBall.forceRun = true;
- rootBall.rigy.type = "static";
- xGame.common.d2World.openCheckStill = true;
- this.guanyuRandomKnife();
- }
- guanyuRandomKnife() {
- let rootBall = xGame.common.d2World.rootBall;
- let dir = this.getRandDir();
- let angle = xGame.common.getfguiRotation(dir.x, dir.y);
- console.log("当前angle", angle);
- this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
- this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
- let dis = 324;
- let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
- let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
- Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
- this.rtStarX = rootBall.gameObj.x;
- this.rtStarY = rootBall.gameObj.y;
- this.knifeTimes++;
- let skillLevel;
- if (xGame.common.gameMgr.selfTurn) {
- skillLevel = DataMgr.getBigSkillByIndex(4);
- }
- else {
- skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
- }
- if (!skillLevel)
- skillLevel = 1;
- skillLevel += 2;
- if (this.knifeTimes < skillLevel) {
- Laya.timer.once(400, this, () => {
- this.guanyuRandomKnife();
- });
- }
- else {
- rootBall.forceRun = false;
- rootBall.rigy.type = "dynamic";
- xGame.common.extraMoveNum = skillLevel;
- }
- }));
- }
- getRandDir() {
- let rootBall = xGame.common.d2World.rootBall;
- let allBall = this.getAllBallArr();
- let target = xGame.common.getRandArrEle(allBall);
- this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
- return this.knifeV2;
- }
- cloneKnife(x, y, rotation) {
- let parent = xGame.common.d3World.knifeRoot;
- let prefab = xGame.common.d3World.knife;
- let clone = prefab.clone();
- parent.addChild(clone);
- xGame.common.pos2to3Convert(x, y, this.knifeV3);
- clone.transform.localPositionX = this.knifeV3.x;
- clone.transform.localPositionY = 0;
- clone.transform.localPositionZ = this.knifeV3.z;
- clone.transform.localRotationEulerX = 0;
- clone.transform.localRotationEulerY = rotation;
- clone.transform.localRotationEulerZ = 0;
- clone.active = true;
- return clone;
- }
- cloneGuanYuEft(x, y, angle) {
- return;
- let parent = xGame.common.gameUI.ui.guanyuNode;
- let eft = new ui_guanyuAni();
- eft.parent = parent;
- eft.x = x;
- eft.y = y;
- eft.rotation = angle;
- }
- }
- class ui_UIWordsList extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIWordsList"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n74 = (this.getChild("n74"));
- this.clickNode = (this.getChild("clickNode"));
- this.myNode = (this.getChild("myNode"));
- this.n68 = (this.getChild("n68"));
- this.n66 = (this.getChild("n66"));
- this.n55 = (this.getChild("n55"));
- this.wordsBtn = (this.getChild("wordsBtn"));
- this.emotionBtn = (this.getChild("emotionBtn"));
- this.mybggg = (this.getChild("mybggg"));
- this.wordsList = (this.getChild("wordsList"));
- this.emotionList = (this.getChild("emotionList"));
- this.myRoot = (this.getChild("myRoot"));
- }
- }
- ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
- class EmotionDisplay {
- constructor(index, ui) {
- this.ui = ui;
- this.index = index;
- this.ui.onClick(this, this.clickSelf);
- this.updateSelf();
- }
- updateSelf() {
- let data = cfgTable.emotionData[this.index + 1];
- this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
- }
- clickSelf() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- xGame.common.talkMgr.showSelfEmotion(this.index + 1);
- xGame.common.talkMgr.closeTalkView();
- }
- }
- class WordsDisplay {
- constructor(index, ui) {
- this.ui = ui;
- this.index = index;
- this.ui.onClick(this, this.clickSelf);
- this.updateSelf();
- }
- updateSelf() {
- let data = cfgTable.talkwordsData[this.index + 1];
- this.ui.txt.text = data.msg;
- }
- clickSelf() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- xGame.common.talkMgr.showSelfTalk(this.index + 1);
- xGame.common.talkMgr.closeTalkView();
- }
- }
- class UIWordsList extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UIWordsList.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.wordsBtn, this.openTalkList);
- this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
- this.addUIClick(this.ui.clickNode, this.hide);
- this.initTalkList();
- this.initEmotionList();
- }
- show() {
- super.show();
- }
- initTalkList() {
- this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
- let data = cfgTable.talkwordsData;
- let length = Object.keys(data).length;
- this.ui.wordsList.numItems = length;
- }
- initEmotionList() {
- this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
- let data = cfgTable.emotionData;
- let length = Object.keys(data).length;
- this.ui.emotionList.numItems = length;
- }
- renderTalkItem(index, obj) {
- let temp = new WordsDisplay(index, obj);
- }
- renderEmotionItem(index, obj) {
- let temp = new EmotionDisplay(index, obj);
- }
- openTalkList() {
- this.ui.c1.selectedIndex = 0;
- }
- openEmotionList() {
- this.ui.c1.selectedIndex = 1;
- }
- }
- UIWordsList.uiName = "UIWordsList";
- class TalkMgr {
- constructor() {
- this.aiSpeak = true;
- this.emotionList = [];
- this.talkList = [];
- this.addEvent();
- xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
- this.emotionList = [];
- this.talkList = [];
- for (let k in cfgTable.emotionData) {
- this.emotionList.push(cfgTable.emotionData[k].id);
- }
- for (let k in cfgTable.talkwordsData) {
- this.talkList.push(cfgTable.talkwordsData[k].id);
- }
- }
- addEvent() {
- let ui = xGame.common.gameUI.ui;
- ui.wordsBtn.visible = true;
- ui.wordsBtn.onClick(this, this.openTalkView);
- ui.aiWordsBtn.visible = true;
- ui.aiWordsBtn.onClick(this, this.clickAIState);
- }
- openTalkView() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- xGame.uiMgr.Show(UIWordsList);
- }
- closeTalkView() {
- xGame.uiMgr.Hide(UIWordsList);
- }
- clickAIState() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- this.aiSpeak = !this.aiSpeak;
- this.changeAIState(this.aiSpeak);
- }
- changeAIState(speak) {
- this.aiSpeak = speak;
- let btn = xGame.common.gameUI.ui.aiWordsBtn;
- if (speak) {
- btn.c1.selectedIndex = 0;
- }
- else {
- btn.c1.selectedIndex = 1;
- }
- }
- showSelfTalk(wordsId) {
- let ui = xGame.common.gameUI.ui;
- ui.selfTalk.visible = true;
- ui.selfTalk.myNode.c1.selectedIndex = 1;
- ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
- ui.selfTalk.t0.play();
- }
- showSelfEmotion(emotionId) {
- let ui = xGame.common.gameUI.ui;
- ui.selfTalk.visible = true;
- ui.selfTalk.myNode.c1.selectedIndex = 0;
- this.selfSpine && this.selfSpine.dispose();
- ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
- let spineData = cfgTable.emotionData[emotionId].spine;
- this.selfSpine = new SpineMgr(spineData, () => {
- let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
- let yy = ui.selfTalk.myNode.spineRoot.height / 2;
- let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
- this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
- });
- ui.selfTalk.t0.play();
- }
- showAITalk(wordsId) {
- if (!this.aiSpeak)
- return;
- if (DataMgr.gameData.gameCount < 2)
- return;
- if (wordsId < 1)
- wordsId = this.getRandTalk();
- let ui = xGame.common.gameUI.ui;
- ui.aiTalk.visible = true;
- ui.aiTalk.myNode.c1.selectedIndex = 1;
- ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
- ui.aiTalk.t0.play();
- }
- getRandTalk() {
- let rand = xGame.tools.random(0, this.talkList.length);
- return this.emotionList[rand];
- }
- getRandEmotion() {
- let rand = xGame.tools.random(0, this.emotionList.length);
- return this.emotionList[rand];
- }
- showAIEmotion(emotionId) {
- if (!this.aiSpeak)
- return;
- if (DataMgr.gameData.gameCount < 2)
- return;
- if (emotionId < 1)
- emotionId = this.getRandEmotion();
- let ui = xGame.common.gameUI.ui;
- ui.aiTalk.visible = true;
- ui.aiTalk.myNode.c1.selectedIndex = 0;
- this.aiSpine && this.aiSpine.dispose();
- ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
- let spineData = cfgTable.emotionData[emotionId].spine;
- this.aiSpine = new SpineMgr(spineData, () => {
- let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
- let yy = ui.aiTalk.myNode.spineRoot.height / 2;
- let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
- this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
- });
- ui.aiTalk.t0.play();
- }
- resetGame() {
- let ui = xGame.common.gameUI.ui;
- ui.aiTalk.visible = false;
- ui.selfTalk.visible = false;
- this.aiSpine && this.aiSpine.dispose();
- this.selfSpine && this.selfSpine.dispose();
- ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
- ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
- this.closeTalkView();
- }
- }
- class WordsMgr {
- constructor() {
- this.comboTimes = 1;
- this.skillTimes = 0;
- this.wordsSpine = new SpineMgr("yxz_jingqiu");
- this.comboSpine = new SpineMgr("yxz_liangan");
- this.skillSpine = new SpineMgr("yiganxqiu");
- this.scoreSpine = new SpineMgr("defen");
- }
- setClassicCombo(isInterrupt) {
- if (isInterrupt) {
- this.comboTimes = 0;
- }
- }
- playClassicWords(type, callback) {
- this.callback = callback;
- let aniIndex = type;
- let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
- let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
- let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
- mySpine.destroy(true);
- this.playClassicTimes();
- });
- }
- playClassicTimes() {
- this.comboTimes++;
- if (this.comboTimes <= 1) {
- this.callback && this.callback();
- }
- else {
- let aniIndex = this.comboTimes - 1;
- let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
- let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
- let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
- mySpine.destroy(true);
- this.callback && this.callback();
- });
- }
- }
- playBigSkillTimes(times, callback) {
- if (times <= 0) {
- callback && callback();
- return;
- }
- this.callback = callback;
- let pre = "sz_0";
- let aniIndex = 0;
- this.getWordsImg(times, pre, () => {
- let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
- let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
- let mySpine = this.skillSpine.createSpine(data, parent, 1);
- let r1 = ``;
- let r2 = ``;
- if (times <= 9) {
- r1 = `res/d2Res/${pre}${times}.png`;
- mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
- aniIndex = 0;
- }
- else {
- r1 = `res/d2Res/${pre}${times % 10}.png`;
- r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
- mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
- mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
- aniIndex = 1;
- }
- this.skillSpine.play(data, aniIndex, false, parent, () => {
- mySpine.destroy(true);
- xGame.common.gameMgr.playSkillTips();
- this.playScore(times);
- xGame.common.playRandomMutiBallBigSkillSound();
- }, mySpine);
- });
- }
- playScore(score) {
- let pre = "sz_";
- let aniIndex = 0;
- this.getWordsImg(score, pre, () => {
- let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
- let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
- let mySpine = this.scoreSpine.createSpine(data, parent, 1);
- let r1 = ``;
- let r2 = ``;
- if (score <= 9) {
- r1 = `res/d2Res/${pre}${score}.png`;
- mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
- aniIndex = 0;
- }
- else {
- r1 = `res/d2Res/${pre}${score % 10}.png`;
- r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
- mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
- mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
- aniIndex = 1;
- }
- this.scoreSpine.play(data, aniIndex, false, parent, () => {
- mySpine.destroy(true);
- this.callback && this.callback();
- }, mySpine);
- });
- }
- getWordsImg(number, pre = "", callback) {
- let arr = [];
- if (number <= 9) {
- arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
- }
- else {
- 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 });
- }
- Laya.loader.load(arr, Laya.Handler.create(this, () => {
- callback && callback();
- }));
- }
- }
- class ui_UIRodMethod extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIRodMethod"));
- }
- onConstruct() {
- this.n24 = (this.getChild("n24"));
- this.white = (this.getChild("white"));
- this.dot = (this.getChild("dot"));
- this.sureBtn = (this.getChild("sureBtn"));
- this.n20 = (this.getChild("n20"));
- this.n21 = (this.getChild("n21"));
- this.n22 = (this.getChild("n22"));
- this.n23 = (this.getChild("n23"));
- this.n5 = (this.getChild("n5"));
- this.n14 = (this.getChild("n14"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
- class UIRodMethod extends UIBase {
- constructor() {
- super();
- this.isPressd = false;
- }
- onConstructor() {
- this.ui = ui_UIRodMethod.createInstance();
- this.contentPane = this.ui;
- this.addUIClick(this.ui.sureBtn, this.closeSelf);
- this.moveDir = new Laya.Vector2();
- this.moveDest = new Laya.Vector2();
- this.centerPos = new Laya.Vector2();
- xGame.common.uiRodMethod = this;
- }
- show() {
- super.show();
- xGame.common.gameMgr.gamePause = true;
- this.openPressDotEvent();
- this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
- this.centerPos.x = this.ui.white.x;
- this.centerPos.y = this.ui.white.y;
- this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
- this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
- this.setDot();
- }
- setDot() {
- this.ui.dot.x = this.moveDest.x;
- this.ui.dot.y = this.moveDest.y;
- }
- closeSelf() {
- xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
- xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
- this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
- this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
- xGame.common.gameMgr.gamePause = false;
- this.hide();
- }
- openPressDotEvent() {
- this.closePressDotEvent();
- this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
- this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
- this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
- this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
- this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
- this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
- }
- closePressDotEvent() {
- this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
- this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
- this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
- this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
- this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
- this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
- }
- onDown(e) {
- if (e.type == Laya.Event.MOUSE_DOWN)
- this.isPressd = true;
- else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
- this.isPressd = false;
- if (!this.isPressd)
- return;
- this.moveDest.x = e.stageX;
- this.moveDest.y = e.stageY;
- let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
- if (dis > 6724) {
- this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
- this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
- }
- this.setDot();
- }
- resetRod() {
- this.ui.dot.x = this.ui.white.x;
- this.ui.dot.y = this.ui.white.y;
- this.gameRod.dot.x = this.gameRod.bg.x;
- this.gameRod.dot.y = this.gameRod.bg.y;
- xGame.common.rodOffest.x = 0;
- xGame.common.rodOffest.y = 0;
- }
- }
- UIRodMethod.uiName = "UIRodMethod";
- class UIGame extends UIBase {
- constructor() {
- super();
- this.powerNum = 0;
- this.isD3Inited = false;
- this.isPrePlay = false;
- this.isMoveRod = false;
- this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
- this.rulerDis = 20;
- this.rulerOffset = 0;
- }
- onConstructor() {
- this.ui = ui_UIGame.createInstance();
- this.contentPane = this.ui;
- this.ui.x += xGame.common.sysOffestNum;
- this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
- this.isEject = false;
- xGame.common.gameUI = this;
- this.initSelf();
- }
- isTurnSelf() {
- if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
- return true;
- }
- }
- initSelf() {
- let topUI = this.ui.topNode;
- topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
- topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
- this.barInfo = {};
- this.barInfo.curY = 0;
- this.barInfo.height = this.ui.powerNode.height;
- this.barInfo.showStarY = this.ui.powerNode.showImg.y;
- this.barInfo.powerStartY = this.ui.powerNode.y;
- xGame.common.aiPlayer = new AIPlayer();
- xGame.common.gameMgr = new GameMgr();
- xGame.common.skillMgr = new SkillMgr();
- xGame.common.wordsMgr = new WordsMgr();
- xGame.common.talkMgr = new TalkMgr();
- xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
- console.log("加载经典模式表情文件chenggon !");
- });
- xGame.common.awardSpine = new SpineMgr("jinbi", () => {
- console.log("挑战模式奖励模式spine加载成功!");
- });
- xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
- xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
- this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
- this.addUIClick(this.ui.returnBtn, this.returnHome);
- this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
- this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
- this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
- }
- getGanZiImg() {
- let index = DataMgr.getCurBallRod();
- let data = cfgTable.ballrodData[index + 1];
- let gan_url = xGame.common.getGameIconUrl(data.img);
- console.log('zh:getGanZiImg gan_url==' + gan_url);
- this.ui.powerNode.showImg.url = gan_url;
- console.log('zh:修改杆子图标O K');
- }
- returnHome() {
- let tips = "Are you sure to exit the game?";
- let woman = "Boss, why don't you play for a while longer?";
- xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
- }
- addRodMethodClick() {
- if (this.isTurnSelf()) {
- xGame.uiMgr.Show(UIRodMethod);
- }
- }
- clickHelpLineBtn(force = false) {
- if (!this.isTurnSelf())
- return;
- xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
- if (success) {
- xGame.common.longHelpLine = true;
- xGame.common.d2World.getHelpLine();
- Moyu.sendDataEvent("guideNum");
- }
- else {
- }
- });
- }
- renderSelfDisplayBalls(index, target) {
- let str = "q" + xGame.common.gameMgr.selfBallArr[index];
- target.myImg.url = xGame.common.getGameIconUrl(str);
- }
- renderAIDisplayBalls(index, target) {
- let str = "q" + xGame.common.gameMgr.aiBallArr[index];
- target.myImg.url = xGame.common.getGameIconUrl(str);
- ;
- }
- updateMode() {
- if (xGame.common.gameMode == GameMode.classic) {
- this.ui.topNode.scoreNode.visible = false;
- }
- else if (xGame.common.gameMode == GameMode.bigMove) {
- this.ui.topNode.scoreNode.visible = true;
- }
- }
- show() {
- super.show();
- console.log("zh:uigame show AADD");
- this.ui.alpha = 0;
- this.updateSelf();
- xGame.common.gameMgr.gamePause = false;
- xGame.common.gameUI.ui.blackAni.visible = false;
- xGame.common.gameUI.ui.whiteAni.visible = false;
- this.ui.powerEft.visible = false;
- this.ui.colorNode.visible = false;
- this.updateHead();
- let curUse = DataMgr.getCurBallRod();
- console.log('zh:UIGame 选择的球杆234 = ' + curUse);
- this.getGanZiImg();
- }
- updateSelf() {
- if (xGame.common.gameMode == GameMode.classic) {
- this.ui.c1.selectedIndex = 0;
- this.ui.topNode.middleNode.c1.selectedIndex = 0;
- this.ui.topNode.middleNode.visible = true;
- this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
- }
- else if (xGame.common.gameMode == GameMode.bigMove) {
- this.ui.c1.selectedIndex = 0;
- this.ui.topNode.middleNode.c1.selectedIndex = 1;
- this.ui.topNode.middleNode.visible = false;
- let max = xGame.cfgMgr.getMaxBigMoveLength();
- let rand = xGame.common.randomNum(1, max);
- let guide = DataMgr.getSkillGuide();
- if (guide == 0)
- rand = 1;
- xGame.common.bigMoveLevelIndex = rand;
- }
- else if (xGame.common.gameMode == GameMode.placeBall) {
- let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
- this.ui.c1.selectedIndex = 1 + data.type;
- this.ui.alpha = 1;
- this.startGame();
- }
- this.updateMode();
- this.initD3world();
- this.initD2world();
- }
- startGame() {
- this.ui.snowNode.visible = Math.random() <= 0.1;
- this.ui.d2Node.visible = false;
- xGame.common.d3World.d3Hand.gameObj.active = false;
- xGame.common.d3World.tableSrc.init();
- xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
- this.cameraViewChange(() => {
- xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- xGame.common.d3World.d3Hand.gameObj.active = true;
- this.playPutBallD3Ani();
- break;
- case GameMode.bigMove:
- this.enterGame();
- Laya.timer.once(500, this, () => {
- this.ui.topNode.middleNode.visible = true;
- this.ui.topNode.middleNode.t0.play();
- });
- break;
- case GameMode.placeBall:
- this.enterGame();
- break;
- default:
- break;
- }
- });
- PlatMgr.showBanner(false);
- }
- enterGame() {
- this.ui.d2Node.visible = true;
- xGame.common.d3World.d3Hand.gameObj.active = false;
- xGame.common.showOneCamera("mainCamera");
- Moyu.recordGame(30, true);
- if (!this.isPrePlay) {
- this.isPrePlay = true;
- xGame.common.d3World.prePlayEft();
- }
- xGame.common.gameMgr.gameReady();
- this.openAllEvent();
- this.ui.snowNode.visible = false;
- let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
- this.ui.helpBtn.visible = condition;
- }
- showHelpLineGuide() {
- let longGuide = DataMgr.getGuideHelpLine();
- if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
- this.ui.helpBtn.visible = true;
- this.ui.guideNode.visible = true;
- }
- }
- setTurnAlpha(alpha) {
- this.ui.keduNode.alpha = alpha;
- this.ui.ganNode.alpha = alpha;
- this.ui.rodMethodNode.alpha = alpha;
- this.ui.helpBtn.alpha = alpha ? 1 : 0;
- }
- cameraViewChange(callback) {
- xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
- let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
- xGame.common.showOneCamera("visitAngle");
- cameraSrc.localRotationEulerY = 180;
- cameraSrc.localRotationEulerZ = 0;
- Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
- Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
- callback && callback();
- }));
- }));
- }
- playPutBallD3Ani() {
- xGame.common.showOneCamera("mainCamera");
- let handSrc = xGame.common.d3World.d3Hand;
- handSrc.gameObj.active = true;
- handSrc.transform.localPositionZ = 3;
- Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
- Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
- handSrc.gameObj.active = false;
- this.enterGame();
- }), 400);
- }));
- }
- updateHead() {
- let user = Moyu.getUserInfo();
- this.ui.topNode.selfNameTxt.text = user.nickName;
- xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
- let aiData = xGame.cfgMgr.getRandomUserInfo();
- if (DataMgr.getSkillGuide() < 1) {
- this.ui.topNode.aiNameTxt.text = 'billiards';
- this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
- }
- else {
- this.ui.topNode.aiNameTxt.text = aiData.name;
- let randNo = Math.floor(Math.random() * 10) + 1;
- this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
- }
- }
- initD2world() {
- let node = this.ui.d2Root.displayObject;
- let src = node.getComponent(D2World);
- if (!src) {
- xGame.common.d2World = node.addComponent(D2World);
- }
- xGame.common.d2World.initSelf();
- }
- initD3world() {
- if (this.isD3Inited)
- return;
- this.isD3Inited = true;
- let scene3D = xGame.common.d3Scene;
- this.ui.d3Root.displayObject.addChild(scene3D);
- scene3D.active = true;
- xGame.common.d3World.tableSrc.setBorderPos();
- }
- onRootMove(e) {
- let rootBall = xGame.common.d2World.rootBall;
- this.ui.moveNode.x = e.x;
- this.ui.moveNode.y = e.y;
- rootBall.gameObj.x = e.x;
- rootBall.gameObj.y = e.y;
- rootBall.d3BallSrc.setTransPos(e.x, e.y);
- }
- aiRootMove(move) {
- if (move)
- this.hideBallUI();
- else {
- this.showBallUI();
- xGame.common.d2World.getHelpLine();
- }
- }
- aiForce(type, force = 0) {
- this.pressTarget = PressType.powerNode;
- if (type == 1)
- this.onEventUp({ force: true });
- else if (type == 2)
- this.onEventMove({ stageY: force, force: true });
- }
- onEventPress(e) {
- if (e.stopPropagation)
- e.stopPropagation();
- if (!this.isTurnSelf())
- return;
- let target = e.target;
- switch (target) {
- case this.ui.myPowerNode.displayObject:
- this.pressTarget = PressType.powerNode;
- this.barInfo.curY = e.stageY;
- this.updateBarInfo();
- break;
- case this.ui.moveNode.displayObject:
- this.pressTarget = PressType.moveNode;
- this.hideBallUI();
- this.eventObj.curX = this.ui.moveNode.x;
- this.eventObj.curY = this.ui.moveNode.y;
- this.ui.moveNode.finger.visible = false;
- this.eventObj.lastX = e.stageX;
- this.eventObj.lastY = e.stageY;
- break;
- case this.ui.rulerClickNode.displayObject:
- this.pressTarget = PressType.rulerNode;
- this.eventObj.lastY = e.stageY;
- break;
- case this.ui.d2Root.displayObject:
- this.pressTarget = PressType.d2Root;
- this.eventObj.lastX = e.stageX;
- this.eventObj.lastY = e.stageY;
- this.eventObj.starX = e.stageX;
- this.eventObj.starY = e.stageY;
- this.eventObj.curX = 0;
- this.eventObj.curY = 0;
- xGame.common.d2World.d2Gan.setGanLastInfo();
- this.rulerOffset = 0;
- break;
- default:
- break;
- }
- }
- onEventMove(e) {
- if (e.stopPropagation)
- e.stopPropagation();
- if (e && e.force) {
- }
- else {
- if (!this.isTurnSelf())
- return;
- }
- switch (this.pressTarget) {
- case PressType.powerNode:
- this.barInfo.curY = e.stageY;
- this.updateBarInfo();
- this.isMoveRod = true;
- break;
- case PressType.moveNode:
- let rootBall = xGame.common.d2World.rootBall;
- let radius = rootBall.gameObj.width / 2;
- let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
- let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
- let border = xGame.common.d2World.borderRect;
- if (curX <= border.x + radius)
- curX = border.x + radius;
- else if (curX >= border.x + border.width - radius)
- curX = border.x + border.width - radius;
- if (curY <= border.y + radius)
- curY = border.y + radius;
- else if (curY >= border.y + border.height - radius)
- curY = border.y + border.height - radius;
- if (xGame.common.gameMgr.isOpenBall) {
- if (curX >= border.x + border.openBallW - radius)
- curX = border.x + border.openBallW - radius;
- }
- this.ui.moveNode.x = curX;
- this.ui.moveNode.y = curY;
- rootBall.gameObj.x = curX;
- rootBall.gameObj.y = curY;
- rootBall.d3BallSrc.setTransPos(curX, curY);
- this.isMoveRod = true;
- break;
- case PressType.rulerNode:
- let yy = e.stageY - this.eventObj.lastY;
- this.eventObj.lastY = e.stageY;
- let ruler1 = this.ui.rulerNode.img1;
- let ruler2 = this.ui.rulerNode.img2;
- ruler1.y += yy;
- ruler2.y += yy;
- this.rulerOffset += yy;
- if (Math.abs(this.rulerOffset) >= this.rulerDis) {
- this.rulerOffset = 0;
- xGame.soundMgr.playSound("inch", 1, 10);
- }
- xGame.common.d2World.d2Gan.rotateSelf(yy, true);
- let h = ruler1.height;
- this.checkGuide();
- this.isMoveRod = true;
- if (ruler1.y >= h) {
- ruler1.y = -h;
- ruler2.y = 0;
- return;
- }
- else if (ruler1.y <= -h) {
- ruler1.y = h;
- ruler2.y = 0;
- return;
- }
- if (ruler2.y >= h) {
- ruler2.y = -h;
- ruler1.y = 0;
- return;
- }
- else if (ruler2.y <= -h) {
- ruler2.y = h;
- ruler1.y = 0;
- return;
- }
- break;
- case PressType.d2Root:
- this.eventObj.curX = e.stageX;
- this.eventObj.curY = e.stageY;
- let offset = this.checkRodMoveDir();
- xGame.common.d2World.d2Gan.rotateSelf(offset);
- this.eventObj.lastX = e.stageX;
- this.eventObj.lastY = e.stageY;
- break;
- default:
- break;
- }
- }
- onEventUp(e) {
- if (e.stopPropagation)
- e.stopPropagation();
- if (e && e.force) {
- }
- else {
- if (!this.isTurnSelf())
- return;
- }
- switch (this.pressTarget) {
- case PressType.powerNode:
- this.ui.powerNode.value = 0;
- this.ui.powerNode.showImg.y = this.barInfo.showStarY;
- this.ui.powerTxt.text = "";
- if (this.powerNum > 0) {
- xGame.eventMgr.event(BALL_SHOOT);
- xGame.common.d2World.shoot(this.powerNum);
- xGame.common.d2World.d2Gan.shoot();
- xGame.common.d2World.d2HelpLine.shoot();
- this.finishGuide();
- this.ui.powerEft.visible = false;
- this.ui.colorNode.visible = false;
- let ganStr = "";
- if (this.powerNum <= 30) {
- ganStr = "gan_30";
- }
- else if (this.powerNum <= 60) {
- ganStr = "gan_50";
- }
- else {
- ganStr = "gan_80";
- }
- xGame.soundMgr.playSound(ganStr);
- }
- break;
- case PressType.moveNode:
- let rootBall = xGame.common.d2World.rootBall;
- let lastX = xGame.common.gameMgr.lastRootBallPos.x;
- let lastY = xGame.common.gameMgr.lastRootBallPos.y;
- let isIntersect = this.judgeBallIntersect();
- if (isIntersect) {
- this.ui.moveNode.x = lastX;
- this.ui.moveNode.y = lastY;
- rootBall.gameObj.x = lastX;
- rootBall.gameObj.y = lastY;
- rootBall.d3BallSrc.setTransPos(lastX, lastY);
- xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
- }
- else {
- xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
- xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
- }
- this.showBallUI();
- this.ui.moveNode.finger.visible = true;
- xGame.common.d2World.getHelpLine();
- break;
- case PressType.rulerNode:
- break;
- case PressType.d2Root:
- let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
- if (dis <= 25) {
- this.moveToClickDot(e);
- }
- break;
- default:
- break;
- }
- this.pressTarget = -1;
- }
- checkGuide() {
- let guide = DataMgr.getSkillGuide();
- if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
- xGame.common.guideStep++;
- xGame.common.gameUI.ui.guide2.visible = false;
- xGame.common.gameUI.ui.guide3.visible = true;
- }
- }
- finishGuide() {
- let guide = DataMgr.getSkillGuide();
- if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
- xGame.common.guideStep = 10;
- this.closeAllGuide();
- }
- }
- closeAllGuide() {
- xGame.common.gameUI.ui.guide1.visible = false;
- xGame.common.gameUI.ui.guide2.visible = false;
- xGame.common.gameUI.ui.guide3.visible = false;
- }
- updateBarInfo() {
- let star = this.ui.powerNode.y;
- let rate = (this.barInfo.curY - star) / this.barInfo.height;
- if (rate >= 1)
- rate = 1;
- if (rate <= 0)
- rate = 0;
- this.powerNum = Math.ceil(rate * 100);
- this.ui.powerNode.value = this.powerNum;
- this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
- this.ui.colorNode.value = this.powerNum;
- this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
- this.ui.powerEft.visible = this.powerNum != 0;
- this.ui.colorNode.visible = this.powerNum != 0;
- this.ui.powerTxt.text = this.powerNum + "";
- xGame.common.d2World.d2Gan.storagePower(this.powerNum);
- }
- forceCancel() {
- this.ui.powerNode.value = 0;
- this.ui.powerNode.showImg.y = this.barInfo.showStarY;
- this.ui.powerTxt.text = "";
- }
- checkRodMoveDir() {
- let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
- let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
- if (tempX >= 0 && tempY <= 0) {
- return this.checkDir();
- }
- else if (tempX < 0 && tempY < 0) {
- return this.checkDir(1, -1);
- }
- else if (tempX < 0 && tempY > 0) {
- return this.checkDir(-1, -1);
- }
- else {
- return this.checkDir(-1, 1);
- }
- }
- checkDir(flagX = 1, flagY = 1) {
- let offsetX = this.eventObj.curX - this.eventObj.lastX;
- let offsetY = this.eventObj.curY - this.eventObj.lastY;
- if (offsetY == 0) {
- return offsetX * flagX;
- }
- if (offsetX == 0) {
- return offsetY * flagY;
- }
- let angle = offsetY / offsetX;
- if (Math.abs(angle) >= 1) {
- return offsetY * flagY;
- }
- else {
- return offsetX * flagX;
- }
- }
- judgeBallIntersect() {
- let rootBall = xGame.common.d2World.rootBall;
- let ballArr = xGame.common.d2World.ballArr;
- let radius = rootBall.gameObj.width / 2;
- let temp;
- let isIntersect = false;
- for (let index = 0; index < ballArr.length; index++) {
- temp = ballArr[index];
- if (temp.number == rootBall.number)
- continue;
- isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
- if (isIntersect) {
- break;
- }
- }
- return isIntersect;
- }
- hideBallUI() {
- let d2Gan = xGame.common.d2World.d2Gan;
- if (!d2Gan.ui.isDisposed)
- d2Gan.ui.visible = false;
- let d2Help = xGame.common.d2World.d2HelpLine;
- if (!d2Help.ui.isDisposed)
- d2Help.ui.visible = false;
- let rootBall = xGame.common.d2World.rootBall;
- if (!rootBall.destroyed) {
- rootBall.gameObj.active = false;
- }
- }
- showBallUI() {
- let d2Gan = xGame.common.d2World.d2Gan;
- if (!d2Gan.ui.isDisposed)
- d2Gan.ui.visible = true;
- let d2Help = xGame.common.d2World.d2HelpLine;
- if (!d2Help.ui.isDisposed)
- d2Help.ui.visible = true;
- let rootBall = xGame.common.d2World.rootBall;
- if (!rootBall.destroyed) {
- rootBall.gameObj.active = true;
- }
- }
- moveToClickDot(e) {
- if (!this.isMoveRod && !xGame.common.clickedBall) {
- let root = xGame.common.d2World.rootBall.gameObj;
- let xx = e.stageX - xGame.common.sysOffestNum;
- let yy = e.stageY;
- let x = xx - root.x;
- let y = yy - root.y;
- let angle = xGame.common.getfguiRotation(x, y);
- xGame.common.d2World.d2Gan.ui.rotation = angle;
- xGame.common.d2World.getHelpLine();
- }
- this.isMoveRod = false;
- xGame.common.clickedBall = false;
- }
- openAllEvent() {
- this.closeAllEvent();
- this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
- this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
- this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
- this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
- this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
- this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
- this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
- }
- closeAllEvent() {
- this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
- this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
- this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
- this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
- this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
- this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
- this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
- }
- resetGame() {
- this.closeAllEvent();
- this.hideBallUI();
- xGame.common.gameMgr.gamePause = true;
- }
- }
- UIGame.uiName = "UIGame";
- class UIAddProp extends UIBase {
- constructor() {
- super();
- this.curType = "";
- }
- onConstructor() {
- this.ui = ui_UIAddProp.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.closeBtn, this.closeSelf);
- this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
- this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
- this.updateUI();
- this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
- this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
- this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
- this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
- this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
- this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
- }
- show(type) {
- super.show();
- this.curType = type == 0 ? "coin" : "diamond";
- this.switchBtn("");
- this.ui.t0.play();
- this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
- PlatMgr.showInsert(true);
- }
- closeSelf() {
- this.hide();
- }
- updateUI() {
- let data = cfgTable.moneyData;
- let temp;
- let obj;
- for (const key in data) {
- temp = data[key];
- obj = this.ui.myNode["node" + key];
- if (parseInt(key) <= 2) {
- obj.diamondTxt.text = "+" + temp.num;
- }
- else {
- obj.coinTxt.text = temp.num;
- obj.diamondTxt.text = temp.get.split('_')[1];
- }
- }
- this.updateDiamondShare();
- }
- updateDiamondShare() {
- let data = DataMgr.getShareDiamondTimes();
- if (data >= xGame.common.maxShareDiamondTimes) {
- this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
- this.ui.myNode.node1.touchable = false;
- xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
- }
- else {
- this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
- this.ui.myNode.node1.touchable = true;
- }
- }
- switchBtn(type) {
- if (type == "")
- type = this.curType;
- else {
- if (this.curType == type) {
- return;
- }
- else {
- this.curType = type;
- }
- }
- if (type == "coin") {
- this.ui.myNode.coinBtn.c1.selectedIndex = 0;
- this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
- this.ui.myNode.coinBtn.displayObject.zOrder = 10;
- this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
- this.ui.myNode.c1.selectedIndex = 0;
- }
- else {
- this.ui.myNode.coinBtn.c1.selectedIndex = 1;
- this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
- this.ui.myNode.coinBtn.displayObject.zOrder = 9;
- this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
- this.ui.myNode.c1.selectedIndex = 1;
- }
- }
- convertCoin(index) {
- let data = cfgTable.moneyData[index];
- let coinNum = data.num;
- let str = data.get.split('_')[1];
- let needDiamond = parseInt(str);
- if (DataMgr.diamondEnough(needDiamond)) {
- DataMgr.setDiamond(-needDiamond);
- xGame.common.playObjFlyAnim(coinNum, Prop.coin);
- xGame.uiMgr.Show(UIMsg, "Exchange successful!");
- }
- else {
- xGame.uiMgr.Show(UIMsg, "Diamond shortage");
- this.switchBtn("diamond");
- }
- }
- videoGetDiamond() {
- console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_uiAddProp_videoGetDiamond();
- }
- }
- qjff_AD_for_uiAddProp_videoGetDiamond() {
- let num = cfgTable.moneyData[2].num;
- xGame.common.playObjFlyAnim(num, Prop.diamond);
- this.closeSelf();
- }
- videoGetCoin() {
- console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_uiAddProp_videoGetCoin();
- }
- }
- qjff_AD_for_uiAddProp_videoGetCoin() {
- xGame.common.playObjFlyAnim(2000, Prop.coin);
- this.closeSelf();
- }
- shareGetDiamond() {
- let times = DataMgr.getShareDiamondTimes();
- if (times >= xGame.common.maxShareDiamondTimes) {
- console.log('zh: 233333333333 maxShareDiamondTimes');
- xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
- }
- else {
- console.log('zh:33333333333333ad');
- console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_uiAddProp_shareGetDiamond();
- }
- }
- }
- qjff_AD_for_uiAddProp_shareGetDiamond() {
- let diamond = xGame.common.randomNum(50, 100);
- xGame.common.playObjFlyAnim(diamond, Prop.diamond);
- DataMgr.setShareDiamondTimes(1);
- this.updateDiamondShare();
- }
- openPutBallView() {
- let end = xGame.uiMgr.getUI(UIGameEnd);
- let skill = xGame.uiMgr.getUI(UISkill);
- let level = xGame.uiMgr.getUI(UILevelDisplay);
- let uigame = xGame.uiMgr.getUI(UIGame);
- if (end && !end.isHide) {
- xGame.uiMgr.Hide(UIGameEnd);
- xGame.uiMgr.Show(UIMain);
- }
- if (skill && !skill.isHide)
- xGame.uiMgr.Hide(UISkill);
- if (uigame && !uigame.isHide)
- xGame.uiMgr.Hide(UIGame);
- if (level && !level.isHide) {
- }
- else {
- xGame.uiMgr.Show(UILevelDisplay);
- }
- this.closeSelf();
- }
- }
- UIAddProp.uiName = "UIAddProp";
- class MoneyNode {
- constructor(ui) {
- this.leftTime = 0;
- this.ui = ui;
- this.ui.addCoinBtn.onClick(this, this.addCoin);
- this.ui.addDiamondBtn.onClick(this, this.addDiamond);
- this.ui.addPowerBtn.onClick(this, this.addPower);
- this.ui.c1.selectedIndex = 1;
- xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
- xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
- xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
- xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
- this.coinChange();
- this.diamondChange();
- this.powerChange();
- }
- addPower() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- xGame.uiMgr.Show(UIPower);
- }
- powerChange() {
- let powerNum = DataMgr.getPower();
- this.ui.powerTxt.text = powerNum + "";
- }
- checkPowerTime() {
- let cur = new Date().getTime();
- let last = DataMgr.getPowerTime();
- if (last == 0) {
- last = cur;
- DataMgr.setPowerTime(cur);
- }
- let power = DataMgr.getPower();
- let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
- Laya.timer.clearAll(this);
- if (power >= xGame.common.natureMaxPower) {
- this.ui.powerTimeTxt.text = "";
- DataMgr.setPowerTime(cur);
- return;
- }
- if (power + offset >= xGame.common.natureMaxPower) {
- DataMgr.setPower(xGame.common.natureMaxPower, false);
- this.ui.powerTimeTxt.text = "";
- DataMgr.setPowerTime(cur);
- }
- else {
- if (offset > 0) {
- DataMgr.setPower(offset);
- DataMgr.setPowerTime(cur);
- }
- let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
- this.leftTime = xGame.common.powerRecoverNum - time;
- if (this.leftTime <= 0)
- this.leftTime = 0;
- this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
- Laya.timer.loop(1000, this, this.updatePowerTime);
- }
- }
- updatePowerTime() {
- this.leftTime -= 1;
- this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
- if (this.leftTime <= 0) {
- this.checkPowerTime();
- }
- }
- coinChange() {
- this.ui.coinTxt.text = DataMgr.getCoin() + "";
- }
- diamondChange() {
- this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
- }
- addCoin() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- Moyu.sendDataEvent("AddCoinBtn");
- xGame.uiMgr.Show(UIAddProp, 0);
- }
- addDiamond() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- Moyu.sendDataEvent("AddDiamondBtn");
- xGame.uiMgr.Show(UIAddProp, 1);
- }
- }
- class UIDraw extends UIBase {
- constructor() {
- super();
- this.curKey = 0;
- }
- onConstructor() {
- this.ui = ui_UIDraw.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.moneyNode = new MoneyNode(this.ui.moneyNode);
- this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
- this.addUIClick(this.ui.drawBtn, this.startDraw);
- this.initDraw();
- this.initUI();
- this.ui.myNode.flashNode.c1.selectedIndex = 1;
- if (Moyu.isKs)
- this.ui.closeNode.closeBtn.x += 100;
- }
- show() {
- super.show();
- this.ui.t0.play();
- this.playSecretaryIdle();
- this.updateDraw();
- this.checkFree();
- if (PlatMgr.bannerDelay > 0) {
- this.ui.closeNode.closeBtn.visible = false;
- Laya.timer.once(PlatMgr.bannerDelay, this, () => {
- this.ui.closeNode.closeBtn.visible = true;
- });
- }
- PlatMgr.showRateBanner();
- }
- hide() {
- Laya.timer.clearAll(this);
- super.hide();
- }
- checkFree() {
- let isFree = DataMgr.getDailyfreeDrawTimes();
- this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
- }
- initDraw() {
- this.drawObj = [];
- let data = cfgTable.drawData;
- let temp;
- let weight = 0;
- for (const key in data) {
- temp = data[key];
- weight += temp.weight;
- this.drawObj.push(weight);
- }
- this.allWeight = weight;
- }
- initUI() {
- let data = cfgTable.drawData;
- let temp;
- let img;
- let txt;
- for (const key in data) {
- temp = data[key];
- img = this.ui.myNode.rotNode["img" + key];
- txt = this.ui.myNode.rotNode["txt" + key];
- img.url = xGame.common.getGameIconUrl(temp.icon);
- txt.visible = true;
- if (temp.award > 2) {
- img.rotation = 0;
- txt.text = cfgTable.ballrodData[temp.award - 1].name;
- }
- else {
- img.rotation = temp.rotation;
- txt.text = temp.num;
- }
- }
- }
- getCurkey() {
- let rand = Math.random() * this.allWeight;
- let temp;
- for (let index = 0; index < this.drawObj.length - 1; index++) {
- temp = this.drawObj[index];
- if (index == 0) {
- if (rand < temp) {
- return index + 1;
- }
- }
- else {
- if (rand >= temp && rand < this.drawObj[index + 1]) {
- return index + 1;
- }
- }
- }
- return 2;
- }
- startDraw() {
- let freeTimes = DataMgr.getDailyfreeDrawTimes();
- if (freeTimes > 0) {
- this.beginDraw();
- DataMgr.setDailyfreeDrawTimes(0);
- this.checkFree();
- }
- else {
- if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_chouJiang();
- }
- }
- }
- qjff_chouJiang() {
- this.beginDraw();
- }
- beginDraw() {
- this.ui.myNode.flashNode.c1.selectedIndex = 0;
- this.ui.drawBtn.touchable = false;
- this.curKey = this.getCurkey();
- console.log("当前key", this.curKey);
- let cell = 60;
- let lap = 3;
- let angle = cell * (this.curKey - 1) + lap * 360;
- let target = this.ui.myNode.rotNode;
- target.rotation = 0;
- Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
- console.log("旋转完成");
- this.ui.drawBtn.touchable = true;
- this.getAward();
- }));
- }
- getAward() {
- let data = cfgTable.drawData[this.curKey];
- let temp = new AwardType();
- temp.type = data.award;
- temp.num = data.num;
- xGame.common.getAward([temp], () => {
- DataMgr.setDrawTimes(1);
- this.updateDraw();
- this.ui.myNode.flashNode.c1.selectedIndex = 1;
- });
- }
- updateDraw() {
- let drawTimes = DataMgr.getDrawTimes();
- let awardTimes = DataMgr.getDrawAwardTimes();
- if (Math.floor(drawTimes / 3) > awardTimes) {
- this.ui.extraNode.boxBtn.t0.play(null, -1);
- this.ui.extraNode.boxBtn.touchable = true;
- this.ui.extraNode.tipsTxt.text = "3/3";
- this.ui.extraNode.barNode.width = 265;
- this.getExtraAward();
- }
- else {
- this.ui.extraNode.boxBtn.t0.stop();
- this.ui.extraNode.boxBtn.touchable = false;
- this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
- this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
- }
- let data = cfgTable.drawData[1];
- if (awardTimes == 0) {
- this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
- this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
- this.ui.myNode.rotNode.img1.rotation = 0;
- }
- else {
- let award = data.nextid;
- this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
- this.ui.myNode.rotNode.txt1.text = award[1];
- this.ui.myNode.rotNode.img1.rotation = 0;
- }
- }
- getExtraAward() {
- let drawTimes = DataMgr.getDrawTimes();
- let awardTimes = DataMgr.getDrawAwardTimes();
- let data = cfgTable.drawData[1];
- let award = new AwardType();
- if (awardTimes == 0) {
- award.num = data.num;
- award.type = data.award;
- xGame.common.getAward([award], () => {
- let all = Math.floor(drawTimes / 3);
- DataMgr.setDrawAwardTimes(all);
- this.updateDraw();
- });
- }
- else {
- award.num = parseInt(data.nextid[1]);
- award.type = parseInt(data.nextid[0]);
- xGame.common.getAward([award], () => {
- let all = Math.floor(drawTimes / 3);
- DataMgr.setDrawAwardTimes(all);
- this.updateDraw();
- });
- }
- }
- closeSelf() {
- this.hide();
- }
- playSecretaryIdle() {
- let parent = this.ui.secretary.displayObject;
- parent.destroyChildren();
- let xx = this.ui.secretary.width / 2;
- let yy = this.ui.secretary.height;
- let scale = xGame.common.getSecretaryScale();
- let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
- xGame.common.secretary.play(data, 0, true, parent);
- }
- }
- UIDraw.uiName = "UIDraw";
- class ui_UIFlyEft extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIFlyEft"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n7 = (this.getChild("n7"));
- this.iconNode = (this.getChild("iconNode"));
- this.txt = (this.getChild("txt"));
- this.txtNode = (this.getChild("txtNode"));
- }
- }
- ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
- class UIFlyEft extends UIBase {
- constructor() {
- super();
- this.max = 8;
- this.delay = 0;
- }
- onConstructor() {
- this.ui = ui_UIFlyEft.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.isMuti = true;
- this.ui.x += xGame.common.sysOffestNum;
- }
- getArrPos() {
- if (this.iconPos && this.iconPos.length > 0)
- return;
- this.iconPos = [];
- let temp;
- for (let index = 0; index < this.max; index++) {
- temp = this.ui["n" + index];
- this.iconPos.push([temp.x, temp.y]);
- }
- }
- show(stPos, edPos, num, type, callback) {
- super.show();
- this.parent.setChildIndex(this, this.parent.numChildren - 1);
- this.getArrPos();
- this.updateUI(type);
- this.updatePos();
- this.runFly(edPos, callback);
- this.runWorlds(stPos, num);
- }
- updateUI(type) {
- let temp;
- let str;
- for (let index = 0; index < this.max; index++) {
- temp = this.ui["n" + index];
- str = this.getIconStr(type);
- temp.url = xGame.common.getGameIconUrl(str);
- }
- }
- getIconStr(type) {
- switch (type) {
- case Prop.diamond:
- return "ty_zs";
- case Prop.coin:
- return "ty_jb";
- default:
- break;
- }
- }
- updatePos() {
- let temp;
- for (let index = 0; index < this.max; index++) {
- temp = this.ui["n" + index];
- temp.x = this.iconPos[index][0];
- temp.y = this.iconPos[index][1];
- }
- }
- runFly(endPos, callback) {
- let all = 0;
- let temp;
- for (let index = 0; index < this.max; index++) {
- temp = this.ui["n" + index];
- temp.visible = true;
- Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
- temp.visible = false;
- all++;
- if (all >= this.max) {
- callback && callback();
- }
- }), 20 * index);
- }
- }
- runWorlds(stPos, num) {
- let str = "+" + num;
- this.ui.txt.text = str;
- let starX = stPos.x;
- let starY = stPos.y + 50;
- this.ui.txt.x = starX;
- this.ui.txt.y = starY;
- this.ui.txt.visible = true;
- this.ui.txt.alpha = 1;
- Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
- Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
- this.ui.txt.visible = false;
- this.hide();
- }));
- }));
- }
- }
- UIFlyEft.uiName = "UIFlyEft";
- class Common {
- constructor() {
- this.convertNum = 0.025;
- this.VectorUp = new Laya.Vector3(0, 1, 0);
- this.scaleV3One = new Laya.Vector3();
- this.scaleV3Two = new Laya.Vector3();
- this.posV4 = new Laya.Vector4();
- this.showDebug = false;
- this.openGuide = true;
- this.rodOffest = new Laya.Vector2(0, 0);
- this.rodAngle = 0;
- this.gameMode = GameMode.classic;
- this.bigMoveLevelIndex = 1;
- this.bigMoveNeedCoin = 1000;
- this.classicNiceNeddCoin = 1000;
- this.passAwardCoin = 2000;
- this.classicRoomType = 1;
- this.maxPower = 20;
- this.natureMaxPower = 5;
- this.videoPower = 2;
- this.powerRecoverNum = 900;
- this.curPlayerSkillType = 0;
- this.isNewDay = false;
- this.clickedBall = false;
- this.placeBallCurLevel = 0;
- this.placeBallStarNum = 0;
- this.longHelpLine = false;
- this.maxShareDiamondTimes = 3;
- this.guideStep = 0;
- this.temSelfLevel = 0;
- this.extraMoveNum = 0;
- this.curRankID = 0;
- this.rankID = {
- normalStar: 12000,
- wxStar: 12001
- };
- this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
- this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
- this.btnClickStr = "buttonclick";
- this.maxSkillLevel = 10;
- this.upSkillLevel = false;
- this.gameStartTime = 0;
- this._sysOffestNum = 0;
- this.angleV2 = new Laya.Vector2();
- this.rootV = new Laya.Vector2(0, 1);
- this.tempDir1 = new Laya.Vector2();
- this.tempDir2 = new Laya.Vector2();
- this.ballSize = 33;
- this.stPos = new Laya.Point();
- this.edPos = new Laya.Point();
- Common._instance = this;
- window["common"] = this;
- }
- static getInstance() {
- if (!this._instance) {
- this._instance = new Common();
- }
- return this._instance;
- }
- get sysOffestNum() {
- if (this._sysOffestNum == 0) {
- this._sysOffestNum = (Laya.stage.width - 1334) / 2;
- }
- return this._sysOffestNum;
- }
- testShader() {
- let test = new LightShader();
- test.texture = "res/d3Res/ballTexture/ball1.png";
- Laya.stage.addChild(test);
- }
- playScale(node) {
- Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
- Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
- }));
- }));
- }
- setGroup(colli, ...group) {
- let out = 0;
- for (let index = 0; index < group.length; index++) {
- if (index == 0) {
- out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
- }
- else {
- out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
- }
- }
- colli.collisionGroup = out;
- }
- setCanGroupWith(colli, ...group) {
- let out = 0;
- for (let index = 0; index < group.length; index++) {
- if (index == 0) {
- out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
- }
- else {
- out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
- }
- }
- colli.canCollideWith = out;
- }
- loadPrefab(name, callback) {
- Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
- let prefab = new Laya.Prefab();
- prefab.json = obj;
- let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
- callback && callback(img);
- }));
- }
- pos2to3Convert(x, y, d3Pos) {
- x = x + this.sysOffestNum;
- d3Pos.setValue(x, y, 0);
- let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
- if (success) {
- }
- else {
- console.error("转换出错了。。。。。。。。");
- }
- }
- scale2to3Convert(num) {
- this.scaleV3One.setValue(0, 0, 0);
- this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
- this.scaleV3Two.setValue(0, num, 0);
- this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
- let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
- return outNum;
- }
- pos3to2Convert(d3Pos) {
- this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
- d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
- d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
- d3Pos.x -= this.sysOffestNum;
- }
- scale3to2Convert(num) {
- let scale = this.scale2to3Convert(1);
- let d2Out = num / scale;
- return d2Out;
- }
- getCollider(type, restitution = 0.9, density = 10) {
- let colli;
- if (type == "box")
- colli = new Laya.BoxCollider();
- else
- colli = new Laya.CircleCollider();
- colli.friction = 0;
- colli.restitution = restitution;
- colli.density = density;
- return colli;
- }
- getRigbody() {
- let rigy = new Laya.RigidBody();
- rigy.bullet = true;
- rigy.allowRotation = false;
- rigy.allowSleep = false;
- rigy.gravityScale = 0;
- return rigy;
- }
- getfguiRotation(x, y) {
- this.angleV2.setValue(x, y);
- Laya.Vector2.normalize(this.angleV2, this.angleV2);
- let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
- if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
- angle = -angle;
- }
- return 180 + angle;
- }
- getAngle(x, y) {
- this.angleV2.setValue(x, y);
- Laya.Vector2.normalize(this.angleV2, this.angleV2);
- let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
- return angle;
- }
- randomNum(a, b) {
- return a + Math.floor((b - a + 1) * Math.random());
- }
- getRandArrEle(arr) {
- return arr[Math.floor(arr.length * Math.random())];
- }
- getSign(val) {
- return val >= 0 ? 1 : -1;
- }
- botherArr(arr) {
- let times = arr.length + 2;
- let length = arr.length;
- let a;
- let b;
- let temp;
- for (let index = 0; index < times; index++) {
- a = Math.floor(Math.random() * length);
- b = Math.floor(Math.random() * length);
- temp = arr[a];
- arr[a] = arr[b];
- arr[b] = temp;
- }
- }
- getGameIconUrl(id) {
- return "ui://game/" + id;
- }
- getComponentUrl(id) {
- return "ui://game/" + id;
- }
- getAnimation() {
- }
- judgeSkillType(type = SkillType.highSpace) {
- if (this.gameMode == GameMode.classic)
- return;
- let gameMgr = this.gameMgr;
- if (gameMgr.selfTurn) {
- if (gameMgr.selfCurSkill == type) {
- return true;
- }
- }
- else {
- if (gameMgr.aiCurSkill == type) {
- return true;
- }
- }
- }
- ballColliHole(collider) {
- if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
- xGame.common.gameMgr.isFirstInGame = false;
- xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
- }
- collider.owner.mySrc.checkWrongBall();
- }
- getArrMaxEle(arr) {
- let max = -Infinity;
- for (let index = 0; index < arr.length; index++) {
- max = Math.max(arr[index], max);
- }
- return max;
- }
- getArrMinEle(arr) {
- let min = Infinity;
- for (let index = 0; index < arr.length; index++) {
- min = Math.min(arr[index], min);
- }
- return min;
- }
- playRandomMutiBallBigSkillSound() {
- if (Math.random() <= 0.5)
- return;
- let rand = this.randomNum(1, 6);
- let str = "ganfa0" + rand;
- xGame.soundMgr.playSound(str);
- }
- showOneCamera(type) {
- let object = xGame.common.d3World.cameraObj;
- for (const key in object) {
- if (Object.prototype.hasOwnProperty.call(object, key)) {
- object[key].init();
- object[key].owner.active = key == type;
- }
- }
- }
- checkBallOverBorder(x, y) {
- let radius = 17;
- let condition = this._checkBorder(x + radius, y) ||
- this._checkBorder(x - radius, y) ||
- this._checkBorder(x, y + radius) ||
- this._checkBorder(x, y - radius);
- if (condition) {
- return true;
- }
- }
- _checkBorder(x, y) {
- let borderRect = this.d2World.borderRect;
- let xOffest = 20;
- let yOffest = 20;
- if (y <= borderRect.y - yOffest) {
- return true;
- }
- if (y >= borderRect.y + borderRect.height + yOffest) {
- return true;
- }
- if (x <= borderRect.x - xOffest) {
- return true;
- }
- if (x >= borderRect.x + borderRect.width + xOffest) {
- return true;
- }
- }
- initWeight(cfg) {
- let allCfgData = { data: {}, allWeightNum: 0 };
- let weightCfg = allCfgData.data;
- let weight = 0;
- for (const key in cfg) {
- weightCfg[key] = {};
- weightCfg[key].id = cfg[key].id;
- weightCfg[key].minWeight = weight;
- weight += cfg[key].weight;
- weightCfg[key].maxWeight = weight;
- }
- allCfgData.allWeightNum = weight;
- return allCfgData;
- }
- getRandomWeightData(cfg) {
- let weightCfg = cfg.data;
- let allWeightNum = cfg.allWeightNum;
- let rand = Math.floor(Math.random() * allWeightNum);
- for (const key in weightCfg) {
- if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
- return weightCfg[key];
- }
- }
- return weightCfg[1];
- }
- showGirlTalkPop(wordsIndex, node, msgNode) {
- node.visible = true;
- msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
- node.t0.play(Laya.Handler.create(this, () => {
- node.visible = false;
- }));
- }
- stopGirlPop(node) {
- node.t0.stop();
- node.visible = false;
- }
- createHead(loader, url, size = 107) {
- if (Laya.Browser.name == "Browser") {
- loader.url = url;
- return;
- }
- if (Moyu.isTT) {
- let localImage = new Image();
- localImage.src = url;
- localImage.onload = () => {
- let t2d = new Laya.Texture2D();
- t2d.width = size;
- t2d.height = size;
- loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
- t2d.loadImageSource(localImage);
- };
- }
- else {
- console.log('zh:url=', url);
- loader.url = url;
- }
- }
- addTestCoin(num) {
- DataMgr.setCoin(num);
- }
- addTestDiamond(num) {
- DataMgr.setDiamond(num);
- }
- addTestSkill() {
- DataMgr.setBigSkill(0, 99);
- DataMgr.setBigSkill(1, 99);
- DataMgr.setBigSkill(2, 99);
- }
- playClassicEmotion(number, x, y) {
- if (this.gameMode == GameMode.bigMove)
- return;
- let randIndex = this.randomNum(0, 2);
- let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
- let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
- if (this.gameMgr.selfTurn) {
- if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
- this.classicEmotionSpine.play(data, randIndex, false, parent);
- }
- else {
- if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
- }
- else {
- if (number == this.gameMgr.blackNum) {
- if (this.gameMgr.selfBallArr.length == 0) {
- this.classicEmotionSpine.play(data, randIndex, false, parent);
- }
- else {
- }
- }
- else {
- this.classicEmotionSpine.play(data, randIndex, false, parent);
- }
- }
- }
- }
- else {
- if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
- this.classicEmotionSpine.play(data, randIndex, false, parent);
- }
- else {
- if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
- }
- else {
- if (number == this.gameMgr.blackNum) {
- if (this.gameMgr.aiBallArr.length == 0) {
- this.classicEmotionSpine.play(data, randIndex, false, parent);
- }
- else {
- }
- }
- else {
- this.classicEmotionSpine.play(data, randIndex, false, parent);
- }
- }
- }
- }
- }
- playHappySound(number) {
- if (this.gameMode != GameMode.classic)
- return;
- if (number == 8)
- return;
- let play = false;
- if (this.gameMgr.selfTurn) {
- if (this.gameMgr.ensureBallType) {
- if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
- play = true;
- }
- }
- else {
- play = true;
- }
- }
- else {
- if (this.gameMgr.ensureBallType) {
- if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
- play = true;
- }
- }
- else {
- play = true;
- }
- }
- if (play)
- xGame.soundMgr.playSound("applause");
- }
- destroyClassicEmotion() {
- if (this.gameMode == GameMode.bigMove)
- return;
- let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
- parent.destroyChildren();
- }
- playAwardSpine(x, y) {
- let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
- let parent = this.gameUI.ui.awardSpineNode.displayObject;
- this.awardSpine.play(data, 0, false, parent);
- }
- destroyAwardSpine() {
- let parent = this.gameUI.ui.awardSpineNode.displayObject;
- parent.destroyChildren();
- }
- isBlock(bx, by, hx, hy, except = null) {
- this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
- let balls = xGame.common.d2World.ballArr;
- let outArr = [];
- for (let index = 0; index < balls.length; index++) {
- let obj = balls[index];
- if (obj.number == 0)
- continue;
- if (obj == except)
- continue;
- let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
- this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
- let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
- if (num >= 1)
- num = 1;
- if (num < 0)
- continue;
- let gap = Math.sin(Math.acos(num)) * dis;
- if (gap < this.ballSize) {
- outArr.push({
- dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
- disHon: Math.cos(Math.acos(num)) * dis,
- disVer: Math.sin(Math.acos(num)) * dis,
- src: balls[index],
- dir: this.tempDir1
- });
- }
- }
- if (outArr.length > 0) {
- outArr.sort((a, b) => { return a.dis - b.dis; });
- return outArr[0];
- }
- }
- AngleBetween(vector1, vector2) {
- let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
- return rad * (180 / Math.PI);
- }
- getSecretaryScale() {
- if (this.secretary.spineName == "mishu") {
- return 1.28;
- }
- else {
- return 1.024;
- }
- }
- signAwardContainsRod(arr) {
- let temp;
- for (let index = 0; index < arr.length; index++) {
- temp = arr[index].split('-')[0];
- if (parseInt(temp) > 2) {
- return true;
- }
- }
- }
- judgeSameDay() {
- let lastTime = DataMgr.getSignTime();
- let curTime = new Date().getTime();
- if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
- return true;
- }
- return false;
- }
- getAward(arr, callback) {
- let showTriple = arr[0].type <= 2;
- xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
- let temp;
- for (let index = 0; index < arr.length; index++) {
- temp = arr[index];
- switch (temp.type) {
- case 1:
- this.playObjFlyAnim(temp.num, temp.type);
- break;
- case 2:
- this.playObjFlyAnim(temp.num, temp.type);
- break;
- case 3:
- case 4:
- case 5:
- case 6:
- DataMgr.setBallRod(temp.type - 2, 1);
- DataMgr.setCurBallRod(temp.type - 2);
- break;
- default:
- break;
- }
- }
- callback && callback(watchVideo);
- });
- }
- getMoneyNode() {
- let moneyNode;
- let sign = xGame.uiMgr.getUI(UISign);
- let draw = xGame.uiMgr.getUI(UIDraw);
- let end = xGame.uiMgr.getUI(UIGameEnd);
- let skill = xGame.uiMgr.getUI(UISkill);
- if (sign && !sign.isHide)
- moneyNode = sign.ui.moneyNode;
- if (draw && !draw.isHide)
- moneyNode = draw.ui.moneyNode;
- if (end && !end.isHide)
- moneyNode = end.ui.moneyNode;
- if (skill && !skill.isHide)
- moneyNode = skill.ui.moneyNode;
- let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
- let main = xGame.uiMgr.getUI(UIMain);
- if (condition1 && main && !main.isHide) {
- moneyNode = main.ui.moneyNode;
- }
- return moneyNode;
- }
- playObjFlyAnim(num, type, callback = null) {
- this.stPos.x = Laya.stage.width / 2;
- this.stPos.y = Laya.stage.height / 2;
- let moneyNode = this.getMoneyNode();
- switch (type) {
- case Prop.diamond:
- this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
- this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
- moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
- this.edPos.x /= 2;
- this.edPos.y /= 2;
- break;
- case Prop.coin:
- this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
- this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
- moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
- this.edPos.x /= 2;
- this.edPos.y /= 2;
- break;
- default:
- break;
- }
- xGame.soundMgr.playSound("coinbag");
- xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
- switch (type) {
- case Prop.diamond:
- DataMgr.setDiamond(num);
- break;
- case Prop.coin:
- DataMgr.setCoin(num);
- break;
- default:
- break;
- }
- callback && callback();
- });
- }
- autoPopUIView() {
- let arr = [];
- let sign = this.judgeSameDay() ? false : true;
- if (sign)
- arr.push("sign");
- let draw = DataMgr.getDailyfreeDrawTimes() > 0;
- if (draw)
- arr.push("draw");
- if (arr.length <= 0)
- return;
- let str = this.getRandArrEle(arr);
- switch (str) {
- case "sign":
- xGame.uiMgr.Show(UISign);
- break;
- case "draw":
- xGame.uiMgr.Show(UIDraw);
- break;
- default:
- break;
- }
- }
- getMSTime(time) {
- let min = Math.floor(time / 60);
- let sec = Math.floor((time - min * 60));
- if (sec < 10)
- sec = "0" + sec;
- if (min < 10)
- min = "0" + min;
- return `${min}:${sec}`;
- }
- testPower() {
- DataMgr.setPower(0, false);
- }
- getAllStarNum() {
- let data = DataMgr.getPlaceBallLevelList();
- let out = 0;
- for (let index = 0; index < data.length; index++) {
- out += data[index].star;
- }
- return out;
- }
- recoverCameraView() {
- Laya.timer.once(900, this, () => {
- xGame.common.showOneCamera("mainCamera");
- if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
- xGame.common.gameUI.ui.d2Node.alpha = 1;
- xGame.common.gameUI.ui.border.alpha = 0;
- if (Laya.physicsTimer.scale < 1) {
- Laya.physicsTimer.scale = 1;
- }
- }
- });
- }
- getClassicLevel() {
- let successTimes = DataMgr.getClassicTimes();
- let needKey = "";
- let lastKey = "";
- let cfg = cfgTable.classictimesData;
- let data;
- for (const key in cfg) {
- data = cfg[key];
- if (successTimes <= data.times) {
- needKey = key;
- }
- lastKey = key;
- }
- if (needKey == "")
- needKey = lastKey;
- return cfg[needKey];
- }
- }
- Common._instance = null;
- class ui_Component92 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component92"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- }
- }
- ui_Component92.URL = "ui://isxx5ak710hfv49p";
- class ui_Component129 extends fgui.GProgressBar {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component129"));
- }
- onConstruct() {
- this.bar_v = (this.getChild("bar_v"));
- this.n84 = (this.getChild("n84"));
- }
- }
- ui_Component129.URL = "ui://isxx5ak7748uv4mp";
- class ui_Component130 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component130"));
- }
- onConstruct() {
- this.ani = (this.getChild("ani"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component130.URL = "ui://isxx5ak7748uv4mq";
- class ui_powerEft extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "powerEft"));
- }
- onConstruct() {
- this.ani = (this.getChild("ani"));
- this.n88 = (this.getChild("n88"));
- this.n89 = (this.getChild("n89"));
- }
- }
- ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
- class ui_PutBallLevelDisplay extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n2 = (this.getChild("n2"));
- this.n22 = (this.getChild("n22"));
- this.n23 = (this.getChild("n23"));
- this.n15 = (this.getChild("n15"));
- this.challenge = (this.getChild("challenge"));
- this.n17 = (this.getChild("n17"));
- this.n3 = (this.getChild("n3"));
- this.starNode = (this.getChild("starNode"));
- this.levelTxt = (this.getChild("levelTxt"));
- this.n14 = (this.getChild("n14"));
- this.n19 = (this.getChild("n19"));
- this.n20 = (this.getChild("n20"));
- this.n21 = (this.getChild("n21"));
- this.special = (this.getChild("special"));
- }
- }
- ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
- class ui_Component79 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component79"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n7 = (this.getChild("n7"));
- this.n8 = (this.getChild("n8"));
- this.n9 = (this.getChild("n9"));
- this.n10 = (this.getChild("n10"));
- this.n11 = (this.getChild("n11"));
- this.n12 = (this.getChild("n12"));
- }
- }
- ui_Component79.URL = "ui://isxx5ak7avag477";
- class ui_Component80 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component80"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.myList = (this.getChild("myList"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component80.URL = "ui://isxx5ak7avag47b";
- class ui_SignNormal extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "SignNormal"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n7 = (this.getChild("n7"));
- this.n15 = (this.getChild("n15"));
- this.titleTxt = (this.getChild("titleTxt"));
- this.n8 = (this.getChild("n8"));
- this.myIcon = (this.getChild("myIcon"));
- this.numTxt = (this.getChild("numTxt"));
- this.n12 = (this.getChild("n12"));
- this.n13 = (this.getChild("n13"));
- this.n17 = (this.getChild("n17"));
- this.n14 = (this.getChild("n14"));
- }
- }
- ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
- class ui_screenNode extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "screenNode"));
- }
- onConstruct() {
- this.n9 = (this.getChild("n9"));
- this.screenImg = (this.getChild("screenImg"));
- }
- }
- ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
- class ui_GetAwrad_com1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
- }
- onConstruct() {
- this.n38 = (this.getChild("n38"));
- this.n39 = (this.getChild("n39"));
- this.n40 = (this.getChild("n40"));
- this.t0 = this.getTransition("t0");
- this.t1 = this.getTransition("t1");
- }
- }
- ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
- class ui_GetAwrad_com2 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
- }
- onConstruct() {
- this.n39 = (this.getChild("n39"));
- this.n40 = (this.getChild("n40"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
- class ui_Component128 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component128"));
- }
- onConstruct() {
- this.n38 = (this.getChild("n38"));
- this.n40 = (this.getChild("n40"));
- }
- }
- ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
- class ui_Component100_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component100_1"));
- }
- onConstruct() {
- this.myNode = (this.getChild("myNode"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
- class ui_Component142 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component142"));
- }
- onConstruct() {
- this.n41 = (this.getChild("n41"));
- this.n42 = (this.getChild("n42"));
- }
- }
- ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
- class ui_main_guang extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "main_guang"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n8 = (this.getChild("n8"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
- class ui_try_com1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "try_com1"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n0 = (this.getChild("n0"));
- this.n2 = (this.getChild("n2"));
- this.cancelBtn = (this.getChild("cancelBtn"));
- this.videoBtn = (this.getChild("videoBtn"));
- this.n9 = (this.getChild("n9"));
- this.n24 = (this.getChild("n24"));
- this.titleTxt = (this.getChild("titleTxt"));
- this.n32 = (this.getChild("n32"));
- this.n29 = (this.getChild("n29"));
- this.n36 = (this.getChild("n36"));
- this.txtTime = (this.getChild("txtTime"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
- class ui_try_com2 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "try_com2"));
- }
- onConstruct() {
- this.skillicon = (this.getChild("skillicon"));
- this.n35 = (this.getChild("n35"));
- this.n31 = (this.getChild("n31"));
- this.n32 = (this.getChild("n32"));
- this.n33 = (this.getChild("n33"));
- this.n34 = (this.getChild("n34"));
- }
- }
- ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
- class ui_try_com3 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "try_com3"));
- }
- onConstruct() {
- this.n33 = (this.getChild("n33"));
- this.n34 = (this.getChild("n34"));
- this.n35 = (this.getChild("n35"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
- class ui_huihe1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "huihe1"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
- class ui_huihe2 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "huihe2"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
- class ui_Component143 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component143"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n7 = (this.getChild("n7"));
- this.n8 = (this.getChild("n8"));
- this.n9 = (this.getChild("n9"));
- this.n10 = (this.getChild("n10"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
- class ui_dh_jingbi2 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n8 = (this.getChild("n8"));
- this.n10 = (this.getChild("n10"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
- class ui_dh_jingbi2_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n4 = (this.getChild("n4"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
- class ui_dh_jingbi3 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n8 = (this.getChild("n8"));
- this.n10 = (this.getChild("n10"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
- class ui_dh_jingbi3_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.n1 = (this.getChild("n1"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
- class ui_hb_jinbi1 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
- }
- onConstruct() {
- this.n20 = (this.getChild("n20"));
- this.n25 = (this.getChild("n25"));
- this.coinTxt = (this.getChild("coinTxt"));
- this.n28 = (this.getChild("n28"));
- this.n32 = (this.getChild("n32"));
- this.n38 = (this.getChild("n38"));
- this.n45 = (this.getChild("n45"));
- this.getTips = (this.getChild("getTips"));
- this.n39 = (this.getChild("n39"));
- this.diamondTxt = (this.getChild("diamondTxt"));
- this.n41 = (this.getChild("n41"));
- this.n42 = (this.getChild("n42"));
- this.n46 = (this.getChild("n46"));
- this.n47 = (this.getChild("n47"));
- this.n48 = (this.getChild("n48"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
- class ui_hb_jinbi2 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
- }
- onConstruct() {
- this.n20 = (this.getChild("n20"));
- this.n25 = (this.getChild("n25"));
- this.coinTxt = (this.getChild("coinTxt"));
- this.n28 = (this.getChild("n28"));
- this.n32 = (this.getChild("n32"));
- this.n38 = (this.getChild("n38"));
- this.n39 = (this.getChild("n39"));
- this.diamondTxt = (this.getChild("diamondTxt"));
- this.n41 = (this.getChild("n41"));
- this.n42 = (this.getChild("n42"));
- this.n43 = (this.getChild("n43"));
- this.n44 = (this.getChild("n44"));
- this.n45 = (this.getChild("n45"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
- class ui_hb_jinbi3 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
- }
- onConstruct() {
- this.n20 = (this.getChild("n20"));
- this.n25 = (this.getChild("n25"));
- this.coinTxt = (this.getChild("coinTxt"));
- this.n28 = (this.getChild("n28"));
- this.n32 = (this.getChild("n32"));
- this.n38 = (this.getChild("n38"));
- this.n39 = (this.getChild("n39"));
- this.diamondTxt = (this.getChild("diamondTxt"));
- this.n41 = (this.getChild("n41"));
- this.n42 = (this.getChild("n42"));
- this.n43 = (this.getChild("n43"));
- this.n44 = (this.getChild("n44"));
- this.n45 = (this.getChild("n45"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
- class ui_Component104 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component104"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n12 = (this.getChild("n12"));
- this.coinBtn = (this.getChild("coinBtn"));
- this.diamondBtn = (this.getChild("diamondBtn"));
- this.node3 = (this.getChild("node3"));
- this.node4 = (this.getChild("node4"));
- this.node5 = (this.getChild("node5"));
- this.node1 = (this.getChild("node1"));
- this.node2 = (this.getChild("node2"));
- this.node6 = (this.getChild("node6"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
- class ui_Component105 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component105"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n49 = (this.getChild("n49"));
- this.n18 = (this.getChild("n18"));
- this.n46 = (this.getChild("n46"));
- this.n48 = (this.getChild("n48"));
- }
- }
- ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
- class ui_Component106 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component106"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n49 = (this.getChild("n49"));
- this.n18 = (this.getChild("n18"));
- this.n46 = (this.getChild("n46"));
- this.n48 = (this.getChild("n48"));
- }
- }
- ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
- class ui_hb_zs1 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "hb_zs1"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n20 = (this.getChild("n20"));
- this.n21 = (this.getChild("n21"));
- this.n26 = (this.getChild("n26"));
- this.n27 = (this.getChild("n27"));
- this.shareTxt = (this.getChild("shareTxt"));
- this.n32 = (this.getChild("n32"));
- this.n38 = (this.getChild("n38"));
- this.n39 = (this.getChild("n39"));
- this.n44 = (this.getChild("n44"));
- this.diamondTxt = (this.getChild("diamondTxt"));
- this.n41 = (this.getChild("n41"));
- this.n45 = (this.getChild("n45"));
- this.n47 = (this.getChild("n47"));
- this.n48 = (this.getChild("n48"));
- this.randTxt = (this.getChild("randTxt"));
- this.n50 = (this.getChild("n50"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
- class ui_dh_zs1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zs1"));
- }
- onConstruct() {
- this.n10 = (this.getChild("n10"));
- this.n9 = (this.getChild("n9"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n8 = (this.getChild("n8"));
- this.n11 = (this.getChild("n11"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
- class ui_dh_zs1_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.n1 = (this.getChild("n1"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
- class ui_hb_zs2 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "hb_zs2"));
- }
- onConstruct() {
- this.n20 = (this.getChild("n20"));
- this.n21 = (this.getChild("n21"));
- this.n26 = (this.getChild("n26"));
- this.n27 = (this.getChild("n27"));
- this.n32 = (this.getChild("n32"));
- this.n38 = (this.getChild("n38"));
- this.n39 = (this.getChild("n39"));
- this.n44 = (this.getChild("n44"));
- this.diamondTxt = (this.getChild("diamondTxt"));
- this.n41 = (this.getChild("n41"));
- this.n45 = (this.getChild("n45"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
- class ui_hb_zs3 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "hb_zs3"));
- }
- onConstruct() {
- this.n20 = (this.getChild("n20"));
- this.n21 = (this.getChild("n21"));
- this.n26 = (this.getChild("n26"));
- this.n27 = (this.getChild("n27"));
- this.n32 = (this.getChild("n32"));
- this.n38 = (this.getChild("n38"));
- this.n47 = (this.getChild("n47"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
- class ui_dh_zs2 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zs2"));
- }
- onConstruct() {
- this.n10 = (this.getChild("n10"));
- this.n9 = (this.getChild("n9"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n8 = (this.getChild("n8"));
- this.n11 = (this.getChild("n11"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
- class ui_dh_zs2_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.n1 = (this.getChild("n1"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
- class ui_dh_zs3 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zs3"));
- }
- onConstruct() {
- this.n10 = (this.getChild("n10"));
- this.n9 = (this.getChild("n9"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n8 = (this.getChild("n8"));
- this.n11 = (this.getChild("n11"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
- class ui_dh_zs3_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.n1 = (this.getChild("n1"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
- class ui_Component107 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component107"));
- }
- onConstruct() {
- this.n18 = (this.getChild("n18"));
- this.n19 = (this.getChild("n19"));
- this.n20 = (this.getChild("n20"));
- this.n21 = (this.getChild("n21"));
- this.n22 = (this.getChild("n22"));
- this.levelTxt = (this.getChild("levelTxt"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
- class ui_box_com1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "box_com1"));
- }
- onConstruct() {
- this.n14 = (this.getChild("n14"));
- this.n6 = (this.getChild("n6"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
- class ui_box_com2 extends fgui.GProgressBar {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "box_com2"));
- }
- onConstruct() {
- this.bg0 = (this.getChild("bg0"));
- this.bg = (this.getChild("bg"));
- this.bar = (this.getChild("bar"));
- this.n7 = (this.getChild("n7"));
- this.n8 = (this.getChild("n8"));
- this.n10 = (this.getChild("n10"));
- this.n11 = (this.getChild("n11"));
- this.n12 = (this.getChild("n12"));
- }
- }
- ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
- class ui_box_com4 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "box_com4"));
- }
- onConstruct() {
- this.n8 = (this.getChild("n8"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
- class ui_box_com3 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "box_com3"));
- }
- onConstruct() {
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.t0 = this.getTransition("t0");
- this.t1 = this.getTransition("t1");
- }
- }
- ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
- class ui_Component97 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component97"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n46 = (this.getChild("n46"));
- this.diamondNode = (this.getChild("diamondNode"));
- this.coinNode = (this.getChild("coinNode"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
- class ui_Component98 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component98"));
- }
- onConstruct() {
- this.n8 = (this.getChild("n8"));
- this.n40 = (this.getChild("n40"));
- }
- }
- ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
- class ui_Component28_11 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component28_11"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n12 = (this.getChild("n12"));
- this.n17 = (this.getChild("n17"));
- this.n13 = (this.getChild("n13"));
- this.diamondTxt = (this.getChild("diamondTxt"));
- this.n15 = (this.getChild("n15"));
- this.n16 = (this.getChild("n16"));
- }
- }
- ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
- class ui_Component58_11 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component58_11"));
- }
- onConstruct() {
- this.n23 = (this.getChild("n23"));
- this.n41 = (this.getChild("n41"));
- this.myList = (this.getChild("myList"));
- this.n45 = (this.getChild("n45"));
- this.n44 = (this.getChild("n44"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
- class ui_Component100 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component100"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n75 = (this.getChild("n75"));
- this.n76 = (this.getChild("n76"));
- this.n80 = (this.getChild("n80"));
- this.txt = (this.getChild("txt"));
- this.spineRoot = (this.getChild("spineRoot"));
- }
- }
- ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
- class ui_Component101 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component101"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n36 = (this.getChild("n36"));
- this.n35 = (this.getChild("n35"));
- this.n33 = (this.getChild("n33"));
- this.n34 = (this.getChild("n34"));
- }
- }
- ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
- class ui_Component53 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component53"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n7 = (this.getChild("n7"));
- this.n8 = (this.getChild("n8"));
- this.n9 = (this.getChild("n9"));
- this.n10 = (this.getChild("n10"));
- this.n11 = (this.getChild("n11"));
- this.n12 = (this.getChild("n12"));
- this.n13 = (this.getChild("n13"));
- this.n14 = (this.getChild("n14"));
- this.n15 = (this.getChild("n15"));
- this.n16 = (this.getChild("n16"));
- this.n19 = (this.getChild("n19"));
- this.n20 = (this.getChild("n20"));
- this.n21 = (this.getChild("n21"));
- this.n22 = (this.getChild("n22"));
- this.n23 = (this.getChild("n23"));
- this.n24 = (this.getChild("n24"));
- this.n25 = (this.getChild("n25"));
- this.n26 = (this.getChild("n26"));
- this.n27 = (this.getChild("n27"));
- this.n28 = (this.getChild("n28"));
- this.n29 = (this.getChild("n29"));
- this.n30 = (this.getChild("n30"));
- this.n31 = (this.getChild("n31"));
- this.n32 = (this.getChild("n32"));
- this.n33 = (this.getChild("n33"));
- this.n34 = (this.getChild("n34"));
- this.n35 = (this.getChild("n35"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component53.URL = "ui://isxx5ak7g1ie43u";
- class ui_Component58 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component58"));
- }
- onConstruct() {
- this.n23 = (this.getChild("n23"));
- this.n41 = (this.getChild("n41"));
- this.n8 = (this.getChild("n8"));
- this.skillList = (this.getChild("skillList"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component58.URL = "ui://isxx5ak7gg0z445";
- class ui_Component59 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component59"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.msgTxt = (this.getChild("msgTxt"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component59.URL = "ui://isxx5ak7gg0z446";
- class ui_RulerNode extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "RulerNode"));
- }
- onConstruct() {
- this.n6 = (this.getChild("n6"));
- this.n4 = (this.getChild("n4"));
- this.img1 = (this.getChild("img1"));
- this.img2 = (this.getChild("img2"));
- }
- }
- ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
- class ui_Component108 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component108"));
- }
- onConstruct() {
- this.n19 = (this.getChild("n19"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
- class ui_Component63 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component63"));
- }
- onConstruct() {
- this.n66 = (this.getChild("n66"));
- this.n56 = (this.getChild("n56"));
- this.n63 = (this.getChild("n63"));
- this.n65 = (this.getChild("n65"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component63.URL = "ui://isxx5ak7h657452";
- class ui_topNode extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "topNode"));
- }
- onConstruct() {
- this.selfProgress = (this.getChild("selfProgress"));
- this.aiProgress = (this.getChild("aiProgress"));
- this.selfKuang = (this.getChild("selfKuang"));
- this.aiKuang = (this.getChild("aiKuang"));
- this.selfHeadLoader = (this.getChild("selfHeadLoader"));
- this.aiHeadLoader = (this.getChild("aiHeadLoader"));
- this.n33 = (this.getChild("n33"));
- this.n34 = (this.getChild("n34"));
- this.selfNameTxt = (this.getChild("selfNameTxt"));
- this.aiNameTxt = (this.getChild("aiNameTxt"));
- this.selfBallList = (this.getChild("selfBallList"));
- this.aiBallList = (this.getChild("aiBallList"));
- this.middleNode = (this.getChild("middleNode"));
- this.selfScoreTxt = (this.getChild("selfScoreTxt"));
- this.aiScoreTxt = (this.getChild("aiScoreTxt"));
- this.scoreNode = (this.getChild("scoreNode"));
- this.selfTips = (this.getChild("selfTips"));
- this.aiTips = (this.getChild("aiTips"));
- }
- }
- ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
- class ui_selfProgress extends fgui.GProgressBar {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "selfProgress"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.bar = (this.getChild("bar"));
- }
- }
- ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
- class ui_aiProgress extends fgui.GProgressBar {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "aiProgress"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.bar = (this.getChild("bar"));
- }
- }
- ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
- class ui_ballDisplay extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ballDisplay"));
- }
- onConstruct() {
- this.myImg = (this.getChild("myImg"));
- }
- }
- ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
- class ui_moveNode extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "moveNode"));
- }
- onConstruct() {
- this.n8 = (this.getChild("n8"));
- this.finger = (this.getChild("finger"));
- }
- }
- ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
- class ui_cancelBtn extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "cancelBtn"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- }
- }
- ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
- class ui_shareBtn extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "shareBtn"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n2 = (this.getChild("n2"));
- this.n1 = (this.getChild("n1"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- }
- }
- ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
- class ui_share2Btn extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "share2Btn"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- }
- }
- ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
- class ui_rodMethodNode extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "rodMethodNode"));
- }
- onConstruct() {
- this.bg = (this.getChild("bg"));
- this.dot = (this.getChild("dot"));
- }
- }
- ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
- class ui_sureBtn extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "sureBtn"));
- }
- onConstruct() {
- this.n2 = (this.getChild("n2"));
- this.n1 = (this.getChild("n1"));
- }
- }
- ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
- class ui_Component18 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component18"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.nameTxt = (this.getChild("nameTxt"));
- this.headImg = (this.getChild("headImg"));
- this.n24 = (this.getChild("n24"));
- this.skillImg = (this.getChild("skillImg"));
- this.skillTxt = (this.getChild("skillTxt"));
- }
- }
- ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
- class ui_Component45 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component45"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n40 = (this.getChild("n40"));
- this.n41 = (this.getChild("n41"));
- this.targetScoreTxt = (this.getChild("targetScoreTxt"));
- this.n42 = (this.getChild("n42"));
- this.awardTxt = (this.getChild("awardTxt"));
- this.n44 = (this.getChild("n44"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component45.URL = "ui://isxx5ak7i4k2438";
- class ui_emotionDisplay extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "emotionDisplay"));
- }
- onConstruct() {
- this.myIcon = (this.getChild("myIcon"));
- }
- }
- ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
- class ui_Component49 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component49"));
- }
- onConstruct() {
- this.n69 = (this.getChild("n69"));
- this.n56 = (this.getChild("n56"));
- }
- }
- ui_Component49.URL = "ui://isxx5ak7i4k243n";
- class ui_Component50 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component50"));
- }
- onConstruct() {
- this.n54 = (this.getChild("n54"));
- this.n65 = (this.getChild("n65"));
- }
- }
- ui_Component50.URL = "ui://isxx5ak7i4k243o";
- class ui_Component51 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component51"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n51 = (this.getChild("n51"));
- this.n54 = (this.getChild("n54"));
- }
- }
- ui_Component51.URL = "ui://isxx5ak7i4k243p";
- class ui_Button5 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Button5"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n0 = (this.getChild("n0"));
- this.n2 = (this.getChild("n2"));
- }
- }
- ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
- class ui_Component124 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component124"));
- }
- onConstruct() {
- this.n22 = (this.getChild("n22"));
- this.shareNode = (this.getChild("shareNode"));
- }
- }
- ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
- class ui_Component125 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component125"));
- }
- onConstruct() {
- this.n29 = (this.getChild("n29"));
- this.coinTxt = (this.getChild("coinTxt"));
- }
- }
- ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
- class ui_Component52 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component52"));
- }
- onConstruct() {
- this.n35 = (this.getChild("n35"));
- this.n36 = (this.getChild("n36"));
- }
- }
- ui_Component52.URL = "ui://isxx5ak7ihpy43t";
- class ui_drawBtn extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "drawBtn"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n2 = (this.getChild("n2"));
- this.n1 = (this.getChild("n1"));
- this.n5 = (this.getChild("n5"));
- }
- }
- ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
- class ui_Component43 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component43"));
- }
- onConstruct() {
- this.n49 = (this.getChild("n49"));
- }
- }
- ui_Component43.URL = "ui://isxx5ak7iveg434";
- class ui_wordsDisplay extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "wordsDisplay"));
- }
- onConstruct() {
- this.txt = (this.getChild("txt"));
- this.n63 = (this.getChild("n63"));
- }
- }
- ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
- class ui_Component_phb extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component_phb"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- }
- }
- ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
- class ui_Component3 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component3"));
- }
- onConstruct() {
- this.n26 = (this.getChild("n26"));
- this.n24 = (this.getChild("n24"));
- this.nameTxt = (this.getChild("nameTxt"));
- this.headRoot = (this.getChild("headRoot"));
- }
- }
- ui_Component3.URL = "ui://isxx5ak7ixm43xh";
- class ui_Component4 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component4"));
- }
- onConstruct() {
- this.headImg = (this.getChild("headImg"));
- }
- }
- ui_Component4.URL = "ui://isxx5ak7ixm43xi";
- class ui_Component7 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component7"));
- }
- onConstruct() {
- this.n17 = (this.getChild("n17"));
- }
- }
- ui_Component7.URL = "ui://isxx5ak7ixm43xq";
- class ui_Component8 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component8"));
- }
- onConstruct() {
- this.n19 = (this.getChild("n19"));
- }
- }
- ui_Component8.URL = "ui://isxx5ak7ixm43xr";
- class ui_Component10 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component10"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n40 = (this.getChild("n40"));
- }
- }
- ui_Component10.URL = "ui://isxx5ak7ixm43xt";
- class ui_Component11 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component11"));
- }
- onConstruct() {
- this.n34 = (this.getChild("n34"));
- }
- }
- ui_Component11.URL = "ui://isxx5ak7ixm43xu";
- class ui_Component12 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component12"));
- }
- onConstruct() {
- this.n35 = (this.getChild("n35"));
- }
- }
- ui_Component12.URL = "ui://isxx5ak7ixm43xv";
- class ui_Component13 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component13"));
- }
- onConstruct() {
- this.n27 = (this.getChild("n27"));
- this.n36 = (this.getChild("n36"));
- }
- }
- ui_Component13.URL = "ui://isxx5ak7ixm43xw";
- class ui_dh_js_tuowei extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
- }
- onConstruct() {
- this.n19 = (this.getChild("n19"));
- this.n18 = (this.getChild("n18"));
- this.n0 = (this.getChild("n0"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n8 = (this.getChild("n8"));
- this.n9 = (this.getChild("n9"));
- this.n10 = (this.getChild("n10"));
- this.n11 = (this.getChild("n11"));
- this.n12 = (this.getChild("n12"));
- this.n13 = (this.getChild("n13"));
- this.n14 = (this.getChild("n14"));
- this.n15 = (this.getChild("n15"));
- this.n20 = (this.getChild("n20"));
- this.t0 = this.getTransition("t0");
- this.t1 = this.getTransition("t1");
- }
- }
- ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
- class ui_dh_js_tw_g extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
- class ui_dh_js_xingxing extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n0 = (this.getChild("n0"));
- this.t2 = this.getTransition("t2");
- this.t1 = this.getTransition("t1");
- }
- }
- ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
- class ui_dh_zy_jiazai extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n8 = (this.getChild("n8"));
- this.n7 = (this.getChild("n7"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
- class ui_dh_js_xingxing2 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n3 = (this.getChild("n3"));
- this.n5 = (this.getChild("n5"));
- this.n4 = (this.getChild("n4"));
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- }
- }
- ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
- class ui_dh_js_tuowei2 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
- }
- onConstruct() {
- this.n19 = (this.getChild("n19"));
- this.n21 = (this.getChild("n21"));
- this.n0 = (this.getChild("n0"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n8 = (this.getChild("n8"));
- this.n9 = (this.getChild("n9"));
- this.n10 = (this.getChild("n10"));
- this.n11 = (this.getChild("n11"));
- this.n12 = (this.getChild("n12"));
- this.n13 = (this.getChild("n13"));
- this.n14 = (this.getChild("n14"));
- this.n15 = (this.getChild("n15"));
- this.n23 = (this.getChild("n23"));
- this.t0 = this.getTransition("t0");
- this.t1 = this.getTransition("t1");
- }
- }
- ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
- class ui_dh_js_tw_g_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
- class ui_dh_js_shibai_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
- }
- onConstruct() {
- this.n4 = (this.getChild("n4"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.idle = this.getTransition("idle");
- this.attack = this.getTransition("attack");
- }
- }
- ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
- class ui_special extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "special"));
- }
- onConstruct() {
- this.n18 = (this.getChild("n18"));
- this.n19 = (this.getChild("n19"));
- this.n20 = (this.getChild("n20"));
- this.n21 = (this.getChild("n21"));
- this.n22 = (this.getChild("n22"));
- this.levelTxt = (this.getChild("levelTxt"));
- this.n24 = (this.getChild("n24"));
- this.n25 = (this.getChild("n25"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_special.URL = "ui://isxx5ak7j979v4i6";
- class ui_Component145 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component145"));
- }
- onConstruct() {
- this.guanyuNode = (this.getChild("guanyuNode"));
- }
- }
- ui_Component145.URL = "ui://isxx5ak7jaakv51f";
- class ui_longBtn extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "longBtn"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n2 = (this.getChild("n2"));
- this.n1 = (this.getChild("n1"));
- this.n4 = (this.getChild("n4"));
- }
- }
- ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
- class ui_Component146 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component146"));
- }
- onConstruct() {
- this.n89 = (this.getChild("n89"));
- this.n90 = (this.getChild("n90"));
- this.guideBtn = (this.getChild("guideBtn"));
- }
- }
- ui_Component146.URL = "ui://isxx5ak7jaakv55w";
- class ui_Component146_11 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component146_11"));
- }
- onConstruct() {
- this.n89 = (this.getChild("n89"));
- this.n90 = (this.getChild("n90"));
- this.guideBtn = (this.getChild("guideBtn"));
- }
- }
- ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
- class ui_Component111_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component111_1"));
- }
- onConstruct() {
- this.n68 = (this.getChild("n68"));
- this.myMask = (this.getChild("myMask"));
- }
- }
- ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
- class ui_Component64_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component64_1"));
- }
- onConstruct() {
- this.n57 = (this.getChild("n57"));
- this.n54 = (this.getChild("n54"));
- this.n55 = (this.getChild("n55"));
- this.n56 = (this.getChild("n56"));
- this.t1 = this.getTransition("t1");
- }
- }
- ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
- class ui_ModeSelection_com123 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
- }
- onConstruct() {
- this.type1 = (this.getChild("type1"));
- this.type2 = (this.getChild("type2"));
- this.type3 = (this.getChild("type3"));
- this.n38 = (this.getChild("n38"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
- class ui_Component132_2 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component132_2"));
- }
- onConstruct() {
- this.n25 = (this.getChild("n25"));
- this.n26 = (this.getChild("n26"));
- this.n27 = (this.getChild("n27"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
- class ui_UIPower$1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIPower"));
- }
- onConstruct() {
- this.n11 = (this.getChild("n11"));
- this.myNode = (this.getChild("myNode"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
- class ui_Component133 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component133"));
- }
- onConstruct() {
- this.n29 = (this.getChild("n29"));
- this.n30 = (this.getChild("n30"));
- }
- }
- ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
- class ui_Component134 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component134"));
- }
- onConstruct() {
- this.n30 = (this.getChild("n30"));
- this.n31 = (this.getChild("n31"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
- class ui_Component135 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component135"));
- }
- onConstruct() {
- this.n30 = (this.getChild("n30"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
- class ui_Component137 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component137"));
- }
- onConstruct() {
- this.n28 = (this.getChild("n28"));
- this.n29 = (this.getChild("n29"));
- this.n30 = (this.getChild("n30"));
- this.n32 = (this.getChild("n32"));
- }
- }
- ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
- class ui_dh_zuanshi extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n0 = (this.getChild("n0"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- }
- }
- ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
- class ui_Component138 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component138"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
- class ui_Component139 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component139"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
- class ui_Component140 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component140"));
- }
- onConstruct() {
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
- class ui_Component141 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component141"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
- class ui_powerNode extends fgui.GProgressBar {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "powerNode"));
- }
- onConstruct() {
- this.n2 = (this.getChild("n2"));
- this.bar_v = (this.getChild("bar_v"));
- this.showImg = (this.getChild("showImg"));
- this.n12 = (this.getChild("n12"));
- }
- }
- ui_powerNode.URL = "ui://isxx5ak7kt443qh";
- class ui_dh_jingbi1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n8 = (this.getChild("n8"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
- class ui_Component94 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component94"));
- }
- onConstruct() {
- this.n77 = (this.getChild("n77"));
- }
- }
- ui_Component94.URL = "ui://isxx5ak7l1574b6";
- class ui_Component95 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component95"));
- }
- onConstruct() {
- this.n77 = (this.getChild("n77"));
- }
- }
- ui_Component95.URL = "ui://isxx5ak7l1574b7";
- class ui_Component126 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component126"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.normalBtn = (this.getChild("normalBtn"));
- this.tripleBtn = (this.getChild("tripleBtn"));
- }
- }
- ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
- class ui_Component60 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component60"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n48 = (this.getChild("n48"));
- this.womanTxt = (this.getChild("womanTxt"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component60.URL = "ui://isxx5ak7llhd44g";
- class ui_Component98_3 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component98_3"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n8 = (this.getChild("n8"));
- this.n41 = (this.getChild("n41"));
- this.n40 = (this.getChild("n40"));
- }
- }
- ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
- class ui_ModeSelection_com1 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
- }
- onConstruct() {
- this.n34 = (this.getChild("n34"));
- this.n36 = (this.getChild("n36"));
- this.n22 = (this.getChild("n22"));
- this.n20 = (this.getChild("n20"));
- this.n23 = (this.getChild("n23"));
- this.n24 = (this.getChild("n24"));
- this.n26 = (this.getChild("n26"));
- this.n33 = (this.getChild("n33"));
- this.coinImg = (this.getChild("coinImg"));
- this.need = (this.getChild("need"));
- this.n35 = (this.getChild("n35"));
- this.n29 = (this.getChild("n29"));
- this.tipsTxt = (this.getChild("tipsTxt"));
- this.n30 = (this.getChild("n30"));
- this.peopleTxt = (this.getChild("peopleTxt"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
- class ui_ModeSelection_com2 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
- }
- onConstruct() {
- this.n36 = (this.getChild("n36"));
- this.n34 = (this.getChild("n34"));
- this.n22 = (this.getChild("n22"));
- this.n20 = (this.getChild("n20"));
- this.n23 = (this.getChild("n23"));
- this.n24 = (this.getChild("n24"));
- this.n26 = (this.getChild("n26"));
- this.n33 = (this.getChild("n33"));
- this.coinImg = (this.getChild("coinImg"));
- this.need = (this.getChild("need"));
- this.n35 = (this.getChild("n35"));
- this.n29 = (this.getChild("n29"));
- this.tipsTxt = (this.getChild("tipsTxt"));
- this.n30 = (this.getChild("n30"));
- this.peopleTxt = (this.getChild("peopleTxt"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
- class ui_ModeSelection_com3 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
- }
- onConstruct() {
- this.n34 = (this.getChild("n34"));
- this.n36 = (this.getChild("n36"));
- this.n22 = (this.getChild("n22"));
- this.n20 = (this.getChild("n20"));
- this.n23 = (this.getChild("n23"));
- this.n24 = (this.getChild("n24"));
- this.n26 = (this.getChild("n26"));
- this.n33 = (this.getChild("n33"));
- this.coinImg = (this.getChild("coinImg"));
- this.need = (this.getChild("need"));
- this.n35 = (this.getChild("n35"));
- this.n29 = (this.getChild("n29"));
- this.tipsTxt = (this.getChild("tipsTxt"));
- this.n30 = (this.getChild("n30"));
- this.peopleTxt = (this.getChild("peopleTxt"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
- class ui_Invitation_com1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Invitation_com1"));
- }
- onConstruct() {
- this.n14 = (this.getChild("n14"));
- this.n13 = (this.getChild("n13"));
- this.n3 = (this.getChild("n3"));
- this.n1 = (this.getChild("n1"));
- this.n6 = (this.getChild("n6"));
- this.n7 = (this.getChild("n7"));
- this.enterBtn = (this.getChild("enterBtn"));
- this.n11 = (this.getChild("n11"));
- this.n12 = (this.getChild("n12"));
- this.n15 = (this.getChild("n15"));
- this.t0 = this.getTransition("t0");
- this.t1 = this.getTransition("t1");
- }
- }
- ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
- class ui_Component87_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component87_1"));
- }
- onConstruct() {
- this.n74 = (this.getChild("n74"));
- this.n73 = (this.getChild("n73"));
- this.ballTxt = (this.getChild("ballTxt"));
- this.n76 = (this.getChild("n76"));
- this.helpLineBtn = (this.getChild("helpLineBtn"));
- this.levelTxt = (this.getChild("levelTxt"));
- this.n87 = (this.getChild("n87"));
- this.n84 = (this.getChild("n84"));
- this.hpTxt = (this.getChild("hpTxt"));
- this.n89 = (this.getChild("n89"));
- this.tipsTxt = (this.getChild("tipsTxt"));
- }
- }
- ui_Component87_1.URL = "ui://isxx5ak7luq648t";
- class ui_sqg1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "sqg1"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n0 = (this.getChild("n0"));
- }
- }
- ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
- class ui_sqg2 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "sqg2"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n0 = (this.getChild("n0"));
- }
- }
- ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
- class ui_sqg3 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "sqg3"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n0 = (this.getChild("n0"));
- }
- }
- ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
- class ui_sqg4 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "sqg4"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n0 = (this.getChild("n0"));
- }
- }
- ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
- class ui_Component36 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component36"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n53 = (this.getChild("n53"));
- this.n56 = (this.getChild("n56"));
- }
- }
- ui_Component36.URL = "ui://isxx5ak7mnrs42r";
- class ui_Component37 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component37"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n52 = (this.getChild("n52"));
- this.n54 = (this.getChild("n54"));
- }
- }
- ui_Component37.URL = "ui://isxx5ak7mnrs42s";
- class ui_UISetting extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UISetting"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n4 = (this.getChild("n4"));
- this.soundBtn = (this.getChild("soundBtn"));
- this.shakeBtn = (this.getChild("shakeBtn"));
- this.clickNode = (this.getChild("clickNode"));
- this.xyBtn = (this.getChild("xyBtn"));
- }
- }
- ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
- class ui_Component39 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component39"));
- }
- onConstruct() {
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n7 = (this.getChild("n7"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component39.URL = "ui://isxx5ak7mnrs42v";
- class ui_Component40 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component40"));
- }
- onConstruct() {
- this.n46 = (this.getChild("n46"));
- this.n47 = (this.getChild("n47"));
- }
- }
- ui_Component40.URL = "ui://isxx5ak7mnrs42y";
- class ui_Component41 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component41"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n0 = (this.getChild("n0"));
- this.titleTxt = (this.getChild("titleTxt"));
- this.n2 = (this.getChild("n2"));
- this.msgTips = (this.getChild("msgTips"));
- this.numTxt = (this.getChild("numTxt"));
- this.n18 = (this.getChild("n18"));
- this.cancelBtn = (this.getChild("cancelBtn"));
- this.videoBtn = (this.getChild("videoBtn"));
- this.n10 = (this.getChild("n10"));
- }
- }
- ui_Component41.URL = "ui://isxx5ak7mnrs430";
- class ui_Component42 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component42"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.tipsTxt = (this.getChild("tipsTxt"));
- this.cancelBtn = (this.getChild("cancelBtn"));
- this.sureBtn = (this.getChild("sureBtn"));
- this.n11 = (this.getChild("n11"));
- this.n13 = (this.getChild("n13"));
- this.n14 = (this.getChild("n14"));
- this.womanTxt = (this.getChild("womanTxt"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component42.URL = "ui://isxx5ak7mnrs431";
- class ui_dh_js_shengli extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n7 = (this.getChild("n7"));
- this.n8 = (this.getChild("n8"));
- this.attack = this.getTransition("attack");
- this.idle = this.getTransition("idle");
- }
- }
- ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
- class ui_dh_js_shengli_g extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.n1 = (this.getChild("n1"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
- class ui_dh_js_shibai extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.idle = this.getTransition("idle");
- this.attack = this.getTransition("attack");
- }
- }
- ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
- class ui_dh_zy_ganfa extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- }
- }
- ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
- class ui_dh_zy_sc_guang extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n2 = (this.getChild("n2"));
- }
- }
- ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
- class ui_dh_zy_shangcheng extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n3 = (this.getChild("n3"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
- class ui_dh_zy_wanfa extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- }
- }
- ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
- class ui_Component53_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component53_1"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n7 = (this.getChild("n7"));
- this.n8 = (this.getChild("n8"));
- this.n9 = (this.getChild("n9"));
- this.n10 = (this.getChild("n10"));
- this.n11 = (this.getChild("n11"));
- this.n12 = (this.getChild("n12"));
- this.n13 = (this.getChild("n13"));
- this.n14 = (this.getChild("n14"));
- this.n15 = (this.getChild("n15"));
- this.n16 = (this.getChild("n16"));
- this.n19 = (this.getChild("n19"));
- this.n20 = (this.getChild("n20"));
- this.n21 = (this.getChild("n21"));
- this.n22 = (this.getChild("n22"));
- this.n23 = (this.getChild("n23"));
- this.n24 = (this.getChild("n24"));
- this.n25 = (this.getChild("n25"));
- this.n26 = (this.getChild("n26"));
- this.n27 = (this.getChild("n27"));
- this.n28 = (this.getChild("n28"));
- this.n29 = (this.getChild("n29"));
- this.n30 = (this.getChild("n30"));
- this.n31 = (this.getChild("n31"));
- this.n32 = (this.getChild("n32"));
- this.n33 = (this.getChild("n33"));
- this.n34 = (this.getChild("n34"));
- this.n35 = (this.getChild("n35"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
- class ui_Component30 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component30"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n46 = (this.getChild("n46"));
- this.n47 = (this.getChild("n47"));
- this.numTxt = (this.getChild("numTxt"));
- this.n50 = (this.getChild("n50"));
- this.n53 = (this.getChild("n53"));
- this.n54 = (this.getChild("n54"));
- this.n55 = (this.getChild("n55"));
- this.n56 = (this.getChild("n56"));
- }
- }
- ui_Component30.URL = "ui://isxx5ak7p4tr41y";
- class ui_Component30_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component30_1"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n46 = (this.getChild("n46"));
- this.n47 = (this.getChild("n47"));
- this.numTxt = (this.getChild("numTxt"));
- this.n50 = (this.getChild("n50"));
- this.n51 = (this.getChild("n51"));
- this.n52 = (this.getChild("n52"));
- this.n53 = (this.getChild("n53"));
- this.n54 = (this.getChild("n54"));
- }
- }
- ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
- class ui_Component31 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component31"));
- }
- onConstruct() {
- this.n55 = (this.getChild("n55"));
- this.n54 = (this.getChild("n54"));
- this.conditionTxt = (this.getChild("conditionTxt"));
- this.n57 = (this.getChild("n57"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component31.URL = "ui://isxx5ak7p4tr423";
- class ui_Component32 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component32"));
- }
- onConstruct() {
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n7 = (this.getChild("n7"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component32.URL = "ui://isxx5ak7p4tr42f";
- class ui_AwardItem extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "AwardItem"));
- }
- onConstruct() {
- this.n9 = (this.getChild("n9"));
- this.myIcon = (this.getChild("myIcon"));
- this.numTxt = (this.getChild("numTxt"));
- this.nameTxt = (this.getChild("nameTxt"));
- this.n16 = (this.getChild("n16"));
- this.n17 = (this.getChild("n17"));
- }
- }
- ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
- class ui_ranking_com1 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ranking_com1"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n49 = (this.getChild("n49"));
- this.n18 = (this.getChild("n18"));
- this.n46 = (this.getChild("n46"));
- this.n48 = (this.getChild("n48"));
- this.n50 = (this.getChild("n50"));
- }
- }
- ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
- class ui_ranking_com2 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ranking_com2"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n49 = (this.getChild("n49"));
- this.n18 = (this.getChild("n18"));
- this.n46 = (this.getChild("n46"));
- this.n48 = (this.getChild("n48"));
- this.n50 = (this.getChild("n50"));
- }
- }
- ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
- class ui_ranking_com3 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ranking_com3"));
- }
- onConstruct() {
- this.n17 = (this.getChild("n17"));
- this.myIcon = (this.getChild("myIcon"));
- }
- }
- ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
- class ui_ranking_com4 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ranking_com4"));
- }
- onConstruct() {
- this.n16 = (this.getChild("n16"));
- this.head = (this.getChild("head"));
- }
- }
- ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
- class ui_ranking_com5 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ranking_com5"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.c2 = this.getController("c2");
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.levelBtn = (this.getChild("levelBtn"));
- this.starBtn = (this.getChild("starBtn"));
- this.n23 = (this.getChild("n23"));
- this.n24 = (this.getChild("n24"));
- this.n25 = (this.getChild("n25"));
- this.myList = (this.getChild("myList"));
- this.selfNode = (this.getChild("selfNode"));
- this.n9 = (this.getChild("n9"));
- this.n12 = (this.getChild("n12"));
- this.n13 = (this.getChild("n13"));
- this.n14 = (this.getChild("n14"));
- this.n39 = (this.getChild("n39"));
- this.n41 = (this.getChild("n41"));
- this.n42 = (this.getChild("n42"));
- this.n45 = (this.getChild("n45"));
- this.changeBtn = (this.getChild("changeBtn"));
- this.closeBtn = (this.getChild("closeBtn"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
- class ui_RankItem extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "RankItem"));
- }
- onConstruct() {
- this.n10 = (this.getChild("n10"));
- this.n11 = (this.getChild("n11"));
- this.rankTxt = (this.getChild("rankTxt"));
- this.headNode = (this.getChild("headNode"));
- this.nameTxt = (this.getChild("nameTxt"));
- this.n19 = (this.getChild("n19"));
- this.valueTxt = (this.getChild("valueTxt"));
- this.img1 = (this.getChild("img1"));
- this.img2 = (this.getChild("img2"));
- this.img3 = (this.getChild("img3"));
- }
- }
- ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
- class ui_ranking_com9 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ranking_com9"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n27 = (this.getChild("n27"));
- this.n28 = (this.getChild("n28"));
- this.headNode = (this.getChild("headNode"));
- this.rankTxt = (this.getChild("rankTxt"));
- this.nameTxt = (this.getChild("nameTxt"));
- this.n34 = (this.getChild("n34"));
- this.valueTxt = (this.getChild("valueTxt"));
- this.n36 = (this.getChild("n36"));
- this.n37 = (this.getChild("n37"));
- this.n38 = (this.getChild("n38"));
- this.n39 = (this.getChild("n39"));
- this.n40 = (this.getChild("n40"));
- }
- }
- ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
- class ui_ranking_com10 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ranking_com10"));
- }
- onConstruct() {
- this.n23 = (this.getChild("n23"));
- this.n24 = (this.getChild("n24"));
- }
- }
- ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
- class ui_ranking_com11 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ranking_com11"));
- }
- onConstruct() {
- this.n24 = (this.getChild("n24"));
- this.n25 = (this.getChild("n25"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
- class ui_ranking_com13 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ranking_com13"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n44 = (this.getChild("n44"));
- this.n45 = (this.getChild("n45"));
- this.n46 = (this.getChild("n46"));
- }
- }
- ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
- class ui_Component122 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component122"));
- }
- onConstruct() {
- this.gameNode3 = (this.getChild("gameNode3"));
- }
- }
- ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
- class ui_skillItem extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "skillItem"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n31 = (this.getChild("n31"));
- this.n6 = (this.getChild("n6"));
- this.skillImg = (this.getChild("skillImg"));
- this.nameTxt = (this.getChild("nameTxt"));
- this.levelTxt = (this.getChild("levelTxt"));
- this.n28 = (this.getChild("n28"));
- this.describeTxt = (this.getChild("describeTxt"));
- this.n32 = (this.getChild("n32"));
- this.mutiBtn = (this.getChild("mutiBtn"));
- this.tryNode = (this.getChild("tryNode"));
- this.normalBtn = (this.getChild("normalBtn"));
- this.startBtn = (this.getChild("startBtn"));
- this.n42 = (this.getChild("n42"));
- this.n43 = (this.getChild("n43"));
- this.n44 = (this.getChild("n44"));
- }
- }
- ui_skillItem.URL = "ui://isxx5ak7qlo041q";
- class ui_Component26 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component26"));
- }
- onConstruct() {
- this.n11 = (this.getChild("n11"));
- this.n30 = (this.getChild("n30"));
- this.n34 = (this.getChild("n34"));
- }
- }
- ui_Component26.URL = "ui://isxx5ak7qlo041r";
- class ui_Component28 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component28"));
- }
- onConstruct() {
- this.n12 = (this.getChild("n12"));
- this.n31 = (this.getChild("n31"));
- this.curTxt = (this.getChild("curTxt"));
- this.n33 = (this.getChild("n33"));
- }
- }
- ui_Component28.URL = "ui://isxx5ak7qlo041t";
- class ui_Component1302 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component1302"));
- }
- onConstruct() {
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- }
- }
- ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
- class ui_Component113 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component113"));
- }
- onConstruct() {
- this.n85 = (this.getChild("n85"));
- this.n86 = (this.getChild("n86"));
- this.n77 = (this.getChild("n77"));
- this.n79 = (this.getChild("n79"));
- this.n80 = (this.getChild("n80"));
- this.n81 = (this.getChild("n81"));
- this.n82 = (this.getChild("n82"));
- this.n84 = (this.getChild("n84"));
- this.n87 = (this.getChild("n87"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
- class ui_Component114 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component114"));
- }
- onConstruct() {
- this.n77 = (this.getChild("n77"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
- class ui_Component115 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component115"));
- }
- onConstruct() {
- this.n83 = (this.getChild("n83"));
- this.fingerNode = (this.getChild("fingerNode"));
- this.n84 = (this.getChild("n84"));
- }
- }
- ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
- class ui_Component117 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component117"));
- }
- onConstruct() {
- this.n87 = (this.getChild("n87"));
- this.n88 = (this.getChild("n88"));
- this.n84 = (this.getChild("n84"));
- this.n85 = (this.getChild("n85"));
- this.n86 = (this.getChild("n86"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
- class ui_Component98_1 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component98_1"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n8 = (this.getChild("n8"));
- this.n41 = (this.getChild("n41"));
- this.n40 = (this.getChild("n40"));
- }
- }
- ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
- class ui_Component61 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component61"));
- }
- onConstruct() {
- this.n14 = (this.getChild("n14"));
- this.n6 = (this.getChild("n6"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component61.URL = "ui://isxx5ak7s8sz44h";
- class ui_Component62 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component62"));
- }
- onConstruct() {
- this.n66 = (this.getChild("n66"));
- this.n56 = (this.getChild("n56"));
- this.n63 = (this.getChild("n63"));
- this.n65 = (this.getChild("n65"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component62.URL = "ui://isxx5ak7s8sz44u";
- class ui_d3Root extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "d3Root"));
- }
- onConstruct() {
- }
- }
- ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
- class ui_d2Root extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "d2Root"));
- }
- onConstruct() {
- }
- }
- ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
- class ui_ballNode extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ballNode"));
- }
- onConstruct() {
- }
- }
- ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
- class ui_border extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "border"));
- }
- onConstruct() {
- this.bar1 = (this.getChild("bar1"));
- this.bar2 = (this.getChild("bar2"));
- this.bar3 = (this.getChild("bar3"));
- this.bar4 = (this.getChild("bar4"));
- this.bar5 = (this.getChild("bar5"));
- this.bar6 = (this.getChild("bar6"));
- this.circle1 = (this.getChild("circle1"));
- this.circle2 = (this.getChild("circle2"));
- this.circle3 = (this.getChild("circle3"));
- this.circle4 = (this.getChild("circle4"));
- this.circle5 = (this.getChild("circle5"));
- this.circle6 = (this.getChild("circle6"));
- this.n28 = (this.getChild("n28"));
- }
- }
- ui_border.URL = "ui://isxx5ak7sdh33qq";
- class ui_Component41_2 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component41_2"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n0 = (this.getChild("n0"));
- this.n2 = (this.getChild("n2"));
- this.n19 = (this.getChild("n19"));
- this.cancelBtn = (this.getChild("cancelBtn"));
- this.videoBtn = (this.getChild("videoBtn"));
- this.n9 = (this.getChild("n9"));
- this.n22 = (this.getChild("n22"));
- this.tipsTxt = (this.getChild("tipsTxt"));
- this.n23 = (this.getChild("n23"));
- this.n24 = (this.getChild("n24"));
- this.n26 = (this.getChild("n26"));
- this.n27 = (this.getChild("n27"));
- this.titleTxt = (this.getChild("titleTxt"));
- }
- }
- ui_Component41_2.URL = "ui://isxx5ak7trk948w";
- class ui_Component41_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component41_1"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n0 = (this.getChild("n0"));
- this.n2 = (this.getChild("n2"));
- this.cancelBtn = (this.getChild("cancelBtn"));
- this.videoBtn = (this.getChild("videoBtn"));
- this.n27 = (this.getChild("n27"));
- this.n30 = (this.getChild("n30"));
- this.n31 = (this.getChild("n31"));
- this.n32 = (this.getChild("n32"));
- this.n33 = (this.getChild("n33"));
- this.n34 = (this.getChild("n34"));
- this.n35 = (this.getChild("n35"));
- this.n36 = (this.getChild("n36"));
- this.n1 = (this.getChild("n1"));
- this.n37 = (this.getChild("n37"));
- this.t0 = this.getTransition("t0");
- this.t1 = this.getTransition("t1");
- this.t2 = this.getTransition("t2");
- this.t3 = this.getTransition("t3");
- }
- }
- ui_Component41_1.URL = "ui://isxx5ak7trk9491";
- class ui_againBtn extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "againBtn"));
- }
- onConstruct() {
- this.n2 = (this.getChild("n2"));
- this.n1 = (this.getChild("n1"));
- this.n5 = (this.getChild("n5"));
- }
- }
- ui_againBtn.URL = "ui://isxx5ak7u58xv509";
- class ui_Component118 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component118"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n14 = (this.getChild("n14"));
- this.n9 = (this.getChild("n9"));
- this.n10 = (this.getChild("n10"));
- this.diamondTxt = (this.getChild("diamondTxt"));
- this.n13 = (this.getChild("n13"));
- this.n15 = (this.getChild("n15"));
- }
- }
- ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
- class ui_Component119 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component119"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n13 = (this.getChild("n13"));
- this.n6 = (this.getChild("n6"));
- this.screenNode = (this.getChild("screenNode"));
- this.n15 = (this.getChild("n15"));
- this.closeBtn = (this.getChild("closeBtn"));
- this.share2Btn = (this.getChild("share2Btn"));
- this.shareBtn = (this.getChild("shareBtn"));
- this.tipsNode = (this.getChild("tipsNode"));
- this.awardNode = (this.getChild("awardNode"));
- }
- }
- ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
- class ui_Component132_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component132_1"));
- }
- onConstruct() {
- this.n25 = (this.getChild("n25"));
- this.n26 = (this.getChild("n26"));
- this.n27 = (this.getChild("n27"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
- class ui_SecretaryDisplay extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
- }
- onConstruct() {
- this.n2 = (this.getChild("n2"));
- this.levelTxt = (this.getChild("levelTxt"));
- this.n4 = (this.getChild("n4"));
- this.secretary = (this.getChild("secretary"));
- this.purchaseBtn = (this.getChild("purchaseBtn"));
- this.n16 = (this.getChild("n16"));
- this.n37 = (this.getChild("n37"));
- this.n41 = (this.getChild("n41"));
- this.n14 = (this.getChild("n14"));
- this.n17 = (this.getChild("n17"));
- this.heightTxt = (this.getChild("heightTxt"));
- this.n46 = (this.getChild("n46"));
- this.n36 = (this.getChild("n36"));
- this.n38 = (this.getChild("n38"));
- this.foodTxt = (this.getChild("foodTxt"));
- this.n47 = (this.getChild("n47"));
- this.n40 = (this.getChild("n40"));
- this.n42 = (this.getChild("n42"));
- this.historyTxt = (this.getChild("historyTxt"));
- this.n48 = (this.getChild("n48"));
- this.nameImg = (this.getChild("nameImg"));
- this.n12 = (this.getChild("n12"));
- this.n49 = (this.getChild("n49"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
- class ui_BallRodDisplay extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n31 = (this.getChild("n31"));
- this.n6 = (this.getChild("n6"));
- this.nameTxt = (this.getChild("nameTxt"));
- this.rodImg = (this.getChild("rodImg"));
- this.levelNode = (this.getChild("levelNode"));
- this.eftRod = (this.getChild("eftRod"));
- this.purchaseBtn = (this.getChild("purchaseBtn"));
- }
- }
- ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
- class ui_Component111_11 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component111_11"));
- }
- onConstruct() {
- this.n68 = (this.getChild("n68"));
- this.n69 = (this.getChild("n69"));
- }
- }
- ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
- class ui_Component112 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component112"));
- }
- onConstruct() {
- this.n68 = (this.getChild("n68"));
- this.n70 = (this.getChild("n70"));
- this.myMask = (this.getChild("myMask"));
- }
- }
- ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
- class ui_Component111 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component111"));
- }
- onConstruct() {
- this.n68 = (this.getChild("n68"));
- this.myMask = (this.getChild("myMask"));
- }
- }
- ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
- class ui_Component144 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component144"));
- }
- onConstruct() {
- this.n8 = (this.getChild("n8"));
- }
- }
- ui_Component144.URL = "ui://isxx5ak7vv6av515";
- class ui_Sign_com2 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Sign_com2"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
- class ui_Sign_guang extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Sign_guang"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n8 = (this.getChild("n8"));
- }
- }
- ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
- class ui_SignMax extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "SignMax"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n7 = (this.getChild("n7"));
- this.n15 = (this.getChild("n15"));
- this.n8 = (this.getChild("n8"));
- this.titleTxt = (this.getChild("titleTxt"));
- this.myIcon1 = (this.getChild("myIcon1"));
- this.numTxt1 = (this.getChild("numTxt1"));
- this.myIcon2 = (this.getChild("myIcon2"));
- this.n20 = (this.getChild("n20"));
- this.n17 = (this.getChild("n17"));
- this.numTxt2 = (this.getChild("numTxt2"));
- this.n12 = (this.getChild("n12"));
- this.n13 = (this.getChild("n13"));
- this.n21 = (this.getChild("n21"));
- this.n14 = (this.getChild("n14"));
- }
- }
- ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
- class ui_Sign_com2_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
- class ui_Sign_com5 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Sign_com5"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.n29 = (this.getChild("n29"));
- this.n4 = (this.getChild("n4"));
- this.day1 = (this.getChild("day1"));
- this.day2 = (this.getChild("day2"));
- this.day3 = (this.getChild("day3"));
- this.day4 = (this.getChild("day4"));
- this.day5 = (this.getChild("day5"));
- this.day6 = (this.getChild("day6"));
- this.day7 = (this.getChild("day7"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
- class ui_Sign_com8 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Sign_com8"));
- }
- onConstruct() {
- this.n48 = (this.getChild("n48"));
- this.womanTxt = (this.getChild("womanTxt"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
- class ui_Sign_com6 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Sign_com6"));
- }
- onConstruct() {
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
- class ui_Sign_com7 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Sign_com7"));
- }
- onConstruct() {
- this.n29 = (this.getChild("n29"));
- this.n2 = (this.getChild("n2"));
- }
- }
- ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
- class ui_UITurntable_com1_2 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
- }
- onConstruct() {
- this.n5 = (this.getChild("n5"));
- this.n4 = (this.getChild("n4"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
- class ui_UITurntable_com2 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n4 = (this.getChild("n4"));
- this.n6 = (this.getChild("n6"));
- this.n10 = (this.getChild("n10"));
- this.n11 = (this.getChild("n11"));
- this.n12 = (this.getChild("n12"));
- this.n13 = (this.getChild("n13"));
- this.n14 = (this.getChild("n14"));
- this.n15 = (this.getChild("n15"));
- this.n16 = (this.getChild("n16"));
- this.n17 = (this.getChild("n17"));
- this.n18 = (this.getChild("n18"));
- this.n19 = (this.getChild("n19"));
- this.n20 = (this.getChild("n20"));
- this.n21 = (this.getChild("n21"));
- this.n22 = (this.getChild("n22"));
- this.n23 = (this.getChild("n23"));
- this.n24 = (this.getChild("n24"));
- this.n25 = (this.getChild("n25"));
- this.n26 = (this.getChild("n26"));
- this.n27 = (this.getChild("n27"));
- this.n28 = (this.getChild("n28"));
- this.n29 = (this.getChild("n29"));
- this.n30 = (this.getChild("n30"));
- this.n31 = (this.getChild("n31"));
- this.n32 = (this.getChild("n32"));
- this.n33 = (this.getChild("n33"));
- }
- }
- ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
- class ui_UITurntable_com1_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
- }
- onConstruct() {
- this.n5 = (this.getChild("n5"));
- this.n4 = (this.getChild("n4"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
- class ui_UITurntable_com5 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
- }
- onConstruct() {
- this.flashNode = (this.getChild("flashNode"));
- this.rotNode = (this.getChild("rotNode"));
- this.n3 = (this.getChild("n3"));
- this.n21 = (this.getChild("n21"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
- class ui_UITurntable_com7 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
- }
- onConstruct() {
- this.n2 = (this.getChild("n2"));
- this.n35 = (this.getChild("n35"));
- this.img1 = (this.getChild("img1"));
- this.img2 = (this.getChild("img2"));
- this.img3 = (this.getChild("img3"));
- this.img4 = (this.getChild("img4"));
- this.img6 = (this.getChild("img6"));
- this.img5 = (this.getChild("img5"));
- this.txt1 = (this.getChild("txt1"));
- this.txt2 = (this.getChild("txt2"));
- this.txt3 = (this.getChild("txt3"));
- this.txt4 = (this.getChild("txt4"));
- this.txt5 = (this.getChild("txt5"));
- this.txt6 = (this.getChild("txt6"));
- }
- }
- ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
- class ui_UITurntable_com9 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
- }
- onConstruct() {
- this.n38 = (this.getChild("n38"));
- this.n39 = (this.getChild("n39"));
- }
- }
- ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
- class ui_UITurntable_com10 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
- }
- onConstruct() {
- this.n39 = (this.getChild("n39"));
- this.n40 = (this.getChild("n40"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
- class ui_UITurntable_com11 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
- }
- onConstruct() {
- this.n38 = (this.getChild("n38"));
- this.n39 = (this.getChild("n39"));
- this.n40 = (this.getChild("n40"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
- class ui_UITurntable_com12 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
- }
- onConstruct() {
- this.n43 = (this.getChild("n43"));
- this.barNode = (this.getChild("barNode"));
- this.tipsTxt = (this.getChild("tipsTxt"));
- this.n45 = (this.getChild("n45"));
- this.boxBtn = (this.getChild("boxBtn"));
- }
- }
- ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
- class ui_UITurntable_com1 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
- }
- onConstruct() {
- this.n41 = (this.getChild("n41"));
- this.n42 = (this.getChild("n42"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
- class ui_UITurntable_com3 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
- }
- onConstruct() {
- this.n48 = (this.getChild("n48"));
- this.womanTxt = (this.getChild("womanTxt"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
- class ui_cancelBtn2 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "cancelBtn2"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n7 = (this.getChild("n7"));
- this.n8 = (this.getChild("n8"));
- this.powerEft = (this.getChild("powerEft"));
- }
- }
- ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
- class ui_shareBtn2 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "shareBtn2"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n2 = (this.getChild("n2"));
- this.n24 = (this.getChild("n24"));
- this.n1 = (this.getChild("n1"));
- this.n3 = (this.getChild("n3"));
- this.n23 = (this.getChild("n23"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n20 = (this.getChild("n20"));
- this.n21 = (this.getChild("n21"));
- this.n22 = (this.getChild("n22"));
- this.powerEft = (this.getChild("powerEft"));
- }
- }
- ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
- class ui_UIMoney extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIMoney"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n4 = (this.getChild("n4"));
- this.coinImg = (this.getChild("coinImg"));
- this.addCoinBtn = (this.getChild("addCoinBtn"));
- this.coinTxt = (this.getChild("coinTxt"));
- this.n7 = (this.getChild("n7"));
- this.addDiamondBtn = (this.getChild("addDiamondBtn"));
- this.diamondTxt = (this.getChild("diamondTxt"));
- this.diamondImg = (this.getChild("diamondImg"));
- this.n12 = (this.getChild("n12"));
- this.powerImg = (this.getChild("powerImg"));
- this.addPowerBtn = (this.getChild("addPowerBtn"));
- this.powerTxt = (this.getChild("powerTxt"));
- this.powerTimeTxt = (this.getChild("powerTimeTxt"));
- }
- }
- ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
- class ui_backBtn extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "backBtn"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.t0 = this.getTransition("t0");
- this.t1 = this.getTransition("t1");
- }
- }
- ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
- class ui_MoneyBtn extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "MoneyBtn"));
- }
- onConstruct() {
- this.button = this.getController("button");
- this.n0 = (this.getChild("n0"));
- }
- }
- ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
- class ui_UIMoneyBtn extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.closeBtn = (this.getChild("closeBtn"));
- }
- }
- ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
- class ui_Component64 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component64"));
- }
- onConstruct() {
- this.n57 = (this.getChild("n57"));
- this.n54 = (this.getChild("n54"));
- this.n55 = (this.getChild("n55"));
- this.n56 = (this.getChild("n56"));
- this.t1 = this.getTransition("t1");
- }
- }
- ui_Component64.URL = "ui://isxx5ak7wp26456";
- class ui_Component41_3 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component41_3"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n0 = (this.getChild("n0"));
- this.n2 = (this.getChild("n2"));
- this.cancelBtn = (this.getChild("cancelBtn"));
- this.videoBtn = (this.getChild("videoBtn"));
- this.n9 = (this.getChild("n9"));
- this.n24 = (this.getChild("n24"));
- this.n27 = (this.getChild("n27"));
- this.titleTxt = (this.getChild("titleTxt"));
- this.n28 = (this.getChild("n28"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
- class ui_dh_zs_4 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zs_4"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n8 = (this.getChild("n8"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
- class ui_Component71_1 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component71_1"));
- }
- onConstruct() {
- this.n17 = (this.getChild("n17"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
- class ui_Component83 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component83"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n17 = (this.getChild("n17"));
- this.n19 = (this.getChild("n19"));
- this.n20 = (this.getChild("n20"));
- }
- }
- ui_Component83.URL = "ui://isxx5ak7xs1r47z";
- class ui_Component84 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component84"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n4 = (this.getChild("n4"));
- this.n22 = (this.getChild("n22"));
- this.n23 = (this.getChild("n23"));
- this.numTxt = (this.getChild("numTxt"));
- this.n25 = (this.getChild("n25"));
- this.n26 = (this.getChild("n26"));
- }
- }
- ui_Component84.URL = "ui://isxx5ak7xs1r480";
- class ui_Component84_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component84_1"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n4 = (this.getChild("n4"));
- this.n22 = (this.getChild("n22"));
- this.n23 = (this.getChild("n23"));
- this.numTxt = (this.getChild("numTxt"));
- this.n25 = (this.getChild("n25"));
- this.n26 = (this.getChild("n26"));
- }
- }
- ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
- class ui_Component85 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component85"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n6 = (this.getChild("n6"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.levelTxt = (this.getChild("levelTxt"));
- this.n10 = (this.getChild("n10"));
- this.n11 = (this.getChild("n11"));
- this.n12 = (this.getChild("n12"));
- this.n13 = (this.getChild("n13"));
- this.n14 = (this.getChild("n14"));
- this.modeNode = (this.getChild("modeNode"));
- this.n18 = (this.getChild("n18"));
- this.conditionTxt = (this.getChild("conditionTxt"));
- this.diamondNode = (this.getChild("diamondNode"));
- this.coinNode = (this.getChild("coinNode"));
- this.startBtn = (this.getChild("startBtn"));
- this.n28 = (this.getChild("n28"));
- this.displayRoot = (this.getChild("displayRoot"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component85.URL = "ui://isxx5ak7xs1r482";
- class ui_Component86 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component86"));
- }
- onConstruct() {
- this.n15 = (this.getChild("n15"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component86.URL = "ui://isxx5ak7xs1r483";
- class ui_Component87 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component87"));
- }
- onConstruct() {
- this.n66 = (this.getChild("n66"));
- this.myProgress = (this.getChild("myProgress"));
- this.starAni = (this.getChild("starAni"));
- this.hpTxt = (this.getChild("hpTxt"));
- this.n74 = (this.getChild("n74"));
- this.n73 = (this.getChild("n73"));
- this.ballTxt = (this.getChild("ballTxt"));
- this.n76 = (this.getChild("n76"));
- this.helpLineBtn = (this.getChild("helpLineBtn"));
- this.levelTxt = (this.getChild("levelTxt"));
- this.star1 = (this.getChild("star1"));
- this.star2 = (this.getChild("star2"));
- this.star3 = (this.getChild("star3"));
- }
- }
- ui_Component87.URL = "ui://isxx5ak7xs1r48m";
- class ui_Component88 extends fgui.GProgressBar {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component88"));
- }
- onConstruct() {
- this.n68 = (this.getChild("n68"));
- this.bar = (this.getChild("bar"));
- }
- }
- ui_Component88.URL = "ui://isxx5ak7xs1r48n";
- class ui_Component89 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component89"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n71 = (this.getChild("n71"));
- this.n72 = (this.getChild("n72"));
- }
- }
- ui_Component89.URL = "ui://isxx5ak7xs1r48o";
- class ui_Component90 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component90"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n64 = (this.getChild("n64"));
- this.n65 = (this.getChild("n65"));
- this.n66 = (this.getChild("n66"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component90.URL = "ui://isxx5ak7xs1r48p";
- class ui_Component127 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component127"));
- }
- onConstruct() {
- this.n5 = (this.getChild("n5"));
- }
- }
- ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
- class gameBinder {
- static bindAll() {
- fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
- fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
- fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
- fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
- fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
- fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
- fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
- fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
- fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
- fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
- fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
- fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
- fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
- fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
- fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
- fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
- fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
- fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
- fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
- fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
- fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
- fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
- fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
- fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
- fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
- fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
- fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
- fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
- fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
- fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
- fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
- fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
- fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
- fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
- fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
- fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
- fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
- fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
- fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
- fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
- fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
- fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
- fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
- fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
- fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
- fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
- fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
- fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
- fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
- fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
- fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
- fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
- fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
- fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
- fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
- fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
- fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
- fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
- fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
- fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
- fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
- fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
- fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
- fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
- fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
- fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
- fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
- fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
- fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
- fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
- fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
- fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
- fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
- fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
- fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
- fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
- fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
- fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
- fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
- fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
- fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
- fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
- fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
- fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
- fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
- fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
- fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
- fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
- fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
- fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
- fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
- fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
- fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
- fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
- fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
- fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
- fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
- fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
- fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
- fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
- fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
- fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
- fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
- fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
- fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
- fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
- fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
- fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
- fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
- fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
- fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
- fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
- fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
- fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
- fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
- fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
- fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
- fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
- fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
- fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
- fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
- fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
- fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
- fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
- fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
- fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
- fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
- fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
- fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
- fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
- fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
- fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
- fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
- fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
- fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
- fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
- fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
- fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
- fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
- fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
- fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
- fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
- fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
- fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
- fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
- fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
- fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
- fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
- fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
- fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
- fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
- fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
- fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
- fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
- fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
- fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
- fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
- fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
- fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
- fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
- fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
- fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
- fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
- fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
- fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
- fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
- fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
- fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
- fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
- fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
- fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
- fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
- fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
- fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
- fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
- fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
- fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
- fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
- fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
- fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
- fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
- fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
- fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
- fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
- fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
- fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
- fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
- fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
- fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
- fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
- fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
- fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
- fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
- fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
- fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
- fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
- fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
- fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
- fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
- fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
- fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
- fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
- fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
- fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
- fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
- fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
- fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
- fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
- fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
- fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
- fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
- fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
- fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
- fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
- fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
- fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
- fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
- fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
- fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
- fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
- fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
- fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
- fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
- fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
- fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
- fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
- fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
- fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
- fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
- fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
- fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
- fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
- fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
- fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
- fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
- fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
- fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
- fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
- fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
- fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
- fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
- fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
- fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
- fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
- fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
- fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
- fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
- fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
- fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
- fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
- fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
- fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
- fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
- fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
- fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
- fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
- fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
- fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
- fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
- fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
- fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
- }
- }
- class ui_btn6 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "btn6"));
- }
- onConstruct() {
- this.n6 = (this.getChild("n6"));
- this.n1 = (this.getChild("n1"));
- }
- }
- ui_btn6.URL = "ui://37nctnhwc6l6v4em";
- class ui_xyItem extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "xyItem"));
- }
- onConstruct() {
- this.xyItem = (this.getChild("xyItem"));
- }
- }
- ui_xyItem.URL = "ui://37nctnhwcpayv4el";
- class ui_loadinfo extends fgui.GProgressBar {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "loadinfo"));
- }
- onConstruct() {
- this.bg = (this.getChild("bg"));
- this.bar = (this.getChild("bar"));
- this.title = (this.getChild("title"));
- this.ani = (this.getChild("ani"));
- }
- }
- ui_loadinfo.URL = "ui://37nctnhwis36c";
- class ui_xyNode extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "xyNode"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.btnYes = (this.getChild("btnYes"));
- this.btnNo = (this.getChild("btnNo"));
- this.btnKnown = (this.getChild("btnKnown"));
- this.btnSure = (this.getChild("btnSure"));
- this.txtWelcom = (this.getChild("txtWelcom"));
- this.txtXy = (this.getChild("txtXy"));
- this.n75 = (this.getChild("n75"));
- this.btnXy1 = (this.getChild("btnXy1"));
- this.btnXy3 = (this.getChild("btnXy3"));
- this.btnXy2 = (this.getChild("btnXy2"));
- this.n74 = (this.getChild("n74"));
- this.xy1 = (this.getChild("xy1"));
- this.txtTitle = (this.getChild("txtTitle"));
- this.btnBack = (this.getChild("btnBack"));
- this.xyList = (this.getChild("xyList"));
- this.xy2 = (this.getChild("xy2"));
- this.xyNode = (this.getChild("xyNode"));
- }
- }
- ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
- class ui_ageNode extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "ageNode"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.n7 = (this.getChild("n7"));
- this.n4 = (this.getChild("n4"));
- this.btnAge = (this.getChild("btnAge"));
- this.ageNode = (this.getChild("ageNode"));
- }
- }
- ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
- class ui_rnNode extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "rnNode"));
- }
- onConstruct() {
- this.n28 = (this.getChild("n28"));
- this.n30 = (this.getChild("n30"));
- this.n33 = (this.getChild("n33"));
- this.rn1 = (this.getChild("rn1"));
- this.n40 = (this.getChild("n40"));
- this.n41 = (this.getChild("n41"));
- this.rn3 = (this.getChild("rn3"));
- this.n37 = (this.getChild("n37"));
- this.n39 = (this.getChild("n39"));
- this.rn2 = (this.getChild("rn2"));
- this.n47 = (this.getChild("n47"));
- this.n49 = (this.getChild("n49"));
- this.n44 = (this.getChild("n44"));
- this.inputCode = (this.getChild("inputCode"));
- this.inputName = (this.getChild("inputName"));
- this.n48 = (this.getChild("n48"));
- this.n50 = (this.getChild("n50"));
- this.rn4 = (this.getChild("rn4"));
- this.btnCheck = (this.getChild("btnCheck"));
- this.btnExit = (this.getChild("btnExit"));
- this.btnDone = (this.getChild("btnDone"));
- this.rnNode = (this.getChild("rnNode"));
- }
- }
- ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
- class ui_tipNode extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "tipNode"));
- }
- onConstruct() {
- this.bg = (this.getChild("bg"));
- this.n55 = (this.getChild("n55"));
- this.n56 = (this.getChild("n56"));
- this.tipNode = (this.getChild("tipNode"));
- }
- }
- ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
- class ui_fcmNode extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "fcmNode"));
- }
- onConstruct() {
- this.n63 = (this.getChild("n63"));
- this.n62 = (this.getChild("n62"));
- this.btnRn = (this.getChild("btnRn"));
- this.n61 = (this.getChild("n61"));
- this.n58 = (this.getChild("n58"));
- this.fcmNode = (this.getChild("fcmNode"));
- }
- }
- ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
- class ui_msgNode extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "msgNode"));
- }
- onConstruct() {
- this.n69 = (this.getChild("n69"));
- this.txtMsg = (this.getChild("txtMsg"));
- this.msgNode = (this.getChild("msgNode"));
- }
- }
- ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
- class ui_dh_zy_ganfa$1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n13 = (this.getChild("n13"));
- this.n14 = (this.getChild("n14"));
- this.n15 = (this.getChild("n15"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n7 = (this.getChild("n7"));
- this.n8 = (this.getChild("n8"));
- this.n9 = (this.getChild("n9"));
- this.n10 = (this.getChild("n10"));
- this.n12 = (this.getChild("n12"));
- this.n11 = (this.getChild("n11"));
- this.n16 = (this.getChild("n16"));
- this.n17 = (this.getChild("n17"));
- this.n18 = (this.getChild("n18"));
- this.n20 = (this.getChild("n20"));
- this.n21 = (this.getChild("n21"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
- class ui_btn5 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "btn5"));
- }
- onConstruct() {
- this.n9 = (this.getChild("n9"));
- this.n1 = (this.getChild("n1"));
- }
- }
- ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
- class ui_UILoading extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "UILoading"));
- }
- onConstruct() {
- this.n12 = (this.getChild("n12"));
- this.loadinfo = (this.getChild("loadinfo"));
- this.n13 = (this.getChild("n13"));
- this.txtLoad = (this.getChild("txtLoad"));
- this.n18 = (this.getChild("n18"));
- }
- }
- ui_UILoading.URL = "ui://37nctnhwphc33";
- class ui_AgeItem extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "AgeItem"));
- }
- onConstruct() {
- this.txtAge = (this.getChild("txtAge"));
- }
- }
- ui_AgeItem.URL = "ui://37nctnhwxe622n";
- class ui_btn1 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "btn1"));
- }
- onConstruct() {
- this.n6 = (this.getChild("n6"));
- this.n1 = (this.getChild("n1"));
- }
- }
- ui_btn1.URL = "ui://37nctnhwxe622p";
- class ui_btn3 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "btn3"));
- }
- onConstruct() {
- this.n9 = (this.getChild("n9"));
- this.n1 = (this.getChild("n1"));
- }
- }
- ui_btn3.URL = "ui://37nctnhwxe622s";
- class ui_btn2 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "btn2"));
- }
- onConstruct() {
- this.n6 = (this.getChild("n6"));
- this.n1 = (this.getChild("n1"));
- }
- }
- ui_btn2.URL = "ui://37nctnhwxe622t";
- class ui_btnBack extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "btnBack"));
- }
- onConstruct() {
- this.n6 = (this.getChild("n6"));
- this.n7 = (this.getChild("n7"));
- }
- }
- ui_btnBack.URL = "ui://37nctnhwxe622u";
- class ui_btnXy1 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "btnXy1"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- }
- }
- ui_btnXy1.URL = "ui://37nctnhwxe622w";
- class ui_btnXy2 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "btnXy2"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- }
- }
- ui_btnXy2.URL = "ui://37nctnhwxe622x";
- class ui_btnXy3 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "btnXy3"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- }
- }
- ui_btnXy3.URL = "ui://37nctnhwxe622y";
- class ui_btn4 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("loading", "btn4"));
- }
- onConstruct() {
- this.n9 = (this.getChild("n9"));
- this.n1 = (this.getChild("n1"));
- }
- }
- ui_btn4.URL = "ui://37nctnhwxe622z";
- class loadingBinder {
- static bindAll() {
- fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
- fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
- fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
- fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
- fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
- fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
- fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
- fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
- fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
- fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
- fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
- fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
- fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
- fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
- fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
- fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
- fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
- fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
- fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
- fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
- fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
- fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
- }
- }
- class UIMgr {
- constructor() {
- this._stage = null;
- this._uiList = [];
- this._showList = [];
- this._bindPkgList = [];
- this.uiIndex = 0;
- }
- static get inst() {
- if (UIMgr._inst == null) {
- UIMgr._inst = new UIMgr();
- }
- return UIMgr._inst;
- }
- setStage(s) {
- if (this._stage) {
- console.log("ViewMgr::Stage->舞台不可赋值两次");
- return;
- }
- this._stage = s;
- }
- clearTempData() {
- console.log('zh:clearTempData start');
- Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
- console.log('zh:clearTempData end');
- }
- init() {
- this.setStage(Laya.stage);
- fairygui.UIConfig.defaultFont = "微软雅黑";
- fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
- fairygui.UIConfig.packageFileExtension = "obj";
- fairygui.UIConfig.bringWindowToFrontOnClick = false;
- Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
- fairygui.GRoot.inst.width = Laya.stage.width;
- fairygui.GRoot.inst.height = Laya.stage.height;
- Laya.timer.frameLoop(1, this, this.addAllUpdate);
- }
- addAllUpdate() {
- this.uiIndex = 0;
- for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
- if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
- this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
- }
- }
- }
- bindFUI(pkgname) {
- if (this._bindPkgList.indexOf(pkgname) >= 0) {
- return;
- }
- switch (pkgname) {
- case fguiRes.loading:
- fairygui.UIPackage.addPackage(pkgname);
- loadingBinder.bindAll();
- this._bindPkgList.push(pkgname);
- break;
- case fguiRes.game:
- fairygui.UIPackage.addPackage(pkgname);
- gameBinder.bindAll();
- this._bindPkgList.push(pkgname);
- break;
- default:
- break;
- }
- }
- Show(cls, ...param) {
- let nameStr = cls.uiName;
- for (let i = this._uiList.length - 1; i >= 0; i--) {
- let temp = this._uiList[i];
- let str = temp.className;
- if (str == nameStr) {
- if (temp.isMuti) {
- if (temp.isHide) {
- temp.show(...param);
- this._uiList.splice(i, 1);
- this._uiList.push(temp);
- return temp;
- }
- }
- else {
- temp.show(...param);
- this._uiList.splice(i, 1);
- this._uiList.push(temp);
- return temp;
- }
- }
- }
- let ui = new cls();
- ui.className = nameStr;
- this._showUI(ui, param);
- return ui;
- }
- destroyUI(ui) {
- for (let i = this._uiList.length - 1; i >= 0; i--) {
- let temp = this._uiList[i].className;
- if (temp == ui.className) {
- this._uiList.splice(i, 1);
- break;
- }
- }
- this.checkUIState();
- }
- _showUI(ui, param) {
- this._uiList.push(ui);
- ui.show(...param);
- }
- Hide(uiClass) {
- let ui = this.getUI(uiClass);
- if (ui && !ui.isHide) {
- ui.hide();
- }
- }
- getUI(ui) {
- let nameStr = ui.uiName;
- for (let index = 0; index < this._uiList.length; index++) {
- let temp = this._uiList[index];
- if (temp.className == nameStr) {
- return temp;
- }
- }
- return null;
- }
- isShow(cls) {
- for (var i of this._uiList) {
- if (i instanceof cls) {
- return i.isShowing;
- }
- }
- return false;
- }
- showUINum() {
- let num = 0;
- for (var i of this._uiList) {
- if (i.isShowing) {
- num++;
- }
- }
- return num;
- }
- checkUIState() {
- Laya.timer.clear(this, this._uiCheck);
- Laya.timer.once(400, this, this._uiCheck);
- }
- _uiCheck() {
- let showList = [];
- for (var i of this._uiList) {
- if (!i.isHide) {
- showList.push(i);
- }
- }
- for (let index = 0; index < showList.length; index++) {
- if (index == showList.length - 1) {
- showList[index].checkActive(true);
- }
- else {
- showList[index].checkActive(false);
- }
- }
- }
- showTip(msg, time = 600, size = 30) {
- }
- }
- class UIShowList {
- }
- class SoundMgr {
- constructor() {
- this.soundMax = 4;
- this.isLoad = false;
- this.soundMap = {};
- this.isSound = true;
- this.openShake = true;
- SoundMgr._instance = this;
- }
- static getInstance() {
- if (!this._instance) {
- this._instance = new SoundMgr();
- }
- return this._instance;
- }
- init() {
- console.log('zh:sm init 1');
- Laya.SoundManager.autoReleaseSound = true;
- Laya.SoundManager.autoStopMusic = true;
- Laya.SoundManager.musicVolume = 0.3;
- Laya.SoundManager.soundVolume = 0.5;
- this.musicPlayed = false;
- this.audioUrl = "asset/sound/ogg/";
- console.log('zh:sm init 2');
- console.log('zh:dev type ');
- if (Laya.Browser.onAndroid) {
- console.log('zh:dev type android');
- this.audioUrl = "asset/sound/ogg/";
- this.isLoad = true;
- }
- else {
- console.log('zh:dev type not android');
- this.audioUrl = "asset/sound/mp3/";
- this.isLoad = true;
- }
- }
- onSetting(isS) {
- this.isSound = isS;
- this.mute(!this.isSound);
- }
- clearCount() {
- for (var key in this.soundMap) {
- delete this.soundMap[key];
- }
- }
- playMusic(path, loop = 0) {
- console.log('zh:playMusic 1 PATH=' + path);
- this.musicPath = path;
- if (!this.isLoad) {
- return;
- }
- if (!path || path == "") {
- return;
- }
- if (!this.isSound) {
- return;
- }
- this.musicPlayed = true;
- let url = this.getUrl(path);
- if (!Laya.Browser.onAndroid) {
- Laya.loader.load(url, Laya.Handler.create(this, () => {
- this.play(url, loop);
- }));
- }
- else {
- this.play(url, loop);
- }
- }
- play(url, loop) {
- Laya.SoundManager.playMusic(url, loop);
- }
- getUrl(path) {
- let url = this.audioUrl + path;
- if (Laya.Browser.onAndroid) {
- url += ".ogg";
- }
- else {
- url += ".mp3";
- }
- return url;
- }
- pauseMusic(pause) {
- if (pause) {
- this.mute(true);
- }
- else if (this.isSound)
- this.mute(false);
- }
- stopMusic() {
- Laya.SoundManager.stopMusic();
- if (Moyu.isNeedPlatAudio) {
- Moyu.stopMusic();
- }
- }
- mute(mute) {
- if (Moyu.isNeedPlatAudio) {
- Moyu.pauseMusic(mute);
- }
- else {
- Laya.SoundManager.musicMuted = mute;
- if (!mute && !this.musicPlayed && this.musicPath) {
- this.playMusic(this.musicPath);
- }
- }
- }
- stopSound(path) {
- let url = this.getUrl(path);
- Laya.SoundManager.stopSound(url);
- }
- playSound(path, loop = 1, soundMax = this.soundMax) {
- if (!this.isLoad)
- return;
- if (!this.isSound)
- return;
- if (!path || path == "")
- return;
- let url = this.getUrl(path);
- if (Moyu.isNeedPlatAudio) {
- Moyu.playSound(path, loop == 0);
- }
- else {
- let count = 1;
- if (this.soundMap[path])
- count = this.soundMap[path] + 1;
- if (count > soundMax)
- return;
- this.soundMap[path] = count;
- Laya.SoundManager.playSound(url, loop);
- Laya.timer.once(500 * loop, this, this.removePath, [path], false);
- }
- }
- removePath(path) {
- if (this.soundMap[path]) {
- let count = this.soundMap[path];
- count--;
- if (count < 1)
- delete this.soundMap[path];
- else
- this.soundMap[path] = count;
- }
- }
- playBtnSound() {
- this.playSound("btn");
- }
- playGetSound() {
- }
- playCloseUISound() {
- }
- }
- SoundMgr._instance = null;
- var Handler$1 = Laya.Handler;
- var EResType;
- (function (EResType) {
- EResType[EResType["none"] = 0] = "none";
- EResType[EResType["nromal"] = 1] = "nromal";
- EResType[EResType["td"] = 2] = "td";
- EResType[EResType["sk"] = 3] = "sk";
- })(EResType || (EResType = {}));
- class CResLoader {
- constructor(doneCall, proCall) {
- this.completrCall = doneCall;
- this.progressCall = proCall;
- this.progressHander = new Handler$1(this, this.onProgress);
- this.tdResMap = {};
- }
- load(resList) {
- this.resCount = 0;
- this.loadCount = 0;
- for (let i = 0; i < resList.length; i++) {
- let path = resList[i];
- if (!path)
- continue;
- this.resCount++;
- let type = this.getResType(path);
- if (type == EResType.nromal)
- this.loadNromal(path);
- else if (type == EResType.td)
- this.loadTd(path);
- }
- }
- getRes(path) {
- let type = this.getResType(path);
- if (type == EResType.nromal)
- return Laya.loader.getRes(path);
- else if (type == EResType.td) {
- let res = this.tdResMap[path];
- if (res)
- return res.clone();
- return null;
- }
- }
- destroy() {
- this.progressHander.clear();
- this.progressHander = null;
- }
- clearRes(path) {
- let type = this.getResType(path);
- if (type == EResType.nromal)
- Laya.loader.clearRes(path);
- else if (type == EResType.td) {
- let obj = this.tdResMap[path];
- if (obj)
- obj.destroy();
- delete this.tdResMap[path];
- }
- }
- getResType(path) {
- let exs = this.getExtension(path);
- if (exs == "sk")
- return EResType.sk;
- if (exs == "ls" || exs == "lh" || exs == "lm")
- return EResType.td;
- else
- return EResType.nromal;
- }
- getExtension(res) {
- var index = res.lastIndexOf(".");
- return res.substr(index + 1);
- }
- loadNromal(path) {
- Laya.loader.load(path, Laya.Handler.create(this, (res) => {
- if (res) {
- this.onLoad();
- }
- else
- console.log("load res fail:" + path);
- }), this.progressHander);
- }
- loadSk() {
- }
- loadTd(path) {
- if (this.tdResMap[path]) {
- this.onLoad();
- return;
- }
- Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
- if (res) {
- this.tdResMap[path] = res;
- this.onLoad();
- }
- else
- console.log("load res fail:" + path);
- }));
- }
- onLoad() {
- this.loadCount++;
- this.onProgress(1);
- if (this.loadCount >= this.resCount) {
- this.completrCall.run();
- }
- }
- onProgress(pro) {
- let progress = (this.loadCount + pro) / this.resCount;
- this.progressCall.runWith(progress);
- }
- }
- var Handler$2 = Laya.Handler;
- class ResInfo {
- constructor() {
- this.index = 0;
- }
- }
- class ResMgr {
- constructor() {
- this.resList = [];
- this.doneList = [];
- this.resMap = {};
- this.currentLoad = null;
- this.completeHandler = new Handler$2(this, this.onComplete);
- this.progressHandler = new Handler$2(this, this.onProgress);
- this.loader = new CResLoader(this.completeHandler, this.progressHandler);
- }
- static getInstance() {
- if (ResMgr._instance == null) {
- ResMgr._instance = new ResMgr();
- }
- return ResMgr._instance;
- }
- loadList(list, completeHandler, progressHandler) {
- if (list.length < 1) {
- completeHandler.run();
- return;
- }
- let info = this.getResInfo();
- info.resList = list;
- info.completeHandler = completeHandler;
- info.progressHandler = progressHandler;
- this.resList.push(info);
- this.startLoad();
- }
- loadFguiRes(list, completeHandler, progressHandler) {
- Laya.loader.load(list, completeHandler, progressHandler);
- }
- loadAny(list, completeHandler, progressHandler) {
- Laya.loader.load(list, completeHandler, progressHandler);
- }
- load(path, completeHandler, progressHandler) {
- let count = this.resMap[path];
- if (count && count > 0) {
- if (completeHandler)
- completeHandler.run();
- }
- else
- this.loadList([path], completeHandler, progressHandler);
- }
- getRes(path) {
- let res = this.resMap[path];
- if (!res)
- this.showLog("资源不存在:" + path);
- else
- return this.loader.getRes(path);
- }
- clearList(list, force = false) {
- if (!list || list.length < 1)
- return;
- let cr = () => {
- for (const k in list) {
- let v = list[k];
- if (!v)
- continue;
- if (force) {
- this.loader.clearRes(v);
- delete this.resMap[v];
- }
- else {
- let count = this.resMap[v];
- if (count && count > 1) {
- count--;
- this.resMap[v] = count;
- }
- else {
- this.loader.clearRes(v);
- delete this.resMap[v];
- }
- }
- }
- if (!window.hasOwnProperty("ks"))
- Laya.Resource.destroyUnusedResources();
- };
- Laya.timer.clearAll(this);
- Laya.timer.once(2000, this, cr);
- }
- clear3D() {
- for (const k in this.loader.tdResMap) {
- this.loader.clearRes(k);
- if (this.resMap[k])
- delete this.resMap[k];
- }
- if (!window.hasOwnProperty("ks"))
- Laya.Resource.destroyUnusedResources();
- }
- clear(path, force = false) {
- this.clearList([path], force);
- }
- getResInfo() {
- if (this.doneList.length > 0)
- return this.doneList.pop();
- else
- return new ResInfo();
- }
- startLoad() {
- if (this.currentLoad)
- return;
- this.currentLoad = this.resList.pop();
- if (this.currentLoad) {
- this.loader.load(this.currentLoad.resList);
- }
- }
- onComplete() {
- if (!this.currentLoad)
- return;
- for (const k in this.currentLoad.resList) {
- let v = this.currentLoad.resList[k];
- let count = this.resMap[v];
- if (count)
- count++;
- else
- count = 1;
- this.resMap[v] = count;
- }
- if (this.currentLoad.completeHandler)
- this.currentLoad.completeHandler.run();
- this.doneList.push(this.currentLoad);
- this.currentLoad = null;
- this.startLoad();
- }
- onProgress(pro) {
- if (!this.currentLoad)
- return;
- if (this.currentLoad.progressHandler)
- this.currentLoad.progressHandler.runWith(pro);
- }
- showLog(str, ...args) {
- console.log("[ResLoader] " + str);
- }
- }
- ResMgr._instance = null;
- class EventMgr extends Laya.EventDispatcher {
- }
- let eventMgr = new EventMgr();
- class ConfigMgr {
- static getInstance() {
- if (!this._instance) {
- this._instance = new ConfigMgr();
- }
- return this._instance;
- }
- init() {
- this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
- this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
- this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
- this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
- }
- getUserInfoByIndex(index) {
- return this.npcJson[index];
- }
- getRandomUserInfo() {
- let index = xGame.tools.random(0, this.npcJson.length);
- return this.npcJson[index];
- }
- getMaxBigMoveLength() {
- return Object.keys(this.levelCfg).length;
- }
- getBigMoveLevelByIndex(index) {
- let cfg = this.levelCfg;
- cfg = cfg[index];
- return cfg;
- }
- getRandomClassicLevel() {
- let cfg = this.classicCfg;
- let num = Object.keys(cfg).length;
- let rand = xGame.common.randomNum(1, num);
- return cfg[rand];
- }
- getPlaceBallByLevel(level) {
- return this.placeBallCfg[level];
- }
- getMaxPlaceBall() {
- return Object.keys(this.placeBallCfg).length;
- }
- }
- class PoolD3Mgr {
- constructor() {
- this.pool = {};
- }
- static get ins() {
- return this._ins || (this._ins = new PoolD3Mgr);
- }
- createList(key, prefab, parent) {
- if (!this.pool[key]) {
- this.pool[key] = {};
- this.pool[key].prefab = prefab;
- this.pool[key].list = [];
- this.pool[key].parent = parent;
- }
- }
- getItem(key) {
- if (!this.pool[key]) {
- return;
- }
- let temp;
- if (this.pool[key].list.length > 0) {
- temp = this.pool[key].list.pop();
- }
- else {
- temp = this.pool[key].prefab.clone();
- if (this.pool[key].parent) {
- this.pool[key].parent.addChild(temp);
- }
- }
- temp.active = true;
- return temp;
- }
- putItem(key, obj) {
- if (!this.pool[key]) {
- return;
- }
- obj.active = false;
- this.pool[key].list.push(obj);
- }
- }
- let context$1 = context;
- let uiMgr = UIMgr.inst;
- let soundMgr = SoundMgr.getInstance();
- let resMgr = ResMgr.getInstance();
- let httpMgr = HttpMgr.getInstance();
- let common = Common.getInstance();
- let cfgMgr = ConfigMgr.getInstance();
- let poolD3Mgr = PoolD3Mgr.ins;
- let d3TexUrl = "res/d3Res/";
- let d3ModeUrl = "res/unityRes/";
- function setStageSize(view) {
- if (view.width) {
- view.width = Laya.stage.width;
- view.height = Laya.stage.height;
- }
- }
- function filledBg(view) {
- let wh = Laya.stage.height / Laya.stage.width;
- if (wh > 16 / 9) {
- view.height = Laya.stage.height;
- view.width = Laya.stage.height / 1334 * 750;
- }
- else {
- view.width = Laya.stage.width;
- view.height = Laya.stage.width / 750 * 1334;
- }
- }
- function setNotch(view) {
- if (view.height) {
- view.y += context$1.notchHeight;
- }
- }
- function showTip(str) {
- uiMgr.Show(UIMsg, str);
- }
- function log(...args) {
- console.log(args);
- }
- let xGame = {
- context: context$1,
- eventMgr,
- resMgr,
- uiMgr,
- soundMgr,
- define,
- tools,
- httpMgr,
- d3TexUrl,
- d3ModeUrl,
- common,
- cfgMgr,
- poolD3Mgr,
- setStageSize,
- filledBg,
- setNotch,
- showTip,
- log,
- };
- window["xGame"] = xGame;
- let dataName = 'tBall_';
- class UserData {
- constructor() {
- this.userId = "";
- this.isAgree = false;
- this.coinNum = 0;
- this.gemNum = 0;
- this.sound = true;
- this.vibration = true;
- this.currentDate = 0;
- this.createTime = 0;
- this.awardTime = 0;
- this.roleId = 1;
- this.roleList = [];
- this.roleAds = [];
- this.dressId = 101;
- this.itemId = 201;
- this.bigSkills = [1, 1, 1, 1, 1];
- this.coin = 4000;
- this.diamond = 0;
- this.skillSuccessTimes = 0;
- this.skillGuide = 0;
- this.skillAccTimes = 0;
- this.placeBallData = [];
- this.shareDiamondTimes = 0;
- this.dailyVideoShareTimes = 0;
- this.secretary = [1, 0];
- this.curSecretary = 0;
- this.ballRod = [1, 0, 0, 0, 0, 1];
- this.curBallRod = 5;
- this.signData = 0;
- this.signTime = 0;
- this.drawTimes = 0;
- this.drawAwardTimes = 0;
- this.dailyfreeDrawTimes = 1;
- this.power = 5;
- this.powerTime = 0;
- this.challengeTimes = 0;
- this.extraSign = 0;
- this.classicTimes = 0;
- this.guideHelpLine = 0;
- this.newUser = true;
- this.rootBallFoul = 0;
- this.timeoutFoul = 0;
- this.roleList = [1];
- }
- saveData() {
- let data = {};
- for (let k in this) {
- data[k.toString()] = this[k];
- }
- Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
- }
- getData() {
- let ld = Laya.LocalStorage.getItem(dataName + "userdata");
- if (ld) {
- let localData = JSON.parse(ld);
- if (localData) {
- for (let k in this) {
- let key = k.toString();
- let data = localData[key];
- if (data != undefined) {
- this[k] = data;
- }
- }
- }
- }
- }
- }
- class ItemData {
- constructor() {
- this.itemList = {};
- this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
- this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
- }
- saveData() {
- Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
- }
- getData() {
- let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
- if (ld) {
- let localData = JSON.parse(ld);
- if (localData) {
- this.itemList = localData;
- }
- }
- }
- }
- class GameData {
- constructor() {
- this.curLevel = 0;
- this.gameType = 1;
- this.signIdx = 0;
- this.signMax = 0;
- this.rotaryTime = 0;
- this.rotaryCount = 0;
- this.rotaryList = [];
- this.diyCount = 3;
- this.awardIdx = 0;
- this.shareNum = 2;
- this.rankWeek = 0;
- this.rankScore = 0;
- this.gameCount = 0;
- this.trySkill = -1;
- this.tryTime = 0;
- }
- saveData() {
- let data = {};
- for (let k in this) {
- data[k.toString()] = this[k];
- }
- Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
- }
- getData() {
- let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
- if (ld) {
- let localData = JSON.parse(ld);
- if (localData) {
- for (let k in this) {
- let key = k.toString();
- let data = localData[key];
- if (data != undefined) {
- this[k] = data;
- }
- }
- }
- }
- }
- }
- class DataMgr {
- static Init() {
- this.userData = new UserData();
- this.gameData = new GameData();
- this.itemData = new ItemData();
- this.userData.getData();
- this.gameData.getData();
- this.itemData.getData();
- this.roleId = this.userData.roleId;
- this.resetUse();
- }
- static isNewDay() {
- Moyu.isNewDay(this, (isnew) => {
- xGame.common.isNewDay = isnew;
- if (!isnew)
- return;
- DataMgr.setShareDiamondTimes(0, false);
- DataMgr.setDailyVideoShareTimes(0, false);
- DataMgr.setDailyfreeDrawTimes(1);
- DataMgr.setExtraSign(0);
- });
- }
- static deletData() {
- Laya.LocalStorage.clear();
- }
- static upRankData() {
- let num = xGame.common.getAllStarNum();
- if (num > 0)
- Moyu.upRankData(xGame.common.curRankID, num);
- }
- static addItem(id, count = 1) {
- let v = this.itemData.itemList[id];
- if (!v)
- v = { id: id, count: count, adnum: 0, active: true };
- else {
- if (v.active) {
- v.count += count;
- }
- else {
- v.count = count;
- v.active = true;
- }
- }
- this.itemData.itemList[id] = v;
- xGame.soundMgr.playGetSound();
- this.saveItemData();
- }
- static hasItem(id) {
- let v = this.itemData.itemList[id];
- if (v && v.active)
- return true;
- return false;
- }
- static getItem(id) {
- let v = this.itemData.itemList[id];
- return v;
- }
- static getItemCount(id) {
- let v = this.itemData.itemList[id];
- if (v && v.active)
- return v.count;
- return 0;
- }
- static getItemAd(id) {
- let v = this.itemData.itemList[id];
- if (v) {
- return v.adnum;
- }
- return 0;
- }
- static onItemAd(id, num = 1) {
- let v = this.itemData.itemList[id];
- if (!v)
- v = { id: id, count: 1, adnum: num, active: false };
- else
- v.adnum += num;
- this.itemData.itemList[id] = v;
- this.saveItemData();
- }
- static costItem(id, count) {
- let v = this.itemData.itemList[id];
- if (v && v.active) {
- if (v.count < count)
- return false;
- else {
- v.count -= count;
- this.itemData.itemList[id] = v;
- return true;
- }
- }
- return false;
- }
- static resetUse() {
- this.dressId = this.userData.dressId;
- this.itemId = this.userData.itemId;
- }
- static passLevel() {
- if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
- this.gameData.curLevel++;
- this.curLevel = this.gameData.curLevel;
- this.saveGameData();
- }
- static useRole(id) {
- this.roleId = id;
- if (this.hasRole(id)) {
- this.userData.roleId = id;
- this.saveUserData();
- }
- }
- static addRole(id) {
- if (this.hasRole(id))
- return;
- this.userData.roleList.push(id);
- this.saveUserData();
- }
- static hasRole(id) {
- return this.userData.roleList.indexOf(id) >= 0;
- }
- static gemEnough(num) {
- return this.userData.gemNum >= num;
- }
- static roleHasAd(id) {
- let count = this.userData.roleAds[id];
- if (count != undefined && count >= 0)
- return true;
- else
- return false;
- }
- static saveUserData(time = 500, event, arg) {
- if (this.userSaving)
- return;
- this.userSaving = true;
- Laya.timer.once(time, this, () => {
- this.userSaving = false;
- this.userData.saveData();
- if (event)
- xGame.eventMgr.event(event, arg);
- });
- }
- static saveGameData() {
- if (this.gameSaving)
- return;
- this.gameSaving = true;
- Laya.timer.once(1000, this, () => {
- this.gameSaving = false;
- this.gameData.saveData();
- });
- }
- static saveItemData() {
- let fun = () => {
- this.itemData.saveData();
- };
- Laya.timer.clear(this, fun);
- Laya.timer.once(500, this, fun);
- }
- static saveData() {
- this.saveUserData();
- this.saveGameData();
- }
- static getBigSkillList() {
- return this.userData.bigSkills;
- }
- static getBigSkillByIndex(index) {
- return this.userData.bigSkills[index];
- }
- static setBigSkill(index, val, addUp = true) {
- if (addUp) {
- this.userData.bigSkills[index] += val;
- }
- else {
- this.userData.bigSkills[index] = val;
- }
- this.saveUserData();
- }
- static coinEnough(need) {
- if (typeof need != "number") {
- console.error("金币格式错误");
- return;
- }
- return this.userData.coin >= need;
- }
- static setCoin(val) {
- if (typeof val != "number") {
- return;
- }
- this.userData.coin += val;
- this.saveUserData();
- xGame.eventMgr.event(COIN_CHANGE);
- }
- static getCoin() {
- return this.userData.coin;
- }
- static diamondEnough(need) {
- if (typeof need != "number") {
- console.error("金币格式错误");
- return;
- }
- return this.userData.diamond >= need;
- }
- static setDiamond(val) {
- if (typeof val != "number") {
- return;
- }
- this.userData.diamond += val;
- this.saveUserData();
- xGame.eventMgr.event(DIAMOND_CHANGE);
- }
- static getDiamond() {
- return this.userData.diamond;
- }
- static getSkillSuccessTimes() {
- return this.userData.skillSuccessTimes;
- }
- static setSkillSuccessTimes(val, addUp = true) {
- if (addUp)
- this.userData.skillSuccessTimes += val;
- else
- this.userData.skillSuccessTimes = val;
- this.saveUserData();
- }
- static getSkillAccTimes() {
- return this.userData.skillAccTimes;
- }
- static setSkillAccTimes(val) {
- this.userData.skillAccTimes += val;
- this.saveUserData();
- }
- static getSkillGuide() {
- if (!xGame.common.openGuide) {
- return 1;
- }
- return this.userData.skillGuide;
- }
- static setSkillGuide(val) {
- this.userData.skillGuide = val;
- this.saveUserData();
- }
- static getPlaceBallLevelList() {
- return this.userData.placeBallData;
- }
- static getPlaceBallLevel(level) {
- let arr = this.userData.placeBallData;
- let index = level - 1;
- let out;
- if (arr[index]) {
- out = arr[index];
- }
- else {
- let max = arr.length;
- if (max == index) {
- out = {
- star: 0,
- play: true,
- isCur: true,
- getAward: false
- };
- }
- else {
- out = {
- star: 0,
- play: false,
- getAward: false
- };
- }
- }
- return out;
- }
- static setPlaceBallLevel(level, star) {
- let arr = this.userData.placeBallData;
- let index = level - 1;
- if (arr[index]) {
- arr[index].star = Math.max(arr[index].star, star);
- }
- else {
- let max = arr.length;
- if (max == index) {
- arr.push({
- star: star,
- play: true,
- getAward: false
- });
- }
- else {
- console.error("关卡存储出错");
- }
- }
- this.saveUserData();
- }
- static setPlaceBallAward(level) {
- let arr = this.userData.placeBallData;
- let index = level - 1;
- if (arr[index]) {
- arr[index].getAward = true;
- }
- this.saveUserData();
- }
- static getShareDiamondTimes() {
- return this.userData.shareDiamondTimes;
- }
- static setShareDiamondTimes(val, addUp = true) {
- if (addUp) {
- this.userData.shareDiamondTimes += val;
- }
- else {
- this.userData.shareDiamondTimes = val;
- }
- this.saveUserData();
- }
- static getDailyVideoShareTimes() {
- return this.userData.dailyVideoShareTimes;
- }
- static setDailyVideoShareTimes(val, addUp = true) {
- if (addUp) {
- this.userData.dailyVideoShareTimes += val;
- }
- else {
- this.userData.dailyVideoShareTimes = val;
- }
- this.saveUserData();
- }
- static getSecretary(index) {
- return this.userData.secretary[index];
- }
- static setSecretary(index, val) {
- this.userData.secretary[index] = val;
- this.saveUserData();
- }
- static getCurSecretary() {
- return this.userData.curSecretary;
- }
- static setCurSecretary(index) {
- this.userData.curSecretary = index;
- this.saveUserData();
- xGame.eventMgr.event(CHANGE_SECRETARY, index);
- }
- static getBallRod(index) {
- return this.userData.ballRod[index];
- }
- static setBallRod(index, val) {
- this.userData.ballRod[index] = val;
- this.saveUserData();
- }
- static getCurBallRod() {
- return this.userData.curBallRod;
- }
- static setCurBallRod(index) {
- this.userData.curBallRod = index;
- this.saveUserData();
- }
- static setSignData(val) {
- this.userData.signData = val;
- this.saveUserData();
- }
- static getSignData() {
- return this.userData.signData;
- }
- static setSignTime(val) {
- this.userData.signTime = val;
- this.saveUserData();
- }
- static getSignTime() {
- return this.userData.signTime;
- }
- static getDrawTimes() {
- return this.userData.drawTimes;
- }
- static setDrawTimes(val, addUp = true) {
- if (addUp) {
- this.userData.drawTimes += val;
- }
- else {
- this.userData.drawTimes = val;
- }
- this.saveUserData();
- }
- static getDrawAwardTimes() {
- return this.userData.drawAwardTimes;
- }
- static setDrawAwardTimes(val) {
- this.userData.drawAwardTimes = val;
- this.saveUserData();
- }
- static getDailyfreeDrawTimes() {
- return this.userData.dailyfreeDrawTimes;
- }
- static setDailyfreeDrawTimes(val) {
- this.userData.dailyfreeDrawTimes = val;
- this.saveUserData();
- }
- static setPower(val, addUp = true) {
- if (addUp)
- this.userData.power += val;
- else
- this.userData.power = val;
- if (this.userData.power >= xGame.common.maxPower) {
- this.userData.power = xGame.common.maxPower;
- }
- xGame.eventMgr.event(POWER_CHANGE, val);
- this.saveUserData();
- }
- static getPower() {
- return this.userData.power;
- }
- static setPowerTime(val) {
- this.userData.powerTime = val;
- this.saveUserData();
- }
- static getPowerTime() {
- return this.userData.powerTime;
- }
- static powerEnough() {
- return this.getPower() > 0;
- }
- static getChallengeTimes() {
- return this.userData.challengeTimes;
- }
- static setChallengeTimes(val) {
- this.userData.challengeTimes += val;
- this.saveUserData();
- }
- static getExtraSign() {
- return this.userData.extraSign;
- }
- static setExtraSign(val) {
- this.userData.extraSign = val;
- this.saveUserData();
- }
- static getClassicTimes() {
- return this.userData.classicTimes;
- }
- static setClassicTimes() {
- this.userData.classicTimes += 1;
- this.saveUserData();
- }
- static getGuideHelpLine() {
- return this.userData.guideHelpLine;
- }
- static setGuideHelpLine() {
- this.userData.guideHelpLine = 1;
- this.saveUserData();
- }
- static getNewUser() {
- return this.userData.newUser;
- }
- static setNewUser() {
- this.userData.newUser = false;
- this.saveUserData();
- }
- static getRootBallFoul() {
- return this.userData.rootBallFoul;
- }
- static setRootBallFoul() {
- this.userData.rootBallFoul = 1;
- this.saveUserData();
- }
- static getTimeoutFoul() {
- return this.userData.timeoutFoul;
- }
- static setTimeoutFoul() {
- this.userData.timeoutFoul = 1;
- this.saveUserData();
- }
- }
- DataMgr.isNewUser = false;
- DataMgr.fristEnter = true;
- DataMgr.levelType = 0;
- DataMgr.awardId = 0;
- DataMgr.awardCoin = 0;
- DataMgr.sceneId = -1;
- DataMgr.tryId = 0;
- DataMgr.curLevel = 1;
- DataMgr.vipLevel = 0;
- DataMgr.maxLevel = 0;
- DataMgr.awardRatio = 1;
- DataMgr.gameList = [];
- DataMgr.rankList = [];
- DataMgr.recoverTime = 480000;
- DataMgr.minScore = 0;
- DataMgr.rankDis = 0;
- DataMgr.userSaving = false;
- DataMgr.gameSaving = false;
- class D3Tween extends Laya.Script3D {
- constructor() {
- super();
- this.isInited = false;
- }
- ;
- init() {
- if (this.isInited)
- return;
- this.isInited = true;
- this.gameObj = this.owner;
- this.transform = this.gameObj.transform;
- }
- get rotX() {
- return this.transform.localRotationEulerX;
- }
- set rotX(v) {
- this.transform.localRotationEulerX = v;
- }
- get rotY() {
- return this.transform.localRotationEulerY;
- }
- set rotY(v) {
- this.transform.localRotationEulerY = v;
- }
- get rotZ() {
- return this.transform.localRotationEulerZ;
- }
- set rotZ(v) {
- this.transform.localRotationEulerZ = v;
- }
- get posX() {
- return this.transform.localPositionX;
- }
- set posX(v) {
- this.transform.localPositionX = v;
- }
- get posY() {
- return this.transform.localPositionY;
- }
- set posY(v) {
- this.transform.localPositionY = v;
- }
- get posZ() {
- return this.transform.localPositionZ;
- }
- set posZ(v) {
- this.transform.localPositionZ = v;
- }
- get rotation() {
- return this.transform.localRotation;
- }
- set rotation(v) {
- this.transform.localRotation = v;
- }
- }
- class D2Hole extends Laya.Script {
- constructor() { super(); }
- onTriggerEnter(collider) {
- if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
- return;
- }
- if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
- if (collider.owner["mySrc"].isRunSkillAni) {
- return;
- }
- if (collider.owner["mySrc"].number != 0) {
- xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
- }
- xGame.common.ballColliHole(collider);
- xGame.common.recoverCameraView();
- }
- }
- }
- class Table extends Laya.Script3D {
- constructor() {
- super();
- this.isSetBorder = false;
- this.inited = false;
- }
- ;
- onAwake() {
- this.init();
- }
- init() {
- if (this.inited)
- return;
- this.inited = true;
- this.gameObj = this.owner;
- this.border = this.gameObj.getChildByName("border");
- }
- setBorderPos() {
- if (this.isSetBorder)
- return;
- this.isSetBorder = true;
- let ui = xGame.common.gameUI.ui;
- let bar1 = this.border.getChildByName("bar1");
- let bar2 = this.border.getChildByName("bar2");
- let bar3 = this.border.getChildByName("bar3");
- let bar4 = this.border.getChildByName("bar4");
- let bar5 = this.border.getChildByName("bar5");
- let bar6 = this.border.getChildByName("bar6");
- this.setInfo(bar1, ui.border.bar1, "box");
- this.setInfo(bar2, ui.border.bar2, "box");
- this.setInfo(bar3, ui.border.bar3, "box");
- this.setInfo(bar4, ui.border.bar4, "box");
- this.setInfo(bar5, ui.border.bar5, "box");
- this.setInfo(bar6, ui.border.bar6, "box");
- let circle1 = this.border.getChildByName("circle1");
- let circle2 = this.border.getChildByName("circle2");
- let circle3 = this.border.getChildByName("circle3");
- let circle4 = this.border.getChildByName("circle4");
- let circle5 = this.border.getChildByName("circle5");
- let circle6 = this.border.getChildByName("circle6");
- this.setInfo(circle1, ui.border.circle1, "circle");
- this.setInfo(circle2, ui.border.circle2, "circle");
- this.setInfo(circle3, ui.border.circle3, "circle");
- this.setInfo(circle4, ui.border.circle4, "circle");
- this.setInfo(circle5, ui.border.circle5, "circle");
- this.setInfo(circle6, ui.border.circle6, "circle");
- this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
- this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
- this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
- this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
- this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
- this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
- let arr = xGame.common.gameMgr.holePosList;
- xGame.common.gameMgr.posObj = {
- "1": arr[0],
- "3": arr[2],
- "4": arr[3],
- "6": arr[5]
- };
- }
- initHolePos(x, y) {
- if (x < 300)
- x += 25;
- else if (x > 1000)
- x -= 25;
- else if (y > 200)
- y -= 10;
- else
- y += 10;
- if (y < 200)
- y += 30;
- else if (y > 500)
- y -= 30;
- xGame.common.gameMgr.holePosList.push({ x: x, y: y });
- }
- setInfo(d3Obj, d2Obj, type) {
- let ui = xGame.common.gameUI.ui;
- let sprite = new Laya.Sprite();
- ui.border.displayObject.addChild(sprite);
- let colli = xGame.common.getCollider(type);
- sprite.addComponentIntance(colli);
- let rigy = xGame.common.getRigbody();
- rigy.type = "static";
- sprite.addComponentIntance(rigy);
- let d3Pos = d3Obj.transform.position;
- xGame.common.pos3to2Convert(d3Pos);
- let scaleX = d3Obj.transform.localScaleX;
- let scaleZ = d3Obj.transform.localScaleZ;
- let width = xGame.common.scale3to2Convert(scaleZ);
- let height = xGame.common.scale3to2Convert(scaleX);
- sprite.pivotX = width / 2;
- sprite.pivotY = height / 2;
- sprite.x = d3Pos.x;
- sprite.y = d3Pos.y;
- sprite.width = width;
- sprite.height = height;
- d2Obj.x = d3Pos.x;
- d2Obj.y = d3Pos.y;
- d2Obj.width = width;
- d2Obj.height = height;
- if (type == "box") {
- colli.width = width;
- colli.height = height;
- colli.isSensor = false;
- colli.label = "border";
- }
- else {
- colli.radius = width / 2;
- colli.isSensor = true;
- colli.label = "hole";
- sprite.addComponent(D2Hole);
- }
- }
- }
- class D3World extends Laya.Script3D {
- constructor() {
- super();
- this.loadNum = 0;
- this.setLoadNum = 7;
- this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
- }
- onAwake() {
- }
- loadScene() {
- this.scene = this.owner;
- let url = `res/unityRes/root.lh`;
- Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
- this.scene.addChild(prefab);
- this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
- this.putCameraInfo();
- this.camera.enableHDR = false;
- this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
- this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
- this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
- this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
- this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
- this.knife = this.scene.getChildByName("root").getChildByName("knife");
- this.knife.active = false;
- this.loadD3Obj();
- }));
- }
- putCameraInfo() {
- let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
- this.cameraObj = new cameraType();
- this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
- this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
- this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
- this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
- this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
- this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
- this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
- this.visitAngleChild.init();
- this.visitRootObj.posX = this.visitAngleChild.posX;
- this.visitRootObj.posY = this.visitAngleChild.posY;
- this.visitRootObj.posZ = this.visitAngleChild.posZ;
- this.visitRootObj.rotX = this.visitAngleChild.rotX;
- this.visitRootObj.rotY = this.visitAngleChild.rotY;
- this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
- this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
- xGame.common.showOneCamera("mainCamera");
- }
- loadD3Obj() {
- this.loadTable();
- this.loadRoom();
- this.loadInHoleParticial();
- this.loadIceParticial();
- this.loadHitParticial();
- this.loadFireworksParticial();
- this.loadBall();
- }
- loadInHoleParticial() {
- this.loadD3Res("inHoleEft", "", (prefab) => {
- prefab.addComponent(Partical);
- xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
- });
- }
- loadIceParticial() {
- this.loadD3Res("iceEft", "", (prefab) => {
- prefab.addComponent(Partical);
- xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
- });
- }
- loadHitParticial() {
- this.loadD3Res("hitEft", "", (prefab) => {
- prefab.addComponent(Partical);
- xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
- });
- }
- loadFireworksParticial() {
- this.loadD3Res("fireworksEft", "", (prefab) => {
- prefab.addComponent(Partical);
- xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
- });
- }
- loadBall(index = 1) {
- this.loadD3Res("ball", index, (prefab) => {
- this.ballPrefab = prefab;
- this.ballPrefab.addComponent(Ball);
- xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
- });
- }
- loadTable(index = 1) {
- this.loadD3Res("table", index, (prefab) => {
- this.tableSrc = prefab.addComponent(Table);
- this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
- this.d3Hand.init();
- this.tableRoot.addChild(prefab);
- });
- }
- loadRoom(index = 1) {
- this.loadD3Res("room", index, (prefab) => {
- this.roomRoot.addChild(prefab);
- });
- }
- loadD3Res(type, index, callback) {
- let url = `res/unityRes/${type}${index}.lh`;
- Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
- callback && callback(prefab);
- this.checkResLoad();
- }));
- }
- checkResLoad() {
- this.loadNum++;
- if (this.loadNum >= this.setLoadNum) {
- xGame.eventMgr.event(D3RES_LOADED);
- }
- }
- prePlayEft() {
- let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
- eft.transform.localPositionX = 0;
- eft.transform.localPositionY = -5;
- eft.transform.localPositionZ = 0;
- eft.active = true;
- let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
- ice.transform.localPositionX = 0;
- ice.transform.localPositionY = -5;
- ice.transform.localPositionZ = 0;
- ice.active = true;
- let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
- hit.transform.localPositionX = 0;
- hit.transform.localPositionY = -5;
- hit.transform.localPositionZ = 0;
- hit.active = true;
- let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
- fireworks.transform.localPositionX = 0;
- fireworks.transform.localPositionY = -5;
- fireworks.transform.localPositionZ = 0;
- fireworks.active = true;
- }
- }
- class cameraType {
- }
- class MoyuMgr$1 {
- static initMoyu() {
- this.moyuView = new MoyuView$1();
- Laya.stage.addChild(this.moyuView.ui.displayObject);
- this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
- this.moyuView.ui.displayObject.zOrder = 1000;
- this.moyuView.init();
- this.moyuView.showTip(true);
- this.moyuView.showAge(true, 0, Laya.stage.height - 320);
- window['XApk'] = this;
- }
- static showAge(show) {
- if (this.moyuView)
- this.moyuView.showAge(show);
- }
- static onPlatMsg(idx) {
- if (!MoyuMgr$1.moyuView)
- return;
- if (idx == '0') {
- MoyuMgr$1.moyuView.showTip(false);
- }
- }
- static showAgree(call) {
- if (this.moyuView)
- this.moyuView.showAgree(call);
- else
- call && call();
- }
- static showXy(type = 1) {
- if (this.moyuView)
- this.moyuView.showXy(type);
- }
- }
- MoyuMgr$1.isAdvise = false;
- class MoyuView$1 {
- constructor() {
- this.ysxyNum = 1;
- this.ysJson = null;
- this.ui = ui_UIMoyu.createInstance();
- }
- init() {
- this.ui.mainBg.visible = false;
- this.ui.xyNode.visible = false;
- this.ui.ageNode.visible = false;
- this.ui.tipNode.visible = false;
- this.ui.rnNode.visible = false;
- this.ui.fcmNode.visible = false;
- this.ui.ageTip.visible = false;
- this.ui.msgNode.visible = false;
- this.ui.visible = false;
- this.ui.xyNode.xyList.setVirtual();
- this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
- this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
- this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
- this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
- this.ui.xyNode.btnKnown.visible = false;
- this.ui.xyNode.xy1.visible = false;
- this.ui.xyNode.xy2.visible = false;
- this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
- this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
- this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
- this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
- this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
- this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
- this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
- this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
- this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
- this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
- this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
- this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
- this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
- this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
- if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
- this.ysxyNum = 2;
- }
- }
- onClick(obj) {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- switch (obj) {
- case this.ui.ageTip:
- if (Moyu.isTTApk) {
- this.ui.ageNode.visible = true;
- this.ui.mainBg.visible = true;
- }
- break;
- case this.ui.tipNode:
- this.showTip(false);
- break;
- case this.ui.ageNode.btnAge:
- this.ui.ageNode.visible = false;
- this.ui.mainBg.visible = false;
- if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
- this.ui.visible = false;
- break;
- case this.ui.xyNode.btnXy3:
- case this.ui.xyNode.btnXy1:
- this.loadXy(1);
- break;
- case this.ui.xyNode.btnXy2:
- this.loadXy(2);
- break;
- case this.ui.xyNode.btnBack:
- this.ui.xyNode.xy1.visible = true;
- this.ui.xyNode.xy2.visible = false;
- break;
- case this.ui.xyNode.btnKnown:
- this.ui.xyNode.visible = false;
- this.ui.mainBg.visible = false;
- this.ui.visible = false;
- break;
- case this.ui.rnNode.btnCheck:
- this.check();
- break;
- case this.ui.rnNode.btnExit:
- case this.ui.xyNode.btnNo:
- this.ysxyNum--;
- if (this.ysxyNum > 0)
- this.showMsg("Refuse to quit the game once again");
- else {
- Moyu.userAgree(false);
- Moyu.exit();
- }
- break;
- case this.ui.xyNode.btnSure:
- case this.ui.xyNode.btnYes:
- DataMgr.userData.isAgree = true;
- DataMgr.saveUserData();
- this.onAgree();
- break;
- case this.ui.rnNode.btnDone:
- this.ui.rnNode.visible = false;
- this.ui.visible = false;
- break;
- case this.ui.fcmNode.btnRn:
- this.showRn();
- break;
- }
- }
- showTip(show) {
- if (!Moyu.isVVApk && !Moyu.isOPApk)
- return;
- if (show) {
- MoyuMgr$1.isAdvise = true;
- this.ui.visible = true;
- this.ui.tipNode.visible = true;
- this.ui.tipNode.alpha = 1;
- Laya.timer.once(1000, this, this.showTip, [false]);
- }
- else {
- this.ui.tipNode.alpha = 1;
- this.ui.tipNode.visible = true;
- Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
- this.ui.tipNode.visible = false;
- MoyuMgr$1.isAdvise = false;
- }), 1000);
- }
- }
- showAge(show, px = 0, py = 0) {
- if (Moyu.platType > 10 && !Moyu.isIos) {
- this.ui.ageTip.x = px;
- this.ui.ageTip.y = py;
- this.ui.ageTip.visible = show;
- if (show)
- this.ui.visible = true;
- }
- }
- showAgree(call) {
- this.agreeCall = call;
- this.onAgree();
- return;
- if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
- this.showXy(0);
- }
- else
- this.onAgree();
- }
- onAgree() {
- if (!this.ui.ageNode.visible)
- this.ui.visible = false;
- this.ui.xyNode.visible = false;
- Moyu.userAgree(true);
- this.showAge(false);
- this.agreeCall && this.agreeCall();
- this.showRn();
- }
- showMsg(txt) {
- this.ui.msgNode.txtMsg.text = txt;
- this.ui.msgNode.visible = true;
- this.ui.msgNode.alpha = 1;
- this.ui.visible = true;
- Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
- this.ui.msgNode.visible = false;
- }), 2500, true);
- }
- showRn() {
- if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
- if (!Moyu.isRealName || Moyu.gameTime < 999) {
- this.ui.rnNode.rn1.visible = true;
- this.ui.rnNode.rn2.visible = false;
- this.ui.rnNode.rn3.visible = false;
- this.ui.rnNode.rn4.visible = false;
- this.ui.rnNode.visible = true;
- this.ui.mainBg.visible = true;
- this.ui.rnNode.btnDone.visible = false;
- this.ui.rnNode.btnExit.visible = true;
- this.ui.rnNode.btnCheck.visible = true;
- this.ui.fcmNode.visible = false;
- this.ui.visible = true;
- return;
- }
- }
- this.showFcm();
- }
- showFcm() {
- if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
- Moyu.initFCM(true);
- if (Moyu.gameTime < 1)
- this.fcmLoop();
- else if (Moyu.gameTime < 999)
- Laya.timer.loop(10000, this.ui, this.fcmLoop);
- }
- }
- fcmLoop() {
- if (Moyu.gameTime < 1) {
- this.ui.rnNode.visible = false;
- this.ui.fcmNode.visible = true;
- this.ui.mainBg.visible = true;
- this.ui.visible = true;
- this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
- Laya.timer.clear(this.ui, this.fcmLoop);
- }
- }
- check() {
- if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
- this.ui.rnNode.rn1.visible = false;
- this.ui.rnNode.rn2.visible = false;
- this.ui.rnNode.rn4.visible = true;
- }
- else if (this.ui.rnNode.rn4.visible) {
- let name = this.ui.rnNode.inputName.text;
- let code = this.ui.rnNode.inputCode.text;
- if (code && code.length == 18) {
- this.ui.rnNode.rn1.visible = false;
- this.ui.rnNode.rn4.visible = false;
- Moyu.authenticate(name, code, (res) => {
- this.ui.rnNode.rn2.visible = !res;
- this.ui.rnNode.rn3.visible = res;
- this.ui.rnNode.btnDone.visible = res;
- this.ui.rnNode.btnExit.visible = !res;
- this.ui.rnNode.btnCheck.visible = !res;
- if (res)
- this.showFcm();
- });
- }
- else
- this.showMsg("信息填写不完整");
- }
- }
- loadXy(type = 0) {
- this.ui.xyNode.xy1.visible = false;
- this.ui.xyNode.xy2.visible = true;
- this.ui.xyNode.xyList.scrollToView(0);
- if (type == 1) {
- Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
- }
- else if (type == 2) {
- Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
- }
- }
- showXy(type = 0) {
- this.xyBtn();
- if (type == 0) {
- if (Moyu.isPlat(MoyuPlat.f399Apk)) {
- this.ui.xyNode.btnSure.visible = true;
- }
- else {
- this.ui.xyNode.btnYes.visible = true;
- this.ui.xyNode.btnNo.visible = true;
- }
- }
- else {
- this.ui.xyNode.btnKnown.visible = true;
- this.ui.mainBg.visible = true;
- }
- this.ui.xyNode.xy1.visible = true;
- this.ui.xyNode.xy2.visible = false;
- this.ui.xyNode.visible = true;
- this.ui.visible = true;
- }
- xyBtn() {
- this.ui.xyNode.btnSure.visible = false;
- this.ui.xyNode.btnYes.visible = false;
- this.ui.xyNode.btnNo.visible = false;
- this.ui.xyNode.btnKnown.visible = false;
- {
- this.ui.xyNode.btnXy3.visible = false;
- this.ui.xyNode.btnXy2.visible = true;
- this.ui.xyNode.btnXy1.visible = true;
- this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
- }
- }
- createXY(json) {
- this.ysJson = json.content;
- this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
- this.ui.xyNode.xyList.numItems = this.ysJson.length;
- this.ui.xyNode.xy2.visible = true;
- }
- renderListItem(idx, cell) {
- let xy = this.ysJson[idx];
- cell.height = xy.line * 30;
- cell.xyItem.text = xy.text;
- }
- onDestroy() {
- this.agreeCall = null;
- }
- }
- class UILoading extends UIBase {
- constructor() {
- super();
- this.accTime = 0;
- this.curNum = 0;
- this.rate = 1;
- this.loadSubOk = false;
- this.loadResOK = false;
- this.openLoading = true;
- this.beginLoadRes = false;
- this.finishD2 = false;
- this.finishD3 = false;
- }
- onConstructor() {
- this.ui = ui_UILoading.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this._initUI();
- this._addEvent();
- }
- _initUI() {
- MoyuMgr$1.initMoyu();
- }
- _addEvent() {
- xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
- xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
- }
- show() {
- super.show();
- console.log('zh:加载分包资源');
- loadSubRes(this.subResProgress.bind(this));
- this.ui.txtLoad.text = "Loading...";
- }
- subResProgress(pro, finish) {
- this.curNum = pro;
- if (finish) {
- this.curNum = 1;
- this.loadSubOk = true;
- }
- }
- laodD3Res() {
- let scene3D = new Laya.Scene3D();
- xGame.common.d3Scene = scene3D;
- xGame.common.d3World = scene3D.addComponent(D3World);
- xGame.common.d3World.loadScene();
- }
- loadD2Res() {
- Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
- this.finishD2 = true;
- this.checkLoadAll();
- this.curNum = 1;
- }), Laya.Handler.create(this, (pro) => {
- this.curNum = pro;
- }, null, false));
- }
- d3ResFinish() {
- this.finishD3 = true;
- this.checkLoadAll();
- }
- checkLoadAll() {
- if (this.finishD2 && this.finishD3) {
- this.loadResOK = true;
- }
- }
- loadRes() {
- this.laodD3Res();
- this.loadD2Res();
- }
- myUpdate(dt) {
- if (!this.openLoading)
- return;
- this.accTime += dt * this.rate;
- if (this.accTime >= this.curNum)
- this.accTime = this.curNum;
- this.ui.loadinfo.value = this.accTime * 100;
- if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
- if (!this.beginLoadRes) {
- this.beginLoadRes = true;
- this.ui.txtLoad.text = "Loading...";
- this.curNum = 0;
- this.accTime = 0;
- this.loadRes();
- }
- if (this.loadResOK) {
- this.openLoading = false;
- Laya.timer.once(300, this, () => {
- xGame.common.d3Scene.active = false;
- MoyuMgr$1.showAgree(enterGame);
- });
- }
- }
- }
- release() {
- }
- hide() {
- super.hide();
- this.release();
- }
- onClose() {
- this.hide();
- }
- }
- UILoading.uiName = "UILoading";
- class UIRepentProp$1 extends UIBase {
- constructor() {
- super();
- this.viewType = 0;
- this.regretType = 0;
- }
- onConstructor() {
- this.ui = ui_UIRepentProp.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
- this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
- this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
- this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
- }
- show(viewType, regretType, callback) {
- PlatMgr.showInsert(true);
- this.viewType = viewType;
- this.regretType = regretType;
- this.callback = callback;
- super.show();
- this.ui.t0.play();
- this.ui.c1.selectedIndex = this.viewType;
- this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
- if (this.viewType == 0) {
- let guide = DataMgr.getGuideHelpLine();
- this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
- this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
- }
- xGame.common.gameMgr.gamePause = true;
- }
- hideSelf() {
- xGame.common.gameMgr.gamePause = false;
- this.callback && this.callback(false);
- this.hide();
- }
- videoRegret() {
- console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_UIrepentProp_videoRegret();
- }
- }
- qjff_AD_for_UIrepentProp_videoRegret() {
- this.callback && this.callback(true);
- this.hideSelf();
- }
- videoAddHelpLine() {
- let guide = DataMgr.getGuideHelpLine();
- if (guide == 0) {
- this.callback && this.callback(true);
- this.hideSelf();
- DataMgr.setGuideHelpLine();
- xGame.common.gameUI.ui.guideNode.visible = false;
- }
- else {
- console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
- }
- }
- }
- qjff_AD_for_UIrepentProp_videoAddHelpLine() {
- this.callback && this.callback(true);
- this.hideSelf();
- }
- }
- UIRepentProp$1.uiName = "UIRepentProp";
- class UIRodMethod$1 extends UIBase {
- constructor() {
- super();
- this.isPressd = false;
- }
- onConstructor() {
- this.ui = ui_UIRodMethod.createInstance();
- this.contentPane = this.ui;
- this.addUIClick(this.ui.sureBtn, this.closeSelf);
- this.moveDir = new Laya.Vector2();
- this.moveDest = new Laya.Vector2();
- this.centerPos = new Laya.Vector2();
- xGame.common.uiRodMethod = this;
- }
- show() {
- super.show();
- xGame.common.gameMgr.gamePause = true;
- this.openPressDotEvent();
- this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
- this.centerPos.x = this.ui.white.x;
- this.centerPos.y = this.ui.white.y;
- this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
- this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
- this.setDot();
- }
- setDot() {
- this.ui.dot.x = this.moveDest.x;
- this.ui.dot.y = this.moveDest.y;
- }
- closeSelf() {
- xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
- xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
- this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
- this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
- xGame.common.gameMgr.gamePause = false;
- this.hide();
- }
- openPressDotEvent() {
- this.closePressDotEvent();
- this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
- this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
- this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
- this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
- this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
- this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
- }
- closePressDotEvent() {
- this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
- this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
- this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
- this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
- this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
- this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
- }
- onDown(e) {
- if (e.type == Laya.Event.MOUSE_DOWN)
- this.isPressd = true;
- else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
- this.isPressd = false;
- if (!this.isPressd)
- return;
- this.moveDest.x = e.stageX;
- this.moveDest.y = e.stageY;
- let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
- if (dis > 6724) {
- this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
- this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
- }
- this.setDot();
- }
- resetRod() {
- this.ui.dot.x = this.ui.white.x;
- this.ui.dot.y = this.ui.white.y;
- this.gameRod.dot.x = this.gameRod.bg.x;
- this.gameRod.dot.y = this.gameRod.bg.y;
- xGame.common.rodOffest.x = 0;
- xGame.common.rodOffest.y = 0;
- }
- }
- UIRodMethod$1.uiName = "UIRodMethod";
- class UIMsg$1 extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UIMsg.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.isMuti = true;
- }
- show(msg, callback) {
- super.show();
- this.ui.tipsNode.msgTxt.text = msg;
- this.ui.alpha = 1;
- Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
- this.hide();
- callback && callback();
- }), 1000);
- }
- }
- UIMsg$1.uiName = "UIMsg";
- class UITips$1 extends UIBase {
- constructor() {
- super();
- this.type = 0;
- }
- onConstructor() {
- this.ui = ui_UITips.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
- this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
- }
- show(tipsTxt, womanTxt, type) {
- super.show();
- this.ui.t0.play();
- this.ui.myNode.tipsTxt.text = tipsTxt;
- this.ui.myNode.womanTxt.text = womanTxt;
- PlatMgr.showInsert(true);
- this.ui.myNode.c1.selectedIndex = type;
- this.type = type;
- switch (this.type) {
- case TipsType.exitGame:
- xGame.common.gameMgr.gamePause = true;
- break;
- case TipsType.foul:
- Laya.timer.once(200, this, () => {
- xGame.common.gameMgr.gamePause = true;
- });
- break;
- default:
- break;
- }
- }
- clickLeftBtn() {
- this.hide();
- xGame.common.gameMgr.gamePause = false;
- switch (this.type) {
- case TipsType.exitGame:
- break;
- case TipsType.foul:
- break;
- default:
- break;
- }
- }
- clickRightBtn() {
- this.hide();
- switch (this.type) {
- case TipsType.exitGame:
- xGame.eventMgr.event(RESET_GAME);
- xGame.uiMgr.Show(UIMain$1);
- Moyu.recordEnd(this, null);
- xGame.common.longHelpLine = false;
- break;
- case TipsType.foul:
- xGame.common.gameMgr.gamePause = false;
- Laya.timer.clearAll(this);
- break;
- default:
- break;
- }
- }
- }
- UITips$1.uiName = "UITips";
- class UIGame$1 extends UIBase {
- constructor() {
- super();
- this.powerNum = 0;
- this.isD3Inited = false;
- this.isPrePlay = false;
- this.isMoveRod = false;
- this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
- this.rulerDis = 20;
- this.rulerOffset = 0;
- }
- onConstructor() {
- this.ui = ui_UIGame.createInstance();
- this.contentPane = this.ui;
- this.ui.x += xGame.common.sysOffestNum;
- this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
- this.isEject = false;
- xGame.common.gameUI = this;
- this.initSelf();
- }
- isTurnSelf() {
- if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
- return true;
- }
- }
- initSelf() {
- let topUI = this.ui.topNode;
- topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
- topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
- this.barInfo = {};
- this.barInfo.curY = 0;
- this.barInfo.height = this.ui.powerNode.height;
- this.barInfo.showStarY = this.ui.powerNode.showImg.y;
- this.barInfo.powerStartY = this.ui.powerNode.y;
- xGame.common.aiPlayer = new AIPlayer();
- xGame.common.gameMgr = new GameMgr();
- xGame.common.skillMgr = new SkillMgr();
- xGame.common.wordsMgr = new WordsMgr();
- xGame.common.talkMgr = new TalkMgr();
- xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
- console.log("加载经典模式表情文件chenggon !");
- });
- xGame.common.awardSpine = new SpineMgr("jinbi", () => {
- console.log("挑战模式奖励模式spine加载成功!");
- });
- xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
- xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
- this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
- this.addUIClick(this.ui.returnBtn, this.returnHome);
- this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
- this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
- this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
- }
- getGanZiImg() {
- let index = DataMgr.getCurBallRod();
- let data = cfgTable.ballrodData[index + 1];
- let gan_url = xGame.common.getGameIconUrl(data.img);
- console.log('zh:getGanZiImg gan_url==' + gan_url);
- this.ui.powerNode.showImg.url = gan_url;
- console.log('zh:修改杆子图标O K');
- }
- returnHome() {
- let tips = "Are you sure to exit the game?";
- let woman = "Boss, why don't you play for a while longer?";
- xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
- }
- addRodMethodClick() {
- if (this.isTurnSelf()) {
- xGame.uiMgr.Show(UIRodMethod$1);
- }
- }
- clickHelpLineBtn(force = false) {
- if (!this.isTurnSelf())
- return;
- xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
- if (success) {
- xGame.common.longHelpLine = true;
- xGame.common.d2World.getHelpLine();
- Moyu.sendDataEvent("guideNum");
- }
- else {
- }
- });
- }
- renderSelfDisplayBalls(index, target) {
- let str = "q" + xGame.common.gameMgr.selfBallArr[index];
- target.myImg.url = xGame.common.getGameIconUrl(str);
- }
- renderAIDisplayBalls(index, target) {
- let str = "q" + xGame.common.gameMgr.aiBallArr[index];
- target.myImg.url = xGame.common.getGameIconUrl(str);
- ;
- }
- updateMode() {
- if (xGame.common.gameMode == GameMode.classic) {
- this.ui.topNode.scoreNode.visible = false;
- }
- else if (xGame.common.gameMode == GameMode.bigMove) {
- this.ui.topNode.scoreNode.visible = true;
- }
- }
- show() {
- super.show();
- console.log("zh:uigame show AADD");
- this.ui.alpha = 0;
- this.updateSelf();
- xGame.common.gameMgr.gamePause = false;
- xGame.common.gameUI.ui.blackAni.visible = false;
- xGame.common.gameUI.ui.whiteAni.visible = false;
- this.ui.powerEft.visible = false;
- this.ui.colorNode.visible = false;
- this.updateHead();
- let curUse = DataMgr.getCurBallRod();
- console.log('zh:UIGame 选择的球杆234 = ' + curUse);
- this.getGanZiImg();
- }
- updateSelf() {
- if (xGame.common.gameMode == GameMode.classic) {
- this.ui.c1.selectedIndex = 0;
- this.ui.topNode.middleNode.c1.selectedIndex = 0;
- this.ui.topNode.middleNode.visible = true;
- this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
- }
- else if (xGame.common.gameMode == GameMode.bigMove) {
- this.ui.c1.selectedIndex = 0;
- this.ui.topNode.middleNode.c1.selectedIndex = 1;
- this.ui.topNode.middleNode.visible = false;
- let max = xGame.cfgMgr.getMaxBigMoveLength();
- let rand = xGame.common.randomNum(1, max);
- let guide = DataMgr.getSkillGuide();
- if (guide == 0)
- rand = 1;
- xGame.common.bigMoveLevelIndex = rand;
- }
- else if (xGame.common.gameMode == GameMode.placeBall) {
- let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
- this.ui.c1.selectedIndex = 1 + data.type;
- this.ui.alpha = 1;
- this.startGame();
- }
- this.updateMode();
- this.initD3world();
- this.initD2world();
- }
- startGame() {
- this.ui.snowNode.visible = Math.random() <= 0.1;
- this.ui.d2Node.visible = false;
- xGame.common.d3World.d3Hand.gameObj.active = false;
- xGame.common.d3World.tableSrc.init();
- xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
- this.cameraViewChange(() => {
- xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- xGame.common.d3World.d3Hand.gameObj.active = true;
- this.playPutBallD3Ani();
- break;
- case GameMode.bigMove:
- this.enterGame();
- Laya.timer.once(500, this, () => {
- this.ui.topNode.middleNode.visible = true;
- this.ui.topNode.middleNode.t0.play();
- });
- break;
- case GameMode.placeBall:
- this.enterGame();
- break;
- default:
- break;
- }
- });
- PlatMgr.showBanner(false);
- }
- enterGame() {
- this.ui.d2Node.visible = true;
- xGame.common.d3World.d3Hand.gameObj.active = false;
- xGame.common.showOneCamera("mainCamera");
- Moyu.recordGame(30, true);
- if (!this.isPrePlay) {
- this.isPrePlay = true;
- xGame.common.d3World.prePlayEft();
- }
- xGame.common.gameMgr.gameReady();
- this.openAllEvent();
- this.ui.snowNode.visible = false;
- let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
- this.ui.helpBtn.visible = condition;
- }
- showHelpLineGuide() {
- let longGuide = DataMgr.getGuideHelpLine();
- if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
- this.ui.helpBtn.visible = true;
- this.ui.guideNode.visible = true;
- }
- }
- setTurnAlpha(alpha) {
- this.ui.keduNode.alpha = alpha;
- this.ui.ganNode.alpha = alpha;
- this.ui.rodMethodNode.alpha = alpha;
- this.ui.helpBtn.alpha = alpha ? 1 : 0;
- }
- cameraViewChange(callback) {
- xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
- let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
- xGame.common.showOneCamera("visitAngle");
- cameraSrc.localRotationEulerY = 180;
- cameraSrc.localRotationEulerZ = 0;
- Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
- Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
- callback && callback();
- }));
- }));
- }
- playPutBallD3Ani() {
- xGame.common.showOneCamera("mainCamera");
- let handSrc = xGame.common.d3World.d3Hand;
- handSrc.gameObj.active = true;
- handSrc.transform.localPositionZ = 3;
- Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
- Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
- handSrc.gameObj.active = false;
- this.enterGame();
- }), 400);
- }));
- }
- updateHead() {
- let user = Moyu.getUserInfo();
- this.ui.topNode.selfNameTxt.text = user.nickName;
- xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
- let aiData = xGame.cfgMgr.getRandomUserInfo();
- if (DataMgr.getSkillGuide() < 1) {
- this.ui.topNode.aiNameTxt.text = 'billiards';
- this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
- }
- else {
- this.ui.topNode.aiNameTxt.text = aiData.name;
- let randNo = Math.floor(Math.random() * 10) + 1;
- this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
- }
- }
- initD2world() {
- let node = this.ui.d2Root.displayObject;
- let src = node.getComponent(D2World);
- if (!src) {
- xGame.common.d2World = node.addComponent(D2World);
- }
- xGame.common.d2World.initSelf();
- }
- initD3world() {
- if (this.isD3Inited)
- return;
- this.isD3Inited = true;
- let scene3D = xGame.common.d3Scene;
- this.ui.d3Root.displayObject.addChild(scene3D);
- scene3D.active = true;
- xGame.common.d3World.tableSrc.setBorderPos();
- }
- onRootMove(e) {
- let rootBall = xGame.common.d2World.rootBall;
- this.ui.moveNode.x = e.x;
- this.ui.moveNode.y = e.y;
- rootBall.gameObj.x = e.x;
- rootBall.gameObj.y = e.y;
- rootBall.d3BallSrc.setTransPos(e.x, e.y);
- }
- aiRootMove(move) {
- if (move)
- this.hideBallUI();
- else {
- this.showBallUI();
- xGame.common.d2World.getHelpLine();
- }
- }
- aiForce(type, force = 0) {
- this.pressTarget = PressType.powerNode;
- if (type == 1)
- this.onEventUp({ force: true });
- else if (type == 2)
- this.onEventMove({ stageY: force, force: true });
- }
- onEventPress(e) {
- if (e.stopPropagation)
- e.stopPropagation();
- if (!this.isTurnSelf())
- return;
- let target = e.target;
- switch (target) {
- case this.ui.myPowerNode.displayObject:
- this.pressTarget = PressType.powerNode;
- this.barInfo.curY = e.stageY;
- this.updateBarInfo();
- break;
- case this.ui.moveNode.displayObject:
- this.pressTarget = PressType.moveNode;
- this.hideBallUI();
- this.eventObj.curX = this.ui.moveNode.x;
- this.eventObj.curY = this.ui.moveNode.y;
- this.ui.moveNode.finger.visible = false;
- this.eventObj.lastX = e.stageX;
- this.eventObj.lastY = e.stageY;
- break;
- case this.ui.rulerClickNode.displayObject:
- this.pressTarget = PressType.rulerNode;
- this.eventObj.lastY = e.stageY;
- break;
- case this.ui.d2Root.displayObject:
- this.pressTarget = PressType.d2Root;
- this.eventObj.lastX = e.stageX;
- this.eventObj.lastY = e.stageY;
- this.eventObj.starX = e.stageX;
- this.eventObj.starY = e.stageY;
- this.eventObj.curX = 0;
- this.eventObj.curY = 0;
- xGame.common.d2World.d2Gan.setGanLastInfo();
- this.rulerOffset = 0;
- break;
- default:
- break;
- }
- }
- onEventMove(e) {
- if (e.stopPropagation)
- e.stopPropagation();
- if (e && e.force) {
- }
- else {
- if (!this.isTurnSelf())
- return;
- }
- switch (this.pressTarget) {
- case PressType.powerNode:
- this.barInfo.curY = e.stageY;
- this.updateBarInfo();
- this.isMoveRod = true;
- break;
- case PressType.moveNode:
- let rootBall = xGame.common.d2World.rootBall;
- let radius = rootBall.gameObj.width / 2;
- let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
- let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
- let border = xGame.common.d2World.borderRect;
- if (curX <= border.x + radius)
- curX = border.x + radius;
- else if (curX >= border.x + border.width - radius)
- curX = border.x + border.width - radius;
- if (curY <= border.y + radius)
- curY = border.y + radius;
- else if (curY >= border.y + border.height - radius)
- curY = border.y + border.height - radius;
- if (xGame.common.gameMgr.isOpenBall) {
- if (curX >= border.x + border.openBallW - radius)
- curX = border.x + border.openBallW - radius;
- }
- this.ui.moveNode.x = curX;
- this.ui.moveNode.y = curY;
- rootBall.gameObj.x = curX;
- rootBall.gameObj.y = curY;
- rootBall.d3BallSrc.setTransPos(curX, curY);
- this.isMoveRod = true;
- break;
- case PressType.rulerNode:
- let yy = e.stageY - this.eventObj.lastY;
- this.eventObj.lastY = e.stageY;
- let ruler1 = this.ui.rulerNode.img1;
- let ruler2 = this.ui.rulerNode.img2;
- ruler1.y += yy;
- ruler2.y += yy;
- this.rulerOffset += yy;
- if (Math.abs(this.rulerOffset) >= this.rulerDis) {
- this.rulerOffset = 0;
- xGame.soundMgr.playSound("inch", 1, 10);
- }
- xGame.common.d2World.d2Gan.rotateSelf(yy, true);
- let h = ruler1.height;
- this.checkGuide();
- this.isMoveRod = true;
- if (ruler1.y >= h) {
- ruler1.y = -h;
- ruler2.y = 0;
- return;
- }
- else if (ruler1.y <= -h) {
- ruler1.y = h;
- ruler2.y = 0;
- return;
- }
- if (ruler2.y >= h) {
- ruler2.y = -h;
- ruler1.y = 0;
- return;
- }
- else if (ruler2.y <= -h) {
- ruler2.y = h;
- ruler1.y = 0;
- return;
- }
- break;
- case PressType.d2Root:
- this.eventObj.curX = e.stageX;
- this.eventObj.curY = e.stageY;
- let offset = this.checkRodMoveDir();
- xGame.common.d2World.d2Gan.rotateSelf(offset);
- this.eventObj.lastX = e.stageX;
- this.eventObj.lastY = e.stageY;
- break;
- default:
- break;
- }
- }
- onEventUp(e) {
- if (e.stopPropagation)
- e.stopPropagation();
- if (e && e.force) {
- }
- else {
- if (!this.isTurnSelf())
- return;
- }
- switch (this.pressTarget) {
- case PressType.powerNode:
- this.ui.powerNode.value = 0;
- this.ui.powerNode.showImg.y = this.barInfo.showStarY;
- this.ui.powerTxt.text = "";
- if (this.powerNum > 0) {
- xGame.eventMgr.event(BALL_SHOOT);
- xGame.common.d2World.shoot(this.powerNum);
- xGame.common.d2World.d2Gan.shoot();
- xGame.common.d2World.d2HelpLine.shoot();
- this.finishGuide();
- this.ui.powerEft.visible = false;
- this.ui.colorNode.visible = false;
- let ganStr = "";
- if (this.powerNum <= 30) {
- ganStr = "gan_30";
- }
- else if (this.powerNum <= 60) {
- ganStr = "gan_50";
- }
- else {
- ganStr = "gan_80";
- }
- xGame.soundMgr.playSound(ganStr);
- }
- break;
- case PressType.moveNode:
- let rootBall = xGame.common.d2World.rootBall;
- let lastX = xGame.common.gameMgr.lastRootBallPos.x;
- let lastY = xGame.common.gameMgr.lastRootBallPos.y;
- let isIntersect = this.judgeBallIntersect();
- if (isIntersect) {
- this.ui.moveNode.x = lastX;
- this.ui.moveNode.y = lastY;
- rootBall.gameObj.x = lastX;
- rootBall.gameObj.y = lastY;
- rootBall.d3BallSrc.setTransPos(lastX, lastY);
- xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
- }
- else {
- xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
- xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
- }
- this.showBallUI();
- this.ui.moveNode.finger.visible = true;
- xGame.common.d2World.getHelpLine();
- break;
- case PressType.rulerNode:
- break;
- case PressType.d2Root:
- let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
- if (dis <= 25) {
- this.moveToClickDot(e);
- }
- break;
- default:
- break;
- }
- this.pressTarget = -1;
- }
- checkGuide() {
- let guide = DataMgr.getSkillGuide();
- if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
- xGame.common.guideStep++;
- xGame.common.gameUI.ui.guide2.visible = false;
- xGame.common.gameUI.ui.guide3.visible = true;
- }
- }
- finishGuide() {
- let guide = DataMgr.getSkillGuide();
- if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
- xGame.common.guideStep = 10;
- this.closeAllGuide();
- }
- }
- closeAllGuide() {
- xGame.common.gameUI.ui.guide1.visible = false;
- xGame.common.gameUI.ui.guide2.visible = false;
- xGame.common.gameUI.ui.guide3.visible = false;
- }
- updateBarInfo() {
- let star = this.ui.powerNode.y;
- let rate = (this.barInfo.curY - star) / this.barInfo.height;
- if (rate >= 1)
- rate = 1;
- if (rate <= 0)
- rate = 0;
- this.powerNum = Math.ceil(rate * 100);
- this.ui.powerNode.value = this.powerNum;
- this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
- this.ui.colorNode.value = this.powerNum;
- this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
- this.ui.powerEft.visible = this.powerNum != 0;
- this.ui.colorNode.visible = this.powerNum != 0;
- this.ui.powerTxt.text = this.powerNum + "";
- xGame.common.d2World.d2Gan.storagePower(this.powerNum);
- }
- forceCancel() {
- this.ui.powerNode.value = 0;
- this.ui.powerNode.showImg.y = this.barInfo.showStarY;
- this.ui.powerTxt.text = "";
- }
- checkRodMoveDir() {
- let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
- let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
- if (tempX >= 0 && tempY <= 0) {
- return this.checkDir();
- }
- else if (tempX < 0 && tempY < 0) {
- return this.checkDir(1, -1);
- }
- else if (tempX < 0 && tempY > 0) {
- return this.checkDir(-1, -1);
- }
- else {
- return this.checkDir(-1, 1);
- }
- }
- checkDir(flagX = 1, flagY = 1) {
- let offsetX = this.eventObj.curX - this.eventObj.lastX;
- let offsetY = this.eventObj.curY - this.eventObj.lastY;
- if (offsetY == 0) {
- return offsetX * flagX;
- }
- if (offsetX == 0) {
- return offsetY * flagY;
- }
- let angle = offsetY / offsetX;
- if (Math.abs(angle) >= 1) {
- return offsetY * flagY;
- }
- else {
- return offsetX * flagX;
- }
- }
- judgeBallIntersect() {
- let rootBall = xGame.common.d2World.rootBall;
- let ballArr = xGame.common.d2World.ballArr;
- let radius = rootBall.gameObj.width / 2;
- let temp;
- let isIntersect = false;
- for (let index = 0; index < ballArr.length; index++) {
- temp = ballArr[index];
- if (temp.number == rootBall.number)
- continue;
- isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
- if (isIntersect) {
- break;
- }
- }
- return isIntersect;
- }
- hideBallUI() {
- let d2Gan = xGame.common.d2World.d2Gan;
- if (!d2Gan.ui.isDisposed)
- d2Gan.ui.visible = false;
- let d2Help = xGame.common.d2World.d2HelpLine;
- if (!d2Help.ui.isDisposed)
- d2Help.ui.visible = false;
- let rootBall = xGame.common.d2World.rootBall;
- if (!rootBall.destroyed) {
- rootBall.gameObj.active = false;
- }
- }
- showBallUI() {
- let d2Gan = xGame.common.d2World.d2Gan;
- if (!d2Gan.ui.isDisposed)
- d2Gan.ui.visible = true;
- let d2Help = xGame.common.d2World.d2HelpLine;
- if (!d2Help.ui.isDisposed)
- d2Help.ui.visible = true;
- let rootBall = xGame.common.d2World.rootBall;
- if (!rootBall.destroyed) {
- rootBall.gameObj.active = true;
- }
- }
- moveToClickDot(e) {
- if (!this.isMoveRod && !xGame.common.clickedBall) {
- let root = xGame.common.d2World.rootBall.gameObj;
- let xx = e.stageX - xGame.common.sysOffestNum;
- let yy = e.stageY;
- let x = xx - root.x;
- let y = yy - root.y;
- let angle = xGame.common.getfguiRotation(x, y);
- xGame.common.d2World.d2Gan.ui.rotation = angle;
- xGame.common.d2World.getHelpLine();
- }
- this.isMoveRod = false;
- xGame.common.clickedBall = false;
- }
- openAllEvent() {
- this.closeAllEvent();
- this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
- this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
- this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
- this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
- this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
- this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
- this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
- }
- closeAllEvent() {
- this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
- this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
- this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
- this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
- this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
- this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
- this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
- }
- resetGame() {
- this.closeAllEvent();
- this.hideBallUI();
- xGame.common.gameMgr.gamePause = true;
- }
- }
- UIGame$1.uiName = "UIGame";
- class UIAddCoin$1 extends UIBase {
- constructor() {
- super();
- this.coinNum = 2000;
- }
- onConstructor() {
- this.ui = ui_UIAddCoin.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
- this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
- }
- show() {
- super.show();
- this.ui.t0.play();
- }
- videoAddCoin() {
- console.log('zh:qjff_AD_for_UIAddCoin');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_UIAddCoin();
- }
- }
- qjff_AD_for_UIAddCoin() {
- xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
- this.hide();
- }
- }
- UIAddCoin$1.uiName = "UIAddCoin";
- class UIInvitation$1 extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UIInvitation.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
- }
- show() {
- super.show();
- }
- enterGame() {
- xGame.common.gameMode = GameMode.classic;
- DataMgr.setChallengeTimes(1);
- xGame.common.passAwardCoin = 2000;
- let need = xGame.common.classicNiceNeddCoin;
- if (DataMgr.coinEnough(need)) {
- DataMgr.setCoin(-need);
- xGame.eventMgr.event(RESTART_GAME, true);
- Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
- }
- else {
- xGame.eventMgr.event(RESTART_GAME, true);
- }
- this.hide();
- }
- hide() {
- super.hide();
- }
- }
- UIInvitation$1.uiName = "UIInvitation";
- class UIPower$1 extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UIPower.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
- this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
- }
- show() {
- super.show();
- this.ui.t0.play();
- }
- videoGetPower() {
- console.log('zh:qjff_AD_for_uipower');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_uipower();
- }
- }
- qjff_AD_for_uipower() {
- DataMgr.setPower(xGame.common.videoPower, true);
- xGame.eventMgr.event(POWER_TIME);
- this.hide();
- }
- }
- UIPower$1.uiName = "UIPower";
- class UIGameEnd$1 extends UIBase {
- constructor() {
- super();
- this.success = false;
- this.awardCoinNum = 1000;
- this.awardDiamondNum = 10;
- }
- onConstructor() {
- this.ui = ui_UIGameEnd.createInstance();
- this.contentPane = this.ui;
- this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
- this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
- this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
- this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
- this.ui.talkNode.visible = false;
- if (Moyu.isKs)
- this.ui.closeNode.closeBtn.x += 100;
- }
- updateType() {
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- this.ui.c1.selectedIndex = this.success ? 0 : 1;
- this.ui.coinNode.visible = this.success;
- if (!this.success) {
- Laya.timer.once(500, this, () => {
- xGame.uiMgr.Show(UIAddCoin$1);
- });
- }
- this.ui.isGetAward.visible = false;
- this.ui.leftBtn.c1.selectedIndex = 3;
- this.ui.rightBtn.c1.selectedIndex = 0;
- this.moneyNode.ui.c1.selectedIndex = 1;
- break;
- case GameMode.bigMove:
- this.ui.c1.selectedIndex = this.success ? 0 : 1;
- this.ui.coinNode.visible = this.success;
- if (xGame.common.gameMode == GameMode.bigMove) {
- if (this.success) {
- DataMgr.setSkillSuccessTimes(1, true);
- DataMgr.setSkillAccTimes(1);
- }
- else {
- DataMgr.setSkillSuccessTimes(0, false);
- }
- }
- if (!this.success) {
- Laya.timer.once(500, this, () => {
- xGame.uiMgr.Show(UIAddCoin$1);
- });
- }
- this.ui.isGetAward.visible = false;
- this.ui.leftBtn.c1.selectedIndex = 3;
- this.ui.rightBtn.c1.selectedIndex = 0;
- this.moneyNode.ui.c1.selectedIndex = 1;
- break;
- case GameMode.placeBall:
- this.ui.coinNode.visible = false;
- if (this.success) {
- if (xGame.common.placeBallStarNum == 3) {
- this.ui.c1.selectedIndex = 2;
- }
- else {
- this.ui.c1.selectedIndex = 3;
- }
- }
- else {
- this.ui.c1.selectedIndex = 4;
- }
- let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
- if (cfg.type == PlaceBallType.challenge) {
- this.ui.c1.selectedIndex = 2;
- }
- this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
- this.updatePlaceBallBtn();
- this.updatePlaceBallStarNum();
- this.updatePlaceBallAwardState();
- this.moneyNode.ui.c1.selectedIndex = 2;
- this.moneyNode.checkPowerTime();
- this.moneyNode.powerChange();
- DataMgr.upRankData();
- break;
- default:
- break;
- }
- }
- updatePlaceBallBtn() {
- this.ui.leftBtn.c1.selectedIndex = 5;
- if (this.success) {
- this.ui.rightBtn.c1.selectedIndex = 14;
- }
- else {
- if (xGame.common.placeBallStarNum == 3) {
- this.ui.rightBtn.c1.selectedIndex = 14;
- }
- else {
- this.ui.rightBtn.c1.selectedIndex = 1;
- }
- }
- }
- updatePlaceBallStarNum() {
- let starNum = xGame.common.placeBallStarNum;
- if (starNum == 0)
- this.ui.starNumNode.c1.selectedIndex = 3;
- else {
- this.ui.starNumNode.c1.selectedIndex = starNum - 1;
- }
- }
- updatePlaceBallAwardState() {
- let level = xGame.common.placeBallCurLevel;
- let starNum = xGame.common.placeBallStarNum;
- let getAward = DataMgr.getPlaceBallLevel(level).getAward;
- let data = cfgTable.placeballData[level].award;
- let cfg = cfgTable.placeballData[level];
- this.awardDiamondNum = data[1];
- this.awardCoinNum = data[0];
- if (cfg.type == PlaceBallType.challenge) {
- this.awardDiamondNum = 0;
- this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
- }
- this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
- this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
- if (cfg.type == PlaceBallType.challenge) {
- this.ui.awardNode.coinNode.visible = true;
- }
- if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
- this.ui.awardNode.diamondNode.x = 265;
- this.ui.awardNode.coinNode.x = 354;
- }
- else {
- this.ui.awardNode.diamondNode.x = 291;
- this.ui.awardNode.coinNode.x = 291;
- }
- this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
- this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
- if (this.awardCoinNum == 0) {
- this.ui.awardNode.coinNode.numTxt.text = "";
- }
- if (getAward) {
- this.ui.isGetAward.visible = true;
- this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
- this.ui.awardNode.coinNode.c1.selectedIndex = 2;
- }
- else {
- this.ui.isGetAward.visible = false;
- if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
- this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
- this.ui.awardNode.coinNode.c1.selectedIndex = 0;
- }
- else {
- this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
- this.ui.awardNode.coinNode.c1.selectedIndex = 1;
- }
- }
- }
- show(success) {
- super.show();
- xGame.eventMgr.event(RESET_GAME);
- this.success = success;
- Laya.timer.clearAll(this);
- this.playSecretaryAni();
- Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
- let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
- offsetTime = Math.floor(offsetTime / 1000);
- Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
- this.updateType();
- Laya.timer.once(200, this, () => {
- this.addAward(() => {
- this.updateType();
- Laya.timer.once(500, this, () => {
- this.showChallengeLevel();
- });
- });
- });
- if (this.success) {
- xGame.soundMgr.playSound('slots_roll01');
- xGame.soundMgr.playSound("s_win");
- xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
- }
- else {
- xGame.soundMgr.playSound('matchwin01');
- xGame.soundMgr.playSound("s_lose");
- xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
- }
- if (!Moyu.isLegal)
- PlatMgr.showBanner(true);
- let challengeNum = DataMgr.getChallengeTimes();
- if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
- DataMgr.setChallengeTimes(1);
- }
- if (this.success && xGame.common.gameMode == GameMode.classic) {
- DataMgr.setClassicTimes();
- }
- }
- showChallengeLevel() {
- if (DataMgr.getChallengeTimes() != 0)
- return;
- let skill = DataMgr.getSkillAccTimes();
- let put = DataMgr.getPlaceBallLevelList().length;
- if (skill >= 3 || put >= 5) {
- xGame.uiMgr.Show(UIInvitation$1);
- this.hide();
- }
- }
- addAward(callback) {
- if (!this.success) {
- callback && callback();
- return;
- }
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- this.awardCoinNum = xGame.common.passAwardCoin;
- this.awardDiamondNum = 0;
- xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
- break;
- case GameMode.bigMove:
- this.awardCoinNum = xGame.common.passAwardCoin;
- this.awardDiamondNum = 0;
- xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
- callback && callback();
- break;
- case GameMode.placeBall:
- let level = xGame.common.placeBallCurLevel;
- Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
- if (xGame.common.placeBallStarNum != 3) {
- callback && callback();
- return;
- }
- else {
- let getAward = DataMgr.getPlaceBallLevel(level).getAward;
- if (getAward) {
- callback && callback();
- return;
- }
- }
- let cfg = cfgTable.placeballData[level];
- let data = cfgTable.placeballData[level].award;
- this.awardCoinNum = data[0];
- this.awardDiamondNum = data[1];
- if (cfg.type == PlaceBallType.challenge) {
- this.awardDiamondNum = 0;
- this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
- }
- let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
- let diamondAward;
- if (this.awardDiamondNum > 0) {
- diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
- xGame.common.getAward([diamondAward, coinAward], callback);
- }
- else {
- xGame.common.getAward([coinAward], callback);
- }
- if (cfg.type == PlaceBallType.normal) {
- DataMgr.setPlaceBallAward(level);
- }
- break;
- default:
- break;
- }
- }
- playSecretaryAni_old() {
- let parent = this.ui.secretary.displayObject;
- parent.destroyChildren();
- let xx = this.ui.secretary.width / 2;
- let yy = this.ui.secretary.height;
- let scale = xGame.common.getSecretaryScale();
- let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
- if (this.success) {
- let rand = Math.random() <= 0.5 ? 2 : 3;
- xGame.common.secretary.play(data, rand, false, parent, () => {
- xGame.common.secretary.play(data, 1, true, parent);
- });
- }
- else {
- xGame.common.secretary.play(data, 0, true, parent);
- }
- }
- playSecretaryAni() {
- let parent = this.ui.secretary.displayObject;
- parent.destroyChildren();
- let xx = this.ui.secretary.width / 2;
- let yy = this.ui.secretary.height;
- let scale = xGame.common.getSecretaryScale();
- let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
- if (this.success) {
- let rand = 0;
- xGame.common.secretary.play(data, 0, true, parent);
- }
- else {
- xGame.common.secretary.play(data, 0, true, parent);
- }
- }
- restartGame() {
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- xGame.eventMgr.event(RESTART_GAME);
- Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
- break;
- case GameMode.bigMove:
- this.hide();
- xGame.eventMgr.event(RESTART_GAME);
- Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
- break;
- default:
- break;
- }
- }
- hide() {
- super.hide();
- xGame.common.stopGirlPop(this.ui.talkNode);
- PlatMgr.showBanner(false);
- }
- returnHome() {
- this.hide();
- let showFailWords = !this.success;
- xGame.uiMgr.Show(UIMain$1, showFailWords);
- }
- clickLeftBtn() {
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- case GameMode.bigMove:
- this.returnHome();
- break;
- case GameMode.placeBall:
- let level = xGame.common.placeBallCurLevel;
- this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
- Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
- break;
- default:
- break;
- }
- }
- powerStartPlaceBallLevel(level, btn) {
- if (DataMgr.powerEnough()) {
- btn.touchable = false;
- btn.powerEft.t0.play(Laya.Handler.create(this, () => {
- btn.touchable = true;
- DataMgr.setPower(-1);
- xGame.eventMgr.event(POWER_TIME);
- this.startPlaceBallLevel(level);
- }));
- }
- else {
- xGame.uiMgr.Show(UIPower$1, 0);
- }
- }
- clickRightBtn() {
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- console.log('zh:clickRightBtn 111');
- case GameMode.bigMove:
- console.log('zh:clickRightBtn 222');
- this.restartGame();
- break;
- case GameMode.placeBall:
- console.log('zh:clickRightBtn 333');
- let level = xGame.common.placeBallCurLevel;
- let data = DataMgr.getPlaceBallLevel(level);
- let curPss = data.play && !data.isCur;
- if (curPss) {
- console.log('zh:clickRightBtn 333-111');
- console.log('zh:当前LV=' + level);
- if (level == 60) {
- xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
- Laya.timer.once(3000, this, () => {
- this.returnHome();
- });
- }
- else {
- this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
- }
- }
- else {
- console.log('zh:clickRightBtn 333-000');
- Moyu.sendDataEvent("placeBallNextLevel");
- console.log('zh:qjff_AD_for_uiGameEnd');
- Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_uiGameEnd(level);
- }
- }
- break;
- default:
- console.log('zh:clickRightBtn 444');
- break;
- }
- }
- qjff_AD_for_uiGameEnd(level) {
- DataMgr.setPlaceBallLevel(level, 1);
- this.startPlaceBallLevel(level + 1);
- }
- startPlaceBallLevel(level) {
- xGame.common.gameMode = GameMode.placeBall;
- xGame.common.placeBallCurLevel = level;
- xGame.uiMgr.Show(UIGame$1);
- this.hide();
- }
- }
- UIGameEnd$1.uiName = "UIGameEnd";
- class ShowItem$1 {
- constructor() {
- this.ui = ui_ShowItem.createInstance();
- }
- destroySelf() {
- if (!this.ui.isDisposed) {
- this.ui.removeFromParent();
- this.ui.dispose();
- }
- }
- setParent(parent) {
- parent.addChild(this.ui);
- }
- setPos(x, y) {
- this.ui.x = x;
- this.ui.y = y;
- }
- setUrl(index) {
- this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
- }
- }
- class UILevelProp$1 extends UIBase {
- constructor() {
- super();
- this.firstPos = 385;
- this.secondPos = 467;
- this.showItemArr = [];
- }
- onFontLoaded() {
- try {
- this.ui.myNode.conditionTxt.font = "arial";
- console.log("zh: onFontLoaded 设置arial字体成功");
- }
- catch (error) {
- console.log("zh: constructor onFontLoaded加载arial字体失败");
- }
- }
- onConstructor() {
- this.ui = ui_UILevelProp.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.closeBtn, this.hide);
- this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
- this.addUIClick(this.ui.myNode.startBtn, this.startGame);
- }
- show(level) {
- super.show();
- this.ui.t1.play();
- this.level = level;
- this.data = cfgTable.placeballData[this.level];
- this.updateSelf();
- this.showPreView();
- this.moneyNode.ui.c1.selectedIndex = 2;
- this.moneyNode.checkPowerTime();
- this.moneyNode.powerChange();
- }
- showPreView() {
- let item;
- let data;
- for (let index = 0; index < this.showItemArr.length; index++) {
- item = this.showItemArr[index];
- item.destroySelf();
- }
- this.showItemArr = [];
- let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
- for (const key in cfgData) {
- data = cfgData[key];
- item = new ShowItem$1();
- item.setParent(this.ui.myNode.displayRoot);
- item.setPos(data.x, data.y);
- item.setUrl(data.value);
- this.showItemArr.push(item);
- }
- }
- updateSelf() {
- this.ui.myNode.levelTxt.text = `Level ${this.level}`;
- this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
- if (this.data.ball == -1) {
- this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
- }
- else {
- this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
- }
- let localData = DataMgr.getPlaceBallLevel(this.level);
- let getAward = localData.getAward;
- let cfg = cfgTable.placeballData[this.level];
- let coin = this.data.award[0];
- let diamond = this.data.award[1];
- if (cfg.type == PlaceBallType.challenge) {
- diamond = 0;
- coin = 100;
- }
- this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
- this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
- this.ui.myNode.coinNode.numTxt.text = coin + "";
- if (cfg.type == PlaceBallType.challenge) {
- this.ui.myNode.coinNode.numTxt.text = "";
- }
- this.ui.myNode.diamondNode.numTxt.text = diamond + "";
- if (coin > 0 && diamond > 0) {
- this.ui.myNode.diamondNode.x = 385;
- this.ui.myNode.coinNode.x = 467;
- }
- else {
- this.ui.myNode.diamondNode.x = 385;
- this.ui.myNode.coinNode.x = 385;
- }
- if (!getAward) {
- this.ui.myNode.coinNode.c1.selectedIndex = 0;
- this.ui.myNode.diamondNode.c1.selectedIndex = 0;
- }
- else {
- this.ui.myNode.diamondNode.c1.selectedIndex = 1;
- this.ui.myNode.coinNode.c1.selectedIndex = 1;
- }
- }
- startGame() {
- if (DataMgr.powerEnough()) {
- this.ui.myNode.startBtn.touchable = false;
- this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
- console.log('zh:startGame ');
- this.ui.myNode.startBtn.touchable = true;
- DataMgr.setPower(-1);
- xGame.eventMgr.event(POWER_TIME);
- xGame.common.gameMode = GameMode.placeBall;
- xGame.common.placeBallCurLevel = this.level;
- xGame.uiMgr.Show(UIGame$1);
- xGame.uiMgr.Hide(UILevelDisplay$1);
- xGame.uiMgr.Hide(UIMain$1);
- this.hide();
- }));
- }
- else {
- console.log('zh:startGame no power');
- xGame.uiMgr.Show(UIPower$1);
- }
- }
- hide() {
- super.hide();
- }
- }
- UILevelProp$1.uiName = "UILevelProp";
- class PutBallLevelDisplay$1 {
- constructor(ui, index) {
- this.index = 0;
- this.ui = ui;
- this.index = index;
- this.ui.onClick(this, this.clickSelf);
- this.updateSelf();
- this.ui.levelTxt.text = (this.index + 1) + "";
- this.ui.challenge.levelTxt.text = (this.index + 1) + "";
- this.ui.special.levelTxt.text = (this.index + 1) + "";
- }
- updateSelf() {
- let level = this.index + 1;
- this.data = DataMgr.getPlaceBallLevel(level);
- this.ui.starNode.c1.selectedIndex = this.data.star;
- let isChallenge = cfgTable.placeballData[level].type;
- if (this.data.isCur) {
- if (isChallenge) {
- this.ui.c1.selectedIndex = 5;
- }
- else {
- this.ui.c1.selectedIndex = 2;
- }
- }
- else {
- if (this.data.play) {
- if (this.data.star == 3) {
- this.ui.c1.selectedIndex = 0;
- }
- else {
- this.ui.c1.selectedIndex = 1;
- }
- }
- else {
- if (isChallenge) {
- this.ui.c1.selectedIndex = 4;
- }
- else {
- this.ui.c1.selectedIndex = 3;
- }
- }
- }
- }
- clickSelf() {
- if (!this.data.play)
- return;
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
- }
- }
- class UILevelDisplay$1 extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UILevelDisplay.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.myList = this.ui.myNode.myList;
- this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
- this.levelItemArr = [];
- let levelNum = xGame.cfgMgr.getMaxPlaceBall();
- this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
- this.myList.numItems = levelNum;
- if (Moyu.isKs)
- this.ui.closeNode.closeBtn.x += 100;
- }
- levelItemRender(index, target) {
- let item = new PutBallLevelDisplay$1(target, index);
- this.levelItemArr.push(item);
- }
- show() {
- super.show();
- this.updateLevel();
- this.scrollToPlace();
- }
- updateLevel() {
- let temp;
- for (let index = 0; index < this.levelItemArr.length; index++) {
- temp = this.levelItemArr[index];
- temp.updateSelf();
- }
- }
- scrollToPlace() {
- let maxNum = xGame.cfgMgr.getMaxPlaceBall();
- let passArr = DataMgr.getPlaceBallLevelList();
- let offest = passArr.length;
- if (offest >= maxNum - 1)
- offest = maxNum - 1;
- this.myList.scrollToView(offest, true, true);
- }
- hide() {
- super.hide();
- }
- }
- UILevelDisplay$1.uiName = "UILevelDisplay";
- class UIMatching$1 extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UIMatching.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- }
- show(callback) {
- super.show();
- PlatMgr.showBanner(true);
- this.callback = callback;
- let user = Moyu.getUserInfo();
- if (!this.selfPot) {
- this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
- }
- if (!this.aiPot) {
- this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
- }
- this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
- this.ui.selfHead.nameTxt.text = user.nickName;
- xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
- this.ui.aiHead.nameTxt.text = "???";
- this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
- this.ui.selfHead.c1.selectedIndex = 0;
- this.ui.aiHead.c1.selectedIndex = 0;
- this.ui.selfHead.x = this.selfPot.x;
- this.ui.selfHead.y = this.selfPot.y;
- this.ui.aiHead.x = this.aiPot.x;
- this.ui.aiHead.y = this.aiPot.y;
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- break;
- case GameMode.bigMove:
- this.initSkillData();
- break;
- default:
- break;
- }
- this.ui.t1.play(Laya.Handler.create(this, () => {
- this.ui.t2.play(Laya.Handler.create(this, () => {
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- this.waitingPeople();
- break;
- case GameMode.bigMove:
- this.skillSelectFinish(xGame.common.curPlayerSkillType);
- break;
- default:
- break;
- }
- }));
- }));
- }
- initSkillData() {
- this.skillSelectData = [];
- let skillUrl = xGame.common.skillIconList;
- let skillName = xGame.common.skillNameList;
- let skillLevel = DataMgr.getBigSkillList();
- let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
- for (let index = 0; index < 5; index++) {
- let obj = {};
- obj.skillImg = skillUrl[index];
- obj.skillName = skillName[index];
- obj.skillType = skillType[index];
- obj.skillLevel = skillLevel[index];
- this.skillSelectData.push(obj);
- }
- }
- getAISkillLevel(myLevel) {
- let video = xGame.common.upSkillLevel;
- let aiLevel;
- let temp;
- if (video) {
- temp = xGame.common.randomNum(-2, -1);
- }
- else {
- if (myLevel <= 5) {
- temp = xGame.common.randomNum(1, 3);
- }
- else if (myLevel <= 9) {
- temp = xGame.common.randomNum(-2, 1);
- }
- else {
- temp = xGame.common.randomNum(-4, 0);
- }
- }
- aiLevel = temp + myLevel;
- if (aiLevel <= 1)
- aiLevel = 1;
- if (aiLevel >= 10)
- aiLevel = 10;
- return aiLevel;
- }
- getAISkillType() {
- return xGame.common.randomNum(1, 4);
- let successTimes = DataMgr.getSkillSuccessTimes();
- let info = cfgTable.aiskillData[successTimes];
- if (!info) {
- let max = Object.keys(cfgTable.aiskillData).length - 1;
- info = cfgTable.aiskillData[max];
- }
- let dataArr = info.skillselect;
- let myCfg = {};
- for (let index = 0; index < dataArr.length; index++) {
- let temp = dataArr[index].split('-');
- myCfg[temp[0]] = {};
- myCfg[temp[0]].id = parseInt(temp[0]);
- myCfg[temp[0]].weight = parseInt(temp[1]);
- }
- let aiCfg = xGame.common.initWeight(myCfg);
- let curData = xGame.common.getRandomWeightData(aiCfg);
- return parseInt(curData.id);
- }
- getAISkillData(index) {
- let myLevel = this.skillSelectData[index].skillLevel;
- let aiLevel = this.getAISkillLevel(myLevel);
- let aiType = this.getAISkillType() - 1;
- return { aiLevel, aiType } = { aiLevel, aiType };
- }
- skillSelectFinish(index) {
- let aiInfo = this.getAISkillData(index);
- xGame.common.gameMgr.selfCurSkill = index;
- xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
- xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
- this.ui.selfHead.c1.selectedIndex = 1;
- this.ui.aiHead.c1.selectedIndex = 1;
- let myData = this.skillSelectData[index];
- this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
- let guide = DataMgr.getSkillGuide();
- if (guide == 0) {
- this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
- }
- else {
- this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
- }
- let aiData = this.skillSelectData[aiInfo.aiType];
- this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
- this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
- this.waitingPeople();
- }
- waitingPeople() {
- let time = xGame.common.randomNum(1000, 3000);
- time += 1000;
- Laya.timer.once(time, this, () => {
- this.matchingSuccess();
- });
- }
- matchingSuccess() {
- let gameUI = xGame.common.gameUI;
- let name = gameUI.ui.topNode.aiNameTxt.text;
- let url = gameUI.ui.topNode.aiHeadLoader.url;
- this.ui.aiHead.nameTxt.text = name;
- this.ui.aiHead.headImg.url = url;
- name = gameUI.ui.topNode.selfNameTxt.text;
- url = gameUI.ui.topNode.selfHeadLoader.url;
- this.ui.selfHead.nameTxt.text = name;
- this.ui.selfHead.headImg.url = url;
- this.ui.t3.play(Laya.Handler.create(this, () => {
- this.callback && this.callback();
- this.ui.t4.play(Laya.Handler.create(this, () => {
- this.destroySelf();
- }));
- }));
- }
- destroySelf() {
- this.callback = null;
- this.skillSelectData = null;
- this.selfPot = null;
- this.aiPot = null;
- if (!this.ui.isDisposed) {
- this.ui.removeFromParent();
- this.ui.dispose();
- }
- xGame.uiMgr.destroyUI(this);
- }
- }
- UIMatching$1.uiName = "UIMatching";
- class SkillDisplay$1 {
- constructor(ui, data, uiIndex) {
- this.starX = 0;
- this.starY = 0;
- this.index = 0;
- this.ui = ui;
- this.data = data;
- this.index = uiIndex;
- this.initSelf();
- console.log('zh:SkillDisplay constructor this.skillData=', data);
- }
- initSelf() {
- this.ui.normalBtn.onClick(this, this.clickAddLevel);
- this.ui.nameTxt.text = this.data.name;
- this.ui.describeTxt.text = this.data.describe;
- this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
- this.ui.startBtn.onClick(this, this.startGame);
- this.updateSelf();
- }
- updateSelf() {
- this.checkTry();
- let level = DataMgr.getBigSkillByIndex(this.index);
- this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
- }
- checkTry() {
- let index = this.index;
- let level = DataMgr.getBigSkillByIndex(index);
- if (level == null) {
- DataMgr.setBigSkill(index, 1, false);
- level = 1;
- }
- this.ui.levelTxt.text = "LV." + level;
- if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
- this.ui.tryNode.visible = true;
- else
- this.ui.tryNode.visible = false;
- }
- clickAddLevel() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- Moyu.sendDataEvent("UpSkill", { id: this.data.index });
- console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
- if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
- this.qjff_AD_for_skilldisplay_clickAddLevel();
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_skilldisplay_clickAddLevel();
- }
- }
- qjff_AD_for_skilldisplay_clickAddLevel() {
- DataMgr.setBigSkill(this.data.index, 1);
- this.updateSelf();
- xGame.common.upSkillLevel = true;
- }
- startGame() {
- if (this.data.index == 3) {
- alert('Coming soon!');
- return;
- }
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- let needCoin = xGame.common.bigMoveNeedCoin;
- xGame.common.passAwardCoin = 2000;
- let guide = DataMgr.getSkillGuide();
- console.log('zh:startGame guide=' + guide);
- xGame.common.temSelfLevel = 0;
- if (guide == 0) {
- needCoin = 0;
- xGame.common.temSelfLevel = 100;
- }
- if (DataMgr.coinEnough(needCoin)) {
- DataMgr.setCoin(-needCoin);
- xGame.common.curPlayerSkillType = this.index;
- if (guide == 0)
- xGame.common.curPlayerSkillType = 0;
- xGame.uiMgr.Show(UIGame$1);
- xGame.uiMgr.Hide(UIMain$1);
- xGame.uiMgr.Show(UIMatching$1, () => {
- xGame.common.gameUI.ui.alpha = 1;
- xGame.common.gameUI.startGame();
- xGame.uiMgr.Hide(UISkill$1);
- });
- }
- else {
- xGame.uiMgr.Show(UIAddProp$1, 0);
- Moyu.sendDataEvent("AddCoinVideo");
- }
- }
- }
- class UISkill$1 extends UIBase {
- constructor() {
- super();
- this.skillData = [];
- }
- onConstructor() {
- this.ui = ui_UISkill.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
- this.initSkillData();
- console.log('zh:aaaaaa1111111111');
- this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
- this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
- console.log('zh:aaaaaa22222222');
- this.displayList = [];
- this.ui.skillNode.skillList.numItems = 3;
- this.addUIClick(this.ui, this.interuptSecretary);
- this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
- this.ui.talkNode.visible = false;
- if (Moyu.isKs)
- this.ui.closeNode.closeBtn.x += 100;
- }
- show() {
- super.show();
- this.playSecretaryIdle();
- this.moneyNode.ui.c1.selectedIndex = 1;
- Laya.timer.clearAll(this);
- xGame.soundMgr.playSound("s_start");
- xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
- let guide = DataMgr.getSkillGuide();
- this.ui.guideNode.visible = guide == 0;
- let item = this.getSkillItemByUIIndex(0);
- if (guide == 0) {
- item.ui.c1.selectedIndex = 1;
- }
- else {
- item.ui.c1.selectedIndex = 0;
- }
- this.ui.guideNode.guideBtn.visible = guide == 0;
- for (let index = 0; index < this.displayList.length; index++) {
- this.displayList[index].checkTry();
- }
- }
- getSkillItemByUIIndex(cur) {
- for (let index = 0; index < this.displayList.length; index++) {
- if (this.displayList[index].index == cur) {
- return this.displayList[index];
- }
- }
- }
- enterGuideLevel() {
- let item = this.getSkillItemByUIIndex(0);
- item.startGame();
- if (DataMgr.getNewUser())
- Moyu.sendDataEvent("gameStart1");
- }
- initSkillData() {
- this.skillData = [];
- let nameList = xGame.common.skillNameList;
- let iconList = xGame.common.skillIconList;
- let describeList = [
- "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
- "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
- "The power of frost descends—freezing the flow and taking full control of the game!"
- ];
- console.log('zh:initSkillData 111111111');
- let data;
- for (let index = 0; index < nameList.length; index++) {
- data = {};
- data.name = nameList[index];
- data.icon = iconList[index];
- data.describe = describeList[index];
- data.index = index;
- this.skillData.push(data);
- }
- }
- updateSkillItem(index, target) {
- if (this.displayList[index] == null) {
- let uiIndex;
- switch (index) {
- case 0:
- uiIndex = 1;
- break;
- case 1:
- uiIndex = 0;
- break;
- case 2:
- uiIndex = 2;
- break;
- case 3:
- uiIndex = 3;
- break;
- default:
- break;
- }
- let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
- this.displayList.push(temp);
- }
- }
- playSecretaryIdle() {
- let parent = this.ui.secretary.displayObject;
- parent.destroyChildren();
- let xx = this.ui.secretary.width / 2;
- let yy = this.ui.secretary.height;
- let scale = xGame.common.getSecretaryScale();
- let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
- xGame.common.secretary.play(data, 0, true, parent);
- }
- returnUIMain() {
- this.hide();
- xGame.common.stopGirlPop(this.ui.talkNode);
- xGame.uiMgr.Show(UIMain$1);
- }
- interuptSecretary() {
- Laya.timer.clearAll(this);
- this.playSecretaryRandomSound();
- }
- playSecretaryRandomSound() {
- if (this.isHide)
- return;
- let time = xGame.common.randomNum(45000, 60000);
- Laya.timer.once(time, this, () => {
- if (this.isHide)
- return;
- let index = xGame.common.randomNum(4, 7);
- xGame.soundMgr.playSound("s_main0" + index);
- let words = 1;
- switch (index) {
- case 4:
- words = 5;
- break;
- case 5:
- words = 3;
- break;
- case 6:
- words = 6;
- break;
- case 7:
- words = 7;
- break;
- default:
- break;
- }
- xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
- this.playSecretaryRandomSound();
- });
- }
- }
- UISkill$1.uiName = "UISkill";
- class UIAddProp$1 extends UIBase {
- constructor() {
- super();
- this.curType = "";
- }
- onConstructor() {
- this.ui = ui_UIAddProp.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.closeBtn, this.closeSelf);
- this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
- this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
- this.updateUI();
- this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
- this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
- this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
- this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
- this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
- this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
- }
- show(type) {
- super.show();
- this.curType = type == 0 ? "coin" : "diamond";
- this.switchBtn("");
- this.ui.t0.play();
- this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
- PlatMgr.showInsert(true);
- }
- closeSelf() {
- this.hide();
- }
- updateUI() {
- let data = cfgTable.moneyData;
- let temp;
- let obj;
- for (const key in data) {
- temp = data[key];
- obj = this.ui.myNode["node" + key];
- if (parseInt(key) <= 2) {
- obj.diamondTxt.text = "+" + temp.num;
- }
- else {
- obj.coinTxt.text = temp.num;
- obj.diamondTxt.text = temp.get.split('_')[1];
- }
- }
- this.updateDiamondShare();
- }
- updateDiamondShare() {
- let data = DataMgr.getShareDiamondTimes();
- if (data >= xGame.common.maxShareDiamondTimes) {
- this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
- this.ui.myNode.node1.touchable = false;
- xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
- }
- else {
- this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
- this.ui.myNode.node1.touchable = true;
- }
- }
- switchBtn(type) {
- if (type == "")
- type = this.curType;
- else {
- if (this.curType == type) {
- return;
- }
- else {
- this.curType = type;
- }
- }
- if (type == "coin") {
- this.ui.myNode.coinBtn.c1.selectedIndex = 0;
- this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
- this.ui.myNode.coinBtn.displayObject.zOrder = 10;
- this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
- this.ui.myNode.c1.selectedIndex = 0;
- }
- else {
- this.ui.myNode.coinBtn.c1.selectedIndex = 1;
- this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
- this.ui.myNode.coinBtn.displayObject.zOrder = 9;
- this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
- this.ui.myNode.c1.selectedIndex = 1;
- }
- }
- convertCoin(index) {
- let data = cfgTable.moneyData[index];
- let coinNum = data.num;
- let str = data.get.split('_')[1];
- let needDiamond = parseInt(str);
- if (DataMgr.diamondEnough(needDiamond)) {
- DataMgr.setDiamond(-needDiamond);
- xGame.common.playObjFlyAnim(coinNum, Prop.coin);
- xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
- }
- else {
- xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
- this.switchBtn("diamond");
- }
- }
- videoGetDiamond() {
- console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_uiAddProp_videoGetDiamond();
- }
- }
- qjff_AD_for_uiAddProp_videoGetDiamond() {
- let num = cfgTable.moneyData[2].num;
- xGame.common.playObjFlyAnim(num, Prop.diamond);
- this.closeSelf();
- }
- videoGetCoin() {
- console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_uiAddProp_videoGetCoin();
- }
- }
- qjff_AD_for_uiAddProp_videoGetCoin() {
- xGame.common.playObjFlyAnim(2000, Prop.coin);
- this.closeSelf();
- }
- shareGetDiamond() {
- let times = DataMgr.getShareDiamondTimes();
- if (times >= xGame.common.maxShareDiamondTimes) {
- console.log('zh: 233333333333 maxShareDiamondTimes');
- xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
- }
- else {
- console.log('zh:33333333333333ad');
- console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_uiAddProp_shareGetDiamond();
- }
- }
- }
- qjff_AD_for_uiAddProp_shareGetDiamond() {
- let diamond = xGame.common.randomNum(50, 100);
- xGame.common.playObjFlyAnim(diamond, Prop.diamond);
- DataMgr.setShareDiamondTimes(1);
- this.updateDiamondShare();
- }
- openPutBallView() {
- let end = xGame.uiMgr.getUI(UIGameEnd$1);
- let skill = xGame.uiMgr.getUI(UISkill$1);
- let level = xGame.uiMgr.getUI(UILevelDisplay$1);
- let uigame = xGame.uiMgr.getUI(UIGame$1);
- if (end && !end.isHide) {
- xGame.uiMgr.Hide(UIGameEnd$1);
- xGame.uiMgr.Show(UIMain$1);
- }
- if (skill && !skill.isHide)
- xGame.uiMgr.Hide(UISkill$1);
- if (uigame && !uigame.isHide)
- xGame.uiMgr.Hide(UIGame$1);
- if (level && !level.isHide) {
- }
- else {
- xGame.uiMgr.Show(UILevelDisplay$1);
- }
- this.closeSelf();
- }
- }
- UIAddProp$1.uiName = "UIAddProp";
- class MoneyNode$1 {
- constructor(ui) {
- this.leftTime = 0;
- this.ui = ui;
- this.ui.addCoinBtn.onClick(this, this.addCoin);
- this.ui.addDiamondBtn.onClick(this, this.addDiamond);
- this.ui.addPowerBtn.onClick(this, this.addPower);
- this.ui.c1.selectedIndex = 1;
- xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
- xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
- xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
- xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
- this.coinChange();
- this.diamondChange();
- this.powerChange();
- }
- addPower() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- xGame.uiMgr.Show(UIPower$1);
- }
- powerChange() {
- let powerNum = DataMgr.getPower();
- this.ui.powerTxt.text = powerNum + "";
- }
- checkPowerTime() {
- let cur = new Date().getTime();
- let last = DataMgr.getPowerTime();
- if (last == 0) {
- last = cur;
- DataMgr.setPowerTime(cur);
- }
- let power = DataMgr.getPower();
- let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
- Laya.timer.clearAll(this);
- if (power >= xGame.common.natureMaxPower) {
- this.ui.powerTimeTxt.text = "";
- DataMgr.setPowerTime(cur);
- return;
- }
- if (power + offset >= xGame.common.natureMaxPower) {
- DataMgr.setPower(xGame.common.natureMaxPower, false);
- this.ui.powerTimeTxt.text = "";
- DataMgr.setPowerTime(cur);
- }
- else {
- if (offset > 0) {
- DataMgr.setPower(offset);
- DataMgr.setPowerTime(cur);
- }
- let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
- this.leftTime = xGame.common.powerRecoverNum - time;
- if (this.leftTime <= 0)
- this.leftTime = 0;
- this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
- Laya.timer.loop(1000, this, this.updatePowerTime);
- }
- }
- updatePowerTime() {
- this.leftTime -= 1;
- this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
- if (this.leftTime <= 0) {
- this.checkPowerTime();
- }
- }
- coinChange() {
- this.ui.coinTxt.text = DataMgr.getCoin() + "";
- }
- diamondChange() {
- this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
- }
- addCoin() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- Moyu.sendDataEvent("AddCoinBtn");
- xGame.uiMgr.Show(UIAddProp$1, 0);
- }
- addDiamond() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- Moyu.sendDataEvent("AddDiamondBtn");
- xGame.uiMgr.Show(UIAddProp$1, 1);
- }
- }
- class SettingNode$1 {
- constructor(ui) {
- this.showSetting = false;
- this.openSound = true;
- this.openShake = true;
- this.ui = ui;
- this.ui.soundBtn.onClick(this, this.switchSound);
- this.ui.shakeBtn.onClick(this, this.switchShake);
- this.ui.xyBtn.onClick(this, this.onXy);
- this.ui.clickNode.onClick(this, this.changeSetting);
- this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
- this.ui.xyBtn.visible = false;
- this.ui.shakeBtn.visible = false;
- }
- changeSetting() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- this.showSetting = !this.showSetting;
- this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
- }
- switchSound() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- this.openSound = !this.openSound;
- Moyu.onSetting(this.openSound, this.openShake);
- xGame.soundMgr.onSetting(this.openSound);
- this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
- }
- switchShake() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- this.openShake = !this.openShake;
- Moyu.onSetting(this.openSound, this.openShake);
- this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
- }
- onXy() {
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- MoyuMgr$1.showXy(1);
- }
- }
- class UIDraw$1 extends UIBase {
- constructor() {
- super();
- this.curKey = 0;
- }
- onConstructor() {
- this.ui = ui_UIDraw.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
- this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
- this.addUIClick(this.ui.drawBtn, this.startDraw);
- this.initDraw();
- this.initUI();
- this.ui.myNode.flashNode.c1.selectedIndex = 1;
- if (Moyu.isKs)
- this.ui.closeNode.closeBtn.x += 100;
- }
- show() {
- super.show();
- this.ui.t0.play();
- this.playSecretaryIdle();
- this.updateDraw();
- this.checkFree();
- if (PlatMgr.bannerDelay > 0) {
- this.ui.closeNode.closeBtn.visible = false;
- Laya.timer.once(PlatMgr.bannerDelay, this, () => {
- this.ui.closeNode.closeBtn.visible = true;
- });
- }
- PlatMgr.showRateBanner();
- }
- hide() {
- Laya.timer.clearAll(this);
- super.hide();
- }
- checkFree() {
- let isFree = DataMgr.getDailyfreeDrawTimes();
- this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
- }
- initDraw() {
- this.drawObj = [];
- let data = cfgTable.drawData;
- let temp;
- let weight = 0;
- for (const key in data) {
- temp = data[key];
- weight += temp.weight;
- this.drawObj.push(weight);
- }
- this.allWeight = weight;
- }
- initUI() {
- let data = cfgTable.drawData;
- let temp;
- let img;
- let txt;
- for (const key in data) {
- temp = data[key];
- img = this.ui.myNode.rotNode["img" + key];
- txt = this.ui.myNode.rotNode["txt" + key];
- img.url = xGame.common.getGameIconUrl(temp.icon);
- txt.visible = true;
- if (temp.award > 2) {
- img.rotation = 0;
- txt.text = cfgTable.ballrodData[temp.award - 1].name;
- }
- else {
- img.rotation = temp.rotation;
- txt.text = temp.num;
- }
- }
- }
- getCurkey() {
- let rand = Math.random() * this.allWeight;
- let temp;
- for (let index = 0; index < this.drawObj.length - 1; index++) {
- temp = this.drawObj[index];
- if (index == 0) {
- if (rand < temp) {
- return index + 1;
- }
- }
- else {
- if (rand >= temp && rand < this.drawObj[index + 1]) {
- return index + 1;
- }
- }
- }
- return 2;
- }
- startDraw() {
- let freeTimes = DataMgr.getDailyfreeDrawTimes();
- if (freeTimes > 0) {
- this.beginDraw();
- DataMgr.setDailyfreeDrawTimes(0);
- this.checkFree();
- }
- else {
- if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_chouJiang();
- }
- }
- }
- qjff_chouJiang() {
- this.beginDraw();
- }
- beginDraw() {
- this.ui.myNode.flashNode.c1.selectedIndex = 0;
- this.ui.drawBtn.touchable = false;
- this.curKey = this.getCurkey();
- console.log("当前key", this.curKey);
- let cell = 60;
- let lap = 3;
- let angle = cell * (this.curKey - 1) + lap * 360;
- let target = this.ui.myNode.rotNode;
- target.rotation = 0;
- Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
- console.log("旋转完成");
- this.ui.drawBtn.touchable = true;
- this.getAward();
- }));
- }
- getAward() {
- let data = cfgTable.drawData[this.curKey];
- let temp = new AwardType();
- temp.type = data.award;
- temp.num = data.num;
- xGame.common.getAward([temp], () => {
- DataMgr.setDrawTimes(1);
- this.updateDraw();
- this.ui.myNode.flashNode.c1.selectedIndex = 1;
- });
- }
- updateDraw() {
- let drawTimes = DataMgr.getDrawTimes();
- let awardTimes = DataMgr.getDrawAwardTimes();
- if (Math.floor(drawTimes / 3) > awardTimes) {
- this.ui.extraNode.boxBtn.t0.play(null, -1);
- this.ui.extraNode.boxBtn.touchable = true;
- this.ui.extraNode.tipsTxt.text = "3/3";
- this.ui.extraNode.barNode.width = 265;
- this.getExtraAward();
- }
- else {
- this.ui.extraNode.boxBtn.t0.stop();
- this.ui.extraNode.boxBtn.touchable = false;
- this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
- this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
- }
- let data = cfgTable.drawData[1];
- if (awardTimes == 0) {
- this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
- this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
- this.ui.myNode.rotNode.img1.rotation = 0;
- }
- else {
- let award = data.nextid;
- this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
- this.ui.myNode.rotNode.txt1.text = award[1];
- this.ui.myNode.rotNode.img1.rotation = 0;
- }
- }
- getExtraAward() {
- let drawTimes = DataMgr.getDrawTimes();
- let awardTimes = DataMgr.getDrawAwardTimes();
- let data = cfgTable.drawData[1];
- let award = new AwardType();
- if (awardTimes == 0) {
- award.num = data.num;
- award.type = data.award;
- xGame.common.getAward([award], () => {
- let all = Math.floor(drawTimes / 3);
- DataMgr.setDrawAwardTimes(all);
- this.updateDraw();
- });
- }
- else {
- award.num = parseInt(data.nextid[1]);
- award.type = parseInt(data.nextid[0]);
- xGame.common.getAward([award], () => {
- let all = Math.floor(drawTimes / 3);
- DataMgr.setDrawAwardTimes(all);
- this.updateDraw();
- });
- }
- }
- closeSelf() {
- this.hide();
- }
- playSecretaryIdle() {
- let parent = this.ui.secretary.displayObject;
- parent.destroyChildren();
- let xx = this.ui.secretary.width / 2;
- let yy = this.ui.secretary.height;
- let scale = xGame.common.getSecretaryScale();
- let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
- xGame.common.secretary.play(data, 0, true, parent);
- }
- }
- UIDraw$1.uiName = "UIDraw";
- class UIRanking$1 extends UIBase {
- constructor() {
- super();
- this.showSelf = true;
- this.rankType = 1;
- this.rankList = [];
- this.myIndex = 0;
- this.myStar = 0;
- }
- onConstructor() {
- this.ui = ui_UIRanking.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.myNode.closeBtn, this.hide);
- this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
- this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
- this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
- this.ui.myNode.myList.setVirtual();
- this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
- }
- show() {
- super.show();
- this.myIndex = 51;
- Moyu.getRankList({
- rankId: xGame.common.curRankID,
- type: MoyuRankType.total,
- page: 1,
- pageSize: 50,
- }, this, this.updateItemData);
- this.updateSelf();
- let self = Moyu.getUserInfo();
- if (!self.isAuth) {
- Moyu.initUser(this, () => {
- DataMgr.upRankData();
- });
- }
- }
- updateSelfItem() {
- let self = Moyu.getUserInfo();
- this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
- this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
- this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
- this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
- xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
- }
- updateItemData(data) {
- this.myStar = xGame.common.getAllStarNum();
- if (this.rankList.length < 2) {
- this.rankList = data;
- let self = Moyu.getUserInfo();
- for (let i = 0; i < data.length; i++) {
- let data = this.rankList[i];
- if (data.userId == self.userId) {
- this.rankList.splice(i, 1);
- break;
- }
- }
- for (let i = 0; i < data.length; i++) {
- let data = this.rankList[i];
- if (data.rankScore < this.myStar && this.myIndex > 50) {
- this.myIndex = i + 1;
- let user = { headIcon: self.headIcon, nickName: "myself" };
- let ud = { user: user, data: {} };
- let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
- if (Moyu.platType < 11) {
- user.headIcon = self.headIcon;
- user.nickName = self.nickName;
- }
- this.rankList.splice(i, 0, md);
- break;
- }
- }
- }
- this.updateSelfItem();
- this.ui.myNode.myList.numItems = this.rankList.length;
- }
- updateItemUI(index, obj) {
- let data = this.rankList[index];
- let userData = JSON.parse(data.userData).user;
- obj.nameTxt.text = userData.nickName.toString();
- obj.valueTxt.text = data.rankScore;
- xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
- obj.rankTxt.text = index + 1;
- switch (index) {
- case 0:
- this.setImg(obj, 1, 0, 0);
- obj.rankTxt.color = "#FFC047";
- break;
- case 1:
- this.setImg(obj, 0, 1, 0);
- obj.rankTxt.color = "#ACACAC";
- break;
- case 2:
- this.setImg(obj, 0, 0, 1);
- obj.rankTxt.color = "#D09672";
- break;
- default:
- this.setImg(obj, 0, 0, 0);
- obj.rankTxt.color = "#496FAB";
- break;
- }
- }
- setImg(obj, a, b, c) {
- obj.img1.visible = a ? true : false;
- obj.img2.visible = b ? true : false;
- obj.img3.visible = c ? true : false;
- }
- changeList(type) {
- this.rankType = type;
- this.updateSelf();
- }
- changeSelfNode() {
- this.showSelf = !this.showSelf;
- this.updateSelf();
- }
- updateSelf() {
- this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
- this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
- this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
- this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
- this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
- }
- }
- UIRanking$1.uiName = "UIRanking";
- class UISecretary$1 extends UIBase {
- constructor() {
- super();
- this.curIndex = 1;
- }
- onConstructor() {
- this.ui = ui_UISecretary.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.closeBtn, this.closeSelf);
- this.nodeObj = { left: null, right: null, cur: null };
- this.nodeObj.cur = this.ui.myNode.gameNode3;
- }
- show() {
- super.show();
- this.ui.t0.play();
- this.updateData();
- }
- addSecretarySpine(node, spineName) {
- if (spineName == "mishu") {
- if (this.secretarySpine1) {
- node.displayObject.destroyChildren();
- this.playWoman(this.secretarySpine1, node.displayObject);
- }
- else {
- let spine1 = new SpineMgr("mishu", () => {
- this.secretarySpine1 = spine1;
- this.playWoman(this.secretarySpine1, node.displayObject);
- });
- }
- }
- else {
- if (this.secretarySpine2) {
- node.displayObject.destroyChildren();
- this.playWoman(this.secretarySpine2, node.displayObject);
- }
- else {
- let spine2 = new SpineMgr("xiaomishu2", () => {
- this.secretarySpine2 = spine2;
- this.playWoman(this.secretarySpine2, node.displayObject);
- });
- }
- }
- }
- playWoman(node, parent) {
- let xx = this.ui.myNode.gameNode3.secretary.width / 2;
- let yy = this.ui.myNode.gameNode3.secretary.height;
- let scale = 1.5;
- if (node == this.secretarySpine2) {
- scale = 1.2;
- }
- let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
- node.play(data, 0, true, parent);
- }
- turnLeft() {
- this.curIndex--;
- if (this.curIndex < 1) {
- this.curIndex = 2;
- }
- let left = this.nodeObj.left;
- let right = this.nodeObj.right;
- let cur = this.nodeObj.cur;
- Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
- Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
- Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
- this.updateData();
- }));
- this.ui.myNode.setChildIndex(right, 2);
- this.nodeObj.left = cur;
- this.nodeObj.right = left;
- this.nodeObj.cur = right;
- }
- turnRight() {
- this.curIndex++;
- if (this.curIndex > 2) {
- this.curIndex = 1;
- }
- let left = this.nodeObj.left;
- let right = this.nodeObj.right;
- let cur = this.nodeObj.cur;
- Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
- Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
- Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
- this.updateData();
- }));
- this.ui.myNode.setChildIndex(left, 2);
- this.nodeObj.left = right;
- this.nodeObj.right = cur;
- this.nodeObj.cur = left;
- }
- updateData() {
- console.log('zh: updateData FFFFFFFFFF');
- let data = cfgTable.secretaryshopData;
- let children = this.ui.myNode._children;
- let temp;
- let curData;
- for (let index = 0; index < children.length; index++) {
- temp = children[index];
- curData = data[1];
- temp.heightTxt.text = curData.height;
- temp.foodTxt.text = curData.food;
- temp.historyTxt.text = curData.history;
- temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
- this.addSecretarySpine(temp.secretary, curData.spine);
- let womanIndex = curData.id - 1;
- let getWoman = DataMgr.getSecretary(womanIndex);
- let curUse = DataMgr.getCurSecretary();
- if (getWoman) {
- if (curUse == womanIndex) {
- temp.purchaseBtn.c1.selectedIndex = 1;
- }
- else {
- temp.purchaseBtn.c1.selectedIndex = 2;
- }
- }
- else {
- temp.purchaseBtn.c1.selectedIndex = 0;
- temp.purchaseBtn.diamondTxt.text = curData.price + "";
- }
- temp.purchaseBtn.visible = false;
- }
- }
- clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
- console.log('zh: 点击了clickSecretary ');
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- if (getWoman) {
- if (curUse != womanIndex) {
- console.log();
- DataMgr.setCurSecretary(womanIndex);
- this.updateData();
- }
- }
- else {
- console.log('zh:点击购买了');
- let need = needDiamond;
- if (DataMgr.diamondEnough(need)) {
- DataMgr.setDiamond(-need);
- DataMgr.setSecretary(womanIndex, 1);
- DataMgr.setCurSecretary(womanIndex);
- this.updateData();
- }
- else {
- xGame.uiMgr.Show(UIAddProp$1, 1);
- }
- }
- }
- closeSelf() {
- this.hide();
- }
- }
- UISecretary$1.uiName = "UISecretary";
- class BallRodDisplay$1 {
- constructor(ui, index) {
- this.index = 0;
- this.uiIndex = 0;
- this.ui = ui;
- this.index = index;
- this.initData();
- }
- initData() {
- this.ui.purchaseBtn.onClick(this, this.buyBallRod);
- let data = cfgTable.ballrodData[this.index + 1];
- this.ui.nameTxt.text = data.name;
- this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
- this.ui.levelNode.c1.selectedIndex = data.quality;
- this.ui.purchaseBtn.diamondTxt.text = data.price + "";
- if (data.spine) {
- this.mySpine = new SpineMgr(data.spine, () => {
- let xx = 150;
- let yy = 70;
- let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
- this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
- });
- }
- }
- updateSelf() {
- console.log('zh:updateSelf -------------- ');
- let get = DataMgr.getBallRod(this.index);
- if (get == null)
- get = 1;
- let curUse = DataMgr.getCurBallRod();
- console.log('zh:updateSelf 选择的球杆 = ' + curUse);
- if (get) {
- if (curUse == this.index) {
- this.ui.purchaseBtn.c1.selectedIndex = 0;
- }
- else {
- this.ui.purchaseBtn.c1.selectedIndex = 1;
- }
- }
- else {
- this.ui.purchaseBtn.c1.selectedIndex = 2;
- }
- }
- buyBallRod() {
- console.log('zh:buyBallRod eeeeee');
- xGame.soundMgr.playSound(xGame.common.btnClickStr);
- let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
- switch (selectedIndex) {
- case 0:
- break;
- case 1:
- console.log('zh:点击了 USE THIS');
- DataMgr.setCurBallRod(this.index);
- let curUse = DataMgr.getCurBallRod();
- console.log('zh:updateSelf 选择的球杆 = ' + curUse);
- let ui = xGame.uiMgr.getUI(UIShop$1);
- ui.updateBallRod();
- break;
- case 2:
- let data = cfgTable.ballrodData[this.index + 1];
- let need = data.price;
- if (DataMgr.diamondEnough(need)) {
- DataMgr.setDiamond(-need);
- DataMgr.setBallRod(this.index, 1);
- DataMgr.setCurBallRod(this.index);
- let ui = xGame.uiMgr.getUI(UIShop$1);
- ui.updateBallRod();
- }
- else {
- xGame.uiMgr.Show(UIAddProp$1, 1);
- }
- break;
- default:
- break;
- }
- }
- }
- class UIShop$1 extends UIBase {
- constructor() {
- super();
- this.itemNums = 0;
- }
- onConstructor() {
- this.ui = ui_UIShop.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
- this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
- this.addUIClick(this.ui, this.interuptSecretary);
- this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
- this.ballRodArr = [];
- this.itemNums = Object.keys(cfgTable.ballrodData).length;
- this.ui.myNode.myList.numItems = this.itemNums;
- if (Moyu.isKs)
- this.ui.closeNode.closeBtn.x += 100;
- }
- show() {
- super.show();
- this.playSecretaryIdle();
- this.updateBallRod();
- }
- updateBallRod() {
- for (let index = 0; index < this.ballRodArr.length; index++) {
- this.ballRodArr[index].updateSelf();
- }
- }
- renderBallRod(sort, obj) {
- let index = this.getIndexBySort(sort + 1) - 1;
- let ballRod = new BallRodDisplay$1(obj, index);
- this.ballRodArr.push(ballRod);
- }
- getIndexBySort(sort) {
- let object = cfgTable.ballrodData;
- for (const key in object) {
- if (object[key].sort == sort) {
- return parseInt(key);
- }
- }
- }
- playSecretaryIdle() {
- let parent = this.ui.secretary.displayObject;
- parent.destroyChildren();
- let xx = this.ui.secretary.width / 2;
- let yy = this.ui.secretary.height;
- let scale = xGame.common.getSecretaryScale();
- let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
- xGame.common.secretary.play(data, 0, true, parent);
- }
- interuptSecretary() {
- Laya.timer.clearAll(this);
- this.playSecretaryRandomSound();
- }
- playSecretaryRandomSound() {
- if (this.isHide)
- return;
- let time = xGame.common.randomNum(45000, 60000);
- Laya.timer.once(time, this, () => {
- if (this.isHide)
- return;
- let index = xGame.common.randomNum(4, 7);
- xGame.soundMgr.playSound("s_main0" + index);
- let words = 1;
- switch (index) {
- case 4:
- words = 5;
- break;
- case 5:
- words = 3;
- break;
- case 6:
- words = 6;
- break;
- case 7:
- words = 7;
- break;
- default:
- break;
- }
- xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
- this.playSecretaryRandomSound();
- });
- }
- closeSelf() {
- this.hide();
- }
- }
- UIShop$1.uiName = "UIShop";
- class SignMax$1 {
- constructor(ui) {
- this.ui = ui;
- }
- updateSelf(index, sameDay, curDayIndex) {
- let data = cfgTable.signData[index + 1];
- this.ui.titleTxt.text = data.title;
- let arr1 = data.award[0].split('-');
- let arr2 = data.award[1].split('-');
- let num1 = parseInt(arr1[1]);
- let num2 = parseInt(arr2[1]);
- this.ui.numTxt1.text = num1 + "";
- this.ui.numTxt2.text = num2 + "";
- this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
- this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
- if (xGame.common.signAwardContainsRod([data.award[0]])) {
- this.ui.numTxt1.visible = false;
- }
- else {
- this.ui.numTxt1.visible = true;
- }
- if (xGame.common.signAwardContainsRod([data.award[1]])) {
- this.ui.numTxt2.visible = false;
- }
- else {
- this.ui.numTxt2.visible = true;
- }
- if (index < curDayIndex) {
- this.ui.c1.selectedIndex = 1;
- }
- else if (index == curDayIndex) {
- if (sameDay) {
- this.ui.c1.selectedIndex = 2;
- }
- else {
- this.ui.c1.selectedIndex = 2;
- }
- }
- else {
- this.ui.c1.selectedIndex = 0;
- }
- }
- }
- class SignNormal$1 {
- constructor(ui) {
- this.ui = ui;
- }
- updateSelf(index, sameDay, curDayIndex) {
- let data = cfgTable.signData[index + 1];
- this.ui.titleTxt.text = data.title;
- let arr = data.award[0].split('-');
- let type = parseInt(arr[0]);
- let num = parseInt(arr[1]);
- this.ui.numTxt.text = num + "";
- if (type > 2) {
- this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
- this.ui.myIcon.rotation = 0;
- }
- else {
- this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
- this.ui.myIcon.rotation = 0;
- }
- if (xGame.common.signAwardContainsRod(data.award)) {
- this.ui.numTxt.visible = false;
- }
- else {
- this.ui.numTxt.visible = true;
- }
- if (index < curDayIndex) {
- this.ui.c1.selectedIndex = 1;
- }
- else if (index == curDayIndex) {
- if (sameDay) {
- this.ui.c1.selectedIndex = 2;
- }
- else {
- this.ui.c1.selectedIndex = 2;
- }
- }
- else {
- this.ui.c1.selectedIndex = 0;
- }
- }
- }
- class UISign$1 extends UIBase {
- constructor() {
- super();
- this.curDayIndex = 0;
- this.starX = 0;
- }
- onConstructor() {
- this.ui = ui_UISign.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
- this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
- this.initSignItem();
- this.addUIClick(this.ui.normalBtn, this.normalGetAward);
- this.addUIClick(this.ui.againBtn, this.againGetAward);
- }
- show() {
- super.show();
- this.ui.t0.play();
- this.playSecretaryIdle();
- this.updateSign();
- }
- initSignItem() {
- this.signArr = [];
- for (let index = 0; index < 6; index++) {
- let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
- this.signArr.push(temp);
- }
- this.signMax = new SignMax$1(this.ui.myNode.day7);
- if (Moyu.isKs)
- this.ui.closeNode.closeBtn.x += 100;
- }
- updateSign() {
- let sameDay = xGame.common.judgeSameDay();
- let max = 7;
- this.curDayIndex = DataMgr.getSignData();
- if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
- this.curDayIndex = 0;
- if (!sameDay) {
- this.ui.normalBtn.visible = true;
- this.ui.tipsNode.visible = false;
- this.ui.againBtn.visible = false;
- }
- else {
- this.ui.normalBtn.visible = false;
- let again = DataMgr.getExtraSign();
- let isCurrency = false;
- let index = this.curDayIndex;
- if (index == 0)
- index = 7;
- let award = cfgTable.signData[index].award;
- let num = award[0].split("-")[0];
- if (num == "1" || num == "2")
- isCurrency = true;
- let showAgain = again == 0 && isCurrency;
- this.ui.againBtn.visible = showAgain;
- this.ui.tipsNode.visible = !showAgain;
- }
- for (let index = 0; index < this.signArr.length; index++) {
- this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
- }
- this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
- }
- playSecretaryIdle() {
- let parent = this.ui.secretary.displayObject;
- parent.destroyChildren();
- let xx = this.ui.secretary.width / 2;
- let yy = this.ui.secretary.height;
- let scale = xGame.common.getSecretaryScale();
- let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
- xGame.common.secretary.play(data, 0, true, parent);
- }
- closeSelf() {
- this.hide();
- }
- normalGetAward() {
- let sameDay = xGame.common.judgeSameDay();
- if (!sameDay) {
- let award = cfgTable.signData[this.curDayIndex + 1].award;
- let temp;
- let type;
- let num;
- let arr = [];
- for (let index = 0; index < award.length; index++) {
- temp = award[index].split("-");
- type = parseInt(temp[0]);
- num = parseInt(temp[1]);
- let awardType = new AwardType();
- awardType.num = num;
- awardType.type = type;
- arr.push(awardType);
- }
- xGame.common.getAward(arr, (watchVideo) => {
- this.curDayIndex++;
- if (this.curDayIndex > 7)
- this.curDayIndex = 0;
- DataMgr.setSignData(this.curDayIndex);
- DataMgr.setSignTime(new Date().getTime());
- if (watchVideo) {
- DataMgr.setExtraSign(1);
- Moyu.sendDataEvent("signIn1");
- }
- this.updateSign();
- });
- }
- }
- againGetAward() {
- Moyu.sendDataEvent("signIn2");
- console.log('zh:qjff_AD_for_uisign');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_uisign();
- }
- }
- qjff_AD_for_uisign() {
- let index = this.curDayIndex;
- if (index == 0)
- index = 7;
- let award = cfgTable.signData[index].award;
- let temp;
- let type;
- let num;
- for (let index = 0; index < award.length; index++) {
- temp = award[index].split("-");
- type = parseInt(temp[0]);
- num = parseInt(temp[1]) * 3;
- xGame.common.playObjFlyAnim(num, type);
- }
- DataMgr.setExtraSign(1);
- this.updateSign();
- }
- }
- UISign$1.uiName = "UISign";
- class UIModeSelection$1 extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UIModeSelection.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
- this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
- this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
- this.addUIClick(this.ui.closeBtn, this.hide);
- this.peopleArr = [650, 6900, 3800];
- this.peopleOffest = [50, 500, 200];
- this.updateSelf();
- }
- show(callback) {
- super.show();
- this.ui.t0.play();
- this.callback = callback;
- }
- updateSelf() {
- let cfg = cfgTable.modeselectData;
- for (let index = 1; index <= 3; index++) {
- let node = this.ui.myNode["type" + index];
- node.need.text = cfg[index].need;
- node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
- node.peopleTxt.text = this.getRandPeople(index - 1);
- }
- }
- enterGame(type) {
- xGame.common.classicRoomType = type;
- let cfg = cfgTable.modeselectData[type];
- let need = cfg.need;
- xGame.common.passAwardCoin = cfg.award;
- if (DataMgr.coinEnough(need)) {
- DataMgr.setCoin(-need);
- this.ui.myNode["type" + type].t0.play();
- Laya.timer.once(200, this, () => {
- this.callback && this.callback();
- });
- }
- else {
- Moyu.sendDataEvent("AddCoinVideo");
- xGame.uiMgr.Show(UIAddProp$1, 0);
- }
- }
- getRandPeople(index) {
- let rand = this.peopleOffest[index];
- return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
- }
- }
- UIModeSelection$1.uiName = "UIModeSelection";
- class UITry$1 extends UIBase {
- constructor() {
- super();
- this.closeTime = 0;
- this.closeNum = 0;
- this.skillUrl = xGame.common.skillIconList;
- }
- onConstructor() {
- this.ui = ui_UITry.createInstance();
- this.contentPane = this.ui;
- this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
- this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
- }
- show() {
- super.show();
- this.closeNum = 0;
- this.closeTime = 15;
- this.ui.t0.play();
- PlatMgr.showRateBanner();
- this.ui.myNode.txtTime.text = this.closeTime.toString();
- Laya.timer.loop(1000, this, this.updateTime);
- let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
- this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
- xGame.common.gameMgr.gamePause = true;
- }
- updateTime() {
- if (this.closeTime > 1) {
- this.closeTime--;
- this.ui.myNode.txtTime.text = this.closeTime.toString();
- }
- else
- this.hide();
- }
- hide() {
- Laya.timer.clearAll(this);
- Moyu.showBannerAd(false);
- super.hide();
- xGame.common.gameMgr.gamePause = false;
- }
- onTry() {
- console.log('zh:qjff_AD_for_uitry');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_uitry();
- }
- }
- qjff_AD_for_uitry() {
- let select = xGame.common.curPlayerSkillType;
- DataMgr.gameData.trySkill = select;
- DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
- DataMgr.saveGameData();
- DataMgr.setBigSkill(select, 1);
- xGame.showTip("Trial Successful");
- this.hide();
- }
- onCancel() {
- if (this.closeNum > 0) {
- this.closeNum--;
- if (this.closeNum < 2)
- this.hide();
- return;
- }
- else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
- this.onTry();
- }
- else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
- this.closeNum = 3;
- }
- else
- this.hide();
- }
- }
- UITry$1.uiName = "UITry";
- class UIGetAward$1 extends UIBase {
- constructor() {
- super();
- this.showTriple = true;
- }
- onConstructor() {
- this.ui = ui_UIGetAward.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
- this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
- this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
- }
- show(arr, showTriple, callback) {
- super.show();
- this.ui.t0.play();
- this.ui.eftNode.visible = true;
- this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
- this.ui.eftNode.visible = false;
- }), 1, 0, 0, 0.9);
- this.awardArr = arr;
- this.showTriple = showTriple;
- this.callback = callback;
- this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
- this.ui.myList.numItems = arr.length;
- xGame.soundMgr.playSound("getaward");
- }
- updateSelf(index, obj) {
- let temp = this.awardArr[index];
- let icon = this.getIcon(temp.type);
- let str = icon;
- if (temp.type > 2) {
- str = "s" + icon;
- }
- obj.myIcon.url = xGame.common.getGameIconUrl(str);
- obj.myIcon.rotation = 0;
- obj.numTxt.text = temp.num + "";
- obj.numTxt.visible = temp.type > 2 ? false : true;
- obj.nameTxt.text = this.getNameStr(temp.type);
- }
- renderItem(index, obj) {
- this.updateSelf(index, obj);
- }
- tripleGetAward() {
- console.log('zh:qjff_AD_for_uigetAward');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_uigetAward();
- }
- }
- qjff_AD_for_uigetAward() {
- this.getAward(3);
- }
- normalGetAward() {
- if (PlatMgr.isMisVideo())
- this.tripleGetAward();
- else
- this.getAward();
- }
- getAward(times = 1) {
- this.hide();
- for (let index = 0; index < this.awardArr.length; index++) {
- this.awardArr[index].num *= times;
- }
- this.callback && this.callback(times != 1);
- }
- getIcon(type) {
- switch (type) {
- case Prop.diamond:
- return "ty_zs";
- case Prop.coin:
- return "ty_jb";
- case Prop.gan1:
- return "qg1";
- case Prop.gan2:
- return "qg2";
- case Prop.gan3:
- return "qg3";
- case Prop.gan4:
- return "qg4";
- default:
- break;
- }
- }
- getNameStr(type) {
- switch (type) {
- case Prop.diamond:
- return "Diamond";
- case Prop.coin:
- return "Coins";
- case Prop.gan1:
- case Prop.gan2:
- case Prop.gan3:
- case Prop.gan4:
- return cfgTable.ballrodData[type - 1].name;
- default:
- break;
- }
- }
- }
- UIGetAward$1.uiName = "UIGetAward";
- class UIBox$1 extends UIBase {
- constructor() {
- super();
- this.boxNum = 0;
- this.boxMax = 10;
- this.inAd = false;
- this.isClose = false;
- }
- onConstructor() {
- this.ui = ui_UIBox.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.closeBtn, this.onCloseBox);
- this.addUIClick(this.ui.openBtn, this.onOpenBox);
- Laya.timer.loop(1000, this, this.update);
- }
- update() {
- if (this.boxNum > 0 && this.boxNum < this.boxMax) {
- this.boxNum -= 1;
- this.upBar();
- }
- }
- upBar() {
- if (this.boxNum > this.boxMax)
- this.boxNum = this.boxMax;
- this.ui.bar.value = this.boxNum * 10;
- }
- show() {
- super.show();
- this.isClose = false;
- this.boxNum = 0;
- this.inAd = false;
- this.upBar();
- this.ui.t0.play();
- this.ui.closeBtn.visible = false;
- Laya.timer.once(3000, this, () => {
- this.ui.closeBtn.visible = true;
- this.ui.bar.alpha = 1;
- });
- Laya.timer.once(500, this, () => {
- this.ui.t1.play();
- });
- }
- hide() {
- Laya.timer.clearAll(this);
- Moyu.showBannerAd(false);
- super.hide();
- }
- onOpenBox() {
- this.boxNum++;
- if (this.boxNum < this.boxMax) {
- if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
- Moyu.showInsertAd(0, PlatMgr.insertGap);
- }
- else if (this.boxNum == this.boxMax) {
- if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
- this.ui.openBtn.c1.selectedIndex = 13;
- this.inAd = true;
- }
- else
- this.getAward();
- }
- else if (this.inAd) {
- console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
- if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
- }
- else {
- console.log('zh:AD 失败,直接发放奖励');
- this.qjff_AD_for_UIBOX_onOpenBox();
- }
- }
- this.upBar();
- }
- qjff_AD_for_UIBOX_onOpenBox() {
- this.getAward();
- }
- onCloseBox() {
- if (this.isClose)
- this.hide();
- else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
- this.isClose = true;
- PlatMgr.showBanner(true, 0, 3000);
- }
- else
- this.hide();
- }
- getAward() {
- let str = "";
- if (Math.random() < 0.5) {
- let max = Moyu.isLegal ? 500 : 2500;
- let num = xGame.tools.random(max, 500 + max);
- DataMgr.setCoin(num);
- str = "金币x" + num;
- }
- else {
- let max = Moyu.isLegal ? 10 : 30;
- let num = xGame.tools.random(max, 30 + max);
- DataMgr.setDiamond(num);
- str = "钻石x" + num;
- }
- xGame.showTip("恭喜获得-" + str);
- this.hide();
- }
- }
- UIBox$1.uiName = "UIBox";
- class UIMain$1 extends UIBase {
- constructor() {
- super();
- this.firstEnter = true;
- }
- nativeCallJs(msg) {
- let t = msg;
- console.log("zh: nativeCallJs 奖励开始发放:", t);
- switch (t) {
- case 'qjff_chouJiang':
- let dui = xGame.uiMgr.getUI(UIDraw$1);
- dui.qjff_chouJiang();
- break;
- case 'qjff_AD_for_uisign':
- let dui2 = xGame.uiMgr.getUI(UISign$1);
- dui2.qjff_AD_for_uisign();
- break;
- case 'qjff_AD_for_uitry':
- let dui3 = xGame.uiMgr.getUI(UITry$1);
- dui3.qjff_AD_for_uitry();
- break;
- case 'qjff_AD_for_uipower':
- let dui4 = xGame.uiMgr.getUI(UIPower$1);
- dui4.qjff_AD_for_uipower();
- break;
- case 'qjff_AD_for_uigetAward':
- let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
- dui5.qjff_AD_for_uigetAward();
- break;
- case 'qjff_AD_for_uiGameEnd':
- let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
- let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
- dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
- break;
- case 'qjff_AD_for_uiAddProp_videoGetDiamond':
- let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
- dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
- break;
- case 'qjff_AD_for_uiAddProp_videoGetCoin':
- let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
- dui8.qjff_AD_for_uiAddProp_videoGetCoin();
- break;
- case 'qjff_AD_for_UIrepentProp_videoRegret':
- let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
- dui9.qjff_AD_for_UIrepentProp_videoRegret();
- break;
- case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
- let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
- dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
- break;
- case 'qjff_AD_for_UIBOX_onOpenBox':
- let dui11 = xGame.uiMgr.getUI(UIBox$1);
- dui11.qjff_AD_for_UIBOX_onOpenBox();
- break;
- case 'qjff_AD_for_UIAddCoin':
- let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
- dui12.qjff_AD_for_UIAddCoin();
- break;
- case '111a':
- let dui14 = xGame.uiMgr.getUI(UISign$1);
- dui14.qjff_AD_for_uisign();
- break;
- case '222a':
- let dui15 = xGame.uiMgr.getUI(UISign$1);
- dui15.qjff_AD_for_uisign();
- break;
- case '333a':
- let dui16 = xGame.uiMgr.getUI(UISign$1);
- dui16.qjff_AD_for_uisign();
- break;
- default:
- console.log('zh:未知的方法名字' + t);
- break;
- }
- }
- onConstructor() {
- console.log('zh: UIMain onConstructor');
- this.ui = ui_UIMain.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addEvent();
- this.addClickSpine();
- this.settingNode = new SettingNode$1(this.ui.settingNode);
- this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
- xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
- xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
- xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
- let curUse = DataMgr.getCurSecretary();
- this.changeSecretary(curUse);
- this.ui.talkNode.visible = false;
- let guide = DataMgr.getSkillGuide();
- if (xGame.common.isNewDay && guide == 1) {
- xGame.common.isNewDay = false;
- xGame.soundMgr.playSound("s_main01");
- xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
- console.log("zh:播放小秘书每天语音");
- }
- this.ui.n83.visible = false;
- window['nativeCallJs'] = this.nativeCallJs.bind(this);
- }
- changeSecretary(curUse) {
- let name = cfgTable.secretaryshopData[curUse + 1].spine;
- xGame.common.secretary && xGame.common.secretary.dispose();
- this.addSecretarySpine(name);
- }
- addSecretarySpine(name) {
- let spine = new SpineMgr(name, () => {
- this.playSecretaryIdle();
- });
- xGame.common.secretary = spine;
- }
- addClickSpine() {
- let clickSpine = new SpineMgr("dianji", () => {
- Laya.stage.on(Laya.Event.CLICK, this, (e) => {
- let parent = Laya.stage;
- let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
- clickSpine.play(data, 0, false, parent, (spine) => {
- spine.destroy(true);
- });
- });
- });
- }
- addEvent() {
- this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
- this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
- this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
- this.addUIClick(this.ui.globalBtn, this.startGlobal);
- this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
- this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
- this.addUIClick(this.ui, this.interuptSecretary);
- this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
- this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
- this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
- this.addUIClick(this.ui.shopBtn, this.openShopView);
- this.addUIClick(this.ui.signBtn, this.openSignView);
- this.addUIClick(this.ui.drawBtn, this.openDrawView);
- this.addUIClick(this.ui.rankBtn, this.openRanking);
- }
- show(showFailWords) {
- super.show();
- this.moneyNode.ui.c1.selectedIndex = 1;
- this.playSecretaryIdle();
- xGame.soundMgr.playMusic("caromhall01", 0);
- Laya.timer.clearAll(this);
- this.playSecretaryRandomSound();
- console.log('zh:uimain.ts show show FailWords=', showFailWords);
- if (showFailWords) {
- console.log('zh:uimain.ts ');
- setTimeout(() => {
- let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
- let words = -1;
- if (str == "s_main02") {
- words = 2;
- }
- else {
- words = 3;
- }
- xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
- xGame.soundMgr.playSound(str);
- }, 300);
- }
- this.showGuide();
- this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
- this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
- let guide = DataMgr.getSkillGuide();
- if (guide == 1) {
- let randTime = xGame.common.randomNum(300, 800);
- if (this.firstEnter) {
- this.firstEnter = false;
- randTime += 900;
- }
- Laya.timer.once(randTime, this, () => {
- xGame.common.autoPopUIView();
- });
- }
- }
- checkActive(show) {
- }
- showGuide() {
- let guide = DataMgr.getSkillGuide();
- this.ui.guideBtn.visible = guide == 0;
- this.ui.enterGuide.visible = false;
- this.ui.secretaryGuide.visible = guide == 0;
- if (guide == 0) {
- xGame.soundMgr.playSound("s_guide");
- xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
- }
- }
- ensureSecretary() {
- console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
- this.ui.secretaryGuide.visible = false;
- this.ui.enterGuide.visible = true;
- this.ui.wordsNode.t0.play();
- if (DataMgr.getNewUser())
- Moyu.sendDataEvent("gameReady");
- }
- playSecretaryIdle() {
- let parent = this.ui.secretary.displayObject;
- parent.destroyChildren();
- let xx = this.ui.secretary.width / 2;
- let yy = this.ui.secretary.height;
- let scale = xGame.common.getSecretaryScale();
- let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
- console.log("zh:playSecretaryIdle", data);
- xGame.common.secretary.play(data, 0, true, parent);
- }
- startGame(type) {
- xGame.common.gameMode = type;
- Moyu.sendDataEvent("PlayGame", { type: type });
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- let challengeTimes = DataMgr.getChallengeTimes();
- if (challengeTimes == 0) {
- xGame.uiMgr.Show(UIInvitation$1);
- }
- else {
- this.beginGame();
- }
- break;
- case GameMode.bigMove:
- this.beginGame();
- if (DataMgr.getNewUser())
- Moyu.sendDataEvent("gameStart0");
- break;
- default:
- break;
- }
- }
- beginGame(isNice = false) {
- console.log('zh:beginGame beginGame beginGame');
- if (xGame.common.gameMode == GameMode.classic) {
- if (isNice) {
- this.enterClassic();
- }
- else {
- xGame.uiMgr.Show(UIModeSelection$1, () => {
- this.enterClassic();
- });
- }
- }
- else if (xGame.common.gameMode == GameMode.bigMove) {
- this.ui.enterGuide.visible = false;
- xGame.uiMgr.Show(UISkill$1);
- }
- }
- enterClassic() {
- xGame.uiMgr.Show(UIGame$1);
- xGame.uiMgr.Show(UIMatching$1, () => {
- if (!this.isHide)
- this.hide();
- xGame.common.gameUI.ui.alpha = 1;
- xGame.common.gameUI.startGame();
- xGame.uiMgr.Hide(UIGameEnd$1);
- });
- }
- startGlobal() {
- xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
- }
- startWeekly() {
- xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
- }
- zhouSaiMonth() {
- console.log('zh: zhouSaiMonth 被调用');
- }
- startPlaceBall() {
- xGame.uiMgr.Show(UILevelDisplay$1);
- }
- hide() {
- console.log('zh:uimain hide ...');
- super.hide();
- xGame.common.stopGirlPop(this.ui.talkNode);
- }
- onGetUserInfo(force = false) {
- if (Moyu.isWx) {
- let info = Moyu.getSystemInfo();
- if (info)
- Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
- }
- else {
- Moyu.initUser(this, this.freshUser, force);
- }
- if (!Moyu.hasUserInfo) {
- let user = Moyu.getUserInfo();
- user.headIcon = 'res/ty_touxiang.png';
- }
- this.freshUser();
- }
- freshUser() {
- let user = Moyu.getUserInfo();
- if (!user.isAuth) {
- user.headIcon = 'res/ty_touxiang.png';
- }
- else
- DataMgr.upRankData();
- this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
- xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
- }
- interuptSecretary() {
- Laya.timer.clearAll(this);
- this.playSecretaryRandomSound();
- }
- playSecretaryRandomSound() {
- if (this.isHide)
- return;
- let time = xGame.common.randomNum(45000, 60000);
- Laya.timer.once(time, this, () => {
- if (this.isHide)
- return;
- let index = xGame.common.randomNum(4, 7);
- xGame.soundMgr.playSound("s_main0" + index);
- let words = 1;
- switch (index) {
- case 4:
- words = 5;
- break;
- case 5:
- words = 3;
- break;
- case 6:
- words = 6;
- break;
- case 7:
- words = 7;
- break;
- default:
- break;
- }
- xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
- this.playSecretaryRandomSound();
- });
- }
- openSecretaryView() {
- xGame.uiMgr.Show(UISecretary$1);
- Moyu.sendDataEvent("secretary");
- }
- openShopView() {
- xGame.uiMgr.Show(UIShop$1);
- }
- openSignView() {
- xGame.uiMgr.Show(UISign$1);
- }
- openDrawView() {
- xGame.uiMgr.Show(UIDraw$1);
- }
- openRanking() {
- console.log('zh:phb openRanking');
- xGame.uiMgr.Show(UIRanking$1);
- Moyu.sendDataEvent("rankingList");
- }
- }
- UIMain$1.uiName = "UIMain";
- function InitShader() {
- }
- function appInit() {
- xGame.context.init(getLoadingResList(), initCallback);
- }
- function getLoadingResList() {
- return [
- { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
- { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
- ];
- }
- function getGameResList() {
- return [
- { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
- { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
- { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
- { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
- { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
- { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
- { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
- { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
- { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
- { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
- { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
- { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
- { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
- { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
- { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
- { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
- { url: "res/json/npc.json", type: Laya.Loader.JSON },
- { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
- { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
- { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
- { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
- ];
- }
- function initCallback() {
- window["DataMgr"] = DataMgr;
- DataMgr.Init();
- Moyu.init(getPlat(), this, () => {
- DataMgr.isNewDay();
- PlatMgr.initConfig();
- xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
- }, true);
- console.log('zh:开始sm init1 start');
- xGame.soundMgr.init();
- console.log('zh:开始sm init1 end');
- xGame.uiMgr.init();
- xGame.uiMgr.clearTempData();
- xGame.uiMgr.bindFUI(fguiRes.loading);
- xGame.uiMgr.Show(UILoading);
- }
- function loadSubRes(callback) {
- var tab = ["asset", "res", "spine"];
- let subDone = 0;
- for (var i = 0; i < tab.length; i++) {
- let sub = tab[i];
- Moyu.loadSubRes(sub, (pro) => {
- callback && callback(pro, false);
- }).then(() => {
- subDone++;
- if (subDone >= tab.length)
- callback && callback(1, true);
- });
- }
- }
- function enterGame() {
- xGame.cfgMgr.init();
- xGame.soundMgr.onSetting(DataMgr.userData.sound);
- Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
- xGame.uiMgr.Hide(UILoading);
- fgui.UIPackage.removePackage(fguiRes.loading);
- xGame.uiMgr.bindFUI(fguiRes.game);
- xGame.uiMgr.Show(UIMain$1);
- if (DataMgr.getNewUser())
- Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
- }
- function getPlat() {
- let cfg = new MoyuCfg();
- cfg.plat = MoyuPlat.web;
- cfg.myId = 120;
- cfg.myKey = '8848a885774230a4';
- cfg.version = 0;
- if (window.hasOwnProperty("gamebox")) {
- cfg.plat = MoyuPlat.f399;
- cfg.version = 0;
- }
- else if (window.hasOwnProperty("ks")) {
- cfg.plat = MoyuPlat.ks;
- cfg.version = 0;
- cfg.ads.ksVideoId = '2300002254_01';
- cfg.ads.ksInsertId = '2300002254_02';
- }
- else if (Laya.Browser.onTTMiniGame) {
- cfg.plat = MoyuPlat.tt;
- cfg.version = 0;
- cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
- cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
- cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
- }
- else if (Laya.Browser.onMiniGame) {
- cfg.plat = MoyuPlat.wx;
- cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
- cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
- cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
- }
- else if (Laya.Browser.onQQMiniGame) {
- cfg.plat = MoyuPlat.qq;
- }
- else if (Laya.Browser.onQGMiniGame) {
- cfg.plat = MoyuPlat.op;
- cfg.ads.opVideoId = '455502';
- cfg.ads.opBannerId = '455507';
- }
- else if (Laya.Browser.onVVMiniGame) {
- cfg.plat = MoyuPlat.vv;
- cfg.version = 0;
- cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
- cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
- cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
- }
- else if (Laya.Browser.onHWMiniGame) {
- cfg.plat = MoyuPlat.hw;
- }
- else if (window["mz"]) {
- cfg.plat = MoyuPlat.mz;
- }
- else {
- let cfg = window['conchConfig'];
- if (cfg) {
- var os = cfg.getOS();
- if (os == "Conch-ios") {
- cfg.plat = MoyuPlat.ios;
- }
- else if (os == "Conch-android") {
- }
- }
- }
- return cfg;
- }
- class Main {
- constructor() {
- if (window["Laya3D"])
- Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
- else {
- Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
- this.initMain();
- }
- }
- initMain() {
- Laya["Physics"] && Laya["Physics"].enable();
- Laya["DebugPanel"] && Laya["DebugPanel"].enable();
- Laya.stage.scaleMode = GameConfig.scaleMode;
- Laya.stage.screenMode = GameConfig.screenMode;
- Laya.stage.alignV = GameConfig.alignV;
- Laya.stage.alignH = GameConfig.alignH;
- Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
- if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
- Laya.enableDebugPanel();
- if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
- Laya["PhysicsDebugDraw"].enable();
- if (GameConfig.stat)
- Laya.Stat.show();
- Laya.alertGlobalError(true);
- Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
- }
- onVersionLoaded() {
- appInit();
- }
- }
- new Main();
- }());
- //# sourceMappingURL=bundle.js.map
|