123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601 |
- (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 keyForLoginInfo = "userInfo";
- 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,
- keyForLoginInfo: keyForLoginInfo,
- 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 = urlTop + 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':'Network exception','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"));
- this.n_Logout = (this.getChild("n_Logout"));
- this.n_zhuCe = (this.getChild("n_zhuCe"));
- this.n_dengLu = (this.getChild("n_dengLu"));
- }
- }
- 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;
- this.curType = "";
- }
- 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.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
- this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
- this.addUIClick(this.ui, this.interuptSecretary);
- console.log('zh:this.renderBallRodthis.renderBallRodthis.renderBallRodthis.renderBallRod = ' + this.renderBallRod);
- 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;
- }
- show(type) {
- super.show();
- console.log('zh:show type = ' + type);
- this.curType = type == 0 ? "qiugan" : "daoju";
- this.switchBtn("qiugan");
- this.playSecretaryIdle();
- this.updateBallRod();
- }
- test123() {
- console.log('zh:test123 ');
- }
- switchBtn(type) {
- console.log('zh:1111切換 sel type=' + type);
- if (type == "") {
- type = this.curType;
- }
- else {
- if (this.curType == type) {
- return;
- }
- else {
- this.curType = type;
- }
- }
- if (type == "qiugan") {
- console.log('zh:qg sel');
- this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
- this.ui.myNode.n_daoju.c1.selectedIndex = 1;
- this.ui.myNode.myList.visible = true;
- this.ui.myNode.djList.visible = false;
- }
- else {
- console.log('zh:dj sel');
- this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
- this.ui.myNode.n_daoju.c1.selectedIndex = 0;
- this.ui.myNode.myList.visible = false;
- this.ui.myNode.djList.visible = true;
- }
- }
- 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_UIReg extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIReg"));
- }
- onConstruct() {
- this.n38 = (this.getChild("n38"));
- this.n9 = (this.getChild("n9"));
- this.n14 = (this.getChild("n14"));
- this.n15 = (this.getChild("n15"));
- this.n34 = (this.getChild("n34"));
- this.closeBtn = (this.getChild("closeBtn"));
- this.n39 = (this.getChild("n39"));
- this.lab_tip = (this.getChild("lab_tip"));
- this.n43 = (this.getChild("n43"));
- this.txt_ua = (this.getChild("txt_ua"));
- this.n44 = (this.getChild("n44"));
- this.txt_up1 = (this.getChild("txt_up1"));
- this.n45 = (this.getChild("n45"));
- this.txt_up2 = (this.getChild("txt_up2"));
- this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
- this.btn_reg = (this.getChild("btn_reg"));
- }
- }
- ui_UIReg.URL = "ui://isxx5ak7bobav57v";
- class ui_UILogin extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UILogin"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n18 = (this.getChild("n18"));
- this.n7 = (this.getChild("n7"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.closeBtn = (this.getChild("closeBtn"));
- this.btn_gotoReg = (this.getChild("btn_gotoReg"));
- this.btn_login = (this.getChild("btn_login"));
- this.n30 = (this.getChild("n30"));
- this.n31 = (this.getChild("n31"));
- this.txt_up = (this.getChild("txt_up"));
- this.n32 = (this.getChild("n32"));
- this.txt_ua = (this.getChild("txt_ua"));
- }
- }
- ui_UILogin.URL = "ui://isxx5ak7bobav57u";
- class UILogin extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UILogin.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.closeBtn, this.closeSelf);
- this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
- this.addUIClick(this.ui.btn_login, this.userLogin);
- }
- show() {
- super.show();
- this.x = (Laya.stage.width - this.width) / 2;
- this.y = (Laya.stage.height - this.height) / 2;
- }
- closeSelf() {
- this.hide();
- }
- userLogin() {
- let ua = this.ui.txt_ua.text;
- let up = this.ui.txt_up.text;
- if (ua && up) {
- xGame.uiMgr.Show(UIMsg, "Request in progress..");
- let reqData = JSON.stringify({
- username: ua.trim(),
- password: up.trim(),
- fromMark: 'app_game'
- });
- xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
- try {
- console.log('zh:res = ' + JSON.stringify(res));
- let code = res.code;
- let msg = res.msg;
- xGame.uiMgr.Show(UIMsg, msg);
- if (code == 200) {
- let keyStr = 'userInfo';
- let jsonStr = {
- "username": res.username,
- "token": res.token
- };
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- }
- }
- catch (error) {
- console.log('error=' + error);
- alert(error);
- }
- finally {
- }
- });
- }
- else {
- xGame.uiMgr.Show(UIMsg, "Missing information!");
- }
- }
- gotoRegPage() {
- this.closeSelf();
- xGame.uiMgr.Show(UIReg);
- }
- }
- UILogin.uiName = "UILogin";
- class UIReg extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UIReg.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.closeBtn, this.closeSelf);
- this.addUIClick(this.ui.btn_reg, this.regUser);
- this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
- }
- show() {
- super.show();
- this.x = (Laya.stage.width - this.width) / 2;
- this.y = (Laya.stage.height - this.height) / 2;
- }
- closeSelf() {
- this.hide();
- }
- regUser() {
- this.ui.lab_tip.visible = false;
- let ua = this.ui.txt_ua.text;
- let up1 = this.ui.txt_up1.text;
- let up2 = this.ui.txt_up2.text;
- if (ua && up1 && up2 && up1 == up2) {
- xGame.uiMgr.Show(UIMsg, "Request in progress..");
- let reqData = JSON.stringify({
- username: ua.trim(),
- password: up1.trim(),
- fromMark: 'app_game'
- });
- xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
- try {
- this.ui.lab_tip.visible = true;
- console.log('zh:res = ' + JSON.stringify(res));
- let code = res.code;
- let msg = res.msg;
- this.ui.lab_tip.text = msg;
- xGame.uiMgr.Show(UIMsg, msg);
- if (code == 200) {
- this.ui.lab_tip.color = "#FFFFFF";
- }
- else {
- this.ui.lab_tip.color = "#FF0000";
- }
- }
- catch (error) {
- console.log('error=' + error);
- alert(error);
- }
- finally {
- }
- });
- }
- else {
- if (up1 != up2) {
- xGame.uiMgr.Show(UIMsg, "Password mismatch!");
- }
- else {
- xGame.uiMgr.Show(UIMsg, "Missing information!");
- }
- }
- }
- gotoLogin() {
- this.closeSelf();
- xGame.uiMgr.Show(UILogin);
- }
- }
- UIReg.uiName = "UIReg";
- 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.onGetUserInfo();
- this.ui.n83.visible = false;
- if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
- const d = LocalStorageManager.getItem(keyForLoginInfo);
- let ua = d.username;
- this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
- }
- this.c_btn_for_user();
- window['nativeCallJs'] = this.nativeCallJs.bind(this);
- }
- Logout() {
- if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
- LocalStorageManager.removeItem(keyForLoginInfo);
- this.freshUser();
- }
- }
- gotoLogin() {
- xGame.uiMgr.Show(UILogin);
- }
- gotoRegUser() {
- xGame.uiMgr.Show(UIReg);
- }
- c_btn_for_user() {
- this.ui.n_Logout.visible = false;
- this.ui.n_dengLu.visible = false;
- this.ui.n_zhuCe.visible = false;
- if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
- this.ui.n_Logout.visible = true;
- }
- else {
- this.ui.n_dengLu.visible = true;
- }
- }
- 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);
- this.addUIClick(this.ui.n_Logout, this.Logout);
- this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
- this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
- }
- 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);
- }
- this.freshUser();
- }
- freshUser() {
- let user = Moyu.getUserInfo();
- if (!user.isAuth) {
- user.headIcon = 'res/ty_touxiang.png';
- }
- else {
- DataMgr.upRankData();
- }
- this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
- xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
- let keyStr = keyForLoginInfo;
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- let ua = d.username;
- this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
- }
- else {
- }
- this.c_btn_for_user();
- }
- 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, 0);
- }
- 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_Button_reg extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Button_reg"));
- }
- onConstruct() {
- this.button = this.getController("button");
- this.n6 = (this.getChild("n6"));
- 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.n_qiuGan = (this.getChild("n_qiuGan"));
- this.n_daoju = (this.getChild("n_daoju"));
- this.djList = (this.getChild("djList"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
- class ui_Component100 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component100"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n75 = (this.getChild("n75"));
- this.n76 = (this.getChild("n76"));
- this.n80 = (this.getChild("n80"));
- this.txt = (this.getChild("txt"));
- this.spineRoot = (this.getChild("spineRoot"));
- }
- }
- ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
- class ui_Component101 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component101"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n36 = (this.getChild("n36"));
- this.n35 = (this.getChild("n35"));
- this.n33 = (this.getChild("n33"));
- this.n34 = (this.getChild("n34"));
- }
- }
- ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
- class ui_Component53 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component53"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n7 = (this.getChild("n7"));
- this.n8 = (this.getChild("n8"));
- this.n9 = (this.getChild("n9"));
- this.n10 = (this.getChild("n10"));
- this.n11 = (this.getChild("n11"));
- this.n12 = (this.getChild("n12"));
- this.n13 = (this.getChild("n13"));
- this.n14 = (this.getChild("n14"));
- this.n15 = (this.getChild("n15"));
- this.n16 = (this.getChild("n16"));
- this.n19 = (this.getChild("n19"));
- this.n20 = (this.getChild("n20"));
- this.n21 = (this.getChild("n21"));
- this.n22 = (this.getChild("n22"));
- this.n23 = (this.getChild("n23"));
- this.n24 = (this.getChild("n24"));
- this.n25 = (this.getChild("n25"));
- this.n26 = (this.getChild("n26"));
- this.n27 = (this.getChild("n27"));
- this.n28 = (this.getChild("n28"));
- this.n29 = (this.getChild("n29"));
- this.n30 = (this.getChild("n30"));
- this.n31 = (this.getChild("n31"));
- this.n32 = (this.getChild("n32"));
- this.n33 = (this.getChild("n33"));
- this.n34 = (this.getChild("n34"));
- this.n35 = (this.getChild("n35"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component53.URL = "ui://isxx5ak7g1ie43u";
- class ui_Component58 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component58"));
- }
- onConstruct() {
- this.n23 = (this.getChild("n23"));
- this.n41 = (this.getChild("n41"));
- this.n8 = (this.getChild("n8"));
- this.skillList = (this.getChild("skillList"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component58.URL = "ui://isxx5ak7gg0z445";
- class ui_Component59 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component59"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.msgTxt = (this.getChild("msgTxt"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component59.URL = "ui://isxx5ak7gg0z446";
- class ui_RulerNode extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "RulerNode"));
- }
- onConstruct() {
- this.n6 = (this.getChild("n6"));
- this.n4 = (this.getChild("n4"));
- this.img1 = (this.getChild("img1"));
- this.img2 = (this.getChild("img2"));
- }
- }
- ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
- class ui_Component108 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component108"));
- }
- onConstruct() {
- this.n19 = (this.getChild("n19"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
- class ui_Component63 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component63"));
- }
- onConstruct() {
- this.n66 = (this.getChild("n66"));
- this.n56 = (this.getChild("n56"));
- this.n63 = (this.getChild("n63"));
- this.n65 = (this.getChild("n65"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component63.URL = "ui://isxx5ak7h657452";
- class ui_topNode extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "topNode"));
- }
- onConstruct() {
- this.selfProgress = (this.getChild("selfProgress"));
- this.aiProgress = (this.getChild("aiProgress"));
- this.selfKuang = (this.getChild("selfKuang"));
- this.aiKuang = (this.getChild("aiKuang"));
- this.selfHeadLoader = (this.getChild("selfHeadLoader"));
- this.aiHeadLoader = (this.getChild("aiHeadLoader"));
- this.n33 = (this.getChild("n33"));
- this.n34 = (this.getChild("n34"));
- this.selfNameTxt = (this.getChild("selfNameTxt"));
- this.aiNameTxt = (this.getChild("aiNameTxt"));
- this.selfBallList = (this.getChild("selfBallList"));
- this.aiBallList = (this.getChild("aiBallList"));
- this.middleNode = (this.getChild("middleNode"));
- this.selfScoreTxt = (this.getChild("selfScoreTxt"));
- this.aiScoreTxt = (this.getChild("aiScoreTxt"));
- this.scoreNode = (this.getChild("scoreNode"));
- this.selfTips = (this.getChild("selfTips"));
- this.aiTips = (this.getChild("aiTips"));
- }
- }
- ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
- class ui_selfProgress extends fgui.GProgressBar {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "selfProgress"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.bar = (this.getChild("bar"));
- }
- }
- ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
- class ui_aiProgress extends fgui.GProgressBar {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "aiProgress"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.bar = (this.getChild("bar"));
- }
- }
- ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
- class ui_ballDisplay extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ballDisplay"));
- }
- onConstruct() {
- this.myImg = (this.getChild("myImg"));
- }
- }
- ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
- class ui_moveNode extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "moveNode"));
- }
- onConstruct() {
- this.n8 = (this.getChild("n8"));
- this.finger = (this.getChild("finger"));
- }
- }
- ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
- class ui_cancelBtn extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "cancelBtn"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- }
- }
- ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
- class ui_shareBtn extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "shareBtn"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n2 = (this.getChild("n2"));
- this.n1 = (this.getChild("n1"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- }
- }
- ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
- class ui_share2Btn extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "share2Btn"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- }
- }
- ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
- class ui_rodMethodNode extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "rodMethodNode"));
- }
- onConstruct() {
- this.bg = (this.getChild("bg"));
- this.dot = (this.getChild("dot"));
- }
- }
- ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
- class ui_sureBtn extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "sureBtn"));
- }
- onConstruct() {
- this.n2 = (this.getChild("n2"));
- this.n1 = (this.getChild("n1"));
- }
- }
- ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
- class ui_Component18 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component18"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.nameTxt = (this.getChild("nameTxt"));
- this.headImg = (this.getChild("headImg"));
- this.n24 = (this.getChild("n24"));
- this.skillImg = (this.getChild("skillImg"));
- this.skillTxt = (this.getChild("skillTxt"));
- }
- }
- ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
- class ui_Component45 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component45"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n40 = (this.getChild("n40"));
- this.n41 = (this.getChild("n41"));
- this.targetScoreTxt = (this.getChild("targetScoreTxt"));
- this.n42 = (this.getChild("n42"));
- this.awardTxt = (this.getChild("awardTxt"));
- this.n44 = (this.getChild("n44"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component45.URL = "ui://isxx5ak7i4k2438";
- class ui_emotionDisplay extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "emotionDisplay"));
- }
- onConstruct() {
- this.myIcon = (this.getChild("myIcon"));
- }
- }
- ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
- class ui_Component49 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component49"));
- }
- onConstruct() {
- this.n69 = (this.getChild("n69"));
- this.n56 = (this.getChild("n56"));
- }
- }
- ui_Component49.URL = "ui://isxx5ak7i4k243n";
- class ui_Component50 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component50"));
- }
- onConstruct() {
- this.n54 = (this.getChild("n54"));
- this.n65 = (this.getChild("n65"));
- }
- }
- ui_Component50.URL = "ui://isxx5ak7i4k243o";
- class ui_Component51 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component51"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n51 = (this.getChild("n51"));
- this.n54 = (this.getChild("n54"));
- }
- }
- ui_Component51.URL = "ui://isxx5ak7i4k243p";
- class ui_Button5 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Button5"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n0 = (this.getChild("n0"));
- this.n2 = (this.getChild("n2"));
- }
- }
- ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
- class ui_Component124 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component124"));
- }
- onConstruct() {
- this.n22 = (this.getChild("n22"));
- this.shareNode = (this.getChild("shareNode"));
- }
- }
- ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
- class ui_Component125 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component125"));
- }
- onConstruct() {
- this.n29 = (this.getChild("n29"));
- this.coinTxt = (this.getChild("coinTxt"));
- }
- }
- ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
- class ui_Component52 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component52"));
- }
- onConstruct() {
- this.n35 = (this.getChild("n35"));
- this.n36 = (this.getChild("n36"));
- }
- }
- ui_Component52.URL = "ui://isxx5ak7ihpy43t";
- class ui_drawBtn extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "drawBtn"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n2 = (this.getChild("n2"));
- this.n1 = (this.getChild("n1"));
- this.n5 = (this.getChild("n5"));
- }
- }
- ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
- class ui_Component43 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component43"));
- }
- onConstruct() {
- this.n49 = (this.getChild("n49"));
- }
- }
- ui_Component43.URL = "ui://isxx5ak7iveg434";
- class ui_wordsDisplay extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "wordsDisplay"));
- }
- onConstruct() {
- this.txt = (this.getChild("txt"));
- this.n63 = (this.getChild("n63"));
- }
- }
- ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
- class ui_Component_phb extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component_phb"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- }
- }
- ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
- class ui_Component3 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component3"));
- }
- onConstruct() {
- this.n26 = (this.getChild("n26"));
- this.n24 = (this.getChild("n24"));
- this.nameTxt = (this.getChild("nameTxt"));
- this.headRoot = (this.getChild("headRoot"));
- }
- }
- ui_Component3.URL = "ui://isxx5ak7ixm43xh";
- class ui_Component4 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component4"));
- }
- onConstruct() {
- this.headImg = (this.getChild("headImg"));
- }
- }
- ui_Component4.URL = "ui://isxx5ak7ixm43xi";
- class ui_Component7 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component7"));
- }
- onConstruct() {
- this.n17 = (this.getChild("n17"));
- }
- }
- ui_Component7.URL = "ui://isxx5ak7ixm43xq";
- class ui_Component8 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component8"));
- }
- onConstruct() {
- this.n19 = (this.getChild("n19"));
- }
- }
- ui_Component8.URL = "ui://isxx5ak7ixm43xr";
- class ui_Component10 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component10"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n40 = (this.getChild("n40"));
- }
- }
- ui_Component10.URL = "ui://isxx5ak7ixm43xt";
- class ui_Component11 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component11"));
- }
- onConstruct() {
- this.n34 = (this.getChild("n34"));
- }
- }
- ui_Component11.URL = "ui://isxx5ak7ixm43xu";
- class ui_Component12 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component12"));
- }
- onConstruct() {
- this.n35 = (this.getChild("n35"));
- }
- }
- ui_Component12.URL = "ui://isxx5ak7ixm43xv";
- class ui_Component13 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component13"));
- }
- onConstruct() {
- this.n27 = (this.getChild("n27"));
- this.n36 = (this.getChild("n36"));
- }
- }
- ui_Component13.URL = "ui://isxx5ak7ixm43xw";
- class ui_dh_js_tuowei extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
- }
- onConstruct() {
- this.n19 = (this.getChild("n19"));
- this.n18 = (this.getChild("n18"));
- this.n0 = (this.getChild("n0"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n8 = (this.getChild("n8"));
- this.n9 = (this.getChild("n9"));
- this.n10 = (this.getChild("n10"));
- this.n11 = (this.getChild("n11"));
- this.n12 = (this.getChild("n12"));
- this.n13 = (this.getChild("n13"));
- this.n14 = (this.getChild("n14"));
- this.n15 = (this.getChild("n15"));
- this.n20 = (this.getChild("n20"));
- this.t0 = this.getTransition("t0");
- this.t1 = this.getTransition("t1");
- }
- }
- ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
- class ui_dh_js_tw_g extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
- class ui_dh_js_xingxing extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n0 = (this.getChild("n0"));
- this.t2 = this.getTransition("t2");
- this.t1 = this.getTransition("t1");
- }
- }
- ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
- class ui_dh_zy_jiazai extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n8 = (this.getChild("n8"));
- this.n7 = (this.getChild("n7"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
- class ui_dh_js_xingxing2 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n3 = (this.getChild("n3"));
- this.n5 = (this.getChild("n5"));
- this.n4 = (this.getChild("n4"));
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- }
- }
- ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
- class ui_dh_js_tuowei2 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
- }
- onConstruct() {
- this.n19 = (this.getChild("n19"));
- this.n21 = (this.getChild("n21"));
- this.n0 = (this.getChild("n0"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n8 = (this.getChild("n8"));
- this.n9 = (this.getChild("n9"));
- this.n10 = (this.getChild("n10"));
- this.n11 = (this.getChild("n11"));
- this.n12 = (this.getChild("n12"));
- this.n13 = (this.getChild("n13"));
- this.n14 = (this.getChild("n14"));
- this.n15 = (this.getChild("n15"));
- this.n23 = (this.getChild("n23"));
- this.t0 = this.getTransition("t0");
- this.t1 = this.getTransition("t1");
- }
- }
- ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
- class ui_dh_js_tw_g_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
- class ui_dh_js_shibai_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
- }
- onConstruct() {
- this.n4 = (this.getChild("n4"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.idle = this.getTransition("idle");
- this.attack = this.getTransition("attack");
- }
- }
- ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
- class ui_special extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "special"));
- }
- onConstruct() {
- this.n18 = (this.getChild("n18"));
- this.n19 = (this.getChild("n19"));
- this.n20 = (this.getChild("n20"));
- this.n21 = (this.getChild("n21"));
- this.n22 = (this.getChild("n22"));
- this.levelTxt = (this.getChild("levelTxt"));
- this.n24 = (this.getChild("n24"));
- this.n25 = (this.getChild("n25"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_special.URL = "ui://isxx5ak7j979v4i6";
- class ui_Component145 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component145"));
- }
- onConstruct() {
- this.guanyuNode = (this.getChild("guanyuNode"));
- }
- }
- ui_Component145.URL = "ui://isxx5ak7jaakv51f";
- class ui_longBtn extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "longBtn"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n2 = (this.getChild("n2"));
- this.n1 = (this.getChild("n1"));
- this.n4 = (this.getChild("n4"));
- }
- }
- ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
- class ui_Component146 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component146"));
- }
- onConstruct() {
- this.n89 = (this.getChild("n89"));
- this.n90 = (this.getChild("n90"));
- this.guideBtn = (this.getChild("guideBtn"));
- }
- }
- ui_Component146.URL = "ui://isxx5ak7jaakv55w";
- class ui_Component146_11 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component146_11"));
- }
- onConstruct() {
- this.n89 = (this.getChild("n89"));
- this.n90 = (this.getChild("n90"));
- this.guideBtn = (this.getChild("guideBtn"));
- }
- }
- ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
- class ui_Component111_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component111_1"));
- }
- onConstruct() {
- this.n68 = (this.getChild("n68"));
- this.myMask = (this.getChild("myMask"));
- }
- }
- ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
- class ui_Component64_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component64_1"));
- }
- onConstruct() {
- this.n57 = (this.getChild("n57"));
- this.n54 = (this.getChild("n54"));
- this.n55 = (this.getChild("n55"));
- this.n56 = (this.getChild("n56"));
- this.t1 = this.getTransition("t1");
- }
- }
- ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
- class ui_ModeSelection_com123 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
- }
- onConstruct() {
- this.type1 = (this.getChild("type1"));
- this.type2 = (this.getChild("type2"));
- this.type3 = (this.getChild("type3"));
- this.n38 = (this.getChild("n38"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
- class ui_Component132_2 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component132_2"));
- }
- onConstruct() {
- this.n25 = (this.getChild("n25"));
- this.n26 = (this.getChild("n26"));
- this.n27 = (this.getChild("n27"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
- class ui_UIPower$1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UIPower"));
- }
- onConstruct() {
- this.n11 = (this.getChild("n11"));
- this.myNode = (this.getChild("myNode"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
- class ui_Component133 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component133"));
- }
- onConstruct() {
- this.n29 = (this.getChild("n29"));
- this.n30 = (this.getChild("n30"));
- }
- }
- ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
- class ui_Component134 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component134"));
- }
- onConstruct() {
- this.n30 = (this.getChild("n30"));
- this.n31 = (this.getChild("n31"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
- class ui_Component135 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component135"));
- }
- onConstruct() {
- this.n30 = (this.getChild("n30"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
- class ui_Component137 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component137"));
- }
- onConstruct() {
- this.n28 = (this.getChild("n28"));
- this.n29 = (this.getChild("n29"));
- this.n30 = (this.getChild("n30"));
- this.n32 = (this.getChild("n32"));
- }
- }
- ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
- class ui_dh_zuanshi extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n0 = (this.getChild("n0"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- }
- }
- ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
- class ui_Component138 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component138"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
- class ui_Component139 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component139"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
- class ui_Component140 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component140"));
- }
- onConstruct() {
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
- class ui_Component141 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component141"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
- class ui_powerNode extends fgui.GProgressBar {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "powerNode"));
- }
- onConstruct() {
- this.n2 = (this.getChild("n2"));
- this.bar_v = (this.getChild("bar_v"));
- this.showImg = (this.getChild("showImg"));
- this.n12 = (this.getChild("n12"));
- }
- }
- ui_powerNode.URL = "ui://isxx5ak7kt443qh";
- class ui_dh_jingbi1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n8 = (this.getChild("n8"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
- class ui_Component94 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component94"));
- }
- onConstruct() {
- this.n77 = (this.getChild("n77"));
- }
- }
- ui_Component94.URL = "ui://isxx5ak7l1574b6";
- class ui_Component95 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component95"));
- }
- onConstruct() {
- this.n77 = (this.getChild("n77"));
- }
- }
- ui_Component95.URL = "ui://isxx5ak7l1574b7";
- class ui_Component126 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component126"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.normalBtn = (this.getChild("normalBtn"));
- this.tripleBtn = (this.getChild("tripleBtn"));
- }
- }
- ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
- class ui_Component60 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component60"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n48 = (this.getChild("n48"));
- this.womanTxt = (this.getChild("womanTxt"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component60.URL = "ui://isxx5ak7llhd44g";
- class ui_Component98_3 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component98_3"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n8 = (this.getChild("n8"));
- this.n41 = (this.getChild("n41"));
- this.n40 = (this.getChild("n40"));
- }
- }
- ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
- class ui_ModeSelection_com1 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
- }
- onConstruct() {
- this.n34 = (this.getChild("n34"));
- this.n36 = (this.getChild("n36"));
- this.n22 = (this.getChild("n22"));
- this.n20 = (this.getChild("n20"));
- this.n23 = (this.getChild("n23"));
- this.n24 = (this.getChild("n24"));
- this.n26 = (this.getChild("n26"));
- this.n33 = (this.getChild("n33"));
- this.coinImg = (this.getChild("coinImg"));
- this.need = (this.getChild("need"));
- this.n35 = (this.getChild("n35"));
- this.n29 = (this.getChild("n29"));
- this.tipsTxt = (this.getChild("tipsTxt"));
- this.n30 = (this.getChild("n30"));
- this.peopleTxt = (this.getChild("peopleTxt"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
- class ui_ModeSelection_com2 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
- }
- onConstruct() {
- this.n36 = (this.getChild("n36"));
- this.n34 = (this.getChild("n34"));
- this.n22 = (this.getChild("n22"));
- this.n20 = (this.getChild("n20"));
- this.n23 = (this.getChild("n23"));
- this.n24 = (this.getChild("n24"));
- this.n26 = (this.getChild("n26"));
- this.n33 = (this.getChild("n33"));
- this.coinImg = (this.getChild("coinImg"));
- this.need = (this.getChild("need"));
- this.n35 = (this.getChild("n35"));
- this.n29 = (this.getChild("n29"));
- this.tipsTxt = (this.getChild("tipsTxt"));
- this.n30 = (this.getChild("n30"));
- this.peopleTxt = (this.getChild("peopleTxt"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
- class ui_ModeSelection_com3 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
- }
- onConstruct() {
- this.n34 = (this.getChild("n34"));
- this.n36 = (this.getChild("n36"));
- this.n22 = (this.getChild("n22"));
- this.n20 = (this.getChild("n20"));
- this.n23 = (this.getChild("n23"));
- this.n24 = (this.getChild("n24"));
- this.n26 = (this.getChild("n26"));
- this.n33 = (this.getChild("n33"));
- this.coinImg = (this.getChild("coinImg"));
- this.need = (this.getChild("need"));
- this.n35 = (this.getChild("n35"));
- this.n29 = (this.getChild("n29"));
- this.tipsTxt = (this.getChild("tipsTxt"));
- this.n30 = (this.getChild("n30"));
- this.peopleTxt = (this.getChild("peopleTxt"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
- class ui_Invitation_com1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Invitation_com1"));
- }
- onConstruct() {
- this.n14 = (this.getChild("n14"));
- this.n13 = (this.getChild("n13"));
- this.n3 = (this.getChild("n3"));
- this.n1 = (this.getChild("n1"));
- this.n6 = (this.getChild("n6"));
- this.n7 = (this.getChild("n7"));
- this.enterBtn = (this.getChild("enterBtn"));
- this.n11 = (this.getChild("n11"));
- this.n12 = (this.getChild("n12"));
- this.n15 = (this.getChild("n15"));
- this.t0 = this.getTransition("t0");
- this.t1 = this.getTransition("t1");
- }
- }
- ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
- class ui_Component87_1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component87_1"));
- }
- onConstruct() {
- this.n74 = (this.getChild("n74"));
- this.n73 = (this.getChild("n73"));
- this.ballTxt = (this.getChild("ballTxt"));
- this.n76 = (this.getChild("n76"));
- this.helpLineBtn = (this.getChild("helpLineBtn"));
- this.levelTxt = (this.getChild("levelTxt"));
- this.n87 = (this.getChild("n87"));
- this.n84 = (this.getChild("n84"));
- this.hpTxt = (this.getChild("hpTxt"));
- this.n89 = (this.getChild("n89"));
- this.tipsTxt = (this.getChild("tipsTxt"));
- }
- }
- ui_Component87_1.URL = "ui://isxx5ak7luq648t";
- class ui_sqg1 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "sqg1"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n0 = (this.getChild("n0"));
- }
- }
- ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
- class ui_sqg2 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "sqg2"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n0 = (this.getChild("n0"));
- }
- }
- ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
- class ui_sqg3 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "sqg3"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n0 = (this.getChild("n0"));
- }
- }
- ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
- class ui_sqg4 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "sqg4"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n0 = (this.getChild("n0"));
- }
- }
- ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
- class ui_Component36 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component36"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n53 = (this.getChild("n53"));
- this.n56 = (this.getChild("n56"));
- }
- }
- ui_Component36.URL = "ui://isxx5ak7mnrs42r";
- class ui_Component37 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component37"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n52 = (this.getChild("n52"));
- this.n54 = (this.getChild("n54"));
- }
- }
- ui_Component37.URL = "ui://isxx5ak7mnrs42s";
- class ui_UISetting extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "UISetting"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n4 = (this.getChild("n4"));
- this.soundBtn = (this.getChild("soundBtn"));
- this.shakeBtn = (this.getChild("shakeBtn"));
- this.clickNode = (this.getChild("clickNode"));
- this.xyBtn = (this.getChild("xyBtn"));
- }
- }
- ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
- class ui_Component39 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component39"));
- }
- onConstruct() {
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n7 = (this.getChild("n7"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component39.URL = "ui://isxx5ak7mnrs42v";
- class ui_Component40 extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component40"));
- }
- onConstruct() {
- this.n46 = (this.getChild("n46"));
- this.n47 = (this.getChild("n47"));
- }
- }
- ui_Component40.URL = "ui://isxx5ak7mnrs42y";
- class ui_Component41 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component41"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n0 = (this.getChild("n0"));
- this.titleTxt = (this.getChild("titleTxt"));
- this.n2 = (this.getChild("n2"));
- this.msgTips = (this.getChild("msgTips"));
- this.numTxt = (this.getChild("numTxt"));
- this.n18 = (this.getChild("n18"));
- this.cancelBtn = (this.getChild("cancelBtn"));
- this.videoBtn = (this.getChild("videoBtn"));
- this.n10 = (this.getChild("n10"));
- }
- }
- ui_Component41.URL = "ui://isxx5ak7mnrs430";
- class ui_Component42 extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component42"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.tipsTxt = (this.getChild("tipsTxt"));
- this.cancelBtn = (this.getChild("cancelBtn"));
- this.sureBtn = (this.getChild("sureBtn"));
- this.n11 = (this.getChild("n11"));
- this.n13 = (this.getChild("n13"));
- this.n14 = (this.getChild("n14"));
- this.womanTxt = (this.getChild("womanTxt"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_Component42.URL = "ui://isxx5ak7mnrs431";
- class ui_dh_js_shengli extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.n4 = (this.getChild("n4"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n5 = (this.getChild("n5"));
- this.n6 = (this.getChild("n6"));
- this.n7 = (this.getChild("n7"));
- this.n8 = (this.getChild("n8"));
- this.attack = this.getTransition("attack");
- this.idle = this.getTransition("idle");
- }
- }
- ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
- class ui_dh_js_shengli_g extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
- }
- onConstruct() {
- this.n3 = (this.getChild("n3"));
- this.n1 = (this.getChild("n1"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
- class ui_dh_js_shibai extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n1 = (this.getChild("n1"));
- this.n2 = (this.getChild("n2"));
- this.n3 = (this.getChild("n3"));
- this.idle = this.getTransition("idle");
- this.attack = this.getTransition("attack");
- }
- }
- ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
- class ui_dh_zy_ganfa extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- }
- }
- ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
- class ui_dh_zy_sc_guang extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n2 = (this.getChild("n2"));
- }
- }
- ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
- class ui_dh_zy_shangcheng extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- this.n3 = (this.getChild("n3"));
- this.t0 = this.getTransition("t0");
- }
- }
- ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
- class ui_dh_zy_wanfa extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
- }
- onConstruct() {
- this.n0 = (this.getChild("n0"));
- }
- }
- ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
- class ui_Button_login extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Button_login"));
- }
- onConstruct() {
- this.button = this.getController("button");
- this.n5 = (this.getChild("n5"));
- this.n3 = (this.getChild("n3"));
- }
- }
- ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
- 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_Component_dl_zc extends fgui.GButton {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
- }
- onConstruct() {
- this.c1 = this.getController("c1");
- this.n0 = (this.getChild("n0"));
- }
- }
- ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
- 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_daoJuDisplay extends fgui.GComponent {
- static createInstance() {
- return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
- }
- onConstruct() {
- this.n1 = (this.getChild("n1"));
- this.n0 = (this.getChild("n0"));
- }
- }
- ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
- 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_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_Button_login.URL, ui_Button_login);
- 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_Component_dl_zc.URL, ui_Component_dl_zc);
- 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_daoJuDisplay.URL, ui_daoJuDisplay);
- 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;
- this.curType = "";
- }
- 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.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
- this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
- this.addUIClick(this.ui, this.interuptSecretary);
- console.log('zh:this.renderBallRodthis.renderBallRodthis.renderBallRodthis.renderBallRod = ' + this.renderBallRod);
- 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;
- }
- show(type) {
- super.show();
- console.log('zh:show type = ' + type);
- this.curType = type == 0 ? "qiugan" : "daoju";
- this.switchBtn("qiugan");
- this.playSecretaryIdle();
- this.updateBallRod();
- }
- test123() {
- console.log('zh:test123 ');
- }
- switchBtn(type) {
- console.log('zh:1111切換 sel type=' + type);
- if (type == "") {
- type = this.curType;
- }
- else {
- if (this.curType == type) {
- return;
- }
- else {
- this.curType = type;
- }
- }
- if (type == "qiugan") {
- console.log('zh:qg sel');
- this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
- this.ui.myNode.n_daoju.c1.selectedIndex = 1;
- this.ui.myNode.myList.visible = true;
- this.ui.myNode.djList.visible = false;
- }
- else {
- console.log('zh:dj sel');
- this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
- this.ui.myNode.n_daoju.c1.selectedIndex = 0;
- this.ui.myNode.myList.visible = false;
- this.ui.myNode.djList.visible = true;
- }
- }
- 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 UILogin$1 extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UILogin.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.closeBtn, this.closeSelf);
- this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
- this.addUIClick(this.ui.btn_login, this.userLogin);
- }
- show() {
- super.show();
- this.x = (Laya.stage.width - this.width) / 2;
- this.y = (Laya.stage.height - this.height) / 2;
- }
- closeSelf() {
- this.hide();
- }
- userLogin() {
- let ua = this.ui.txt_ua.text;
- let up = this.ui.txt_up.text;
- if (ua && up) {
- xGame.uiMgr.Show(UIMsg$1, "Request in progress..");
- let reqData = JSON.stringify({
- username: ua.trim(),
- password: up.trim(),
- fromMark: 'app_game'
- });
- xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
- try {
- console.log('zh:res = ' + JSON.stringify(res));
- let code = res.code;
- let msg = res.msg;
- xGame.uiMgr.Show(UIMsg$1, msg);
- if (code == 200) {
- let keyStr = 'userInfo';
- let jsonStr = {
- "username": res.username,
- "token": res.token
- };
- LocalStorageManager.setItem(keyStr, jsonStr);
- }
- else {
- }
- }
- catch (error) {
- console.log('error=' + error);
- alert(error);
- }
- finally {
- }
- });
- }
- else {
- xGame.uiMgr.Show(UIMsg$1, "Missing information!");
- }
- }
- gotoRegPage() {
- this.closeSelf();
- xGame.uiMgr.Show(UIReg$1);
- }
- }
- UILogin$1.uiName = "UILogin";
- class UIReg$1 extends UIBase {
- constructor() {
- super();
- }
- onConstructor() {
- this.ui = ui_UIReg.createInstance();
- this.contentPane = this.ui;
- this.isEject = false;
- this.addUIClick(this.ui.closeBtn, this.closeSelf);
- this.addUIClick(this.ui.btn_reg, this.regUser);
- this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
- }
- show() {
- super.show();
- this.x = (Laya.stage.width - this.width) / 2;
- this.y = (Laya.stage.height - this.height) / 2;
- }
- closeSelf() {
- this.hide();
- }
- regUser() {
- this.ui.lab_tip.visible = false;
- let ua = this.ui.txt_ua.text;
- let up1 = this.ui.txt_up1.text;
- let up2 = this.ui.txt_up2.text;
- if (ua && up1 && up2 && up1 == up2) {
- xGame.uiMgr.Show(UIMsg$1, "Request in progress..");
- let reqData = JSON.stringify({
- username: ua.trim(),
- password: up1.trim(),
- fromMark: 'app_game'
- });
- xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
- try {
- this.ui.lab_tip.visible = true;
- console.log('zh:res = ' + JSON.stringify(res));
- let code = res.code;
- let msg = res.msg;
- this.ui.lab_tip.text = msg;
- xGame.uiMgr.Show(UIMsg$1, msg);
- if (code == 200) {
- this.ui.lab_tip.color = "#FFFFFF";
- }
- else {
- this.ui.lab_tip.color = "#FF0000";
- }
- }
- catch (error) {
- console.log('error=' + error);
- alert(error);
- }
- finally {
- }
- });
- }
- else {
- if (up1 != up2) {
- xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
- }
- else {
- xGame.uiMgr.Show(UIMsg$1, "Missing information!");
- }
- }
- }
- gotoLogin() {
- this.closeSelf();
- xGame.uiMgr.Show(UILogin$1);
- }
- }
- UIReg$1.uiName = "UIReg";
- 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.onGetUserInfo();
- this.ui.n83.visible = false;
- if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
- const d = LocalStorageManager.getItem(keyForLoginInfo);
- let ua = d.username;
- this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
- }
- this.c_btn_for_user();
- window['nativeCallJs'] = this.nativeCallJs.bind(this);
- }
- Logout() {
- if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
- LocalStorageManager.removeItem(keyForLoginInfo);
- this.freshUser();
- }
- }
- gotoLogin() {
- xGame.uiMgr.Show(UILogin$1);
- }
- gotoRegUser() {
- xGame.uiMgr.Show(UIReg$1);
- }
- c_btn_for_user() {
- this.ui.n_Logout.visible = false;
- this.ui.n_dengLu.visible = false;
- this.ui.n_zhuCe.visible = false;
- if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
- this.ui.n_Logout.visible = true;
- }
- else {
- this.ui.n_dengLu.visible = true;
- }
- }
- 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);
- this.addUIClick(this.ui.n_Logout, this.Logout);
- this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
- this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
- }
- 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);
- }
- this.freshUser();
- }
- freshUser() {
- let user = Moyu.getUserInfo();
- if (!user.isAuth) {
- user.headIcon = 'res/ty_touxiang.png';
- }
- else {
- DataMgr.upRankData();
- }
- this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
- xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
- let keyStr = keyForLoginInfo;
- if (LocalStorageManager.hasJosnKey(keyStr)) {
- const d = LocalStorageManager.getItem(keyStr);
- let ua = d.username;
- this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
- }
- else {
- }
- this.c_btn_for_user();
- }
- 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, 0);
- }
- 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
|