12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182 |
- (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);
- alert("Please check your network connection.");
- }
- function completeHandler(data) {
- if (data && data.length > 0) {
- let jsonData = JSON.parse(data);
- if (call)
- call(jsonData);
- }
- }
- }
- sendPost2025(reqUrl, data, call) {
- let isDev = false;
- let urlTop = "https://api.kessongame.site/";
- let urlMid = urlTop + "prod-api/api/game/";
- if (isDev) {
- urlTop = "http://192.168.1.13:8090/";
- urlMid = urlTop + "api/game/";
- }
- let url = urlMid + reqUrl;
- if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
- if (isDev) {
- url = urlMid + reqUrl;
- }
- else {
- url = urlTop + "prod-api/" + reqUrl;
- }
- }
- 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) {
- if (call) {
- call("{'msg':'网络错误','code':500}");
- }
- else {
- alert("Tip:Please check your network connection.");
- }
- }
- 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) {
- console.log('zh:showInternAd start');
- if (!Laya.Browser.onAndroid) {
- console.log('zh:showInternAd 非android dev');
- return false;
- }
- if (!this.initBridge()) {
- return false;
- }
- let rs = this.bridge.call("showInternAd", mark);
- try {
- const result = JSON.parse(rs);
- if (result.code === 200) {
- console.log("zh:showInternAd OK");
- return true;
- }
- else {
- console.warn("zh:showInternAd FAILL:", result.msg);
- return false;
- }
- }
- catch (e) {
- console.error("zh:解析桥接返回值失败:", e);
- return false;
- }
- }
- exitAndCloseGame() {
- if (!Laya.Browser.onAndroid) {
- console.log('zh:非android dev');
- return;
- }
- if (!this.initBridge()) {
- return;
- }
- console.log('zh:开始关闭游戏-');
- this.bridge.call("exitAndCloseGame");
- }
- 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;
- }
- }
- logEventForAdNoParams(eventName) {
- console.log("zh:logEventForAdNoParams eventName1=" + eventName);
- if (!Laya.Browser.onAndroid) {
- console.log('zh:非android dev');
- return;
- }
- if (!this.initBridge()) {
- return;
- }
- console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
- this.bridge.call("logEventForAdNoParams", eventName);
- }
- logEventForAdHaveParams(eventName, jsonStr) {
- console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
- if (!Laya.Browser.onAndroid) {
- console.log('zh:非android dev');
- return;
- }
- if (!this.initBridge()) {
- return;
- }
- console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
- console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
- this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
- }
- logEventForFirebase(eventName, jsonStr) {
- console.log("zh:ts logEventForFirebase eventName1=" + eventName);
- if (!Laya.Browser.onAndroid) {
- console.log('zh:非android dev');
- return;
- }
- if (!this.initBridge()) {
- return;
- }
- console.log("zh:call logEventForFirebase eventName2=" + eventName);
- console.log("zh:logEventForFirebase req = json=" + jsonStr);
- this.bridge.call("logEventForFirebase", eventName, jsonStr);
- }
- 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) {
- JSBridgeUtils.instance.showInternAd('uivideoshare_show');
- }
- }
- 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)) {
- console.log('zh:插屏 ad start');
- JSBridgeUtils.instance.showInternAd('platMgr');
- }
- 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;
- console.log('zh:插屏 ad start');
- JSBridgeUtils.instance.showInternAd('gameInsert');
- }
- }
- static gameInsert() {
- let t = this.getRand();
- let r = this.gameInsertRate;
- if (t < r) {
- console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
- }
- }
- static showRateBanner() {
- if (this.getRand() < this.bannerRate)
- this.showBanner(true, this.bannerDelay, 3000);
- }
- static showBanner(show, delay = 0, hide = 0) {
- if (2 > 1) {
- console.log('zh:显示showBanner广告 直接返回');
- return;
- }
- 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) {
- if (2 > 1) {
- console.log('zh:显示showBanner广告 直接返回');
- return;
- }
- 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 LocalStorageManager {
- test1() {
- LocalStorageManager.setItem("playerName", "Tom");
- LocalStorageManager.setItem("playerLevel", 5);
- LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
- const name = LocalStorageManager.getItem("playerName");
- const level = LocalStorageManager.getItem("playerLevel");
- const data = LocalStorageManager.getItem("playerData");
- console.log(name);
- console.log(level);
- console.log(data);
- LocalStorageManager.removeItem("playerLevel");
- }
- static setItem(key, value) {
- Laya.LocalStorage.setItem(key, JSON.stringify(value));
- }
- static getItem(key) {
- const data = Laya.LocalStorage.getItem(key);
- if (data === null)
- return null;
- try {
- return JSON.parse(data);
- }
- catch (e) {
- return data;
- }
- }
- static removeItem(key) {
- Laya.LocalStorage.removeItem(key);
- }
- static clear() {
- Laya.LocalStorage.clear();
- }
- static hasJosnKey(key) {
- var value = Laya.LocalStorage.getJSON(key);
- if (value != null) {
- return true;
- }
- else {
- return false;
- }
- }
- static hasKey(key) {
- return Laya.LocalStorage.getItem(key) !== null;
- }
- }
- 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()) {
- console.log('zh:powerEnough =' + 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);
- this.logEventForChallenge_level_start(this.level);
- xGame.uiMgr.Hide(UILevelDisplay);
- xGame.uiMgr.Hide(UIMain);
- this.hide();
- }));
- }
- else {
- console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
- xGame.uiMgr.Show(UIPower);
- }
- }
- logEventForChallenge_level_start(level) {
- let keyStr = 'sjmd_challenge_level_start';
- let jsonStr = {
- "count": 1,
- "gold_balance ": DataMgr.getCoin(),
- "level": level,
- "diamond_balance ": DataMgr.getDiamond()
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- if (level > d.level) {
- jsonStr.count = d.count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- }
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
- }
- 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.topX = 10;
- this.myIndex = this.topX + 1;
- 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.getPaiHangBangDataFormJosnFile();
- this.updateSelf();
- let self = Moyu.getUserInfo();
- if (!self.isAuth) {
- Moyu.initUser(this, () => {
- DataMgr.upRankData();
- });
- }
- }
- getPaiHangBangDataFormJosnFile() {
- const rankingList = cfgTable.paiHangBangData.list;
- this.updateItemData(rankingList);
- }
- updateSelfItem() {
- console.log('zh:Moyu.platType =' + Moyu.platType);
- 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 > this.topX ? "No Rank" : this.myIndex.toString();
- if (this.myIndex > this.topX) {
- this.ui.myNode.selfNode.rankTxt.fontSize = 36;
- }
- else {
- this.ui.myNode.selfNode.rankTxt.fontSize = 30;
- }
- this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
- this.ui.myNode.selfNode.nameTxt.text = '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();
- console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
- self.headIcon = self.headIcon;
- 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 > this.topX) {
- 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) };
- console.log('zh:Moyu.platType = ' + Moyu.platType);
- 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() {
- 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();
- this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
- }
- else {
- xGame.uiMgr.Show(UIAddProp, 1);
- }
- break;
- default:
- break;
- }
- }
- logEventForGouMaiGan(qiuGanName) {
- const ev = {
- value: qiuGanName
- };
- const jsonStr = JSON.stringify(ev);
- console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
- }
- }
- 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() {
- console.log('zh:rod skill 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;
- console.log('zh: skilldisplay 1');
- 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);
- });
- this.logEventForRod_start();
- }
- else {
- console.log('zh: skilldisplay 2');
- xGame.uiMgr.Show(UIAddProp, 0);
- Moyu.sendDataEvent("AddCoinVideo");
- }
- }
- logEventForRod_start() {
- let gfmsIdx = xGame.common.curPlayerSkillType;
- console.log('zh:选择的技能=' + gfmsIdx);
- let gfmc = 'Skyfall Shot';
- if (gfmsIdx == 0) {
- gfmc = 'Skyfall Shot';
- }
- if (gfmsIdx == 1) {
- gfmc = 'Surging break';
- }
- if (gfmsIdx == 2) {
- gfmc = 'Frost Lock';
- }
- let keyStr = 'sjmd_rod_start_' + gfmsIdx;
- let jsonStr = {
- "count": 0,
- "name": gfmc
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- jsonStr.count = d.count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
- }
- }
- 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 strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
- "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
- "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 = [65, 990, 580];
- this.peopleOffest = [5, 10, 10];
- }
- show(callback) {
- this.updateSelf();
- 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) {
- console.log('zh: 进入经典模式 type: ' + 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();
- });
- this.logEventForClassic_start();
- }
- 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);
- }
- logEventForClassic_start() {
- let rtype = xGame.common.classicRoomType;
- let msmc = '';
- if (rtype == 1) {
- msmc = 'beginner';
- }
- if (rtype == 2) {
- msmc = 'expert';
- }
- if (rtype == 3) {
- msmc = 'master';
- }
- let keyStr = 'sjmd_classic_start_' + rtype;
- let jsonStr = {
- "difficulty": msmc,
- "classic_count": 1,
- "difficulty_count": 1
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- jsonStr.classic_count = d.classic_count + 1;
- jsonStr.difficulty_count = d.difficulty_count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
- }
- }
- 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) {
- console.log("zh: firstEnter");
- this.firstEnter = false;
- randTime += 900;
- }
- else {
- console.log("zh: no firstEnter");
- }
- 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) {
- console.log("zh:显示引导");
- xGame.soundMgr.playSound("s_guide");
- xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
- }
- else {
- console.log("zh:不需要显示引导");
- }
- }
- 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 });
- console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- console.log('zh:进入经典模式111111111');
- if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
- let db_over_lev = DataMgr.getChallengeMode_overLev();
- console.log('zh:classic db_over_lev=', db_over_lev);
- if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
- console.log('zh:判断是否可以玩该模式classic =NO');
- let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
- xGame.uiMgr.Show(UIMsg, tipStr);
- return;
- }
- else {
- console.log('zh:可以玩该模式classic 66666666666666');
- this.beginGame();
- }
- }
- else {
- console.log('zh:不需要判断是否可以玩该classic');
- let challengeTimes = DataMgr.getChallengeTimes();
- if (challengeTimes == 0) {
- xGame.uiMgr.Show(UIInvitation);
- }
- else {
- this.beginGame();
- }
- break;
- }
- case GameMode.bigMove:
- console.error('zh:bigMove check');
- let guide = DataMgr.getSkillGuide();
- if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
- let db_over_lev = DataMgr.getChallengeMode_overLev();
- console.log('zh:bigMove db_over_lev=', db_over_lev);
- if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
- let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
- xGame.uiMgr.Show(UIMsg, tipStr);
- return;
- }
- else {
- console.log('zh:可以玩该模式 bigMove');
- this.beginGame();
- if (DataMgr.getNewUser())
- Moyu.sendDataEvent("gameStart0");
- }
- }
- else {
- this.beginGame();
- if (DataMgr.getNewUser())
- Moyu.sendDataEvent("gameStart0");
- }
- break;
- default:
- console.error('zh:未知错误!!!!');
- break;
- }
- }
- beginGame(isNice = false) {
- console.log('zh:beginGame ');
- let guide = DataMgr.getSkillGuide();
- if (guide == 1) {
- console.log('zh:非新手引导,showInternAd ');
- JSBridgeUtils.instance.showInternAd('beginGame');
- }
- else {
- console.log('zh:新手引导,不显示AD ');
- }
- console.log('zh:beginGame 2 go');
- if (xGame.common.gameMode == GameMode.classic) {
- if (isNice) {
- this.enterClassic();
- }
- else {
- xGame.uiMgr.Show(UIModeSelection, () => {
- console.log('zh:BBBBBBBBBBBBBBB');
- 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();
- console.log('zh: 进reg');
- }
- 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);
- });
- }
- else {
- this.logEventForClassic_win();
- }
- this.logEventForClassic_complete();
- 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:
- console.log('zh:招法模式 aaaaaa 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);
- }
- }
- this.logEventForRod_complete_N();
- if (!this.success) {
- Laya.timer.once(500, this, () => {
- xGame.uiMgr.Show(UIAddCoin);
- });
- }
- else {
- this.logEventForRod_win();
- }
- 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;
- }
- let level = xGame.common.placeBallCurLevel;
- if (level > 59) {
- this.logEventForChallenge_level_complete(level);
- }
- else {
- this.logEventForChallenge_level_N(level);
- }
- }
- 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;
- }
- }
- logEventForRod_complete_N() {
- let gfmsIdx = xGame.common.curPlayerSkillType;
- console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
- let gfmc = 'Skyfall Shot';
- if (gfmsIdx == 0) {
- gfmc = 'Skyfall Shot';
- }
- if (gfmsIdx == 1) {
- gfmc = 'Surging break';
- }
- if (gfmsIdx == 2) {
- gfmc = 'Frost Lock';
- }
- let level = DataMgr.getBigSkillByIndex(gfmsIdx);
- console.log('zh:logEventForRod_complete_N level = ' + level);
- let keyStr = 'sjmd_rod_start_' + gfmsIdx;
- let jsonStr = {
- "count": 0,
- "name": gfmc
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- jsonStr.count = d.count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- const d2 = LocalStorageManager.getItem(keyStr);
- let count = d2.count;
- console.log('zh:logEventForRod_complete_N count = ' + count);
- if (count % 5 == 0) {
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
- JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
- }
- }
- logEventForRod_win() {
- console.log('zh:logEventForRod_win,胜利');
- let gfmsIdx = xGame.common.curPlayerSkillType;
- console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
- let gfmc = 'Skyfall Shot';
- if (gfmsIdx == 0) {
- gfmc = 'Skyfall Shot';
- }
- if (gfmsIdx == 1) {
- gfmc = 'Surging break';
- }
- if (gfmsIdx == 2) {
- gfmc = 'Frost Lock';
- }
- let level = DataMgr.getBigSkillByIndex(gfmsIdx);
- console.log('zh:logEventForRod_win level = ' + level);
- let keyStr = 'sjmd_rod_win_' + gfmsIdx;
- let jsonStr = {
- "count": 1,
- "name": gfmc + ' Lev' + level
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- jsonStr.count = d.count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
- }
- logEventForClassic_win() {
- console.log('zh:logEventForClassic_win,胜利');
- let rtype = xGame.common.classicRoomType;
- let msmc = '';
- if (rtype == 1) {
- msmc = 'beginner';
- }
- if (rtype == 2) {
- msmc = 'expert';
- }
- if (rtype == 3) {
- msmc = 'master';
- }
- let keyStr = 'sjmd_classic_win_' + rtype;
- let jsonStr = {
- "difficulty": msmc,
- "classic_count": 1,
- "difficulty_count": 1
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- jsonStr.classic_count = d.classic_count + 1;
- jsonStr.difficulty_count = d.difficulty_count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
- }
- logEventForClassic_complete() {
- console.log('zh:logEventForClassic_complete,胜利');
- let rtype = xGame.common.classicRoomType;
- let msmc = '';
- if (rtype == 1) {
- msmc = 'beginner';
- }
- if (rtype == 2) {
- msmc = 'expert';
- }
- if (rtype == 3) {
- msmc = 'master';
- }
- let keyStr = 'sjmd_classic_complete_' + rtype;
- let jsonStr = {
- "msmc": msmc,
- "count": 0
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- jsonStr.count = d.count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- if (jsonStr.count % 5 == 0) {
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
- JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
- }
- }
- 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) {
- JSBridgeUtils.instance.showInternAd('gameend_success');
- console.log('zh:game end 成功');
- xGame.soundMgr.playSound('slots_roll01');
- xGame.soundMgr.playSound("s_win");
- xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
- this.diyGameDataUtilForGameWin();
- }
- else {
- JSBridgeUtils.instance.showInternAd('gameend_faill');
- console.log('zh:game end失败');
- xGame.soundMgr.playSound('matchwin01');
- xGame.soundMgr.playSound("s_lose");
- xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
- }
- 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();
- }
- }
- diyGameDataUtilForGameWin() {
- console.log('zh: DiyGameDataUtilForGameWin diy ');
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- console.log('zh:DiyGameDataUtilForGameWin 111');
- case GameMode.bigMove:
- console.log('zh:DiyGameDataUtilForGameWin 222');
- this.restartGame();
- break;
- case GameMode.placeBall:
- console.log('zh:DiyGameDataUtilForGameWin 333');
- var level = xGame.common.placeBallCurLevel;
- console.log('zh:练习模式 联系了多少LEV=' + level);
- let db_over_lev = DataMgr.getChallengeMode_overLev();
- if (level > db_over_lev) {
- DataMgr.setChallengeMode_overLev(level);
- }
- break;
- default:
- console.log('zh:DiyGameDataUtilForGameWin 444');
- break;
- }
- }
- 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);
- this.logEventForChallenge_level_start(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 {
- let lev = level + 1;
- this.powerStartPlaceBallLevel(lev, 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;
- }
- }
- logEventForChallenge_level_start(level) {
- let keyStr = 'sjmd_challenge_level_start';
- let jsonStr = {
- "count": 0,
- "gold_balance ": DataMgr.getCoin(),
- "level": level,
- "diamond_balance ": DataMgr.getDiamond()
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- if (level > d.level) {
- jsonStr.count = d.count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- }
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
- }
- 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();
- }
- logEventForChallenge_level_complete(level) {
- let keyStr = 'sjmd_challenge_level_complete';
- let jsonStr = {
- "count": 1,
- "gold_balance ": DataMgr.getCoin(),
- "level": level,
- "diamond_balance ": DataMgr.getDiamond()
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- jsonStr.count = d.count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
- }
- logEventForChallenge_level_N(level) {
- console.log('zh:logEventForChallenge_level_N ' + level);
- let keyStr = 'sjmd_challenge_level_N';
- if (LocalStorageManager.hasKey(keyStr)) {
- let lev = LocalStorageManager.getItem(keyStr);
- if (level > lev) {
- LocalStorageManager.setItem(keyStr, level);
- }
- if ((level) % 5 == 0) {
- console.log('zh:每5关上报1次');
- let sjmc = 'challenge_level_' + level;
- JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
- let sjmcForFirebase = 'challenge_level_' + level;
- JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
- }
- else {
- console.log('zh:5 no 上报');
- }
- }
- else {
- LocalStorageManager.setItem(keyStr, level);
- }
- }
- }
- 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);
- JSBridgeUtils.instance.showInternAd('uivideoshare_show');
- 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) {
- 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();
- console.log('zh: 新手引导完毕');
- JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
- }
- }
- 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;
- }
- 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_UILogin extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UILogin"));
- }
- onConstruct() {
- this.n7 = (this.getChild("n7"));
- this.n0 = (this.getChild("n0"));
- this.btn_login = (this.getChild("btn_login"));
- this.closeBtn = (this.getChild("closeBtn"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n10 = (this.getChild("n10"));
- this.n12 = (this.getChild("n12"));
- this.btn_gotoReg = (this.getChild("btn_gotoReg"));
- this.lab_tip = (this.getChild("lab_tip"));
- this.txt_ua = (this.getChild("txt_ua"));
- this.txt_up = (this.getChild("txt_up"));
- }
- }
- ui_UILogin.URL = "ui://isxx5ak7bobav57u";
- class ui_UIReg extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIReg"));
- }
- onConstruct() {
- this.n9 = (this.getChild("n9"));
- this.closeBtn = (this.getChild("closeBtn"));
- this.btn_reg = (this.getChild("btn_reg"));
- this.n14 = (this.getChild("n14"));
- this.n15 = (this.getChild("n15"));
- this.n27 = (this.getChild("n27"));
- this.n26 = (this.getChild("n26"));
- this.txt_ua = (this.getChild("txt_ua"));
- this.n29 = (this.getChild("n29"));
- this.txt_up1 = (this.getChild("txt_up1"));
- this.n32 = (this.getChild("n32"));
- this.txt_up2 = (this.getChild("txt_up2"));
- this.n34 = (this.getChild("n34"));
- this.lab_tip = (this.getChild("lab_tip"));
- this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
- }
- }
- ui_UIReg.URL = "ui://isxx5ak7bobav57v";
- class ui_Button_reg extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Button_reg"));
- }
- onConstruct() {
- this.button = this.getController("button");
- this.n5 = (this.getChild("n5"));
- this.n4 = (this.getChild("n4"));
- }
- }
- ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
- 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.c1 = this.getController("c1");
- this.n23 = (this.getChild("n23"));
- this.n41 = (this.getChild("n41"));
- this.myList = (this.getChild("myList"));
- this.djList = (this.getChild("djList"));
- this.n45 = (this.getChild("n45"));
- this.n_item = (this.getChild("n_item"));
- 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_Component_close extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component_close"));
- }
- onConstruct() {
- this.n5 = (this.getChild("n5"));
- }
- }
- ui_Component_close.URL = "ui://isxx5ak7hgftv580";
- 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_Component_daoju extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component_daoju"));
- }
- onConstruct() {
- }
- }
- ui_Component_daoju.URL = "ui://isxx5ak7nmu9v57t";
- class ui_Button_login extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Button_login"));
- }
- onConstruct() {
- this.button = this.getController("button");
- this.n4 = (this.getChild("n4"));
- this.n3 = (this.getChild("n3"));
- }
- }
- ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
- class ui_Component_goto extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component_goto"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n0 = (this.getChild("n0"));
- this.n_goto = (this.getChild("n_goto"));
- }
- }
- ui_Component_goto.URL = "ui://isxx5ak7nnz5v589";
- 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_UILogin.URL, ui_UILogin);
- fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
- fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
- 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_Component_close.URL, ui_Component_close);
- 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_Component_daoju.URL, ui_Component_daoju);
- fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
- fgui.UIObjectFactory.setExtension(ui_Component_goto.URL, ui_Component_goto);
- 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();
- /*! *****************************************************************************
- Copyright (c) Microsoft Corporation. All rights reserved.
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of the
- License at http://www.apache.org/licenses/LICENSE-2.0
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
- MERCHANTABLITY OR NON-INFRINGEMENT.
- See the Apache Version 2.0 License for specific language governing permissions
- and limitations under the License.
- ***************************************************************************** */
- /* global Reflect, Promise */
- var extendStatics = function(d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- function __extends(d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- }
- var __assign = function() {
- __assign = Object.assign || function __assign(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
- }
- return t;
- };
- return __assign.apply(this, arguments);
- };
- function __rest(s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
- t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
- t[p[i]] = s[p[i]];
- return t;
- }
- function __decorate(decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- }
- function __param(paramIndex, decorator) {
- return function (target, key) { decorator(target, key, paramIndex); }
- }
- function __metadata(metadataKey, metadataValue) {
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
- }
- function __awaiter(thisArg, _arguments, P, generator) {
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
- }
- function __generator(thisArg, body) {
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
- function verb(n) { return function (v) { return step([n, v]); }; }
- function step(op) {
- if (f) throw new TypeError("Generator is already executing.");
- while (_) try {
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
- if (y = 0, t) op = [op[0] & 2, t.value];
- switch (op[0]) {
- case 0: case 1: t = op; break;
- case 4: _.label++; return { value: op[1], done: false };
- case 5: _.label++; y = op[1]; op = [0]; continue;
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
- default:
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
- if (t[2]) _.ops.pop();
- _.trys.pop(); continue;
- }
- op = body.call(thisArg, _);
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
- }
- }
- function __exportStar(m, exports) {
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
- }
- function __values(o) {
- var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
- if (m) return m.call(o);
- return {
- next: function () {
- if (o && i >= o.length) o = void 0;
- return { value: o && o[i++], done: !o };
- }
- };
- }
- function __read(o, n) {
- var m = typeof Symbol === "function" && o[Symbol.iterator];
- if (!m) return o;
- var i = m.call(o), r, ar = [], e;
- try {
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
- }
- catch (error) { e = { error: error }; }
- finally {
- try {
- if (r && !r.done && (m = i["return"])) m.call(i);
- }
- finally { if (e) throw e.error; }
- }
- return ar;
- }
- function __spread() {
- for (var ar = [], i = 0; i < arguments.length; i++)
- ar = ar.concat(__read(arguments[i]));
- return ar;
- }
- function __await(v) {
- return this instanceof __await ? (this.v = v, this) : new __await(v);
- }
- function __asyncGenerator(thisArg, _arguments, generator) {
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
- function fulfill(value) { resume("next", value); }
- function reject(value) { resume("throw", value); }
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
- }
- function __asyncDelegator(o) {
- var i, p;
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
- }
- function __asyncValues(o) {
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
- var m = o[Symbol.asyncIterator], i;
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
- }
- function __makeTemplateObject(cooked, raw) {
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
- return cooked;
- };
- function __importStar(mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
- result.default = mod;
- return result;
- }
- function __importDefault(mod) {
- return (mod && mod.__esModule) ? mod : { default: mod };
- }
- class CustomAlert {
- static show(title, content, buttons) {
- if (!Laya.Box || !Laya.Label || !Laya.Button) {
- console.error("UI模块未加载!请检查laya.ui.js是否引入");
- return;
- }
- const bg = new Laya.Box();
- bg.alpha = 0;
- bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
- Laya.stage.addChild(bg);
- Laya.Tween.to(bg, { alpha: 1 }, 200);
- const panel = new Laya.Box();
- panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
- panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
- bg.addChild(panel);
- const titleText = new Laya.Text();
- titleText.text = title;
- titleText.fontSize = 32;
- titleText.color = "#333333";
- titleText.bold = true;
- titleText.pos(20, 20);
- titleText.width = 360;
- titleText.align = "center";
- panel.addChild(titleText);
- const contentText = new Laya.Text();
- contentText.text = content;
- contentText.fontSize = 21;
- contentText.color = "#555555";
- contentText.pos(20, 70);
- contentText.width = 360;
- contentText.wordWrap = true;
- contentText.align = "center";
- panel.addChild(contentText);
- const buttonContainer = new Laya.Box();
- buttonContainer.pos(20, 160);
- panel.addChild(buttonContainer);
- const btnWidth = 120;
- const spacing = 30;
- const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
- buttons.forEach((btn, index) => {
- const button = new Laya.Button();
- button.label = btn.label;
- button.size(btnWidth, 40);
- button.labelSize = 22;
- button.pos(index * (btnWidth + spacing), 0);
- button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
- button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
- button.on(Laya.Event.MOUSE_OVER, this, () => {
- button.alpha = 0.9;
- });
- button.on(Laya.Event.MOUSE_OUT, this, () => {
- button.alpha = 1;
- });
- button.on(Laya.Event.CLICK, this, () => {
- btn.handler();
- Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
- bg.removeSelf();
- }));
- });
- buttonContainer.addChild(button);
- });
- buttonContainer.x = (panel.width - totalWidth) / 2;
- }
- }
- class ConfigMgr {
- constructor() {
- this.httpReqCount = 4;
- this.httpReqOkCount = 0;
- this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
- try {
- this.httpReqOkCount = 0;
- let reqData = JSON.stringify({
- gameName: "TQ",
- gameUserName: "zhangSan"
- });
- console.log('zh:第1个请求');
- const classicCfg = yield this.sendPostAsync('getClassicCfg', reqData);
- this.classicCfg = classicCfg;
- this.httpReqOkCount++;
- console.log('zh:第2个请求');
- const levelCfg = yield this.sendPostAsync('getLevelCfg', reqData);
- this.levelCfg = levelCfg;
- this.httpReqOkCount++;
- console.log('zh:第3个请求');
- const placeBallCfg = yield this.sendPostAsync('getPlaceBallCfg', reqData);
- this.placeBallCfg = placeBallCfg;
- this.httpReqOkCount++;
- console.log('zh:第4个请求npc');
- const npc = yield this.sendPostAsync('getNpc', reqData);
- this.npcJson = npc.Data;
- this.httpReqOkCount++;
- console.log('zh:所有配置加载完成');
- }
- catch (error) {
- console.error('请求失败:', error);
- }
- finally {
- if (this.httpReqCount > this.httpReqOkCount) {
- CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
- {
- label: "Okay", handler: () => {
- console.log("zh:好的知道了");
- JSBridgeUtils.instance.exitAndCloseGame();
- }
- }
- ]);
- }
- }
- });
- this.sendPostAsync = (action, reqData) => {
- return new Promise((resolve, reject) => {
- xGame.httpMgr.sendPost2025(action, reqData, (res) => {
- try {
- let code = res.code;
- if (code == 200) {
- const parsedData = JSON.parse(res.msg);
- resolve(parsedData);
- }
- else {
- console.log(`zh:res = ${JSON.stringify(res)}`);
- reject(new Error(`Request failed with code: ${code}`));
- }
- }
- catch (error) {
- console.error(`error=${error}`);
- alert("Please check your network connection.");
- reject(error);
- }
- finally {
- console.log(`zh:${action}`);
- }
- });
- });
- };
- }
- static getInstance() {
- if (!this._instance) {
- this._instance = new ConfigMgr();
- }
- return this._instance;
- }
- init() {
- this.getConfigFromServer();
- }
- test() {
- let reqData = JSON.stringify({
- gameName: "TQ",
- gameUserName: "zhangSan"
- });
- xGame.httpMgr.sendPost2025('getClassicCfg', reqData, (res) => {
- console.log('zh:1s');
- try {
- let code = res.code;
- let data = res.data;
- if (code == 200) {
- const parsedData = JSON.parse(data);
- this.classicCfg = parsedData;
- }
- else {
- console.log('zh:res = ' + JSON.stringify(res));
- }
- }
- catch (error) {
- console.log('error=' + error);
- alert("Please check your network connection.");
- }
- finally {
- console.log('zh:1');
- }
- });
- }
- getUserInfoByIndex(index) {
- return this.npcJson[index];
- }
- getRandomUserInfo() {
- let index = xGame.tools.random(0, this.npcJson.length);
- let rs = this.npcJson[index];
- return rs;
- }
- 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 Diy2025GameData {
- constructor() {
- this.challengeMode_overLev = 0;
- this.xszyForClassic = false;
- this.xszyForChallenge = false;
- }
- saveData() {
- let data = {};
- for (let k in this) {
- data[k.toString()] = this[k];
- }
- Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
- }
- getData() {
- let ld = Laya.LocalStorage.getItem(dataName + "diydata");
- 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.diyGameData = new Diy2025GameData();
- this.userData.getData();
- this.gameData.getData();
- this.itemData.getData();
- this.diyGameData.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();
- }
- static saveDiyGameData() {
- if (this.diyGameSaving)
- return;
- this.diyGameSaving = true;
- Laya.timer.once(500, this, () => {
- this.diyGameSaving = false;
- this.diyGameData.saveData();
- });
- }
- static getChallengeMode_overLev() {
- this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
- return this.challengeMode_overLev;
- }
- static setChallengeMode_overLev(levNum) {
- this.diyGameData.challengeMode_overLev = levNum;
- this.saveDiyGameData();
- }
- }
- DataMgr.isNewUser = false;
- DataMgr.fristEnter = true;
- DataMgr.levelType = 0;
- DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
- DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
- DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
- DataMgr.challengeMode_overLev = 0;
- DataMgr.xszyForClassic = false;
- DataMgr.xszyForChallenge = false;
- 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;
- DataMgr.diyGameSaving = 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();
- console.log('zh: 新手引导完毕');
- JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
- }
- }
- 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);
- });
- }
- else {
- this.logEventForClassic_win();
- }
- this.logEventForClassic_complete();
- 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:
- console.log('zh:招法模式 aaaaaa 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);
- }
- }
- this.logEventForRod_complete_N();
- if (!this.success) {
- Laya.timer.once(500, this, () => {
- xGame.uiMgr.Show(UIAddCoin$1);
- });
- }
- else {
- this.logEventForRod_win();
- }
- 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;
- }
- let level = xGame.common.placeBallCurLevel;
- if (level > 59) {
- this.logEventForChallenge_level_complete(level);
- }
- else {
- this.logEventForChallenge_level_N(level);
- }
- }
- 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;
- }
- }
- logEventForRod_complete_N() {
- let gfmsIdx = xGame.common.curPlayerSkillType;
- console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
- let gfmc = 'Skyfall Shot';
- if (gfmsIdx == 0) {
- gfmc = 'Skyfall Shot';
- }
- if (gfmsIdx == 1) {
- gfmc = 'Surging break';
- }
- if (gfmsIdx == 2) {
- gfmc = 'Frost Lock';
- }
- let level = DataMgr.getBigSkillByIndex(gfmsIdx);
- console.log('zh:logEventForRod_complete_N level = ' + level);
- let keyStr = 'sjmd_rod_start_' + gfmsIdx;
- let jsonStr = {
- "count": 0,
- "name": gfmc
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- jsonStr.count = d.count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- const d2 = LocalStorageManager.getItem(keyStr);
- let count = d2.count;
- console.log('zh:logEventForRod_complete_N count = ' + count);
- if (count % 5 == 0) {
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
- JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
- }
- }
- logEventForRod_win() {
- console.log('zh:logEventForRod_win,胜利');
- let gfmsIdx = xGame.common.curPlayerSkillType;
- console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
- let gfmc = 'Skyfall Shot';
- if (gfmsIdx == 0) {
- gfmc = 'Skyfall Shot';
- }
- if (gfmsIdx == 1) {
- gfmc = 'Surging break';
- }
- if (gfmsIdx == 2) {
- gfmc = 'Frost Lock';
- }
- let level = DataMgr.getBigSkillByIndex(gfmsIdx);
- console.log('zh:logEventForRod_win level = ' + level);
- let keyStr = 'sjmd_rod_win_' + gfmsIdx;
- let jsonStr = {
- "count": 1,
- "name": gfmc + ' Lev' + level
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- jsonStr.count = d.count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
- }
- logEventForClassic_win() {
- console.log('zh:logEventForClassic_win,胜利');
- let rtype = xGame.common.classicRoomType;
- let msmc = '';
- if (rtype == 1) {
- msmc = 'beginner';
- }
- if (rtype == 2) {
- msmc = 'expert';
- }
- if (rtype == 3) {
- msmc = 'master';
- }
- let keyStr = 'sjmd_classic_win_' + rtype;
- let jsonStr = {
- "difficulty": msmc,
- "classic_count": 1,
- "difficulty_count": 1
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- jsonStr.classic_count = d.classic_count + 1;
- jsonStr.difficulty_count = d.difficulty_count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
- }
- logEventForClassic_complete() {
- console.log('zh:logEventForClassic_complete,胜利');
- let rtype = xGame.common.classicRoomType;
- let msmc = '';
- if (rtype == 1) {
- msmc = 'beginner';
- }
- if (rtype == 2) {
- msmc = 'expert';
- }
- if (rtype == 3) {
- msmc = 'master';
- }
- let keyStr = 'sjmd_classic_complete_' + rtype;
- let jsonStr = {
- "msmc": msmc,
- "count": 0
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- jsonStr.count = d.count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- if (jsonStr.count % 5 == 0) {
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
- JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
- }
- }
- 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) {
- JSBridgeUtils.instance.showInternAd('gameend_success');
- console.log('zh:game end 成功');
- xGame.soundMgr.playSound('slots_roll01');
- xGame.soundMgr.playSound("s_win");
- xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
- this.diyGameDataUtilForGameWin();
- }
- else {
- JSBridgeUtils.instance.showInternAd('gameend_faill');
- console.log('zh:game end失败');
- xGame.soundMgr.playSound('matchwin01');
- xGame.soundMgr.playSound("s_lose");
- xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
- }
- 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();
- }
- }
- diyGameDataUtilForGameWin() {
- console.log('zh: DiyGameDataUtilForGameWin diy ');
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- console.log('zh:DiyGameDataUtilForGameWin 111');
- case GameMode.bigMove:
- console.log('zh:DiyGameDataUtilForGameWin 222');
- this.restartGame();
- break;
- case GameMode.placeBall:
- console.log('zh:DiyGameDataUtilForGameWin 333');
- var level = xGame.common.placeBallCurLevel;
- console.log('zh:练习模式 联系了多少LEV=' + level);
- let db_over_lev = DataMgr.getChallengeMode_overLev();
- if (level > db_over_lev) {
- DataMgr.setChallengeMode_overLev(level);
- }
- break;
- default:
- console.log('zh:DiyGameDataUtilForGameWin 444');
- break;
- }
- }
- 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);
- this.logEventForChallenge_level_start(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 {
- let lev = level + 1;
- this.powerStartPlaceBallLevel(lev, 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;
- }
- }
- logEventForChallenge_level_start(level) {
- let keyStr = 'sjmd_challenge_level_start';
- let jsonStr = {
- "count": 0,
- "gold_balance ": DataMgr.getCoin(),
- "level": level,
- "diamond_balance ": DataMgr.getDiamond()
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- if (level > d.level) {
- jsonStr.count = d.count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- }
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
- }
- 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();
- }
- logEventForChallenge_level_complete(level) {
- let keyStr = 'sjmd_challenge_level_complete';
- let jsonStr = {
- "count": 1,
- "gold_balance ": DataMgr.getCoin(),
- "level": level,
- "diamond_balance ": DataMgr.getDiamond()
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- jsonStr.count = d.count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
- }
- logEventForChallenge_level_N(level) {
- console.log('zh:logEventForChallenge_level_N ' + level);
- let keyStr = 'sjmd_challenge_level_N';
- if (LocalStorageManager.hasKey(keyStr)) {
- let lev = LocalStorageManager.getItem(keyStr);
- if (level > lev) {
- LocalStorageManager.setItem(keyStr, level);
- }
- if ((level) % 5 == 0) {
- console.log('zh:每5关上报1次');
- let sjmc = 'challenge_level_' + level;
- JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
- let sjmcForFirebase = 'challenge_level_' + level;
- JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
- }
- else {
- console.log('zh:5 no 上报');
- }
- }
- else {
- LocalStorageManager.setItem(keyStr, level);
- }
- }
- }
- 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()) {
- console.log('zh:powerEnough =' + 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);
- this.logEventForChallenge_level_start(this.level);
- xGame.uiMgr.Hide(UILevelDisplay$1);
- xGame.uiMgr.Hide(UIMain$1);
- this.hide();
- }));
- }
- else {
- console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
- xGame.uiMgr.Show(UIPower$1);
- }
- }
- logEventForChallenge_level_start(level) {
- let keyStr = 'sjmd_challenge_level_start';
- let jsonStr = {
- "count": 1,
- "gold_balance ": DataMgr.getCoin(),
- "level": level,
- "diamond_balance ": DataMgr.getDiamond()
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- if (level > d.level) {
- jsonStr.count = d.count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- }
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
- }
- 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() {
- console.log('zh:rod skill 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;
- console.log('zh: skilldisplay 1');
- 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);
- });
- this.logEventForRod_start();
- }
- else {
- console.log('zh: skilldisplay 2');
- xGame.uiMgr.Show(UIAddProp$1, 0);
- Moyu.sendDataEvent("AddCoinVideo");
- }
- }
- logEventForRod_start() {
- let gfmsIdx = xGame.common.curPlayerSkillType;
- console.log('zh:选择的技能=' + gfmsIdx);
- let gfmc = 'Skyfall Shot';
- if (gfmsIdx == 0) {
- gfmc = 'Skyfall Shot';
- }
- if (gfmsIdx == 1) {
- gfmc = 'Surging break';
- }
- if (gfmsIdx == 2) {
- gfmc = 'Frost Lock';
- }
- let keyStr = 'sjmd_rod_start_' + gfmsIdx;
- let jsonStr = {
- "count": 0,
- "name": gfmc
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- jsonStr.count = d.count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
- }
- }
- 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 strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
- "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
- "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.topX = 10;
- this.myIndex = this.topX + 1;
- 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.getPaiHangBangDataFormJosnFile();
- this.updateSelf();
- let self = Moyu.getUserInfo();
- if (!self.isAuth) {
- Moyu.initUser(this, () => {
- DataMgr.upRankData();
- });
- }
- }
- getPaiHangBangDataFormJosnFile() {
- const rankingList = cfgTable.paiHangBangData.list;
- this.updateItemData(rankingList);
- }
- updateSelfItem() {
- console.log('zh:Moyu.platType =' + Moyu.platType);
- 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 > this.topX ? "No Rank" : this.myIndex.toString();
- if (this.myIndex > this.topX) {
- this.ui.myNode.selfNode.rankTxt.fontSize = 36;
- }
- else {
- this.ui.myNode.selfNode.rankTxt.fontSize = 30;
- }
- this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
- this.ui.myNode.selfNode.nameTxt.text = '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();
- console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
- self.headIcon = self.headIcon;
- 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 > this.topX) {
- 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) };
- console.log('zh:Moyu.platType = ' + Moyu.platType);
- 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() {
- 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();
- this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
- }
- else {
- xGame.uiMgr.Show(UIAddProp$1, 1);
- }
- break;
- default:
- break;
- }
- }
- logEventForGouMaiGan(qiuGanName) {
- const ev = {
- value: qiuGanName
- };
- const jsonStr = JSON.stringify(ev);
- console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
- }
- }
- 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 = [65, 990, 580];
- this.peopleOffest = [5, 10, 10];
- }
- show(callback) {
- this.updateSelf();
- 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) {
- console.log('zh: 进入经典模式 type: ' + 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();
- });
- this.logEventForClassic_start();
- }
- 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);
- }
- logEventForClassic_start() {
- let rtype = xGame.common.classicRoomType;
- let msmc = '';
- if (rtype == 1) {
- msmc = 'beginner';
- }
- if (rtype == 2) {
- msmc = 'expert';
- }
- if (rtype == 3) {
- msmc = 'master';
- }
- let keyStr = 'sjmd_classic_start_' + rtype;
- let jsonStr = {
- "difficulty": msmc,
- "classic_count": 1,
- "difficulty_count": 1
- };
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- jsonStr.classic_count = d.classic_count + 1;
- jsonStr.difficulty_count = d.difficulty_count + 1;
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- const reqStr = JSON.stringify(jsonStr);
- JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
- }
- }
- 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) {
- JSBridgeUtils.instance.showInternAd('uivideoshare_show');
- }
- }
- 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) {
- console.log("zh: firstEnter");
- this.firstEnter = false;
- randTime += 900;
- }
- else {
- console.log("zh: no firstEnter");
- }
- 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) {
- console.log("zh:显示引导");
- xGame.soundMgr.playSound("s_guide");
- xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
- }
- else {
- console.log("zh:不需要显示引导");
- }
- }
- 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 });
- console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
- switch (xGame.common.gameMode) {
- case GameMode.classic:
- console.log('zh:进入经典模式111111111');
- if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
- let db_over_lev = DataMgr.getChallengeMode_overLev();
- console.log('zh:classic db_over_lev=', db_over_lev);
- if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
- console.log('zh:判断是否可以玩该模式classic =NO');
- let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
- xGame.uiMgr.Show(UIMsg$1, tipStr);
- return;
- }
- else {
- console.log('zh:可以玩该模式classic 66666666666666');
- this.beginGame();
- }
- }
- else {
- console.log('zh:不需要判断是否可以玩该classic');
- let challengeTimes = DataMgr.getChallengeTimes();
- if (challengeTimes == 0) {
- xGame.uiMgr.Show(UIInvitation$1);
- }
- else {
- this.beginGame();
- }
- break;
- }
- case GameMode.bigMove:
- console.error('zh:bigMove check');
- let guide = DataMgr.getSkillGuide();
- if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
- let db_over_lev = DataMgr.getChallengeMode_overLev();
- console.log('zh:bigMove db_over_lev=', db_over_lev);
- if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
- let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
- xGame.uiMgr.Show(UIMsg$1, tipStr);
- return;
- }
- else {
- console.log('zh:可以玩该模式 bigMove');
- this.beginGame();
- if (DataMgr.getNewUser())
- Moyu.sendDataEvent("gameStart0");
- }
- }
- else {
- this.beginGame();
- if (DataMgr.getNewUser())
- Moyu.sendDataEvent("gameStart0");
- }
- break;
- default:
- console.error('zh:未知错误!!!!');
- break;
- }
- }
- beginGame(isNice = false) {
- console.log('zh:beginGame ');
- let guide = DataMgr.getSkillGuide();
- if (guide == 1) {
- console.log('zh:非新手引导,showInternAd ');
- JSBridgeUtils.instance.showInternAd('beginGame');
- }
- else {
- console.log('zh:新手引导,不显示AD ');
- }
- console.log('zh:beginGame 2 go');
- if (xGame.common.gameMode == GameMode.classic) {
- if (isNice) {
- this.enterClassic();
- }
- else {
- xGame.uiMgr.Show(UIModeSelection$1, () => {
- console.log('zh:BBBBBBBBBBBBBBB');
- 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();
- console.log('zh: 进reg');
- }
- 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/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 = 180;
- 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
|