bundle.js 903 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let keyForLoginInfo = "userInfo";
  52. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  53. let poolKey = {
  54. inHoleEft: "inHoleEft",
  55. d3ball: "d3ball",
  56. iceEft: "iceEft",
  57. hitEft: "hitEft",
  58. fireworksEft: "fireworksEft",
  59. };
  60. var GameMode;
  61. (function (GameMode) {
  62. GameMode[GameMode["classic"] = 0] = "classic";
  63. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  64. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  65. })(GameMode || (GameMode = {}));
  66. var SkillType;
  67. (function (SkillType) {
  68. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  69. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  70. SkillType[SkillType["ice"] = 2] = "ice";
  71. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  72. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  73. })(SkillType || (SkillType = {}));
  74. var ClassicWordsType;
  75. (function (ClassicWordsType) {
  76. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  77. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  78. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  79. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  80. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  81. })(ClassicWordsType || (ClassicWordsType = {}));
  82. var PressType;
  83. (function (PressType) {
  84. PressType[PressType["powerNode"] = 0] = "powerNode";
  85. PressType[PressType["d2Root"] = 1] = "d2Root";
  86. PressType[PressType["moveNode"] = 2] = "moveNode";
  87. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  88. })(PressType || (PressType = {}));
  89. var PlaceBallType;
  90. (function (PlaceBallType) {
  91. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  92. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  93. })(PlaceBallType || (PlaceBallType = {}));
  94. var EAdType;
  95. (function (EAdType) {
  96. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  97. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  98. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  99. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  100. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  101. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  102. EAdType[EAdType["sign"] = 6] = "sign";
  103. EAdType[EAdType["draw"] = 7] = "draw";
  104. EAdType[EAdType["triple"] = 8] = "triple";
  105. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  106. EAdType[EAdType["getPower"] = 10] = "getPower";
  107. EAdType[EAdType["box"] = 11] = "box";
  108. EAdType[EAdType["try"] = 12] = "try";
  109. EAdType[EAdType["againSign"] = 13] = "againSign";
  110. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  111. })(EAdType || (EAdType = {}));
  112. var Prop;
  113. (function (Prop) {
  114. Prop[Prop["diamond"] = 1] = "diamond";
  115. Prop[Prop["coin"] = 2] = "coin";
  116. Prop[Prop["gan1"] = 3] = "gan1";
  117. Prop[Prop["gan2"] = 4] = "gan2";
  118. Prop[Prop["gan3"] = 5] = "gan3";
  119. Prop[Prop["gan4"] = 6] = "gan4";
  120. })(Prop || (Prop = {}));
  121. var TipsType;
  122. (function (TipsType) {
  123. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  124. TipsType[TipsType["foul"] = 1] = "foul";
  125. })(TipsType || (TipsType = {}));
  126. class AwardType {
  127. constructor(type, num) {
  128. this.type = type;
  129. this.num = num;
  130. }
  131. }
  132. var define = /*#__PURE__*/Object.freeze({
  133. fguiRes: fguiRes,
  134. ballCamp: ballCamp,
  135. FoulType: FoulType,
  136. ALL_BALL_STOP: ALL_BALL_STOP,
  137. WAIT_SHOOT: WAIT_SHOOT,
  138. D3RES_LOADED: D3RES_LOADED,
  139. BALL_SHOOT: BALL_SHOOT,
  140. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  141. RESET_GAME: RESET_GAME,
  142. COIN_CHANGE: COIN_CHANGE,
  143. DIAMOND_CHANGE: DIAMOND_CHANGE,
  144. RESTART_GAME: RESTART_GAME,
  145. GET_USER_INFO: GET_USER_INFO,
  146. CHANGE_SECRETARY: CHANGE_SECRETARY,
  147. POWER_CHANGE: POWER_CHANGE,
  148. POWER_TIME: POWER_TIME,
  149. keyForLoginInfo: keyForLoginInfo,
  150. baseHeadUrl: baseHeadUrl,
  151. poolKey: poolKey,
  152. get GameMode () { return GameMode; },
  153. get SkillType () { return SkillType; },
  154. get ClassicWordsType () { return ClassicWordsType; },
  155. get PressType () { return PressType; },
  156. get PlaceBallType () { return PlaceBallType; },
  157. get EAdType () { return EAdType; },
  158. get Prop () { return Prop; },
  159. get TipsType () { return TipsType; },
  160. AwardType: AwardType
  161. });
  162. class CContext {
  163. constructor() {
  164. this.winSize = { width: 0, height: 0 };
  165. this.notchHeight = 0;
  166. this.bannerHeight = 0;
  167. }
  168. init(resList, callback) {
  169. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  170. this.notchHeight = this.getNotchHeight();
  171. this.bannerHeight = this.getBannerHeight();
  172. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  173. callback && callback();
  174. }));
  175. }
  176. getNotchHeight() {
  177. let notchHeight = 50;
  178. if (Laya.Browser.onMiniGame) {
  179. let deviceInfo = wx.getSystemInfoSync();
  180. if (Laya.Browser.onIOS) {
  181. if (deviceInfo.model.search('iPhone X') != -1) {
  182. notchHeight = deviceInfo.statusBarHeight - 10;
  183. }
  184. else {
  185. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  186. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  187. notchHeight = deviceInfo.statusBarHeight - 10;
  188. }
  189. }
  190. }
  191. else if (Laya.Browser.onAndroid) {
  192. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  193. notchHeight = deviceInfo.statusBarHeight;
  194. }
  195. }
  196. }
  197. return notchHeight;
  198. }
  199. getBannerHeight() {
  200. return 0;
  201. }
  202. }
  203. let context = new CContext();
  204. var Handler = Laya.Handler;
  205. var Tween = Laya.Tween;
  206. function playClickEffect(btn) {
  207. if (!btn)
  208. return;
  209. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  210. if (!btn)
  211. return;
  212. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  213. if (!btn)
  214. return;
  215. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  216. }), 0, true);
  217. }), 0, true);
  218. }
  219. function getNumList(strList) {
  220. let dataList = [];
  221. if (strList) {
  222. let list = strList;
  223. let array = list.split(',');
  224. for (var v in array) {
  225. dataList.push(Number(array[v]));
  226. }
  227. }
  228. return dataList;
  229. }
  230. function getStrList(strList) {
  231. let dataList = [];
  232. if (strList) {
  233. let list = strList;
  234. let array = list.split('|');
  235. for (var v in array) {
  236. dataList.push(String(array[v]));
  237. }
  238. }
  239. return dataList;
  240. }
  241. function getRandStr(len) {
  242. 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'];
  243. let str = "";
  244. for (let i = 0; i < len; i++) {
  245. let rand = random(0, list.length);
  246. str += list[rand];
  247. }
  248. return str;
  249. }
  250. function getUserId() {
  251. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  252. return str;
  253. }
  254. function formatPos(pos, len = 2) {
  255. let v = Math.pow(10, len);
  256. pos.x = Math.floor(pos.x * v) / v;
  257. pos.y = Math.floor(pos.y * v) / v;
  258. if (pos.z)
  259. pos.z = Math.floor(pos.z * v) / v;
  260. return pos;
  261. }
  262. function setPosInt(pos) {
  263. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  264. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  265. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  266. return pos;
  267. }
  268. function random(min, max) {
  269. var rang = max - min;
  270. var rand = Math.random() * rang;
  271. return Math.floor(rand) + min;
  272. }
  273. function randomList(list, num) {
  274. if (list.length <= num)
  275. return list;
  276. let arry = [];
  277. list.forEach(item => {
  278. arry.push(item);
  279. });
  280. let nums = [];
  281. for (let i = 0; i < num; i++) {
  282. let rand = random(0, arry.length);
  283. let v = arry[rand];
  284. nums.push(v);
  285. arry.splice(rand, 1);
  286. }
  287. return nums;
  288. }
  289. function worldToScreen(camera, point, pos) {
  290. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  291. pos.x = pos.x / Laya.stage.clientScaleX;
  292. pos.y = pos.y / Laya.stage.clientScaleY;
  293. }
  294. function getStringLenght(str) {
  295. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  296. }
  297. function reviseString(str, len) {
  298. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  299. if (ld > len) {
  300. let sl = Math.floor(len / 2);
  301. let rs = str.substring(0, sl);
  302. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  303. while (d + 2 < len) {
  304. sl++;
  305. rs = str.substring(0, sl);
  306. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  307. }
  308. return rs + "...";
  309. }
  310. return str;
  311. }
  312. function getCoinString(coin) {
  313. if (coin < 10000)
  314. return coin.toString();
  315. else if (coin < 1000000) {
  316. let vh = Math.ceil(coin / 100);
  317. return (vh / 10) + "k";
  318. }
  319. else if (coin < 1000000000) {
  320. var vh = Math.ceil(coin / 100000);
  321. return (vh / 10) + "m";
  322. }
  323. else if (coin < 1000000000000) {
  324. var vh = Math.ceil(coin / 100000000);
  325. return (vh / 10) + "b";
  326. }
  327. else if (coin < 1000000000000000) {
  328. var vh = Math.ceil(coin / 100000000000);
  329. return (vh / 10) + "t";
  330. }
  331. }
  332. function getV3Dest(pos, dir, dis, dest) {
  333. dir.x *= dis;
  334. dir.y *= dis;
  335. dir.z *= dis;
  336. Laya.Vector3.add(pos, dir, dest);
  337. return dest;
  338. }
  339. function getV2Dest(x1, y1, dir, dis, dest) {
  340. dest.x = x1 + dir.x * dis;
  341. dest.y = y1 + dir.y * dis;
  342. return dest;
  343. }
  344. function getV2Dir(x1, y1, x2, y2, dir) {
  345. dir.x = x2 - x1;
  346. dir.y = y2 - y1;
  347. Laya.Vector2.normalize(dir, dir);
  348. return dir;
  349. }
  350. function getV3Dir(p1, p2, dir) {
  351. Laya.Vector3.subtract(p1, p2, dir);
  352. Laya.Vector3.normalize(dir, dir);
  353. return dir;
  354. }
  355. function copyPos(ip, op) {
  356. op.x = ip.x;
  357. op.y = ip.y;
  358. if (ip.z)
  359. op.z = ip.z;
  360. return op;
  361. }
  362. function getScreenImg() {
  363. let gl = Laya.WebGLContext.mainContext;
  364. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  365. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  366. let w = gl.drawingBufferWidth;
  367. let h = gl.drawingBufferHeight;
  368. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  369. texture2d.setPixels(pixels);
  370. return new Laya.Texture(texture2d);
  371. }
  372. function playMoveByPositions(sp, positions, v, completeCallback) {
  373. let p;
  374. let play = () => {
  375. if (positions.length == 0) {
  376. completeCallback();
  377. return;
  378. }
  379. p = positions[0];
  380. positions.splice(0, 1);
  381. 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, () => {
  382. play();
  383. }));
  384. };
  385. play();
  386. }
  387. function setStarPos(node, num, max) {
  388. for (let i = 1; i <= 5; i++) {
  389. let img = node.getChildAt(i - 1);
  390. img.width = img.height = 30;
  391. img.pivotX = img.pivotY = 0.5;
  392. img.gray = i > num;
  393. img.visible = i <= max;
  394. if (max == 3) {
  395. img.x = node.width / 2 + (i - 2) * 30 - 15;
  396. img.y = node.height - 40;
  397. if (i == 2)
  398. img.y = node.height - 30;
  399. }
  400. else if (max == 5) {
  401. let ly = Math.abs(i - 3);
  402. img.x = node.width / 2 + (i - 3) * 20 - 15;
  403. img.y = node.height - ly * 8 - 30;
  404. }
  405. }
  406. }
  407. function playLoopAnimRotate(sp, time, clockwise = true) {
  408. let rotation;
  409. sp.rotation = sp.rotation % 360;
  410. if (clockwise) {
  411. rotation = -360;
  412. }
  413. else {
  414. rotation = 360;
  415. }
  416. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  417. this.playLoopAnimRotate(sp, time, clockwise);
  418. }));
  419. }
  420. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  421. let x, y;
  422. if (isBig) {
  423. x = valueXMin;
  424. y = valueYMin;
  425. }
  426. else {
  427. x = valueXMax;
  428. y = valueYMax;
  429. }
  430. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  431. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  432. }));
  433. }
  434. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  435. let scale;
  436. if (isBig) {
  437. scale = valueMin;
  438. }
  439. else {
  440. scale = valueMax;
  441. }
  442. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  443. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  444. }));
  445. }
  446. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  447. let value;
  448. if (isBig) {
  449. value = valueMin;
  450. }
  451. else {
  452. value = valueMax;
  453. }
  454. if (count) {
  455. count--;
  456. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  457. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  458. }));
  459. }
  460. else {
  461. sp.rotation = 0;
  462. }
  463. }
  464. function inRect(rect, p) {
  465. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  466. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  467. return true;
  468. }
  469. }
  470. return false;
  471. }
  472. function getNumberK(number) {
  473. if (number < 1000) {
  474. return number.toString();
  475. }
  476. else {
  477. return (number / 1000).toFixed(1) + "k";
  478. }
  479. }
  480. function pointInsideCircle(point, circle, r) {
  481. if (r === 0)
  482. return false;
  483. var dx = circle.x - point.x;
  484. var dy = circle.y - point.y;
  485. return dx * dx + dy * dy <= r * r;
  486. }
  487. function formatString(str, data) {
  488. if (!str || data == undefined) {
  489. return str;
  490. }
  491. if (typeof data === "object") {
  492. for (var key in data) {
  493. if (data.hasOwnProperty(key)) {
  494. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  495. }
  496. }
  497. }
  498. else {
  499. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  500. return str.replace(reg, function (match, index) {
  501. return args[index - (-1)];
  502. });
  503. }
  504. return str;
  505. }
  506. function getIntersection(a, b) {
  507. let t = [];
  508. for (var i = 0; i < a.length; i++) {
  509. for (var j = 0; j < b.length; j++) {
  510. if (a[i] == b[j]) {
  511. t.push(a[i]);
  512. }
  513. }
  514. }
  515. return t;
  516. }
  517. function getComplement(a, b) {
  518. let t = [];
  519. let count = false;
  520. for (var i = 0; i < a.length; i++) {
  521. count = false;
  522. for (var j = 0; j < b.length; j++) {
  523. if (a[i] == b[j]) {
  524. count = true;
  525. break;
  526. }
  527. }
  528. if (!count) {
  529. t.push(a[i]);
  530. }
  531. }
  532. return t;
  533. }
  534. function geSpriteStageRect(sp) {
  535. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  536. let rect = {
  537. x: point.x,
  538. y: point.y,
  539. width: sp.width * sp.globalScaleX,
  540. height: sp.height * sp.globalScaleY
  541. };
  542. return rect;
  543. }
  544. function touchButton(button) {
  545. let event = new Laya.Event();
  546. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  547. }
  548. function setColor(sprite, r, g, b) {
  549. var redMat = [
  550. r / 255, 0, 0, 0, 0,
  551. g / 255, 0, 0, 0, 0,
  552. b / 255, 0, 0, 0, 0,
  553. 0, 0, 0, 1, 0,
  554. ];
  555. var filter = new Laya.ColorFilter(redMat);
  556. sprite.filters = [filter];
  557. }
  558. function clone(obj, newobj = {}) {
  559. for (var attr in obj) {
  560. if (typeof obj[attr] == "object") {
  561. newobj[attr] = clone(obj[attr], newobj[attr]);
  562. }
  563. else {
  564. newobj[attr] = obj[attr];
  565. }
  566. }
  567. return newobj;
  568. }
  569. function _ms(arr, compare, begin, end) {
  570. const size = end - begin;
  571. if (size <= 1) {
  572. return;
  573. }
  574. const middle = (end + begin) >> 1;
  575. _ms(arr, compare, begin, middle);
  576. _ms(arr, compare, middle, end);
  577. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  578. return;
  579. }
  580. const merged = [];
  581. let leftIndex = begin, rightIndex = middle;
  582. while (merged.length < size) {
  583. if (leftIndex === middle) {
  584. merged.push(arr[rightIndex++]);
  585. }
  586. else if (rightIndex === end) {
  587. merged.push(arr[leftIndex++]);
  588. }
  589. else {
  590. const c = compare(arr[leftIndex], arr[rightIndex]);
  591. if (c <= 0) {
  592. merged.push(arr[leftIndex++]);
  593. }
  594. else {
  595. merged.push(arr[rightIndex++]);
  596. }
  597. }
  598. }
  599. arr.splice(begin, size, ...merged);
  600. }
  601. function sort(arr, compare) {
  602. if (!Array.isArray(arr)) {
  603. throw new Error('sort的参数必须为数组');
  604. }
  605. _ms(arr, compare, 0, arr.length);
  606. return arr;
  607. }
  608. function getLanguage(id) {
  609. }
  610. function getLanguageByTip(id) {
  611. }
  612. function toWeights(array) {
  613. let max = 0;
  614. for (var i = 0; i < array.length; i++) {
  615. max = max + array[i];
  616. if (array[i] == 0) {
  617. array[i] = 0;
  618. }
  619. else {
  620. array[i] = max;
  621. }
  622. }
  623. return array;
  624. }
  625. function unique(array) {
  626. var n = {}, r = [], len = array.length, val, type;
  627. for (var i = 0; i < array.length; i++) {
  628. val = array[i];
  629. type = typeof val;
  630. if (!n[val]) {
  631. n[val] = [type];
  632. r.push(val);
  633. }
  634. else if (n[val].indexOf(type) < 0) {
  635. n[val].push(type);
  636. r.push(val);
  637. }
  638. }
  639. return r;
  640. }
  641. function unique1(array) {
  642. var r = [];
  643. for (var i = 0, l = array.length; i < l; i++) {
  644. for (var j = i + 1; j < l; j++)
  645. if (array[i] == array[j])
  646. j == ++i;
  647. r.push(array[i]);
  648. }
  649. return r;
  650. }
  651. function getDistance(x1, y1, x2, y2) {
  652. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  653. }
  654. function getV2Dis(pos1, pos2) {
  655. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  656. }
  657. function getV2SqDis(pos1, pos2) {
  658. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  659. }
  660. function getDis(x1, y1, x2, y2) {
  661. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  662. }
  663. function getDeltaxy(x1, y1, x2, y2) {
  664. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  665. }
  666. function getSymbolNumber(num) {
  667. if (num > 0) {
  668. return "+" + num;
  669. }
  670. else if (num < 0) {
  671. return num.toString();
  672. }
  673. return num.toString();
  674. }
  675. function fixNumber(num, length) {
  676. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  677. }
  678. function toThousands(num) {
  679. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  680. }
  681. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  682. function fmtMoney(money) {
  683. money = toThousands(money.replace(/^0+/, ''));
  684. if (money.length == 0) {
  685. money = "0";
  686. }
  687. let unit = 0;
  688. for (var i = 0; i < money.length; i++) {
  689. if (money.charAt(i) == ",") {
  690. unit++;
  691. }
  692. }
  693. if (unit == 0) {
  694. return money;
  695. }
  696. else {
  697. let idx = money.indexOf(",");
  698. if (idx) {
  699. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  700. }
  701. return money.replace(",", ".");
  702. }
  703. }
  704. function flatten(arr) {
  705. while (arr.some(item => Array.isArray(item))) {
  706. arr = [].concat(...arr);
  707. }
  708. return arr;
  709. }
  710. function getDistanceByPoint(p1, p2) {
  711. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  712. }
  713. function getAngleByPoint(p1, p2) {
  714. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  715. }
  716. function toIntByArray(array) {
  717. for (var index = 0; index < array.length; index++) {
  718. array[index] = parseInt(array[index]);
  719. }
  720. return array;
  721. }
  722. function getAngle0To360(angle) {
  723. while (angle < 0) {
  724. angle += 360;
  725. }
  726. while (angle >= 360) {
  727. angle -= 360;
  728. }
  729. return angle;
  730. }
  731. function toAngle(radian) {
  732. return radian * 180 / Math.PI;
  733. }
  734. function toRadian(angle) {
  735. return angle * Math.PI / 180;
  736. }
  737. function getArrayValueRandom(array) {
  738. return array[random(0, array.length - 1)];
  739. }
  740. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  743. }
  744. function fmtTimeMMSS(time) {
  745. if (time < 0) {
  746. time = 0;
  747. }
  748. else
  749. time = Math.floor(time);
  750. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  751. }
  752. function fmtTimeMS(time) {
  753. if (time < 0) {
  754. time = 0;
  755. }
  756. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  757. }
  758. function fmtTimeHHMM(time) {
  759. if (time < 0) {
  760. time = 0;
  761. }
  762. time = Math.floor(time / 1000);
  763. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  764. }
  765. let severTime = 0;
  766. function getServerTime() {
  767. return new Date(new Date().getTime() - severTime);
  768. }
  769. function setServerTime(data) {
  770. severTime = (new Date().getTime() - data);
  771. }
  772. var tools = /*#__PURE__*/Object.freeze({
  773. playClickEffect: playClickEffect,
  774. getNumList: getNumList,
  775. getStrList: getStrList,
  776. getRandStr: getRandStr,
  777. getUserId: getUserId,
  778. formatPos: formatPos,
  779. setPosInt: setPosInt,
  780. random: random,
  781. randomList: randomList,
  782. worldToScreen: worldToScreen,
  783. getStringLenght: getStringLenght,
  784. reviseString: reviseString,
  785. getCoinString: getCoinString,
  786. getV3Dest: getV3Dest,
  787. getV2Dest: getV2Dest,
  788. getV2Dir: getV2Dir,
  789. getV3Dir: getV3Dir,
  790. copyPos: copyPos,
  791. getScreenImg: getScreenImg,
  792. playMoveByPositions: playMoveByPositions,
  793. setStarPos: setStarPos,
  794. playLoopAnimRotate: playLoopAnimRotate,
  795. playLoopAnimPosition: playLoopAnimPosition,
  796. playLoopAnimScale: playLoopAnimScale,
  797. playLoopAnimRotation: playLoopAnimRotation,
  798. inRect: inRect,
  799. getNumberK: getNumberK,
  800. pointInsideCircle: pointInsideCircle,
  801. formatString: formatString,
  802. getIntersection: getIntersection,
  803. getComplement: getComplement,
  804. geSpriteStageRect: geSpriteStageRect,
  805. touchButton: touchButton,
  806. setColor: setColor,
  807. clone: clone,
  808. sort: sort,
  809. getLanguage: getLanguage,
  810. getLanguageByTip: getLanguageByTip,
  811. toWeights: toWeights,
  812. unique: unique,
  813. unique1: unique1,
  814. getDistance: getDistance,
  815. getV2Dis: getV2Dis,
  816. getV2SqDis: getV2SqDis,
  817. getDis: getDis,
  818. getDeltaxy: getDeltaxy,
  819. getSymbolNumber: getSymbolNumber,
  820. fixNumber: fixNumber,
  821. toThousands: toThousands,
  822. fmtMoney: fmtMoney,
  823. flatten: flatten,
  824. getDistanceByPoint: getDistanceByPoint,
  825. getAngleByPoint: getAngleByPoint,
  826. toIntByArray: toIntByArray,
  827. getAngle0To360: getAngle0To360,
  828. toAngle: toAngle,
  829. toRadian: toRadian,
  830. getArrayValueRandom: getArrayValueRandom,
  831. promptByTip: promptByTip,
  832. promptByErrorCode: promptByErrorCode,
  833. fmtTimeMMSS: fmtTimeMMSS,
  834. fmtTimeMS: fmtTimeMS,
  835. fmtTimeHHMM: fmtTimeHHMM,
  836. getServerTime: getServerTime,
  837. setServerTime: setServerTime
  838. });
  839. class HttpMgr {
  840. constructor() {
  841. HttpMgr._instance = this;
  842. }
  843. static getInstance() {
  844. if (!this._instance) {
  845. this._instance = new HttpMgr();
  846. }
  847. return this._instance;
  848. }
  849. sendPost(url, data, call) {
  850. let httpObj = new Laya.HttpRequest();
  851. httpObj.http.timeout = 5000;
  852. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  853. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  854. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  855. function errorHandler(error) {
  856. console.log("errorHandler:" + error);
  857. alert("Please check your network connection.");
  858. }
  859. function completeHandler(data) {
  860. if (data && data.length > 0) {
  861. let jsonData = JSON.parse(data);
  862. if (call)
  863. call(jsonData);
  864. }
  865. }
  866. }
  867. sendPost2025(reqUrl, data, call) {
  868. let isDev = true;
  869. let urlTop = "https://api.kessongame.site/";
  870. let urlMid = urlTop + "prod-api/api/game/";
  871. if (isDev) {
  872. urlTop = "http://192.168.1.13:8090/";
  873. urlMid = urlTop + "api/game/";
  874. }
  875. let url = urlMid + reqUrl;
  876. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  877. if (isDev) {
  878. url = urlTop + reqUrl;
  879. }
  880. else {
  881. url = urlTop + "prod-api/" + reqUrl;
  882. }
  883. }
  884. let httpObj = new Laya.HttpRequest();
  885. httpObj.http.timeout = 5000;
  886. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  887. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  888. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  889. function errorHandler(error) {
  890. if (call) {
  891. call("{'msg':'Network exception','code':500}");
  892. }
  893. else {
  894. alert("Tip:Please check your network connection.");
  895. }
  896. }
  897. function completeHandler(data) {
  898. if (data && data.length > 0) {
  899. let jsonData = JSON.parse(data);
  900. if (call)
  901. call(jsonData);
  902. }
  903. }
  904. }
  905. sendGet(url, call) {
  906. let httpObj = new Laya.HttpRequest();
  907. httpObj.http.timeout = 5000;
  908. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  909. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  910. httpObj.send(url, '', 'get');
  911. function errorHandler(error) {
  912. console.log("errorHandler:" + error);
  913. }
  914. function completeHandler(data) {
  915. if (data && data.length > 0) {
  916. if (call)
  917. call(data);
  918. }
  919. }
  920. }
  921. }
  922. HttpMgr._instance = null;
  923. class LightShader extends Laya.Sprite {
  924. constructor() {
  925. super();
  926. this._time = 0;
  927. this._sin = 0;
  928. this.initShader();
  929. }
  930. initShader() {
  931. var vs = `
  932. #define FSHIGHPRECISION
  933. attribute vec4 posuv;
  934. uniform vec2 size;
  935. varying vec4 v_texcoord;
  936. void main() {
  937. vec4 pos = vec4(posuv.xy,0.,1.);
  938. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  939. gl_Position=pos1;
  940. v_texcoord.xy = posuv.xy;
  941. }
  942. `;
  943. var ps = `
  944. #define FSHIGHPRECISION
  945. precision highp float;
  946. varying vec4 v_texcoord;
  947. uniform vec2 size;
  948. uniform sampler2D texture;
  949. uniform float u_Time;
  950. void main() {
  951. vec4 color= texture2D(texture, v_texcoord.xy);
  952. float width = 0.2;
  953. float start = u_Time;
  954. float offset = 1.0;
  955. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  956. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  957. {
  958. color.r=1.1;
  959. color.g=1.1;
  960. color.b=1.1;
  961. gl_FragColor = color;
  962. } else {
  963. gl_FragColor = color;
  964. }
  965. }
  966. `;
  967. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  968. this.customRenderEnable = true;
  969. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  970. }
  971. customRender(context, x, y) {
  972. this.onUpdate();
  973. if (!this.texture)
  974. return;
  975. let xx = x - this.pivotX;
  976. let yy = y - this.pivotY;
  977. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  978. }
  979. onUpdate() {
  980. this._time += 2 * Laya.timer.delta * 0.001;
  981. this._sin = Math.sin(this._time);
  982. if (this._sin > 0.99) {
  983. this._sin = 0;
  984. this._time = 0;
  985. }
  986. this.shaderValue['u_Time'] = this._sin;
  987. }
  988. }
  989. LightShader.DissolveSurfaceSaveName = 9997;
  990. class UIBase extends fairygui.Window {
  991. constructor() {
  992. super();
  993. this.isEject = true;
  994. this.isHide = true;
  995. this.showbanner = true;
  996. this.className = "";
  997. this.isMuti = false;
  998. this.showbanner = false;
  999. this.onConstructor();
  1000. }
  1001. checkActive(show) {
  1002. }
  1003. getUIName() {
  1004. return UIBase.uiName;
  1005. }
  1006. onConstructor() {
  1007. }
  1008. onInit() {
  1009. if (!!this.contentPane) {
  1010. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1011. }
  1012. this.setPivot(0.5, 0.5, false);
  1013. }
  1014. doShowAnimation() {
  1015. if (!this.isEject)
  1016. return;
  1017. super.doShowAnimation();
  1018. Laya.Tween.clearTween(this);
  1019. this.scaleX = this.scaleY = 0.8;
  1020. let tweenFunc1 = (func) => {
  1021. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1022. };
  1023. let tweenFunc2 = (func) => {
  1024. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1025. };
  1026. tweenFunc1(tweenFunc2);
  1027. }
  1028. show(...args) {
  1029. super.show();
  1030. this._openParam = args;
  1031. this.isHide = false;
  1032. xGame.uiMgr.checkUIState();
  1033. }
  1034. moveBannerButton() {
  1035. }
  1036. showBannerButton() {
  1037. this.bannerButton.visible = true;
  1038. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1039. this.bannerButton.touchable = true;
  1040. }));
  1041. }
  1042. hide() {
  1043. super.hide();
  1044. this.isHide = true;
  1045. xGame.uiMgr.checkUIState();
  1046. }
  1047. Dispose() {
  1048. super.dispose();
  1049. }
  1050. myUpdate(delay) {
  1051. }
  1052. refresh() { }
  1053. addUIClick(obj, func, arr = null) {
  1054. obj.onClick(this, func, arr);
  1055. obj.onClick(this, this.playBtnSound);
  1056. }
  1057. offUIClick(obj, func) {
  1058. obj.offClick(this, func);
  1059. }
  1060. playBtnSound() {
  1061. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1062. }
  1063. }
  1064. UIBase.lastShowBanner = 0;
  1065. UIBase.showBannerNum = 0;
  1066. UIBase.uiName = "";
  1067. class ui_UIDraw extends fgui.GComponent {
  1068. static createInstance() {
  1069. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1070. }
  1071. onConstruct() {
  1072. this.n1 = (this.getChild("n1"));
  1073. this.extraNode = (this.getChild("extraNode"));
  1074. this.myNode = (this.getChild("myNode"));
  1075. this.closeNode = (this.getChild("closeNode"));
  1076. this.moneyNode = (this.getChild("moneyNode"));
  1077. this.n38 = (this.getChild("n38"));
  1078. this.secretary = (this.getChild("secretary"));
  1079. this.drawBtn = (this.getChild("drawBtn"));
  1080. this.talkNode = (this.getChild("talkNode"));
  1081. this.t0 = this.getTransition("t0");
  1082. }
  1083. }
  1084. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1085. class ui_UIBox extends fgui.GComponent {
  1086. static createInstance() {
  1087. return (fgui.UIPackage.createObject("game", "UIBox"));
  1088. }
  1089. onConstruct() {
  1090. this.n0 = (this.getChild("n0"));
  1091. this.n12 = (this.getChild("n12"));
  1092. this.n1 = (this.getChild("n1"));
  1093. this.n2 = (this.getChild("n2"));
  1094. this.bar = (this.getChild("bar"));
  1095. this.closeBtn = (this.getChild("closeBtn"));
  1096. this.openBtn = (this.getChild("openBtn"));
  1097. this.t0 = this.getTransition("t0");
  1098. this.t1 = this.getTransition("t1");
  1099. }
  1100. }
  1101. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1102. class GlobalManager {
  1103. constructor() {
  1104. }
  1105. registerMethod(name, method) {
  1106. console.log('zh: 注册全局方法', name);
  1107. this[name] = method;
  1108. }
  1109. callMethod(name, ...args) {
  1110. console.log('zh: 调用全局方法', name);
  1111. if (this[name]) {
  1112. return this[name](...args);
  1113. }
  1114. else {
  1115. console.error(`zh: 全局方法 Method ${name} not found`);
  1116. }
  1117. }
  1118. }
  1119. GlobalManager.instance = new GlobalManager();
  1120. class JSBridgeUtils {
  1121. constructor() { }
  1122. static get instance() {
  1123. if (!this._instance) {
  1124. this._instance = new JSBridgeUtils();
  1125. }
  1126. return this._instance;
  1127. }
  1128. initBridge() {
  1129. if (!Laya.Browser.onAndroid) {
  1130. console.log('zh:非android dev');
  1131. return;
  1132. }
  1133. let cfg = window['conchConfig'];
  1134. if (cfg) {
  1135. var os = cfg.getOS();
  1136. if (os == "Conch-android") {
  1137. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1138. if (this.bridge) {
  1139. return true;
  1140. }
  1141. else {
  1142. return false;
  1143. }
  1144. }
  1145. else {
  1146. return false;
  1147. }
  1148. }
  1149. else {
  1150. return false;
  1151. }
  1152. }
  1153. testAd1() {
  1154. if (!Laya.Browser.onAndroid) {
  1155. console.log('zh:非android dev');
  1156. return;
  1157. }
  1158. if (!this.initBridge()) {
  1159. return;
  1160. }
  1161. let rs = this.bridge.call("testString", "hello");
  1162. console.log('zh:testString rs=' + rs);
  1163. }
  1164. testAdCallBack() {
  1165. if (!this.initBridge()) {
  1166. return;
  1167. }
  1168. console.log("zh:testAdCallBack start");
  1169. const defaultObj = { code: 200, msg: "req update Ui" };
  1170. const reqObj = { code: 300, msg: "hello java ui" };
  1171. this.bridge.callWithBack((rsStr) => {
  1172. const rsObj = JSON.parse(rsStr);
  1173. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1174. }, "testAsyncCallback", JSON.stringify(reqObj));
  1175. }
  1176. showInternAd(mark) {
  1177. console.log('zh:showInternAd start');
  1178. if (!Laya.Browser.onAndroid) {
  1179. console.log('zh:showInternAd 非android dev');
  1180. return false;
  1181. }
  1182. if (!this.initBridge()) {
  1183. return false;
  1184. }
  1185. let rs = this.bridge.call("showInternAd", mark);
  1186. try {
  1187. const result = JSON.parse(rs);
  1188. if (result.code === 200) {
  1189. console.log("zh:showInternAd OK");
  1190. return true;
  1191. }
  1192. else {
  1193. console.warn("zh:showInternAd FAILL:", result.msg);
  1194. return false;
  1195. }
  1196. }
  1197. catch (e) {
  1198. console.error("zh:解析桥接返回值失败:", e);
  1199. return false;
  1200. }
  1201. }
  1202. exitAndCloseGame() {
  1203. if (!Laya.Browser.onAndroid) {
  1204. console.log('zh:非android dev');
  1205. return;
  1206. }
  1207. if (!this.initBridge()) {
  1208. return;
  1209. }
  1210. console.log('zh:开始关闭游戏-');
  1211. this.bridge.call("exitAndCloseGame");
  1212. }
  1213. showRewardAd(mark) {
  1214. if (!Laya.Browser.onAndroid) {
  1215. console.log('zh:非android dev');
  1216. return false;
  1217. }
  1218. if (!this.initBridge()) {
  1219. return false;
  1220. }
  1221. let rs = this.bridge.call("showRewardAd", mark);
  1222. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1223. try {
  1224. const result = JSON.parse(rs);
  1225. if (result.code === 200) {
  1226. console.log("zh:广告显示成功");
  1227. return true;
  1228. }
  1229. else {
  1230. console.warn("zh:广告显示失败:", result.msg);
  1231. return false;
  1232. }
  1233. }
  1234. catch (e) {
  1235. console.error("zh:解析桥接返回值失败:", e);
  1236. return false;
  1237. }
  1238. }
  1239. logEventForAdNoParams(eventName) {
  1240. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1241. if (!Laya.Browser.onAndroid) {
  1242. console.log('zh:非android dev');
  1243. return;
  1244. }
  1245. if (!this.initBridge()) {
  1246. return;
  1247. }
  1248. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1249. this.bridge.call("logEventForAdNoParams", eventName);
  1250. }
  1251. logEventForAdHaveParams(eventName, jsonStr) {
  1252. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1253. if (!Laya.Browser.onAndroid) {
  1254. console.log('zh:非android dev');
  1255. return;
  1256. }
  1257. if (!this.initBridge()) {
  1258. return;
  1259. }
  1260. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1261. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1262. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1263. }
  1264. logEventForFirebase(eventName, jsonStr) {
  1265. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1266. if (!Laya.Browser.onAndroid) {
  1267. console.log('zh:非android dev');
  1268. return;
  1269. }
  1270. if (!this.initBridge()) {
  1271. return;
  1272. }
  1273. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1274. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1275. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1276. }
  1277. nativeCallJs(msg) {
  1278. console.log("zh:nativeCallJs received data: 1111", msg);
  1279. if (msg === 'Ad1') {
  1280. GlobalManager.instance.callMethod('Ad1');
  1281. console.log("zh: Ad1 奖励发送成功");
  1282. }
  1283. else if (msg === 'Ad2') {
  1284. GlobalManager.instance.callMethod('Ad2');
  1285. console.log("zh: Ad2 奖励发送成功");
  1286. }
  1287. else if (msg === 'Ad3') {
  1288. GlobalManager.instance.callMethod('Ad3');
  1289. console.log("zh: Ad3 奖励发送成功");
  1290. }
  1291. else if (msg === 'Ad4') {
  1292. GlobalManager.instance.callMethod('Ad4');
  1293. console.log("zh: Ad4 奖励发送成功");
  1294. }
  1295. else if (msg === 'Ad5') {
  1296. console.log("zh: Ad5 奖励发送成功");
  1297. GlobalManager.instance.callMethod('Ad5');
  1298. }
  1299. }
  1300. }
  1301. class UIBox extends UIBase {
  1302. constructor() {
  1303. super();
  1304. this.boxNum = 0;
  1305. this.boxMax = 10;
  1306. this.inAd = false;
  1307. this.isClose = false;
  1308. }
  1309. onConstructor() {
  1310. this.ui = ui_UIBox.createInstance();
  1311. this.contentPane = this.ui;
  1312. this.isEject = false;
  1313. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1314. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1315. Laya.timer.loop(1000, this, this.update);
  1316. }
  1317. update() {
  1318. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1319. this.boxNum -= 1;
  1320. this.upBar();
  1321. }
  1322. }
  1323. upBar() {
  1324. if (this.boxNum > this.boxMax)
  1325. this.boxNum = this.boxMax;
  1326. this.ui.bar.value = this.boxNum * 10;
  1327. }
  1328. show() {
  1329. super.show();
  1330. this.isClose = false;
  1331. this.boxNum = 0;
  1332. this.inAd = false;
  1333. this.upBar();
  1334. this.ui.t0.play();
  1335. this.ui.closeBtn.visible = false;
  1336. Laya.timer.once(3000, this, () => {
  1337. this.ui.closeBtn.visible = true;
  1338. this.ui.bar.alpha = 1;
  1339. });
  1340. Laya.timer.once(500, this, () => {
  1341. this.ui.t1.play();
  1342. });
  1343. }
  1344. hide() {
  1345. Laya.timer.clearAll(this);
  1346. Moyu.showBannerAd(false);
  1347. super.hide();
  1348. }
  1349. onOpenBox() {
  1350. this.boxNum++;
  1351. if (this.boxNum < this.boxMax) {
  1352. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1353. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1354. }
  1355. }
  1356. else if (this.boxNum == this.boxMax) {
  1357. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1358. this.ui.openBtn.c1.selectedIndex = 13;
  1359. this.inAd = true;
  1360. }
  1361. else
  1362. this.getAward();
  1363. }
  1364. else if (this.inAd) {
  1365. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1366. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1367. }
  1368. else {
  1369. console.log('zh:AD 失败,直接发放奖励');
  1370. this.qjff_AD_for_UIBOX_onOpenBox();
  1371. }
  1372. }
  1373. this.upBar();
  1374. }
  1375. qjff_AD_for_UIBOX_onOpenBox() {
  1376. this.getAward();
  1377. }
  1378. onCloseBox() {
  1379. if (this.isClose)
  1380. this.hide();
  1381. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1382. this.isClose = true;
  1383. PlatMgr.showBanner(true, 0, 3000);
  1384. }
  1385. else
  1386. this.hide();
  1387. }
  1388. getAward() {
  1389. let str = "";
  1390. if (Math.random() < 0.5) {
  1391. let max = Moyu.isLegal ? 500 : 2500;
  1392. let num = xGame.tools.random(max, 500 + max);
  1393. DataMgr.setCoin(num);
  1394. str = "金币x" + num;
  1395. }
  1396. else {
  1397. let max = Moyu.isLegal ? 10 : 30;
  1398. let num = xGame.tools.random(max, 30 + max);
  1399. DataMgr.setDiamond(num);
  1400. str = "钻石x" + num;
  1401. }
  1402. xGame.showTip("恭喜获得-" + str);
  1403. this.hide();
  1404. }
  1405. }
  1406. UIBox.uiName = "UIBox";
  1407. class ui_UITry extends fgui.GComponent {
  1408. static createInstance() {
  1409. return (fgui.UIPackage.createObject("game", "UITry"));
  1410. }
  1411. onConstruct() {
  1412. this.n11 = (this.getChild("n11"));
  1413. this.myNode = (this.getChild("myNode"));
  1414. this.t0 = this.getTransition("t0");
  1415. }
  1416. }
  1417. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1418. class UITry extends UIBase {
  1419. constructor() {
  1420. super();
  1421. this.closeTime = 0;
  1422. this.closeNum = 0;
  1423. this.skillUrl = xGame.common.skillIconList;
  1424. }
  1425. onConstructor() {
  1426. this.ui = ui_UITry.createInstance();
  1427. this.contentPane = this.ui;
  1428. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1429. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1430. }
  1431. show() {
  1432. super.show();
  1433. this.closeNum = 0;
  1434. this.closeTime = 15;
  1435. this.ui.t0.play();
  1436. PlatMgr.showRateBanner();
  1437. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1438. Laya.timer.loop(1000, this, this.updateTime);
  1439. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1440. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1441. xGame.common.gameMgr.gamePause = true;
  1442. }
  1443. updateTime() {
  1444. if (this.closeTime > 1) {
  1445. this.closeTime--;
  1446. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1447. }
  1448. else
  1449. this.hide();
  1450. }
  1451. hide() {
  1452. Laya.timer.clearAll(this);
  1453. Moyu.showBannerAd(false);
  1454. super.hide();
  1455. xGame.common.gameMgr.gamePause = false;
  1456. }
  1457. onTry() {
  1458. console.log('zh:qjff_AD_for_uitry');
  1459. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1460. }
  1461. else {
  1462. console.log('zh:AD 失败,直接发放奖励');
  1463. this.qjff_AD_for_uitry();
  1464. }
  1465. }
  1466. qjff_AD_for_uitry() {
  1467. let select = xGame.common.curPlayerSkillType;
  1468. DataMgr.gameData.trySkill = select;
  1469. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1470. DataMgr.saveGameData();
  1471. DataMgr.setBigSkill(select, 1);
  1472. xGame.showTip("Trial Successful");
  1473. this.hide();
  1474. }
  1475. onCancel() {
  1476. if (this.closeNum > 0) {
  1477. this.closeNum--;
  1478. if (this.closeNum < 2)
  1479. this.hide();
  1480. return;
  1481. }
  1482. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1483. this.onTry();
  1484. }
  1485. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1486. this.closeNum = 3;
  1487. }
  1488. else
  1489. this.hide();
  1490. }
  1491. }
  1492. UITry.uiName = "UITry";
  1493. class PlatMgr {
  1494. static initConfig() {
  1495. this.lastVt = 0;
  1496. if (!Moyu.platConfig)
  1497. return;
  1498. for (let k in Moyu.platConfig) {
  1499. let pd = this[k];
  1500. let pc = Moyu.platConfig[k];
  1501. if (pd != undefined && pc != undefined)
  1502. this[k] = pc;
  1503. }
  1504. Moyu.setBannerPos(0.5, 1);
  1505. }
  1506. static rand100(num) {
  1507. return xGame.tools.random(0, 100) < num;
  1508. }
  1509. static isMisVideo() {
  1510. let dt = Laya.timer.currTimer - this.lastVt;
  1511. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1512. this.lastVt = Laya.timer.currTimer;
  1513. return true;
  1514. }
  1515. else {
  1516. if (this.rand100(this.fullVideoRate)) {
  1517. console.log('zh:插屏 ad start');
  1518. JSBridgeUtils.instance.showInternAd('platMgr');
  1519. }
  1520. return false;
  1521. }
  1522. }
  1523. static showVideo(call, type) {
  1524. Moyu.showVideoAd(() => {
  1525. this.lastVt = Laya.timer.currTimer;
  1526. call && call();
  1527. }, type);
  1528. }
  1529. static showInsert(delay = false) {
  1530. if (this.getRand() < this.insertRate) {
  1531. let dt = delay ? this.insertDelay : 0;
  1532. console.log('zh:插屏 ad start');
  1533. JSBridgeUtils.instance.showInternAd('gameInsert');
  1534. }
  1535. }
  1536. static gameInsert() {
  1537. let t = this.getRand();
  1538. let r = this.gameInsertRate;
  1539. if (t < r) {
  1540. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1541. }
  1542. }
  1543. static showRateBanner() {
  1544. if (this.getRand() < this.bannerRate)
  1545. this.showBanner(true, this.bannerDelay, 3000);
  1546. }
  1547. static showBanner(show, delay = 0, hide = 0) {
  1548. if (2 > 1) {
  1549. console.log('zh:显示showBanner广告 直接返回');
  1550. return;
  1551. }
  1552. if (!show)
  1553. Moyu.showBannerAd(false);
  1554. else {
  1555. Laya.timer.clear(this, this.bannerShow);
  1556. if (delay > 0)
  1557. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1558. else
  1559. this.bannerShow(true);
  1560. if (hide > 0)
  1561. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1562. }
  1563. }
  1564. static bannerShow(show) {
  1565. if (2 > 1) {
  1566. console.log('zh:显示showBanner广告 直接返回');
  1567. return;
  1568. }
  1569. Moyu.showBannerAd(show);
  1570. console.log("showBanner" + show);
  1571. }
  1572. static getRand() {
  1573. return xGame.tools.random(0, 100);
  1574. }
  1575. static openBox() {
  1576. if (this.getRand() < this.boxRate)
  1577. xGame.uiMgr.Show(UIBox);
  1578. }
  1579. static openTry() {
  1580. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1581. return;
  1582. if (this.getRand() < this.tryRate)
  1583. xGame.uiMgr.Show(UITry);
  1584. else if (DataMgr.gameData.gameCount == 1)
  1585. xGame.uiMgr.Show(UITry);
  1586. }
  1587. }
  1588. PlatMgr.forceShare = 0;
  1589. PlatMgr.signAdRate = 0;
  1590. PlatMgr.forceVideoRate = 0;
  1591. PlatMgr.forceVideoGap = 0;
  1592. PlatMgr.fullVideoRate = 0;
  1593. PlatMgr.gameInsertRate = 0;
  1594. PlatMgr.insertGap = 0;
  1595. PlatMgr.insertDelay = 0;
  1596. PlatMgr.insertRate = 0;
  1597. PlatMgr.boxRate = 0;
  1598. PlatMgr.boxVideoRate = 0;
  1599. PlatMgr.boxInsertRate = 0;
  1600. PlatMgr.boxBannerRate = 0;
  1601. PlatMgr.tryRate = 0;
  1602. PlatMgr.tryClose3Rate = 0;
  1603. PlatMgr.tryVideoRate = 0;
  1604. PlatMgr.bannerRate = 0;
  1605. PlatMgr.lastVt = 0;
  1606. class ui_UIAddProp extends fgui.GComponent {
  1607. static createInstance() {
  1608. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1609. }
  1610. onConstruct() {
  1611. this.n11 = (this.getChild("n11"));
  1612. this.myNode = (this.getChild("myNode"));
  1613. this.closeBtn = (this.getChild("closeBtn"));
  1614. this.t0 = this.getTransition("t0");
  1615. }
  1616. }
  1617. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1618. class SpineMgr {
  1619. constructor(name, loadCb = null) {
  1620. this.loaded = false;
  1621. this.spineName = '';
  1622. this.loadedCallback = loadCb;
  1623. this.templet = new Laya.Templet();
  1624. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1625. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1626. if (name === 'mishu') {
  1627. this.templet.loadAni('spine/nvmishu.sk');
  1628. }
  1629. else {
  1630. this.templet.loadAni(`spine/${name}.sk`);
  1631. }
  1632. this.templet.lock = true;
  1633. this.spineName = name;
  1634. }
  1635. onError() {
  1636. console.log("zh:spine加载出错");
  1637. }
  1638. parseComplete() {
  1639. this.loaded = true;
  1640. this.loadedCallback && this.loadedCallback();
  1641. }
  1642. dispose() {
  1643. if (this.templet && !this.templet.destroyed) {
  1644. this.templet.destroy();
  1645. }
  1646. this.templet = null;
  1647. }
  1648. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1649. if (!this.loaded) {
  1650. return;
  1651. }
  1652. let spine;
  1653. if (mySpine) {
  1654. spine = mySpine;
  1655. }
  1656. else {
  1657. spine = this.createSpine(data, parent);
  1658. }
  1659. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1660. if (!isLoop) {
  1661. spine.on(Laya.Event.STOPPED, this, () => {
  1662. spine.offAll(Laya.Event.STOPPED);
  1663. callback && callback(spine);
  1664. });
  1665. }
  1666. return spine;
  1667. }
  1668. createSpine(data, parent, type = 1) {
  1669. let spine;
  1670. spine = this.templet.buildArmature(type);
  1671. spine.showSkinByIndex(0);
  1672. parent.addChild(spine);
  1673. spine.pos(data.x, data.y);
  1674. spine.scale(data.scaleX, data.scaleY, true);
  1675. return spine;
  1676. }
  1677. }
  1678. var AIState;
  1679. (function (AIState) {
  1680. AIState[AIState["none"] = 0] = "none";
  1681. AIState[AIState["idle"] = 1] = "idle";
  1682. AIState[AIState["reset"] = 2] = "reset";
  1683. AIState[AIState["move"] = 3] = "move";
  1684. AIState[AIState["wait"] = 4] = "wait";
  1685. AIState[AIState["select"] = 5] = "select";
  1686. AIState[AIState["turn"] = 6] = "turn";
  1687. AIState[AIState["shoot"] = 7] = "shoot";
  1688. AIState[AIState["leave"] = 8] = "leave";
  1689. })(AIState || (AIState = {}));
  1690. class AIPlayer {
  1691. constructor() {
  1692. this.dtime = 30;
  1693. this.awayTime = 0;
  1694. this.awayNum = 0;
  1695. this.hideTime = 0;
  1696. this.rootMoveTime = 0;
  1697. this.isGuide = false;
  1698. this.state = AIState.none;
  1699. this.waitTime = 0;
  1700. this.forceNum = 0;
  1701. this.forceMax = 0;
  1702. this.ballSize = 33;
  1703. this.selectNum = 0;
  1704. this.destRot = 0;
  1705. this.aiLv = 10;
  1706. this.kickBall = [];
  1707. this.lineBall = [];
  1708. this.scoreBall = [];
  1709. this.holeBall = [];
  1710. this.turnNum = 0;
  1711. this.setNum = 0;
  1712. this.setMax = 0;
  1713. this.setRate = 0;
  1714. this.rectL = 0;
  1715. this.rectR = 0;
  1716. this.rectT = 0;
  1717. this.rectB = 0;
  1718. this.rootPos = { x: 0, y: 0 };
  1719. this.bestForce = 0;
  1720. this.bestAngle = 180;
  1721. this.bestPos = { x: 0, y: 0 };
  1722. this.bestKick = { x: 0, y: 0 };
  1723. this.posList = [];
  1724. this.posIdx = 0;
  1725. this.chatTime = 3000;
  1726. this.tempDir1 = new Laya.Vector2();
  1727. this.tempDir2 = new Laya.Vector2();
  1728. this.tempDir3 = new Laya.Vector2();
  1729. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1730. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1731. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1732. this.gameSrc = xGame.common.gameUI;
  1733. this.hideTime = Laya.timer.currTimer;
  1734. Moyu.setOnTipCall((id) => {
  1735. if (id == 20012)
  1736. this.hideTime = Laya.timer.currTimer;
  1737. else
  1738. (id == 20011);
  1739. {
  1740. let dt = Laya.timer.currTimer - this.hideTime;
  1741. console.log("onshow" + dt);
  1742. if (dt > 30000 && this.state > AIState.none)
  1743. xGame.common.gameMgr.aiGameEnd(false);
  1744. }
  1745. }, this);
  1746. }
  1747. init() {
  1748. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1749. this.awayTime = xGame.tools.random(5000, 10000);
  1750. this.awayNum = 0;
  1751. this.hideTime = Laya.timer.currTimer;
  1752. let rect = xGame.common.d2World.borderRect;
  1753. this.rectL = Math.ceil(rect.x) + 17;
  1754. this.rectT = Math.ceil(rect.y) + 17;
  1755. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1756. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1757. this.wBall = xGame.common.d2World.rootBall;
  1758. this.ballSize = this.wBall.gameObj.width - 1;
  1759. if (this.posList.length < 1) {
  1760. let dp = 40;
  1761. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1762. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1763. let dx = i < this.rectR ? i : this.rectR;
  1764. let dy = j < this.rectB ? j : this.rectB;
  1765. let order = xGame.tools.random(0, 1000);
  1766. this.posList.push({ x: dx, y: dy, order: order });
  1767. }
  1768. }
  1769. this.posList.sort(function (a, b) {
  1770. return a.order - b.order;
  1771. });
  1772. this.setMax = this.posList.length;
  1773. }
  1774. this.state = AIState.idle;
  1775. }
  1776. setAiLevel(num) {
  1777. this.aiLv = num;
  1778. }
  1779. initBall() {
  1780. this.rootPos.x = this.wBall.gameObj.x;
  1781. this.rootPos.y = this.wBall.gameObj.y;
  1782. this.initHoleBall();
  1783. }
  1784. initHoleBall() {
  1785. this.kickBall = [];
  1786. this.lineBall = [];
  1787. this.scoreBall = [];
  1788. this.holeBall = [];
  1789. this.selectNum = 0;
  1790. this.forceNum = 0;
  1791. this.forceMax = 0;
  1792. this.turnNum = 0;
  1793. let list = xGame.common.d2World.ballArr;
  1794. if (list.length < 20 && !this.isGuide) {
  1795. let holes = xGame.common.gameMgr.holePosList;
  1796. for (let i = 0; i < list.length; i++) {
  1797. let obj = list[i];
  1798. if (!obj)
  1799. continue;
  1800. obj.kickPos.x = 0;
  1801. obj.kickPos.y = 0;
  1802. obj.poleAngle = 0;
  1803. obj.hard = 0;
  1804. obj.borderDis = 0;
  1805. obj.kickAngle = 180;
  1806. if (obj.number == 0)
  1807. continue;
  1808. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1809. continue;
  1810. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1811. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1812. continue;
  1813. }
  1814. let b = obj.gameObj;
  1815. let wbp = this.rootPos;
  1816. let bx = wbp.x - b.x;
  1817. let by = wbp.y - b.y;
  1818. obj.borderDis = xGame.tools.random(0, 100);
  1819. this.kickBall.push(obj);
  1820. if (!this.isLine(wbp, obj))
  1821. continue;
  1822. obj.kickAngle = xGame.tools.random(90, 180);
  1823. obj.kickPos.x = b.x;
  1824. obj.kickPos.y = b.y;
  1825. this.lineBall.push(obj);
  1826. let minDis = 999999;
  1827. let hole = false;
  1828. for (let j = 0; j < holes.length; j++) {
  1829. let hp = holes[j];
  1830. if (bx >= 0 && hp.x > b.x + 100)
  1831. continue;
  1832. if (bx <= 0 && hp.x < b.x - 100)
  1833. continue;
  1834. if (by < -10 && hp.y < wbp.y)
  1835. continue;
  1836. if (by > 10 && hp.y > wbp.y)
  1837. continue;
  1838. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1839. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1840. if (dis < minDis) {
  1841. let dx = b.x - this.tempDir1.x * this.ballSize;
  1842. let dy = b.y - this.tempDir1.y * this.ballSize;
  1843. this.tempDir3.x = this.tempDir1.x;
  1844. this.tempDir3.y = this.tempDir1.y;
  1845. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1846. obj.kickPos.x = dx;
  1847. obj.kickPos.y = dy;
  1848. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1849. if (num > 1)
  1850. num = 1;
  1851. obj.kickAngle = Math.acos(num) * 57.3;
  1852. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1853. dis = dis * 2;
  1854. if (Math.abs(hp.x - 600) < 100)
  1855. dis += 50;
  1856. obj.hard = dis + obj.kickAngle * 3;
  1857. hole = true;
  1858. }
  1859. }
  1860. }
  1861. }
  1862. if (hole) {
  1863. this.scoreBall.push(obj);
  1864. this.holeBall.push(obj);
  1865. }
  1866. }
  1867. this.scoreBall.sort(function (a, b) {
  1868. return a.hard - b.hard;
  1869. });
  1870. this.holeBall.sort(function (a, b) {
  1871. return a.kickAngle - b.kickAngle;
  1872. });
  1873. this.kickBall.sort(function (a, b) {
  1874. return a.borderDis - b.borderDis;
  1875. });
  1876. }
  1877. else {
  1878. let max = list.length - 1;
  1879. let i = xGame.tools.random(0, max);
  1880. for (i; i <= max; i++) {
  1881. let idx = i >= max ? i -= max : i;
  1882. let obj = list[idx];
  1883. if (obj && obj.number != 0) {
  1884. obj.kickAngle = xGame.tools.random(90, 180);
  1885. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1886. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1887. this.lineBall.push(obj);
  1888. break;
  1889. }
  1890. }
  1891. }
  1892. }
  1893. selectBall() {
  1894. let ball = null;
  1895. this.destRot = 0;
  1896. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1897. let ai = 110 - this.aiLv * 10;
  1898. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1899. let score = false;
  1900. if (this.scoreBall.length < 1) {
  1901. if (this.lineBall.length < 1) {
  1902. for (let i = 0; i < this.kickBall.length; i++) {
  1903. let list = [];
  1904. let bo = this.kickBall[i];
  1905. let bobj = bo.gameObj;
  1906. let rect = xGame.common.d2World.borderRect;
  1907. let mobj = this.wBall.gameObj;
  1908. let minb = bobj.y - rect.y - 20;
  1909. let minw = mobj.y - rect.y - 50;
  1910. if (minb > 0 && minw > 0) {
  1911. let dlenx = 0;
  1912. let dleny = mobj.y - rect.y;
  1913. let spx = mobj.x;
  1914. let spy = rect.y - dleny;
  1915. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1916. }
  1917. minb = rect.y + rect.height - bobj.y - 20;
  1918. minw = rect.y + rect.height - mobj.y - 50;
  1919. if (minb > 0 && minw > 0) {
  1920. let dlenx = 0;
  1921. let dleny = rect.y + rect.height - mobj.y;
  1922. let spx = mobj.x;
  1923. let spy = rect.y + rect.height + dleny;
  1924. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1925. }
  1926. minb = bobj.x - rect.x - 20;
  1927. minw = mobj.x - rect.x - 50;
  1928. if (minb > 0 && minw > 0) {
  1929. let dlenx = mobj.x - rect.x;
  1930. let dleny = 0;
  1931. let spx = rect.x - dlenx;
  1932. let spy = mobj.y;
  1933. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1934. }
  1935. minb = rect.x + rect.width - bobj.x - 20;
  1936. minw = rect.x + rect.width - mobj.x - 50;
  1937. if (minb > 0 && minw > 0) {
  1938. let dlenx = rect.x + rect.width - mobj.x;
  1939. let dleny = 0;
  1940. let spx = rect.x + rect.width + dlenx;
  1941. let spy = mobj.y;
  1942. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1943. }
  1944. list.sort(function (a, b) {
  1945. return a.order - b.order;
  1946. });
  1947. for (let i = 0; i < list.length; i++) {
  1948. let data = list[i];
  1949. let mx = mobj.x - bobj.x;
  1950. let my = mobj.y - bobj.y;
  1951. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1952. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1953. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1954. if (num > 1)
  1955. num = 1;
  1956. let cos = Math.acos(num);
  1957. if (cos > 1.57)
  1958. cos = 1.57;
  1959. else if (cos < 0.01)
  1960. cos = 0.01;
  1961. let tan = Math.tan(cos);
  1962. let dx = tan * data.dleny;
  1963. let dy = tan * data.dlenx;
  1964. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1965. if (Math.abs(bx - 667) < 40)
  1966. continue;
  1967. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1968. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1969. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1970. this.forceMax = dis * 0.08;
  1971. this.destRot += mis * 0.1;
  1972. this.setKick(bx, by);
  1973. return true;
  1974. }
  1975. }
  1976. }
  1977. }
  1978. else {
  1979. ball = xGame.common.getRandArrEle(this.lineBall);
  1980. }
  1981. }
  1982. else {
  1983. for (let i = 0; i < this.scoreBall.length; i++) {
  1984. if (i < this.scoreBall.length - 1) {
  1985. let rand = 70 + this.aiLv * 10 + i * 10;
  1986. if (xGame.tools.random(0, 100) < rand) {
  1987. ball = this.scoreBall[i];
  1988. break;
  1989. }
  1990. }
  1991. else {
  1992. ball = this.scoreBall[i];
  1993. break;
  1994. }
  1995. }
  1996. score = true;
  1997. this.selectNum++;
  1998. }
  1999. if (!ball)
  2000. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2001. if (this.selectNum >= max) {
  2002. let dx = ball.gameObj.x;
  2003. let dy = ball.gameObj.y;
  2004. let kickAngle = 0;
  2005. if (score) {
  2006. dx = ball.kickPos.x;
  2007. dy = ball.kickPos.y;
  2008. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2009. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2010. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2011. if (adot > 1)
  2012. adot = 1;
  2013. kickAngle = Math.acos(adot) * 57.3;
  2014. if (kickAngle > 45) {
  2015. let kdx = ball.kickPos.x - ball.gameObj.x;
  2016. let kdy = ball.kickPos.y - ball.gameObj.y;
  2017. dx = ball.kickPos.x - kdx * mis * 0.3;
  2018. dy = ball.kickPos.y - kdy * mis * 0.3;
  2019. }
  2020. else
  2021. this.destRot += mis;
  2022. }
  2023. else if (ball.poleAngle != 0) {
  2024. this.destRot += ball.poleAngle;
  2025. }
  2026. if (xGame.common.gameMode == 0) {
  2027. let af = kickAngle * 0.08;
  2028. this.forceMax = ball.hard * 0.1 + af * af;
  2029. }
  2030. this.setKick(dx, dy);
  2031. }
  2032. else {
  2033. let rand = this.aiLv * 5 + 40;
  2034. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2035. ball = xGame.common.getRandArrEle(this.scoreBall);
  2036. else
  2037. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2038. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2039. if (xGame.tools.random(0, 100) > rand) {
  2040. this.selectNum = max;
  2041. }
  2042. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2043. this.selectNum++;
  2044. }
  2045. ball.onClick(0, true);
  2046. }
  2047. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2048. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2049. let balls = xGame.common.d2World.ballArr;
  2050. let max = xGame.tools.getDis(hx, hy, bx, by);
  2051. for (let index = 0; index < balls.length; index++) {
  2052. let obj = balls[index];
  2053. if (obj.number == 0)
  2054. continue;
  2055. if (obj.number == bn || obj.number == dn)
  2056. continue;
  2057. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2058. if (dis * dis > max)
  2059. continue;
  2060. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2061. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2062. if (num > 1)
  2063. num = 1;
  2064. if (num < 0)
  2065. continue;
  2066. let gap = Math.sin(Math.acos(num)) * dis;
  2067. if (gap < this.ballSize)
  2068. return true;
  2069. }
  2070. return false;
  2071. }
  2072. isLine(xy, ball) {
  2073. let bx = xy.x;
  2074. let by = xy.y;
  2075. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2076. let dis = ball.getDestDis(xy);
  2077. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2078. let sin = Math.sin(angle);
  2079. let cos = Math.cos(angle);
  2080. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2081. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2082. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2083. let dx = bx + this.tempDir2.x * dis;
  2084. let dy = by + this.tempDir2.y * dis;
  2085. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2086. sin = Math.sin(-angle);
  2087. cos = Math.cos(-angle);
  2088. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2089. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2090. dx = bx + this.tempDir2.x * dis;
  2091. dy = by + this.tempDir2.y * dis;
  2092. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2093. if (isr && isl)
  2094. return false;
  2095. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2096. }
  2097. return true;
  2098. }
  2099. turnPole() {
  2100. this.turnNum++;
  2101. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2102. let dr = rot - this.destRot;
  2103. let abs = Math.abs(dr) % 360;
  2104. if (abs > 180) {
  2105. if (rot > 180)
  2106. rot -= 360;
  2107. if (this.destRot > 180)
  2108. this.destRot -= 360;
  2109. }
  2110. let max = this.turnNum * 5 + this.aiLv * 5;
  2111. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2112. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2113. let at = xGame.tools.random(1000, 2000);
  2114. if (!this.onAway(3))
  2115. at += xGame.tools.random(10000, 15000);
  2116. this.setState(AIState.shoot, at);
  2117. }
  2118. else {
  2119. let mr = 0;
  2120. if (abs > 3)
  2121. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2122. else if (Math.random() > 0.6)
  2123. mr = xGame.tools.random(1, 10) * 0.1;
  2124. mr = dr > 0 ? -mr : mr;
  2125. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2126. }
  2127. }
  2128. setKick(dx, dy) {
  2129. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2130. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2131. this.tempDir1.x = 0;
  2132. this.tempDir1.y = 1;
  2133. this.tempDir2.y = -this.tempDir2.y;
  2134. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2135. if (num > 1)
  2136. num = 1;
  2137. let rot = Math.acos(num) * 57.3;
  2138. if (this.tempDir2.x < 0)
  2139. rot = 360 - rot;
  2140. this.destRot += rot;
  2141. if (!xGame.common.gameMgr.finishOneShoot) {
  2142. this.forceMax += xGame.tools.random(10, 50);
  2143. this.forceMax -= this.aiLv * 2;
  2144. if (this.forceMax < 20)
  2145. this.forceMax = 20;
  2146. }
  2147. if (this.forceMax > 100)
  2148. this.forceMax = 101;
  2149. else if (this.forceMax < 10)
  2150. this.forceMax += xGame.tools.random(0, 10);
  2151. if (xGame.common.gameMode == 1)
  2152. this.forceMax = xGame.tools.random(80, 100);
  2153. else
  2154. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2155. let max = 2000 - this.aiLv * 100;
  2156. if (Math.random() > 0.8)
  2157. max += xGame.tools.random(100, 2000);
  2158. this.setState(AIState.turn, xGame.tools.random(500, max));
  2159. }
  2160. shoot() {
  2161. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2162. if (Math.random() > 0.8) {
  2163. this.gameSrc.aiForce(1);
  2164. this.setState(AIState.wait);
  2165. }
  2166. }
  2167. else {
  2168. let df = xGame.tools.random(3, 8);
  2169. if (this.forceNum < this.forceMax)
  2170. this.forceNum += df;
  2171. else
  2172. this.forceNum -= df;
  2173. let startY = this.gameSrc.ui.powerNode.y;
  2174. let height = this.gameSrc.ui.powerNode.height;
  2175. let force = startY + height * this.forceNum * 0.01;
  2176. this.gameSrc.aiForce(2, force);
  2177. }
  2178. }
  2179. reset() {
  2180. for (let i = 0; i < 4; i++) {
  2181. this.setRate--;
  2182. this.setNum++;
  2183. let pos = this.posList[this.posIdx];
  2184. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2185. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2186. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2187. this.rootPos.x = 387;
  2188. if (this.rootPos.x < this.rectL)
  2189. this.rootPos.x = this.rectL;
  2190. else if (this.rootPos.x > this.rectR)
  2191. this.rootPos.x = this.rectR;
  2192. if (this.rootPos.y < this.rectT)
  2193. this.rootPos.y = this.rectT;
  2194. else if (this.rootPos.y > this.rectB)
  2195. this.rootPos.y = this.rectB;
  2196. this.posIdx++;
  2197. let max = this.posList.length;
  2198. if (this.posIdx >= max)
  2199. this.posIdx -= max;
  2200. this.initHoleBall();
  2201. let ball = null;
  2202. if (this.scoreBall.length > 0)
  2203. ball = this.scoreBall[0];
  2204. else if (this.lineBall.length > 0)
  2205. ball = xGame.common.getRandArrEle(this.lineBall);
  2206. if (ball && ball.kickAngle < this.bestAngle) {
  2207. this.bestAngle = ball.kickAngle;
  2208. this.bestKick.x = ball.kickPos.x;
  2209. this.bestKick.y = ball.kickPos.y;
  2210. this.bestPos.x = this.rootPos.x;
  2211. this.bestPos.y = this.rootPos.y;
  2212. this.bestForce = ball.hard * 0.08;
  2213. }
  2214. }
  2215. if (this.setNum >= this.setMax)
  2216. this.setMax = 0;
  2217. if (this.setRate < 1) {
  2218. this.setState(AIState.move, 0);
  2219. this.rootMoveTime = Laya.timer.currTimer;
  2220. this.gameSrc.aiRootMove(true);
  2221. }
  2222. }
  2223. delayLine() {
  2224. this.gameSrc.aiRootMove(false);
  2225. }
  2226. move() {
  2227. if (this.bestPos.x < 1)
  2228. this.bestPos = this.rootPos;
  2229. let wObj = this.wBall.gameObj;
  2230. let destx = wObj.x;
  2231. let desty = wObj.y;
  2232. let dx = Math.abs(destx - this.bestPos.x);
  2233. let dy = Math.abs(desty - this.bestPos.y);
  2234. let mx = 3 + dx * 0.03;
  2235. let my = 3 + dy * 0.03;
  2236. if (dx < 4 && dy < 4) {
  2237. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2238. dt = dt < 1000 ? 1000 - dt : 0;
  2239. if (this.setMax > 0) {
  2240. let min = this.setMax * 0.3 + this.aiLv * 5;
  2241. this.setRate = xGame.tools.random(min, this.setMax);
  2242. this.setState(AIState.reset, 0);
  2243. }
  2244. else {
  2245. this.destRot = 0;
  2246. this.forceMax = this.bestForce;
  2247. this.setKick(this.bestKick.x, this.bestKick.y);
  2248. }
  2249. if (dt > 100) {
  2250. Laya.timer.clear(this, this.delayLine);
  2251. Laya.timer.once(dt, this, this.delayLine);
  2252. }
  2253. else
  2254. this.gameSrc.aiRootMove(false);
  2255. }
  2256. else {
  2257. if (dx > 4)
  2258. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2259. if (dy > 4)
  2260. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2261. this.gameSrc.onRootMove({ x: destx, y: desty });
  2262. }
  2263. }
  2264. resetRoot() {
  2265. this.bestAngle = 180;
  2266. this.bestForce = 0;
  2267. this.setMax = this.posList.length;
  2268. this.posIdx = xGame.tools.random(0, this.setMax);
  2269. let min = this.setMax * 0.3 + this.aiLv * 5;
  2270. this.setRate = xGame.tools.random(min, this.setMax);
  2271. let max = 2000 - this.aiLv * 100;
  2272. if (Math.random() > 0.8)
  2273. max += xGame.tools.random(100, 1000);
  2274. if (this.isGuide)
  2275. this.setState(AIState.select, 500);
  2276. else if (this.onAway(2))
  2277. this.setState(AIState.reset, xGame.tools.random(400, max));
  2278. else
  2279. this.setState(AIState.none);
  2280. if (xGame.common.gameMgr.finishOneShoot)
  2281. this.chat();
  2282. }
  2283. runAI() {
  2284. if (this.state > AIState.idle)
  2285. return;
  2286. this.initBall();
  2287. this.onGame(2500);
  2288. if (Math.random() > 0.6)
  2289. this.chat();
  2290. }
  2291. stopRun() {
  2292. this.setState(AIState.idle);
  2293. }
  2294. onGame(base) {
  2295. let max = base - this.aiLv * 100;
  2296. if (Math.random() > 0.8)
  2297. max += xGame.tools.random(100, 1000);
  2298. if (this.onAway(2))
  2299. this.setState(AIState.select, xGame.tools.random(500, max));
  2300. else
  2301. this.setState(AIState.none);
  2302. }
  2303. setState(sta, wt = 0) {
  2304. if (this.state == AIState.none)
  2305. return;
  2306. this.state = sta;
  2307. this.waitTime = wt;
  2308. }
  2309. onUpdate() {
  2310. if (this.state == AIState.none)
  2311. return;
  2312. this.awayTime -= this.dtime;
  2313. if (this.awayTime < 1) {
  2314. this.awayTime = xGame.tools.random(6000, 10000);
  2315. this.awayNum += (11 - this.aiLv);
  2316. this.onAway(1);
  2317. }
  2318. if (this.waitTime >= 0) {
  2319. this.waitTime -= this.dtime;
  2320. return;
  2321. }
  2322. switch (this.state) {
  2323. case AIState.idle:
  2324. this.chat();
  2325. break;
  2326. case AIState.reset:
  2327. this.reset();
  2328. break;
  2329. case AIState.move:
  2330. this.move();
  2331. break;
  2332. case AIState.leave:
  2333. this.state = AIState.none;
  2334. xGame.common.gameMgr.aiGameEnd(true);
  2335. break;
  2336. case AIState.select:
  2337. this.selectBall();
  2338. break;
  2339. case AIState.turn:
  2340. this.turnPole();
  2341. break;
  2342. case AIState.shoot:
  2343. this.shoot();
  2344. break;
  2345. }
  2346. }
  2347. onAway(type) {
  2348. if (type == 1) {
  2349. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2350. let num = this.awayNum + db * 20;
  2351. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2352. xGame.common.gameMgr.aiLeave();
  2353. this.setState(AIState.leave, 6666);
  2354. }
  2355. }
  2356. else if (type == 2) {
  2357. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2358. let num = this.awayNum + db * 30;
  2359. if (xGame.tools.random(0, 10000) < num)
  2360. return false;
  2361. }
  2362. else if (type == 3) {
  2363. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2364. let num = this.awayNum + db * 10;
  2365. if (xGame.tools.random(0, 4000) < num)
  2366. return false;
  2367. }
  2368. return true;
  2369. }
  2370. chat() {
  2371. if (this.chatTime > 0) {
  2372. this.chatTime -= this.dtime;
  2373. return;
  2374. }
  2375. this.chatTime = xGame.tools.random(2000, 10000);
  2376. let rand = xGame.tools.random(0, 100);
  2377. if (rand < 15)
  2378. this.talk();
  2379. else if (rand < 35)
  2380. this.emotion();
  2381. }
  2382. talk() {
  2383. xGame.common.talkMgr.showAITalk(0);
  2384. }
  2385. emotion() {
  2386. xGame.common.talkMgr.showAIEmotion(0);
  2387. }
  2388. resetAI() {
  2389. this.stopRun();
  2390. this.state = AIState.none;
  2391. }
  2392. }
  2393. class Partical extends Laya.Script3D {
  2394. constructor() {
  2395. super();
  2396. this.duration = 2000;
  2397. }
  2398. ;
  2399. onAwake() {
  2400. this.gameObj = this.owner;
  2401. }
  2402. onEnable() {
  2403. this.openTimer();
  2404. }
  2405. openTimer() {
  2406. Laya.timer.once(this.duration, this, this.disappear);
  2407. }
  2408. setCallback(obj, callback) {
  2409. this.obj = obj;
  2410. this.callback = callback;
  2411. Laya.timer.clearAll(this);
  2412. Laya.timer.once(this.duration, this, this.disappear);
  2413. }
  2414. disappear() {
  2415. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2416. this.callback && this.callback(this.obj);
  2417. }
  2418. }
  2419. class Ball extends Laya.Script3D {
  2420. constructor() {
  2421. super();
  2422. this.posV3 = new Laya.Vector3();
  2423. this.rotRate = 2.1;
  2424. this.rotSpeed = new Laya.Vector3();
  2425. this.myIndex = 0;
  2426. }
  2427. onAwake() {
  2428. this.gameObj = this.owner;
  2429. this.transform = this.gameObj.transform;
  2430. this.ballNode = this.gameObj.getChildByName("Ball");
  2431. this.shadowNode = this.gameObj.getChildByName("shadow");
  2432. }
  2433. initSelf(index, x, y, owner) {
  2434. this.d2BallSrc = owner;
  2435. this.myIndex = index;
  2436. this.setAlbedoTexture();
  2437. this.setTransPos(x, y);
  2438. this.setScale();
  2439. this.ballNode.transform.localRotationEulerX = 90;
  2440. if (index == 0) {
  2441. }
  2442. }
  2443. setAlbedoTexture(isIce = false) {
  2444. let url;
  2445. if (isIce) {
  2446. url = `res/d3Res/ballTexture/ice.jpg`;
  2447. }
  2448. else {
  2449. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2450. }
  2451. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2452. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2453. }));
  2454. }
  2455. runFireworks(obj, delay, callback) {
  2456. Laya.timer.clearAll(this);
  2457. Laya.timer.once(delay + 1, this, () => {
  2458. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2459. fire.transform.localPositionX = this.transform.localPositionX;
  2460. fire.transform.localPositionY = this.transform.localPositionY;
  2461. fire.transform.localPositionZ = this.transform.localPositionZ;
  2462. let src = fire.getComponent(Partical);
  2463. src.duration = 1000;
  2464. src.setCallback(obj, callback);
  2465. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2466. eft.transform.localPositionX = this.transform.localPositionX;
  2467. eft.transform.localPositionY = this.transform.localPositionY;
  2468. eft.transform.localPositionZ = this.transform.localPositionZ;
  2469. });
  2470. }
  2471. setTransPos(x, y) {
  2472. this.setRotation();
  2473. xGame.common.pos2to3Convert(x, y, this.posV3);
  2474. this.transform.localPositionX = this.posV3.x;
  2475. this.transform.localPositionY = 0;
  2476. this.transform.localPositionZ = this.posV3.z;
  2477. this.transform.localRotationEulerX = 0;
  2478. this.transform.localRotationEulerY = 0;
  2479. this.transform.localRotationEulerZ = 0;
  2480. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2481. this.shadowNode.transform.localPositionY = 0.1;
  2482. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2483. }
  2484. setRotation() {
  2485. if (this.d2BallSrc.canRot) {
  2486. let speed = this.d2BallSrc.rigy.linearVelocity;
  2487. this.rotSpeed.x = speed.x * this.rotRate;
  2488. this.rotSpeed.z = speed.y * this.rotRate;
  2489. this.rotSpeed.y = this.d2BallSrc.rotY;
  2490. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2491. }
  2492. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2493. this.rotSpeed.x = this.rotSpeed.y = 0;
  2494. this.rotSpeed.y = this.d2BallSrc.rotY;
  2495. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2496. }
  2497. }
  2498. setScale() {
  2499. let radius = xGame.common.d2World.rootBall.ui.width;
  2500. let scale = xGame.common.scale2to3Convert(radius);
  2501. this.transform.localScaleX = scale;
  2502. this.transform.localScaleY = scale;
  2503. this.transform.localScaleZ = scale;
  2504. }
  2505. playInHoleEft() {
  2506. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2507. eft.transform.position = this.transform.position;
  2508. }
  2509. playIceEft() {
  2510. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2511. eft.transform.position = this.transform.position;
  2512. }
  2513. get scaleXYZ() {
  2514. return this.transform.localScaleX;
  2515. }
  2516. set scaleXYZ(val) {
  2517. this.transform.localScaleX = val;
  2518. this.transform.localScaleY = val;
  2519. this.transform.localScaleZ = val;
  2520. }
  2521. get posX() {
  2522. return this.transform.localPositionX;
  2523. }
  2524. set posX(val) {
  2525. this.transform.localPositionX = val;
  2526. }
  2527. get posY() {
  2528. return this.transform.localPositionY;
  2529. }
  2530. set posY(val) {
  2531. this.transform.localPositionY = val;
  2532. }
  2533. get posZ() {
  2534. return this.transform.localPositionZ;
  2535. }
  2536. set posZ(val) {
  2537. this.transform.localPositionZ = val;
  2538. }
  2539. destroySelf() {
  2540. this.posV3 = null;
  2541. this.rotSpeed = null;
  2542. this.d2BallSrc = null;
  2543. this.ballNode = null;
  2544. this.gameObj.destroy(true);
  2545. this.transform = null;
  2546. this.destroy();
  2547. }
  2548. }
  2549. class ui_D2Ball extends fgui.GComponent {
  2550. static createInstance() {
  2551. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2552. }
  2553. onConstruct() {
  2554. this.myIcon = (this.getChild("myIcon"));
  2555. this.inner = (this.getChild("inner"));
  2556. this.n8 = (this.getChild("n8"));
  2557. this.n4 = (this.getChild("n4"));
  2558. this.wrongTips = (this.getChild("wrongTips"));
  2559. this.rightTips = (this.getChild("rightTips"));
  2560. this.breathAni = this.getTransition("breathAni");
  2561. }
  2562. }
  2563. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2564. class D2BallSrc extends Laya.Script {
  2565. constructor() {
  2566. super();
  2567. this.number = 0;
  2568. this.startX = 0;
  2569. this.startY = 0;
  2570. this.angleV2 = new Laya.Vector2();
  2571. this.isRootBall = false;
  2572. this.isBlackBall = false;
  2573. this.ballType = "";
  2574. this.canRot = true;
  2575. this.rotY = 0;
  2576. this.poleAngle = 0;
  2577. this.kickPos = { x: 0, y: 0 };
  2578. this.hard = 0;
  2579. this.kickAngle = 0;
  2580. this.borderDis = 0;
  2581. this.speedP10 = 5.6;
  2582. this.lastSpeed = { x: 0, y: 0 };
  2583. this.stillSpeed = 0.12;
  2584. this.ballFunc = "normal";
  2585. this.isRunSkillAni = false;
  2586. this.isInHole = false;
  2587. this.iceOwner = "";
  2588. this.forceRun = false;
  2589. this.myUNID = "";
  2590. this.rectL = 0;
  2591. this.rectR = 0;
  2592. this.rectT = 0;
  2593. this.rectB = 0;
  2594. this.forceVec = new Laya.Vector2();
  2595. this.lastDis = 0;
  2596. this.helpOut = { type: "", x: 0, y: 0 };
  2597. }
  2598. initSelf(number, x, y, d3Ball) {
  2599. if (!this.gameObj)
  2600. this.gameObj = this.owner;
  2601. this.number = number;
  2602. this.startX = x;
  2603. this.startY = y;
  2604. this.d3Ball = d3Ball;
  2605. this.isRootBall = false;
  2606. this.isBlackBall = false;
  2607. this.ballType = "";
  2608. if (number == 0) {
  2609. this.isRootBall = true;
  2610. }
  2611. else if (number == 8) {
  2612. this.isBlackBall = true;
  2613. }
  2614. else {
  2615. if (number <= 7) {
  2616. this.ballType = ballCamp.full;
  2617. }
  2618. else {
  2619. this.ballType = ballCamp.flower;
  2620. }
  2621. }
  2622. this.setInfo();
  2623. this.setD3Ball();
  2624. this.owner["mySrc"] = this;
  2625. this.rigy.linearDamping = 1;
  2626. D2BallSrc._unid++;
  2627. this.myUNID = "d2ball" + D2BallSrc._unid;
  2628. let rect = xGame.common.d2World.borderRect;
  2629. this.rectL = Math.ceil(rect.x) + 20;
  2630. this.rectT = Math.ceil(rect.y) + 20;
  2631. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2632. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2633. }
  2634. setInfo() {
  2635. this.gameObj.x = this.startX;
  2636. this.gameObj.y = this.startY;
  2637. let radius = this.ui.width / 2;
  2638. this.gameObj.width = radius * 2;
  2639. this.gameObj.height = radius * 2;
  2640. if (xGame.common.showDebug) {
  2641. this.ui.myIcon.alpha = 1;
  2642. this.ui.inner.alpha = 1;
  2643. }
  2644. else {
  2645. this.ui.myIcon.alpha = 0;
  2646. this.ui.inner.alpha = 0;
  2647. }
  2648. }
  2649. setD3Ball() {
  2650. this.d3Ball = this.d3Ball;
  2651. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2652. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2653. }
  2654. onUpdate() {
  2655. if (xGame.common.gameMgr.gamePause)
  2656. return;
  2657. if (this.isInHole)
  2658. return;
  2659. if (!xGame.common.d2World.openCheckStill)
  2660. return;
  2661. this.runBall();
  2662. }
  2663. runBall() {
  2664. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2665. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2666. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2667. this.judgeBorder();
  2668. }
  2669. getDestDis(dest) {
  2670. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2671. }
  2672. setmyXY(x, y) {
  2673. this.d3BallSrc.setTransPos(x, y);
  2674. }
  2675. getSpeed() {
  2676. let speed = this.rigy.linearVelocity;
  2677. return speed.x * speed.x + speed.y * speed.y;
  2678. }
  2679. onTriggerEnter(collider) {
  2680. if (!collider || !collider.owner)
  2681. return;
  2682. let coll = "collide";
  2683. let speed = this.getSpeed();
  2684. let sv2 = this.speedP10 * this.speedP10;
  2685. if (collider.label == "ball") {
  2686. if (speed < 9 && this.number != 0)
  2687. coll = "";
  2688. else if (speed < sv2)
  2689. coll = "collide_4";
  2690. else if (speed < sv2 * 6.2)
  2691. coll = "collide_3";
  2692. else if (speed < sv2 * 25)
  2693. coll = "collide_2";
  2694. else if (speed < sv2 * 56)
  2695. coll = "collide_1";
  2696. xGame.soundMgr.playSound(coll);
  2697. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2698. if (collider.owner) {
  2699. let rig = collider.owner.getComponent(D2BallSrc);
  2700. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2701. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2702. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2703. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2704. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2705. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2706. let rx = 0;
  2707. let ry = 0;
  2708. if (this.gameObj.x < this.rectL)
  2709. rx = vx;
  2710. else if (this.gameObj.x > this.rectR)
  2711. rx = -vx;
  2712. else if (this.gameObj.y < this.rectT)
  2713. ry = vy;
  2714. else if (this.gameObj.y > this.rectB)
  2715. ry = -vy;
  2716. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2717. }
  2718. }
  2719. if (this.number != 0) {
  2720. return;
  2721. }
  2722. else {
  2723. if (this.forceRun) {
  2724. console.log("randon force");
  2725. this.applyForce(collider);
  2726. }
  2727. }
  2728. if (xGame.common.d2World.isOnSameLine) {
  2729. xGame.common.d2World.isOnSameLine = false;
  2730. this.rigy.linearVelocity = { x: 0, y: 0 };
  2731. }
  2732. if (xGame.common.gameMgr.firstColliObj == null) {
  2733. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2734. xGame.common.gameMgr.isTouchedBall = true;
  2735. }
  2736. }
  2737. else {
  2738. xGame.common.recoverCameraView();
  2739. let wallStr = "";
  2740. if (speed < 9) { }
  2741. else if (speed < sv2) { }
  2742. else if (speed < sv2 * 6.2)
  2743. wallStr = "wall_30";
  2744. else if (speed < sv2 * 25)
  2745. wallStr = "wall_50";
  2746. else if (speed < sv2 * 56)
  2747. wallStr = "wall_80";
  2748. xGame.soundMgr.playSound(wallStr);
  2749. }
  2750. }
  2751. applyForce(collider) {
  2752. let src = collider.owner.mySrc;
  2753. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2754. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2755. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2756. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2757. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2758. }
  2759. checkWrongBall(playEft = true) {
  2760. if (this.isInHole)
  2761. return;
  2762. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2763. if (this.number != 0 && playEft)
  2764. this.d3BallSrc.playInHoleEft();
  2765. let coll = "inpocket_1";
  2766. let speed = this.getSpeed();
  2767. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2768. if (speed < 9 && this.number != 0)
  2769. coll = "";
  2770. else if (speed < sv2 * 6.2)
  2771. coll = "inpocket_4";
  2772. else if (speed < sv2 * 25)
  2773. coll = "collide_3";
  2774. else if (speed < sv2 * 56)
  2775. coll = "collide_2";
  2776. xGame.soundMgr.playSound(coll);
  2777. this.isInHole = true;
  2778. if (this.number == 0) {
  2779. console.log("白球进了。。");
  2780. this.reset();
  2781. this.rigy.linearVelocity = { x: 0, y: 0 };
  2782. this.hideSelf();
  2783. xGame.common.gameUI.ui.whiteAni.visible = true;
  2784. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2785. xGame.common.gameUI.ui.whiteAni.visible = false;
  2786. }));
  2787. }
  2788. else {
  2789. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2790. xGame.common.d2World.removeOneBall(this);
  2791. this.destroySelf();
  2792. xGame.common.playHappySound(this.number);
  2793. this.runFlyEft();
  2794. }
  2795. }
  2796. runFlyEft() {
  2797. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2798. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2799. }
  2800. }
  2801. hideSelf() {
  2802. if (this.d3Ball)
  2803. this.d3Ball.active = false;
  2804. }
  2805. showSelf() {
  2806. this.isInHole = false;
  2807. if (this.d3Ball && !this.d3Ball.active)
  2808. this.d3Ball.active = true;
  2809. }
  2810. isStill() {
  2811. let speed = this.rigy.linearVelocity;
  2812. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2813. this.rigy.linearVelocity = { x: 0, y: 0 };
  2814. return true;
  2815. }
  2816. return false;
  2817. }
  2818. reset() {
  2819. }
  2820. destroySelf() {
  2821. this.d3BallSrc.destroySelf();
  2822. if (!this.ui.isDisposed) {
  2823. this.ui.removeFromParent();
  2824. this.ui.dispose();
  2825. this.ui = null;
  2826. }
  2827. this.outColli = null;
  2828. this.innerColli = null;
  2829. this.rigy = null;
  2830. this.d3Ball = null;
  2831. this.d3BallSrc = null;
  2832. this.angleV2 = null;
  2833. this.gameObj.destroy(true);
  2834. this.destroy();
  2835. }
  2836. judgeBorder() {
  2837. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2838. return;
  2839. }
  2840. if (this.destroyed)
  2841. return;
  2842. if (xGame.common.gameMode == GameMode.classic)
  2843. return;
  2844. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2845. if (isOver) {
  2846. this.checkWrongBall();
  2847. }
  2848. }
  2849. onClick(e, force = false) {
  2850. if (this.number == 0)
  2851. return;
  2852. if (force) {
  2853. }
  2854. else {
  2855. if (xGame.common.d2World.openCheckStill)
  2856. return;
  2857. if (!xGame.common.gameMgr.selfTurn) {
  2858. return;
  2859. }
  2860. }
  2861. if (!xGame.common.gameMgr.finishOneShoot)
  2862. return;
  2863. let root = xGame.common.d2World.rootBall.gameObj;
  2864. let x = this.gameObj.x - root.x;
  2865. let y = this.gameObj.y - root.y;
  2866. let angle = xGame.common.getfguiRotation(x, y);
  2867. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2868. xGame.common.d2World.getHelpLine();
  2869. xGame.common.clickedBall = true;
  2870. this.checkGuide();
  2871. }
  2872. checkGuide() {
  2873. let guide = DataMgr.getSkillGuide();
  2874. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2875. xGame.common.guideStep++;
  2876. xGame.common.gameUI.ui.guide1.visible = false;
  2877. xGame.common.gameUI.ui.guide2.visible = true;
  2878. }
  2879. }
  2880. checkDistance(disX, disY, angle) {
  2881. let diameter = this.gameObj.width - 1;
  2882. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2883. if (!this.lastDis)
  2884. this.lastDis = dis;
  2885. else {
  2886. if (dis > this.lastDis) {
  2887. this.helpOut.type = "remove";
  2888. return this.helpOut;
  2889. }
  2890. }
  2891. if (dis <= Math.pow(diameter, 2)) {
  2892. let del = 0.01;
  2893. let offest = 0;
  2894. let realX = disX - this.gameObj.x;
  2895. let realY = disY - this.gameObj.y;
  2896. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2897. offest += del;
  2898. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2899. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2900. }
  2901. this.helpOut.type = "ok";
  2902. this.helpOut.x = realX + this.gameObj.x;
  2903. this.helpOut.y = realY + this.gameObj.y;
  2904. return this.helpOut;
  2905. }
  2906. else {
  2907. this.helpOut.type = "no";
  2908. return this.helpOut;
  2909. }
  2910. }
  2911. clearBallEft() {
  2912. this.clearBallRightEft();
  2913. this.clearBallWrongEft();
  2914. }
  2915. clearBallRightEft() {
  2916. this.ui.breathAni.stop();
  2917. this.ui.rightTips.visible = false;
  2918. }
  2919. clearBallWrongEft() {
  2920. this.ui.wrongTips.visible = false;
  2921. }
  2922. showWrongEft() {
  2923. if (!xGame.common.gameMgr.selfTurn)
  2924. return;
  2925. this.ui.wrongTips.visible = true;
  2926. }
  2927. showRightEft() {
  2928. if (!xGame.common.gameMgr.selfTurn)
  2929. return;
  2930. this.ui.rightTips.visible = true;
  2931. this.ui.rightTips.scaleX = 1;
  2932. this.ui.rightTips.scaleY = 1;
  2933. this.ui.breathAni.play();
  2934. }
  2935. setBallFunc(type, owner) {
  2936. if (type == "ice") {
  2937. this.ballFunc = type;
  2938. this.d3BallSrc.setAlbedoTexture(true);
  2939. this.rigy.type = "static";
  2940. this.iceOwner = owner;
  2941. }
  2942. else {
  2943. if (owner == this.iceOwner) {
  2944. this.ballFunc = type;
  2945. this.d3BallSrc.setAlbedoTexture(false);
  2946. this.rigy.type = "dynamic";
  2947. }
  2948. }
  2949. }
  2950. }
  2951. D2BallSrc._unid = 0;
  2952. class D2RootBallSrc extends D2BallSrc {
  2953. constructor() {
  2954. super();
  2955. this.maxSpeed = 0;
  2956. this.classicMaxSpeed = 2.2;
  2957. this.bigSkillMaxSpeed = 4;
  2958. this.angle = 0;
  2959. this.allPercent = 0;
  2960. this.linearPercent = 0;
  2961. this.anglePercent = 0;
  2962. this.maxAngleRate = 0.6;
  2963. this.baseRot = 7;
  2964. this.angleMax = 0;
  2965. this.speed = new Laya.Vector2();
  2966. this.rotSpeed = new Laya.Vector2();
  2967. }
  2968. isStill() {
  2969. let speed = this.rigy.linearVelocity;
  2970. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2971. if (this.anglePercent <= 0.1) {
  2972. this.rigy.linearVelocity = { x: 0, y: 0 };
  2973. return true;
  2974. }
  2975. }
  2976. return false;
  2977. }
  2978. reset() {
  2979. this.linearPercent = 0;
  2980. this.anglePercent = 0;
  2981. }
  2982. setSpeed(percent, angle) {
  2983. this.allPercent = percent;
  2984. this.angle = angle;
  2985. this.setAngleSpeed();
  2986. this.setLinearSpeed();
  2987. let hit = "hit";
  2988. if (percent < 25)
  2989. hit = "hit03";
  2990. else if (percent < 50)
  2991. hit = "hit02";
  2992. else if (percent < 75)
  2993. hit = "hit01";
  2994. xGame.soundMgr.playSound(hit);
  2995. }
  2996. setAngleSpeed() {
  2997. let offest = xGame.common.rodOffest;
  2998. let radius = 82;
  2999. let rate = Math.abs(offest.y / radius) * 0.5;
  3000. if (offest.y > 0)
  3001. this.angleMax = -this.baseRot * 2;
  3002. else
  3003. this.angleMax = this.baseRot;
  3004. this.rotY = -offest.x / radius * 100;
  3005. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3006. this.linearPercent = this.allPercent - this.anglePercent;
  3007. }
  3008. setLinearSpeed() {
  3009. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3010. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3011. if (!xGame.common.longHelpLine) {
  3012. let offset = -150 + xGame.common.randomNum(0, 300);
  3013. offset /= 100;
  3014. this.angle += offset;
  3015. }
  3016. }
  3017. }
  3018. let sin = Math.sin(this.angle * Math.PI / 180);
  3019. let cos = Math.cos(this.angle * Math.PI / 180);
  3020. switch (xGame.common.gameMode) {
  3021. case GameMode.classic:
  3022. this.maxSpeed = this.classicMaxSpeed;
  3023. break;
  3024. case GameMode.bigMove:
  3025. this.maxSpeed = this.bigSkillMaxSpeed;
  3026. break;
  3027. case GameMode.placeBall:
  3028. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3029. if (data.type == 1) {
  3030. this.maxSpeed = this.bigSkillMaxSpeed;
  3031. }
  3032. else {
  3033. this.maxSpeed = this.classicMaxSpeed;
  3034. }
  3035. break;
  3036. default:
  3037. break;
  3038. }
  3039. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3040. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3041. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3042. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3043. this.rigy.applyLinearImpulseToCenter(this.speed);
  3044. }
  3045. onUpdate() {
  3046. if (this.anglePercent > 0.1) {
  3047. this.anglePercent *= 0.97;
  3048. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3049. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3050. this.rigy.applyForceToCenter(this.rotSpeed);
  3051. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3052. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3053. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3054. if (num > 0.9)
  3055. this.canRot = true;
  3056. }
  3057. else
  3058. this.canRot = true;
  3059. if (Math.abs(this.rotY) > 0.1)
  3060. this.rotY *= 0.98;
  3061. super.onUpdate();
  3062. }
  3063. destroySelf() {
  3064. super.destroySelf();
  3065. this.speed = null;
  3066. }
  3067. }
  3068. class D2Ball extends Laya.Sprite {
  3069. constructor(isRootBall = false) {
  3070. super();
  3071. this.ui = ui_D2Ball.createInstance();
  3072. this.pivotX = this.ui.width / 2;
  3073. this.pivotY = this.ui.width / 2;
  3074. this.x = 0;
  3075. this.y = 0;
  3076. this.addChild(this.ui.displayObject);
  3077. this.ui.displayObject.x += this.ui.width / 2;
  3078. this.ui.displayObject.y += this.ui.width / 2;
  3079. if (isRootBall) {
  3080. this.d2Src = this.addComponent(D2RootBallSrc);
  3081. }
  3082. else {
  3083. this.d2Src = this.addComponent(D2BallSrc);
  3084. }
  3085. this.d2Src.ui = this.ui;
  3086. this.addCircleCollider();
  3087. this.addInnerCircleCollider();
  3088. this.addRigyBody();
  3089. }
  3090. addCircleCollider() {
  3091. let colli = xGame.common.getCollider("circle");
  3092. colli.radius = this.ui.width / 2;
  3093. this.addComponentIntance(colli);
  3094. this.d2Src.outColli = colli;
  3095. colli.label = "ball";
  3096. }
  3097. addInnerCircleCollider() {
  3098. let colli = xGame.common.getCollider("circle");
  3099. colli.radius = this.ui.inner.width / 2;
  3100. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3101. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3102. this.addComponentIntance(colli);
  3103. this.d2Src.innerColli = colli;
  3104. colli.label = "inner";
  3105. }
  3106. addRigyBody() {
  3107. let rigy = xGame.common.getRigbody();
  3108. rigy.type = "dynamic";
  3109. this.addComponentIntance(rigy);
  3110. this.d2Src.rigy = rigy;
  3111. }
  3112. disposeSelf() {
  3113. if (!this.ui.isDisposed) {
  3114. this.ui.dispose();
  3115. this.ui.removeFromParent();
  3116. this.ui = null;
  3117. }
  3118. }
  3119. }
  3120. class ui_D2Gan extends fgui.GComponent {
  3121. static createInstance() {
  3122. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3123. }
  3124. onConstruct() {
  3125. this.myIcon = (this.getChild("myIcon"));
  3126. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3127. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3128. this.self = (this.getChild("self"));
  3129. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3130. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3131. this.ai = (this.getChild("ai"));
  3132. }
  3133. }
  3134. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3135. class D2Gan {
  3136. constructor() {
  3137. this.offset = 0.15;
  3138. this.cell = 1.5;
  3139. this.onBallCell = 0.4;
  3140. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3141. this.moveNum = 70;
  3142. this.rulerRate = 0.1;
  3143. this.ui = ui_D2Gan.createInstance();
  3144. this.changeSelfRod();
  3145. this.changeAIRod();
  3146. }
  3147. changeSelfRod() {
  3148. let index = DataMgr.getCurBallRod();
  3149. let data = cfgTable.ballrodData[index + 1];
  3150. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3151. this.selfMySpine && this.selfMySpine.dispose();
  3152. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3153. if (data.spine) {
  3154. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3155. this.selfMySpine = new SpineMgr(data.spine, () => {
  3156. let xx = this.ui.selfEftRoot.width / 2;
  3157. let yy = this.ui.selfEftRoot.height / 2;
  3158. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3159. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3160. outSpine.rotation = -90;
  3161. });
  3162. }
  3163. }
  3164. changeAIRod() {
  3165. let length = Object.keys(cfgTable.ballrodData).length;
  3166. let rand = Math.floor(length * Math.random()) + 1;
  3167. let data = cfgTable.ballrodData[rand];
  3168. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3169. this.aiMySpine && this.aiMySpine.dispose();
  3170. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3171. if (data.spine) {
  3172. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3173. this.aiMySpine = new SpineMgr(data.spine, () => {
  3174. let xx = this.ui.aiEftRoot.width / 2;
  3175. let yy = this.ui.aiEftRoot.height / 2;
  3176. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3177. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3178. outSpine.rotation = -90;
  3179. });
  3180. }
  3181. }
  3182. setGanLastInfo() {
  3183. this.lastInfo.rotation = this.ui.rotation;
  3184. this.lastInfo.x = this.ui.x;
  3185. this.lastInfo.y = this.ui.y;
  3186. }
  3187. rotateSelf(flag, isRuler = false) {
  3188. let angle;
  3189. flag = flag * this.offset;
  3190. if (xGame.common.d2World.isHelpLineOnBall) {
  3191. angle = flag * this.onBallCell;
  3192. }
  3193. else {
  3194. angle = flag * this.cell;
  3195. }
  3196. if (isRuler) {
  3197. angle *= this.rulerRate;
  3198. }
  3199. this.ui.rotation += angle;
  3200. xGame.common.d2World.getHelpLine();
  3201. }
  3202. checkDistance() {
  3203. let target = xGame.common.d2World.targetBall;
  3204. let root = xGame.common.d2World.rootBall;
  3205. if (target == null) {
  3206. return 1;
  3207. }
  3208. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3209. if (dis <= 2500) {
  3210. return 5;
  3211. }
  3212. return 1;
  3213. }
  3214. rotDest(rot) {
  3215. this.ui.rotation = rot;
  3216. xGame.common.d2World.getHelpLine();
  3217. }
  3218. storagePower(powerNum) {
  3219. let pos = (powerNum / 100) * this.moveNum;
  3220. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3221. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3222. this.ui.x = this.lastInfo.x + xx;
  3223. this.ui.y = this.lastInfo.y + yy;
  3224. }
  3225. shoot() {
  3226. this.storagePower(0);
  3227. this.ui.visible = false;
  3228. }
  3229. destroySelf() {
  3230. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3231. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3232. this.selfMySpine && this.selfMySpine.dispose();
  3233. this.aiMySpine && this.aiMySpine.dispose();
  3234. this.lastInfo = null;
  3235. if (!this.ui.isDisposed) {
  3236. this.ui.removeFromParent();
  3237. this.ui.dispose();
  3238. }
  3239. }
  3240. }
  3241. class ui_HelpLine extends fgui.GComponent {
  3242. static createInstance() {
  3243. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3244. }
  3245. onConstruct() {
  3246. this.n10 = (this.getChild("n10"));
  3247. this.rect = (this.getChild("rect"));
  3248. this.dir11 = (this.getChild("dir11"));
  3249. this.dir = (this.getChild("dir"));
  3250. this.rootDir = (this.getChild("rootDir"));
  3251. this.dirDot = (this.getChild("dirDot"));
  3252. }
  3253. }
  3254. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3255. class D2HelpLine {
  3256. constructor() {
  3257. this.starX = 0;
  3258. this.starY = 0;
  3259. this.ui = ui_HelpLine.createInstance();
  3260. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3261. this.starX = this.ui.rect.x;
  3262. this.starY = this.ui.rect.y;
  3263. }
  3264. shoot() {
  3265. this.ui.visible = false;
  3266. }
  3267. destroySelf() {
  3268. if (this.ui.isDisposed) {
  3269. this.ui.removeFromParent();
  3270. this.ui.dispose();
  3271. }
  3272. }
  3273. }
  3274. class D2World extends Laya.Script {
  3275. constructor() {
  3276. super();
  3277. this.ballArr = [];
  3278. this.openCheckStill = false;
  3279. this.checkArr = [];
  3280. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3281. this.isHelpLineOnBall = false;
  3282. this.isOnSameLine = false;
  3283. this.reflectAngle = 0;
  3284. this.powerPercent = 0;
  3285. this.inHolesSpeed = [];
  3286. this.outDir = new Laya.Vector2();
  3287. this.rootDir = new Laya.Vector2();
  3288. this.aiLv = 0;
  3289. this.rootPos = new Laya.Vector2();
  3290. this.tempDir1 = new Laya.Vector2();
  3291. this.tempDir2 = new Laya.Vector2();
  3292. this.tempDir3 = new Laya.Vector2();
  3293. this.ballSize = 33;
  3294. this.destRot = 0;
  3295. }
  3296. initSelf() {
  3297. this.createBalls();
  3298. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3299. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3300. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3301. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3302. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3303. }
  3304. setBorderRect() {
  3305. let ui = xGame.common.gameUI.ui;
  3306. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3307. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3308. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3309. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3310. this.borderRect.x = starX;
  3311. this.borderRect.y = starY;
  3312. this.borderRect.width = width;
  3313. this.borderRect.height = height;
  3314. }
  3315. resetGame() {
  3316. this.openCheckStill = false;
  3317. let temp;
  3318. for (let index = 0; index < this.ballArr.length; index++) {
  3319. temp = this.ballArr[index];
  3320. temp.destroySelf();
  3321. }
  3322. xGame.common.d3World.ballRoot.destroyChildren();
  3323. xGame.common.gameUI.ui.ballNode.removeChildren();
  3324. console.log("进入摧毁逻辑");
  3325. this.d2Gan.destroySelf();
  3326. this.d2HelpLine.destroySelf();
  3327. this.ballArr = [];
  3328. }
  3329. setD2Gan() {
  3330. let ballNode = this.rootBall.ui;
  3331. let d2Gan = new D2Gan();
  3332. this.d2Gan = d2Gan;
  3333. let ganNode = d2Gan.ui;
  3334. ballNode.addChild(ganNode);
  3335. ganNode.pivotX = ganNode.pivotX;
  3336. ganNode.pivotY = ganNode.pivotY;
  3337. ganNode.x = ganNode.myIcon.width / 2;
  3338. ganNode.y = this.rootBall.gameObj.width;
  3339. d2Gan.setGanLastInfo();
  3340. }
  3341. setHelpLine() {
  3342. let d2Help = new D2HelpLine();
  3343. this.d2HelpLine = d2Help;
  3344. }
  3345. createBalls() {
  3346. let cfg;
  3347. switch (xGame.common.gameMode) {
  3348. case GameMode.classic:
  3349. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3350. break;
  3351. case GameMode.bigMove:
  3352. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3353. break;
  3354. case GameMode.placeBall:
  3355. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3356. break;
  3357. default:
  3358. break;
  3359. }
  3360. cfg = JSON.parse(JSON.stringify(cfg));
  3361. for (const key in cfg) {
  3362. if (cfg[key].value == 0) {
  3363. this.createRootBall(cfg[key]);
  3364. delete cfg[key];
  3365. break;
  3366. }
  3367. }
  3368. this.createOtherBalls(cfg);
  3369. }
  3370. createRootBall(data) {
  3371. let root = new D2Ball(true);
  3372. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3373. this.rootBall = root.d2Src;
  3374. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3375. let d3BallSrc = d3Ball.getComponent(Ball);
  3376. xGame.common.d3World.rootBall = d3Ball;
  3377. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3378. let xx = data.x;
  3379. let yy = data.y;
  3380. let numer = data.value;
  3381. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3382. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3383. this.ballArr.push(this.rootBall);
  3384. this.setD2Gan();
  3385. this.setHelpLine();
  3386. }
  3387. createOtherBalls(cfg) {
  3388. let temp;
  3389. let src;
  3390. let data;
  3391. for (const key in cfg) {
  3392. data = cfg[key];
  3393. temp = new D2Ball();
  3394. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3395. src = temp.d2Src;
  3396. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3397. src.initSelf(data.value, data.x, data.y, d3Ball);
  3398. this.ballArr.push(src);
  3399. }
  3400. }
  3401. shoot(percent) {
  3402. this.powerPercent = percent;
  3403. this.openCheckStill = true;
  3404. let d2Angle = this.d2Gan.ui.rotation;
  3405. this.rootBall.setSpeed(percent, d2Angle);
  3406. this.clearBallAllEft();
  3407. this.changePlayerView();
  3408. }
  3409. onUpdate() {
  3410. if (!this.openCheckStill)
  3411. return;
  3412. this.checkStill();
  3413. }
  3414. checkStill() {
  3415. for (let index = 0; index < this.ballArr.length; index++) {
  3416. if (!this.ballArr[index].isStill()) {
  3417. return;
  3418. }
  3419. }
  3420. xGame.eventMgr.event(ALL_BALL_STOP);
  3421. }
  3422. allBallStop() {
  3423. this.openCheckStill = false;
  3424. xGame.common.recoverCameraView();
  3425. }
  3426. waitShoot() {
  3427. if (!this.d2Gan.ui.isDisposed) {
  3428. this.d2Gan.ui.visible = true;
  3429. }
  3430. if (!this.d2HelpLine.ui.isDisposed) {
  3431. this.d2HelpLine.ui.visible = true;
  3432. }
  3433. this.clearBallAllEft();
  3434. this.showBallRightEft();
  3435. this.getHelpLine();
  3436. this.inHolesSpeed = [];
  3437. this.selectOneBall();
  3438. }
  3439. _getAllBallArr() {
  3440. let arr = this.ballArr;
  3441. let outArr = [];
  3442. for (let index = 0; index < arr.length; index++) {
  3443. if (arr[index] instanceof D2RootBallSrc)
  3444. continue;
  3445. if (arr[index].ballFunc == "ice")
  3446. continue;
  3447. if (arr[index].destroyed)
  3448. continue;
  3449. outArr.push(arr[index]);
  3450. }
  3451. return outArr;
  3452. }
  3453. _getBlackObj() {
  3454. let arr = this.ballArr;
  3455. for (let index = 0; index < arr.length; index++) {
  3456. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3457. return arr[index];
  3458. }
  3459. }
  3460. }
  3461. selectOneBall() {
  3462. let all = this._getAllBallArr();
  3463. let target;
  3464. switch (xGame.common.gameMode) {
  3465. case GameMode.classic:
  3466. if (xGame.common.gameMgr.selfTurn) {
  3467. let self = xGame.common.gameMgr.selfBallArr;
  3468. let black = this._getBlackObj();
  3469. if (xGame.common.gameMgr.ensureBallType) {
  3470. if (self.length > 0) {
  3471. let out = [];
  3472. for (let j = 0; j < all.length; j++) {
  3473. if (self.indexOf(all[j].number) > -1) {
  3474. out.push(all[j]);
  3475. }
  3476. }
  3477. target = this.selectBestEnterOne(out);
  3478. }
  3479. else {
  3480. target = this.selectBestEnterOne([black]);
  3481. }
  3482. }
  3483. else {
  3484. target = this.selectBestEnterOne(all);
  3485. }
  3486. }
  3487. else {
  3488. target = this.selectBestEnterOne(all);
  3489. }
  3490. break;
  3491. case GameMode.bigMove:
  3492. target = this.selectBestEnterOne(all);
  3493. break;
  3494. case GameMode.placeBall:
  3495. if (all.length > 0) {
  3496. target = this.selectBestEnterOne(all);
  3497. }
  3498. break;
  3499. default:
  3500. break;
  3501. }
  3502. if (target && !target.destroyed && target.onClick) {
  3503. target.onClick(0, true);
  3504. let num = -200 + xGame.common.randomNum(0, 400);
  3505. num /= 150;
  3506. if (xGame.common.longHelpLine) {
  3507. num = 0;
  3508. }
  3509. this.destRot += num;
  3510. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3511. }
  3512. }
  3513. removeOneBall(ball) {
  3514. for (let index = 0; index < this.ballArr.length; index++) {
  3515. if (this.ballArr[index].id == ball.id) {
  3516. this.ballArr.splice(index, 1);
  3517. break;
  3518. }
  3519. }
  3520. }
  3521. getHelpLine() {
  3522. this.d2HelpLine.ui.dirDot.visible = false;
  3523. this.isOnSameLine = false;
  3524. let startX = this.rootBall.gameObj.x;
  3525. let startY = this.rootBall.gameObj.y;
  3526. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3527. if (dis == null) {
  3528. this.d2HelpLine.ui.visible = false;
  3529. console.error("辅助线异常");
  3530. return;
  3531. }
  3532. this.d2HelpLine.ui.visible = true;
  3533. let angle = this.d2Gan.ui.rotation;
  3534. let radius = 16.5;
  3535. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3536. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3537. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3538. if (colliObj == null) {
  3539. this.getColliPos(disX, disY, radius, angle);
  3540. xGame.common.d2World.isHelpLineOnBall = false;
  3541. this.targetBall = null;
  3542. this.reflectAngle = 0;
  3543. this.showBallWrongEft();
  3544. }
  3545. else {
  3546. let target = colliObj.src;
  3547. let radius = 16.5;
  3548. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3549. dis1 = Math.sqrt(dis1);
  3550. let realDis = colliObj.disHon - dis1;
  3551. let dir = colliObj.dir;
  3552. let xx = startX + dir.x * realDis;
  3553. let yy = startY + dir.y * realDis;
  3554. this.getColliPos(xx, yy, radius, angle);
  3555. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3556. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3557. let offset = xGame.common.rodOffest;
  3558. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3559. this.isOnSameLine = true;
  3560. }
  3561. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3562. xGame.common.d2World.isHelpLineOnBall = true;
  3563. this.targetBall = target;
  3564. this.reflectAngle = reflectAngle;
  3565. this.showBallWrongEft();
  3566. if (xGame.common.longHelpLine) {
  3567. this.delayReflectLine(target, reflectAngle);
  3568. }
  3569. }
  3570. }
  3571. getBorderDot(startX, startY, angle) {
  3572. let radius = 17;
  3573. let distance;
  3574. let isDone;
  3575. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3576. isDone = this.judgeUpDown(distance, angle, startX);
  3577. if (isDone != null) {
  3578. return isDone;
  3579. }
  3580. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3581. isDone = this.judgeUpDown(distance, angle, startX);
  3582. if (isDone != null) {
  3583. return isDone;
  3584. }
  3585. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3586. isDone = this.judgeLeftRight(distance, angle, startY);
  3587. if (isDone != null) {
  3588. return isDone;
  3589. }
  3590. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3591. isDone = this.judgeLeftRight(distance, angle, startY);
  3592. if (isDone != null) {
  3593. return isDone;
  3594. }
  3595. }
  3596. judgeUpDown(distance, angle, startX) {
  3597. let flag = Math.sin(angle * Math.PI / 180);
  3598. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3599. if (distance >= 0) {
  3600. if (flag > 0) {
  3601. if (temp < this.borderRect.x + this.borderRect.width) {
  3602. return distance;
  3603. }
  3604. }
  3605. else {
  3606. if (temp > this.borderRect.x) {
  3607. return distance;
  3608. }
  3609. }
  3610. }
  3611. }
  3612. judgeLeftRight(distance, angle, starY) {
  3613. let flag = -Math.cos(angle * Math.PI / 180);
  3614. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3615. if (distance >= 0) {
  3616. if (flag > 0) {
  3617. if (temp < this.borderRect.y + this.borderRect.height) {
  3618. return distance;
  3619. }
  3620. }
  3621. else {
  3622. if (temp > this.borderRect.y) {
  3623. return distance;
  3624. }
  3625. }
  3626. }
  3627. }
  3628. clearBallAllEft() {
  3629. let temp;
  3630. for (let index = 0; index < this.ballArr.length; index++) {
  3631. temp = this.ballArr[index];
  3632. temp.clearBallEft();
  3633. }
  3634. }
  3635. showBallRightEft() {
  3636. let gameMgr = xGame.common.gameMgr;
  3637. let temp;
  3638. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3639. if (targetArr.length <= 0)
  3640. return;
  3641. for (let index = 0; index < this.ballArr.length; index++) {
  3642. temp = this.ballArr[index];
  3643. if (targetArr.indexOf(temp.number) > -1) {
  3644. temp.showRightEft();
  3645. }
  3646. }
  3647. }
  3648. showBallWrongEft() {
  3649. let gameMgr = xGame.common.gameMgr;
  3650. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3651. if (targetArr.length <= 0)
  3652. return;
  3653. let temp;
  3654. for (let index = 0; index < this.ballArr.length; index++) {
  3655. temp = this.ballArr[index];
  3656. if (this.targetBall && this.targetBall.number == temp.number) {
  3657. if (targetArr.indexOf(temp.number) <= -1) {
  3658. temp.showWrongEft();
  3659. }
  3660. else {
  3661. temp.clearBallWrongEft();
  3662. }
  3663. }
  3664. else {
  3665. temp.clearBallWrongEft();
  3666. }
  3667. }
  3668. }
  3669. getColliPos(x, y, radius, angle) {
  3670. this.d2HelpLine.ui.x = x;
  3671. this.d2HelpLine.ui.y = y;
  3672. let dirX = x - this.rootBall.gameObj.x;
  3673. let dirY = y - this.rootBall.gameObj.y;
  3674. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3675. if (rectH <= 0)
  3676. rectH = 0;
  3677. this.d2HelpLine.ui.rect.height = 0;
  3678. this.d2HelpLine.ui.rect.height = rectH;
  3679. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3680. if (rectH < this.rootBall.gameObj.width) {
  3681. this.d2HelpLine.ui.rect.visible = false;
  3682. }
  3683. else {
  3684. this.d2HelpLine.ui.rect.visible = true;
  3685. }
  3686. this.d2HelpLine.ui.dir.visible = false;
  3687. this.d2HelpLine.ui.rootDir.visible = false;
  3688. }
  3689. getReflectLine(x, y, radius, target) {
  3690. this.d2HelpLine.ui.dir.visible = true;
  3691. let dirX = target.x - x;
  3692. let dirY = target.y - y;
  3693. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3694. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3695. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3696. this.d2HelpLine.ui.dir.height = 48;
  3697. this.d2HelpLine.ui.dir.rotation = angle;
  3698. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3699. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3700. return angle;
  3701. }
  3702. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3703. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3704. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3705. let targetX = target.gameObj.x;
  3706. let targetY = target.gameObj.y;
  3707. this.outDir.setValue(targetX - xx, targetY - yy);
  3708. this.rootDir.setValue(rtX - xx, rtY - yy);
  3709. let ver = Math.PI / 2;
  3710. let sin = Math.sin(ver);
  3711. let cos = Math.cos(ver);
  3712. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3713. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3714. this.outDir.setValue(outX, outY);
  3715. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3716. Laya.Vector2.normalize(this.outDir, this.outDir);
  3717. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3718. if (Math.abs(result) <= 0.08) {
  3719. this.d2HelpLine.ui.rootDir.visible = false;
  3720. return;
  3721. }
  3722. if (result > 0) {
  3723. angle += 90;
  3724. }
  3725. else if (result < 0) {
  3726. angle -= 90;
  3727. }
  3728. this.d2HelpLine.ui.rootDir.visible = true;
  3729. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3730. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3731. this.d2HelpLine.ui.rootDir.rotation = angle;
  3732. }
  3733. delayReflectLine(obj, angle) {
  3734. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3735. return;
  3736. }
  3737. this.isOnSameLine = false;
  3738. let startX = obj.gameObj.x;
  3739. let startY = obj.gameObj.y;
  3740. let dis = this.getBorderDot(startX, startY, angle);
  3741. if (dis == null) {
  3742. this.d2HelpLine.ui.dirDot.visible = false;
  3743. return;
  3744. }
  3745. this.d2HelpLine.ui.visible = true;
  3746. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3747. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3748. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3749. if (colliObj == null) {
  3750. this.setDelayLine(disX, disY, obj, angle);
  3751. }
  3752. else {
  3753. let radius = 16;
  3754. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3755. dis1 = Math.sqrt(dis1);
  3756. let realDis = colliObj.disHon - dis1;
  3757. let dir = colliObj.dir;
  3758. let xx = startX + dir.x * realDis;
  3759. let yy = startY + dir.y * realDis;
  3760. this.setDelayLine(xx, yy, obj, angle);
  3761. }
  3762. }
  3763. setDelayLine(x, y, obj, angle) {
  3764. let dirX = x - obj.gameObj.x;
  3765. let dirY = y - obj.gameObj.y;
  3766. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3767. if (rectH <= 0)
  3768. rectH = 0;
  3769. this.d2HelpLine.ui.dir.height = rectH;
  3770. this.d2HelpLine.ui.dirDot.visible = true;
  3771. this.d2HelpLine.ui.dirDot.x = 17;
  3772. this.d2HelpLine.ui.dirDot.y = 17;
  3773. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3774. ;
  3775. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3776. }
  3777. changePlayerView() {
  3778. if (Math.random() >= 0.7)
  3779. return;
  3780. if (!this.targetBall) {
  3781. return;
  3782. }
  3783. if (!xGame.common.gameMgr.selfTurn)
  3784. return;
  3785. switch (xGame.common.gameMode) {
  3786. case GameMode.classic:
  3787. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3788. if (this.targetBall.number != 8) {
  3789. return;
  3790. }
  3791. }
  3792. break;
  3793. case GameMode.bigMove:
  3794. return;
  3795. case GameMode.placeBall:
  3796. break;
  3797. default:
  3798. break;
  3799. }
  3800. let startX = this.targetBall.gameObj.x;
  3801. let startY = this.targetBall.gameObj.y;
  3802. let angle = this.reflectAngle;
  3803. let dis = this.getBorderDot(startX, startY, angle);
  3804. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3805. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3806. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3807. if (colliObj) {
  3808. return;
  3809. }
  3810. let offset = 40;
  3811. let posObj = xGame.common.gameMgr.posObj;
  3812. let temp;
  3813. let radius;
  3814. let tarX, tarY;
  3815. for (const key in posObj) {
  3816. temp = posObj[key];
  3817. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3818. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3819. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3820. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3821. xGame.common.showOneCamera("angle" + key);
  3822. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3823. Laya.physicsTimer.scale = 0.7;
  3824. break;
  3825. }
  3826. }
  3827. }
  3828. selectBestEnterOne(arr) {
  3829. this.aiLv = xGame.tools.random(1, 11);
  3830. this.aiLv = 10;
  3831. this.wBall = xGame.common.d2World.rootBall;
  3832. this.rootPos.x = this.wBall.gameObj.x;
  3833. this.rootPos.y = this.wBall.gameObj.y;
  3834. this.initHoleBall(arr);
  3835. return this.selectBall();
  3836. }
  3837. selectBall() {
  3838. let ball = null;
  3839. this.destRot = 0;
  3840. let ai = 110 - this.aiLv * 10;
  3841. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3842. let score = false;
  3843. if (this.scoreBall.length < 1) {
  3844. if (this.lineBall.length < 1) {
  3845. for (let i = 0; i < this.kickBall.length; i++) {
  3846. let list = [];
  3847. let bo = this.kickBall[i];
  3848. let bobj = bo.gameObj;
  3849. let rect = xGame.common.d2World.borderRect;
  3850. let mobj = this.wBall.gameObj;
  3851. let minb = bobj.y - rect.y - 20;
  3852. let minw = mobj.y - rect.y - 50;
  3853. if (minb > 0 && minw > 0) {
  3854. let dlenx = 0;
  3855. let dleny = mobj.y - rect.y;
  3856. let spx = mobj.x;
  3857. let spy = rect.y - dleny;
  3858. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3859. }
  3860. minb = rect.y + rect.height - bobj.y - 20;
  3861. minw = rect.y + rect.height - mobj.y - 50;
  3862. if (minb > 0 && minw > 0) {
  3863. let dlenx = 0;
  3864. let dleny = rect.y + rect.height - mobj.y;
  3865. let spx = mobj.x;
  3866. let spy = rect.y + rect.height + dleny;
  3867. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3868. }
  3869. minb = bobj.x - rect.x - 20;
  3870. minw = mobj.x - rect.x - 50;
  3871. if (minb > 0 && minw > 0) {
  3872. let dlenx = mobj.x - rect.x;
  3873. let dleny = 0;
  3874. let spx = rect.x - dlenx;
  3875. let spy = mobj.y;
  3876. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3877. }
  3878. minb = rect.x + rect.width - bobj.x - 20;
  3879. minw = rect.x + rect.width - mobj.x - 50;
  3880. if (minb > 0 && minw > 0) {
  3881. let dlenx = rect.x + rect.width - mobj.x;
  3882. let dleny = 0;
  3883. let spx = rect.x + rect.width + dlenx;
  3884. let spy = mobj.y;
  3885. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3886. }
  3887. list.sort(function (a, b) {
  3888. return a.order - b.order;
  3889. });
  3890. for (let i = 0; i < list.length; i++) {
  3891. let data = list[i];
  3892. let mx = mobj.x - bobj.x;
  3893. let my = mobj.y - bobj.y;
  3894. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3895. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3896. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3897. if (num > 1)
  3898. num = 1;
  3899. let cos = Math.acos(num);
  3900. if (cos > 1.57)
  3901. cos = 1.57;
  3902. else if (cos < 0.01)
  3903. cos = 0.01;
  3904. let tan = Math.tan(cos);
  3905. let dx = tan * data.dleny;
  3906. let dy = tan * data.dlenx;
  3907. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3908. if (Math.abs(bx - 667) < 40)
  3909. continue;
  3910. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3911. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3912. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3913. this.forceMax = dis * 0.08;
  3914. this.destRot += mis * 0.1;
  3915. this.setKick(bx, by);
  3916. return true;
  3917. }
  3918. }
  3919. }
  3920. }
  3921. else {
  3922. ball = xGame.common.getRandArrEle(this.lineBall);
  3923. }
  3924. }
  3925. else {
  3926. for (let i = 0; i < this.scoreBall.length; i++) {
  3927. if (i < this.scoreBall.length - 1) {
  3928. let rand = 70 + this.aiLv * 10 + i * 10;
  3929. if (xGame.tools.random(0, 100) < rand) {
  3930. ball = this.scoreBall[i];
  3931. break;
  3932. }
  3933. }
  3934. else {
  3935. ball = this.scoreBall[i];
  3936. break;
  3937. }
  3938. }
  3939. score = true;
  3940. this.selectNum++;
  3941. }
  3942. if (!ball)
  3943. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3944. let dx = ball.gameObj.x;
  3945. let dy = ball.gameObj.y;
  3946. let kickAngle = 0;
  3947. if (score) {
  3948. dx = ball.kickPos.x;
  3949. dy = ball.kickPos.y;
  3950. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3951. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3952. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3953. if (adot > 1)
  3954. adot = 1;
  3955. kickAngle = Math.acos(adot) * 57.3;
  3956. if (kickAngle > 45) {
  3957. let kdx = ball.kickPos.x - ball.gameObj.x;
  3958. let kdy = ball.kickPos.y - ball.gameObj.y;
  3959. dx = ball.kickPos.x - kdx * mis * 0.3;
  3960. dy = ball.kickPos.y - kdy * mis * 0.3;
  3961. }
  3962. else
  3963. this.destRot += mis;
  3964. }
  3965. else if (ball.poleAngle != 0) {
  3966. this.destRot += ball.poleAngle;
  3967. }
  3968. if (xGame.common.gameMode == 0) {
  3969. let af = kickAngle * 0.08;
  3970. this.forceMax = ball.hard * 0.1 + af * af;
  3971. }
  3972. this.setKick(dx, dy);
  3973. return ball;
  3974. }
  3975. initHoleBall(arr) {
  3976. this.kickBall = [];
  3977. this.lineBall = [];
  3978. this.scoreBall = [];
  3979. this.holeBall = [];
  3980. this.selectNum = 0;
  3981. this.forceNum = 0;
  3982. this.forceMax = 0;
  3983. this.turnNum = 0;
  3984. let list = arr;
  3985. let holes = xGame.common.gameMgr.holePosList;
  3986. let self = xGame.common.aiPlayer;
  3987. for (let i = 0; i < list.length; i++) {
  3988. let obj = list[i];
  3989. if (!obj)
  3990. continue;
  3991. obj.kickPos.x = 0;
  3992. obj.kickPos.y = 0;
  3993. obj.poleAngle = 0;
  3994. obj.hard = 0;
  3995. obj.borderDis = 0;
  3996. obj.kickAngle = 180;
  3997. let b = obj.gameObj;
  3998. let wbp = this.rootPos;
  3999. let bx = wbp.x - b.x;
  4000. let by = wbp.y - b.y;
  4001. obj.borderDis = xGame.tools.random(0, 100);
  4002. this.kickBall.push(obj);
  4003. if (!this.isLine(wbp, obj))
  4004. continue;
  4005. obj.kickAngle = xGame.tools.random(90, 180);
  4006. obj.kickPos.x = b.x;
  4007. obj.kickPos.y = b.y;
  4008. this.lineBall.push(obj);
  4009. let minDis = 999999;
  4010. let hole = false;
  4011. for (let j = 0; j < holes.length; j++) {
  4012. let hp = holes[j];
  4013. if (bx >= 0 && hp.x > b.x + 100)
  4014. continue;
  4015. if (bx <= 0 && hp.x < b.x - 100)
  4016. continue;
  4017. if (by < -10 && hp.y < wbp.y)
  4018. continue;
  4019. if (by > 10 && hp.y > wbp.y)
  4020. continue;
  4021. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4022. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4023. if (dis < minDis) {
  4024. let dx = b.x - this.tempDir1.x * this.ballSize;
  4025. let dy = b.y - this.tempDir1.y * this.ballSize;
  4026. this.tempDir3.x = this.tempDir1.x;
  4027. this.tempDir3.y = this.tempDir1.y;
  4028. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4029. obj.kickPos.x = dx;
  4030. obj.kickPos.y = dy;
  4031. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4032. if (num > 1)
  4033. num = 1;
  4034. obj.kickAngle = Math.acos(num) * 57.3;
  4035. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4036. dis = dis * 2;
  4037. if (Math.abs(hp.x - 600) < 100)
  4038. dis += 50;
  4039. obj.hard = dis + obj.kickAngle * 3;
  4040. hole = true;
  4041. }
  4042. }
  4043. }
  4044. }
  4045. if (hole) {
  4046. this.scoreBall.push(obj);
  4047. this.holeBall.push(obj);
  4048. }
  4049. }
  4050. this.scoreBall.sort(function (a, b) {
  4051. return a.hard - b.hard;
  4052. });
  4053. this.holeBall.sort(function (a, b) {
  4054. return a.kickAngle - b.kickAngle;
  4055. });
  4056. this.kickBall.sort(function (a, b) {
  4057. return a.borderDis - b.borderDis;
  4058. });
  4059. }
  4060. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4061. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4062. let balls = xGame.common.d2World.ballArr;
  4063. let max = xGame.tools.getDis(hx, hy, bx, by);
  4064. for (let index = 0; index < balls.length; index++) {
  4065. let obj = balls[index];
  4066. if (obj.number == 0)
  4067. continue;
  4068. if (obj.number == bn || obj.number == dn)
  4069. continue;
  4070. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4071. if (dis * dis > max)
  4072. continue;
  4073. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4074. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4075. if (num > 1)
  4076. num = 1;
  4077. if (num < 0)
  4078. continue;
  4079. let gap = Math.sin(Math.acos(num)) * dis;
  4080. if (gap < this.ballSize)
  4081. return true;
  4082. }
  4083. return false;
  4084. }
  4085. isLine(xy, ball) {
  4086. let bx = xy.x;
  4087. let by = xy.y;
  4088. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4089. let dis = ball.getDestDis(xy);
  4090. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4091. let sin = Math.sin(angle);
  4092. let cos = Math.cos(angle);
  4093. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4094. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4095. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4096. let dx = bx + this.tempDir2.x * dis;
  4097. let dy = by + this.tempDir2.y * dis;
  4098. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4099. sin = Math.sin(-angle);
  4100. cos = Math.cos(-angle);
  4101. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4102. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4103. dx = bx + this.tempDir2.x * dis;
  4104. dy = by + this.tempDir2.y * dis;
  4105. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4106. if (isr && isl)
  4107. return false;
  4108. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4109. }
  4110. return true;
  4111. }
  4112. setKick(dx, dy) {
  4113. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4114. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4115. this.tempDir1.x = 0;
  4116. this.tempDir1.y = 1;
  4117. this.tempDir2.y = -this.tempDir2.y;
  4118. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4119. if (num > 1)
  4120. num = 1;
  4121. let rot = Math.acos(num) * 57.3;
  4122. if (this.tempDir2.x < 0)
  4123. rot = 360 - rot;
  4124. this.destRot += rot;
  4125. }
  4126. }
  4127. class ui_UIGame extends fgui.GComponent {
  4128. static createInstance() {
  4129. return (fgui.UIPackage.createObject("game", "UIGame"));
  4130. }
  4131. onConstruct() {
  4132. this.c1 = this.getController("c1");
  4133. this.d3Root = (this.getChild("d3Root"));
  4134. this.clickNode = (this.getChild("clickNode"));
  4135. this.d2Root = (this.getChild("d2Root"));
  4136. this.topNode = (this.getChild("topNode"));
  4137. this.n72 = (this.getChild("n72"));
  4138. this.n40 = (this.getChild("n40"));
  4139. this.rulerNode = (this.getChild("rulerNode"));
  4140. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4141. this.n50 = (this.getChild("n50"));
  4142. this.keduNode = (this.getChild("keduNode"));
  4143. this.powerTxt = (this.getChild("powerTxt"));
  4144. this.powerNode = (this.getChild("powerNode"));
  4145. this.colorNode = (this.getChild("colorNode"));
  4146. this.powerEft = (this.getChild("powerEft"));
  4147. this.myPowerNode = (this.getChild("myPowerNode"));
  4148. this.ganNode = (this.getChild("ganNode"));
  4149. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4150. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4151. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4152. this.skillRod = (this.getChild("skillRod"));
  4153. this.border = (this.getChild("border"));
  4154. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4155. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4156. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4157. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4158. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4159. this.guanyuNode = (this.getChild("guanyuNode"));
  4160. this.helpBtn = (this.getChild("helpBtn"));
  4161. this.wordsBtn = (this.getChild("wordsBtn"));
  4162. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4163. this.returnBtn = (this.getChild("returnBtn"));
  4164. this.ballNode = (this.getChild("ballNode"));
  4165. this.whiteAni = (this.getChild("whiteAni"));
  4166. this.blackAni = (this.getChild("blackAni"));
  4167. this.selfTurn = (this.getChild("selfTurn"));
  4168. this.aiTurn = (this.getChild("aiTurn"));
  4169. this.deskNode = (this.getChild("deskNode"));
  4170. this.moveNode = (this.getChild("moveNode"));
  4171. this.selfTalk = (this.getChild("selfTalk"));
  4172. this.aiTalk = (this.getChild("aiTalk"));
  4173. this.d2Node = (this.getChild("d2Node"));
  4174. this.snowNode = (this.getChild("snowNode"));
  4175. this.guide2 = (this.getChild("guide2"));
  4176. this.guide1 = (this.getChild("guide1"));
  4177. this.guide3 = (this.getChild("guide3"));
  4178. this.guideNode = (this.getChild("guideNode"));
  4179. }
  4180. }
  4181. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4182. class ui_UIGameEnd extends fgui.GComponent {
  4183. static createInstance() {
  4184. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4185. }
  4186. onConstruct() {
  4187. this.c1 = this.getController("c1");
  4188. this.n22 = (this.getChild("n22"));
  4189. this.n2 = (this.getChild("n2"));
  4190. this.n52 = (this.getChild("n52"));
  4191. this.n53 = (this.getChild("n53"));
  4192. this.coinNode = (this.getChild("coinNode"));
  4193. this.closeNode = (this.getChild("closeNode"));
  4194. this.moneyNode = (this.getChild("moneyNode"));
  4195. this.secretary = (this.getChild("secretary"));
  4196. this.n27 = (this.getChild("n27"));
  4197. this.n29 = (this.getChild("n29"));
  4198. this.talkNode = (this.getChild("talkNode"));
  4199. this.n38 = (this.getChild("n38"));
  4200. this.n39 = (this.getChild("n39"));
  4201. this.n40 = (this.getChild("n40"));
  4202. this.awardNode = (this.getChild("awardNode"));
  4203. this.starNumNode = (this.getChild("starNumNode"));
  4204. this.n47 = (this.getChild("n47"));
  4205. this.conditionNode = (this.getChild("conditionNode"));
  4206. this.isGetAward = (this.getChild("isGetAward"));
  4207. this.leftBtn = (this.getChild("leftBtn"));
  4208. this.rightBtn = (this.getChild("rightBtn"));
  4209. this.btnNode = (this.getChild("btnNode"));
  4210. }
  4211. }
  4212. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4213. class ui_UIAddCoin extends fgui.GComponent {
  4214. static createInstance() {
  4215. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4216. }
  4217. onConstruct() {
  4218. this.n11 = (this.getChild("n11"));
  4219. this.myNode = (this.getChild("myNode"));
  4220. this.t0 = this.getTransition("t0");
  4221. }
  4222. }
  4223. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4224. class UIAddCoin extends UIBase {
  4225. constructor() {
  4226. super();
  4227. this.coinNum = 2000;
  4228. }
  4229. onConstructor() {
  4230. this.ui = ui_UIAddCoin.createInstance();
  4231. this.contentPane = this.ui;
  4232. this.isEject = false;
  4233. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4234. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4235. }
  4236. show() {
  4237. super.show();
  4238. this.ui.t0.play();
  4239. }
  4240. videoAddCoin() {
  4241. console.log('zh:qjff_AD_for_UIAddCoin');
  4242. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4243. }
  4244. else {
  4245. console.log('zh:AD 失败,直接发放奖励');
  4246. this.qjff_AD_for_UIAddCoin();
  4247. }
  4248. }
  4249. qjff_AD_for_UIAddCoin() {
  4250. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4251. this.hide();
  4252. }
  4253. }
  4254. UIAddCoin.uiName = "UIAddCoin";
  4255. class ui_UIInvitation extends fgui.GComponent {
  4256. static createInstance() {
  4257. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4258. }
  4259. onConstruct() {
  4260. this.n14 = (this.getChild("n14"));
  4261. this.myNode = (this.getChild("myNode"));
  4262. this.t0 = this.getTransition("t0");
  4263. }
  4264. }
  4265. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4266. class UIInvitation extends UIBase {
  4267. constructor() {
  4268. super();
  4269. }
  4270. onConstructor() {
  4271. this.ui = ui_UIInvitation.createInstance();
  4272. this.contentPane = this.ui;
  4273. this.isEject = false;
  4274. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4275. }
  4276. show() {
  4277. super.show();
  4278. }
  4279. enterGame() {
  4280. xGame.common.gameMode = GameMode.classic;
  4281. DataMgr.setChallengeTimes(1);
  4282. xGame.common.passAwardCoin = 2000;
  4283. let need = xGame.common.classicNiceNeddCoin;
  4284. if (DataMgr.coinEnough(need)) {
  4285. DataMgr.setCoin(-need);
  4286. xGame.eventMgr.event(RESTART_GAME, true);
  4287. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4288. }
  4289. else {
  4290. xGame.eventMgr.event(RESTART_GAME, true);
  4291. }
  4292. this.hide();
  4293. }
  4294. hide() {
  4295. super.hide();
  4296. }
  4297. }
  4298. UIInvitation.uiName = "UIInvitation";
  4299. class ui_UIMain extends fgui.GComponent {
  4300. static createInstance() {
  4301. return (fgui.UIPackage.createObject("game", "UIMain"));
  4302. }
  4303. onConstruct() {
  4304. this.n47 = (this.getChild("n47"));
  4305. this.n10 = (this.getChild("n10"));
  4306. this.secretary = (this.getChild("secretary"));
  4307. this.shopBtn = (this.getChild("shopBtn"));
  4308. this.moneyNode = (this.getChild("moneyNode"));
  4309. this.headNode = (this.getChild("headNode"));
  4310. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4311. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4312. this.classicBtn = (this.getChild("classicBtn"));
  4313. this.globalBtn = (this.getChild("globalBtn"));
  4314. this.n44 = (this.getChild("n44"));
  4315. this.signBtn = (this.getChild("signBtn"));
  4316. this.drawBtn = (this.getChild("drawBtn"));
  4317. this.settingNode = (this.getChild("settingNode"));
  4318. this.n45 = (this.getChild("n45"));
  4319. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4320. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4321. this.rankBtn = (this.getChild("rankBtn"));
  4322. this.n46 = (this.getChild("n46"));
  4323. this.liucheng1 = (this.getChild("liucheng1"));
  4324. this.rightBtn = (this.getChild("rightBtn"));
  4325. this.n75 = (this.getChild("n75"));
  4326. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4327. this.liucheng2 = (this.getChild("liucheng2"));
  4328. this.guideBtn = (this.getChild("guideBtn"));
  4329. this.n73 = (this.getChild("n73"));
  4330. this.wordsNode = (this.getChild("wordsNode"));
  4331. this.enterGuide = (this.getChild("enterGuide"));
  4332. this.talkNode = (this.getChild("talkNode"));
  4333. this.n83 = (this.getChild("n83"));
  4334. this.n84 = (this.getChild("n84"));
  4335. this.n_Logout = (this.getChild("n_Logout"));
  4336. this.n_zhuCe = (this.getChild("n_zhuCe"));
  4337. this.n_dengLu = (this.getChild("n_dengLu"));
  4338. }
  4339. }
  4340. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4341. class ui_UIMoyu extends fgui.GComponent {
  4342. static createInstance() {
  4343. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4344. }
  4345. onConstruct() {
  4346. this.ageTip = (this.getChild("ageTip"));
  4347. this.mainBg = (this.getChild("mainBg"));
  4348. this.xyNode = (this.getChild("xyNode"));
  4349. this.rnNode = (this.getChild("rnNode"));
  4350. this.fcmNode = (this.getChild("fcmNode"));
  4351. this.ageNode = (this.getChild("ageNode"));
  4352. this.tipNode = (this.getChild("tipNode"));
  4353. this.msgNode = (this.getChild("msgNode"));
  4354. }
  4355. }
  4356. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4357. class MoyuMgr {
  4358. static initMoyu() {
  4359. this.moyuView = new MoyuView();
  4360. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4361. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4362. this.moyuView.ui.displayObject.zOrder = 1000;
  4363. this.moyuView.init();
  4364. this.moyuView.showTip(true);
  4365. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4366. window['XApk'] = this;
  4367. }
  4368. static showAge(show) {
  4369. if (this.moyuView)
  4370. this.moyuView.showAge(show);
  4371. }
  4372. static onPlatMsg(idx) {
  4373. if (!MoyuMgr.moyuView)
  4374. return;
  4375. if (idx == '0') {
  4376. MoyuMgr.moyuView.showTip(false);
  4377. }
  4378. }
  4379. static showAgree(call) {
  4380. if (this.moyuView)
  4381. this.moyuView.showAgree(call);
  4382. else
  4383. call && call();
  4384. }
  4385. static showXy(type = 1) {
  4386. if (this.moyuView)
  4387. this.moyuView.showXy(type);
  4388. }
  4389. }
  4390. MoyuMgr.isAdvise = false;
  4391. class MoyuView {
  4392. constructor() {
  4393. this.ysxyNum = 1;
  4394. this.ysJson = null;
  4395. this.ui = ui_UIMoyu.createInstance();
  4396. }
  4397. init() {
  4398. this.ui.mainBg.visible = false;
  4399. this.ui.xyNode.visible = false;
  4400. this.ui.ageNode.visible = false;
  4401. this.ui.tipNode.visible = false;
  4402. this.ui.rnNode.visible = false;
  4403. this.ui.fcmNode.visible = false;
  4404. this.ui.ageTip.visible = false;
  4405. this.ui.msgNode.visible = false;
  4406. this.ui.visible = false;
  4407. this.ui.xyNode.xyList.setVirtual();
  4408. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4409. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4410. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4411. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4412. this.ui.xyNode.btnKnown.visible = false;
  4413. this.ui.xyNode.xy1.visible = false;
  4414. this.ui.xyNode.xy2.visible = false;
  4415. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4416. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4417. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4418. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4419. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4420. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4421. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4422. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4423. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4424. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4425. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4426. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4427. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4428. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4429. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4430. this.ysxyNum = 2;
  4431. }
  4432. }
  4433. onClick(obj) {
  4434. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4435. switch (obj) {
  4436. case this.ui.ageTip:
  4437. if (Moyu.isTTApk) {
  4438. this.ui.ageNode.visible = true;
  4439. this.ui.mainBg.visible = true;
  4440. }
  4441. break;
  4442. case this.ui.tipNode:
  4443. this.showTip(false);
  4444. break;
  4445. case this.ui.ageNode.btnAge:
  4446. this.ui.ageNode.visible = false;
  4447. this.ui.mainBg.visible = false;
  4448. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4449. this.ui.visible = false;
  4450. break;
  4451. case this.ui.xyNode.btnXy3:
  4452. case this.ui.xyNode.btnXy1:
  4453. this.loadXy(1);
  4454. break;
  4455. case this.ui.xyNode.btnXy2:
  4456. this.loadXy(2);
  4457. break;
  4458. case this.ui.xyNode.btnBack:
  4459. this.ui.xyNode.xy1.visible = true;
  4460. this.ui.xyNode.xy2.visible = false;
  4461. break;
  4462. case this.ui.xyNode.btnKnown:
  4463. this.ui.xyNode.visible = false;
  4464. this.ui.mainBg.visible = false;
  4465. this.ui.visible = false;
  4466. break;
  4467. case this.ui.rnNode.btnCheck:
  4468. this.check();
  4469. break;
  4470. case this.ui.rnNode.btnExit:
  4471. case this.ui.xyNode.btnNo:
  4472. this.ysxyNum--;
  4473. if (this.ysxyNum > 0)
  4474. this.showMsg("Refuse to quit the game once again");
  4475. else {
  4476. Moyu.userAgree(false);
  4477. Moyu.exit();
  4478. }
  4479. break;
  4480. case this.ui.xyNode.btnSure:
  4481. case this.ui.xyNode.btnYes:
  4482. DataMgr.userData.isAgree = true;
  4483. DataMgr.saveUserData();
  4484. this.onAgree();
  4485. break;
  4486. case this.ui.rnNode.btnDone:
  4487. this.ui.rnNode.visible = false;
  4488. this.ui.visible = false;
  4489. break;
  4490. case this.ui.fcmNode.btnRn:
  4491. this.showRn();
  4492. break;
  4493. }
  4494. }
  4495. showTip(show) {
  4496. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4497. return;
  4498. if (show) {
  4499. MoyuMgr.isAdvise = true;
  4500. this.ui.visible = true;
  4501. this.ui.tipNode.visible = true;
  4502. this.ui.tipNode.alpha = 1;
  4503. Laya.timer.once(1000, this, this.showTip, [false]);
  4504. }
  4505. else {
  4506. this.ui.tipNode.alpha = 1;
  4507. this.ui.tipNode.visible = true;
  4508. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4509. this.ui.tipNode.visible = false;
  4510. MoyuMgr.isAdvise = false;
  4511. }), 1000);
  4512. }
  4513. }
  4514. showAge(show, px = 0, py = 0) {
  4515. if (Moyu.platType > 10 && !Moyu.isIos) {
  4516. this.ui.ageTip.x = px;
  4517. this.ui.ageTip.y = py;
  4518. this.ui.ageTip.visible = show;
  4519. if (show)
  4520. this.ui.visible = true;
  4521. }
  4522. }
  4523. showAgree(call) {
  4524. this.agreeCall = call;
  4525. this.onAgree();
  4526. return;
  4527. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4528. this.showXy(0);
  4529. }
  4530. else
  4531. this.onAgree();
  4532. }
  4533. onAgree() {
  4534. if (!this.ui.ageNode.visible)
  4535. this.ui.visible = false;
  4536. this.ui.xyNode.visible = false;
  4537. Moyu.userAgree(true);
  4538. this.showAge(false);
  4539. this.agreeCall && this.agreeCall();
  4540. this.showRn();
  4541. }
  4542. showMsg(txt) {
  4543. this.ui.msgNode.txtMsg.text = txt;
  4544. this.ui.msgNode.visible = true;
  4545. this.ui.msgNode.alpha = 1;
  4546. this.ui.visible = true;
  4547. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4548. this.ui.msgNode.visible = false;
  4549. }), 2500, true);
  4550. }
  4551. showRn() {
  4552. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4553. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4554. this.ui.rnNode.rn1.visible = true;
  4555. this.ui.rnNode.rn2.visible = false;
  4556. this.ui.rnNode.rn3.visible = false;
  4557. this.ui.rnNode.rn4.visible = false;
  4558. this.ui.rnNode.visible = true;
  4559. this.ui.mainBg.visible = true;
  4560. this.ui.rnNode.btnDone.visible = false;
  4561. this.ui.rnNode.btnExit.visible = true;
  4562. this.ui.rnNode.btnCheck.visible = true;
  4563. this.ui.fcmNode.visible = false;
  4564. this.ui.visible = true;
  4565. return;
  4566. }
  4567. }
  4568. this.showFcm();
  4569. }
  4570. showFcm() {
  4571. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4572. Moyu.initFCM(true);
  4573. if (Moyu.gameTime < 1)
  4574. this.fcmLoop();
  4575. else if (Moyu.gameTime < 999)
  4576. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4577. }
  4578. }
  4579. fcmLoop() {
  4580. if (Moyu.gameTime < 1) {
  4581. this.ui.rnNode.visible = false;
  4582. this.ui.fcmNode.visible = true;
  4583. this.ui.mainBg.visible = true;
  4584. this.ui.visible = true;
  4585. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4586. Laya.timer.clear(this.ui, this.fcmLoop);
  4587. }
  4588. }
  4589. check() {
  4590. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4591. this.ui.rnNode.rn1.visible = false;
  4592. this.ui.rnNode.rn2.visible = false;
  4593. this.ui.rnNode.rn4.visible = true;
  4594. }
  4595. else if (this.ui.rnNode.rn4.visible) {
  4596. let name = this.ui.rnNode.inputName.text;
  4597. let code = this.ui.rnNode.inputCode.text;
  4598. if (code && code.length == 18) {
  4599. this.ui.rnNode.rn1.visible = false;
  4600. this.ui.rnNode.rn4.visible = false;
  4601. Moyu.authenticate(name, code, (res) => {
  4602. this.ui.rnNode.rn2.visible = !res;
  4603. this.ui.rnNode.rn3.visible = res;
  4604. this.ui.rnNode.btnDone.visible = res;
  4605. this.ui.rnNode.btnExit.visible = !res;
  4606. this.ui.rnNode.btnCheck.visible = !res;
  4607. if (res)
  4608. this.showFcm();
  4609. });
  4610. }
  4611. else
  4612. this.showMsg("信息填写不完整");
  4613. }
  4614. }
  4615. loadXy(type = 0) {
  4616. this.ui.xyNode.xy1.visible = false;
  4617. this.ui.xyNode.xy2.visible = true;
  4618. this.ui.xyNode.xyList.scrollToView(0);
  4619. if (type == 1) {
  4620. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4621. }
  4622. else if (type == 2) {
  4623. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4624. }
  4625. }
  4626. showXy(type = 0) {
  4627. this.xyBtn();
  4628. if (type == 0) {
  4629. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4630. this.ui.xyNode.btnSure.visible = true;
  4631. }
  4632. else {
  4633. this.ui.xyNode.btnYes.visible = true;
  4634. this.ui.xyNode.btnNo.visible = true;
  4635. }
  4636. }
  4637. else {
  4638. this.ui.xyNode.btnKnown.visible = true;
  4639. this.ui.mainBg.visible = true;
  4640. }
  4641. this.ui.xyNode.xy1.visible = true;
  4642. this.ui.xyNode.xy2.visible = false;
  4643. this.ui.xyNode.visible = true;
  4644. this.ui.visible = true;
  4645. }
  4646. xyBtn() {
  4647. this.ui.xyNode.btnSure.visible = false;
  4648. this.ui.xyNode.btnYes.visible = false;
  4649. this.ui.xyNode.btnNo.visible = false;
  4650. this.ui.xyNode.btnKnown.visible = false;
  4651. {
  4652. this.ui.xyNode.btnXy3.visible = false;
  4653. this.ui.xyNode.btnXy2.visible = true;
  4654. this.ui.xyNode.btnXy1.visible = true;
  4655. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4656. }
  4657. }
  4658. createXY(json) {
  4659. this.ysJson = json.content;
  4660. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4661. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4662. this.ui.xyNode.xy2.visible = true;
  4663. }
  4664. renderListItem(idx, cell) {
  4665. let xy = this.ysJson[idx];
  4666. cell.height = xy.line * 30;
  4667. cell.xyItem.text = xy.text;
  4668. }
  4669. onDestroy() {
  4670. this.agreeCall = null;
  4671. }
  4672. }
  4673. class SettingNode {
  4674. constructor(ui) {
  4675. this.showSetting = false;
  4676. this.openSound = true;
  4677. this.openShake = true;
  4678. this.ui = ui;
  4679. this.ui.soundBtn.onClick(this, this.switchSound);
  4680. this.ui.shakeBtn.onClick(this, this.switchShake);
  4681. this.ui.xyBtn.onClick(this, this.onXy);
  4682. this.ui.clickNode.onClick(this, this.changeSetting);
  4683. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4684. this.ui.xyBtn.visible = false;
  4685. this.ui.shakeBtn.visible = false;
  4686. }
  4687. changeSetting() {
  4688. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4689. this.showSetting = !this.showSetting;
  4690. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4691. }
  4692. switchSound() {
  4693. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4694. this.openSound = !this.openSound;
  4695. Moyu.onSetting(this.openSound, this.openShake);
  4696. xGame.soundMgr.onSetting(this.openSound);
  4697. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4698. }
  4699. switchShake() {
  4700. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4701. this.openShake = !this.openShake;
  4702. Moyu.onSetting(this.openSound, this.openShake);
  4703. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4704. }
  4705. onXy() {
  4706. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4707. MoyuMgr.showXy(1);
  4708. }
  4709. }
  4710. class ui_UILevelDisplay extends fgui.GComponent {
  4711. static createInstance() {
  4712. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4713. }
  4714. onConstruct() {
  4715. this.n9 = (this.getChild("n9"));
  4716. this.myNode = (this.getChild("myNode"));
  4717. this.closeNode = (this.getChild("closeNode"));
  4718. }
  4719. }
  4720. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4721. class ui_UILevelProp extends fgui.GComponent {
  4722. static createInstance() {
  4723. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4724. }
  4725. onConstruct() {
  4726. this.n16 = (this.getChild("n16"));
  4727. this.myNode = (this.getChild("myNode"));
  4728. this.closeBtn = (this.getChild("closeBtn"));
  4729. this.moneyNode = (this.getChild("moneyNode"));
  4730. this.t1 = this.getTransition("t1");
  4731. }
  4732. }
  4733. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4734. class ui_ShowItem extends fgui.GComponent {
  4735. static createInstance() {
  4736. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4737. }
  4738. onConstruct() {
  4739. this.myImg = (this.getChild("myImg"));
  4740. }
  4741. }
  4742. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4743. class ShowItem {
  4744. constructor() {
  4745. this.ui = ui_ShowItem.createInstance();
  4746. }
  4747. destroySelf() {
  4748. if (!this.ui.isDisposed) {
  4749. this.ui.removeFromParent();
  4750. this.ui.dispose();
  4751. }
  4752. }
  4753. setParent(parent) {
  4754. parent.addChild(this.ui);
  4755. }
  4756. setPos(x, y) {
  4757. this.ui.x = x;
  4758. this.ui.y = y;
  4759. }
  4760. setUrl(index) {
  4761. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4762. }
  4763. }
  4764. class ui_UIPower extends fgui.GComponent {
  4765. static createInstance() {
  4766. return (fgui.UIPackage.createObject("game", "UIPower"));
  4767. }
  4768. onConstruct() {
  4769. this.n11 = (this.getChild("n11"));
  4770. this.myNode = (this.getChild("myNode"));
  4771. this.t0 = this.getTransition("t0");
  4772. }
  4773. }
  4774. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4775. class UIPower extends UIBase {
  4776. constructor() {
  4777. super();
  4778. }
  4779. onConstructor() {
  4780. this.ui = ui_UIPower.createInstance();
  4781. this.contentPane = this.ui;
  4782. this.isEject = false;
  4783. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4784. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4785. }
  4786. show() {
  4787. super.show();
  4788. this.ui.t0.play();
  4789. }
  4790. videoGetPower() {
  4791. console.log('zh:qjff_AD_for_uipower');
  4792. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4793. }
  4794. else {
  4795. console.log('zh:AD 失败,直接发放奖励');
  4796. this.qjff_AD_for_uipower();
  4797. }
  4798. }
  4799. qjff_AD_for_uipower() {
  4800. DataMgr.setPower(xGame.common.videoPower, true);
  4801. xGame.eventMgr.event(POWER_TIME);
  4802. this.hide();
  4803. }
  4804. }
  4805. UIPower.uiName = "UIPower";
  4806. class LocalStorageManager {
  4807. test1() {
  4808. LocalStorageManager.setItem("playerName", "Tom");
  4809. LocalStorageManager.setItem("playerLevel", 5);
  4810. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  4811. const name = LocalStorageManager.getItem("playerName");
  4812. const level = LocalStorageManager.getItem("playerLevel");
  4813. const data = LocalStorageManager.getItem("playerData");
  4814. console.log(name);
  4815. console.log(level);
  4816. console.log(data);
  4817. LocalStorageManager.removeItem("playerLevel");
  4818. }
  4819. static setItem(key, value) {
  4820. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  4821. }
  4822. static getItem(key) {
  4823. const data = Laya.LocalStorage.getItem(key);
  4824. if (data === null)
  4825. return null;
  4826. try {
  4827. return JSON.parse(data);
  4828. }
  4829. catch (e) {
  4830. return data;
  4831. }
  4832. }
  4833. static removeItem(key) {
  4834. Laya.LocalStorage.removeItem(key);
  4835. }
  4836. static clear() {
  4837. Laya.LocalStorage.clear();
  4838. }
  4839. static hasJosnKey(key) {
  4840. var value = Laya.LocalStorage.getJSON(key);
  4841. if (value != null) {
  4842. return true;
  4843. }
  4844. else {
  4845. return false;
  4846. }
  4847. }
  4848. static hasKey(key) {
  4849. return Laya.LocalStorage.getItem(key) !== null;
  4850. }
  4851. }
  4852. class UILevelProp extends UIBase {
  4853. constructor() {
  4854. super();
  4855. this.firstPos = 385;
  4856. this.secondPos = 467;
  4857. this.showItemArr = [];
  4858. }
  4859. onFontLoaded() {
  4860. try {
  4861. this.ui.myNode.conditionTxt.font = "arial";
  4862. console.log("zh: onFontLoaded 设置arial字体成功");
  4863. }
  4864. catch (error) {
  4865. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4866. }
  4867. }
  4868. onConstructor() {
  4869. this.ui = ui_UILevelProp.createInstance();
  4870. this.contentPane = this.ui;
  4871. this.isEject = false;
  4872. this.addUIClick(this.ui.closeBtn, this.hide);
  4873. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4874. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4875. }
  4876. show(level) {
  4877. super.show();
  4878. this.ui.t1.play();
  4879. this.level = level;
  4880. this.data = cfgTable.placeballData[this.level];
  4881. this.updateSelf();
  4882. this.showPreView();
  4883. this.moneyNode.ui.c1.selectedIndex = 2;
  4884. this.moneyNode.checkPowerTime();
  4885. this.moneyNode.powerChange();
  4886. }
  4887. showPreView() {
  4888. let item;
  4889. let data;
  4890. for (let index = 0; index < this.showItemArr.length; index++) {
  4891. item = this.showItemArr[index];
  4892. item.destroySelf();
  4893. }
  4894. this.showItemArr = [];
  4895. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4896. for (const key in cfgData) {
  4897. data = cfgData[key];
  4898. item = new ShowItem();
  4899. item.setParent(this.ui.myNode.displayRoot);
  4900. item.setPos(data.x, data.y);
  4901. item.setUrl(data.value);
  4902. this.showItemArr.push(item);
  4903. }
  4904. }
  4905. updateSelf() {
  4906. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4907. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4908. if (this.data.ball == -1) {
  4909. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4910. }
  4911. else {
  4912. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4913. }
  4914. let localData = DataMgr.getPlaceBallLevel(this.level);
  4915. let getAward = localData.getAward;
  4916. let cfg = cfgTable.placeballData[this.level];
  4917. let coin = this.data.award[0];
  4918. let diamond = this.data.award[1];
  4919. if (cfg.type == PlaceBallType.challenge) {
  4920. diamond = 0;
  4921. coin = 100;
  4922. }
  4923. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4924. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4925. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4926. if (cfg.type == PlaceBallType.challenge) {
  4927. this.ui.myNode.coinNode.numTxt.text = "";
  4928. }
  4929. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4930. if (coin > 0 && diamond > 0) {
  4931. this.ui.myNode.diamondNode.x = 385;
  4932. this.ui.myNode.coinNode.x = 467;
  4933. }
  4934. else {
  4935. this.ui.myNode.diamondNode.x = 385;
  4936. this.ui.myNode.coinNode.x = 385;
  4937. }
  4938. if (!getAward) {
  4939. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4940. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4941. }
  4942. else {
  4943. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4944. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4945. }
  4946. }
  4947. startGame() {
  4948. if (DataMgr.powerEnough()) {
  4949. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  4950. this.ui.myNode.startBtn.touchable = false;
  4951. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4952. console.log('zh:startGame ');
  4953. this.ui.myNode.startBtn.touchable = true;
  4954. DataMgr.setPower(-1);
  4955. xGame.eventMgr.event(POWER_TIME);
  4956. xGame.common.gameMode = GameMode.placeBall;
  4957. xGame.common.placeBallCurLevel = this.level;
  4958. xGame.uiMgr.Show(UIGame);
  4959. this.logEventForChallenge_level_start(this.level);
  4960. xGame.uiMgr.Hide(UILevelDisplay);
  4961. xGame.uiMgr.Hide(UIMain);
  4962. this.hide();
  4963. }));
  4964. }
  4965. else {
  4966. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  4967. xGame.uiMgr.Show(UIPower);
  4968. }
  4969. }
  4970. logEventForChallenge_level_start(level) {
  4971. let keyStr = 'sjmd_challenge_level_start';
  4972. let jsonStr = {
  4973. "count": 1,
  4974. "gold_balance ": DataMgr.getCoin(),
  4975. "level": level,
  4976. "diamond_balance ": DataMgr.getDiamond()
  4977. };
  4978. if (LocalStorageManager.hasJosnKey(keyStr)) {
  4979. const d = LocalStorageManager.getItem(keyStr);
  4980. if (level > d.level) {
  4981. jsonStr.count = d.count + 1;
  4982. LocalStorageManager.setItem(keyStr, jsonStr);
  4983. }
  4984. else {
  4985. }
  4986. }
  4987. else {
  4988. LocalStorageManager.setItem(keyStr, jsonStr);
  4989. }
  4990. const reqStr = JSON.stringify(jsonStr);
  4991. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  4992. }
  4993. hide() {
  4994. super.hide();
  4995. }
  4996. }
  4997. UILevelProp.uiName = "UILevelProp";
  4998. class PutBallLevelDisplay {
  4999. constructor(ui, index) {
  5000. this.index = 0;
  5001. this.ui = ui;
  5002. this.index = index;
  5003. this.ui.onClick(this, this.clickSelf);
  5004. this.updateSelf();
  5005. this.ui.levelTxt.text = (this.index + 1) + "";
  5006. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5007. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5008. }
  5009. updateSelf() {
  5010. let level = this.index + 1;
  5011. this.data = DataMgr.getPlaceBallLevel(level);
  5012. this.ui.starNode.c1.selectedIndex = this.data.star;
  5013. let isChallenge = cfgTable.placeballData[level].type;
  5014. if (this.data.isCur) {
  5015. if (isChallenge) {
  5016. this.ui.c1.selectedIndex = 5;
  5017. }
  5018. else {
  5019. this.ui.c1.selectedIndex = 2;
  5020. }
  5021. }
  5022. else {
  5023. if (this.data.play) {
  5024. if (this.data.star == 3) {
  5025. this.ui.c1.selectedIndex = 0;
  5026. }
  5027. else {
  5028. this.ui.c1.selectedIndex = 1;
  5029. }
  5030. }
  5031. else {
  5032. if (isChallenge) {
  5033. this.ui.c1.selectedIndex = 4;
  5034. }
  5035. else {
  5036. this.ui.c1.selectedIndex = 3;
  5037. }
  5038. }
  5039. }
  5040. }
  5041. clickSelf() {
  5042. if (!this.data.play)
  5043. return;
  5044. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5045. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5046. }
  5047. }
  5048. class UILevelDisplay extends UIBase {
  5049. constructor() {
  5050. super();
  5051. }
  5052. onConstructor() {
  5053. this.ui = ui_UILevelDisplay.createInstance();
  5054. this.contentPane = this.ui;
  5055. this.isEject = false;
  5056. this.myList = this.ui.myNode.myList;
  5057. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5058. this.levelItemArr = [];
  5059. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5060. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5061. this.myList.numItems = levelNum;
  5062. if (Moyu.isKs)
  5063. this.ui.closeNode.closeBtn.x += 100;
  5064. }
  5065. levelItemRender(index, target) {
  5066. let item = new PutBallLevelDisplay(target, index);
  5067. this.levelItemArr.push(item);
  5068. }
  5069. show() {
  5070. super.show();
  5071. this.updateLevel();
  5072. this.scrollToPlace();
  5073. }
  5074. updateLevel() {
  5075. let temp;
  5076. for (let index = 0; index < this.levelItemArr.length; index++) {
  5077. temp = this.levelItemArr[index];
  5078. temp.updateSelf();
  5079. }
  5080. }
  5081. scrollToPlace() {
  5082. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5083. let passArr = DataMgr.getPlaceBallLevelList();
  5084. let offest = passArr.length;
  5085. if (offest >= maxNum - 1)
  5086. offest = maxNum - 1;
  5087. this.myList.scrollToView(offest, true, true);
  5088. }
  5089. hide() {
  5090. super.hide();
  5091. }
  5092. }
  5093. UILevelDisplay.uiName = "UILevelDisplay";
  5094. class ui_UIMatching extends fgui.GComponent {
  5095. static createInstance() {
  5096. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5097. }
  5098. onConstruct() {
  5099. this.n5 = (this.getChild("n5"));
  5100. this.n49 = (this.getChild("n49"));
  5101. this.n51 = (this.getChild("n51"));
  5102. this.n64 = (this.getChild("n64"));
  5103. this.n2 = (this.getChild("n2"));
  5104. this.n53 = (this.getChild("n53"));
  5105. this.n54 = (this.getChild("n54"));
  5106. this.n56 = (this.getChild("n56"));
  5107. this.n58 = (this.getChild("n58"));
  5108. this.n59 = (this.getChild("n59"));
  5109. this.n57 = (this.getChild("n57"));
  5110. this.n60 = (this.getChild("n60"));
  5111. this.n62 = (this.getChild("n62"));
  5112. this.awardTxt = (this.getChild("awardTxt"));
  5113. this.n61 = (this.getChild("n61"));
  5114. this.selfHead = (this.getChild("selfHead"));
  5115. this.aiHead = (this.getChild("aiHead"));
  5116. this.n82 = (this.getChild("n82"));
  5117. this.n84 = (this.getChild("n84"));
  5118. this.n83 = (this.getChild("n83"));
  5119. this.t1 = this.getTransition("t1");
  5120. this.t2 = this.getTransition("t2");
  5121. this.t3 = this.getTransition("t3");
  5122. this.t4 = this.getTransition("t4");
  5123. }
  5124. }
  5125. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5126. class UIMatching extends UIBase {
  5127. constructor() {
  5128. super();
  5129. }
  5130. onConstructor() {
  5131. this.ui = ui_UIMatching.createInstance();
  5132. this.contentPane = this.ui;
  5133. this.isEject = false;
  5134. }
  5135. show(callback) {
  5136. super.show();
  5137. PlatMgr.showBanner(true);
  5138. this.callback = callback;
  5139. let user = Moyu.getUserInfo();
  5140. if (!this.selfPot) {
  5141. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5142. }
  5143. if (!this.aiPot) {
  5144. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5145. }
  5146. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5147. this.ui.selfHead.nameTxt.text = user.nickName;
  5148. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5149. this.ui.aiHead.nameTxt.text = "???";
  5150. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5151. this.ui.selfHead.c1.selectedIndex = 0;
  5152. this.ui.aiHead.c1.selectedIndex = 0;
  5153. this.ui.selfHead.x = this.selfPot.x;
  5154. this.ui.selfHead.y = this.selfPot.y;
  5155. this.ui.aiHead.x = this.aiPot.x;
  5156. this.ui.aiHead.y = this.aiPot.y;
  5157. switch (xGame.common.gameMode) {
  5158. case GameMode.classic:
  5159. break;
  5160. case GameMode.bigMove:
  5161. this.initSkillData();
  5162. break;
  5163. default:
  5164. break;
  5165. }
  5166. this.ui.t1.play(Laya.Handler.create(this, () => {
  5167. this.ui.t2.play(Laya.Handler.create(this, () => {
  5168. switch (xGame.common.gameMode) {
  5169. case GameMode.classic:
  5170. this.waitingPeople();
  5171. break;
  5172. case GameMode.bigMove:
  5173. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5174. break;
  5175. default:
  5176. break;
  5177. }
  5178. }));
  5179. }));
  5180. }
  5181. initSkillData() {
  5182. this.skillSelectData = [];
  5183. let skillUrl = xGame.common.skillIconList;
  5184. let skillName = xGame.common.skillNameList;
  5185. let skillLevel = DataMgr.getBigSkillList();
  5186. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5187. for (let index = 0; index < 5; index++) {
  5188. let obj = {};
  5189. obj.skillImg = skillUrl[index];
  5190. obj.skillName = skillName[index];
  5191. obj.skillType = skillType[index];
  5192. obj.skillLevel = skillLevel[index];
  5193. this.skillSelectData.push(obj);
  5194. }
  5195. }
  5196. getAISkillLevel(myLevel) {
  5197. let video = xGame.common.upSkillLevel;
  5198. let aiLevel;
  5199. let temp;
  5200. if (video) {
  5201. temp = xGame.common.randomNum(-2, -1);
  5202. }
  5203. else {
  5204. if (myLevel <= 5) {
  5205. temp = xGame.common.randomNum(1, 3);
  5206. }
  5207. else if (myLevel <= 9) {
  5208. temp = xGame.common.randomNum(-2, 1);
  5209. }
  5210. else {
  5211. temp = xGame.common.randomNum(-4, 0);
  5212. }
  5213. }
  5214. aiLevel = temp + myLevel;
  5215. if (aiLevel <= 1)
  5216. aiLevel = 1;
  5217. if (aiLevel >= 10)
  5218. aiLevel = 10;
  5219. return aiLevel;
  5220. }
  5221. getAISkillType() {
  5222. return xGame.common.randomNum(1, 4);
  5223. let successTimes = DataMgr.getSkillSuccessTimes();
  5224. let info = cfgTable.aiskillData[successTimes];
  5225. if (!info) {
  5226. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5227. info = cfgTable.aiskillData[max];
  5228. }
  5229. let dataArr = info.skillselect;
  5230. let myCfg = {};
  5231. for (let index = 0; index < dataArr.length; index++) {
  5232. let temp = dataArr[index].split('-');
  5233. myCfg[temp[0]] = {};
  5234. myCfg[temp[0]].id = parseInt(temp[0]);
  5235. myCfg[temp[0]].weight = parseInt(temp[1]);
  5236. }
  5237. let aiCfg = xGame.common.initWeight(myCfg);
  5238. let curData = xGame.common.getRandomWeightData(aiCfg);
  5239. return parseInt(curData.id);
  5240. }
  5241. getAISkillData(index) {
  5242. let myLevel = this.skillSelectData[index].skillLevel;
  5243. let aiLevel = this.getAISkillLevel(myLevel);
  5244. let aiType = this.getAISkillType() - 1;
  5245. return { aiLevel, aiType } = { aiLevel, aiType };
  5246. }
  5247. skillSelectFinish(index) {
  5248. let aiInfo = this.getAISkillData(index);
  5249. xGame.common.gameMgr.selfCurSkill = index;
  5250. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5251. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5252. this.ui.selfHead.c1.selectedIndex = 1;
  5253. this.ui.aiHead.c1.selectedIndex = 1;
  5254. let myData = this.skillSelectData[index];
  5255. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5256. let guide = DataMgr.getSkillGuide();
  5257. if (guide == 0) {
  5258. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5259. }
  5260. else {
  5261. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5262. }
  5263. let aiData = this.skillSelectData[aiInfo.aiType];
  5264. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5265. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5266. this.waitingPeople();
  5267. }
  5268. waitingPeople() {
  5269. let time = xGame.common.randomNum(1000, 3000);
  5270. time += 1000;
  5271. Laya.timer.once(time, this, () => {
  5272. this.matchingSuccess();
  5273. });
  5274. }
  5275. matchingSuccess() {
  5276. let gameUI = xGame.common.gameUI;
  5277. let name = gameUI.ui.topNode.aiNameTxt.text;
  5278. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5279. this.ui.aiHead.nameTxt.text = name;
  5280. this.ui.aiHead.headImg.url = url;
  5281. name = gameUI.ui.topNode.selfNameTxt.text;
  5282. url = gameUI.ui.topNode.selfHeadLoader.url;
  5283. this.ui.selfHead.nameTxt.text = name;
  5284. this.ui.selfHead.headImg.url = url;
  5285. this.ui.t3.play(Laya.Handler.create(this, () => {
  5286. this.callback && this.callback();
  5287. this.ui.t4.play(Laya.Handler.create(this, () => {
  5288. this.destroySelf();
  5289. }));
  5290. }));
  5291. }
  5292. destroySelf() {
  5293. this.callback = null;
  5294. this.skillSelectData = null;
  5295. this.selfPot = null;
  5296. this.aiPot = null;
  5297. if (!this.ui.isDisposed) {
  5298. this.ui.removeFromParent();
  5299. this.ui.dispose();
  5300. }
  5301. xGame.uiMgr.destroyUI(this);
  5302. }
  5303. }
  5304. UIMatching.uiName = "UIMatching";
  5305. class ui_UIRanking extends fgui.GComponent {
  5306. static createInstance() {
  5307. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5308. }
  5309. onConstruct() {
  5310. this.n26 = (this.getChild("n26"));
  5311. this.myNode = (this.getChild("myNode"));
  5312. }
  5313. }
  5314. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5315. class UIRanking extends UIBase {
  5316. constructor() {
  5317. super();
  5318. this.showSelf = true;
  5319. this.rankType = 1;
  5320. this.rankList = [];
  5321. this.topX = 10;
  5322. this.myIndex = this.topX + 1;
  5323. this.myStar = 0;
  5324. }
  5325. onConstructor() {
  5326. this.ui = ui_UIRanking.createInstance();
  5327. this.contentPane = this.ui;
  5328. this.isEject = false;
  5329. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5330. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5331. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5332. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5333. this.ui.myNode.myList.setVirtual();
  5334. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5335. }
  5336. show() {
  5337. super.show();
  5338. this.getPaiHangBangDataFormJosnFile();
  5339. this.updateSelf();
  5340. let self = Moyu.getUserInfo();
  5341. if (!self.isAuth) {
  5342. Moyu.initUser(this, () => {
  5343. DataMgr.upRankData();
  5344. });
  5345. }
  5346. }
  5347. getPaiHangBangDataFormJosnFile() {
  5348. const rankingList = cfgTable.paiHangBangData.list;
  5349. this.updateItemData(rankingList);
  5350. }
  5351. updateSelfItem() {
  5352. console.log('zh:Moyu.platType =' + Moyu.platType);
  5353. let self = Moyu.getUserInfo();
  5354. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5355. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5356. if (this.myIndex > this.topX) {
  5357. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5358. }
  5359. else {
  5360. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5361. }
  5362. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5363. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5364. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5365. }
  5366. updateItemData(data) {
  5367. this.myStar = xGame.common.getAllStarNum();
  5368. if (this.rankList.length < 2) {
  5369. this.rankList = data;
  5370. let self = Moyu.getUserInfo();
  5371. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5372. self.headIcon = self.headIcon;
  5373. for (let i = 0; i < data.length; i++) {
  5374. let data = this.rankList[i];
  5375. if (data.userId == self.userId) {
  5376. this.rankList.splice(i, 1);
  5377. break;
  5378. }
  5379. }
  5380. for (let i = 0; i < data.length; i++) {
  5381. let data = this.rankList[i];
  5382. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5383. this.myIndex = i + 1;
  5384. let user = { headIcon: self.headIcon, nickName: "myself" };
  5385. let ud = { user: user, data: {} };
  5386. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5387. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5388. if (Moyu.platType < 11) {
  5389. user.headIcon = self.headIcon;
  5390. user.nickName = self.nickName;
  5391. }
  5392. this.rankList.splice(i, 0, md);
  5393. break;
  5394. }
  5395. }
  5396. }
  5397. this.updateSelfItem();
  5398. this.ui.myNode.myList.numItems = this.rankList.length;
  5399. }
  5400. updateItemUI(index, obj) {
  5401. let data = this.rankList[index];
  5402. let userData = JSON.parse(data.userData).user;
  5403. obj.nameTxt.text = userData.nickName.toString();
  5404. obj.valueTxt.text = data.rankScore;
  5405. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5406. obj.rankTxt.text = index + 1;
  5407. switch (index) {
  5408. case 0:
  5409. this.setImg(obj, 1, 0, 0);
  5410. obj.rankTxt.color = "#FFC047";
  5411. break;
  5412. case 1:
  5413. this.setImg(obj, 0, 1, 0);
  5414. obj.rankTxt.color = "#ACACAC";
  5415. break;
  5416. case 2:
  5417. this.setImg(obj, 0, 0, 1);
  5418. obj.rankTxt.color = "#D09672";
  5419. break;
  5420. default:
  5421. this.setImg(obj, 0, 0, 0);
  5422. obj.rankTxt.color = "#496FAB";
  5423. break;
  5424. }
  5425. }
  5426. setImg(obj, a, b, c) {
  5427. obj.img1.visible = a ? true : false;
  5428. obj.img2.visible = b ? true : false;
  5429. obj.img3.visible = c ? true : false;
  5430. }
  5431. changeList(type) {
  5432. this.rankType = type;
  5433. this.updateSelf();
  5434. }
  5435. changeSelfNode() {
  5436. this.showSelf = !this.showSelf;
  5437. this.updateSelf();
  5438. }
  5439. updateSelf() {
  5440. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5441. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5442. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5443. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5444. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5445. }
  5446. }
  5447. UIRanking.uiName = "UIRanking";
  5448. class ui_UISecretary extends fgui.GComponent {
  5449. static createInstance() {
  5450. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5451. }
  5452. onConstruct() {
  5453. this.n0 = (this.getChild("n0"));
  5454. this.myNode = (this.getChild("myNode"));
  5455. this.closeBtn = (this.getChild("closeBtn"));
  5456. this.t0 = this.getTransition("t0");
  5457. }
  5458. }
  5459. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5460. class UISecretary extends UIBase {
  5461. constructor() {
  5462. super();
  5463. this.curIndex = 1;
  5464. }
  5465. onConstructor() {
  5466. this.ui = ui_UISecretary.createInstance();
  5467. this.contentPane = this.ui;
  5468. this.isEject = false;
  5469. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5470. this.nodeObj = { left: null, right: null, cur: null };
  5471. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5472. }
  5473. show() {
  5474. super.show();
  5475. this.ui.t0.play();
  5476. this.updateData();
  5477. }
  5478. addSecretarySpine(node, spineName) {
  5479. if (spineName == "mishu") {
  5480. if (this.secretarySpine1) {
  5481. node.displayObject.destroyChildren();
  5482. this.playWoman(this.secretarySpine1, node.displayObject);
  5483. }
  5484. else {
  5485. let spine1 = new SpineMgr("mishu", () => {
  5486. this.secretarySpine1 = spine1;
  5487. this.playWoman(this.secretarySpine1, node.displayObject);
  5488. });
  5489. }
  5490. }
  5491. else {
  5492. if (this.secretarySpine2) {
  5493. node.displayObject.destroyChildren();
  5494. this.playWoman(this.secretarySpine2, node.displayObject);
  5495. }
  5496. else {
  5497. let spine2 = new SpineMgr("xiaomishu2", () => {
  5498. this.secretarySpine2 = spine2;
  5499. this.playWoman(this.secretarySpine2, node.displayObject);
  5500. });
  5501. }
  5502. }
  5503. }
  5504. playWoman(node, parent) {
  5505. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5506. let yy = this.ui.myNode.gameNode3.secretary.height;
  5507. let scale = 1.5;
  5508. if (node == this.secretarySpine2) {
  5509. scale = 1.2;
  5510. }
  5511. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5512. node.play(data, 0, true, parent);
  5513. }
  5514. turnLeft() {
  5515. this.curIndex--;
  5516. if (this.curIndex < 1) {
  5517. this.curIndex = 2;
  5518. }
  5519. let left = this.nodeObj.left;
  5520. let right = this.nodeObj.right;
  5521. let cur = this.nodeObj.cur;
  5522. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5523. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5524. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5525. this.updateData();
  5526. }));
  5527. this.ui.myNode.setChildIndex(right, 2);
  5528. this.nodeObj.left = cur;
  5529. this.nodeObj.right = left;
  5530. this.nodeObj.cur = right;
  5531. }
  5532. turnRight() {
  5533. this.curIndex++;
  5534. if (this.curIndex > 2) {
  5535. this.curIndex = 1;
  5536. }
  5537. let left = this.nodeObj.left;
  5538. let right = this.nodeObj.right;
  5539. let cur = this.nodeObj.cur;
  5540. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5541. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5542. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5543. this.updateData();
  5544. }));
  5545. this.ui.myNode.setChildIndex(left, 2);
  5546. this.nodeObj.left = right;
  5547. this.nodeObj.right = cur;
  5548. this.nodeObj.cur = left;
  5549. }
  5550. updateData() {
  5551. console.log('zh: updateData FFFFFFFFFF');
  5552. let data = cfgTable.secretaryshopData;
  5553. let children = this.ui.myNode._children;
  5554. let temp;
  5555. let curData;
  5556. for (let index = 0; index < children.length; index++) {
  5557. temp = children[index];
  5558. curData = data[1];
  5559. temp.heightTxt.text = curData.height;
  5560. temp.foodTxt.text = curData.food;
  5561. temp.historyTxt.text = curData.history;
  5562. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5563. this.addSecretarySpine(temp.secretary, curData.spine);
  5564. let womanIndex = curData.id - 1;
  5565. let getWoman = DataMgr.getSecretary(womanIndex);
  5566. let curUse = DataMgr.getCurSecretary();
  5567. if (getWoman) {
  5568. if (curUse == womanIndex) {
  5569. temp.purchaseBtn.c1.selectedIndex = 1;
  5570. }
  5571. else {
  5572. temp.purchaseBtn.c1.selectedIndex = 2;
  5573. }
  5574. }
  5575. else {
  5576. temp.purchaseBtn.c1.selectedIndex = 0;
  5577. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5578. }
  5579. temp.purchaseBtn.visible = false;
  5580. }
  5581. }
  5582. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5583. console.log('zh: 点击了clickSecretary ');
  5584. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5585. if (getWoman) {
  5586. if (curUse != womanIndex) {
  5587. console.log();
  5588. DataMgr.setCurSecretary(womanIndex);
  5589. this.updateData();
  5590. }
  5591. }
  5592. else {
  5593. console.log('zh:点击购买了');
  5594. let need = needDiamond;
  5595. if (DataMgr.diamondEnough(need)) {
  5596. DataMgr.setDiamond(-need);
  5597. DataMgr.setSecretary(womanIndex, 1);
  5598. DataMgr.setCurSecretary(womanIndex);
  5599. this.updateData();
  5600. }
  5601. else {
  5602. xGame.uiMgr.Show(UIAddProp, 1);
  5603. }
  5604. }
  5605. }
  5606. closeSelf() {
  5607. this.hide();
  5608. }
  5609. }
  5610. UISecretary.uiName = "UISecretary";
  5611. class ui_UIShop extends fgui.GComponent {
  5612. static createInstance() {
  5613. return (fgui.UIPackage.createObject("game", "UIShop"));
  5614. }
  5615. onConstruct() {
  5616. this.n48 = (this.getChild("n48"));
  5617. this.n0 = (this.getChild("n0"));
  5618. this.secretary = (this.getChild("secretary"));
  5619. this.talkNode = (this.getChild("talkNode"));
  5620. this.closeNode = (this.getChild("closeNode"));
  5621. this.moneyNode = (this.getChild("moneyNode"));
  5622. this.myNode = (this.getChild("myNode"));
  5623. }
  5624. }
  5625. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5626. class BallRodDisplay {
  5627. constructor(ui, index) {
  5628. this.index = 0;
  5629. this.uiIndex = 0;
  5630. this.ui = ui;
  5631. this.index = index;
  5632. this.initData();
  5633. }
  5634. initData() {
  5635. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5636. let data = cfgTable.ballrodData[this.index + 1];
  5637. this.ui.nameTxt.text = data.name;
  5638. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5639. this.ui.levelNode.c1.selectedIndex = data.quality;
  5640. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5641. if (data.spine) {
  5642. this.mySpine = new SpineMgr(data.spine, () => {
  5643. let xx = 150;
  5644. let yy = 70;
  5645. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5646. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5647. });
  5648. }
  5649. }
  5650. updateSelf() {
  5651. console.log('zh:updateSelf -------------- ');
  5652. let get = DataMgr.getBallRod(this.index);
  5653. if (get == null)
  5654. get = 1;
  5655. let curUse = DataMgr.getCurBallRod();
  5656. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5657. if (get) {
  5658. if (curUse == this.index) {
  5659. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5660. }
  5661. else {
  5662. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5663. }
  5664. }
  5665. else {
  5666. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5667. }
  5668. }
  5669. buyBallRod() {
  5670. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5671. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5672. switch (selectedIndex) {
  5673. case 0:
  5674. break;
  5675. case 1:
  5676. console.log('zh:点击了 USE THIS');
  5677. DataMgr.setCurBallRod(this.index);
  5678. let curUse = DataMgr.getCurBallRod();
  5679. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5680. let ui = xGame.uiMgr.getUI(UIShop);
  5681. ui.updateBallRod();
  5682. break;
  5683. case 2:
  5684. let data = cfgTable.ballrodData[this.index + 1];
  5685. let need = data.price;
  5686. if (DataMgr.diamondEnough(need)) {
  5687. DataMgr.setDiamond(-need);
  5688. DataMgr.setBallRod(this.index, 1);
  5689. DataMgr.setCurBallRod(this.index);
  5690. let ui = xGame.uiMgr.getUI(UIShop);
  5691. ui.updateBallRod();
  5692. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5693. }
  5694. else {
  5695. xGame.uiMgr.Show(UIAddProp, 1);
  5696. }
  5697. break;
  5698. default:
  5699. break;
  5700. }
  5701. }
  5702. logEventForGouMaiGan(qiuGanName) {
  5703. const ev = {
  5704. value: qiuGanName
  5705. };
  5706. const jsonStr = JSON.stringify(ev);
  5707. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5708. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5709. }
  5710. }
  5711. class UIShop extends UIBase {
  5712. constructor() {
  5713. super();
  5714. this.itemNums = 0;
  5715. }
  5716. onConstructor() {
  5717. this.ui = ui_UIShop.createInstance();
  5718. this.contentPane = this.ui;
  5719. this.isEject = false;
  5720. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5721. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5722. this.addUIClick(this.ui, this.interuptSecretary);
  5723. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5724. this.ballRodArr = [];
  5725. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5726. this.ui.myNode.myList.numItems = this.itemNums;
  5727. if (Moyu.isKs)
  5728. this.ui.closeNode.closeBtn.x += 100;
  5729. }
  5730. show() {
  5731. super.show();
  5732. this.playSecretaryIdle();
  5733. this.updateBallRod();
  5734. }
  5735. updateBallRod() {
  5736. for (let index = 0; index < this.ballRodArr.length; index++) {
  5737. this.ballRodArr[index].updateSelf();
  5738. }
  5739. }
  5740. renderBallRod(sort, obj) {
  5741. let index = this.getIndexBySort(sort + 1) - 1;
  5742. let ballRod = new BallRodDisplay(obj, index);
  5743. this.ballRodArr.push(ballRod);
  5744. }
  5745. getIndexBySort(sort) {
  5746. let object = cfgTable.ballrodData;
  5747. for (const key in object) {
  5748. if (object[key].sort == sort) {
  5749. return parseInt(key);
  5750. }
  5751. }
  5752. }
  5753. playSecretaryIdle() {
  5754. let parent = this.ui.secretary.displayObject;
  5755. parent.destroyChildren();
  5756. let xx = this.ui.secretary.width / 2;
  5757. let yy = this.ui.secretary.height;
  5758. let scale = xGame.common.getSecretaryScale();
  5759. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5760. xGame.common.secretary.play(data, 0, true, parent);
  5761. }
  5762. interuptSecretary() {
  5763. Laya.timer.clearAll(this);
  5764. this.playSecretaryRandomSound();
  5765. }
  5766. playSecretaryRandomSound() {
  5767. if (this.isHide)
  5768. return;
  5769. let time = xGame.common.randomNum(45000, 60000);
  5770. Laya.timer.once(time, this, () => {
  5771. if (this.isHide)
  5772. return;
  5773. let index = xGame.common.randomNum(4, 7);
  5774. xGame.soundMgr.playSound("s_main0" + index);
  5775. let words = 1;
  5776. switch (index) {
  5777. case 4:
  5778. words = 5;
  5779. break;
  5780. case 5:
  5781. words = 3;
  5782. break;
  5783. case 6:
  5784. words = 6;
  5785. break;
  5786. case 7:
  5787. words = 7;
  5788. break;
  5789. default:
  5790. break;
  5791. }
  5792. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5793. this.playSecretaryRandomSound();
  5794. });
  5795. }
  5796. closeSelf() {
  5797. this.hide();
  5798. }
  5799. }
  5800. UIShop.uiName = "UIShop";
  5801. class ui_UISign extends fgui.GComponent {
  5802. static createInstance() {
  5803. return (fgui.UIPackage.createObject("game", "UISign"));
  5804. }
  5805. onConstruct() {
  5806. this.n6 = (this.getChild("n6"));
  5807. this.closeNode = (this.getChild("closeNode"));
  5808. this.myNode = (this.getChild("myNode"));
  5809. this.moneyNode = (this.getChild("moneyNode"));
  5810. this.secretary = (this.getChild("secretary"));
  5811. this.talkNode = (this.getChild("talkNode"));
  5812. this.tripleBtn = (this.getChild("tripleBtn"));
  5813. this.normalBtn = (this.getChild("normalBtn"));
  5814. this.tipsNode = (this.getChild("tipsNode"));
  5815. this.againBtn = (this.getChild("againBtn"));
  5816. this.t0 = this.getTransition("t0");
  5817. }
  5818. }
  5819. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5820. class SignMax {
  5821. constructor(ui) {
  5822. this.ui = ui;
  5823. }
  5824. updateSelf(index, sameDay, curDayIndex) {
  5825. let data = cfgTable.signData[index + 1];
  5826. this.ui.titleTxt.text = data.title;
  5827. let arr1 = data.award[0].split('-');
  5828. let arr2 = data.award[1].split('-');
  5829. let num1 = parseInt(arr1[1]);
  5830. let num2 = parseInt(arr2[1]);
  5831. this.ui.numTxt1.text = num1 + "";
  5832. this.ui.numTxt2.text = num2 + "";
  5833. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5834. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5835. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5836. this.ui.numTxt1.visible = false;
  5837. }
  5838. else {
  5839. this.ui.numTxt1.visible = true;
  5840. }
  5841. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5842. this.ui.numTxt2.visible = false;
  5843. }
  5844. else {
  5845. this.ui.numTxt2.visible = true;
  5846. }
  5847. if (index < curDayIndex) {
  5848. this.ui.c1.selectedIndex = 1;
  5849. }
  5850. else if (index == curDayIndex) {
  5851. if (sameDay) {
  5852. this.ui.c1.selectedIndex = 2;
  5853. }
  5854. else {
  5855. this.ui.c1.selectedIndex = 2;
  5856. }
  5857. }
  5858. else {
  5859. this.ui.c1.selectedIndex = 0;
  5860. }
  5861. }
  5862. }
  5863. class SignNormal {
  5864. constructor(ui) {
  5865. this.ui = ui;
  5866. }
  5867. updateSelf(index, sameDay, curDayIndex) {
  5868. let data = cfgTable.signData[index + 1];
  5869. this.ui.titleTxt.text = data.title;
  5870. let arr = data.award[0].split('-');
  5871. let type = parseInt(arr[0]);
  5872. let num = parseInt(arr[1]);
  5873. this.ui.numTxt.text = num + "";
  5874. if (type > 2) {
  5875. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5876. this.ui.myIcon.rotation = 0;
  5877. }
  5878. else {
  5879. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5880. this.ui.myIcon.rotation = 0;
  5881. }
  5882. if (xGame.common.signAwardContainsRod(data.award)) {
  5883. this.ui.numTxt.visible = false;
  5884. }
  5885. else {
  5886. this.ui.numTxt.visible = true;
  5887. }
  5888. if (index < curDayIndex) {
  5889. this.ui.c1.selectedIndex = 1;
  5890. }
  5891. else if (index == curDayIndex) {
  5892. if (sameDay) {
  5893. this.ui.c1.selectedIndex = 2;
  5894. }
  5895. else {
  5896. this.ui.c1.selectedIndex = 2;
  5897. }
  5898. }
  5899. else {
  5900. this.ui.c1.selectedIndex = 0;
  5901. }
  5902. }
  5903. }
  5904. class UISign extends UIBase {
  5905. constructor() {
  5906. super();
  5907. this.curDayIndex = 0;
  5908. this.starX = 0;
  5909. }
  5910. onConstructor() {
  5911. this.ui = ui_UISign.createInstance();
  5912. this.contentPane = this.ui;
  5913. this.isEject = false;
  5914. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5915. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5916. this.initSignItem();
  5917. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5918. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5919. }
  5920. show() {
  5921. super.show();
  5922. this.ui.t0.play();
  5923. this.playSecretaryIdle();
  5924. this.updateSign();
  5925. }
  5926. initSignItem() {
  5927. this.signArr = [];
  5928. for (let index = 0; index < 6; index++) {
  5929. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5930. this.signArr.push(temp);
  5931. }
  5932. this.signMax = new SignMax(this.ui.myNode.day7);
  5933. if (Moyu.isKs)
  5934. this.ui.closeNode.closeBtn.x += 100;
  5935. }
  5936. updateSign() {
  5937. let sameDay = xGame.common.judgeSameDay();
  5938. let max = 7;
  5939. this.curDayIndex = DataMgr.getSignData();
  5940. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5941. this.curDayIndex = 0;
  5942. if (!sameDay) {
  5943. this.ui.normalBtn.visible = true;
  5944. this.ui.tipsNode.visible = false;
  5945. this.ui.againBtn.visible = false;
  5946. }
  5947. else {
  5948. this.ui.normalBtn.visible = false;
  5949. let again = DataMgr.getExtraSign();
  5950. let isCurrency = false;
  5951. let index = this.curDayIndex;
  5952. if (index == 0)
  5953. index = 7;
  5954. let award = cfgTable.signData[index].award;
  5955. let num = award[0].split("-")[0];
  5956. if (num == "1" || num == "2")
  5957. isCurrency = true;
  5958. let showAgain = again == 0 && isCurrency;
  5959. this.ui.againBtn.visible = showAgain;
  5960. this.ui.tipsNode.visible = !showAgain;
  5961. }
  5962. for (let index = 0; index < this.signArr.length; index++) {
  5963. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5964. }
  5965. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5966. }
  5967. playSecretaryIdle() {
  5968. let parent = this.ui.secretary.displayObject;
  5969. parent.destroyChildren();
  5970. let xx = this.ui.secretary.width / 2;
  5971. let yy = this.ui.secretary.height;
  5972. let scale = xGame.common.getSecretaryScale();
  5973. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5974. xGame.common.secretary.play(data, 0, true, parent);
  5975. }
  5976. closeSelf() {
  5977. this.hide();
  5978. }
  5979. normalGetAward() {
  5980. let sameDay = xGame.common.judgeSameDay();
  5981. if (!sameDay) {
  5982. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5983. let temp;
  5984. let type;
  5985. let num;
  5986. let arr = [];
  5987. for (let index = 0; index < award.length; index++) {
  5988. temp = award[index].split("-");
  5989. type = parseInt(temp[0]);
  5990. num = parseInt(temp[1]);
  5991. let awardType = new AwardType();
  5992. awardType.num = num;
  5993. awardType.type = type;
  5994. arr.push(awardType);
  5995. }
  5996. xGame.common.getAward(arr, (watchVideo) => {
  5997. this.curDayIndex++;
  5998. if (this.curDayIndex > 7)
  5999. this.curDayIndex = 0;
  6000. DataMgr.setSignData(this.curDayIndex);
  6001. DataMgr.setSignTime(new Date().getTime());
  6002. if (watchVideo) {
  6003. DataMgr.setExtraSign(1);
  6004. Moyu.sendDataEvent("signIn1");
  6005. }
  6006. this.updateSign();
  6007. });
  6008. }
  6009. }
  6010. againGetAward() {
  6011. Moyu.sendDataEvent("signIn2");
  6012. console.log('zh:qjff_AD_for_uisign');
  6013. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6014. }
  6015. else {
  6016. console.log('zh:AD 失败,直接发放奖励');
  6017. this.qjff_AD_for_uisign();
  6018. }
  6019. }
  6020. qjff_AD_for_uisign() {
  6021. let index = this.curDayIndex;
  6022. if (index == 0)
  6023. index = 7;
  6024. let award = cfgTable.signData[index].award;
  6025. let temp;
  6026. let type;
  6027. let num;
  6028. for (let index = 0; index < award.length; index++) {
  6029. temp = award[index].split("-");
  6030. type = parseInt(temp[0]);
  6031. num = parseInt(temp[1]) * 3;
  6032. xGame.common.playObjFlyAnim(num, type);
  6033. }
  6034. DataMgr.setExtraSign(1);
  6035. this.updateSign();
  6036. }
  6037. }
  6038. UISign.uiName = "UISign";
  6039. class ui_UISkill extends fgui.GComponent {
  6040. static createInstance() {
  6041. return (fgui.UIPackage.createObject("game", "UISkill"));
  6042. }
  6043. onConstruct() {
  6044. this.n48 = (this.getChild("n48"));
  6045. this.n0 = (this.getChild("n0"));
  6046. this.secretary = (this.getChild("secretary"));
  6047. this.talkNode = (this.getChild("talkNode"));
  6048. this.closeNode = (this.getChild("closeNode"));
  6049. this.moneyNode = (this.getChild("moneyNode"));
  6050. this.skillNode = (this.getChild("skillNode"));
  6051. this.guideNode = (this.getChild("guideNode"));
  6052. }
  6053. }
  6054. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6055. class SkillDisplay {
  6056. constructor(ui, data, uiIndex) {
  6057. this.starX = 0;
  6058. this.starY = 0;
  6059. this.index = 0;
  6060. this.ui = ui;
  6061. this.data = data;
  6062. this.index = uiIndex;
  6063. this.initSelf();
  6064. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6065. }
  6066. initSelf() {
  6067. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6068. this.ui.nameTxt.text = this.data.name;
  6069. this.ui.describeTxt.text = this.data.describe;
  6070. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6071. this.ui.startBtn.onClick(this, this.startGame);
  6072. this.updateSelf();
  6073. }
  6074. updateSelf() {
  6075. this.checkTry();
  6076. let level = DataMgr.getBigSkillByIndex(this.index);
  6077. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6078. }
  6079. checkTry() {
  6080. let index = this.index;
  6081. let level = DataMgr.getBigSkillByIndex(index);
  6082. if (level == null) {
  6083. DataMgr.setBigSkill(index, 1, false);
  6084. level = 1;
  6085. }
  6086. this.ui.levelTxt.text = "LV." + level;
  6087. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6088. this.ui.tryNode.visible = true;
  6089. else
  6090. this.ui.tryNode.visible = false;
  6091. }
  6092. clickAddLevel() {
  6093. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6094. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6095. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6096. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6097. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6098. }
  6099. else {
  6100. console.log('zh:AD 失败,直接发放奖励');
  6101. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6102. }
  6103. }
  6104. qjff_AD_for_skilldisplay_clickAddLevel() {
  6105. DataMgr.setBigSkill(this.data.index, 1);
  6106. this.updateSelf();
  6107. xGame.common.upSkillLevel = true;
  6108. }
  6109. startGame() {
  6110. console.log('zh:rod skill startgame');
  6111. if (this.data.index == 3) {
  6112. alert('Coming soon!');
  6113. return;
  6114. }
  6115. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6116. let needCoin = xGame.common.bigMoveNeedCoin;
  6117. xGame.common.passAwardCoin = 2000;
  6118. let guide = DataMgr.getSkillGuide();
  6119. console.log('zh:startGame guide=' + guide);
  6120. xGame.common.temSelfLevel = 0;
  6121. if (guide == 0) {
  6122. needCoin = 0;
  6123. xGame.common.temSelfLevel = 100;
  6124. }
  6125. if (DataMgr.coinEnough(needCoin)) {
  6126. DataMgr.setCoin(-needCoin);
  6127. xGame.common.curPlayerSkillType = this.index;
  6128. if (guide == 0)
  6129. xGame.common.curPlayerSkillType = 0;
  6130. console.log('zh: skilldisplay 1');
  6131. xGame.uiMgr.Show(UIGame);
  6132. xGame.uiMgr.Hide(UIMain);
  6133. xGame.uiMgr.Show(UIMatching, () => {
  6134. xGame.common.gameUI.ui.alpha = 1;
  6135. xGame.common.gameUI.startGame();
  6136. xGame.uiMgr.Hide(UISkill);
  6137. });
  6138. this.logEventForRod_start();
  6139. }
  6140. else {
  6141. console.log('zh: skilldisplay 2');
  6142. xGame.uiMgr.Show(UIAddProp, 0);
  6143. Moyu.sendDataEvent("AddCoinVideo");
  6144. }
  6145. }
  6146. logEventForRod_start() {
  6147. let gfmsIdx = xGame.common.curPlayerSkillType;
  6148. console.log('zh:选择的技能=' + gfmsIdx);
  6149. let gfmc = 'Skyfall Shot';
  6150. if (gfmsIdx == 0) {
  6151. gfmc = 'Skyfall Shot';
  6152. }
  6153. if (gfmsIdx == 1) {
  6154. gfmc = 'Surging break';
  6155. }
  6156. if (gfmsIdx == 2) {
  6157. gfmc = 'Frost Lock';
  6158. }
  6159. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6160. let jsonStr = {
  6161. "count": 0,
  6162. "name": gfmc
  6163. };
  6164. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6165. const d = LocalStorageManager.getItem(keyStr);
  6166. jsonStr.count = d.count + 1;
  6167. LocalStorageManager.setItem(keyStr, jsonStr);
  6168. }
  6169. else {
  6170. LocalStorageManager.setItem(keyStr, jsonStr);
  6171. }
  6172. const reqStr = JSON.stringify(jsonStr);
  6173. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6174. }
  6175. }
  6176. class UISkill extends UIBase {
  6177. constructor() {
  6178. super();
  6179. this.skillData = [];
  6180. }
  6181. onConstructor() {
  6182. this.ui = ui_UISkill.createInstance();
  6183. this.contentPane = this.ui;
  6184. this.isEject = false;
  6185. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6186. this.initSkillData();
  6187. console.log('zh:aaaaaa1111111111');
  6188. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6189. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6190. console.log('zh:aaaaaa22222222');
  6191. this.displayList = [];
  6192. this.ui.skillNode.skillList.numItems = 3;
  6193. this.addUIClick(this.ui, this.interuptSecretary);
  6194. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6195. this.ui.talkNode.visible = false;
  6196. if (Moyu.isKs)
  6197. this.ui.closeNode.closeBtn.x += 100;
  6198. }
  6199. show() {
  6200. super.show();
  6201. this.playSecretaryIdle();
  6202. this.moneyNode.ui.c1.selectedIndex = 1;
  6203. Laya.timer.clearAll(this);
  6204. xGame.soundMgr.playSound("s_start");
  6205. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6206. let guide = DataMgr.getSkillGuide();
  6207. this.ui.guideNode.visible = guide == 0;
  6208. let item = this.getSkillItemByUIIndex(0);
  6209. if (guide == 0) {
  6210. item.ui.c1.selectedIndex = 1;
  6211. }
  6212. else {
  6213. item.ui.c1.selectedIndex = 0;
  6214. }
  6215. this.ui.guideNode.guideBtn.visible = guide == 0;
  6216. for (let index = 0; index < this.displayList.length; index++) {
  6217. this.displayList[index].checkTry();
  6218. }
  6219. }
  6220. getSkillItemByUIIndex(cur) {
  6221. for (let index = 0; index < this.displayList.length; index++) {
  6222. if (this.displayList[index].index == cur) {
  6223. return this.displayList[index];
  6224. }
  6225. }
  6226. }
  6227. enterGuideLevel() {
  6228. let item = this.getSkillItemByUIIndex(0);
  6229. item.startGame();
  6230. if (DataMgr.getNewUser())
  6231. Moyu.sendDataEvent("gameStart1");
  6232. }
  6233. initSkillData() {
  6234. this.skillData = [];
  6235. let nameList = xGame.common.skillNameList;
  6236. let iconList = xGame.common.skillIconList;
  6237. let describeList = [
  6238. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6239. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6240. "The power of frost descends—freezing the flow and taking full control of the game!"
  6241. ];
  6242. console.log('zh:initSkillData 111111111');
  6243. let data;
  6244. for (let index = 0; index < nameList.length; index++) {
  6245. data = {};
  6246. data.name = nameList[index];
  6247. data.icon = iconList[index];
  6248. data.describe = describeList[index];
  6249. data.index = index;
  6250. this.skillData.push(data);
  6251. }
  6252. }
  6253. updateSkillItem(index, target) {
  6254. if (this.displayList[index] == null) {
  6255. let uiIndex;
  6256. switch (index) {
  6257. case 0:
  6258. uiIndex = 1;
  6259. break;
  6260. case 1:
  6261. uiIndex = 0;
  6262. break;
  6263. case 2:
  6264. uiIndex = 2;
  6265. break;
  6266. case 3:
  6267. uiIndex = 3;
  6268. break;
  6269. default:
  6270. break;
  6271. }
  6272. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6273. this.displayList.push(temp);
  6274. }
  6275. }
  6276. playSecretaryIdle() {
  6277. let parent = this.ui.secretary.displayObject;
  6278. parent.destroyChildren();
  6279. let xx = this.ui.secretary.width / 2;
  6280. let yy = this.ui.secretary.height;
  6281. let scale = xGame.common.getSecretaryScale();
  6282. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6283. xGame.common.secretary.play(data, 0, true, parent);
  6284. }
  6285. returnUIMain() {
  6286. this.hide();
  6287. xGame.common.stopGirlPop(this.ui.talkNode);
  6288. xGame.uiMgr.Show(UIMain);
  6289. }
  6290. interuptSecretary() {
  6291. Laya.timer.clearAll(this);
  6292. this.playSecretaryRandomSound();
  6293. }
  6294. playSecretaryRandomSound() {
  6295. if (this.isHide)
  6296. return;
  6297. let time = xGame.common.randomNum(45000, 60000);
  6298. Laya.timer.once(time, this, () => {
  6299. if (this.isHide)
  6300. return;
  6301. let index = xGame.common.randomNum(4, 7);
  6302. xGame.soundMgr.playSound("s_main0" + index);
  6303. let words = 1;
  6304. switch (index) {
  6305. case 4:
  6306. words = 5;
  6307. break;
  6308. case 5:
  6309. words = 3;
  6310. break;
  6311. case 6:
  6312. words = 6;
  6313. break;
  6314. case 7:
  6315. words = 7;
  6316. break;
  6317. default:
  6318. break;
  6319. }
  6320. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6321. this.playSecretaryRandomSound();
  6322. });
  6323. }
  6324. }
  6325. UISkill.uiName = "UISkill";
  6326. class ui_UIMsg extends fgui.GComponent {
  6327. static createInstance() {
  6328. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6329. }
  6330. onConstruct() {
  6331. this.tipsNode = (this.getChild("tipsNode"));
  6332. }
  6333. }
  6334. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6335. class UIMsg extends UIBase {
  6336. constructor() {
  6337. super();
  6338. }
  6339. onConstructor() {
  6340. this.ui = ui_UIMsg.createInstance();
  6341. this.contentPane = this.ui;
  6342. this.isEject = false;
  6343. this.isMuti = true;
  6344. }
  6345. show(msg, callback) {
  6346. super.show();
  6347. this.ui.tipsNode.msgTxt.text = msg;
  6348. this.ui.alpha = 1;
  6349. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6350. this.hide();
  6351. callback && callback();
  6352. }), 1000);
  6353. }
  6354. }
  6355. UIMsg.uiName = "UIMsg";
  6356. class ui_UIModeSelection extends fgui.GComponent {
  6357. static createInstance() {
  6358. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6359. }
  6360. onConstruct() {
  6361. this.n19 = (this.getChild("n19"));
  6362. this.closeBtn = (this.getChild("closeBtn"));
  6363. this.myNode = (this.getChild("myNode"));
  6364. this.t0 = this.getTransition("t0");
  6365. }
  6366. }
  6367. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6368. class UIModeSelection extends UIBase {
  6369. constructor() {
  6370. super();
  6371. }
  6372. onConstructor() {
  6373. this.ui = ui_UIModeSelection.createInstance();
  6374. this.contentPane = this.ui;
  6375. this.isEject = false;
  6376. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6377. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6378. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6379. this.addUIClick(this.ui.closeBtn, this.hide);
  6380. this.peopleArr = [65, 990, 580];
  6381. this.peopleOffest = [5, 10, 10];
  6382. }
  6383. show(callback) {
  6384. this.updateSelf();
  6385. super.show();
  6386. this.ui.t0.play();
  6387. this.callback = callback;
  6388. }
  6389. updateSelf() {
  6390. let cfg = cfgTable.modeselectData;
  6391. for (let index = 1; index <= 3; index++) {
  6392. let node = this.ui.myNode["type" + index];
  6393. node.need.text = cfg[index].need;
  6394. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6395. node.peopleTxt.text = this.getRandPeople(index - 1);
  6396. }
  6397. }
  6398. enterGame(type) {
  6399. console.log('zh: 进入经典模式 type: ' + type);
  6400. xGame.common.classicRoomType = type;
  6401. let cfg = cfgTable.modeselectData[type];
  6402. let need = cfg.need;
  6403. xGame.common.passAwardCoin = cfg.award;
  6404. if (DataMgr.coinEnough(need)) {
  6405. DataMgr.setCoin(-need);
  6406. this.ui.myNode["type" + type].t0.play();
  6407. Laya.timer.once(200, this, () => {
  6408. this.callback && this.callback();
  6409. });
  6410. this.logEventForClassic_start();
  6411. }
  6412. else {
  6413. Moyu.sendDataEvent("AddCoinVideo");
  6414. xGame.uiMgr.Show(UIAddProp, 0);
  6415. }
  6416. }
  6417. getRandPeople(index) {
  6418. let rand = this.peopleOffest[index];
  6419. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6420. }
  6421. logEventForClassic_start() {
  6422. let rtype = xGame.common.classicRoomType;
  6423. let msmc = '';
  6424. if (rtype == 1) {
  6425. msmc = 'beginner';
  6426. }
  6427. if (rtype == 2) {
  6428. msmc = 'expert';
  6429. }
  6430. if (rtype == 3) {
  6431. msmc = 'master';
  6432. }
  6433. let keyStr = 'sjmd_classic_start_' + rtype;
  6434. let jsonStr = {
  6435. "difficulty": msmc,
  6436. "classic_count": 1,
  6437. "difficulty_count": 1
  6438. };
  6439. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6440. const d = LocalStorageManager.getItem(keyStr);
  6441. jsonStr.classic_count = d.classic_count + 1;
  6442. jsonStr.difficulty_count = d.difficulty_count + 1;
  6443. LocalStorageManager.setItem(keyStr, jsonStr);
  6444. }
  6445. else {
  6446. LocalStorageManager.setItem(keyStr, jsonStr);
  6447. }
  6448. const reqStr = JSON.stringify(jsonStr);
  6449. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6450. }
  6451. }
  6452. UIModeSelection.uiName = "UIModeSelection";
  6453. class ui_UIReg extends fgui.GComponent {
  6454. static createInstance() {
  6455. return (fgui.UIPackage.createObject("game", "UIReg"));
  6456. }
  6457. onConstruct() {
  6458. this.n38 = (this.getChild("n38"));
  6459. this.n9 = (this.getChild("n9"));
  6460. this.btn_reg = (this.getChild("btn_reg"));
  6461. this.n14 = (this.getChild("n14"));
  6462. this.n15 = (this.getChild("n15"));
  6463. this.n34 = (this.getChild("n34"));
  6464. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6465. this.closeBtn = (this.getChild("closeBtn"));
  6466. this.n39 = (this.getChild("n39"));
  6467. this.n40 = (this.getChild("n40"));
  6468. this.txt_ua = (this.getChild("txt_ua"));
  6469. this.n41 = (this.getChild("n41"));
  6470. this.txt_up1 = (this.getChild("txt_up1"));
  6471. this.n42 = (this.getChild("n42"));
  6472. this.txt_up2 = (this.getChild("txt_up2"));
  6473. this.lab_tip = (this.getChild("lab_tip"));
  6474. }
  6475. }
  6476. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6477. class ui_UILogin extends fgui.GComponent {
  6478. static createInstance() {
  6479. return (fgui.UIPackage.createObject("game", "UILogin"));
  6480. }
  6481. onConstruct() {
  6482. this.n18 = (this.getChild("n18"));
  6483. this.n7 = (this.getChild("n7"));
  6484. this.btn_login = (this.getChild("btn_login"));
  6485. this.n5 = (this.getChild("n5"));
  6486. this.n6 = (this.getChild("n6"));
  6487. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6488. this.lab_tip = (this.getChild("lab_tip"));
  6489. this.closeBtn = (this.getChild("closeBtn"));
  6490. this.n25 = (this.getChild("n25"));
  6491. this.txt_ua = (this.getChild("txt_ua"));
  6492. this.n27 = (this.getChild("n27"));
  6493. this.txt_up = (this.getChild("txt_up"));
  6494. this.n29 = (this.getChild("n29"));
  6495. }
  6496. }
  6497. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6498. class UILogin extends UIBase {
  6499. constructor() {
  6500. super();
  6501. }
  6502. onConstructor() {
  6503. this.ui = ui_UILogin.createInstance();
  6504. this.contentPane = this.ui;
  6505. this.isEject = false;
  6506. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6507. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6508. this.addUIClick(this.ui.btn_login, this.userLogin);
  6509. }
  6510. show() {
  6511. super.show();
  6512. this.x = (Laya.stage.width - this.width) / 2;
  6513. this.y = (Laya.stage.height - this.height) / 2;
  6514. }
  6515. closeSelf() {
  6516. this.hide();
  6517. }
  6518. userLogin() {
  6519. this.ui.lab_tip.visible = false;
  6520. let ua = this.ui.txt_ua.text;
  6521. let up = this.ui.txt_up.text;
  6522. if (ua && up) {
  6523. xGame.uiMgr.Show(UIMsg, "Request in progress..");
  6524. let reqData = JSON.stringify({
  6525. username: ua.trim(),
  6526. password: up.trim(),
  6527. fromMark: 'app_game'
  6528. });
  6529. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6530. try {
  6531. this.ui.lab_tip.visible = true;
  6532. console.log('zh:res = ' + JSON.stringify(res));
  6533. let code = res.code;
  6534. let msg = res.msg;
  6535. this.ui.lab_tip.text = msg;
  6536. xGame.uiMgr.Show(UIMsg, msg);
  6537. if (code == 200) {
  6538. let keyStr = 'userInfo';
  6539. let jsonStr = {
  6540. "username": res.username,
  6541. "token": res.token
  6542. };
  6543. LocalStorageManager.setItem(keyStr, jsonStr);
  6544. this.ui.lab_tip.color = "#FFFFFF";
  6545. }
  6546. else {
  6547. this.ui.lab_tip.color = "#FF0000";
  6548. }
  6549. }
  6550. catch (error) {
  6551. console.log('error=' + error);
  6552. alert(error);
  6553. }
  6554. finally {
  6555. }
  6556. });
  6557. }
  6558. else {
  6559. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6560. }
  6561. }
  6562. gotoRegPage() {
  6563. this.closeSelf();
  6564. xGame.uiMgr.Show(UIReg);
  6565. }
  6566. }
  6567. UILogin.uiName = "UILogin";
  6568. class UIReg extends UIBase {
  6569. constructor() {
  6570. super();
  6571. }
  6572. onConstructor() {
  6573. this.ui = ui_UIReg.createInstance();
  6574. this.contentPane = this.ui;
  6575. this.isEject = false;
  6576. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6577. this.addUIClick(this.ui.btn_reg, this.regUser);
  6578. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6579. }
  6580. show() {
  6581. super.show();
  6582. this.x = (Laya.stage.width - this.width) / 2;
  6583. this.y = (Laya.stage.height - this.height) / 2;
  6584. }
  6585. closeSelf() {
  6586. this.hide();
  6587. }
  6588. regUser() {
  6589. this.ui.lab_tip.visible = false;
  6590. let ua = this.ui.txt_ua.text;
  6591. let up1 = this.ui.txt_up1.text;
  6592. let up2 = this.ui.txt_up2.text;
  6593. if (ua && up1 && up2 && up1 == up2) {
  6594. this.ui.closeBtn.visible = false;
  6595. xGame.uiMgr.Show(UIMsg, "Request in progress..");
  6596. let reqData = JSON.stringify({
  6597. username: ua.trim(),
  6598. password: up1.trim(),
  6599. fromMark: 'app_game'
  6600. });
  6601. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  6602. try {
  6603. this.ui.lab_tip.visible = true;
  6604. console.log('zh:res = ' + JSON.stringify(res));
  6605. let code = res.code;
  6606. let msg = res.msg;
  6607. this.ui.lab_tip.text = msg;
  6608. xGame.uiMgr.Show(UIMsg, msg);
  6609. if (code == 200) {
  6610. this.ui.lab_tip.color = "#FFFFFF";
  6611. }
  6612. else {
  6613. this.ui.lab_tip.color = "#FF0000";
  6614. }
  6615. }
  6616. catch (error) {
  6617. console.log('error=' + error);
  6618. alert(error);
  6619. }
  6620. finally {
  6621. }
  6622. });
  6623. }
  6624. else {
  6625. if (up1 != up2) {
  6626. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  6627. }
  6628. else {
  6629. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6630. }
  6631. }
  6632. }
  6633. gotoLogin() {
  6634. this.closeSelf();
  6635. xGame.uiMgr.Show(UILogin);
  6636. }
  6637. }
  6638. UIReg.uiName = "UIReg";
  6639. class ui_UIGetAward extends fgui.GComponent {
  6640. static createInstance() {
  6641. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6642. }
  6643. onConstruct() {
  6644. this.n4 = (this.getChild("n4"));
  6645. this.n0 = (this.getChild("n0"));
  6646. this.myList = (this.getChild("myList"));
  6647. this.n1 = (this.getChild("n1"));
  6648. this.eftNode = (this.getChild("eftNode"));
  6649. this.btnNode = (this.getChild("btnNode"));
  6650. this.t0 = this.getTransition("t0");
  6651. }
  6652. }
  6653. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6654. class UIGetAward extends UIBase {
  6655. constructor() {
  6656. super();
  6657. this.showTriple = true;
  6658. }
  6659. onConstructor() {
  6660. this.ui = ui_UIGetAward.createInstance();
  6661. this.contentPane = this.ui;
  6662. this.isEject = false;
  6663. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6664. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6665. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6666. }
  6667. show(arr, showTriple, callback) {
  6668. super.show();
  6669. this.ui.t0.play();
  6670. this.ui.eftNode.visible = true;
  6671. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6672. this.ui.eftNode.visible = false;
  6673. }), 1, 0, 0, 0.9);
  6674. this.awardArr = arr;
  6675. this.showTriple = showTriple;
  6676. this.callback = callback;
  6677. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6678. this.ui.myList.numItems = arr.length;
  6679. xGame.soundMgr.playSound("getaward");
  6680. }
  6681. updateSelf(index, obj) {
  6682. let temp = this.awardArr[index];
  6683. let icon = this.getIcon(temp.type);
  6684. let str = icon;
  6685. if (temp.type > 2) {
  6686. str = "s" + icon;
  6687. }
  6688. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6689. obj.myIcon.rotation = 0;
  6690. obj.numTxt.text = temp.num + "";
  6691. obj.numTxt.visible = temp.type > 2 ? false : true;
  6692. obj.nameTxt.text = this.getNameStr(temp.type);
  6693. }
  6694. renderItem(index, obj) {
  6695. this.updateSelf(index, obj);
  6696. }
  6697. tripleGetAward() {
  6698. console.log('zh:qjff_AD_for_uigetAward');
  6699. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6700. }
  6701. else {
  6702. console.log('zh:AD 失败,直接发放奖励');
  6703. this.qjff_AD_for_uigetAward();
  6704. }
  6705. }
  6706. qjff_AD_for_uigetAward() {
  6707. this.getAward(3);
  6708. }
  6709. normalGetAward() {
  6710. if (PlatMgr.isMisVideo())
  6711. this.tripleGetAward();
  6712. else
  6713. this.getAward();
  6714. }
  6715. getAward(times = 1) {
  6716. this.hide();
  6717. for (let index = 0; index < this.awardArr.length; index++) {
  6718. this.awardArr[index].num *= times;
  6719. }
  6720. this.callback && this.callback(times != 1);
  6721. }
  6722. getIcon(type) {
  6723. switch (type) {
  6724. case Prop.diamond:
  6725. return "ty_zs";
  6726. case Prop.coin:
  6727. return "ty_jb";
  6728. case Prop.gan1:
  6729. return "qg1";
  6730. case Prop.gan2:
  6731. return "qg2";
  6732. case Prop.gan3:
  6733. return "qg3";
  6734. case Prop.gan4:
  6735. return "qg4";
  6736. default:
  6737. break;
  6738. }
  6739. }
  6740. getNameStr(type) {
  6741. switch (type) {
  6742. case Prop.diamond:
  6743. return "Diamond";
  6744. case Prop.coin:
  6745. return "Coins";
  6746. case Prop.gan1:
  6747. case Prop.gan2:
  6748. case Prop.gan3:
  6749. case Prop.gan4:
  6750. return cfgTable.ballrodData[type - 1].name;
  6751. default:
  6752. break;
  6753. }
  6754. }
  6755. }
  6756. UIGetAward.uiName = "UIGetAward";
  6757. class ui_UIRepentProp extends fgui.GComponent {
  6758. static createInstance() {
  6759. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6760. }
  6761. onConstruct() {
  6762. this.c1 = this.getController("c1");
  6763. this.n11 = (this.getChild("n11"));
  6764. this.regretNode = (this.getChild("regretNode"));
  6765. this.helpLineNode = (this.getChild("helpLineNode"));
  6766. this.t0 = this.getTransition("t0");
  6767. }
  6768. }
  6769. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6770. class UIRepentProp extends UIBase {
  6771. constructor() {
  6772. super();
  6773. this.viewType = 0;
  6774. this.regretType = 0;
  6775. }
  6776. onConstructor() {
  6777. this.ui = ui_UIRepentProp.createInstance();
  6778. this.contentPane = this.ui;
  6779. this.isEject = false;
  6780. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6781. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6782. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6783. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6784. }
  6785. show(viewType, regretType, callback) {
  6786. PlatMgr.showInsert(true);
  6787. this.viewType = viewType;
  6788. this.regretType = regretType;
  6789. this.callback = callback;
  6790. super.show();
  6791. this.ui.t0.play();
  6792. this.ui.c1.selectedIndex = this.viewType;
  6793. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6794. if (this.viewType == 0) {
  6795. let guide = DataMgr.getGuideHelpLine();
  6796. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6797. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6798. }
  6799. xGame.common.gameMgr.gamePause = true;
  6800. }
  6801. hideSelf() {
  6802. xGame.common.gameMgr.gamePause = false;
  6803. this.callback && this.callback(false);
  6804. this.hide();
  6805. }
  6806. videoRegret() {
  6807. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6808. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6809. }
  6810. else {
  6811. console.log('zh:AD 失败,直接发放奖励');
  6812. this.qjff_AD_for_UIrepentProp_videoRegret();
  6813. }
  6814. }
  6815. qjff_AD_for_UIrepentProp_videoRegret() {
  6816. this.callback && this.callback(true);
  6817. this.hideSelf();
  6818. }
  6819. videoAddHelpLine() {
  6820. let guide = DataMgr.getGuideHelpLine();
  6821. if (guide == 0) {
  6822. this.callback && this.callback(true);
  6823. this.hideSelf();
  6824. DataMgr.setGuideHelpLine();
  6825. xGame.common.gameUI.ui.guideNode.visible = false;
  6826. }
  6827. else {
  6828. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6829. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6830. }
  6831. else {
  6832. console.log('zh:AD 失败,直接发放奖励');
  6833. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6834. }
  6835. }
  6836. }
  6837. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6838. this.callback && this.callback(true);
  6839. this.hideSelf();
  6840. }
  6841. }
  6842. UIRepentProp.uiName = "UIRepentProp";
  6843. class UIMain extends UIBase {
  6844. constructor() {
  6845. super();
  6846. this.firstEnter = true;
  6847. }
  6848. nativeCallJs(msg) {
  6849. let t = msg;
  6850. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6851. switch (t) {
  6852. case 'qjff_chouJiang':
  6853. let dui = xGame.uiMgr.getUI(UIDraw);
  6854. dui.qjff_chouJiang();
  6855. break;
  6856. case 'qjff_AD_for_uisign':
  6857. let dui2 = xGame.uiMgr.getUI(UISign);
  6858. dui2.qjff_AD_for_uisign();
  6859. break;
  6860. case 'qjff_AD_for_uitry':
  6861. let dui3 = xGame.uiMgr.getUI(UITry);
  6862. dui3.qjff_AD_for_uitry();
  6863. break;
  6864. case 'qjff_AD_for_uipower':
  6865. let dui4 = xGame.uiMgr.getUI(UIPower);
  6866. dui4.qjff_AD_for_uipower();
  6867. break;
  6868. case 'qjff_AD_for_uigetAward':
  6869. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6870. dui5.qjff_AD_for_uigetAward();
  6871. break;
  6872. case 'qjff_AD_for_uiGameEnd':
  6873. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6874. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6875. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6876. break;
  6877. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6878. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6879. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6880. break;
  6881. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6882. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6883. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6884. break;
  6885. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6886. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6887. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6888. break;
  6889. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6890. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6891. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6892. break;
  6893. case 'qjff_AD_for_UIBOX_onOpenBox':
  6894. let dui11 = xGame.uiMgr.getUI(UIBox);
  6895. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6896. break;
  6897. case 'qjff_AD_for_UIAddCoin':
  6898. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6899. dui12.qjff_AD_for_UIAddCoin();
  6900. break;
  6901. case '111a':
  6902. let dui14 = xGame.uiMgr.getUI(UISign);
  6903. dui14.qjff_AD_for_uisign();
  6904. break;
  6905. case '222a':
  6906. let dui15 = xGame.uiMgr.getUI(UISign);
  6907. dui15.qjff_AD_for_uisign();
  6908. break;
  6909. case '333a':
  6910. let dui16 = xGame.uiMgr.getUI(UISign);
  6911. dui16.qjff_AD_for_uisign();
  6912. break;
  6913. default:
  6914. console.log('zh:未知的方法名字' + t);
  6915. break;
  6916. }
  6917. }
  6918. onConstructor() {
  6919. console.log('zh: UIMain onConstructor');
  6920. this.ui = ui_UIMain.createInstance();
  6921. this.contentPane = this.ui;
  6922. this.isEject = false;
  6923. this.addEvent();
  6924. this.addClickSpine();
  6925. this.settingNode = new SettingNode(this.ui.settingNode);
  6926. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6927. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6928. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6929. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6930. let curUse = DataMgr.getCurSecretary();
  6931. this.changeSecretary(curUse);
  6932. this.ui.talkNode.visible = false;
  6933. let guide = DataMgr.getSkillGuide();
  6934. if (xGame.common.isNewDay && guide == 1) {
  6935. xGame.common.isNewDay = false;
  6936. xGame.soundMgr.playSound("s_main01");
  6937. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6938. console.log("zh:播放小秘书每天语音");
  6939. }
  6940. this.onGetUserInfo();
  6941. this.ui.n83.visible = false;
  6942. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  6943. const d = LocalStorageManager.getItem(keyForLoginInfo);
  6944. let ua = d.username;
  6945. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  6946. }
  6947. this.c_btn_for_user();
  6948. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6949. }
  6950. Logout() {
  6951. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  6952. LocalStorageManager.removeItem(keyForLoginInfo);
  6953. this.freshUser();
  6954. }
  6955. }
  6956. gotoLogin() {
  6957. xGame.uiMgr.Show(UILogin);
  6958. }
  6959. gotoRegUser() {
  6960. xGame.uiMgr.Show(UIReg);
  6961. }
  6962. c_btn_for_user() {
  6963. this.ui.n_Logout.visible = false;
  6964. this.ui.n_dengLu.visible = false;
  6965. this.ui.n_zhuCe.visible = false;
  6966. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  6967. this.ui.n_Logout.visible = true;
  6968. }
  6969. else {
  6970. this.ui.n_dengLu.visible = true;
  6971. }
  6972. }
  6973. changeSecretary(curUse) {
  6974. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6975. xGame.common.secretary && xGame.common.secretary.dispose();
  6976. this.addSecretarySpine(name);
  6977. }
  6978. addSecretarySpine(name) {
  6979. let spine = new SpineMgr(name, () => {
  6980. this.playSecretaryIdle();
  6981. });
  6982. xGame.common.secretary = spine;
  6983. }
  6984. addClickSpine() {
  6985. let clickSpine = new SpineMgr("dianji", () => {
  6986. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6987. let parent = Laya.stage;
  6988. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6989. clickSpine.play(data, 0, false, parent, (spine) => {
  6990. spine.destroy(true);
  6991. });
  6992. });
  6993. });
  6994. }
  6995. addEvent() {
  6996. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6997. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6998. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6999. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7000. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7001. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7002. this.addUIClick(this.ui, this.interuptSecretary);
  7003. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7004. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7005. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7006. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7007. this.addUIClick(this.ui.signBtn, this.openSignView);
  7008. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7009. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7010. this.addUIClick(this.ui.n_Logout, this.Logout);
  7011. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7012. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7013. }
  7014. show(showFailWords) {
  7015. super.show();
  7016. this.moneyNode.ui.c1.selectedIndex = 1;
  7017. this.playSecretaryIdle();
  7018. xGame.soundMgr.playMusic("caromhall01", 0);
  7019. Laya.timer.clearAll(this);
  7020. this.playSecretaryRandomSound();
  7021. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7022. if (showFailWords) {
  7023. console.log('zh:uimain.ts ');
  7024. setTimeout(() => {
  7025. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7026. let words = -1;
  7027. if (str == "s_main02") {
  7028. words = 2;
  7029. }
  7030. else {
  7031. words = 3;
  7032. }
  7033. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7034. xGame.soundMgr.playSound(str);
  7035. }, 300);
  7036. }
  7037. this.showGuide();
  7038. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7039. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7040. let guide = DataMgr.getSkillGuide();
  7041. if (guide == 1) {
  7042. let randTime = xGame.common.randomNum(300, 800);
  7043. if (this.firstEnter) {
  7044. console.log("zh: firstEnter");
  7045. this.firstEnter = false;
  7046. randTime += 900;
  7047. }
  7048. else {
  7049. console.log("zh: no firstEnter");
  7050. }
  7051. Laya.timer.once(randTime, this, () => {
  7052. xGame.common.autoPopUIView();
  7053. });
  7054. }
  7055. }
  7056. checkActive(show) {
  7057. }
  7058. showGuide() {
  7059. let guide = DataMgr.getSkillGuide();
  7060. this.ui.guideBtn.visible = guide == 0;
  7061. this.ui.enterGuide.visible = false;
  7062. this.ui.secretaryGuide.visible = guide == 0;
  7063. if (guide == 0) {
  7064. console.log("zh:显示引导");
  7065. xGame.soundMgr.playSound("s_guide");
  7066. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7067. }
  7068. else {
  7069. console.log("zh:不需要显示引导");
  7070. }
  7071. }
  7072. ensureSecretary() {
  7073. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7074. this.ui.secretaryGuide.visible = false;
  7075. this.ui.enterGuide.visible = true;
  7076. this.ui.wordsNode.t0.play();
  7077. if (DataMgr.getNewUser())
  7078. Moyu.sendDataEvent("gameReady");
  7079. }
  7080. playSecretaryIdle() {
  7081. let parent = this.ui.secretary.displayObject;
  7082. parent.destroyChildren();
  7083. let xx = this.ui.secretary.width / 2;
  7084. let yy = this.ui.secretary.height;
  7085. let scale = xGame.common.getSecretaryScale();
  7086. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7087. console.log("zh:playSecretaryIdle", data);
  7088. xGame.common.secretary.play(data, 0, true, parent);
  7089. }
  7090. startGame(type) {
  7091. xGame.common.gameMode = type;
  7092. Moyu.sendDataEvent("PlayGame", { type: type });
  7093. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7094. switch (xGame.common.gameMode) {
  7095. case GameMode.classic:
  7096. console.log('zh:进入经典模式111111111');
  7097. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7098. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7099. console.log('zh:classic db_over_lev=', db_over_lev);
  7100. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7101. console.log('zh:判断是否可以玩该模式classic =NO');
  7102. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7103. xGame.uiMgr.Show(UIMsg, tipStr);
  7104. return;
  7105. }
  7106. else {
  7107. console.log('zh:可以玩该模式classic 66666666666666');
  7108. this.beginGame();
  7109. }
  7110. }
  7111. else {
  7112. console.log('zh:不需要判断是否可以玩该classic');
  7113. let challengeTimes = DataMgr.getChallengeTimes();
  7114. if (challengeTimes == 0) {
  7115. xGame.uiMgr.Show(UIInvitation);
  7116. }
  7117. else {
  7118. this.beginGame();
  7119. }
  7120. break;
  7121. }
  7122. case GameMode.bigMove:
  7123. console.error('zh:bigMove check');
  7124. let guide = DataMgr.getSkillGuide();
  7125. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7126. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7127. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7128. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7129. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7130. xGame.uiMgr.Show(UIMsg, tipStr);
  7131. return;
  7132. }
  7133. else {
  7134. console.log('zh:可以玩该模式 bigMove');
  7135. this.beginGame();
  7136. if (DataMgr.getNewUser())
  7137. Moyu.sendDataEvent("gameStart0");
  7138. }
  7139. }
  7140. else {
  7141. this.beginGame();
  7142. if (DataMgr.getNewUser())
  7143. Moyu.sendDataEvent("gameStart0");
  7144. }
  7145. break;
  7146. default:
  7147. console.error('zh:未知错误!!!!');
  7148. break;
  7149. }
  7150. }
  7151. beginGame(isNice = false) {
  7152. console.log('zh:beginGame ');
  7153. let guide = DataMgr.getSkillGuide();
  7154. if (guide == 1) {
  7155. console.log('zh:非新手引导,showInternAd ');
  7156. JSBridgeUtils.instance.showInternAd('beginGame');
  7157. }
  7158. else {
  7159. console.log('zh:新手引导,不显示AD ');
  7160. }
  7161. console.log('zh:beginGame 2 go');
  7162. if (xGame.common.gameMode == GameMode.classic) {
  7163. if (isNice) {
  7164. this.enterClassic();
  7165. }
  7166. else {
  7167. xGame.uiMgr.Show(UIModeSelection, () => {
  7168. console.log('zh:BBBBBBBBBBBBBBB');
  7169. this.enterClassic();
  7170. });
  7171. }
  7172. }
  7173. else if (xGame.common.gameMode == GameMode.bigMove) {
  7174. this.ui.enterGuide.visible = false;
  7175. xGame.uiMgr.Show(UISkill);
  7176. }
  7177. }
  7178. enterClassic() {
  7179. xGame.uiMgr.Show(UIGame);
  7180. xGame.uiMgr.Show(UIMatching, () => {
  7181. if (!this.isHide)
  7182. this.hide();
  7183. xGame.common.gameUI.ui.alpha = 1;
  7184. xGame.common.gameUI.startGame();
  7185. xGame.uiMgr.Hide(UIGameEnd);
  7186. });
  7187. }
  7188. startGlobal() {
  7189. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7190. }
  7191. startWeekly() {
  7192. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7193. }
  7194. zhouSaiMonth() {
  7195. console.log('zh: zhouSaiMonth 被调用');
  7196. }
  7197. startPlaceBall() {
  7198. xGame.uiMgr.Show(UILevelDisplay);
  7199. }
  7200. hide() {
  7201. console.log('zh:uimain hide ...');
  7202. super.hide();
  7203. xGame.common.stopGirlPop(this.ui.talkNode);
  7204. }
  7205. onGetUserInfo(force = false) {
  7206. if (Moyu.isWx) {
  7207. let info = Moyu.getSystemInfo();
  7208. if (info)
  7209. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7210. }
  7211. else {
  7212. Moyu.initUser(this, this.freshUser, force);
  7213. }
  7214. this.freshUser();
  7215. }
  7216. freshUser() {
  7217. let user = Moyu.getUserInfo();
  7218. if (!user.isAuth) {
  7219. user.headIcon = 'res/ty_touxiang.png';
  7220. }
  7221. else {
  7222. DataMgr.upRankData();
  7223. }
  7224. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7225. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7226. let keyStr = keyForLoginInfo;
  7227. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7228. const d = LocalStorageManager.getItem(keyStr);
  7229. let ua = d.username;
  7230. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7231. }
  7232. else {
  7233. }
  7234. this.c_btn_for_user();
  7235. }
  7236. interuptSecretary() {
  7237. Laya.timer.clearAll(this);
  7238. this.playSecretaryRandomSound();
  7239. }
  7240. playSecretaryRandomSound() {
  7241. if (this.isHide)
  7242. return;
  7243. let time = xGame.common.randomNum(45000, 60000);
  7244. Laya.timer.once(time, this, () => {
  7245. if (this.isHide)
  7246. return;
  7247. let index = xGame.common.randomNum(4, 7);
  7248. xGame.soundMgr.playSound("s_main0" + index);
  7249. let words = 1;
  7250. switch (index) {
  7251. case 4:
  7252. words = 5;
  7253. break;
  7254. case 5:
  7255. words = 3;
  7256. break;
  7257. case 6:
  7258. words = 6;
  7259. break;
  7260. case 7:
  7261. words = 7;
  7262. break;
  7263. default:
  7264. break;
  7265. }
  7266. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7267. this.playSecretaryRandomSound();
  7268. });
  7269. }
  7270. openSecretaryView() {
  7271. xGame.uiMgr.Show(UISecretary);
  7272. Moyu.sendDataEvent("secretary");
  7273. }
  7274. openShopView() {
  7275. xGame.uiMgr.Show(UIShop);
  7276. }
  7277. openSignView() {
  7278. xGame.uiMgr.Show(UISign);
  7279. }
  7280. openDrawView() {
  7281. xGame.uiMgr.Show(UIDraw);
  7282. }
  7283. openRanking() {
  7284. console.log('zh:phb openRanking');
  7285. xGame.uiMgr.Show(UIRanking);
  7286. Moyu.sendDataEvent("rankingList");
  7287. }
  7288. }
  7289. UIMain.uiName = "UIMain";
  7290. class UIGameEnd extends UIBase {
  7291. constructor() {
  7292. super();
  7293. this.success = false;
  7294. this.awardCoinNum = 1000;
  7295. this.awardDiamondNum = 10;
  7296. }
  7297. onConstructor() {
  7298. this.ui = ui_UIGameEnd.createInstance();
  7299. this.contentPane = this.ui;
  7300. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7301. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7302. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7303. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7304. this.ui.talkNode.visible = false;
  7305. if (Moyu.isKs)
  7306. this.ui.closeNode.closeBtn.x += 100;
  7307. }
  7308. updateType() {
  7309. switch (xGame.common.gameMode) {
  7310. case GameMode.classic:
  7311. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7312. this.ui.coinNode.visible = this.success;
  7313. if (!this.success) {
  7314. Laya.timer.once(500, this, () => {
  7315. xGame.uiMgr.Show(UIAddCoin);
  7316. });
  7317. }
  7318. else {
  7319. this.logEventForClassic_win();
  7320. }
  7321. this.logEventForClassic_complete();
  7322. this.ui.isGetAward.visible = false;
  7323. this.ui.leftBtn.c1.selectedIndex = 3;
  7324. this.ui.rightBtn.c1.selectedIndex = 0;
  7325. this.moneyNode.ui.c1.selectedIndex = 1;
  7326. break;
  7327. case GameMode.bigMove:
  7328. console.log('zh:招法模式 aaaaaa bigMove');
  7329. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7330. this.ui.coinNode.visible = this.success;
  7331. if (xGame.common.gameMode == GameMode.bigMove) {
  7332. if (this.success) {
  7333. DataMgr.setSkillSuccessTimes(1, true);
  7334. DataMgr.setSkillAccTimes(1);
  7335. }
  7336. else {
  7337. DataMgr.setSkillSuccessTimes(0, false);
  7338. }
  7339. }
  7340. this.logEventForRod_complete_N();
  7341. if (!this.success) {
  7342. Laya.timer.once(500, this, () => {
  7343. xGame.uiMgr.Show(UIAddCoin);
  7344. });
  7345. }
  7346. else {
  7347. this.logEventForRod_win();
  7348. }
  7349. this.ui.isGetAward.visible = false;
  7350. this.ui.leftBtn.c1.selectedIndex = 3;
  7351. this.ui.rightBtn.c1.selectedIndex = 0;
  7352. this.moneyNode.ui.c1.selectedIndex = 1;
  7353. break;
  7354. case GameMode.placeBall:
  7355. this.ui.coinNode.visible = false;
  7356. if (this.success) {
  7357. if (xGame.common.placeBallStarNum == 3) {
  7358. this.ui.c1.selectedIndex = 2;
  7359. }
  7360. else {
  7361. this.ui.c1.selectedIndex = 3;
  7362. }
  7363. let level = xGame.common.placeBallCurLevel;
  7364. if (level > 59) {
  7365. this.logEventForChallenge_level_complete(level);
  7366. }
  7367. else {
  7368. this.logEventForChallenge_level_N(level);
  7369. }
  7370. }
  7371. else {
  7372. this.ui.c1.selectedIndex = 4;
  7373. }
  7374. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7375. if (cfg.type == PlaceBallType.challenge) {
  7376. this.ui.c1.selectedIndex = 2;
  7377. }
  7378. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7379. this.updatePlaceBallBtn();
  7380. this.updatePlaceBallStarNum();
  7381. this.updatePlaceBallAwardState();
  7382. this.moneyNode.ui.c1.selectedIndex = 2;
  7383. this.moneyNode.checkPowerTime();
  7384. this.moneyNode.powerChange();
  7385. DataMgr.upRankData();
  7386. break;
  7387. default:
  7388. break;
  7389. }
  7390. }
  7391. logEventForRod_complete_N() {
  7392. let gfmsIdx = xGame.common.curPlayerSkillType;
  7393. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7394. let gfmc = 'Skyfall Shot';
  7395. if (gfmsIdx == 0) {
  7396. gfmc = 'Skyfall Shot';
  7397. }
  7398. if (gfmsIdx == 1) {
  7399. gfmc = 'Surging break';
  7400. }
  7401. if (gfmsIdx == 2) {
  7402. gfmc = 'Frost Lock';
  7403. }
  7404. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7405. console.log('zh:logEventForRod_complete_N level = ' + level);
  7406. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7407. let jsonStr = {
  7408. "count": 0,
  7409. "name": gfmc
  7410. };
  7411. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7412. const d = LocalStorageManager.getItem(keyStr);
  7413. jsonStr.count = d.count + 1;
  7414. LocalStorageManager.setItem(keyStr, jsonStr);
  7415. }
  7416. else {
  7417. LocalStorageManager.setItem(keyStr, jsonStr);
  7418. }
  7419. const d2 = LocalStorageManager.getItem(keyStr);
  7420. let count = d2.count;
  7421. console.log('zh:logEventForRod_complete_N count = ' + count);
  7422. if (count % 5 == 0) {
  7423. const reqStr = JSON.stringify(jsonStr);
  7424. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7425. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  7426. }
  7427. }
  7428. logEventForRod_win() {
  7429. console.log('zh:logEventForRod_win,胜利');
  7430. let gfmsIdx = xGame.common.curPlayerSkillType;
  7431. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  7432. let gfmc = 'Skyfall Shot';
  7433. if (gfmsIdx == 0) {
  7434. gfmc = 'Skyfall Shot';
  7435. }
  7436. if (gfmsIdx == 1) {
  7437. gfmc = 'Surging break';
  7438. }
  7439. if (gfmsIdx == 2) {
  7440. gfmc = 'Frost Lock';
  7441. }
  7442. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7443. console.log('zh:logEventForRod_win level = ' + level);
  7444. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  7445. let jsonStr = {
  7446. "count": 1,
  7447. "name": gfmc + ' Lev' + level
  7448. };
  7449. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7450. const d = LocalStorageManager.getItem(keyStr);
  7451. jsonStr.count = d.count + 1;
  7452. LocalStorageManager.setItem(keyStr, jsonStr);
  7453. }
  7454. else {
  7455. LocalStorageManager.setItem(keyStr, jsonStr);
  7456. }
  7457. const reqStr = JSON.stringify(jsonStr);
  7458. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  7459. }
  7460. logEventForClassic_win() {
  7461. console.log('zh:logEventForClassic_win,胜利');
  7462. let rtype = xGame.common.classicRoomType;
  7463. let msmc = '';
  7464. if (rtype == 1) {
  7465. msmc = 'beginner';
  7466. }
  7467. if (rtype == 2) {
  7468. msmc = 'expert';
  7469. }
  7470. if (rtype == 3) {
  7471. msmc = 'master';
  7472. }
  7473. let keyStr = 'sjmd_classic_win_' + rtype;
  7474. let jsonStr = {
  7475. "difficulty": msmc,
  7476. "classic_count": 1,
  7477. "difficulty_count": 1
  7478. };
  7479. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7480. const d = LocalStorageManager.getItem(keyStr);
  7481. jsonStr.classic_count = d.classic_count + 1;
  7482. jsonStr.difficulty_count = d.difficulty_count + 1;
  7483. LocalStorageManager.setItem(keyStr, jsonStr);
  7484. }
  7485. else {
  7486. LocalStorageManager.setItem(keyStr, jsonStr);
  7487. }
  7488. const reqStr = JSON.stringify(jsonStr);
  7489. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  7490. }
  7491. logEventForClassic_complete() {
  7492. console.log('zh:logEventForClassic_complete,胜利');
  7493. let rtype = xGame.common.classicRoomType;
  7494. let msmc = '';
  7495. if (rtype == 1) {
  7496. msmc = 'beginner';
  7497. }
  7498. if (rtype == 2) {
  7499. msmc = 'expert';
  7500. }
  7501. if (rtype == 3) {
  7502. msmc = 'master';
  7503. }
  7504. let keyStr = 'sjmd_classic_complete_' + rtype;
  7505. let jsonStr = {
  7506. "msmc": msmc,
  7507. "count": 0
  7508. };
  7509. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7510. const d = LocalStorageManager.getItem(keyStr);
  7511. jsonStr.count = d.count + 1;
  7512. LocalStorageManager.setItem(keyStr, jsonStr);
  7513. }
  7514. else {
  7515. LocalStorageManager.setItem(keyStr, jsonStr);
  7516. }
  7517. if (jsonStr.count % 5 == 0) {
  7518. const reqStr = JSON.stringify(jsonStr);
  7519. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  7520. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  7521. }
  7522. }
  7523. updatePlaceBallBtn() {
  7524. this.ui.leftBtn.c1.selectedIndex = 5;
  7525. if (this.success) {
  7526. this.ui.rightBtn.c1.selectedIndex = 14;
  7527. }
  7528. else {
  7529. if (xGame.common.placeBallStarNum == 3) {
  7530. this.ui.rightBtn.c1.selectedIndex = 14;
  7531. }
  7532. else {
  7533. this.ui.rightBtn.c1.selectedIndex = 1;
  7534. }
  7535. }
  7536. }
  7537. updatePlaceBallStarNum() {
  7538. let starNum = xGame.common.placeBallStarNum;
  7539. if (starNum == 0)
  7540. this.ui.starNumNode.c1.selectedIndex = 3;
  7541. else {
  7542. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  7543. }
  7544. }
  7545. updatePlaceBallAwardState() {
  7546. let level = xGame.common.placeBallCurLevel;
  7547. let starNum = xGame.common.placeBallStarNum;
  7548. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7549. let data = cfgTable.placeballData[level].award;
  7550. let cfg = cfgTable.placeballData[level];
  7551. this.awardDiamondNum = data[1];
  7552. this.awardCoinNum = data[0];
  7553. if (cfg.type == PlaceBallType.challenge) {
  7554. this.awardDiamondNum = 0;
  7555. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7556. }
  7557. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  7558. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  7559. if (cfg.type == PlaceBallType.challenge) {
  7560. this.ui.awardNode.coinNode.visible = true;
  7561. }
  7562. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  7563. this.ui.awardNode.diamondNode.x = 265;
  7564. this.ui.awardNode.coinNode.x = 354;
  7565. }
  7566. else {
  7567. this.ui.awardNode.diamondNode.x = 291;
  7568. this.ui.awardNode.coinNode.x = 291;
  7569. }
  7570. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  7571. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  7572. if (this.awardCoinNum == 0) {
  7573. this.ui.awardNode.coinNode.numTxt.text = "";
  7574. }
  7575. if (getAward) {
  7576. this.ui.isGetAward.visible = true;
  7577. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  7578. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  7579. }
  7580. else {
  7581. this.ui.isGetAward.visible = false;
  7582. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  7583. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  7584. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  7585. }
  7586. else {
  7587. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  7588. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  7589. }
  7590. }
  7591. }
  7592. show(success) {
  7593. super.show();
  7594. xGame.eventMgr.event(RESET_GAME);
  7595. this.success = success;
  7596. Laya.timer.clearAll(this);
  7597. this.playSecretaryAni();
  7598. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  7599. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  7600. offsetTime = Math.floor(offsetTime / 1000);
  7601. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  7602. this.updateType();
  7603. Laya.timer.once(200, this, () => {
  7604. this.addAward(() => {
  7605. this.updateType();
  7606. Laya.timer.once(500, this, () => {
  7607. this.showChallengeLevel();
  7608. });
  7609. });
  7610. });
  7611. if (this.success) {
  7612. JSBridgeUtils.instance.showInternAd('gameend_success');
  7613. console.log('zh:game end 成功');
  7614. xGame.soundMgr.playSound('slots_roll01');
  7615. xGame.soundMgr.playSound("s_win");
  7616. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7617. this.diyGameDataUtilForGameWin();
  7618. }
  7619. else {
  7620. JSBridgeUtils.instance.showInternAd('gameend_faill');
  7621. console.log('zh:game end失败');
  7622. xGame.soundMgr.playSound('matchwin01');
  7623. xGame.soundMgr.playSound("s_lose");
  7624. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7625. }
  7626. let challengeNum = DataMgr.getChallengeTimes();
  7627. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7628. DataMgr.setChallengeTimes(1);
  7629. }
  7630. if (this.success && xGame.common.gameMode == GameMode.classic) {
  7631. DataMgr.setClassicTimes();
  7632. }
  7633. }
  7634. diyGameDataUtilForGameWin() {
  7635. console.log('zh: DiyGameDataUtilForGameWin diy ');
  7636. switch (xGame.common.gameMode) {
  7637. case GameMode.classic:
  7638. console.log('zh:DiyGameDataUtilForGameWin 111');
  7639. case GameMode.bigMove:
  7640. console.log('zh:DiyGameDataUtilForGameWin 222');
  7641. this.restartGame();
  7642. break;
  7643. case GameMode.placeBall:
  7644. console.log('zh:DiyGameDataUtilForGameWin 333');
  7645. var level = xGame.common.placeBallCurLevel;
  7646. console.log('zh:练习模式 联系了多少LEV=' + level);
  7647. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7648. if (level > db_over_lev) {
  7649. DataMgr.setChallengeMode_overLev(level);
  7650. }
  7651. break;
  7652. default:
  7653. console.log('zh:DiyGameDataUtilForGameWin 444');
  7654. break;
  7655. }
  7656. }
  7657. showChallengeLevel() {
  7658. if (DataMgr.getChallengeTimes() != 0)
  7659. return;
  7660. let skill = DataMgr.getSkillAccTimes();
  7661. let put = DataMgr.getPlaceBallLevelList().length;
  7662. if (skill >= 3 || put >= 5) {
  7663. xGame.uiMgr.Show(UIInvitation);
  7664. this.hide();
  7665. }
  7666. }
  7667. addAward(callback) {
  7668. if (!this.success) {
  7669. callback && callback();
  7670. return;
  7671. }
  7672. switch (xGame.common.gameMode) {
  7673. case GameMode.classic:
  7674. this.awardCoinNum = xGame.common.passAwardCoin;
  7675. this.awardDiamondNum = 0;
  7676. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7677. break;
  7678. case GameMode.bigMove:
  7679. this.awardCoinNum = xGame.common.passAwardCoin;
  7680. this.awardDiamondNum = 0;
  7681. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7682. callback && callback();
  7683. break;
  7684. case GameMode.placeBall:
  7685. let level = xGame.common.placeBallCurLevel;
  7686. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  7687. if (xGame.common.placeBallStarNum != 3) {
  7688. callback && callback();
  7689. return;
  7690. }
  7691. else {
  7692. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7693. if (getAward) {
  7694. callback && callback();
  7695. return;
  7696. }
  7697. }
  7698. let cfg = cfgTable.placeballData[level];
  7699. let data = cfgTable.placeballData[level].award;
  7700. this.awardCoinNum = data[0];
  7701. this.awardDiamondNum = data[1];
  7702. if (cfg.type == PlaceBallType.challenge) {
  7703. this.awardDiamondNum = 0;
  7704. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7705. }
  7706. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  7707. let diamondAward;
  7708. if (this.awardDiamondNum > 0) {
  7709. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  7710. xGame.common.getAward([diamondAward, coinAward], callback);
  7711. }
  7712. else {
  7713. xGame.common.getAward([coinAward], callback);
  7714. }
  7715. if (cfg.type == PlaceBallType.normal) {
  7716. DataMgr.setPlaceBallAward(level);
  7717. }
  7718. break;
  7719. default:
  7720. break;
  7721. }
  7722. }
  7723. playSecretaryAni_old() {
  7724. let parent = this.ui.secretary.displayObject;
  7725. parent.destroyChildren();
  7726. let xx = this.ui.secretary.width / 2;
  7727. let yy = this.ui.secretary.height;
  7728. let scale = xGame.common.getSecretaryScale();
  7729. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7730. if (this.success) {
  7731. let rand = Math.random() <= 0.5 ? 2 : 3;
  7732. xGame.common.secretary.play(data, rand, false, parent, () => {
  7733. xGame.common.secretary.play(data, 1, true, parent);
  7734. });
  7735. }
  7736. else {
  7737. xGame.common.secretary.play(data, 0, true, parent);
  7738. }
  7739. }
  7740. playSecretaryAni() {
  7741. let parent = this.ui.secretary.displayObject;
  7742. parent.destroyChildren();
  7743. let xx = this.ui.secretary.width / 2;
  7744. let yy = this.ui.secretary.height;
  7745. let scale = xGame.common.getSecretaryScale();
  7746. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7747. if (this.success) {
  7748. let rand = 0;
  7749. xGame.common.secretary.play(data, 0, true, parent);
  7750. }
  7751. else {
  7752. xGame.common.secretary.play(data, 0, true, parent);
  7753. }
  7754. }
  7755. restartGame() {
  7756. switch (xGame.common.gameMode) {
  7757. case GameMode.classic:
  7758. xGame.eventMgr.event(RESTART_GAME);
  7759. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7760. break;
  7761. case GameMode.bigMove:
  7762. this.hide();
  7763. xGame.eventMgr.event(RESTART_GAME);
  7764. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7765. break;
  7766. default:
  7767. break;
  7768. }
  7769. }
  7770. hide() {
  7771. super.hide();
  7772. xGame.common.stopGirlPop(this.ui.talkNode);
  7773. PlatMgr.showBanner(false);
  7774. }
  7775. returnHome() {
  7776. this.hide();
  7777. let showFailWords = !this.success;
  7778. xGame.uiMgr.Show(UIMain, showFailWords);
  7779. }
  7780. clickLeftBtn() {
  7781. switch (xGame.common.gameMode) {
  7782. case GameMode.classic:
  7783. case GameMode.bigMove:
  7784. this.returnHome();
  7785. break;
  7786. case GameMode.placeBall:
  7787. let level = xGame.common.placeBallCurLevel;
  7788. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7789. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7790. break;
  7791. default:
  7792. break;
  7793. }
  7794. }
  7795. powerStartPlaceBallLevel(level, btn) {
  7796. if (DataMgr.powerEnough()) {
  7797. btn.touchable = false;
  7798. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7799. btn.touchable = true;
  7800. DataMgr.setPower(-1);
  7801. xGame.eventMgr.event(POWER_TIME);
  7802. this.startPlaceBallLevel(level);
  7803. this.logEventForChallenge_level_start(level);
  7804. }));
  7805. }
  7806. else {
  7807. xGame.uiMgr.Show(UIPower, 0);
  7808. }
  7809. }
  7810. clickRightBtn() {
  7811. switch (xGame.common.gameMode) {
  7812. case GameMode.classic:
  7813. console.log('zh:clickRightBtn 111');
  7814. case GameMode.bigMove:
  7815. console.log('zh:clickRightBtn 222');
  7816. this.restartGame();
  7817. break;
  7818. case GameMode.placeBall:
  7819. console.log('zh:clickRightBtn 333');
  7820. let level = xGame.common.placeBallCurLevel;
  7821. let data = DataMgr.getPlaceBallLevel(level);
  7822. let curPss = data.play && !data.isCur;
  7823. if (curPss) {
  7824. console.log('zh:clickRightBtn 333-111');
  7825. console.log('zh:当前LV=' + level);
  7826. if (level == 60) {
  7827. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7828. Laya.timer.once(3000, this, () => {
  7829. this.returnHome();
  7830. });
  7831. }
  7832. else {
  7833. let lev = level + 1;
  7834. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  7835. }
  7836. }
  7837. else {
  7838. console.log('zh:clickRightBtn 333-000');
  7839. Moyu.sendDataEvent("placeBallNextLevel");
  7840. console.log('zh:qjff_AD_for_uiGameEnd');
  7841. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7842. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7843. }
  7844. else {
  7845. console.log('zh:AD 失败,直接发放奖励');
  7846. this.qjff_AD_for_uiGameEnd(level);
  7847. }
  7848. }
  7849. break;
  7850. default:
  7851. console.log('zh:clickRightBtn 444');
  7852. break;
  7853. }
  7854. }
  7855. logEventForChallenge_level_start(level) {
  7856. let keyStr = 'sjmd_challenge_level_start';
  7857. let jsonStr = {
  7858. "count": 0,
  7859. "gold_balance ": DataMgr.getCoin(),
  7860. "level": level,
  7861. "diamond_balance ": DataMgr.getDiamond()
  7862. };
  7863. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7864. const d = LocalStorageManager.getItem(keyStr);
  7865. if (level > d.level) {
  7866. jsonStr.count = d.count + 1;
  7867. LocalStorageManager.setItem(keyStr, jsonStr);
  7868. }
  7869. else {
  7870. }
  7871. }
  7872. else {
  7873. LocalStorageManager.setItem(keyStr, jsonStr);
  7874. }
  7875. const reqStr = JSON.stringify(jsonStr);
  7876. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  7877. }
  7878. qjff_AD_for_uiGameEnd(level) {
  7879. DataMgr.setPlaceBallLevel(level, 1);
  7880. this.startPlaceBallLevel(level + 1);
  7881. }
  7882. startPlaceBallLevel(level) {
  7883. xGame.common.gameMode = GameMode.placeBall;
  7884. xGame.common.placeBallCurLevel = level;
  7885. xGame.uiMgr.Show(UIGame);
  7886. this.hide();
  7887. }
  7888. logEventForChallenge_level_complete(level) {
  7889. let keyStr = 'sjmd_challenge_level_complete';
  7890. let jsonStr = {
  7891. "count": 1,
  7892. "gold_balance ": DataMgr.getCoin(),
  7893. "level": level,
  7894. "diamond_balance ": DataMgr.getDiamond()
  7895. };
  7896. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7897. const d = LocalStorageManager.getItem(keyStr);
  7898. jsonStr.count = d.count + 1;
  7899. LocalStorageManager.setItem(keyStr, jsonStr);
  7900. }
  7901. else {
  7902. LocalStorageManager.setItem(keyStr, jsonStr);
  7903. }
  7904. const reqStr = JSON.stringify(jsonStr);
  7905. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  7906. }
  7907. logEventForChallenge_level_N(level) {
  7908. console.log('zh:logEventForChallenge_level_N ' + level);
  7909. let keyStr = 'sjmd_challenge_level_N';
  7910. if (LocalStorageManager.hasKey(keyStr)) {
  7911. let lev = LocalStorageManager.getItem(keyStr);
  7912. if (level > lev) {
  7913. LocalStorageManager.setItem(keyStr, level);
  7914. }
  7915. if ((level) % 5 == 0) {
  7916. console.log('zh:每5关上报1次');
  7917. let sjmc = 'challenge_level_' + level;
  7918. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  7919. let sjmcForFirebase = 'challenge_level_' + level;
  7920. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  7921. }
  7922. else {
  7923. console.log('zh:5 no 上报');
  7924. }
  7925. }
  7926. else {
  7927. LocalStorageManager.setItem(keyStr, level);
  7928. }
  7929. }
  7930. }
  7931. UIGameEnd.uiName = "UIGameEnd";
  7932. class ui_UIVideoShare extends fgui.GComponent {
  7933. static createInstance() {
  7934. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7935. }
  7936. onConstruct() {
  7937. this.n10 = (this.getChild("n10"));
  7938. this.myNode = (this.getChild("myNode"));
  7939. this.t0 = this.getTransition("t0");
  7940. }
  7941. }
  7942. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7943. class UIVideoShare extends UIBase {
  7944. constructor() {
  7945. super();
  7946. this.success = false;
  7947. this.awardNum = 0;
  7948. this.isShared = true;
  7949. }
  7950. onConstructor() {
  7951. this.ui = ui_UIVideoShare.createInstance();
  7952. this.contentPane = this.ui;
  7953. this.isEject = false;
  7954. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7955. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7956. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7957. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7958. }
  7959. show(success) {
  7960. super.show();
  7961. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7962. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7963. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7964. this.success = success;
  7965. let time = xGame.common.randomNum(600, 1500);
  7966. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  7967. if (success)
  7968. xGame.soundMgr.playSound("applause");
  7969. this.ui.t0.play();
  7970. this.checkShareState();
  7971. let times = DataMgr.getDailyVideoShareTimes();
  7972. this.awardNum = times == 0 ? 2000 : 200;
  7973. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  7974. }
  7975. checkShareState() {
  7976. if (PlatMgr.forceShare == 0) {
  7977. this.ui.myNode.closeBtn.visible = true;
  7978. this.ui.myNode.tipsNode.visible = false;
  7979. this.ui.myNode.closeBtn.x = 90;
  7980. this.ui.myNode.shareBtn.x = 342;
  7981. }
  7982. else if (PlatMgr.forceShare == 1) {
  7983. this.ui.myNode.closeBtn.visible = false;
  7984. this.ui.myNode.tipsNode.visible = true;
  7985. this.ui.myNode.shareBtn.x = 218;
  7986. this.isShared = true;
  7987. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7988. }
  7989. }
  7990. checkForceShare() {
  7991. this.isShared = !this.isShared;
  7992. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7993. }
  7994. videoShare() {
  7995. if (PlatMgr.forceShare == 1) {
  7996. if (this.isShared) {
  7997. this.shareGame();
  7998. }
  7999. else {
  8000. this.hideSelf();
  8001. }
  8002. }
  8003. else {
  8004. this.shareGame();
  8005. }
  8006. }
  8007. shareGame() {
  8008. Moyu.sendDataEvent("VideoShare");
  8009. if (Moyu.canShare() > 100) {
  8010. Moyu.shareGame((success) => {
  8011. if (success) {
  8012. DataMgr.setDailyVideoShareTimes(1);
  8013. DataMgr.setCoin(this.awardNum);
  8014. }
  8015. this.hideSelf();
  8016. }, this);
  8017. }
  8018. else {
  8019. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8020. this.hideSelf();
  8021. }
  8022. }
  8023. hideSelf() {
  8024. this.hide();
  8025. xGame.uiMgr.Show(UIGameEnd, this.success);
  8026. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8027. xGame.common.screenImg.destroy();
  8028. xGame.common.screenImg = null;
  8029. }
  8030. }
  8031. }
  8032. UIVideoShare.uiName = "UIVideoShare";
  8033. class ui_UITips extends fgui.GComponent {
  8034. static createInstance() {
  8035. return (fgui.UIPackage.createObject("game", "UITips"));
  8036. }
  8037. onConstruct() {
  8038. this.n0 = (this.getChild("n0"));
  8039. this.myNode = (this.getChild("myNode"));
  8040. this.t0 = this.getTransition("t0");
  8041. }
  8042. }
  8043. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8044. class UITips extends UIBase {
  8045. constructor() {
  8046. super();
  8047. this.type = 0;
  8048. }
  8049. onConstructor() {
  8050. this.ui = ui_UITips.createInstance();
  8051. this.contentPane = this.ui;
  8052. this.isEject = false;
  8053. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8054. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8055. }
  8056. show(tipsTxt, womanTxt, type) {
  8057. super.show();
  8058. this.ui.t0.play();
  8059. this.ui.myNode.tipsTxt.text = tipsTxt;
  8060. this.ui.myNode.womanTxt.text = womanTxt;
  8061. PlatMgr.showInsert(true);
  8062. this.ui.myNode.c1.selectedIndex = type;
  8063. this.type = type;
  8064. switch (this.type) {
  8065. case TipsType.exitGame:
  8066. xGame.common.gameMgr.gamePause = true;
  8067. break;
  8068. case TipsType.foul:
  8069. Laya.timer.once(200, this, () => {
  8070. xGame.common.gameMgr.gamePause = true;
  8071. });
  8072. break;
  8073. default:
  8074. break;
  8075. }
  8076. }
  8077. clickLeftBtn() {
  8078. this.hide();
  8079. xGame.common.gameMgr.gamePause = false;
  8080. switch (this.type) {
  8081. case TipsType.exitGame:
  8082. break;
  8083. case TipsType.foul:
  8084. break;
  8085. default:
  8086. break;
  8087. }
  8088. }
  8089. clickRightBtn() {
  8090. this.hide();
  8091. switch (this.type) {
  8092. case TipsType.exitGame:
  8093. xGame.eventMgr.event(RESET_GAME);
  8094. xGame.uiMgr.Show(UIMain);
  8095. Moyu.recordEnd(this, null);
  8096. xGame.common.longHelpLine = false;
  8097. break;
  8098. case TipsType.foul:
  8099. xGame.common.gameMgr.gamePause = false;
  8100. Laya.timer.clearAll(this);
  8101. break;
  8102. default:
  8103. break;
  8104. }
  8105. }
  8106. }
  8107. UITips.uiName = "UITips";
  8108. class GameMgr {
  8109. constructor() {
  8110. this.selfCamp = "";
  8111. this.selfFoulNum = 0;
  8112. this.selfBallArr = [];
  8113. this.selfTimer = 0;
  8114. this.selfScore = 0;
  8115. this.aiCamp = "";
  8116. this.aiFoulNum = 0;
  8117. this.aiBallArr = [];
  8118. this.aiTimer = 0;
  8119. this.aiScore = 0;
  8120. this.aiSkillLevelNum = 1;
  8121. this.targertScore = 0;
  8122. this.setTime = 30;
  8123. this.selfTurnRate = 0.5;
  8124. this.accTime = 0;
  8125. this.curFoul = "";
  8126. this.maxFoulTimes = 3;
  8127. this.isFirstInGame = true;
  8128. this.firstColliObj = null;
  8129. this.inHoleBalls = [];
  8130. this.blackNum = 8;
  8131. this.success = false;
  8132. this.holePosList = [];
  8133. this.posObj = {};
  8134. this._selfTurn = false;
  8135. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8136. this.ensureBallType = false;
  8137. this.isOpenBall = true;
  8138. this.finishOneShoot = true;
  8139. this.isEnd = false;
  8140. this.isChangeTurn = false;
  8141. this.isInterrupt = false;
  8142. this.aiPlayedBreakArmy = false;
  8143. this.isTouchedBall = false;
  8144. this.finishBalls = 0;
  8145. this.needBalls = 0;
  8146. this.allBallNum = 0;
  8147. this.placeBallPosData = {};
  8148. this.curHP = 0;
  8149. this.showLongView = false;
  8150. this.firstShoot = true;
  8151. this._gamePause = false;
  8152. this.trunCount = 0;
  8153. this.isBlackInHole = false;
  8154. this.isEnter = true;
  8155. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8156. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8157. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8158. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8159. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8160. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8161. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8162. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8163. }
  8164. get gamePause() {
  8165. return this._gamePause;
  8166. }
  8167. set gamePause(v) {
  8168. if (v) {
  8169. Laya.physicsTimer.pause();
  8170. }
  8171. else {
  8172. Laya.physicsTimer.resume();
  8173. }
  8174. this._gamePause = v;
  8175. }
  8176. get selfTurn() {
  8177. return this._selfTurn;
  8178. }
  8179. set selfTurn(val) {
  8180. this.trunCount++;
  8181. this._selfTurn = val;
  8182. if (val) {
  8183. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8184. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8185. }
  8186. else {
  8187. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8188. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8189. if (this.trunCount > 1)
  8190. PlatMgr.openBox();
  8191. }
  8192. }
  8193. resetGame() {
  8194. this.inHoleBalls = [];
  8195. this.isFirstInGame = true;
  8196. this.firstColliObj = null;
  8197. this.aiCamp = "";
  8198. this.selfCamp = "";
  8199. this.aiFoulNum = 0;
  8200. this.selfFoulNum = 0;
  8201. this.selfBallArr = [];
  8202. this.aiBallArr = [];
  8203. this.gamePause = false;
  8204. this.ensureBallType = false;
  8205. this.isInterrupt = false;
  8206. this.updateLeftBall();
  8207. this.clearTime();
  8208. this.aiPlayedBreakArmy = false;
  8209. this.isBlackInHole = false;
  8210. this.placeBallPosData = {};
  8211. if (xGame.common.d3World.knifeRoot) {
  8212. xGame.common.d3World.knifeRoot.destroyChildren();
  8213. }
  8214. }
  8215. gameReady() {
  8216. this.trunCount = 0;
  8217. this.firstColliObj = null;
  8218. this.isFirstInGame = true;
  8219. this.selfTurn = Math.random() <= this.selfTurnRate;
  8220. let challengeNum = DataMgr.getChallengeTimes();
  8221. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8222. this.selfTurn = true;
  8223. }
  8224. if (xGame.common.gameMode == GameMode.placeBall)
  8225. this.selfTurn = true;
  8226. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8227. this.selfTurn = true;
  8228. }
  8229. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8230. this.checkGuide();
  8231. if (xGame.common.uiRodMethod)
  8232. xGame.common.uiRodMethod.resetRod();
  8233. xGame.common.d2World.getHelpLine();
  8234. this.isOpenBall = true;
  8235. this.isTouchedBall = false;
  8236. xGame.common.aiPlayer.stopRun();
  8237. this.setTime = 30;
  8238. let ui = xGame.common.gameUI.ui;
  8239. switch (xGame.common.gameMode) {
  8240. case GameMode.classic:
  8241. xGame.common.aiPlayer.init();
  8242. this.blackNum = 8;
  8243. this.placeRootBall();
  8244. this.peoplePlay(9, 10);
  8245. ui.wordsBtn.visible = true;
  8246. ui.aiWordsBtn.visible = true;
  8247. xGame.common.talkMgr.changeAIState(true);
  8248. DataMgr.gameData.gameCount++;
  8249. DataMgr.saveGameData();
  8250. break;
  8251. case GameMode.bigMove:
  8252. this.blackNum = -1;
  8253. this.selfScore = 0;
  8254. this.aiScore = 0;
  8255. xGame.common.aiPlayer.init();
  8256. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8257. this.updateSelfScore();
  8258. this.updateAIScore();
  8259. this.updateTargetSroce();
  8260. this.placeRootBall();
  8261. this.peoplePlay(9, 10);
  8262. ui.wordsBtn.visible = true;
  8263. ui.aiWordsBtn.visible = true;
  8264. xGame.common.talkMgr.changeAIState(true);
  8265. if (DataMgr.getSkillGuide() < 1)
  8266. DataMgr.gameData.gameCount = 0;
  8267. else {
  8268. DataMgr.gameData.gameCount++;
  8269. DataMgr.saveGameData();
  8270. PlatMgr.openTry();
  8271. }
  8272. if (xGame.common.d3World.knifeRoot) {
  8273. xGame.common.d3World.knifeRoot.destroyChildren();
  8274. }
  8275. break;
  8276. case GameMode.placeBall:
  8277. this.blackNum = -1;
  8278. this.selfTurn = true;
  8279. this.setTime = 10000;
  8280. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8281. this.curHP = this.placeBallData.hp;
  8282. if (this.placeBallData.ball == -1)
  8283. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  8284. else
  8285. this.needBalls = this.placeBallData.ball;
  8286. console.log("需要的进球数目", this.needBalls);
  8287. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  8288. this.finishBalls = 0;
  8289. this.placeBallPosData = {};
  8290. this.updatePlaceBallPos();
  8291. this.updatePlaceBallState();
  8292. this.finishOneShoot = true;
  8293. xGame.common.gameUI.ui.moveNode.visible = false;
  8294. this.isOpenBall = false;
  8295. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8296. ui.wordsBtn.visible = false;
  8297. ui.aiWordsBtn.visible = false;
  8298. xGame.common.talkMgr.changeAIState(false);
  8299. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  8300. PlatMgr.openBox();
  8301. });
  8302. break;
  8303. default:
  8304. break;
  8305. }
  8306. this.showLongView = false;
  8307. xGame.common.wordsMgr.comboTimes = 1;
  8308. let guide = DataMgr.getSkillGuide();
  8309. if (guide)
  8310. xGame.eventMgr.event(WAIT_SHOOT);
  8311. xGame.common.upSkillLevel = false;
  8312. xGame.common.gameStartTime = new Date().getTime();
  8313. this.firstShoot = true;
  8314. }
  8315. checkGuide() {
  8316. let guide = DataMgr.getSkillGuide();
  8317. let gameUI = xGame.common.gameUI.ui;
  8318. gameUI.guide1.visible = false;
  8319. gameUI.guide2.visible = false;
  8320. gameUI.guide3.visible = false;
  8321. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  8322. this.selfTurn = true;
  8323. }
  8324. else {
  8325. return;
  8326. }
  8327. let oneBall = this.getOneBall();
  8328. gameUI.guide1.visible = true;
  8329. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8330. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8331. }
  8332. getOneBall() {
  8333. let arr = xGame.common.d2World.ballArr;
  8334. for (let index = 0; index < arr.length; index++) {
  8335. if (arr[index].number == 0)
  8336. continue;
  8337. return arr[index];
  8338. }
  8339. }
  8340. updateSelfScore() {
  8341. let ui = xGame.common.gameUI.ui.topNode;
  8342. ui.selfScoreTxt.text = this.selfScore + "";
  8343. }
  8344. updateAIScore() {
  8345. let ui = xGame.common.gameUI.ui.topNode;
  8346. ui.aiScoreTxt.text = this.aiScore + "";
  8347. }
  8348. updateTargetSroce() {
  8349. let ui = xGame.common.gameUI.ui.topNode;
  8350. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8351. }
  8352. updateLeftBall() {
  8353. let topUI = xGame.common.gameUI.ui.topNode;
  8354. topUI.selfBallList.numItems = this.selfBallArr.length;
  8355. topUI.aiBallList.numItems = this.aiBallArr.length;
  8356. }
  8357. ballShoot() {
  8358. this.clearTime();
  8359. this.finishOneShoot = false;
  8360. xGame.common.gameUI.ui.moveNode.visible = false;
  8361. if (xGame.common.gameUI.ui.guideNode.visible) {
  8362. xGame.common.gameUI.ui.guideNode.visible = false;
  8363. }
  8364. if (this.firstShoot) {
  8365. this.firstShoot = false;
  8366. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8367. }
  8368. }
  8369. ensureCamp(number) {
  8370. this.ensureBallType = true;
  8371. this.isOpenBall = false;
  8372. if (xGame.common.gameMode != GameMode.classic)
  8373. return;
  8374. let full = [1, 2, 3, 4, 5, 6, 7];
  8375. let flower = [9, 10, 11, 12, 13, 14, 15];
  8376. let sayWords = "";
  8377. if (this.selfTurn) {
  8378. if (number <= 7) {
  8379. this.selfCamp = ballCamp.full;
  8380. this.selfBallArr = full;
  8381. this.aiCamp = ballCamp.flower;
  8382. this.aiBallArr = flower;
  8383. sayWords = cfgTable.wordsData[3].msg;
  8384. }
  8385. else {
  8386. this.selfCamp = ballCamp.flower;
  8387. this.selfBallArr = flower;
  8388. this.aiCamp = ballCamp.full;
  8389. this.aiBallArr = full;
  8390. sayWords = cfgTable.wordsData[4].msg;
  8391. }
  8392. }
  8393. else {
  8394. if (number <= 7) {
  8395. this.selfCamp = ballCamp.flower;
  8396. this.selfBallArr = flower;
  8397. this.aiCamp = ballCamp.full;
  8398. this.aiBallArr = full;
  8399. sayWords = cfgTable.wordsData[2].msg;
  8400. }
  8401. else {
  8402. this.selfCamp = ballCamp.full;
  8403. this.selfBallArr = full;
  8404. this.aiCamp = ballCamp.flower;
  8405. this.aiBallArr = flower;
  8406. sayWords = cfgTable.wordsData[1].msg;
  8407. }
  8408. }
  8409. this.updateLeftBall();
  8410. xGame.uiMgr.Show(UIMsg, sayWords);
  8411. }
  8412. updatePlaceBallState() {
  8413. let ui = xGame.common.gameUI.ui;
  8414. switch (this.placeBallData.type) {
  8415. case PlaceBallType.normal:
  8416. let normal = ui.placeNormalNode;
  8417. normal.hpTxt.text = this.curHP + "";
  8418. this.updatePlaceBallStar(normal);
  8419. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8420. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8421. break;
  8422. case PlaceBallType.challenge:
  8423. let challenge = ui.placeChallengeNode;
  8424. challenge.hpTxt.text = "Shots:" + this.curHP;
  8425. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  8426. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8427. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  8428. break;
  8429. default:
  8430. break;
  8431. }
  8432. }
  8433. playSubHpAni() {
  8434. let ui = xGame.common.gameUI.ui;
  8435. switch (this.placeBallData.type) {
  8436. case PlaceBallType.normal:
  8437. let normal = ui.placeNormalNode;
  8438. normal.hpTxt.visible = false;
  8439. normal.starAni.c1.selectedIndex = 1;
  8440. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  8441. normal.hpTxt.visible = true;
  8442. normal.starAni.c1.selectedIndex = 0;
  8443. }));
  8444. break;
  8445. default:
  8446. break;
  8447. }
  8448. }
  8449. getEndStarNum() {
  8450. let num;
  8451. let level = xGame.common.placeBallCurLevel;
  8452. if (this.curHP == this.placeBallData.hp) {
  8453. num = 3;
  8454. }
  8455. else if (this.curHP <= 1) {
  8456. num = 1;
  8457. }
  8458. else {
  8459. num = 2;
  8460. }
  8461. if (!this.success) {
  8462. num = 0;
  8463. }
  8464. else {
  8465. DataMgr.setPlaceBallLevel(level, num);
  8466. }
  8467. let myType = cfgTable.placeballData[level].type;
  8468. if (this.success && myType == 1) {
  8469. num = 3;
  8470. }
  8471. xGame.common.placeBallStarNum = num;
  8472. }
  8473. updatePlaceBallStar(node) {
  8474. let star = 0;
  8475. if (this.curHP == this.placeBallData.hp) {
  8476. star = 3;
  8477. }
  8478. else if (this.curHP >= 2) {
  8479. star = 2;
  8480. }
  8481. else if (this.curHP == 1) {
  8482. star = 1;
  8483. }
  8484. else {
  8485. star = 0;
  8486. }
  8487. let temp;
  8488. for (let index = 1; index <= 3; index++) {
  8489. temp = node["star" + index];
  8490. temp.c1.selectedIndex = star >= index ? 1 : 0;
  8491. }
  8492. node.myProgress.value = (star / 3) * 100;
  8493. }
  8494. openRegretView(isFoul, GoalNum, challenge = false) {
  8495. let regretType = -1;
  8496. if (isFoul) {
  8497. regretType = 1;
  8498. }
  8499. else {
  8500. if (GoalNum <= 0) {
  8501. regretType = 0;
  8502. }
  8503. }
  8504. if (challenge) {
  8505. regretType = 1;
  8506. }
  8507. if (regretType != -1) {
  8508. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  8509. if (success) {
  8510. this.curHP++;
  8511. this.updatePlaceBallState();
  8512. this.setPlaceBallAllPos();
  8513. xGame.common.gameUI.ui.moveNode.visible = false;
  8514. }
  8515. else {
  8516. if (this.curHP <= 0) {
  8517. this.success = false;
  8518. this.gameEnd();
  8519. }
  8520. this.playSubHpAni();
  8521. }
  8522. this.updatePlaceBallState();
  8523. this.updatePlaceBallPos();
  8524. });
  8525. }
  8526. }
  8527. setPlaceBallAllPos() {
  8528. let allBall = xGame.common.d2World.ballArr;
  8529. let cfgArr = this.placeBallPosData;
  8530. let temp;
  8531. let obj;
  8532. for (let index = 0; index < allBall.length; index++) {
  8533. temp = allBall[index];
  8534. if (temp.destroyed)
  8535. continue;
  8536. obj = cfgArr[temp.myUNID];
  8537. if (obj && obj.src && !obj.src.destroyed) {
  8538. temp.gameObj.x = obj.posX;
  8539. temp.gameObj.y = obj.posY;
  8540. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  8541. }
  8542. }
  8543. xGame.common.d2World.getHelpLine();
  8544. }
  8545. updatePlaceBallPos() {
  8546. let arr = xGame.common.d2World.ballArr;
  8547. let temp;
  8548. for (let index = 0; index < arr.length; index++) {
  8549. temp = arr[index];
  8550. if (!this.placeBallPosData[temp.myUNID]) {
  8551. this.placeBallPosData[temp.myUNID] = {
  8552. src: temp,
  8553. posX: temp.gameObj.x,
  8554. posY: temp.gameObj.y
  8555. };
  8556. }
  8557. else {
  8558. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  8559. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  8560. }
  8561. }
  8562. let check;
  8563. for (const key in this.placeBallPosData) {
  8564. check = this.placeBallPosData[key];
  8565. if (check.src.destroyed) {
  8566. delete this.placeBallPosData[key];
  8567. }
  8568. }
  8569. }
  8570. gameRun(type) {
  8571. if (this.gamePause)
  8572. return;
  8573. this.curFoul = this.getFoulType();
  8574. if (type) {
  8575. xGame.common.d2World.d2Gan.shoot();
  8576. xGame.common.gameUI.forceCancel();
  8577. this.curFoul = type;
  8578. }
  8579. this.isEnd = false;
  8580. this.isChangeTurn = true;
  8581. if (xGame.common.gameMode == GameMode.classic) {
  8582. this.judgeClassic(this.curFoul);
  8583. this.checkClassicWords(() => {
  8584. xGame.common.destroyClassicEmotion();
  8585. if (this.isEnd) {
  8586. if (this.isBlackInHole) {
  8587. xGame.common.gameUI.ui.blackAni.visible = true;
  8588. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  8589. xGame.common.gameUI.ui.blackAni.visible = false;
  8590. this.gameEnd();
  8591. }));
  8592. }
  8593. else {
  8594. this.gameEnd();
  8595. }
  8596. }
  8597. else {
  8598. this.waitShoot();
  8599. xGame.eventMgr.event(WAIT_SHOOT);
  8600. }
  8601. });
  8602. }
  8603. else if (xGame.common.gameMode == GameMode.bigMove) {
  8604. xGame.common.aiPlayer.stopRun();
  8605. let scoreArr = this.getScore(this.curFoul);
  8606. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  8607. this.isEnd = true;
  8608. }
  8609. this.checkBigSkillWords(() => {
  8610. if (this.isEnd) {
  8611. this.gameEnd();
  8612. }
  8613. else {
  8614. this.waitShoot();
  8615. xGame.eventMgr.event(WAIT_SHOOT);
  8616. }
  8617. });
  8618. }
  8619. else if (xGame.common.gameMode == GameMode.placeBall) {
  8620. xGame.common.destroyAwardSpine();
  8621. let isFoul = this.curFoul == FoulType.rootHole;
  8622. let GoalNum = this.inHoleBalls.length;
  8623. if (this.inHoleBalls.indexOf(0) > -1)
  8624. GoalNum -= 1;
  8625. if (isFoul) {
  8626. this.placeRootBall();
  8627. }
  8628. console.log("neeballs", this.needBalls);
  8629. console.log("当前完成的goalNum", GoalNum);
  8630. this.finishBalls += GoalNum;
  8631. console.log("当前完成的finishballs", this.finishBalls);
  8632. let need = this.needBalls;
  8633. if (this.placeBallData.type == PlaceBallType.challenge) {
  8634. need += 100;
  8635. }
  8636. if (this.finishBalls >= need) {
  8637. this.success = true;
  8638. this.gameEnd();
  8639. }
  8640. else {
  8641. switch (this.placeBallData.type) {
  8642. case PlaceBallType.normal:
  8643. if (!isFoul && GoalNum > 0) {
  8644. this.updatePlaceBallPos();
  8645. this.updatePlaceBallState();
  8646. }
  8647. else {
  8648. this.curHP--;
  8649. this.openRegretView(isFoul, GoalNum);
  8650. }
  8651. this.waitShoot();
  8652. xGame.eventMgr.event(WAIT_SHOOT);
  8653. break;
  8654. case PlaceBallType.challenge:
  8655. this.curHP--;
  8656. this.updatePlaceBallState();
  8657. if (isFoul) {
  8658. this.openRegretView(isFoul, GoalNum, true);
  8659. }
  8660. else {
  8661. this.updatePlaceBallPos();
  8662. if (this.curHP <= 0) {
  8663. this.success = true;
  8664. this.gameEnd();
  8665. }
  8666. }
  8667. this.waitShoot();
  8668. xGame.eventMgr.event(WAIT_SHOOT);
  8669. break;
  8670. default:
  8671. break;
  8672. }
  8673. }
  8674. }
  8675. }
  8676. checkClassicWords(callback) {
  8677. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  8678. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  8679. let type = this.getClassicWordsType();
  8680. if (condition && type != -1) {
  8681. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  8682. xGame.soundMgr.playSound(str);
  8683. xGame.common.wordsMgr.playClassicWords(type, callback);
  8684. }
  8685. else {
  8686. Laya.timer.once(300, this, () => {
  8687. callback && callback();
  8688. });
  8689. }
  8690. }
  8691. getClassicWordsType() {
  8692. let d2world = xGame.common.d2World;
  8693. let type = -1;
  8694. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  8695. type = ClassicWordsType.perfectShow;
  8696. return type;
  8697. }
  8698. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  8699. type = ClassicWordsType.directShoot;
  8700. return type;
  8701. }
  8702. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  8703. type = ClassicWordsType.anotherShoot;
  8704. return type;
  8705. }
  8706. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  8707. type = ClassicWordsType.bigPower;
  8708. return type;
  8709. }
  8710. let minSpeed = 1;
  8711. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  8712. type = ClassicWordsType.hardShoot;
  8713. return type;
  8714. }
  8715. if (this.inHoleBalls.length > 0) {
  8716. type = ClassicWordsType.directShoot;
  8717. return type;
  8718. }
  8719. return type;
  8720. }
  8721. checkBigSkillWords(callback) {
  8722. if (this.curFoul == FoulType.timeOut) {
  8723. callback && callback();
  8724. }
  8725. else {
  8726. let playSkill = false;
  8727. if (this.selfTurn) {
  8728. playSkill = true;
  8729. }
  8730. else {
  8731. if (!this.aiPlayedBreakArmy) {
  8732. this.aiPlayedBreakArmy = true;
  8733. playSkill = true;
  8734. }
  8735. if (this.aiCurSkill != SkillType.breakArmy) {
  8736. playSkill = true;
  8737. }
  8738. }
  8739. if (xGame.common.skillMgr.playedLastSkill) {
  8740. xGame.common.skillMgr.playedLastSkill = false;
  8741. playSkill = false;
  8742. }
  8743. if (playSkill) {
  8744. xGame.common.skillMgr.runBigSkill((extraScore) => {
  8745. let selfExtra = 0;
  8746. let aiExtra = 0;
  8747. if (this.selfTurn)
  8748. selfExtra += extraScore;
  8749. else
  8750. aiExtra += extraScore;
  8751. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  8752. this.isEnd = true;
  8753. }
  8754. this.playBigSkillTimes(callback);
  8755. });
  8756. }
  8757. else {
  8758. this.playBigSkillTimes(callback);
  8759. }
  8760. }
  8761. }
  8762. playBigSkillTimes(callback) {
  8763. let length = this.inHoleBalls.length;
  8764. if (this.inHoleBalls.indexOf(0) > -1) {
  8765. length = this.inHoleBalls.length - 1;
  8766. }
  8767. if (length <= 0) {
  8768. callback && callback();
  8769. return;
  8770. }
  8771. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  8772. callback && callback();
  8773. });
  8774. }
  8775. playSkillTips() {
  8776. let levelNum = 0;
  8777. let curType;
  8778. if (this.selfTurn) {
  8779. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  8780. curType = this.selfCurSkill;
  8781. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8782. levelNum += 5;
  8783. }
  8784. }
  8785. else {
  8786. levelNum = this.aiSkillLevelNum;
  8787. curType = this.aiCurSkill;
  8788. }
  8789. let str = ``;
  8790. switch (curType) {
  8791. case SkillType.highSpace:
  8792. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8793. break;
  8794. case SkillType.breakArmy:
  8795. str = `You pocketed ${levelNum} extra balls`;
  8796. break;
  8797. case SkillType.ice:
  8798. str = `${levelNum * 2} extra balls were frozen`;
  8799. break;
  8800. case SkillType.fireworks:
  8801. str = `${levelNum} extra balls exploded `;
  8802. break;
  8803. case SkillType.GuanYu:
  8804. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8805. break;
  8806. default:
  8807. break;
  8808. }
  8809. xGame.uiMgr.Show(UIMsg, str);
  8810. }
  8811. getFoulType() {
  8812. let foulType = "";
  8813. if (this.firstColliObj == null) {
  8814. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8815. return FoulType.rootHole;
  8816. }
  8817. return FoulType.notTouch;
  8818. }
  8819. else {
  8820. if (this.selfTurn) {
  8821. if (this.selfBallArr.length > 0) {
  8822. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8823. foulType = FoulType.wrongTouch;
  8824. }
  8825. }
  8826. else {
  8827. if (this.ensureBallType) {
  8828. }
  8829. else {
  8830. if (this.firstColliObj == this.blackNum) {
  8831. foulType = FoulType.wrongTouch;
  8832. }
  8833. }
  8834. }
  8835. }
  8836. else {
  8837. if (this.aiBallArr.length > 0) {
  8838. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8839. foulType = FoulType.wrongTouch;
  8840. }
  8841. }
  8842. else {
  8843. if (this.ensureBallType) {
  8844. }
  8845. else {
  8846. if (this.firstColliObj == this.blackNum) {
  8847. foulType = FoulType.wrongTouch;
  8848. }
  8849. }
  8850. }
  8851. }
  8852. if (this.inHoleBalls.length <= 0) {
  8853. return foulType;
  8854. }
  8855. let temp;
  8856. if (this.inHoleBalls.indexOf(0) > -1) {
  8857. foulType = FoulType.rootHole;
  8858. }
  8859. else {
  8860. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8861. temp = this.inHoleBalls[index];
  8862. if (this.selfTurn) {
  8863. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8864. foulType = FoulType.wrongHole;
  8865. break;
  8866. }
  8867. }
  8868. else {
  8869. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8870. foulType = FoulType.wrongHole;
  8871. break;
  8872. }
  8873. }
  8874. }
  8875. }
  8876. let foo;
  8877. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8878. temp = this.inHoleBalls[index];
  8879. foo = this.selfBallArr.indexOf(temp);
  8880. if (foo > -1) {
  8881. this.selfBallArr.splice(foo, 1);
  8882. }
  8883. foo = this.aiBallArr.indexOf(temp);
  8884. if (foo > -1) {
  8885. this.aiBallArr.splice(foo, 1);
  8886. }
  8887. }
  8888. this.updateLeftBall();
  8889. }
  8890. return foulType;
  8891. }
  8892. judgeGameEndByBlack(arr) {
  8893. if (this.selfTurn) {
  8894. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8895. this.selfFoulNum = this.maxFoulTimes;
  8896. return true;
  8897. }
  8898. }
  8899. else {
  8900. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8901. this.aiFoulNum = this.maxFoulTimes;
  8902. return true;
  8903. }
  8904. }
  8905. }
  8906. judgeClassic(type) {
  8907. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8908. xGame.common.aiPlayer.stopRun();
  8909. if (this.judgeNormalSuccess()) {
  8910. this.isEnd = true;
  8911. return;
  8912. }
  8913. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8914. if (this.selfTurn) {
  8915. if (isFoul) {
  8916. this.selfFoulNum++;
  8917. }
  8918. if (this.selfFoulNum >= this.maxFoulTimes) {
  8919. this.success = false;
  8920. this.isEnd = true;
  8921. return;
  8922. }
  8923. }
  8924. else {
  8925. if (isFoul)
  8926. this.aiFoulNum++;
  8927. if (this.aiFoulNum >= this.maxFoulTimes) {
  8928. this.success = true;
  8929. this.isEnd = true;
  8930. return;
  8931. }
  8932. }
  8933. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8934. this.isChangeTurn = false;
  8935. }
  8936. else {
  8937. this.isInterrupt = true;
  8938. }
  8939. }
  8940. waitShoot() {
  8941. if (xGame.common.gameMode == GameMode.classic) {
  8942. switch (this.curFoul) {
  8943. case FoulType.timeOut:
  8944. case FoulType.rootHole:
  8945. this.selfTurn = !this.selfTurn;
  8946. this.peoplePlay(5, 6, true);
  8947. break;
  8948. case FoulType.notTouch:
  8949. this.selfTurn = !this.selfTurn;
  8950. this.peoplePlay(7, 7);
  8951. break;
  8952. case FoulType.wrongHole:
  8953. this.selfTurn = !this.selfTurn;
  8954. this.peoplePlay(11, 11);
  8955. break;
  8956. default:
  8957. if (this.inHoleBalls.length > 0) {
  8958. this.peoplePlay(0, 0, false, false);
  8959. }
  8960. else {
  8961. this.selfTurn = !this.selfTurn;
  8962. this.peoplePlay(7, 7);
  8963. }
  8964. break;
  8965. }
  8966. }
  8967. else if (xGame.common.gameMode == GameMode.bigMove) {
  8968. if (this.curFoul == FoulType.timeOut) {
  8969. this.selfTurn = !this.selfTurn;
  8970. this.peoplePlay(14, 15);
  8971. this.placeRootBall();
  8972. }
  8973. else {
  8974. this.selfTurn = !this.selfTurn;
  8975. if (this.curFoul == FoulType.rootHole) {
  8976. this.peoplePlay(12, 13);
  8977. this.placeRootBall();
  8978. }
  8979. else {
  8980. this.peoplePlay(0, 0, false, false);
  8981. }
  8982. }
  8983. }
  8984. else if (xGame.common.gameMode == GameMode.placeBall) {
  8985. this.finishOneShoot = true;
  8986. }
  8987. this.gameResult();
  8988. }
  8989. gameResult() {
  8990. this.firstColliObj = null;
  8991. this.inHoleBalls = [];
  8992. let curX = xGame.common.d2World.rootBall.gameObj.x;
  8993. let curY = xGame.common.d2World.rootBall.gameObj.y;
  8994. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  8995. if (xGame.common.uiRodMethod)
  8996. xGame.common.uiRodMethod.resetRod();
  8997. xGame.common.d2World.rootBall.showSelf();
  8998. this.clearIceSkill();
  8999. if (this.selfTurn) {
  9000. PlatMgr.gameInsert();
  9001. }
  9002. xGame.common.d3World.knifeRoot.destroyChildren();
  9003. if (this.selfTurn) {
  9004. xGame.common.gameUI.showHelpLineGuide();
  9005. xGame.common.gameUI.setTurnAlpha(true);
  9006. }
  9007. else {
  9008. xGame.common.gameUI.setTurnAlpha(false);
  9009. }
  9010. }
  9011. getScore(type) {
  9012. let selfAdd = 0;
  9013. let aiAdd = 0;
  9014. if (type == FoulType.timeOut) {
  9015. if (this.selfTurn)
  9016. aiAdd += 3;
  9017. else
  9018. selfAdd += 3;
  9019. }
  9020. else {
  9021. if (this.inHoleBalls.length > 0) {
  9022. if (this.selfTurn) {
  9023. if (type == FoulType.rootHole) {
  9024. aiAdd += 3;
  9025. if (this.inHoleBalls.length - 1 > 0) {
  9026. selfAdd += this.inHoleBalls.length - 1;
  9027. }
  9028. }
  9029. else {
  9030. selfAdd += this.inHoleBalls.length;
  9031. }
  9032. }
  9033. else {
  9034. if (type == FoulType.rootHole) {
  9035. selfAdd += 3;
  9036. if (this.inHoleBalls.length - 1 > 0) {
  9037. aiAdd += this.inHoleBalls.length - 1;
  9038. }
  9039. }
  9040. else {
  9041. aiAdd += this.inHoleBalls.length;
  9042. }
  9043. }
  9044. }
  9045. }
  9046. return [selfAdd, aiAdd];
  9047. }
  9048. judgeScoreEnd(selfAdd, aiAdd) {
  9049. this.selfScore += selfAdd;
  9050. this.aiScore += aiAdd;
  9051. this.updateAIScore();
  9052. this.updateSelfScore();
  9053. if (this.selfScore >= this.targertScore) {
  9054. this.success = true;
  9055. return true;
  9056. }
  9057. if (this.aiScore >= this.targertScore) {
  9058. this.success = false;
  9059. return true;
  9060. }
  9061. let ballArr = xGame.common.d2World.ballArr;
  9062. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9063. if (this.selfScore > this.aiScore) {
  9064. this.success = true;
  9065. return true;
  9066. }
  9067. else if (this.selfScore < this.aiScore) {
  9068. this.success = false;
  9069. return true;
  9070. }
  9071. else {
  9072. if (this.selfTurn) {
  9073. this.success = false;
  9074. }
  9075. else {
  9076. this.success = true;
  9077. }
  9078. return true;
  9079. }
  9080. }
  9081. }
  9082. clearIceSkill() {
  9083. let arr = xGame.common.d2World.ballArr;
  9084. let temp;
  9085. if (this.selfTurn) {
  9086. if (this.selfCurSkill == SkillType.ice) {
  9087. for (let index = 0; index < arr.length; index++) {
  9088. temp = arr[index];
  9089. if (temp.ballFunc == "ice") {
  9090. temp.setBallFunc("normal", "self");
  9091. }
  9092. }
  9093. }
  9094. }
  9095. else {
  9096. if (this.aiCurSkill == SkillType.ice) {
  9097. for (let index = 0; index < arr.length; index++) {
  9098. temp = arr[index];
  9099. if (temp.ballFunc == "ice") {
  9100. temp.setBallFunc("normal", "ai");
  9101. }
  9102. }
  9103. }
  9104. }
  9105. }
  9106. judgeNormalSuccess() {
  9107. if (this.selfTurn) {
  9108. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9109. this.success = true;
  9110. return true;
  9111. }
  9112. }
  9113. else {
  9114. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9115. this.success = false;
  9116. return true;
  9117. }
  9118. }
  9119. }
  9120. gameEnd() {
  9121. if (Moyu.isTT) {
  9122. xGame.common.screenImg = getScreenImg();
  9123. }
  9124. console.log("游戏结束", this.success);
  9125. xGame.common.aiPlayer.stopRun();
  9126. if (xGame.common.gameMode == GameMode.placeBall) {
  9127. this.getEndStarNum();
  9128. this.updatePlaceBallState();
  9129. }
  9130. this.isEnter = false;
  9131. Moyu.recordEnd(this, () => {
  9132. if (this.isEnter)
  9133. return;
  9134. this.isEnter = true;
  9135. console.log("进入录结束回调");
  9136. this.enterNext();
  9137. });
  9138. Laya.timer.once(1000, this, () => {
  9139. if (this.isEnter)
  9140. return;
  9141. this.isEnter = true;
  9142. this.enterNext();
  9143. });
  9144. xGame.common.longHelpLine = false;
  9145. }
  9146. enterNext() {
  9147. Laya.timer.clearAll(this);
  9148. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9149. xGame.uiMgr.Show(UIVideoShare, this.success);
  9150. }
  9151. else {
  9152. xGame.uiMgr.Show(UIGameEnd, this.success);
  9153. }
  9154. }
  9155. aiLeave() {
  9156. let ui = xGame.common.gameUI.ui;
  9157. ui.topNode.aiNameTxt.text = "offline";
  9158. }
  9159. aiGameEnd(suc) {
  9160. this.success = suc;
  9161. xGame.common.aiPlayer.stopRun();
  9162. if (this.success) {
  9163. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9164. Laya.timer.once(1000, this, () => {
  9165. this.clearTime();
  9166. this.gameEnd();
  9167. });
  9168. }
  9169. }
  9170. openTimer() {
  9171. let src = xGame.common.gameUI;
  9172. if (this.selfTurn) {
  9173. src.ui.topNode.selfProgress.visible = true;
  9174. src.ui.topNode.aiProgress.visible = false;
  9175. this.curTimer = src.ui.topNode.selfProgress;
  9176. }
  9177. else {
  9178. src.ui.topNode.selfProgress.visible = false;
  9179. src.ui.topNode.aiProgress.visible = true;
  9180. this.curTimer = src.ui.topNode.aiProgress;
  9181. }
  9182. this.accTime = 0;
  9183. Laya.timer.clearAll(this);
  9184. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9185. this.curTimer.value = 100;
  9186. }
  9187. updateTime(dt) {
  9188. if (this.gamePause)
  9189. return;
  9190. this.accTime += dt;
  9191. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9192. if (this.accTime >= this.setTime) {
  9193. this.clearTime();
  9194. console.log("时钟进入了gameRun");
  9195. this.gameRun(FoulType.timeOut);
  9196. }
  9197. }
  9198. clearTime() {
  9199. let src = xGame.common.gameUI;
  9200. src.ui.topNode.selfProgress.visible = false;
  9201. src.ui.topNode.aiProgress.visible = false;
  9202. Laya.timer.clearAll(this);
  9203. }
  9204. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9205. let ui = xGame.common.gameUI.ui;
  9206. let selfMsg, aiMsg;
  9207. if (sayWords) {
  9208. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9209. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9210. if (Foul) {
  9211. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9212. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9213. this.placeRootBall();
  9214. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9215. if (this.curFoul == FoulType.rootHole) {
  9216. if (!DataMgr.getRootBallFoul()) {
  9217. DataMgr.setRootBallFoul();
  9218. aiMsg = "";
  9219. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9220. let woman = "Boss, pay attention next time~";
  9221. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9222. }
  9223. }
  9224. else if (this.curFoul == FoulType.timeOut) {
  9225. if (!DataMgr.getTimeoutFoul()) {
  9226. DataMgr.setTimeoutFoul();
  9227. aiMsg = "";
  9228. let tips = "Game timeout, 3 fouls, this game failed.";
  9229. let woman = "Boss, pay attention to the timeline~";
  9230. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9231. }
  9232. }
  9233. }
  9234. }
  9235. }
  9236. if (this.selfTurn) {
  9237. if (sayWords) {
  9238. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9239. ui.selfTurn.visible = true;
  9240. ui.aiTurn.visible = false;
  9241. ui.selfTurn.t0.play();
  9242. Moyu.vibration();
  9243. });
  9244. }
  9245. }
  9246. else {
  9247. let aiNum = xGame.tools.random(1, 11);
  9248. let challengeNum = DataMgr.getChallengeTimes();
  9249. let delay = false;
  9250. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9251. aiNum = 9;
  9252. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9253. aiNum = 3;
  9254. if (challengeNum == 3) {
  9255. if (!this.showLongView) {
  9256. this.showLongView = true;
  9257. delay = true;
  9258. }
  9259. }
  9260. }
  9261. }
  9262. if (delay) {
  9263. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9264. if (success) {
  9265. xGame.common.longHelpLine = true;
  9266. xGame.common.d2World.getHelpLine();
  9267. }
  9268. else {
  9269. aiNum = 10;
  9270. }
  9271. xGame.common.aiPlayer.setAiLevel(aiNum);
  9272. if (sayWords) {
  9273. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9274. xGame.common.aiPlayer.runAI();
  9275. ui.selfTurn.visible = false;
  9276. ui.aiTurn.visible = true;
  9277. ui.aiTurn.t0.play();
  9278. });
  9279. }
  9280. else {
  9281. xGame.common.aiPlayer.runAI();
  9282. }
  9283. this.openTimer();
  9284. this.finishOneShoot = true;
  9285. if (this.selfTurn) {
  9286. ui.topNode.selfKuang.visible = true;
  9287. ui.topNode.aiKuang.visible = false;
  9288. ui.topNode.selfTips.visible = true;
  9289. ui.topNode.aiTips.visible = false;
  9290. }
  9291. else {
  9292. ui.topNode.selfKuang.visible = false;
  9293. ui.topNode.aiKuang.visible = true;
  9294. ui.topNode.selfTips.visible = false;
  9295. ui.topNode.aiTips.visible = true;
  9296. }
  9297. });
  9298. return;
  9299. }
  9300. if (xGame.common.gameMode == GameMode.classic) {
  9301. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  9302. if (cfg) {
  9303. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  9304. aiNum = aiLevel;
  9305. }
  9306. }
  9307. xGame.common.aiPlayer.setAiLevel(aiNum);
  9308. if (sayWords) {
  9309. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9310. xGame.common.aiPlayer.runAI();
  9311. ui.selfTurn.visible = false;
  9312. ui.aiTurn.visible = true;
  9313. ui.aiTurn.t0.play();
  9314. });
  9315. }
  9316. else {
  9317. xGame.common.aiPlayer.runAI();
  9318. }
  9319. }
  9320. this.openTimer();
  9321. this.finishOneShoot = true;
  9322. if (this.selfTurn) {
  9323. ui.topNode.selfKuang.visible = true;
  9324. ui.topNode.aiKuang.visible = false;
  9325. ui.topNode.selfTips.visible = true;
  9326. ui.topNode.aiTips.visible = false;
  9327. }
  9328. else {
  9329. ui.topNode.selfKuang.visible = false;
  9330. ui.topNode.aiKuang.visible = true;
  9331. ui.topNode.selfTips.visible = false;
  9332. ui.topNode.aiTips.visible = true;
  9333. }
  9334. }
  9335. placeRootBall() {
  9336. let rootBall = xGame.common.d2World.rootBall;
  9337. if (!rootBall)
  9338. return;
  9339. rootBall.gameObj.x = this.lastRootBallPos.x;
  9340. rootBall.gameObj.y = this.lastRootBallPos.y;
  9341. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9342. let moveNode = xGame.common.gameUI.ui.moveNode;
  9343. moveNode.visible = true;
  9344. moveNode.x = this.lastRootBallPos.x;
  9345. moveNode.y = this.lastRootBallPos.y;
  9346. if (!this.selfTurn) {
  9347. xGame.common.aiPlayer.resetRoot();
  9348. }
  9349. }
  9350. }
  9351. class ui_guanyuAni extends fgui.GComponent {
  9352. static createInstance() {
  9353. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9354. }
  9355. onConstruct() {
  9356. this.n0 = (this.getChild("n0"));
  9357. }
  9358. }
  9359. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9360. class UIFireworks extends UIBase {
  9361. constructor() {
  9362. super();
  9363. }
  9364. onConstructor() {
  9365. this.isEject = false;
  9366. }
  9367. show(callback) {
  9368. super.show();
  9369. }
  9370. }
  9371. UIFireworks.uiName = "UIFireworks";
  9372. class ui_UIGuanYu extends fgui.GComponent {
  9373. static createInstance() {
  9374. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9375. }
  9376. onConstruct() {
  9377. this.n2 = (this.getChild("n2"));
  9378. this.n1 = (this.getChild("n1"));
  9379. this.n3 = (this.getChild("n3"));
  9380. this.n4 = (this.getChild("n4"));
  9381. this.n5 = (this.getChild("n5"));
  9382. this.n6 = (this.getChild("n6"));
  9383. this.n8 = (this.getChild("n8"));
  9384. this.n7 = (this.getChild("n7"));
  9385. this.t0 = this.getTransition("t0");
  9386. }
  9387. }
  9388. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9389. class UIGuanYu extends UIBase {
  9390. constructor() {
  9391. super();
  9392. }
  9393. onConstructor() {
  9394. this.ui = ui_UIGuanYu.createInstance();
  9395. this.contentPane = this.ui;
  9396. this.isEject = false;
  9397. }
  9398. show(callback) {
  9399. super.show();
  9400. this.ui.t0.play(Laya.Handler.create(this, () => {
  9401. callback && callback();
  9402. this.hide();
  9403. }));
  9404. }
  9405. }
  9406. UIGuanYu.uiName = "UIGuanYu";
  9407. class SkillMgr {
  9408. constructor() {
  9409. this.leveNum = 0;
  9410. this.extraScore = 0;
  9411. this.selfTurn = false;
  9412. this.playedLastSkill = false;
  9413. this.tweenArr = [];
  9414. this._finishNum = 0;
  9415. this._curFinish = 0;
  9416. this._rootX = 0;
  9417. this._rootY = 0;
  9418. this.knifeTimes = 0;
  9419. this.knifeV2 = new Laya.Vector2();
  9420. this.knifeV3 = new Laya.Vector3();
  9421. this.rtStarX = 0;
  9422. this.rtStarY = 0;
  9423. this.addBigSkillSpine();
  9424. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9425. }
  9426. addBigSkillSpine() {
  9427. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  9428. console.log("extra2 success");
  9429. });
  9430. }
  9431. runBigSkill(callback) {
  9432. this.tweenArr = [];
  9433. this.callback = callback;
  9434. this.judgeSkill();
  9435. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  9436. let guide = DataMgr.getSkillGuide();
  9437. if (!xGame.common.gameMgr.selfTurn) {
  9438. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  9439. }
  9440. else {
  9441. if (xGame.common.temSelfLevel != 0) {
  9442. this.leveNum = xGame.common.temSelfLevel;
  9443. }
  9444. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9445. this.leveNum += 5;
  9446. }
  9447. }
  9448. if (guide == 0) {
  9449. DataMgr.setSkillGuide(1);
  9450. if (DataMgr.getNewUser()) {
  9451. Moyu.sendDataEvent("gameFirstPlay");
  9452. DataMgr.setNewUser();
  9453. }
  9454. }
  9455. this.playSpineAni(() => {
  9456. switch (this.curSkill) {
  9457. case SkillType.highSpace:
  9458. this.runHighSpace();
  9459. break;
  9460. case SkillType.breakArmy:
  9461. this.runBreakArmy();
  9462. break;
  9463. case SkillType.ice:
  9464. this.runIce();
  9465. break;
  9466. case SkillType.fireworks:
  9467. this.runFireworks();
  9468. break;
  9469. case SkillType.GuanYu:
  9470. this.runGuanYu();
  9471. break;
  9472. default:
  9473. break;
  9474. }
  9475. });
  9476. }
  9477. judgeSkill() {
  9478. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  9479. let gameMgr = xGame.common.gameMgr;
  9480. let type;
  9481. for (let index = 0; index < typeArr.length; index++) {
  9482. type = typeArr[index];
  9483. if (gameMgr.selfTurn) {
  9484. if (gameMgr.selfCurSkill == type) {
  9485. this.selfTurn = true;
  9486. this.curSkill = type;
  9487. return;
  9488. }
  9489. }
  9490. else {
  9491. if (gameMgr.aiCurSkill == type) {
  9492. this.selfTurn = false;
  9493. this.curSkill = type;
  9494. return;
  9495. }
  9496. }
  9497. }
  9498. }
  9499. playSpineAni(callback) {
  9500. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  9501. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  9502. parent.destroyChildren();
  9503. let aniIndex = 0;
  9504. let skillSpine;
  9505. switch (this.curSkill) {
  9506. case SkillType.highSpace:
  9507. aniIndex = 1;
  9508. xGame.soundMgr.playSound("skill01");
  9509. skillSpine = this.skillSpine2;
  9510. data.scaleX = 0.5;
  9511. data.scaleY = 0.5;
  9512. skillSpine.play(data, 1, false, parent, () => {
  9513. callback && callback();
  9514. });
  9515. break;
  9516. case SkillType.breakArmy:
  9517. aniIndex = 2;
  9518. xGame.soundMgr.playSound("skill02");
  9519. skillSpine = this.skillSpine2;
  9520. data.scaleX = 0.5;
  9521. data.scaleY = 0.5;
  9522. skillSpine.play(data, 2, false, parent, () => {
  9523. callback && callback();
  9524. });
  9525. break;
  9526. case SkillType.ice:
  9527. aniIndex = 0;
  9528. xGame.soundMgr.playSound("skill03");
  9529. skillSpine = this.skillSpine2;
  9530. data.scaleX = 0.5;
  9531. data.scaleY = 0.5;
  9532. skillSpine.play(data, 0, false, parent, () => {
  9533. callback && callback();
  9534. });
  9535. break;
  9536. case SkillType.fireworks:
  9537. xGame.soundMgr.playSound("skill_04_01");
  9538. xGame.soundMgr.playSound("skill04");
  9539. xGame.uiMgr.Show(UIFireworks, callback);
  9540. break;
  9541. case SkillType.GuanYu:
  9542. xGame.soundMgr.playSound("skill05_1");
  9543. xGame.soundMgr.playSound("skill05");
  9544. xGame.uiMgr.Show(UIGuanYu, callback);
  9545. break;
  9546. default:
  9547. break;
  9548. }
  9549. }
  9550. getAllBallArr() {
  9551. let arr = xGame.common.d2World.ballArr;
  9552. let outArr = [];
  9553. for (let index = 0; index < arr.length; index++) {
  9554. if (arr[index] instanceof D2RootBallSrc)
  9555. continue;
  9556. if (arr[index].ballFunc == "ice")
  9557. continue;
  9558. if (arr[index].destroyed)
  9559. continue;
  9560. outArr.push(arr[index]);
  9561. }
  9562. return outArr;
  9563. }
  9564. getOneArr(deletObj) {
  9565. let allArr = this.getAllBallArr();
  9566. let temp;
  9567. for (let index = 0; index < allArr.length; index++) {
  9568. temp = allArr[index];
  9569. if (temp.id == deletObj.id) {
  9570. allArr.splice(index, 1);
  9571. break;
  9572. }
  9573. }
  9574. return allArr;
  9575. }
  9576. getNearBallBag(ball) {
  9577. let ui = xGame.common.gameUI.ui;
  9578. let circleArr = [];
  9579. for (let index = 1; index <= 6; index++) {
  9580. circleArr.push(ui.border["circle" + index]);
  9581. }
  9582. let outIndex = 0;
  9583. let temp;
  9584. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  9585. ;
  9586. let dis = 0;
  9587. for (let index = 1; index < circleArr.length; index++) {
  9588. temp = circleArr[index];
  9589. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  9590. if (dis < min) {
  9591. min = dis;
  9592. outIndex = index;
  9593. }
  9594. }
  9595. return [circleArr[outIndex], outIndex];
  9596. }
  9597. ballFlyToBag(ballArr, time = 300) {
  9598. let temp;
  9599. let hole;
  9600. this._finishNum = ballArr.length;
  9601. this._curFinish = 0;
  9602. let holeObj = {};
  9603. let holeCfg = {
  9604. "1": 0,
  9605. "2": 0,
  9606. "3": 0,
  9607. "4": 0,
  9608. "5": 0,
  9609. "6": 0
  9610. };
  9611. for (let index = 0; index < ballArr.length; index++) {
  9612. temp = ballArr[index];
  9613. temp.outColli.isSensor = true;
  9614. temp.innerColli.isSensor = true;
  9615. temp.isRunSkillAni = true;
  9616. let holeArr = this.getNearBallBag(temp);
  9617. hole = holeArr[0];
  9618. holeObj[index] = holeArr[1];
  9619. temp.d3BallSrc.scaleXYZ = 0.5;
  9620. this.tweenArr.push(temp.d3BallSrc, temp);
  9621. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9622. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  9623. }));
  9624. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  9625. let mIndex = holeObj[this._curFinish];
  9626. let isDone = holeCfg[mIndex];
  9627. if (isDone) {
  9628. ballArr[this._curFinish].checkWrongBall(false);
  9629. }
  9630. else {
  9631. holeCfg[mIndex] = 1;
  9632. ballArr[this._curFinish].checkWrongBall();
  9633. }
  9634. this._curFinish++;
  9635. if (this._curFinish >= this._finishNum) {
  9636. if (this.curSkill == SkillType.highSpace) {
  9637. }
  9638. else if (this.curSkill == SkillType.breakArmy) {
  9639. let rootBall = xGame.common.d2World.rootBall;
  9640. rootBall.gameObj.x = this._rootX;
  9641. rootBall.gameObj.y = this._rootY;
  9642. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9643. xGame.common.d2World.d2Gan.ui.visible = true;
  9644. xGame.common.d2World.d2HelpLine.ui.visible = true;
  9645. xGame.common.d2World.getHelpLine();
  9646. this.callback && this.callback(this.extraScore);
  9647. }
  9648. }
  9649. }));
  9650. }
  9651. }
  9652. runHighSpace() {
  9653. let rootBall = xGame.common.d2World.rootBall;
  9654. rootBall.showSelf();
  9655. let d3Src = rootBall.d3BallSrc;
  9656. let allArr = this.getAllBallArr();
  9657. if (allArr.length <= 0) {
  9658. this.callback && this.callback(0);
  9659. return;
  9660. }
  9661. let selectBall = xGame.common.d2World.targetBall;
  9662. let wrong = selectBall && selectBall.destroyed;
  9663. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  9664. selectBall = xGame.common.getRandArrEle(allArr);
  9665. }
  9666. let targetD3Src = selectBall.d3BallSrc;
  9667. xGame.common.d2World.d2Gan.ui.visible = false;
  9668. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9669. d3Src.scaleXYZ = 0.5;
  9670. this.tweenArr.push(d3Src);
  9671. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9672. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9673. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  9674. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  9675. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  9676. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  9677. let outArr = [selectBall];
  9678. let other = this.leveNum - 1;
  9679. if (other > 0) {
  9680. let nearArr = this.getOneArr(selectBall);
  9681. if (nearArr.length > 0) {
  9682. xGame.common.botherArr(nearArr);
  9683. if (other >= nearArr.length)
  9684. other = nearArr.length;
  9685. for (let index = 0; index < other; index++) {
  9686. outArr.push(nearArr[index]);
  9687. }
  9688. }
  9689. }
  9690. xGame.common.extraMoveNum = other + 1;
  9691. this.extraScore = other + 1;
  9692. this._rootX = selectBall.gameObj.x;
  9693. this._rootY = selectBall.gameObj.y;
  9694. rootBall.gameObj.x = this._rootX;
  9695. rootBall.gameObj.y = this._rootY;
  9696. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9697. Laya.Tween.clearAll(d3Src);
  9698. this.addRandomForce(outArr);
  9699. }));
  9700. }));
  9701. }
  9702. addRandomForce(outArr) {
  9703. if (outArr.length > 0) {
  9704. xGame.common.d2World.openCheckStill = true;
  9705. this.playedLastSkill = true;
  9706. }
  9707. let temp;
  9708. for (let index = 0; index < outArr.length; index++) {
  9709. let angle = xGame.common.randomNum(0, 360);
  9710. let linearPercent = xGame.common.randomNum(65, 100);
  9711. temp = outArr[index];
  9712. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  9713. }
  9714. }
  9715. setLinearSpeed(angle, rigy, linearPercent) {
  9716. let sin = Math.sin(angle * Math.PI / 180);
  9717. let cos = Math.cos(angle * Math.PI / 180);
  9718. let maxSpeed = 4;
  9719. let speed = new Laya.Vector2();
  9720. speed.x = maxSpeed * linearPercent * sin;
  9721. speed.y = -maxSpeed * linearPercent * cos;
  9722. rigy.applyLinearImpulseToCenter(speed);
  9723. }
  9724. runBreakArmy() {
  9725. xGame.common.d2World.d2Gan.ui.visible = false;
  9726. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9727. let gameUI = xGame.common.gameUI.ui;
  9728. gameUI.skillRod.visible = true;
  9729. gameUI.skillRod.rotation = 110;
  9730. let outArr = this.getAllBallArr();
  9731. if (outArr.length <= 0) {
  9732. gameUI.skillRod.visible = false;
  9733. this.callback && this.callback(0);
  9734. return;
  9735. }
  9736. xGame.common.botherArr(outArr);
  9737. if (this.leveNum >= outArr.length)
  9738. this.leveNum = outArr.length;
  9739. let deleteNum = outArr.length - this.leveNum;
  9740. outArr.splice(0, deleteNum);
  9741. this.extraScore = this.leveNum;
  9742. let potX = gameUI.skillRod.x;
  9743. let potY = gameUI.skillRod.y;
  9744. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  9745. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  9746. let disArr = [];
  9747. for (let index = 0; index < outArr.length; index++) {
  9748. let obj = outArr[index];
  9749. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  9750. dis = Math.pow(dis, 0.5);
  9751. disArr.push(dis);
  9752. }
  9753. this.tweenArr.push(gameUI.skillRod);
  9754. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9755. })).update = Laya.Handler.create(this, (e, t, c) => {
  9756. let angle = gameUI.skillRod.rotation;
  9757. let xx;
  9758. let yy;
  9759. let temp;
  9760. for (let index = 0; index < outArr.length; index++) {
  9761. temp = outArr[index];
  9762. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  9763. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  9764. yy -= 20;
  9765. temp.gameObj.x = xx;
  9766. temp.gameObj.y = yy;
  9767. temp.d3BallSrc.setTransPos(xx, yy);
  9768. }
  9769. if (angle <= 60) {
  9770. Laya.Tween.clearAll(gameUI.skillRod);
  9771. this.ballFlyToBag(outArr, 150);
  9772. gameUI.skillRod.visible = false;
  9773. }
  9774. }, null, false);
  9775. }
  9776. runIce() {
  9777. let ballArr = xGame.common.d2World.ballArr;
  9778. this.leveNum *= 2;
  9779. if (this.leveNum >= ballArr.length - 1)
  9780. this.leveNum = ballArr.length - 1;
  9781. let tempArr = [];
  9782. let outArr = [];
  9783. for (let index = 0; index < ballArr.length; index++) {
  9784. if (ballArr[index] instanceof D2RootBallSrc)
  9785. continue;
  9786. tempArr.push(ballArr[index]);
  9787. }
  9788. if (tempArr.length <= 0) {
  9789. this.callback && this.callback(0);
  9790. return;
  9791. }
  9792. xGame.common.botherArr(tempArr);
  9793. for (let index = 0; index < this.leveNum; index++) {
  9794. outArr.push(tempArr[index]);
  9795. }
  9796. this.extraScore = this.leveNum;
  9797. let temp;
  9798. for (let index = 0; index < outArr.length; index++) {
  9799. temp = outArr[index];
  9800. temp.d3BallSrc.playIceEft();
  9801. }
  9802. Laya.timer.once(2000, this, () => {
  9803. for (let index = 0; index < outArr.length; index++) {
  9804. temp = outArr[index];
  9805. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9806. temp.setBallFunc("ice", str);
  9807. }
  9808. this.callback && this.callback(0);
  9809. });
  9810. }
  9811. runFireworks() {
  9812. let allArr = this.getAllBallArr();
  9813. if (allArr.length <= 0) {
  9814. this.callback && this.callback(0);
  9815. return;
  9816. }
  9817. xGame.common.d2World.d2Gan.ui.visible = false;
  9818. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9819. let outArr = [];
  9820. let other = this.leveNum;
  9821. if (other > 0) {
  9822. if (allArr.length > 0) {
  9823. xGame.common.botherArr(allArr);
  9824. if (other >= allArr.length)
  9825. other = allArr.length;
  9826. for (let index = 0; index < other; index++) {
  9827. outArr.push(allArr[index]);
  9828. }
  9829. }
  9830. }
  9831. xGame.common.extraMoveNum = other;
  9832. this.extraScore = other;
  9833. this.addRandmomFireworks(outArr);
  9834. }
  9835. addRandmomFireworks(outArr) {
  9836. Laya.timer.once(1100, this, () => {
  9837. if (outArr.length > 0) {
  9838. xGame.common.d2World.openCheckStill = true;
  9839. this.playedLastSkill = true;
  9840. }
  9841. });
  9842. xGame.soundMgr.playSound("skill_04_02");
  9843. let temp;
  9844. let delay = -200;
  9845. for (let index = 0; index < outArr.length; index++) {
  9846. temp = outArr[index];
  9847. delay += 200;
  9848. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9849. let angle = xGame.common.randomNum(0, 360);
  9850. angle = this.getFireworksAngle(obj);
  9851. let linearPercent = xGame.common.randomNum(45, 80);
  9852. if (!obj.destroyed)
  9853. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9854. });
  9855. }
  9856. }
  9857. getFireworksAngle(obj) {
  9858. let rootBall = xGame.common.d2World.rootBall;
  9859. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9860. }
  9861. resetGame() {
  9862. Laya.timer.clearAll(this);
  9863. if (this.tweenArr) {
  9864. for (let index = 0; index < this.tweenArr.length; index++) {
  9865. Laya.Tween.clearAll(this.tweenArr[index]);
  9866. }
  9867. }
  9868. this.tweenArr = null;
  9869. }
  9870. runGuanYu() {
  9871. xGame.common.d2World.d2Gan.ui.visible = false;
  9872. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9873. let rootBall = xGame.common.d2World.rootBall;
  9874. if (rootBall.isInHole) {
  9875. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9876. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9877. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9878. rootBall.showSelf();
  9879. }
  9880. this.rtStarX = rootBall.gameObj.x;
  9881. this.rtStarY = rootBall.gameObj.y;
  9882. this.knifeTimes = 0;
  9883. this.playedLastSkill = true;
  9884. rootBall.forceRun = true;
  9885. rootBall.rigy.type = "static";
  9886. xGame.common.d2World.openCheckStill = true;
  9887. this.guanyuRandomKnife();
  9888. }
  9889. guanyuRandomKnife() {
  9890. let rootBall = xGame.common.d2World.rootBall;
  9891. let dir = this.getRandDir();
  9892. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9893. console.log("当前angle", angle);
  9894. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9895. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9896. let dis = 324;
  9897. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9898. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9899. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9900. this.rtStarX = rootBall.gameObj.x;
  9901. this.rtStarY = rootBall.gameObj.y;
  9902. this.knifeTimes++;
  9903. let skillLevel;
  9904. if (xGame.common.gameMgr.selfTurn) {
  9905. skillLevel = DataMgr.getBigSkillByIndex(4);
  9906. }
  9907. else {
  9908. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9909. }
  9910. if (!skillLevel)
  9911. skillLevel = 1;
  9912. skillLevel += 2;
  9913. if (this.knifeTimes < skillLevel) {
  9914. Laya.timer.once(400, this, () => {
  9915. this.guanyuRandomKnife();
  9916. });
  9917. }
  9918. else {
  9919. rootBall.forceRun = false;
  9920. rootBall.rigy.type = "dynamic";
  9921. xGame.common.extraMoveNum = skillLevel;
  9922. }
  9923. }));
  9924. }
  9925. getRandDir() {
  9926. let rootBall = xGame.common.d2World.rootBall;
  9927. let allBall = this.getAllBallArr();
  9928. let target = xGame.common.getRandArrEle(allBall);
  9929. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9930. return this.knifeV2;
  9931. }
  9932. cloneKnife(x, y, rotation) {
  9933. let parent = xGame.common.d3World.knifeRoot;
  9934. let prefab = xGame.common.d3World.knife;
  9935. let clone = prefab.clone();
  9936. parent.addChild(clone);
  9937. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9938. clone.transform.localPositionX = this.knifeV3.x;
  9939. clone.transform.localPositionY = 0;
  9940. clone.transform.localPositionZ = this.knifeV3.z;
  9941. clone.transform.localRotationEulerX = 0;
  9942. clone.transform.localRotationEulerY = rotation;
  9943. clone.transform.localRotationEulerZ = 0;
  9944. clone.active = true;
  9945. return clone;
  9946. }
  9947. cloneGuanYuEft(x, y, angle) {
  9948. return;
  9949. let parent = xGame.common.gameUI.ui.guanyuNode;
  9950. let eft = new ui_guanyuAni();
  9951. eft.parent = parent;
  9952. eft.x = x;
  9953. eft.y = y;
  9954. eft.rotation = angle;
  9955. }
  9956. }
  9957. class ui_UIWordsList extends fgui.GComponent {
  9958. static createInstance() {
  9959. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9960. }
  9961. onConstruct() {
  9962. this.c1 = this.getController("c1");
  9963. this.n74 = (this.getChild("n74"));
  9964. this.clickNode = (this.getChild("clickNode"));
  9965. this.myNode = (this.getChild("myNode"));
  9966. this.n68 = (this.getChild("n68"));
  9967. this.n66 = (this.getChild("n66"));
  9968. this.n55 = (this.getChild("n55"));
  9969. this.wordsBtn = (this.getChild("wordsBtn"));
  9970. this.emotionBtn = (this.getChild("emotionBtn"));
  9971. this.mybggg = (this.getChild("mybggg"));
  9972. this.wordsList = (this.getChild("wordsList"));
  9973. this.emotionList = (this.getChild("emotionList"));
  9974. this.myRoot = (this.getChild("myRoot"));
  9975. }
  9976. }
  9977. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  9978. class EmotionDisplay {
  9979. constructor(index, ui) {
  9980. this.ui = ui;
  9981. this.index = index;
  9982. this.ui.onClick(this, this.clickSelf);
  9983. this.updateSelf();
  9984. }
  9985. updateSelf() {
  9986. let data = cfgTable.emotionData[this.index + 1];
  9987. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  9988. }
  9989. clickSelf() {
  9990. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9991. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  9992. xGame.common.talkMgr.closeTalkView();
  9993. }
  9994. }
  9995. class WordsDisplay {
  9996. constructor(index, ui) {
  9997. this.ui = ui;
  9998. this.index = index;
  9999. this.ui.onClick(this, this.clickSelf);
  10000. this.updateSelf();
  10001. }
  10002. updateSelf() {
  10003. let data = cfgTable.talkwordsData[this.index + 1];
  10004. this.ui.txt.text = data.msg;
  10005. }
  10006. clickSelf() {
  10007. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10008. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10009. xGame.common.talkMgr.closeTalkView();
  10010. }
  10011. }
  10012. class UIWordsList extends UIBase {
  10013. constructor() {
  10014. super();
  10015. }
  10016. onConstructor() {
  10017. this.ui = ui_UIWordsList.createInstance();
  10018. this.contentPane = this.ui;
  10019. this.isEject = false;
  10020. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10021. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10022. this.addUIClick(this.ui.clickNode, this.hide);
  10023. this.initTalkList();
  10024. this.initEmotionList();
  10025. }
  10026. show() {
  10027. super.show();
  10028. }
  10029. initTalkList() {
  10030. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10031. let data = cfgTable.talkwordsData;
  10032. let length = Object.keys(data).length;
  10033. this.ui.wordsList.numItems = length;
  10034. }
  10035. initEmotionList() {
  10036. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10037. let data = cfgTable.emotionData;
  10038. let length = Object.keys(data).length;
  10039. this.ui.emotionList.numItems = length;
  10040. }
  10041. renderTalkItem(index, obj) {
  10042. let temp = new WordsDisplay(index, obj);
  10043. }
  10044. renderEmotionItem(index, obj) {
  10045. let temp = new EmotionDisplay(index, obj);
  10046. }
  10047. openTalkList() {
  10048. this.ui.c1.selectedIndex = 0;
  10049. }
  10050. openEmotionList() {
  10051. this.ui.c1.selectedIndex = 1;
  10052. }
  10053. }
  10054. UIWordsList.uiName = "UIWordsList";
  10055. class TalkMgr {
  10056. constructor() {
  10057. this.aiSpeak = true;
  10058. this.emotionList = [];
  10059. this.talkList = [];
  10060. this.addEvent();
  10061. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10062. this.emotionList = [];
  10063. this.talkList = [];
  10064. for (let k in cfgTable.emotionData) {
  10065. this.emotionList.push(cfgTable.emotionData[k].id);
  10066. }
  10067. for (let k in cfgTable.talkwordsData) {
  10068. this.talkList.push(cfgTable.talkwordsData[k].id);
  10069. }
  10070. }
  10071. addEvent() {
  10072. let ui = xGame.common.gameUI.ui;
  10073. ui.wordsBtn.visible = true;
  10074. ui.wordsBtn.onClick(this, this.openTalkView);
  10075. ui.aiWordsBtn.visible = true;
  10076. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10077. }
  10078. openTalkView() {
  10079. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10080. xGame.uiMgr.Show(UIWordsList);
  10081. }
  10082. closeTalkView() {
  10083. xGame.uiMgr.Hide(UIWordsList);
  10084. }
  10085. clickAIState() {
  10086. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10087. this.aiSpeak = !this.aiSpeak;
  10088. this.changeAIState(this.aiSpeak);
  10089. }
  10090. changeAIState(speak) {
  10091. this.aiSpeak = speak;
  10092. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10093. if (speak) {
  10094. btn.c1.selectedIndex = 0;
  10095. }
  10096. else {
  10097. btn.c1.selectedIndex = 1;
  10098. }
  10099. }
  10100. showSelfTalk(wordsId) {
  10101. let ui = xGame.common.gameUI.ui;
  10102. ui.selfTalk.visible = true;
  10103. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10104. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10105. ui.selfTalk.t0.play();
  10106. }
  10107. showSelfEmotion(emotionId) {
  10108. let ui = xGame.common.gameUI.ui;
  10109. ui.selfTalk.visible = true;
  10110. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10111. this.selfSpine && this.selfSpine.dispose();
  10112. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10113. let spineData = cfgTable.emotionData[emotionId].spine;
  10114. this.selfSpine = new SpineMgr(spineData, () => {
  10115. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10116. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10117. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10118. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10119. });
  10120. ui.selfTalk.t0.play();
  10121. }
  10122. showAITalk(wordsId) {
  10123. if (!this.aiSpeak)
  10124. return;
  10125. if (DataMgr.gameData.gameCount < 2)
  10126. return;
  10127. if (wordsId < 1)
  10128. wordsId = this.getRandTalk();
  10129. let ui = xGame.common.gameUI.ui;
  10130. ui.aiTalk.visible = true;
  10131. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10132. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10133. ui.aiTalk.t0.play();
  10134. }
  10135. getRandTalk() {
  10136. let rand = xGame.tools.random(0, this.talkList.length);
  10137. return this.emotionList[rand];
  10138. }
  10139. getRandEmotion() {
  10140. let rand = xGame.tools.random(0, this.emotionList.length);
  10141. return this.emotionList[rand];
  10142. }
  10143. showAIEmotion(emotionId) {
  10144. if (!this.aiSpeak)
  10145. return;
  10146. if (DataMgr.gameData.gameCount < 2)
  10147. return;
  10148. if (emotionId < 1)
  10149. emotionId = this.getRandEmotion();
  10150. let ui = xGame.common.gameUI.ui;
  10151. ui.aiTalk.visible = true;
  10152. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10153. this.aiSpine && this.aiSpine.dispose();
  10154. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10155. let spineData = cfgTable.emotionData[emotionId].spine;
  10156. this.aiSpine = new SpineMgr(spineData, () => {
  10157. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10158. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10159. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10160. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10161. });
  10162. ui.aiTalk.t0.play();
  10163. }
  10164. resetGame() {
  10165. let ui = xGame.common.gameUI.ui;
  10166. ui.aiTalk.visible = false;
  10167. ui.selfTalk.visible = false;
  10168. this.aiSpine && this.aiSpine.dispose();
  10169. this.selfSpine && this.selfSpine.dispose();
  10170. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10171. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10172. this.closeTalkView();
  10173. }
  10174. }
  10175. class WordsMgr {
  10176. constructor() {
  10177. this.comboTimes = 1;
  10178. this.skillTimes = 0;
  10179. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10180. this.comboSpine = new SpineMgr("yxz_liangan");
  10181. this.skillSpine = new SpineMgr("yiganxqiu");
  10182. this.scoreSpine = new SpineMgr("defen");
  10183. }
  10184. setClassicCombo(isInterrupt) {
  10185. if (isInterrupt) {
  10186. this.comboTimes = 0;
  10187. }
  10188. }
  10189. playClassicWords(type, callback) {
  10190. this.callback = callback;
  10191. let aniIndex = type;
  10192. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10193. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10194. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10195. mySpine.destroy(true);
  10196. this.playClassicTimes();
  10197. });
  10198. }
  10199. playClassicTimes() {
  10200. this.comboTimes++;
  10201. if (this.comboTimes <= 1) {
  10202. this.callback && this.callback();
  10203. }
  10204. else {
  10205. let aniIndex = this.comboTimes - 1;
  10206. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10207. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10208. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10209. mySpine.destroy(true);
  10210. this.callback && this.callback();
  10211. });
  10212. }
  10213. }
  10214. playBigSkillTimes(times, callback) {
  10215. if (times <= 0) {
  10216. callback && callback();
  10217. return;
  10218. }
  10219. this.callback = callback;
  10220. let pre = "sz_0";
  10221. let aniIndex = 0;
  10222. this.getWordsImg(times, pre, () => {
  10223. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10224. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10225. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10226. let r1 = ``;
  10227. let r2 = ``;
  10228. if (times <= 9) {
  10229. r1 = `res/d2Res/${pre}${times}.png`;
  10230. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10231. aniIndex = 0;
  10232. }
  10233. else {
  10234. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10235. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10236. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10237. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10238. aniIndex = 1;
  10239. }
  10240. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10241. mySpine.destroy(true);
  10242. xGame.common.gameMgr.playSkillTips();
  10243. this.playScore(times);
  10244. xGame.common.playRandomMutiBallBigSkillSound();
  10245. }, mySpine);
  10246. });
  10247. }
  10248. playScore(score) {
  10249. let pre = "sz_";
  10250. let aniIndex = 0;
  10251. this.getWordsImg(score, pre, () => {
  10252. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10253. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10254. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10255. let r1 = ``;
  10256. let r2 = ``;
  10257. if (score <= 9) {
  10258. r1 = `res/d2Res/${pre}${score}.png`;
  10259. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10260. aniIndex = 0;
  10261. }
  10262. else {
  10263. r1 = `res/d2Res/${pre}${score % 10}.png`;
  10264. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  10265. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10266. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  10267. aniIndex = 1;
  10268. }
  10269. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  10270. mySpine.destroy(true);
  10271. this.callback && this.callback();
  10272. }, mySpine);
  10273. });
  10274. }
  10275. getWordsImg(number, pre = "", callback) {
  10276. let arr = [];
  10277. if (number <= 9) {
  10278. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  10279. }
  10280. else {
  10281. 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 });
  10282. }
  10283. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  10284. callback && callback();
  10285. }));
  10286. }
  10287. }
  10288. class ui_UIRodMethod extends fgui.GComponent {
  10289. static createInstance() {
  10290. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  10291. }
  10292. onConstruct() {
  10293. this.n24 = (this.getChild("n24"));
  10294. this.white = (this.getChild("white"));
  10295. this.dot = (this.getChild("dot"));
  10296. this.sureBtn = (this.getChild("sureBtn"));
  10297. this.n20 = (this.getChild("n20"));
  10298. this.n21 = (this.getChild("n21"));
  10299. this.n22 = (this.getChild("n22"));
  10300. this.n23 = (this.getChild("n23"));
  10301. this.n5 = (this.getChild("n5"));
  10302. this.n14 = (this.getChild("n14"));
  10303. this.t0 = this.getTransition("t0");
  10304. }
  10305. }
  10306. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  10307. class UIRodMethod extends UIBase {
  10308. constructor() {
  10309. super();
  10310. this.isPressd = false;
  10311. }
  10312. onConstructor() {
  10313. this.ui = ui_UIRodMethod.createInstance();
  10314. this.contentPane = this.ui;
  10315. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  10316. this.moveDir = new Laya.Vector2();
  10317. this.moveDest = new Laya.Vector2();
  10318. this.centerPos = new Laya.Vector2();
  10319. xGame.common.uiRodMethod = this;
  10320. }
  10321. show() {
  10322. super.show();
  10323. xGame.common.gameMgr.gamePause = true;
  10324. this.openPressDotEvent();
  10325. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10326. this.centerPos.x = this.ui.white.x;
  10327. this.centerPos.y = this.ui.white.y;
  10328. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10329. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10330. this.setDot();
  10331. }
  10332. setDot() {
  10333. this.ui.dot.x = this.moveDest.x;
  10334. this.ui.dot.y = this.moveDest.y;
  10335. }
  10336. closeSelf() {
  10337. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10338. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10339. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10340. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10341. xGame.common.gameMgr.gamePause = false;
  10342. this.hide();
  10343. }
  10344. openPressDotEvent() {
  10345. this.closePressDotEvent();
  10346. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10347. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10348. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10349. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10350. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10351. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10352. }
  10353. closePressDotEvent() {
  10354. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10355. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10356. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10357. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10358. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10359. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10360. }
  10361. onDown(e) {
  10362. if (e.type == Laya.Event.MOUSE_DOWN)
  10363. this.isPressd = true;
  10364. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10365. this.isPressd = false;
  10366. if (!this.isPressd)
  10367. return;
  10368. this.moveDest.x = e.stageX;
  10369. this.moveDest.y = e.stageY;
  10370. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10371. if (dis > 6724) {
  10372. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10373. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10374. }
  10375. this.setDot();
  10376. }
  10377. resetRod() {
  10378. this.ui.dot.x = this.ui.white.x;
  10379. this.ui.dot.y = this.ui.white.y;
  10380. this.gameRod.dot.x = this.gameRod.bg.x;
  10381. this.gameRod.dot.y = this.gameRod.bg.y;
  10382. xGame.common.rodOffest.x = 0;
  10383. xGame.common.rodOffest.y = 0;
  10384. }
  10385. }
  10386. UIRodMethod.uiName = "UIRodMethod";
  10387. class UIGame extends UIBase {
  10388. constructor() {
  10389. super();
  10390. this.powerNum = 0;
  10391. this.isD3Inited = false;
  10392. this.isPrePlay = false;
  10393. this.isMoveRod = false;
  10394. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10395. this.rulerDis = 20;
  10396. this.rulerOffset = 0;
  10397. }
  10398. onConstructor() {
  10399. this.ui = ui_UIGame.createInstance();
  10400. this.contentPane = this.ui;
  10401. this.ui.x += xGame.common.sysOffestNum;
  10402. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10403. this.isEject = false;
  10404. xGame.common.gameUI = this;
  10405. this.initSelf();
  10406. }
  10407. isTurnSelf() {
  10408. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10409. return true;
  10410. }
  10411. }
  10412. initSelf() {
  10413. let topUI = this.ui.topNode;
  10414. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10415. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10416. this.barInfo = {};
  10417. this.barInfo.curY = 0;
  10418. this.barInfo.height = this.ui.powerNode.height;
  10419. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10420. this.barInfo.powerStartY = this.ui.powerNode.y;
  10421. xGame.common.aiPlayer = new AIPlayer();
  10422. xGame.common.gameMgr = new GameMgr();
  10423. xGame.common.skillMgr = new SkillMgr();
  10424. xGame.common.wordsMgr = new WordsMgr();
  10425. xGame.common.talkMgr = new TalkMgr();
  10426. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  10427. console.log("加载经典模式表情文件chenggon !");
  10428. });
  10429. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  10430. console.log("挑战模式奖励模式spine加载成功!");
  10431. });
  10432. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  10433. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10434. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  10435. this.addUIClick(this.ui.returnBtn, this.returnHome);
  10436. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  10437. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  10438. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  10439. }
  10440. getGanZiImg() {
  10441. let index = DataMgr.getCurBallRod();
  10442. let data = cfgTable.ballrodData[index + 1];
  10443. let gan_url = xGame.common.getGameIconUrl(data.img);
  10444. console.log('zh:getGanZiImg gan_url==' + gan_url);
  10445. this.ui.powerNode.showImg.url = gan_url;
  10446. console.log('zh:修改杆子图标O K');
  10447. }
  10448. returnHome() {
  10449. let tips = "Are you sure to exit the game?";
  10450. let woman = "Boss, why don't you play for a while longer?";
  10451. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  10452. }
  10453. addRodMethodClick() {
  10454. if (this.isTurnSelf()) {
  10455. xGame.uiMgr.Show(UIRodMethod);
  10456. }
  10457. }
  10458. clickHelpLineBtn(force = false) {
  10459. if (!this.isTurnSelf())
  10460. return;
  10461. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10462. if (success) {
  10463. xGame.common.longHelpLine = true;
  10464. xGame.common.d2World.getHelpLine();
  10465. Moyu.sendDataEvent("guideNum");
  10466. }
  10467. else {
  10468. }
  10469. });
  10470. }
  10471. renderSelfDisplayBalls(index, target) {
  10472. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  10473. target.myImg.url = xGame.common.getGameIconUrl(str);
  10474. }
  10475. renderAIDisplayBalls(index, target) {
  10476. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  10477. target.myImg.url = xGame.common.getGameIconUrl(str);
  10478. ;
  10479. }
  10480. updateMode() {
  10481. if (xGame.common.gameMode == GameMode.classic) {
  10482. this.ui.topNode.scoreNode.visible = false;
  10483. }
  10484. else if (xGame.common.gameMode == GameMode.bigMove) {
  10485. this.ui.topNode.scoreNode.visible = true;
  10486. }
  10487. }
  10488. show() {
  10489. super.show();
  10490. console.log("zh:uigame show AADD");
  10491. this.ui.alpha = 0;
  10492. this.updateSelf();
  10493. xGame.common.gameMgr.gamePause = false;
  10494. xGame.common.gameUI.ui.blackAni.visible = false;
  10495. xGame.common.gameUI.ui.whiteAni.visible = false;
  10496. this.ui.powerEft.visible = false;
  10497. this.ui.colorNode.visible = false;
  10498. this.updateHead();
  10499. let curUse = DataMgr.getCurBallRod();
  10500. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  10501. this.getGanZiImg();
  10502. }
  10503. updateSelf() {
  10504. if (xGame.common.gameMode == GameMode.classic) {
  10505. this.ui.c1.selectedIndex = 0;
  10506. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  10507. this.ui.topNode.middleNode.visible = true;
  10508. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  10509. }
  10510. else if (xGame.common.gameMode == GameMode.bigMove) {
  10511. this.ui.c1.selectedIndex = 0;
  10512. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  10513. this.ui.topNode.middleNode.visible = false;
  10514. let max = xGame.cfgMgr.getMaxBigMoveLength();
  10515. let rand = xGame.common.randomNum(1, max);
  10516. let guide = DataMgr.getSkillGuide();
  10517. if (guide == 0)
  10518. rand = 1;
  10519. xGame.common.bigMoveLevelIndex = rand;
  10520. }
  10521. else if (xGame.common.gameMode == GameMode.placeBall) {
  10522. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  10523. this.ui.c1.selectedIndex = 1 + data.type;
  10524. this.ui.alpha = 1;
  10525. this.startGame();
  10526. }
  10527. this.updateMode();
  10528. this.initD3world();
  10529. this.initD2world();
  10530. }
  10531. startGame() {
  10532. this.ui.snowNode.visible = Math.random() <= 0.1;
  10533. this.ui.d2Node.visible = false;
  10534. xGame.common.d3World.d3Hand.gameObj.active = false;
  10535. xGame.common.d3World.tableSrc.init();
  10536. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10537. this.cameraViewChange(() => {
  10538. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  10539. switch (xGame.common.gameMode) {
  10540. case GameMode.classic:
  10541. xGame.common.d3World.d3Hand.gameObj.active = true;
  10542. this.playPutBallD3Ani();
  10543. break;
  10544. case GameMode.bigMove:
  10545. this.enterGame();
  10546. Laya.timer.once(500, this, () => {
  10547. this.ui.topNode.middleNode.visible = true;
  10548. this.ui.topNode.middleNode.t0.play();
  10549. });
  10550. break;
  10551. case GameMode.placeBall:
  10552. this.enterGame();
  10553. break;
  10554. default:
  10555. break;
  10556. }
  10557. });
  10558. PlatMgr.showBanner(false);
  10559. }
  10560. enterGame() {
  10561. this.ui.d2Node.visible = true;
  10562. xGame.common.d3World.d3Hand.gameObj.active = false;
  10563. xGame.common.showOneCamera("mainCamera");
  10564. Moyu.recordGame(30, true);
  10565. if (!this.isPrePlay) {
  10566. this.isPrePlay = true;
  10567. xGame.common.d3World.prePlayEft();
  10568. }
  10569. xGame.common.gameMgr.gameReady();
  10570. this.openAllEvent();
  10571. this.ui.snowNode.visible = false;
  10572. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  10573. this.ui.helpBtn.visible = condition;
  10574. }
  10575. showHelpLineGuide() {
  10576. let longGuide = DataMgr.getGuideHelpLine();
  10577. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  10578. this.ui.helpBtn.visible = true;
  10579. this.ui.guideNode.visible = true;
  10580. }
  10581. }
  10582. setTurnAlpha(alpha) {
  10583. this.ui.keduNode.alpha = alpha;
  10584. this.ui.ganNode.alpha = alpha;
  10585. this.ui.rodMethodNode.alpha = alpha;
  10586. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  10587. }
  10588. cameraViewChange(callback) {
  10589. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10590. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  10591. xGame.common.showOneCamera("visitAngle");
  10592. cameraSrc.localRotationEulerY = 180;
  10593. cameraSrc.localRotationEulerZ = 0;
  10594. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  10595. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  10596. callback && callback();
  10597. }));
  10598. }));
  10599. }
  10600. playPutBallD3Ani() {
  10601. xGame.common.showOneCamera("mainCamera");
  10602. let handSrc = xGame.common.d3World.d3Hand;
  10603. handSrc.gameObj.active = true;
  10604. handSrc.transform.localPositionZ = 3;
  10605. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10606. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  10607. handSrc.gameObj.active = false;
  10608. this.enterGame();
  10609. }), 400);
  10610. }));
  10611. }
  10612. updateHead() {
  10613. let user = Moyu.getUserInfo();
  10614. this.ui.topNode.selfNameTxt.text = user.nickName;
  10615. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  10616. let aiData = xGame.cfgMgr.getRandomUserInfo();
  10617. if (DataMgr.getSkillGuide() < 1) {
  10618. this.ui.topNode.aiNameTxt.text = 'billiards';
  10619. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  10620. }
  10621. else {
  10622. this.ui.topNode.aiNameTxt.text = aiData.name;
  10623. let randNo = Math.floor(Math.random() * 10) + 1;
  10624. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  10625. }
  10626. }
  10627. initD2world() {
  10628. let node = this.ui.d2Root.displayObject;
  10629. let src = node.getComponent(D2World);
  10630. if (!src) {
  10631. xGame.common.d2World = node.addComponent(D2World);
  10632. }
  10633. xGame.common.d2World.initSelf();
  10634. }
  10635. initD3world() {
  10636. if (this.isD3Inited)
  10637. return;
  10638. this.isD3Inited = true;
  10639. let scene3D = xGame.common.d3Scene;
  10640. this.ui.d3Root.displayObject.addChild(scene3D);
  10641. scene3D.active = true;
  10642. xGame.common.d3World.tableSrc.setBorderPos();
  10643. }
  10644. onRootMove(e) {
  10645. let rootBall = xGame.common.d2World.rootBall;
  10646. this.ui.moveNode.x = e.x;
  10647. this.ui.moveNode.y = e.y;
  10648. rootBall.gameObj.x = e.x;
  10649. rootBall.gameObj.y = e.y;
  10650. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  10651. }
  10652. aiRootMove(move) {
  10653. if (move)
  10654. this.hideBallUI();
  10655. else {
  10656. this.showBallUI();
  10657. xGame.common.d2World.getHelpLine();
  10658. }
  10659. }
  10660. aiForce(type, force = 0) {
  10661. this.pressTarget = PressType.powerNode;
  10662. if (type == 1)
  10663. this.onEventUp({ force: true });
  10664. else if (type == 2)
  10665. this.onEventMove({ stageY: force, force: true });
  10666. }
  10667. onEventPress(e) {
  10668. if (e.stopPropagation)
  10669. e.stopPropagation();
  10670. if (!this.isTurnSelf())
  10671. return;
  10672. let target = e.target;
  10673. switch (target) {
  10674. case this.ui.myPowerNode.displayObject:
  10675. this.pressTarget = PressType.powerNode;
  10676. this.barInfo.curY = e.stageY;
  10677. this.updateBarInfo();
  10678. break;
  10679. case this.ui.moveNode.displayObject:
  10680. this.pressTarget = PressType.moveNode;
  10681. this.hideBallUI();
  10682. this.eventObj.curX = this.ui.moveNode.x;
  10683. this.eventObj.curY = this.ui.moveNode.y;
  10684. this.ui.moveNode.finger.visible = false;
  10685. this.eventObj.lastX = e.stageX;
  10686. this.eventObj.lastY = e.stageY;
  10687. break;
  10688. case this.ui.rulerClickNode.displayObject:
  10689. this.pressTarget = PressType.rulerNode;
  10690. this.eventObj.lastY = e.stageY;
  10691. break;
  10692. case this.ui.d2Root.displayObject:
  10693. this.pressTarget = PressType.d2Root;
  10694. this.eventObj.lastX = e.stageX;
  10695. this.eventObj.lastY = e.stageY;
  10696. this.eventObj.starX = e.stageX;
  10697. this.eventObj.starY = e.stageY;
  10698. this.eventObj.curX = 0;
  10699. this.eventObj.curY = 0;
  10700. xGame.common.d2World.d2Gan.setGanLastInfo();
  10701. this.rulerOffset = 0;
  10702. break;
  10703. default:
  10704. break;
  10705. }
  10706. }
  10707. onEventMove(e) {
  10708. if (e.stopPropagation)
  10709. e.stopPropagation();
  10710. if (e && e.force) {
  10711. }
  10712. else {
  10713. if (!this.isTurnSelf())
  10714. return;
  10715. }
  10716. switch (this.pressTarget) {
  10717. case PressType.powerNode:
  10718. this.barInfo.curY = e.stageY;
  10719. this.updateBarInfo();
  10720. this.isMoveRod = true;
  10721. break;
  10722. case PressType.moveNode:
  10723. let rootBall = xGame.common.d2World.rootBall;
  10724. let radius = rootBall.gameObj.width / 2;
  10725. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  10726. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  10727. let border = xGame.common.d2World.borderRect;
  10728. if (curX <= border.x + radius)
  10729. curX = border.x + radius;
  10730. else if (curX >= border.x + border.width - radius)
  10731. curX = border.x + border.width - radius;
  10732. if (curY <= border.y + radius)
  10733. curY = border.y + radius;
  10734. else if (curY >= border.y + border.height - radius)
  10735. curY = border.y + border.height - radius;
  10736. if (xGame.common.gameMgr.isOpenBall) {
  10737. if (curX >= border.x + border.openBallW - radius)
  10738. curX = border.x + border.openBallW - radius;
  10739. }
  10740. this.ui.moveNode.x = curX;
  10741. this.ui.moveNode.y = curY;
  10742. rootBall.gameObj.x = curX;
  10743. rootBall.gameObj.y = curY;
  10744. rootBall.d3BallSrc.setTransPos(curX, curY);
  10745. this.isMoveRod = true;
  10746. break;
  10747. case PressType.rulerNode:
  10748. let yy = e.stageY - this.eventObj.lastY;
  10749. this.eventObj.lastY = e.stageY;
  10750. let ruler1 = this.ui.rulerNode.img1;
  10751. let ruler2 = this.ui.rulerNode.img2;
  10752. ruler1.y += yy;
  10753. ruler2.y += yy;
  10754. this.rulerOffset += yy;
  10755. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  10756. this.rulerOffset = 0;
  10757. xGame.soundMgr.playSound("inch", 1, 10);
  10758. }
  10759. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  10760. let h = ruler1.height;
  10761. this.checkGuide();
  10762. this.isMoveRod = true;
  10763. if (ruler1.y >= h) {
  10764. ruler1.y = -h;
  10765. ruler2.y = 0;
  10766. return;
  10767. }
  10768. else if (ruler1.y <= -h) {
  10769. ruler1.y = h;
  10770. ruler2.y = 0;
  10771. return;
  10772. }
  10773. if (ruler2.y >= h) {
  10774. ruler2.y = -h;
  10775. ruler1.y = 0;
  10776. return;
  10777. }
  10778. else if (ruler2.y <= -h) {
  10779. ruler2.y = h;
  10780. ruler1.y = 0;
  10781. return;
  10782. }
  10783. break;
  10784. case PressType.d2Root:
  10785. this.eventObj.curX = e.stageX;
  10786. this.eventObj.curY = e.stageY;
  10787. let offset = this.checkRodMoveDir();
  10788. xGame.common.d2World.d2Gan.rotateSelf(offset);
  10789. this.eventObj.lastX = e.stageX;
  10790. this.eventObj.lastY = e.stageY;
  10791. break;
  10792. default:
  10793. break;
  10794. }
  10795. }
  10796. onEventUp(e) {
  10797. if (e.stopPropagation)
  10798. e.stopPropagation();
  10799. if (e && e.force) {
  10800. }
  10801. else {
  10802. if (!this.isTurnSelf())
  10803. return;
  10804. }
  10805. switch (this.pressTarget) {
  10806. case PressType.powerNode:
  10807. this.ui.powerNode.value = 0;
  10808. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10809. this.ui.powerTxt.text = "";
  10810. if (this.powerNum > 0) {
  10811. xGame.eventMgr.event(BALL_SHOOT);
  10812. xGame.common.d2World.shoot(this.powerNum);
  10813. xGame.common.d2World.d2Gan.shoot();
  10814. xGame.common.d2World.d2HelpLine.shoot();
  10815. this.finishGuide();
  10816. this.ui.powerEft.visible = false;
  10817. this.ui.colorNode.visible = false;
  10818. let ganStr = "";
  10819. if (this.powerNum <= 30) {
  10820. ganStr = "gan_30";
  10821. }
  10822. else if (this.powerNum <= 60) {
  10823. ganStr = "gan_50";
  10824. }
  10825. else {
  10826. ganStr = "gan_80";
  10827. }
  10828. xGame.soundMgr.playSound(ganStr);
  10829. }
  10830. break;
  10831. case PressType.moveNode:
  10832. let rootBall = xGame.common.d2World.rootBall;
  10833. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10834. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10835. let isIntersect = this.judgeBallIntersect();
  10836. if (isIntersect) {
  10837. this.ui.moveNode.x = lastX;
  10838. this.ui.moveNode.y = lastY;
  10839. rootBall.gameObj.x = lastX;
  10840. rootBall.gameObj.y = lastY;
  10841. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10842. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10843. }
  10844. else {
  10845. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10846. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10847. }
  10848. this.showBallUI();
  10849. this.ui.moveNode.finger.visible = true;
  10850. xGame.common.d2World.getHelpLine();
  10851. break;
  10852. case PressType.rulerNode:
  10853. break;
  10854. case PressType.d2Root:
  10855. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10856. if (dis <= 25) {
  10857. this.moveToClickDot(e);
  10858. }
  10859. break;
  10860. default:
  10861. break;
  10862. }
  10863. this.pressTarget = -1;
  10864. }
  10865. checkGuide() {
  10866. let guide = DataMgr.getSkillGuide();
  10867. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10868. xGame.common.guideStep++;
  10869. xGame.common.gameUI.ui.guide2.visible = false;
  10870. xGame.common.gameUI.ui.guide3.visible = true;
  10871. }
  10872. }
  10873. finishGuide() {
  10874. let guide = DataMgr.getSkillGuide();
  10875. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10876. xGame.common.guideStep = 10;
  10877. this.closeAllGuide();
  10878. console.log('zh: 新手引导完毕');
  10879. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  10880. }
  10881. }
  10882. closeAllGuide() {
  10883. xGame.common.gameUI.ui.guide1.visible = false;
  10884. xGame.common.gameUI.ui.guide2.visible = false;
  10885. xGame.common.gameUI.ui.guide3.visible = false;
  10886. }
  10887. updateBarInfo() {
  10888. let star = this.ui.powerNode.y;
  10889. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10890. if (rate >= 1)
  10891. rate = 1;
  10892. if (rate <= 0)
  10893. rate = 0;
  10894. this.powerNum = Math.ceil(rate * 100);
  10895. this.ui.powerNode.value = this.powerNum;
  10896. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10897. this.ui.colorNode.value = this.powerNum;
  10898. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10899. this.ui.powerEft.visible = this.powerNum != 0;
  10900. this.ui.colorNode.visible = this.powerNum != 0;
  10901. this.ui.powerTxt.text = this.powerNum + "";
  10902. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10903. }
  10904. forceCancel() {
  10905. this.ui.powerNode.value = 0;
  10906. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10907. this.ui.powerTxt.text = "";
  10908. }
  10909. checkRodMoveDir() {
  10910. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10911. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10912. if (tempX >= 0 && tempY <= 0) {
  10913. return this.checkDir();
  10914. }
  10915. else if (tempX < 0 && tempY < 0) {
  10916. return this.checkDir(1, -1);
  10917. }
  10918. else if (tempX < 0 && tempY > 0) {
  10919. return this.checkDir(-1, -1);
  10920. }
  10921. else {
  10922. return this.checkDir(-1, 1);
  10923. }
  10924. }
  10925. checkDir(flagX = 1, flagY = 1) {
  10926. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10927. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10928. if (offsetY == 0) {
  10929. return offsetX * flagX;
  10930. }
  10931. if (offsetX == 0) {
  10932. return offsetY * flagY;
  10933. }
  10934. let angle = offsetY / offsetX;
  10935. if (Math.abs(angle) >= 1) {
  10936. return offsetY * flagY;
  10937. }
  10938. else {
  10939. return offsetX * flagX;
  10940. }
  10941. }
  10942. judgeBallIntersect() {
  10943. let rootBall = xGame.common.d2World.rootBall;
  10944. let ballArr = xGame.common.d2World.ballArr;
  10945. let radius = rootBall.gameObj.width / 2;
  10946. let temp;
  10947. let isIntersect = false;
  10948. for (let index = 0; index < ballArr.length; index++) {
  10949. temp = ballArr[index];
  10950. if (temp.number == rootBall.number)
  10951. continue;
  10952. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10953. if (isIntersect) {
  10954. break;
  10955. }
  10956. }
  10957. return isIntersect;
  10958. }
  10959. hideBallUI() {
  10960. let d2Gan = xGame.common.d2World.d2Gan;
  10961. if (!d2Gan.ui.isDisposed)
  10962. d2Gan.ui.visible = false;
  10963. let d2Help = xGame.common.d2World.d2HelpLine;
  10964. if (!d2Help.ui.isDisposed)
  10965. d2Help.ui.visible = false;
  10966. let rootBall = xGame.common.d2World.rootBall;
  10967. if (!rootBall.destroyed) {
  10968. rootBall.gameObj.active = false;
  10969. }
  10970. }
  10971. showBallUI() {
  10972. let d2Gan = xGame.common.d2World.d2Gan;
  10973. if (!d2Gan.ui.isDisposed)
  10974. d2Gan.ui.visible = true;
  10975. let d2Help = xGame.common.d2World.d2HelpLine;
  10976. if (!d2Help.ui.isDisposed)
  10977. d2Help.ui.visible = true;
  10978. let rootBall = xGame.common.d2World.rootBall;
  10979. if (!rootBall.destroyed) {
  10980. rootBall.gameObj.active = true;
  10981. }
  10982. }
  10983. moveToClickDot(e) {
  10984. if (!this.isMoveRod && !xGame.common.clickedBall) {
  10985. let root = xGame.common.d2World.rootBall.gameObj;
  10986. let xx = e.stageX - xGame.common.sysOffestNum;
  10987. let yy = e.stageY;
  10988. let x = xx - root.x;
  10989. let y = yy - root.y;
  10990. let angle = xGame.common.getfguiRotation(x, y);
  10991. xGame.common.d2World.d2Gan.ui.rotation = angle;
  10992. xGame.common.d2World.getHelpLine();
  10993. }
  10994. this.isMoveRod = false;
  10995. xGame.common.clickedBall = false;
  10996. }
  10997. openAllEvent() {
  10998. this.closeAllEvent();
  10999. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11000. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11001. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11002. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11003. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11004. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11005. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11006. }
  11007. closeAllEvent() {
  11008. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11009. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11010. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11011. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11012. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11013. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11014. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11015. }
  11016. resetGame() {
  11017. this.closeAllEvent();
  11018. this.hideBallUI();
  11019. xGame.common.gameMgr.gamePause = true;
  11020. }
  11021. }
  11022. UIGame.uiName = "UIGame";
  11023. class UIAddProp extends UIBase {
  11024. constructor() {
  11025. super();
  11026. this.curType = "";
  11027. }
  11028. onConstructor() {
  11029. this.ui = ui_UIAddProp.createInstance();
  11030. this.contentPane = this.ui;
  11031. this.isEject = false;
  11032. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11033. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11034. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11035. this.updateUI();
  11036. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11037. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11038. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11039. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11040. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11041. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11042. }
  11043. show(type) {
  11044. super.show();
  11045. this.curType = type == 0 ? "coin" : "diamond";
  11046. this.switchBtn("");
  11047. this.ui.t0.play();
  11048. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11049. PlatMgr.showInsert(true);
  11050. }
  11051. closeSelf() {
  11052. this.hide();
  11053. }
  11054. updateUI() {
  11055. let data = cfgTable.moneyData;
  11056. let temp;
  11057. let obj;
  11058. for (const key in data) {
  11059. temp = data[key];
  11060. obj = this.ui.myNode["node" + key];
  11061. if (parseInt(key) <= 2) {
  11062. obj.diamondTxt.text = "+" + temp.num;
  11063. }
  11064. else {
  11065. obj.coinTxt.text = temp.num;
  11066. obj.diamondTxt.text = temp.get.split('_')[1];
  11067. }
  11068. }
  11069. this.updateDiamondShare();
  11070. }
  11071. updateDiamondShare() {
  11072. let data = DataMgr.getShareDiamondTimes();
  11073. if (data >= xGame.common.maxShareDiamondTimes) {
  11074. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11075. this.ui.myNode.node1.touchable = false;
  11076. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11077. }
  11078. else {
  11079. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11080. this.ui.myNode.node1.touchable = true;
  11081. }
  11082. }
  11083. switchBtn(type) {
  11084. if (type == "")
  11085. type = this.curType;
  11086. else {
  11087. if (this.curType == type) {
  11088. return;
  11089. }
  11090. else {
  11091. this.curType = type;
  11092. }
  11093. }
  11094. if (type == "coin") {
  11095. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11096. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11097. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11098. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11099. this.ui.myNode.c1.selectedIndex = 0;
  11100. }
  11101. else {
  11102. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11103. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11104. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11105. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11106. this.ui.myNode.c1.selectedIndex = 1;
  11107. }
  11108. }
  11109. convertCoin(index) {
  11110. let data = cfgTable.moneyData[index];
  11111. let coinNum = data.num;
  11112. let str = data.get.split('_')[1];
  11113. let needDiamond = parseInt(str);
  11114. if (DataMgr.diamondEnough(needDiamond)) {
  11115. DataMgr.setDiamond(-needDiamond);
  11116. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11117. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11118. }
  11119. else {
  11120. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11121. this.switchBtn("diamond");
  11122. }
  11123. }
  11124. videoGetDiamond() {
  11125. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11126. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11127. }
  11128. else {
  11129. console.log('zh:AD 失败,直接发放奖励');
  11130. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11131. }
  11132. }
  11133. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11134. let num = cfgTable.moneyData[2].num;
  11135. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11136. this.closeSelf();
  11137. }
  11138. videoGetCoin() {
  11139. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11140. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11141. }
  11142. else {
  11143. console.log('zh:AD 失败,直接发放奖励');
  11144. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11145. }
  11146. }
  11147. qjff_AD_for_uiAddProp_videoGetCoin() {
  11148. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11149. this.closeSelf();
  11150. }
  11151. shareGetDiamond() {
  11152. let times = DataMgr.getShareDiamondTimes();
  11153. if (times >= xGame.common.maxShareDiamondTimes) {
  11154. console.log('zh: 233333333333 maxShareDiamondTimes');
  11155. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11156. }
  11157. else {
  11158. console.log('zh:33333333333333ad');
  11159. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11160. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11161. }
  11162. else {
  11163. console.log('zh:AD 失败,直接发放奖励');
  11164. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11165. }
  11166. }
  11167. }
  11168. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11169. let diamond = xGame.common.randomNum(50, 100);
  11170. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11171. DataMgr.setShareDiamondTimes(1);
  11172. this.updateDiamondShare();
  11173. }
  11174. openPutBallView() {
  11175. let end = xGame.uiMgr.getUI(UIGameEnd);
  11176. let skill = xGame.uiMgr.getUI(UISkill);
  11177. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11178. let uigame = xGame.uiMgr.getUI(UIGame);
  11179. if (end && !end.isHide) {
  11180. xGame.uiMgr.Hide(UIGameEnd);
  11181. xGame.uiMgr.Show(UIMain);
  11182. }
  11183. if (skill && !skill.isHide)
  11184. xGame.uiMgr.Hide(UISkill);
  11185. if (uigame && !uigame.isHide)
  11186. xGame.uiMgr.Hide(UIGame);
  11187. if (level && !level.isHide) {
  11188. }
  11189. else {
  11190. xGame.uiMgr.Show(UILevelDisplay);
  11191. }
  11192. this.closeSelf();
  11193. }
  11194. }
  11195. UIAddProp.uiName = "UIAddProp";
  11196. class MoneyNode {
  11197. constructor(ui) {
  11198. this.leftTime = 0;
  11199. this.ui = ui;
  11200. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11201. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11202. this.ui.addPowerBtn.onClick(this, this.addPower);
  11203. this.ui.c1.selectedIndex = 1;
  11204. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11205. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11206. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11207. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11208. this.coinChange();
  11209. this.diamondChange();
  11210. this.powerChange();
  11211. }
  11212. addPower() {
  11213. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11214. xGame.uiMgr.Show(UIPower);
  11215. }
  11216. powerChange() {
  11217. let powerNum = DataMgr.getPower();
  11218. this.ui.powerTxt.text = powerNum + "";
  11219. }
  11220. checkPowerTime() {
  11221. let cur = new Date().getTime();
  11222. let last = DataMgr.getPowerTime();
  11223. if (last == 0) {
  11224. last = cur;
  11225. DataMgr.setPowerTime(cur);
  11226. }
  11227. let power = DataMgr.getPower();
  11228. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11229. Laya.timer.clearAll(this);
  11230. if (power >= xGame.common.natureMaxPower) {
  11231. this.ui.powerTimeTxt.text = "";
  11232. DataMgr.setPowerTime(cur);
  11233. return;
  11234. }
  11235. if (power + offset >= xGame.common.natureMaxPower) {
  11236. DataMgr.setPower(xGame.common.natureMaxPower, false);
  11237. this.ui.powerTimeTxt.text = "";
  11238. DataMgr.setPowerTime(cur);
  11239. }
  11240. else {
  11241. if (offset > 0) {
  11242. DataMgr.setPower(offset);
  11243. DataMgr.setPowerTime(cur);
  11244. }
  11245. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  11246. this.leftTime = xGame.common.powerRecoverNum - time;
  11247. if (this.leftTime <= 0)
  11248. this.leftTime = 0;
  11249. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11250. Laya.timer.loop(1000, this, this.updatePowerTime);
  11251. }
  11252. }
  11253. updatePowerTime() {
  11254. this.leftTime -= 1;
  11255. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11256. if (this.leftTime <= 0) {
  11257. this.checkPowerTime();
  11258. }
  11259. }
  11260. coinChange() {
  11261. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  11262. }
  11263. diamondChange() {
  11264. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  11265. }
  11266. addCoin() {
  11267. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11268. Moyu.sendDataEvent("AddCoinBtn");
  11269. xGame.uiMgr.Show(UIAddProp, 0);
  11270. }
  11271. addDiamond() {
  11272. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11273. Moyu.sendDataEvent("AddDiamondBtn");
  11274. xGame.uiMgr.Show(UIAddProp, 1);
  11275. }
  11276. }
  11277. class UIDraw extends UIBase {
  11278. constructor() {
  11279. super();
  11280. this.curKey = 0;
  11281. }
  11282. onConstructor() {
  11283. this.ui = ui_UIDraw.createInstance();
  11284. this.contentPane = this.ui;
  11285. this.isEject = false;
  11286. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  11287. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  11288. this.addUIClick(this.ui.drawBtn, this.startDraw);
  11289. this.initDraw();
  11290. this.initUI();
  11291. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11292. if (Moyu.isKs)
  11293. this.ui.closeNode.closeBtn.x += 100;
  11294. }
  11295. show() {
  11296. super.show();
  11297. this.ui.t0.play();
  11298. this.playSecretaryIdle();
  11299. this.updateDraw();
  11300. this.checkFree();
  11301. if (PlatMgr.bannerDelay > 0) {
  11302. this.ui.closeNode.closeBtn.visible = false;
  11303. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  11304. this.ui.closeNode.closeBtn.visible = true;
  11305. });
  11306. }
  11307. PlatMgr.showRateBanner();
  11308. }
  11309. hide() {
  11310. Laya.timer.clearAll(this);
  11311. super.hide();
  11312. }
  11313. checkFree() {
  11314. let isFree = DataMgr.getDailyfreeDrawTimes();
  11315. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  11316. }
  11317. initDraw() {
  11318. this.drawObj = [];
  11319. let data = cfgTable.drawData;
  11320. let temp;
  11321. let weight = 0;
  11322. for (const key in data) {
  11323. temp = data[key];
  11324. weight += temp.weight;
  11325. this.drawObj.push(weight);
  11326. }
  11327. this.allWeight = weight;
  11328. }
  11329. initUI() {
  11330. let data = cfgTable.drawData;
  11331. let temp;
  11332. let img;
  11333. let txt;
  11334. for (const key in data) {
  11335. temp = data[key];
  11336. img = this.ui.myNode.rotNode["img" + key];
  11337. txt = this.ui.myNode.rotNode["txt" + key];
  11338. img.url = xGame.common.getGameIconUrl(temp.icon);
  11339. txt.visible = true;
  11340. if (temp.award > 2) {
  11341. img.rotation = 0;
  11342. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11343. }
  11344. else {
  11345. img.rotation = temp.rotation;
  11346. txt.text = temp.num;
  11347. }
  11348. }
  11349. }
  11350. getCurkey() {
  11351. let rand = Math.random() * this.allWeight;
  11352. let temp;
  11353. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11354. temp = this.drawObj[index];
  11355. if (index == 0) {
  11356. if (rand < temp) {
  11357. return index + 1;
  11358. }
  11359. }
  11360. else {
  11361. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11362. return index + 1;
  11363. }
  11364. }
  11365. }
  11366. return 2;
  11367. }
  11368. startDraw() {
  11369. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11370. if (freeTimes > 0) {
  11371. this.beginDraw();
  11372. DataMgr.setDailyfreeDrawTimes(0);
  11373. this.checkFree();
  11374. }
  11375. else {
  11376. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11377. }
  11378. else {
  11379. console.log('zh:AD 失败,直接发放奖励');
  11380. this.qjff_chouJiang();
  11381. }
  11382. }
  11383. }
  11384. qjff_chouJiang() {
  11385. this.beginDraw();
  11386. }
  11387. beginDraw() {
  11388. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11389. this.ui.drawBtn.touchable = false;
  11390. this.curKey = this.getCurkey();
  11391. console.log("当前key", this.curKey);
  11392. let cell = 60;
  11393. let lap = 3;
  11394. let angle = cell * (this.curKey - 1) + lap * 360;
  11395. let target = this.ui.myNode.rotNode;
  11396. target.rotation = 0;
  11397. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  11398. console.log("旋转完成");
  11399. this.ui.drawBtn.touchable = true;
  11400. this.getAward();
  11401. }));
  11402. }
  11403. getAward() {
  11404. let data = cfgTable.drawData[this.curKey];
  11405. let temp = new AwardType();
  11406. temp.type = data.award;
  11407. temp.num = data.num;
  11408. xGame.common.getAward([temp], () => {
  11409. DataMgr.setDrawTimes(1);
  11410. this.updateDraw();
  11411. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11412. });
  11413. }
  11414. updateDraw() {
  11415. let drawTimes = DataMgr.getDrawTimes();
  11416. let awardTimes = DataMgr.getDrawAwardTimes();
  11417. if (Math.floor(drawTimes / 3) > awardTimes) {
  11418. this.ui.extraNode.boxBtn.t0.play(null, -1);
  11419. this.ui.extraNode.boxBtn.touchable = true;
  11420. this.ui.extraNode.tipsTxt.text = "3/3";
  11421. this.ui.extraNode.barNode.width = 265;
  11422. this.getExtraAward();
  11423. }
  11424. else {
  11425. this.ui.extraNode.boxBtn.t0.stop();
  11426. this.ui.extraNode.boxBtn.touchable = false;
  11427. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  11428. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  11429. }
  11430. let data = cfgTable.drawData[1];
  11431. if (awardTimes == 0) {
  11432. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  11433. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  11434. this.ui.myNode.rotNode.img1.rotation = 0;
  11435. }
  11436. else {
  11437. let award = data.nextid;
  11438. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  11439. this.ui.myNode.rotNode.txt1.text = award[1];
  11440. this.ui.myNode.rotNode.img1.rotation = 0;
  11441. }
  11442. }
  11443. getExtraAward() {
  11444. let drawTimes = DataMgr.getDrawTimes();
  11445. let awardTimes = DataMgr.getDrawAwardTimes();
  11446. let data = cfgTable.drawData[1];
  11447. let award = new AwardType();
  11448. if (awardTimes == 0) {
  11449. award.num = data.num;
  11450. award.type = data.award;
  11451. xGame.common.getAward([award], () => {
  11452. let all = Math.floor(drawTimes / 3);
  11453. DataMgr.setDrawAwardTimes(all);
  11454. this.updateDraw();
  11455. });
  11456. }
  11457. else {
  11458. award.num = parseInt(data.nextid[1]);
  11459. award.type = parseInt(data.nextid[0]);
  11460. xGame.common.getAward([award], () => {
  11461. let all = Math.floor(drawTimes / 3);
  11462. DataMgr.setDrawAwardTimes(all);
  11463. this.updateDraw();
  11464. });
  11465. }
  11466. }
  11467. closeSelf() {
  11468. this.hide();
  11469. }
  11470. playSecretaryIdle() {
  11471. let parent = this.ui.secretary.displayObject;
  11472. parent.destroyChildren();
  11473. let xx = this.ui.secretary.width / 2;
  11474. let yy = this.ui.secretary.height;
  11475. let scale = xGame.common.getSecretaryScale();
  11476. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  11477. xGame.common.secretary.play(data, 0, true, parent);
  11478. }
  11479. }
  11480. UIDraw.uiName = "UIDraw";
  11481. class ui_UIFlyEft extends fgui.GComponent {
  11482. static createInstance() {
  11483. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  11484. }
  11485. onConstruct() {
  11486. this.n0 = (this.getChild("n0"));
  11487. this.n1 = (this.getChild("n1"));
  11488. this.n2 = (this.getChild("n2"));
  11489. this.n3 = (this.getChild("n3"));
  11490. this.n4 = (this.getChild("n4"));
  11491. this.n5 = (this.getChild("n5"));
  11492. this.n6 = (this.getChild("n6"));
  11493. this.n7 = (this.getChild("n7"));
  11494. this.iconNode = (this.getChild("iconNode"));
  11495. this.txt = (this.getChild("txt"));
  11496. this.txtNode = (this.getChild("txtNode"));
  11497. }
  11498. }
  11499. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  11500. class UIFlyEft extends UIBase {
  11501. constructor() {
  11502. super();
  11503. this.max = 8;
  11504. this.delay = 0;
  11505. }
  11506. onConstructor() {
  11507. this.ui = ui_UIFlyEft.createInstance();
  11508. this.contentPane = this.ui;
  11509. this.isEject = false;
  11510. this.isMuti = true;
  11511. this.ui.x += xGame.common.sysOffestNum;
  11512. }
  11513. getArrPos() {
  11514. if (this.iconPos && this.iconPos.length > 0)
  11515. return;
  11516. this.iconPos = [];
  11517. let temp;
  11518. for (let index = 0; index < this.max; index++) {
  11519. temp = this.ui["n" + index];
  11520. this.iconPos.push([temp.x, temp.y]);
  11521. }
  11522. }
  11523. show(stPos, edPos, num, type, callback) {
  11524. super.show();
  11525. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  11526. this.getArrPos();
  11527. this.updateUI(type);
  11528. this.updatePos();
  11529. this.runFly(edPos, callback);
  11530. this.runWorlds(stPos, num);
  11531. }
  11532. updateUI(type) {
  11533. let temp;
  11534. let str;
  11535. for (let index = 0; index < this.max; index++) {
  11536. temp = this.ui["n" + index];
  11537. str = this.getIconStr(type);
  11538. temp.url = xGame.common.getGameIconUrl(str);
  11539. }
  11540. }
  11541. getIconStr(type) {
  11542. switch (type) {
  11543. case Prop.diamond:
  11544. return "ty_zs";
  11545. case Prop.coin:
  11546. return "ty_jb";
  11547. default:
  11548. break;
  11549. }
  11550. }
  11551. updatePos() {
  11552. let temp;
  11553. for (let index = 0; index < this.max; index++) {
  11554. temp = this.ui["n" + index];
  11555. temp.x = this.iconPos[index][0];
  11556. temp.y = this.iconPos[index][1];
  11557. }
  11558. }
  11559. runFly(endPos, callback) {
  11560. let all = 0;
  11561. let temp;
  11562. for (let index = 0; index < this.max; index++) {
  11563. temp = this.ui["n" + index];
  11564. temp.visible = true;
  11565. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  11566. temp.visible = false;
  11567. all++;
  11568. if (all >= this.max) {
  11569. callback && callback();
  11570. }
  11571. }), 20 * index);
  11572. }
  11573. }
  11574. runWorlds(stPos, num) {
  11575. let str = "+" + num;
  11576. this.ui.txt.text = str;
  11577. let starX = stPos.x;
  11578. let starY = stPos.y + 50;
  11579. this.ui.txt.x = starX;
  11580. this.ui.txt.y = starY;
  11581. this.ui.txt.visible = true;
  11582. this.ui.txt.alpha = 1;
  11583. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  11584. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  11585. this.ui.txt.visible = false;
  11586. this.hide();
  11587. }));
  11588. }));
  11589. }
  11590. }
  11591. UIFlyEft.uiName = "UIFlyEft";
  11592. class Common {
  11593. constructor() {
  11594. this.convertNum = 0.025;
  11595. this.VectorUp = new Laya.Vector3(0, 1, 0);
  11596. this.scaleV3One = new Laya.Vector3();
  11597. this.scaleV3Two = new Laya.Vector3();
  11598. this.posV4 = new Laya.Vector4();
  11599. this.showDebug = false;
  11600. this.openGuide = true;
  11601. this.rodOffest = new Laya.Vector2(0, 0);
  11602. this.rodAngle = 0;
  11603. this.gameMode = GameMode.classic;
  11604. this.bigMoveLevelIndex = 1;
  11605. this.bigMoveNeedCoin = 1000;
  11606. this.classicNiceNeddCoin = 1000;
  11607. this.passAwardCoin = 2000;
  11608. this.classicRoomType = 1;
  11609. this.maxPower = 20;
  11610. this.natureMaxPower = 5;
  11611. this.videoPower = 2;
  11612. this.powerRecoverNum = 900;
  11613. this.curPlayerSkillType = 0;
  11614. this.isNewDay = false;
  11615. this.clickedBall = false;
  11616. this.placeBallCurLevel = 0;
  11617. this.placeBallStarNum = 0;
  11618. this.longHelpLine = false;
  11619. this.maxShareDiamondTimes = 3;
  11620. this.guideStep = 0;
  11621. this.temSelfLevel = 0;
  11622. this.extraMoveNum = 0;
  11623. this.curRankID = 0;
  11624. this.rankID = {
  11625. normalStar: 12000,
  11626. wxStar: 12001
  11627. };
  11628. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  11629. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  11630. this.btnClickStr = "buttonclick";
  11631. this.maxSkillLevel = 10;
  11632. this.upSkillLevel = false;
  11633. this.gameStartTime = 0;
  11634. this._sysOffestNum = 0;
  11635. this.angleV2 = new Laya.Vector2();
  11636. this.rootV = new Laya.Vector2(0, 1);
  11637. this.tempDir1 = new Laya.Vector2();
  11638. this.tempDir2 = new Laya.Vector2();
  11639. this.ballSize = 33;
  11640. this.stPos = new Laya.Point();
  11641. this.edPos = new Laya.Point();
  11642. Common._instance = this;
  11643. window["common"] = this;
  11644. }
  11645. static getInstance() {
  11646. if (!this._instance) {
  11647. this._instance = new Common();
  11648. }
  11649. return this._instance;
  11650. }
  11651. get sysOffestNum() {
  11652. if (this._sysOffestNum == 0) {
  11653. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  11654. }
  11655. return this._sysOffestNum;
  11656. }
  11657. testShader() {
  11658. let test = new LightShader();
  11659. test.texture = "res/d3Res/ballTexture/ball1.png";
  11660. Laya.stage.addChild(test);
  11661. }
  11662. playScale(node) {
  11663. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  11664. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  11665. }));
  11666. }));
  11667. }
  11668. setGroup(colli, ...group) {
  11669. let out = 0;
  11670. for (let index = 0; index < group.length; index++) {
  11671. if (index == 0) {
  11672. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11673. }
  11674. else {
  11675. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11676. }
  11677. }
  11678. colli.collisionGroup = out;
  11679. }
  11680. setCanGroupWith(colli, ...group) {
  11681. let out = 0;
  11682. for (let index = 0; index < group.length; index++) {
  11683. if (index == 0) {
  11684. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11685. }
  11686. else {
  11687. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11688. }
  11689. }
  11690. colli.canCollideWith = out;
  11691. }
  11692. loadPrefab(name, callback) {
  11693. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  11694. let prefab = new Laya.Prefab();
  11695. prefab.json = obj;
  11696. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  11697. callback && callback(img);
  11698. }));
  11699. }
  11700. pos2to3Convert(x, y, d3Pos) {
  11701. x = x + this.sysOffestNum;
  11702. d3Pos.setValue(x, y, 0);
  11703. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  11704. if (success) {
  11705. }
  11706. else {
  11707. console.error("转换出错了。。。。。。。。");
  11708. }
  11709. }
  11710. scale2to3Convert(num) {
  11711. this.scaleV3One.setValue(0, 0, 0);
  11712. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  11713. this.scaleV3Two.setValue(0, num, 0);
  11714. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  11715. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  11716. return outNum;
  11717. }
  11718. pos3to2Convert(d3Pos) {
  11719. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  11720. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  11721. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  11722. d3Pos.x -= this.sysOffestNum;
  11723. }
  11724. scale3to2Convert(num) {
  11725. let scale = this.scale2to3Convert(1);
  11726. let d2Out = num / scale;
  11727. return d2Out;
  11728. }
  11729. getCollider(type, restitution = 0.9, density = 10) {
  11730. let colli;
  11731. if (type == "box")
  11732. colli = new Laya.BoxCollider();
  11733. else
  11734. colli = new Laya.CircleCollider();
  11735. colli.friction = 0;
  11736. colli.restitution = restitution;
  11737. colli.density = density;
  11738. return colli;
  11739. }
  11740. getRigbody() {
  11741. let rigy = new Laya.RigidBody();
  11742. rigy.bullet = true;
  11743. rigy.allowRotation = false;
  11744. rigy.allowSleep = false;
  11745. rigy.gravityScale = 0;
  11746. return rigy;
  11747. }
  11748. getfguiRotation(x, y) {
  11749. this.angleV2.setValue(x, y);
  11750. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11751. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11752. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  11753. angle = -angle;
  11754. }
  11755. return 180 + angle;
  11756. }
  11757. getAngle(x, y) {
  11758. this.angleV2.setValue(x, y);
  11759. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11760. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11761. return angle;
  11762. }
  11763. randomNum(a, b) {
  11764. return a + Math.floor((b - a + 1) * Math.random());
  11765. }
  11766. getRandArrEle(arr) {
  11767. return arr[Math.floor(arr.length * Math.random())];
  11768. }
  11769. getSign(val) {
  11770. return val >= 0 ? 1 : -1;
  11771. }
  11772. botherArr(arr) {
  11773. let times = arr.length + 2;
  11774. let length = arr.length;
  11775. let a;
  11776. let b;
  11777. let temp;
  11778. for (let index = 0; index < times; index++) {
  11779. a = Math.floor(Math.random() * length);
  11780. b = Math.floor(Math.random() * length);
  11781. temp = arr[a];
  11782. arr[a] = arr[b];
  11783. arr[b] = temp;
  11784. }
  11785. }
  11786. getGameIconUrl(id) {
  11787. return "ui://game/" + id;
  11788. }
  11789. getComponentUrl(id) {
  11790. return "ui://game/" + id;
  11791. }
  11792. getAnimation() {
  11793. }
  11794. judgeSkillType(type = SkillType.highSpace) {
  11795. if (this.gameMode == GameMode.classic)
  11796. return;
  11797. let gameMgr = this.gameMgr;
  11798. if (gameMgr.selfTurn) {
  11799. if (gameMgr.selfCurSkill == type) {
  11800. return true;
  11801. }
  11802. }
  11803. else {
  11804. if (gameMgr.aiCurSkill == type) {
  11805. return true;
  11806. }
  11807. }
  11808. }
  11809. ballColliHole(collider) {
  11810. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11811. xGame.common.gameMgr.isFirstInGame = false;
  11812. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11813. }
  11814. collider.owner.mySrc.checkWrongBall();
  11815. }
  11816. getArrMaxEle(arr) {
  11817. let max = -Infinity;
  11818. for (let index = 0; index < arr.length; index++) {
  11819. max = Math.max(arr[index], max);
  11820. }
  11821. return max;
  11822. }
  11823. getArrMinEle(arr) {
  11824. let min = Infinity;
  11825. for (let index = 0; index < arr.length; index++) {
  11826. min = Math.min(arr[index], min);
  11827. }
  11828. return min;
  11829. }
  11830. playRandomMutiBallBigSkillSound() {
  11831. if (Math.random() <= 0.5)
  11832. return;
  11833. let rand = this.randomNum(1, 6);
  11834. let str = "ganfa0" + rand;
  11835. xGame.soundMgr.playSound(str);
  11836. }
  11837. showOneCamera(type) {
  11838. let object = xGame.common.d3World.cameraObj;
  11839. for (const key in object) {
  11840. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11841. object[key].init();
  11842. object[key].owner.active = key == type;
  11843. }
  11844. }
  11845. }
  11846. checkBallOverBorder(x, y) {
  11847. let radius = 17;
  11848. let condition = this._checkBorder(x + radius, y) ||
  11849. this._checkBorder(x - radius, y) ||
  11850. this._checkBorder(x, y + radius) ||
  11851. this._checkBorder(x, y - radius);
  11852. if (condition) {
  11853. return true;
  11854. }
  11855. }
  11856. _checkBorder(x, y) {
  11857. let borderRect = this.d2World.borderRect;
  11858. let xOffest = 20;
  11859. let yOffest = 20;
  11860. if (y <= borderRect.y - yOffest) {
  11861. return true;
  11862. }
  11863. if (y >= borderRect.y + borderRect.height + yOffest) {
  11864. return true;
  11865. }
  11866. if (x <= borderRect.x - xOffest) {
  11867. return true;
  11868. }
  11869. if (x >= borderRect.x + borderRect.width + xOffest) {
  11870. return true;
  11871. }
  11872. }
  11873. initWeight(cfg) {
  11874. let allCfgData = { data: {}, allWeightNum: 0 };
  11875. let weightCfg = allCfgData.data;
  11876. let weight = 0;
  11877. for (const key in cfg) {
  11878. weightCfg[key] = {};
  11879. weightCfg[key].id = cfg[key].id;
  11880. weightCfg[key].minWeight = weight;
  11881. weight += cfg[key].weight;
  11882. weightCfg[key].maxWeight = weight;
  11883. }
  11884. allCfgData.allWeightNum = weight;
  11885. return allCfgData;
  11886. }
  11887. getRandomWeightData(cfg) {
  11888. let weightCfg = cfg.data;
  11889. let allWeightNum = cfg.allWeightNum;
  11890. let rand = Math.floor(Math.random() * allWeightNum);
  11891. for (const key in weightCfg) {
  11892. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11893. return weightCfg[key];
  11894. }
  11895. }
  11896. return weightCfg[1];
  11897. }
  11898. showGirlTalkPop(wordsIndex, node, msgNode) {
  11899. node.visible = true;
  11900. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11901. node.t0.play(Laya.Handler.create(this, () => {
  11902. node.visible = false;
  11903. }));
  11904. }
  11905. stopGirlPop(node) {
  11906. node.t0.stop();
  11907. node.visible = false;
  11908. }
  11909. createHead(loader, url, size = 107) {
  11910. if (Laya.Browser.name == "Browser") {
  11911. loader.url = url;
  11912. return;
  11913. }
  11914. else {
  11915. console.log('zh:url=', url);
  11916. loader.url = url;
  11917. }
  11918. }
  11919. addTestCoin(num) {
  11920. DataMgr.setCoin(num);
  11921. }
  11922. addTestDiamond(num) {
  11923. DataMgr.setDiamond(num);
  11924. }
  11925. addTestSkill() {
  11926. DataMgr.setBigSkill(0, 99);
  11927. DataMgr.setBigSkill(1, 99);
  11928. DataMgr.setBigSkill(2, 99);
  11929. }
  11930. playClassicEmotion(number, x, y) {
  11931. if (this.gameMode == GameMode.bigMove)
  11932. return;
  11933. let randIndex = this.randomNum(0, 2);
  11934. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11935. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11936. if (this.gameMgr.selfTurn) {
  11937. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11938. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11939. }
  11940. else {
  11941. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11942. }
  11943. else {
  11944. if (number == this.gameMgr.blackNum) {
  11945. if (this.gameMgr.selfBallArr.length == 0) {
  11946. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11947. }
  11948. else {
  11949. }
  11950. }
  11951. else {
  11952. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11953. }
  11954. }
  11955. }
  11956. }
  11957. else {
  11958. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11959. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11960. }
  11961. else {
  11962. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11963. }
  11964. else {
  11965. if (number == this.gameMgr.blackNum) {
  11966. if (this.gameMgr.aiBallArr.length == 0) {
  11967. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11968. }
  11969. else {
  11970. }
  11971. }
  11972. else {
  11973. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11974. }
  11975. }
  11976. }
  11977. }
  11978. }
  11979. playHappySound(number) {
  11980. if (this.gameMode != GameMode.classic)
  11981. return;
  11982. if (number == 8)
  11983. return;
  11984. let play = false;
  11985. if (this.gameMgr.selfTurn) {
  11986. if (this.gameMgr.ensureBallType) {
  11987. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11988. play = true;
  11989. }
  11990. }
  11991. else {
  11992. play = true;
  11993. }
  11994. }
  11995. else {
  11996. if (this.gameMgr.ensureBallType) {
  11997. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11998. play = true;
  11999. }
  12000. }
  12001. else {
  12002. play = true;
  12003. }
  12004. }
  12005. if (play)
  12006. xGame.soundMgr.playSound("applause");
  12007. }
  12008. destroyClassicEmotion() {
  12009. if (this.gameMode == GameMode.bigMove)
  12010. return;
  12011. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12012. parent.destroyChildren();
  12013. }
  12014. playAwardSpine(x, y) {
  12015. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12016. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12017. this.awardSpine.play(data, 0, false, parent);
  12018. }
  12019. destroyAwardSpine() {
  12020. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12021. parent.destroyChildren();
  12022. }
  12023. isBlock(bx, by, hx, hy, except = null) {
  12024. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12025. let balls = xGame.common.d2World.ballArr;
  12026. let outArr = [];
  12027. for (let index = 0; index < balls.length; index++) {
  12028. let obj = balls[index];
  12029. if (obj.number == 0)
  12030. continue;
  12031. if (obj == except)
  12032. continue;
  12033. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12034. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12035. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12036. if (num >= 1)
  12037. num = 1;
  12038. if (num < 0)
  12039. continue;
  12040. let gap = Math.sin(Math.acos(num)) * dis;
  12041. if (gap < this.ballSize) {
  12042. outArr.push({
  12043. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12044. disHon: Math.cos(Math.acos(num)) * dis,
  12045. disVer: Math.sin(Math.acos(num)) * dis,
  12046. src: balls[index],
  12047. dir: this.tempDir1
  12048. });
  12049. }
  12050. }
  12051. if (outArr.length > 0) {
  12052. outArr.sort((a, b) => { return a.dis - b.dis; });
  12053. return outArr[0];
  12054. }
  12055. }
  12056. AngleBetween(vector1, vector2) {
  12057. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12058. return rad * (180 / Math.PI);
  12059. }
  12060. getSecretaryScale() {
  12061. if (this.secretary.spineName == "mishu") {
  12062. return 1.28;
  12063. }
  12064. else {
  12065. return 1.024;
  12066. }
  12067. }
  12068. signAwardContainsRod(arr) {
  12069. let temp;
  12070. for (let index = 0; index < arr.length; index++) {
  12071. temp = arr[index].split('-')[0];
  12072. if (parseInt(temp) > 2) {
  12073. return true;
  12074. }
  12075. }
  12076. }
  12077. judgeSameDay() {
  12078. let lastTime = DataMgr.getSignTime();
  12079. let curTime = new Date().getTime();
  12080. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12081. return true;
  12082. }
  12083. return false;
  12084. }
  12085. getAward(arr, callback) {
  12086. let showTriple = arr[0].type <= 2;
  12087. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12088. let temp;
  12089. for (let index = 0; index < arr.length; index++) {
  12090. temp = arr[index];
  12091. switch (temp.type) {
  12092. case 1:
  12093. this.playObjFlyAnim(temp.num, temp.type);
  12094. break;
  12095. case 2:
  12096. this.playObjFlyAnim(temp.num, temp.type);
  12097. break;
  12098. case 3:
  12099. case 4:
  12100. case 5:
  12101. case 6:
  12102. DataMgr.setBallRod(temp.type - 2, 1);
  12103. DataMgr.setCurBallRod(temp.type - 2);
  12104. break;
  12105. default:
  12106. break;
  12107. }
  12108. }
  12109. callback && callback(watchVideo);
  12110. });
  12111. }
  12112. getMoneyNode() {
  12113. let moneyNode;
  12114. let sign = xGame.uiMgr.getUI(UISign);
  12115. let draw = xGame.uiMgr.getUI(UIDraw);
  12116. let end = xGame.uiMgr.getUI(UIGameEnd);
  12117. let skill = xGame.uiMgr.getUI(UISkill);
  12118. if (sign && !sign.isHide)
  12119. moneyNode = sign.ui.moneyNode;
  12120. if (draw && !draw.isHide)
  12121. moneyNode = draw.ui.moneyNode;
  12122. if (end && !end.isHide)
  12123. moneyNode = end.ui.moneyNode;
  12124. if (skill && !skill.isHide)
  12125. moneyNode = skill.ui.moneyNode;
  12126. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12127. let main = xGame.uiMgr.getUI(UIMain);
  12128. if (condition1 && main && !main.isHide) {
  12129. moneyNode = main.ui.moneyNode;
  12130. }
  12131. return moneyNode;
  12132. }
  12133. playObjFlyAnim(num, type, callback = null) {
  12134. this.stPos.x = Laya.stage.width / 2;
  12135. this.stPos.y = Laya.stage.height / 2;
  12136. let moneyNode = this.getMoneyNode();
  12137. switch (type) {
  12138. case Prop.diamond:
  12139. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12140. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12141. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12142. this.edPos.x /= 2;
  12143. this.edPos.y /= 2;
  12144. break;
  12145. case Prop.coin:
  12146. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12147. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12148. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12149. this.edPos.x /= 2;
  12150. this.edPos.y /= 2;
  12151. break;
  12152. default:
  12153. break;
  12154. }
  12155. xGame.soundMgr.playSound("coinbag");
  12156. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12157. switch (type) {
  12158. case Prop.diamond:
  12159. DataMgr.setDiamond(num);
  12160. break;
  12161. case Prop.coin:
  12162. DataMgr.setCoin(num);
  12163. break;
  12164. default:
  12165. break;
  12166. }
  12167. callback && callback();
  12168. });
  12169. }
  12170. autoPopUIView() {
  12171. let arr = [];
  12172. let sign = this.judgeSameDay() ? false : true;
  12173. if (sign)
  12174. arr.push("sign");
  12175. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12176. if (draw)
  12177. arr.push("draw");
  12178. if (arr.length <= 0)
  12179. return;
  12180. let str = this.getRandArrEle(arr);
  12181. switch (str) {
  12182. case "sign":
  12183. xGame.uiMgr.Show(UISign);
  12184. break;
  12185. case "draw":
  12186. xGame.uiMgr.Show(UIDraw);
  12187. break;
  12188. default:
  12189. break;
  12190. }
  12191. }
  12192. getMSTime(time) {
  12193. let min = Math.floor(time / 60);
  12194. let sec = Math.floor((time - min * 60));
  12195. if (sec < 10)
  12196. sec = "0" + sec;
  12197. if (min < 10)
  12198. min = "0" + min;
  12199. return `${min}:${sec}`;
  12200. }
  12201. testPower() {
  12202. DataMgr.setPower(0, false);
  12203. }
  12204. getAllStarNum() {
  12205. let data = DataMgr.getPlaceBallLevelList();
  12206. let out = 0;
  12207. for (let index = 0; index < data.length; index++) {
  12208. out += data[index].star;
  12209. }
  12210. return out;
  12211. }
  12212. recoverCameraView() {
  12213. Laya.timer.once(900, this, () => {
  12214. xGame.common.showOneCamera("mainCamera");
  12215. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12216. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12217. xGame.common.gameUI.ui.border.alpha = 0;
  12218. if (Laya.physicsTimer.scale < 1) {
  12219. Laya.physicsTimer.scale = 1;
  12220. }
  12221. }
  12222. });
  12223. }
  12224. getClassicLevel() {
  12225. let successTimes = DataMgr.getClassicTimes();
  12226. let needKey = "";
  12227. let lastKey = "";
  12228. let cfg = cfgTable.classictimesData;
  12229. let data;
  12230. for (const key in cfg) {
  12231. data = cfg[key];
  12232. if (successTimes <= data.times) {
  12233. needKey = key;
  12234. }
  12235. lastKey = key;
  12236. }
  12237. if (needKey == "")
  12238. needKey = lastKey;
  12239. return cfg[needKey];
  12240. }
  12241. }
  12242. Common._instance = null;
  12243. class ui_Component92 extends fgui.GComponent {
  12244. static createInstance() {
  12245. return (fgui.UIPackage.createObject("game", "Component92"));
  12246. }
  12247. onConstruct() {
  12248. this.n0 = (this.getChild("n0"));
  12249. }
  12250. }
  12251. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  12252. class ui_Component129 extends fgui.GProgressBar {
  12253. static createInstance() {
  12254. return (fgui.UIPackage.createObject("game", "Component129"));
  12255. }
  12256. onConstruct() {
  12257. this.bar_v = (this.getChild("bar_v"));
  12258. this.n84 = (this.getChild("n84"));
  12259. }
  12260. }
  12261. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  12262. class ui_Component130 extends fgui.GComponent {
  12263. static createInstance() {
  12264. return (fgui.UIPackage.createObject("game", "Component130"));
  12265. }
  12266. onConstruct() {
  12267. this.ani = (this.getChild("ani"));
  12268. this.t0 = this.getTransition("t0");
  12269. }
  12270. }
  12271. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  12272. class ui_powerEft extends fgui.GComponent {
  12273. static createInstance() {
  12274. return (fgui.UIPackage.createObject("game", "powerEft"));
  12275. }
  12276. onConstruct() {
  12277. this.ani = (this.getChild("ani"));
  12278. this.n88 = (this.getChild("n88"));
  12279. this.n89 = (this.getChild("n89"));
  12280. }
  12281. }
  12282. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  12283. class ui_PutBallLevelDisplay extends fgui.GComponent {
  12284. static createInstance() {
  12285. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  12286. }
  12287. onConstruct() {
  12288. this.c1 = this.getController("c1");
  12289. this.n2 = (this.getChild("n2"));
  12290. this.n22 = (this.getChild("n22"));
  12291. this.n23 = (this.getChild("n23"));
  12292. this.n15 = (this.getChild("n15"));
  12293. this.challenge = (this.getChild("challenge"));
  12294. this.n17 = (this.getChild("n17"));
  12295. this.n3 = (this.getChild("n3"));
  12296. this.starNode = (this.getChild("starNode"));
  12297. this.levelTxt = (this.getChild("levelTxt"));
  12298. this.n14 = (this.getChild("n14"));
  12299. this.n19 = (this.getChild("n19"));
  12300. this.n20 = (this.getChild("n20"));
  12301. this.n21 = (this.getChild("n21"));
  12302. this.special = (this.getChild("special"));
  12303. }
  12304. }
  12305. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  12306. class ui_Component79 extends fgui.GComponent {
  12307. static createInstance() {
  12308. return (fgui.UIPackage.createObject("game", "Component79"));
  12309. }
  12310. onConstruct() {
  12311. this.c1 = this.getController("c1");
  12312. this.n7 = (this.getChild("n7"));
  12313. this.n8 = (this.getChild("n8"));
  12314. this.n9 = (this.getChild("n9"));
  12315. this.n10 = (this.getChild("n10"));
  12316. this.n11 = (this.getChild("n11"));
  12317. this.n12 = (this.getChild("n12"));
  12318. }
  12319. }
  12320. ui_Component79.URL = "ui://isxx5ak7avag477";
  12321. class ui_Component80 extends fgui.GComponent {
  12322. static createInstance() {
  12323. return (fgui.UIPackage.createObject("game", "Component80"));
  12324. }
  12325. onConstruct() {
  12326. this.n0 = (this.getChild("n0"));
  12327. this.n1 = (this.getChild("n1"));
  12328. this.myList = (this.getChild("myList"));
  12329. this.t0 = this.getTransition("t0");
  12330. }
  12331. }
  12332. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12333. class ui_SignNormal extends fgui.GComponent {
  12334. static createInstance() {
  12335. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12336. }
  12337. onConstruct() {
  12338. this.c1 = this.getController("c1");
  12339. this.n7 = (this.getChild("n7"));
  12340. this.n15 = (this.getChild("n15"));
  12341. this.titleTxt = (this.getChild("titleTxt"));
  12342. this.n8 = (this.getChild("n8"));
  12343. this.myIcon = (this.getChild("myIcon"));
  12344. this.numTxt = (this.getChild("numTxt"));
  12345. this.n12 = (this.getChild("n12"));
  12346. this.n13 = (this.getChild("n13"));
  12347. this.n17 = (this.getChild("n17"));
  12348. this.n14 = (this.getChild("n14"));
  12349. }
  12350. }
  12351. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12352. class ui_Button_reg extends fgui.GButton {
  12353. static createInstance() {
  12354. return (fgui.UIPackage.createObject("game", "Button_reg"));
  12355. }
  12356. onConstruct() {
  12357. this.button = this.getController("button");
  12358. this.n5 = (this.getChild("n5"));
  12359. this.n4 = (this.getChild("n4"));
  12360. }
  12361. }
  12362. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  12363. class ui_screenNode extends fgui.GComponent {
  12364. static createInstance() {
  12365. return (fgui.UIPackage.createObject("game", "screenNode"));
  12366. }
  12367. onConstruct() {
  12368. this.n9 = (this.getChild("n9"));
  12369. this.screenImg = (this.getChild("screenImg"));
  12370. }
  12371. }
  12372. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12373. class ui_GetAwrad_com1 extends fgui.GComponent {
  12374. static createInstance() {
  12375. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12376. }
  12377. onConstruct() {
  12378. this.n38 = (this.getChild("n38"));
  12379. this.n39 = (this.getChild("n39"));
  12380. this.n40 = (this.getChild("n40"));
  12381. this.t0 = this.getTransition("t0");
  12382. this.t1 = this.getTransition("t1");
  12383. }
  12384. }
  12385. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12386. class ui_GetAwrad_com2 extends fgui.GComponent {
  12387. static createInstance() {
  12388. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12389. }
  12390. onConstruct() {
  12391. this.n39 = (this.getChild("n39"));
  12392. this.n40 = (this.getChild("n40"));
  12393. this.t0 = this.getTransition("t0");
  12394. }
  12395. }
  12396. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  12397. class ui_Component128 extends fgui.GComponent {
  12398. static createInstance() {
  12399. return (fgui.UIPackage.createObject("game", "Component128"));
  12400. }
  12401. onConstruct() {
  12402. this.n38 = (this.getChild("n38"));
  12403. this.n40 = (this.getChild("n40"));
  12404. }
  12405. }
  12406. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  12407. class ui_Component100_1 extends fgui.GComponent {
  12408. static createInstance() {
  12409. return (fgui.UIPackage.createObject("game", "Component100_1"));
  12410. }
  12411. onConstruct() {
  12412. this.myNode = (this.getChild("myNode"));
  12413. this.t0 = this.getTransition("t0");
  12414. }
  12415. }
  12416. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  12417. class ui_Component142 extends fgui.GComponent {
  12418. static createInstance() {
  12419. return (fgui.UIPackage.createObject("game", "Component142"));
  12420. }
  12421. onConstruct() {
  12422. this.n41 = (this.getChild("n41"));
  12423. this.n42 = (this.getChild("n42"));
  12424. }
  12425. }
  12426. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  12427. class ui_main_guang extends fgui.GComponent {
  12428. static createInstance() {
  12429. return (fgui.UIPackage.createObject("game", "main_guang"));
  12430. }
  12431. onConstruct() {
  12432. this.n1 = (this.getChild("n1"));
  12433. this.n2 = (this.getChild("n2"));
  12434. this.n3 = (this.getChild("n3"));
  12435. this.n4 = (this.getChild("n4"));
  12436. this.n5 = (this.getChild("n5"));
  12437. this.n6 = (this.getChild("n6"));
  12438. this.n8 = (this.getChild("n8"));
  12439. this.t0 = this.getTransition("t0");
  12440. }
  12441. }
  12442. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  12443. class ui_try_com1 extends fgui.GComponent {
  12444. static createInstance() {
  12445. return (fgui.UIPackage.createObject("game", "try_com1"));
  12446. }
  12447. onConstruct() {
  12448. this.c1 = this.getController("c1");
  12449. this.n0 = (this.getChild("n0"));
  12450. this.n2 = (this.getChild("n2"));
  12451. this.cancelBtn = (this.getChild("cancelBtn"));
  12452. this.videoBtn = (this.getChild("videoBtn"));
  12453. this.n9 = (this.getChild("n9"));
  12454. this.n24 = (this.getChild("n24"));
  12455. this.titleTxt = (this.getChild("titleTxt"));
  12456. this.n32 = (this.getChild("n32"));
  12457. this.n29 = (this.getChild("n29"));
  12458. this.n36 = (this.getChild("n36"));
  12459. this.txtTime = (this.getChild("txtTime"));
  12460. this.t0 = this.getTransition("t0");
  12461. }
  12462. }
  12463. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  12464. class ui_try_com2 extends fgui.GComponent {
  12465. static createInstance() {
  12466. return (fgui.UIPackage.createObject("game", "try_com2"));
  12467. }
  12468. onConstruct() {
  12469. this.skillicon = (this.getChild("skillicon"));
  12470. this.n35 = (this.getChild("n35"));
  12471. this.n31 = (this.getChild("n31"));
  12472. this.n32 = (this.getChild("n32"));
  12473. this.n33 = (this.getChild("n33"));
  12474. this.n34 = (this.getChild("n34"));
  12475. }
  12476. }
  12477. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  12478. class ui_try_com3 extends fgui.GComponent {
  12479. static createInstance() {
  12480. return (fgui.UIPackage.createObject("game", "try_com3"));
  12481. }
  12482. onConstruct() {
  12483. this.n33 = (this.getChild("n33"));
  12484. this.n34 = (this.getChild("n34"));
  12485. this.n35 = (this.getChild("n35"));
  12486. this.t0 = this.getTransition("t0");
  12487. }
  12488. }
  12489. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  12490. class ui_huihe1 extends fgui.GComponent {
  12491. static createInstance() {
  12492. return (fgui.UIPackage.createObject("game", "huihe1"));
  12493. }
  12494. onConstruct() {
  12495. this.n0 = (this.getChild("n0"));
  12496. this.n1 = (this.getChild("n1"));
  12497. this.t0 = this.getTransition("t0");
  12498. }
  12499. }
  12500. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  12501. class ui_huihe2 extends fgui.GComponent {
  12502. static createInstance() {
  12503. return (fgui.UIPackage.createObject("game", "huihe2"));
  12504. }
  12505. onConstruct() {
  12506. this.n0 = (this.getChild("n0"));
  12507. this.n1 = (this.getChild("n1"));
  12508. this.t0 = this.getTransition("t0");
  12509. }
  12510. }
  12511. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  12512. class ui_Component143 extends fgui.GComponent {
  12513. static createInstance() {
  12514. return (fgui.UIPackage.createObject("game", "Component143"));
  12515. }
  12516. onConstruct() {
  12517. this.n3 = (this.getChild("n3"));
  12518. this.n4 = (this.getChild("n4"));
  12519. this.n5 = (this.getChild("n5"));
  12520. this.n6 = (this.getChild("n6"));
  12521. this.n7 = (this.getChild("n7"));
  12522. this.n8 = (this.getChild("n8"));
  12523. this.n9 = (this.getChild("n9"));
  12524. this.n10 = (this.getChild("n10"));
  12525. this.t0 = this.getTransition("t0");
  12526. }
  12527. }
  12528. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  12529. class ui_dh_jingbi2 extends fgui.GComponent {
  12530. static createInstance() {
  12531. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  12532. }
  12533. onConstruct() {
  12534. this.n0 = (this.getChild("n0"));
  12535. this.n1 = (this.getChild("n1"));
  12536. this.n2 = (this.getChild("n2"));
  12537. this.n3 = (this.getChild("n3"));
  12538. this.n4 = (this.getChild("n4"));
  12539. this.n5 = (this.getChild("n5"));
  12540. this.n6 = (this.getChild("n6"));
  12541. this.n8 = (this.getChild("n8"));
  12542. this.n10 = (this.getChild("n10"));
  12543. this.t0 = this.getTransition("t0");
  12544. }
  12545. }
  12546. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  12547. class ui_dh_jingbi2_1 extends fgui.GComponent {
  12548. static createInstance() {
  12549. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  12550. }
  12551. onConstruct() {
  12552. this.n1 = (this.getChild("n1"));
  12553. this.n4 = (this.getChild("n4"));
  12554. this.t0 = this.getTransition("t0");
  12555. }
  12556. }
  12557. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  12558. class ui_dh_jingbi3 extends fgui.GComponent {
  12559. static createInstance() {
  12560. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  12561. }
  12562. onConstruct() {
  12563. this.n0 = (this.getChild("n0"));
  12564. this.n1 = (this.getChild("n1"));
  12565. this.n2 = (this.getChild("n2"));
  12566. this.n3 = (this.getChild("n3"));
  12567. this.n4 = (this.getChild("n4"));
  12568. this.n5 = (this.getChild("n5"));
  12569. this.n6 = (this.getChild("n6"));
  12570. this.n8 = (this.getChild("n8"));
  12571. this.n10 = (this.getChild("n10"));
  12572. this.t0 = this.getTransition("t0");
  12573. }
  12574. }
  12575. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  12576. class ui_dh_jingbi3_1 extends fgui.GComponent {
  12577. static createInstance() {
  12578. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  12579. }
  12580. onConstruct() {
  12581. this.n3 = (this.getChild("n3"));
  12582. this.n1 = (this.getChild("n1"));
  12583. this.t0 = this.getTransition("t0");
  12584. }
  12585. }
  12586. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  12587. class ui_hb_jinbi1 extends fgui.GButton {
  12588. static createInstance() {
  12589. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  12590. }
  12591. onConstruct() {
  12592. this.n20 = (this.getChild("n20"));
  12593. this.n25 = (this.getChild("n25"));
  12594. this.coinTxt = (this.getChild("coinTxt"));
  12595. this.n28 = (this.getChild("n28"));
  12596. this.n32 = (this.getChild("n32"));
  12597. this.n38 = (this.getChild("n38"));
  12598. this.n45 = (this.getChild("n45"));
  12599. this.getTips = (this.getChild("getTips"));
  12600. this.n39 = (this.getChild("n39"));
  12601. this.diamondTxt = (this.getChild("diamondTxt"));
  12602. this.n41 = (this.getChild("n41"));
  12603. this.n42 = (this.getChild("n42"));
  12604. this.n46 = (this.getChild("n46"));
  12605. this.n47 = (this.getChild("n47"));
  12606. this.n48 = (this.getChild("n48"));
  12607. this.t0 = this.getTransition("t0");
  12608. }
  12609. }
  12610. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  12611. class ui_hb_jinbi2 extends fgui.GButton {
  12612. static createInstance() {
  12613. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  12614. }
  12615. onConstruct() {
  12616. this.n20 = (this.getChild("n20"));
  12617. this.n25 = (this.getChild("n25"));
  12618. this.coinTxt = (this.getChild("coinTxt"));
  12619. this.n28 = (this.getChild("n28"));
  12620. this.n32 = (this.getChild("n32"));
  12621. this.n38 = (this.getChild("n38"));
  12622. this.n39 = (this.getChild("n39"));
  12623. this.diamondTxt = (this.getChild("diamondTxt"));
  12624. this.n41 = (this.getChild("n41"));
  12625. this.n42 = (this.getChild("n42"));
  12626. this.n43 = (this.getChild("n43"));
  12627. this.n44 = (this.getChild("n44"));
  12628. this.n45 = (this.getChild("n45"));
  12629. this.t0 = this.getTransition("t0");
  12630. }
  12631. }
  12632. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  12633. class ui_hb_jinbi3 extends fgui.GButton {
  12634. static createInstance() {
  12635. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  12636. }
  12637. onConstruct() {
  12638. this.n20 = (this.getChild("n20"));
  12639. this.n25 = (this.getChild("n25"));
  12640. this.coinTxt = (this.getChild("coinTxt"));
  12641. this.n28 = (this.getChild("n28"));
  12642. this.n32 = (this.getChild("n32"));
  12643. this.n38 = (this.getChild("n38"));
  12644. this.n39 = (this.getChild("n39"));
  12645. this.diamondTxt = (this.getChild("diamondTxt"));
  12646. this.n41 = (this.getChild("n41"));
  12647. this.n42 = (this.getChild("n42"));
  12648. this.n43 = (this.getChild("n43"));
  12649. this.n44 = (this.getChild("n44"));
  12650. this.n45 = (this.getChild("n45"));
  12651. this.t0 = this.getTransition("t0");
  12652. }
  12653. }
  12654. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  12655. class ui_Component104 extends fgui.GComponent {
  12656. static createInstance() {
  12657. return (fgui.UIPackage.createObject("game", "Component104"));
  12658. }
  12659. onConstruct() {
  12660. this.c1 = this.getController("c1");
  12661. this.n12 = (this.getChild("n12"));
  12662. this.coinBtn = (this.getChild("coinBtn"));
  12663. this.diamondBtn = (this.getChild("diamondBtn"));
  12664. this.node3 = (this.getChild("node3"));
  12665. this.node4 = (this.getChild("node4"));
  12666. this.node5 = (this.getChild("node5"));
  12667. this.node1 = (this.getChild("node1"));
  12668. this.node2 = (this.getChild("node2"));
  12669. this.node6 = (this.getChild("node6"));
  12670. this.t0 = this.getTransition("t0");
  12671. }
  12672. }
  12673. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  12674. class ui_Component105 extends fgui.GButton {
  12675. static createInstance() {
  12676. return (fgui.UIPackage.createObject("game", "Component105"));
  12677. }
  12678. onConstruct() {
  12679. this.c1 = this.getController("c1");
  12680. this.n49 = (this.getChild("n49"));
  12681. this.n18 = (this.getChild("n18"));
  12682. this.n46 = (this.getChild("n46"));
  12683. this.n48 = (this.getChild("n48"));
  12684. }
  12685. }
  12686. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  12687. class ui_Component106 extends fgui.GButton {
  12688. static createInstance() {
  12689. return (fgui.UIPackage.createObject("game", "Component106"));
  12690. }
  12691. onConstruct() {
  12692. this.c1 = this.getController("c1");
  12693. this.n49 = (this.getChild("n49"));
  12694. this.n18 = (this.getChild("n18"));
  12695. this.n46 = (this.getChild("n46"));
  12696. this.n48 = (this.getChild("n48"));
  12697. }
  12698. }
  12699. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  12700. class ui_hb_zs1 extends fgui.GButton {
  12701. static createInstance() {
  12702. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  12703. }
  12704. onConstruct() {
  12705. this.c1 = this.getController("c1");
  12706. this.n20 = (this.getChild("n20"));
  12707. this.n21 = (this.getChild("n21"));
  12708. this.n26 = (this.getChild("n26"));
  12709. this.n27 = (this.getChild("n27"));
  12710. this.shareTxt = (this.getChild("shareTxt"));
  12711. this.n32 = (this.getChild("n32"));
  12712. this.n38 = (this.getChild("n38"));
  12713. this.n39 = (this.getChild("n39"));
  12714. this.n44 = (this.getChild("n44"));
  12715. this.diamondTxt = (this.getChild("diamondTxt"));
  12716. this.n41 = (this.getChild("n41"));
  12717. this.n45 = (this.getChild("n45"));
  12718. this.n47 = (this.getChild("n47"));
  12719. this.n48 = (this.getChild("n48"));
  12720. this.randTxt = (this.getChild("randTxt"));
  12721. this.n50 = (this.getChild("n50"));
  12722. this.t0 = this.getTransition("t0");
  12723. }
  12724. }
  12725. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  12726. class ui_dh_zs1 extends fgui.GComponent {
  12727. static createInstance() {
  12728. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  12729. }
  12730. onConstruct() {
  12731. this.n10 = (this.getChild("n10"));
  12732. this.n9 = (this.getChild("n9"));
  12733. this.n1 = (this.getChild("n1"));
  12734. this.n2 = (this.getChild("n2"));
  12735. this.n3 = (this.getChild("n3"));
  12736. this.n4 = (this.getChild("n4"));
  12737. this.n5 = (this.getChild("n5"));
  12738. this.n6 = (this.getChild("n6"));
  12739. this.n8 = (this.getChild("n8"));
  12740. this.n11 = (this.getChild("n11"));
  12741. this.t0 = this.getTransition("t0");
  12742. }
  12743. }
  12744. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  12745. class ui_dh_zs1_1 extends fgui.GComponent {
  12746. static createInstance() {
  12747. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  12748. }
  12749. onConstruct() {
  12750. this.n3 = (this.getChild("n3"));
  12751. this.n1 = (this.getChild("n1"));
  12752. this.t0 = this.getTransition("t0");
  12753. }
  12754. }
  12755. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  12756. class ui_hb_zs2 extends fgui.GButton {
  12757. static createInstance() {
  12758. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  12759. }
  12760. onConstruct() {
  12761. this.n20 = (this.getChild("n20"));
  12762. this.n21 = (this.getChild("n21"));
  12763. this.n26 = (this.getChild("n26"));
  12764. this.n27 = (this.getChild("n27"));
  12765. this.n32 = (this.getChild("n32"));
  12766. this.n38 = (this.getChild("n38"));
  12767. this.n39 = (this.getChild("n39"));
  12768. this.n44 = (this.getChild("n44"));
  12769. this.diamondTxt = (this.getChild("diamondTxt"));
  12770. this.n41 = (this.getChild("n41"));
  12771. this.n45 = (this.getChild("n45"));
  12772. this.t0 = this.getTransition("t0");
  12773. }
  12774. }
  12775. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  12776. class ui_hb_zs3 extends fgui.GButton {
  12777. static createInstance() {
  12778. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  12779. }
  12780. onConstruct() {
  12781. this.n20 = (this.getChild("n20"));
  12782. this.n21 = (this.getChild("n21"));
  12783. this.n26 = (this.getChild("n26"));
  12784. this.n27 = (this.getChild("n27"));
  12785. this.n32 = (this.getChild("n32"));
  12786. this.n38 = (this.getChild("n38"));
  12787. this.n47 = (this.getChild("n47"));
  12788. this.t0 = this.getTransition("t0");
  12789. }
  12790. }
  12791. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12792. class ui_dh_zs2 extends fgui.GComponent {
  12793. static createInstance() {
  12794. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12795. }
  12796. onConstruct() {
  12797. this.n10 = (this.getChild("n10"));
  12798. this.n9 = (this.getChild("n9"));
  12799. this.n1 = (this.getChild("n1"));
  12800. this.n2 = (this.getChild("n2"));
  12801. this.n3 = (this.getChild("n3"));
  12802. this.n4 = (this.getChild("n4"));
  12803. this.n5 = (this.getChild("n5"));
  12804. this.n6 = (this.getChild("n6"));
  12805. this.n8 = (this.getChild("n8"));
  12806. this.n11 = (this.getChild("n11"));
  12807. this.t0 = this.getTransition("t0");
  12808. }
  12809. }
  12810. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12811. class ui_dh_zs2_1 extends fgui.GComponent {
  12812. static createInstance() {
  12813. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12814. }
  12815. onConstruct() {
  12816. this.n3 = (this.getChild("n3"));
  12817. this.n1 = (this.getChild("n1"));
  12818. this.t0 = this.getTransition("t0");
  12819. }
  12820. }
  12821. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12822. class ui_dh_zs3 extends fgui.GComponent {
  12823. static createInstance() {
  12824. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12825. }
  12826. onConstruct() {
  12827. this.n10 = (this.getChild("n10"));
  12828. this.n9 = (this.getChild("n9"));
  12829. this.n1 = (this.getChild("n1"));
  12830. this.n2 = (this.getChild("n2"));
  12831. this.n3 = (this.getChild("n3"));
  12832. this.n4 = (this.getChild("n4"));
  12833. this.n5 = (this.getChild("n5"));
  12834. this.n6 = (this.getChild("n6"));
  12835. this.n8 = (this.getChild("n8"));
  12836. this.n11 = (this.getChild("n11"));
  12837. this.t0 = this.getTransition("t0");
  12838. }
  12839. }
  12840. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12841. class ui_dh_zs3_1 extends fgui.GComponent {
  12842. static createInstance() {
  12843. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12844. }
  12845. onConstruct() {
  12846. this.n3 = (this.getChild("n3"));
  12847. this.n1 = (this.getChild("n1"));
  12848. this.t0 = this.getTransition("t0");
  12849. }
  12850. }
  12851. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12852. class ui_Component107 extends fgui.GComponent {
  12853. static createInstance() {
  12854. return (fgui.UIPackage.createObject("game", "Component107"));
  12855. }
  12856. onConstruct() {
  12857. this.n18 = (this.getChild("n18"));
  12858. this.n19 = (this.getChild("n19"));
  12859. this.n20 = (this.getChild("n20"));
  12860. this.n21 = (this.getChild("n21"));
  12861. this.n22 = (this.getChild("n22"));
  12862. this.levelTxt = (this.getChild("levelTxt"));
  12863. this.t0 = this.getTransition("t0");
  12864. }
  12865. }
  12866. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12867. class ui_box_com1 extends fgui.GComponent {
  12868. static createInstance() {
  12869. return (fgui.UIPackage.createObject("game", "box_com1"));
  12870. }
  12871. onConstruct() {
  12872. this.n14 = (this.getChild("n14"));
  12873. this.n6 = (this.getChild("n6"));
  12874. this.t0 = this.getTransition("t0");
  12875. }
  12876. }
  12877. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12878. class ui_box_com2 extends fgui.GProgressBar {
  12879. static createInstance() {
  12880. return (fgui.UIPackage.createObject("game", "box_com2"));
  12881. }
  12882. onConstruct() {
  12883. this.bg0 = (this.getChild("bg0"));
  12884. this.bg = (this.getChild("bg"));
  12885. this.bar = (this.getChild("bar"));
  12886. this.n7 = (this.getChild("n7"));
  12887. this.n8 = (this.getChild("n8"));
  12888. this.n10 = (this.getChild("n10"));
  12889. this.n11 = (this.getChild("n11"));
  12890. this.n12 = (this.getChild("n12"));
  12891. }
  12892. }
  12893. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12894. class ui_box_com4 extends fgui.GComponent {
  12895. static createInstance() {
  12896. return (fgui.UIPackage.createObject("game", "box_com4"));
  12897. }
  12898. onConstruct() {
  12899. this.n8 = (this.getChild("n8"));
  12900. this.t0 = this.getTransition("t0");
  12901. }
  12902. }
  12903. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12904. class ui_box_com3 extends fgui.GComponent {
  12905. static createInstance() {
  12906. return (fgui.UIPackage.createObject("game", "box_com3"));
  12907. }
  12908. onConstruct() {
  12909. this.n2 = (this.getChild("n2"));
  12910. this.n3 = (this.getChild("n3"));
  12911. this.n4 = (this.getChild("n4"));
  12912. this.n5 = (this.getChild("n5"));
  12913. this.t0 = this.getTransition("t0");
  12914. this.t1 = this.getTransition("t1");
  12915. }
  12916. }
  12917. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12918. class ui_Component97 extends fgui.GComponent {
  12919. static createInstance() {
  12920. return (fgui.UIPackage.createObject("game", "Component97"));
  12921. }
  12922. onConstruct() {
  12923. this.c1 = this.getController("c1");
  12924. this.n46 = (this.getChild("n46"));
  12925. this.diamondNode = (this.getChild("diamondNode"));
  12926. this.coinNode = (this.getChild("coinNode"));
  12927. this.t0 = this.getTransition("t0");
  12928. }
  12929. }
  12930. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12931. class ui_Component98 extends fgui.GButton {
  12932. static createInstance() {
  12933. return (fgui.UIPackage.createObject("game", "Component98"));
  12934. }
  12935. onConstruct() {
  12936. this.n8 = (this.getChild("n8"));
  12937. this.n40 = (this.getChild("n40"));
  12938. }
  12939. }
  12940. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12941. class ui_Component28_11 extends fgui.GButton {
  12942. static createInstance() {
  12943. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12944. }
  12945. onConstruct() {
  12946. this.c1 = this.getController("c1");
  12947. this.n12 = (this.getChild("n12"));
  12948. this.n17 = (this.getChild("n17"));
  12949. this.n13 = (this.getChild("n13"));
  12950. this.diamondTxt = (this.getChild("diamondTxt"));
  12951. this.n15 = (this.getChild("n15"));
  12952. this.n16 = (this.getChild("n16"));
  12953. }
  12954. }
  12955. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12956. class ui_Component58_11 extends fgui.GComponent {
  12957. static createInstance() {
  12958. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12959. }
  12960. onConstruct() {
  12961. this.c1 = this.getController("c1");
  12962. this.n23 = (this.getChild("n23"));
  12963. this.n41 = (this.getChild("n41"));
  12964. this.myList = (this.getChild("myList"));
  12965. this.djList = (this.getChild("djList"));
  12966. this.n45 = (this.getChild("n45"));
  12967. this.n_item = (this.getChild("n_item"));
  12968. this.t0 = this.getTransition("t0");
  12969. }
  12970. }
  12971. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12972. class ui_Component100 extends fgui.GComponent {
  12973. static createInstance() {
  12974. return (fgui.UIPackage.createObject("game", "Component100"));
  12975. }
  12976. onConstruct() {
  12977. this.c1 = this.getController("c1");
  12978. this.n75 = (this.getChild("n75"));
  12979. this.n76 = (this.getChild("n76"));
  12980. this.n80 = (this.getChild("n80"));
  12981. this.txt = (this.getChild("txt"));
  12982. this.spineRoot = (this.getChild("spineRoot"));
  12983. }
  12984. }
  12985. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12986. class ui_Component101 extends fgui.GComponent {
  12987. static createInstance() {
  12988. return (fgui.UIPackage.createObject("game", "Component101"));
  12989. }
  12990. onConstruct() {
  12991. this.c1 = this.getController("c1");
  12992. this.n36 = (this.getChild("n36"));
  12993. this.n35 = (this.getChild("n35"));
  12994. this.n33 = (this.getChild("n33"));
  12995. this.n34 = (this.getChild("n34"));
  12996. }
  12997. }
  12998. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12999. class ui_Component53 extends fgui.GComponent {
  13000. static createInstance() {
  13001. return (fgui.UIPackage.createObject("game", "Component53"));
  13002. }
  13003. onConstruct() {
  13004. this.n0 = (this.getChild("n0"));
  13005. this.n1 = (this.getChild("n1"));
  13006. this.n2 = (this.getChild("n2"));
  13007. this.n3 = (this.getChild("n3"));
  13008. this.n4 = (this.getChild("n4"));
  13009. this.n5 = (this.getChild("n5"));
  13010. this.n6 = (this.getChild("n6"));
  13011. this.n7 = (this.getChild("n7"));
  13012. this.n8 = (this.getChild("n8"));
  13013. this.n9 = (this.getChild("n9"));
  13014. this.n10 = (this.getChild("n10"));
  13015. this.n11 = (this.getChild("n11"));
  13016. this.n12 = (this.getChild("n12"));
  13017. this.n13 = (this.getChild("n13"));
  13018. this.n14 = (this.getChild("n14"));
  13019. this.n15 = (this.getChild("n15"));
  13020. this.n16 = (this.getChild("n16"));
  13021. this.n19 = (this.getChild("n19"));
  13022. this.n20 = (this.getChild("n20"));
  13023. this.n21 = (this.getChild("n21"));
  13024. this.n22 = (this.getChild("n22"));
  13025. this.n23 = (this.getChild("n23"));
  13026. this.n24 = (this.getChild("n24"));
  13027. this.n25 = (this.getChild("n25"));
  13028. this.n26 = (this.getChild("n26"));
  13029. this.n27 = (this.getChild("n27"));
  13030. this.n28 = (this.getChild("n28"));
  13031. this.n29 = (this.getChild("n29"));
  13032. this.n30 = (this.getChild("n30"));
  13033. this.n31 = (this.getChild("n31"));
  13034. this.n32 = (this.getChild("n32"));
  13035. this.n33 = (this.getChild("n33"));
  13036. this.n34 = (this.getChild("n34"));
  13037. this.n35 = (this.getChild("n35"));
  13038. this.t0 = this.getTransition("t0");
  13039. }
  13040. }
  13041. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13042. class ui_Component58 extends fgui.GComponent {
  13043. static createInstance() {
  13044. return (fgui.UIPackage.createObject("game", "Component58"));
  13045. }
  13046. onConstruct() {
  13047. this.n23 = (this.getChild("n23"));
  13048. this.n41 = (this.getChild("n41"));
  13049. this.n8 = (this.getChild("n8"));
  13050. this.skillList = (this.getChild("skillList"));
  13051. this.t0 = this.getTransition("t0");
  13052. }
  13053. }
  13054. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13055. class ui_Component59 extends fgui.GComponent {
  13056. static createInstance() {
  13057. return (fgui.UIPackage.createObject("game", "Component59"));
  13058. }
  13059. onConstruct() {
  13060. this.n3 = (this.getChild("n3"));
  13061. this.msgTxt = (this.getChild("msgTxt"));
  13062. this.t0 = this.getTransition("t0");
  13063. }
  13064. }
  13065. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13066. class ui_RulerNode extends fgui.GComponent {
  13067. static createInstance() {
  13068. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13069. }
  13070. onConstruct() {
  13071. this.n6 = (this.getChild("n6"));
  13072. this.n4 = (this.getChild("n4"));
  13073. this.img1 = (this.getChild("img1"));
  13074. this.img2 = (this.getChild("img2"));
  13075. }
  13076. }
  13077. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13078. class ui_Component108 extends fgui.GComponent {
  13079. static createInstance() {
  13080. return (fgui.UIPackage.createObject("game", "Component108"));
  13081. }
  13082. onConstruct() {
  13083. this.n19 = (this.getChild("n19"));
  13084. this.t0 = this.getTransition("t0");
  13085. }
  13086. }
  13087. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13088. class ui_Component63 extends fgui.GComponent {
  13089. static createInstance() {
  13090. return (fgui.UIPackage.createObject("game", "Component63"));
  13091. }
  13092. onConstruct() {
  13093. this.n66 = (this.getChild("n66"));
  13094. this.n56 = (this.getChild("n56"));
  13095. this.n63 = (this.getChild("n63"));
  13096. this.n65 = (this.getChild("n65"));
  13097. this.t0 = this.getTransition("t0");
  13098. }
  13099. }
  13100. ui_Component63.URL = "ui://isxx5ak7h657452";
  13101. class ui_topNode extends fgui.GComponent {
  13102. static createInstance() {
  13103. return (fgui.UIPackage.createObject("game", "topNode"));
  13104. }
  13105. onConstruct() {
  13106. this.selfProgress = (this.getChild("selfProgress"));
  13107. this.aiProgress = (this.getChild("aiProgress"));
  13108. this.selfKuang = (this.getChild("selfKuang"));
  13109. this.aiKuang = (this.getChild("aiKuang"));
  13110. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13111. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13112. this.n33 = (this.getChild("n33"));
  13113. this.n34 = (this.getChild("n34"));
  13114. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13115. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13116. this.selfBallList = (this.getChild("selfBallList"));
  13117. this.aiBallList = (this.getChild("aiBallList"));
  13118. this.middleNode = (this.getChild("middleNode"));
  13119. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13120. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13121. this.scoreNode = (this.getChild("scoreNode"));
  13122. this.selfTips = (this.getChild("selfTips"));
  13123. this.aiTips = (this.getChild("aiTips"));
  13124. }
  13125. }
  13126. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13127. class ui_selfProgress extends fgui.GProgressBar {
  13128. static createInstance() {
  13129. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13130. }
  13131. onConstruct() {
  13132. this.n3 = (this.getChild("n3"));
  13133. this.bar = (this.getChild("bar"));
  13134. }
  13135. }
  13136. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13137. class ui_aiProgress extends fgui.GProgressBar {
  13138. static createInstance() {
  13139. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13140. }
  13141. onConstruct() {
  13142. this.n3 = (this.getChild("n3"));
  13143. this.bar = (this.getChild("bar"));
  13144. }
  13145. }
  13146. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13147. class ui_ballDisplay extends fgui.GComponent {
  13148. static createInstance() {
  13149. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13150. }
  13151. onConstruct() {
  13152. this.myImg = (this.getChild("myImg"));
  13153. }
  13154. }
  13155. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13156. class ui_moveNode extends fgui.GComponent {
  13157. static createInstance() {
  13158. return (fgui.UIPackage.createObject("game", "moveNode"));
  13159. }
  13160. onConstruct() {
  13161. this.n8 = (this.getChild("n8"));
  13162. this.finger = (this.getChild("finger"));
  13163. }
  13164. }
  13165. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13166. class ui_cancelBtn extends fgui.GButton {
  13167. static createInstance() {
  13168. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13169. }
  13170. onConstruct() {
  13171. this.c1 = this.getController("c1");
  13172. this.n0 = (this.getChild("n0"));
  13173. this.n1 = (this.getChild("n1"));
  13174. }
  13175. }
  13176. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13177. class ui_shareBtn extends fgui.GButton {
  13178. static createInstance() {
  13179. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13180. }
  13181. onConstruct() {
  13182. this.c1 = this.getController("c1");
  13183. this.n2 = (this.getChild("n2"));
  13184. this.n1 = (this.getChild("n1"));
  13185. this.n3 = (this.getChild("n3"));
  13186. this.n4 = (this.getChild("n4"));
  13187. this.n5 = (this.getChild("n5"));
  13188. this.n6 = (this.getChild("n6"));
  13189. }
  13190. }
  13191. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13192. class ui_share2Btn extends fgui.GButton {
  13193. static createInstance() {
  13194. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13195. }
  13196. onConstruct() {
  13197. this.n3 = (this.getChild("n3"));
  13198. }
  13199. }
  13200. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13201. class ui_rodMethodNode extends fgui.GComponent {
  13202. static createInstance() {
  13203. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13204. }
  13205. onConstruct() {
  13206. this.bg = (this.getChild("bg"));
  13207. this.dot = (this.getChild("dot"));
  13208. }
  13209. }
  13210. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13211. class ui_sureBtn extends fgui.GButton {
  13212. static createInstance() {
  13213. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13214. }
  13215. onConstruct() {
  13216. this.n2 = (this.getChild("n2"));
  13217. this.n1 = (this.getChild("n1"));
  13218. }
  13219. }
  13220. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13221. class ui_Component18 extends fgui.GComponent {
  13222. static createInstance() {
  13223. return (fgui.UIPackage.createObject("game", "Component18"));
  13224. }
  13225. onConstruct() {
  13226. this.c1 = this.getController("c1");
  13227. this.nameTxt = (this.getChild("nameTxt"));
  13228. this.headImg = (this.getChild("headImg"));
  13229. this.n24 = (this.getChild("n24"));
  13230. this.skillImg = (this.getChild("skillImg"));
  13231. this.skillTxt = (this.getChild("skillTxt"));
  13232. }
  13233. }
  13234. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  13235. class ui_Component45 extends fgui.GComponent {
  13236. static createInstance() {
  13237. return (fgui.UIPackage.createObject("game", "Component45"));
  13238. }
  13239. onConstruct() {
  13240. this.c1 = this.getController("c1");
  13241. this.n40 = (this.getChild("n40"));
  13242. this.n41 = (this.getChild("n41"));
  13243. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  13244. this.n42 = (this.getChild("n42"));
  13245. this.awardTxt = (this.getChild("awardTxt"));
  13246. this.n44 = (this.getChild("n44"));
  13247. this.t0 = this.getTransition("t0");
  13248. }
  13249. }
  13250. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  13251. class ui_emotionDisplay extends fgui.GButton {
  13252. static createInstance() {
  13253. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  13254. }
  13255. onConstruct() {
  13256. this.myIcon = (this.getChild("myIcon"));
  13257. }
  13258. }
  13259. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  13260. class ui_Component49 extends fgui.GButton {
  13261. static createInstance() {
  13262. return (fgui.UIPackage.createObject("game", "Component49"));
  13263. }
  13264. onConstruct() {
  13265. this.n69 = (this.getChild("n69"));
  13266. this.n56 = (this.getChild("n56"));
  13267. }
  13268. }
  13269. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  13270. class ui_Component50 extends fgui.GButton {
  13271. static createInstance() {
  13272. return (fgui.UIPackage.createObject("game", "Component50"));
  13273. }
  13274. onConstruct() {
  13275. this.n54 = (this.getChild("n54"));
  13276. this.n65 = (this.getChild("n65"));
  13277. }
  13278. }
  13279. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  13280. class ui_Component51 extends fgui.GButton {
  13281. static createInstance() {
  13282. return (fgui.UIPackage.createObject("game", "Component51"));
  13283. }
  13284. onConstruct() {
  13285. this.c1 = this.getController("c1");
  13286. this.n51 = (this.getChild("n51"));
  13287. this.n54 = (this.getChild("n54"));
  13288. }
  13289. }
  13290. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  13291. class ui_Button5 extends fgui.GButton {
  13292. static createInstance() {
  13293. return (fgui.UIPackage.createObject("game", "Button5"));
  13294. }
  13295. onConstruct() {
  13296. this.c1 = this.getController("c1");
  13297. this.n0 = (this.getChild("n0"));
  13298. this.n2 = (this.getChild("n2"));
  13299. }
  13300. }
  13301. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  13302. class ui_Component124 extends fgui.GComponent {
  13303. static createInstance() {
  13304. return (fgui.UIPackage.createObject("game", "Component124"));
  13305. }
  13306. onConstruct() {
  13307. this.n22 = (this.getChild("n22"));
  13308. this.shareNode = (this.getChild("shareNode"));
  13309. }
  13310. }
  13311. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  13312. class ui_Component125 extends fgui.GComponent {
  13313. static createInstance() {
  13314. return (fgui.UIPackage.createObject("game", "Component125"));
  13315. }
  13316. onConstruct() {
  13317. this.n29 = (this.getChild("n29"));
  13318. this.coinTxt = (this.getChild("coinTxt"));
  13319. }
  13320. }
  13321. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  13322. class ui_Component52 extends fgui.GButton {
  13323. static createInstance() {
  13324. return (fgui.UIPackage.createObject("game", "Component52"));
  13325. }
  13326. onConstruct() {
  13327. this.n35 = (this.getChild("n35"));
  13328. this.n36 = (this.getChild("n36"));
  13329. }
  13330. }
  13331. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  13332. class ui_drawBtn extends fgui.GButton {
  13333. static createInstance() {
  13334. return (fgui.UIPackage.createObject("game", "drawBtn"));
  13335. }
  13336. onConstruct() {
  13337. this.c1 = this.getController("c1");
  13338. this.n2 = (this.getChild("n2"));
  13339. this.n1 = (this.getChild("n1"));
  13340. this.n5 = (this.getChild("n5"));
  13341. }
  13342. }
  13343. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13344. class ui_Component43 extends fgui.GButton {
  13345. static createInstance() {
  13346. return (fgui.UIPackage.createObject("game", "Component43"));
  13347. }
  13348. onConstruct() {
  13349. this.n49 = (this.getChild("n49"));
  13350. }
  13351. }
  13352. ui_Component43.URL = "ui://isxx5ak7iveg434";
  13353. class ui_wordsDisplay extends fgui.GComponent {
  13354. static createInstance() {
  13355. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  13356. }
  13357. onConstruct() {
  13358. this.txt = (this.getChild("txt"));
  13359. this.n63 = (this.getChild("n63"));
  13360. }
  13361. }
  13362. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  13363. class ui_Component_phb extends fgui.GComponent {
  13364. static createInstance() {
  13365. return (fgui.UIPackage.createObject("game", "Component_phb"));
  13366. }
  13367. onConstruct() {
  13368. this.n3 = (this.getChild("n3"));
  13369. this.n4 = (this.getChild("n4"));
  13370. }
  13371. }
  13372. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  13373. class ui_Component3 extends fgui.GComponent {
  13374. static createInstance() {
  13375. return (fgui.UIPackage.createObject("game", "Component3"));
  13376. }
  13377. onConstruct() {
  13378. this.n26 = (this.getChild("n26"));
  13379. this.n24 = (this.getChild("n24"));
  13380. this.nameTxt = (this.getChild("nameTxt"));
  13381. this.headRoot = (this.getChild("headRoot"));
  13382. }
  13383. }
  13384. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  13385. class ui_Component4 extends fgui.GComponent {
  13386. static createInstance() {
  13387. return (fgui.UIPackage.createObject("game", "Component4"));
  13388. }
  13389. onConstruct() {
  13390. this.headImg = (this.getChild("headImg"));
  13391. }
  13392. }
  13393. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  13394. class ui_Component7 extends fgui.GButton {
  13395. static createInstance() {
  13396. return (fgui.UIPackage.createObject("game", "Component7"));
  13397. }
  13398. onConstruct() {
  13399. this.n17 = (this.getChild("n17"));
  13400. }
  13401. }
  13402. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  13403. class ui_Component8 extends fgui.GButton {
  13404. static createInstance() {
  13405. return (fgui.UIPackage.createObject("game", "Component8"));
  13406. }
  13407. onConstruct() {
  13408. this.n19 = (this.getChild("n19"));
  13409. }
  13410. }
  13411. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  13412. class ui_Component10 extends fgui.GButton {
  13413. static createInstance() {
  13414. return (fgui.UIPackage.createObject("game", "Component10"));
  13415. }
  13416. onConstruct() {
  13417. this.c1 = this.getController("c1");
  13418. this.n40 = (this.getChild("n40"));
  13419. }
  13420. }
  13421. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  13422. class ui_Component11 extends fgui.GButton {
  13423. static createInstance() {
  13424. return (fgui.UIPackage.createObject("game", "Component11"));
  13425. }
  13426. onConstruct() {
  13427. this.n34 = (this.getChild("n34"));
  13428. }
  13429. }
  13430. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  13431. class ui_Component12 extends fgui.GButton {
  13432. static createInstance() {
  13433. return (fgui.UIPackage.createObject("game", "Component12"));
  13434. }
  13435. onConstruct() {
  13436. this.n35 = (this.getChild("n35"));
  13437. }
  13438. }
  13439. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  13440. class ui_Component13 extends fgui.GButton {
  13441. static createInstance() {
  13442. return (fgui.UIPackage.createObject("game", "Component13"));
  13443. }
  13444. onConstruct() {
  13445. this.n27 = (this.getChild("n27"));
  13446. this.n36 = (this.getChild("n36"));
  13447. }
  13448. }
  13449. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  13450. class ui_dh_js_tuowei extends fgui.GComponent {
  13451. static createInstance() {
  13452. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  13453. }
  13454. onConstruct() {
  13455. this.n19 = (this.getChild("n19"));
  13456. this.n18 = (this.getChild("n18"));
  13457. this.n0 = (this.getChild("n0"));
  13458. this.n3 = (this.getChild("n3"));
  13459. this.n4 = (this.getChild("n4"));
  13460. this.n5 = (this.getChild("n5"));
  13461. this.n6 = (this.getChild("n6"));
  13462. this.n8 = (this.getChild("n8"));
  13463. this.n9 = (this.getChild("n9"));
  13464. this.n10 = (this.getChild("n10"));
  13465. this.n11 = (this.getChild("n11"));
  13466. this.n12 = (this.getChild("n12"));
  13467. this.n13 = (this.getChild("n13"));
  13468. this.n14 = (this.getChild("n14"));
  13469. this.n15 = (this.getChild("n15"));
  13470. this.n20 = (this.getChild("n20"));
  13471. this.t0 = this.getTransition("t0");
  13472. this.t1 = this.getTransition("t1");
  13473. }
  13474. }
  13475. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  13476. class ui_dh_js_tw_g extends fgui.GComponent {
  13477. static createInstance() {
  13478. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  13479. }
  13480. onConstruct() {
  13481. this.n0 = (this.getChild("n0"));
  13482. this.n1 = (this.getChild("n1"));
  13483. this.t0 = this.getTransition("t0");
  13484. }
  13485. }
  13486. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  13487. class ui_dh_js_xingxing extends fgui.GComponent {
  13488. static createInstance() {
  13489. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  13490. }
  13491. onConstruct() {
  13492. this.n1 = (this.getChild("n1"));
  13493. this.n2 = (this.getChild("n2"));
  13494. this.n3 = (this.getChild("n3"));
  13495. this.n4 = (this.getChild("n4"));
  13496. this.n0 = (this.getChild("n0"));
  13497. this.t2 = this.getTransition("t2");
  13498. this.t1 = this.getTransition("t1");
  13499. }
  13500. }
  13501. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  13502. class ui_dh_zy_jiazai extends fgui.GComponent {
  13503. static createInstance() {
  13504. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  13505. }
  13506. onConstruct() {
  13507. this.c1 = this.getController("c1");
  13508. this.n0 = (this.getChild("n0"));
  13509. this.n1 = (this.getChild("n1"));
  13510. this.n2 = (this.getChild("n2"));
  13511. this.n4 = (this.getChild("n4"));
  13512. this.n5 = (this.getChild("n5"));
  13513. this.n6 = (this.getChild("n6"));
  13514. this.n8 = (this.getChild("n8"));
  13515. this.n7 = (this.getChild("n7"));
  13516. this.t0 = this.getTransition("t0");
  13517. }
  13518. }
  13519. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  13520. class ui_dh_js_xingxing2 extends fgui.GComponent {
  13521. static createInstance() {
  13522. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  13523. }
  13524. onConstruct() {
  13525. this.c1 = this.getController("c1");
  13526. this.n3 = (this.getChild("n3"));
  13527. this.n5 = (this.getChild("n5"));
  13528. this.n4 = (this.getChild("n4"));
  13529. this.n0 = (this.getChild("n0"));
  13530. this.n1 = (this.getChild("n1"));
  13531. this.n2 = (this.getChild("n2"));
  13532. }
  13533. }
  13534. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  13535. class ui_dh_js_tuowei2 extends fgui.GComponent {
  13536. static createInstance() {
  13537. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  13538. }
  13539. onConstruct() {
  13540. this.n19 = (this.getChild("n19"));
  13541. this.n21 = (this.getChild("n21"));
  13542. this.n0 = (this.getChild("n0"));
  13543. this.n3 = (this.getChild("n3"));
  13544. this.n4 = (this.getChild("n4"));
  13545. this.n5 = (this.getChild("n5"));
  13546. this.n6 = (this.getChild("n6"));
  13547. this.n8 = (this.getChild("n8"));
  13548. this.n9 = (this.getChild("n9"));
  13549. this.n10 = (this.getChild("n10"));
  13550. this.n11 = (this.getChild("n11"));
  13551. this.n12 = (this.getChild("n12"));
  13552. this.n13 = (this.getChild("n13"));
  13553. this.n14 = (this.getChild("n14"));
  13554. this.n15 = (this.getChild("n15"));
  13555. this.n23 = (this.getChild("n23"));
  13556. this.t0 = this.getTransition("t0");
  13557. this.t1 = this.getTransition("t1");
  13558. }
  13559. }
  13560. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  13561. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  13562. static createInstance() {
  13563. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  13564. }
  13565. onConstruct() {
  13566. this.n1 = (this.getChild("n1"));
  13567. this.n2 = (this.getChild("n2"));
  13568. this.t0 = this.getTransition("t0");
  13569. }
  13570. }
  13571. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  13572. class ui_dh_js_shibai_1 extends fgui.GComponent {
  13573. static createInstance() {
  13574. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  13575. }
  13576. onConstruct() {
  13577. this.n4 = (this.getChild("n4"));
  13578. this.n2 = (this.getChild("n2"));
  13579. this.n3 = (this.getChild("n3"));
  13580. this.idle = this.getTransition("idle");
  13581. this.attack = this.getTransition("attack");
  13582. }
  13583. }
  13584. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  13585. class ui_special extends fgui.GComponent {
  13586. static createInstance() {
  13587. return (fgui.UIPackage.createObject("game", "special"));
  13588. }
  13589. onConstruct() {
  13590. this.n18 = (this.getChild("n18"));
  13591. this.n19 = (this.getChild("n19"));
  13592. this.n20 = (this.getChild("n20"));
  13593. this.n21 = (this.getChild("n21"));
  13594. this.n22 = (this.getChild("n22"));
  13595. this.levelTxt = (this.getChild("levelTxt"));
  13596. this.n24 = (this.getChild("n24"));
  13597. this.n25 = (this.getChild("n25"));
  13598. this.t0 = this.getTransition("t0");
  13599. }
  13600. }
  13601. ui_special.URL = "ui://isxx5ak7j979v4i6";
  13602. class ui_Component145 extends fgui.GComponent {
  13603. static createInstance() {
  13604. return (fgui.UIPackage.createObject("game", "Component145"));
  13605. }
  13606. onConstruct() {
  13607. this.guanyuNode = (this.getChild("guanyuNode"));
  13608. }
  13609. }
  13610. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  13611. class ui_longBtn extends fgui.GButton {
  13612. static createInstance() {
  13613. return (fgui.UIPackage.createObject("game", "longBtn"));
  13614. }
  13615. onConstruct() {
  13616. this.c1 = this.getController("c1");
  13617. this.n2 = (this.getChild("n2"));
  13618. this.n1 = (this.getChild("n1"));
  13619. this.n4 = (this.getChild("n4"));
  13620. }
  13621. }
  13622. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  13623. class ui_Component146 extends fgui.GComponent {
  13624. static createInstance() {
  13625. return (fgui.UIPackage.createObject("game", "Component146"));
  13626. }
  13627. onConstruct() {
  13628. this.n89 = (this.getChild("n89"));
  13629. this.n90 = (this.getChild("n90"));
  13630. this.guideBtn = (this.getChild("guideBtn"));
  13631. }
  13632. }
  13633. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  13634. class ui_Component146_11 extends fgui.GComponent {
  13635. static createInstance() {
  13636. return (fgui.UIPackage.createObject("game", "Component146_11"));
  13637. }
  13638. onConstruct() {
  13639. this.n89 = (this.getChild("n89"));
  13640. this.n90 = (this.getChild("n90"));
  13641. this.guideBtn = (this.getChild("guideBtn"));
  13642. }
  13643. }
  13644. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  13645. class ui_Component111_1 extends fgui.GComponent {
  13646. static createInstance() {
  13647. return (fgui.UIPackage.createObject("game", "Component111_1"));
  13648. }
  13649. onConstruct() {
  13650. this.n68 = (this.getChild("n68"));
  13651. this.myMask = (this.getChild("myMask"));
  13652. }
  13653. }
  13654. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  13655. class ui_Component64_1 extends fgui.GComponent {
  13656. static createInstance() {
  13657. return (fgui.UIPackage.createObject("game", "Component64_1"));
  13658. }
  13659. onConstruct() {
  13660. this.n57 = (this.getChild("n57"));
  13661. this.n54 = (this.getChild("n54"));
  13662. this.n55 = (this.getChild("n55"));
  13663. this.n56 = (this.getChild("n56"));
  13664. this.t1 = this.getTransition("t1");
  13665. }
  13666. }
  13667. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  13668. class ui_ModeSelection_com123 extends fgui.GComponent {
  13669. static createInstance() {
  13670. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  13671. }
  13672. onConstruct() {
  13673. this.type1 = (this.getChild("type1"));
  13674. this.type2 = (this.getChild("type2"));
  13675. this.type3 = (this.getChild("type3"));
  13676. this.n38 = (this.getChild("n38"));
  13677. this.t0 = this.getTransition("t0");
  13678. }
  13679. }
  13680. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  13681. class ui_Component132_2 extends fgui.GComponent {
  13682. static createInstance() {
  13683. return (fgui.UIPackage.createObject("game", "Component132_2"));
  13684. }
  13685. onConstruct() {
  13686. this.n25 = (this.getChild("n25"));
  13687. this.n26 = (this.getChild("n26"));
  13688. this.n27 = (this.getChild("n27"));
  13689. this.t0 = this.getTransition("t0");
  13690. }
  13691. }
  13692. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  13693. class ui_UIPower$1 extends fgui.GComponent {
  13694. static createInstance() {
  13695. return (fgui.UIPackage.createObject("game", "UIPower"));
  13696. }
  13697. onConstruct() {
  13698. this.n11 = (this.getChild("n11"));
  13699. this.myNode = (this.getChild("myNode"));
  13700. this.t0 = this.getTransition("t0");
  13701. }
  13702. }
  13703. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  13704. class ui_Component133 extends fgui.GComponent {
  13705. static createInstance() {
  13706. return (fgui.UIPackage.createObject("game", "Component133"));
  13707. }
  13708. onConstruct() {
  13709. this.n29 = (this.getChild("n29"));
  13710. this.n30 = (this.getChild("n30"));
  13711. }
  13712. }
  13713. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  13714. class ui_Component134 extends fgui.GComponent {
  13715. static createInstance() {
  13716. return (fgui.UIPackage.createObject("game", "Component134"));
  13717. }
  13718. onConstruct() {
  13719. this.n30 = (this.getChild("n30"));
  13720. this.n31 = (this.getChild("n31"));
  13721. this.t0 = this.getTransition("t0");
  13722. }
  13723. }
  13724. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  13725. class ui_Component135 extends fgui.GComponent {
  13726. static createInstance() {
  13727. return (fgui.UIPackage.createObject("game", "Component135"));
  13728. }
  13729. onConstruct() {
  13730. this.n30 = (this.getChild("n30"));
  13731. this.t0 = this.getTransition("t0");
  13732. }
  13733. }
  13734. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  13735. class ui_Component137 extends fgui.GComponent {
  13736. static createInstance() {
  13737. return (fgui.UIPackage.createObject("game", "Component137"));
  13738. }
  13739. onConstruct() {
  13740. this.n28 = (this.getChild("n28"));
  13741. this.n29 = (this.getChild("n29"));
  13742. this.n30 = (this.getChild("n30"));
  13743. this.n32 = (this.getChild("n32"));
  13744. }
  13745. }
  13746. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  13747. class ui_dh_zuanshi extends fgui.GButton {
  13748. static createInstance() {
  13749. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  13750. }
  13751. onConstruct() {
  13752. this.n1 = (this.getChild("n1"));
  13753. this.n2 = (this.getChild("n2"));
  13754. this.n0 = (this.getChild("n0"));
  13755. this.n3 = (this.getChild("n3"));
  13756. this.n4 = (this.getChild("n4"));
  13757. }
  13758. }
  13759. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  13760. class ui_Component138 extends fgui.GComponent {
  13761. static createInstance() {
  13762. return (fgui.UIPackage.createObject("game", "Component138"));
  13763. }
  13764. onConstruct() {
  13765. this.n1 = (this.getChild("n1"));
  13766. this.n2 = (this.getChild("n2"));
  13767. this.t0 = this.getTransition("t0");
  13768. }
  13769. }
  13770. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  13771. class ui_Component139 extends fgui.GComponent {
  13772. static createInstance() {
  13773. return (fgui.UIPackage.createObject("game", "Component139"));
  13774. }
  13775. onConstruct() {
  13776. this.n0 = (this.getChild("n0"));
  13777. this.t0 = this.getTransition("t0");
  13778. }
  13779. }
  13780. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  13781. class ui_Component140 extends fgui.GComponent {
  13782. static createInstance() {
  13783. return (fgui.UIPackage.createObject("game", "Component140"));
  13784. }
  13785. onConstruct() {
  13786. this.n2 = (this.getChild("n2"));
  13787. this.n3 = (this.getChild("n3"));
  13788. this.t0 = this.getTransition("t0");
  13789. }
  13790. }
  13791. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  13792. class ui_Component141 extends fgui.GComponent {
  13793. static createInstance() {
  13794. return (fgui.UIPackage.createObject("game", "Component141"));
  13795. }
  13796. onConstruct() {
  13797. this.n0 = (this.getChild("n0"));
  13798. this.t0 = this.getTransition("t0");
  13799. }
  13800. }
  13801. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  13802. class ui_powerNode extends fgui.GProgressBar {
  13803. static createInstance() {
  13804. return (fgui.UIPackage.createObject("game", "powerNode"));
  13805. }
  13806. onConstruct() {
  13807. this.n2 = (this.getChild("n2"));
  13808. this.bar_v = (this.getChild("bar_v"));
  13809. this.showImg = (this.getChild("showImg"));
  13810. this.n12 = (this.getChild("n12"));
  13811. }
  13812. }
  13813. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13814. class ui_dh_jingbi1 extends fgui.GComponent {
  13815. static createInstance() {
  13816. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13817. }
  13818. onConstruct() {
  13819. this.n0 = (this.getChild("n0"));
  13820. this.n1 = (this.getChild("n1"));
  13821. this.n2 = (this.getChild("n2"));
  13822. this.n3 = (this.getChild("n3"));
  13823. this.n4 = (this.getChild("n4"));
  13824. this.n5 = (this.getChild("n5"));
  13825. this.n6 = (this.getChild("n6"));
  13826. this.n8 = (this.getChild("n8"));
  13827. this.t0 = this.getTransition("t0");
  13828. }
  13829. }
  13830. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13831. class ui_Component94 extends fgui.GButton {
  13832. static createInstance() {
  13833. return (fgui.UIPackage.createObject("game", "Component94"));
  13834. }
  13835. onConstruct() {
  13836. this.n77 = (this.getChild("n77"));
  13837. }
  13838. }
  13839. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13840. class ui_Component95 extends fgui.GButton {
  13841. static createInstance() {
  13842. return (fgui.UIPackage.createObject("game", "Component95"));
  13843. }
  13844. onConstruct() {
  13845. this.n77 = (this.getChild("n77"));
  13846. }
  13847. }
  13848. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13849. class ui_Component126 extends fgui.GComponent {
  13850. static createInstance() {
  13851. return (fgui.UIPackage.createObject("game", "Component126"));
  13852. }
  13853. onConstruct() {
  13854. this.c1 = this.getController("c1");
  13855. this.normalBtn = (this.getChild("normalBtn"));
  13856. this.tripleBtn = (this.getChild("tripleBtn"));
  13857. }
  13858. }
  13859. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13860. class ui_Component60 extends fgui.GComponent {
  13861. static createInstance() {
  13862. return (fgui.UIPackage.createObject("game", "Component60"));
  13863. }
  13864. onConstruct() {
  13865. this.c1 = this.getController("c1");
  13866. this.n48 = (this.getChild("n48"));
  13867. this.womanTxt = (this.getChild("womanTxt"));
  13868. this.t0 = this.getTransition("t0");
  13869. }
  13870. }
  13871. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13872. class ui_Component98_3 extends fgui.GButton {
  13873. static createInstance() {
  13874. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13875. }
  13876. onConstruct() {
  13877. this.c1 = this.getController("c1");
  13878. this.n8 = (this.getChild("n8"));
  13879. this.n41 = (this.getChild("n41"));
  13880. this.n40 = (this.getChild("n40"));
  13881. }
  13882. }
  13883. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13884. class ui_ModeSelection_com1 extends fgui.GButton {
  13885. static createInstance() {
  13886. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13887. }
  13888. onConstruct() {
  13889. this.n34 = (this.getChild("n34"));
  13890. this.n36 = (this.getChild("n36"));
  13891. this.n22 = (this.getChild("n22"));
  13892. this.n20 = (this.getChild("n20"));
  13893. this.n23 = (this.getChild("n23"));
  13894. this.n24 = (this.getChild("n24"));
  13895. this.n26 = (this.getChild("n26"));
  13896. this.n33 = (this.getChild("n33"));
  13897. this.coinImg = (this.getChild("coinImg"));
  13898. this.need = (this.getChild("need"));
  13899. this.n35 = (this.getChild("n35"));
  13900. this.n29 = (this.getChild("n29"));
  13901. this.tipsTxt = (this.getChild("tipsTxt"));
  13902. this.n30 = (this.getChild("n30"));
  13903. this.peopleTxt = (this.getChild("peopleTxt"));
  13904. this.t0 = this.getTransition("t0");
  13905. }
  13906. }
  13907. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13908. class ui_ModeSelection_com2 extends fgui.GButton {
  13909. static createInstance() {
  13910. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13911. }
  13912. onConstruct() {
  13913. this.n36 = (this.getChild("n36"));
  13914. this.n34 = (this.getChild("n34"));
  13915. this.n22 = (this.getChild("n22"));
  13916. this.n20 = (this.getChild("n20"));
  13917. this.n23 = (this.getChild("n23"));
  13918. this.n24 = (this.getChild("n24"));
  13919. this.n26 = (this.getChild("n26"));
  13920. this.n33 = (this.getChild("n33"));
  13921. this.coinImg = (this.getChild("coinImg"));
  13922. this.need = (this.getChild("need"));
  13923. this.n35 = (this.getChild("n35"));
  13924. this.n29 = (this.getChild("n29"));
  13925. this.tipsTxt = (this.getChild("tipsTxt"));
  13926. this.n30 = (this.getChild("n30"));
  13927. this.peopleTxt = (this.getChild("peopleTxt"));
  13928. this.t0 = this.getTransition("t0");
  13929. }
  13930. }
  13931. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13932. class ui_ModeSelection_com3 extends fgui.GButton {
  13933. static createInstance() {
  13934. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13935. }
  13936. onConstruct() {
  13937. this.n34 = (this.getChild("n34"));
  13938. this.n36 = (this.getChild("n36"));
  13939. this.n22 = (this.getChild("n22"));
  13940. this.n20 = (this.getChild("n20"));
  13941. this.n23 = (this.getChild("n23"));
  13942. this.n24 = (this.getChild("n24"));
  13943. this.n26 = (this.getChild("n26"));
  13944. this.n33 = (this.getChild("n33"));
  13945. this.coinImg = (this.getChild("coinImg"));
  13946. this.need = (this.getChild("need"));
  13947. this.n35 = (this.getChild("n35"));
  13948. this.n29 = (this.getChild("n29"));
  13949. this.tipsTxt = (this.getChild("tipsTxt"));
  13950. this.n30 = (this.getChild("n30"));
  13951. this.peopleTxt = (this.getChild("peopleTxt"));
  13952. this.t0 = this.getTransition("t0");
  13953. }
  13954. }
  13955. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13956. class ui_Invitation_com1 extends fgui.GComponent {
  13957. static createInstance() {
  13958. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13959. }
  13960. onConstruct() {
  13961. this.n14 = (this.getChild("n14"));
  13962. this.n13 = (this.getChild("n13"));
  13963. this.n3 = (this.getChild("n3"));
  13964. this.n1 = (this.getChild("n1"));
  13965. this.n6 = (this.getChild("n6"));
  13966. this.n7 = (this.getChild("n7"));
  13967. this.enterBtn = (this.getChild("enterBtn"));
  13968. this.n11 = (this.getChild("n11"));
  13969. this.n12 = (this.getChild("n12"));
  13970. this.n15 = (this.getChild("n15"));
  13971. this.t0 = this.getTransition("t0");
  13972. this.t1 = this.getTransition("t1");
  13973. }
  13974. }
  13975. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13976. class ui_Component87_1 extends fgui.GComponent {
  13977. static createInstance() {
  13978. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13979. }
  13980. onConstruct() {
  13981. this.n74 = (this.getChild("n74"));
  13982. this.n73 = (this.getChild("n73"));
  13983. this.ballTxt = (this.getChild("ballTxt"));
  13984. this.n76 = (this.getChild("n76"));
  13985. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13986. this.levelTxt = (this.getChild("levelTxt"));
  13987. this.n87 = (this.getChild("n87"));
  13988. this.n84 = (this.getChild("n84"));
  13989. this.hpTxt = (this.getChild("hpTxt"));
  13990. this.n89 = (this.getChild("n89"));
  13991. this.tipsTxt = (this.getChild("tipsTxt"));
  13992. }
  13993. }
  13994. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13995. class ui_sqg1 extends fgui.GComponent {
  13996. static createInstance() {
  13997. return (fgui.UIPackage.createObject("game", "sqg1"));
  13998. }
  13999. onConstruct() {
  14000. this.n1 = (this.getChild("n1"));
  14001. this.n0 = (this.getChild("n0"));
  14002. }
  14003. }
  14004. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14005. class ui_sqg2 extends fgui.GComponent {
  14006. static createInstance() {
  14007. return (fgui.UIPackage.createObject("game", "sqg2"));
  14008. }
  14009. onConstruct() {
  14010. this.n1 = (this.getChild("n1"));
  14011. this.n0 = (this.getChild("n0"));
  14012. }
  14013. }
  14014. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14015. class ui_sqg3 extends fgui.GComponent {
  14016. static createInstance() {
  14017. return (fgui.UIPackage.createObject("game", "sqg3"));
  14018. }
  14019. onConstruct() {
  14020. this.n1 = (this.getChild("n1"));
  14021. this.n0 = (this.getChild("n0"));
  14022. }
  14023. }
  14024. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14025. class ui_sqg4 extends fgui.GComponent {
  14026. static createInstance() {
  14027. return (fgui.UIPackage.createObject("game", "sqg4"));
  14028. }
  14029. onConstruct() {
  14030. this.n1 = (this.getChild("n1"));
  14031. this.n0 = (this.getChild("n0"));
  14032. }
  14033. }
  14034. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14035. class ui_Component36 extends fgui.GButton {
  14036. static createInstance() {
  14037. return (fgui.UIPackage.createObject("game", "Component36"));
  14038. }
  14039. onConstruct() {
  14040. this.c1 = this.getController("c1");
  14041. this.n53 = (this.getChild("n53"));
  14042. this.n56 = (this.getChild("n56"));
  14043. }
  14044. }
  14045. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14046. class ui_Component37 extends fgui.GButton {
  14047. static createInstance() {
  14048. return (fgui.UIPackage.createObject("game", "Component37"));
  14049. }
  14050. onConstruct() {
  14051. this.c1 = this.getController("c1");
  14052. this.n52 = (this.getChild("n52"));
  14053. this.n54 = (this.getChild("n54"));
  14054. }
  14055. }
  14056. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14057. class ui_UISetting extends fgui.GComponent {
  14058. static createInstance() {
  14059. return (fgui.UIPackage.createObject("game", "UISetting"));
  14060. }
  14061. onConstruct() {
  14062. this.c1 = this.getController("c1");
  14063. this.n4 = (this.getChild("n4"));
  14064. this.soundBtn = (this.getChild("soundBtn"));
  14065. this.shakeBtn = (this.getChild("shakeBtn"));
  14066. this.clickNode = (this.getChild("clickNode"));
  14067. this.xyBtn = (this.getChild("xyBtn"));
  14068. }
  14069. }
  14070. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14071. class ui_Component39 extends fgui.GComponent {
  14072. static createInstance() {
  14073. return (fgui.UIPackage.createObject("game", "Component39"));
  14074. }
  14075. onConstruct() {
  14076. this.n5 = (this.getChild("n5"));
  14077. this.n6 = (this.getChild("n6"));
  14078. this.n7 = (this.getChild("n7"));
  14079. this.t0 = this.getTransition("t0");
  14080. }
  14081. }
  14082. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14083. class ui_Component40 extends fgui.GButton {
  14084. static createInstance() {
  14085. return (fgui.UIPackage.createObject("game", "Component40"));
  14086. }
  14087. onConstruct() {
  14088. this.n46 = (this.getChild("n46"));
  14089. this.n47 = (this.getChild("n47"));
  14090. }
  14091. }
  14092. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14093. class ui_Component41 extends fgui.GComponent {
  14094. static createInstance() {
  14095. return (fgui.UIPackage.createObject("game", "Component41"));
  14096. }
  14097. onConstruct() {
  14098. this.c1 = this.getController("c1");
  14099. this.n0 = (this.getChild("n0"));
  14100. this.titleTxt = (this.getChild("titleTxt"));
  14101. this.n2 = (this.getChild("n2"));
  14102. this.msgTips = (this.getChild("msgTips"));
  14103. this.numTxt = (this.getChild("numTxt"));
  14104. this.n18 = (this.getChild("n18"));
  14105. this.cancelBtn = (this.getChild("cancelBtn"));
  14106. this.videoBtn = (this.getChild("videoBtn"));
  14107. this.n10 = (this.getChild("n10"));
  14108. }
  14109. }
  14110. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14111. class ui_Component42 extends fgui.GComponent {
  14112. static createInstance() {
  14113. return (fgui.UIPackage.createObject("game", "Component42"));
  14114. }
  14115. onConstruct() {
  14116. this.c1 = this.getController("c1");
  14117. this.n1 = (this.getChild("n1"));
  14118. this.n2 = (this.getChild("n2"));
  14119. this.n3 = (this.getChild("n3"));
  14120. this.tipsTxt = (this.getChild("tipsTxt"));
  14121. this.cancelBtn = (this.getChild("cancelBtn"));
  14122. this.sureBtn = (this.getChild("sureBtn"));
  14123. this.n11 = (this.getChild("n11"));
  14124. this.n13 = (this.getChild("n13"));
  14125. this.n14 = (this.getChild("n14"));
  14126. this.womanTxt = (this.getChild("womanTxt"));
  14127. this.t0 = this.getTransition("t0");
  14128. }
  14129. }
  14130. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14131. class ui_dh_js_shengli extends fgui.GComponent {
  14132. static createInstance() {
  14133. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14134. }
  14135. onConstruct() {
  14136. this.n3 = (this.getChild("n3"));
  14137. this.n4 = (this.getChild("n4"));
  14138. this.n1 = (this.getChild("n1"));
  14139. this.n2 = (this.getChild("n2"));
  14140. this.n5 = (this.getChild("n5"));
  14141. this.n6 = (this.getChild("n6"));
  14142. this.n7 = (this.getChild("n7"));
  14143. this.n8 = (this.getChild("n8"));
  14144. this.attack = this.getTransition("attack");
  14145. this.idle = this.getTransition("idle");
  14146. }
  14147. }
  14148. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  14149. class ui_dh_js_shengli_g extends fgui.GComponent {
  14150. static createInstance() {
  14151. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  14152. }
  14153. onConstruct() {
  14154. this.n3 = (this.getChild("n3"));
  14155. this.n1 = (this.getChild("n1"));
  14156. this.t0 = this.getTransition("t0");
  14157. }
  14158. }
  14159. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  14160. class ui_dh_js_shibai extends fgui.GComponent {
  14161. static createInstance() {
  14162. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  14163. }
  14164. onConstruct() {
  14165. this.n0 = (this.getChild("n0"));
  14166. this.n1 = (this.getChild("n1"));
  14167. this.n2 = (this.getChild("n2"));
  14168. this.n3 = (this.getChild("n3"));
  14169. this.idle = this.getTransition("idle");
  14170. this.attack = this.getTransition("attack");
  14171. }
  14172. }
  14173. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  14174. class ui_dh_zy_ganfa extends fgui.GButton {
  14175. static createInstance() {
  14176. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  14177. }
  14178. onConstruct() {
  14179. this.n0 = (this.getChild("n0"));
  14180. }
  14181. }
  14182. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  14183. class ui_dh_zy_sc_guang extends fgui.GButton {
  14184. static createInstance() {
  14185. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  14186. }
  14187. onConstruct() {
  14188. this.n0 = (this.getChild("n0"));
  14189. this.n2 = (this.getChild("n2"));
  14190. }
  14191. }
  14192. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  14193. class ui_dh_zy_shangcheng extends fgui.GComponent {
  14194. static createInstance() {
  14195. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  14196. }
  14197. onConstruct() {
  14198. this.n0 = (this.getChild("n0"));
  14199. this.n3 = (this.getChild("n3"));
  14200. this.t0 = this.getTransition("t0");
  14201. }
  14202. }
  14203. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  14204. class ui_dh_zy_wanfa extends fgui.GButton {
  14205. static createInstance() {
  14206. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  14207. }
  14208. onConstruct() {
  14209. this.n0 = (this.getChild("n0"));
  14210. }
  14211. }
  14212. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  14213. class ui_Component_daoju extends fgui.GComponent {
  14214. static createInstance() {
  14215. return (fgui.UIPackage.createObject("game", "Component_daoju"));
  14216. }
  14217. onConstruct() {
  14218. }
  14219. }
  14220. ui_Component_daoju.URL = "ui://isxx5ak7nmu9v57t";
  14221. class ui_Button_login extends fgui.GButton {
  14222. static createInstance() {
  14223. return (fgui.UIPackage.createObject("game", "Button_login"));
  14224. }
  14225. onConstruct() {
  14226. this.button = this.getController("button");
  14227. this.n4 = (this.getChild("n4"));
  14228. this.n3 = (this.getChild("n3"));
  14229. }
  14230. }
  14231. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  14232. class ui_Component_goto extends fgui.GButton {
  14233. static createInstance() {
  14234. return (fgui.UIPackage.createObject("game", "Component_goto"));
  14235. }
  14236. onConstruct() {
  14237. this.c1 = this.getController("c1");
  14238. this.n0 = (this.getChild("n0"));
  14239. this.n_goto = (this.getChild("n_goto"));
  14240. }
  14241. }
  14242. ui_Component_goto.URL = "ui://isxx5ak7nnz5v589";
  14243. class ui_Component53_1 extends fgui.GComponent {
  14244. static createInstance() {
  14245. return (fgui.UIPackage.createObject("game", "Component53_1"));
  14246. }
  14247. onConstruct() {
  14248. this.n0 = (this.getChild("n0"));
  14249. this.n1 = (this.getChild("n1"));
  14250. this.n2 = (this.getChild("n2"));
  14251. this.n3 = (this.getChild("n3"));
  14252. this.n4 = (this.getChild("n4"));
  14253. this.n5 = (this.getChild("n5"));
  14254. this.n6 = (this.getChild("n6"));
  14255. this.n7 = (this.getChild("n7"));
  14256. this.n8 = (this.getChild("n8"));
  14257. this.n9 = (this.getChild("n9"));
  14258. this.n10 = (this.getChild("n10"));
  14259. this.n11 = (this.getChild("n11"));
  14260. this.n12 = (this.getChild("n12"));
  14261. this.n13 = (this.getChild("n13"));
  14262. this.n14 = (this.getChild("n14"));
  14263. this.n15 = (this.getChild("n15"));
  14264. this.n16 = (this.getChild("n16"));
  14265. this.n19 = (this.getChild("n19"));
  14266. this.n20 = (this.getChild("n20"));
  14267. this.n21 = (this.getChild("n21"));
  14268. this.n22 = (this.getChild("n22"));
  14269. this.n23 = (this.getChild("n23"));
  14270. this.n24 = (this.getChild("n24"));
  14271. this.n25 = (this.getChild("n25"));
  14272. this.n26 = (this.getChild("n26"));
  14273. this.n27 = (this.getChild("n27"));
  14274. this.n28 = (this.getChild("n28"));
  14275. this.n29 = (this.getChild("n29"));
  14276. this.n30 = (this.getChild("n30"));
  14277. this.n31 = (this.getChild("n31"));
  14278. this.n32 = (this.getChild("n32"));
  14279. this.n33 = (this.getChild("n33"));
  14280. this.n34 = (this.getChild("n34"));
  14281. this.n35 = (this.getChild("n35"));
  14282. this.t0 = this.getTransition("t0");
  14283. }
  14284. }
  14285. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  14286. class ui_Component30 extends fgui.GComponent {
  14287. static createInstance() {
  14288. return (fgui.UIPackage.createObject("game", "Component30"));
  14289. }
  14290. onConstruct() {
  14291. this.c1 = this.getController("c1");
  14292. this.n46 = (this.getChild("n46"));
  14293. this.n47 = (this.getChild("n47"));
  14294. this.numTxt = (this.getChild("numTxt"));
  14295. this.n50 = (this.getChild("n50"));
  14296. this.n53 = (this.getChild("n53"));
  14297. this.n54 = (this.getChild("n54"));
  14298. this.n55 = (this.getChild("n55"));
  14299. this.n56 = (this.getChild("n56"));
  14300. }
  14301. }
  14302. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  14303. class ui_Component30_1 extends fgui.GComponent {
  14304. static createInstance() {
  14305. return (fgui.UIPackage.createObject("game", "Component30_1"));
  14306. }
  14307. onConstruct() {
  14308. this.c1 = this.getController("c1");
  14309. this.n46 = (this.getChild("n46"));
  14310. this.n47 = (this.getChild("n47"));
  14311. this.numTxt = (this.getChild("numTxt"));
  14312. this.n50 = (this.getChild("n50"));
  14313. this.n51 = (this.getChild("n51"));
  14314. this.n52 = (this.getChild("n52"));
  14315. this.n53 = (this.getChild("n53"));
  14316. this.n54 = (this.getChild("n54"));
  14317. }
  14318. }
  14319. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  14320. class ui_Component31 extends fgui.GComponent {
  14321. static createInstance() {
  14322. return (fgui.UIPackage.createObject("game", "Component31"));
  14323. }
  14324. onConstruct() {
  14325. this.n55 = (this.getChild("n55"));
  14326. this.n54 = (this.getChild("n54"));
  14327. this.conditionTxt = (this.getChild("conditionTxt"));
  14328. this.n57 = (this.getChild("n57"));
  14329. this.t0 = this.getTransition("t0");
  14330. }
  14331. }
  14332. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  14333. class ui_Component32 extends fgui.GComponent {
  14334. static createInstance() {
  14335. return (fgui.UIPackage.createObject("game", "Component32"));
  14336. }
  14337. onConstruct() {
  14338. this.n5 = (this.getChild("n5"));
  14339. this.n6 = (this.getChild("n6"));
  14340. this.n7 = (this.getChild("n7"));
  14341. this.t0 = this.getTransition("t0");
  14342. }
  14343. }
  14344. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  14345. class ui_AwardItem extends fgui.GComponent {
  14346. static createInstance() {
  14347. return (fgui.UIPackage.createObject("game", "AwardItem"));
  14348. }
  14349. onConstruct() {
  14350. this.n9 = (this.getChild("n9"));
  14351. this.myIcon = (this.getChild("myIcon"));
  14352. this.numTxt = (this.getChild("numTxt"));
  14353. this.nameTxt = (this.getChild("nameTxt"));
  14354. this.n16 = (this.getChild("n16"));
  14355. this.n17 = (this.getChild("n17"));
  14356. }
  14357. }
  14358. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  14359. class ui_ranking_com1 extends fgui.GButton {
  14360. static createInstance() {
  14361. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  14362. }
  14363. onConstruct() {
  14364. this.c1 = this.getController("c1");
  14365. this.n49 = (this.getChild("n49"));
  14366. this.n18 = (this.getChild("n18"));
  14367. this.n46 = (this.getChild("n46"));
  14368. this.n48 = (this.getChild("n48"));
  14369. this.n50 = (this.getChild("n50"));
  14370. }
  14371. }
  14372. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  14373. class ui_ranking_com2 extends fgui.GButton {
  14374. static createInstance() {
  14375. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  14376. }
  14377. onConstruct() {
  14378. this.c1 = this.getController("c1");
  14379. this.n49 = (this.getChild("n49"));
  14380. this.n18 = (this.getChild("n18"));
  14381. this.n46 = (this.getChild("n46"));
  14382. this.n48 = (this.getChild("n48"));
  14383. this.n50 = (this.getChild("n50"));
  14384. }
  14385. }
  14386. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  14387. class ui_ranking_com3 extends fgui.GComponent {
  14388. static createInstance() {
  14389. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  14390. }
  14391. onConstruct() {
  14392. this.n17 = (this.getChild("n17"));
  14393. this.myIcon = (this.getChild("myIcon"));
  14394. }
  14395. }
  14396. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  14397. class ui_ranking_com4 extends fgui.GComponent {
  14398. static createInstance() {
  14399. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  14400. }
  14401. onConstruct() {
  14402. this.n16 = (this.getChild("n16"));
  14403. this.head = (this.getChild("head"));
  14404. }
  14405. }
  14406. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  14407. class ui_ranking_com5 extends fgui.GComponent {
  14408. static createInstance() {
  14409. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  14410. }
  14411. onConstruct() {
  14412. this.c1 = this.getController("c1");
  14413. this.c2 = this.getController("c2");
  14414. this.n2 = (this.getChild("n2"));
  14415. this.n3 = (this.getChild("n3"));
  14416. this.levelBtn = (this.getChild("levelBtn"));
  14417. this.starBtn = (this.getChild("starBtn"));
  14418. this.n23 = (this.getChild("n23"));
  14419. this.n24 = (this.getChild("n24"));
  14420. this.n25 = (this.getChild("n25"));
  14421. this.myList = (this.getChild("myList"));
  14422. this.selfNode = (this.getChild("selfNode"));
  14423. this.n9 = (this.getChild("n9"));
  14424. this.n12 = (this.getChild("n12"));
  14425. this.n13 = (this.getChild("n13"));
  14426. this.n14 = (this.getChild("n14"));
  14427. this.n39 = (this.getChild("n39"));
  14428. this.n41 = (this.getChild("n41"));
  14429. this.n42 = (this.getChild("n42"));
  14430. this.n45 = (this.getChild("n45"));
  14431. this.changeBtn = (this.getChild("changeBtn"));
  14432. this.closeBtn = (this.getChild("closeBtn"));
  14433. this.t0 = this.getTransition("t0");
  14434. }
  14435. }
  14436. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  14437. class ui_RankItem extends fgui.GComponent {
  14438. static createInstance() {
  14439. return (fgui.UIPackage.createObject("game", "RankItem"));
  14440. }
  14441. onConstruct() {
  14442. this.n10 = (this.getChild("n10"));
  14443. this.n11 = (this.getChild("n11"));
  14444. this.rankTxt = (this.getChild("rankTxt"));
  14445. this.headNode = (this.getChild("headNode"));
  14446. this.nameTxt = (this.getChild("nameTxt"));
  14447. this.n19 = (this.getChild("n19"));
  14448. this.valueTxt = (this.getChild("valueTxt"));
  14449. this.img1 = (this.getChild("img1"));
  14450. this.img2 = (this.getChild("img2"));
  14451. this.img3 = (this.getChild("img3"));
  14452. }
  14453. }
  14454. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  14455. class ui_ranking_com9 extends fgui.GComponent {
  14456. static createInstance() {
  14457. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  14458. }
  14459. onConstruct() {
  14460. this.c1 = this.getController("c1");
  14461. this.n27 = (this.getChild("n27"));
  14462. this.n28 = (this.getChild("n28"));
  14463. this.headNode = (this.getChild("headNode"));
  14464. this.rankTxt = (this.getChild("rankTxt"));
  14465. this.nameTxt = (this.getChild("nameTxt"));
  14466. this.n34 = (this.getChild("n34"));
  14467. this.valueTxt = (this.getChild("valueTxt"));
  14468. this.n36 = (this.getChild("n36"));
  14469. this.n37 = (this.getChild("n37"));
  14470. this.n38 = (this.getChild("n38"));
  14471. this.n39 = (this.getChild("n39"));
  14472. this.n40 = (this.getChild("n40"));
  14473. }
  14474. }
  14475. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  14476. class ui_ranking_com10 extends fgui.GComponent {
  14477. static createInstance() {
  14478. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  14479. }
  14480. onConstruct() {
  14481. this.n23 = (this.getChild("n23"));
  14482. this.n24 = (this.getChild("n24"));
  14483. }
  14484. }
  14485. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  14486. class ui_ranking_com11 extends fgui.GComponent {
  14487. static createInstance() {
  14488. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  14489. }
  14490. onConstruct() {
  14491. this.n24 = (this.getChild("n24"));
  14492. this.n25 = (this.getChild("n25"));
  14493. this.t0 = this.getTransition("t0");
  14494. }
  14495. }
  14496. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  14497. class ui_ranking_com13 extends fgui.GButton {
  14498. static createInstance() {
  14499. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  14500. }
  14501. onConstruct() {
  14502. this.c1 = this.getController("c1");
  14503. this.n44 = (this.getChild("n44"));
  14504. this.n45 = (this.getChild("n45"));
  14505. this.n46 = (this.getChild("n46"));
  14506. }
  14507. }
  14508. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  14509. class ui_Component_dl_zc extends fgui.GButton {
  14510. static createInstance() {
  14511. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  14512. }
  14513. onConstruct() {
  14514. this.c1 = this.getController("c1");
  14515. this.n0 = (this.getChild("n0"));
  14516. }
  14517. }
  14518. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  14519. class ui_Component122 extends fgui.GComponent {
  14520. static createInstance() {
  14521. return (fgui.UIPackage.createObject("game", "Component122"));
  14522. }
  14523. onConstruct() {
  14524. this.gameNode3 = (this.getChild("gameNode3"));
  14525. }
  14526. }
  14527. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  14528. class ui_skillItem extends fgui.GComponent {
  14529. static createInstance() {
  14530. return (fgui.UIPackage.createObject("game", "skillItem"));
  14531. }
  14532. onConstruct() {
  14533. this.c1 = this.getController("c1");
  14534. this.n31 = (this.getChild("n31"));
  14535. this.n6 = (this.getChild("n6"));
  14536. this.skillImg = (this.getChild("skillImg"));
  14537. this.nameTxt = (this.getChild("nameTxt"));
  14538. this.levelTxt = (this.getChild("levelTxt"));
  14539. this.n28 = (this.getChild("n28"));
  14540. this.describeTxt = (this.getChild("describeTxt"));
  14541. this.n32 = (this.getChild("n32"));
  14542. this.mutiBtn = (this.getChild("mutiBtn"));
  14543. this.tryNode = (this.getChild("tryNode"));
  14544. this.normalBtn = (this.getChild("normalBtn"));
  14545. this.startBtn = (this.getChild("startBtn"));
  14546. this.n42 = (this.getChild("n42"));
  14547. this.n43 = (this.getChild("n43"));
  14548. this.n44 = (this.getChild("n44"));
  14549. }
  14550. }
  14551. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  14552. class ui_Component26 extends fgui.GButton {
  14553. static createInstance() {
  14554. return (fgui.UIPackage.createObject("game", "Component26"));
  14555. }
  14556. onConstruct() {
  14557. this.n11 = (this.getChild("n11"));
  14558. this.n30 = (this.getChild("n30"));
  14559. this.n34 = (this.getChild("n34"));
  14560. }
  14561. }
  14562. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  14563. class ui_Component28 extends fgui.GButton {
  14564. static createInstance() {
  14565. return (fgui.UIPackage.createObject("game", "Component28"));
  14566. }
  14567. onConstruct() {
  14568. this.n12 = (this.getChild("n12"));
  14569. this.n31 = (this.getChild("n31"));
  14570. this.curTxt = (this.getChild("curTxt"));
  14571. this.n33 = (this.getChild("n33"));
  14572. }
  14573. }
  14574. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  14575. class ui_Component1302 extends fgui.GComponent {
  14576. static createInstance() {
  14577. return (fgui.UIPackage.createObject("game", "Component1302"));
  14578. }
  14579. onConstruct() {
  14580. this.n2 = (this.getChild("n2"));
  14581. this.n3 = (this.getChild("n3"));
  14582. }
  14583. }
  14584. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  14585. class ui_Component113 extends fgui.GComponent {
  14586. static createInstance() {
  14587. return (fgui.UIPackage.createObject("game", "Component113"));
  14588. }
  14589. onConstruct() {
  14590. this.n85 = (this.getChild("n85"));
  14591. this.n86 = (this.getChild("n86"));
  14592. this.n77 = (this.getChild("n77"));
  14593. this.n79 = (this.getChild("n79"));
  14594. this.n80 = (this.getChild("n80"));
  14595. this.n81 = (this.getChild("n81"));
  14596. this.n82 = (this.getChild("n82"));
  14597. this.n84 = (this.getChild("n84"));
  14598. this.n87 = (this.getChild("n87"));
  14599. this.t0 = this.getTransition("t0");
  14600. }
  14601. }
  14602. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  14603. class ui_Component114 extends fgui.GComponent {
  14604. static createInstance() {
  14605. return (fgui.UIPackage.createObject("game", "Component114"));
  14606. }
  14607. onConstruct() {
  14608. this.n77 = (this.getChild("n77"));
  14609. this.t0 = this.getTransition("t0");
  14610. }
  14611. }
  14612. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  14613. class ui_Component115 extends fgui.GComponent {
  14614. static createInstance() {
  14615. return (fgui.UIPackage.createObject("game", "Component115"));
  14616. }
  14617. onConstruct() {
  14618. this.n83 = (this.getChild("n83"));
  14619. this.fingerNode = (this.getChild("fingerNode"));
  14620. this.n84 = (this.getChild("n84"));
  14621. }
  14622. }
  14623. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  14624. class ui_Component117 extends fgui.GComponent {
  14625. static createInstance() {
  14626. return (fgui.UIPackage.createObject("game", "Component117"));
  14627. }
  14628. onConstruct() {
  14629. this.n87 = (this.getChild("n87"));
  14630. this.n88 = (this.getChild("n88"));
  14631. this.n84 = (this.getChild("n84"));
  14632. this.n85 = (this.getChild("n85"));
  14633. this.n86 = (this.getChild("n86"));
  14634. this.t0 = this.getTransition("t0");
  14635. }
  14636. }
  14637. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  14638. class ui_Component98_1 extends fgui.GButton {
  14639. static createInstance() {
  14640. return (fgui.UIPackage.createObject("game", "Component98_1"));
  14641. }
  14642. onConstruct() {
  14643. this.c1 = this.getController("c1");
  14644. this.n8 = (this.getChild("n8"));
  14645. this.n41 = (this.getChild("n41"));
  14646. this.n40 = (this.getChild("n40"));
  14647. }
  14648. }
  14649. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  14650. class ui_Component61 extends fgui.GComponent {
  14651. static createInstance() {
  14652. return (fgui.UIPackage.createObject("game", "Component61"));
  14653. }
  14654. onConstruct() {
  14655. this.n14 = (this.getChild("n14"));
  14656. this.n6 = (this.getChild("n6"));
  14657. this.t0 = this.getTransition("t0");
  14658. }
  14659. }
  14660. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  14661. class ui_Component62 extends fgui.GComponent {
  14662. static createInstance() {
  14663. return (fgui.UIPackage.createObject("game", "Component62"));
  14664. }
  14665. onConstruct() {
  14666. this.n66 = (this.getChild("n66"));
  14667. this.n56 = (this.getChild("n56"));
  14668. this.n63 = (this.getChild("n63"));
  14669. this.n65 = (this.getChild("n65"));
  14670. this.t0 = this.getTransition("t0");
  14671. }
  14672. }
  14673. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  14674. class ui_d3Root extends fgui.GComponent {
  14675. static createInstance() {
  14676. return (fgui.UIPackage.createObject("game", "d3Root"));
  14677. }
  14678. onConstruct() {
  14679. }
  14680. }
  14681. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  14682. class ui_d2Root extends fgui.GComponent {
  14683. static createInstance() {
  14684. return (fgui.UIPackage.createObject("game", "d2Root"));
  14685. }
  14686. onConstruct() {
  14687. }
  14688. }
  14689. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  14690. class ui_ballNode extends fgui.GComponent {
  14691. static createInstance() {
  14692. return (fgui.UIPackage.createObject("game", "ballNode"));
  14693. }
  14694. onConstruct() {
  14695. }
  14696. }
  14697. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  14698. class ui_border extends fgui.GComponent {
  14699. static createInstance() {
  14700. return (fgui.UIPackage.createObject("game", "border"));
  14701. }
  14702. onConstruct() {
  14703. this.bar1 = (this.getChild("bar1"));
  14704. this.bar2 = (this.getChild("bar2"));
  14705. this.bar3 = (this.getChild("bar3"));
  14706. this.bar4 = (this.getChild("bar4"));
  14707. this.bar5 = (this.getChild("bar5"));
  14708. this.bar6 = (this.getChild("bar6"));
  14709. this.circle1 = (this.getChild("circle1"));
  14710. this.circle2 = (this.getChild("circle2"));
  14711. this.circle3 = (this.getChild("circle3"));
  14712. this.circle4 = (this.getChild("circle4"));
  14713. this.circle5 = (this.getChild("circle5"));
  14714. this.circle6 = (this.getChild("circle6"));
  14715. this.n28 = (this.getChild("n28"));
  14716. }
  14717. }
  14718. ui_border.URL = "ui://isxx5ak7sdh33qq";
  14719. class ui_Component41_2 extends fgui.GComponent {
  14720. static createInstance() {
  14721. return (fgui.UIPackage.createObject("game", "Component41_2"));
  14722. }
  14723. onConstruct() {
  14724. this.c1 = this.getController("c1");
  14725. this.n0 = (this.getChild("n0"));
  14726. this.n2 = (this.getChild("n2"));
  14727. this.n19 = (this.getChild("n19"));
  14728. this.cancelBtn = (this.getChild("cancelBtn"));
  14729. this.videoBtn = (this.getChild("videoBtn"));
  14730. this.n9 = (this.getChild("n9"));
  14731. this.n22 = (this.getChild("n22"));
  14732. this.tipsTxt = (this.getChild("tipsTxt"));
  14733. this.n23 = (this.getChild("n23"));
  14734. this.n24 = (this.getChild("n24"));
  14735. this.n26 = (this.getChild("n26"));
  14736. this.n27 = (this.getChild("n27"));
  14737. this.titleTxt = (this.getChild("titleTxt"));
  14738. }
  14739. }
  14740. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  14741. class ui_Component41_1 extends fgui.GComponent {
  14742. static createInstance() {
  14743. return (fgui.UIPackage.createObject("game", "Component41_1"));
  14744. }
  14745. onConstruct() {
  14746. this.c1 = this.getController("c1");
  14747. this.n0 = (this.getChild("n0"));
  14748. this.n2 = (this.getChild("n2"));
  14749. this.cancelBtn = (this.getChild("cancelBtn"));
  14750. this.videoBtn = (this.getChild("videoBtn"));
  14751. this.n27 = (this.getChild("n27"));
  14752. this.n30 = (this.getChild("n30"));
  14753. this.n31 = (this.getChild("n31"));
  14754. this.n32 = (this.getChild("n32"));
  14755. this.n33 = (this.getChild("n33"));
  14756. this.n34 = (this.getChild("n34"));
  14757. this.n35 = (this.getChild("n35"));
  14758. this.n36 = (this.getChild("n36"));
  14759. this.n1 = (this.getChild("n1"));
  14760. this.n37 = (this.getChild("n37"));
  14761. this.t0 = this.getTransition("t0");
  14762. this.t1 = this.getTransition("t1");
  14763. this.t2 = this.getTransition("t2");
  14764. this.t3 = this.getTransition("t3");
  14765. }
  14766. }
  14767. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  14768. class ui_againBtn extends fgui.GButton {
  14769. static createInstance() {
  14770. return (fgui.UIPackage.createObject("game", "againBtn"));
  14771. }
  14772. onConstruct() {
  14773. this.n2 = (this.getChild("n2"));
  14774. this.n1 = (this.getChild("n1"));
  14775. this.n5 = (this.getChild("n5"));
  14776. }
  14777. }
  14778. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  14779. class ui_Component118 extends fgui.GButton {
  14780. static createInstance() {
  14781. return (fgui.UIPackage.createObject("game", "Component118"));
  14782. }
  14783. onConstruct() {
  14784. this.c1 = this.getController("c1");
  14785. this.n14 = (this.getChild("n14"));
  14786. this.n9 = (this.getChild("n9"));
  14787. this.n10 = (this.getChild("n10"));
  14788. this.diamondTxt = (this.getChild("diamondTxt"));
  14789. this.n13 = (this.getChild("n13"));
  14790. this.n15 = (this.getChild("n15"));
  14791. }
  14792. }
  14793. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  14794. class ui_Component119 extends fgui.GComponent {
  14795. static createInstance() {
  14796. return (fgui.UIPackage.createObject("game", "Component119"));
  14797. }
  14798. onConstruct() {
  14799. this.n1 = (this.getChild("n1"));
  14800. this.n2 = (this.getChild("n2"));
  14801. this.n13 = (this.getChild("n13"));
  14802. this.n6 = (this.getChild("n6"));
  14803. this.screenNode = (this.getChild("screenNode"));
  14804. this.n15 = (this.getChild("n15"));
  14805. this.closeBtn = (this.getChild("closeBtn"));
  14806. this.share2Btn = (this.getChild("share2Btn"));
  14807. this.shareBtn = (this.getChild("shareBtn"));
  14808. this.tipsNode = (this.getChild("tipsNode"));
  14809. this.awardNode = (this.getChild("awardNode"));
  14810. }
  14811. }
  14812. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  14813. class ui_Component132_1 extends fgui.GComponent {
  14814. static createInstance() {
  14815. return (fgui.UIPackage.createObject("game", "Component132_1"));
  14816. }
  14817. onConstruct() {
  14818. this.n25 = (this.getChild("n25"));
  14819. this.n26 = (this.getChild("n26"));
  14820. this.n27 = (this.getChild("n27"));
  14821. this.t0 = this.getTransition("t0");
  14822. }
  14823. }
  14824. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  14825. class ui_SecretaryDisplay extends fgui.GComponent {
  14826. static createInstance() {
  14827. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  14828. }
  14829. onConstruct() {
  14830. this.n2 = (this.getChild("n2"));
  14831. this.levelTxt = (this.getChild("levelTxt"));
  14832. this.n4 = (this.getChild("n4"));
  14833. this.secretary = (this.getChild("secretary"));
  14834. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14835. this.n16 = (this.getChild("n16"));
  14836. this.n37 = (this.getChild("n37"));
  14837. this.n41 = (this.getChild("n41"));
  14838. this.n14 = (this.getChild("n14"));
  14839. this.n17 = (this.getChild("n17"));
  14840. this.heightTxt = (this.getChild("heightTxt"));
  14841. this.n46 = (this.getChild("n46"));
  14842. this.n36 = (this.getChild("n36"));
  14843. this.n38 = (this.getChild("n38"));
  14844. this.foodTxt = (this.getChild("foodTxt"));
  14845. this.n47 = (this.getChild("n47"));
  14846. this.n40 = (this.getChild("n40"));
  14847. this.n42 = (this.getChild("n42"));
  14848. this.historyTxt = (this.getChild("historyTxt"));
  14849. this.n48 = (this.getChild("n48"));
  14850. this.nameImg = (this.getChild("nameImg"));
  14851. this.n12 = (this.getChild("n12"));
  14852. this.n49 = (this.getChild("n49"));
  14853. this.t0 = this.getTransition("t0");
  14854. }
  14855. }
  14856. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14857. class ui_BallRodDisplay extends fgui.GComponent {
  14858. static createInstance() {
  14859. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14860. }
  14861. onConstruct() {
  14862. this.c1 = this.getController("c1");
  14863. this.n31 = (this.getChild("n31"));
  14864. this.n6 = (this.getChild("n6"));
  14865. this.nameTxt = (this.getChild("nameTxt"));
  14866. this.rodImg = (this.getChild("rodImg"));
  14867. this.levelNode = (this.getChild("levelNode"));
  14868. this.eftRod = (this.getChild("eftRod"));
  14869. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14870. }
  14871. }
  14872. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14873. class ui_Component111_11 extends fgui.GComponent {
  14874. static createInstance() {
  14875. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14876. }
  14877. onConstruct() {
  14878. this.n68 = (this.getChild("n68"));
  14879. this.n69 = (this.getChild("n69"));
  14880. }
  14881. }
  14882. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14883. class ui_Component112 extends fgui.GComponent {
  14884. static createInstance() {
  14885. return (fgui.UIPackage.createObject("game", "Component112"));
  14886. }
  14887. onConstruct() {
  14888. this.n68 = (this.getChild("n68"));
  14889. this.n70 = (this.getChild("n70"));
  14890. this.myMask = (this.getChild("myMask"));
  14891. }
  14892. }
  14893. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14894. class ui_Component111 extends fgui.GComponent {
  14895. static createInstance() {
  14896. return (fgui.UIPackage.createObject("game", "Component111"));
  14897. }
  14898. onConstruct() {
  14899. this.n68 = (this.getChild("n68"));
  14900. this.myMask = (this.getChild("myMask"));
  14901. }
  14902. }
  14903. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14904. class ui_Component144 extends fgui.GButton {
  14905. static createInstance() {
  14906. return (fgui.UIPackage.createObject("game", "Component144"));
  14907. }
  14908. onConstruct() {
  14909. this.n8 = (this.getChild("n8"));
  14910. }
  14911. }
  14912. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14913. class ui_Sign_com2 extends fgui.GComponent {
  14914. static createInstance() {
  14915. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14916. }
  14917. onConstruct() {
  14918. this.n0 = (this.getChild("n0"));
  14919. this.n1 = (this.getChild("n1"));
  14920. this.t0 = this.getTransition("t0");
  14921. }
  14922. }
  14923. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14924. class ui_Sign_guang extends fgui.GComponent {
  14925. static createInstance() {
  14926. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14927. }
  14928. onConstruct() {
  14929. this.n1 = (this.getChild("n1"));
  14930. this.n2 = (this.getChild("n2"));
  14931. this.n3 = (this.getChild("n3"));
  14932. this.n4 = (this.getChild("n4"));
  14933. this.n5 = (this.getChild("n5"));
  14934. this.n6 = (this.getChild("n6"));
  14935. this.n8 = (this.getChild("n8"));
  14936. }
  14937. }
  14938. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14939. class ui_SignMax extends fgui.GComponent {
  14940. static createInstance() {
  14941. return (fgui.UIPackage.createObject("game", "SignMax"));
  14942. }
  14943. onConstruct() {
  14944. this.c1 = this.getController("c1");
  14945. this.n7 = (this.getChild("n7"));
  14946. this.n15 = (this.getChild("n15"));
  14947. this.n8 = (this.getChild("n8"));
  14948. this.titleTxt = (this.getChild("titleTxt"));
  14949. this.myIcon1 = (this.getChild("myIcon1"));
  14950. this.numTxt1 = (this.getChild("numTxt1"));
  14951. this.myIcon2 = (this.getChild("myIcon2"));
  14952. this.n20 = (this.getChild("n20"));
  14953. this.n17 = (this.getChild("n17"));
  14954. this.numTxt2 = (this.getChild("numTxt2"));
  14955. this.n12 = (this.getChild("n12"));
  14956. this.n13 = (this.getChild("n13"));
  14957. this.n21 = (this.getChild("n21"));
  14958. this.n14 = (this.getChild("n14"));
  14959. }
  14960. }
  14961. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14962. class ui_Sign_com2_1 extends fgui.GComponent {
  14963. static createInstance() {
  14964. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14965. }
  14966. onConstruct() {
  14967. this.n0 = (this.getChild("n0"));
  14968. this.n1 = (this.getChild("n1"));
  14969. this.t0 = this.getTransition("t0");
  14970. }
  14971. }
  14972. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14973. class ui_Sign_com5 extends fgui.GComponent {
  14974. static createInstance() {
  14975. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14976. }
  14977. onConstruct() {
  14978. this.n3 = (this.getChild("n3"));
  14979. this.n29 = (this.getChild("n29"));
  14980. this.n4 = (this.getChild("n4"));
  14981. this.day1 = (this.getChild("day1"));
  14982. this.day2 = (this.getChild("day2"));
  14983. this.day3 = (this.getChild("day3"));
  14984. this.day4 = (this.getChild("day4"));
  14985. this.day5 = (this.getChild("day5"));
  14986. this.day6 = (this.getChild("day6"));
  14987. this.day7 = (this.getChild("day7"));
  14988. this.t0 = this.getTransition("t0");
  14989. }
  14990. }
  14991. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  14992. class ui_Sign_com8 extends fgui.GComponent {
  14993. static createInstance() {
  14994. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  14995. }
  14996. onConstruct() {
  14997. this.n48 = (this.getChild("n48"));
  14998. this.womanTxt = (this.getChild("womanTxt"));
  14999. this.t0 = this.getTransition("t0");
  15000. }
  15001. }
  15002. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15003. class ui_Sign_com6 extends fgui.GComponent {
  15004. static createInstance() {
  15005. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15006. }
  15007. onConstruct() {
  15008. this.n2 = (this.getChild("n2"));
  15009. this.n3 = (this.getChild("n3"));
  15010. this.t0 = this.getTransition("t0");
  15011. }
  15012. }
  15013. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15014. class ui_Sign_com7 extends fgui.GComponent {
  15015. static createInstance() {
  15016. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15017. }
  15018. onConstruct() {
  15019. this.n29 = (this.getChild("n29"));
  15020. this.n2 = (this.getChild("n2"));
  15021. }
  15022. }
  15023. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15024. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15025. static createInstance() {
  15026. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15027. }
  15028. onConstruct() {
  15029. this.n5 = (this.getChild("n5"));
  15030. this.n4 = (this.getChild("n4"));
  15031. this.t0 = this.getTransition("t0");
  15032. }
  15033. }
  15034. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15035. class ui_UITurntable_com2 extends fgui.GComponent {
  15036. static createInstance() {
  15037. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15038. }
  15039. onConstruct() {
  15040. this.c1 = this.getController("c1");
  15041. this.n4 = (this.getChild("n4"));
  15042. this.n6 = (this.getChild("n6"));
  15043. this.n10 = (this.getChild("n10"));
  15044. this.n11 = (this.getChild("n11"));
  15045. this.n12 = (this.getChild("n12"));
  15046. this.n13 = (this.getChild("n13"));
  15047. this.n14 = (this.getChild("n14"));
  15048. this.n15 = (this.getChild("n15"));
  15049. this.n16 = (this.getChild("n16"));
  15050. this.n17 = (this.getChild("n17"));
  15051. this.n18 = (this.getChild("n18"));
  15052. this.n19 = (this.getChild("n19"));
  15053. this.n20 = (this.getChild("n20"));
  15054. this.n21 = (this.getChild("n21"));
  15055. this.n22 = (this.getChild("n22"));
  15056. this.n23 = (this.getChild("n23"));
  15057. this.n24 = (this.getChild("n24"));
  15058. this.n25 = (this.getChild("n25"));
  15059. this.n26 = (this.getChild("n26"));
  15060. this.n27 = (this.getChild("n27"));
  15061. this.n28 = (this.getChild("n28"));
  15062. this.n29 = (this.getChild("n29"));
  15063. this.n30 = (this.getChild("n30"));
  15064. this.n31 = (this.getChild("n31"));
  15065. this.n32 = (this.getChild("n32"));
  15066. this.n33 = (this.getChild("n33"));
  15067. }
  15068. }
  15069. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15070. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15071. static createInstance() {
  15072. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15073. }
  15074. onConstruct() {
  15075. this.n5 = (this.getChild("n5"));
  15076. this.n4 = (this.getChild("n4"));
  15077. this.t0 = this.getTransition("t0");
  15078. }
  15079. }
  15080. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15081. class ui_UITurntable_com5 extends fgui.GComponent {
  15082. static createInstance() {
  15083. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15084. }
  15085. onConstruct() {
  15086. this.flashNode = (this.getChild("flashNode"));
  15087. this.rotNode = (this.getChild("rotNode"));
  15088. this.n3 = (this.getChild("n3"));
  15089. this.n21 = (this.getChild("n21"));
  15090. this.t0 = this.getTransition("t0");
  15091. }
  15092. }
  15093. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15094. class ui_UITurntable_com7 extends fgui.GComponent {
  15095. static createInstance() {
  15096. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15097. }
  15098. onConstruct() {
  15099. this.n2 = (this.getChild("n2"));
  15100. this.n35 = (this.getChild("n35"));
  15101. this.img1 = (this.getChild("img1"));
  15102. this.img2 = (this.getChild("img2"));
  15103. this.img3 = (this.getChild("img3"));
  15104. this.img4 = (this.getChild("img4"));
  15105. this.img6 = (this.getChild("img6"));
  15106. this.img5 = (this.getChild("img5"));
  15107. this.txt1 = (this.getChild("txt1"));
  15108. this.txt2 = (this.getChild("txt2"));
  15109. this.txt3 = (this.getChild("txt3"));
  15110. this.txt4 = (this.getChild("txt4"));
  15111. this.txt5 = (this.getChild("txt5"));
  15112. this.txt6 = (this.getChild("txt6"));
  15113. }
  15114. }
  15115. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15116. class ui_UITurntable_com9 extends fgui.GComponent {
  15117. static createInstance() {
  15118. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15119. }
  15120. onConstruct() {
  15121. this.n38 = (this.getChild("n38"));
  15122. this.n39 = (this.getChild("n39"));
  15123. }
  15124. }
  15125. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  15126. class ui_UITurntable_com10 extends fgui.GComponent {
  15127. static createInstance() {
  15128. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  15129. }
  15130. onConstruct() {
  15131. this.n39 = (this.getChild("n39"));
  15132. this.n40 = (this.getChild("n40"));
  15133. this.t0 = this.getTransition("t0");
  15134. }
  15135. }
  15136. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  15137. class ui_UITurntable_com11 extends fgui.GComponent {
  15138. static createInstance() {
  15139. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  15140. }
  15141. onConstruct() {
  15142. this.n38 = (this.getChild("n38"));
  15143. this.n39 = (this.getChild("n39"));
  15144. this.n40 = (this.getChild("n40"));
  15145. this.t0 = this.getTransition("t0");
  15146. }
  15147. }
  15148. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  15149. class ui_UITurntable_com12 extends fgui.GComponent {
  15150. static createInstance() {
  15151. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  15152. }
  15153. onConstruct() {
  15154. this.n43 = (this.getChild("n43"));
  15155. this.barNode = (this.getChild("barNode"));
  15156. this.tipsTxt = (this.getChild("tipsTxt"));
  15157. this.n45 = (this.getChild("n45"));
  15158. this.boxBtn = (this.getChild("boxBtn"));
  15159. }
  15160. }
  15161. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  15162. class ui_UITurntable_com1 extends fgui.GButton {
  15163. static createInstance() {
  15164. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  15165. }
  15166. onConstruct() {
  15167. this.n41 = (this.getChild("n41"));
  15168. this.n42 = (this.getChild("n42"));
  15169. this.t0 = this.getTransition("t0");
  15170. }
  15171. }
  15172. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  15173. class ui_UITurntable_com3 extends fgui.GComponent {
  15174. static createInstance() {
  15175. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  15176. }
  15177. onConstruct() {
  15178. this.n48 = (this.getChild("n48"));
  15179. this.womanTxt = (this.getChild("womanTxt"));
  15180. this.t0 = this.getTransition("t0");
  15181. }
  15182. }
  15183. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  15184. class ui_cancelBtn2 extends fgui.GButton {
  15185. static createInstance() {
  15186. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  15187. }
  15188. onConstruct() {
  15189. this.c1 = this.getController("c1");
  15190. this.n0 = (this.getChild("n0"));
  15191. this.n1 = (this.getChild("n1"));
  15192. this.n2 = (this.getChild("n2"));
  15193. this.n3 = (this.getChild("n3"));
  15194. this.n4 = (this.getChild("n4"));
  15195. this.n5 = (this.getChild("n5"));
  15196. this.n6 = (this.getChild("n6"));
  15197. this.n7 = (this.getChild("n7"));
  15198. this.n8 = (this.getChild("n8"));
  15199. this.powerEft = (this.getChild("powerEft"));
  15200. }
  15201. }
  15202. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  15203. class ui_shareBtn2 extends fgui.GButton {
  15204. static createInstance() {
  15205. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  15206. }
  15207. onConstruct() {
  15208. this.c1 = this.getController("c1");
  15209. this.n2 = (this.getChild("n2"));
  15210. this.n24 = (this.getChild("n24"));
  15211. this.n1 = (this.getChild("n1"));
  15212. this.n3 = (this.getChild("n3"));
  15213. this.n23 = (this.getChild("n23"));
  15214. this.n4 = (this.getChild("n4"));
  15215. this.n5 = (this.getChild("n5"));
  15216. this.n6 = (this.getChild("n6"));
  15217. this.n20 = (this.getChild("n20"));
  15218. this.n21 = (this.getChild("n21"));
  15219. this.n22 = (this.getChild("n22"));
  15220. this.powerEft = (this.getChild("powerEft"));
  15221. }
  15222. }
  15223. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  15224. class ui_UIMoney extends fgui.GComponent {
  15225. static createInstance() {
  15226. return (fgui.UIPackage.createObject("game", "UIMoney"));
  15227. }
  15228. onConstruct() {
  15229. this.c1 = this.getController("c1");
  15230. this.n4 = (this.getChild("n4"));
  15231. this.coinImg = (this.getChild("coinImg"));
  15232. this.addCoinBtn = (this.getChild("addCoinBtn"));
  15233. this.coinTxt = (this.getChild("coinTxt"));
  15234. this.n7 = (this.getChild("n7"));
  15235. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  15236. this.diamondTxt = (this.getChild("diamondTxt"));
  15237. this.diamondImg = (this.getChild("diamondImg"));
  15238. this.n12 = (this.getChild("n12"));
  15239. this.powerImg = (this.getChild("powerImg"));
  15240. this.addPowerBtn = (this.getChild("addPowerBtn"));
  15241. this.powerTxt = (this.getChild("powerTxt"));
  15242. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  15243. }
  15244. }
  15245. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  15246. class ui_backBtn extends fgui.GButton {
  15247. static createInstance() {
  15248. return (fgui.UIPackage.createObject("game", "backBtn"));
  15249. }
  15250. onConstruct() {
  15251. this.n0 = (this.getChild("n0"));
  15252. this.t0 = this.getTransition("t0");
  15253. this.t1 = this.getTransition("t1");
  15254. }
  15255. }
  15256. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  15257. class ui_MoneyBtn extends fgui.GButton {
  15258. static createInstance() {
  15259. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  15260. }
  15261. onConstruct() {
  15262. this.button = this.getController("button");
  15263. this.n0 = (this.getChild("n0"));
  15264. }
  15265. }
  15266. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  15267. class ui_UIMoneyBtn extends fgui.GComponent {
  15268. static createInstance() {
  15269. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  15270. }
  15271. onConstruct() {
  15272. this.n1 = (this.getChild("n1"));
  15273. this.closeBtn = (this.getChild("closeBtn"));
  15274. }
  15275. }
  15276. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  15277. class ui_Component64 extends fgui.GComponent {
  15278. static createInstance() {
  15279. return (fgui.UIPackage.createObject("game", "Component64"));
  15280. }
  15281. onConstruct() {
  15282. this.n57 = (this.getChild("n57"));
  15283. this.n54 = (this.getChild("n54"));
  15284. this.n55 = (this.getChild("n55"));
  15285. this.n56 = (this.getChild("n56"));
  15286. this.t1 = this.getTransition("t1");
  15287. }
  15288. }
  15289. ui_Component64.URL = "ui://isxx5ak7wp26456";
  15290. class ui_Component41_3 extends fgui.GComponent {
  15291. static createInstance() {
  15292. return (fgui.UIPackage.createObject("game", "Component41_3"));
  15293. }
  15294. onConstruct() {
  15295. this.c1 = this.getController("c1");
  15296. this.n0 = (this.getChild("n0"));
  15297. this.n2 = (this.getChild("n2"));
  15298. this.cancelBtn = (this.getChild("cancelBtn"));
  15299. this.videoBtn = (this.getChild("videoBtn"));
  15300. this.n9 = (this.getChild("n9"));
  15301. this.n24 = (this.getChild("n24"));
  15302. this.n27 = (this.getChild("n27"));
  15303. this.titleTxt = (this.getChild("titleTxt"));
  15304. this.n28 = (this.getChild("n28"));
  15305. this.t0 = this.getTransition("t0");
  15306. }
  15307. }
  15308. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  15309. class ui_dh_zs_4 extends fgui.GComponent {
  15310. static createInstance() {
  15311. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  15312. }
  15313. onConstruct() {
  15314. this.n1 = (this.getChild("n1"));
  15315. this.n2 = (this.getChild("n2"));
  15316. this.n3 = (this.getChild("n3"));
  15317. this.n4 = (this.getChild("n4"));
  15318. this.n5 = (this.getChild("n5"));
  15319. this.n6 = (this.getChild("n6"));
  15320. this.n8 = (this.getChild("n8"));
  15321. this.t0 = this.getTransition("t0");
  15322. }
  15323. }
  15324. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  15325. class ui_Component71_1 extends fgui.GButton {
  15326. static createInstance() {
  15327. return (fgui.UIPackage.createObject("game", "Component71_1"));
  15328. }
  15329. onConstruct() {
  15330. this.n17 = (this.getChild("n17"));
  15331. this.t0 = this.getTransition("t0");
  15332. }
  15333. }
  15334. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  15335. class ui_Component83 extends fgui.GComponent {
  15336. static createInstance() {
  15337. return (fgui.UIPackage.createObject("game", "Component83"));
  15338. }
  15339. onConstruct() {
  15340. this.c1 = this.getController("c1");
  15341. this.n17 = (this.getChild("n17"));
  15342. this.n19 = (this.getChild("n19"));
  15343. this.n20 = (this.getChild("n20"));
  15344. }
  15345. }
  15346. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  15347. class ui_Component84 extends fgui.GComponent {
  15348. static createInstance() {
  15349. return (fgui.UIPackage.createObject("game", "Component84"));
  15350. }
  15351. onConstruct() {
  15352. this.c1 = this.getController("c1");
  15353. this.n4 = (this.getChild("n4"));
  15354. this.n22 = (this.getChild("n22"));
  15355. this.n23 = (this.getChild("n23"));
  15356. this.numTxt = (this.getChild("numTxt"));
  15357. this.n25 = (this.getChild("n25"));
  15358. this.n26 = (this.getChild("n26"));
  15359. }
  15360. }
  15361. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  15362. class ui_Component84_1 extends fgui.GComponent {
  15363. static createInstance() {
  15364. return (fgui.UIPackage.createObject("game", "Component84_1"));
  15365. }
  15366. onConstruct() {
  15367. this.c1 = this.getController("c1");
  15368. this.n4 = (this.getChild("n4"));
  15369. this.n22 = (this.getChild("n22"));
  15370. this.n23 = (this.getChild("n23"));
  15371. this.numTxt = (this.getChild("numTxt"));
  15372. this.n25 = (this.getChild("n25"));
  15373. this.n26 = (this.getChild("n26"));
  15374. }
  15375. }
  15376. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  15377. class ui_Component85 extends fgui.GComponent {
  15378. static createInstance() {
  15379. return (fgui.UIPackage.createObject("game", "Component85"));
  15380. }
  15381. onConstruct() {
  15382. this.n1 = (this.getChild("n1"));
  15383. this.n6 = (this.getChild("n6"));
  15384. this.n2 = (this.getChild("n2"));
  15385. this.n3 = (this.getChild("n3"));
  15386. this.levelTxt = (this.getChild("levelTxt"));
  15387. this.n10 = (this.getChild("n10"));
  15388. this.n11 = (this.getChild("n11"));
  15389. this.n12 = (this.getChild("n12"));
  15390. this.n13 = (this.getChild("n13"));
  15391. this.n14 = (this.getChild("n14"));
  15392. this.modeNode = (this.getChild("modeNode"));
  15393. this.n18 = (this.getChild("n18"));
  15394. this.conditionTxt = (this.getChild("conditionTxt"));
  15395. this.diamondNode = (this.getChild("diamondNode"));
  15396. this.coinNode = (this.getChild("coinNode"));
  15397. this.startBtn = (this.getChild("startBtn"));
  15398. this.n28 = (this.getChild("n28"));
  15399. this.displayRoot = (this.getChild("displayRoot"));
  15400. this.t0 = this.getTransition("t0");
  15401. }
  15402. }
  15403. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  15404. class ui_Component86 extends fgui.GButton {
  15405. static createInstance() {
  15406. return (fgui.UIPackage.createObject("game", "Component86"));
  15407. }
  15408. onConstruct() {
  15409. this.n15 = (this.getChild("n15"));
  15410. this.t0 = this.getTransition("t0");
  15411. }
  15412. }
  15413. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  15414. class ui_Component87 extends fgui.GComponent {
  15415. static createInstance() {
  15416. return (fgui.UIPackage.createObject("game", "Component87"));
  15417. }
  15418. onConstruct() {
  15419. this.n66 = (this.getChild("n66"));
  15420. this.myProgress = (this.getChild("myProgress"));
  15421. this.starAni = (this.getChild("starAni"));
  15422. this.hpTxt = (this.getChild("hpTxt"));
  15423. this.n74 = (this.getChild("n74"));
  15424. this.n73 = (this.getChild("n73"));
  15425. this.ballTxt = (this.getChild("ballTxt"));
  15426. this.n76 = (this.getChild("n76"));
  15427. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15428. this.levelTxt = (this.getChild("levelTxt"));
  15429. this.star1 = (this.getChild("star1"));
  15430. this.star2 = (this.getChild("star2"));
  15431. this.star3 = (this.getChild("star3"));
  15432. }
  15433. }
  15434. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  15435. class ui_Component88 extends fgui.GProgressBar {
  15436. static createInstance() {
  15437. return (fgui.UIPackage.createObject("game", "Component88"));
  15438. }
  15439. onConstruct() {
  15440. this.n68 = (this.getChild("n68"));
  15441. this.bar = (this.getChild("bar"));
  15442. }
  15443. }
  15444. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  15445. class ui_Component89 extends fgui.GComponent {
  15446. static createInstance() {
  15447. return (fgui.UIPackage.createObject("game", "Component89"));
  15448. }
  15449. onConstruct() {
  15450. this.c1 = this.getController("c1");
  15451. this.n71 = (this.getChild("n71"));
  15452. this.n72 = (this.getChild("n72"));
  15453. }
  15454. }
  15455. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  15456. class ui_Component90 extends fgui.GComponent {
  15457. static createInstance() {
  15458. return (fgui.UIPackage.createObject("game", "Component90"));
  15459. }
  15460. onConstruct() {
  15461. this.c1 = this.getController("c1");
  15462. this.n64 = (this.getChild("n64"));
  15463. this.n65 = (this.getChild("n65"));
  15464. this.n66 = (this.getChild("n66"));
  15465. this.t0 = this.getTransition("t0");
  15466. }
  15467. }
  15468. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  15469. class ui_Component127 extends fgui.GButton {
  15470. static createInstance() {
  15471. return (fgui.UIPackage.createObject("game", "Component127"));
  15472. }
  15473. onConstruct() {
  15474. this.n5 = (this.getChild("n5"));
  15475. }
  15476. }
  15477. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  15478. class gameBinder {
  15479. static bindAll() {
  15480. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  15481. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  15482. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  15483. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  15484. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  15485. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  15486. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  15487. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  15488. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  15489. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  15490. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  15491. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  15492. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  15493. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  15494. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  15495. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  15496. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  15497. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  15498. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  15499. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  15500. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  15501. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  15502. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  15503. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  15504. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  15505. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  15506. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  15507. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  15508. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  15509. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  15510. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  15511. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  15512. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  15513. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  15514. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  15515. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  15516. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  15517. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  15518. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  15519. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  15520. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  15521. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  15522. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  15523. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  15524. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  15525. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  15526. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  15527. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  15528. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  15529. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  15530. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  15531. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  15532. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  15533. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  15534. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  15535. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  15536. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  15537. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  15538. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  15539. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  15540. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  15541. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  15542. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  15543. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  15544. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  15545. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  15546. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  15547. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  15548. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  15549. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  15550. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  15551. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  15552. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  15553. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  15554. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  15555. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  15556. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  15557. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  15558. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  15559. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  15560. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  15561. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  15562. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  15563. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  15564. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  15565. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  15566. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  15567. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  15568. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  15569. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  15570. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  15571. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  15572. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  15573. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  15574. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  15575. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  15576. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  15577. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  15578. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  15579. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  15580. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  15581. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  15582. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  15583. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  15584. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  15585. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  15586. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  15587. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  15588. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  15589. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  15590. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  15591. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  15592. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  15593. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  15594. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  15595. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  15596. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  15597. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  15598. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  15599. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  15600. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  15601. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  15602. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  15603. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  15604. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  15605. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  15606. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  15607. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  15608. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  15609. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  15610. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  15611. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  15612. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  15613. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  15614. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  15615. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  15616. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  15617. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  15618. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  15619. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  15620. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  15621. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  15622. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  15623. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  15624. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  15625. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  15626. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  15627. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  15628. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  15629. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  15630. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  15631. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  15632. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  15633. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  15634. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  15635. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  15636. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  15637. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  15638. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  15639. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  15640. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  15641. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  15642. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  15643. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  15644. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  15645. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  15646. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  15647. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  15648. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  15649. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  15650. fgui.UIObjectFactory.setExtension(ui_Component_daoju.URL, ui_Component_daoju);
  15651. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  15652. fgui.UIObjectFactory.setExtension(ui_Component_goto.URL, ui_Component_goto);
  15653. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  15654. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  15655. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  15656. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  15657. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  15658. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  15659. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  15660. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  15661. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  15662. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  15663. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  15664. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  15665. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  15666. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  15667. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  15668. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  15669. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  15670. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  15671. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  15672. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  15673. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  15674. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  15675. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  15676. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  15677. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  15678. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  15679. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  15680. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  15681. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  15682. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  15683. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  15684. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  15685. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  15686. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  15687. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  15688. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  15689. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  15690. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  15691. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  15692. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  15693. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  15694. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  15695. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  15696. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  15697. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  15698. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  15699. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  15700. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  15701. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  15702. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  15703. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  15704. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  15705. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  15706. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  15707. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  15708. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  15709. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  15710. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  15711. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  15712. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  15713. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  15714. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  15715. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  15716. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  15717. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  15718. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  15719. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  15720. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  15721. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  15722. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  15723. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  15724. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  15725. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  15726. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  15727. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  15728. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  15729. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  15730. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  15731. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  15732. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  15733. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  15734. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  15735. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  15736. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  15737. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  15738. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  15739. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  15740. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  15741. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  15742. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  15743. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  15744. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  15745. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  15746. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  15747. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  15748. }
  15749. }
  15750. class ui_btn6 extends fgui.GButton {
  15751. static createInstance() {
  15752. return (fgui.UIPackage.createObject("loading", "btn6"));
  15753. }
  15754. onConstruct() {
  15755. this.n6 = (this.getChild("n6"));
  15756. this.n1 = (this.getChild("n1"));
  15757. }
  15758. }
  15759. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  15760. class ui_xyItem extends fgui.GComponent {
  15761. static createInstance() {
  15762. return (fgui.UIPackage.createObject("loading", "xyItem"));
  15763. }
  15764. onConstruct() {
  15765. this.xyItem = (this.getChild("xyItem"));
  15766. }
  15767. }
  15768. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  15769. class ui_loadinfo extends fgui.GProgressBar {
  15770. static createInstance() {
  15771. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  15772. }
  15773. onConstruct() {
  15774. this.bg = (this.getChild("bg"));
  15775. this.bar = (this.getChild("bar"));
  15776. this.title = (this.getChild("title"));
  15777. this.ani = (this.getChild("ani"));
  15778. }
  15779. }
  15780. ui_loadinfo.URL = "ui://37nctnhwis36c";
  15781. class ui_xyNode extends fgui.GComponent {
  15782. static createInstance() {
  15783. return (fgui.UIPackage.createObject("loading", "xyNode"));
  15784. }
  15785. onConstruct() {
  15786. this.n0 = (this.getChild("n0"));
  15787. this.btnYes = (this.getChild("btnYes"));
  15788. this.btnNo = (this.getChild("btnNo"));
  15789. this.btnKnown = (this.getChild("btnKnown"));
  15790. this.btnSure = (this.getChild("btnSure"));
  15791. this.txtWelcom = (this.getChild("txtWelcom"));
  15792. this.txtXy = (this.getChild("txtXy"));
  15793. this.n75 = (this.getChild("n75"));
  15794. this.btnXy1 = (this.getChild("btnXy1"));
  15795. this.btnXy3 = (this.getChild("btnXy3"));
  15796. this.btnXy2 = (this.getChild("btnXy2"));
  15797. this.n74 = (this.getChild("n74"));
  15798. this.xy1 = (this.getChild("xy1"));
  15799. this.txtTitle = (this.getChild("txtTitle"));
  15800. this.btnBack = (this.getChild("btnBack"));
  15801. this.xyList = (this.getChild("xyList"));
  15802. this.xy2 = (this.getChild("xy2"));
  15803. this.xyNode = (this.getChild("xyNode"));
  15804. }
  15805. }
  15806. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  15807. class ui_ageNode extends fgui.GComponent {
  15808. static createInstance() {
  15809. return (fgui.UIPackage.createObject("loading", "ageNode"));
  15810. }
  15811. onConstruct() {
  15812. this.n3 = (this.getChild("n3"));
  15813. this.n7 = (this.getChild("n7"));
  15814. this.n4 = (this.getChild("n4"));
  15815. this.btnAge = (this.getChild("btnAge"));
  15816. this.ageNode = (this.getChild("ageNode"));
  15817. }
  15818. }
  15819. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  15820. class ui_rnNode extends fgui.GComponent {
  15821. static createInstance() {
  15822. return (fgui.UIPackage.createObject("loading", "rnNode"));
  15823. }
  15824. onConstruct() {
  15825. this.n28 = (this.getChild("n28"));
  15826. this.n30 = (this.getChild("n30"));
  15827. this.n33 = (this.getChild("n33"));
  15828. this.rn1 = (this.getChild("rn1"));
  15829. this.n40 = (this.getChild("n40"));
  15830. this.n41 = (this.getChild("n41"));
  15831. this.rn3 = (this.getChild("rn3"));
  15832. this.n37 = (this.getChild("n37"));
  15833. this.n39 = (this.getChild("n39"));
  15834. this.rn2 = (this.getChild("rn2"));
  15835. this.n47 = (this.getChild("n47"));
  15836. this.n49 = (this.getChild("n49"));
  15837. this.n44 = (this.getChild("n44"));
  15838. this.inputCode = (this.getChild("inputCode"));
  15839. this.inputName = (this.getChild("inputName"));
  15840. this.n48 = (this.getChild("n48"));
  15841. this.n50 = (this.getChild("n50"));
  15842. this.rn4 = (this.getChild("rn4"));
  15843. this.btnCheck = (this.getChild("btnCheck"));
  15844. this.btnExit = (this.getChild("btnExit"));
  15845. this.btnDone = (this.getChild("btnDone"));
  15846. this.rnNode = (this.getChild("rnNode"));
  15847. }
  15848. }
  15849. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  15850. class ui_tipNode extends fgui.GComponent {
  15851. static createInstance() {
  15852. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15853. }
  15854. onConstruct() {
  15855. this.bg = (this.getChild("bg"));
  15856. this.n55 = (this.getChild("n55"));
  15857. this.n56 = (this.getChild("n56"));
  15858. this.tipNode = (this.getChild("tipNode"));
  15859. }
  15860. }
  15861. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15862. class ui_fcmNode extends fgui.GComponent {
  15863. static createInstance() {
  15864. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15865. }
  15866. onConstruct() {
  15867. this.n63 = (this.getChild("n63"));
  15868. this.n62 = (this.getChild("n62"));
  15869. this.btnRn = (this.getChild("btnRn"));
  15870. this.n61 = (this.getChild("n61"));
  15871. this.n58 = (this.getChild("n58"));
  15872. this.fcmNode = (this.getChild("fcmNode"));
  15873. }
  15874. }
  15875. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15876. class ui_msgNode extends fgui.GComponent {
  15877. static createInstance() {
  15878. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15879. }
  15880. onConstruct() {
  15881. this.n69 = (this.getChild("n69"));
  15882. this.txtMsg = (this.getChild("txtMsg"));
  15883. this.msgNode = (this.getChild("msgNode"));
  15884. }
  15885. }
  15886. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15887. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15888. static createInstance() {
  15889. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15890. }
  15891. onConstruct() {
  15892. this.n1 = (this.getChild("n1"));
  15893. this.n13 = (this.getChild("n13"));
  15894. this.n14 = (this.getChild("n14"));
  15895. this.n15 = (this.getChild("n15"));
  15896. this.n3 = (this.getChild("n3"));
  15897. this.n4 = (this.getChild("n4"));
  15898. this.n5 = (this.getChild("n5"));
  15899. this.n6 = (this.getChild("n6"));
  15900. this.n7 = (this.getChild("n7"));
  15901. this.n8 = (this.getChild("n8"));
  15902. this.n9 = (this.getChild("n9"));
  15903. this.n10 = (this.getChild("n10"));
  15904. this.n12 = (this.getChild("n12"));
  15905. this.n11 = (this.getChild("n11"));
  15906. this.n16 = (this.getChild("n16"));
  15907. this.n17 = (this.getChild("n17"));
  15908. this.n18 = (this.getChild("n18"));
  15909. this.n20 = (this.getChild("n20"));
  15910. this.n21 = (this.getChild("n21"));
  15911. this.t0 = this.getTransition("t0");
  15912. }
  15913. }
  15914. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15915. class ui_btn5 extends fgui.GButton {
  15916. static createInstance() {
  15917. return (fgui.UIPackage.createObject("loading", "btn5"));
  15918. }
  15919. onConstruct() {
  15920. this.n9 = (this.getChild("n9"));
  15921. this.n1 = (this.getChild("n1"));
  15922. }
  15923. }
  15924. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15925. class ui_UILoading extends fgui.GComponent {
  15926. static createInstance() {
  15927. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15928. }
  15929. onConstruct() {
  15930. this.n12 = (this.getChild("n12"));
  15931. this.loadinfo = (this.getChild("loadinfo"));
  15932. this.n13 = (this.getChild("n13"));
  15933. this.txtLoad = (this.getChild("txtLoad"));
  15934. this.n18 = (this.getChild("n18"));
  15935. }
  15936. }
  15937. ui_UILoading.URL = "ui://37nctnhwphc33";
  15938. class ui_AgeItem extends fgui.GComponent {
  15939. static createInstance() {
  15940. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15941. }
  15942. onConstruct() {
  15943. this.txtAge = (this.getChild("txtAge"));
  15944. }
  15945. }
  15946. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15947. class ui_btn1 extends fgui.GButton {
  15948. static createInstance() {
  15949. return (fgui.UIPackage.createObject("loading", "btn1"));
  15950. }
  15951. onConstruct() {
  15952. this.n6 = (this.getChild("n6"));
  15953. this.n1 = (this.getChild("n1"));
  15954. }
  15955. }
  15956. ui_btn1.URL = "ui://37nctnhwxe622p";
  15957. class ui_btn3 extends fgui.GButton {
  15958. static createInstance() {
  15959. return (fgui.UIPackage.createObject("loading", "btn3"));
  15960. }
  15961. onConstruct() {
  15962. this.n9 = (this.getChild("n9"));
  15963. this.n1 = (this.getChild("n1"));
  15964. }
  15965. }
  15966. ui_btn3.URL = "ui://37nctnhwxe622s";
  15967. class ui_btn2 extends fgui.GButton {
  15968. static createInstance() {
  15969. return (fgui.UIPackage.createObject("loading", "btn2"));
  15970. }
  15971. onConstruct() {
  15972. this.n6 = (this.getChild("n6"));
  15973. this.n1 = (this.getChild("n1"));
  15974. }
  15975. }
  15976. ui_btn2.URL = "ui://37nctnhwxe622t";
  15977. class ui_btnBack extends fgui.GButton {
  15978. static createInstance() {
  15979. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15980. }
  15981. onConstruct() {
  15982. this.n6 = (this.getChild("n6"));
  15983. this.n7 = (this.getChild("n7"));
  15984. }
  15985. }
  15986. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15987. class ui_btnXy1 extends fgui.GButton {
  15988. static createInstance() {
  15989. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15990. }
  15991. onConstruct() {
  15992. this.n1 = (this.getChild("n1"));
  15993. }
  15994. }
  15995. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15996. class ui_btnXy2 extends fgui.GButton {
  15997. static createInstance() {
  15998. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15999. }
  16000. onConstruct() {
  16001. this.n1 = (this.getChild("n1"));
  16002. }
  16003. }
  16004. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16005. class ui_btnXy3 extends fgui.GButton {
  16006. static createInstance() {
  16007. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16008. }
  16009. onConstruct() {
  16010. this.n1 = (this.getChild("n1"));
  16011. }
  16012. }
  16013. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16014. class ui_btn4 extends fgui.GButton {
  16015. static createInstance() {
  16016. return (fgui.UIPackage.createObject("loading", "btn4"));
  16017. }
  16018. onConstruct() {
  16019. this.n9 = (this.getChild("n9"));
  16020. this.n1 = (this.getChild("n1"));
  16021. }
  16022. }
  16023. ui_btn4.URL = "ui://37nctnhwxe622z";
  16024. class loadingBinder {
  16025. static bindAll() {
  16026. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16027. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16028. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16029. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16030. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16031. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16032. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16033. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16034. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16035. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16036. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16037. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16038. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16039. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16040. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16041. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16042. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16043. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16044. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16045. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16046. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16047. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16048. }
  16049. }
  16050. class UIMgr {
  16051. constructor() {
  16052. this._stage = null;
  16053. this._uiList = [];
  16054. this._showList = [];
  16055. this._bindPkgList = [];
  16056. this.uiIndex = 0;
  16057. }
  16058. static get inst() {
  16059. if (UIMgr._inst == null) {
  16060. UIMgr._inst = new UIMgr();
  16061. }
  16062. return UIMgr._inst;
  16063. }
  16064. setStage(s) {
  16065. if (this._stage) {
  16066. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16067. return;
  16068. }
  16069. this._stage = s;
  16070. }
  16071. clearTempData() {
  16072. console.log('zh:clearTempData start');
  16073. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16074. console.log('zh:clearTempData end');
  16075. }
  16076. init() {
  16077. this.setStage(Laya.stage);
  16078. fairygui.UIConfig.defaultFont = "微软雅黑";
  16079. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  16080. fairygui.UIConfig.packageFileExtension = "obj";
  16081. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16082. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16083. fairygui.GRoot.inst.width = Laya.stage.width;
  16084. fairygui.GRoot.inst.height = Laya.stage.height;
  16085. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16086. }
  16087. addAllUpdate() {
  16088. this.uiIndex = 0;
  16089. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16090. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16091. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16092. }
  16093. }
  16094. }
  16095. bindFUI(pkgname) {
  16096. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16097. return;
  16098. }
  16099. switch (pkgname) {
  16100. case fguiRes.loading:
  16101. fairygui.UIPackage.addPackage(pkgname);
  16102. loadingBinder.bindAll();
  16103. this._bindPkgList.push(pkgname);
  16104. break;
  16105. case fguiRes.game:
  16106. fairygui.UIPackage.addPackage(pkgname);
  16107. gameBinder.bindAll();
  16108. this._bindPkgList.push(pkgname);
  16109. break;
  16110. default:
  16111. break;
  16112. }
  16113. }
  16114. Show(cls, ...param) {
  16115. let nameStr = cls.uiName;
  16116. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16117. let temp = this._uiList[i];
  16118. let str = temp.className;
  16119. if (str == nameStr) {
  16120. if (temp.isMuti) {
  16121. if (temp.isHide) {
  16122. temp.show(...param);
  16123. this._uiList.splice(i, 1);
  16124. this._uiList.push(temp);
  16125. return temp;
  16126. }
  16127. }
  16128. else {
  16129. temp.show(...param);
  16130. this._uiList.splice(i, 1);
  16131. this._uiList.push(temp);
  16132. return temp;
  16133. }
  16134. }
  16135. }
  16136. let ui = new cls();
  16137. ui.className = nameStr;
  16138. this._showUI(ui, param);
  16139. return ui;
  16140. }
  16141. destroyUI(ui) {
  16142. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16143. let temp = this._uiList[i].className;
  16144. if (temp == ui.className) {
  16145. this._uiList.splice(i, 1);
  16146. break;
  16147. }
  16148. }
  16149. this.checkUIState();
  16150. }
  16151. _showUI(ui, param) {
  16152. this._uiList.push(ui);
  16153. ui.show(...param);
  16154. }
  16155. Hide(uiClass) {
  16156. let ui = this.getUI(uiClass);
  16157. if (ui && !ui.isHide) {
  16158. ui.hide();
  16159. }
  16160. }
  16161. getUI(ui) {
  16162. let nameStr = ui.uiName;
  16163. for (let index = 0; index < this._uiList.length; index++) {
  16164. let temp = this._uiList[index];
  16165. if (temp.className == nameStr) {
  16166. return temp;
  16167. }
  16168. }
  16169. return null;
  16170. }
  16171. isShow(cls) {
  16172. for (var i of this._uiList) {
  16173. if (i instanceof cls) {
  16174. return i.isShowing;
  16175. }
  16176. }
  16177. return false;
  16178. }
  16179. showUINum() {
  16180. let num = 0;
  16181. for (var i of this._uiList) {
  16182. if (i.isShowing) {
  16183. num++;
  16184. }
  16185. }
  16186. return num;
  16187. }
  16188. checkUIState() {
  16189. Laya.timer.clear(this, this._uiCheck);
  16190. Laya.timer.once(400, this, this._uiCheck);
  16191. }
  16192. _uiCheck() {
  16193. let showList = [];
  16194. for (var i of this._uiList) {
  16195. if (!i.isHide) {
  16196. showList.push(i);
  16197. }
  16198. }
  16199. for (let index = 0; index < showList.length; index++) {
  16200. if (index == showList.length - 1) {
  16201. showList[index].checkActive(true);
  16202. }
  16203. else {
  16204. showList[index].checkActive(false);
  16205. }
  16206. }
  16207. }
  16208. showTip(msg, time = 600, size = 30) {
  16209. }
  16210. }
  16211. class UIShowList {
  16212. }
  16213. class SoundMgr {
  16214. constructor() {
  16215. this.soundMax = 4;
  16216. this.isLoad = false;
  16217. this.soundMap = {};
  16218. this.isSound = true;
  16219. this.openShake = true;
  16220. SoundMgr._instance = this;
  16221. }
  16222. static getInstance() {
  16223. if (!this._instance) {
  16224. this._instance = new SoundMgr();
  16225. }
  16226. return this._instance;
  16227. }
  16228. init() {
  16229. console.log('zh:sm init 1');
  16230. Laya.SoundManager.autoReleaseSound = true;
  16231. Laya.SoundManager.autoStopMusic = true;
  16232. Laya.SoundManager.musicVolume = 0.3;
  16233. Laya.SoundManager.soundVolume = 0.5;
  16234. this.musicPlayed = false;
  16235. this.audioUrl = "asset/sound/ogg/";
  16236. console.log('zh:sm init 2');
  16237. console.log('zh:dev type ');
  16238. if (Laya.Browser.onAndroid) {
  16239. console.log('zh:dev type android');
  16240. this.audioUrl = "asset/sound/ogg/";
  16241. this.isLoad = true;
  16242. }
  16243. else {
  16244. console.log('zh:dev type not android');
  16245. this.audioUrl = "asset/sound/mp3/";
  16246. this.isLoad = true;
  16247. }
  16248. }
  16249. onSetting(isS) {
  16250. this.isSound = isS;
  16251. this.mute(!this.isSound);
  16252. }
  16253. clearCount() {
  16254. for (var key in this.soundMap) {
  16255. delete this.soundMap[key];
  16256. }
  16257. }
  16258. playMusic(path, loop = 0) {
  16259. console.log('zh:playMusic 1 PATH=' + path);
  16260. this.musicPath = path;
  16261. if (!this.isLoad) {
  16262. return;
  16263. }
  16264. if (!path || path == "") {
  16265. return;
  16266. }
  16267. if (!this.isSound) {
  16268. return;
  16269. }
  16270. this.musicPlayed = true;
  16271. let url = this.getUrl(path);
  16272. if (!Laya.Browser.onAndroid) {
  16273. Laya.loader.load(url, Laya.Handler.create(this, () => {
  16274. this.play(url, loop);
  16275. }));
  16276. }
  16277. else {
  16278. this.play(url, loop);
  16279. }
  16280. }
  16281. play(url, loop) {
  16282. Laya.SoundManager.playMusic(url, loop);
  16283. }
  16284. getUrl(path) {
  16285. let url = this.audioUrl + path;
  16286. if (Laya.Browser.onAndroid) {
  16287. url += ".ogg";
  16288. }
  16289. else {
  16290. url += ".mp3";
  16291. }
  16292. return url;
  16293. }
  16294. pauseMusic(pause) {
  16295. if (pause) {
  16296. this.mute(true);
  16297. }
  16298. else if (this.isSound)
  16299. this.mute(false);
  16300. }
  16301. stopMusic() {
  16302. Laya.SoundManager.stopMusic();
  16303. if (Moyu.isNeedPlatAudio) {
  16304. Moyu.stopMusic();
  16305. }
  16306. }
  16307. mute(mute) {
  16308. if (Moyu.isNeedPlatAudio) {
  16309. Moyu.pauseMusic(mute);
  16310. }
  16311. else {
  16312. Laya.SoundManager.musicMuted = mute;
  16313. if (!mute && !this.musicPlayed && this.musicPath) {
  16314. this.playMusic(this.musicPath);
  16315. }
  16316. }
  16317. }
  16318. stopSound(path) {
  16319. let url = this.getUrl(path);
  16320. Laya.SoundManager.stopSound(url);
  16321. }
  16322. playSound(path, loop = 1, soundMax = this.soundMax) {
  16323. if (!this.isLoad)
  16324. return;
  16325. if (!this.isSound)
  16326. return;
  16327. if (!path || path == "")
  16328. return;
  16329. let url = this.getUrl(path);
  16330. if (Moyu.isNeedPlatAudio) {
  16331. Moyu.playSound(path, loop == 0);
  16332. }
  16333. else {
  16334. let count = 1;
  16335. if (this.soundMap[path])
  16336. count = this.soundMap[path] + 1;
  16337. if (count > soundMax)
  16338. return;
  16339. this.soundMap[path] = count;
  16340. Laya.SoundManager.playSound(url, loop);
  16341. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  16342. }
  16343. }
  16344. removePath(path) {
  16345. if (this.soundMap[path]) {
  16346. let count = this.soundMap[path];
  16347. count--;
  16348. if (count < 1)
  16349. delete this.soundMap[path];
  16350. else
  16351. this.soundMap[path] = count;
  16352. }
  16353. }
  16354. playBtnSound() {
  16355. this.playSound("btn");
  16356. }
  16357. playGetSound() {
  16358. }
  16359. playCloseUISound() {
  16360. }
  16361. }
  16362. SoundMgr._instance = null;
  16363. var Handler$1 = Laya.Handler;
  16364. var EResType;
  16365. (function (EResType) {
  16366. EResType[EResType["none"] = 0] = "none";
  16367. EResType[EResType["nromal"] = 1] = "nromal";
  16368. EResType[EResType["td"] = 2] = "td";
  16369. EResType[EResType["sk"] = 3] = "sk";
  16370. })(EResType || (EResType = {}));
  16371. class CResLoader {
  16372. constructor(doneCall, proCall) {
  16373. this.completrCall = doneCall;
  16374. this.progressCall = proCall;
  16375. this.progressHander = new Handler$1(this, this.onProgress);
  16376. this.tdResMap = {};
  16377. }
  16378. load(resList) {
  16379. this.resCount = 0;
  16380. this.loadCount = 0;
  16381. for (let i = 0; i < resList.length; i++) {
  16382. let path = resList[i];
  16383. if (!path)
  16384. continue;
  16385. this.resCount++;
  16386. let type = this.getResType(path);
  16387. if (type == EResType.nromal)
  16388. this.loadNromal(path);
  16389. else if (type == EResType.td)
  16390. this.loadTd(path);
  16391. }
  16392. }
  16393. getRes(path) {
  16394. let type = this.getResType(path);
  16395. if (type == EResType.nromal)
  16396. return Laya.loader.getRes(path);
  16397. else if (type == EResType.td) {
  16398. let res = this.tdResMap[path];
  16399. if (res)
  16400. return res.clone();
  16401. return null;
  16402. }
  16403. }
  16404. destroy() {
  16405. this.progressHander.clear();
  16406. this.progressHander = null;
  16407. }
  16408. clearRes(path) {
  16409. let type = this.getResType(path);
  16410. if (type == EResType.nromal)
  16411. Laya.loader.clearRes(path);
  16412. else if (type == EResType.td) {
  16413. let obj = this.tdResMap[path];
  16414. if (obj)
  16415. obj.destroy();
  16416. delete this.tdResMap[path];
  16417. }
  16418. }
  16419. getResType(path) {
  16420. let exs = this.getExtension(path);
  16421. if (exs == "sk")
  16422. return EResType.sk;
  16423. if (exs == "ls" || exs == "lh" || exs == "lm")
  16424. return EResType.td;
  16425. else
  16426. return EResType.nromal;
  16427. }
  16428. getExtension(res) {
  16429. var index = res.lastIndexOf(".");
  16430. return res.substr(index + 1);
  16431. }
  16432. loadNromal(path) {
  16433. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  16434. if (res) {
  16435. this.onLoad();
  16436. }
  16437. else
  16438. console.log("load res fail:" + path);
  16439. }), this.progressHander);
  16440. }
  16441. loadSk() {
  16442. }
  16443. loadTd(path) {
  16444. if (this.tdResMap[path]) {
  16445. this.onLoad();
  16446. return;
  16447. }
  16448. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  16449. if (res) {
  16450. this.tdResMap[path] = res;
  16451. this.onLoad();
  16452. }
  16453. else
  16454. console.log("load res fail:" + path);
  16455. }));
  16456. }
  16457. onLoad() {
  16458. this.loadCount++;
  16459. this.onProgress(1);
  16460. if (this.loadCount >= this.resCount) {
  16461. this.completrCall.run();
  16462. }
  16463. }
  16464. onProgress(pro) {
  16465. let progress = (this.loadCount + pro) / this.resCount;
  16466. this.progressCall.runWith(progress);
  16467. }
  16468. }
  16469. var Handler$2 = Laya.Handler;
  16470. class ResInfo {
  16471. constructor() {
  16472. this.index = 0;
  16473. }
  16474. }
  16475. class ResMgr {
  16476. constructor() {
  16477. this.resList = [];
  16478. this.doneList = [];
  16479. this.resMap = {};
  16480. this.currentLoad = null;
  16481. this.completeHandler = new Handler$2(this, this.onComplete);
  16482. this.progressHandler = new Handler$2(this, this.onProgress);
  16483. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  16484. }
  16485. static getInstance() {
  16486. if (ResMgr._instance == null) {
  16487. ResMgr._instance = new ResMgr();
  16488. }
  16489. return ResMgr._instance;
  16490. }
  16491. loadList(list, completeHandler, progressHandler) {
  16492. if (list.length < 1) {
  16493. completeHandler.run();
  16494. return;
  16495. }
  16496. let info = this.getResInfo();
  16497. info.resList = list;
  16498. info.completeHandler = completeHandler;
  16499. info.progressHandler = progressHandler;
  16500. this.resList.push(info);
  16501. this.startLoad();
  16502. }
  16503. loadFguiRes(list, completeHandler, progressHandler) {
  16504. Laya.loader.load(list, completeHandler, progressHandler);
  16505. }
  16506. loadAny(list, completeHandler, progressHandler) {
  16507. Laya.loader.load(list, completeHandler, progressHandler);
  16508. }
  16509. load(path, completeHandler, progressHandler) {
  16510. let count = this.resMap[path];
  16511. if (count && count > 0) {
  16512. if (completeHandler)
  16513. completeHandler.run();
  16514. }
  16515. else
  16516. this.loadList([path], completeHandler, progressHandler);
  16517. }
  16518. getRes(path) {
  16519. let res = this.resMap[path];
  16520. if (!res)
  16521. this.showLog("资源不存在:" + path);
  16522. else
  16523. return this.loader.getRes(path);
  16524. }
  16525. clearList(list, force = false) {
  16526. if (!list || list.length < 1)
  16527. return;
  16528. let cr = () => {
  16529. for (const k in list) {
  16530. let v = list[k];
  16531. if (!v)
  16532. continue;
  16533. if (force) {
  16534. this.loader.clearRes(v);
  16535. delete this.resMap[v];
  16536. }
  16537. else {
  16538. let count = this.resMap[v];
  16539. if (count && count > 1) {
  16540. count--;
  16541. this.resMap[v] = count;
  16542. }
  16543. else {
  16544. this.loader.clearRes(v);
  16545. delete this.resMap[v];
  16546. }
  16547. }
  16548. }
  16549. if (!window.hasOwnProperty("ks"))
  16550. Laya.Resource.destroyUnusedResources();
  16551. };
  16552. Laya.timer.clearAll(this);
  16553. Laya.timer.once(2000, this, cr);
  16554. }
  16555. clear3D() {
  16556. for (const k in this.loader.tdResMap) {
  16557. this.loader.clearRes(k);
  16558. if (this.resMap[k])
  16559. delete this.resMap[k];
  16560. }
  16561. if (!window.hasOwnProperty("ks"))
  16562. Laya.Resource.destroyUnusedResources();
  16563. }
  16564. clear(path, force = false) {
  16565. this.clearList([path], force);
  16566. }
  16567. getResInfo() {
  16568. if (this.doneList.length > 0)
  16569. return this.doneList.pop();
  16570. else
  16571. return new ResInfo();
  16572. }
  16573. startLoad() {
  16574. if (this.currentLoad)
  16575. return;
  16576. this.currentLoad = this.resList.pop();
  16577. if (this.currentLoad) {
  16578. this.loader.load(this.currentLoad.resList);
  16579. }
  16580. }
  16581. onComplete() {
  16582. if (!this.currentLoad)
  16583. return;
  16584. for (const k in this.currentLoad.resList) {
  16585. let v = this.currentLoad.resList[k];
  16586. let count = this.resMap[v];
  16587. if (count)
  16588. count++;
  16589. else
  16590. count = 1;
  16591. this.resMap[v] = count;
  16592. }
  16593. if (this.currentLoad.completeHandler)
  16594. this.currentLoad.completeHandler.run();
  16595. this.doneList.push(this.currentLoad);
  16596. this.currentLoad = null;
  16597. this.startLoad();
  16598. }
  16599. onProgress(pro) {
  16600. if (!this.currentLoad)
  16601. return;
  16602. if (this.currentLoad.progressHandler)
  16603. this.currentLoad.progressHandler.runWith(pro);
  16604. }
  16605. showLog(str, ...args) {
  16606. console.log("[ResLoader] " + str);
  16607. }
  16608. }
  16609. ResMgr._instance = null;
  16610. class EventMgr extends Laya.EventDispatcher {
  16611. }
  16612. let eventMgr = new EventMgr();
  16613. /*! *****************************************************************************
  16614. Copyright (c) Microsoft Corporation. All rights reserved.
  16615. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  16616. this file except in compliance with the License. You may obtain a copy of the
  16617. License at http://www.apache.org/licenses/LICENSE-2.0
  16618. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16619. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  16620. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  16621. MERCHANTABLITY OR NON-INFRINGEMENT.
  16622. See the Apache Version 2.0 License for specific language governing permissions
  16623. and limitations under the License.
  16624. ***************************************************************************** */
  16625. /* global Reflect, Promise */
  16626. var extendStatics = function(d, b) {
  16627. extendStatics = Object.setPrototypeOf ||
  16628. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16629. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16630. return extendStatics(d, b);
  16631. };
  16632. function __extends(d, b) {
  16633. extendStatics(d, b);
  16634. function __() { this.constructor = d; }
  16635. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16636. }
  16637. var __assign = function() {
  16638. __assign = Object.assign || function __assign(t) {
  16639. for (var s, i = 1, n = arguments.length; i < n; i++) {
  16640. s = arguments[i];
  16641. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  16642. }
  16643. return t;
  16644. };
  16645. return __assign.apply(this, arguments);
  16646. };
  16647. function __rest(s, e) {
  16648. var t = {};
  16649. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  16650. t[p] = s[p];
  16651. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  16652. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  16653. t[p[i]] = s[p[i]];
  16654. return t;
  16655. }
  16656. function __decorate(decorators, target, key, desc) {
  16657. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  16658. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  16659. 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;
  16660. return c > 3 && r && Object.defineProperty(target, key, r), r;
  16661. }
  16662. function __param(paramIndex, decorator) {
  16663. return function (target, key) { decorator(target, key, paramIndex); }
  16664. }
  16665. function __metadata(metadataKey, metadataValue) {
  16666. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  16667. }
  16668. function __awaiter(thisArg, _arguments, P, generator) {
  16669. return new (P || (P = Promise))(function (resolve, reject) {
  16670. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  16671. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  16672. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  16673. step((generator = generator.apply(thisArg, _arguments || [])).next());
  16674. });
  16675. }
  16676. function __generator(thisArg, body) {
  16677. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  16678. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  16679. function verb(n) { return function (v) { return step([n, v]); }; }
  16680. function step(op) {
  16681. if (f) throw new TypeError("Generator is already executing.");
  16682. while (_) try {
  16683. 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;
  16684. if (y = 0, t) op = [op[0] & 2, t.value];
  16685. switch (op[0]) {
  16686. case 0: case 1: t = op; break;
  16687. case 4: _.label++; return { value: op[1], done: false };
  16688. case 5: _.label++; y = op[1]; op = [0]; continue;
  16689. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  16690. default:
  16691. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  16692. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  16693. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  16694. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  16695. if (t[2]) _.ops.pop();
  16696. _.trys.pop(); continue;
  16697. }
  16698. op = body.call(thisArg, _);
  16699. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  16700. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  16701. }
  16702. }
  16703. function __exportStar(m, exports) {
  16704. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  16705. }
  16706. function __values(o) {
  16707. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  16708. if (m) return m.call(o);
  16709. return {
  16710. next: function () {
  16711. if (o && i >= o.length) o = void 0;
  16712. return { value: o && o[i++], done: !o };
  16713. }
  16714. };
  16715. }
  16716. function __read(o, n) {
  16717. var m = typeof Symbol === "function" && o[Symbol.iterator];
  16718. if (!m) return o;
  16719. var i = m.call(o), r, ar = [], e;
  16720. try {
  16721. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  16722. }
  16723. catch (error) { e = { error: error }; }
  16724. finally {
  16725. try {
  16726. if (r && !r.done && (m = i["return"])) m.call(i);
  16727. }
  16728. finally { if (e) throw e.error; }
  16729. }
  16730. return ar;
  16731. }
  16732. function __spread() {
  16733. for (var ar = [], i = 0; i < arguments.length; i++)
  16734. ar = ar.concat(__read(arguments[i]));
  16735. return ar;
  16736. }
  16737. function __await(v) {
  16738. return this instanceof __await ? (this.v = v, this) : new __await(v);
  16739. }
  16740. function __asyncGenerator(thisArg, _arguments, generator) {
  16741. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  16742. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  16743. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  16744. 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); }); }; }
  16745. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  16746. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  16747. function fulfill(value) { resume("next", value); }
  16748. function reject(value) { resume("throw", value); }
  16749. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  16750. }
  16751. function __asyncDelegator(o) {
  16752. var i, p;
  16753. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  16754. 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; }
  16755. }
  16756. function __asyncValues(o) {
  16757. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  16758. var m = o[Symbol.asyncIterator], i;
  16759. 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);
  16760. 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); }); }; }
  16761. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  16762. }
  16763. function __makeTemplateObject(cooked, raw) {
  16764. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  16765. return cooked;
  16766. };
  16767. function __importStar(mod) {
  16768. if (mod && mod.__esModule) return mod;
  16769. var result = {};
  16770. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  16771. result.default = mod;
  16772. return result;
  16773. }
  16774. function __importDefault(mod) {
  16775. return (mod && mod.__esModule) ? mod : { default: mod };
  16776. }
  16777. class CustomAlert {
  16778. static show(title, content, buttons) {
  16779. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  16780. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  16781. return;
  16782. }
  16783. const bg = new Laya.Box();
  16784. bg.alpha = 0;
  16785. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  16786. Laya.stage.addChild(bg);
  16787. Laya.Tween.to(bg, { alpha: 1 }, 200);
  16788. const panel = new Laya.Box();
  16789. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  16790. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  16791. bg.addChild(panel);
  16792. const titleText = new Laya.Text();
  16793. titleText.text = title;
  16794. titleText.fontSize = 32;
  16795. titleText.color = "#333333";
  16796. titleText.bold = true;
  16797. titleText.pos(20, 20);
  16798. titleText.width = 360;
  16799. titleText.align = "center";
  16800. panel.addChild(titleText);
  16801. const contentText = new Laya.Text();
  16802. contentText.text = content;
  16803. contentText.fontSize = 21;
  16804. contentText.color = "#555555";
  16805. contentText.pos(20, 70);
  16806. contentText.width = 360;
  16807. contentText.wordWrap = true;
  16808. contentText.align = "center";
  16809. panel.addChild(contentText);
  16810. const buttonContainer = new Laya.Box();
  16811. buttonContainer.pos(20, 160);
  16812. panel.addChild(buttonContainer);
  16813. const btnWidth = 120;
  16814. const spacing = 30;
  16815. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  16816. buttons.forEach((btn, index) => {
  16817. const button = new Laya.Button();
  16818. button.label = btn.label;
  16819. button.size(btnWidth, 40);
  16820. button.labelSize = 22;
  16821. button.pos(index * (btnWidth + spacing), 0);
  16822. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  16823. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  16824. button.on(Laya.Event.MOUSE_OVER, this, () => {
  16825. button.alpha = 0.9;
  16826. });
  16827. button.on(Laya.Event.MOUSE_OUT, this, () => {
  16828. button.alpha = 1;
  16829. });
  16830. button.on(Laya.Event.CLICK, this, () => {
  16831. btn.handler();
  16832. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  16833. bg.removeSelf();
  16834. }));
  16835. });
  16836. buttonContainer.addChild(button);
  16837. });
  16838. buttonContainer.x = (panel.width - totalWidth) / 2;
  16839. }
  16840. }
  16841. class ConfigMgr {
  16842. constructor() {
  16843. this.httpReqCount = 4;
  16844. this.httpReqOkCount = 0;
  16845. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  16846. try {
  16847. this.httpReqOkCount = 0;
  16848. let reqData = JSON.stringify({
  16849. gameName: "TQ",
  16850. gameUserName: "zhangSan"
  16851. });
  16852. console.log('zh:第1个请求');
  16853. const classicCfg = yield this.sendPostAsync('getClassicCfg', reqData);
  16854. this.classicCfg = classicCfg;
  16855. this.httpReqOkCount++;
  16856. console.log('zh:第2个请求');
  16857. const levelCfg = yield this.sendPostAsync('getLevelCfg', reqData);
  16858. this.levelCfg = levelCfg;
  16859. this.httpReqOkCount++;
  16860. console.log('zh:第3个请求');
  16861. const placeBallCfg = yield this.sendPostAsync('getPlaceBallCfg', reqData);
  16862. this.placeBallCfg = placeBallCfg;
  16863. this.httpReqOkCount++;
  16864. console.log('zh:第4个请求npc');
  16865. const npc = yield this.sendPostAsync('getNpc', reqData);
  16866. this.npcJson = npc.Data;
  16867. this.httpReqOkCount++;
  16868. console.log('zh:所有配置加载完成');
  16869. }
  16870. catch (error) {
  16871. console.error('请求失败:', error);
  16872. }
  16873. finally {
  16874. if (this.httpReqCount > this.httpReqOkCount) {
  16875. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  16876. {
  16877. label: "Okay", handler: () => {
  16878. console.log("zh:好的知道了");
  16879. JSBridgeUtils.instance.exitAndCloseGame();
  16880. }
  16881. }
  16882. ]);
  16883. }
  16884. }
  16885. });
  16886. this.sendPostAsync = (action, reqData) => {
  16887. return new Promise((resolve, reject) => {
  16888. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  16889. try {
  16890. let code = res.code;
  16891. if (code == 200) {
  16892. const parsedData = JSON.parse(res.msg);
  16893. resolve(parsedData);
  16894. }
  16895. else {
  16896. console.log(`zh:res = ${JSON.stringify(res)}`);
  16897. reject(new Error(`Request failed with code: ${code}`));
  16898. }
  16899. }
  16900. catch (error) {
  16901. console.error(`error=${error}`);
  16902. alert("Please check your network connection.");
  16903. reject(error);
  16904. }
  16905. finally {
  16906. console.log(`zh:${action}`);
  16907. }
  16908. });
  16909. });
  16910. };
  16911. }
  16912. static getInstance() {
  16913. if (!this._instance) {
  16914. this._instance = new ConfigMgr();
  16915. }
  16916. return this._instance;
  16917. }
  16918. init() {
  16919. this.getConfigFromServer();
  16920. }
  16921. test() {
  16922. let reqData = JSON.stringify({
  16923. gameName: "TQ",
  16924. gameUserName: "zhangSan"
  16925. });
  16926. xGame.httpMgr.sendPost2025('getClassicCfg', reqData, (res) => {
  16927. console.log('zh:1s');
  16928. try {
  16929. let code = res.code;
  16930. let data = res.data;
  16931. if (code == 200) {
  16932. const parsedData = JSON.parse(data);
  16933. this.classicCfg = parsedData;
  16934. }
  16935. else {
  16936. console.log('zh:res = ' + JSON.stringify(res));
  16937. }
  16938. }
  16939. catch (error) {
  16940. console.log('error=' + error);
  16941. alert("Please check your network connection.");
  16942. }
  16943. finally {
  16944. console.log('zh:1');
  16945. }
  16946. });
  16947. }
  16948. getUserInfoByIndex(index) {
  16949. return this.npcJson[index];
  16950. }
  16951. getRandomUserInfo() {
  16952. let index = xGame.tools.random(0, this.npcJson.length);
  16953. let rs = this.npcJson[index];
  16954. return rs;
  16955. }
  16956. getMaxBigMoveLength() {
  16957. return Object.keys(this.levelCfg).length;
  16958. }
  16959. getBigMoveLevelByIndex(index) {
  16960. let cfg = this.levelCfg;
  16961. cfg = cfg[index];
  16962. return cfg;
  16963. }
  16964. getRandomClassicLevel() {
  16965. let cfg = this.classicCfg;
  16966. let num = Object.keys(cfg).length;
  16967. let rand = xGame.common.randomNum(1, num);
  16968. return cfg[rand];
  16969. }
  16970. getPlaceBallByLevel(level) {
  16971. return this.placeBallCfg[level];
  16972. }
  16973. getMaxPlaceBall() {
  16974. return Object.keys(this.placeBallCfg).length;
  16975. }
  16976. }
  16977. class PoolD3Mgr {
  16978. constructor() {
  16979. this.pool = {};
  16980. }
  16981. static get ins() {
  16982. return this._ins || (this._ins = new PoolD3Mgr);
  16983. }
  16984. createList(key, prefab, parent) {
  16985. if (!this.pool[key]) {
  16986. this.pool[key] = {};
  16987. this.pool[key].prefab = prefab;
  16988. this.pool[key].list = [];
  16989. this.pool[key].parent = parent;
  16990. }
  16991. }
  16992. getItem(key) {
  16993. if (!this.pool[key]) {
  16994. return;
  16995. }
  16996. let temp;
  16997. if (this.pool[key].list.length > 0) {
  16998. temp = this.pool[key].list.pop();
  16999. }
  17000. else {
  17001. temp = this.pool[key].prefab.clone();
  17002. if (this.pool[key].parent) {
  17003. this.pool[key].parent.addChild(temp);
  17004. }
  17005. }
  17006. temp.active = true;
  17007. return temp;
  17008. }
  17009. putItem(key, obj) {
  17010. if (!this.pool[key]) {
  17011. return;
  17012. }
  17013. obj.active = false;
  17014. this.pool[key].list.push(obj);
  17015. }
  17016. }
  17017. let context$1 = context;
  17018. let uiMgr = UIMgr.inst;
  17019. let soundMgr = SoundMgr.getInstance();
  17020. let resMgr = ResMgr.getInstance();
  17021. let httpMgr = HttpMgr.getInstance();
  17022. let common = Common.getInstance();
  17023. let cfgMgr = ConfigMgr.getInstance();
  17024. let poolD3Mgr = PoolD3Mgr.ins;
  17025. let d3TexUrl = "res/d3Res/";
  17026. let d3ModeUrl = "res/unityRes/";
  17027. function setStageSize(view) {
  17028. if (view.width) {
  17029. view.width = Laya.stage.width;
  17030. view.height = Laya.stage.height;
  17031. }
  17032. }
  17033. function filledBg(view) {
  17034. let wh = Laya.stage.height / Laya.stage.width;
  17035. if (wh > 16 / 9) {
  17036. view.height = Laya.stage.height;
  17037. view.width = Laya.stage.height / 1334 * 750;
  17038. }
  17039. else {
  17040. view.width = Laya.stage.width;
  17041. view.height = Laya.stage.width / 750 * 1334;
  17042. }
  17043. }
  17044. function setNotch(view) {
  17045. if (view.height) {
  17046. view.y += context$1.notchHeight;
  17047. }
  17048. }
  17049. function showTip(str) {
  17050. uiMgr.Show(UIMsg, str);
  17051. }
  17052. function log(...args) {
  17053. console.log(args);
  17054. }
  17055. let xGame = {
  17056. context: context$1,
  17057. eventMgr,
  17058. resMgr,
  17059. uiMgr,
  17060. soundMgr,
  17061. define,
  17062. tools,
  17063. httpMgr,
  17064. d3TexUrl,
  17065. d3ModeUrl,
  17066. common,
  17067. cfgMgr,
  17068. poolD3Mgr,
  17069. setStageSize,
  17070. filledBg,
  17071. setNotch,
  17072. showTip,
  17073. log,
  17074. };
  17075. window["xGame"] = xGame;
  17076. let dataName = 'tBall_';
  17077. class UserData {
  17078. constructor() {
  17079. this.userId = "";
  17080. this.isAgree = false;
  17081. this.coinNum = 0;
  17082. this.gemNum = 0;
  17083. this.sound = true;
  17084. this.vibration = true;
  17085. this.currentDate = 0;
  17086. this.createTime = 0;
  17087. this.awardTime = 0;
  17088. this.roleId = 1;
  17089. this.roleList = [];
  17090. this.roleAds = [];
  17091. this.dressId = 101;
  17092. this.itemId = 201;
  17093. this.bigSkills = [1, 1, 1, 1, 1];
  17094. this.coin = 4000;
  17095. this.diamond = 0;
  17096. this.skillSuccessTimes = 0;
  17097. this.skillGuide = 0;
  17098. this.skillAccTimes = 0;
  17099. this.placeBallData = [];
  17100. this.shareDiamondTimes = 0;
  17101. this.dailyVideoShareTimes = 0;
  17102. this.secretary = [1, 0];
  17103. this.curSecretary = 0;
  17104. this.ballRod = [1, 0, 0, 0, 0, 1];
  17105. this.curBallRod = 5;
  17106. this.signData = 0;
  17107. this.signTime = 0;
  17108. this.drawTimes = 0;
  17109. this.drawAwardTimes = 0;
  17110. this.dailyfreeDrawTimes = 1;
  17111. this.power = 5;
  17112. this.powerTime = 0;
  17113. this.challengeTimes = 0;
  17114. this.extraSign = 0;
  17115. this.classicTimes = 0;
  17116. this.guideHelpLine = 0;
  17117. this.newUser = true;
  17118. this.rootBallFoul = 0;
  17119. this.timeoutFoul = 0;
  17120. this.roleList = [1];
  17121. }
  17122. saveData() {
  17123. let data = {};
  17124. for (let k in this) {
  17125. data[k.toString()] = this[k];
  17126. }
  17127. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  17128. }
  17129. getData() {
  17130. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  17131. if (ld) {
  17132. let localData = JSON.parse(ld);
  17133. if (localData) {
  17134. for (let k in this) {
  17135. let key = k.toString();
  17136. let data = localData[key];
  17137. if (data != undefined) {
  17138. this[k] = data;
  17139. }
  17140. }
  17141. }
  17142. }
  17143. }
  17144. }
  17145. class ItemData {
  17146. constructor() {
  17147. this.itemList = {};
  17148. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  17149. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  17150. }
  17151. saveData() {
  17152. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  17153. }
  17154. getData() {
  17155. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  17156. if (ld) {
  17157. let localData = JSON.parse(ld);
  17158. if (localData) {
  17159. this.itemList = localData;
  17160. }
  17161. }
  17162. }
  17163. }
  17164. class GameData {
  17165. constructor() {
  17166. this.curLevel = 0;
  17167. this.gameType = 1;
  17168. this.signIdx = 0;
  17169. this.signMax = 0;
  17170. this.rotaryTime = 0;
  17171. this.rotaryCount = 0;
  17172. this.rotaryList = [];
  17173. this.diyCount = 3;
  17174. this.awardIdx = 0;
  17175. this.shareNum = 2;
  17176. this.rankWeek = 0;
  17177. this.rankScore = 0;
  17178. this.gameCount = 0;
  17179. this.trySkill = -1;
  17180. this.tryTime = 0;
  17181. }
  17182. saveData() {
  17183. let data = {};
  17184. for (let k in this) {
  17185. data[k.toString()] = this[k];
  17186. }
  17187. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  17188. }
  17189. getData() {
  17190. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  17191. if (ld) {
  17192. let localData = JSON.parse(ld);
  17193. if (localData) {
  17194. for (let k in this) {
  17195. let key = k.toString();
  17196. let data = localData[key];
  17197. if (data != undefined) {
  17198. this[k] = data;
  17199. }
  17200. }
  17201. }
  17202. }
  17203. }
  17204. }
  17205. class Diy2025GameData {
  17206. constructor() {
  17207. this.challengeMode_overLev = 0;
  17208. this.xszyForClassic = false;
  17209. this.xszyForChallenge = false;
  17210. }
  17211. saveData() {
  17212. let data = {};
  17213. for (let k in this) {
  17214. data[k.toString()] = this[k];
  17215. }
  17216. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  17217. }
  17218. getData() {
  17219. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  17220. if (ld) {
  17221. let localData = JSON.parse(ld);
  17222. if (localData) {
  17223. for (let k in this) {
  17224. let key = k.toString();
  17225. let data = localData[key];
  17226. if (data != undefined) {
  17227. this[k] = data;
  17228. }
  17229. }
  17230. }
  17231. }
  17232. }
  17233. }
  17234. class DataMgr {
  17235. static Init() {
  17236. this.userData = new UserData();
  17237. this.gameData = new GameData();
  17238. this.itemData = new ItemData();
  17239. this.diyGameData = new Diy2025GameData();
  17240. this.userData.getData();
  17241. this.gameData.getData();
  17242. this.itemData.getData();
  17243. this.diyGameData.getData();
  17244. this.roleId = this.userData.roleId;
  17245. this.resetUse();
  17246. }
  17247. static isNewDay() {
  17248. Moyu.isNewDay(this, (isnew) => {
  17249. xGame.common.isNewDay = isnew;
  17250. if (!isnew)
  17251. return;
  17252. DataMgr.setShareDiamondTimes(0, false);
  17253. DataMgr.setDailyVideoShareTimes(0, false);
  17254. DataMgr.setDailyfreeDrawTimes(1);
  17255. DataMgr.setExtraSign(0);
  17256. });
  17257. }
  17258. static deletData() {
  17259. Laya.LocalStorage.clear();
  17260. }
  17261. static upRankData() {
  17262. let num = xGame.common.getAllStarNum();
  17263. if (num > 0)
  17264. Moyu.upRankData(xGame.common.curRankID, num);
  17265. }
  17266. static addItem(id, count = 1) {
  17267. let v = this.itemData.itemList[id];
  17268. if (!v)
  17269. v = { id: id, count: count, adnum: 0, active: true };
  17270. else {
  17271. if (v.active) {
  17272. v.count += count;
  17273. }
  17274. else {
  17275. v.count = count;
  17276. v.active = true;
  17277. }
  17278. }
  17279. this.itemData.itemList[id] = v;
  17280. xGame.soundMgr.playGetSound();
  17281. this.saveItemData();
  17282. }
  17283. static hasItem(id) {
  17284. let v = this.itemData.itemList[id];
  17285. if (v && v.active)
  17286. return true;
  17287. return false;
  17288. }
  17289. static getItem(id) {
  17290. let v = this.itemData.itemList[id];
  17291. return v;
  17292. }
  17293. static getItemCount(id) {
  17294. let v = this.itemData.itemList[id];
  17295. if (v && v.active)
  17296. return v.count;
  17297. return 0;
  17298. }
  17299. static getItemAd(id) {
  17300. let v = this.itemData.itemList[id];
  17301. if (v) {
  17302. return v.adnum;
  17303. }
  17304. return 0;
  17305. }
  17306. static onItemAd(id, num = 1) {
  17307. let v = this.itemData.itemList[id];
  17308. if (!v)
  17309. v = { id: id, count: 1, adnum: num, active: false };
  17310. else
  17311. v.adnum += num;
  17312. this.itemData.itemList[id] = v;
  17313. this.saveItemData();
  17314. }
  17315. static costItem(id, count) {
  17316. let v = this.itemData.itemList[id];
  17317. if (v && v.active) {
  17318. if (v.count < count)
  17319. return false;
  17320. else {
  17321. v.count -= count;
  17322. this.itemData.itemList[id] = v;
  17323. return true;
  17324. }
  17325. }
  17326. return false;
  17327. }
  17328. static resetUse() {
  17329. this.dressId = this.userData.dressId;
  17330. this.itemId = this.userData.itemId;
  17331. }
  17332. static passLevel() {
  17333. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  17334. this.gameData.curLevel++;
  17335. this.curLevel = this.gameData.curLevel;
  17336. this.saveGameData();
  17337. }
  17338. static useRole(id) {
  17339. this.roleId = id;
  17340. if (this.hasRole(id)) {
  17341. this.userData.roleId = id;
  17342. this.saveUserData();
  17343. }
  17344. }
  17345. static addRole(id) {
  17346. if (this.hasRole(id))
  17347. return;
  17348. this.userData.roleList.push(id);
  17349. this.saveUserData();
  17350. }
  17351. static hasRole(id) {
  17352. return this.userData.roleList.indexOf(id) >= 0;
  17353. }
  17354. static gemEnough(num) {
  17355. return this.userData.gemNum >= num;
  17356. }
  17357. static roleHasAd(id) {
  17358. let count = this.userData.roleAds[id];
  17359. if (count != undefined && count >= 0)
  17360. return true;
  17361. else
  17362. return false;
  17363. }
  17364. static saveUserData(time = 500, event, arg) {
  17365. if (this.userSaving)
  17366. return;
  17367. this.userSaving = true;
  17368. Laya.timer.once(time, this, () => {
  17369. this.userSaving = false;
  17370. this.userData.saveData();
  17371. if (event)
  17372. xGame.eventMgr.event(event, arg);
  17373. });
  17374. }
  17375. static saveGameData() {
  17376. if (this.gameSaving)
  17377. return;
  17378. this.gameSaving = true;
  17379. Laya.timer.once(1000, this, () => {
  17380. this.gameSaving = false;
  17381. this.gameData.saveData();
  17382. });
  17383. }
  17384. static saveItemData() {
  17385. let fun = () => {
  17386. this.itemData.saveData();
  17387. };
  17388. Laya.timer.clear(this, fun);
  17389. Laya.timer.once(500, this, fun);
  17390. }
  17391. static saveData() {
  17392. this.saveUserData();
  17393. this.saveGameData();
  17394. }
  17395. static getBigSkillList() {
  17396. return this.userData.bigSkills;
  17397. }
  17398. static getBigSkillByIndex(index) {
  17399. return this.userData.bigSkills[index];
  17400. }
  17401. static setBigSkill(index, val, addUp = true) {
  17402. if (addUp) {
  17403. this.userData.bigSkills[index] += val;
  17404. }
  17405. else {
  17406. this.userData.bigSkills[index] = val;
  17407. }
  17408. this.saveUserData();
  17409. }
  17410. static coinEnough(need) {
  17411. if (typeof need != "number") {
  17412. console.error("金币格式错误");
  17413. return;
  17414. }
  17415. return this.userData.coin >= need;
  17416. }
  17417. static setCoin(val) {
  17418. if (typeof val != "number") {
  17419. return;
  17420. }
  17421. this.userData.coin += val;
  17422. this.saveUserData();
  17423. xGame.eventMgr.event(COIN_CHANGE);
  17424. }
  17425. static getCoin() {
  17426. return this.userData.coin;
  17427. }
  17428. static diamondEnough(need) {
  17429. if (typeof need != "number") {
  17430. console.error("金币格式错误");
  17431. return;
  17432. }
  17433. return this.userData.diamond >= need;
  17434. }
  17435. static setDiamond(val) {
  17436. if (typeof val != "number") {
  17437. return;
  17438. }
  17439. this.userData.diamond += val;
  17440. this.saveUserData();
  17441. xGame.eventMgr.event(DIAMOND_CHANGE);
  17442. }
  17443. static getDiamond() {
  17444. return this.userData.diamond;
  17445. }
  17446. static getSkillSuccessTimes() {
  17447. return this.userData.skillSuccessTimes;
  17448. }
  17449. static setSkillSuccessTimes(val, addUp = true) {
  17450. if (addUp)
  17451. this.userData.skillSuccessTimes += val;
  17452. else
  17453. this.userData.skillSuccessTimes = val;
  17454. this.saveUserData();
  17455. }
  17456. static getSkillAccTimes() {
  17457. return this.userData.skillAccTimes;
  17458. }
  17459. static setSkillAccTimes(val) {
  17460. this.userData.skillAccTimes += val;
  17461. this.saveUserData();
  17462. }
  17463. static getSkillGuide() {
  17464. if (!xGame.common.openGuide) {
  17465. return 1;
  17466. }
  17467. return this.userData.skillGuide;
  17468. }
  17469. static setSkillGuide(val) {
  17470. this.userData.skillGuide = val;
  17471. this.saveUserData();
  17472. }
  17473. static getPlaceBallLevelList() {
  17474. return this.userData.placeBallData;
  17475. }
  17476. static getPlaceBallLevel(level) {
  17477. let arr = this.userData.placeBallData;
  17478. let index = level - 1;
  17479. let out;
  17480. if (arr[index]) {
  17481. out = arr[index];
  17482. }
  17483. else {
  17484. let max = arr.length;
  17485. if (max == index) {
  17486. out = {
  17487. star: 0,
  17488. play: true,
  17489. isCur: true,
  17490. getAward: false
  17491. };
  17492. }
  17493. else {
  17494. out = {
  17495. star: 0,
  17496. play: false,
  17497. getAward: false
  17498. };
  17499. }
  17500. }
  17501. return out;
  17502. }
  17503. static setPlaceBallLevel(level, star) {
  17504. let arr = this.userData.placeBallData;
  17505. let index = level - 1;
  17506. if (arr[index]) {
  17507. arr[index].star = Math.max(arr[index].star, star);
  17508. }
  17509. else {
  17510. let max = arr.length;
  17511. if (max == index) {
  17512. arr.push({
  17513. star: star,
  17514. play: true,
  17515. getAward: false
  17516. });
  17517. }
  17518. else {
  17519. console.error("关卡存储出错");
  17520. }
  17521. }
  17522. this.saveUserData();
  17523. }
  17524. static setPlaceBallAward(level) {
  17525. let arr = this.userData.placeBallData;
  17526. let index = level - 1;
  17527. if (arr[index]) {
  17528. arr[index].getAward = true;
  17529. }
  17530. this.saveUserData();
  17531. }
  17532. static getShareDiamondTimes() {
  17533. return this.userData.shareDiamondTimes;
  17534. }
  17535. static setShareDiamondTimes(val, addUp = true) {
  17536. if (addUp) {
  17537. this.userData.shareDiamondTimes += val;
  17538. }
  17539. else {
  17540. this.userData.shareDiamondTimes = val;
  17541. }
  17542. this.saveUserData();
  17543. }
  17544. static getDailyVideoShareTimes() {
  17545. return this.userData.dailyVideoShareTimes;
  17546. }
  17547. static setDailyVideoShareTimes(val, addUp = true) {
  17548. if (addUp) {
  17549. this.userData.dailyVideoShareTimes += val;
  17550. }
  17551. else {
  17552. this.userData.dailyVideoShareTimes = val;
  17553. }
  17554. this.saveUserData();
  17555. }
  17556. static getSecretary(index) {
  17557. return this.userData.secretary[index];
  17558. }
  17559. static setSecretary(index, val) {
  17560. this.userData.secretary[index] = val;
  17561. this.saveUserData();
  17562. }
  17563. static getCurSecretary() {
  17564. return this.userData.curSecretary;
  17565. }
  17566. static setCurSecretary(index) {
  17567. this.userData.curSecretary = index;
  17568. this.saveUserData();
  17569. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  17570. }
  17571. static getBallRod(index) {
  17572. return this.userData.ballRod[index];
  17573. }
  17574. static setBallRod(index, val) {
  17575. this.userData.ballRod[index] = val;
  17576. this.saveUserData();
  17577. }
  17578. static getCurBallRod() {
  17579. return this.userData.curBallRod;
  17580. }
  17581. static setCurBallRod(index) {
  17582. this.userData.curBallRod = index;
  17583. this.saveUserData();
  17584. }
  17585. static setSignData(val) {
  17586. this.userData.signData = val;
  17587. this.saveUserData();
  17588. }
  17589. static getSignData() {
  17590. return this.userData.signData;
  17591. }
  17592. static setSignTime(val) {
  17593. this.userData.signTime = val;
  17594. this.saveUserData();
  17595. }
  17596. static getSignTime() {
  17597. return this.userData.signTime;
  17598. }
  17599. static getDrawTimes() {
  17600. return this.userData.drawTimes;
  17601. }
  17602. static setDrawTimes(val, addUp = true) {
  17603. if (addUp) {
  17604. this.userData.drawTimes += val;
  17605. }
  17606. else {
  17607. this.userData.drawTimes = val;
  17608. }
  17609. this.saveUserData();
  17610. }
  17611. static getDrawAwardTimes() {
  17612. return this.userData.drawAwardTimes;
  17613. }
  17614. static setDrawAwardTimes(val) {
  17615. this.userData.drawAwardTimes = val;
  17616. this.saveUserData();
  17617. }
  17618. static getDailyfreeDrawTimes() {
  17619. return this.userData.dailyfreeDrawTimes;
  17620. }
  17621. static setDailyfreeDrawTimes(val) {
  17622. this.userData.dailyfreeDrawTimes = val;
  17623. this.saveUserData();
  17624. }
  17625. static setPower(val, addUp = true) {
  17626. if (addUp)
  17627. this.userData.power += val;
  17628. else
  17629. this.userData.power = val;
  17630. if (this.userData.power >= xGame.common.maxPower) {
  17631. this.userData.power = xGame.common.maxPower;
  17632. }
  17633. xGame.eventMgr.event(POWER_CHANGE, val);
  17634. this.saveUserData();
  17635. }
  17636. static getPower() {
  17637. return this.userData.power;
  17638. }
  17639. static setPowerTime(val) {
  17640. this.userData.powerTime = val;
  17641. this.saveUserData();
  17642. }
  17643. static getPowerTime() {
  17644. return this.userData.powerTime;
  17645. }
  17646. static powerEnough() {
  17647. return this.getPower() > 0;
  17648. }
  17649. static getChallengeTimes() {
  17650. return this.userData.challengeTimes;
  17651. }
  17652. static setChallengeTimes(val) {
  17653. this.userData.challengeTimes += val;
  17654. this.saveUserData();
  17655. }
  17656. static getExtraSign() {
  17657. return this.userData.extraSign;
  17658. }
  17659. static setExtraSign(val) {
  17660. this.userData.extraSign = val;
  17661. this.saveUserData();
  17662. }
  17663. static getClassicTimes() {
  17664. return this.userData.classicTimes;
  17665. }
  17666. static setClassicTimes() {
  17667. this.userData.classicTimes += 1;
  17668. this.saveUserData();
  17669. }
  17670. static getGuideHelpLine() {
  17671. return this.userData.guideHelpLine;
  17672. }
  17673. static setGuideHelpLine() {
  17674. this.userData.guideHelpLine = 1;
  17675. this.saveUserData();
  17676. }
  17677. static getNewUser() {
  17678. return this.userData.newUser;
  17679. }
  17680. static setNewUser() {
  17681. this.userData.newUser = false;
  17682. this.saveUserData();
  17683. }
  17684. static getRootBallFoul() {
  17685. return this.userData.rootBallFoul;
  17686. }
  17687. static setRootBallFoul() {
  17688. this.userData.rootBallFoul = 1;
  17689. this.saveUserData();
  17690. }
  17691. static getTimeoutFoul() {
  17692. return this.userData.timeoutFoul;
  17693. }
  17694. static setTimeoutFoul() {
  17695. this.userData.timeoutFoul = 1;
  17696. this.saveUserData();
  17697. }
  17698. static saveDiyGameData() {
  17699. if (this.diyGameSaving)
  17700. return;
  17701. this.diyGameSaving = true;
  17702. Laya.timer.once(500, this, () => {
  17703. this.diyGameSaving = false;
  17704. this.diyGameData.saveData();
  17705. });
  17706. }
  17707. static getChallengeMode_overLev() {
  17708. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  17709. return this.challengeMode_overLev;
  17710. }
  17711. static setChallengeMode_overLev(levNum) {
  17712. this.diyGameData.challengeMode_overLev = levNum;
  17713. this.saveDiyGameData();
  17714. }
  17715. }
  17716. DataMgr.isNewUser = false;
  17717. DataMgr.fristEnter = true;
  17718. DataMgr.levelType = 0;
  17719. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  17720. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  17721. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  17722. DataMgr.challengeMode_overLev = 0;
  17723. DataMgr.xszyForClassic = false;
  17724. DataMgr.xszyForChallenge = false;
  17725. DataMgr.awardId = 0;
  17726. DataMgr.awardCoin = 0;
  17727. DataMgr.sceneId = -1;
  17728. DataMgr.tryId = 0;
  17729. DataMgr.curLevel = 1;
  17730. DataMgr.vipLevel = 0;
  17731. DataMgr.maxLevel = 0;
  17732. DataMgr.awardRatio = 1;
  17733. DataMgr.gameList = [];
  17734. DataMgr.rankList = [];
  17735. DataMgr.recoverTime = 480000;
  17736. DataMgr.minScore = 0;
  17737. DataMgr.rankDis = 0;
  17738. DataMgr.userSaving = false;
  17739. DataMgr.gameSaving = false;
  17740. DataMgr.diyGameSaving = false;
  17741. class D3Tween extends Laya.Script3D {
  17742. constructor() {
  17743. super();
  17744. this.isInited = false;
  17745. }
  17746. ;
  17747. init() {
  17748. if (this.isInited)
  17749. return;
  17750. this.isInited = true;
  17751. this.gameObj = this.owner;
  17752. this.transform = this.gameObj.transform;
  17753. }
  17754. get rotX() {
  17755. return this.transform.localRotationEulerX;
  17756. }
  17757. set rotX(v) {
  17758. this.transform.localRotationEulerX = v;
  17759. }
  17760. get rotY() {
  17761. return this.transform.localRotationEulerY;
  17762. }
  17763. set rotY(v) {
  17764. this.transform.localRotationEulerY = v;
  17765. }
  17766. get rotZ() {
  17767. return this.transform.localRotationEulerZ;
  17768. }
  17769. set rotZ(v) {
  17770. this.transform.localRotationEulerZ = v;
  17771. }
  17772. get posX() {
  17773. return this.transform.localPositionX;
  17774. }
  17775. set posX(v) {
  17776. this.transform.localPositionX = v;
  17777. }
  17778. get posY() {
  17779. return this.transform.localPositionY;
  17780. }
  17781. set posY(v) {
  17782. this.transform.localPositionY = v;
  17783. }
  17784. get posZ() {
  17785. return this.transform.localPositionZ;
  17786. }
  17787. set posZ(v) {
  17788. this.transform.localPositionZ = v;
  17789. }
  17790. get rotation() {
  17791. return this.transform.localRotation;
  17792. }
  17793. set rotation(v) {
  17794. this.transform.localRotation = v;
  17795. }
  17796. }
  17797. class D2Hole extends Laya.Script {
  17798. constructor() { super(); }
  17799. onTriggerEnter(collider) {
  17800. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  17801. return;
  17802. }
  17803. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  17804. if (collider.owner["mySrc"].isRunSkillAni) {
  17805. return;
  17806. }
  17807. if (collider.owner["mySrc"].number != 0) {
  17808. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  17809. }
  17810. xGame.common.ballColliHole(collider);
  17811. xGame.common.recoverCameraView();
  17812. }
  17813. }
  17814. }
  17815. class Table extends Laya.Script3D {
  17816. constructor() {
  17817. super();
  17818. this.isSetBorder = false;
  17819. this.inited = false;
  17820. }
  17821. ;
  17822. onAwake() {
  17823. this.init();
  17824. }
  17825. init() {
  17826. if (this.inited)
  17827. return;
  17828. this.inited = true;
  17829. this.gameObj = this.owner;
  17830. this.border = this.gameObj.getChildByName("border");
  17831. }
  17832. setBorderPos() {
  17833. if (this.isSetBorder)
  17834. return;
  17835. this.isSetBorder = true;
  17836. let ui = xGame.common.gameUI.ui;
  17837. let bar1 = this.border.getChildByName("bar1");
  17838. let bar2 = this.border.getChildByName("bar2");
  17839. let bar3 = this.border.getChildByName("bar3");
  17840. let bar4 = this.border.getChildByName("bar4");
  17841. let bar5 = this.border.getChildByName("bar5");
  17842. let bar6 = this.border.getChildByName("bar6");
  17843. this.setInfo(bar1, ui.border.bar1, "box");
  17844. this.setInfo(bar2, ui.border.bar2, "box");
  17845. this.setInfo(bar3, ui.border.bar3, "box");
  17846. this.setInfo(bar4, ui.border.bar4, "box");
  17847. this.setInfo(bar5, ui.border.bar5, "box");
  17848. this.setInfo(bar6, ui.border.bar6, "box");
  17849. let circle1 = this.border.getChildByName("circle1");
  17850. let circle2 = this.border.getChildByName("circle2");
  17851. let circle3 = this.border.getChildByName("circle3");
  17852. let circle4 = this.border.getChildByName("circle4");
  17853. let circle5 = this.border.getChildByName("circle5");
  17854. let circle6 = this.border.getChildByName("circle6");
  17855. this.setInfo(circle1, ui.border.circle1, "circle");
  17856. this.setInfo(circle2, ui.border.circle2, "circle");
  17857. this.setInfo(circle3, ui.border.circle3, "circle");
  17858. this.setInfo(circle4, ui.border.circle4, "circle");
  17859. this.setInfo(circle5, ui.border.circle5, "circle");
  17860. this.setInfo(circle6, ui.border.circle6, "circle");
  17861. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  17862. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  17863. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  17864. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  17865. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  17866. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  17867. let arr = xGame.common.gameMgr.holePosList;
  17868. xGame.common.gameMgr.posObj = {
  17869. "1": arr[0],
  17870. "3": arr[2],
  17871. "4": arr[3],
  17872. "6": arr[5]
  17873. };
  17874. }
  17875. initHolePos(x, y) {
  17876. if (x < 300)
  17877. x += 25;
  17878. else if (x > 1000)
  17879. x -= 25;
  17880. else if (y > 200)
  17881. y -= 10;
  17882. else
  17883. y += 10;
  17884. if (y < 200)
  17885. y += 30;
  17886. else if (y > 500)
  17887. y -= 30;
  17888. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  17889. }
  17890. setInfo(d3Obj, d2Obj, type) {
  17891. let ui = xGame.common.gameUI.ui;
  17892. let sprite = new Laya.Sprite();
  17893. ui.border.displayObject.addChild(sprite);
  17894. let colli = xGame.common.getCollider(type);
  17895. sprite.addComponentIntance(colli);
  17896. let rigy = xGame.common.getRigbody();
  17897. rigy.type = "static";
  17898. sprite.addComponentIntance(rigy);
  17899. let d3Pos = d3Obj.transform.position;
  17900. xGame.common.pos3to2Convert(d3Pos);
  17901. let scaleX = d3Obj.transform.localScaleX;
  17902. let scaleZ = d3Obj.transform.localScaleZ;
  17903. let width = xGame.common.scale3to2Convert(scaleZ);
  17904. let height = xGame.common.scale3to2Convert(scaleX);
  17905. sprite.pivotX = width / 2;
  17906. sprite.pivotY = height / 2;
  17907. sprite.x = d3Pos.x;
  17908. sprite.y = d3Pos.y;
  17909. sprite.width = width;
  17910. sprite.height = height;
  17911. d2Obj.x = d3Pos.x;
  17912. d2Obj.y = d3Pos.y;
  17913. d2Obj.width = width;
  17914. d2Obj.height = height;
  17915. if (type == "box") {
  17916. colli.width = width;
  17917. colli.height = height;
  17918. colli.isSensor = false;
  17919. colli.label = "border";
  17920. }
  17921. else {
  17922. colli.radius = width / 2;
  17923. colli.isSensor = true;
  17924. colli.label = "hole";
  17925. sprite.addComponent(D2Hole);
  17926. }
  17927. }
  17928. }
  17929. class D3World extends Laya.Script3D {
  17930. constructor() {
  17931. super();
  17932. this.loadNum = 0;
  17933. this.setLoadNum = 7;
  17934. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  17935. }
  17936. onAwake() {
  17937. }
  17938. loadScene() {
  17939. this.scene = this.owner;
  17940. let url = `res/unityRes/root.lh`;
  17941. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  17942. this.scene.addChild(prefab);
  17943. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  17944. this.putCameraInfo();
  17945. this.camera.enableHDR = false;
  17946. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  17947. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  17948. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  17949. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  17950. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  17951. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  17952. this.knife.active = false;
  17953. this.loadD3Obj();
  17954. }));
  17955. }
  17956. putCameraInfo() {
  17957. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  17958. this.cameraObj = new cameraType();
  17959. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  17960. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  17961. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  17962. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  17963. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  17964. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  17965. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  17966. this.visitAngleChild.init();
  17967. this.visitRootObj.posX = this.visitAngleChild.posX;
  17968. this.visitRootObj.posY = this.visitAngleChild.posY;
  17969. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  17970. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  17971. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  17972. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  17973. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  17974. xGame.common.showOneCamera("mainCamera");
  17975. }
  17976. loadD3Obj() {
  17977. this.loadTable();
  17978. this.loadRoom();
  17979. this.loadInHoleParticial();
  17980. this.loadIceParticial();
  17981. this.loadHitParticial();
  17982. this.loadFireworksParticial();
  17983. this.loadBall();
  17984. }
  17985. loadInHoleParticial() {
  17986. this.loadD3Res("inHoleEft", "", (prefab) => {
  17987. prefab.addComponent(Partical);
  17988. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  17989. });
  17990. }
  17991. loadIceParticial() {
  17992. this.loadD3Res("iceEft", "", (prefab) => {
  17993. prefab.addComponent(Partical);
  17994. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  17995. });
  17996. }
  17997. loadHitParticial() {
  17998. this.loadD3Res("hitEft", "", (prefab) => {
  17999. prefab.addComponent(Partical);
  18000. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  18001. });
  18002. }
  18003. loadFireworksParticial() {
  18004. this.loadD3Res("fireworksEft", "", (prefab) => {
  18005. prefab.addComponent(Partical);
  18006. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  18007. });
  18008. }
  18009. loadBall(index = 1) {
  18010. this.loadD3Res("ball", index, (prefab) => {
  18011. this.ballPrefab = prefab;
  18012. this.ballPrefab.addComponent(Ball);
  18013. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  18014. });
  18015. }
  18016. loadTable(index = 1) {
  18017. this.loadD3Res("table", index, (prefab) => {
  18018. this.tableSrc = prefab.addComponent(Table);
  18019. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  18020. this.d3Hand.init();
  18021. this.tableRoot.addChild(prefab);
  18022. });
  18023. }
  18024. loadRoom(index = 1) {
  18025. this.loadD3Res("room", index, (prefab) => {
  18026. this.roomRoot.addChild(prefab);
  18027. });
  18028. }
  18029. loadD3Res(type, index, callback) {
  18030. let url = `res/unityRes/${type}${index}.lh`;
  18031. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  18032. callback && callback(prefab);
  18033. this.checkResLoad();
  18034. }));
  18035. }
  18036. checkResLoad() {
  18037. this.loadNum++;
  18038. if (this.loadNum >= this.setLoadNum) {
  18039. xGame.eventMgr.event(D3RES_LOADED);
  18040. }
  18041. }
  18042. prePlayEft() {
  18043. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  18044. eft.transform.localPositionX = 0;
  18045. eft.transform.localPositionY = -5;
  18046. eft.transform.localPositionZ = 0;
  18047. eft.active = true;
  18048. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  18049. ice.transform.localPositionX = 0;
  18050. ice.transform.localPositionY = -5;
  18051. ice.transform.localPositionZ = 0;
  18052. ice.active = true;
  18053. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  18054. hit.transform.localPositionX = 0;
  18055. hit.transform.localPositionY = -5;
  18056. hit.transform.localPositionZ = 0;
  18057. hit.active = true;
  18058. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  18059. fireworks.transform.localPositionX = 0;
  18060. fireworks.transform.localPositionY = -5;
  18061. fireworks.transform.localPositionZ = 0;
  18062. fireworks.active = true;
  18063. }
  18064. }
  18065. class cameraType {
  18066. }
  18067. class MoyuMgr$1 {
  18068. static initMoyu() {
  18069. this.moyuView = new MoyuView$1();
  18070. Laya.stage.addChild(this.moyuView.ui.displayObject);
  18071. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  18072. this.moyuView.ui.displayObject.zOrder = 1000;
  18073. this.moyuView.init();
  18074. this.moyuView.showTip(true);
  18075. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  18076. window['XApk'] = this;
  18077. }
  18078. static showAge(show) {
  18079. if (this.moyuView)
  18080. this.moyuView.showAge(show);
  18081. }
  18082. static onPlatMsg(idx) {
  18083. if (!MoyuMgr$1.moyuView)
  18084. return;
  18085. if (idx == '0') {
  18086. MoyuMgr$1.moyuView.showTip(false);
  18087. }
  18088. }
  18089. static showAgree(call) {
  18090. if (this.moyuView)
  18091. this.moyuView.showAgree(call);
  18092. else
  18093. call && call();
  18094. }
  18095. static showXy(type = 1) {
  18096. if (this.moyuView)
  18097. this.moyuView.showXy(type);
  18098. }
  18099. }
  18100. MoyuMgr$1.isAdvise = false;
  18101. class MoyuView$1 {
  18102. constructor() {
  18103. this.ysxyNum = 1;
  18104. this.ysJson = null;
  18105. this.ui = ui_UIMoyu.createInstance();
  18106. }
  18107. init() {
  18108. this.ui.mainBg.visible = false;
  18109. this.ui.xyNode.visible = false;
  18110. this.ui.ageNode.visible = false;
  18111. this.ui.tipNode.visible = false;
  18112. this.ui.rnNode.visible = false;
  18113. this.ui.fcmNode.visible = false;
  18114. this.ui.ageTip.visible = false;
  18115. this.ui.msgNode.visible = false;
  18116. this.ui.visible = false;
  18117. this.ui.xyNode.xyList.setVirtual();
  18118. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  18119. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  18120. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  18121. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  18122. this.ui.xyNode.btnKnown.visible = false;
  18123. this.ui.xyNode.xy1.visible = false;
  18124. this.ui.xyNode.xy2.visible = false;
  18125. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  18126. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  18127. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  18128. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  18129. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  18130. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  18131. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  18132. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  18133. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  18134. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  18135. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  18136. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  18137. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  18138. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  18139. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  18140. this.ysxyNum = 2;
  18141. }
  18142. }
  18143. onClick(obj) {
  18144. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18145. switch (obj) {
  18146. case this.ui.ageTip:
  18147. if (Moyu.isTTApk) {
  18148. this.ui.ageNode.visible = true;
  18149. this.ui.mainBg.visible = true;
  18150. }
  18151. break;
  18152. case this.ui.tipNode:
  18153. this.showTip(false);
  18154. break;
  18155. case this.ui.ageNode.btnAge:
  18156. this.ui.ageNode.visible = false;
  18157. this.ui.mainBg.visible = false;
  18158. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  18159. this.ui.visible = false;
  18160. break;
  18161. case this.ui.xyNode.btnXy3:
  18162. case this.ui.xyNode.btnXy1:
  18163. this.loadXy(1);
  18164. break;
  18165. case this.ui.xyNode.btnXy2:
  18166. this.loadXy(2);
  18167. break;
  18168. case this.ui.xyNode.btnBack:
  18169. this.ui.xyNode.xy1.visible = true;
  18170. this.ui.xyNode.xy2.visible = false;
  18171. break;
  18172. case this.ui.xyNode.btnKnown:
  18173. this.ui.xyNode.visible = false;
  18174. this.ui.mainBg.visible = false;
  18175. this.ui.visible = false;
  18176. break;
  18177. case this.ui.rnNode.btnCheck:
  18178. this.check();
  18179. break;
  18180. case this.ui.rnNode.btnExit:
  18181. case this.ui.xyNode.btnNo:
  18182. this.ysxyNum--;
  18183. if (this.ysxyNum > 0)
  18184. this.showMsg("Refuse to quit the game once again");
  18185. else {
  18186. Moyu.userAgree(false);
  18187. Moyu.exit();
  18188. }
  18189. break;
  18190. case this.ui.xyNode.btnSure:
  18191. case this.ui.xyNode.btnYes:
  18192. DataMgr.userData.isAgree = true;
  18193. DataMgr.saveUserData();
  18194. this.onAgree();
  18195. break;
  18196. case this.ui.rnNode.btnDone:
  18197. this.ui.rnNode.visible = false;
  18198. this.ui.visible = false;
  18199. break;
  18200. case this.ui.fcmNode.btnRn:
  18201. this.showRn();
  18202. break;
  18203. }
  18204. }
  18205. showTip(show) {
  18206. if (!Moyu.isVVApk && !Moyu.isOPApk)
  18207. return;
  18208. if (show) {
  18209. MoyuMgr$1.isAdvise = true;
  18210. this.ui.visible = true;
  18211. this.ui.tipNode.visible = true;
  18212. this.ui.tipNode.alpha = 1;
  18213. Laya.timer.once(1000, this, this.showTip, [false]);
  18214. }
  18215. else {
  18216. this.ui.tipNode.alpha = 1;
  18217. this.ui.tipNode.visible = true;
  18218. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  18219. this.ui.tipNode.visible = false;
  18220. MoyuMgr$1.isAdvise = false;
  18221. }), 1000);
  18222. }
  18223. }
  18224. showAge(show, px = 0, py = 0) {
  18225. if (Moyu.platType > 10 && !Moyu.isIos) {
  18226. this.ui.ageTip.x = px;
  18227. this.ui.ageTip.y = py;
  18228. this.ui.ageTip.visible = show;
  18229. if (show)
  18230. this.ui.visible = true;
  18231. }
  18232. }
  18233. showAgree(call) {
  18234. this.agreeCall = call;
  18235. this.onAgree();
  18236. return;
  18237. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  18238. this.showXy(0);
  18239. }
  18240. else
  18241. this.onAgree();
  18242. }
  18243. onAgree() {
  18244. if (!this.ui.ageNode.visible)
  18245. this.ui.visible = false;
  18246. this.ui.xyNode.visible = false;
  18247. Moyu.userAgree(true);
  18248. this.showAge(false);
  18249. this.agreeCall && this.agreeCall();
  18250. this.showRn();
  18251. }
  18252. showMsg(txt) {
  18253. this.ui.msgNode.txtMsg.text = txt;
  18254. this.ui.msgNode.visible = true;
  18255. this.ui.msgNode.alpha = 1;
  18256. this.ui.visible = true;
  18257. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  18258. this.ui.msgNode.visible = false;
  18259. }), 2500, true);
  18260. }
  18261. showRn() {
  18262. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18263. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  18264. this.ui.rnNode.rn1.visible = true;
  18265. this.ui.rnNode.rn2.visible = false;
  18266. this.ui.rnNode.rn3.visible = false;
  18267. this.ui.rnNode.rn4.visible = false;
  18268. this.ui.rnNode.visible = true;
  18269. this.ui.mainBg.visible = true;
  18270. this.ui.rnNode.btnDone.visible = false;
  18271. this.ui.rnNode.btnExit.visible = true;
  18272. this.ui.rnNode.btnCheck.visible = true;
  18273. this.ui.fcmNode.visible = false;
  18274. this.ui.visible = true;
  18275. return;
  18276. }
  18277. }
  18278. this.showFcm();
  18279. }
  18280. showFcm() {
  18281. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18282. Moyu.initFCM(true);
  18283. if (Moyu.gameTime < 1)
  18284. this.fcmLoop();
  18285. else if (Moyu.gameTime < 999)
  18286. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  18287. }
  18288. }
  18289. fcmLoop() {
  18290. if (Moyu.gameTime < 1) {
  18291. this.ui.rnNode.visible = false;
  18292. this.ui.fcmNode.visible = true;
  18293. this.ui.mainBg.visible = true;
  18294. this.ui.visible = true;
  18295. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  18296. Laya.timer.clear(this.ui, this.fcmLoop);
  18297. }
  18298. }
  18299. check() {
  18300. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  18301. this.ui.rnNode.rn1.visible = false;
  18302. this.ui.rnNode.rn2.visible = false;
  18303. this.ui.rnNode.rn4.visible = true;
  18304. }
  18305. else if (this.ui.rnNode.rn4.visible) {
  18306. let name = this.ui.rnNode.inputName.text;
  18307. let code = this.ui.rnNode.inputCode.text;
  18308. if (code && code.length == 18) {
  18309. this.ui.rnNode.rn1.visible = false;
  18310. this.ui.rnNode.rn4.visible = false;
  18311. Moyu.authenticate(name, code, (res) => {
  18312. this.ui.rnNode.rn2.visible = !res;
  18313. this.ui.rnNode.rn3.visible = res;
  18314. this.ui.rnNode.btnDone.visible = res;
  18315. this.ui.rnNode.btnExit.visible = !res;
  18316. this.ui.rnNode.btnCheck.visible = !res;
  18317. if (res)
  18318. this.showFcm();
  18319. });
  18320. }
  18321. else
  18322. this.showMsg("信息填写不完整");
  18323. }
  18324. }
  18325. loadXy(type = 0) {
  18326. this.ui.xyNode.xy1.visible = false;
  18327. this.ui.xyNode.xy2.visible = true;
  18328. this.ui.xyNode.xyList.scrollToView(0);
  18329. if (type == 1) {
  18330. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  18331. }
  18332. else if (type == 2) {
  18333. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  18334. }
  18335. }
  18336. showXy(type = 0) {
  18337. this.xyBtn();
  18338. if (type == 0) {
  18339. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  18340. this.ui.xyNode.btnSure.visible = true;
  18341. }
  18342. else {
  18343. this.ui.xyNode.btnYes.visible = true;
  18344. this.ui.xyNode.btnNo.visible = true;
  18345. }
  18346. }
  18347. else {
  18348. this.ui.xyNode.btnKnown.visible = true;
  18349. this.ui.mainBg.visible = true;
  18350. }
  18351. this.ui.xyNode.xy1.visible = true;
  18352. this.ui.xyNode.xy2.visible = false;
  18353. this.ui.xyNode.visible = true;
  18354. this.ui.visible = true;
  18355. }
  18356. xyBtn() {
  18357. this.ui.xyNode.btnSure.visible = false;
  18358. this.ui.xyNode.btnYes.visible = false;
  18359. this.ui.xyNode.btnNo.visible = false;
  18360. this.ui.xyNode.btnKnown.visible = false;
  18361. {
  18362. this.ui.xyNode.btnXy3.visible = false;
  18363. this.ui.xyNode.btnXy2.visible = true;
  18364. this.ui.xyNode.btnXy1.visible = true;
  18365. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  18366. }
  18367. }
  18368. createXY(json) {
  18369. this.ysJson = json.content;
  18370. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  18371. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  18372. this.ui.xyNode.xy2.visible = true;
  18373. }
  18374. renderListItem(idx, cell) {
  18375. let xy = this.ysJson[idx];
  18376. cell.height = xy.line * 30;
  18377. cell.xyItem.text = xy.text;
  18378. }
  18379. onDestroy() {
  18380. this.agreeCall = null;
  18381. }
  18382. }
  18383. class UILoading extends UIBase {
  18384. constructor() {
  18385. super();
  18386. this.accTime = 0;
  18387. this.curNum = 0;
  18388. this.rate = 1;
  18389. this.loadSubOk = false;
  18390. this.loadResOK = false;
  18391. this.openLoading = true;
  18392. this.beginLoadRes = false;
  18393. this.finishD2 = false;
  18394. this.finishD3 = false;
  18395. }
  18396. onConstructor() {
  18397. this.ui = ui_UILoading.createInstance();
  18398. this.contentPane = this.ui;
  18399. this.isEject = false;
  18400. this._initUI();
  18401. this._addEvent();
  18402. }
  18403. _initUI() {
  18404. MoyuMgr$1.initMoyu();
  18405. }
  18406. _addEvent() {
  18407. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  18408. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  18409. }
  18410. show() {
  18411. super.show();
  18412. console.log('zh:加载分包资源');
  18413. loadSubRes(this.subResProgress.bind(this));
  18414. this.ui.txtLoad.text = "Loading...";
  18415. }
  18416. subResProgress(pro, finish) {
  18417. this.curNum = pro;
  18418. if (finish) {
  18419. this.curNum = 1;
  18420. this.loadSubOk = true;
  18421. }
  18422. }
  18423. laodD3Res() {
  18424. let scene3D = new Laya.Scene3D();
  18425. xGame.common.d3Scene = scene3D;
  18426. xGame.common.d3World = scene3D.addComponent(D3World);
  18427. xGame.common.d3World.loadScene();
  18428. }
  18429. loadD2Res() {
  18430. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  18431. this.finishD2 = true;
  18432. this.checkLoadAll();
  18433. this.curNum = 1;
  18434. }), Laya.Handler.create(this, (pro) => {
  18435. this.curNum = pro;
  18436. }, null, false));
  18437. }
  18438. d3ResFinish() {
  18439. this.finishD3 = true;
  18440. this.checkLoadAll();
  18441. }
  18442. checkLoadAll() {
  18443. if (this.finishD2 && this.finishD3) {
  18444. this.loadResOK = true;
  18445. }
  18446. }
  18447. loadRes() {
  18448. this.laodD3Res();
  18449. this.loadD2Res();
  18450. }
  18451. myUpdate(dt) {
  18452. if (!this.openLoading)
  18453. return;
  18454. this.accTime += dt * this.rate;
  18455. if (this.accTime >= this.curNum)
  18456. this.accTime = this.curNum;
  18457. this.ui.loadinfo.value = this.accTime * 100;
  18458. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  18459. if (!this.beginLoadRes) {
  18460. this.beginLoadRes = true;
  18461. this.ui.txtLoad.text = "Loading...";
  18462. this.curNum = 0;
  18463. this.accTime = 0;
  18464. this.loadRes();
  18465. }
  18466. if (this.loadResOK) {
  18467. this.openLoading = false;
  18468. Laya.timer.once(300, this, () => {
  18469. xGame.common.d3Scene.active = false;
  18470. MoyuMgr$1.showAgree(enterGame);
  18471. });
  18472. }
  18473. }
  18474. }
  18475. release() {
  18476. }
  18477. hide() {
  18478. super.hide();
  18479. this.release();
  18480. }
  18481. onClose() {
  18482. this.hide();
  18483. }
  18484. }
  18485. UILoading.uiName = "UILoading";
  18486. class UIRepentProp$1 extends UIBase {
  18487. constructor() {
  18488. super();
  18489. this.viewType = 0;
  18490. this.regretType = 0;
  18491. }
  18492. onConstructor() {
  18493. this.ui = ui_UIRepentProp.createInstance();
  18494. this.contentPane = this.ui;
  18495. this.isEject = false;
  18496. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  18497. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  18498. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  18499. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  18500. }
  18501. show(viewType, regretType, callback) {
  18502. PlatMgr.showInsert(true);
  18503. this.viewType = viewType;
  18504. this.regretType = regretType;
  18505. this.callback = callback;
  18506. super.show();
  18507. this.ui.t0.play();
  18508. this.ui.c1.selectedIndex = this.viewType;
  18509. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  18510. if (this.viewType == 0) {
  18511. let guide = DataMgr.getGuideHelpLine();
  18512. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  18513. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  18514. }
  18515. xGame.common.gameMgr.gamePause = true;
  18516. }
  18517. hideSelf() {
  18518. xGame.common.gameMgr.gamePause = false;
  18519. this.callback && this.callback(false);
  18520. this.hide();
  18521. }
  18522. videoRegret() {
  18523. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  18524. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  18525. }
  18526. else {
  18527. console.log('zh:AD 失败,直接发放奖励');
  18528. this.qjff_AD_for_UIrepentProp_videoRegret();
  18529. }
  18530. }
  18531. qjff_AD_for_UIrepentProp_videoRegret() {
  18532. this.callback && this.callback(true);
  18533. this.hideSelf();
  18534. }
  18535. videoAddHelpLine() {
  18536. let guide = DataMgr.getGuideHelpLine();
  18537. if (guide == 0) {
  18538. this.callback && this.callback(true);
  18539. this.hideSelf();
  18540. DataMgr.setGuideHelpLine();
  18541. xGame.common.gameUI.ui.guideNode.visible = false;
  18542. }
  18543. else {
  18544. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  18545. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  18546. }
  18547. else {
  18548. console.log('zh:AD 失败,直接发放奖励');
  18549. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  18550. }
  18551. }
  18552. }
  18553. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  18554. this.callback && this.callback(true);
  18555. this.hideSelf();
  18556. }
  18557. }
  18558. UIRepentProp$1.uiName = "UIRepentProp";
  18559. class UIRodMethod$1 extends UIBase {
  18560. constructor() {
  18561. super();
  18562. this.isPressd = false;
  18563. }
  18564. onConstructor() {
  18565. this.ui = ui_UIRodMethod.createInstance();
  18566. this.contentPane = this.ui;
  18567. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  18568. this.moveDir = new Laya.Vector2();
  18569. this.moveDest = new Laya.Vector2();
  18570. this.centerPos = new Laya.Vector2();
  18571. xGame.common.uiRodMethod = this;
  18572. }
  18573. show() {
  18574. super.show();
  18575. xGame.common.gameMgr.gamePause = true;
  18576. this.openPressDotEvent();
  18577. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  18578. this.centerPos.x = this.ui.white.x;
  18579. this.centerPos.y = this.ui.white.y;
  18580. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  18581. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  18582. this.setDot();
  18583. }
  18584. setDot() {
  18585. this.ui.dot.x = this.moveDest.x;
  18586. this.ui.dot.y = this.moveDest.y;
  18587. }
  18588. closeSelf() {
  18589. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  18590. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  18591. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  18592. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  18593. xGame.common.gameMgr.gamePause = false;
  18594. this.hide();
  18595. }
  18596. openPressDotEvent() {
  18597. this.closePressDotEvent();
  18598. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18599. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  18600. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18601. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18602. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18603. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18604. }
  18605. closePressDotEvent() {
  18606. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18607. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  18608. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18609. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18610. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18611. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18612. }
  18613. onDown(e) {
  18614. if (e.type == Laya.Event.MOUSE_DOWN)
  18615. this.isPressd = true;
  18616. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  18617. this.isPressd = false;
  18618. if (!this.isPressd)
  18619. return;
  18620. this.moveDest.x = e.stageX;
  18621. this.moveDest.y = e.stageY;
  18622. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  18623. if (dis > 6724) {
  18624. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  18625. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  18626. }
  18627. this.setDot();
  18628. }
  18629. resetRod() {
  18630. this.ui.dot.x = this.ui.white.x;
  18631. this.ui.dot.y = this.ui.white.y;
  18632. this.gameRod.dot.x = this.gameRod.bg.x;
  18633. this.gameRod.dot.y = this.gameRod.bg.y;
  18634. xGame.common.rodOffest.x = 0;
  18635. xGame.common.rodOffest.y = 0;
  18636. }
  18637. }
  18638. UIRodMethod$1.uiName = "UIRodMethod";
  18639. class UIMsg$1 extends UIBase {
  18640. constructor() {
  18641. super();
  18642. }
  18643. onConstructor() {
  18644. this.ui = ui_UIMsg.createInstance();
  18645. this.contentPane = this.ui;
  18646. this.isEject = false;
  18647. this.isMuti = true;
  18648. }
  18649. show(msg, callback) {
  18650. super.show();
  18651. this.ui.tipsNode.msgTxt.text = msg;
  18652. this.ui.alpha = 1;
  18653. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  18654. this.hide();
  18655. callback && callback();
  18656. }), 1000);
  18657. }
  18658. }
  18659. UIMsg$1.uiName = "UIMsg";
  18660. class UITips$1 extends UIBase {
  18661. constructor() {
  18662. super();
  18663. this.type = 0;
  18664. }
  18665. onConstructor() {
  18666. this.ui = ui_UITips.createInstance();
  18667. this.contentPane = this.ui;
  18668. this.isEject = false;
  18669. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  18670. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  18671. }
  18672. show(tipsTxt, womanTxt, type) {
  18673. super.show();
  18674. this.ui.t0.play();
  18675. this.ui.myNode.tipsTxt.text = tipsTxt;
  18676. this.ui.myNode.womanTxt.text = womanTxt;
  18677. PlatMgr.showInsert(true);
  18678. this.ui.myNode.c1.selectedIndex = type;
  18679. this.type = type;
  18680. switch (this.type) {
  18681. case TipsType.exitGame:
  18682. xGame.common.gameMgr.gamePause = true;
  18683. break;
  18684. case TipsType.foul:
  18685. Laya.timer.once(200, this, () => {
  18686. xGame.common.gameMgr.gamePause = true;
  18687. });
  18688. break;
  18689. default:
  18690. break;
  18691. }
  18692. }
  18693. clickLeftBtn() {
  18694. this.hide();
  18695. xGame.common.gameMgr.gamePause = false;
  18696. switch (this.type) {
  18697. case TipsType.exitGame:
  18698. break;
  18699. case TipsType.foul:
  18700. break;
  18701. default:
  18702. break;
  18703. }
  18704. }
  18705. clickRightBtn() {
  18706. this.hide();
  18707. switch (this.type) {
  18708. case TipsType.exitGame:
  18709. xGame.eventMgr.event(RESET_GAME);
  18710. xGame.uiMgr.Show(UIMain$1);
  18711. Moyu.recordEnd(this, null);
  18712. xGame.common.longHelpLine = false;
  18713. break;
  18714. case TipsType.foul:
  18715. xGame.common.gameMgr.gamePause = false;
  18716. Laya.timer.clearAll(this);
  18717. break;
  18718. default:
  18719. break;
  18720. }
  18721. }
  18722. }
  18723. UITips$1.uiName = "UITips";
  18724. class UIGame$1 extends UIBase {
  18725. constructor() {
  18726. super();
  18727. this.powerNum = 0;
  18728. this.isD3Inited = false;
  18729. this.isPrePlay = false;
  18730. this.isMoveRod = false;
  18731. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  18732. this.rulerDis = 20;
  18733. this.rulerOffset = 0;
  18734. }
  18735. onConstructor() {
  18736. this.ui = ui_UIGame.createInstance();
  18737. this.contentPane = this.ui;
  18738. this.ui.x += xGame.common.sysOffestNum;
  18739. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  18740. this.isEject = false;
  18741. xGame.common.gameUI = this;
  18742. this.initSelf();
  18743. }
  18744. isTurnSelf() {
  18745. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  18746. return true;
  18747. }
  18748. }
  18749. initSelf() {
  18750. let topUI = this.ui.topNode;
  18751. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  18752. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  18753. this.barInfo = {};
  18754. this.barInfo.curY = 0;
  18755. this.barInfo.height = this.ui.powerNode.height;
  18756. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  18757. this.barInfo.powerStartY = this.ui.powerNode.y;
  18758. xGame.common.aiPlayer = new AIPlayer();
  18759. xGame.common.gameMgr = new GameMgr();
  18760. xGame.common.skillMgr = new SkillMgr();
  18761. xGame.common.wordsMgr = new WordsMgr();
  18762. xGame.common.talkMgr = new TalkMgr();
  18763. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  18764. console.log("加载经典模式表情文件chenggon !");
  18765. });
  18766. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  18767. console.log("挑战模式奖励模式spine加载成功!");
  18768. });
  18769. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  18770. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  18771. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  18772. this.addUIClick(this.ui.returnBtn, this.returnHome);
  18773. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  18774. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  18775. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  18776. }
  18777. getGanZiImg() {
  18778. let index = DataMgr.getCurBallRod();
  18779. let data = cfgTable.ballrodData[index + 1];
  18780. let gan_url = xGame.common.getGameIconUrl(data.img);
  18781. console.log('zh:getGanZiImg gan_url==' + gan_url);
  18782. this.ui.powerNode.showImg.url = gan_url;
  18783. console.log('zh:修改杆子图标O K');
  18784. }
  18785. returnHome() {
  18786. let tips = "Are you sure to exit the game?";
  18787. let woman = "Boss, why don't you play for a while longer?";
  18788. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  18789. }
  18790. addRodMethodClick() {
  18791. if (this.isTurnSelf()) {
  18792. xGame.uiMgr.Show(UIRodMethod$1);
  18793. }
  18794. }
  18795. clickHelpLineBtn(force = false) {
  18796. if (!this.isTurnSelf())
  18797. return;
  18798. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  18799. if (success) {
  18800. xGame.common.longHelpLine = true;
  18801. xGame.common.d2World.getHelpLine();
  18802. Moyu.sendDataEvent("guideNum");
  18803. }
  18804. else {
  18805. }
  18806. });
  18807. }
  18808. renderSelfDisplayBalls(index, target) {
  18809. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  18810. target.myImg.url = xGame.common.getGameIconUrl(str);
  18811. }
  18812. renderAIDisplayBalls(index, target) {
  18813. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  18814. target.myImg.url = xGame.common.getGameIconUrl(str);
  18815. ;
  18816. }
  18817. updateMode() {
  18818. if (xGame.common.gameMode == GameMode.classic) {
  18819. this.ui.topNode.scoreNode.visible = false;
  18820. }
  18821. else if (xGame.common.gameMode == GameMode.bigMove) {
  18822. this.ui.topNode.scoreNode.visible = true;
  18823. }
  18824. }
  18825. show() {
  18826. super.show();
  18827. console.log("zh:uigame show AADD");
  18828. this.ui.alpha = 0;
  18829. this.updateSelf();
  18830. xGame.common.gameMgr.gamePause = false;
  18831. xGame.common.gameUI.ui.blackAni.visible = false;
  18832. xGame.common.gameUI.ui.whiteAni.visible = false;
  18833. this.ui.powerEft.visible = false;
  18834. this.ui.colorNode.visible = false;
  18835. this.updateHead();
  18836. let curUse = DataMgr.getCurBallRod();
  18837. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  18838. this.getGanZiImg();
  18839. }
  18840. updateSelf() {
  18841. if (xGame.common.gameMode == GameMode.classic) {
  18842. this.ui.c1.selectedIndex = 0;
  18843. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  18844. this.ui.topNode.middleNode.visible = true;
  18845. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  18846. }
  18847. else if (xGame.common.gameMode == GameMode.bigMove) {
  18848. this.ui.c1.selectedIndex = 0;
  18849. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  18850. this.ui.topNode.middleNode.visible = false;
  18851. let max = xGame.cfgMgr.getMaxBigMoveLength();
  18852. let rand = xGame.common.randomNum(1, max);
  18853. let guide = DataMgr.getSkillGuide();
  18854. if (guide == 0)
  18855. rand = 1;
  18856. xGame.common.bigMoveLevelIndex = rand;
  18857. }
  18858. else if (xGame.common.gameMode == GameMode.placeBall) {
  18859. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18860. this.ui.c1.selectedIndex = 1 + data.type;
  18861. this.ui.alpha = 1;
  18862. this.startGame();
  18863. }
  18864. this.updateMode();
  18865. this.initD3world();
  18866. this.initD2world();
  18867. }
  18868. startGame() {
  18869. this.ui.snowNode.visible = Math.random() <= 0.1;
  18870. this.ui.d2Node.visible = false;
  18871. xGame.common.d3World.d3Hand.gameObj.active = false;
  18872. xGame.common.d3World.tableSrc.init();
  18873. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  18874. this.cameraViewChange(() => {
  18875. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  18876. switch (xGame.common.gameMode) {
  18877. case GameMode.classic:
  18878. xGame.common.d3World.d3Hand.gameObj.active = true;
  18879. this.playPutBallD3Ani();
  18880. break;
  18881. case GameMode.bigMove:
  18882. this.enterGame();
  18883. Laya.timer.once(500, this, () => {
  18884. this.ui.topNode.middleNode.visible = true;
  18885. this.ui.topNode.middleNode.t0.play();
  18886. });
  18887. break;
  18888. case GameMode.placeBall:
  18889. this.enterGame();
  18890. break;
  18891. default:
  18892. break;
  18893. }
  18894. });
  18895. PlatMgr.showBanner(false);
  18896. }
  18897. enterGame() {
  18898. this.ui.d2Node.visible = true;
  18899. xGame.common.d3World.d3Hand.gameObj.active = false;
  18900. xGame.common.showOneCamera("mainCamera");
  18901. Moyu.recordGame(30, true);
  18902. if (!this.isPrePlay) {
  18903. this.isPrePlay = true;
  18904. xGame.common.d3World.prePlayEft();
  18905. }
  18906. xGame.common.gameMgr.gameReady();
  18907. this.openAllEvent();
  18908. this.ui.snowNode.visible = false;
  18909. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  18910. this.ui.helpBtn.visible = condition;
  18911. }
  18912. showHelpLineGuide() {
  18913. let longGuide = DataMgr.getGuideHelpLine();
  18914. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  18915. this.ui.helpBtn.visible = true;
  18916. this.ui.guideNode.visible = true;
  18917. }
  18918. }
  18919. setTurnAlpha(alpha) {
  18920. this.ui.keduNode.alpha = alpha;
  18921. this.ui.ganNode.alpha = alpha;
  18922. this.ui.rodMethodNode.alpha = alpha;
  18923. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  18924. }
  18925. cameraViewChange(callback) {
  18926. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  18927. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  18928. xGame.common.showOneCamera("visitAngle");
  18929. cameraSrc.localRotationEulerY = 180;
  18930. cameraSrc.localRotationEulerZ = 0;
  18931. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  18932. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  18933. callback && callback();
  18934. }));
  18935. }));
  18936. }
  18937. playPutBallD3Ani() {
  18938. xGame.common.showOneCamera("mainCamera");
  18939. let handSrc = xGame.common.d3World.d3Hand;
  18940. handSrc.gameObj.active = true;
  18941. handSrc.transform.localPositionZ = 3;
  18942. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  18943. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  18944. handSrc.gameObj.active = false;
  18945. this.enterGame();
  18946. }), 400);
  18947. }));
  18948. }
  18949. updateHead() {
  18950. let user = Moyu.getUserInfo();
  18951. this.ui.topNode.selfNameTxt.text = user.nickName;
  18952. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  18953. let aiData = xGame.cfgMgr.getRandomUserInfo();
  18954. if (DataMgr.getSkillGuide() < 1) {
  18955. this.ui.topNode.aiNameTxt.text = 'billiards';
  18956. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  18957. }
  18958. else {
  18959. this.ui.topNode.aiNameTxt.text = aiData.name;
  18960. let randNo = Math.floor(Math.random() * 10) + 1;
  18961. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  18962. }
  18963. }
  18964. initD2world() {
  18965. let node = this.ui.d2Root.displayObject;
  18966. let src = node.getComponent(D2World);
  18967. if (!src) {
  18968. xGame.common.d2World = node.addComponent(D2World);
  18969. }
  18970. xGame.common.d2World.initSelf();
  18971. }
  18972. initD3world() {
  18973. if (this.isD3Inited)
  18974. return;
  18975. this.isD3Inited = true;
  18976. let scene3D = xGame.common.d3Scene;
  18977. this.ui.d3Root.displayObject.addChild(scene3D);
  18978. scene3D.active = true;
  18979. xGame.common.d3World.tableSrc.setBorderPos();
  18980. }
  18981. onRootMove(e) {
  18982. let rootBall = xGame.common.d2World.rootBall;
  18983. this.ui.moveNode.x = e.x;
  18984. this.ui.moveNode.y = e.y;
  18985. rootBall.gameObj.x = e.x;
  18986. rootBall.gameObj.y = e.y;
  18987. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  18988. }
  18989. aiRootMove(move) {
  18990. if (move)
  18991. this.hideBallUI();
  18992. else {
  18993. this.showBallUI();
  18994. xGame.common.d2World.getHelpLine();
  18995. }
  18996. }
  18997. aiForce(type, force = 0) {
  18998. this.pressTarget = PressType.powerNode;
  18999. if (type == 1)
  19000. this.onEventUp({ force: true });
  19001. else if (type == 2)
  19002. this.onEventMove({ stageY: force, force: true });
  19003. }
  19004. onEventPress(e) {
  19005. if (e.stopPropagation)
  19006. e.stopPropagation();
  19007. if (!this.isTurnSelf())
  19008. return;
  19009. let target = e.target;
  19010. switch (target) {
  19011. case this.ui.myPowerNode.displayObject:
  19012. this.pressTarget = PressType.powerNode;
  19013. this.barInfo.curY = e.stageY;
  19014. this.updateBarInfo();
  19015. break;
  19016. case this.ui.moveNode.displayObject:
  19017. this.pressTarget = PressType.moveNode;
  19018. this.hideBallUI();
  19019. this.eventObj.curX = this.ui.moveNode.x;
  19020. this.eventObj.curY = this.ui.moveNode.y;
  19021. this.ui.moveNode.finger.visible = false;
  19022. this.eventObj.lastX = e.stageX;
  19023. this.eventObj.lastY = e.stageY;
  19024. break;
  19025. case this.ui.rulerClickNode.displayObject:
  19026. this.pressTarget = PressType.rulerNode;
  19027. this.eventObj.lastY = e.stageY;
  19028. break;
  19029. case this.ui.d2Root.displayObject:
  19030. this.pressTarget = PressType.d2Root;
  19031. this.eventObj.lastX = e.stageX;
  19032. this.eventObj.lastY = e.stageY;
  19033. this.eventObj.starX = e.stageX;
  19034. this.eventObj.starY = e.stageY;
  19035. this.eventObj.curX = 0;
  19036. this.eventObj.curY = 0;
  19037. xGame.common.d2World.d2Gan.setGanLastInfo();
  19038. this.rulerOffset = 0;
  19039. break;
  19040. default:
  19041. break;
  19042. }
  19043. }
  19044. onEventMove(e) {
  19045. if (e.stopPropagation)
  19046. e.stopPropagation();
  19047. if (e && e.force) {
  19048. }
  19049. else {
  19050. if (!this.isTurnSelf())
  19051. return;
  19052. }
  19053. switch (this.pressTarget) {
  19054. case PressType.powerNode:
  19055. this.barInfo.curY = e.stageY;
  19056. this.updateBarInfo();
  19057. this.isMoveRod = true;
  19058. break;
  19059. case PressType.moveNode:
  19060. let rootBall = xGame.common.d2World.rootBall;
  19061. let radius = rootBall.gameObj.width / 2;
  19062. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  19063. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  19064. let border = xGame.common.d2World.borderRect;
  19065. if (curX <= border.x + radius)
  19066. curX = border.x + radius;
  19067. else if (curX >= border.x + border.width - radius)
  19068. curX = border.x + border.width - radius;
  19069. if (curY <= border.y + radius)
  19070. curY = border.y + radius;
  19071. else if (curY >= border.y + border.height - radius)
  19072. curY = border.y + border.height - radius;
  19073. if (xGame.common.gameMgr.isOpenBall) {
  19074. if (curX >= border.x + border.openBallW - radius)
  19075. curX = border.x + border.openBallW - radius;
  19076. }
  19077. this.ui.moveNode.x = curX;
  19078. this.ui.moveNode.y = curY;
  19079. rootBall.gameObj.x = curX;
  19080. rootBall.gameObj.y = curY;
  19081. rootBall.d3BallSrc.setTransPos(curX, curY);
  19082. this.isMoveRod = true;
  19083. break;
  19084. case PressType.rulerNode:
  19085. let yy = e.stageY - this.eventObj.lastY;
  19086. this.eventObj.lastY = e.stageY;
  19087. let ruler1 = this.ui.rulerNode.img1;
  19088. let ruler2 = this.ui.rulerNode.img2;
  19089. ruler1.y += yy;
  19090. ruler2.y += yy;
  19091. this.rulerOffset += yy;
  19092. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  19093. this.rulerOffset = 0;
  19094. xGame.soundMgr.playSound("inch", 1, 10);
  19095. }
  19096. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  19097. let h = ruler1.height;
  19098. this.checkGuide();
  19099. this.isMoveRod = true;
  19100. if (ruler1.y >= h) {
  19101. ruler1.y = -h;
  19102. ruler2.y = 0;
  19103. return;
  19104. }
  19105. else if (ruler1.y <= -h) {
  19106. ruler1.y = h;
  19107. ruler2.y = 0;
  19108. return;
  19109. }
  19110. if (ruler2.y >= h) {
  19111. ruler2.y = -h;
  19112. ruler1.y = 0;
  19113. return;
  19114. }
  19115. else if (ruler2.y <= -h) {
  19116. ruler2.y = h;
  19117. ruler1.y = 0;
  19118. return;
  19119. }
  19120. break;
  19121. case PressType.d2Root:
  19122. this.eventObj.curX = e.stageX;
  19123. this.eventObj.curY = e.stageY;
  19124. let offset = this.checkRodMoveDir();
  19125. xGame.common.d2World.d2Gan.rotateSelf(offset);
  19126. this.eventObj.lastX = e.stageX;
  19127. this.eventObj.lastY = e.stageY;
  19128. break;
  19129. default:
  19130. break;
  19131. }
  19132. }
  19133. onEventUp(e) {
  19134. if (e.stopPropagation)
  19135. e.stopPropagation();
  19136. if (e && e.force) {
  19137. }
  19138. else {
  19139. if (!this.isTurnSelf())
  19140. return;
  19141. }
  19142. switch (this.pressTarget) {
  19143. case PressType.powerNode:
  19144. this.ui.powerNode.value = 0;
  19145. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19146. this.ui.powerTxt.text = "";
  19147. if (this.powerNum > 0) {
  19148. xGame.eventMgr.event(BALL_SHOOT);
  19149. xGame.common.d2World.shoot(this.powerNum);
  19150. xGame.common.d2World.d2Gan.shoot();
  19151. xGame.common.d2World.d2HelpLine.shoot();
  19152. this.finishGuide();
  19153. this.ui.powerEft.visible = false;
  19154. this.ui.colorNode.visible = false;
  19155. let ganStr = "";
  19156. if (this.powerNum <= 30) {
  19157. ganStr = "gan_30";
  19158. }
  19159. else if (this.powerNum <= 60) {
  19160. ganStr = "gan_50";
  19161. }
  19162. else {
  19163. ganStr = "gan_80";
  19164. }
  19165. xGame.soundMgr.playSound(ganStr);
  19166. }
  19167. break;
  19168. case PressType.moveNode:
  19169. let rootBall = xGame.common.d2World.rootBall;
  19170. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  19171. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  19172. let isIntersect = this.judgeBallIntersect();
  19173. if (isIntersect) {
  19174. this.ui.moveNode.x = lastX;
  19175. this.ui.moveNode.y = lastY;
  19176. rootBall.gameObj.x = lastX;
  19177. rootBall.gameObj.y = lastY;
  19178. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  19179. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  19180. }
  19181. else {
  19182. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  19183. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  19184. }
  19185. this.showBallUI();
  19186. this.ui.moveNode.finger.visible = true;
  19187. xGame.common.d2World.getHelpLine();
  19188. break;
  19189. case PressType.rulerNode:
  19190. break;
  19191. case PressType.d2Root:
  19192. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  19193. if (dis <= 25) {
  19194. this.moveToClickDot(e);
  19195. }
  19196. break;
  19197. default:
  19198. break;
  19199. }
  19200. this.pressTarget = -1;
  19201. }
  19202. checkGuide() {
  19203. let guide = DataMgr.getSkillGuide();
  19204. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  19205. xGame.common.guideStep++;
  19206. xGame.common.gameUI.ui.guide2.visible = false;
  19207. xGame.common.gameUI.ui.guide3.visible = true;
  19208. }
  19209. }
  19210. finishGuide() {
  19211. let guide = DataMgr.getSkillGuide();
  19212. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  19213. xGame.common.guideStep = 10;
  19214. this.closeAllGuide();
  19215. console.log('zh: 新手引导完毕');
  19216. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  19217. }
  19218. }
  19219. closeAllGuide() {
  19220. xGame.common.gameUI.ui.guide1.visible = false;
  19221. xGame.common.gameUI.ui.guide2.visible = false;
  19222. xGame.common.gameUI.ui.guide3.visible = false;
  19223. }
  19224. updateBarInfo() {
  19225. let star = this.ui.powerNode.y;
  19226. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  19227. if (rate >= 1)
  19228. rate = 1;
  19229. if (rate <= 0)
  19230. rate = 0;
  19231. this.powerNum = Math.ceil(rate * 100);
  19232. this.ui.powerNode.value = this.powerNum;
  19233. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  19234. this.ui.colorNode.value = this.powerNum;
  19235. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  19236. this.ui.powerEft.visible = this.powerNum != 0;
  19237. this.ui.colorNode.visible = this.powerNum != 0;
  19238. this.ui.powerTxt.text = this.powerNum + "";
  19239. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  19240. }
  19241. forceCancel() {
  19242. this.ui.powerNode.value = 0;
  19243. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19244. this.ui.powerTxt.text = "";
  19245. }
  19246. checkRodMoveDir() {
  19247. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  19248. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  19249. if (tempX >= 0 && tempY <= 0) {
  19250. return this.checkDir();
  19251. }
  19252. else if (tempX < 0 && tempY < 0) {
  19253. return this.checkDir(1, -1);
  19254. }
  19255. else if (tempX < 0 && tempY > 0) {
  19256. return this.checkDir(-1, -1);
  19257. }
  19258. else {
  19259. return this.checkDir(-1, 1);
  19260. }
  19261. }
  19262. checkDir(flagX = 1, flagY = 1) {
  19263. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  19264. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  19265. if (offsetY == 0) {
  19266. return offsetX * flagX;
  19267. }
  19268. if (offsetX == 0) {
  19269. return offsetY * flagY;
  19270. }
  19271. let angle = offsetY / offsetX;
  19272. if (Math.abs(angle) >= 1) {
  19273. return offsetY * flagY;
  19274. }
  19275. else {
  19276. return offsetX * flagX;
  19277. }
  19278. }
  19279. judgeBallIntersect() {
  19280. let rootBall = xGame.common.d2World.rootBall;
  19281. let ballArr = xGame.common.d2World.ballArr;
  19282. let radius = rootBall.gameObj.width / 2;
  19283. let temp;
  19284. let isIntersect = false;
  19285. for (let index = 0; index < ballArr.length; index++) {
  19286. temp = ballArr[index];
  19287. if (temp.number == rootBall.number)
  19288. continue;
  19289. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  19290. if (isIntersect) {
  19291. break;
  19292. }
  19293. }
  19294. return isIntersect;
  19295. }
  19296. hideBallUI() {
  19297. let d2Gan = xGame.common.d2World.d2Gan;
  19298. if (!d2Gan.ui.isDisposed)
  19299. d2Gan.ui.visible = false;
  19300. let d2Help = xGame.common.d2World.d2HelpLine;
  19301. if (!d2Help.ui.isDisposed)
  19302. d2Help.ui.visible = false;
  19303. let rootBall = xGame.common.d2World.rootBall;
  19304. if (!rootBall.destroyed) {
  19305. rootBall.gameObj.active = false;
  19306. }
  19307. }
  19308. showBallUI() {
  19309. let d2Gan = xGame.common.d2World.d2Gan;
  19310. if (!d2Gan.ui.isDisposed)
  19311. d2Gan.ui.visible = true;
  19312. let d2Help = xGame.common.d2World.d2HelpLine;
  19313. if (!d2Help.ui.isDisposed)
  19314. d2Help.ui.visible = true;
  19315. let rootBall = xGame.common.d2World.rootBall;
  19316. if (!rootBall.destroyed) {
  19317. rootBall.gameObj.active = true;
  19318. }
  19319. }
  19320. moveToClickDot(e) {
  19321. if (!this.isMoveRod && !xGame.common.clickedBall) {
  19322. let root = xGame.common.d2World.rootBall.gameObj;
  19323. let xx = e.stageX - xGame.common.sysOffestNum;
  19324. let yy = e.stageY;
  19325. let x = xx - root.x;
  19326. let y = yy - root.y;
  19327. let angle = xGame.common.getfguiRotation(x, y);
  19328. xGame.common.d2World.d2Gan.ui.rotation = angle;
  19329. xGame.common.d2World.getHelpLine();
  19330. }
  19331. this.isMoveRod = false;
  19332. xGame.common.clickedBall = false;
  19333. }
  19334. openAllEvent() {
  19335. this.closeAllEvent();
  19336. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19337. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19338. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19339. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19340. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19341. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19342. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19343. }
  19344. closeAllEvent() {
  19345. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19346. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19347. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19348. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19349. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19350. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19351. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19352. }
  19353. resetGame() {
  19354. this.closeAllEvent();
  19355. this.hideBallUI();
  19356. xGame.common.gameMgr.gamePause = true;
  19357. }
  19358. }
  19359. UIGame$1.uiName = "UIGame";
  19360. class UIAddCoin$1 extends UIBase {
  19361. constructor() {
  19362. super();
  19363. this.coinNum = 2000;
  19364. }
  19365. onConstructor() {
  19366. this.ui = ui_UIAddCoin.createInstance();
  19367. this.contentPane = this.ui;
  19368. this.isEject = false;
  19369. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19370. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  19371. }
  19372. show() {
  19373. super.show();
  19374. this.ui.t0.play();
  19375. }
  19376. videoAddCoin() {
  19377. console.log('zh:qjff_AD_for_UIAddCoin');
  19378. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  19379. }
  19380. else {
  19381. console.log('zh:AD 失败,直接发放奖励');
  19382. this.qjff_AD_for_UIAddCoin();
  19383. }
  19384. }
  19385. qjff_AD_for_UIAddCoin() {
  19386. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  19387. this.hide();
  19388. }
  19389. }
  19390. UIAddCoin$1.uiName = "UIAddCoin";
  19391. class UIInvitation$1 extends UIBase {
  19392. constructor() {
  19393. super();
  19394. }
  19395. onConstructor() {
  19396. this.ui = ui_UIInvitation.createInstance();
  19397. this.contentPane = this.ui;
  19398. this.isEject = false;
  19399. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  19400. }
  19401. show() {
  19402. super.show();
  19403. }
  19404. enterGame() {
  19405. xGame.common.gameMode = GameMode.classic;
  19406. DataMgr.setChallengeTimes(1);
  19407. xGame.common.passAwardCoin = 2000;
  19408. let need = xGame.common.classicNiceNeddCoin;
  19409. if (DataMgr.coinEnough(need)) {
  19410. DataMgr.setCoin(-need);
  19411. xGame.eventMgr.event(RESTART_GAME, true);
  19412. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  19413. }
  19414. else {
  19415. xGame.eventMgr.event(RESTART_GAME, true);
  19416. }
  19417. this.hide();
  19418. }
  19419. hide() {
  19420. super.hide();
  19421. }
  19422. }
  19423. UIInvitation$1.uiName = "UIInvitation";
  19424. class UIPower$1 extends UIBase {
  19425. constructor() {
  19426. super();
  19427. }
  19428. onConstructor() {
  19429. this.ui = ui_UIPower.createInstance();
  19430. this.contentPane = this.ui;
  19431. this.isEject = false;
  19432. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19433. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  19434. }
  19435. show() {
  19436. super.show();
  19437. this.ui.t0.play();
  19438. }
  19439. videoGetPower() {
  19440. console.log('zh:qjff_AD_for_uipower');
  19441. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  19442. }
  19443. else {
  19444. console.log('zh:AD 失败,直接发放奖励');
  19445. this.qjff_AD_for_uipower();
  19446. }
  19447. }
  19448. qjff_AD_for_uipower() {
  19449. DataMgr.setPower(xGame.common.videoPower, true);
  19450. xGame.eventMgr.event(POWER_TIME);
  19451. this.hide();
  19452. }
  19453. }
  19454. UIPower$1.uiName = "UIPower";
  19455. class UIGameEnd$1 extends UIBase {
  19456. constructor() {
  19457. super();
  19458. this.success = false;
  19459. this.awardCoinNum = 1000;
  19460. this.awardDiamondNum = 10;
  19461. }
  19462. onConstructor() {
  19463. this.ui = ui_UIGameEnd.createInstance();
  19464. this.contentPane = this.ui;
  19465. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  19466. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  19467. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  19468. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19469. this.ui.talkNode.visible = false;
  19470. if (Moyu.isKs)
  19471. this.ui.closeNode.closeBtn.x += 100;
  19472. }
  19473. updateType() {
  19474. switch (xGame.common.gameMode) {
  19475. case GameMode.classic:
  19476. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19477. this.ui.coinNode.visible = this.success;
  19478. if (!this.success) {
  19479. Laya.timer.once(500, this, () => {
  19480. xGame.uiMgr.Show(UIAddCoin$1);
  19481. });
  19482. }
  19483. else {
  19484. this.logEventForClassic_win();
  19485. }
  19486. this.logEventForClassic_complete();
  19487. this.ui.isGetAward.visible = false;
  19488. this.ui.leftBtn.c1.selectedIndex = 3;
  19489. this.ui.rightBtn.c1.selectedIndex = 0;
  19490. this.moneyNode.ui.c1.selectedIndex = 1;
  19491. break;
  19492. case GameMode.bigMove:
  19493. console.log('zh:招法模式 aaaaaa bigMove');
  19494. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19495. this.ui.coinNode.visible = this.success;
  19496. if (xGame.common.gameMode == GameMode.bigMove) {
  19497. if (this.success) {
  19498. DataMgr.setSkillSuccessTimes(1, true);
  19499. DataMgr.setSkillAccTimes(1);
  19500. }
  19501. else {
  19502. DataMgr.setSkillSuccessTimes(0, false);
  19503. }
  19504. }
  19505. this.logEventForRod_complete_N();
  19506. if (!this.success) {
  19507. Laya.timer.once(500, this, () => {
  19508. xGame.uiMgr.Show(UIAddCoin$1);
  19509. });
  19510. }
  19511. else {
  19512. this.logEventForRod_win();
  19513. }
  19514. this.ui.isGetAward.visible = false;
  19515. this.ui.leftBtn.c1.selectedIndex = 3;
  19516. this.ui.rightBtn.c1.selectedIndex = 0;
  19517. this.moneyNode.ui.c1.selectedIndex = 1;
  19518. break;
  19519. case GameMode.placeBall:
  19520. this.ui.coinNode.visible = false;
  19521. if (this.success) {
  19522. if (xGame.common.placeBallStarNum == 3) {
  19523. this.ui.c1.selectedIndex = 2;
  19524. }
  19525. else {
  19526. this.ui.c1.selectedIndex = 3;
  19527. }
  19528. let level = xGame.common.placeBallCurLevel;
  19529. if (level > 59) {
  19530. this.logEventForChallenge_level_complete(level);
  19531. }
  19532. else {
  19533. this.logEventForChallenge_level_N(level);
  19534. }
  19535. }
  19536. else {
  19537. this.ui.c1.selectedIndex = 4;
  19538. }
  19539. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19540. if (cfg.type == PlaceBallType.challenge) {
  19541. this.ui.c1.selectedIndex = 2;
  19542. }
  19543. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  19544. this.updatePlaceBallBtn();
  19545. this.updatePlaceBallStarNum();
  19546. this.updatePlaceBallAwardState();
  19547. this.moneyNode.ui.c1.selectedIndex = 2;
  19548. this.moneyNode.checkPowerTime();
  19549. this.moneyNode.powerChange();
  19550. DataMgr.upRankData();
  19551. break;
  19552. default:
  19553. break;
  19554. }
  19555. }
  19556. logEventForRod_complete_N() {
  19557. let gfmsIdx = xGame.common.curPlayerSkillType;
  19558. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  19559. let gfmc = 'Skyfall Shot';
  19560. if (gfmsIdx == 0) {
  19561. gfmc = 'Skyfall Shot';
  19562. }
  19563. if (gfmsIdx == 1) {
  19564. gfmc = 'Surging break';
  19565. }
  19566. if (gfmsIdx == 2) {
  19567. gfmc = 'Frost Lock';
  19568. }
  19569. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  19570. console.log('zh:logEventForRod_complete_N level = ' + level);
  19571. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  19572. let jsonStr = {
  19573. "count": 0,
  19574. "name": gfmc
  19575. };
  19576. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19577. const d = LocalStorageManager.getItem(keyStr);
  19578. jsonStr.count = d.count + 1;
  19579. LocalStorageManager.setItem(keyStr, jsonStr);
  19580. }
  19581. else {
  19582. LocalStorageManager.setItem(keyStr, jsonStr);
  19583. }
  19584. const d2 = LocalStorageManager.getItem(keyStr);
  19585. let count = d2.count;
  19586. console.log('zh:logEventForRod_complete_N count = ' + count);
  19587. if (count % 5 == 0) {
  19588. const reqStr = JSON.stringify(jsonStr);
  19589. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  19590. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  19591. }
  19592. }
  19593. logEventForRod_win() {
  19594. console.log('zh:logEventForRod_win,胜利');
  19595. let gfmsIdx = xGame.common.curPlayerSkillType;
  19596. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  19597. let gfmc = 'Skyfall Shot';
  19598. if (gfmsIdx == 0) {
  19599. gfmc = 'Skyfall Shot';
  19600. }
  19601. if (gfmsIdx == 1) {
  19602. gfmc = 'Surging break';
  19603. }
  19604. if (gfmsIdx == 2) {
  19605. gfmc = 'Frost Lock';
  19606. }
  19607. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  19608. console.log('zh:logEventForRod_win level = ' + level);
  19609. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  19610. let jsonStr = {
  19611. "count": 1,
  19612. "name": gfmc + ' Lev' + level
  19613. };
  19614. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19615. const d = LocalStorageManager.getItem(keyStr);
  19616. jsonStr.count = d.count + 1;
  19617. LocalStorageManager.setItem(keyStr, jsonStr);
  19618. }
  19619. else {
  19620. LocalStorageManager.setItem(keyStr, jsonStr);
  19621. }
  19622. const reqStr = JSON.stringify(jsonStr);
  19623. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  19624. }
  19625. logEventForClassic_win() {
  19626. console.log('zh:logEventForClassic_win,胜利');
  19627. let rtype = xGame.common.classicRoomType;
  19628. let msmc = '';
  19629. if (rtype == 1) {
  19630. msmc = 'beginner';
  19631. }
  19632. if (rtype == 2) {
  19633. msmc = 'expert';
  19634. }
  19635. if (rtype == 3) {
  19636. msmc = 'master';
  19637. }
  19638. let keyStr = 'sjmd_classic_win_' + rtype;
  19639. let jsonStr = {
  19640. "difficulty": msmc,
  19641. "classic_count": 1,
  19642. "difficulty_count": 1
  19643. };
  19644. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19645. const d = LocalStorageManager.getItem(keyStr);
  19646. jsonStr.classic_count = d.classic_count + 1;
  19647. jsonStr.difficulty_count = d.difficulty_count + 1;
  19648. LocalStorageManager.setItem(keyStr, jsonStr);
  19649. }
  19650. else {
  19651. LocalStorageManager.setItem(keyStr, jsonStr);
  19652. }
  19653. const reqStr = JSON.stringify(jsonStr);
  19654. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  19655. }
  19656. logEventForClassic_complete() {
  19657. console.log('zh:logEventForClassic_complete,胜利');
  19658. let rtype = xGame.common.classicRoomType;
  19659. let msmc = '';
  19660. if (rtype == 1) {
  19661. msmc = 'beginner';
  19662. }
  19663. if (rtype == 2) {
  19664. msmc = 'expert';
  19665. }
  19666. if (rtype == 3) {
  19667. msmc = 'master';
  19668. }
  19669. let keyStr = 'sjmd_classic_complete_' + rtype;
  19670. let jsonStr = {
  19671. "msmc": msmc,
  19672. "count": 0
  19673. };
  19674. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19675. const d = LocalStorageManager.getItem(keyStr);
  19676. jsonStr.count = d.count + 1;
  19677. LocalStorageManager.setItem(keyStr, jsonStr);
  19678. }
  19679. else {
  19680. LocalStorageManager.setItem(keyStr, jsonStr);
  19681. }
  19682. if (jsonStr.count % 5 == 0) {
  19683. const reqStr = JSON.stringify(jsonStr);
  19684. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  19685. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  19686. }
  19687. }
  19688. updatePlaceBallBtn() {
  19689. this.ui.leftBtn.c1.selectedIndex = 5;
  19690. if (this.success) {
  19691. this.ui.rightBtn.c1.selectedIndex = 14;
  19692. }
  19693. else {
  19694. if (xGame.common.placeBallStarNum == 3) {
  19695. this.ui.rightBtn.c1.selectedIndex = 14;
  19696. }
  19697. else {
  19698. this.ui.rightBtn.c1.selectedIndex = 1;
  19699. }
  19700. }
  19701. }
  19702. updatePlaceBallStarNum() {
  19703. let starNum = xGame.common.placeBallStarNum;
  19704. if (starNum == 0)
  19705. this.ui.starNumNode.c1.selectedIndex = 3;
  19706. else {
  19707. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  19708. }
  19709. }
  19710. updatePlaceBallAwardState() {
  19711. let level = xGame.common.placeBallCurLevel;
  19712. let starNum = xGame.common.placeBallStarNum;
  19713. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  19714. let data = cfgTable.placeballData[level].award;
  19715. let cfg = cfgTable.placeballData[level];
  19716. this.awardDiamondNum = data[1];
  19717. this.awardCoinNum = data[0];
  19718. if (cfg.type == PlaceBallType.challenge) {
  19719. this.awardDiamondNum = 0;
  19720. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  19721. }
  19722. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  19723. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  19724. if (cfg.type == PlaceBallType.challenge) {
  19725. this.ui.awardNode.coinNode.visible = true;
  19726. }
  19727. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  19728. this.ui.awardNode.diamondNode.x = 265;
  19729. this.ui.awardNode.coinNode.x = 354;
  19730. }
  19731. else {
  19732. this.ui.awardNode.diamondNode.x = 291;
  19733. this.ui.awardNode.coinNode.x = 291;
  19734. }
  19735. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  19736. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  19737. if (this.awardCoinNum == 0) {
  19738. this.ui.awardNode.coinNode.numTxt.text = "";
  19739. }
  19740. if (getAward) {
  19741. this.ui.isGetAward.visible = true;
  19742. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  19743. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  19744. }
  19745. else {
  19746. this.ui.isGetAward.visible = false;
  19747. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  19748. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  19749. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  19750. }
  19751. else {
  19752. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  19753. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  19754. }
  19755. }
  19756. }
  19757. show(success) {
  19758. super.show();
  19759. xGame.eventMgr.event(RESET_GAME);
  19760. this.success = success;
  19761. Laya.timer.clearAll(this);
  19762. this.playSecretaryAni();
  19763. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  19764. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  19765. offsetTime = Math.floor(offsetTime / 1000);
  19766. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  19767. this.updateType();
  19768. Laya.timer.once(200, this, () => {
  19769. this.addAward(() => {
  19770. this.updateType();
  19771. Laya.timer.once(500, this, () => {
  19772. this.showChallengeLevel();
  19773. });
  19774. });
  19775. });
  19776. if (this.success) {
  19777. JSBridgeUtils.instance.showInternAd('gameend_success');
  19778. console.log('zh:game end 成功');
  19779. xGame.soundMgr.playSound('slots_roll01');
  19780. xGame.soundMgr.playSound("s_win");
  19781. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19782. this.diyGameDataUtilForGameWin();
  19783. }
  19784. else {
  19785. JSBridgeUtils.instance.showInternAd('gameend_faill');
  19786. console.log('zh:game end失败');
  19787. xGame.soundMgr.playSound('matchwin01');
  19788. xGame.soundMgr.playSound("s_lose");
  19789. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19790. }
  19791. let challengeNum = DataMgr.getChallengeTimes();
  19792. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  19793. DataMgr.setChallengeTimes(1);
  19794. }
  19795. if (this.success && xGame.common.gameMode == GameMode.classic) {
  19796. DataMgr.setClassicTimes();
  19797. }
  19798. }
  19799. diyGameDataUtilForGameWin() {
  19800. console.log('zh: DiyGameDataUtilForGameWin diy ');
  19801. switch (xGame.common.gameMode) {
  19802. case GameMode.classic:
  19803. console.log('zh:DiyGameDataUtilForGameWin 111');
  19804. case GameMode.bigMove:
  19805. console.log('zh:DiyGameDataUtilForGameWin 222');
  19806. this.restartGame();
  19807. break;
  19808. case GameMode.placeBall:
  19809. console.log('zh:DiyGameDataUtilForGameWin 333');
  19810. var level = xGame.common.placeBallCurLevel;
  19811. console.log('zh:练习模式 联系了多少LEV=' + level);
  19812. let db_over_lev = DataMgr.getChallengeMode_overLev();
  19813. if (level > db_over_lev) {
  19814. DataMgr.setChallengeMode_overLev(level);
  19815. }
  19816. break;
  19817. default:
  19818. console.log('zh:DiyGameDataUtilForGameWin 444');
  19819. break;
  19820. }
  19821. }
  19822. showChallengeLevel() {
  19823. if (DataMgr.getChallengeTimes() != 0)
  19824. return;
  19825. let skill = DataMgr.getSkillAccTimes();
  19826. let put = DataMgr.getPlaceBallLevelList().length;
  19827. if (skill >= 3 || put >= 5) {
  19828. xGame.uiMgr.Show(UIInvitation$1);
  19829. this.hide();
  19830. }
  19831. }
  19832. addAward(callback) {
  19833. if (!this.success) {
  19834. callback && callback();
  19835. return;
  19836. }
  19837. switch (xGame.common.gameMode) {
  19838. case GameMode.classic:
  19839. this.awardCoinNum = xGame.common.passAwardCoin;
  19840. this.awardDiamondNum = 0;
  19841. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  19842. break;
  19843. case GameMode.bigMove:
  19844. this.awardCoinNum = xGame.common.passAwardCoin;
  19845. this.awardDiamondNum = 0;
  19846. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  19847. callback && callback();
  19848. break;
  19849. case GameMode.placeBall:
  19850. let level = xGame.common.placeBallCurLevel;
  19851. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  19852. if (xGame.common.placeBallStarNum != 3) {
  19853. callback && callback();
  19854. return;
  19855. }
  19856. else {
  19857. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  19858. if (getAward) {
  19859. callback && callback();
  19860. return;
  19861. }
  19862. }
  19863. let cfg = cfgTable.placeballData[level];
  19864. let data = cfgTable.placeballData[level].award;
  19865. this.awardCoinNum = data[0];
  19866. this.awardDiamondNum = data[1];
  19867. if (cfg.type == PlaceBallType.challenge) {
  19868. this.awardDiamondNum = 0;
  19869. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  19870. }
  19871. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  19872. let diamondAward;
  19873. if (this.awardDiamondNum > 0) {
  19874. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  19875. xGame.common.getAward([diamondAward, coinAward], callback);
  19876. }
  19877. else {
  19878. xGame.common.getAward([coinAward], callback);
  19879. }
  19880. if (cfg.type == PlaceBallType.normal) {
  19881. DataMgr.setPlaceBallAward(level);
  19882. }
  19883. break;
  19884. default:
  19885. break;
  19886. }
  19887. }
  19888. playSecretaryAni_old() {
  19889. let parent = this.ui.secretary.displayObject;
  19890. parent.destroyChildren();
  19891. let xx = this.ui.secretary.width / 2;
  19892. let yy = this.ui.secretary.height;
  19893. let scale = xGame.common.getSecretaryScale();
  19894. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19895. if (this.success) {
  19896. let rand = Math.random() <= 0.5 ? 2 : 3;
  19897. xGame.common.secretary.play(data, rand, false, parent, () => {
  19898. xGame.common.secretary.play(data, 1, true, parent);
  19899. });
  19900. }
  19901. else {
  19902. xGame.common.secretary.play(data, 0, true, parent);
  19903. }
  19904. }
  19905. playSecretaryAni() {
  19906. let parent = this.ui.secretary.displayObject;
  19907. parent.destroyChildren();
  19908. let xx = this.ui.secretary.width / 2;
  19909. let yy = this.ui.secretary.height;
  19910. let scale = xGame.common.getSecretaryScale();
  19911. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19912. if (this.success) {
  19913. let rand = 0;
  19914. xGame.common.secretary.play(data, 0, true, parent);
  19915. }
  19916. else {
  19917. xGame.common.secretary.play(data, 0, true, parent);
  19918. }
  19919. }
  19920. restartGame() {
  19921. switch (xGame.common.gameMode) {
  19922. case GameMode.classic:
  19923. xGame.eventMgr.event(RESTART_GAME);
  19924. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19925. break;
  19926. case GameMode.bigMove:
  19927. this.hide();
  19928. xGame.eventMgr.event(RESTART_GAME);
  19929. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19930. break;
  19931. default:
  19932. break;
  19933. }
  19934. }
  19935. hide() {
  19936. super.hide();
  19937. xGame.common.stopGirlPop(this.ui.talkNode);
  19938. PlatMgr.showBanner(false);
  19939. }
  19940. returnHome() {
  19941. this.hide();
  19942. let showFailWords = !this.success;
  19943. xGame.uiMgr.Show(UIMain$1, showFailWords);
  19944. }
  19945. clickLeftBtn() {
  19946. switch (xGame.common.gameMode) {
  19947. case GameMode.classic:
  19948. case GameMode.bigMove:
  19949. this.returnHome();
  19950. break;
  19951. case GameMode.placeBall:
  19952. let level = xGame.common.placeBallCurLevel;
  19953. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  19954. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19955. break;
  19956. default:
  19957. break;
  19958. }
  19959. }
  19960. powerStartPlaceBallLevel(level, btn) {
  19961. if (DataMgr.powerEnough()) {
  19962. btn.touchable = false;
  19963. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  19964. btn.touchable = true;
  19965. DataMgr.setPower(-1);
  19966. xGame.eventMgr.event(POWER_TIME);
  19967. this.startPlaceBallLevel(level);
  19968. this.logEventForChallenge_level_start(level);
  19969. }));
  19970. }
  19971. else {
  19972. xGame.uiMgr.Show(UIPower$1, 0);
  19973. }
  19974. }
  19975. clickRightBtn() {
  19976. switch (xGame.common.gameMode) {
  19977. case GameMode.classic:
  19978. console.log('zh:clickRightBtn 111');
  19979. case GameMode.bigMove:
  19980. console.log('zh:clickRightBtn 222');
  19981. this.restartGame();
  19982. break;
  19983. case GameMode.placeBall:
  19984. console.log('zh:clickRightBtn 333');
  19985. let level = xGame.common.placeBallCurLevel;
  19986. let data = DataMgr.getPlaceBallLevel(level);
  19987. let curPss = data.play && !data.isCur;
  19988. if (curPss) {
  19989. console.log('zh:clickRightBtn 333-111');
  19990. console.log('zh:当前LV=' + level);
  19991. if (level == 60) {
  19992. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  19993. Laya.timer.once(3000, this, () => {
  19994. this.returnHome();
  19995. });
  19996. }
  19997. else {
  19998. let lev = level + 1;
  19999. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  20000. }
  20001. }
  20002. else {
  20003. console.log('zh:clickRightBtn 333-000');
  20004. Moyu.sendDataEvent("placeBallNextLevel");
  20005. console.log('zh:qjff_AD_for_uiGameEnd');
  20006. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  20007. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  20008. }
  20009. else {
  20010. console.log('zh:AD 失败,直接发放奖励');
  20011. this.qjff_AD_for_uiGameEnd(level);
  20012. }
  20013. }
  20014. break;
  20015. default:
  20016. console.log('zh:clickRightBtn 444');
  20017. break;
  20018. }
  20019. }
  20020. logEventForChallenge_level_start(level) {
  20021. let keyStr = 'sjmd_challenge_level_start';
  20022. let jsonStr = {
  20023. "count": 0,
  20024. "gold_balance ": DataMgr.getCoin(),
  20025. "level": level,
  20026. "diamond_balance ": DataMgr.getDiamond()
  20027. };
  20028. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20029. const d = LocalStorageManager.getItem(keyStr);
  20030. if (level > d.level) {
  20031. jsonStr.count = d.count + 1;
  20032. LocalStorageManager.setItem(keyStr, jsonStr);
  20033. }
  20034. else {
  20035. }
  20036. }
  20037. else {
  20038. LocalStorageManager.setItem(keyStr, jsonStr);
  20039. }
  20040. const reqStr = JSON.stringify(jsonStr);
  20041. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20042. }
  20043. qjff_AD_for_uiGameEnd(level) {
  20044. DataMgr.setPlaceBallLevel(level, 1);
  20045. this.startPlaceBallLevel(level + 1);
  20046. }
  20047. startPlaceBallLevel(level) {
  20048. xGame.common.gameMode = GameMode.placeBall;
  20049. xGame.common.placeBallCurLevel = level;
  20050. xGame.uiMgr.Show(UIGame$1);
  20051. this.hide();
  20052. }
  20053. logEventForChallenge_level_complete(level) {
  20054. let keyStr = 'sjmd_challenge_level_complete';
  20055. let jsonStr = {
  20056. "count": 1,
  20057. "gold_balance ": DataMgr.getCoin(),
  20058. "level": level,
  20059. "diamond_balance ": DataMgr.getDiamond()
  20060. };
  20061. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20062. const d = LocalStorageManager.getItem(keyStr);
  20063. jsonStr.count = d.count + 1;
  20064. LocalStorageManager.setItem(keyStr, jsonStr);
  20065. }
  20066. else {
  20067. LocalStorageManager.setItem(keyStr, jsonStr);
  20068. }
  20069. const reqStr = JSON.stringify(jsonStr);
  20070. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  20071. }
  20072. logEventForChallenge_level_N(level) {
  20073. console.log('zh:logEventForChallenge_level_N ' + level);
  20074. let keyStr = 'sjmd_challenge_level_N';
  20075. if (LocalStorageManager.hasKey(keyStr)) {
  20076. let lev = LocalStorageManager.getItem(keyStr);
  20077. if (level > lev) {
  20078. LocalStorageManager.setItem(keyStr, level);
  20079. }
  20080. if ((level) % 5 == 0) {
  20081. console.log('zh:每5关上报1次');
  20082. let sjmc = 'challenge_level_' + level;
  20083. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  20084. let sjmcForFirebase = 'challenge_level_' + level;
  20085. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  20086. }
  20087. else {
  20088. console.log('zh:5 no 上报');
  20089. }
  20090. }
  20091. else {
  20092. LocalStorageManager.setItem(keyStr, level);
  20093. }
  20094. }
  20095. }
  20096. UIGameEnd$1.uiName = "UIGameEnd";
  20097. class ShowItem$1 {
  20098. constructor() {
  20099. this.ui = ui_ShowItem.createInstance();
  20100. }
  20101. destroySelf() {
  20102. if (!this.ui.isDisposed) {
  20103. this.ui.removeFromParent();
  20104. this.ui.dispose();
  20105. }
  20106. }
  20107. setParent(parent) {
  20108. parent.addChild(this.ui);
  20109. }
  20110. setPos(x, y) {
  20111. this.ui.x = x;
  20112. this.ui.y = y;
  20113. }
  20114. setUrl(index) {
  20115. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  20116. }
  20117. }
  20118. class UILevelProp$1 extends UIBase {
  20119. constructor() {
  20120. super();
  20121. this.firstPos = 385;
  20122. this.secondPos = 467;
  20123. this.showItemArr = [];
  20124. }
  20125. onFontLoaded() {
  20126. try {
  20127. this.ui.myNode.conditionTxt.font = "arial";
  20128. console.log("zh: onFontLoaded 设置arial字体成功");
  20129. }
  20130. catch (error) {
  20131. console.log("zh: constructor onFontLoaded加载arial字体失败");
  20132. }
  20133. }
  20134. onConstructor() {
  20135. this.ui = ui_UILevelProp.createInstance();
  20136. this.contentPane = this.ui;
  20137. this.isEject = false;
  20138. this.addUIClick(this.ui.closeBtn, this.hide);
  20139. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20140. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  20141. }
  20142. show(level) {
  20143. super.show();
  20144. this.ui.t1.play();
  20145. this.level = level;
  20146. this.data = cfgTable.placeballData[this.level];
  20147. this.updateSelf();
  20148. this.showPreView();
  20149. this.moneyNode.ui.c1.selectedIndex = 2;
  20150. this.moneyNode.checkPowerTime();
  20151. this.moneyNode.powerChange();
  20152. }
  20153. showPreView() {
  20154. let item;
  20155. let data;
  20156. for (let index = 0; index < this.showItemArr.length; index++) {
  20157. item = this.showItemArr[index];
  20158. item.destroySelf();
  20159. }
  20160. this.showItemArr = [];
  20161. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  20162. for (const key in cfgData) {
  20163. data = cfgData[key];
  20164. item = new ShowItem$1();
  20165. item.setParent(this.ui.myNode.displayRoot);
  20166. item.setPos(data.x, data.y);
  20167. item.setUrl(data.value);
  20168. this.showItemArr.push(item);
  20169. }
  20170. }
  20171. updateSelf() {
  20172. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  20173. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  20174. if (this.data.ball == -1) {
  20175. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  20176. }
  20177. else {
  20178. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  20179. }
  20180. let localData = DataMgr.getPlaceBallLevel(this.level);
  20181. let getAward = localData.getAward;
  20182. let cfg = cfgTable.placeballData[this.level];
  20183. let coin = this.data.award[0];
  20184. let diamond = this.data.award[1];
  20185. if (cfg.type == PlaceBallType.challenge) {
  20186. diamond = 0;
  20187. coin = 100;
  20188. }
  20189. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  20190. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  20191. this.ui.myNode.coinNode.numTxt.text = coin + "";
  20192. if (cfg.type == PlaceBallType.challenge) {
  20193. this.ui.myNode.coinNode.numTxt.text = "";
  20194. }
  20195. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  20196. if (coin > 0 && diamond > 0) {
  20197. this.ui.myNode.diamondNode.x = 385;
  20198. this.ui.myNode.coinNode.x = 467;
  20199. }
  20200. else {
  20201. this.ui.myNode.diamondNode.x = 385;
  20202. this.ui.myNode.coinNode.x = 385;
  20203. }
  20204. if (!getAward) {
  20205. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  20206. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  20207. }
  20208. else {
  20209. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  20210. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  20211. }
  20212. }
  20213. startGame() {
  20214. if (DataMgr.powerEnough()) {
  20215. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  20216. this.ui.myNode.startBtn.touchable = false;
  20217. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20218. console.log('zh:startGame ');
  20219. this.ui.myNode.startBtn.touchable = true;
  20220. DataMgr.setPower(-1);
  20221. xGame.eventMgr.event(POWER_TIME);
  20222. xGame.common.gameMode = GameMode.placeBall;
  20223. xGame.common.placeBallCurLevel = this.level;
  20224. xGame.uiMgr.Show(UIGame$1);
  20225. this.logEventForChallenge_level_start(this.level);
  20226. xGame.uiMgr.Hide(UILevelDisplay$1);
  20227. xGame.uiMgr.Hide(UIMain$1);
  20228. this.hide();
  20229. }));
  20230. }
  20231. else {
  20232. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  20233. xGame.uiMgr.Show(UIPower$1);
  20234. }
  20235. }
  20236. logEventForChallenge_level_start(level) {
  20237. let keyStr = 'sjmd_challenge_level_start';
  20238. let jsonStr = {
  20239. "count": 1,
  20240. "gold_balance ": DataMgr.getCoin(),
  20241. "level": level,
  20242. "diamond_balance ": DataMgr.getDiamond()
  20243. };
  20244. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20245. const d = LocalStorageManager.getItem(keyStr);
  20246. if (level > d.level) {
  20247. jsonStr.count = d.count + 1;
  20248. LocalStorageManager.setItem(keyStr, jsonStr);
  20249. }
  20250. else {
  20251. }
  20252. }
  20253. else {
  20254. LocalStorageManager.setItem(keyStr, jsonStr);
  20255. }
  20256. const reqStr = JSON.stringify(jsonStr);
  20257. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20258. }
  20259. hide() {
  20260. super.hide();
  20261. }
  20262. }
  20263. UILevelProp$1.uiName = "UILevelProp";
  20264. class PutBallLevelDisplay$1 {
  20265. constructor(ui, index) {
  20266. this.index = 0;
  20267. this.ui = ui;
  20268. this.index = index;
  20269. this.ui.onClick(this, this.clickSelf);
  20270. this.updateSelf();
  20271. this.ui.levelTxt.text = (this.index + 1) + "";
  20272. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  20273. this.ui.special.levelTxt.text = (this.index + 1) + "";
  20274. }
  20275. updateSelf() {
  20276. let level = this.index + 1;
  20277. this.data = DataMgr.getPlaceBallLevel(level);
  20278. this.ui.starNode.c1.selectedIndex = this.data.star;
  20279. let isChallenge = cfgTable.placeballData[level].type;
  20280. if (this.data.isCur) {
  20281. if (isChallenge) {
  20282. this.ui.c1.selectedIndex = 5;
  20283. }
  20284. else {
  20285. this.ui.c1.selectedIndex = 2;
  20286. }
  20287. }
  20288. else {
  20289. if (this.data.play) {
  20290. if (this.data.star == 3) {
  20291. this.ui.c1.selectedIndex = 0;
  20292. }
  20293. else {
  20294. this.ui.c1.selectedIndex = 1;
  20295. }
  20296. }
  20297. else {
  20298. if (isChallenge) {
  20299. this.ui.c1.selectedIndex = 4;
  20300. }
  20301. else {
  20302. this.ui.c1.selectedIndex = 3;
  20303. }
  20304. }
  20305. }
  20306. }
  20307. clickSelf() {
  20308. if (!this.data.play)
  20309. return;
  20310. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20311. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  20312. }
  20313. }
  20314. class UILevelDisplay$1 extends UIBase {
  20315. constructor() {
  20316. super();
  20317. }
  20318. onConstructor() {
  20319. this.ui = ui_UILevelDisplay.createInstance();
  20320. this.contentPane = this.ui;
  20321. this.isEject = false;
  20322. this.myList = this.ui.myNode.myList;
  20323. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  20324. this.levelItemArr = [];
  20325. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  20326. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  20327. this.myList.numItems = levelNum;
  20328. if (Moyu.isKs)
  20329. this.ui.closeNode.closeBtn.x += 100;
  20330. }
  20331. levelItemRender(index, target) {
  20332. let item = new PutBallLevelDisplay$1(target, index);
  20333. this.levelItemArr.push(item);
  20334. }
  20335. show() {
  20336. super.show();
  20337. this.updateLevel();
  20338. this.scrollToPlace();
  20339. }
  20340. updateLevel() {
  20341. let temp;
  20342. for (let index = 0; index < this.levelItemArr.length; index++) {
  20343. temp = this.levelItemArr[index];
  20344. temp.updateSelf();
  20345. }
  20346. }
  20347. scrollToPlace() {
  20348. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  20349. let passArr = DataMgr.getPlaceBallLevelList();
  20350. let offest = passArr.length;
  20351. if (offest >= maxNum - 1)
  20352. offest = maxNum - 1;
  20353. this.myList.scrollToView(offest, true, true);
  20354. }
  20355. hide() {
  20356. super.hide();
  20357. }
  20358. }
  20359. UILevelDisplay$1.uiName = "UILevelDisplay";
  20360. class UIMatching$1 extends UIBase {
  20361. constructor() {
  20362. super();
  20363. }
  20364. onConstructor() {
  20365. this.ui = ui_UIMatching.createInstance();
  20366. this.contentPane = this.ui;
  20367. this.isEject = false;
  20368. }
  20369. show(callback) {
  20370. super.show();
  20371. PlatMgr.showBanner(true);
  20372. this.callback = callback;
  20373. let user = Moyu.getUserInfo();
  20374. if (!this.selfPot) {
  20375. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  20376. }
  20377. if (!this.aiPot) {
  20378. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  20379. }
  20380. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  20381. this.ui.selfHead.nameTxt.text = user.nickName;
  20382. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  20383. this.ui.aiHead.nameTxt.text = "???";
  20384. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  20385. this.ui.selfHead.c1.selectedIndex = 0;
  20386. this.ui.aiHead.c1.selectedIndex = 0;
  20387. this.ui.selfHead.x = this.selfPot.x;
  20388. this.ui.selfHead.y = this.selfPot.y;
  20389. this.ui.aiHead.x = this.aiPot.x;
  20390. this.ui.aiHead.y = this.aiPot.y;
  20391. switch (xGame.common.gameMode) {
  20392. case GameMode.classic:
  20393. break;
  20394. case GameMode.bigMove:
  20395. this.initSkillData();
  20396. break;
  20397. default:
  20398. break;
  20399. }
  20400. this.ui.t1.play(Laya.Handler.create(this, () => {
  20401. this.ui.t2.play(Laya.Handler.create(this, () => {
  20402. switch (xGame.common.gameMode) {
  20403. case GameMode.classic:
  20404. this.waitingPeople();
  20405. break;
  20406. case GameMode.bigMove:
  20407. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  20408. break;
  20409. default:
  20410. break;
  20411. }
  20412. }));
  20413. }));
  20414. }
  20415. initSkillData() {
  20416. this.skillSelectData = [];
  20417. let skillUrl = xGame.common.skillIconList;
  20418. let skillName = xGame.common.skillNameList;
  20419. let skillLevel = DataMgr.getBigSkillList();
  20420. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  20421. for (let index = 0; index < 5; index++) {
  20422. let obj = {};
  20423. obj.skillImg = skillUrl[index];
  20424. obj.skillName = skillName[index];
  20425. obj.skillType = skillType[index];
  20426. obj.skillLevel = skillLevel[index];
  20427. this.skillSelectData.push(obj);
  20428. }
  20429. }
  20430. getAISkillLevel(myLevel) {
  20431. let video = xGame.common.upSkillLevel;
  20432. let aiLevel;
  20433. let temp;
  20434. if (video) {
  20435. temp = xGame.common.randomNum(-2, -1);
  20436. }
  20437. else {
  20438. if (myLevel <= 5) {
  20439. temp = xGame.common.randomNum(1, 3);
  20440. }
  20441. else if (myLevel <= 9) {
  20442. temp = xGame.common.randomNum(-2, 1);
  20443. }
  20444. else {
  20445. temp = xGame.common.randomNum(-4, 0);
  20446. }
  20447. }
  20448. aiLevel = temp + myLevel;
  20449. if (aiLevel <= 1)
  20450. aiLevel = 1;
  20451. if (aiLevel >= 10)
  20452. aiLevel = 10;
  20453. return aiLevel;
  20454. }
  20455. getAISkillType() {
  20456. return xGame.common.randomNum(1, 4);
  20457. let successTimes = DataMgr.getSkillSuccessTimes();
  20458. let info = cfgTable.aiskillData[successTimes];
  20459. if (!info) {
  20460. let max = Object.keys(cfgTable.aiskillData).length - 1;
  20461. info = cfgTable.aiskillData[max];
  20462. }
  20463. let dataArr = info.skillselect;
  20464. let myCfg = {};
  20465. for (let index = 0; index < dataArr.length; index++) {
  20466. let temp = dataArr[index].split('-');
  20467. myCfg[temp[0]] = {};
  20468. myCfg[temp[0]].id = parseInt(temp[0]);
  20469. myCfg[temp[0]].weight = parseInt(temp[1]);
  20470. }
  20471. let aiCfg = xGame.common.initWeight(myCfg);
  20472. let curData = xGame.common.getRandomWeightData(aiCfg);
  20473. return parseInt(curData.id);
  20474. }
  20475. getAISkillData(index) {
  20476. let myLevel = this.skillSelectData[index].skillLevel;
  20477. let aiLevel = this.getAISkillLevel(myLevel);
  20478. let aiType = this.getAISkillType() - 1;
  20479. return { aiLevel, aiType } = { aiLevel, aiType };
  20480. }
  20481. skillSelectFinish(index) {
  20482. let aiInfo = this.getAISkillData(index);
  20483. xGame.common.gameMgr.selfCurSkill = index;
  20484. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  20485. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  20486. this.ui.selfHead.c1.selectedIndex = 1;
  20487. this.ui.aiHead.c1.selectedIndex = 1;
  20488. let myData = this.skillSelectData[index];
  20489. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  20490. let guide = DataMgr.getSkillGuide();
  20491. if (guide == 0) {
  20492. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  20493. }
  20494. else {
  20495. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  20496. }
  20497. let aiData = this.skillSelectData[aiInfo.aiType];
  20498. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  20499. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  20500. this.waitingPeople();
  20501. }
  20502. waitingPeople() {
  20503. let time = xGame.common.randomNum(1000, 3000);
  20504. time += 1000;
  20505. Laya.timer.once(time, this, () => {
  20506. this.matchingSuccess();
  20507. });
  20508. }
  20509. matchingSuccess() {
  20510. let gameUI = xGame.common.gameUI;
  20511. let name = gameUI.ui.topNode.aiNameTxt.text;
  20512. let url = gameUI.ui.topNode.aiHeadLoader.url;
  20513. this.ui.aiHead.nameTxt.text = name;
  20514. this.ui.aiHead.headImg.url = url;
  20515. name = gameUI.ui.topNode.selfNameTxt.text;
  20516. url = gameUI.ui.topNode.selfHeadLoader.url;
  20517. this.ui.selfHead.nameTxt.text = name;
  20518. this.ui.selfHead.headImg.url = url;
  20519. this.ui.t3.play(Laya.Handler.create(this, () => {
  20520. this.callback && this.callback();
  20521. this.ui.t4.play(Laya.Handler.create(this, () => {
  20522. this.destroySelf();
  20523. }));
  20524. }));
  20525. }
  20526. destroySelf() {
  20527. this.callback = null;
  20528. this.skillSelectData = null;
  20529. this.selfPot = null;
  20530. this.aiPot = null;
  20531. if (!this.ui.isDisposed) {
  20532. this.ui.removeFromParent();
  20533. this.ui.dispose();
  20534. }
  20535. xGame.uiMgr.destroyUI(this);
  20536. }
  20537. }
  20538. UIMatching$1.uiName = "UIMatching";
  20539. class SkillDisplay$1 {
  20540. constructor(ui, data, uiIndex) {
  20541. this.starX = 0;
  20542. this.starY = 0;
  20543. this.index = 0;
  20544. this.ui = ui;
  20545. this.data = data;
  20546. this.index = uiIndex;
  20547. this.initSelf();
  20548. console.log('zh:SkillDisplay constructor this.skillData=', data);
  20549. }
  20550. initSelf() {
  20551. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  20552. this.ui.nameTxt.text = this.data.name;
  20553. this.ui.describeTxt.text = this.data.describe;
  20554. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  20555. this.ui.startBtn.onClick(this, this.startGame);
  20556. this.updateSelf();
  20557. }
  20558. updateSelf() {
  20559. this.checkTry();
  20560. let level = DataMgr.getBigSkillByIndex(this.index);
  20561. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  20562. }
  20563. checkTry() {
  20564. let index = this.index;
  20565. let level = DataMgr.getBigSkillByIndex(index);
  20566. if (level == null) {
  20567. DataMgr.setBigSkill(index, 1, false);
  20568. level = 1;
  20569. }
  20570. this.ui.levelTxt.text = "LV." + level;
  20571. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  20572. this.ui.tryNode.visible = true;
  20573. else
  20574. this.ui.tryNode.visible = false;
  20575. }
  20576. clickAddLevel() {
  20577. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20578. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  20579. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  20580. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  20581. this.qjff_AD_for_skilldisplay_clickAddLevel();
  20582. }
  20583. else {
  20584. console.log('zh:AD 失败,直接发放奖励');
  20585. this.qjff_AD_for_skilldisplay_clickAddLevel();
  20586. }
  20587. }
  20588. qjff_AD_for_skilldisplay_clickAddLevel() {
  20589. DataMgr.setBigSkill(this.data.index, 1);
  20590. this.updateSelf();
  20591. xGame.common.upSkillLevel = true;
  20592. }
  20593. startGame() {
  20594. console.log('zh:rod skill startgame');
  20595. if (this.data.index == 3) {
  20596. alert('Coming soon!');
  20597. return;
  20598. }
  20599. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20600. let needCoin = xGame.common.bigMoveNeedCoin;
  20601. xGame.common.passAwardCoin = 2000;
  20602. let guide = DataMgr.getSkillGuide();
  20603. console.log('zh:startGame guide=' + guide);
  20604. xGame.common.temSelfLevel = 0;
  20605. if (guide == 0) {
  20606. needCoin = 0;
  20607. xGame.common.temSelfLevel = 100;
  20608. }
  20609. if (DataMgr.coinEnough(needCoin)) {
  20610. DataMgr.setCoin(-needCoin);
  20611. xGame.common.curPlayerSkillType = this.index;
  20612. if (guide == 0)
  20613. xGame.common.curPlayerSkillType = 0;
  20614. console.log('zh: skilldisplay 1');
  20615. xGame.uiMgr.Show(UIGame$1);
  20616. xGame.uiMgr.Hide(UIMain$1);
  20617. xGame.uiMgr.Show(UIMatching$1, () => {
  20618. xGame.common.gameUI.ui.alpha = 1;
  20619. xGame.common.gameUI.startGame();
  20620. xGame.uiMgr.Hide(UISkill$1);
  20621. });
  20622. this.logEventForRod_start();
  20623. }
  20624. else {
  20625. console.log('zh: skilldisplay 2');
  20626. xGame.uiMgr.Show(UIAddProp$1, 0);
  20627. Moyu.sendDataEvent("AddCoinVideo");
  20628. }
  20629. }
  20630. logEventForRod_start() {
  20631. let gfmsIdx = xGame.common.curPlayerSkillType;
  20632. console.log('zh:选择的技能=' + gfmsIdx);
  20633. let gfmc = 'Skyfall Shot';
  20634. if (gfmsIdx == 0) {
  20635. gfmc = 'Skyfall Shot';
  20636. }
  20637. if (gfmsIdx == 1) {
  20638. gfmc = 'Surging break';
  20639. }
  20640. if (gfmsIdx == 2) {
  20641. gfmc = 'Frost Lock';
  20642. }
  20643. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20644. let jsonStr = {
  20645. "count": 0,
  20646. "name": gfmc
  20647. };
  20648. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20649. const d = LocalStorageManager.getItem(keyStr);
  20650. jsonStr.count = d.count + 1;
  20651. LocalStorageManager.setItem(keyStr, jsonStr);
  20652. }
  20653. else {
  20654. LocalStorageManager.setItem(keyStr, jsonStr);
  20655. }
  20656. const reqStr = JSON.stringify(jsonStr);
  20657. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  20658. }
  20659. }
  20660. class UISkill$1 extends UIBase {
  20661. constructor() {
  20662. super();
  20663. this.skillData = [];
  20664. }
  20665. onConstructor() {
  20666. this.ui = ui_UISkill.createInstance();
  20667. this.contentPane = this.ui;
  20668. this.isEject = false;
  20669. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20670. this.initSkillData();
  20671. console.log('zh:aaaaaa1111111111');
  20672. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  20673. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  20674. console.log('zh:aaaaaa22222222');
  20675. this.displayList = [];
  20676. this.ui.skillNode.skillList.numItems = 3;
  20677. this.addUIClick(this.ui, this.interuptSecretary);
  20678. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  20679. this.ui.talkNode.visible = false;
  20680. if (Moyu.isKs)
  20681. this.ui.closeNode.closeBtn.x += 100;
  20682. }
  20683. show() {
  20684. super.show();
  20685. this.playSecretaryIdle();
  20686. this.moneyNode.ui.c1.selectedIndex = 1;
  20687. Laya.timer.clearAll(this);
  20688. xGame.soundMgr.playSound("s_start");
  20689. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20690. let guide = DataMgr.getSkillGuide();
  20691. this.ui.guideNode.visible = guide == 0;
  20692. let item = this.getSkillItemByUIIndex(0);
  20693. if (guide == 0) {
  20694. item.ui.c1.selectedIndex = 1;
  20695. }
  20696. else {
  20697. item.ui.c1.selectedIndex = 0;
  20698. }
  20699. this.ui.guideNode.guideBtn.visible = guide == 0;
  20700. for (let index = 0; index < this.displayList.length; index++) {
  20701. this.displayList[index].checkTry();
  20702. }
  20703. }
  20704. getSkillItemByUIIndex(cur) {
  20705. for (let index = 0; index < this.displayList.length; index++) {
  20706. if (this.displayList[index].index == cur) {
  20707. return this.displayList[index];
  20708. }
  20709. }
  20710. }
  20711. enterGuideLevel() {
  20712. let item = this.getSkillItemByUIIndex(0);
  20713. item.startGame();
  20714. if (DataMgr.getNewUser())
  20715. Moyu.sendDataEvent("gameStart1");
  20716. }
  20717. initSkillData() {
  20718. this.skillData = [];
  20719. let nameList = xGame.common.skillNameList;
  20720. let iconList = xGame.common.skillIconList;
  20721. let describeList = [
  20722. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  20723. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  20724. "The power of frost descends—freezing the flow and taking full control of the game!"
  20725. ];
  20726. console.log('zh:initSkillData 111111111');
  20727. let data;
  20728. for (let index = 0; index < nameList.length; index++) {
  20729. data = {};
  20730. data.name = nameList[index];
  20731. data.icon = iconList[index];
  20732. data.describe = describeList[index];
  20733. data.index = index;
  20734. this.skillData.push(data);
  20735. }
  20736. }
  20737. updateSkillItem(index, target) {
  20738. if (this.displayList[index] == null) {
  20739. let uiIndex;
  20740. switch (index) {
  20741. case 0:
  20742. uiIndex = 1;
  20743. break;
  20744. case 1:
  20745. uiIndex = 0;
  20746. break;
  20747. case 2:
  20748. uiIndex = 2;
  20749. break;
  20750. case 3:
  20751. uiIndex = 3;
  20752. break;
  20753. default:
  20754. break;
  20755. }
  20756. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  20757. this.displayList.push(temp);
  20758. }
  20759. }
  20760. playSecretaryIdle() {
  20761. let parent = this.ui.secretary.displayObject;
  20762. parent.destroyChildren();
  20763. let xx = this.ui.secretary.width / 2;
  20764. let yy = this.ui.secretary.height;
  20765. let scale = xGame.common.getSecretaryScale();
  20766. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20767. xGame.common.secretary.play(data, 0, true, parent);
  20768. }
  20769. returnUIMain() {
  20770. this.hide();
  20771. xGame.common.stopGirlPop(this.ui.talkNode);
  20772. xGame.uiMgr.Show(UIMain$1);
  20773. }
  20774. interuptSecretary() {
  20775. Laya.timer.clearAll(this);
  20776. this.playSecretaryRandomSound();
  20777. }
  20778. playSecretaryRandomSound() {
  20779. if (this.isHide)
  20780. return;
  20781. let time = xGame.common.randomNum(45000, 60000);
  20782. Laya.timer.once(time, this, () => {
  20783. if (this.isHide)
  20784. return;
  20785. let index = xGame.common.randomNum(4, 7);
  20786. xGame.soundMgr.playSound("s_main0" + index);
  20787. let words = 1;
  20788. switch (index) {
  20789. case 4:
  20790. words = 5;
  20791. break;
  20792. case 5:
  20793. words = 3;
  20794. break;
  20795. case 6:
  20796. words = 6;
  20797. break;
  20798. case 7:
  20799. words = 7;
  20800. break;
  20801. default:
  20802. break;
  20803. }
  20804. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20805. this.playSecretaryRandomSound();
  20806. });
  20807. }
  20808. }
  20809. UISkill$1.uiName = "UISkill";
  20810. class UIAddProp$1 extends UIBase {
  20811. constructor() {
  20812. super();
  20813. this.curType = "";
  20814. }
  20815. onConstructor() {
  20816. this.ui = ui_UIAddProp.createInstance();
  20817. this.contentPane = this.ui;
  20818. this.isEject = false;
  20819. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  20820. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  20821. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  20822. this.updateUI();
  20823. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  20824. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  20825. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  20826. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  20827. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  20828. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  20829. }
  20830. show(type) {
  20831. super.show();
  20832. this.curType = type == 0 ? "coin" : "diamond";
  20833. this.switchBtn("");
  20834. this.ui.t0.play();
  20835. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  20836. PlatMgr.showInsert(true);
  20837. }
  20838. closeSelf() {
  20839. this.hide();
  20840. }
  20841. updateUI() {
  20842. let data = cfgTable.moneyData;
  20843. let temp;
  20844. let obj;
  20845. for (const key in data) {
  20846. temp = data[key];
  20847. obj = this.ui.myNode["node" + key];
  20848. if (parseInt(key) <= 2) {
  20849. obj.diamondTxt.text = "+" + temp.num;
  20850. }
  20851. else {
  20852. obj.coinTxt.text = temp.num;
  20853. obj.diamondTxt.text = temp.get.split('_')[1];
  20854. }
  20855. }
  20856. this.updateDiamondShare();
  20857. }
  20858. updateDiamondShare() {
  20859. let data = DataMgr.getShareDiamondTimes();
  20860. if (data >= xGame.common.maxShareDiamondTimes) {
  20861. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  20862. this.ui.myNode.node1.touchable = false;
  20863. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  20864. }
  20865. else {
  20866. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  20867. this.ui.myNode.node1.touchable = true;
  20868. }
  20869. }
  20870. switchBtn(type) {
  20871. if (type == "")
  20872. type = this.curType;
  20873. else {
  20874. if (this.curType == type) {
  20875. return;
  20876. }
  20877. else {
  20878. this.curType = type;
  20879. }
  20880. }
  20881. if (type == "coin") {
  20882. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  20883. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  20884. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  20885. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  20886. this.ui.myNode.c1.selectedIndex = 0;
  20887. }
  20888. else {
  20889. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  20890. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  20891. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  20892. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  20893. this.ui.myNode.c1.selectedIndex = 1;
  20894. }
  20895. }
  20896. convertCoin(index) {
  20897. let data = cfgTable.moneyData[index];
  20898. let coinNum = data.num;
  20899. let str = data.get.split('_')[1];
  20900. let needDiamond = parseInt(str);
  20901. if (DataMgr.diamondEnough(needDiamond)) {
  20902. DataMgr.setDiamond(-needDiamond);
  20903. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  20904. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  20905. }
  20906. else {
  20907. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  20908. this.switchBtn("diamond");
  20909. }
  20910. }
  20911. videoGetDiamond() {
  20912. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  20913. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  20914. }
  20915. else {
  20916. console.log('zh:AD 失败,直接发放奖励');
  20917. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  20918. }
  20919. }
  20920. qjff_AD_for_uiAddProp_videoGetDiamond() {
  20921. let num = cfgTable.moneyData[2].num;
  20922. xGame.common.playObjFlyAnim(num, Prop.diamond);
  20923. this.closeSelf();
  20924. }
  20925. videoGetCoin() {
  20926. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  20927. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  20928. }
  20929. else {
  20930. console.log('zh:AD 失败,直接发放奖励');
  20931. this.qjff_AD_for_uiAddProp_videoGetCoin();
  20932. }
  20933. }
  20934. qjff_AD_for_uiAddProp_videoGetCoin() {
  20935. xGame.common.playObjFlyAnim(2000, Prop.coin);
  20936. this.closeSelf();
  20937. }
  20938. shareGetDiamond() {
  20939. let times = DataMgr.getShareDiamondTimes();
  20940. if (times >= xGame.common.maxShareDiamondTimes) {
  20941. console.log('zh: 233333333333 maxShareDiamondTimes');
  20942. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  20943. }
  20944. else {
  20945. console.log('zh:33333333333333ad');
  20946. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  20947. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  20948. }
  20949. else {
  20950. console.log('zh:AD 失败,直接发放奖励');
  20951. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  20952. }
  20953. }
  20954. }
  20955. qjff_AD_for_uiAddProp_shareGetDiamond() {
  20956. let diamond = xGame.common.randomNum(50, 100);
  20957. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  20958. DataMgr.setShareDiamondTimes(1);
  20959. this.updateDiamondShare();
  20960. }
  20961. openPutBallView() {
  20962. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  20963. let skill = xGame.uiMgr.getUI(UISkill$1);
  20964. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  20965. let uigame = xGame.uiMgr.getUI(UIGame$1);
  20966. if (end && !end.isHide) {
  20967. xGame.uiMgr.Hide(UIGameEnd$1);
  20968. xGame.uiMgr.Show(UIMain$1);
  20969. }
  20970. if (skill && !skill.isHide)
  20971. xGame.uiMgr.Hide(UISkill$1);
  20972. if (uigame && !uigame.isHide)
  20973. xGame.uiMgr.Hide(UIGame$1);
  20974. if (level && !level.isHide) {
  20975. }
  20976. else {
  20977. xGame.uiMgr.Show(UILevelDisplay$1);
  20978. }
  20979. this.closeSelf();
  20980. }
  20981. }
  20982. UIAddProp$1.uiName = "UIAddProp";
  20983. class MoneyNode$1 {
  20984. constructor(ui) {
  20985. this.leftTime = 0;
  20986. this.ui = ui;
  20987. this.ui.addCoinBtn.onClick(this, this.addCoin);
  20988. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  20989. this.ui.addPowerBtn.onClick(this, this.addPower);
  20990. this.ui.c1.selectedIndex = 1;
  20991. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  20992. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  20993. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  20994. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  20995. this.coinChange();
  20996. this.diamondChange();
  20997. this.powerChange();
  20998. }
  20999. addPower() {
  21000. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21001. xGame.uiMgr.Show(UIPower$1);
  21002. }
  21003. powerChange() {
  21004. let powerNum = DataMgr.getPower();
  21005. this.ui.powerTxt.text = powerNum + "";
  21006. }
  21007. checkPowerTime() {
  21008. let cur = new Date().getTime();
  21009. let last = DataMgr.getPowerTime();
  21010. if (last == 0) {
  21011. last = cur;
  21012. DataMgr.setPowerTime(cur);
  21013. }
  21014. let power = DataMgr.getPower();
  21015. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  21016. Laya.timer.clearAll(this);
  21017. if (power >= xGame.common.natureMaxPower) {
  21018. this.ui.powerTimeTxt.text = "";
  21019. DataMgr.setPowerTime(cur);
  21020. return;
  21021. }
  21022. if (power + offset >= xGame.common.natureMaxPower) {
  21023. DataMgr.setPower(xGame.common.natureMaxPower, false);
  21024. this.ui.powerTimeTxt.text = "";
  21025. DataMgr.setPowerTime(cur);
  21026. }
  21027. else {
  21028. if (offset > 0) {
  21029. DataMgr.setPower(offset);
  21030. DataMgr.setPowerTime(cur);
  21031. }
  21032. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  21033. this.leftTime = xGame.common.powerRecoverNum - time;
  21034. if (this.leftTime <= 0)
  21035. this.leftTime = 0;
  21036. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21037. Laya.timer.loop(1000, this, this.updatePowerTime);
  21038. }
  21039. }
  21040. updatePowerTime() {
  21041. this.leftTime -= 1;
  21042. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21043. if (this.leftTime <= 0) {
  21044. this.checkPowerTime();
  21045. }
  21046. }
  21047. coinChange() {
  21048. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  21049. }
  21050. diamondChange() {
  21051. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  21052. }
  21053. addCoin() {
  21054. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21055. Moyu.sendDataEvent("AddCoinBtn");
  21056. xGame.uiMgr.Show(UIAddProp$1, 0);
  21057. }
  21058. addDiamond() {
  21059. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21060. Moyu.sendDataEvent("AddDiamondBtn");
  21061. xGame.uiMgr.Show(UIAddProp$1, 1);
  21062. }
  21063. }
  21064. class SettingNode$1 {
  21065. constructor(ui) {
  21066. this.showSetting = false;
  21067. this.openSound = true;
  21068. this.openShake = true;
  21069. this.ui = ui;
  21070. this.ui.soundBtn.onClick(this, this.switchSound);
  21071. this.ui.shakeBtn.onClick(this, this.switchShake);
  21072. this.ui.xyBtn.onClick(this, this.onXy);
  21073. this.ui.clickNode.onClick(this, this.changeSetting);
  21074. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  21075. this.ui.xyBtn.visible = false;
  21076. this.ui.shakeBtn.visible = false;
  21077. }
  21078. changeSetting() {
  21079. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21080. this.showSetting = !this.showSetting;
  21081. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  21082. }
  21083. switchSound() {
  21084. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21085. this.openSound = !this.openSound;
  21086. Moyu.onSetting(this.openSound, this.openShake);
  21087. xGame.soundMgr.onSetting(this.openSound);
  21088. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  21089. }
  21090. switchShake() {
  21091. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21092. this.openShake = !this.openShake;
  21093. Moyu.onSetting(this.openSound, this.openShake);
  21094. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  21095. }
  21096. onXy() {
  21097. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21098. MoyuMgr$1.showXy(1);
  21099. }
  21100. }
  21101. class UIDraw$1 extends UIBase {
  21102. constructor() {
  21103. super();
  21104. this.curKey = 0;
  21105. }
  21106. onConstructor() {
  21107. this.ui = ui_UIDraw.createInstance();
  21108. this.contentPane = this.ui;
  21109. this.isEject = false;
  21110. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21111. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21112. this.addUIClick(this.ui.drawBtn, this.startDraw);
  21113. this.initDraw();
  21114. this.initUI();
  21115. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21116. if (Moyu.isKs)
  21117. this.ui.closeNode.closeBtn.x += 100;
  21118. }
  21119. show() {
  21120. super.show();
  21121. this.ui.t0.play();
  21122. this.playSecretaryIdle();
  21123. this.updateDraw();
  21124. this.checkFree();
  21125. if (PlatMgr.bannerDelay > 0) {
  21126. this.ui.closeNode.closeBtn.visible = false;
  21127. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  21128. this.ui.closeNode.closeBtn.visible = true;
  21129. });
  21130. }
  21131. PlatMgr.showRateBanner();
  21132. }
  21133. hide() {
  21134. Laya.timer.clearAll(this);
  21135. super.hide();
  21136. }
  21137. checkFree() {
  21138. let isFree = DataMgr.getDailyfreeDrawTimes();
  21139. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  21140. }
  21141. initDraw() {
  21142. this.drawObj = [];
  21143. let data = cfgTable.drawData;
  21144. let temp;
  21145. let weight = 0;
  21146. for (const key in data) {
  21147. temp = data[key];
  21148. weight += temp.weight;
  21149. this.drawObj.push(weight);
  21150. }
  21151. this.allWeight = weight;
  21152. }
  21153. initUI() {
  21154. let data = cfgTable.drawData;
  21155. let temp;
  21156. let img;
  21157. let txt;
  21158. for (const key in data) {
  21159. temp = data[key];
  21160. img = this.ui.myNode.rotNode["img" + key];
  21161. txt = this.ui.myNode.rotNode["txt" + key];
  21162. img.url = xGame.common.getGameIconUrl(temp.icon);
  21163. txt.visible = true;
  21164. if (temp.award > 2) {
  21165. img.rotation = 0;
  21166. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  21167. }
  21168. else {
  21169. img.rotation = temp.rotation;
  21170. txt.text = temp.num;
  21171. }
  21172. }
  21173. }
  21174. getCurkey() {
  21175. let rand = Math.random() * this.allWeight;
  21176. let temp;
  21177. for (let index = 0; index < this.drawObj.length - 1; index++) {
  21178. temp = this.drawObj[index];
  21179. if (index == 0) {
  21180. if (rand < temp) {
  21181. return index + 1;
  21182. }
  21183. }
  21184. else {
  21185. if (rand >= temp && rand < this.drawObj[index + 1]) {
  21186. return index + 1;
  21187. }
  21188. }
  21189. }
  21190. return 2;
  21191. }
  21192. startDraw() {
  21193. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  21194. if (freeTimes > 0) {
  21195. this.beginDraw();
  21196. DataMgr.setDailyfreeDrawTimes(0);
  21197. this.checkFree();
  21198. }
  21199. else {
  21200. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  21201. }
  21202. else {
  21203. console.log('zh:AD 失败,直接发放奖励');
  21204. this.qjff_chouJiang();
  21205. }
  21206. }
  21207. }
  21208. qjff_chouJiang() {
  21209. this.beginDraw();
  21210. }
  21211. beginDraw() {
  21212. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  21213. this.ui.drawBtn.touchable = false;
  21214. this.curKey = this.getCurkey();
  21215. console.log("当前key", this.curKey);
  21216. let cell = 60;
  21217. let lap = 3;
  21218. let angle = cell * (this.curKey - 1) + lap * 360;
  21219. let target = this.ui.myNode.rotNode;
  21220. target.rotation = 0;
  21221. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  21222. console.log("旋转完成");
  21223. this.ui.drawBtn.touchable = true;
  21224. this.getAward();
  21225. }));
  21226. }
  21227. getAward() {
  21228. let data = cfgTable.drawData[this.curKey];
  21229. let temp = new AwardType();
  21230. temp.type = data.award;
  21231. temp.num = data.num;
  21232. xGame.common.getAward([temp], () => {
  21233. DataMgr.setDrawTimes(1);
  21234. this.updateDraw();
  21235. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21236. });
  21237. }
  21238. updateDraw() {
  21239. let drawTimes = DataMgr.getDrawTimes();
  21240. let awardTimes = DataMgr.getDrawAwardTimes();
  21241. if (Math.floor(drawTimes / 3) > awardTimes) {
  21242. this.ui.extraNode.boxBtn.t0.play(null, -1);
  21243. this.ui.extraNode.boxBtn.touchable = true;
  21244. this.ui.extraNode.tipsTxt.text = "3/3";
  21245. this.ui.extraNode.barNode.width = 265;
  21246. this.getExtraAward();
  21247. }
  21248. else {
  21249. this.ui.extraNode.boxBtn.t0.stop();
  21250. this.ui.extraNode.boxBtn.touchable = false;
  21251. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  21252. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  21253. }
  21254. let data = cfgTable.drawData[1];
  21255. if (awardTimes == 0) {
  21256. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  21257. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  21258. this.ui.myNode.rotNode.img1.rotation = 0;
  21259. }
  21260. else {
  21261. let award = data.nextid;
  21262. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  21263. this.ui.myNode.rotNode.txt1.text = award[1];
  21264. this.ui.myNode.rotNode.img1.rotation = 0;
  21265. }
  21266. }
  21267. getExtraAward() {
  21268. let drawTimes = DataMgr.getDrawTimes();
  21269. let awardTimes = DataMgr.getDrawAwardTimes();
  21270. let data = cfgTable.drawData[1];
  21271. let award = new AwardType();
  21272. if (awardTimes == 0) {
  21273. award.num = data.num;
  21274. award.type = data.award;
  21275. xGame.common.getAward([award], () => {
  21276. let all = Math.floor(drawTimes / 3);
  21277. DataMgr.setDrawAwardTimes(all);
  21278. this.updateDraw();
  21279. });
  21280. }
  21281. else {
  21282. award.num = parseInt(data.nextid[1]);
  21283. award.type = parseInt(data.nextid[0]);
  21284. xGame.common.getAward([award], () => {
  21285. let all = Math.floor(drawTimes / 3);
  21286. DataMgr.setDrawAwardTimes(all);
  21287. this.updateDraw();
  21288. });
  21289. }
  21290. }
  21291. closeSelf() {
  21292. this.hide();
  21293. }
  21294. playSecretaryIdle() {
  21295. let parent = this.ui.secretary.displayObject;
  21296. parent.destroyChildren();
  21297. let xx = this.ui.secretary.width / 2;
  21298. let yy = this.ui.secretary.height;
  21299. let scale = xGame.common.getSecretaryScale();
  21300. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21301. xGame.common.secretary.play(data, 0, true, parent);
  21302. }
  21303. }
  21304. UIDraw$1.uiName = "UIDraw";
  21305. class UIRanking$1 extends UIBase {
  21306. constructor() {
  21307. super();
  21308. this.showSelf = true;
  21309. this.rankType = 1;
  21310. this.rankList = [];
  21311. this.topX = 10;
  21312. this.myIndex = this.topX + 1;
  21313. this.myStar = 0;
  21314. }
  21315. onConstructor() {
  21316. this.ui = ui_UIRanking.createInstance();
  21317. this.contentPane = this.ui;
  21318. this.isEject = false;
  21319. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  21320. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  21321. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  21322. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  21323. this.ui.myNode.myList.setVirtual();
  21324. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  21325. }
  21326. show() {
  21327. super.show();
  21328. this.getPaiHangBangDataFormJosnFile();
  21329. this.updateSelf();
  21330. let self = Moyu.getUserInfo();
  21331. if (!self.isAuth) {
  21332. Moyu.initUser(this, () => {
  21333. DataMgr.upRankData();
  21334. });
  21335. }
  21336. }
  21337. getPaiHangBangDataFormJosnFile() {
  21338. const rankingList = cfgTable.paiHangBangData.list;
  21339. this.updateItemData(rankingList);
  21340. }
  21341. updateSelfItem() {
  21342. console.log('zh:Moyu.platType =' + Moyu.platType);
  21343. let self = Moyu.getUserInfo();
  21344. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  21345. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  21346. if (this.myIndex > this.topX) {
  21347. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  21348. }
  21349. else {
  21350. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  21351. }
  21352. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  21353. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  21354. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  21355. }
  21356. updateItemData(data) {
  21357. this.myStar = xGame.common.getAllStarNum();
  21358. if (this.rankList.length < 2) {
  21359. this.rankList = data;
  21360. let self = Moyu.getUserInfo();
  21361. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  21362. self.headIcon = self.headIcon;
  21363. for (let i = 0; i < data.length; i++) {
  21364. let data = this.rankList[i];
  21365. if (data.userId == self.userId) {
  21366. this.rankList.splice(i, 1);
  21367. break;
  21368. }
  21369. }
  21370. for (let i = 0; i < data.length; i++) {
  21371. let data = this.rankList[i];
  21372. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  21373. this.myIndex = i + 1;
  21374. let user = { headIcon: self.headIcon, nickName: "myself" };
  21375. let ud = { user: user, data: {} };
  21376. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  21377. console.log('zh:Moyu.platType = ' + Moyu.platType);
  21378. if (Moyu.platType < 11) {
  21379. user.headIcon = self.headIcon;
  21380. user.nickName = self.nickName;
  21381. }
  21382. this.rankList.splice(i, 0, md);
  21383. break;
  21384. }
  21385. }
  21386. }
  21387. this.updateSelfItem();
  21388. this.ui.myNode.myList.numItems = this.rankList.length;
  21389. }
  21390. updateItemUI(index, obj) {
  21391. let data = this.rankList[index];
  21392. let userData = JSON.parse(data.userData).user;
  21393. obj.nameTxt.text = userData.nickName.toString();
  21394. obj.valueTxt.text = data.rankScore;
  21395. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  21396. obj.rankTxt.text = index + 1;
  21397. switch (index) {
  21398. case 0:
  21399. this.setImg(obj, 1, 0, 0);
  21400. obj.rankTxt.color = "#FFC047";
  21401. break;
  21402. case 1:
  21403. this.setImg(obj, 0, 1, 0);
  21404. obj.rankTxt.color = "#ACACAC";
  21405. break;
  21406. case 2:
  21407. this.setImg(obj, 0, 0, 1);
  21408. obj.rankTxt.color = "#D09672";
  21409. break;
  21410. default:
  21411. this.setImg(obj, 0, 0, 0);
  21412. obj.rankTxt.color = "#496FAB";
  21413. break;
  21414. }
  21415. }
  21416. setImg(obj, a, b, c) {
  21417. obj.img1.visible = a ? true : false;
  21418. obj.img2.visible = b ? true : false;
  21419. obj.img3.visible = c ? true : false;
  21420. }
  21421. changeList(type) {
  21422. this.rankType = type;
  21423. this.updateSelf();
  21424. }
  21425. changeSelfNode() {
  21426. this.showSelf = !this.showSelf;
  21427. this.updateSelf();
  21428. }
  21429. updateSelf() {
  21430. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  21431. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  21432. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21433. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  21434. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21435. }
  21436. }
  21437. UIRanking$1.uiName = "UIRanking";
  21438. class UISecretary$1 extends UIBase {
  21439. constructor() {
  21440. super();
  21441. this.curIndex = 1;
  21442. }
  21443. onConstructor() {
  21444. this.ui = ui_UISecretary.createInstance();
  21445. this.contentPane = this.ui;
  21446. this.isEject = false;
  21447. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21448. this.nodeObj = { left: null, right: null, cur: null };
  21449. this.nodeObj.cur = this.ui.myNode.gameNode3;
  21450. }
  21451. show() {
  21452. super.show();
  21453. this.ui.t0.play();
  21454. this.updateData();
  21455. }
  21456. addSecretarySpine(node, spineName) {
  21457. if (spineName == "mishu") {
  21458. if (this.secretarySpine1) {
  21459. node.displayObject.destroyChildren();
  21460. this.playWoman(this.secretarySpine1, node.displayObject);
  21461. }
  21462. else {
  21463. let spine1 = new SpineMgr("mishu", () => {
  21464. this.secretarySpine1 = spine1;
  21465. this.playWoman(this.secretarySpine1, node.displayObject);
  21466. });
  21467. }
  21468. }
  21469. else {
  21470. if (this.secretarySpine2) {
  21471. node.displayObject.destroyChildren();
  21472. this.playWoman(this.secretarySpine2, node.displayObject);
  21473. }
  21474. else {
  21475. let spine2 = new SpineMgr("xiaomishu2", () => {
  21476. this.secretarySpine2 = spine2;
  21477. this.playWoman(this.secretarySpine2, node.displayObject);
  21478. });
  21479. }
  21480. }
  21481. }
  21482. playWoman(node, parent) {
  21483. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  21484. let yy = this.ui.myNode.gameNode3.secretary.height;
  21485. let scale = 1.5;
  21486. if (node == this.secretarySpine2) {
  21487. scale = 1.2;
  21488. }
  21489. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21490. node.play(data, 0, true, parent);
  21491. }
  21492. turnLeft() {
  21493. this.curIndex--;
  21494. if (this.curIndex < 1) {
  21495. this.curIndex = 2;
  21496. }
  21497. let left = this.nodeObj.left;
  21498. let right = this.nodeObj.right;
  21499. let cur = this.nodeObj.cur;
  21500. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21501. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21502. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21503. this.updateData();
  21504. }));
  21505. this.ui.myNode.setChildIndex(right, 2);
  21506. this.nodeObj.left = cur;
  21507. this.nodeObj.right = left;
  21508. this.nodeObj.cur = right;
  21509. }
  21510. turnRight() {
  21511. this.curIndex++;
  21512. if (this.curIndex > 2) {
  21513. this.curIndex = 1;
  21514. }
  21515. let left = this.nodeObj.left;
  21516. let right = this.nodeObj.right;
  21517. let cur = this.nodeObj.cur;
  21518. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21519. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21520. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21521. this.updateData();
  21522. }));
  21523. this.ui.myNode.setChildIndex(left, 2);
  21524. this.nodeObj.left = right;
  21525. this.nodeObj.right = cur;
  21526. this.nodeObj.cur = left;
  21527. }
  21528. updateData() {
  21529. console.log('zh: updateData FFFFFFFFFF');
  21530. let data = cfgTable.secretaryshopData;
  21531. let children = this.ui.myNode._children;
  21532. let temp;
  21533. let curData;
  21534. for (let index = 0; index < children.length; index++) {
  21535. temp = children[index];
  21536. curData = data[1];
  21537. temp.heightTxt.text = curData.height;
  21538. temp.foodTxt.text = curData.food;
  21539. temp.historyTxt.text = curData.history;
  21540. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  21541. this.addSecretarySpine(temp.secretary, curData.spine);
  21542. let womanIndex = curData.id - 1;
  21543. let getWoman = DataMgr.getSecretary(womanIndex);
  21544. let curUse = DataMgr.getCurSecretary();
  21545. if (getWoman) {
  21546. if (curUse == womanIndex) {
  21547. temp.purchaseBtn.c1.selectedIndex = 1;
  21548. }
  21549. else {
  21550. temp.purchaseBtn.c1.selectedIndex = 2;
  21551. }
  21552. }
  21553. else {
  21554. temp.purchaseBtn.c1.selectedIndex = 0;
  21555. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  21556. }
  21557. temp.purchaseBtn.visible = false;
  21558. }
  21559. }
  21560. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  21561. console.log('zh: 点击了clickSecretary ');
  21562. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21563. if (getWoman) {
  21564. if (curUse != womanIndex) {
  21565. console.log();
  21566. DataMgr.setCurSecretary(womanIndex);
  21567. this.updateData();
  21568. }
  21569. }
  21570. else {
  21571. console.log('zh:点击购买了');
  21572. let need = needDiamond;
  21573. if (DataMgr.diamondEnough(need)) {
  21574. DataMgr.setDiamond(-need);
  21575. DataMgr.setSecretary(womanIndex, 1);
  21576. DataMgr.setCurSecretary(womanIndex);
  21577. this.updateData();
  21578. }
  21579. else {
  21580. xGame.uiMgr.Show(UIAddProp$1, 1);
  21581. }
  21582. }
  21583. }
  21584. closeSelf() {
  21585. this.hide();
  21586. }
  21587. }
  21588. UISecretary$1.uiName = "UISecretary";
  21589. class BallRodDisplay$1 {
  21590. constructor(ui, index) {
  21591. this.index = 0;
  21592. this.uiIndex = 0;
  21593. this.ui = ui;
  21594. this.index = index;
  21595. this.initData();
  21596. }
  21597. initData() {
  21598. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  21599. let data = cfgTable.ballrodData[this.index + 1];
  21600. this.ui.nameTxt.text = data.name;
  21601. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  21602. this.ui.levelNode.c1.selectedIndex = data.quality;
  21603. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  21604. if (data.spine) {
  21605. this.mySpine = new SpineMgr(data.spine, () => {
  21606. let xx = 150;
  21607. let yy = 70;
  21608. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  21609. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  21610. });
  21611. }
  21612. }
  21613. updateSelf() {
  21614. console.log('zh:updateSelf -------------- ');
  21615. let get = DataMgr.getBallRod(this.index);
  21616. if (get == null)
  21617. get = 1;
  21618. let curUse = DataMgr.getCurBallRod();
  21619. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  21620. if (get) {
  21621. if (curUse == this.index) {
  21622. this.ui.purchaseBtn.c1.selectedIndex = 0;
  21623. }
  21624. else {
  21625. this.ui.purchaseBtn.c1.selectedIndex = 1;
  21626. }
  21627. }
  21628. else {
  21629. this.ui.purchaseBtn.c1.selectedIndex = 2;
  21630. }
  21631. }
  21632. buyBallRod() {
  21633. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21634. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  21635. switch (selectedIndex) {
  21636. case 0:
  21637. break;
  21638. case 1:
  21639. console.log('zh:点击了 USE THIS');
  21640. DataMgr.setCurBallRod(this.index);
  21641. let curUse = DataMgr.getCurBallRod();
  21642. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  21643. let ui = xGame.uiMgr.getUI(UIShop$1);
  21644. ui.updateBallRod();
  21645. break;
  21646. case 2:
  21647. let data = cfgTable.ballrodData[this.index + 1];
  21648. let need = data.price;
  21649. if (DataMgr.diamondEnough(need)) {
  21650. DataMgr.setDiamond(-need);
  21651. DataMgr.setBallRod(this.index, 1);
  21652. DataMgr.setCurBallRod(this.index);
  21653. let ui = xGame.uiMgr.getUI(UIShop$1);
  21654. ui.updateBallRod();
  21655. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  21656. }
  21657. else {
  21658. xGame.uiMgr.Show(UIAddProp$1, 1);
  21659. }
  21660. break;
  21661. default:
  21662. break;
  21663. }
  21664. }
  21665. logEventForGouMaiGan(qiuGanName) {
  21666. const ev = {
  21667. value: qiuGanName
  21668. };
  21669. const jsonStr = JSON.stringify(ev);
  21670. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  21671. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  21672. }
  21673. }
  21674. class UIShop$1 extends UIBase {
  21675. constructor() {
  21676. super();
  21677. this.itemNums = 0;
  21678. }
  21679. onConstructor() {
  21680. this.ui = ui_UIShop.createInstance();
  21681. this.contentPane = this.ui;
  21682. this.isEject = false;
  21683. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21684. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21685. this.addUIClick(this.ui, this.interuptSecretary);
  21686. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  21687. this.ballRodArr = [];
  21688. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  21689. this.ui.myNode.myList.numItems = this.itemNums;
  21690. if (Moyu.isKs)
  21691. this.ui.closeNode.closeBtn.x += 100;
  21692. }
  21693. show() {
  21694. super.show();
  21695. this.playSecretaryIdle();
  21696. this.updateBallRod();
  21697. }
  21698. updateBallRod() {
  21699. for (let index = 0; index < this.ballRodArr.length; index++) {
  21700. this.ballRodArr[index].updateSelf();
  21701. }
  21702. }
  21703. renderBallRod(sort, obj) {
  21704. let index = this.getIndexBySort(sort + 1) - 1;
  21705. let ballRod = new BallRodDisplay$1(obj, index);
  21706. this.ballRodArr.push(ballRod);
  21707. }
  21708. getIndexBySort(sort) {
  21709. let object = cfgTable.ballrodData;
  21710. for (const key in object) {
  21711. if (object[key].sort == sort) {
  21712. return parseInt(key);
  21713. }
  21714. }
  21715. }
  21716. playSecretaryIdle() {
  21717. let parent = this.ui.secretary.displayObject;
  21718. parent.destroyChildren();
  21719. let xx = this.ui.secretary.width / 2;
  21720. let yy = this.ui.secretary.height;
  21721. let scale = xGame.common.getSecretaryScale();
  21722. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21723. xGame.common.secretary.play(data, 0, true, parent);
  21724. }
  21725. interuptSecretary() {
  21726. Laya.timer.clearAll(this);
  21727. this.playSecretaryRandomSound();
  21728. }
  21729. playSecretaryRandomSound() {
  21730. if (this.isHide)
  21731. return;
  21732. let time = xGame.common.randomNum(45000, 60000);
  21733. Laya.timer.once(time, this, () => {
  21734. if (this.isHide)
  21735. return;
  21736. let index = xGame.common.randomNum(4, 7);
  21737. xGame.soundMgr.playSound("s_main0" + index);
  21738. let words = 1;
  21739. switch (index) {
  21740. case 4:
  21741. words = 5;
  21742. break;
  21743. case 5:
  21744. words = 3;
  21745. break;
  21746. case 6:
  21747. words = 6;
  21748. break;
  21749. case 7:
  21750. words = 7;
  21751. break;
  21752. default:
  21753. break;
  21754. }
  21755. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21756. this.playSecretaryRandomSound();
  21757. });
  21758. }
  21759. closeSelf() {
  21760. this.hide();
  21761. }
  21762. }
  21763. UIShop$1.uiName = "UIShop";
  21764. class SignMax$1 {
  21765. constructor(ui) {
  21766. this.ui = ui;
  21767. }
  21768. updateSelf(index, sameDay, curDayIndex) {
  21769. let data = cfgTable.signData[index + 1];
  21770. this.ui.titleTxt.text = data.title;
  21771. let arr1 = data.award[0].split('-');
  21772. let arr2 = data.award[1].split('-');
  21773. let num1 = parseInt(arr1[1]);
  21774. let num2 = parseInt(arr2[1]);
  21775. this.ui.numTxt1.text = num1 + "";
  21776. this.ui.numTxt2.text = num2 + "";
  21777. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  21778. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  21779. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  21780. this.ui.numTxt1.visible = false;
  21781. }
  21782. else {
  21783. this.ui.numTxt1.visible = true;
  21784. }
  21785. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  21786. this.ui.numTxt2.visible = false;
  21787. }
  21788. else {
  21789. this.ui.numTxt2.visible = true;
  21790. }
  21791. if (index < curDayIndex) {
  21792. this.ui.c1.selectedIndex = 1;
  21793. }
  21794. else if (index == curDayIndex) {
  21795. if (sameDay) {
  21796. this.ui.c1.selectedIndex = 2;
  21797. }
  21798. else {
  21799. this.ui.c1.selectedIndex = 2;
  21800. }
  21801. }
  21802. else {
  21803. this.ui.c1.selectedIndex = 0;
  21804. }
  21805. }
  21806. }
  21807. class SignNormal$1 {
  21808. constructor(ui) {
  21809. this.ui = ui;
  21810. }
  21811. updateSelf(index, sameDay, curDayIndex) {
  21812. let data = cfgTable.signData[index + 1];
  21813. this.ui.titleTxt.text = data.title;
  21814. let arr = data.award[0].split('-');
  21815. let type = parseInt(arr[0]);
  21816. let num = parseInt(arr[1]);
  21817. this.ui.numTxt.text = num + "";
  21818. if (type > 2) {
  21819. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  21820. this.ui.myIcon.rotation = 0;
  21821. }
  21822. else {
  21823. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  21824. this.ui.myIcon.rotation = 0;
  21825. }
  21826. if (xGame.common.signAwardContainsRod(data.award)) {
  21827. this.ui.numTxt.visible = false;
  21828. }
  21829. else {
  21830. this.ui.numTxt.visible = true;
  21831. }
  21832. if (index < curDayIndex) {
  21833. this.ui.c1.selectedIndex = 1;
  21834. }
  21835. else if (index == curDayIndex) {
  21836. if (sameDay) {
  21837. this.ui.c1.selectedIndex = 2;
  21838. }
  21839. else {
  21840. this.ui.c1.selectedIndex = 2;
  21841. }
  21842. }
  21843. else {
  21844. this.ui.c1.selectedIndex = 0;
  21845. }
  21846. }
  21847. }
  21848. class UISign$1 extends UIBase {
  21849. constructor() {
  21850. super();
  21851. this.curDayIndex = 0;
  21852. this.starX = 0;
  21853. }
  21854. onConstructor() {
  21855. this.ui = ui_UISign.createInstance();
  21856. this.contentPane = this.ui;
  21857. this.isEject = false;
  21858. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21859. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21860. this.initSignItem();
  21861. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  21862. this.addUIClick(this.ui.againBtn, this.againGetAward);
  21863. }
  21864. show() {
  21865. super.show();
  21866. this.ui.t0.play();
  21867. this.playSecretaryIdle();
  21868. this.updateSign();
  21869. }
  21870. initSignItem() {
  21871. this.signArr = [];
  21872. for (let index = 0; index < 6; index++) {
  21873. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  21874. this.signArr.push(temp);
  21875. }
  21876. this.signMax = new SignMax$1(this.ui.myNode.day7);
  21877. if (Moyu.isKs)
  21878. this.ui.closeNode.closeBtn.x += 100;
  21879. }
  21880. updateSign() {
  21881. let sameDay = xGame.common.judgeSameDay();
  21882. let max = 7;
  21883. this.curDayIndex = DataMgr.getSignData();
  21884. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  21885. this.curDayIndex = 0;
  21886. if (!sameDay) {
  21887. this.ui.normalBtn.visible = true;
  21888. this.ui.tipsNode.visible = false;
  21889. this.ui.againBtn.visible = false;
  21890. }
  21891. else {
  21892. this.ui.normalBtn.visible = false;
  21893. let again = DataMgr.getExtraSign();
  21894. let isCurrency = false;
  21895. let index = this.curDayIndex;
  21896. if (index == 0)
  21897. index = 7;
  21898. let award = cfgTable.signData[index].award;
  21899. let num = award[0].split("-")[0];
  21900. if (num == "1" || num == "2")
  21901. isCurrency = true;
  21902. let showAgain = again == 0 && isCurrency;
  21903. this.ui.againBtn.visible = showAgain;
  21904. this.ui.tipsNode.visible = !showAgain;
  21905. }
  21906. for (let index = 0; index < this.signArr.length; index++) {
  21907. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  21908. }
  21909. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  21910. }
  21911. playSecretaryIdle() {
  21912. let parent = this.ui.secretary.displayObject;
  21913. parent.destroyChildren();
  21914. let xx = this.ui.secretary.width / 2;
  21915. let yy = this.ui.secretary.height;
  21916. let scale = xGame.common.getSecretaryScale();
  21917. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21918. xGame.common.secretary.play(data, 0, true, parent);
  21919. }
  21920. closeSelf() {
  21921. this.hide();
  21922. }
  21923. normalGetAward() {
  21924. let sameDay = xGame.common.judgeSameDay();
  21925. if (!sameDay) {
  21926. let award = cfgTable.signData[this.curDayIndex + 1].award;
  21927. let temp;
  21928. let type;
  21929. let num;
  21930. let arr = [];
  21931. for (let index = 0; index < award.length; index++) {
  21932. temp = award[index].split("-");
  21933. type = parseInt(temp[0]);
  21934. num = parseInt(temp[1]);
  21935. let awardType = new AwardType();
  21936. awardType.num = num;
  21937. awardType.type = type;
  21938. arr.push(awardType);
  21939. }
  21940. xGame.common.getAward(arr, (watchVideo) => {
  21941. this.curDayIndex++;
  21942. if (this.curDayIndex > 7)
  21943. this.curDayIndex = 0;
  21944. DataMgr.setSignData(this.curDayIndex);
  21945. DataMgr.setSignTime(new Date().getTime());
  21946. if (watchVideo) {
  21947. DataMgr.setExtraSign(1);
  21948. Moyu.sendDataEvent("signIn1");
  21949. }
  21950. this.updateSign();
  21951. });
  21952. }
  21953. }
  21954. againGetAward() {
  21955. Moyu.sendDataEvent("signIn2");
  21956. console.log('zh:qjff_AD_for_uisign');
  21957. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  21958. }
  21959. else {
  21960. console.log('zh:AD 失败,直接发放奖励');
  21961. this.qjff_AD_for_uisign();
  21962. }
  21963. }
  21964. qjff_AD_for_uisign() {
  21965. let index = this.curDayIndex;
  21966. if (index == 0)
  21967. index = 7;
  21968. let award = cfgTable.signData[index].award;
  21969. let temp;
  21970. let type;
  21971. let num;
  21972. for (let index = 0; index < award.length; index++) {
  21973. temp = award[index].split("-");
  21974. type = parseInt(temp[0]);
  21975. num = parseInt(temp[1]) * 3;
  21976. xGame.common.playObjFlyAnim(num, type);
  21977. }
  21978. DataMgr.setExtraSign(1);
  21979. this.updateSign();
  21980. }
  21981. }
  21982. UISign$1.uiName = "UISign";
  21983. class UIModeSelection$1 extends UIBase {
  21984. constructor() {
  21985. super();
  21986. }
  21987. onConstructor() {
  21988. this.ui = ui_UIModeSelection.createInstance();
  21989. this.contentPane = this.ui;
  21990. this.isEject = false;
  21991. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  21992. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  21993. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  21994. this.addUIClick(this.ui.closeBtn, this.hide);
  21995. this.peopleArr = [65, 990, 580];
  21996. this.peopleOffest = [5, 10, 10];
  21997. }
  21998. show(callback) {
  21999. this.updateSelf();
  22000. super.show();
  22001. this.ui.t0.play();
  22002. this.callback = callback;
  22003. }
  22004. updateSelf() {
  22005. let cfg = cfgTable.modeselectData;
  22006. for (let index = 1; index <= 3; index++) {
  22007. let node = this.ui.myNode["type" + index];
  22008. node.need.text = cfg[index].need;
  22009. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  22010. node.peopleTxt.text = this.getRandPeople(index - 1);
  22011. }
  22012. }
  22013. enterGame(type) {
  22014. console.log('zh: 进入经典模式 type: ' + type);
  22015. xGame.common.classicRoomType = type;
  22016. let cfg = cfgTable.modeselectData[type];
  22017. let need = cfg.need;
  22018. xGame.common.passAwardCoin = cfg.award;
  22019. if (DataMgr.coinEnough(need)) {
  22020. DataMgr.setCoin(-need);
  22021. this.ui.myNode["type" + type].t0.play();
  22022. Laya.timer.once(200, this, () => {
  22023. this.callback && this.callback();
  22024. });
  22025. this.logEventForClassic_start();
  22026. }
  22027. else {
  22028. Moyu.sendDataEvent("AddCoinVideo");
  22029. xGame.uiMgr.Show(UIAddProp$1, 0);
  22030. }
  22031. }
  22032. getRandPeople(index) {
  22033. let rand = this.peopleOffest[index];
  22034. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  22035. }
  22036. logEventForClassic_start() {
  22037. let rtype = xGame.common.classicRoomType;
  22038. let msmc = '';
  22039. if (rtype == 1) {
  22040. msmc = 'beginner';
  22041. }
  22042. if (rtype == 2) {
  22043. msmc = 'expert';
  22044. }
  22045. if (rtype == 3) {
  22046. msmc = 'master';
  22047. }
  22048. let keyStr = 'sjmd_classic_start_' + rtype;
  22049. let jsonStr = {
  22050. "difficulty": msmc,
  22051. "classic_count": 1,
  22052. "difficulty_count": 1
  22053. };
  22054. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22055. const d = LocalStorageManager.getItem(keyStr);
  22056. jsonStr.classic_count = d.classic_count + 1;
  22057. jsonStr.difficulty_count = d.difficulty_count + 1;
  22058. LocalStorageManager.setItem(keyStr, jsonStr);
  22059. }
  22060. else {
  22061. LocalStorageManager.setItem(keyStr, jsonStr);
  22062. }
  22063. const reqStr = JSON.stringify(jsonStr);
  22064. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  22065. }
  22066. }
  22067. UIModeSelection$1.uiName = "UIModeSelection";
  22068. class UILogin$1 extends UIBase {
  22069. constructor() {
  22070. super();
  22071. }
  22072. onConstructor() {
  22073. this.ui = ui_UILogin.createInstance();
  22074. this.contentPane = this.ui;
  22075. this.isEject = false;
  22076. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22077. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  22078. this.addUIClick(this.ui.btn_login, this.userLogin);
  22079. }
  22080. show() {
  22081. super.show();
  22082. this.x = (Laya.stage.width - this.width) / 2;
  22083. this.y = (Laya.stage.height - this.height) / 2;
  22084. }
  22085. closeSelf() {
  22086. this.hide();
  22087. }
  22088. userLogin() {
  22089. this.ui.lab_tip.visible = false;
  22090. let ua = this.ui.txt_ua.text;
  22091. let up = this.ui.txt_up.text;
  22092. if (ua && up) {
  22093. xGame.uiMgr.Show(UIMsg$1, "Request in progress..");
  22094. let reqData = JSON.stringify({
  22095. username: ua.trim(),
  22096. password: up.trim(),
  22097. fromMark: 'app_game'
  22098. });
  22099. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  22100. try {
  22101. this.ui.lab_tip.visible = true;
  22102. console.log('zh:res = ' + JSON.stringify(res));
  22103. let code = res.code;
  22104. let msg = res.msg;
  22105. this.ui.lab_tip.text = msg;
  22106. xGame.uiMgr.Show(UIMsg$1, msg);
  22107. if (code == 200) {
  22108. let keyStr = 'userInfo';
  22109. let jsonStr = {
  22110. "username": res.username,
  22111. "token": res.token
  22112. };
  22113. LocalStorageManager.setItem(keyStr, jsonStr);
  22114. this.ui.lab_tip.color = "#FFFFFF";
  22115. }
  22116. else {
  22117. this.ui.lab_tip.color = "#FF0000";
  22118. }
  22119. }
  22120. catch (error) {
  22121. console.log('error=' + error);
  22122. alert(error);
  22123. }
  22124. finally {
  22125. }
  22126. });
  22127. }
  22128. else {
  22129. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22130. }
  22131. }
  22132. gotoRegPage() {
  22133. this.closeSelf();
  22134. xGame.uiMgr.Show(UIReg$1);
  22135. }
  22136. }
  22137. UILogin$1.uiName = "UILogin";
  22138. class UIReg$1 extends UIBase {
  22139. constructor() {
  22140. super();
  22141. }
  22142. onConstructor() {
  22143. this.ui = ui_UIReg.createInstance();
  22144. this.contentPane = this.ui;
  22145. this.isEject = false;
  22146. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22147. this.addUIClick(this.ui.btn_reg, this.regUser);
  22148. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  22149. }
  22150. show() {
  22151. super.show();
  22152. this.x = (Laya.stage.width - this.width) / 2;
  22153. this.y = (Laya.stage.height - this.height) / 2;
  22154. }
  22155. closeSelf() {
  22156. this.hide();
  22157. }
  22158. regUser() {
  22159. this.ui.lab_tip.visible = false;
  22160. let ua = this.ui.txt_ua.text;
  22161. let up1 = this.ui.txt_up1.text;
  22162. let up2 = this.ui.txt_up2.text;
  22163. if (ua && up1 && up2 && up1 == up2) {
  22164. this.ui.closeBtn.visible = false;
  22165. xGame.uiMgr.Show(UIMsg$1, "Request in progress..");
  22166. let reqData = JSON.stringify({
  22167. username: ua.trim(),
  22168. password: up1.trim(),
  22169. fromMark: 'app_game'
  22170. });
  22171. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  22172. try {
  22173. this.ui.lab_tip.visible = true;
  22174. console.log('zh:res = ' + JSON.stringify(res));
  22175. let code = res.code;
  22176. let msg = res.msg;
  22177. this.ui.lab_tip.text = msg;
  22178. xGame.uiMgr.Show(UIMsg$1, msg);
  22179. if (code == 200) {
  22180. this.ui.lab_tip.color = "#FFFFFF";
  22181. }
  22182. else {
  22183. this.ui.lab_tip.color = "#FF0000";
  22184. }
  22185. }
  22186. catch (error) {
  22187. console.log('error=' + error);
  22188. alert(error);
  22189. }
  22190. finally {
  22191. }
  22192. });
  22193. }
  22194. else {
  22195. if (up1 != up2) {
  22196. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  22197. }
  22198. else {
  22199. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22200. }
  22201. }
  22202. }
  22203. gotoLogin() {
  22204. this.closeSelf();
  22205. xGame.uiMgr.Show(UILogin$1);
  22206. }
  22207. }
  22208. UIReg$1.uiName = "UIReg";
  22209. class UITry$1 extends UIBase {
  22210. constructor() {
  22211. super();
  22212. this.closeTime = 0;
  22213. this.closeNum = 0;
  22214. this.skillUrl = xGame.common.skillIconList;
  22215. }
  22216. onConstructor() {
  22217. this.ui = ui_UITry.createInstance();
  22218. this.contentPane = this.ui;
  22219. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  22220. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  22221. }
  22222. show() {
  22223. super.show();
  22224. this.closeNum = 0;
  22225. this.closeTime = 15;
  22226. this.ui.t0.play();
  22227. PlatMgr.showRateBanner();
  22228. this.ui.myNode.txtTime.text = this.closeTime.toString();
  22229. Laya.timer.loop(1000, this, this.updateTime);
  22230. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  22231. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  22232. xGame.common.gameMgr.gamePause = true;
  22233. }
  22234. updateTime() {
  22235. if (this.closeTime > 1) {
  22236. this.closeTime--;
  22237. this.ui.myNode.txtTime.text = this.closeTime.toString();
  22238. }
  22239. else
  22240. this.hide();
  22241. }
  22242. hide() {
  22243. Laya.timer.clearAll(this);
  22244. Moyu.showBannerAd(false);
  22245. super.hide();
  22246. xGame.common.gameMgr.gamePause = false;
  22247. }
  22248. onTry() {
  22249. console.log('zh:qjff_AD_for_uitry');
  22250. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  22251. }
  22252. else {
  22253. console.log('zh:AD 失败,直接发放奖励');
  22254. this.qjff_AD_for_uitry();
  22255. }
  22256. }
  22257. qjff_AD_for_uitry() {
  22258. let select = xGame.common.curPlayerSkillType;
  22259. DataMgr.gameData.trySkill = select;
  22260. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  22261. DataMgr.saveGameData();
  22262. DataMgr.setBigSkill(select, 1);
  22263. xGame.showTip("Trial Successful");
  22264. this.hide();
  22265. }
  22266. onCancel() {
  22267. if (this.closeNum > 0) {
  22268. this.closeNum--;
  22269. if (this.closeNum < 2)
  22270. this.hide();
  22271. return;
  22272. }
  22273. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  22274. this.onTry();
  22275. }
  22276. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  22277. this.closeNum = 3;
  22278. }
  22279. else
  22280. this.hide();
  22281. }
  22282. }
  22283. UITry$1.uiName = "UITry";
  22284. class UIGetAward$1 extends UIBase {
  22285. constructor() {
  22286. super();
  22287. this.showTriple = true;
  22288. }
  22289. onConstructor() {
  22290. this.ui = ui_UIGetAward.createInstance();
  22291. this.contentPane = this.ui;
  22292. this.isEject = false;
  22293. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  22294. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  22295. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  22296. }
  22297. show(arr, showTriple, callback) {
  22298. super.show();
  22299. this.ui.t0.play();
  22300. this.ui.eftNode.visible = true;
  22301. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  22302. this.ui.eftNode.visible = false;
  22303. }), 1, 0, 0, 0.9);
  22304. this.awardArr = arr;
  22305. this.showTriple = showTriple;
  22306. this.callback = callback;
  22307. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  22308. this.ui.myList.numItems = arr.length;
  22309. xGame.soundMgr.playSound("getaward");
  22310. }
  22311. updateSelf(index, obj) {
  22312. let temp = this.awardArr[index];
  22313. let icon = this.getIcon(temp.type);
  22314. let str = icon;
  22315. if (temp.type > 2) {
  22316. str = "s" + icon;
  22317. }
  22318. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  22319. obj.myIcon.rotation = 0;
  22320. obj.numTxt.text = temp.num + "";
  22321. obj.numTxt.visible = temp.type > 2 ? false : true;
  22322. obj.nameTxt.text = this.getNameStr(temp.type);
  22323. }
  22324. renderItem(index, obj) {
  22325. this.updateSelf(index, obj);
  22326. }
  22327. tripleGetAward() {
  22328. console.log('zh:qjff_AD_for_uigetAward');
  22329. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  22330. }
  22331. else {
  22332. console.log('zh:AD 失败,直接发放奖励');
  22333. this.qjff_AD_for_uigetAward();
  22334. }
  22335. }
  22336. qjff_AD_for_uigetAward() {
  22337. this.getAward(3);
  22338. }
  22339. normalGetAward() {
  22340. if (PlatMgr.isMisVideo())
  22341. this.tripleGetAward();
  22342. else
  22343. this.getAward();
  22344. }
  22345. getAward(times = 1) {
  22346. this.hide();
  22347. for (let index = 0; index < this.awardArr.length; index++) {
  22348. this.awardArr[index].num *= times;
  22349. }
  22350. this.callback && this.callback(times != 1);
  22351. }
  22352. getIcon(type) {
  22353. switch (type) {
  22354. case Prop.diamond:
  22355. return "ty_zs";
  22356. case Prop.coin:
  22357. return "ty_jb";
  22358. case Prop.gan1:
  22359. return "qg1";
  22360. case Prop.gan2:
  22361. return "qg2";
  22362. case Prop.gan3:
  22363. return "qg3";
  22364. case Prop.gan4:
  22365. return "qg4";
  22366. default:
  22367. break;
  22368. }
  22369. }
  22370. getNameStr(type) {
  22371. switch (type) {
  22372. case Prop.diamond:
  22373. return "Diamond";
  22374. case Prop.coin:
  22375. return "Coins";
  22376. case Prop.gan1:
  22377. case Prop.gan2:
  22378. case Prop.gan3:
  22379. case Prop.gan4:
  22380. return cfgTable.ballrodData[type - 1].name;
  22381. default:
  22382. break;
  22383. }
  22384. }
  22385. }
  22386. UIGetAward$1.uiName = "UIGetAward";
  22387. class UIBox$1 extends UIBase {
  22388. constructor() {
  22389. super();
  22390. this.boxNum = 0;
  22391. this.boxMax = 10;
  22392. this.inAd = false;
  22393. this.isClose = false;
  22394. }
  22395. onConstructor() {
  22396. this.ui = ui_UIBox.createInstance();
  22397. this.contentPane = this.ui;
  22398. this.isEject = false;
  22399. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  22400. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  22401. Laya.timer.loop(1000, this, this.update);
  22402. }
  22403. update() {
  22404. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  22405. this.boxNum -= 1;
  22406. this.upBar();
  22407. }
  22408. }
  22409. upBar() {
  22410. if (this.boxNum > this.boxMax)
  22411. this.boxNum = this.boxMax;
  22412. this.ui.bar.value = this.boxNum * 10;
  22413. }
  22414. show() {
  22415. super.show();
  22416. this.isClose = false;
  22417. this.boxNum = 0;
  22418. this.inAd = false;
  22419. this.upBar();
  22420. this.ui.t0.play();
  22421. this.ui.closeBtn.visible = false;
  22422. Laya.timer.once(3000, this, () => {
  22423. this.ui.closeBtn.visible = true;
  22424. this.ui.bar.alpha = 1;
  22425. });
  22426. Laya.timer.once(500, this, () => {
  22427. this.ui.t1.play();
  22428. });
  22429. }
  22430. hide() {
  22431. Laya.timer.clearAll(this);
  22432. Moyu.showBannerAd(false);
  22433. super.hide();
  22434. }
  22435. onOpenBox() {
  22436. this.boxNum++;
  22437. if (this.boxNum < this.boxMax) {
  22438. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  22439. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  22440. }
  22441. }
  22442. else if (this.boxNum == this.boxMax) {
  22443. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  22444. this.ui.openBtn.c1.selectedIndex = 13;
  22445. this.inAd = true;
  22446. }
  22447. else
  22448. this.getAward();
  22449. }
  22450. else if (this.inAd) {
  22451. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  22452. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  22453. }
  22454. else {
  22455. console.log('zh:AD 失败,直接发放奖励');
  22456. this.qjff_AD_for_UIBOX_onOpenBox();
  22457. }
  22458. }
  22459. this.upBar();
  22460. }
  22461. qjff_AD_for_UIBOX_onOpenBox() {
  22462. this.getAward();
  22463. }
  22464. onCloseBox() {
  22465. if (this.isClose)
  22466. this.hide();
  22467. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  22468. this.isClose = true;
  22469. PlatMgr.showBanner(true, 0, 3000);
  22470. }
  22471. else
  22472. this.hide();
  22473. }
  22474. getAward() {
  22475. let str = "";
  22476. if (Math.random() < 0.5) {
  22477. let max = Moyu.isLegal ? 500 : 2500;
  22478. let num = xGame.tools.random(max, 500 + max);
  22479. DataMgr.setCoin(num);
  22480. str = "金币x" + num;
  22481. }
  22482. else {
  22483. let max = Moyu.isLegal ? 10 : 30;
  22484. let num = xGame.tools.random(max, 30 + max);
  22485. DataMgr.setDiamond(num);
  22486. str = "钻石x" + num;
  22487. }
  22488. xGame.showTip("恭喜获得-" + str);
  22489. this.hide();
  22490. }
  22491. }
  22492. UIBox$1.uiName = "UIBox";
  22493. class UIMain$1 extends UIBase {
  22494. constructor() {
  22495. super();
  22496. this.firstEnter = true;
  22497. }
  22498. nativeCallJs(msg) {
  22499. let t = msg;
  22500. console.log("zh: nativeCallJs 奖励开始发放:", t);
  22501. switch (t) {
  22502. case 'qjff_chouJiang':
  22503. let dui = xGame.uiMgr.getUI(UIDraw$1);
  22504. dui.qjff_chouJiang();
  22505. break;
  22506. case 'qjff_AD_for_uisign':
  22507. let dui2 = xGame.uiMgr.getUI(UISign$1);
  22508. dui2.qjff_AD_for_uisign();
  22509. break;
  22510. case 'qjff_AD_for_uitry':
  22511. let dui3 = xGame.uiMgr.getUI(UITry$1);
  22512. dui3.qjff_AD_for_uitry();
  22513. break;
  22514. case 'qjff_AD_for_uipower':
  22515. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  22516. dui4.qjff_AD_for_uipower();
  22517. break;
  22518. case 'qjff_AD_for_uigetAward':
  22519. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  22520. dui5.qjff_AD_for_uigetAward();
  22521. break;
  22522. case 'qjff_AD_for_uiGameEnd':
  22523. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  22524. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  22525. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  22526. break;
  22527. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  22528. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  22529. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  22530. break;
  22531. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  22532. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  22533. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  22534. break;
  22535. case 'qjff_AD_for_UIrepentProp_videoRegret':
  22536. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  22537. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  22538. break;
  22539. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  22540. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  22541. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  22542. break;
  22543. case 'qjff_AD_for_UIBOX_onOpenBox':
  22544. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  22545. dui11.qjff_AD_for_UIBOX_onOpenBox();
  22546. break;
  22547. case 'qjff_AD_for_UIAddCoin':
  22548. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  22549. dui12.qjff_AD_for_UIAddCoin();
  22550. break;
  22551. case '111a':
  22552. let dui14 = xGame.uiMgr.getUI(UISign$1);
  22553. dui14.qjff_AD_for_uisign();
  22554. break;
  22555. case '222a':
  22556. let dui15 = xGame.uiMgr.getUI(UISign$1);
  22557. dui15.qjff_AD_for_uisign();
  22558. break;
  22559. case '333a':
  22560. let dui16 = xGame.uiMgr.getUI(UISign$1);
  22561. dui16.qjff_AD_for_uisign();
  22562. break;
  22563. default:
  22564. console.log('zh:未知的方法名字' + t);
  22565. break;
  22566. }
  22567. }
  22568. onConstructor() {
  22569. console.log('zh: UIMain onConstructor');
  22570. this.ui = ui_UIMain.createInstance();
  22571. this.contentPane = this.ui;
  22572. this.isEject = false;
  22573. this.addEvent();
  22574. this.addClickSpine();
  22575. this.settingNode = new SettingNode$1(this.ui.settingNode);
  22576. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22577. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  22578. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  22579. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  22580. let curUse = DataMgr.getCurSecretary();
  22581. this.changeSecretary(curUse);
  22582. this.ui.talkNode.visible = false;
  22583. let guide = DataMgr.getSkillGuide();
  22584. if (xGame.common.isNewDay && guide == 1) {
  22585. xGame.common.isNewDay = false;
  22586. xGame.soundMgr.playSound("s_main01");
  22587. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22588. console.log("zh:播放小秘书每天语音");
  22589. }
  22590. this.onGetUserInfo();
  22591. this.ui.n83.visible = false;
  22592. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  22593. const d = LocalStorageManager.getItem(keyForLoginInfo);
  22594. let ua = d.username;
  22595. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  22596. }
  22597. this.c_btn_for_user();
  22598. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  22599. }
  22600. Logout() {
  22601. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  22602. LocalStorageManager.removeItem(keyForLoginInfo);
  22603. this.freshUser();
  22604. }
  22605. }
  22606. gotoLogin() {
  22607. xGame.uiMgr.Show(UILogin$1);
  22608. }
  22609. gotoRegUser() {
  22610. xGame.uiMgr.Show(UIReg$1);
  22611. }
  22612. c_btn_for_user() {
  22613. this.ui.n_Logout.visible = false;
  22614. this.ui.n_dengLu.visible = false;
  22615. this.ui.n_zhuCe.visible = false;
  22616. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  22617. this.ui.n_Logout.visible = true;
  22618. }
  22619. else {
  22620. this.ui.n_dengLu.visible = true;
  22621. }
  22622. }
  22623. changeSecretary(curUse) {
  22624. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  22625. xGame.common.secretary && xGame.common.secretary.dispose();
  22626. this.addSecretarySpine(name);
  22627. }
  22628. addSecretarySpine(name) {
  22629. let spine = new SpineMgr(name, () => {
  22630. this.playSecretaryIdle();
  22631. });
  22632. xGame.common.secretary = spine;
  22633. }
  22634. addClickSpine() {
  22635. let clickSpine = new SpineMgr("dianji", () => {
  22636. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  22637. let parent = Laya.stage;
  22638. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  22639. clickSpine.play(data, 0, false, parent, (spine) => {
  22640. spine.destroy(true);
  22641. });
  22642. });
  22643. });
  22644. }
  22645. addEvent() {
  22646. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  22647. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  22648. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  22649. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  22650. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  22651. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  22652. this.addUIClick(this.ui, this.interuptSecretary);
  22653. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  22654. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  22655. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  22656. this.addUIClick(this.ui.shopBtn, this.openShopView);
  22657. this.addUIClick(this.ui.signBtn, this.openSignView);
  22658. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  22659. this.addUIClick(this.ui.rankBtn, this.openRanking);
  22660. this.addUIClick(this.ui.n_Logout, this.Logout);
  22661. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  22662. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  22663. }
  22664. show(showFailWords) {
  22665. super.show();
  22666. this.moneyNode.ui.c1.selectedIndex = 1;
  22667. this.playSecretaryIdle();
  22668. xGame.soundMgr.playMusic("caromhall01", 0);
  22669. Laya.timer.clearAll(this);
  22670. this.playSecretaryRandomSound();
  22671. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  22672. if (showFailWords) {
  22673. console.log('zh:uimain.ts ');
  22674. setTimeout(() => {
  22675. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  22676. let words = -1;
  22677. if (str == "s_main02") {
  22678. words = 2;
  22679. }
  22680. else {
  22681. words = 3;
  22682. }
  22683. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22684. xGame.soundMgr.playSound(str);
  22685. }, 300);
  22686. }
  22687. this.showGuide();
  22688. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  22689. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  22690. let guide = DataMgr.getSkillGuide();
  22691. if (guide == 1) {
  22692. let randTime = xGame.common.randomNum(300, 800);
  22693. if (this.firstEnter) {
  22694. console.log("zh: firstEnter");
  22695. this.firstEnter = false;
  22696. randTime += 900;
  22697. }
  22698. else {
  22699. console.log("zh: no firstEnter");
  22700. }
  22701. Laya.timer.once(randTime, this, () => {
  22702. xGame.common.autoPopUIView();
  22703. });
  22704. }
  22705. }
  22706. checkActive(show) {
  22707. }
  22708. showGuide() {
  22709. let guide = DataMgr.getSkillGuide();
  22710. this.ui.guideBtn.visible = guide == 0;
  22711. this.ui.enterGuide.visible = false;
  22712. this.ui.secretaryGuide.visible = guide == 0;
  22713. if (guide == 0) {
  22714. console.log("zh:显示引导");
  22715. xGame.soundMgr.playSound("s_guide");
  22716. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22717. }
  22718. else {
  22719. console.log("zh:不需要显示引导");
  22720. }
  22721. }
  22722. ensureSecretary() {
  22723. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  22724. this.ui.secretaryGuide.visible = false;
  22725. this.ui.enterGuide.visible = true;
  22726. this.ui.wordsNode.t0.play();
  22727. if (DataMgr.getNewUser())
  22728. Moyu.sendDataEvent("gameReady");
  22729. }
  22730. playSecretaryIdle() {
  22731. let parent = this.ui.secretary.displayObject;
  22732. parent.destroyChildren();
  22733. let xx = this.ui.secretary.width / 2;
  22734. let yy = this.ui.secretary.height;
  22735. let scale = xGame.common.getSecretaryScale();
  22736. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22737. console.log("zh:playSecretaryIdle", data);
  22738. xGame.common.secretary.play(data, 0, true, parent);
  22739. }
  22740. startGame(type) {
  22741. xGame.common.gameMode = type;
  22742. Moyu.sendDataEvent("PlayGame", { type: type });
  22743. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  22744. switch (xGame.common.gameMode) {
  22745. case GameMode.classic:
  22746. console.log('zh:进入经典模式111111111');
  22747. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  22748. let db_over_lev = DataMgr.getChallengeMode_overLev();
  22749. console.log('zh:classic db_over_lev=', db_over_lev);
  22750. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  22751. console.log('zh:判断是否可以玩该模式classic =NO');
  22752. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  22753. xGame.uiMgr.Show(UIMsg$1, tipStr);
  22754. return;
  22755. }
  22756. else {
  22757. console.log('zh:可以玩该模式classic 66666666666666');
  22758. this.beginGame();
  22759. }
  22760. }
  22761. else {
  22762. console.log('zh:不需要判断是否可以玩该classic');
  22763. let challengeTimes = DataMgr.getChallengeTimes();
  22764. if (challengeTimes == 0) {
  22765. xGame.uiMgr.Show(UIInvitation$1);
  22766. }
  22767. else {
  22768. this.beginGame();
  22769. }
  22770. break;
  22771. }
  22772. case GameMode.bigMove:
  22773. console.error('zh:bigMove check');
  22774. let guide = DataMgr.getSkillGuide();
  22775. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  22776. let db_over_lev = DataMgr.getChallengeMode_overLev();
  22777. console.log('zh:bigMove db_over_lev=', db_over_lev);
  22778. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  22779. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  22780. xGame.uiMgr.Show(UIMsg$1, tipStr);
  22781. return;
  22782. }
  22783. else {
  22784. console.log('zh:可以玩该模式 bigMove');
  22785. this.beginGame();
  22786. if (DataMgr.getNewUser())
  22787. Moyu.sendDataEvent("gameStart0");
  22788. }
  22789. }
  22790. else {
  22791. this.beginGame();
  22792. if (DataMgr.getNewUser())
  22793. Moyu.sendDataEvent("gameStart0");
  22794. }
  22795. break;
  22796. default:
  22797. console.error('zh:未知错误!!!!');
  22798. break;
  22799. }
  22800. }
  22801. beginGame(isNice = false) {
  22802. console.log('zh:beginGame ');
  22803. let guide = DataMgr.getSkillGuide();
  22804. if (guide == 1) {
  22805. console.log('zh:非新手引导,showInternAd ');
  22806. JSBridgeUtils.instance.showInternAd('beginGame');
  22807. }
  22808. else {
  22809. console.log('zh:新手引导,不显示AD ');
  22810. }
  22811. console.log('zh:beginGame 2 go');
  22812. if (xGame.common.gameMode == GameMode.classic) {
  22813. if (isNice) {
  22814. this.enterClassic();
  22815. }
  22816. else {
  22817. xGame.uiMgr.Show(UIModeSelection$1, () => {
  22818. console.log('zh:BBBBBBBBBBBBBBB');
  22819. this.enterClassic();
  22820. });
  22821. }
  22822. }
  22823. else if (xGame.common.gameMode == GameMode.bigMove) {
  22824. this.ui.enterGuide.visible = false;
  22825. xGame.uiMgr.Show(UISkill$1);
  22826. }
  22827. }
  22828. enterClassic() {
  22829. xGame.uiMgr.Show(UIGame$1);
  22830. xGame.uiMgr.Show(UIMatching$1, () => {
  22831. if (!this.isHide)
  22832. this.hide();
  22833. xGame.common.gameUI.ui.alpha = 1;
  22834. xGame.common.gameUI.startGame();
  22835. xGame.uiMgr.Hide(UIGameEnd$1);
  22836. });
  22837. }
  22838. startGlobal() {
  22839. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  22840. }
  22841. startWeekly() {
  22842. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  22843. }
  22844. zhouSaiMonth() {
  22845. console.log('zh: zhouSaiMonth 被调用');
  22846. }
  22847. startPlaceBall() {
  22848. xGame.uiMgr.Show(UILevelDisplay$1);
  22849. }
  22850. hide() {
  22851. console.log('zh:uimain hide ...');
  22852. super.hide();
  22853. xGame.common.stopGirlPop(this.ui.talkNode);
  22854. }
  22855. onGetUserInfo(force = false) {
  22856. if (Moyu.isWx) {
  22857. let info = Moyu.getSystemInfo();
  22858. if (info)
  22859. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  22860. }
  22861. else {
  22862. Moyu.initUser(this, this.freshUser, force);
  22863. }
  22864. this.freshUser();
  22865. }
  22866. freshUser() {
  22867. let user = Moyu.getUserInfo();
  22868. if (!user.isAuth) {
  22869. user.headIcon = 'res/ty_touxiang.png';
  22870. }
  22871. else {
  22872. DataMgr.upRankData();
  22873. }
  22874. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  22875. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  22876. let keyStr = keyForLoginInfo;
  22877. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22878. const d = LocalStorageManager.getItem(keyStr);
  22879. let ua = d.username;
  22880. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  22881. }
  22882. else {
  22883. }
  22884. this.c_btn_for_user();
  22885. }
  22886. interuptSecretary() {
  22887. Laya.timer.clearAll(this);
  22888. this.playSecretaryRandomSound();
  22889. }
  22890. playSecretaryRandomSound() {
  22891. if (this.isHide)
  22892. return;
  22893. let time = xGame.common.randomNum(45000, 60000);
  22894. Laya.timer.once(time, this, () => {
  22895. if (this.isHide)
  22896. return;
  22897. let index = xGame.common.randomNum(4, 7);
  22898. xGame.soundMgr.playSound("s_main0" + index);
  22899. let words = 1;
  22900. switch (index) {
  22901. case 4:
  22902. words = 5;
  22903. break;
  22904. case 5:
  22905. words = 3;
  22906. break;
  22907. case 6:
  22908. words = 6;
  22909. break;
  22910. case 7:
  22911. words = 7;
  22912. break;
  22913. default:
  22914. break;
  22915. }
  22916. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22917. this.playSecretaryRandomSound();
  22918. });
  22919. }
  22920. openSecretaryView() {
  22921. xGame.uiMgr.Show(UISecretary$1);
  22922. Moyu.sendDataEvent("secretary");
  22923. }
  22924. openShopView() {
  22925. xGame.uiMgr.Show(UIShop$1);
  22926. }
  22927. openSignView() {
  22928. xGame.uiMgr.Show(UISign$1);
  22929. }
  22930. openDrawView() {
  22931. xGame.uiMgr.Show(UIDraw$1);
  22932. }
  22933. openRanking() {
  22934. console.log('zh:phb openRanking');
  22935. xGame.uiMgr.Show(UIRanking$1);
  22936. Moyu.sendDataEvent("rankingList");
  22937. }
  22938. }
  22939. UIMain$1.uiName = "UIMain";
  22940. function InitShader() {
  22941. }
  22942. function appInit() {
  22943. xGame.context.init(getLoadingResList(), initCallback);
  22944. }
  22945. function getLoadingResList() {
  22946. return [
  22947. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  22948. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  22949. ];
  22950. }
  22951. function getGameResList() {
  22952. return [
  22953. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  22954. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  22955. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  22956. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  22957. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  22958. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  22959. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  22960. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  22961. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  22962. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  22963. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  22964. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  22965. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  22966. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  22967. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  22968. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  22969. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  22970. ];
  22971. }
  22972. function initCallback() {
  22973. window["DataMgr"] = DataMgr;
  22974. DataMgr.Init();
  22975. Moyu.init(getPlat(), this, () => {
  22976. DataMgr.isNewDay();
  22977. PlatMgr.initConfig();
  22978. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  22979. }, true);
  22980. console.log('zh:开始sm init1 start');
  22981. xGame.soundMgr.init();
  22982. console.log('zh:开始sm init1 end');
  22983. xGame.uiMgr.init();
  22984. xGame.uiMgr.clearTempData();
  22985. xGame.uiMgr.bindFUI(fguiRes.loading);
  22986. xGame.uiMgr.Show(UILoading);
  22987. }
  22988. function loadSubRes(callback) {
  22989. var tab = ["asset", "res", "spine"];
  22990. let subDone = 0;
  22991. for (var i = 0; i < tab.length; i++) {
  22992. let sub = tab[i];
  22993. Moyu.loadSubRes(sub, (pro) => {
  22994. callback && callback(pro, false);
  22995. }).then(() => {
  22996. subDone++;
  22997. if (subDone >= tab.length)
  22998. callback && callback(1, true);
  22999. });
  23000. }
  23001. }
  23002. function enterGame() {
  23003. xGame.cfgMgr.init();
  23004. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  23005. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  23006. xGame.uiMgr.Hide(UILoading);
  23007. fgui.UIPackage.removePackage(fguiRes.loading);
  23008. xGame.uiMgr.bindFUI(fguiRes.game);
  23009. xGame.uiMgr.Show(UIMain$1);
  23010. if (DataMgr.getNewUser())
  23011. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  23012. }
  23013. function getPlat() {
  23014. let cfg = new MoyuCfg();
  23015. cfg.plat = MoyuPlat.web;
  23016. cfg.myId = 180;
  23017. cfg.myKey = '8848a885774230a4';
  23018. cfg.version = 0;
  23019. if (window.hasOwnProperty("gamebox")) {
  23020. cfg.plat = MoyuPlat.f399;
  23021. cfg.version = 0;
  23022. }
  23023. else if (window.hasOwnProperty("ks")) {
  23024. cfg.plat = MoyuPlat.ks;
  23025. cfg.version = 0;
  23026. cfg.ads.ksVideoId = '2300002254_01';
  23027. cfg.ads.ksInsertId = '2300002254_02';
  23028. }
  23029. else if (Laya.Browser.onTTMiniGame) {
  23030. cfg.plat = MoyuPlat.tt;
  23031. cfg.version = 0;
  23032. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  23033. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  23034. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  23035. }
  23036. else if (Laya.Browser.onMiniGame) {
  23037. cfg.plat = MoyuPlat.wx;
  23038. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  23039. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  23040. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  23041. }
  23042. else if (Laya.Browser.onQQMiniGame) {
  23043. cfg.plat = MoyuPlat.qq;
  23044. }
  23045. else if (Laya.Browser.onQGMiniGame) {
  23046. cfg.plat = MoyuPlat.op;
  23047. cfg.ads.opVideoId = '455502';
  23048. cfg.ads.opBannerId = '455507';
  23049. }
  23050. else if (Laya.Browser.onVVMiniGame) {
  23051. cfg.plat = MoyuPlat.vv;
  23052. cfg.version = 0;
  23053. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  23054. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  23055. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  23056. }
  23057. else if (Laya.Browser.onHWMiniGame) {
  23058. cfg.plat = MoyuPlat.hw;
  23059. }
  23060. else if (window["mz"]) {
  23061. cfg.plat = MoyuPlat.mz;
  23062. }
  23063. else {
  23064. let cfg = window['conchConfig'];
  23065. if (cfg) {
  23066. var os = cfg.getOS();
  23067. if (os == "Conch-ios") {
  23068. cfg.plat = MoyuPlat.ios;
  23069. }
  23070. else if (os == "Conch-android") {
  23071. }
  23072. }
  23073. }
  23074. return cfg;
  23075. }
  23076. class Main {
  23077. constructor() {
  23078. if (window["Laya3D"])
  23079. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  23080. else {
  23081. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  23082. this.initMain();
  23083. }
  23084. }
  23085. initMain() {
  23086. Laya["Physics"] && Laya["Physics"].enable();
  23087. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  23088. Laya.stage.scaleMode = GameConfig.scaleMode;
  23089. Laya.stage.screenMode = GameConfig.screenMode;
  23090. Laya.stage.alignV = GameConfig.alignV;
  23091. Laya.stage.alignH = GameConfig.alignH;
  23092. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  23093. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  23094. Laya.enableDebugPanel();
  23095. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  23096. Laya["PhysicsDebugDraw"].enable();
  23097. if (GameConfig.stat)
  23098. Laya.Stat.show();
  23099. Laya.alertGlobalError(true);
  23100. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  23101. }
  23102. onVersionLoaded() {
  23103. appInit();
  23104. }
  23105. }
  23106. new Main();
  23107. }());
  23108. //# sourceMappingURL=bundle.js.map