bundle.js 434 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() { }
  5. static init() {
  6. var reg = Laya.ClassUtils.regClass;
  7. }
  8. }
  9. GameConfig.width = 720;
  10. GameConfig.height = 1280;
  11. GameConfig.scaleMode = "fixedwidth";
  12. GameConfig.screenMode = "none";
  13. GameConfig.alignV = "top";
  14. GameConfig.alignH = "left";
  15. GameConfig.startScene = "Window/TaskContentView.scene";
  16. GameConfig.sceneRoot = "";
  17. GameConfig.debug = false;
  18. GameConfig.stat = false;
  19. GameConfig.physicsDebug = false;
  20. GameConfig.exportSceneToJson = true;
  21. GameConfig.init();
  22. class rewarddata {
  23. constructor(_rewarditem) {
  24. this.rewarditem = _rewarditem;
  25. }
  26. }
  27. var systemtype;
  28. (function (systemtype) {
  29. systemtype[systemtype["ios"] = 0] = "ios";
  30. systemtype[systemtype["android"] = 1] = "android";
  31. systemtype[systemtype["other"] = 2] = "other";
  32. })(systemtype || (systemtype = {}));
  33. var ColliderLay;
  34. (function (ColliderLay) {
  35. ColliderLay[ColliderLay["plane"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER1] = "plane";
  36. ColliderLay[ColliderLay["obstacle"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER2] = "obstacle";
  37. ColliderLay[ColliderLay["monster"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER3] = "monster";
  38. ColliderLay[ColliderLay["bullet"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER4] = "bullet";
  39. ColliderLay[ColliderLay["end"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER5] = "end";
  40. ColliderLay[ColliderLay["grass"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER6] = "grass";
  41. ColliderLay[ColliderLay["player"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER7] = "player";
  42. })(ColliderLay || (ColliderLay = {}));
  43. var TouchState;
  44. (function (TouchState) {
  45. TouchState[TouchState["none"] = 0] = "none";
  46. TouchState[TouchState["down"] = 1] = "down";
  47. TouchState[TouchState["up"] = 2] = "up";
  48. TouchState[TouchState["slider"] = 3] = "slider";
  49. TouchState[TouchState["slidermove"] = 4] = "slidermove";
  50. })(TouchState || (TouchState = {}));
  51. var GameState;
  52. (function (GameState) {
  53. GameState[GameState["None"] = 0] = "None";
  54. GameState[GameState["Ready"] = 1] = "Ready";
  55. GameState[GameState["Idle"] = 2] = "Idle";
  56. GameState[GameState["Start"] = 3] = "Start";
  57. GameState[GameState["Playing"] = 4] = "Playing";
  58. GameState[GameState["Pause"] = 5] = "Pause";
  59. GameState[GameState["Resurrection"] = 6] = "Resurrection";
  60. GameState[GameState["Die"] = 7] = "Die";
  61. GameState[GameState["Lose"] = 8] = "Lose";
  62. GameState[GameState["Win"] = 9] = "Win";
  63. GameState[GameState["Over"] = 10] = "Over";
  64. })(GameState || (GameState = {}));
  65. var skintype;
  66. (function (skintype) {
  67. skintype[skintype["role"] = 1] = "role";
  68. skintype[skintype["weapon"] = 2] = "weapon";
  69. skintype[skintype["tw"] = 3] = "tw";
  70. })(skintype || (skintype = {}));
  71. var skinstate;
  72. (function (skinstate) {
  73. skinstate[skinstate["useing"] = 0] = "useing";
  74. skinstate[skinstate["lock"] = 1] = "lock";
  75. skinstate[skinstate["getnoues"] = 2] = "getnoues";
  76. })(skinstate || (skinstate = {}));
  77. var requiretype;
  78. (function (requiretype) {
  79. requiretype[requiretype["\u7CFB\u7EDF\u8D60\u9001"] = 1] = "\u7CFB\u7EDF\u8D60\u9001";
  80. requiretype[requiretype["\u91D1\u5E01\u8D2D\u4E70"] = 2] = "\u91D1\u5E01\u8D2D\u4E70";
  81. requiretype[requiretype["\u89C2\u770B\u89C6\u9891"] = 3] = "\u89C2\u770B\u89C6\u9891";
  82. requiretype[requiretype["\u5206\u4EAB"] = 4] = "\u5206\u4EAB";
  83. requiretype[requiretype["\u7B7E\u5230"] = 5] = "\u7B7E\u5230";
  84. requiretype[requiretype["\u6D3B\u52A8"] = 6] = "\u6D3B\u52A8";
  85. requiretype[requiretype["\u901A\u8FC7\u5173\u5361"] = 7] = "\u901A\u8FC7\u5173\u5361";
  86. requiretype[requiretype["\u7D2F\u8BA1\u767B\u9646"] = 8] = "\u7D2F\u8BA1\u767B\u9646";
  87. requiretype[requiretype["\u9080\u8BF7\u4EBA\u6570\u8FBE\u5230"] = 9] = "\u9080\u8BF7\u4EBA\u6570\u8FBE\u5230";
  88. requiretype[requiretype["\u7816\u77F3\u8D2D\u4E70"] = 10] = "\u7816\u77F3\u8D2D\u4E70";
  89. })(requiretype || (requiretype = {}));
  90. var AccountConfig;
  91. (function (AccountConfig) {
  92. AccountConfig[AccountConfig["crop"] = 0] = "crop";
  93. AccountConfig[AccountConfig["things"] = 1] = "things";
  94. AccountConfig[AccountConfig["land"] = 2] = "land";
  95. AccountConfig[AccountConfig["global"] = 3] = "global";
  96. AccountConfig[AccountConfig["enemy"] = 4] = "enemy";
  97. AccountConfig[AccountConfig["config"] = 5] = "config";
  98. AccountConfig[AccountConfig["entity"] = 6] = "entity";
  99. AccountConfig[AccountConfig["sign"] = 7] = "sign";
  100. AccountConfig[AccountConfig["rewards"] = 8] = "rewards";
  101. AccountConfig[AccountConfig["achievement"] = 9] = "achievement";
  102. AccountConfig[AccountConfig["invite"] = 10] = "invite";
  103. AccountConfig[AccountConfig["mission"] = 11] = "mission";
  104. AccountConfig[AccountConfig["roads"] = 12] = "roads";
  105. AccountConfig[AccountConfig["treasure_click"] = 13] = "treasure_click";
  106. AccountConfig[AccountConfig["theme"] = 14] = "theme";
  107. AccountConfig[AccountConfig["lottery"] = 15] = "lottery";
  108. AccountConfig[AccountConfig["exchange"] = 16] = "exchange";
  109. })(AccountConfig || (AccountConfig = {}));
  110. var AccountUser;
  111. (function (AccountUser) {
  112. AccountUser[AccountUser["money"] = 0] = "money";
  113. AccountUser[AccountUser["diamond"] = 1] = "diamond";
  114. AccountUser[AccountUser["user_id"] = 2] = "user_id";
  115. AccountUser[AccountUser["game_times"] = 3] = "game_times";
  116. AccountUser[AccountUser["get_themes"] = 4] = "get_themes";
  117. AccountUser[AccountUser["video_times"] = 5] = "video_times";
  118. AccountUser[AccountUser["equip_themes"] = 6] = "equip_themes";
  119. AccountUser[AccountUser["last_action_time"] = 7] = "last_action_time";
  120. AccountUser[AccountUser["last_favorite_time"] = 8] = "last_favorite_time";
  121. AccountUser[AccountUser["progress_themes"] = 9] = "progress_themes";
  122. AccountUser[AccountUser["revival"] = 10] = "revival";
  123. AccountUser[AccountUser["stage"] = 11] = "stage";
  124. })(AccountUser || (AccountUser = {}));
  125. var heroAttr;
  126. (function (heroAttr) {
  127. heroAttr[heroAttr["id"] = 0] = "id";
  128. heroAttr[heroAttr["name"] = 1] = "name";
  129. heroAttr[heroAttr["quality"] = 2] = "quality";
  130. heroAttr[heroAttr["icon"] = 3] = "icon";
  131. heroAttr[heroAttr["prefab"] = 4] = "prefab";
  132. heroAttr[heroAttr["require_num"] = 5] = "require_num";
  133. heroAttr[heroAttr["require_type"] = 6] = "require_type";
  134. })(heroAttr || (heroAttr = {}));
  135. var signdata;
  136. (function (signdata) {
  137. signdata[signdata["sign_days"] = 0] = "sign_days";
  138. signdata[signdata["sign_time"] = 1] = "sign_time";
  139. })(signdata || (signdata = {}));
  140. var entity;
  141. (function (entity) {
  142. entity[entity["id"] = 0] = "id";
  143. entity[entity["name"] = 1] = "name";
  144. entity[entity["entity_id"] = 2] = "entity_id";
  145. entity[entity["icon"] = 3] = "icon";
  146. })(entity || (entity = {}));
  147. var skinattr;
  148. (function (skinattr) {
  149. skinattr[skinattr["effectValue_1"] = 0] = "effectValue_1";
  150. skinattr[skinattr["effectValue_2"] = 1] = "effectValue_2";
  151. skinattr[skinattr["effectValue_3"] = 2] = "effectValue_3";
  152. skinattr[skinattr["effectValue_4"] = 3] = "effectValue_4";
  153. })(skinattr || (skinattr = {}));
  154. class TtSdk {
  155. constructor() {
  156. TtSdk.instance = this;
  157. console.log("new record");
  158. }
  159. static get Instance() {
  160. if (TtSdk.instance) {
  161. return TtSdk.instance;
  162. }
  163. else {
  164. var curmanager = new TtSdk();
  165. curmanager.OnNew();
  166. return curmanager;
  167. }
  168. }
  169. static InitVideo() {
  170. if (!Laya.Browser.window.conch)
  171. return;
  172. TtSdk.Conch = Laya.Browser.window.conch;
  173. TtSdk.PlatformClass = Laya.Browser.window["PlatformClass"];
  174. TtSdk.IsAndroid = TtSdk.Conch.config.getOS() == "Conch-android";
  175. if (TtSdk.IsAndroid) {
  176. TtSdk.JavaClassAdHelper = TtSdk.PlatformClass.createClass("com.meta.android.mpg.cm.MetaAd");
  177. console.log(11111111111111111);
  178. console.log(TtSdk.JavaClassAdHelper);
  179. TtSdk.MainActivity = TtSdk.PlatformClass.createClass("demo.MainActivity");
  180. console.log(2222222222222222);
  181. console.log(TtSdk.MainActivity);
  182. TtSdk.MainActivity.callWithBack((isback) => {
  183. TtSdk.Application = isback;
  184. console.log(333333333333333333);
  185. console.log(isback);
  186. }, "getApp");
  187. TtSdk.JavaClassAdHelper.callWithBack((isback) => {
  188. if (isback) {
  189. console.log("SDK初始化成功");
  190. }
  191. }, "init", TtSdk.Application, "1135231362");
  192. TtSdk.IsReady = true;
  193. }
  194. }
  195. static ShowVideo(_cb) {
  196. if (TtSdk.IsAndroid) {
  197. TtSdk.JavaClassAdHelper.callWithBack((isOk) => {
  198. _cb && _cb(isOk);
  199. console.log("SDK看视频成功");
  200. }, "showVideoAd", TtSdk.MainActivity);
  201. }
  202. }
  203. static Showbanner() {
  204. }
  205. static RecordEvent(_desc) {
  206. }
  207. static Clear() {
  208. }
  209. RecordStart() {
  210. if (!Laya.Browser.onMobile)
  211. return;
  212. }
  213. RecordStop() {
  214. }
  215. ShareVideo(cb = null) {
  216. }
  217. static Share(cb = null) {
  218. }
  219. OnNew() {
  220. }
  221. static CreateMoreGameBtn(_pos) {
  222. }
  223. static ShowLoading(title = "加载中...") {
  224. if (this.isShowing)
  225. return;
  226. this.isShowing = true;
  227. }
  228. static HideLoading() {
  229. this.isShowing = false;
  230. }
  231. static CheckWXUpdate() {
  232. }
  233. static shake() {
  234. }
  235. static shakeLong() {
  236. }
  237. static Shake(_short = true) {
  238. }
  239. static showToast(text) {
  240. }
  241. static get SystemFrom() {
  242. if (!Laya.Browser.onWeiXin)
  243. return systemtype.other;
  244. return systemtype.other;
  245. }
  246. static get IsLongScreenSystem() {
  247. if (!Laya.Browser.onWeiXin)
  248. return false;
  249. return false;
  250. }
  251. static SingletonList_expand() {
  252. console.log(Laya.SingletonList.prototype);
  253. Laya.SingletonList.prototype["_remove"] = function (index) {
  254. if (index == -1) {
  255. return;
  256. }
  257. this.length--;
  258. if (index !== this.length) {
  259. var end = this.elements[this.length];
  260. if (end) {
  261. this.elements[index] = end;
  262. end._setIndexInList(index);
  263. }
  264. }
  265. };
  266. var old_func = Laya.SimpleSingletonList.prototype["add"];
  267. Laya.SimpleSingletonList.prototype["add"] = function (element) {
  268. var index = element._getIndexInList();
  269. if (index !== -1) {
  270. return;
  271. }
  272. old_func.call(this, element);
  273. };
  274. }
  275. }
  276. TtSdk.videlAdUnitId = "5c4e6g4617991fkgl6";
  277. TtSdk.bannerAdUnitId = "3ss56gpelt55a7e456";
  278. TtSdk.firstVideo = true;
  279. TtSdk.IsReady = false;
  280. TtSdk.canshow = true;
  281. TtSdk.isShowing = false;
  282. TtSdk.CanShake = true;
  283. var Event = Laya.Event;
  284. var HttpRequest = Laya.HttpRequest;
  285. const PROTOCOL_URL = "https://samuraitoutiaoapi.xwxgame.com/";
  286. class PROTOCOLS {
  287. }
  288. PROTOCOLS.Login = "user/login";
  289. PROTOCOLS.game = "game/start";
  290. PROTOCOLS.end = "game/play";
  291. PROTOCOLS.Sign = "sign/sign";
  292. PROTOCOLS.SignAhead = "sign/ahead";
  293. PROTOCOLS.entertreasure = "treasure/enter";
  294. PROTOCOLS.opentreasure = "treasure/open";
  295. PROTOCOLS.Buy = "theme/buy";
  296. PROTOCOLS.Equip = "theme/equip";
  297. PROTOCOLS.share = "fission/share";
  298. PROTOCOLS.vd = "fission/vd";
  299. PROTOCOLS.revival = "game/revival";
  300. PROTOCOLS.fission = "theme/fission";
  301. PROTOCOLS.themefission = "theme/fission";
  302. PROTOCOLS.treasure = "treasure/click";
  303. PROTOCOLS.Config = "config/table";
  304. PROTOCOLS.Lottery = "lottery/lottery";
  305. PROTOCOLS.GetAchieve = "achievement/getRewards";
  306. class NetworkManager {
  307. static get Instance() {
  308. if (NetworkManager.instance) {
  309. return NetworkManager.instance;
  310. }
  311. else {
  312. return new NetworkManager();
  313. }
  314. }
  315. constructor() {
  316. NetworkManager.instance = this;
  317. }
  318. login(progresscb, completecb, errorcb) {
  319. var userInfor = PlayerAccount.CurrentAccount;
  320. let args = `code=${userInfor.Code}&nickname=${userInfor.NickName}&avatar=${userInfor.Avatar}&gender=${userInfor.Gender}&country=${userInfor.Country}&province=${userInfor.Province}&city=${userInfor.City}& device=${userInfor.Device}$&share_id=${userInfor.ShareId}&scene=${userInfor.Scene}&v=${userInfor.ver}`;
  321. let httpRequest = new HttpRequest();
  322. httpRequest.once(Event.PROGRESS, this, this.onHttpRequestProgress, [progresscb, httpRequest]);
  323. httpRequest.once(Event.COMPLETE, this, this.onLoginRequestComplete, [completecb, httpRequest]);
  324. httpRequest.once(Event.ERROR, this, this.onHttpRequestError, [errorcb, httpRequest]);
  325. httpRequest.send(PROTOCOL_URL + PROTOCOLS.Login, args, "post", "text");
  326. }
  327. onHttpRequestProgress(progresscb, httpRequest) {
  328. if (progresscb) {
  329. console.log("HttpRequestProgress:...");
  330. progresscb.run();
  331. }
  332. }
  333. onLoginRequestComplete(completecb, httpRequest) {
  334. let data = JSON.parse(httpRequest.data);
  335. if (data["code"] != "0") {
  336. console.log("登录异常错误!错误信息:", httpRequest.data);
  337. console.log("登录异常错误!错误信息:= " + data["code"], "httpRequest.dat");
  338. return;
  339. }
  340. PlayerAccount.ServerTime = data["t"];
  341. console.log("登录正式成功");
  342. PlayerAccount.CurrentAccount.SetAccountData(data, completecb);
  343. }
  344. onHttpRequestError(errorcb, httpRequest) {
  345. if (errorcb != null) {
  346. errorcb.runWith(httpRequest);
  347. }
  348. console.log("Error! Http request error.. ", "httpRequest.dat");
  349. TtSdk.ShowLoading("连接网络失败...");
  350. Laya.timer.once(8000, this, () => { TtSdk.HideLoading(); });
  351. console.log("Error! Http request error..." + httpRequest.data);
  352. }
  353. HttpPostRequest(protocol, param, completecb, errorcb, hasToken = true) {
  354. let args = "";
  355. let url = PROTOCOL_URL + protocol;
  356. var accountdata = PlayerAccount.CurAccountData;
  357. if (hasToken == true) {
  358. args = `token=${accountdata.m_token}&`;
  359. }
  360. TtSdk.ShowLoading("连接网络中...");
  361. if (protocol == PROTOCOLS.game || protocol == PROTOCOLS.end || protocol == PROTOCOLS.fission || protocol == PROTOCOLS.vd
  362. || protocol == PROTOCOLS.themefission || protocol == PROTOCOLS.Lottery || protocol == PROTOCOLS.opentreasure) {
  363. let str = "abcdefghijkimnopqrstuvwxyz0123456789";
  364. let code = "{";
  365. let mask = "";
  366. for (let i = 0; i < 4; i++) {
  367. mask += str[Math.floor(Math.random() * 100) % str.length];
  368. }
  369. for (let i = 0; i < param.length; i++) {
  370. for (let key in param[i]) {
  371. code += `\"${key}\":\"${param[i][key]}\"`;
  372. }
  373. if (i < param.length - 1) {
  374. code += ",";
  375. }
  376. else {
  377. code += "}";
  378. }
  379. }
  380. args += "_r=" + mask + this.base64Encode(code);
  381. }
  382. else {
  383. if (param != null) {
  384. for (let i = 0; i < param.length; i++) {
  385. for (let key in param[i]) {
  386. let val = param[i][key];
  387. args += `${key}=${val}`;
  388. if (i < param.length - 1) {
  389. args += "&";
  390. }
  391. }
  392. }
  393. }
  394. }
  395. let httpRequest = new HttpRequest();
  396. httpRequest.once(Event.COMPLETE, this, this.onHttpRequestComplete, [completecb, errorcb, httpRequest]);
  397. httpRequest.once(Event.ERROR, this, this.onHttpRequestError, [errorcb, httpRequest]);
  398. httpRequest.send(url, args, "post", "text");
  399. }
  400. onHttpRequestComplete(succeedcb, failurecb, httpRequest) {
  401. TtSdk.HideLoading();
  402. let data = JSON.parse(httpRequest.data);
  403. if (data["code"] == 0) {
  404. PlayerAccount.CurrentAccount.SetAccountData(data, null);
  405. if (succeedcb != null) {
  406. succeedcb.runWith(data);
  407. }
  408. }
  409. else {
  410. if (failurecb != null) {
  411. failurecb.runWith(data);
  412. }
  413. console.log("Error! Http request complete error, code: " + data["code"] + " message: " + data["message"]);
  414. }
  415. }
  416. base64Encode(str) {
  417. var c1, c2, c3;
  418. var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  419. var i = 0, len = str.length, string = '';
  420. while (i < len) {
  421. c1 = str.charCodeAt(i++) & 0xff;
  422. if (i == len) {
  423. string += base64EncodeChars.charAt(c1 >> 2);
  424. string += base64EncodeChars.charAt((c1 & 0x3) << 4);
  425. string += "==";
  426. break;
  427. }
  428. c2 = str.charCodeAt(i++);
  429. if (i == len) {
  430. string += base64EncodeChars.charAt(c1 >> 2);
  431. string += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
  432. string += base64EncodeChars.charAt((c2 & 0xF) << 2);
  433. string += "=";
  434. break;
  435. }
  436. c3 = str.charCodeAt(i++);
  437. string += base64EncodeChars.charAt(c1 >> 2);
  438. string += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
  439. string += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
  440. string += base64EncodeChars.charAt(c3 & 0x3F);
  441. }
  442. return string;
  443. }
  444. }
  445. class Dictionary {
  446. constructor() {
  447. this.keys = new Array();
  448. this.values = new Array();
  449. }
  450. get count() {
  451. return this.keys.length;
  452. }
  453. add(key, value) {
  454. let index = this.keys.indexOf(key);
  455. if (index == -1) {
  456. this.keys.push(key);
  457. this.values.push(value);
  458. }
  459. else {
  460. this.values[index] = value;
  461. }
  462. }
  463. remove(key) {
  464. let index = this.keys.indexOf(key);
  465. if (index != -1) {
  466. this.keys.splice(index, 1);
  467. this.values.splice(index, 1);
  468. }
  469. }
  470. getValue(key) {
  471. let index = this.keys.indexOf(key);
  472. if (index != -1) {
  473. return this.values[index];
  474. }
  475. return null;
  476. }
  477. containKey(key) {
  478. let index = this.keys.indexOf(key);
  479. if (index != -1) {
  480. return true;
  481. }
  482. return false;
  483. }
  484. containValue(value) {
  485. let index = this.values.indexOf(value);
  486. if (index != -1) {
  487. return true;
  488. }
  489. return false;
  490. }
  491. clear() {
  492. this.keys.length = 0;
  493. this.values.length = 0;
  494. }
  495. }
  496. var EventType;
  497. (function (EventType) {
  498. EventType[EventType["EnterGame"] = 0] = "EnterGame";
  499. EventType[EventType["GameIdle"] = 1] = "GameIdle";
  500. EventType[EventType["GetAd"] = 2] = "GetAd";
  501. EventType[EventType["DrawEnd"] = 3] = "DrawEnd";
  502. EventType[EventType["LevelCreateComplete"] = 4] = "LevelCreateComplete";
  503. EventType[EventType["InputState"] = 5] = "InputState";
  504. EventType[EventType["getmoney"] = 6] = "getmoney";
  505. EventType[EventType["UseSkin"] = 7] = "UseSkin";
  506. EventType[EventType["Cut"] = 8] = "Cut";
  507. EventType[EventType["Chui"] = 9] = "Chui";
  508. EventType[EventType["Running"] = 10] = "Running";
  509. EventType[EventType["Hit"] = 11] = "Hit";
  510. EventType[EventType["TriggerGold"] = 12] = "TriggerGold";
  511. EventType[EventType["SortPrecent"] = 13] = "SortPrecent";
  512. EventType[EventType["BoosDie"] = 14] = "BoosDie";
  513. })(EventType || (EventType = {}));
  514. class EventManager {
  515. static On(_mode, caller, fun, args = []) {
  516. EventManager.curdispather.on(EventType[_mode], caller, fun, args);
  517. }
  518. static Off(_mode, caller, fun, args = []) {
  519. EventManager.curdispather.off(EventType[_mode], caller, fun);
  520. }
  521. static Trigger(_mode, args = []) {
  522. EventManager.curdispather.event(EventType[_mode], args);
  523. }
  524. static GameOn(_mode, caller, fun, args = []) {
  525. EventManager.curdispather.on(GameState[_mode], caller, fun, args);
  526. }
  527. static GameOff(_mode, caller, fun, args = []) {
  528. EventManager.curdispather.off(GameState[_mode], caller, fun);
  529. }
  530. static GameTrigger(_mode, args = []) {
  531. EventManager.curdispather.event(GameState[_mode], args);
  532. }
  533. static InputOn(_mode, caller, fun, args = []) {
  534. EventManager.curdispather.on(TouchState[_mode], caller, fun, args);
  535. }
  536. static InputOff(_mode, caller, fun, args = []) {
  537. EventManager.curdispather.off(TouchState[_mode], caller, fun);
  538. }
  539. static InputTrigger(_mode, args = []) {
  540. EventManager.curdispather.event(TouchState[_mode], args);
  541. }
  542. }
  543. EventManager.curdispather = new Laya.EventDispatcher();
  544. var Sprite3D = Laya.Sprite3D;
  545. class PoolManager {
  546. constructor() {
  547. PoolManager.PoolManagerInstance = this;
  548. EventManager.On(EventType.LevelCreateComplete, this, PoolManager.ClearPool);
  549. }
  550. static get Instance() {
  551. if (PoolManager.PoolManagerInstance) {
  552. return PoolManager.PoolManagerInstance;
  553. }
  554. else {
  555. var instance = new PoolManager();
  556. return instance;
  557. }
  558. }
  559. static GetSprite3D(_obj) {
  560. var objName = _obj.name;
  561. if (this.Sprite3DDic[objName] != null && this.Sprite3DDic[objName] != undefined) {
  562. if (this.Sprite3DDic[objName].length > 0) {
  563. var obj = this.Sprite3DDic[objName][0];
  564. if (!obj || obj.destroyed)
  565. obj = Sprite3D.instantiate(_obj);
  566. this.Sprite3DDic[objName].splice(0, 1);
  567. obj.transform.position = _obj.transform.position.clone();
  568. obj.transform.rotation = _obj.transform.rotation.clone();
  569. obj.transform.setWorldLossyScale(_obj.transform.getWorldLossyScale());
  570. obj.active = true;
  571. return obj;
  572. }
  573. else {
  574. var newobj = Sprite3D.instantiate(_obj);
  575. newobj.active = true;
  576. return newobj;
  577. }
  578. }
  579. else {
  580. var newobj = Sprite3D.instantiate(_obj);
  581. newobj.active = true;
  582. return newobj;
  583. }
  584. }
  585. static RecoverSprite3D(_obj, _active = false) {
  586. if (!_obj) {
  587. console.warn("PoolManager Recover Error!", null);
  588. return;
  589. }
  590. if (_obj.destroyed) {
  591. console.warn("PoolManager Recover Error!", "destroyed");
  592. return;
  593. }
  594. if (!_active && _obj.active == false) {
  595. console.warn("PoolManager Recover Error!", _obj.name);
  596. return;
  597. }
  598. var objName = _obj.name;
  599. if (this.Sprite3DDic[objName] != null && this.Sprite3DDic[objName] != undefined) {
  600. var array = this.Sprite3DDic[objName];
  601. if (array.length > this.PoolSize) {
  602. _obj.destroy();
  603. return;
  604. }
  605. else {
  606. array.push(_obj);
  607. }
  608. }
  609. else {
  610. array = [];
  611. array.push(_obj);
  612. this.Sprite3DDic[objName] = array;
  613. }
  614. _obj.transform.position = new Laya.Vector3(0, 0, -100);
  615. _obj.removeSelf();
  616. _obj.active = false;
  617. }
  618. static ClearPool() {
  619. for (var key in this.Sprite3DDic) {
  620. var objs = this.Sprite3DDic[key];
  621. for (var i = 0; i < objs.length; i++) {
  622. objs[i].destroy();
  623. }
  624. }
  625. this.Sprite3DDic = {};
  626. }
  627. }
  628. PoolManager.PoolSize = 80;
  629. PoolManager.Sprite3DDic = {};
  630. var Vector3 = Laya.Vector3;
  631. var RoleState;
  632. (function (RoleState) {
  633. RoleState[RoleState["None"] = 0] = "None";
  634. RoleState[RoleState["Idle"] = 1] = "Idle";
  635. RoleState[RoleState["Runing"] = 2] = "Runing";
  636. RoleState[RoleState["Awake"] = 3] = "Awake";
  637. RoleState[RoleState["Die"] = 4] = "Die";
  638. RoleState[RoleState["Attack"] = 5] = "Attack";
  639. RoleState[RoleState["Escape"] = 6] = "Escape";
  640. RoleState[RoleState["Win"] = 7] = "Win";
  641. RoleState[RoleState["Wait"] = 8] = "Wait";
  642. })(RoleState || (RoleState = {}));
  643. class RoleData {
  644. constructor(_id, _startpos) {
  645. this.id = _id;
  646. this.startpos = _startpos;
  647. }
  648. }
  649. class Role extends Laya.Script3D {
  650. constructor() {
  651. super(...arguments);
  652. this.startpos = new Vector3();
  653. this.end = false;
  654. this.clear = false;
  655. this.die = false;
  656. this.wudi = false;
  657. }
  658. static Create(_data, arge = null) {
  659. return null;
  660. }
  661. Init(_sprite) {
  662. this.cursprite = _sprite;
  663. this.curanimator = _sprite.getChildAt(0).getComponent(Laya.Animator);
  664. this.curanimator.enabled = true;
  665. this.ChangeState(RoleState.Idle);
  666. this.startpos = this.cursprite.transform.position.clone();
  667. this.clear = false;
  668. this.end = false;
  669. EventManager.GameOn(GameState.Win, this, this.OnGameEnd);
  670. EventManager.GameOn(GameState.Lose, this, this.OnGameEnd);
  671. EventManager.GameOn(GameState.Playing, this, this.OnGamePlaying);
  672. }
  673. OnGameEnd() {
  674. this.ChangeState(RoleState.Idle);
  675. }
  676. OnGamePlaying() {
  677. this.ChangeState(RoleState.Idle);
  678. this.end = false;
  679. this.WithPlaying();
  680. }
  681. WithPlaying() { }
  682. ;
  683. Clear() {
  684. if (this.clear)
  685. return;
  686. this.clear = true;
  687. EventManager.GameOff(GameState.Win, this, this.OnGameEnd);
  688. EventManager.GameOff(GameState.Lose, this, this.OnGameEnd);
  689. EventManager.GameOff(GameState.Playing, this, this.OnGamePlaying);
  690. PoolManager.RecoverSprite3D(this.cursprite, true);
  691. this.OnClear();
  692. this.destroy();
  693. }
  694. ChangeState(_state, args = null) {
  695. if (_state == RoleState.Die && this.wudi)
  696. return;
  697. if (this.end)
  698. return;
  699. if (this.currolestate == _state)
  700. return;
  701. if (this.currolestate == RoleState.Die && args == null)
  702. return;
  703. if (this.currolestate == RoleState.Win)
  704. return;
  705. this.currolestate = _state;
  706. this.onStateChange(this.currolestate, args);
  707. }
  708. OnClear() { }
  709. ;
  710. onStateChange(_state, _data) { }
  711. ;
  712. FallLand(_minhight, cb = null) {
  713. this.die = true;
  714. if (this.cursprite.transform.position.y > _minhight) {
  715. var mpos = this.cursprite.transform.position.clone();
  716. var targetpos = new Vector3(mpos.x, _minhight, mpos.z);
  717. GameUtils.TweenMove(this.cursprite.transform, targetpos, 1.5, Laya.Handler.create(this, () => {
  718. if (cb)
  719. cb();
  720. }), Laya.Ease.quadOut);
  721. }
  722. }
  723. BeBoom() { }
  724. ;
  725. Provocation(_complete = null) {
  726. if (this.provocationclip != null) {
  727. this.curanimator.play(this.provocationclip);
  728. Laya.timer.once(2000, this, () => {
  729. if (_complete)
  730. _complete();
  731. this.ChangeState(RoleState.Idle);
  732. });
  733. }
  734. }
  735. }
  736. var Vector3$1 = Laya.Vector3;
  737. var buildtype;
  738. (function (buildtype) {
  739. buildtype[buildtype["barrier"] = 0] = "barrier";
  740. buildtype[buildtype["stand"] = 1] = "stand";
  741. buildtype[buildtype["road"] = 2] = "road";
  742. })(buildtype || (buildtype = {}));
  743. class builddata {
  744. constructor(_type, _id, _pos) {
  745. this.type = _type;
  746. this.buildid = _id;
  747. this.startpos = new Vector3$1(_pos.x, _pos.y, _pos.z);
  748. this.starteroty = _pos.w;
  749. }
  750. }
  751. class Building {
  752. constructor() {
  753. this.die = false;
  754. this.clear = false;
  755. }
  756. Init(_data) {
  757. this.mdata = _data;
  758. var buildasset = AssetManager.BuildAsset(this.mdata.type, _data.buildid);
  759. this.cursprite = PoolManager.GetSprite3D(buildasset);
  760. }
  761. OnInit() { }
  762. ;
  763. OnClear() { }
  764. ;
  765. Clear() {
  766. if (this.clear)
  767. return;
  768. this.clear = true;
  769. this.OnClear();
  770. this.cursprite.destroy();
  771. }
  772. }
  773. class AssetPath {
  774. }
  775. AssetPath.mainscene = "subpackage/res/mainscene/Conventional/mainscene.ls";
  776. AssetPath.prefab = [
  777. "subpackage/res/prefab/Conventional/role.lh",
  778. "subpackage/res/prefab/Conventional/girl.lh",
  779. "subpackage/res/prefab/Conventional/enemy.lh",
  780. "subpackage/res/prefab/Conventional/obstacle.lh",
  781. "subpackage/res/prefab/Conventional/bullet.lh",
  782. "subpackage/res/prefab/Conventional/effect.lh",
  783. "subpackage/res/prefab/Conventional/stand.lh",
  784. "subpackage/res/prefab/Conventional/road.lh",
  785. "subpackage/res/prefab/Conventional/weapon.lh",
  786. "subpackage/res/prefab/Conventional/tw.lh",
  787. "subpackage/res/prefab/Conventional/hand.lh",
  788. ];
  789. class AssetManager {
  790. constructor() {
  791. AssetManager.instance = this;
  792. }
  793. static get Instance() {
  794. if (AssetManager.instance) {
  795. return AssetManager.instance;
  796. }
  797. else {
  798. return new AssetManager();
  799. }
  800. }
  801. static BuildAsset(_type, _id) {
  802. if (_type == buildtype.barrier) {
  803. return this.obstacle.getValue(_id);
  804. }
  805. else if (_type == buildtype.stand) {
  806. return this.standbuild.getValue(_id);
  807. }
  808. return null;
  809. }
  810. }
  811. AssetManager.role = new Dictionary();
  812. AssetManager.girl = new Dictionary();
  813. AssetManager.enemy = new Dictionary();
  814. AssetManager.obstacle = new Dictionary();
  815. AssetManager.bullet = new Dictionary();
  816. AssetManager.effect = new Dictionary();
  817. AssetManager.standbuild = new Dictionary();
  818. AssetManager.road = new Dictionary();
  819. AssetManager.weapon = new Dictionary();
  820. AssetManager.tw = new Dictionary();
  821. var Vector3$2 = Laya.Vector3;
  822. class BezierCurve {
  823. constructor(pts) {
  824. this.pts = new Array();
  825. this.add_0 = new Vector3$2();
  826. this.add_1 = new Vector3$2();
  827. this.add_2 = new Vector3$2();
  828. this.end = new Vector3$2();
  829. this.step0_0 = new Vector3$2();
  830. this.step0_1 = new Vector3$2();
  831. this.step0_2 = new Vector3$2();
  832. this.step0 = new Vector3$2();
  833. this.step1_0 = new Vector3$2();
  834. this.step1_1 = new Vector3$2();
  835. this.step1_2 = new Vector3$2();
  836. this.step1 = new Vector3$2();
  837. this.step2_0 = new Vector3$2();
  838. this.step2 = new Vector3$2();
  839. for (var i = 0; i < pts.length; i++) {
  840. this.pts.push(pts[i].clone());
  841. }
  842. }
  843. get CurrPtr() {
  844. return this.currPtr;
  845. }
  846. get PathLength() {
  847. var le = 0;
  848. for (var i = 0; i < this.pts.length - 1; i++) {
  849. var dis = Vector3$2.distance(this.pts[i], this.pts[i + 1]);
  850. le += dis;
  851. }
  852. return le;
  853. }
  854. Interp(t) {
  855. let numSections = this.pts.length - 3;
  856. this.currPtr = Math.min(Math.floor(t * numSections), numSections - 1);
  857. let u = t * numSections - this.currPtr;
  858. let a = this.pts[this.currPtr];
  859. let b = this.pts[this.currPtr + 1];
  860. let c = this.pts[this.currPtr + 2];
  861. let d = this.pts[this.currPtr + 3];
  862. if (a == null || b == null || c == null || d == null) {
  863. return;
  864. }
  865. let uu = u * u;
  866. let uuu = uu * u;
  867. let b3 = GameUtils.ScaleVector3(b, 3);
  868. let c3 = GameUtils.ScaleVector3(c, 3);
  869. let a2 = GameUtils.ScaleVector3(a, 2);
  870. let b5 = GameUtils.ScaleVector3(b, 5);
  871. let c4 = GameUtils.ScaleVector3(c, 4);
  872. let b2 = GameUtils.ScaleVector3(b, 2);
  873. Vector3$2.subtract(b3, a, this.step0_0);
  874. Vector3$2.subtract(this.step0_0, c3, this.step0_1);
  875. Vector3$2.add(this.step0_1, d, this.step0_2);
  876. this.step0 = GameUtils.ScaleVector3(this.step0_2, uuu);
  877. Vector3$2.subtract(a2, b5, this.step1_0);
  878. Vector3$2.add(this.step1_0, c4, this.step1_1);
  879. Vector3$2.subtract(this.step1_1, d, this.step1_2);
  880. this.step1 = GameUtils.ScaleVector3(this.step1_2, uu);
  881. Vector3$2.subtract(c, a, this.step2_0);
  882. this.step2 = GameUtils.ScaleVector3(this.step2_0, u);
  883. Vector3$2.add(this.step0, this.step1, this.add_0);
  884. Vector3$2.add(this.add_0, this.step2, this.add_1);
  885. Vector3$2.add(this.add_1, b2, this.add_2);
  886. this.end = GameUtils.ScaleVector3(this.add_2, 0.5);
  887. return this.end;
  888. }
  889. }
  890. var REG = Laya.ClassUtils.regClass;
  891. var ui;
  892. (function (ui) {
  893. var Window;
  894. (function (Window) {
  895. class BaoXiangWindowUI extends Laya.Scene {
  896. constructor() { super(); }
  897. createChildren() {
  898. super.createChildren();
  899. this.createView(BaoXiangWindowUI.uiView);
  900. }
  901. }
  902. BaoXiangWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "visible": false, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 720, "var": "bg", "top": 0, "skin": "game/task4.png", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 12 }, { "type": "Box", "props": { "y": 186, "x": 0, "width": 720, "var": "pan", "height": 664 }, "compId": 3, "child": [{ "type": "Image", "props": { "y": 182, "x": 176, "visible": false, "var": "firstbg", "skin": "bg/-4(1).png" }, "compId": 15 }, { "type": "Image", "props": { "y": 82, "x": 146, "skin": "game/-1(1).png" }, "compId": 14 }, { "type": "Image", "props": { "y": 359, "x": 359, "width": 281, "skin": "game/huode-1-4.png", "height": 281, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 6 }, { "type": "Image", "props": { "y": 358, "x": 360, "var": "icon", "skin": "icon/skin1.png", "scaleY": 1.8, "scaleX": 1.8, "rotation": 0, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 7 }, { "type": "Text", "props": { "y": 520, "x": 241, "width": 237, "visible": true, "var": "skindesc", "valign": "middle", "text": "获得奖励", "height": 50, "fontSize": 40, "font": "SimSun", "color": "#f6f636", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 13 }] }, { "type": "Box", "props": { "y": 788, "x": 0, "width": 720, "var": "Btn", "height": 172 }, "compId": 4, "child": [{ "type": "Button", "props": { "y": 66, "x": 360, "width": 364, "var": "getbtn", "stateNum": 1, "skin": "cheatwindow/3 - 1.png", "pivotY": 66, "pivotX": 182, "height": 131 }, "compId": 9, "child": [{ "type": "Text", "props": { "y": 27, "x": 105, "width": 229, "var": "gettex", "valign": "middle", "text": "开启宝箱", "height": 77, "fontSize": 55, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 11 }] }, { "type": "Button", "props": { "y": 72, "x": 314, "var": "passbtn", "stateNum": 1, "skin": "game/fuhuo-1-3.png", "bottom": 0 }, "compId": 10 }] }], "animations": [{ "nodes": [{ "target": 6, "keyframes": { "rotation": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "rotation", "index": 0 }, { "value": 45, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "rotation", "index": 5 }, { "value": 90, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "rotation", "index": 10 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 2 }], "loadList": ["game/task4.png", "bg/-4(1).png", "game/-1(1).png", "game/huode-1-4.png", "icon/skin1.png", "cheatwindow/3 - 1.png", "game/fuhuo-1-3.png"], "loadList3D": [] };
  903. Window.BaoXiangWindowUI = BaoXiangWindowUI;
  904. REG("ui.Window.BaoXiangWindowUI", BaoXiangWindowUI);
  905. class CDKViewUI extends Laya.Scene {
  906. constructor() { super(); }
  907. createChildren() {
  908. super.createChildren();
  909. this.createView(CDKViewUI.uiView);
  910. }
  911. }
  912. CDKViewUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "game/zhezhao.png", "name": "bg", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 3 }, { "type": "Box", "props": { "y": 386, "x": 0, "width": 720, "var": "pan", "height": 508 }, "compId": 4, "child": [{ "type": "Image", "props": { "x": 86, "top": 0, "skin": "bg/cdk3.png" }, "compId": 5, "child": [{ "type": "TextInput", "props": { "y": 181, "x": 90, "width": 366, "var": "inputtext", "valign": "middle", "type": "number", "text": "123456", "skin": "bg/cdk4.png", "prompt": "请输入兑换码", "maxChars": 10, "height": 63, "fontSize": 30, "align": "center" }, "compId": 7 }] }, { "type": "Button", "props": { "y": 14, "x": 580, "var": "closebtn", "stateNum": 1, "skin": "game/cdk6.png" }, "compId": 8 }, { "type": "Button", "props": { "x": 112, "var": "backbtn", "stateNum": 1, "skin": "game/cdk1.png", "bottom": 0 }, "compId": 9 }, { "type": "Button", "props": { "x": 386, "var": "getbtn", "stateNum": 1, "skin": "game/cdk2.png", "bottom": 0 }, "compId": 10 }] }], "loadList": ["game/zhezhao.png", "bg/cdk3.png", "bg/cdk4.png", "game/cdk6.png", "game/cdk1.png", "game/cdk2.png"], "loadList3D": [] };
  913. Window.CDKViewUI = CDKViewUI;
  914. REG("ui.Window.CDKViewUI", CDKViewUI);
  915. class CheatWindowUI extends Laya.Scene {
  916. constructor() { super(); }
  917. createChildren() {
  918. super.createChildren();
  919. this.createView(CheatWindowUI.uiView);
  920. }
  921. }
  922. CheatWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "var": "bg", "top": 0, "skin": "game/zhezhao.png", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 3 }, { "type": "Box", "props": { "y": 640, "x": 360, "width": 720, "var": "pan", "height": 700, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 4, "child": [{ "type": "Image", "props": { "y": 0, "x": 158, "var": "tippan", "skin": "cheatwindow/2.png" }, "compId": 5 }, { "type": "Image", "props": { "y": 294, "x": 360, "width": 181, "skin": "cheatwindow/kuangdiankaixiang-1-3.png", "pivotY": 89, "pivotX": 91, "height": 177 }, "compId": 6 }] }, { "type": "Box", "props": { "y": 814, "x": 0, "width": 720, "var": "Btn", "height": 155 }, "compId": 8, "child": [{ "type": "Button", "props": { "y": 52, "x": 360, "var": "clickbtn", "stateNum": 1, "skin": "cheatwindow/3.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 9 }, { "type": "Button", "props": { "x": 312, "var": "passbtn", "stateNum": 1, "skin": "cheatwindow/4.png", "bottom": 0 }, "compId": 11 }] }], "animations": [{ "nodes": [{ "target": 4, "keyframes": { "scaleY": [{ "value": 0.4, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "scaleY", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "scaleY", "index": 10 }], "scaleX": [{ "value": 0.4, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "scaleX", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "scaleX", "index": 10 }] } }, { "target": 8, "keyframes": { "visible": [{ "value": false, "tweenMethod": "linearNone", "tween": false, "target": 8, "key": "visible", "index": 0 }, { "value": true, "tweenMethod": "linearNone", "tween": false, "target": 8, "key": "visible", "index": 10 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 0 }, { "nodes": [{ "target": 6, "keyframes": { "scaleY": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "scaleY", "index": 0 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "scaleY", "index": 3 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "scaleY", "index": 5 }], "scaleX": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "scaleX", "index": 0 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "scaleX", "index": 3 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "scaleX", "index": 5 }] } }], "name": "ani2", "id": 2, "frameRate": 24, "action": 0 }], "loadList": ["game/zhezhao.png", "cheatwindow/2.png", "cheatwindow/kuangdiankaixiang-1-3.png", "cheatwindow/3.png", "cheatwindow/4.png"], "loadList3D": [] };
  923. Window.CheatWindowUI = CheatWindowUI;
  924. REG("ui.Window.CheatWindowUI", CheatWindowUI);
  925. class ChestWindowUI extends Laya.Scene {
  926. constructor() { super(); }
  927. createChildren() {
  928. super.createChildren();
  929. this.createView(ChestWindowUI.uiView);
  930. }
  931. }
  932. ChestWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "game/pifu-1-13.png", "name": "bg", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 3 }, { "type": "Button", "props": { "y": 78, "x": 38, "var": "homebtn", "stateNum": 1, "skin": "game/pifu-1-1.png" }, "compId": 4 }, { "type": "Box", "props": { "y": 203, "x": 0, "width": 720, "var": "chestpan", "height": 950 }, "compId": 26, "child": [{ "type": "Image", "props": { "y": 147, "x": 37, "width": 645, "skin": "game/dalandi.png", "height": 655, "sizeGrid": "65,65,65,65" }, "compId": 30, "child": [{ "type": "List", "props": { "y": 28, "x": 26, "width": 592, "var": "chestlist", "spaceY": 25, "spaceX": 25, "height": 599 }, "compId": 5, "child": [{ "type": "Box", "props": { "width": 180, "renderType": "render", "height": 180 }, "compId": 7, "child": [{ "type": "Image", "props": { "width": 180, "skin": "game/xiaodi.png", "height": 180, "sizeGrid": "35,35,35,35" }, "compId": 8 }, { "type": "Image", "props": { "y": 11, "x": 10, "skin": "game/baoxian.png", "name": "chest" }, "compId": 13, "child": [{ "type": "Image", "props": { "y": 106, "x": 101, "skin": "game/shipin.png", "name": "video" }, "compId": 19 }] }, { "type": "Box", "props": { "y": 15, "x": 15, "width": 150, "visible": false, "name": "skin", "height": 150 }, "compId": 14, "child": [{ "type": "Image", "props": { "y": 75, "x": 75, "skin": "icon/skin1.png", "name": "icon", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 15 }] }, { "type": "Box", "props": { "y": 15, "x": 15, "width": 150, "visible": false, "name": "gold", "height": 150 }, "compId": 16, "child": [{ "type": "Image", "props": { "y": 53, "x": 29, "width": 41, "skin": "game/pifu-1-10.png", "height": 44 }, "compId": 17 }, { "type": "Text", "props": { "y": 59, "x": 75, "width": 68, "valign": "middle", "text": "100", "name": "gold", "height": 31, "fontSize": 30, "font": "Arial", "color": "#ffffff", "bold": true, "align": "left", "runtime": "laya.display.Text" }, "compId": 18 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 180, "name": "getbtn", "height": 180 }, "compId": 25 }] }] }] }, { "type": "Box", "props": { "y": 875, "x": 0, "width": 720, "var": "ys", "height": 150 }, "compId": 20, "child": [{ "type": "Image", "props": { "y": 8, "x": 234, "skin": "game/KeyIconBase.png" }, "compId": 31, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "var": "key1", "skin": "game/KeyIcon.png" }, "compId": 21 }] }, { "type": "Image", "props": { "y": 8, "x": 322, "skin": "game/KeyIconBase.png" }, "compId": 32, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "var": "key2", "skin": "game/KeyIcon.png" }, "compId": 23 }] }, { "type": "Image", "props": { "y": 8, "x": 410, "skin": "game/KeyIconBase.png" }, "compId": 33, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "var": "key3", "skin": "game/KeyIcon.png" }, "compId": 22 }] }, { "type": "Text", "props": { "y": -60, "x": 257, "width": 205, "var": "opspr", "valign": "middle", "text": "领取奖励", "styleSkin": "game/fasf.png", "height": 60, "fontSize": 45, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 27 }, { "type": "Button", "props": { "y": 8, "x": 190, "visible": false, "var": "getys", "stateNum": 1, "skin": "game/baoxiang-1-14.png" }, "compId": 9, "child": [{ "type": "Text", "props": { "y": -72, "x": -37, "width": 413, "valign": "middle", "text": "额外获得三把钥匙", "height": 67, "fontSize": 45, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 29 }] }] }, { "type": "Image", "props": { "y": -48, "x": 124, "skin": "game/biaoti.png" }, "compId": 10, "child": [{ "type": "Text", "props": { "y": 115, "x": 48.5, "width": 375, "valign": "middle", "text": "可免费开启2个宝箱", "height": 76, "fontSize": 36, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 28 }] }] }], "loadList": ["game/pifu-1-13.png", "game/pifu-1-1.png", "game/dalandi.png", "game/xiaodi.png", "game/baoxian.png", "game/shipin.png", "icon/skin1.png", "game/pifu-1-10.png", "game/KeyIconBase.png", "game/KeyIcon.png", "game/fasf.png", "game/baoxiang-1-14.png", "game/biaoti.png"], "loadList3D": [] };
  933. Window.ChestWindowUI = ChestWindowUI;
  934. REG("ui.Window.ChestWindowUI", ChestWindowUI);
  935. class HomeWindowUI extends Laya.Scene {
  936. constructor() { super(); }
  937. createChildren() {
  938. super.createChildren();
  939. this.createView(HomeWindowUI.uiView);
  940. }
  941. }
  942. HomeWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 77, "x": 487, "width": 233, "var": "moneypan", "skin": "game/zhujiemian-1-5.png", "height": 70, "sizeGrid": "30,30,30,30" }, "compId": 87, "child": [{ "type": "Image", "props": { "y": 8, "x": 20, "skin": "game/zhujiemian-1-4.png" }, "compId": 88 }, { "type": "Text", "props": { "y": 5, "x": 81, "width": 127, "var": "moneyclip", "valign": "middle", "text": "999", "height": 60, "fontSize": 35, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 89 }, { "type": "Button", "props": { "y": 97, "x": 70, "visible": false, "var": "backbtn", "stateNum": 1, "skin": "recommend/hutui-1-2.png" }, "compId": 145 }] }, { "type": "Box", "props": { "y": 912, "x": 0, "width": 720, "var": "bottombtnpan", "height": 118 }, "compId": 61, "child": [{ "type": "Image", "props": { "y": -178, "x": 236.5, "skin": "game/zhujiemian-1-8 (2).png" }, "compId": 91, "child": [{ "type": "Image", "props": { "y": 47.5, "x": 123, "width": 77, "skin": "game/zhujiemian-1-9.png", "pivotY": 24, "pivotX": 30, "height": 112 }, "compId": 92 }, { "type": "Image", "props": { "y": 185, "x": -8, "skin": "game/zhujiemian-1-10.png" }, "compId": 93 }] }, { "type": "Button", "props": { "y": -220, "x": 229, "width": 260, "var": "startbtn", "stateNum": 1, "labelSize": 50, "height": 324 }, "compId": 3 }, { "type": "Button", "props": { "y": -64, "visible": false, "var": "othergamebtn", "stateNum": 1, "skin": "game/zhujiemian-1-6.png", "left": 0 }, "compId": 62 }, { "type": "Button", "props": { "y": -66, "x": 541, "var": "skinbtn", "stateNum": 1, "skin": "game/zhujiemian-1-7.png" }, "compId": 86 }, { "type": "Button", "props": { "y": -215, "var": "signbtn", "stateNum": 1, "skin": "game/zhujiemian-1-11.png", "right": 0 }, "compId": 144 }, { "type": "Button", "props": { "y": -207, "visible": false, "var": "eggbtn", "stateNum": 1, "skin": "game/zhujiemian-1-6.png", "left": 0 }, "compId": 146 }, { "type": "Button", "props": { "y": -144, "x": 56, "var": "cdbtn", "stateNum": 1, "skin": "game/cdbtn.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 147 }] }, { "type": "Box", "props": { "y": 227, "x": 0, "width": 720, "var": "stagepan", "height": 86 }, "compId": 94, "child": [{ "type": "Image", "props": { "y": 34, "x": 110, "width": 500, "skin": "game/zhujiemian-1-2.png", "sizeGrid": "10,10,10,10" }, "compId": 95 }, { "type": "Box", "props": { "y": 10, "x": 107, "width": 505, "var": "stagelist", "spaceX": 50, "repeatY": 1, "repeatX": 5, "height": 66 }, "compId": 96, "child": [{ "type": "Box", "props": { "renderType": "render" }, "compId": 97, "child": [{ "type": "Image", "props": { "skin": "game/zhujiemian-1-1.png" }, "compId": 98, "child": [{ "type": "Text", "props": { "y": 3, "x": 0, "width": 60, "valign": "middle", "text": "12", "height": 60, "fontSize": 35, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 100 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/zhujiemian-1-3.png" }, "compId": 101 }] }, { "type": "Box", "props": { "y": 0, "x": 109, "renderType": "render" }, "compId": 103, "child": [{ "type": "Image", "props": { "skin": "game/zhujiemian-1-1.png" }, "compId": 104, "child": [{ "type": "Text", "props": { "y": 3, "x": 0, "width": 60, "valign": "middle", "text": "12", "height": 60, "fontSize": 35, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 105 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/zhujiemian-1-3.png" }, "compId": 106 }] }, { "type": "Box", "props": { "y": 0, "x": 222, "renderType": "render" }, "compId": 107, "child": [{ "type": "Image", "props": { "skin": "game/zhujiemian-1-1.png" }, "compId": 108, "child": [{ "type": "Text", "props": { "y": 3, "x": 0, "width": 60, "valign": "middle", "text": "12", "height": 60, "fontSize": 35, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 109 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/zhujiemian-1-3.png" }, "compId": 110 }] }, { "type": "Box", "props": { "y": 0, "x": 338, "renderType": "render" }, "compId": 111, "child": [{ "type": "Image", "props": { "skin": "game/zhujiemian-1-1.png" }, "compId": 112, "child": [{ "type": "Text", "props": { "y": 3, "x": 0, "width": 60, "valign": "middle", "text": "12", "height": 60, "fontSize": 35, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 113 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/zhujiemian-1-3.png" }, "compId": 114 }] }, { "type": "Box", "props": { "y": 0, "x": 444, "renderType": "render" }, "compId": 115, "child": [{ "type": "Image", "props": { "skin": "game/zhujiemian-1-1.png" }, "compId": 116, "child": [{ "type": "Text", "props": { "y": 3, "x": 0, "width": 60, "valign": "middle", "text": "12", "height": 60, "fontSize": 35, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 117 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/zhujiemian-1-3.png" }, "compId": 118 }] }] }] }, { "type": "Box", "props": { "y": 334, "width": 172, "var": "videopan", "right": 0, "height": 306 }, "compId": 148, "child": [{ "type": "Box", "props": { "width": 172, "top": 0, "height": 175 }, "compId": 149, "child": [{ "type": "Image", "props": { "y": 7, "x": 7.5, "skin": "bg/guangi.png" }, "compId": 151 }, { "type": "Image", "props": { "y": 87, "x": 85, "skin": "bg/Rays.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 150 }, { "type": "Button", "props": { "y": 87, "x": 85, "var": "videogetweapon", "stateNum": 1, "skin": "bg/qiriqd.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 152 }] }, { "type": "Box", "props": { "x": 0, "width": 172, "height": 175, "bottom": 0 }, "compId": 153, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "skin": "bg/gaungdi.png" }, "compId": 154 }, { "type": "Image", "props": { "y": 87, "x": 85, "skin": "bg/Rays.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 155 }, { "type": "Button", "props": { "y": 87, "x": 85, "var": "videogettw", "stateNum": 1, "skin": "bg/qiriqd-2.png", "scaleY": 1, "scaleX": 1, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 156 }] }] }], "animations": [{ "nodes": [{ "target": 92, "keyframes": { "y": [{ "value": 47.5, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 0 }, { "value": 17, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 10 }, { "value": 47.5, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 20 }, { "value": 95, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 30 }, { "value": 47.5, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 40 }, { "value": 14, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 50 }, { "value": 47.5, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 60 }, { "value": 95, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 70 }, { "value": 47.5, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 80 }], "x": [{ "value": 123, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 0 }, { "value": 57, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 10 }, { "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 20 }, { "value": 58, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 30 }, { "value": 123.5, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 40 }, { "value": 197, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 50 }, { "value": 247, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 60 }, { "value": 195, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 70 }, { "value": 123.5, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 80 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 2 }, { "nodes": [{ "target": 147, "keyframes": { "scaleY": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 147, "key": "scaleY", "index": 0 }, { "value": 1.3, "tweenMethod": "linearNone", "tween": true, "target": 147, "key": "scaleY", "index": 10 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 147, "key": "scaleY", "index": 20 }], "scaleX": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 147, "key": "scaleX", "index": 0 }, { "value": 1.3, "tweenMethod": "linearNone", "tween": true, "target": 147, "key": "scaleX", "index": 10 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 147, "key": "scaleX", "index": 20 }] } }], "name": "ani2", "id": 2, "frameRate": 24, "action": 2 }, { "nodes": [{ "target": 150, "keyframes": { "rotation": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 150, "key": "rotation", "index": 0 }, { "value": 45, "tweenMethod": "linearNone", "tween": true, "target": 150, "key": "rotation", "index": 10 }, { "value": 90, "tweenMethod": "linearNone", "tween": true, "target": 150, "key": "rotation", "index": 20 }, { "value": 135, "tweenMethod": "linearNone", "tween": true, "target": 150, "key": "rotation", "index": 30 }, { "value": 180, "tweenMethod": "linearNone", "tween": true, "target": 150, "key": "rotation", "index": 40 }] } }, { "target": 152, "keyframes": { "scaleY": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleY", "index": 0 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleY", "index": 10 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleY", "index": 20 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleY", "index": 30 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleY", "index": 40 }], "scaleX": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleX", "index": 0 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleX", "index": 10 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleX", "index": 20 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleX", "index": 30 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleX", "index": 40 }] } }], "name": "ani3", "id": 3, "frameRate": 24, "action": 2 }, { "nodes": [{ "target": 155, "keyframes": { "rotation": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 155, "key": "rotation", "index": 0 }, { "value": 45, "tweenMethod": "linearNone", "tween": true, "target": 155, "key": "rotation", "index": 10 }, { "value": 90, "tweenMethod": "linearNone", "tween": true, "target": 155, "key": "rotation", "index": 20 }, { "value": 135, "tweenMethod": "linearNone", "tween": true, "target": 155, "key": "rotation", "index": 30 }, { "value": 180, "tweenMethod": "linearNone", "tween": true, "target": 155, "key": "rotation", "index": 40 }] } }, { "target": 156, "keyframes": { "scaleY": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleY", "index": 0 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleY", "index": 10 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleY", "index": 20 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleY", "index": 30 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleY", "index": 40 }], "scaleX": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleX", "index": 0 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleX", "index": 10 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleX", "index": 20 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleX", "index": 30 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleX", "index": 40 }] } }], "name": "ani3_0", "id": 3, "frameRate": 24, "action": 2 }], "loadList": ["game/zhujiemian-1-5.png", "game/zhujiemian-1-4.png", "recommend/hutui-1-2.png", "game/zhujiemian-1-8 (2).png", "game/zhujiemian-1-9.png", "game/zhujiemian-1-10.png", "game/zhujiemian-1-6.png", "game/zhujiemian-1-7.png", "game/zhujiemian-1-11.png", "game/cdbtn.png", "game/zhujiemian-1-2.png", "game/zhujiemian-1-1.png", "game/zhujiemian-1-3.png", "bg/guangi.png", "bg/Rays.png", "bg/qiriqd.png", "bg/gaungdi.png", "bg/qiriqd-2.png"], "loadList3D": [] };
  943. Window.HomeWindowUI = HomeWindowUI;
  944. REG("ui.Window.HomeWindowUI", HomeWindowUI);
  945. class InGameWindowUI extends Laya.Scene {
  946. constructor() { super(); }
  947. createChildren() {
  948. super.createChildren();
  949. this.createView(InGameWindowUI.uiView);
  950. }
  951. }
  952. InGameWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Box", "props": { "x": 0, "width": 720, "var": "drawpan", "height": 300, "bottom": 1 }, "compId": 96, "child": [{ "type": "Box", "props": { "y": 25, "x": 0, "width": 127, "var": "attackbox", "height": 250 }, "compId": 97, "child": [{ "type": "Button", "props": { "y": 4, "x": 0, "var": "onebtn", "stateNum": 1, "skin": "game/--4.png" }, "compId": 98, "child": [{ "type": "Image", "props": { "y": -4, "x": 0, "skin": "game/--7.png" }, "compId": 104 }, { "type": "Image", "props": { "y": 22, "x": 7, "skin": "game/--3.png" }, "compId": 101 }] }, { "type": "Button", "props": { "y": 88, "x": 0, "var": "twobtn", "stateNum": 1, "skin": "game/--5.png" }, "compId": 99, "child": [{ "type": "Image", "props": { "y": -4, "skin": "game/--8.png" }, "compId": 102 }, { "type": "Image", "props": { "y": 22, "x": 18, "skin": "game/--2.png" }, "compId": 105 }] }, { "type": "Button", "props": { "y": 171, "x": 0, "var": "threebtn", "stateNum": 1, "skin": "game/--6.png" }, "compId": 100, "child": [{ "type": "Image", "props": { "y": -4, "skin": "game/--9.png" }, "compId": 103 }, { "type": "Image", "props": { "y": 22, "x": 18, "skin": "game/--1.png" }, "compId": 106 }] }] }, { "type": "Image", "props": { "y": 17, "x": 153, "width": 520, "var": "drawban", "skin": "bg/-12.png", "height": 279 }, "compId": 95, "child": [{ "type": "Text", "props": { "y": 5, "x": 44.5, "width": 431, "var": "drawtip", "valign": "middle", "text": "绘制你想要的武器", "height": 41, "fontSize": 40, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 127 }] }, { "type": "List", "props": { "x": 165, "width": 497, "visible": false, "var": "skinlist", "top": 36, "spaceY": 5, "spaceX": 5, "height": 247 }, "compId": 107, "child": [{ "type": "Box", "props": { "width": 120, "renderType": "render", "height": 120 }, "compId": 108, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 120, "skin": "game/pifu-1-12.png", "name": "bg", "height": 120, "alpha": 0.4, "sizeGrid": "35,35,35,35" }, "compId": 109 }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 120, "visible": false, "skin": "game/pifu-1-8.png", "name": "selected", "height": 120, "alpha": 0.4, "sizeGrid": "35,35,35,35" }, "compId": 110 }, { "type": "Image", "props": { "y": 60, "x": 60, "skin": "icon/wuqi1.png", "scaleY": 0.7, "scaleX": 0.7, "name": "icon", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 111 }, { "type": "Box", "props": { "x": 0, "width": 120, "styleSkin": "game/pifu-1-4.png", "height": 30, "bottom": 0 }, "compId": 113, "child": [{ "type": "Image", "props": { "x": 0, "width": 120, "skin": "game/pifu-1-9.png", "height": 30, "bottom": 0 }, "compId": 114 }, { "type": "Text", "props": { "y": 0, "x": 0, "width": 120, "valign": "middle", "text": "使用中", "strokeColor": "#812c03", "name": "useing", "height": 30, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 115 }, { "type": "Text", "props": { "x": 0, "width": 120, "visible": false, "valign": "middle", "text": "使用", "strokeColor": "#812c03", "name": "use", "height": 30, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 116 }, { "type": "Box", "props": { "x": 0, "width": 120, "visible": false, "name": "video", "height": 30, "bottom": 0 }, "compId": 117, "child": [{ "type": "Image", "props": { "y": 3, "x": 27, "width": 24, "skin": "game/pifu-1-11.png", "height": 24 }, "compId": 118 }, { "type": "Text", "props": { "y": 4, "x": 51, "width": 41, "valign": "middle", "text": "试用", "strokeColor": "#812c03", "name": "useing", "height": 22, "fontSize": 20, "font": "SimHei", "color": "#ffffff", "bold": false, "align": "left", "runtime": "laya.display.Text" }, "compId": 119 }] }] }, { "type": "Button", "props": { "y": 52, "x": 0, "width": 120, "stateNum": 1, "name": "getbtn", "height": 68 }, "compId": 126 }] }] }] }], "animations": [{ "nodes": [{ "target": 89, "keyframes": { "visible": [{ "value": true, "tweenMethod": "linearNone", "tween": false, "target": 89, "key": "visible", "index": 0 }], "scaleY": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 89, "key": "scaleY", "index": 0 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 89, "key": "scaleY", "index": 10 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 89, "key": "scaleY", "index": 20 }], "scaleX": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 89, "key": "scaleX", "index": 0 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 89, "key": "scaleX", "index": 10 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 89, "key": "scaleX", "index": 20 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 2 }], "loadList": ["game/--4.png", "game/--7.png", "game/--3.png", "game/--5.png", "game/--8.png", "game/--2.png", "game/--6.png", "game/--9.png", "game/--1.png", "bg/-12.png", "game/pifu-1-12.png", "game/pifu-1-8.png", "icon/wuqi1.png", "game/pifu-1-4.png", "game/pifu-1-9.png", "game/pifu-1-11.png"], "loadList3D": [] };
  953. Window.InGameWindowUI = InGameWindowUI;
  954. REG("ui.Window.InGameWindowUI", InGameWindowUI);
  955. class LoadWindowUI extends Laya.Scene {
  956. constructor() { super(); }
  957. createChildren() {
  958. super.createChildren();
  959. this.createView(LoadWindowUI.uiView);
  960. }
  961. }
  962. LoadWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "x": 0, "width": 720, "top": 0, "skin": "load/login.png", "name": "bg", "bottom": 0 }, "compId": 6 }, { "type": "Image", "props": { "y": 207, "x": 88, "var": "logo", "skin": "load/jiazai-1-3.png" }, "compId": 32 }, { "type": "Box", "props": { "y": 811, "x": 0, "width": 720, "var": "logo1", "styleSkin": "load/jiazai-1-1.png", "height": 100 }, "compId": 33, "child": [{ "type": "Image", "props": { "y": 33, "x": 405, "skin": "load/loding-3.png", "scaleY": 1, "scaleX": 1 }, "compId": 13 }, { "type": "FontClip", "props": { "y": 39, "x": 321, "width": 75, "var": "preclip", "value": "100", "skin": "load/43.png", "sheet": "0123456789", "scaleY": 1, "scaleX": 1, "height": 29, "align": "right" }, "compId": 12 }] }], "animations": [{ "nodes": [{ "target": 9, "keyframes": { "alpha": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 9, "key": "alpha", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 9, "key": "alpha", "index": 5 }, { "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 9, "key": "alpha", "index": 20 }] } }, { "target": 10, "keyframes": { "alpha": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 10, "key": "alpha", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 10, "key": "alpha", "index": 10 }, { "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 10, "key": "alpha", "index": 20 }] } }, { "target": 11, "keyframes": { "alpha": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 11, "key": "alpha", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 11, "key": "alpha", "index": 15 }, { "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 11, "key": "alpha", "index": 20 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 2 }], "loadList": ["load/login.png", "load/jiazai-1-3.png", "load/jiazai-1-1.png", "load/loding-3.png", "load/43.png"], "loadList3D": [] };
  963. Window.LoadWindowUI = LoadWindowUI;
  964. REG("ui.Window.LoadWindowUI", LoadWindowUI);
  965. class ReviveWindowUI extends Laya.Scene {
  966. constructor() { super(); }
  967. createChildren() {
  968. super.createChildren();
  969. this.createView(ReviveWindowUI.uiView);
  970. }
  971. }
  972. ReviveWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 720, "top": 0, "skin": "game/zhezhao.png", "name": "bg", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 3, "child": [{ "type": "Image", "props": { "y": 284, "x": 158.5, "skin": "game/fuhuo-1-2.png" }, "compId": 5 }] }, { "type": "Box", "props": { "y": 705, "x": 0, "width": 720, "var": "pan", "height": 112 }, "compId": 19, "child": [{ "type": "Text", "props": { "y": 2, "x": 281, "width": 157, "var": "timetex", "valign": "middle", "text": "5", "height": 124, "fontSize": 120, "font": "Arial", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 6 }] }, { "type": "Box", "props": { "y": 817, "x": 0, "width": 720, "var": "Btn", "height": 143 }, "compId": 4, "child": [{ "type": "Button", "props": { "y": 42, "x": 360, "var": "passbtn", "stateNum": 1, "skin": "game/fuhuo-1-1.png", "scaleY": 1, "scaleX": 1, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 7 }, { "type": "Button", "props": { "y": 155, "x": 314, "var": "closebtn", "stateNum": 1, "skin": "game/fuhuo-1-3.png", "bottom": 0 }, "compId": 8 }] }], "loadList": ["game/zhezhao.png", "game/fuhuo-1-2.png", "game/fuhuo-1-1.png", "game/fuhuo-1-3.png"], "loadList3D": [] };
  973. Window.ReviveWindowUI = ReviveWindowUI;
  974. REG("ui.Window.ReviveWindowUI", ReviveWindowUI);
  975. class RewardWindowUI extends Laya.Scene {
  976. constructor() { super(); }
  977. createChildren() {
  978. super.createChildren();
  979. this.createView(RewardWindowUI.uiView);
  980. }
  981. }
  982. RewardWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "game/zhezhao.png", "name": "bg", "bottom": 0, "alpha": 1, "sizeGrid": "10,10,10,10" }, "compId": 4 }, { "type": "Box", "props": { "y": 540, "x": 360, "width": 572, "var": "pan", "styleSkin": "game/shezhi-1-3.png", "pivotY": 220, "pivotX": 286, "height": 440 }, "compId": 3, "child": [{ "type": "Image", "props": { "y": -5, "x": 57, "width": 457, "skin": "game/pifu-1-13.png", "height": 459, "sizeGrid": "10,10,10,10" }, "compId": 21 }, { "type": "Image", "props": { "y": -30, "x": 192, "skin": "game/huode-1-2.png" }, "compId": 19 }, { "type": "Image", "props": { "y": 220, "x": 286, "width": 234, "skin": "game/huode-1-4.png", "pivotY": 118, "pivotX": 117, "height": 235 }, "compId": 20 }, { "type": "Image", "props": { "y": 220, "x": 287, "var": "icon", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 15 }, { "type": "Text", "props": { "y": 405, "x": 167.5, "width": 237, "visible": false, "var": "skindesc", "valign": "middle", "text": "获得奖励", "height": 50, "fontSize": 40, "font": "SimSun", "color": "#f6f636", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 17 }] }, { "type": "Box", "props": { "y": 817, "x": 0, "width": 720, "var": "Btn", "height": 113 }, "compId": 10, "child": [{ "type": "Button", "props": { "y": 0, "x": 255, "visible": false, "var": "usebtn", "top": 0, "stateNum": 1, "skin": "game/huode-1-1.png" }, "compId": 8 }, { "type": "Button", "props": { "y": 63, "x": 305, "var": "closebtn", "stateNum": 1, "skin": "game/huode-1-5.png", "bottom": 0 }, "compId": 9 }] }], "animations": [{ "nodes": [{ "target": 20, "keyframes": { "rotation": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 20, "key": "rotation", "index": 0 }, { "value": 90, "tweenMethod": "linearNone", "tween": true, "target": 20, "key": "rotation", "index": 15 }, { "value": 180, "tweenMethod": "linearNone", "tween": true, "target": 20, "key": "rotation", "index": 30 }] } }], "name": "ani2", "id": 2, "frameRate": 24, "action": 2 }], "loadList": ["game/zhezhao.png", "game/shezhi-1-3.png", "game/pifu-1-13.png", "game/huode-1-2.png", "game/huode-1-4.png", "game/huode-1-1.png", "game/huode-1-5.png"], "loadList3D": [] };
  983. Window.RewardWindowUI = RewardWindowUI;
  984. REG("ui.Window.RewardWindowUI", RewardWindowUI);
  985. class SettingWindowUI extends Laya.Scene {
  986. constructor() { super(); }
  987. createChildren() {
  988. super.createChildren();
  989. this.createView(SettingWindowUI.uiView);
  990. }
  991. }
  992. SettingWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "bg/beijing-shengli.png", "name": "bg", "bottom": 0 }, "compId": 3 }, { "type": "Box", "props": { "y": 340, "x": 35, "width": 650, "height": 600 }, "compId": 4, "child": [{ "type": "Image", "props": { "x": 0, "width": 650, "skin": "game/shezhi-di.png", "height": 400, "bottom": 100, "sizeGrid": "20,20,20,20" }, "compId": 7 }, { "type": "Image", "props": { "y": 119, "x": 276, "skin": "game/shezhi (2).png" }, "compId": 6 }, { "type": "Button", "props": { "var": "closeBtn", "top": 125, "stateNum": 1, "skin": "game/guaidbi.png", "scaleY": 1.3, "scaleX": 1.3, "right": 24 }, "compId": 5 }, { "type": "Image", "props": { "y": 331, "skin": "game/zhendong.png", "left": 86 }, "compId": 8 }, { "type": "Image", "props": { "y": 239, "skin": "game/yinyue.png", "left": 86 }, "compId": 9 }, { "type": "Box", "props": { "y": 342, "x": 396, "width": 175, "var": "shakePan", "styleSkin": "settingwindow/shezhi_1_2_3.png", "height": 47 }, "compId": 11, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/di-kaiguan.png", "name": "openSprite" }, "compId": 14, "child": [{ "type": "Image", "props": { "y": 3, "skin": "game/huakuai.png", "left": 5 }, "compId": 32 }, { "type": "Image", "props": { "y": 14.5, "skin": "game/ON.png", "right": 15 }, "compId": 33 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/di-kaiguan.png", "name": "closeSprite" }, "compId": 22, "child": [{ "type": "Image", "props": { "y": 3, "skin": "game/huakuai.png", "right": 5 }, "compId": 34 }, { "type": "Image", "props": { "y": 14, "skin": "game/OFF.png", "left": 10 }, "compId": 35 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 175, "name": "button", "height": 47 }, "compId": 17 }] }, { "type": "Box", "props": { "y": 229, "x": 396, "width": 175, "var": "soundPan", "styleSkin": "settingwindow/shezhi_1_2_3.png", "height": 47 }, "compId": 10, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/di-kaiguan.png", "name": "openSprite" }, "compId": 36, "child": [{ "type": "Image", "props": { "y": 3, "skin": "game/huakuai.png", "left": 5 }, "compId": 38 }, { "type": "Image", "props": { "y": 14.5, "skin": "game/ON.png", "right": 15 }, "compId": 39 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/di-kaiguan.png", "name": "closeSprite" }, "compId": 37, "child": [{ "type": "Image", "props": { "y": 3, "skin": "game/huakuai.png", "right": 5 }, "compId": 40 }, { "type": "Image", "props": { "y": 14, "skin": "game/OFF.png", "left": 10 }, "compId": 41 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 175, "name": "button", "height": 47 }, "compId": 16 }] }, { "type": "Text", "props": { "y": 519, "x": 24, "width": 602, "var": "userid", "valign": "middle", "text": "用户ID:0000", "height": 59, "fontSize": 30, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 28 }, { "type": "Text", "props": { "y": 571, "x": 24, "width": 602, "var": "ver", "valign": "middle", "text": "1.0.9", "height": 59, "fontSize": 30, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 31 }] }], "loadList": ["bg/beijing-shengli.png", "game/shezhi-di.png", "game/shezhi (2).png", "game/guaidbi.png", "game/zhendong.png", "game/yinyue.png", "settingwindow/shezhi_1_2_3.png", "game/di-kaiguan.png", "game/huakuai.png", "game/ON.png", "game/OFF.png"], "loadList3D": [] };
  993. Window.SettingWindowUI = SettingWindowUI;
  994. REG("ui.Window.SettingWindowUI", SettingWindowUI);
  995. class SettlementWindowUI extends Laya.Scene {
  996. constructor() { super(); }
  997. createChildren() {
  998. super.createChildren();
  999. this.createView(SettlementWindowUI.uiView);
  1000. }
  1001. }
  1002. SettlementWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "x": 0, "width": 720, "visible": true, "top": 0, "skin": "game/zhezhao.png", "name": "bg", "bottom": 0, "alpha": 0.8, "sizeGrid": "10,10,10,10" }, "compId": 7 }, { "type": "Box", "props": { "y": 229, "x": 0, "width": 720, "var": "pan", "height": 104 }, "compId": 30, "child": [{ "type": "Image", "props": { "y": 12, "x": 158, "var": "loseshow", "skin": "game/jiesuan-1-1.png" }, "compId": 41 }, { "type": "Image", "props": { "y": 12, "x": 159, "var": "winshow", "skin": "game/jiesuan-1-2.png" }, "compId": 31 }] }, { "type": "Box", "props": { "y": 577, "x": 176, "width": 368, "var": "moneypan", "height": 63 }, "compId": 32, "child": [{ "type": "Image", "props": { "x": 1, "width": 367, "top": 0, "skin": "game/jiesuan-1-5.png", "height": 64 }, "compId": 33 }, { "type": "Image", "props": { "y": 31.5, "x": 112, "width": 58, "var": "moneytt", "skin": "game/jiesuan-1-6.png", "pivotY": 31, "pivotX": 29, "height": 62 }, "compId": 34 }, { "type": "Text", "props": { "y": 9, "x": 160, "width": 121, "var": "moneyclip", "valign": "middle", "text": "1234", "height": 45, "fontSize": 55, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "left", "runtime": "laya.display.Text" }, "compId": 35 }] }, { "type": "Box", "props": { "y": 821, "x": 0, "width": 720, "var": "Btn", "height": 149 }, "compId": 5, "child": [{ "type": "Button", "props": { "y": -35, "x": 228, "width": 263, "var": "videobtn", "height": 27 }, "compId": 71, "child": [{ "type": "Image", "props": { "y": 2, "skin": "game/waiquan.png" }, "compId": 73, "child": [{ "type": "Image", "props": { "y": 4, "x": 4, "var": "videopoint", "skin": "game/zhongquan.png" }, "compId": 74 }] }, { "type": "Image", "props": { "y": 0, "x": 29, "skin": "game/kanshipin-wenzi.png" }, "compId": 72 }] }, { "type": "Button", "props": { "y": 0, "x": 198, "var": "awardbtn", "stateNum": 1, "skin": "game/jiesuan-1-3.png" }, "compId": 40 }, { "type": "Button", "props": { "y": 105, "x": 293, "visible": true, "var": "nomalaward", "stateNum": 1, "skin": "game/jiesuan-1-4.png", "bottom": 0 }, "compId": 3 }] }], "loadList": ["game/zhezhao.png", "game/jiesuan-1-1.png", "game/jiesuan-1-2.png", "game/jiesuan-1-5.png", "game/jiesuan-1-6.png", "game/waiquan.png", "game/zhongquan.png", "game/kanshipin-wenzi.png", "game/jiesuan-1-3.png", "game/jiesuan-1-4.png"], "loadList3D": [] };
  1003. Window.SettlementWindowUI = SettlementWindowUI;
  1004. REG("ui.Window.SettlementWindowUI", SettlementWindowUI);
  1005. class ShareVideoWindowUI extends Laya.Scene {
  1006. constructor() { super(); }
  1007. createChildren() {
  1008. super.createChildren();
  1009. this.createView(ShareVideoWindowUI.uiView);
  1010. }
  1011. }
  1012. ShareVideoWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "game/pifu-1-13.png", "name": "bg", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 4 }, { "type": "Box", "props": { "y": 679, "x": 360, "width": 720, "var": "pan", "pivotY": 289, "pivotX": 360, "height": 578 }, "compId": 3, "child": [{ "type": "Image", "props": { "x": 112, "var": "sharetip", "top": 0, "skin": "game/-1(2).png" }, "compId": 5 }, { "type": "Image", "props": { "y": 0, "x": 103, "var": "firstshare", "skin": "bg/-1.png" }, "compId": 11, "child": [{ "type": "Box", "props": { "y": -86, "x": -104, "width": 720, "height": 664 }, "compId": 12, "child": [{ "type": "Image", "props": { "y": 359, "x": 359, "width": 281, "skin": "game/huode-1-4.png", "height": 281, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 13 }, { "type": "Image", "props": { "y": 358, "x": 360, "var": "icon", "skin": "icon/skin1.png", "scaleY": 1.8, "scaleX": 1.8, "rotation": 0, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 14 }] }] }, { "type": "Image", "props": { "y": 227, "x": 251, "width": 78, "var": "sharemoney", "skin": "game/jiesuan-1-6.png", "height": 81 }, "compId": 7, "child": [{ "type": "Text", "props": { "y": 0, "x": 101, "width": 102, "valign": "middle", "text": "100", "height": 82, "fontSize": 60, "color": "#ffffff", "bold": true, "align": "left", "runtime": "laya.display.Text" }, "compId": 8 }] }, { "type": "Button", "props": { "y": 478, "x": 217, "var": "sharebtn", "stateNum": 1, "skin": "game/-2.png", "bottom": 0 }, "compId": 9 }, { "type": "Button", "props": { "y": 594, "x": 314, "var": "closebtn", "stateNum": 1, "skin": "game/fuhuo-1-3.png" }, "compId": 10 }] }], "animations": [{ "nodes": [{ "target": 3, "keyframes": { "scaleY": [{ "value": 0.6, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleY", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleY", "index": 5 }], "scaleX": [{ "value": 0.6, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleX", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleX", "index": 5 }] } }, { "target": 10, "keyframes": { "visible": [{ "value": false, "tweenMethod": "linearNone", "tween": false, "target": 10, "key": "visible", "index": 0 }, { "value": true, "tweenMethod": "linearNone", "tween": false, "target": 10, "key": "visible", "index": 40 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 1 }, { "nodes": [{ "target": 13, "keyframes": { "rotation": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 13, "key": "rotation", "index": 0 }, { "value": 45, "tweenMethod": "linearNone", "tween": true, "target": 13, "key": "rotation", "index": 5 }, { "value": 90, "tweenMethod": "linearNone", "tween": true, "target": 13, "key": "rotation", "index": 10 }] } }], "name": "ani2", "id": 2, "frameRate": 24, "action": 2 }], "loadList": ["game/pifu-1-13.png", "game/-1(2).png", "bg/-1.png", "game/huode-1-4.png", "icon/skin1.png", "game/jiesuan-1-6.png", "game/-2.png", "game/fuhuo-1-3.png"], "loadList3D": [] };
  1013. Window.ShareVideoWindowUI = ShareVideoWindowUI;
  1014. REG("ui.Window.ShareVideoWindowUI", ShareVideoWindowUI);
  1015. class SignWindowUI extends Laya.Scene {
  1016. constructor() { super(); }
  1017. createChildren() {
  1018. super.createChildren();
  1019. this.createView(SignWindowUI.uiView);
  1020. }
  1021. }
  1022. SignWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "game/zhezhao.png", "name": "bg", "bottom": 0, "alpha": 0.75, "sizeGrid": "10,10,10,10" }, "compId": 3 }, { "type": "Box", "props": { "y": 158, "x": 12, "width": 696, "var": "pan", "height": 642 }, "compId": 9, "child": [{ "type": "Image", "props": { "y": 51, "x": 53.5, "width": 589, "skin": "sign/qiandao-1-2.png", "sizeGrid": "60,60,60,60", "height": 580 }, "compId": 779, "child": [{ "type": "Image", "props": { "y": -31, "x": 177, "skin": "sign/qiandao-1-1.png" }, "compId": 985 }] }, { "type": "Box", "props": { "y": 105, "x": 89, "width": 520, "var": "signlist", "height": 472 }, "compId": 19, "child": [{ "type": "Box", "props": { "y": 11, "width": 122, "left": 50, "height": 133 }, "compId": 14, "child": [{ "type": "Box", "props": { "x": 0, "width": 122, "name": "lock", "height": 133 }, "compId": 49, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 15, "child": [{ "type": "Text", "props": { "y": 10, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "第1天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 996 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 50, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 53 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 55 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 51, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 56 }] }] }, { "type": "Box", "props": { "x": 0, "width": 122, "visible": false, "name": "arrive", "height": 133 }, "compId": 986, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-4.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "24,22,25,23" }, "compId": 992, "child": [{ "type": "Image", "props": { "y": 5.5, "x": 0, "width": 122, "skin": "sign/qiandao-1-7.png", "height": 122 }, "compId": 993 }, { "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第2天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 997 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 987, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 988 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 989 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 990, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1202 }] }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "styleSkin": "sign/qianwan-di.png", "name": "complete", "height": 133 }, "compId": 47, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 994, "child": [{ "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第1天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 998 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 999, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1001 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1002 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1000, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1203 }] }, { "type": "Image", "props": { "y": 82, "x": 0, "skin": "sign/qiandao-1-5.png" }, "compId": 666 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "stateNum": 1, "name": "signbtn", "height": 133 }, "compId": 675 }] }, { "type": "Box", "props": { "y": 11, "width": 273, "right": 50, "height": 133 }, "compId": 1032, "child": [{ "type": "Box", "props": { "x": 0, "width": 273, "name": "lock", "height": 133 }, "compId": 1033, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 273, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1034, "child": [{ "type": "Text", "props": { "y": 10, "x": 93, "width": 87, "value": "100", "valign": "middle", "text": "第2天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1035 }] }, { "type": "Box", "props": { "y": 33, "x": 75, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1036, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1037 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1038 }] }, { "type": "Box", "props": { "y": 33, "x": 75, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1039, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1204 }] }] }, { "type": "Box", "props": { "x": 0, "width": 273, "visible": false, "name": "arrive", "height": 133 }, "compId": 1041, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 273, "skin": "sign/qiandao-1-4.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "24,22,25,23" }, "compId": 1042, "child": [{ "type": "Image", "props": { "y": 5, "x": 75, "width": 122, "skin": "sign/qiandao-1-7.png", "height": 122 }, "compId": 1043 }, { "type": "Text", "props": { "y": 9, "x": 93, "width": 87, "value": "100", "valign": "middle", "text": "第2天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1044 }] }, { "type": "Box", "props": { "y": 33, "x": 75, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1045, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1046 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1047 }] }, { "type": "Box", "props": { "y": 33, "x": 75, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1048, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1205 }] }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 273, "visible": false, "styleSkin": "sign/qianwan-di.png", "name": "complete", "height": 133 }, "compId": 1050, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 273, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1051, "child": [{ "type": "Text", "props": { "y": 9, "x": 93, "width": 87, "value": "100", "valign": "middle", "text": "第2天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1052 }] }, { "type": "Box", "props": { "y": 32, "x": 75, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1053, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1054 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1055 }] }, { "type": "Box", "props": { "y": 32, "x": 75, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1056, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1206 }] }, { "type": "Image", "props": { "y": 82, "x": 0, "skin": "sign/qiandao-1-5.png" }, "compId": 1058 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 273, "visible": false, "stateNum": 1, "name": "signbtn", "height": 133 }, "compId": 1059 }] }, { "type": "Box", "props": { "y": 169.5, "x": 50, "width": 273, "height": 133 }, "compId": 1060, "child": [{ "type": "Box", "props": { "x": 0, "width": 273, "name": "lock", "height": 133 }, "compId": 1061, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 273, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1062, "child": [{ "type": "Text", "props": { "y": 10, "x": 93, "width": 87, "value": "100", "valign": "middle", "text": "第3天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1063 }] }, { "type": "Box", "props": { "y": 33, "x": 75, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1064, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1065 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1066 }] }, { "type": "Box", "props": { "y": 33, "x": 75, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1067, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1207 }] }] }, { "type": "Box", "props": { "x": 0, "width": 273, "visible": false, "name": "arrive", "height": 133 }, "compId": 1069, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 273, "skin": "sign/qiandao-1-4.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "24,22,25,23" }, "compId": 1070, "child": [{ "type": "Image", "props": { "y": 5, "x": 75, "width": 122, "skin": "sign/qiandao-1-7.png", "height": 122 }, "compId": 1071 }, { "type": "Text", "props": { "y": 9, "x": 93, "width": 87, "value": "100", "valign": "middle", "text": "第3天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1072 }] }, { "type": "Box", "props": { "y": 33, "x": 75, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1073, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1074 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1075 }] }, { "type": "Box", "props": { "y": 33, "x": 75, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1076, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1208 }] }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 273, "visible": false, "styleSkin": "sign/qianwan-di.png", "name": "complete", "height": 133 }, "compId": 1078, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 273, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1079, "child": [{ "type": "Text", "props": { "y": 9, "x": 93, "width": 87, "value": "100", "valign": "middle", "text": "第3天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1080 }] }, { "type": "Box", "props": { "y": 32, "x": 75, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1081, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1082 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1083 }] }, { "type": "Box", "props": { "y": 32, "x": 75, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1084, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1209 }] }, { "type": "Image", "props": { "y": 82, "x": 0, "skin": "sign/qiandao-1-5.png" }, "compId": 1086 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 273, "visible": false, "stateNum": 1, "name": "signbtn", "height": 133 }, "compId": 1087 }] }, { "type": "Box", "props": { "y": 169.5, "x": 348, "width": 122, "height": 133 }, "compId": 1088, "child": [{ "type": "Box", "props": { "x": 0, "width": 122, "name": "lock", "height": 133 }, "compId": 1089, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1090, "child": [{ "type": "Text", "props": { "y": 10, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "第4天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1091 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1092, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1093 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1094 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1095, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1210 }] }] }, { "type": "Box", "props": { "x": 0, "width": 122, "visible": false, "name": "arrive", "height": 133 }, "compId": 1097, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-4.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "24,22,25,23" }, "compId": 1098, "child": [{ "type": "Image", "props": { "y": 5.5, "x": 0, "width": 122, "skin": "sign/qiandao-1-7.png", "height": 122 }, "compId": 1099 }, { "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第4天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1100 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1101, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1102 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1103 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1104, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1211 }] }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "styleSkin": "sign/qianwan-di.png", "name": "complete", "height": 133 }, "compId": 1106, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1107, "child": [{ "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第4天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1108 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1109, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1110 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1111 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1112, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1212 }] }, { "type": "Image", "props": { "y": 82, "x": 0, "skin": "sign/qiandao-1-5.png" }, "compId": 1114 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "stateNum": 1, "name": "signbtn", "height": 133 }, "compId": 1115 }] }, { "type": "Box", "props": { "y": 318, "x": 50, "width": 122, "height": 133 }, "compId": 1116, "child": [{ "type": "Box", "props": { "x": 0, "width": 122, "name": "lock", "height": 133 }, "compId": 1117, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1118, "child": [{ "type": "Text", "props": { "y": 10, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "第5天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1119 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1120, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1121 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1122 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1123, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1213 }] }] }, { "type": "Box", "props": { "x": 0, "width": 122, "visible": false, "name": "arrive", "height": 133 }, "compId": 1125, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-4.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "24,22,25,23" }, "compId": 1126, "child": [{ "type": "Image", "props": { "y": 5.5, "x": 0, "width": 122, "skin": "sign/qiandao-1-7.png", "height": 122 }, "compId": 1127 }, { "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第5天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1128 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1129, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1130 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1131 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1132, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1214 }] }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "styleSkin": "sign/qianwan-di.png", "name": "complete", "height": 133 }, "compId": 1134, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1135, "child": [{ "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第5天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1136 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1137, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1138 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1139 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1140, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1215 }] }, { "type": "Image", "props": { "y": 82, "x": 0, "skin": "sign/qiandao-1-5.png" }, "compId": 1142 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "stateNum": 1, "name": "signbtn", "height": 133 }, "compId": 1143 }] }, { "type": "Box", "props": { "y": 318, "x": 209.5, "width": 122, "height": 133 }, "compId": 1144, "child": [{ "type": "Box", "props": { "x": 0, "width": 122, "name": "lock", "height": 133 }, "compId": 1145, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1146, "child": [{ "type": "Text", "props": { "y": 10, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "第6天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1147 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1148, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1149 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1150 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1151, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1216 }] }] }, { "type": "Box", "props": { "x": 0, "width": 122, "visible": false, "name": "arrive", "height": 133 }, "compId": 1153, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-4.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "24,22,25,23" }, "compId": 1154, "child": [{ "type": "Image", "props": { "y": 5.5, "x": 0, "width": 122, "skin": "sign/qiandao-1-7.png", "height": 122 }, "compId": 1155 }, { "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第6天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1156 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1157, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1158 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1159 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1160, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1217 }] }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "styleSkin": "sign/qianwan-di.png", "name": "complete", "height": 133 }, "compId": 1162, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1163, "child": [{ "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第6天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1164 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1165, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1166 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1167 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1168, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1218 }] }, { "type": "Image", "props": { "y": 82, "x": 0, "skin": "sign/qiandao-1-5.png" }, "compId": 1170 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "stateNum": 1, "name": "signbtn", "height": 133 }, "compId": 1171 }] }, { "type": "Box", "props": { "y": 318, "x": 348, "width": 122, "height": 133 }, "compId": 1172, "child": [{ "type": "Box", "props": { "x": 0, "width": 122, "name": "lock", "height": 133 }, "compId": 1173, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1174, "child": [{ "type": "Text", "props": { "y": 10, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "第7天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1175 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1176, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1177 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1178 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1179, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1219 }] }] }, { "type": "Box", "props": { "x": 0, "width": 122, "visible": false, "name": "arrive", "height": 133 }, "compId": 1181, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-4.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "24,22,25,23" }, "compId": 1182, "child": [{ "type": "Image", "props": { "y": 5.5, "x": 0, "width": 122, "skin": "sign/qiandao-1-7.png", "height": 122 }, "compId": 1183 }, { "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第7天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1184 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1185, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1186 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1187 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1188, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1220 }] }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "styleSkin": "sign/qianwan-di.png", "name": "complete", "height": 133 }, "compId": 1190, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1191, "child": [{ "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第7天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1192 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1193, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1194 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1195 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1196, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1221 }] }, { "type": "Image", "props": { "y": 82, "x": 0, "skin": "sign/qiandao-1-5.png" }, "compId": 1198 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "stateNum": 1, "name": "signbtn", "height": 133 }, "compId": 1199 }] }] }, { "type": "Button", "props": { "y": 35, "x": 590, "var": "closebtn2", "stateNum": 1, "skin": "sign/qiandao-1-8.png" }, "compId": 673 }] }, { "type": "Box", "props": { "y": 831, "x": 0, "width": 720, "visible": true, "var": "Btn", "height": 164 }, "compId": 598, "child": [{ "type": "Button", "props": { "y": -27, "x": 228.5, "width": 263, "var": "videobtn", "height": 27 }, "compId": 1222, "child": [{ "type": "Image", "props": { "y": 2, "skin": "game/waiquan.png" }, "compId": 1223, "child": [{ "type": "Image", "props": { "y": 4, "x": 4, "var": "videopoint", "skin": "game/zhongquan.png" }, "compId": 1224 }] }, { "type": "Image", "props": { "y": 0, "x": 29, "skin": "game/kanshipin-wenzi.png" }, "compId": 1225 }] }, { "type": "Button", "props": { "y": 146, "x": 353, "width": 124, "var": "signBtn", "stateNum": 1, "skin": "sign/qiandao-1-6.png", "scaleY": 1.1, "scaleX": 1.1, "pivotY": 17, "pivotX": 62, "height": 34 }, "compId": 46 }, { "type": "Button", "props": { "y": 61, "x": 377, "var": "awardbtn", "stateNum": 1, "skin": "game/jiesuan-1-3.png", "pivotY": 61, "pivotX": 179 }, "compId": 913 }] }], "animations": [{ "nodes": [{ "target": 913, "keyframes": { "scaleY": [{ "value": 1.1, "tweenMethod": "linearNone", "tween": true, "target": 913, "key": "scaleY", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 913, "key": "scaleY", "index": 10 }, { "value": 1.1, "tweenMethod": "linearNone", "tween": true, "target": 913, "key": "scaleY", "index": 20 }], "scaleX": [{ "value": 1.1, "tweenMethod": "linearNone", "tween": true, "target": 913, "key": "scaleX", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 913, "key": "scaleX", "index": 10 }, { "value": 1.1, "tweenMethod": "linearNone", "tween": true, "target": 913, "key": "scaleX", "index": 20 }] } }], "name": "ani8", "id": 8, "frameRate": 24, "action": 2 }], "loadList": ["game/zhezhao.png", "sign/qiandao-1-2.png", "sign/qiandao-1-1.png", "sign/qiandao-1-3.png", "game/qiandao-1-2.png", "sign/jb.png", "icon/skin1.png", "sign/qiandao-1-4.png", "sign/qiandao-1-7.png", "sign/qianwan-di.png", "sign/qiandao-1-5.png", "sign/qiandao-1-8.png", "game/waiquan.png", "game/zhongquan.png", "game/kanshipin-wenzi.png", "sign/qiandao-1-6.png", "game/jiesuan-1-3.png"], "loadList3D": [] };
  1023. Window.SignWindowUI = SignWindowUI;
  1024. REG("ui.Window.SignWindowUI", SignWindowUI);
  1025. class SkinWindowUI extends Laya.Scene {
  1026. constructor() { super(); }
  1027. createChildren() {
  1028. super.createChildren();
  1029. this.createView(SkinWindowUI.uiView);
  1030. }
  1031. }
  1032. SkinWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "x": 0, "width": 720, "top": 0, "skin": "game/pifu-1-13.png", "name": "bg", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 3 }, { "type": "Image", "props": { "y": 138, "x": 478, "width": 233, "var": "moneypan", "skin": "game/zhujiemian-1-5.png", "height": 70, "sizeGrid": "30,30,30,30" }, "compId": 122, "child": [{ "type": "Image", "props": { "y": 8, "x": 20, "skin": "game/zhujiemian-1-4.png" }, "compId": 123 }, { "type": "Text", "props": { "y": 5, "x": 81, "width": 127, "var": "moneyclip", "valign": "middle", "text": "999", "height": 60, "fontSize": 35, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 124 }] }, { "type": "Button", "props": { "y": 138, "var": "homebtn", "stateNum": 1, "skin": "game/pifu-1-1.png", "left": 11 }, "compId": 4 }, { "type": "Button", "props": { "y": 328, "x": 557, "var": "cdkbtn", "stateNum": 1, "skin": "game/cdkbtn.png" }, "compId": 132 }, { "type": "Image", "props": { "x": 0, "width": 720, "var": "listpan", "top": 550, "skin": "game/pifu-1-6.png", "height": 730, "bottom": 0, "sizeGrid": "32,11,9,8" }, "compId": 5, "child": [{ "type": "Image", "props": { "x": 35, "width": 650, "top": 50, "skin": "game/pifu-1-7.png", "bottom": 30, "sizeGrid": "25,25,25,25" }, "compId": 94 }, { "type": "Image", "props": { "y": -508, "x": 144, "width": 432, "var": "patbg", "height": 437 }, "compId": 120, "child": [{ "type": "Image", "props": { "y": 336, "x": 216, "width": 325, "var": "pt", "pivotY": 30, "pivotX": 163, "height": 77 }, "compId": 121 }] }, { "type": "Box", "props": { "x": 0, "width": 720, "var": "skinpan", "top": -80, "height": 80 }, "compId": 77, "child": [{ "type": "Box", "props": { "y": 0, "width": 194, "var": "pf", "left": 50, "height": 80 }, "compId": 96, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "skin": "game/pifu-1-2.png", "name": "openSprite1" }, "compId": 80 }, { "type": "Image", "props": { "x": 0, "visible": false, "skin": "game/pifu-1-3.png", "name": "closeSprite1" }, "compId": 81 }, { "type": "Image", "props": { "y": 17, "x": 50, "skin": "game/pifu-1-4.png" }, "compId": 109 }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 194, "var": "pfbtn", "height": 80 }, "compId": 50 }] }, { "type": "Box", "props": { "y": 0, "x": 263, "width": 194, "var": "wq", "height": 80 }, "compId": 97, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "skin": "game/pifu-1-2.png", "name": "openSprite1" }, "compId": 98 }, { "type": "Image", "props": { "x": 0, "skin": "game/pifu-1-3.png", "name": "closeSprite1" }, "compId": 99 }, { "type": "Image", "props": { "y": 18, "x": 50, "skin": "game/pifu-1-5.png" }, "compId": 111 }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 194, "var": "wqbtn", "height": 80 }, "compId": 100 }] }, { "type": "Box", "props": { "y": 0, "width": 194, "var": "tw", "right": 50, "height": 80 }, "compId": 127, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "skin": "game/pifu-1-2.png", "name": "openSprite1" }, "compId": 128 }, { "type": "Image", "props": { "x": 0, "skin": "game/pifu-1-3.png", "name": "closeSprite1" }, "compId": 129 }, { "type": "Image", "props": { "y": 18, "x": 50, "skin": "game/pifu-1-14.png" }, "compId": 130 }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 194, "var": "twbtn", "height": 80 }, "compId": 131 }] }] }, { "type": "List", "props": { "x": 61, "width": 598, "var": "skinlist", "top": 71, "spaceY": 10, "spaceX": 10, "bottom": 44 }, "compId": 6, "child": [{ "type": "Box", "props": { "width": 190, "renderType": "render", "height": 191 }, "compId": 52, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 190, "skin": "game/pifu-1-12.png", "name": "bg", "height": 191, "sizeGrid": "35,35,35,35" }, "compId": 8 }, { "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/pifu-1-8.png", "name": "selected", "sizeGrid": "35,35,35,35" }, "compId": 119 }, { "type": "Image", "props": { "y": 95, "x": 95, "name": "icon", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 117 }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 190, "name": "showbtn", "height": 191 }, "compId": 22 }, { "type": "Box", "props": { "x": 0, "width": 190, "styleSkin": "game/pifu-1-4.png", "height": 63, "bottom": 5 }, "compId": 23, "child": [{ "type": "Image", "props": { "y": 17, "x": 8.5, "skin": "game/pifu-1-9.png" }, "compId": 118 }, { "type": "Text", "props": { "y": 23, "x": 28, "width": 133, "valign": "middle", "text": "使用中", "strokeColor": "#812c03", "name": "useing", "height": 28, "fontSize": 25, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 25 }, { "type": "Text", "props": { "y": 23, "x": 28, "width": 133, "valign": "middle", "text": "使用", "strokeColor": "#812c03", "name": "use", "height": 28, "fontSize": 25, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 26 }, { "type": "Box", "props": { "x": 20, "width": 149, "name": "video", "height": 43, "bottom": 5 }, "compId": 27, "child": [{ "type": "Image", "props": { "y": 4.5, "x": 34.5, "skin": "game/pifu-1-11.png" }, "compId": 28 }, { "type": "Text", "props": { "y": 12, "x": 81, "width": 49, "valign": "middle", "text": "0/2", "strokeColor": "#812c03", "name": "useing", "height": 28, "fontSize": 25, "font": "SimHei", "color": "#ffffff", "bold": false, "align": "left", "runtime": "laya.display.Text" }, "compId": 29 }] }, { "type": "Box", "props": { "x": 20, "width": 149, "name": "money", "height": 43, "bottom": 5 }, "compId": 30, "child": [{ "type": "Image", "props": { "y": 7, "x": 28, "width": 32, "skin": "game/zhujiemian-1-4.png", "height": 34 }, "compId": 31 }, { "type": "Text", "props": { "y": 12, "x": 65, "width": 61, "valign": "middle", "text": "1000", "strokeColor": "#812c03", "name": "useing", "height": 28, "fontSize": 25, "font": "SimHei", "color": "#ffffff", "bold": false, "align": "left", "runtime": "laya.display.Text" }, "compId": 32 }] }, { "type": "Text", "props": { "y": 23, "x": 40, "width": 110, "valign": "middle", "text": "活动获取", "strokeColor": "#812c03", "name": "activeity", "height": 33, "fontSize": 25, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 33 }, { "type": "Text", "props": { "y": 23, "x": 40, "width": 110, "valign": "middle", "text": "签到获取", "strokeColor": "#812c03", "name": "sign", "height": 33, "fontSize": 25, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 125 }, { "type": "Text", "props": { "y": 23, "x": 23, "width": 144, "valign": "middle", "text": "通过1关获取", "strokeColor": "#812c03", "name": "stage", "height": 33, "fontSize": 25, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 126 }] }, { "type": "Button", "props": { "x": 0, "width": 190, "stateNum": 1, "name": "getbtn", "height": 63, "bottom": 5 }, "compId": 34 }] }] }] }], "loadList": ["game/pifu-1-13.png", "game/zhujiemian-1-5.png", "game/zhujiemian-1-4.png", "game/pifu-1-1.png", "game/cdkbtn.png", "game/pifu-1-6.png", "game/pifu-1-7.png", "game/pifu-1-2.png", "game/pifu-1-3.png", "game/pifu-1-4.png", "game/pifu-1-5.png", "game/pifu-1-14.png", "game/pifu-1-12.png", "game/pifu-1-8.png", "game/pifu-1-9.png", "game/pifu-1-11.png"], "loadList3D": [] };
  1033. Window.SkinWindowUI = SkinWindowUI;
  1034. REG("ui.Window.SkinWindowUI", SkinWindowUI);
  1035. class TaoZhuangWindowUI extends Laya.Scene {
  1036. constructor() { super(); }
  1037. createChildren() {
  1038. super.createChildren();
  1039. this.createView(TaoZhuangWindowUI.uiView);
  1040. }
  1041. }
  1042. TaoZhuangWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "x": 0, "width": 720, "top": 0, "skin": "bg/dise-2.png", "name": "bg", "bottom": 0 }, "compId": 4 }, { "type": "Box", "props": { "y": 514, "x": 360, "width": 720, "var": "pan", "height": 720, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 3, "child": [{ "type": "Button", "props": { "y": -56, "x": 41, "var": "backbtn", "stateNum": 1, "skin": "game/fanhui.png" }, "compId": 5 }, { "type": "Image", "props": { "y": 117, "x": 4, "skin": "bg/dise.png" }, "compId": 6, "child": [{ "type": "Image", "props": { "y": 314, "x": 14, "skin": "bg/wenzilo.png" }, "compId": 7, "child": [{ "type": "Image", "props": { "y": -218, "x": 139, "width": 404, "skin": "bg/gagag.png", "height": 299 }, "compId": 17 }] }, { "type": "Image", "props": { "y": 514, "x": 7, "skin": "bg/disilv.png" }, "compId": 8, "child": [{ "type": "Image", "props": { "y": 19.5, "x": 202.5, "skin": "game/wenzi-1 (2).png" }, "compId": 9 }, { "type": "Image", "props": { "y": 63, "x": 238, "var": "pre1", "skin": "game/lanyuan.png" }, "compId": 11, "child": [{ "type": "Image", "props": { "skin": "game/youyuan.png" }, "compId": 14 }] }, { "type": "Image", "props": { "y": 63, "x": 315.5, "var": "pre2", "skin": "game/lanyuan.png" }, "compId": 10, "child": [{ "type": "Image", "props": { "skin": "game/youyuan.png" }, "compId": 13 }] }, { "type": "Image", "props": { "y": 63, "x": 396, "var": "pre3", "skin": "game/lanyuan.png" }, "compId": 12, "child": [{ "type": "Image", "props": { "skin": "game/youyuan.png" }, "compId": 15 }] }] }, { "type": "Button", "props": { "y": 645, "x": 205, "var": "getbtn", "stateNum": 1, "skin": "game/at-anni.png" }, "compId": 16 }] }] }], "animations": [{ "nodes": [{ "target": 3, "keyframes": { "scaleY": [{ "value": 0.6, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleY", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleY", "index": 10 }], "scaleX": [{ "value": 0.6, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleX", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleX", "index": 10 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 1 }], "loadList": ["bg/dise-2.png", "game/fanhui.png", "bg/dise.png", "bg/wenzilo.png", "bg/gagag.png", "bg/disilv.png", "game/wenzi-1 (2).png", "game/lanyuan.png", "game/youyuan.png", "game/at-anni.png"], "loadList3D": [] };
  1043. Window.TaoZhuangWindowUI = TaoZhuangWindowUI;
  1044. REG("ui.Window.TaoZhuangWindowUI", TaoZhuangWindowUI);
  1045. class TaskContentViewUI extends Laya.Scene {
  1046. constructor() { super(); }
  1047. createChildren() {
  1048. super.createChildren();
  1049. this.createView(TaskContentViewUI.uiView);
  1050. }
  1051. }
  1052. TaskContentViewUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 720, "top": 0, "skin": "game/taskcc5.png", "name": "bg", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 4, "child": [{ "type": "Image", "props": { "y": 57, "x": -150.5, "width": 149, "skin": "bg/taskcc4.png", "rotation": -32, "height": 702, "alpha": 0.5 }, "compId": 21 }, { "type": "Image", "props": { "y": -42, "x": 574, "skin": "bg/taskcc4.png", "rotation": 28, "alpha": 0.5 }, "compId": 13 }, { "type": "Image", "props": { "y": 0, "x": 232, "skin": "bg/taskcc4.png", "alpha": 0.5 }, "compId": 12 }, { "type": "Image", "props": { "y": 295, "x": -136, "skin": "bg/taskcc4.png", "rotation": -42, "alpha": 0.5 }, "compId": 14 }, { "type": "Image", "props": { "y": 1108, "x": -108, "skin": "bg/taskcc4.png", "rotation": -126, "alpha": 0.5 }, "compId": 15 }, { "type": "Image", "props": { "y": 1297, "x": 122, "skin": "bg/taskcc4.png", "rotation": -148, "alpha": 0.5 }, "compId": 16 }, { "type": "Image", "props": { "y": 1353, "x": 473, "skin": "bg/taskcc4.png", "rotation": -178, "alpha": 0.5 }, "compId": 17 }, { "type": "Image", "props": { "y": 1242, "x": 790, "skin": "bg/taskcc4.png", "rotation": -206, "alpha": 0.5 }, "compId": 18 }, { "type": "Image", "props": { "y": 1042, "x": 920, "skin": "bg/taskcc4.png", "rotation": -224, "alpha": 0.5 }, "compId": 19 }, { "type": "Image", "props": { "y": 179, "x": 720, "skin": "bg/taskcc4.png", "rotation": 38, "alpha": 0.5 }, "compId": 20 }, { "type": "Image", "props": { "x": 0, "width": 720, "top": 0, "skin": "bg/taskcc3.png", "bottom": 0 }, "compId": 11 }] }, { "type": "Box", "props": { "y": 640, "x": 360, "width": 720, "var": "mespan", "height": 440, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 5, "child": [{ "type": "Image", "props": { "y": -177, "x": 158, "visible": false, "var": "tips", "skin": "bg/taskcc2.png" }, "compId": 24 }, { "type": "Image", "props": { "x": 111, "top": 0, "skin": "bg/taskmes2.png" }, "compId": 6, "child": [{ "type": "Text", "props": { "y": 38, "x": 167, "width": 176, "var": "title", "valign": "middle", "text": "愈挫愈勇", "height": 38, "fontSize": 25, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 9 }, { "type": "Text", "props": { "y": 98.5, "x": 101.5, "wordWrap": true, "width": 296, "var": "content", "valign": "middle", "text": "在一关失败达到5次", "height": 67, "fontSize": 23, "color": "#5e3513", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 10 }, { "type": "Text", "props": { "y": 144, "x": 101.5, "wordWrap": true, "width": 296, "var": "cdktex", "valign": "middle", "text": "兑换码:123456", "height": 67, "fontSize": 23, "color": "#5e3513", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 22 }, { "type": "Button", "props": { "y": 85, "x": 404, "var": "closemesview", "stateNum": 1, "skin": "game/cd4.png" }, "compId": 7 }] }, { "type": "Button", "props": { "x": 247.5, "visible": false, "var": "sharebtn", "stateNum": 1, "skin": "game/taskmes1.png", "bottom": 0 }, "compId": 8 }] }], "animations": [{ "nodes": [{ "target": 5, "keyframes": { "scaleY": [{ "value": 0.6, "tweenMethod": "linearNone", "tween": true, "target": 5, "key": "scaleY", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 5, "key": "scaleY", "index": 10 }], "scaleX": [{ "value": 0.6, "tweenMethod": "linearNone", "tween": true, "target": 5, "key": "scaleX", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 5, "key": "scaleX", "index": 10 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 0 }], "loadList": ["game/taskcc5.png", "bg/taskcc4.png", "bg/taskcc3.png", "bg/taskcc2.png", "bg/taskmes2.png", "game/cd4.png", "game/taskmes1.png"], "loadList3D": [] };
  1053. Window.TaskContentViewUI = TaskContentViewUI;
  1054. REG("ui.Window.TaskContentViewUI", TaskContentViewUI);
  1055. class TaskWindowUI extends Laya.Scene {
  1056. constructor() { super(); }
  1057. createChildren() {
  1058. super.createChildren();
  1059. this.createView(TaskWindowUI.uiView);
  1060. }
  1061. }
  1062. TaskWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 720, "top": 0, "skin": "game/task2.png", "name": "bg", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 3 }, { "type": "Button", "props": { "y": 138, "x": 0, "var": "homebtn", "stateNum": 1, "skin": "game/pifu-1-1.png", "left": 11 }, "compId": 5 }, { "type": "Image", "props": { "x": 0, "width": 720, "var": "listpan", "top": 466, "skin": "game/pifu-1-6.png", "bottom": 0, "sizeGrid": "32,11,9,8" }, "compId": 6, "child": [{ "type": "Image", "props": { "x": 0, "width": 720, "top": 62, "skin": "game/task4.png", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 9 }, { "type": "Image", "props": { "skin": "bg/task3.png" }, "compId": 48 }, { "type": "List", "props": { "x": 39, "width": 642, "var": "cdlist", "top": 73, "spaceY": 10, "spaceX": 10, "height": 668, "bottom": 73 }, "compId": 49, "child": [{ "type": "Box", "props": { "y": 0, "x": 0, "width": 207, "renderType": "render", "height": 215 }, "compId": 50, "child": [{ "type": "Image", "props": { "skin": "bg/task5.png" }, "compId": 69, "child": [{ "type": "Image", "props": { "y": 42, "x": 58, "skin": "bg/egg.png", "name": "egg" }, "compId": 81 }, { "type": "Text", "props": { "y": 77, "x": 5, "width": 197, "visible": false, "valign": "middle", "text": "兑换码:1234563", "height": 53, "fontSize": 25, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 74 }, { "type": "Button", "props": { "y": 162, "x": 32, "stateNum": 1, "skin": "game/2.png", "name": "videogetbtn" }, "compId": 70 }, { "type": "Button", "props": { "y": 162, "x": 32, "stateNum": 1, "skin": "game/1(2).png", "name": "readbtn" }, "compId": 72 }] }, { "type": "Image", "props": { "y": 17, "x": 13, "skin": "game/cd1.png" }, "compId": 71 }, { "type": "Image", "props": { "y": 75, "x": 77, "skin": "game/gasgahah.png" }, "compId": 82 }] }] }] }], "animations": [{ "nodes": [{ "target": 78, "keyframes": { "scaleY": [{ "value": 0.6, "tweenMethod": "linearNone", "tween": true, "target": 78, "key": "scaleY", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 78, "key": "scaleY", "index": 10 }], "scaleX": [{ "value": 0.6, "tweenMethod": "linearNone", "tween": true, "target": 78, "key": "scaleX", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 78, "key": "scaleX", "index": 10 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 0 }], "loadList": ["game/task2.png", "game/pifu-1-1.png", "game/pifu-1-6.png", "game/task4.png", "bg/task3.png", "bg/task5.png", "bg/egg.png", "game/2.png", "game/1(2).png", "game/cd1.png", "game/gasgahah.png"], "loadList3D": [] };
  1063. Window.TaskWindowUI = TaskWindowUI;
  1064. REG("ui.Window.TaskWindowUI", TaskWindowUI);
  1065. class TryoutWindowUI extends Laya.Scene {
  1066. constructor() { super(); }
  1067. createChildren() {
  1068. super.createChildren();
  1069. this.createView(TryoutWindowUI.uiView);
  1070. }
  1071. }
  1072. TryoutWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "game/zhezhao.png", "name": "bg", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 3 }, { "type": "Box", "props": { "y": 146, "x": 0, "width": 720, "var": "pan", "height": 796 }, "compId": 5, "child": [{ "type": "Image", "props": { "x": 268, "top": 0, "skin": "game/wuqilo.png" }, "compId": 26 }, { "type": "Box", "props": { "y": 80, "x": 0, "width": 720, "var": "upskinpan", "height": 374 }, "compId": 27, "child": [{ "type": "Image", "props": { "skin": "game/zi-z.png", "left": 50 }, "compId": 28, "child": [{ "type": "Image", "props": { "y": 206, "x": 15, "skin": "game/shipin.png" }, "compId": 34 }, { "type": "Button", "props": { "y": 288, "x": 5, "var": "tribtn10", "stateNum": 1, "skin": "game/shiyong.png" }, "compId": 29 }, { "type": "Text", "props": { "y": 15, "x": 38.5, "width": 116, "valign": "middle", "text": "武器名字", "name": "name", "height": 34, "fontSize": 26, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 42 }, { "type": "Image", "props": { "y": 131, "x": 96, "width": 99, "skin": "icon/wuqi12.png", "name": "icon", "height": 199, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 45 }] }, { "type": "Image", "props": { "y": 0, "x": 263, "skin": "game/zi-z.png" }, "compId": 30, "child": [{ "type": "Image", "props": { "y": 206, "x": 15, "skin": "game/shipin.png" }, "compId": 35 }, { "type": "Button", "props": { "y": 288, "x": 5, "var": "tribtn11", "stateNum": 1, "skin": "game/shiyong.png" }, "compId": 31 }, { "type": "Text", "props": { "y": 15, "x": 38, "width": 116, "valign": "middle", "text": "武器名字", "name": "name", "height": 34, "fontSize": 26, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 43 }, { "type": "Image", "props": { "y": 131, "x": 96, "width": 99, "skin": "icon/wuqi12.png", "name": "icon", "height": 199, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 46 }] }, { "type": "Image", "props": { "y": 0, "skin": "game/zi-z.png", "right": 50 }, "compId": 32, "child": [{ "type": "Image", "props": { "y": 206, "x": 15, "skin": "game/shipin.png" }, "compId": 36 }, { "type": "Button", "props": { "y": 288, "x": 5, "var": "tribtn12", "stateNum": 1, "skin": "game/shiyong.png" }, "compId": 33 }, { "type": "Text", "props": { "y": 15, "x": 38, "width": 116, "valign": "middle", "text": "武器名字", "name": "name", "height": 34, "fontSize": 26, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 44 }, { "type": "Image", "props": { "y": 131, "x": 96, "width": 99, "skin": "icon/wuqi12.png", "name": "icon", "height": 199, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 47 }] }] }, { "type": "Image", "props": { "x": 0, "width": 720, "var": "downskinpan", "skin": "bg/hdi.png", "bottom": 0 }, "compId": 37, "child": [{ "type": "Image", "props": { "y": 3, "x": 16, "stateNum": 1, "skin": "game/wuqihdi.png" }, "compId": 38, "child": [{ "type": "Text", "props": { "y": 15, "x": 38, "width": 116, "valign": "middle", "text": "武器名字", "name": "name", "height": 34, "fontSize": 26, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 48 }, { "type": "Image", "props": { "y": 131, "x": 96, "width": 99, "skin": "icon/wuqi12.png", "name": "icon", "height": 199, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 49 }] }, { "type": "Image", "props": { "y": 62, "x": 254, "skin": "game/wenzi-6.png" }, "compId": 39, "child": [{ "type": "Image", "props": { "y": 70, "x": 0, "skin": "game/wenzi-1.png" }, "compId": 40 }] }, { "type": "Button", "props": { "y": 158, "x": 422, "var": "tribtn2", "stateNum": 1, "skin": "game/anniu-.png" }, "compId": 41 }] }] }, { "type": "Box", "props": { "y": 955, "x": 0, "width": 720, "var": "Btn", "height": 45 }, "compId": 12, "child": [{ "type": "Button", "props": { "y": 143, "x": 289, "var": "passbtn", "stateNum": 1, "skin": "game/tuichu.png", "bottom": 0 }, "compId": 16 }] }], "loadList": ["game/zhezhao.png", "game/wuqilo.png", "game/zi-z.png", "game/shipin.png", "game/shiyong.png", "icon/wuqi12.png", "bg/hdi.png", "game/wuqihdi.png", "game/wenzi-6.png", "game/wenzi-1.png", "game/anniu-.png", "game/tuichu.png"], "loadList3D": [] };
  1073. Window.TryoutWindowUI = TryoutWindowUI;
  1074. REG("ui.Window.TryoutWindowUI", TryoutWindowUI);
  1075. })(Window = ui.Window || (ui.Window = {}));
  1076. })(ui || (ui = {}));
  1077. class ADHelper {
  1078. static initAd() {
  1079. if (!Laya.Browser.window.conch)
  1080. return;
  1081. ADHelper.Conch = Laya.Browser.window.conch;
  1082. ADHelper.PlatformClass = Laya.Browser.window.PlatformClass;
  1083. ADHelper.IsAndroid = ADHelper.Conch.config.getOS() == "Conch-android";
  1084. if (ADHelper.IsAndroid) {
  1085. ADHelper.JavaClassAdHelper = ADHelper.PlatformClass.createClass("ad.AdHelper");
  1086. ADHelper.JavaClassAdHelper.callWithBack((isOk) => {
  1087. console.log(">>>>>>>>>>>>>>>>Ad");
  1088. console.log(isOk);
  1089. ADHelper.IsReady = true;
  1090. console.log("[LOG]Java_initAd ok");
  1091. }, "initAd");
  1092. }
  1093. }
  1094. static showVideoAd(callback) {
  1095. if (ADHelper.IsAndroid) {
  1096. console.log(">>>>>>>>>>>>>>>>Ad");
  1097. console.log(ADHelper.JavaClassAdHelper);
  1098. ADHelper.JavaClassAdHelper.callWithBack(isOk => {
  1099. console.log(">>>>>>>>>>>>>");
  1100. console.log(isOk);
  1101. console.log("[LOG]Java_shwoVideoAd callback enter", isOk);
  1102. callback && callback(isOk);
  1103. }, "showVideoAd");
  1104. }
  1105. else {
  1106. callback && callback(true);
  1107. }
  1108. }
  1109. static showBanner() {
  1110. if (ADHelper.IsAndroid) {
  1111. ADHelper.IsBannerVisible = true;
  1112. ADHelper.JavaClassAdHelper.callWithBack(() => {
  1113. if (!ADHelper.IsBannerVisible) {
  1114. ADHelper.hideBanner();
  1115. }
  1116. }, "showBanner");
  1117. }
  1118. }
  1119. static hideBanner() {
  1120. if (ADHelper.IsAndroid) {
  1121. ADHelper.IsBannerVisible = false;
  1122. ADHelper.JavaClassAdHelper.call("hideBanner");
  1123. }
  1124. }
  1125. }
  1126. ADHelper.IsReady = false;
  1127. ADHelper.IsBannerVisible = false;
  1128. var Vector2 = Laya.Vector2;
  1129. var attacktype;
  1130. (function (attacktype) {
  1131. attacktype[attacktype["one"] = 0] = "one";
  1132. attacktype[attacktype["two"] = 1] = "two";
  1133. attacktype[attacktype["three"] = 2] = "three";
  1134. })(attacktype || (attacktype = {}));
  1135. class InGameWindow extends ui.Window.InGameWindowUI {
  1136. constructor() {
  1137. super();
  1138. this.skindatas = [];
  1139. this.enter = false;
  1140. this.path = [];
  1141. this.points = [];
  1142. InGameWindow.instance = this;
  1143. }
  1144. static get Instance() {
  1145. return InGameWindow.instance;
  1146. }
  1147. InitSize() {
  1148. this.height = Laya.stage.height;
  1149. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  1150. this.drawbany = Laya.stage.height - InGameWindow.Instance.drawpan.height + InGameWindow.Instance.drawban.y;
  1151. }
  1152. OnOpen(_win = false) {
  1153. this.skindatas = this.GetSkinDatas(skintype.weapon);
  1154. this.InitSize();
  1155. this.RegButton();
  1156. TtSdk.RecordEvent("enterGame");
  1157. }
  1158. RegButton() {
  1159. this.onebtn.clickHandler = Laya.Handler.create(this, this.OnClickOne, null, false);
  1160. this.twobtn.clickHandler = Laya.Handler.create(this, this.OnClickTwo, null, false);
  1161. this.threebtn.clickHandler = Laya.Handler.create(this, this.OnClickThree, null, false);
  1162. EventManager.InputOn(TouchState.down, this, this.OnDown);
  1163. EventManager.InputOn(TouchState.up, this, this.OnUp);
  1164. EventManager.InputOn(TouchState.slidermove, this, this.OnSlider);
  1165. this.OnClickOne();
  1166. }
  1167. OnClickOne() {
  1168. if (this.curattacktype == attacktype.one)
  1169. return;
  1170. this.skinlist.visible = true;
  1171. this.SetBtnShow(attacktype.one);
  1172. this.ShowWeaponList();
  1173. if (this.drawbg) {
  1174. this.drawbg.removeSelf();
  1175. this.drawbg.destroy();
  1176. this.drawbg = null;
  1177. }
  1178. this.drawtip.visible = false;
  1179. Player.mainpalyer.ShowWeapon(true);
  1180. }
  1181. OnClickTwo() {
  1182. if (this.curattacktype == attacktype.two)
  1183. return;
  1184. this.skinlist.visible = false;
  1185. this.SetBtnShow(attacktype.two);
  1186. if (this.drawbg) {
  1187. this.drawbg.removeSelf();
  1188. this.drawbg.destroy();
  1189. this.drawbg = null;
  1190. }
  1191. this.drawtip.visible = true;
  1192. }
  1193. OnClickThree() {
  1194. if (this.curattacktype == attacktype.three)
  1195. return;
  1196. this.skinlist.visible = false;
  1197. this.SetBtnShow(attacktype.three);
  1198. if (this.drawbg) {
  1199. this.drawbg.removeSelf();
  1200. this.drawbg.destroy();
  1201. this.drawbg = null;
  1202. }
  1203. this.drawtip.visible = true;
  1204. }
  1205. ShowWeaponList() {
  1206. this.skinlist.vScrollBarSkin = "";
  1207. this.skinlist.array = this.skindatas;
  1208. this.skinlist.renderHandler = Laya.Handler.create(this, this.OnRender, null, false);
  1209. }
  1210. OnRender(_cell) {
  1211. var data = _cell.dataSource;
  1212. var selected = _cell.getChildAt(1);
  1213. selected.visible = false;
  1214. var icon = _cell.getChildAt(2);
  1215. var state = _cell.getChildAt(3);
  1216. var geted = _cell.getChildAt(4);
  1217. icon.skin = "icon/" + data.skinicon + ".png";
  1218. this.SetGetBtn(state, data);
  1219. if (data.curskinstate == skinstate.getnoues) {
  1220. geted.clickHandler = Laya.Handler.create(this, this.OnUseSkin, [data], false);
  1221. }
  1222. else if (data.curskinstate == skinstate.lock) {
  1223. geted.clickHandler = Laya.Handler.create(this, this.OnVideoGet, [data], false);
  1224. }
  1225. else if (data.curskinstate == skinstate.useing) {
  1226. selected.visible = true;
  1227. }
  1228. }
  1229. OnHide() {
  1230. if (this.drawbg) {
  1231. this.drawbg.removeSelf();
  1232. this.drawbg.destroy();
  1233. this.drawbg = null;
  1234. }
  1235. EventManager.InputOff(TouchState.down, this, this.OnDown);
  1236. EventManager.InputOff(TouchState.up, this, this.OnUp);
  1237. EventManager.InputOff(TouchState.slidermove, this, this.OnSlider);
  1238. }
  1239. OnUseSkin(_data) {
  1240. if (this.wearskin == _data)
  1241. return;
  1242. this.WearSkin(_data);
  1243. }
  1244. OnVideoGet(_data) {
  1245. if (Laya.Browser.onPC) {
  1246. this.OnUseSkin(_data);
  1247. }
  1248. else {
  1249. ADHelper.showVideoAd((flag) => {
  1250. if (flag) {
  1251. this.OnUseSkin(_data);
  1252. }
  1253. });
  1254. }
  1255. }
  1256. WearSkin(_skin) {
  1257. console.log("wear:", _skin.skinid);
  1258. _skin.curskinstate = skinstate.useing;
  1259. EventManager.Trigger(EventType.UseSkin, [_skin]);
  1260. for (var i = 0; i < this.skindatas.length; i++) {
  1261. var mskin = this.skindatas[i];
  1262. if (mskin != _skin && mskin.curskinstate == skinstate.useing) {
  1263. mskin.curskinstate = skinstate.getnoues;
  1264. }
  1265. }
  1266. this.ShowWeaponList();
  1267. }
  1268. SetGetBtn(_btn, _data) {
  1269. var getuseing = _btn.getChildAt(1);
  1270. getuseing.visible = _data.curskinstate == skinstate.useing;
  1271. var getuse = _btn.getChildAt(2);
  1272. getuse.visible = _data.curskinstate == skinstate.getnoues;
  1273. var getvideo = _btn.getChildAt(3);
  1274. getvideo.visible = false;
  1275. if (_data.curskinstate == skinstate.lock) {
  1276. getvideo.visible = true;
  1277. }
  1278. }
  1279. SetBtnShow(_skintype) {
  1280. this.curattacktype = _skintype;
  1281. for (var i = 0; i < this.attackbox.numChildren; i++) {
  1282. var skin = this.attackbox.getChildAt(i);
  1283. var openskin = skin.getChildAt(0);
  1284. if (i == _skintype) {
  1285. openskin.visible = true;
  1286. }
  1287. else {
  1288. openskin.visible = false;
  1289. }
  1290. }
  1291. }
  1292. GetSkinDatas(_skintype) {
  1293. var skins = PlayerAccount.CurAccountData.m_skinDic.values;
  1294. var gets = [];
  1295. var locks = [];
  1296. for (var i = 0; i < skins.length; i++) {
  1297. var curskin = skins[i];
  1298. if (curskin.skintype != _skintype)
  1299. continue;
  1300. if (curskin.curskinstate != skinstate.lock) {
  1301. gets.push(curskin);
  1302. }
  1303. else {
  1304. locks.push(curskin);
  1305. }
  1306. }
  1307. return gets.concat(locks);
  1308. }
  1309. OnDown() {
  1310. if (this.curattacktype == attacktype.one)
  1311. return;
  1312. this.startpoint = new Vector2(this.drawban.mouseX, this.drawban.mouseY);
  1313. if (this.drawban.mouseY < 50) {
  1314. return;
  1315. }
  1316. if (this.drawban.mouseY > this.drawban.height) {
  1317. return;
  1318. }
  1319. if (this.drawban.mouseX < 0) {
  1320. return;
  1321. }
  1322. if (this.drawban.mouseX > this.drawban.width) {
  1323. return;
  1324. }
  1325. this.enter = true;
  1326. if (this.drawbg) {
  1327. this.drawbg.removeSelf();
  1328. this.drawbg.destroy();
  1329. this.drawbg = null;
  1330. }
  1331. this.drawbg = new Laya.Sprite();
  1332. this.drawbg.width = this.drawban.width;
  1333. this.drawbg.height = this.drawban.height;
  1334. this.drawbg.pos(this.drawban.x, this.drawban.y);
  1335. this.drawpan.addChild(this.drawbg);
  1336. this.points = [];
  1337. this.path = [];
  1338. }
  1339. OnUp() {
  1340. if (this.curattacktype == attacktype.one)
  1341. return;
  1342. if (this.drawbg) {
  1343. this.drawbg.graphics.clear();
  1344. this.drawbg.removeSelf();
  1345. this.drawbg.destroy();
  1346. this.drawbg = null;
  1347. }
  1348. if (this.drawban.mouseY < 50) {
  1349. return;
  1350. }
  1351. if (this.drawban.mouseY > this.drawban.height) {
  1352. return;
  1353. }
  1354. if (this.drawban.mouseX < 0) {
  1355. return;
  1356. }
  1357. if (this.drawban.mouseX > this.drawban.width) {
  1358. return;
  1359. }
  1360. this.enter = false;
  1361. if (this.path.length > 4) {
  1362. if (this.curattacktype == attacktype.two) {
  1363. EventManager.Trigger(EventType.DrawEnd, [this.path, true]);
  1364. }
  1365. else {
  1366. EventManager.Trigger(EventType.DrawEnd, [this.path, false]);
  1367. }
  1368. }
  1369. }
  1370. static get caninput() {
  1371. if (InGameWindow.Instance.drawban.mouseY > 50) {
  1372. return false;
  1373. }
  1374. else {
  1375. return true;
  1376. }
  1377. }
  1378. OnSlider() {
  1379. if (!this.enter)
  1380. return;
  1381. if (this.curattacktype == attacktype.one)
  1382. return;
  1383. this.curscreenpos = new Vector2(this.drawban.mouseX, this.drawban.mouseY);
  1384. if (this.startpoint == null) {
  1385. this.startpoint = this.curscreenpos.clone();
  1386. }
  1387. if (this.varpoint == null) {
  1388. this.varpoint = this.curscreenpos.clone();
  1389. }
  1390. if (this.drawban.mouseY < 50) {
  1391. this.curscreenpos = new Vector2(this.curscreenpos.x, 50);
  1392. }
  1393. if (this.drawban.mouseY > this.drawban.height) {
  1394. this.curscreenpos = new Vector2(this.curscreenpos.x, this.drawban.height);
  1395. }
  1396. if (this.drawban.mouseX < 0) {
  1397. this.curscreenpos = new Vector2(0, this.curscreenpos.y);
  1398. }
  1399. if (this.drawban.mouseX > this.drawban.width) {
  1400. this.curscreenpos = new Vector2(this.drawban.width, this.curscreenpos.y);
  1401. }
  1402. var curoffestx = this.curscreenpos.x - this.startpoint.x;
  1403. var curoffesty = this.curscreenpos.y - this.startpoint.y;
  1404. var dis = GameUtils.Vector2Length(this.varpoint, this.curscreenpos);
  1405. if (dis > 5) {
  1406. if (this.curattacktype == attacktype.two) {
  1407. this.path.push(new Laya.Vector3(curoffesty, Math.abs(curoffestx), 0));
  1408. }
  1409. else {
  1410. this.path.push(new Laya.Vector3(Math.abs(curoffestx), 0, curoffesty));
  1411. }
  1412. this.varpoint = this.curscreenpos;
  1413. }
  1414. this.points.push(curoffestx);
  1415. this.points.push(curoffesty);
  1416. if (this.drawbg) {
  1417. this.drawbg.graphics.clear();
  1418. this.curline = this.drawbg.graphics.drawLines(this.startpoint.x, this.startpoint.y, this.points, "#211f1e", 10);
  1419. }
  1420. }
  1421. }
  1422. var Vector3$3 = Laya.Vector3;
  1423. class CameraManager extends Laya.Script3D {
  1424. constructor() {
  1425. super();
  1426. this.follow = false;
  1427. this.offest = new Vector3$3();
  1428. this.followrate = 0.25;
  1429. this.curcamerapos = new Vector3$3();
  1430. this.curstarpos = new Vector3$3();
  1431. CameraManager.instance = this;
  1432. }
  1433. static get Instance() {
  1434. return CameraManager.instance;
  1435. }
  1436. SetFollow(_target) {
  1437. if (!this.m_cameranode) {
  1438. this.m_cameranode = SceneManager.maincamera;
  1439. }
  1440. this.follow = true;
  1441. this.FollowTarget = _target;
  1442. Vector3$3.subtract(_target.transform.position, this.m_cameranode.transform.position, this.offest);
  1443. }
  1444. SetOffest(_targetpos, _target) {
  1445. this.FollowTarget = _target;
  1446. Vector3$3.subtract(_target.transform.position, _targetpos, this.offest);
  1447. }
  1448. ResetTarget(_target) {
  1449. this.FollowTarget = _target;
  1450. this.follow = true;
  1451. }
  1452. StopFollow() {
  1453. this.follow = false;
  1454. this.FollowTarget = null;
  1455. }
  1456. onUpdate() {
  1457. if (this.follow && this.FollowTarget) {
  1458. Vector3$3.subtract(this.FollowTarget.transform.position, this.offest, this.curcamerapos);
  1459. var curposz = this.curcamerapos.z;
  1460. Vector3$3.lerp(SceneManager.maincamera.transform.position, this.curcamerapos, this.followrate, this.curcamerapos);
  1461. this.curcamerapos = new Vector3$3(this.curcamerapos.x, this.curcamerapos.y, curposz);
  1462. SceneManager.maincamera.transform.position = new Vector3$3(this.curcamerapos.x, this.curcamerapos.y, this.curcamerapos.z);
  1463. }
  1464. }
  1465. }
  1466. class WeaponTrigger extends Laya.Script3D {
  1467. onAwake() {
  1468. this.mainplayer = Player.mainpalyer;
  1469. }
  1470. onTriggerEnter(other) {
  1471. if (this.mainplayer.currolestate != RoleState.Runing)
  1472. return;
  1473. if (this.cantrigger(other)) {
  1474. EventManager.Trigger(EventType.Cut, [other]);
  1475. }
  1476. }
  1477. cantrigger(_collider) {
  1478. if (GameManager.Instance.curgamestate != GameState.Playing)
  1479. return;
  1480. if (_collider.collisionGroup == ColliderLay.monster) {
  1481. return true;
  1482. }
  1483. else if (_collider.collisionGroup == ColliderLay.bullet) {
  1484. return true;
  1485. }
  1486. else if (_collider.collisionGroup == ColliderLay.obstacle || _collider.collisionGroup == ColliderLay.grass) {
  1487. return true;
  1488. }
  1489. }
  1490. }
  1491. var Vector3$4 = Laya.Vector3;
  1492. class InputManager {
  1493. constructor() {
  1494. this.curtouthstate = TouchState.none;
  1495. this.touchPos = new Vector3$4();
  1496. this.curMousePos = new Vector3$4(0, 0, 0);
  1497. this.sliderawakesize = 5;
  1498. this.curdir = new Vector3$4();
  1499. this.curtouchpos = new Vector3$4();
  1500. InputManager.instance = this;
  1501. this.Init();
  1502. }
  1503. static get Instance() {
  1504. return InputManager.instance;
  1505. }
  1506. Init() {
  1507. Laya.stage.on(Laya.Event.MOUSE_DOWN, this, this.TouchEnter);
  1508. Laya.stage.on(Laya.Event.MOUSE_UP, this, this.OnTouchOut);
  1509. Laya.stage.on(Laya.Event.MOUSE_OUT, this, this.OnTouchOut);
  1510. Laya.stage.on(Laya.Event.MOUSE_MOVE, this, this.OnSliderMove);
  1511. EventManager.GameOn(GameState.Ready, this, this.OnGameReady);
  1512. EventManager.GameOn(GameState.Playing, this, this.OnGamePlaying);
  1513. EventManager.GameOn(GameState.Resurrection, this, this.OnGameResurrection);
  1514. EventManager.GameOn(GameState.Lose, this, this.OnGameLose);
  1515. EventManager.GameOn(GameState.Win, this, this.OnGameWin);
  1516. }
  1517. OnGameReady() {
  1518. Laya.timer.clear(this, this.OnTouchMove);
  1519. this.curtouthstate = TouchState.down;
  1520. InputManager.caninput = true;
  1521. }
  1522. OnGamePlaying() {
  1523. InputManager.caninput = true;
  1524. }
  1525. OnGameResurrection() {
  1526. Laya.timer.clear(this, this.OnTouchMove);
  1527. this.curtouthstate = TouchState.down;
  1528. InputManager.caninput = false;
  1529. }
  1530. OnGameLose() {
  1531. Laya.timer.clear(this, this.OnTouchMove);
  1532. this.curtouthstate = TouchState.down;
  1533. InputManager.caninput = false;
  1534. }
  1535. OnGameWin() {
  1536. Laya.timer.clear(this, this.OnTouchMove);
  1537. this.curtouthstate = TouchState.down;
  1538. InputManager.caninput = false;
  1539. }
  1540. TouchEnter(e) {
  1541. this.curtouthstate = TouchState.down;
  1542. EventManager.Trigger(EventType.InputState, [this.curtouthstate]);
  1543. if (!InputManager.caninput)
  1544. return;
  1545. this.curtouchpos = new Laya.Vector3(Laya.MouseManager.instance.mouseX, Laya.MouseManager.instance.mouseY, 0);
  1546. Laya.timer.clear(this, this.OnTouchMove);
  1547. EventManager.InputTrigger(TouchState.down, [this.curMousePos]);
  1548. Laya.timer.frameLoop(1, this, this.OnTouchMove);
  1549. }
  1550. OnTouchOut() {
  1551. this.curtouthstate = TouchState.up;
  1552. EventManager.Trigger(EventType.InputState, [this.curtouthstate]);
  1553. if (!InputManager.caninput)
  1554. return;
  1555. Laya.timer.clear(this, this.OnTouchMove);
  1556. EventManager.InputTrigger(TouchState.up);
  1557. }
  1558. OnTouchMove() {
  1559. this.curtouthstate = TouchState.slider;
  1560. EventManager.Trigger(EventType.InputState, [this.curtouthstate]);
  1561. if (!InputManager.caninput)
  1562. return;
  1563. this.curMousePos = new Laya.Vector3(Laya.MouseManager.instance.mouseX, Laya.MouseManager.instance.mouseY, 0);
  1564. var distance = Vector3$4.distance(this.curtouchpos, this.curMousePos);
  1565. if (distance > this.sliderawakesize) {
  1566. Vector3$4.subtract(this.curtouchpos, this.curMousePos, this.curdir);
  1567. Vector3$4.normalize(this.curdir, this.curdir);
  1568. EventManager.InputTrigger(TouchState.slider, [new Vector3$4(this.curdir.x, 0, this.curdir.y)]);
  1569. }
  1570. }
  1571. OnSliderMove() {
  1572. if (!InputManager.caninput)
  1573. return;
  1574. EventManager.InputTrigger(TouchState.slidermove);
  1575. }
  1576. }
  1577. InputManager.caninput = false;
  1578. var VoiceType;
  1579. (function (VoiceType) {
  1580. VoiceType[VoiceType["boom"] = 0] = "boom";
  1581. VoiceType[VoiceType["cut"] = 1] = "cut";
  1582. VoiceType[VoiceType["cutgrass"] = 2] = "cutgrass";
  1583. VoiceType[VoiceType["lose"] = 3] = "lose";
  1584. VoiceType[VoiceType["win"] = 4] = "win";
  1585. })(VoiceType || (VoiceType = {}));
  1586. var BgmType;
  1587. (function (BgmType) {
  1588. BgmType[BgmType["bgm"] = 0] = "bgm";
  1589. })(BgmType || (BgmType = {}));
  1590. class AudioControl {
  1591. static voiceres(_type) {
  1592. return "subpackage/res/sound/" + VoiceType[_type] + ".wav";
  1593. }
  1594. static PlayVoice(_type, _loop = false) {
  1595. if (!this.play)
  1596. return;
  1597. var loop = _loop ? 0 : 1;
  1598. Laya.SoundManager.playSound(this.voiceres(_type), loop);
  1599. }
  1600. static ClearAudio() {
  1601. Laya.SoundManager.stopAllSound();
  1602. }
  1603. static bgmres(_type) {
  1604. return "subpackage/res/sound/" + BgmType[_type] + ".mp3";
  1605. }
  1606. static PlayBgm(_type, _loop = true) {
  1607. if (!this.play)
  1608. return;
  1609. var loop = _loop ? 0 : 1;
  1610. Laya.SoundManager.playMusic(this.bgmres(_type), loop);
  1611. }
  1612. static ClearBgm() {
  1613. Laya.SoundManager.stopMusic();
  1614. }
  1615. }
  1616. AudioControl.play = true;
  1617. var Vector3$5 = Laya.Vector3;
  1618. var Vector4 = Laya.Vector4;
  1619. class PlayerData extends RoleData {
  1620. constructor(_id, _startpos) {
  1621. super(_id, _startpos);
  1622. }
  1623. }
  1624. class Player extends Role {
  1625. constructor() {
  1626. super(...arguments);
  1627. this.onland = true;
  1628. this.runpoint = [];
  1629. this.allfall = false;
  1630. this.allstand = false;
  1631. this.hands = [];
  1632. this.movespeed = 1.25;
  1633. this.curpos = new Vector3$5();
  1634. this.currot = new Laya.Quaternion();
  1635. this.landhit = new Laya.HitResult();
  1636. this.forwardhit = new Laya.HitResult();
  1637. this.playfall = false;
  1638. this.canfowardmove = true;
  1639. this.landg = 0;
  1640. this.falltime = 0;
  1641. this.standtime = -2;
  1642. this.startcamerapos = new Vector3$5();
  1643. this.startcamerarot = new Laya.Quaternion();
  1644. this.find = false;
  1645. }
  1646. static Create(_data, _roleskin) {
  1647. var roleid = _roleskin.skinid;
  1648. var curid = roleid <= 6 ? roleid : roleid - 12;
  1649. var roleasset = AssetManager.role.getValue(curid);
  1650. if (roleasset == null)
  1651. roleasset = AssetManager.role.getValue(1);
  1652. var model = PoolManager.GetSprite3D(roleasset);
  1653. SceneManager.mainscene.addChild(model);
  1654. model.transform.position = new Vector3$5(_data.startpos.x, _data.startpos.y + 0.2, _data.startpos.z);
  1655. model.transform.rotationEuler = new Vector3$5(model.transform.rotationEuler.x, 360 - _data.startpos.w, model.transform.rotationEuler.z);
  1656. var mainrole = model.addComponent(Player);
  1657. Player.mainpalyer = mainrole;
  1658. var mneck;
  1659. if (curid == 1 || curid == 7 || curid == 10) {
  1660. mneck = model.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(2).getChildAt(0);
  1661. }
  1662. else {
  1663. mneck = model.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(2).getChildAt(0).getChildAt(0);
  1664. }
  1665. mainrole.lefthandpoint = mneck.getChildAt(1).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0);
  1666. mainrole.righthandpoint = mneck.getChildAt(2).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0);
  1667. mainrole.WeaponShow();
  1668. mainrole.jseffect = PoolManager.GetSprite3D(AssetManager.effect.getValue(3));
  1669. model.addChild(mainrole.jseffect);
  1670. mainrole.jseffect.transform.localPosition = new Vector3$5(0, 0, 0);
  1671. mainrole.jseffect.active = false;
  1672. mainrole.mcollider = model.getChildAt(1).getComponent(Laya.PhysicsCollider);
  1673. mainrole.mcollider.collisionGroup = ColliderLay.player;
  1674. mainrole.handmaterial = new Laya.BlinnPhongMaterial;
  1675. mainrole.handmaterial.albedoColor = new Vector4(0, 0, 0);
  1676. mainrole.Init(model);
  1677. mainrole.OnInit();
  1678. return mainrole;
  1679. }
  1680. OnInit() {
  1681. this.mlevel = LevelManager.Instance.curlevel;
  1682. this.movespeed = this.mlevel.leveldata.missiondata.move;
  1683. this.RegEvent();
  1684. CameraManager.Instance.SetFollow(this.cursprite);
  1685. Laya.timer.frameLoop(1, this, this.OnLifeLoop);
  1686. this.runpoint.push(this.cursprite.transform.position.clone());
  1687. }
  1688. OnClear() {
  1689. this.ClearDraws();
  1690. EventManager.Off(EventType.DrawEnd, this, this.PathToCurve);
  1691. this.curlweapontrigger.destroy();
  1692. this.currweapontrigger.destroy();
  1693. PoolManager.RecoverSprite3D(this.curlweapon, true);
  1694. PoolManager.RecoverSprite3D(this.currweapon, true);
  1695. PoolManager.RecoverSprite3D(this.jseffect, true);
  1696. this.curlweaponeffect.destroy();
  1697. this.currweaponeffect.destroy();
  1698. if (this.wineffect)
  1699. PoolManager.RecoverSprite3D(this.wineffect);
  1700. EventManager.InputOff(TouchState.slider, this, this.OnSlider);
  1701. EventManager.InputOff(TouchState.up, this, this.OnUp);
  1702. EventManager.Off(EventType.Hit, this, this.OnHit);
  1703. EventManager.GameOff(GameState.Playing, this, this.OnGamePlaying);
  1704. Laya.timer.clear(this, this.OnLifeLoop);
  1705. this.runpoint = [];
  1706. }
  1707. ClearDraws() {
  1708. Laya.timer.clear(this, this.OnRotWeapon);
  1709. this.ClearHands();
  1710. if (this.currweaponrig != null) {
  1711. this.currweaponrig.destroy();
  1712. this.currdrawweaponcheck.destroy();
  1713. this.currweaponrig = null;
  1714. }
  1715. if (this.curlweaponrig != null) {
  1716. this.curlweaponrig.destroy();
  1717. this.curldrawweaponcheck.destroy();
  1718. this.curlweaponrig = null;
  1719. }
  1720. if (this.drawlweapon != null) {
  1721. this.drawlweapon.destroy();
  1722. this.drawlweapon = null;
  1723. }
  1724. if (this.drawrweapon != null) {
  1725. this.drawrweapon.destroy();
  1726. this.drawrweapon = null;
  1727. }
  1728. }
  1729. ShowWeapon(_active) {
  1730. this.curlweapon.active = _active;
  1731. this.currweapon.active = _active;
  1732. this.ClearDraws();
  1733. }
  1734. RegEvent() {
  1735. EventManager.InputOn(TouchState.slider, this, this.OnSlider);
  1736. EventManager.InputOn(TouchState.up, this, this.OnUp);
  1737. EventManager.On(EventType.Hit, this, this.OnHit);
  1738. EventManager.GameOn(GameState.Playing, this, this.OnGamePlaying);
  1739. EventManager.On(EventType.DrawEnd, this, this.PathToCurve);
  1740. }
  1741. OnGamePlaying() {
  1742. }
  1743. onStateChange(_state, _data) {
  1744. this.standtime = 0;
  1745. if (_state == RoleState.Die) {
  1746. this.OnEnterDie();
  1747. }
  1748. else if (_state == RoleState.Runing) {
  1749. this.OnEnterRunning();
  1750. }
  1751. else if (_state == RoleState.Idle) {
  1752. this.OnEnterIdle();
  1753. }
  1754. else if (_state == RoleState.Attack) {
  1755. this.OnEnterAttack(_data);
  1756. }
  1757. else if (_state == RoleState.Win) {
  1758. this.OnEnterWin();
  1759. }
  1760. }
  1761. ClearHands() {
  1762. for (var i = 0; i < this.hands.length; i++) {
  1763. var mhand = this.hands[i];
  1764. PoolManager.RecoverSprite3D(mhand);
  1765. }
  1766. this.hands = [];
  1767. }
  1768. PathToCurve(_path, one) {
  1769. this.curlweapon.active = false;
  1770. this.currweapon.active = false;
  1771. this.ClearDraws();
  1772. var lefthands = [];
  1773. var righthands = [];
  1774. this.drawlweapon = new Laya.Sprite3D();
  1775. SceneManager.mainscene.addChild(this.drawlweapon);
  1776. this.drawlweapon.transform.rotationEuler = new Vector3$5(0, 0, 0);
  1777. this.drawlweapon.transform.position = new Vector3$5(0, 0, 0);
  1778. this.drawrweapon = new Laya.Sprite3D();
  1779. SceneManager.mainscene.addChild(this.drawrweapon);
  1780. this.drawrweapon.transform.rotationEuler = new Vector3$5(0, 0, 0);
  1781. this.drawrweapon.transform.position = new Vector3$5(0, 0, 0);
  1782. this.curlweaponrig = this.drawlweapon.addComponent(Laya.Rigidbody3D);
  1783. this.comlbincollider = new Laya.CompoundColliderShape();
  1784. this.curlweaponrig.isKinematic = true;
  1785. this.curlweaponrig.colliderShape = this.comlbincollider;
  1786. this.curldrawweaponcheck = this.drawlweapon.addComponent(WeaponTrigger);
  1787. this.currweaponrig = this.drawrweapon.addComponent(Laya.Rigidbody3D);
  1788. this.comrbincollider = new Laya.CompoundColliderShape();
  1789. this.currweaponrig.isKinematic = true;
  1790. this.currweaponrig.colliderShape = this.comrbincollider;
  1791. this.currdrawweaponcheck = this.drawrweapon.addComponent(WeaponTrigger);
  1792. var leftpos = this.drawlweapon.transform.position;
  1793. var rightpos = this.drawrweapon.transform.position;
  1794. for (var i = 0; i < _path.length; i++) {
  1795. var curp = _path[i];
  1796. var curpoint = new Vector3$5(curp.x / 150, curp.y / 150, curp.z / 150);
  1797. var leftpoint = new Vector3$5(leftpos.x + curpoint.x, leftpos.y + curpoint.y, leftpos.z + curpoint.z);
  1798. lefthands.push(leftpoint);
  1799. var rightpoint = new Vector3$5(rightpos.x - curpoint.x, rightpos.y - curpoint.y, rightpos.z - curpoint.z);
  1800. righthands.push(rightpoint);
  1801. }
  1802. var leftcurve = new BezierCurve(lefthands);
  1803. var rightcurve = new BezierCurve(righthands);
  1804. this.CreateHand(leftcurve, rightcurve, one);
  1805. }
  1806. CreateHand(leftcurve, rightcurve, one) {
  1807. var PathLength = GameUtils.PathangleLength(leftcurve.pts);
  1808. var size = Math.floor(PathLength / 0.04);
  1809. for (var i = 0; i < size; i++) {
  1810. var pre = i * 0.02;
  1811. if (pre >= 1)
  1812. break;
  1813. var curpos = leftcurve.Interp(pre);
  1814. if (curpos == null || curpos == undefined) {
  1815. console.log(curpos);
  1816. return;
  1817. }
  1818. if (!one) {
  1819. curpos = new Vector3$5(curpos.x + 1, curpos.y + 1.2, curpos.z);
  1820. }
  1821. var lefthand = PoolManager.GetSprite3D(AssetManager.hand);
  1822. this.drawlweapon.addChild(lefthand);
  1823. this.hands.push(lefthand);
  1824. lefthand.transform.position = curpos;
  1825. lefthand.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  1826. if (pre > 0.9 || i % 20 == 0) {
  1827. var curshape = new Laya.SphereColliderShape(0.125);
  1828. var playerpos = this.drawlweapon.transform.position.clone();
  1829. curshape.localOffset = curpos;
  1830. this.comlbincollider.addChildShape(curshape);
  1831. }
  1832. var lookpos = leftcurve.Interp(pre + 0.01);
  1833. var quaternion1 = new Laya.Quaternion();
  1834. Laya.Quaternion.lookAt(lookpos, lefthand.transform.position, new Vector3$5(0, 0, 1), quaternion1);
  1835. quaternion1.invert(quaternion1);
  1836. lefthand.transform.rotation = quaternion1;
  1837. if (!one) {
  1838. var curpos = rightcurve.Interp(pre);
  1839. curpos = new Vector3$5(curpos.x - 1, curpos.y + 1.2, curpos.z);
  1840. }
  1841. var righthand = PoolManager.GetSprite3D(AssetManager.hand);
  1842. this.drawrweapon.addChild(righthand);
  1843. this.hands.push(righthand);
  1844. righthand.transform.position = curpos;
  1845. righthand.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  1846. if (pre > 0.9 || i % 20 == 0) {
  1847. var curshape = new Laya.SphereColliderShape(0.125);
  1848. var playerpos = this.drawrweapon.transform.position.clone();
  1849. curshape.localOffset = curpos;
  1850. this.comrbincollider.addChildShape(curshape);
  1851. }
  1852. var lookpos = leftcurve.Interp(pre + 0.01);
  1853. var quaternion1 = new Laya.Quaternion();
  1854. Laya.Quaternion.lookAt(lookpos, righthand.transform.position, new Vector3$5(0, 0, 1), quaternion1);
  1855. quaternion1.invert(quaternion1);
  1856. righthand.transform.rotation = quaternion1;
  1857. }
  1858. if (one) {
  1859. this.lefthandpoint.addChild(this.drawlweapon);
  1860. this.drawlweapon.transform.localPosition = new Vector3$5(0, 0, 0);
  1861. this.drawlweapon.transform.localRotationEuler = new Vector3$5(0, 0, 0);
  1862. this.drawlweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  1863. this.righthandpoint.addChild(this.drawrweapon);
  1864. this.drawrweapon.transform.localPosition = new Vector3$5(0, 0, 0);
  1865. this.drawrweapon.transform.localRotationEuler = new Vector3$5(0, 0, 0);
  1866. this.drawrweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  1867. }
  1868. else {
  1869. this.cursprite.addChild(this.drawlweapon);
  1870. this.drawlweapon.transform.localPosition = new Vector3$5(0, 0, 0);
  1871. this.drawlweapon.transform.localRotationEuler = new Vector3$5(0, 0, 0);
  1872. this.drawlweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  1873. this.cursprite.addChild(this.drawrweapon);
  1874. this.drawrweapon.transform.localPosition = new Vector3$5(0, 0, 0);
  1875. this.drawrweapon.transform.localRotationEuler = new Vector3$5(0, 0, 0);
  1876. this.drawrweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  1877. Laya.timer.frameLoop(1, this, this.OnRotWeapon);
  1878. }
  1879. }
  1880. OnRotWeapon() {
  1881. if (this.drawlweapon) {
  1882. this.drawlweapon.transform.rotate(new Vector3$5(0, 0.1, 0));
  1883. }
  1884. if (this.drawrweapon) {
  1885. this.drawrweapon.transform.rotate(new Vector3$5(0, 0.1, 0));
  1886. }
  1887. }
  1888. OnEnterWin() {
  1889. TtSdk.Shake(false);
  1890. this.curanimator.play("dance");
  1891. Laya.timer.clear(this, this.OnLifeLoop);
  1892. this.wineffect = PoolManager.GetSprite3D(AssetManager.effect.getValue(6));
  1893. SceneManager.mainscene.addChild(this.wineffect);
  1894. this.wineffect.transform.position = this.cursprite.transform.position;
  1895. AudioControl.ClearBgm();
  1896. AudioControl.PlayVoice(VoiceType.win);
  1897. Laya.timer.once(2500, this, () => {
  1898. GameManager.Instance.ChangeGameState(GameState.Win);
  1899. });
  1900. }
  1901. OnHit(_monster) {
  1902. if (InputManager.caninput == false)
  1903. return;
  1904. this.ChangeState(RoleState.Die);
  1905. }
  1906. OnEnterAttack(_sprite) {
  1907. }
  1908. OnEnterIdle() {
  1909. if (!this.playfall)
  1910. this.curanimator.play("idle");
  1911. }
  1912. OnEnterRunning() {
  1913. if (!this.playfall)
  1914. this.curanimator.play("run");
  1915. }
  1916. OnEnterDie() {
  1917. TtSdk.Shake(false);
  1918. AudioControl.ClearBgm();
  1919. AudioControl.PlayVoice(VoiceType.lose);
  1920. this.curanimator.play("die");
  1921. CameraManager.Instance.StopFollow();
  1922. Laya.timer.frameOnce(80, this, () => {
  1923. GameManager.Instance.ChangeGameState(GameState.Lose);
  1924. });
  1925. }
  1926. OnEnterLose() {
  1927. }
  1928. OnGameWin(_player) {
  1929. }
  1930. OnSlider(_dir) {
  1931. if (GameManager.Instance.curgamestate != GameState.Playing)
  1932. return;
  1933. if (!InGameWindow.caninput)
  1934. return;
  1935. var rotdir = _dir;
  1936. this.Move(_dir, rotdir);
  1937. }
  1938. get revivepoint() {
  1939. if (this.runpoint.length > 0) {
  1940. return this.runpoint[0];
  1941. }
  1942. var datapos = LevelManager.Instance.curlevel.leveldata.playerdata.startpos;
  1943. return new Vector3$5(datapos.x, datapos.y, datapos.z);
  1944. }
  1945. Revive() {
  1946. this.cursprite.transform.position = this.revivepoint;
  1947. this.end = false;
  1948. this.ChangeState(RoleState.Idle, true);
  1949. CameraManager.Instance.ResetTarget(this.cursprite);
  1950. this.SetWuDi();
  1951. }
  1952. SetWuDi(time = 5000) {
  1953. this.wudi = true;
  1954. Laya.timer.once(time, this, () => {
  1955. this.wudi = false;
  1956. });
  1957. }
  1958. Move(_dir, rotdir) {
  1959. this.ChangeState(RoleState.Runing);
  1960. if (this.currolestate != RoleState.Runing)
  1961. return;
  1962. var curdir = new Vector3$5(-rotdir.x, -rotdir.y, -rotdir.z);
  1963. Laya.Quaternion.rotationLookAt(curdir, new Vector3$5(0, 1, 0), this.currot);
  1964. this.currot.invert(this.currot);
  1965. Laya.Quaternion.slerp(this.cursprite.transform.rotation, this.currot, 0.06, this.currot);
  1966. this.cursprite.transform.rotation = this.currot;
  1967. Vector3$5.add(this.cursprite.transform.position, _dir, this.curpos);
  1968. var addv = 0.1 * this.movespeed;
  1969. Vector3$5.lerp(this.cursprite.transform.position, this.curpos, addv, this.curpos);
  1970. if (this.canfowardmove) {
  1971. this.cursprite.transform.position = this.curpos;
  1972. }
  1973. EventManager.Trigger(EventType.Running, [this.cursprite.transform.position.clone()]);
  1974. }
  1975. OnUp() {
  1976. this.ChangeState(RoleState.Idle);
  1977. }
  1978. WeaponShow(_skin = null) {
  1979. var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[skintype.weapon];
  1980. var equiipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
  1981. equiipskin = _skin == null ? equiipskin : _skin;
  1982. var assetid = equiipskin.skinid - 6;
  1983. if (this.curlweapon != null) {
  1984. PoolManager.RecoverSprite3D(this.curlweapon);
  1985. this.curlweaponeffect.destroy();
  1986. }
  1987. var weaponasset = AssetManager.weapon.getValue(assetid);
  1988. if (weaponasset == null)
  1989. weaponasset = AssetManager.weapon.getValue(1);
  1990. this.curlweapon = PoolManager.GetSprite3D(weaponasset);
  1991. this.curlweapontrigger = this.curlweapon.getChildAt(0).addComponent(WeaponTrigger);
  1992. this.lefthandpoint.addChild(this.curlweapon);
  1993. this.curlweapon.transform.localPosition = new Vector3$5(0, 0, 0);
  1994. this.curlweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  1995. var equiptw = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[skintype.tw];
  1996. var equiptwskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equiptw);
  1997. var twasset = AssetManager.tw.getValue(equiptwskin.skinid - 24);
  1998. this.curlweaponeffect = PoolManager.GetSprite3D(twasset);
  1999. this.curlweapon.addChild(this.curlweaponeffect);
  2000. this.curlweaponeffect.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  2001. this.curlweaponeffect.transform.localPosition = new Vector3$5(0, 1, 0);
  2002. if (this.currweapon != null) {
  2003. PoolManager.RecoverSprite3D(this.currweapon);
  2004. this.currweaponeffect.destroy();
  2005. }
  2006. this.currweapon = PoolManager.GetSprite3D(weaponasset);
  2007. this.currweapontrigger = this.currweapon.getChildAt(0).addComponent(WeaponTrigger);
  2008. this.righthandpoint.addChild(this.currweapon);
  2009. this.currweapon.transform.localPosition = new Vector3$5(0, 0, 0);
  2010. this.currweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  2011. this.currweaponeffect = PoolManager.GetSprite3D(twasset);
  2012. this.currweapon.addChild(this.currweaponeffect);
  2013. this.currweaponeffect.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  2014. this.currweaponeffect.transform.localPosition = new Vector3$5(0, 1, 0);
  2015. }
  2016. TurnWeaponEffect(_skin) {
  2017. var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[skintype.tw];
  2018. var equiipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
  2019. equiipskin = _skin == null ? equiipskin : _skin;
  2020. var assetid = equiipskin.skinid - 24;
  2021. var twasset = AssetManager.tw.getValue(assetid);
  2022. if (this.currweaponeffect)
  2023. PoolManager.RecoverSprite3D(this.currweaponeffect);
  2024. this.currweaponeffect = PoolManager.GetSprite3D(twasset);
  2025. this.currweapon.addChild(this.currweaponeffect);
  2026. this.currweaponeffect.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  2027. this.currweaponeffect.transform.localPosition = new Vector3$5(0, 1, 0);
  2028. if (this.curlweaponeffect)
  2029. PoolManager.RecoverSprite3D(this.curlweaponeffect);
  2030. this.curlweaponeffect = PoolManager.GetSprite3D(twasset);
  2031. this.curlweapon.addChild(this.curlweaponeffect);
  2032. this.curlweaponeffect.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  2033. this.curlweaponeffect.transform.localPosition = new Vector3$5(0, 1, 0);
  2034. }
  2035. get LandCheck() {
  2036. var hitenter = false;
  2037. var curpos = this.cursprite.transform.position;
  2038. var startpoint = new Vector3$5(curpos.x, curpos.y + 10, curpos.z);
  2039. var dir = new Vector3$5(0, -1, 0);
  2040. var ray = new Laya.Ray(startpoint, dir);
  2041. var landlay = ColliderLay.plane | ColliderLay.end;
  2042. if (SceneManager.mainscene.physicsSimulation.rayCast(ray, this.landhit, 100, 1, landlay)) {
  2043. var hight = startpoint.y - this.landhit.point.y;
  2044. hitenter = true;
  2045. hitenter = (hight > 9 && hight < 11) ? true : false;
  2046. if (this.landhit.collider.collisionGroup == ColliderLay.end) {
  2047. this.ChangeState(RoleState.Win);
  2048. }
  2049. }
  2050. return hitenter;
  2051. }
  2052. get ForwardCheck() {
  2053. var hitenter = true;
  2054. var curpos = this.cursprite.transform.position;
  2055. var startpoint = new Vector3$5(curpos.x, curpos.y + 0.1, curpos.z);
  2056. var dir = new Vector3$5();
  2057. this.cursprite.transform.getForward(dir);
  2058. dir = new Vector3$5(-dir.x, -dir.y, -dir.z);
  2059. var ray = new Laya.Ray(startpoint, dir);
  2060. if (SceneManager.mainscene.physicsSimulation.rayCast(ray, this.forwardhit, 0.5)) {
  2061. if (this.forwardhit.collider.collisionGroup == ColliderLay.obstacle) {
  2062. return false;
  2063. }
  2064. }
  2065. return hitenter;
  2066. }
  2067. OnLifeLoop() {
  2068. if (GameManager.Instance.curgamestate != GameState.Playing)
  2069. return;
  2070. var curland = this.LandCheck;
  2071. if (curland) {
  2072. var mpos = this.cursprite.transform.position;
  2073. if (this.landhit) {
  2074. this.cursprite.transform.position = new Vector3$5(mpos.x, this.landhit.point.y, mpos.z);
  2075. this.runpoint.push(this.cursprite.transform.position.clone());
  2076. if (this.runpoint.length > 50) {
  2077. this.runpoint.splice(0, 1);
  2078. }
  2079. }
  2080. }
  2081. if (!this.onland && curland) {
  2082. this.playfall = false;
  2083. this.jseffect.active = false;
  2084. if (this.currolestate == RoleState.Idle) {
  2085. this.curanimator.play("idle");
  2086. }
  2087. else if (this.currolestate == RoleState.Runing) {
  2088. this.curanimator.play("run");
  2089. }
  2090. this.landg = 0;
  2091. this.falltime = 0;
  2092. }
  2093. this.onland = curland;
  2094. if (!this.onland) {
  2095. if (this.playfall == false) {
  2096. this.playfall = true;
  2097. this.curanimator.play("fall");
  2098. this.jseffect.active = true;
  2099. }
  2100. if (this.landg != 0.1)
  2101. this.landg = GameUtils.lerp(this.landg, 0.1, 0.025);
  2102. var mpos = this.cursprite.transform.position;
  2103. this.cursprite.transform.position = new Vector3$5(mpos.x, mpos.y - this.landg, mpos.z);
  2104. this.falltime += 0.016;
  2105. if (!this.allfall && this.falltime > 5) {
  2106. this.allfall = true;
  2107. }
  2108. this.CheckFallDie();
  2109. }
  2110. this.canfowardmove = this.ForwardCheck;
  2111. if (this.currolestate == RoleState.Idle) {
  2112. this.standtime += 0.016;
  2113. if (!this.allstand && this.standtime > 10) {
  2114. this.allstand = true;
  2115. }
  2116. }
  2117. }
  2118. CheckFallDie() {
  2119. if (this.cursprite.transform.position.y < LevelManager.Instance.curlevel.minhight - 3) {
  2120. this.ChangeState(RoleState.Die);
  2121. }
  2122. }
  2123. FindBoos(_boos) {
  2124. if (this.find)
  2125. return;
  2126. this.find = true;
  2127. InputManager.Instance.OnTouchOut();
  2128. InputManager.caninput = false;
  2129. this.startcamerapos = SceneManager.maincamera.transform.position.clone();
  2130. this.startcamerarot = SceneManager.maincamera.transform.rotation.clone();
  2131. CameraManager.Instance.StopFollow();
  2132. this.ChangeState(RoleState.Wait);
  2133. var lookdir = new Vector3$5();
  2134. var boospos = _boos.cursprite.transform.position.clone();
  2135. var mpos = Player.mainpalyer.cursprite.transform.position.clone();
  2136. Vector3$5.subtract(mpos, boospos, lookdir);
  2137. Vector3$5.normalize(lookdir, lookdir);
  2138. Vector3$5.scale(lookdir, 6, lookdir);
  2139. var lookpos = new Vector3$5();
  2140. Vector3$5.add(boospos, lookdir, lookpos);
  2141. lookpos = new Vector3$5(lookpos.x, lookpos.y + 3, lookpos.z);
  2142. var booslookpos = new Vector3$5(boospos.x, boospos.y + 1, boospos.z);
  2143. var ssf = GameUtils.TweenMove(SceneManager.maincamera.transform, lookpos, 1.2, Laya.Handler.create(this, () => {
  2144. ssf.clear();
  2145. _boos.Provocation(() => {
  2146. this.BackCa();
  2147. });
  2148. }), Laya.Ease.quadOut, booslookpos);
  2149. }
  2150. BackCa() {
  2151. SceneManager.maincamera.transform.rotation = this.startcamerarot;
  2152. CameraManager.Instance.ResetTarget(this.cursprite);
  2153. InputManager.caninput = true;
  2154. }
  2155. }
  2156. var Vector3$6 = Laya.Vector3;
  2157. class RigObj {
  2158. constructor(_target, _complete = null, autocleartime = 2.5, rottime = 0) {
  2159. this.awake = false;
  2160. this.minhight = 0;
  2161. this.mforce = 0;
  2162. this.starty = 0;
  2163. this.offestY = 0;
  2164. this.g = 0.1;
  2165. this.m_time = 0;
  2166. this.curPos = new Vector3$6();
  2167. this.screenhit = new Laya.HitResult();
  2168. this.enter = false;
  2169. this.completecallback = _complete;
  2170. Laya.timer.frameLoop(1, this, this.LifeLoop);
  2171. if (rottime < autocleartime)
  2172. rottime = 0;
  2173. this.rottime = rottime;
  2174. if (autocleartime > 0) {
  2175. var lifetime = autocleartime > rottime ? autocleartime : rottime;
  2176. Laya.timer.once(1000 * lifetime, this, this.Destory);
  2177. }
  2178. this.msprite = _target;
  2179. this.starty = _target.transform.position.y;
  2180. this.minhight = this.starty;
  2181. }
  2182. AddForce(_dir, _force, _rotSpeed = 1) {
  2183. this.awake = true;
  2184. this.curdir = new Vector3$6();
  2185. Vector3$6.normalize(_dir, this.curdir);
  2186. Vector3$6.scale(this.curdir, _force, this.curdir);
  2187. var xr = Math.random() > 0.5 ? 1 : -1;
  2188. var yr = Math.random() > 0.5 ? 1 : -1;
  2189. var zr = Math.random() > 0.5 ? 1 : -1;
  2190. this.currotdir = new Vector3$6(Math.random() * 0.02 * xr * _rotSpeed, Math.random() * 0.02 * yr * _rotSpeed, Math.random() * 0.02 * zr * _rotSpeed);
  2191. }
  2192. LifeLoop() {
  2193. if (!this.awake)
  2194. return;
  2195. var checkdis = this.PlaneCheck;
  2196. if (checkdis != null && checkdis <= 0) {
  2197. this.Destory();
  2198. return;
  2199. }
  2200. var mpos = this.msprite.transform.position;
  2201. this.m_time += 0.005;
  2202. this.offestY -= this.g * this.m_time * this.m_time;
  2203. Vector3$6.add(mpos, this.curdir, this.curPos);
  2204. Vector3$6.lerp(mpos, this.curPos, 0.12, this.curPos);
  2205. this.msprite.transform.rotate(this.currotdir);
  2206. if (this.msprite.transform.position.y >= this.minhight) {
  2207. var curoffestx = this.curPos.x - mpos.x;
  2208. var curoffesty = this.curPos.y - mpos.y + this.offestY;
  2209. var curoffextz = this.curPos.z - mpos.z;
  2210. Vector3$6.add(mpos, new Vector3$6(curoffestx, curoffesty, curoffextz), this.curPos);
  2211. this.msprite.transform.position = this.curPos;
  2212. }
  2213. if (curoffesty < 0 && this.msprite.transform.position.y < this.minhight && this.rottime > 0) {
  2214. this.msprite.transform.position = new Vector3$6(mpos.x, this.minhight, mpos.z);
  2215. this.Destory();
  2216. }
  2217. }
  2218. Destory() {
  2219. this.Clear();
  2220. this.FallDown(() => {
  2221. if (this.completecallback != null) {
  2222. this.completecallback();
  2223. }
  2224. });
  2225. }
  2226. Clear() {
  2227. Laya.timer.clearAll(this);
  2228. Laya.timer.clear(this, this.LifeLoop);
  2229. }
  2230. FallDown(_cb) {
  2231. var mpos = this.msprite.transform.position.clone();
  2232. var targetpos = new Vector3$6(mpos.x, mpos.y - 2, mpos.z);
  2233. GameUtils.TweenMove(this.msprite.transform, targetpos, 0.8, Laya.Handler.create(this, () => {
  2234. _cb();
  2235. }));
  2236. }
  2237. get PlaneCheck() {
  2238. var centerpos = this.msprite.transform.position;
  2239. var curray = new Laya.Ray(centerpos, new Vector3$6(0, -1, 0));
  2240. if (SceneManager.mainscene.physicsSimulation.rayCast(curray, this.screenhit, 100)) {
  2241. if (this.screenhit) {
  2242. var dis = this.msprite.transform.position.y - this.screenhit.point.y;
  2243. if (dis > 0) {
  2244. return dis;
  2245. }
  2246. }
  2247. return null;
  2248. }
  2249. else {
  2250. return null;
  2251. }
  2252. }
  2253. }
  2254. var MonsterType;
  2255. (function (MonsterType) {
  2256. MonsterType[MonsterType["BallBoss"] = 0] = "BallBoss";
  2257. MonsterType[MonsterType["Shooter"] = 1] = "Shooter";
  2258. MonsterType[MonsterType["Warrior"] = 2] = "Warrior";
  2259. })(MonsterType || (MonsterType = {}));
  2260. var Weapontype;
  2261. (function (Weapontype) {
  2262. Weapontype[Weapontype["Guitar"] = 1] = "Guitar";
  2263. Weapontype[Weapontype["Fireaxe"] = 2] = "Fireaxe";
  2264. Weapontype[Weapontype["Chair"] = 3] = "Chair";
  2265. Weapontype[Weapontype["Pole"] = 4] = "Pole";
  2266. Weapontype[Weapontype["shuriken"] = 5] = "shuriken";
  2267. Weapontype[Weapontype["Pistol"] = 6] = "Pistol";
  2268. Weapontype[Weapontype["missile"] = 7] = "missile";
  2269. Weapontype[Weapontype["wtaagsg"] = 8] = "wtaagsg";
  2270. })(Weapontype || (Weapontype = {}));
  2271. class MonsterConfig {
  2272. constructor() {
  2273. this.bulletamount = 1;
  2274. this.recognition = 6;
  2275. this.attack_range = 2;
  2276. this.move_speed = 0.3;
  2277. this.frequency = 1;
  2278. this.bullet_speed = 1;
  2279. }
  2280. }
  2281. class MonsterDataManager {
  2282. constructor() {
  2283. MonsterDataManager.OnInit();
  2284. }
  2285. static OnInit() {
  2286. var enemy = PlayerAccount.CurAccountData.GetConfig(AccountConfig.enemy);
  2287. for (var key in enemy) {
  2288. var curdata = enemy[key];
  2289. var id = Number(curdata.id);
  2290. var monsterdata = new MonsterConfig();
  2291. monsterdata.recognition = Number(curdata.recognition);
  2292. monsterdata.attack_range = Number(curdata.attack_range);
  2293. monsterdata.enemy_type = curdata.enemy_type;
  2294. monsterdata.move_speed = Number(curdata.move_speed);
  2295. monsterdata.frequency = Number(curdata.frequency);
  2296. monsterdata.bullet_speed = Number(curdata.bullet_speed);
  2297. this.MonsterDic.add(id, monsterdata);
  2298. }
  2299. var guitarmonster = this.MonsterDic.getValue(1);
  2300. guitarmonster.monstertype = MonsterType.Warrior;
  2301. guitarmonster.weapontype = Weapontype.Guitar;
  2302. var fireaxemonster = this.MonsterDic.getValue(2);
  2303. fireaxemonster.monstertype = MonsterType.Warrior;
  2304. fireaxemonster.weapontype = Weapontype.Fireaxe;
  2305. var chairmonster = this.MonsterDic.getValue(3);
  2306. chairmonster.monstertype = MonsterType.Warrior;
  2307. chairmonster.weapontype = Weapontype.Chair;
  2308. var polemonster = this.MonsterDic.getValue(4);
  2309. polemonster.monstertype = MonsterType.Warrior;
  2310. polemonster.weapontype = Weapontype.Pole;
  2311. var shurikenmonster1 = this.MonsterDic.getValue(5);
  2312. shurikenmonster1.monstertype = MonsterType.Shooter;
  2313. shurikenmonster1.bulletamount = 1;
  2314. shurikenmonster1.weapontype = Weapontype.shuriken;
  2315. var shurikenmonster2 = this.MonsterDic.getValue(6);
  2316. shurikenmonster2.monstertype = MonsterType.Shooter;
  2317. shurikenmonster2.weapontype = Weapontype.shuriken;
  2318. shurikenmonster2.bulletamount = 2;
  2319. var pistolmonster = this.MonsterDic.getValue(7);
  2320. pistolmonster.monstertype = MonsterType.Shooter;
  2321. pistolmonster.bulletamount = 1;
  2322. pistolmonster.weapontype = Weapontype.Pistol;
  2323. var pistolboos = this.MonsterDic.getValue(8);
  2324. pistolboos.monstertype = MonsterType.Shooter;
  2325. pistolboos.weapontype = Weapontype.Pistol;
  2326. pistolboos.bulletamount = 3;
  2327. pistolboos.masktype = 2;
  2328. pistolboos.provocationclip = "gunboosprovocation";
  2329. var shurikenboos = this.MonsterDic.getValue(9);
  2330. shurikenboos.monstertype = MonsterType.Shooter;
  2331. shurikenboos.weapontype = Weapontype.shuriken;
  2332. shurikenboos.bulletamount = 3;
  2333. shurikenboos.masktype = 3;
  2334. shurikenboos.provocationclip = "dartsboosprovocation";
  2335. var ballboos = this.MonsterDic.getValue(10);
  2336. ballboos.monstertype = MonsterType.BallBoss;
  2337. ballboos.weapontype = Weapontype.wtaagsg;
  2338. ballboos.bulletamount = 1;
  2339. ballboos.masktype = 5;
  2340. ballboos.provocationclip = "chuiboosprovocation";
  2341. var rooketboos = this.MonsterDic.getValue(11);
  2342. rooketboos.monstertype = MonsterType.Shooter;
  2343. rooketboos.weapontype = Weapontype.missile;
  2344. rooketboos.bulletamount = 1;
  2345. rooketboos.masktype = 4;
  2346. rooketboos.provocationclip = "paoboosprovocation";
  2347. }
  2348. }
  2349. MonsterDataManager.MonsterDic = new Dictionary();
  2350. var Vector3$7 = Laya.Vector3;
  2351. class MonsterData extends RoleData {
  2352. constructor(_id, _startpos) {
  2353. super(_id, _startpos);
  2354. this.boos = false;
  2355. this.monsterconfig = MonsterDataManager.MonsterDic.getValue(_id);
  2356. }
  2357. }
  2358. class Warrior extends Role {
  2359. constructor() {
  2360. super(...arguments);
  2361. this.movespeed = 0.3;
  2362. this.awakedistance = 8;
  2363. this.attackdistance = 2;
  2364. this.attackrate = 1;
  2365. this.life = false;
  2366. this.movedir = new Vector3$7();
  2367. this.movepos = new Vector3$7();
  2368. this.moverot = new Laya.Quaternion;
  2369. this.landhit = new Laya.HitResult();
  2370. }
  2371. static Create(_data) {
  2372. var roleid = _data.id;
  2373. var roleasset = AssetManager.enemy.getValue(1);
  2374. var model = PoolManager.GetSprite3D(roleasset);
  2375. SceneManager.mainscene.addChild(model);
  2376. model.transform.position = new Vector3$7(_data.startpos.x, _data.startpos.y, _data.startpos.z);
  2377. model.transform.rotationEuler = new Vector3$7(model.transform.rotationEuler.x, 360 - _data.startpos.w, model.transform.rotationEuler.z);
  2378. var monster = model.addComponent(Warrior);
  2379. monster.mdata = _data;
  2380. monster.provocationclip = _data.monsterconfig.provocationclip;
  2381. var neck = model.getChildAt(0).getChildAt(0).getChildAt(1).getChildAt(0).getChildAt(2).getChildAt(0);
  2382. monster.headpoint = neck.getChildAt(0).getChildAt(0);
  2383. monster.weaponpoint = neck.getChildAt(2).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0);
  2384. monster.Init(model);
  2385. monster.collider = model.getChildAt(1).getComponent(Laya.PhysicsCollider);
  2386. monster.collider.collisionGroup = ColliderLay.monster;
  2387. monster.collider.enabled = true;
  2388. monster.SkinShow(monster.mdata.monsterconfig.masktype, monster.mdata.monsterconfig.weapontype);
  2389. monster.awakedistance = _data.monsterconfig.recognition;
  2390. monster.attackdistance = _data.monsterconfig.attack_range;
  2391. monster.movespeed = _data.monsterconfig.move_speed;
  2392. monster.attackrate = _data.monsterconfig.frequency;
  2393. monster.upsprite = model.getChildAt(0).getChildAt(2);
  2394. monster.upsprite.active = true;
  2395. monster.downsprite = model.getChildAt(0).getChildAt(1);
  2396. monster.downsprite.active = true;
  2397. monster.OnInit();
  2398. return monster;
  2399. }
  2400. OnInit() {
  2401. this.mlevel = LevelManager.Instance.curlevel;
  2402. this.RegEvent();
  2403. if (this.mdata.boos) {
  2404. this.cursprite.transform.setWorldLossyScale(new Vector3$7(1.5, 1.5, 1.5));
  2405. }
  2406. }
  2407. OnClear() {
  2408. EventManager.Off(EventType.Cut, this, this.OnCut);
  2409. EventManager.Off(EventType.Running, this, this.OnRunning);
  2410. Laya.timer.clearAll(this);
  2411. Laya.timer.clear(this, this.CheckAttack);
  2412. Laya.timer.clear(this, this.AttackLoop);
  2413. Laya.timer.clear(this, this.MoveLoop);
  2414. Laya.timer.clear(this, this.OnLife);
  2415. this.SkinShow(0, 0);
  2416. if (this.cuteffect)
  2417. PoolManager.RecoverSprite3D(this.cuteffect);
  2418. this.curanimator.speed = 1;
  2419. if (this.diedownsprite) {
  2420. var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
  2421. dieani.speed = 1;
  2422. PoolManager.RecoverSprite3D(this.diedownsprite);
  2423. }
  2424. }
  2425. RegEvent() {
  2426. EventManager.On(EventType.Cut, this, this.OnCut);
  2427. EventManager.On(EventType.Running, this, this.OnRunning);
  2428. }
  2429. WithPlaying() {
  2430. if (this.mdata.boos) {
  2431. Player.mainpalyer.FindBoos(this);
  2432. }
  2433. }
  2434. OnCut(_collider) {
  2435. if (_collider != this.collider)
  2436. return;
  2437. TtSdk.Shake(false);
  2438. AudioControl.PlayVoice(VoiceType.cut);
  2439. if (this.AttackTarget)
  2440. this.StopMove();
  2441. this.ChangeState(RoleState.Die, !PlayerAccount.CurAccountData.cuteffect);
  2442. }
  2443. get displayer() {
  2444. var curpos = this.cursprite.transform.position.clone();
  2445. var mainplayerpos = Player.mainpalyer.cursprite.transform.position.clone();
  2446. var dis = GameUtils.Vector32Length(mainplayerpos, curpos);
  2447. return dis;
  2448. }
  2449. OnRunning(_playerpos) {
  2450. if (this.life)
  2451. return;
  2452. var curpos = this.cursprite.transform.position.clone();
  2453. var dis = GameUtils.Vector32Length(_playerpos, curpos);
  2454. if (dis < this.attackdistance && this.currolestate == RoleState.Idle) {
  2455. this.ChangeState(RoleState.Attack);
  2456. }
  2457. else if (dis < this.awakedistance && this.currolestate == RoleState.Idle) {
  2458. this.ChangeState(RoleState.Awake);
  2459. }
  2460. }
  2461. OnLife() {
  2462. if (Player.mainpalyer.currolestate == RoleState.Die || Player.mainpalyer.currolestate == RoleState.Win)
  2463. return;
  2464. if (this.displayer < this.attackdistance && this.currolestate == RoleState.Idle) {
  2465. this.ChangeState(RoleState.Attack);
  2466. }
  2467. else {
  2468. this.ChangeState(RoleState.Awake);
  2469. }
  2470. }
  2471. onStateChange(_state, _data) {
  2472. Laya.timer.clearAll(this);
  2473. Laya.timer.clear(this, this.AttackLoop);
  2474. Laya.timer.clear(this, this.MoveLoop);
  2475. Laya.timer.clear(this, this.OnLife);
  2476. if (_state == RoleState.Awake) {
  2477. this.OnEnterAwake();
  2478. }
  2479. else if (_state == RoleState.Die) {
  2480. this.OnEnterDie(_data);
  2481. }
  2482. else if (_state == RoleState.Attack) {
  2483. this.OnEnterAttack();
  2484. }
  2485. else if (_state == RoleState.Idle) {
  2486. this.OnEnterIdle();
  2487. }
  2488. }
  2489. OnEnterIdle() {
  2490. this.curanimator.play("warrioridle");
  2491. if (this.life) {
  2492. Laya.timer.frameOnce(40, this, () => {
  2493. Laya.timer.clear(this, this.OnLife);
  2494. Laya.timer.frameLoop(1, this, this.OnLife);
  2495. });
  2496. }
  2497. }
  2498. OnEnterAttack() {
  2499. Laya.timer.clear(this, this.AttackLoop);
  2500. this.AttackLoop();
  2501. }
  2502. AttackLoop() {
  2503. if (!InputManager.caninput)
  2504. return;
  2505. this.curanimator.play("attack");
  2506. Laya.timer.frameOnce(40, this, this.CheckAttack);
  2507. var attackduation = 100 / this.attackrate;
  2508. Laya.timer.frameOnce(attackduation, this, () => {
  2509. this.ChangeState(RoleState.Idle);
  2510. });
  2511. }
  2512. CheckAttack() {
  2513. if (this.currolestate == RoleState.Die)
  2514. return;
  2515. if (this.displayer < this.attackdistance * 1.4) {
  2516. Player.mainpalyer.ChangeState(RoleState.Die);
  2517. }
  2518. }
  2519. OnEnterAwake() {
  2520. EventManager.Off(EventType.Running, this, this.OnRunning);
  2521. this.life = true;
  2522. this.curanimator.play("run");
  2523. this.SetMove(Player.mainpalyer);
  2524. }
  2525. SetMove(_target) {
  2526. this.AttackTarget = _target;
  2527. Laya.timer.clear(this, this.MoveLoop);
  2528. Laya.timer.frameLoop(1, this, this.MoveLoop);
  2529. }
  2530. StopMove() {
  2531. Laya.timer.clear(this, this.MoveLoop);
  2532. this.AttackTarget = null;
  2533. }
  2534. MoveLoop() {
  2535. if (!InputManager.caninput)
  2536. return;
  2537. if (this.AttackTarget && this.AttackTarget.currolestate != RoleState.Wait) {
  2538. var mpos = this.cursprite.transform.position.clone();
  2539. Vector3$7.subtract(this.AttackTarget.cursprite.transform.position, mpos, this.movedir);
  2540. Vector3$7.normalize(this.movedir, this.movedir);
  2541. Vector3$7.scale(this.movedir, this.movespeed, this.movedir);
  2542. Vector3$7.add(mpos, this.movedir, this.movepos);
  2543. Vector3$7.lerp(mpos, this.movepos, 0.12, this.movepos);
  2544. var curland = this.LandCheck;
  2545. if (curland) {
  2546. var gasgag = this.cursprite.transform.position;
  2547. if (this.landhit) {
  2548. this.cursprite.transform.position = new Vector3$7(gasgag.x, this.landhit.point.y, gasgag.z);
  2549. }
  2550. this.cursprite.transform.position = this.movepos;
  2551. }
  2552. this.cursprite.transform.rotation = this.RotLook(this.AttackTarget.cursprite.transform.position);
  2553. if (this.displayer < this.attackdistance) {
  2554. this.ChangeState(RoleState.Attack);
  2555. }
  2556. }
  2557. }
  2558. RotLook(_targetpos, _lerp = true) {
  2559. var mpos = this.cursprite.transform.position.clone();
  2560. _targetpos = new Vector3$7(_targetpos.x, mpos.y, _targetpos.z);
  2561. Laya.Quaternion.lookAt(_targetpos, mpos, new Vector3$7(0, 1, 0), this.moverot);
  2562. this.moverot.invert(this.moverot);
  2563. if (_lerp)
  2564. Laya.Quaternion.slerp(this.cursprite.transform.rotation, this.moverot, 0.2, this.moverot);
  2565. this.cursprite.transform.rotation = this.moverot;
  2566. return this.moverot;
  2567. }
  2568. BeBoom() {
  2569. this.ChangeState(RoleState.Die, true);
  2570. }
  2571. OnEnterDie(_die = false) {
  2572. GameManager.Instance.goldnum += LevelManager.Instance.curlevel.leveldata.missiondata.masterdrop;
  2573. if (_die) {
  2574. this.collider.enabled = false;
  2575. this.curanimator.play("die");
  2576. if (this.mdata.boos)
  2577. EventManager.Trigger(EventType.BoosDie, [this]);
  2578. Laya.timer.frameOnce(80, this, () => {
  2579. this.FallLand(this.cursprite.transform.position.y - 1, () => {
  2580. this.Clear();
  2581. });
  2582. });
  2583. return;
  2584. }
  2585. var cutasset = AssetManager.effect.getValue(4);
  2586. this.cuteffect = PoolManager.GetSprite3D(cutasset);
  2587. SceneManager.mainscene.addChild(this.cuteffect);
  2588. this.cuteffect.transform.position = this.upsprite.transform.position.clone();
  2589. this.diedownsprite = PoolManager.GetSprite3D(AssetManager.enemy.getValue(1));
  2590. SceneManager.mainscene.addChild(this.diedownsprite);
  2591. this.diedownsprite.transform.position = this.cursprite.transform.position.clone();
  2592. this.diedownsprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
  2593. if (this.mdata.boos) {
  2594. this.diedownsprite.transform.setWorldLossyScale(new Vector3$7(1.5, 1.5, 1.5));
  2595. }
  2596. var dieupsprite = this.diedownsprite.getChildAt(0).getChildAt(2);
  2597. dieupsprite.active = false;
  2598. var dieupsprite2 = this.diedownsprite.getChildAt(0).getChildAt(1);
  2599. dieupsprite2.active = true;
  2600. var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
  2601. dieani.speed = 0;
  2602. var diec = this.diedownsprite.getChildAt(1).getComponent(Laya.PhysicsCollider);
  2603. diec.enabled = false;
  2604. var downrig = new RigObj(this.diedownsprite, null, 1, 1.2);
  2605. downrig.minhight = 1;
  2606. downrig.AddForce(new Laya.Vector3(0, 1, 0.5), 0.3);
  2607. this.curanimator.speed = 0;
  2608. this.downsprite.active = false;
  2609. var mrig = new RigObj(this.cursprite, () => {
  2610. mrig.Clear();
  2611. this.Clear();
  2612. }, 1);
  2613. mrig.AddForce(new Laya.Vector3(0, 1, 1), 0.5, 2);
  2614. if (this.mdata.boos)
  2615. EventManager.Trigger(EventType.BoosDie, [this]);
  2616. }
  2617. OnEnterLose() {
  2618. }
  2619. onUpdate() {
  2620. }
  2621. EscapeLoop() {
  2622. }
  2623. AwakeLoop() {
  2624. }
  2625. onTriggerEnter(_collider) {
  2626. }
  2627. SkinShow(headid, weaponid) {
  2628. for (var i = 0; i < this.headpoint.numChildren; i++) {
  2629. var head = this.headpoint.getChildAt(i);
  2630. head.active = headid - 1 == i;
  2631. }
  2632. for (var i = 0; i < this.weaponpoint.numChildren; i++) {
  2633. var weapon = this.weaponpoint.getChildAt(i);
  2634. if (weaponid - 1 == i) {
  2635. this.curweapon = weapon;
  2636. this.curweapon.active = true;
  2637. this.curweaponid = weaponid;
  2638. }
  2639. else {
  2640. weapon.active = false;
  2641. }
  2642. }
  2643. }
  2644. get LandCheck() {
  2645. var hitenter = false;
  2646. var curpos = this.cursprite.transform.position;
  2647. var startpoint = new Vector3$7(curpos.x, curpos.y + 10, curpos.z);
  2648. var dir = new Vector3$7(0, -1, 0);
  2649. var ray = new Laya.Ray(startpoint, dir);
  2650. var landlay = ColliderLay.plane | ColliderLay.end;
  2651. if (SceneManager.mainscene.physicsSimulation.rayCast(ray, this.landhit, 100, 1, landlay)) {
  2652. var hight = startpoint.y - this.landhit.point.y;
  2653. hitenter = true;
  2654. hitenter = (hight > 9 && hight < 13) ? true : false;
  2655. }
  2656. return hitenter;
  2657. }
  2658. }
  2659. var Vector3$8 = Laya.Vector3;
  2660. class Bullet {
  2661. constructor(_form, _startpos, _type, _speed) {
  2662. this.cut = false;
  2663. this.life = 10;
  2664. this.clear = false;
  2665. this.follower = false;
  2666. this.curpos = new Vector3$8();
  2667. this.currot = new Laya.Quaternion();
  2668. this.firedir = new Vector3$8();
  2669. this.tridis = 0.5;
  2670. this.forwardhit = new Laya.HitResult();
  2671. this.formonster = _form;
  2672. this.type = _type;
  2673. this.bulletspeed = _speed;
  2674. this.cursprite = PoolManager.GetSprite3D(AssetManager.bullet.getValue(this.type));
  2675. SceneManager.mainscene.addChild(this.cursprite);
  2676. this.cursprite.transform.position = _startpos;
  2677. if (this.type == 1 || this.type == 2) {
  2678. this.tw = PoolManager.GetSprite3D(AssetManager.effect.getValue(1));
  2679. this.cursprite.addChild(this.tw);
  2680. this.tw.transform.localPosition = new Vector3$8(0, 0, 0);
  2681. }
  2682. else if (this.type == 3) {
  2683. this.tw = PoolManager.GetSprite3D(AssetManager.effect.getValue(7));
  2684. this.cursprite.addChild(this.tw);
  2685. this.tw.transform.localPosition = new Vector3$8(0, 0, 0);
  2686. }
  2687. this.upsprite = this.cursprite.getChildAt(1);
  2688. this.downsprite = this.cursprite.getChildAt(0);
  2689. this.curcollider = this.cursprite.getChildAt(2).getComponent(Laya.PhysicsCollider);
  2690. this.curcollider.collisionGroup = ColliderLay.bullet;
  2691. this.OnInit();
  2692. }
  2693. OnInit() {
  2694. EventManager.On(EventType.Cut, this, this.OnCut);
  2695. EventManager.GameOn(GameState.Over, this, this.OnGameEnd);
  2696. }
  2697. OnGameEnd() {
  2698. this.Clear();
  2699. }
  2700. OnCut(_collider) {
  2701. if (_collider != this.curcollider || this.cut)
  2702. return;
  2703. this.BeCut();
  2704. }
  2705. Clear() {
  2706. if (this.clear)
  2707. return;
  2708. this.clear = true;
  2709. Laya.timer.clearAll(this);
  2710. Laya.timer.clear(this, this.FireLoop);
  2711. if (this.tw)
  2712. this.tw.destroy();
  2713. if (this.uprig)
  2714. this.uprig.Clear();
  2715. if (this.downrig)
  2716. this.downrig.Clear();
  2717. if (this.cuteffect) {
  2718. PoolManager.RecoverSprite3D(this.cuteffect);
  2719. }
  2720. if (this.copysprite) {
  2721. var dieupsprite1 = this.copysprite.getChildAt(1);
  2722. dieupsprite1.active = true;
  2723. PoolManager.RecoverSprite3D(this.copysprite);
  2724. }
  2725. this.downsprite.active = true;
  2726. PoolManager.RecoverSprite3D(this.cursprite);
  2727. EventManager.Off(EventType.Cut, this, this.OnCut);
  2728. EventManager.GameOff(GameState.Over, this, this.OnGameEnd);
  2729. }
  2730. Fire(_startdir, _target = null, _follower = false) {
  2731. this.firetarget = _target;
  2732. this.firedir = _startdir ? _startdir : this.firedir;
  2733. this.follower = _follower;
  2734. if (_follower && this.type != 2) {
  2735. var taretpos = this.firetarget.transform.position.clone();
  2736. var lookpos = new Vector3$8(taretpos.x, taretpos.y + 0.5, taretpos.z);
  2737. Laya.Quaternion.lookAt(lookpos, this.cursprite.transform.position, new Vector3$8(0, 1, 0), this.currot);
  2738. this.currot.invert(this.currot);
  2739. this.cursprite.transform.rotation = this.currot;
  2740. }
  2741. if (_target != null) {
  2742. var sfsf = _target.transform.position.clone();
  2743. var targetpos = new Vector3$8(sfsf.x, sfsf.y + 0.5, sfsf.z);
  2744. Vector3$8.subtract(targetpos, this.cursprite.transform.position, this.firedir);
  2745. }
  2746. this.follower = this.follower && _target != null;
  2747. Vector3$8.normalize(this.firedir, this.firedir);
  2748. Vector3$8.scale(this.firedir, this.bulletspeed, this.firedir);
  2749. Laya.timer.frameLoop(1, this, this.FireLoop);
  2750. Laya.timer.once(this.life * 1000, this, this.Clear);
  2751. }
  2752. FireLoop() {
  2753. if (!InputManager.caninput)
  2754. return;
  2755. Vector3$8.add(this.cursprite.transform.position, this.firedir, this.curpos);
  2756. Vector3$8.lerp(this.cursprite.transform.position, this.curpos, 0.12, this.curpos);
  2757. this.cursprite.transform.position = this.curpos;
  2758. if (this.follower) {
  2759. var sfsf = this.firetarget.transform.position.clone();
  2760. var targetpos = new Vector3$8(sfsf.x, sfsf.y + 0.5, sfsf.z);
  2761. Vector3$8.subtract(targetpos, this.cursprite.transform.position, this.firedir);
  2762. Vector3$8.normalize(this.firedir, this.firedir);
  2763. Vector3$8.scale(this.firedir, this.bulletspeed, this.firedir);
  2764. if (this.type != 2) {
  2765. var taretpos = this.firetarget.transform.position.clone();
  2766. var lookpos = new Vector3$8(taretpos.x, this.cursprite.transform.position.y, taretpos.z);
  2767. Laya.Quaternion.lookAt(lookpos, this.cursprite.transform.position, new Vector3$8(0, 1, 0), this.currot);
  2768. this.currot.invert(this.currot);
  2769. Laya.Quaternion.slerp(this.cursprite.transform.rotation, this.currot, 0.2, this.currot);
  2770. this.cursprite.transform.rotation = this.currot;
  2771. }
  2772. }
  2773. if (this.type == 2) {
  2774. this.cursprite.transform.rotate(new Vector3$8(0, 0.1, 0));
  2775. var hifbarrier = this.ForwardCheck(this.firedir);
  2776. if (hifbarrier) {
  2777. var normal = this.forwardhit.normal;
  2778. var newdir = new Vector3$8();
  2779. var fs = -2 * Vector3$8.dot(normal, this.firedir);
  2780. var gsg = new Vector3$8();
  2781. Vector3$8.scale(normal, fs, gsg);
  2782. Vector3$8.subtract(normal, gsg, newdir);
  2783. this.firedir = newdir;
  2784. Vector3$8.normalize(this.firedir, this.firedir);
  2785. Vector3$8.scale(this.firedir, this.bulletspeed, this.firedir);
  2786. }
  2787. }
  2788. if (this.displayer < this.tridis) {
  2789. this.Clear();
  2790. EventManager.Trigger(EventType.Hit, [this.formonster]);
  2791. }
  2792. }
  2793. BeCut() {
  2794. this.cut = true;
  2795. if (this.tw) {
  2796. this.tw.destroy();
  2797. this.tw = null;
  2798. }
  2799. Laya.timer.clear(this, this.FireLoop);
  2800. var cutasset = AssetManager.effect.getValue(4);
  2801. this.cuteffect = PoolManager.GetSprite3D(cutasset);
  2802. SceneManager.mainscene.addChild(this.cuteffect);
  2803. this.cuteffect.transform.position = this.upsprite.transform.position.clone();
  2804. AudioControl.PlayVoice(VoiceType.cut);
  2805. this.copysprite = PoolManager.GetSprite3D(AssetManager.bullet.getValue(this.type));
  2806. SceneManager.mainscene.addChild(this.copysprite);
  2807. this.copysprite.transform.position = this.cursprite.transform.position.clone();
  2808. this.copysprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
  2809. var dieupsprite = this.copysprite.getChildAt(1);
  2810. dieupsprite.active = false;
  2811. this.uprig = new RigObj(this.copysprite, null, 1);
  2812. this.uprig.minhight = 1;
  2813. this.uprig.AddForce(new Laya.Vector3(0, 1, 0.1), 0.5);
  2814. this.downsprite.active = false;
  2815. this.downrig = new RigObj(this.cursprite, () => {
  2816. this.Clear();
  2817. }, 1.2);
  2818. this.downrig.minhight = 1;
  2819. this.downrig.AddForce(new Laya.Vector3(0, 1, 0.1), 0.3);
  2820. }
  2821. get displayer() {
  2822. var curpos = this.cursprite.transform.position.clone();
  2823. var mainplayerpos = Player.mainpalyer.cursprite.transform.position.clone();
  2824. mainplayerpos = new Vector3$8(mainplayerpos.x, mainplayerpos.y + 0.5, mainplayerpos.z);
  2825. var dis = Vector3$8.distance(mainplayerpos, curpos);
  2826. return dis;
  2827. }
  2828. ForwardCheck(_dir) {
  2829. var hitenter = false;
  2830. var curpos = this.cursprite.transform.position;
  2831. var startpoint = new Vector3$8(curpos.x, curpos.y, curpos.z);
  2832. var ray = new Laya.Ray(startpoint, _dir);
  2833. if (SceneManager.mainscene.physicsSimulation.rayCast(ray, this.forwardhit, 0.5)) {
  2834. if (this.forwardhit.collider.collisionGroup == ColliderLay.obstacle) {
  2835. return true;
  2836. }
  2837. }
  2838. return hitenter;
  2839. }
  2840. }
  2841. var Vector3$9 = Laya.Vector3;
  2842. class Shooter extends Role {
  2843. constructor() {
  2844. super(...arguments);
  2845. this.awakespeed = 0.3;
  2846. this.awakedistance = 10;
  2847. this.attackdistance = 10;
  2848. this.attackrate = 1;
  2849. this.bulletspeed = 1;
  2850. this.life = false;
  2851. this.movedir = new Vector3$9();
  2852. this.movepos = new Vector3$9();
  2853. this.moverot = new Laya.Quaternion;
  2854. }
  2855. static Create(_data) {
  2856. var roleid = _data.id;
  2857. var roleasset = AssetManager.enemy.getValue(1);
  2858. var model = PoolManager.GetSprite3D(roleasset);
  2859. SceneManager.mainscene.addChild(model);
  2860. model.transform.position = new Vector3$9(_data.startpos.x, _data.startpos.y, _data.startpos.z);
  2861. model.transform.rotationEuler = new Vector3$9(model.transform.rotationEuler.x, 360 - _data.startpos.w, model.transform.rotationEuler.z);
  2862. var monster = model.addComponent(Shooter);
  2863. monster.mdata = _data;
  2864. monster.provocationclip = _data.monsterconfig.provocationclip;
  2865. var neck = model.getChildAt(0).getChildAt(0).getChildAt(1).getChildAt(0).getChildAt(2).getChildAt(0);
  2866. monster.headpoint = neck.getChildAt(0).getChildAt(0);
  2867. monster.weaponpoint = neck.getChildAt(2).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0);
  2868. monster.Init(model);
  2869. monster.collider = model.getChildAt(1).getComponent(Laya.PhysicsCollider);
  2870. monster.collider.collisionGroup = ColliderLay.monster;
  2871. monster.collider.enabled = true;
  2872. monster.SkinShow(monster.mdata.monsterconfig.masktype, monster.mdata.monsterconfig.weapontype);
  2873. monster.awakedistance = _data.monsterconfig.recognition;
  2874. monster.attackdistance = _data.monsterconfig.attack_range;
  2875. monster.movespeed = _data.monsterconfig.move_speed;
  2876. monster.attackrate = _data.monsterconfig.frequency;
  2877. monster.bulletspeed = _data.monsterconfig.bullet_speed;
  2878. monster.upsprite = model.getChildAt(0).getChildAt(2);
  2879. monster.upsprite.active = true;
  2880. monster.downsprite = model.getChildAt(0).getChildAt(1);
  2881. monster.downsprite.active = true;
  2882. monster.OnInit();
  2883. return monster;
  2884. }
  2885. OnInit() {
  2886. this.mlevel = LevelManager.Instance.curlevel;
  2887. this.RegEvent();
  2888. if (this.mdata.boos) {
  2889. this.cursprite.transform.setWorldLossyScale(new Vector3$9(1.5, 1.5, 1.5));
  2890. }
  2891. }
  2892. OnClear() {
  2893. EventManager.Off(EventType.Cut, this, this.OnCut);
  2894. EventManager.Off(EventType.Running, this, this.OnRunning);
  2895. Laya.timer.clearAll(this);
  2896. Laya.timer.clear(this, this.AttackLoop);
  2897. Laya.timer.clear(this, this.MoveLoop);
  2898. Laya.timer.clear(this, this.OnLife);
  2899. this.SkinShow(0, 0);
  2900. this.curanimator.speed = 1;
  2901. if (this.cuteffect)
  2902. PoolManager.RecoverSprite3D(this.cuteffect);
  2903. if (this.diedownsprite) {
  2904. var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
  2905. dieani.speed = 1;
  2906. PoolManager.RecoverSprite3D(this.diedownsprite);
  2907. }
  2908. }
  2909. RegEvent() {
  2910. EventManager.On(EventType.Cut, this, this.OnCut);
  2911. EventManager.On(EventType.Running, this, this.OnRunning);
  2912. }
  2913. WithPlaying() {
  2914. if (this.mdata.boos) {
  2915. Player.mainpalyer.FindBoos(this);
  2916. }
  2917. }
  2918. OnCut(_collider) {
  2919. if (_collider != this.collider)
  2920. return;
  2921. TtSdk.Shake(false);
  2922. AudioControl.PlayVoice(VoiceType.cut);
  2923. if (this.AttackTarget)
  2924. this.StopMove();
  2925. this.ChangeState(RoleState.Die, !PlayerAccount.CurAccountData.cuteffect);
  2926. }
  2927. get displayer() {
  2928. var curpos = this.cursprite.transform.position.clone();
  2929. var mainplayerpos = Player.mainpalyer.cursprite.transform.position.clone();
  2930. var dis = Vector3$9.distance(mainplayerpos, curpos);
  2931. return dis;
  2932. }
  2933. OnRunning(_playerpos) {
  2934. if (this.life)
  2935. return;
  2936. var curpos = this.cursprite.transform.position.clone();
  2937. var dis = Vector3$9.distance(_playerpos, curpos);
  2938. if (dis < this.attackdistance && this.currolestate == RoleState.Idle) {
  2939. this.ChangeState(RoleState.Attack);
  2940. }
  2941. if (this.AttackTarget)
  2942. this.cursprite.transform.rotation = this.RotLook(this.AttackTarget.transform.position, false);
  2943. }
  2944. OnLife() {
  2945. if (Player.mainpalyer.currolestate == RoleState.Die || Player.mainpalyer.currolestate == RoleState.Win)
  2946. return;
  2947. if (this.currolestate == RoleState.Idle) {
  2948. this.ChangeState(RoleState.Attack);
  2949. }
  2950. if (this.AttackTarget)
  2951. this.cursprite.transform.rotation = this.RotLook(this.AttackTarget.transform.position, false);
  2952. }
  2953. onStateChange(_state, _data) {
  2954. Laya.timer.clear(this, this.AttackLoop);
  2955. Laya.timer.clear(this, this.MoveLoop);
  2956. Laya.timer.clear(this, this.OnLife);
  2957. if (_state == RoleState.Awake) {
  2958. this.OnEnterAwake();
  2959. }
  2960. else if (_state == RoleState.Die) {
  2961. this.OnEnterDie(_data);
  2962. }
  2963. else if (_state == RoleState.Attack) {
  2964. this.OnEnterAttack();
  2965. }
  2966. else if (_state == RoleState.Idle) {
  2967. this.OnEnterIdle();
  2968. }
  2969. }
  2970. OnEnterIdle() {
  2971. if (this.curweaponid == 5) {
  2972. this.curanimator.crossFade("dartsidle", 0.2);
  2973. }
  2974. else if (this.curweaponid == 6) {
  2975. this.curanimator.crossFade("gunidle", 0.2);
  2976. }
  2977. else if (this.curweaponid == 7) {
  2978. this.curanimator.crossFade("paoboosidle", 0.2);
  2979. }
  2980. if (this.life) {
  2981. Laya.timer.frameOnce(80, this, () => {
  2982. Laya.timer.clear(this, this.OnLife);
  2983. Laya.timer.frameLoop(1, this, this.OnLife);
  2984. });
  2985. }
  2986. }
  2987. OnEnterAttack() {
  2988. this.life = true;
  2989. Laya.timer.clear(this, this.AttackLoop);
  2990. this.AttackLoop();
  2991. this.AttackTarget = Player.mainpalyer.cursprite;
  2992. this.cursprite.transform.rotation = this.RotLook(this.AttackTarget.transform.position, false);
  2993. }
  2994. AttackLoop() {
  2995. if (this.curweaponid == 5) {
  2996. this.curanimator.crossFade("darts", 0.2);
  2997. }
  2998. else if (this.curweaponid == 6) {
  2999. this.curanimator.play("shoot");
  3000. }
  3001. else if (this.curweaponid == 7) {
  3002. this.curanimator.crossFade("paoboosattack", 0.2);
  3003. }
  3004. Laya.timer.frameOnce(30, this, () => {
  3005. if (this.currolestate != RoleState.Die)
  3006. this.Fire();
  3007. });
  3008. var attackrate = 100 / this.attackrate;
  3009. Laya.timer.frameOnce(attackrate, this, () => {
  3010. this.ChangeState(RoleState.Idle);
  3011. });
  3012. }
  3013. Fire() {
  3014. if (!InputManager.caninput)
  3015. return;
  3016. var bulletid;
  3017. var firepo;
  3018. var follow = false;
  3019. var speed = this.mdata.monsterconfig.bullet_speed;
  3020. if (this.curweaponid == 5) {
  3021. bulletid = 2;
  3022. firepo = this.curweapon.transform.position;
  3023. }
  3024. else if (this.curweaponid == 6) {
  3025. bulletid = 1;
  3026. firepo = this.firepoint.transform.position;
  3027. }
  3028. else if (this.curweaponid == 7) {
  3029. bulletid = 3;
  3030. firepo = this.curweapon.transform.position;
  3031. follow = true;
  3032. }
  3033. if (this.mdata.monsterconfig.bulletamount == 1) {
  3034. var bullet = new Bullet(this, firepo, bulletid, speed);
  3035. bullet.Fire(null, Player.mainpalyer.cursprite, follow);
  3036. }
  3037. else if (this.mdata.monsterconfig.bulletamount == 2) {
  3038. var bullet1 = new Bullet(this, firepo, bulletid, speed);
  3039. bullet1.Fire(null, Player.mainpalyer.cursprite, follow);
  3040. var dir = new Vector3$9();
  3041. Vector3$9.subtract(Player.mainpalyer.cursprite.transform.position, bullet1.cursprite.transform.position, dir);
  3042. var ggy = Math.atan(dir.z / dir.x) * 180 / Math.PI;
  3043. var f = Vector3$9.scalarLength(dir);
  3044. if (dir.x > 0)
  3045. ggy += 180;
  3046. console.log("angle:", ggy);
  3047. var ggy1 = ggy + 5;
  3048. var xf1 = dir.x > 0 ? Math.abs(Math.sin(ggy1)) : -Math.abs(Math.sin(ggy1));
  3049. var zf1 = dir.z > 0 ? Math.abs(Math.sin(ggy1)) : -Math.abs(Math.sin(ggy1));
  3050. dir = new Vector3$9(xf1 * f, dir.y, zf1 * f);
  3051. var bullet2 = new Bullet(this, firepo, bulletid, speed);
  3052. bullet2.Fire(dir, null, follow);
  3053. }
  3054. else if (this.mdata.monsterconfig.bulletamount == 3) {
  3055. var bullet = new Bullet(this, firepo, bulletid, speed);
  3056. bullet.Fire(null, Player.mainpalyer.cursprite, follow);
  3057. var dir = new Vector3$9();
  3058. Vector3$9.subtract(Player.mainpalyer.cursprite.transform.position, bullet.cursprite.transform.position, dir);
  3059. var ggy = Math.atan(dir.z / dir.x) * 180 / Math.PI;
  3060. var f = Vector3$9.scalarLength(dir);
  3061. if (dir.x > 0)
  3062. ggy += 180;
  3063. var ggy1 = ggy + 5;
  3064. var xf1 = dir.x > 0 ? Math.abs(Math.sin(ggy1)) : -Math.abs(Math.sin(ggy1));
  3065. var zf1 = dir.z > 0 ? Math.abs(Math.sin(ggy1)) : -Math.abs(Math.sin(ggy1));
  3066. dir = new Vector3$9(xf1 * f, dir.y, zf1 * f);
  3067. var bullet2 = new Bullet(this, firepo, bulletid, speed);
  3068. bullet2.Fire(dir, null, follow);
  3069. var dir2 = new Vector3$9();
  3070. var ggy2 = ggy + 10;
  3071. var xf2 = dir.x > 0 ? Math.abs(Math.sin(ggy2)) : -Math.abs(Math.sin(ggy2));
  3072. var zf2 = dir.z > 0 ? Math.abs(Math.sin(ggy2)) : -Math.abs(Math.sin(ggy2));
  3073. dir2 = new Vector3$9(xf2 * f, dir.y, zf2 * f);
  3074. var bullet3 = new Bullet(this, firepo, bulletid, speed);
  3075. bullet3.Fire(dir2, null, follow);
  3076. }
  3077. }
  3078. OnEnterAwake() {
  3079. EventManager.Off(EventType.Running, this, this.OnRunning);
  3080. this.curanimator.play("run");
  3081. this.SetMove(Player.mainpalyer.cursprite);
  3082. }
  3083. SetMove(_target) {
  3084. this.AttackTarget = _target;
  3085. this.movespeed = this.awakespeed;
  3086. Laya.timer.clear(this, this.MoveLoop);
  3087. Laya.timer.frameLoop(1, this, this.MoveLoop);
  3088. }
  3089. StopMove() {
  3090. Laya.timer.clear(this, this.MoveLoop);
  3091. this.AttackTarget = null;
  3092. }
  3093. MoveLoop() {
  3094. if (this.AttackTarget) {
  3095. var mpos = this.cursprite.transform.position.clone();
  3096. Vector3$9.subtract(this.AttackTarget.transform.position, mpos, this.movedir);
  3097. Vector3$9.normalize(this.movedir, this.movedir);
  3098. Vector3$9.scale(this.movedir, this.movespeed, this.movedir);
  3099. Vector3$9.add(mpos, this.movedir, this.movepos);
  3100. Vector3$9.lerp(mpos, this.movepos, 0.12, this.movepos);
  3101. this.cursprite.transform.position = this.movepos;
  3102. this.cursprite.transform.rotation = this.RotLook(this.AttackTarget.transform.position);
  3103. if (this.displayer < this.attackdistance) {
  3104. this.ChangeState(RoleState.Attack);
  3105. }
  3106. }
  3107. }
  3108. RotLook(_targetpos, _lerp = true) {
  3109. var mpos = this.cursprite.transform.position.clone();
  3110. _targetpos = new Vector3$9(_targetpos.x, mpos.y, _targetpos.z);
  3111. Laya.Quaternion.lookAt(_targetpos, mpos, new Vector3$9(0, 1, 0), this.moverot);
  3112. this.moverot.invert(this.moverot);
  3113. if (_lerp)
  3114. Laya.Quaternion.slerp(this.cursprite.transform.rotation, this.moverot, 0.2, this.moverot);
  3115. this.cursprite.transform.rotation = this.moverot;
  3116. return this.moverot;
  3117. }
  3118. BeBoom() {
  3119. this.ChangeState(RoleState.Die, true);
  3120. }
  3121. OnEnterDie(_die = false) {
  3122. GameManager.Instance.goldnum += LevelManager.Instance.curlevel.leveldata.missiondata.masterdrop;
  3123. if (_die) {
  3124. this.collider.enabled = false;
  3125. this.curanimator.play("die");
  3126. if (this.mdata.boos)
  3127. EventManager.Trigger(EventType.BoosDie, [this]);
  3128. Laya.timer.frameOnce(80, this, () => {
  3129. this.FallLand(this.cursprite.transform.position.y - 1, () => {
  3130. this.Clear();
  3131. });
  3132. });
  3133. return;
  3134. }
  3135. var cutasset = AssetManager.effect.getValue(4);
  3136. this.cuteffect = PoolManager.GetSprite3D(cutasset);
  3137. SceneManager.mainscene.addChild(this.cuteffect);
  3138. this.cuteffect.transform.position = this.upsprite.transform.position.clone();
  3139. this.diedownsprite = PoolManager.GetSprite3D(AssetManager.enemy.getValue(1));
  3140. SceneManager.mainscene.addChild(this.diedownsprite);
  3141. this.diedownsprite.transform.position = this.cursprite.transform.position.clone();
  3142. this.diedownsprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
  3143. if (this.mdata.boos) {
  3144. this.diedownsprite.transform.setWorldLossyScale(new Vector3$9(1.5, 1.5, 1.5));
  3145. }
  3146. var dieupsprite = this.diedownsprite.getChildAt(0).getChildAt(2);
  3147. dieupsprite.active = false;
  3148. var dieupsprite2 = this.diedownsprite.getChildAt(0).getChildAt(1);
  3149. dieupsprite2.active = true;
  3150. var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
  3151. dieani.speed = 0;
  3152. var diec = this.diedownsprite.getChildAt(1).getComponent(Laya.PhysicsCollider);
  3153. diec.enabled = false;
  3154. var downrig = new RigObj(this.diedownsprite, null, 1, 1);
  3155. downrig.minhight = 1;
  3156. downrig.AddForce(new Laya.Vector3(0, 1, 0.5), 0.3);
  3157. this.curanimator.speed = 0;
  3158. this.downsprite.active = false;
  3159. var mrig = new RigObj(this.cursprite, () => {
  3160. mrig.Clear();
  3161. this.Clear();
  3162. }, 1);
  3163. mrig.AddForce(new Laya.Vector3(0, 1, 1), 0.5, 2);
  3164. if (this.mdata.boos)
  3165. EventManager.Trigger(EventType.BoosDie, [this]);
  3166. }
  3167. OnEnterLose() {
  3168. }
  3169. onUpdate() {
  3170. }
  3171. EscapeLoop() {
  3172. }
  3173. AwakeLoop() {
  3174. }
  3175. SkinShow(headid, weaponid) {
  3176. for (var i = 0; i < this.headpoint.numChildren; i++) {
  3177. var head = this.headpoint.getChildAt(i);
  3178. head.active = headid - 1 == i;
  3179. }
  3180. for (var i = 0; i < this.weaponpoint.numChildren; i++) {
  3181. var weapon = this.weaponpoint.getChildAt(i);
  3182. if (weaponid - 1 == i) {
  3183. this.curweapon = weapon;
  3184. this.curweapon.active = true;
  3185. this.curweaponid = weaponid;
  3186. if (weaponid == 6) {
  3187. this.firepoint = this.curweapon.getChildAt(1);
  3188. }
  3189. }
  3190. else {
  3191. weapon.active = false;
  3192. }
  3193. }
  3194. }
  3195. }
  3196. var Vector3$a = Laya.Vector3;
  3197. class RoadData {
  3198. constructor(_type) {
  3199. this.type = _type;
  3200. }
  3201. }
  3202. class Road {
  3203. constructor(_data) {
  3204. this.curdata = _data;
  3205. var roadasset = AssetManager.road.getValue(_data.type);
  3206. this.cursprite = PoolManager.GetSprite3D(roadasset);
  3207. SceneManager.mainscene.addChild(this.cursprite);
  3208. this.cursprite.transform.setWorldLossyScale(_data.scale);
  3209. this.cursprite.transform.position = new Vector3$a(_data.pos.x, _data.pos.y, _data.pos.z);
  3210. this.cursprite.transform.rotationEuler = new Vector3$a(_data.erot.x, 360 - _data.erot.y, _data.erot.z);
  3211. GameUtils.SetColliderLay(this.cursprite, ColliderLay.plane);
  3212. }
  3213. Clear() {
  3214. PoolManager.RecoverSprite3D(this.cursprite);
  3215. }
  3216. }
  3217. class ChuiCheck extends Laya.Script3D {
  3218. onAwake() {
  3219. this.mainplayer = Player.mainpalyer;
  3220. }
  3221. onTriggerEnter(other) {
  3222. if (this.mainplayer.currolestate == RoleState.Die)
  3223. return;
  3224. if (this.cantrigger(other)) {
  3225. EventManager.Trigger(EventType.Chui, [other]);
  3226. }
  3227. }
  3228. cantrigger(_collider) {
  3229. if (GameManager.Instance.curgamestate != GameState.Playing)
  3230. return false;
  3231. if (_collider.collisionGroup == ColliderLay.player) {
  3232. return true;
  3233. }
  3234. return false;
  3235. }
  3236. }
  3237. var Vector3$b = Laya.Vector3;
  3238. class BallBoos extends Role {
  3239. constructor() {
  3240. super(...arguments);
  3241. this.awakespeed = 0.3;
  3242. this.awakedistance = 8;
  3243. this.attackdistance = 6;
  3244. this.standattackdis = 2;
  3245. this.attackrate = 1;
  3246. this.life = false;
  3247. this.movedir = new Vector3$b();
  3248. this.movepos = new Vector3$b();
  3249. this.moverot = new Laya.Quaternion;
  3250. }
  3251. static Create(_data) {
  3252. var roleid = _data.id;
  3253. var roleasset = AssetManager.enemy.getValue(1);
  3254. var model = PoolManager.GetSprite3D(roleasset);
  3255. SceneManager.mainscene.addChild(model);
  3256. model.transform.position = new Vector3$b(_data.startpos.x, _data.startpos.y, _data.startpos.z);
  3257. model.transform.rotationEuler = new Vector3$b(model.transform.rotationEuler.x, 360 - _data.startpos.w, model.transform.rotationEuler.z);
  3258. var monster = model.addComponent(BallBoos);
  3259. monster.mdata = _data;
  3260. monster.provocationclip = _data.monsterconfig.provocationclip;
  3261. var neck = model.getChildAt(0).getChildAt(0).getChildAt(1).getChildAt(0).getChildAt(2).getChildAt(0);
  3262. monster.headpoint = neck.getChildAt(0).getChildAt(0);
  3263. monster.weaponpoint = neck.getChildAt(2).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0);
  3264. monster.Init(model);
  3265. monster.collider = model.getChildAt(1).getComponent(Laya.PhysicsCollider);
  3266. monster.collider.collisionGroup = ColliderLay.monster;
  3267. monster.SkinShow(_data.monsterconfig.masktype, 8);
  3268. monster.awakedistance = _data.monsterconfig.recognition;
  3269. monster.attackdistance = _data.monsterconfig.attack_range;
  3270. monster.movespeed = _data.monsterconfig.move_speed;
  3271. monster.attackrate = _data.monsterconfig.frequency;
  3272. monster.upsprite = model.getChildAt(0).getChildAt(2);
  3273. monster.upsprite.active = true;
  3274. monster.downsprite = model.getChildAt(0).getChildAt(1);
  3275. monster.downsprite.active = true;
  3276. monster.OnInit();
  3277. return monster;
  3278. }
  3279. OnInit() {
  3280. this.mlevel = LevelManager.Instance.curlevel;
  3281. this.RegEvent();
  3282. this.cursprite.transform.setWorldLossyScale(new Vector3$b(1.2, 1.2, 1.2));
  3283. }
  3284. OnClear() {
  3285. EventManager.Off(EventType.Cut, this, this.OnCut);
  3286. EventManager.Off(EventType.Running, this, this.OnRunning);
  3287. EventManager.Off(EventType.Chui, this, this.CheckAttack);
  3288. Laya.timer.clearAll(this);
  3289. Laya.timer.clear(this, this.CheckAttack);
  3290. Laya.timer.clear(this, this.AttackLoop);
  3291. Laya.timer.clear(this, this.MoveLoop);
  3292. Laya.timer.clear(this, this.OnLife);
  3293. var chuicheck = this.curweapon.getComponent(ChuiCheck);
  3294. if (chuicheck)
  3295. chuicheck.destroy();
  3296. if (this.cuteffect)
  3297. PoolManager.RecoverSprite3D(this.cuteffect);
  3298. this.curanimator.speed = 1;
  3299. this.SkinShow(0, 0);
  3300. if (this.diedownsprite) {
  3301. var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
  3302. dieani.speed = 1;
  3303. PoolManager.RecoverSprite3D(this.diedownsprite);
  3304. }
  3305. }
  3306. RegEvent() {
  3307. EventManager.On(EventType.Cut, this, this.OnCut);
  3308. EventManager.On(EventType.Running, this, this.OnRunning);
  3309. EventManager.On(EventType.Chui, this, this.CheckAttack);
  3310. }
  3311. WithPlaying() {
  3312. if (this.mdata.boos) {
  3313. Player.mainpalyer.FindBoos(this);
  3314. }
  3315. }
  3316. OnCut(_collider) {
  3317. if (_collider != this.collider)
  3318. return;
  3319. if (this.AttackTarget)
  3320. this.StopMove();
  3321. this.ChangeState(RoleState.Die, !PlayerAccount.CurAccountData.cuteffect);
  3322. TtSdk.Shake(false);
  3323. AudioControl.PlayVoice(VoiceType.cut);
  3324. var cutasset = AssetManager.effect.getValue(4);
  3325. this.cuteffect = PoolManager.GetSprite3D(cutasset);
  3326. SceneManager.mainscene.addChild(this.cuteffect);
  3327. this.cuteffect.transform.position = this.upsprite.transform.position.clone();
  3328. }
  3329. get displayer() {
  3330. var curpos = this.cursprite.transform.position.clone();
  3331. var mainplayerpos = Player.mainpalyer.cursprite.transform.position.clone();
  3332. var dis = GameUtils.Vector32Length(mainplayerpos, curpos);
  3333. return dis;
  3334. }
  3335. OnRunning(_playerpos) {
  3336. if (this.life)
  3337. return;
  3338. var curpos = this.cursprite.transform.position.clone();
  3339. var dis = GameUtils.Vector32Length(_playerpos, curpos);
  3340. if (dis < this.attackdistance && this.currolestate == RoleState.Idle) {
  3341. this.ChangeState(RoleState.Attack);
  3342. }
  3343. else if (dis < this.awakedistance && this.currolestate == RoleState.Idle) {
  3344. this.ChangeState(RoleState.Awake);
  3345. }
  3346. }
  3347. OnLife() {
  3348. if (Player.mainpalyer.currolestate == RoleState.Die)
  3349. return;
  3350. if (this.displayer < this.attackdistance && this.currolestate == RoleState.Idle) {
  3351. this.ChangeState(RoleState.Attack);
  3352. }
  3353. else {
  3354. this.ChangeState(RoleState.Awake);
  3355. }
  3356. }
  3357. onStateChange(_state, _data) {
  3358. Laya.timer.clearAll(this);
  3359. Laya.timer.clear(this, this.AttackLoop);
  3360. Laya.timer.clear(this, this.MoveLoop);
  3361. Laya.timer.clear(this, this.OnLife);
  3362. if (_state == RoleState.Awake) {
  3363. this.OnEnterAwake();
  3364. }
  3365. else if (_state == RoleState.Die) {
  3366. this.OnEnterDie(_data);
  3367. }
  3368. else if (_state == RoleState.Attack) {
  3369. this.OnEnterAttack();
  3370. }
  3371. else if (_state == RoleState.Idle) {
  3372. this.OnEnterIdle();
  3373. }
  3374. }
  3375. OnEnterIdle() {
  3376. this.curanimator.play("warrioridle");
  3377. this.curanimator.speed = 1;
  3378. if (this.life) {
  3379. Laya.timer.frameOnce(40, this, () => {
  3380. Laya.timer.clear(this, this.OnLife);
  3381. Laya.timer.frameLoop(1, this, this.OnLife);
  3382. });
  3383. }
  3384. }
  3385. OnEnterAttack() {
  3386. Laya.timer.clear(this, this.AttackLoop);
  3387. this.AttackLoop();
  3388. }
  3389. AttackLoop() {
  3390. this.curanimator.play("chuiboosattack");
  3391. this.curanimator.speed = 0.5;
  3392. var attackduation = 250 / this.attackrate;
  3393. if (this.displayer > this.standattackdis) {
  3394. this.AttackTarget = Player.mainpalyer;
  3395. this.movespeed = this.awakespeed;
  3396. Laya.timer.clear(this, this.MoveLoop);
  3397. Laya.timer.frameLoop(1, this, this.MoveLoop);
  3398. }
  3399. Laya.timer.frameOnce(attackduation, this, () => {
  3400. this.ChangeState(RoleState.Idle);
  3401. });
  3402. }
  3403. CheckAttack() {
  3404. if (this.currolestate == RoleState.Die)
  3405. return;
  3406. Player.mainpalyer.ChangeState(RoleState.Die);
  3407. }
  3408. OnEnterAwake() {
  3409. EventManager.Off(EventType.Running, this, this.OnRunning);
  3410. this.life = true;
  3411. this.curanimator.play("run");
  3412. this.curanimator.speed = 1;
  3413. this.SetMove(Player.mainpalyer);
  3414. }
  3415. SetMove(_target) {
  3416. this.AttackTarget = _target;
  3417. this.movespeed = this.awakespeed;
  3418. Laya.timer.clear(this, this.MoveLoop);
  3419. Laya.timer.frameLoop(1, this, this.MoveLoop);
  3420. }
  3421. StopMove() {
  3422. Laya.timer.clear(this, this.MoveLoop);
  3423. this.AttackTarget = null;
  3424. }
  3425. MoveLoop() {
  3426. if (!InputManager.caninput)
  3427. return;
  3428. if (this.AttackTarget && this.AttackTarget.currolestate != RoleState.Die) {
  3429. var mpos = this.cursprite.transform.position.clone();
  3430. Vector3$b.subtract(this.AttackTarget.cursprite.transform.position, mpos, this.movedir);
  3431. Vector3$b.normalize(this.movedir, this.movedir);
  3432. Vector3$b.scale(this.movedir, this.movespeed, this.movedir);
  3433. Vector3$b.add(mpos, this.movedir, this.movepos);
  3434. Vector3$b.lerp(mpos, this.movepos, 0.12, this.movepos);
  3435. this.cursprite.transform.position = this.movepos;
  3436. Laya.Quaternion.lookAt(this.AttackTarget.cursprite.transform.position, mpos, new Vector3$b(0, 1, 0), this.moverot);
  3437. this.moverot.invert(this.moverot);
  3438. Laya.Quaternion.slerp(this.cursprite.transform.rotation, this.moverot, 0.2, this.moverot);
  3439. this.cursprite.transform.rotation = this.moverot;
  3440. if (this.displayer < this.attackdistance) {
  3441. this.ChangeState(RoleState.Attack);
  3442. }
  3443. }
  3444. }
  3445. OnEnterDie(_die) {
  3446. GameManager.Instance.goldnum += LevelManager.Instance.curlevel.leveldata.missiondata.masterdrop;
  3447. if (_die) {
  3448. this.curanimator.play("die");
  3449. this.curanimator.speed = 1;
  3450. if (this.mdata.boos)
  3451. EventManager.Trigger(EventType.BoosDie, [this]);
  3452. Laya.timer.frameOnce(80, this, () => {
  3453. this.FallLand(this.cursprite.transform.position.y - 1, () => {
  3454. this.Clear();
  3455. });
  3456. });
  3457. return;
  3458. }
  3459. var cutasset = AssetManager.effect.getValue(4);
  3460. this.cuteffect = PoolManager.GetSprite3D(cutasset);
  3461. SceneManager.mainscene.addChild(this.cuteffect);
  3462. this.cuteffect.transform.position = this.upsprite.transform.position.clone();
  3463. this.diedownsprite = PoolManager.GetSprite3D(AssetManager.enemy.getValue(1));
  3464. SceneManager.mainscene.addChild(this.diedownsprite);
  3465. this.diedownsprite.transform.position = this.cursprite.transform.position.clone();
  3466. this.diedownsprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
  3467. this.diedownsprite.transform.setWorldLossyScale(new Vector3$b(1.2, 1.2, 1.2));
  3468. var dieupsprite = this.diedownsprite.getChildAt(0).getChildAt(2);
  3469. dieupsprite.active = false;
  3470. var dieupsprite2 = this.diedownsprite.getChildAt(0).getChildAt(1);
  3471. dieupsprite2.active = true;
  3472. var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
  3473. dieani.speed = 0;
  3474. var diec = this.diedownsprite.getChildAt(1).getComponent(Laya.PhysicsCollider);
  3475. diec.enabled = false;
  3476. var downrig = new RigObj(this.diedownsprite, null, 1, 1);
  3477. downrig.minhight = 1;
  3478. downrig.AddForce(new Laya.Vector3(0, 1, 0.5), 0.6);
  3479. this.curanimator.speed = 0;
  3480. this.downsprite.active = false;
  3481. var mrig = new RigObj(this.cursprite, () => {
  3482. this.Clear();
  3483. }, 1);
  3484. mrig.AddForce(new Laya.Vector3(0, 1, 0.6), 0.5, 2);
  3485. if (this.mdata.boos)
  3486. EventManager.Trigger(EventType.BoosDie, [this]);
  3487. }
  3488. BeBoom() {
  3489. this.ChangeState(RoleState.Die, true);
  3490. }
  3491. OnEnterLose() {
  3492. }
  3493. onUpdate() {
  3494. }
  3495. EscapeLoop() {
  3496. }
  3497. AwakeLoop() {
  3498. }
  3499. onTriggerEnter(_collider) {
  3500. }
  3501. SkinShow(headid, weaponid) {
  3502. for (var i = 0; i < this.headpoint.numChildren; i++) {
  3503. var head = this.headpoint.getChildAt(i);
  3504. head.active = headid - 1 == i;
  3505. }
  3506. for (var i = 0; i < this.weaponpoint.numChildren; i++) {
  3507. var weapon = this.weaponpoint.getChildAt(i);
  3508. if (weaponid - 1 == i) {
  3509. this.curweapon = weapon;
  3510. this.curweapon.active = true;
  3511. this.curweapon.addComponent(ChuiCheck);
  3512. this.curweaponid = weaponid;
  3513. }
  3514. else {
  3515. weapon.active = false;
  3516. }
  3517. }
  3518. }
  3519. }
  3520. var Vector3$c = Laya.Vector3;
  3521. class GirlData extends RoleData {
  3522. constructor(_id, _startpos) {
  3523. super(_id, _startpos);
  3524. }
  3525. }
  3526. class Girl extends Role {
  3527. constructor() {
  3528. super(...arguments);
  3529. this.awakedistance = 8;
  3530. this.life = false;
  3531. }
  3532. static Create(_data) {
  3533. var roleid = _data.id;
  3534. var roleasset = AssetManager.girl.getValue(roleid);
  3535. var model = PoolManager.GetSprite3D(roleasset);
  3536. SceneManager.mainscene.addChild(model);
  3537. model.transform.position = new Vector3$c(_data.startpos.x, _data.startpos.y, _data.startpos.z);
  3538. model.transform.rotationEuler = new Vector3$c(model.transform.rotationEuler.x, 360 - _data.startpos.w, model.transform.rotationEuler.z);
  3539. var monster = model.addComponent(Girl);
  3540. monster.Init(model);
  3541. monster.collider = model.getChildAt(1).getComponent(Laya.PhysicsCollider);
  3542. monster.collider.collisionGroup = ColliderLay.monster;
  3543. monster.OnInit();
  3544. return monster;
  3545. }
  3546. OnInit() {
  3547. this.mlevel = LevelManager.Instance.curlevel;
  3548. this.RegEvent();
  3549. }
  3550. OnClear() {
  3551. EventManager.Off(EventType.Cut, this, this.OnCut);
  3552. EventManager.Off(EventType.Running, this, this.OnRunning);
  3553. }
  3554. RegEvent() {
  3555. EventManager.On(EventType.Cut, this, this.OnCut);
  3556. EventManager.On(EventType.Running, this, this.OnRunning);
  3557. }
  3558. OnCut(_collider) {
  3559. if (_collider != this.collider)
  3560. return;
  3561. this.ChangeState(RoleState.Die);
  3562. }
  3563. get displayer() {
  3564. var curpos = this.cursprite.transform.position.clone();
  3565. var mainplayerpos = Player.mainpalyer.cursprite.transform.position.clone();
  3566. var dis = GameUtils.Vector32Length(mainplayerpos, curpos);
  3567. return dis;
  3568. }
  3569. OnRunning(_playerpos) {
  3570. if (this.life)
  3571. return;
  3572. var curpos = this.cursprite.transform.position.clone();
  3573. var dis = GameUtils.Vector32Length(_playerpos, curpos);
  3574. if (dis < this.awakedistance && this.currolestate == RoleState.Idle) {
  3575. this.ChangeState(RoleState.Awake);
  3576. }
  3577. }
  3578. OnLife() {
  3579. if (Player.mainpalyer.currolestate == RoleState.Die)
  3580. return;
  3581. this.ChangeState(RoleState.Awake);
  3582. }
  3583. onStateChange(_state, _data) {
  3584. Laya.timer.clearAll(this);
  3585. Laya.timer.clear(this, this.OnLife);
  3586. if (_state == RoleState.Awake) {
  3587. this.OnEnterAwake();
  3588. }
  3589. else if (_state == RoleState.Die) {
  3590. this.OnEnterDie();
  3591. }
  3592. else if (_state == RoleState.Attack) {
  3593. this.OnEnterAttack();
  3594. }
  3595. else if (_state == RoleState.Idle) {
  3596. this.OnEnterIdle();
  3597. }
  3598. }
  3599. OnEnterIdle() {
  3600. this.curanimator.play("idle");
  3601. if (this.life) {
  3602. Laya.timer.frameOnce(40, this, () => {
  3603. Laya.timer.clear(this, this.OnLife);
  3604. Laya.timer.frameLoop(1, this, this.OnLife);
  3605. });
  3606. }
  3607. }
  3608. OnEnterAttack() {
  3609. Laya.timer.clear(this, this.AttackLoop);
  3610. this.AttackLoop();
  3611. }
  3612. AttackLoop() {
  3613. this.curanimator.play("help");
  3614. var attackduation = 80;
  3615. Laya.timer.frameOnce(attackduation, this, () => {
  3616. this.ChangeState(RoleState.Idle);
  3617. });
  3618. }
  3619. OnEnterAwake() {
  3620. this.life = true;
  3621. }
  3622. OnEnterDie() {
  3623. this.curanimator.play("die");
  3624. Laya.timer.frameOnce(50, this, () => {
  3625. this.FallLand(0, () => {
  3626. this.Clear();
  3627. });
  3628. GameManager.Instance.ChangeGameState(GameState.Lose);
  3629. });
  3630. }
  3631. OnEnterLose() {
  3632. }
  3633. onUpdate() {
  3634. }
  3635. EscapeLoop() {
  3636. }
  3637. AwakeLoop() {
  3638. }
  3639. onTriggerEnter(_collider) {
  3640. }
  3641. }
  3642. var taskstate;
  3643. (function (taskstate) {
  3644. taskstate[taskstate["lock"] = 0] = "lock";
  3645. taskstate[taskstate["open"] = 1] = "open";
  3646. taskstate[taskstate["complete"] = 2] = "complete";
  3647. taskstate[taskstate["geted"] = 3] = "geted";
  3648. })(taskstate || (taskstate = {}));
  3649. class Task {
  3650. constructor(_id) {
  3651. this.state = 0;
  3652. this.find = 1;
  3653. this.id = _id;
  3654. }
  3655. }
  3656. class TaskManager {
  3657. constructor() {
  3658. TaskManager.Init();
  3659. }
  3660. static Init() {
  3661. if (PlayerAccount.is_new) {
  3662. Laya.LocalStorage.removeItem("cdtask");
  3663. Laya.LocalStorage.removeItem("firstbx");
  3664. Laya.LocalStorage.removeItem("firstshare");
  3665. Laya.LocalStorage.removeItem("curleveldata");
  3666. Laya.LocalStorage.removeItem("tzpre");
  3667. }
  3668. var cdtask = Laya.LocalStorage.getItem("cdtask");
  3669. if (cdtask) {
  3670. this.cdtask = JSON.parse(cdtask);
  3671. for (var i = 0; i < this.cdtask.length; i++) {
  3672. var cddata = this.cdtask[i];
  3673. var id = Number(cddata.id);
  3674. var curtask = new Task(id);
  3675. curtask.title = cddata.title;
  3676. curtask.content = cddata.content;
  3677. curtask.cdk = Number(cddata.cdk);
  3678. curtask.find = Number(cddata.find);
  3679. curtask.state = Number(cddata.state);
  3680. this.taskdic.add(id, curtask);
  3681. }
  3682. }
  3683. else {
  3684. var exchange = PlayerAccount.CurAccountData.GetConfig(AccountConfig.exchange);
  3685. if (exchange) {
  3686. for (var key in exchange) {
  3687. var data = exchange[key];
  3688. var id = Number(data.id);
  3689. var curtask = new Task(id);
  3690. curtask.title = data.name;
  3691. curtask.content = data.content;
  3692. curtask.cdk = Number(data.code);
  3693. this.taskdic.add(id, curtask);
  3694. }
  3695. }
  3696. for (var i = 0; i < this.taskdic.values.length; i++) {
  3697. var cuss = this.taskdic.values[i];
  3698. var mdd = {};
  3699. mdd["id"] = cuss.id;
  3700. mdd["title"] = cuss.title;
  3701. mdd["content"] = cuss.content;
  3702. mdd["cdk"] = cuss.cdk;
  3703. mdd["state"] = 0;
  3704. mdd["find"] = 1;
  3705. this.cdtask.push(mdd);
  3706. }
  3707. var mcdmes = JSON.stringify(this.cdtask);
  3708. Laya.LocalStorage.setItem("cdtask", mcdmes);
  3709. }
  3710. }
  3711. static SetData(_data = null) {
  3712. if (this.cdtask.length > 0) {
  3713. if (_data != null) {
  3714. for (var i = 0; i < this.cdtask.length; i++) {
  3715. if (_data.id == this.cdtask[i].id) {
  3716. this.cdtask[i].find = _data.find;
  3717. this.cdtask[i].state = _data.state;
  3718. break;
  3719. }
  3720. }
  3721. }
  3722. var mcdmes = JSON.stringify(this.cdtask);
  3723. Laya.LocalStorage.setItem("cdtask", mcdmes);
  3724. this.taskdic = new Dictionary();
  3725. for (var i = 0; i < this.cdtask.length; i++) {
  3726. var cddata = this.cdtask[i];
  3727. var id = Number(cddata.id);
  3728. var curtask = new Task(id);
  3729. curtask.title = cddata.title;
  3730. curtask.content = cddata.content;
  3731. curtask.cdk = Number(cddata.cdk);
  3732. curtask.find = Number(cddata.find);
  3733. curtask.state = Number(cddata.state);
  3734. this.taskdic.add(id, curtask);
  3735. }
  3736. }
  3737. }
  3738. static GetEgg(_set = false) {
  3739. if (this.cdtask.length > 0) {
  3740. var mcd;
  3741. var mms = [];
  3742. for (var i = 0; i < this.cdtask.length; i++) {
  3743. var fgg = this.cdtask[i];
  3744. if (fgg.find == 1) {
  3745. mms.push(fgg);
  3746. }
  3747. }
  3748. if (mms.length > 0) {
  3749. mcd = mms[GameUtils.getRandomInt(0, mms.length - 1)];
  3750. }
  3751. if (mcd != null && _set) {
  3752. mcd.find = 1;
  3753. this.SetData();
  3754. }
  3755. }
  3756. return mcd;
  3757. }
  3758. static OpenEgg(_egg) {
  3759. for (var i = 0; i < this.cdtask.length; i++) {
  3760. var mtassk = this.cdtask[i];
  3761. if (mtassk.id == _egg.id && mtassk.state == 0) {
  3762. mtassk.state = 1;
  3763. this.SetData();
  3764. break;
  3765. }
  3766. }
  3767. }
  3768. static CompleteEgg(_egg) {
  3769. for (var i = 0; i < this.cdtask.length; i++) {
  3770. var mtassk = this.cdtask[i];
  3771. if (mtassk.id == _egg.id && mtassk.state == 1) {
  3772. mtassk.state = 2;
  3773. this.SetData();
  3774. break;
  3775. }
  3776. }
  3777. }
  3778. static GeEgg(_id) {
  3779. var has = false;
  3780. var curtask;
  3781. for (var i = 0; i < this.taskdic.values.length; i++) {
  3782. var mtask = this.taskdic.values[i];
  3783. if (mtask.cdk == _id) {
  3784. has = true;
  3785. curtask = mtask;
  3786. break;
  3787. }
  3788. }
  3789. if (has) {
  3790. for (var i = 0; i < this.cdtask.length; i++) {
  3791. var mtassk = this.cdtask[i];
  3792. if (mtassk.id == curtask.id && mtassk.state == 2) {
  3793. mtassk.state = 3;
  3794. this.SetData();
  3795. break;
  3796. }
  3797. }
  3798. }
  3799. }
  3800. }
  3801. TaskManager.cdtask = [];
  3802. TaskManager.taskdic = new Dictionary();
  3803. var Vector3$d = Laya.Vector3;
  3804. class missiondata {
  3805. constructor(_id) {
  3806. this.color = new Laya.Vector4(130 / 255, 201 / 255, 254 / 255);
  3807. this.trial = false;
  3808. this.ID = _id;
  3809. }
  3810. }
  3811. class LevelData {
  3812. constructor(id) {
  3813. this.camerapos = new Vector3$d();
  3814. this.cameraerot = new Vector3$d();
  3815. this.girldatas = [];
  3816. this.enemydatas = [];
  3817. this.builddatas = [];
  3818. this.roaddatas = [];
  3819. this.move = 1.25;
  3820. this.color = new Laya.Vector4();
  3821. this.id = Number(id);
  3822. }
  3823. getbooslevel() {
  3824. var ss = false;
  3825. for (var i = 0; i < this.enemydatas.length; i++) {
  3826. var curenemy = this.enemydatas[i];
  3827. if (curenemy.boos) {
  3828. ss = true;
  3829. }
  3830. }
  3831. for (var i = 0; i < this.builddatas.length; i++) {
  3832. var curbuild = this.builddatas[i];
  3833. if (curbuild.boos) {
  3834. ss = true;
  3835. }
  3836. }
  3837. return ss;
  3838. }
  3839. }
  3840. class Level {
  3841. constructor(_id, _config) {
  3842. this.simple = false;
  3843. this.gameroles = [];
  3844. this.booss = [];
  3845. this.lenemys = [];
  3846. this.roads = [];
  3847. this.builds = [];
  3848. this.caocongs = [];
  3849. this.leveltasks = [];
  3850. this.minhight = 100;
  3851. this.allboomree = false;
  3852. this.create = false;
  3853. this.clear = false;
  3854. this.levelid = _id;
  3855. this.leveldata = _config;
  3856. this.Init();
  3857. }
  3858. Init() {
  3859. this.map = new Laya.Node();
  3860. this.levelname = "stage" + this.levelid;
  3861. this.map.name = this.levelname;
  3862. }
  3863. GetTask() {
  3864. this.leveltasks = [];
  3865. for (var i = 0; i < TaskManager.taskdic.values.length; i++) {
  3866. var mtask = TaskManager.taskdic.values[i];
  3867. if (mtask.state == taskstate.open) {
  3868. this.leveltasks.push(mtask);
  3869. }
  3870. }
  3871. }
  3872. Create() {
  3873. if (this.create)
  3874. return;
  3875. this.GetTask();
  3876. EventManager.On(EventType.BoosDie, this, this.OnBoosDie);
  3877. EventManager.On(EventType.UseSkin, this, this.OnUseSkin);
  3878. SceneManager.maincamera.clearColor = this.leveldata.missiondata.color;
  3879. SceneManager.maincamera.transform.position = this.leveldata.camerapos;
  3880. SceneManager.maincamera.transform.rotationEuler = this.leveldata.cameraerot;
  3881. if (this.leveldata.endpos) {
  3882. SceneManager.endsprite.active = true;
  3883. SceneManager.endsprite.transform.position = this.leveldata.endpos;
  3884. SceneManager.endsprite.transform.rotationEuler = new Vector3$d(0, this.leveldata.enderoty, 0);
  3885. }
  3886. else {
  3887. SceneManager.endsprite.active = false;
  3888. }
  3889. var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[skintype.role];
  3890. var equiipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
  3891. equiipskin = equiipskin == null ? PlayerAccount.CurAccountData.m_skinDic.getValue(1) : equiipskin;
  3892. var mainplayer = Player.Create(this.leveldata.playerdata, equiipskin);
  3893. this.gameroles.push(mainplayer);
  3894. for (var i = 0; i < this.leveldata.enemydatas.length; i++) {
  3895. var curenemydata = this.leveldata.enemydatas[i];
  3896. var monster;
  3897. if (curenemydata.monsterconfig.monstertype == MonsterType.Warrior) {
  3898. monster = Warrior.Create(curenemydata);
  3899. }
  3900. else if (curenemydata.monsterconfig.monstertype == MonsterType.Shooter) {
  3901. monster = Shooter.Create(curenemydata);
  3902. }
  3903. else {
  3904. monster = BallBoos.Create(curenemydata);
  3905. }
  3906. if (curenemydata.boos) {
  3907. this.booss.push(monster);
  3908. }
  3909. this.lenemys.push(monster);
  3910. this.gameroles.push(monster);
  3911. }
  3912. for (var i = 0; i < this.leveldata.girldatas.length; i++) {
  3913. var girldata = this.leveldata.girldatas[i];
  3914. var mgirl = Girl.Create(girldata);
  3915. this.gameroles.push(mgirl);
  3916. }
  3917. for (var i = 0; i < this.leveldata.builddatas.length; i++) {
  3918. var curbuilddata = this.leveldata.builddatas[i];
  3919. var mbuild = GameManager.GetBuild(curbuilddata);
  3920. SceneManager.mainscene.addChild(mbuild.cursprite);
  3921. mbuild.cursprite.transform.position = new Vector3$d(curbuilddata.startpos.x, curbuilddata.startpos.y, curbuilddata.startpos.z);
  3922. mbuild.cursprite.transform.rotationEuler = new Vector3$d(-mbuild.cursprite.transform.rotationEuler.x, 360 - curbuilddata.starteroty, mbuild.cursprite.transform.rotationEuler.z);
  3923. mbuild.OnInit();
  3924. this.builds.push(mbuild);
  3925. if (mbuild.mdata.buildid == 6) {
  3926. this.caocongs.push(mbuild);
  3927. }
  3928. }
  3929. for (var i = 0; i < this.leveldata.roaddatas.length; i++) {
  3930. var curroad = this.leveldata.roaddatas[i];
  3931. var mroad = new Road(curroad);
  3932. this.roads.push(mroad);
  3933. if (mroad.cursprite.transform.position.y < this.minhight) {
  3934. this.minhight = mroad.cursprite.transform.position.y;
  3935. }
  3936. }
  3937. console.log("minhight:", this.minhight);
  3938. console.log("Create Level", this.levelid);
  3939. this.create = true;
  3940. this.clear = false;
  3941. }
  3942. Clear() {
  3943. if (this.clear)
  3944. return;
  3945. SceneManager.endsprite.active = false;
  3946. EventManager.Off(EventType.UseSkin, this, this.OnUseSkin);
  3947. EventManager.Off(EventType.BoosDie, this, this.OnBoosDie);
  3948. this.leveltasks = [];
  3949. this.lenemys = [];
  3950. for (var i = 0; i < this.gameroles.length; i++) {
  3951. var currole = this.gameroles[i];
  3952. currole.Clear();
  3953. }
  3954. this.gameroles = [];
  3955. this.booss = [];
  3956. for (var i = 0; i < this.builds.length; i++) {
  3957. var curbuild = this.builds[i];
  3958. curbuild.Clear();
  3959. }
  3960. this.builds = [];
  3961. for (var i = 0; i < this.roads.length; i++) {
  3962. var curroad = this.roads[i];
  3963. curroad.Clear();
  3964. }
  3965. this.roads = [];
  3966. console.log("Clear Level", this.levelid);
  3967. this.create = false;
  3968. this.clear = true;
  3969. }
  3970. get allccclear() {
  3971. if (this.caocongs.length == 0)
  3972. return false;
  3973. for (var i = 0; i < this.caocongs.length; i++) {
  3974. var mcc = this.caocongs[i];
  3975. if (!mcc.die) {
  3976. return false;
  3977. }
  3978. }
  3979. return true;
  3980. }
  3981. get alllenemynoneclear() {
  3982. if (this.lenemys.length == 0)
  3983. return false;
  3984. for (var i = 0; i < this.lenemys.length; i++) {
  3985. var menene = this.lenemys[i];
  3986. if (menene.die) {
  3987. return false;
  3988. }
  3989. }
  3990. return true;
  3991. }
  3992. get allbuildnoclear() {
  3993. if (this.builds.length == 0)
  3994. return false;
  3995. for (var i = 0; i < this.builds.length; i++) {
  3996. var mbbd = this.builds[i];
  3997. if (mbbd.die) {
  3998. return false;
  3999. }
  4000. }
  4001. return true;
  4002. }
  4003. OnBoosDie(_role) {
  4004. console.log("BoosDie", this.booss.length);
  4005. var curboosindex = this.booss.indexOf(_role);
  4006. if (curboosindex != -1) {
  4007. this.booss.splice(curboosindex, 1);
  4008. }
  4009. if (this.booss.length == 0) {
  4010. Player.mainpalyer.ChangeState(RoleState.Win);
  4011. }
  4012. }
  4013. OnUseSkin(_skin) {
  4014. if (_skin == null)
  4015. return;
  4016. if (_skin.skintype == skintype.role) {
  4017. var curplayer = Player.mainpalyer;
  4018. var curstandpos = curplayer.revivepoint;
  4019. var curindex = this.gameroles.indexOf(curplayer);
  4020. this.gameroles.splice(curindex, 1);
  4021. curplayer.Clear();
  4022. this.leveldata.playerdata.startpos = new Laya.Vector4(curstandpos.x, curstandpos.y, curstandpos.z, 0);
  4023. var mainplayer = Player.Create(this.leveldata.playerdata, _skin);
  4024. this.gameroles.push(mainplayer);
  4025. }
  4026. else if (_skin.skintype == skintype.weapon) {
  4027. var curplayer = Player.mainpalyer;
  4028. curplayer.WeaponShow(_skin);
  4029. }
  4030. else {
  4031. var curplayer = Player.mainpalyer;
  4032. curplayer.TurnWeaponEffect(_skin);
  4033. }
  4034. }
  4035. }
  4036. var Vector3$e = Laya.Vector3;
  4037. class LevelManager {
  4038. constructor() {
  4039. this.missiondatas = new Dictionary();
  4040. this.leveldatas = new Dictionary();
  4041. this.levelConfigs = new Dictionary();
  4042. LevelManager.instance = this;
  4043. console.log("关卡初始化...");
  4044. this.LevelInit();
  4045. }
  4046. static get Instance() {
  4047. return LevelManager.instance;
  4048. }
  4049. LevelInit() {
  4050. this.LevelConfigInit();
  4051. }
  4052. LevelConfigInit() {
  4053. var mission = PlayerAccount.CurAccountData.GetConfig(AccountConfig.mission);
  4054. for (var key in mission) {
  4055. var misdata = mission[key];
  4056. var id = Number(misdata.ID);
  4057. var curmisdata = new missiondata(id);
  4058. curmisdata.win = Number(misdata.win);
  4059. curmisdata.lose = Number(misdata.lose);
  4060. curmisdata.masterdrop = Number(misdata.masterdrop);
  4061. curmisdata.move = Number(misdata.move);
  4062. var misdatacolor = misdata.color.split(";");
  4063. curmisdata.color = new Laya.Vector4(Number(misdatacolor[0]) / 255, Number(misdatacolor[1]) / 255, Number(misdatacolor[2]) / 255, 1);
  4064. var curmisdatatrial = misdata.trial;
  4065. curmisdata.trial = curmisdatatrial == 1;
  4066. curmisdata.type = misdata.type;
  4067. this.missiondatas.add(id, curmisdata);
  4068. }
  4069. var leveldataconfig = PlayerAccount.CurAccountData.GetConfig(AccountConfig.config);
  4070. var leveldataS = "";
  4071. for (var key in leveldataconfig) {
  4072. var curconfig = leveldataconfig[key]["config"];
  4073. leveldataS += curconfig;
  4074. }
  4075. leveldataconfig = JSON.parse(leveldataS);
  4076. for (var key in leveldataconfig) {
  4077. var configdata = leveldataconfig[key];
  4078. var id = Number(configdata.id);
  4079. var leveldata = new LevelData(id);
  4080. var camera = configdata.camera.split(",");
  4081. leveldata.camerapos = new Vector3$e(-Number(camera[0]), Number(camera[1]), Number(camera[2]));
  4082. leveldata.cameraerot = new Vector3$e(-Number(camera[3]), 180 - Number(camera[4]), Number(camera[5]));
  4083. var player = configdata.player.split(",");
  4084. leveldata.playerdata = new PlayerData(Number(player[0]), new Laya.Vector4(-Number(player[1]), Number(player[2]), Number(player[3])));
  4085. if (configdata["end"] && configdata["end"] != "") {
  4086. var curend = configdata["end"].split(",");
  4087. leveldata.endpos = new Vector3$e(-Number(curend[0]), Number(curend[1]), Number(curend[2]));
  4088. leveldata.enderoty = 360 - Number(curend[3]);
  4089. }
  4090. if (configdata.enemy && configdata.enemy != "") {
  4091. var curmonsters = configdata.enemy.split(":");
  4092. for (var i = 0; i < curmonsters.length; i++) {
  4093. var curmonster = curmonsters[i].split(",");
  4094. var curenemy = new MonsterData(Number(curmonster[0]), new Laya.Vector4(-Number(curmonster[1]), Number(curmonster[2]), Number(curmonster[3]), Number(curmonster[4])));
  4095. curenemy.boos = curmonster[5] == "1";
  4096. leveldata.enemydatas.push(curenemy);
  4097. }
  4098. }
  4099. if (configdata.barrier && configdata.barrier != "") {
  4100. var curbarriers = configdata.barrier.split(":");
  4101. for (var i = 0; i < curbarriers.length; i++) {
  4102. var curbarrier = curbarriers[i].split(",");
  4103. var curobs = new builddata(buildtype.barrier, Number(curbarrier[0]), new Laya.Vector4(-Number(curbarrier[1]), Number(curbarrier[2]), Number(curbarrier[3]), Number(curbarrier[4])));
  4104. leveldata.builddatas.push(curobs);
  4105. }
  4106. }
  4107. if (configdata.stand && configdata.stand != "") {
  4108. var curstands = configdata.stand.split(":");
  4109. for (var i = 0; i < curstands.length; i++) {
  4110. var curstand = curstands[i].split(",");
  4111. var curst = new builddata(buildtype.stand, Number(curstand[0]), new Laya.Vector4(-Number(curstand[3]), Number(curstand[4]), Number(curstand[5]), Number(curstand[6])));
  4112. curst.monsterid = Number(curstand[1]);
  4113. curst.boos = curstand[2] == 1;
  4114. leveldata.builddatas.push(curst);
  4115. }
  4116. }
  4117. if (configdata.road && configdata.road != "") {
  4118. var curroad = configdata.road.split(":");
  4119. for (var i = 0; i < curroad.length; i++) {
  4120. var currd = curroad[i].split(",");
  4121. var curr = new RoadData(Number(currd[0]));
  4122. curr.pos = new Vector3$e(-Number(currd[1]), Number(currd[2]), Number(currd[3]));
  4123. curr.erot = new Vector3$e(Number(currd[4]), Number(currd[5]), Number(currd[6]));
  4124. curr.scale = new Vector3$e(Number(currd[7]), Number(currd[8]), Number(currd[9]));
  4125. leveldata.roaddatas.push(curr);
  4126. }
  4127. }
  4128. if (configdata.girl && configdata.girl != "") {
  4129. var curgirl = configdata.girl.split(":");
  4130. for (var i = 0; i < curgirl.length; i++) {
  4131. var mg = curgirl[i].split(",");
  4132. var startpos = new Laya.Vector4(-Number(mg[1]), Number(mg[2]), Number(mg[3]), Number(mg[4]));
  4133. var mgdata = new GirlData(Number(mg[0]), startpos);
  4134. leveldata.girldatas.push(mgdata);
  4135. }
  4136. }
  4137. if (this.missiondatas.containKey(id)) {
  4138. var misda = this.missiondatas.getValue(id);
  4139. leveldata.missiondata = misda;
  4140. }
  4141. this.leveldatas.add(id, leveldata);
  4142. var curlevel = new Level(leveldata.id, leveldata);
  4143. this.levelConfigs.add(curlevel.levelid, curlevel);
  4144. }
  4145. var levelcount = this.levelConfigs.count;
  4146. while (this.levelConfigs.count < 500) {
  4147. var curcount = this.levelConfigs.count;
  4148. var randomindex = GameUtils.getRandomInt(levelcount * 0.5, this.levelConfigs.count);
  4149. var randomlevel = this.levelConfigs.getValue(randomindex);
  4150. var newdata = new LevelData(curcount + 1);
  4151. newdata.camerapos = randomlevel.leveldata.camerapos;
  4152. newdata.cameraerot = randomlevel.leveldata.cameraerot;
  4153. newdata.endpos = randomlevel.leveldata.endpos;
  4154. newdata.enderoty = randomlevel.leveldata.enderoty;
  4155. newdata.playerdata = randomlevel.leveldata.playerdata;
  4156. newdata.girldatas = randomlevel.leveldata.girldatas;
  4157. newdata.enemydatas = randomlevel.leveldata.enemydatas;
  4158. newdata.builddatas = randomlevel.leveldata.builddatas;
  4159. newdata.roaddatas = randomlevel.leveldata.roaddatas;
  4160. newdata.missiondata = randomlevel.leveldata.missiondata;
  4161. var curnelevel = new Level(curcount + 1, newdata);
  4162. this.levelConfigs.add(curnelevel.levelid, curnelevel);
  4163. }
  4164. }
  4165. CreateLevel(_level) {
  4166. this.curlevel = _level;
  4167. _level.Create();
  4168. EventManager.Trigger(EventType.LevelCreateComplete, [_level]);
  4169. }
  4170. ReadyLevel() {
  4171. var stage = Number(PlayerAccount.CurAccountData.GetUser(AccountUser.stage));
  4172. console.log("ready level", stage + 1);
  4173. this.curlevel = this.levelConfigs.getValue(Number(stage + 1));
  4174. this.CreateLevel(this.curlevel);
  4175. }
  4176. ClearLevel() {
  4177. if (this.curlevel)
  4178. this.curlevel.Clear();
  4179. }
  4180. }
  4181. LevelManager.teststage = 19;
  4182. class HomeWindow extends ui.Window.HomeWindowUI {
  4183. constructor() {
  4184. super();
  4185. this.showlevel = [];
  4186. this.cantouch = true;
  4187. HomeWindow.instance = this;
  4188. }
  4189. static get Instance() {
  4190. return HomeWindow.instance;
  4191. }
  4192. InitSize() {
  4193. this.height = Laya.stage.height;
  4194. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  4195. this.moneypan.y = Laya.stage.height / 1280 * this.moneypan.y;
  4196. this.bottombtnpan.y = Laya.stage.height / 1280 * this.bottombtnpan.y;
  4197. this.stagepan.y = Laya.stage.height / 1280 * this.stagepan.y;
  4198. this.videopan.y = Laya.stage.height / 1280 * this.videopan.y;
  4199. }
  4200. getshowleveldata() {
  4201. var levels = [];
  4202. var curstageid = Number(PlayerAccount.CurAccountData.GetUser(AccountUser.stage)) + 1;
  4203. var levelsdata = LevelManager.Instance.levelConfigs.values;
  4204. for (var i = 0; i < levelsdata.length; i++) {
  4205. var curdata = levelsdata[i].leveldata;
  4206. if (curdata.id >= curstageid - 2 && curdata.id <= curstageid + 2) {
  4207. curdata.booslevel = curdata.getbooslevel();
  4208. if (curdata.id < curstageid)
  4209. curdata.state = -1;
  4210. if (curdata.id == curstageid)
  4211. curdata.state = 0;
  4212. if (curdata.id > curstageid)
  4213. curdata.state = 1;
  4214. levels.push(curdata);
  4215. }
  4216. }
  4217. var maxstage = levels[levels.length - 1].id;
  4218. if (levels.length == 4) {
  4219. var nextlevel = LevelManager.Instance.levelConfigs.getValue(maxstage + 1).leveldata;
  4220. nextlevel.booslevel = nextlevel.getbooslevel();
  4221. levels.push(nextlevel);
  4222. }
  4223. else if (levels.length == 3) {
  4224. var nextlevel = LevelManager.Instance.levelConfigs.getValue(maxstage + 1).leveldata;
  4225. nextlevel.booslevel = nextlevel.getbooslevel();
  4226. nextlevel.state = 1;
  4227. var nextlevel2 = LevelManager.Instance.levelConfigs.getValue(maxstage + 2).leveldata;
  4228. nextlevel2.booslevel = nextlevel2.getbooslevel();
  4229. nextlevel2.state = 1;
  4230. levels.push(nextlevel);
  4231. levels.push(nextlevel2);
  4232. }
  4233. return levels;
  4234. }
  4235. OnOpen(data = false) {
  4236. console.log("主界面打开...");
  4237. TtSdk.RecordEvent("enterMain");
  4238. this.InitSize();
  4239. this.RegButton();
  4240. this.showlevel = this.getshowleveldata();
  4241. this.RenderStage();
  4242. this.moneyclip.text = PlayerAccount.CurAccountData.GetUser(AccountUser.money);
  4243. }
  4244. RegButton() {
  4245. this.startbtn.clickHandler = Laya.Handler.create(this, this.OnClickStart, null, false);
  4246. this.othergamebtn.clickHandler = Laya.Handler.create(this, this.OnClickMoreGame, null, false);
  4247. this.skinbtn.clickHandler = Laya.Handler.create(this, this.OnClickSkinShop, null, false);
  4248. this.signbtn.clickHandler = Laya.Handler.create(this, this.OnSign, null, false);
  4249. this.cdbtn.clickHandler = Laya.Handler.create(this, this.OnClickCD, null, false);
  4250. this.videogetweapon.clickHandler = Laya.Handler.create(this, this.OnClickVideoGetWeapon, null, false);
  4251. this.videogettw.clickHandler = Laya.Handler.create(this, this.OnClickVideoGetTw, null, false);
  4252. EventManager.InputOn(TouchState.slider, this, this.OnTouchStart);
  4253. }
  4254. OnClickVideoGetWeapon() {
  4255. var reward = PlayerAccount.CurAccountData.GetReward(skintype.weapon);
  4256. if (reward == null)
  4257. return;
  4258. ADHelper.showVideoAd((flag) => {
  4259. if (flag) {
  4260. this.VideoGet(reward);
  4261. }
  4262. });
  4263. }
  4264. OnClickVideoGetTw() {
  4265. var reward = PlayerAccount.CurAccountData.GetReward(skintype.tw);
  4266. if (reward == null)
  4267. return;
  4268. ADHelper.showVideoAd((flag) => {
  4269. if (flag) {
  4270. this.VideoGet(reward);
  4271. }
  4272. });
  4273. }
  4274. VideoGet(_reward) {
  4275. var reward_item = _reward.rewarditem;
  4276. let param = [{ "reward_item": reward_item.toString() }, { "reward_num": _reward.rewardnum.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
  4277. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
  4278. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, _reward);
  4279. }), Laya.Handler.create(this, this.OnSignError), true);
  4280. }
  4281. RenderStage() {
  4282. for (var i = 0; i < this.stagelist.numChildren; i++) {
  4283. var _cell = this.stagelist.getChildAt(i);
  4284. var curdata = this.showlevel[i];
  4285. var bg = _cell.getChildAt(0);
  4286. bg.visible = !curdata.booslevel;
  4287. var bgskin = "";
  4288. var stageid = bg.getChildAt(0);
  4289. stageid.text = curdata.id.toString();
  4290. if (curdata.state == -1) {
  4291. bgskin = "zhujiemian-1-1";
  4292. bg.gray = true;
  4293. }
  4294. else if (curdata.state == 0) {
  4295. bgskin = "zhujiemian-3-1";
  4296. }
  4297. else {
  4298. bgskin = "zhujiemian-1-1";
  4299. }
  4300. bg.skin = "game/" + bgskin + ".png";
  4301. var boosksin = "";
  4302. var boosbg = _cell.getChildAt(1);
  4303. boosbg.visible = curdata.booslevel;
  4304. if (curdata.state == -1) {
  4305. boosksin = "zhujiemian-1-3";
  4306. boosbg.gray = true;
  4307. }
  4308. else if (curdata.state == 0) {
  4309. boosksin = "zhujiemian-4-3";
  4310. }
  4311. else {
  4312. boosksin = "zhujiemian-1-3";
  4313. }
  4314. boosbg.skin = "game/" + boosksin + ".png";
  4315. }
  4316. }
  4317. OnHide() {
  4318. Laya.timer.clearAll(this);
  4319. EventManager.InputOff(TouchState.slider, this, this.OnTouchStart);
  4320. }
  4321. OnTouchStart() {
  4322. if (!this.cantouch)
  4323. return;
  4324. var startpoint = new Laya.Point();
  4325. startpoint = this.bottombtnpan.localToGlobal(new Laya.Point(this.startbtn.x, this.startbtn.y));
  4326. var touchpos = new Laya.Vector2(this.mouseX, this.mouseY);
  4327. if (this.mouseX < startpoint.x || this.mouseX > startpoint.x + this.startbtn.width)
  4328. return;
  4329. if (this.mouseY < startpoint.y || this.mouseY > startpoint.y + this.startbtn.height)
  4330. return;
  4331. EventManager.InputOff(TouchState.slider, this, this.OnTouchStart);
  4332. GameManager.Instance.BeginGame();
  4333. }
  4334. OnClickStart() {
  4335. GameManager.Instance.BeginGame();
  4336. }
  4337. OnClickSkinShop() {
  4338. GameUtils.TweenButton(this.skinbtn, () => {
  4339. WindowManager.Instance.ShowWindow(WindowType.SkinWindow);
  4340. });
  4341. }
  4342. OnSign() {
  4343. GameUtils.TweenButton(this.signbtn, () => {
  4344. WindowManager.Instance.ShowWindow(WindowType.SignWindow);
  4345. });
  4346. }
  4347. OnClickCD() {
  4348. WindowManager.Instance.ShowWindow(WindowType.TaskWindow);
  4349. }
  4350. OnClickMoreGame() {
  4351. GameUtils.TweenButton(this.othergamebtn, () => {
  4352. TtSdk.showToast("暂未开放");
  4353. });
  4354. }
  4355. OnSignError(e) {
  4356. console.log(e);
  4357. }
  4358. }
  4359. HomeWindow.sign = true;
  4360. HomeWindow.skin = true;
  4361. class SettlementWindow extends ui.Window.SettlementWindowUI {
  4362. constructor() {
  4363. super();
  4364. this.curwin = false;
  4365. this.videoopen = true;
  4366. this.settment = false;
  4367. SettlementWindow.instance = this;
  4368. }
  4369. static get Instance() {
  4370. return SettlementWindow.instance;
  4371. }
  4372. InitSize() {
  4373. this.height = Laya.stage.height;
  4374. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  4375. this.pan.y = Laya.stage.height / 1280 * this.pan.y;
  4376. this.moneypan.y = Laya.stage.height / 1280 * this.moneypan.y;
  4377. this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
  4378. }
  4379. OnOpen(_win = false) {
  4380. this.curwin = _win;
  4381. this.curlevel = LevelManager.Instance.curlevel;
  4382. var money = this.curwin ? this.curlevel.leveldata.missiondata.win : this.curlevel.leveldata.missiondata.lose;
  4383. money += GameManager.Instance.goldnum;
  4384. this.moneyclip.text = money.toString();
  4385. this.InitSize();
  4386. this.RegButton();
  4387. TtSdk.Instance.RecordStop();
  4388. TtSdk.RecordEvent("openResult");
  4389. this.winshow.visible = this.curwin;
  4390. this.loseshow.visible = !this.curwin;
  4391. this.videoopen = PlayerAccount.CurAccountData.videolock;
  4392. this.videopoint.visible = this.videoopen;
  4393. }
  4394. RegButton() {
  4395. this.nomalaward.clickHandler = Laya.Handler.create(this, this.OnClickNomalAward, null, false);
  4396. this.awardbtn.clickHandler = Laya.Handler.create(this, this.OnGetAward, null, false);
  4397. this.videobtn.clickHandler = Laya.Handler.create(this, this.OnClcikVideo, null, false);
  4398. }
  4399. OnHide() {
  4400. }
  4401. OnClcikVideo() {
  4402. this.videoopen = !this.videoopen;
  4403. this.videopoint.visible = this.videoopen;
  4404. }
  4405. GetSettment(_cb, double = false) {
  4406. if (this.settment) {
  4407. _cb();
  4408. GameManager.Instance.ChangeGameState(GameState.Over, this.curwin);
  4409. }
  4410. this.settment = true;
  4411. var money = this.curwin ? this.curlevel.leveldata.missiondata.win : this.curlevel.leveldata.missiondata.lose;
  4412. money += GameManager.Instance.goldnum;
  4413. if (double)
  4414. money *= 3;
  4415. var goldnum = money.toString();
  4416. var wins = this.curwin ? "1" : "0";
  4417. var agrs = [{ "t": PlayerAccount.CurrentAccount.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id.toString() }, { "win": wins }, { "money": goldnum }];
  4418. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.end, agrs, new Laya.Handler(this, (_data) => {
  4419. _cb();
  4420. }), new Laya.Handler(this, (_data) => {
  4421. console.log("游戏结果err", _data);
  4422. }));
  4423. }
  4424. OnClickNomalAward() {
  4425. GameUtils.TweenButton(this.nomalaward, this.OnSee);
  4426. }
  4427. OnSee() {
  4428. if (SettlementWindow.Instance.videoopen) {
  4429. SettlementWindow.Instance.OnGetAward();
  4430. }
  4431. else {
  4432. SettlementWindow.Instance.GetSettment(() => {
  4433. GameManager.Instance.ChangeGameState(GameState.Over, SettlementWindow.Instance.curwin);
  4434. });
  4435. }
  4436. }
  4437. OnGetAward() {
  4438. if (ADHelper.IsAndroid) {
  4439. ADHelper.showVideoAd((flag) => {
  4440. if (flag) {
  4441. this.GetSettment(() => {
  4442. GameManager.Instance.ChangeGameState(GameState.Over, this.curwin);
  4443. }, true);
  4444. }
  4445. });
  4446. }
  4447. else {
  4448. this.GetSettment(() => {
  4449. GameManager.Instance.ChangeGameState(GameState.Over, this.curwin);
  4450. }, true);
  4451. }
  4452. }
  4453. }
  4454. class RewardWindow extends ui.Window.RewardWindowUI {
  4455. constructor() {
  4456. super();
  4457. RewardWindow.instance = this;
  4458. this.pan.y = Laya.stage.height / 1280 * this.pan.y;
  4459. RewardWindow.btny = this.Btn.y;
  4460. }
  4461. static get Instance() {
  4462. return RewardWindow.instance;
  4463. }
  4464. OnOpen(_rewarddata = null) {
  4465. this.height = Laya.stage.height;
  4466. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  4467. this.Btn.y = Laya.stage.height / 1280 * RewardWindow.btny;
  4468. this.curreward = _rewarddata;
  4469. if (this.curreward == null) {
  4470. WindowManager.Instance.ClosePopView(WindowType.RewardWindow);
  4471. return;
  4472. }
  4473. this.skindesc.visible = false;
  4474. this.usebtn.visible = false;
  4475. this.ShowReward(_rewarddata);
  4476. TtSdk.Showbanner();
  4477. }
  4478. OnHide() {
  4479. }
  4480. OnClickClose() {
  4481. WindowManager.Instance.ClosePopView(WindowType.RewardWindow);
  4482. if (this.closeback) {
  4483. this.closeback();
  4484. this.closeback = null;
  4485. }
  4486. }
  4487. ShowReward(_data) {
  4488. this.closebtn.clickHandler = Laya.Handler.create(this, this.OnClickClose);
  4489. this.icon.skin = "icon/" + _data.rewardicon + ".png";
  4490. this.skindesc.visible = true;
  4491. this.skindesc.text = _data.rewardname;
  4492. this.usebtn.visible = true;
  4493. var skinid = _data.rewarditem % 6000;
  4494. this.usebtn.clickHandler = Laya.Handler.create(this, this.OnUseSkin, [skinid], false);
  4495. }
  4496. OnUseSkin(_id) {
  4497. var skinid = _id;
  4498. var curskin = PlayerAccount.CurAccountData.m_skinDic.getValue(_id);
  4499. var agrs = [{ "id": skinid.toString() }];
  4500. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Equip, agrs, Laya.Handler.create(this, () => {
  4501. PlayerAccount.CurAccountData.UpdateSkinDic();
  4502. this.OnClickClose();
  4503. EventManager.Trigger(EventType.UseSkin, [curskin]);
  4504. }), null);
  4505. }
  4506. }
  4507. RewardWindow.btny = 1;
  4508. class ReviveWindow extends ui.Window.ReviveWindowUI {
  4509. constructor() {
  4510. super();
  4511. this.counttime = 5;
  4512. this.play = true;
  4513. ReviveWindow.instance = this;
  4514. }
  4515. static get Instance() {
  4516. return ReviveWindow.instance;
  4517. }
  4518. InitSize() {
  4519. this.height = Laya.stage.height;
  4520. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  4521. this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
  4522. this.pan.y = Laya.stage.height / 1280 * this.pan.y;
  4523. }
  4524. OnOpen(_win = false) {
  4525. this.InitSize();
  4526. this.RegButton();
  4527. GameManager.alllose++;
  4528. Laya.timer.loop(1000, this, this.OnCountTime);
  4529. TtSdk.RecordEvent("openRelive");
  4530. TtSdk.Showbanner();
  4531. }
  4532. RegButton() {
  4533. this.passbtn.clickHandler = Laya.Handler.create(this, this.OnPass, null, false);
  4534. this.closebtn.clickHandler = Laya.Handler.create(this, this.OnClose, null, false);
  4535. }
  4536. OnHide() {
  4537. Laya.timer.clear(this, this.OnCountTime);
  4538. }
  4539. OnCountTime() {
  4540. if (!this.play)
  4541. return;
  4542. if (this.counttime > 0) {
  4543. this.counttime -= 1;
  4544. }
  4545. else {
  4546. Laya.timer.clear(this, this.OnCountTime);
  4547. this.counttime = 0;
  4548. this.OnClose();
  4549. }
  4550. this.timetex.text = this.counttime.toString();
  4551. }
  4552. OnPass() {
  4553. if (ADHelper.IsAndroid) {
  4554. this.play = false;
  4555. ADHelper.showVideoAd((flag) => {
  4556. if (flag) {
  4557. Player.mainpalyer.Revive();
  4558. GameManager.Instance.ChangeGameState(GameState.Playing);
  4559. }
  4560. else {
  4561. this.play = true;
  4562. }
  4563. });
  4564. }
  4565. else {
  4566. Player.mainpalyer.Revive();
  4567. GameManager.Instance.ChangeGameState(GameState.Playing);
  4568. }
  4569. }
  4570. OnClose() {
  4571. GameManager.Instance.CheckComplete(false);
  4572. }
  4573. }
  4574. class SkinWindow extends ui.Window.SkinWindowUI {
  4575. constructor() {
  4576. super();
  4577. this.curskindatas = [];
  4578. this.rootspeed1 = -0.015;
  4579. this.currotspeed = -0.015;
  4580. this.canwear = true;
  4581. SkinWindow.instance = this;
  4582. }
  4583. static get Instance() {
  4584. return SkinWindow.instance;
  4585. }
  4586. OnOpen(_data = null) {
  4587. this.height = Laya.stage.height;
  4588. this.moneypan.y = Laya.stage.height / 1280 * this.moneypan.y;
  4589. this.homebtn.y = Laya.stage.height / 1280 * this.homebtn.y;
  4590. this.listpan.top = Laya.stage.height / 1280 * this.listpan.top;
  4591. this.cdkbtn.y = Laya.stage.height / 1280 * this.cdkbtn.y;
  4592. this.RegEvent();
  4593. this.moneyclip.text = PlayerAccount.CurAccountData.GetUser(AccountUser.money);
  4594. Laya.timer.once(10, this, () => {
  4595. this.NewShow();
  4596. });
  4597. }
  4598. RegEvent() {
  4599. this.homebtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
  4600. this.pfbtn.clickHandler = Laya.Handler.create(this, this.OnClickXGG, null, false);
  4601. this.wqbtn.clickHandler = Laya.Handler.create(this, this.OnClickXJJ, null, false);
  4602. this.twbtn.clickHandler = Laya.Handler.create(this, this.OnClickTW, null, false);
  4603. this.cdkbtn.clickHandler = Laya.Handler.create(this, this.OnOpenCDkView, null, false);
  4604. EventManager.On(EventType.UseSkin, this, this.ReFreshData);
  4605. EventManager.On(EventType.getmoney, this, this.ReFreshData);
  4606. }
  4607. OnClickXGG() {
  4608. this.SetBtnShow(skintype.role);
  4609. this.ShowBoySkin();
  4610. }
  4611. OnClickXJJ() {
  4612. this.SetBtnShow(skintype.weapon);
  4613. this.ShowGirlSkin();
  4614. }
  4615. OnClickTW() {
  4616. this.SetBtnShow(skintype.tw);
  4617. this.ShowTwSkin();
  4618. }
  4619. OnOpenCDkView() {
  4620. WindowManager.Instance.OpenPopView(WindowType.CDKView);
  4621. }
  4622. SetBtnShow(_skintype) {
  4623. for (var i = 0; i < this.skinpan.numChildren; i++) {
  4624. var skin = this.skinpan.getChildAt(i);
  4625. var closeskin = skin.getChildAt(1);
  4626. if (i + 1 == _skintype) {
  4627. closeskin.visible = false;
  4628. }
  4629. else {
  4630. closeskin.visible = true;
  4631. }
  4632. }
  4633. }
  4634. OnHide() {
  4635. if (this.mainrole)
  4636. PoolManager.RecoverSprite3D(this.mainrole);
  4637. Laya.timer.clear(this, this.RotLoop);
  4638. if (this.panCamera) {
  4639. this.panCamera.active = false;
  4640. this.panCamera.removeSelf();
  4641. this.panCamera.destroy();
  4642. }
  4643. if (this.panlight) {
  4644. this.panlight.active = false;
  4645. this.panlight.removeSelf();
  4646. this.panlight.destroy();
  4647. }
  4648. if (this.showpan) {
  4649. this.showpan.active = false;
  4650. this.showpan.removeSelf();
  4651. this.showpan.destroy();
  4652. }
  4653. if (this.panScence) {
  4654. this.panScence.active = false;
  4655. this.panScence.removeSelf();
  4656. this.panScence.destroy();
  4657. }
  4658. EventManager.Off(EventType.UseSkin, this, this.ReFreshData);
  4659. EventManager.Off(EventType.getmoney, this, this.ReFreshData);
  4660. }
  4661. GetSkinDatas(_skintype) {
  4662. var skins = PlayerAccount.CurAccountData.m_skinDic.values;
  4663. var gets = [];
  4664. var locks = [];
  4665. for (var i = 0; i < skins.length; i++) {
  4666. var curskin = skins[i];
  4667. if (curskin.skintype != _skintype)
  4668. continue;
  4669. if (curskin.curskinstate != skinstate.lock) {
  4670. gets.push(curskin);
  4671. }
  4672. else {
  4673. locks.push(curskin);
  4674. }
  4675. }
  4676. return gets.concat(locks);
  4677. }
  4678. NewShow() {
  4679. this.panScence = new Laya.Scene3D();
  4680. this.addChild(this.panScence);
  4681. this.panCamera = new Laya.Camera();
  4682. this.panCamera.orthographic = true;
  4683. this.panScence.addChild(this.panCamera);
  4684. this.panCamera.transform.position = new Laya.Vector3(0, 10, 10);
  4685. this.panCamera.viewport = new Laya.Viewport(0, 0, Laya.stage.width, Laya.stage.height);
  4686. this.panCamera.clearFlag = 2;
  4687. var screensize = Laya.stage.height / 1280;
  4688. this.panCamera.orthographicVerticalSize = 20 * screensize;
  4689. this.panlight = new Laya.DirectionLight();
  4690. this.panScence.addChild(this.panlight);
  4691. this.panlight.intensity = 0.6;
  4692. this.showpan = new Laya.Sprite3D();
  4693. this.panScence.addChild(this.showpan);
  4694. var sfasf = this.patbg.localToGlobal(new Laya.Point(this.pt.x, this.pt.y));
  4695. var viewpos = new Laya.Vector3(sfasf.x, sfasf.y, 0);
  4696. var outworldpos = new Laya.Vector3();
  4697. this.panCamera.convertScreenCoordToOrthographicCoord(viewpos, outworldpos);
  4698. this.showpan.transform.position = new Laya.Vector3(outworldpos.x, outworldpos.y, 0);
  4699. Laya.timer.frameLoop(1, this, this.RotLoop);
  4700. this.skinlist.vScrollBarSkin = "";
  4701. this.skinlist.renderHandler = Laya.Handler.create(this, this.OnRender, null, false);
  4702. this.OnClickXGG();
  4703. }
  4704. RotLoop() {
  4705. if (this.mainrole && this.mainrole.active) {
  4706. this.showpan.transform.rotate(new Laya.Vector3(0, this.currotspeed, 0));
  4707. }
  4708. }
  4709. OnClickClose() {
  4710. GameUtils.TweenButton(this.homebtn, () => {
  4711. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  4712. });
  4713. }
  4714. OnRender(_cell, index) {
  4715. var data = _cell.dataSource;
  4716. var icon = _cell.getChildAt(2);
  4717. var selectim = _cell.getChildAt(1);
  4718. selectim.visible = false;
  4719. var getbtn = _cell.getChildAt(5);
  4720. getbtn.visible = false;
  4721. var getbtnbg = _cell.getChildAt(4);
  4722. this.SetGetBtn(getbtnbg, data);
  4723. getbtn.clickHandler = null;
  4724. if (data.curskinstate == skinstate.getnoues) {
  4725. getbtn.visible = true;
  4726. getbtn.clickHandler = Laya.Handler.create(this, this.WearSkin, [data], false);
  4727. }
  4728. else if (data.curskinstate == skinstate.lock) {
  4729. if (data.require_type == 2) {
  4730. getbtn.visible = true;
  4731. getbtn.clickHandler = Laya.Handler.create(this, this.MoneyGet, [data], false);
  4732. }
  4733. else if (data.require_type == 3) {
  4734. getbtn.visible = true;
  4735. getbtn.clickHandler = Laya.Handler.create(this, this.VideoGet, [data], false);
  4736. }
  4737. }
  4738. icon.skin = "icon/" + data.skinicon + ".png";
  4739. var showbtn = _cell.getChildAt(3);
  4740. showbtn.clickHandler = Laya.Handler.create(this, this.ShowRole, [data, index], false);
  4741. }
  4742. SetGetBtn(_btn, _data) {
  4743. var getuseing = _btn.getChildAt(1);
  4744. getuseing.visible = _data.curskinstate == skinstate.useing;
  4745. var getuse = _btn.getChildAt(2);
  4746. getuse.visible = _data.curskinstate == skinstate.getnoues;
  4747. var getvideo = _btn.getChildAt(3);
  4748. getvideo.visible = false;
  4749. var videoclip = getvideo.getChildAt(1);
  4750. var getmoney = _btn.getChildAt(4);
  4751. getmoney.visible = false;
  4752. var moneyclip = getmoney.getChildAt(1);
  4753. var getactiveity = _btn.getChildAt(5);
  4754. getactiveity.visible = false;
  4755. var getsign = _btn.getChildAt(6);
  4756. getsign.visible = false;
  4757. var getstage = _btn.getChildAt(7);
  4758. getstage.visible = false;
  4759. if (_data.curskinstate == skinstate.lock) {
  4760. if (_data.require_type == 2) {
  4761. getmoney.visible = true;
  4762. moneyclip.text = _data.require_num.toString();
  4763. }
  4764. else if (_data.require_type == 3) {
  4765. getvideo.visible = true;
  4766. videoclip.text = this.GetProgress(_data.skinid) + "/" + _data.require_num;
  4767. }
  4768. else if (_data.require_type == 5) {
  4769. getsign.visible = true;
  4770. }
  4771. else if (_data.require_type == 7) {
  4772. getstage.visible = true;
  4773. getstage.text = "通过第" + _data.require_num + "关";
  4774. }
  4775. else {
  4776. getactiveity.visible = true;
  4777. }
  4778. }
  4779. }
  4780. ShowRole(_skin, _cellindex = 0) {
  4781. for (var i = 0; i < this.skinlist.cells.length; i++) {
  4782. var selected = this.skinlist.cells[i].getChildAt(1);
  4783. selected.visible = i == _cellindex;
  4784. }
  4785. if (this.roomfangjianmaterial)
  4786. this.roomfangjianmaterial.albedoTexture = null;
  4787. if (!_skin || this.curskin == _skin) {
  4788. return;
  4789. }
  4790. this.showpan.transform.rotationEuler = new Laya.Vector3(0, 0, 0);
  4791. if (this.curskin != null && this.mainrole) {
  4792. PoolManager.RecoverSprite3D(this.mainrole);
  4793. }
  4794. this.curskin = _skin;
  4795. var asset;
  4796. if (this.curskin.skintype == skintype.role) {
  4797. var curid = this.curskin.skinid <= 6 ? this.curskin.skinid : this.curskin.skinid - 12;
  4798. asset = AssetManager.role.getValue(curid);
  4799. }
  4800. else if (this.curskin.skintype == skintype.weapon) {
  4801. asset = AssetManager.weapon.getValue(this.curskin.skinid - 6);
  4802. }
  4803. else {
  4804. asset = AssetManager.tw.getValue(this.curskin.skinid - 24);
  4805. }
  4806. this.mainrole = PoolManager.GetSprite3D(asset);
  4807. this.showpan.addChild(this.mainrole);
  4808. this.mainrole.transform.localPosition = new Laya.Vector3(0, 0, 0);
  4809. if (this.curskin.skintype != skintype.role) {
  4810. this.mainrole.transform.setWorldLossyScale(new Laya.Vector3(2.5, 2.5, 2.5));
  4811. }
  4812. else {
  4813. this.mainrole.transform.setWorldLossyScale(new Laya.Vector3(1.5, 1.5, 1.5));
  4814. }
  4815. if (_skin.skintype == skintype.tw) {
  4816. this.mainrole.transform.localPositionX = 2;
  4817. this.currotspeed = -0.1;
  4818. }
  4819. else {
  4820. this.currotspeed = 0;
  4821. }
  4822. }
  4823. GetProgress(_id) {
  4824. var ccc = PlayerAccount.CurAccountData.GetUser(AccountUser.progress_themes);
  4825. var progress = ccc[_id] ? ccc[_id] : 0;
  4826. return progress;
  4827. }
  4828. MoneyGet(_skindata) {
  4829. console.log("点击金币购买:" + _skindata.skinname, "1");
  4830. var money = Number(PlayerAccount.CurAccountData.GetUser(AccountUser.money));
  4831. if (money < _skindata.require_num) {
  4832. TtSdk.showToast("金币不足!");
  4833. return;
  4834. }
  4835. var key = PROTOCOLS.Buy;
  4836. var agrs = [{ "id": _skindata.skinid.toString() }];
  4837. NetworkManager.Instance.HttpPostRequest(key, agrs, Laya.Handler.create(this, () => {
  4838. this.ReFreshData();
  4839. console.log("点击金币购买成功:" + _skindata.skinname, "1");
  4840. var reward = new rewarddata(_skindata.skinid + 6000);
  4841. reward.type = 1;
  4842. reward.rewardicon = _skindata.skinicon;
  4843. reward.rewardname = _skindata.skinname;
  4844. reward.rewardnum = 1;
  4845. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
  4846. }), null);
  4847. }
  4848. VideoGet(_skindata) {
  4849. console.log("商城界面:点击看视频获得皮肤->" + _skindata.skinname, "1");
  4850. if (ADHelper.IsAndroid) {
  4851. ADHelper.showVideoAd((flag) => {
  4852. if (flag) {
  4853. var getkey = PROTOCOLS.fission;
  4854. var agrs = [{ "id": _skindata.skinid.toString() }, { "channel": "video" }, { "t": PlayerAccount.ServerTime.toString() }];
  4855. NetworkManager.Instance.HttpPostRequest(getkey, agrs, Laya.Handler.create(this, () => {
  4856. this.ReFreshData();
  4857. console.log("点击看视频获得皮肤成功:" + _skindata.skinname, "1");
  4858. var curskin = PlayerAccount.CurAccountData.m_skinDic.getValue(_skindata.skinid);
  4859. if (curskin.curskinstate == skinstate.getnoues) {
  4860. var reward = new rewarddata(_skindata.skinid + 6000);
  4861. reward.type = 1;
  4862. reward.rewardicon = _skindata.skinicon;
  4863. reward.rewardname = _skindata.skinname;
  4864. reward.rewardnum = 1;
  4865. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
  4866. }
  4867. }), Laya.Handler.create(this, () => { }));
  4868. }
  4869. });
  4870. }
  4871. else {
  4872. var getkey = PROTOCOLS.fission;
  4873. var agrs21 = [{ "id": _skindata.skinid.toString() }, { "channel": "video" }, { "t": PlayerAccount.ServerTime.toString() }];
  4874. NetworkManager.Instance.HttpPostRequest(getkey, agrs21, Laya.Handler.create(this, () => {
  4875. this.ReFreshData();
  4876. var curskin = PlayerAccount.CurAccountData.m_skinDic.getValue(_skindata.skinid);
  4877. if (curskin.curskinstate == skinstate.getnoues) {
  4878. var reward = new rewarddata(_skindata.skinid + 6000);
  4879. reward.type = 1;
  4880. reward.rewardicon = _skindata.skinicon;
  4881. reward.rewardname = _skindata.skinname;
  4882. reward.rewardnum = 1;
  4883. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
  4884. }
  4885. }), Laya.Handler.create(this, () => { }));
  4886. }
  4887. }
  4888. ReFreshData() {
  4889. this.moneyclip.text = PlayerAccount.CurAccountData.GetUser(AccountUser.money);
  4890. PlayerAccount.CurAccountData.UpdateSkinDic();
  4891. this.skinlist.array = this.GetSkinDatas(this.curskintype);
  4892. var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[this.curskintype];
  4893. var curskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
  4894. console.log(this.curskintype, equip, curskin);
  4895. this.ShowRole(curskin);
  4896. }
  4897. WearSkin(_skin) {
  4898. if (!this.canwear)
  4899. return;
  4900. this.canwear = false;
  4901. console.log("wear:", _skin.skinid);
  4902. var agrs = [{ "id": _skin.skinid.toString() }];
  4903. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Equip, agrs, Laya.Handler.create(this, (e) => {
  4904. this.ReFreshData();
  4905. var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[this.curskintype];
  4906. var curskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
  4907. EventManager.Trigger(EventType.UseSkin, [_skin]);
  4908. this.ShowRole(curskin);
  4909. this.canwear = true;
  4910. }), null);
  4911. }
  4912. ShowBoySkin() {
  4913. this.curskintype = skintype.role;
  4914. this.curskindatas = this.GetSkinDatas(skintype.role);
  4915. this.skinlist.array = this.curskindatas;
  4916. var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[this.curskintype];
  4917. var equipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
  4918. this.ShowRole(equipskin);
  4919. }
  4920. ShowGirlSkin() {
  4921. this.curskintype = skintype.weapon;
  4922. this.curskindatas = this.GetSkinDatas(skintype.weapon);
  4923. this.skinlist.array = this.curskindatas;
  4924. var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[this.curskintype];
  4925. var equipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
  4926. if (equipskin)
  4927. this.ShowRole(equipskin);
  4928. }
  4929. ShowTwSkin() {
  4930. this.curskintype = skintype.tw;
  4931. this.curskindatas = this.GetSkinDatas(skintype.tw);
  4932. this.skinlist.array = this.curskindatas;
  4933. var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[this.curskintype];
  4934. if (equip == undefined) {
  4935. equip = 25;
  4936. }
  4937. var equipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
  4938. if (equipskin)
  4939. this.ShowRole(equipskin);
  4940. }
  4941. }
  4942. class TryoutWindow extends ui.Window.TryoutWindowUI {
  4943. constructor() {
  4944. super();
  4945. this.lowskins = [];
  4946. this.highskins = [];
  4947. this.upskins = [];
  4948. TryoutWindow.instance = this;
  4949. }
  4950. static get Instance() {
  4951. return TryoutWindow.instance;
  4952. }
  4953. InitSize() {
  4954. this.height = Laya.stage.height;
  4955. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  4956. this.pan.y = Laya.stage.height / 1180 * this.pan.y;
  4957. this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
  4958. }
  4959. OnOpen(_data = null) {
  4960. this.InitSize();
  4961. this.RegButton();
  4962. this.GetSkinDatas();
  4963. if (this.lowskins.length == 0 && this.highskins.length == 0) {
  4964. this.OnClickClose();
  4965. }
  4966. else {
  4967. TtSdk.Showbanner();
  4968. TtSdk.RecordEvent("enterTry");
  4969. this.upskins = this.GetUpdatas(this.lowskins);
  4970. this.downskin = this.GetDowndatas();
  4971. if (this.upskins.length == 0 && !this.downskin) {
  4972. this.OnClickClose();
  4973. return;
  4974. }
  4975. this.ShowUpSkins();
  4976. this.ShowDownSkin();
  4977. }
  4978. }
  4979. RegButton() {
  4980. this.passbtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
  4981. }
  4982. OnHide() {
  4983. }
  4984. OnClickClose() {
  4985. GameManager.Instance.RecordLevelStart();
  4986. GameManager.Instance.ChangeGameState(GameState.Start);
  4987. }
  4988. OnClcikItem(_skin) {
  4989. if (ADHelper.IsAndroid) {
  4990. ADHelper.showVideoAd((flag) => {
  4991. if (flag) {
  4992. this.GetGetVideoAward(_skin);
  4993. }
  4994. });
  4995. }
  4996. else {
  4997. this.GetGetVideoAward(_skin);
  4998. }
  4999. }
  5000. GetGetVideoAward(_skin) {
  5001. EventManager.Trigger(EventType.UseSkin, [_skin]);
  5002. this.OnClickClose();
  5003. }
  5004. ShowUpSkins() {
  5005. this.upskinpan.x += (3 - this.upskins.length) * 99;
  5006. for (var i = 0; i < this.upskinpan.numChildren; i++) {
  5007. var skinpan = this.upskinpan.getChildAt(i);
  5008. if (i < this.upskins.length) {
  5009. var varskin = this.upskins[i];
  5010. var btn = skinpan.getChildAt(1);
  5011. var name = skinpan.getChildAt(2);
  5012. name.text = varskin.skinname;
  5013. var icon = skinpan.getChildAt(3);
  5014. icon.skin = "icon/" + varskin.skinicon + ".png";
  5015. btn.clickHandler = Laya.Handler.create(this, this.OnClcikItem, [varskin], false);
  5016. }
  5017. else {
  5018. skinpan.visible = false;
  5019. }
  5020. }
  5021. }
  5022. ShowDownSkin() {
  5023. this.downskinpan.visible = this.downskin != null;
  5024. if (this.downskinpan.visible) {
  5025. var name = this.downskinpan.getChildAt(0).getChildAt(0);
  5026. name.text = this.downskin.skinname;
  5027. var icon = this.downskinpan.getChildAt(0).getChildAt(1);
  5028. icon.skin = "icon/" + this.downskin.skinicon + ".png";
  5029. this.tribtn2.clickHandler = Laya.Handler.create(this, this.OnClcikItem, [this.downskin], false);
  5030. }
  5031. }
  5032. GetSkinDatas() {
  5033. for (var i = 0; i < PlayerAccount.CurAccountData.m_skinDic.values.length; i++) {
  5034. var skindata = PlayerAccount.CurAccountData.m_skinDic.values[i];
  5035. if (skindata.curskinstate == skinstate.lock && skindata.skintype == skintype.weapon && skindata.require_type != 6) {
  5036. if (skindata.quality == 1) {
  5037. this.lowskins.push(skindata);
  5038. }
  5039. else {
  5040. this.highskins.push(skindata);
  5041. }
  5042. }
  5043. }
  5044. }
  5045. GetUpdatas(_skindatas) {
  5046. var mskins = [];
  5047. var randomindex1 = GameUtils.getRandomInt(0, _skindatas.length - 1);
  5048. var randomskin1 = _skindatas[randomindex1];
  5049. mskins.push(randomskin1);
  5050. _skindatas.splice(randomindex1, 1);
  5051. if (_skindatas.length > 0) {
  5052. var randomindex2 = GameUtils.getRandomInt(0, _skindatas.length - 1);
  5053. var randomskin2 = _skindatas[randomindex2];
  5054. mskins.push(randomskin2);
  5055. _skindatas.splice(randomindex2, 1);
  5056. }
  5057. if (_skindatas.length > 0) {
  5058. var randomindex3 = GameUtils.getRandomInt(0, _skindatas.length - 1);
  5059. var randomskin3 = _skindatas[randomindex3];
  5060. mskins.push(randomskin3);
  5061. _skindatas.splice(randomindex3, 1);
  5062. }
  5063. return mskins;
  5064. }
  5065. GetDowndatas() {
  5066. var mskins;
  5067. if (this.highskins.length > 0) {
  5068. var randomindex1 = GameUtils.getRandomInt(0, this.highskins.length - 1);
  5069. mskins = this.highskins[randomindex1];
  5070. }
  5071. else {
  5072. if (this.lowskins.length > 0) {
  5073. var randomindex3 = GameUtils.getRandomInt(0, this.lowskins.length - 1);
  5074. mskins = this.lowskins[randomindex3];
  5075. }
  5076. }
  5077. return mskins;
  5078. }
  5079. OnSignError(e) {
  5080. console.log(e);
  5081. }
  5082. }
  5083. var SignItemState;
  5084. (function (SignItemState) {
  5085. SignItemState[SignItemState["ready"] = 0] = "ready";
  5086. SignItemState[SignItemState["videoready"] = 1] = "videoready";
  5087. SignItemState[SignItemState["locking"] = 2] = "locking";
  5088. SignItemState[SignItemState["complete"] = 3] = "complete";
  5089. })(SignItemState || (SignItemState = {}));
  5090. class RewardData {
  5091. constructor(_id, _num) {
  5092. this.rewardid = _id;
  5093. this.rewardnum = _num;
  5094. }
  5095. }
  5096. class SignItem {
  5097. get RewardsData() {
  5098. var rewardsdata = this.rewards.split(";");
  5099. if (rewardsdata.length > 1) {
  5100. return new RewardData(Number(6000), Number(1));
  5101. }
  5102. else {
  5103. return new RewardData(Number(this.rewards), Number(this.rewardsNum));
  5104. }
  5105. }
  5106. }
  5107. class SignWindow extends ui.Window.SignWindowUI {
  5108. constructor() {
  5109. super();
  5110. this.SignAwardDic = {};
  5111. this.curSignItems = [];
  5112. this.videoopen = true;
  5113. SignWindow.instance = this;
  5114. }
  5115. static get Instance() {
  5116. return SignWindow.instance;
  5117. }
  5118. OnOpen(_data = null) {
  5119. this.pan.y = Laya.stage.height / 1280 * this.pan.y;
  5120. this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
  5121. this.curSignItems = this.SignItemsData;
  5122. this.ReFreshSginList();
  5123. this.signBtn.visible = SignWindow.canSgin;
  5124. this.awardbtn.visible = SignWindow.canSgin;
  5125. this.signBtn.clickHandler = Laya.Handler.create(this, this.OOPO, null, false);
  5126. this.closebtn2.clickHandler = Laya.Handler.create(this, this.OnCloseClick);
  5127. this.awardbtn.clickHandler = Laya.Handler.create(this, this.OnClickDouble, null, false);
  5128. this.height = Laya.stage.height;
  5129. this.videobtn.clickHandler = Laya.Handler.create(this, this.OnClcikVideo, null, false);
  5130. TtSdk.Showbanner();
  5131. this.videoopen = PlayerAccount.CurAccountData.videolock;
  5132. this.videopoint.visible = this.videoopen;
  5133. }
  5134. OnCloseClick() {
  5135. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  5136. }
  5137. OnClcikVideo() {
  5138. this.videoopen = !this.videoopen;
  5139. this.videopoint.visible = this.videoopen;
  5140. }
  5141. get SignItemsData() {
  5142. var SignItems = [];
  5143. var config = PlayerAccount.CurAccountData.GetConfig(AccountConfig.sign);
  5144. var signday = Number(PlayerAccount.CurAccountData.GetSign(signdata.sign_days));
  5145. var signtime = Number(PlayerAccount.CurAccountData.GetSign(signdata.sign_time));
  5146. var frist = signday < 7;
  5147. var index = frist ? 0 : 7;
  5148. for (var i = index; i < index + 7; i++) {
  5149. this.SignAwardDic[config[i].id] = config[i].rewards;
  5150. }
  5151. for (var key in this.SignAwardDic) {
  5152. var rewardid = this.SignAwardDic[key];
  5153. var reward = PlayerAccount.CurAccountData.GetRewardConfig(rewardid);
  5154. var signitem = new SignItem();
  5155. signitem.desc = reward.group_name;
  5156. signitem.icon = reward.icon;
  5157. signitem.signId = Number(reward.id);
  5158. signitem.rewards = reward.reward_item;
  5159. signitem.rewardsNum = reward.reward_num;
  5160. signitem.weight = reward.reward_weight;
  5161. var daynum = Number(key);
  5162. if (signday + 1 > daynum) {
  5163. signitem.itemState = SignItemState.complete;
  5164. }
  5165. if (signday + 1 < daynum) {
  5166. signitem.itemState = SignItemState.locking;
  5167. }
  5168. if (signday + 1 == daynum) {
  5169. signitem.itemState = SignItemState.ready;
  5170. }
  5171. SignItems.push(signitem);
  5172. }
  5173. return SignItems;
  5174. }
  5175. static get canSgin() {
  5176. let todayZero = new Date(PlayerAccount.ServerTime * 1000);
  5177. todayZero.setHours(0, 0, 0, 0);
  5178. var zeroTime = todayZero.valueOf();
  5179. var signtime = Number(PlayerAccount.CurAccountData.GetSign(signdata.sign_time));
  5180. var signTime = signtime * 1000;
  5181. var can = signTime < zeroTime ? true : false;
  5182. return can;
  5183. }
  5184. ReFreshSginList() {
  5185. this.Btn.visible = SignWindow.canSgin;
  5186. this.closebtn2.visible = !SignWindow.canSgin;
  5187. for (var i = 0; i < this.signlist.numChildren; i++) {
  5188. var sign = this.signlist.getChildAt(i);
  5189. var data = this.curSignItems[i];
  5190. var showbox;
  5191. var showbox0 = sign.getChildAt(0);
  5192. showbox0.visible = false;
  5193. var showbox1 = sign.getChildAt(1);
  5194. showbox1.visible = false;
  5195. var showbox2 = sign.getChildAt(2);
  5196. showbox2.visible = false;
  5197. if (data.itemState == SignItemState.locking) {
  5198. showbox = showbox0;
  5199. }
  5200. else if (data.itemState == SignItemState.ready) {
  5201. showbox = showbox1;
  5202. }
  5203. else {
  5204. showbox = showbox2;
  5205. }
  5206. showbox.visible = true;
  5207. var awardtype = data.RewardsData.rewardid;
  5208. if (awardtype == 1000) {
  5209. var gold = showbox.getChildByName("gold");
  5210. gold.visible = true;
  5211. var clip = gold.getChildAt(1);
  5212. clip.text = data.RewardsData.rewardnum.toString();
  5213. }
  5214. else {
  5215. var car = showbox.getChildByName("car");
  5216. car.visible = true;
  5217. var skinid = awardtype % 6000;
  5218. var caricon = "";
  5219. if (PlayerAccount.CurAccountData.m_skinDic.containKey(skinid)) {
  5220. caricon = PlayerAccount.CurAccountData.m_skinDic.getValue(skinid).skinicon;
  5221. }
  5222. var sprite = car.getChildAt(0);
  5223. if (caricon)
  5224. sprite.skin = "icon/" + caricon + ".png";
  5225. }
  5226. if (data.itemState == SignItemState.ready) {
  5227. this.cursignitem = data;
  5228. }
  5229. }
  5230. }
  5231. OnClickDouble() {
  5232. if (ADHelper.IsAndroid) {
  5233. ADHelper.showVideoAd((flag) => {
  5234. if (flag) {
  5235. this.OnSign(true);
  5236. }
  5237. });
  5238. }
  5239. else {
  5240. this.OnSign(true);
  5241. }
  5242. }
  5243. OOPO() {
  5244. if (this.videoopen) {
  5245. this.OnClickDouble();
  5246. }
  5247. else {
  5248. this.OnSign();
  5249. }
  5250. }
  5251. OnSign(_double = false) {
  5252. if (!SignWindow.canSgin)
  5253. return;
  5254. var curgold = Number(PlayerAccount.CurAccountData.GetUser(AccountUser.money));
  5255. var curvideo = _double ? "0" : "0";
  5256. let param = [{ "video": curvideo }];
  5257. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Sign, param, Laya.Handler.create(this, (e) => {
  5258. var reward = new rewarddata(this.cursignitem.RewardsData.rewardid);
  5259. reward.type = reward.rewarditem > 1000 ? 1 : 0;
  5260. if (reward.type == 0) {
  5261. this.GetAward(_double, Number(this.cursignitem.rewardsNum), () => {
  5262. this.OnCloseClick();
  5263. });
  5264. return;
  5265. }
  5266. else {
  5267. var skinid = reward.rewarditem % 6000;
  5268. var skin = PlayerAccount.CurAccountData.m_skinDic.getValue(skinid);
  5269. if (skin) {
  5270. reward.rewardicon = skin.skinicon;
  5271. reward.rewardname = this.cursignitem.desc;
  5272. reward.rewardnum = this.cursignitem.RewardsData.rewardnum;
  5273. reward.rewarditem = this.cursignitem.RewardsData.rewardid;
  5274. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
  5275. }
  5276. }
  5277. this.curSignItems = this.SignItemsData;
  5278. SignWindow.Instance.ReFreshSginList();
  5279. }), Laya.Handler.create(this, this.OnSignError), true);
  5280. }
  5281. OnSignError(e) {
  5282. console.log(e);
  5283. }
  5284. OnHide() {
  5285. }
  5286. GetAward(double, _money, _complete) {
  5287. var moneycount = _money;
  5288. var showmoney = _money;
  5289. if (double) {
  5290. moneycount = _money * 2;
  5291. showmoney = _money * 3;
  5292. }
  5293. let param = [{ "reward_item": "1000" }, { "reward_num": moneycount.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
  5294. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
  5295. GameUtils.GetMoney(showmoney, null, Laya.Handler.create(this, () => {
  5296. _complete();
  5297. }));
  5298. }), Laya.Handler.create(this, this.OnSignError), true);
  5299. }
  5300. }
  5301. class drawitem {
  5302. constructor(_id, _icon) {
  5303. this.rewardid = _id;
  5304. this.rewardicon = _icon;
  5305. }
  5306. }
  5307. var rewardtype;
  5308. (function (rewardtype) {
  5309. rewardtype[rewardtype["role"] = 0] = "role";
  5310. rewardtype[rewardtype["weapon"] = 1] = "weapon";
  5311. rewardtype[rewardtype["money"] = 2] = "money";
  5312. rewardtype[rewardtype["egg"] = 3] = "egg";
  5313. })(rewardtype || (rewardtype = {}));
  5314. class CheatWindow extends ui.Window.CheatWindowUI {
  5315. constructor() {
  5316. super();
  5317. this.curooo = false;
  5318. this.currewarddic = new Dictionary();
  5319. this.clickcomplete = false;
  5320. CheatWindow.instance = this;
  5321. CheatWindow.instance.InitSize();
  5322. }
  5323. static get Instance() {
  5324. return CheatWindow.instance;
  5325. }
  5326. InitSize() {
  5327. this.height = Laya.stage.height;
  5328. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  5329. this.pan.y = Laya.stage.height / 1280 * this.pan.y;
  5330. this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
  5331. }
  5332. OnOpen(_ooo = true) {
  5333. this.RegButton();
  5334. this.curooo = _ooo;
  5335. this.tippan.visible = _ooo;
  5336. if (!_ooo)
  5337. this.ani1.play(null, false);
  5338. this.bg.visible = _ooo;
  5339. this.currewarddic = new Dictionary();
  5340. var rewards = PlayerAccount.CurAccountData.GetConfig(AccountConfig.lottery);
  5341. for (var key in rewards) {
  5342. var curconfig = rewards[key];
  5343. var id = Number(key);
  5344. var data = new drawitem(id, curconfig.icon);
  5345. data.name = curconfig.name;
  5346. data.reward_item = curconfig.reward_item;
  5347. data.reward_num = curconfig.reward_num;
  5348. data.weight = curconfig.weight;
  5349. this.currewarddic.add(id + 1, data);
  5350. }
  5351. InputManager.caninput = false;
  5352. this.clickcomplete = false;
  5353. }
  5354. RegButton() {
  5355. this.clickbtn.clickHandler = Laya.Handler.create(this, this.OnClickChect, null, false);
  5356. this.passbtn.clickHandler = Laya.Handler.create(this, this.OnPass, null, false);
  5357. }
  5358. OnClickChect() {
  5359. if (this.clickcomplete)
  5360. return;
  5361. if (Laya.Browser.onPC) {
  5362. this.OnGetGift();
  5363. }
  5364. else {
  5365. ADHelper.showVideoAd((flag) => {
  5366. if (flag) {
  5367. this.OnGetGift();
  5368. }
  5369. });
  5370. }
  5371. }
  5372. OnHide() {
  5373. InputManager.caninput = true;
  5374. }
  5375. OnPass() {
  5376. this.OnEnd();
  5377. }
  5378. OnGetGift() {
  5379. var agrs = [{ "t": PlayerAccount.CurrentAccount.ServerTime.toString() }, { "channel": "video" }];
  5380. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Lottery, agrs, Laya.Handler.create(this, (data) => {
  5381. this.clickcomplete = true;
  5382. var lottery_id = Number(data.lottery_id);
  5383. var curdata = this.currewarddic.getValue(lottery_id);
  5384. var reward = new rewarddata(curdata.reward_item);
  5385. if (reward.rewarditem == 1000 || reward.rewarditem == 2000) {
  5386. GameUtils.GetMoney(curdata.reward_num, null, Laya.Handler.create(this, () => {
  5387. this.OnEnd();
  5388. }));
  5389. }
  5390. else {
  5391. reward.type = reward.rewarditem == 6000 ? rewardtype.role : rewardtype.weapon;
  5392. reward.rewardicon = curdata.rewardicon;
  5393. reward.rewardname = curdata.name;
  5394. reward.rewardnum = curdata.reward_num;
  5395. reward.rewarditem = curdata.reward_item;
  5396. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
  5397. RewardWindow.Instance.closeback = () => {
  5398. this.OnEnd();
  5399. };
  5400. }
  5401. }), Laya.Handler.create(this, () => {
  5402. TtSdk.showToast("领取失败");
  5403. }));
  5404. }
  5405. OnEnd() {
  5406. if (this.curooo == false) {
  5407. WindowManager.Instance.ClosePopView(WindowType.CheatWindow);
  5408. }
  5409. else {
  5410. GameManager.Instance.RessetGame();
  5411. }
  5412. }
  5413. }
  5414. class ShareVideoWindow extends ui.Window.ShareVideoWindowUI {
  5415. constructor() {
  5416. super();
  5417. this.first = false;
  5418. ShareVideoWindow.instance = this;
  5419. }
  5420. static get Instance() {
  5421. return ShareVideoWindow.instance;
  5422. }
  5423. OnOpen(_data = null) {
  5424. this.ani1.play(0, false);
  5425. this.first = false;
  5426. var firstsharemes = Laya.LocalStorage.getItem("firstshare");
  5427. if (!firstsharemes) {
  5428. this.first = true;
  5429. this.firstreward = this.GetReward;
  5430. this.icon.skin = "icon/" + this.firstreward.rewardicon + ".png";
  5431. }
  5432. this.firstshare.visible = this.first;
  5433. this.sharetip.visible = !this.first;
  5434. this.sharemoney.visible = !this.first;
  5435. this.sharebtn.clickHandler = Laya.Handler.create(this, this.OnShareVideo, null, false);
  5436. this.closebtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
  5437. this.height = Laya.stage.height;
  5438. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  5439. }
  5440. OnHide() {
  5441. }
  5442. OnClickClose() {
  5443. WindowManager.Instance.ClosePopView(WindowType.ShareVideoWindow);
  5444. }
  5445. OnShareVideo() {
  5446. if (ADHelper.IsAndroid) {
  5447. TtSdk.Instance.ShareVideo((flag) => {
  5448. if (flag) {
  5449. this.GetVideoReward();
  5450. }
  5451. });
  5452. }
  5453. else {
  5454. this.GetVideoReward();
  5455. }
  5456. }
  5457. GetVideoReward() {
  5458. if (this.first) {
  5459. this.GetSkinReward();
  5460. }
  5461. else {
  5462. this.RewardShareGold();
  5463. }
  5464. }
  5465. RewardShareGold() {
  5466. let param = [{ "reward_item": "1000" }, { "reward_num": "100" }, { "t": PlayerAccount.ServerTime.toString() }];
  5467. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
  5468. GameUtils.GetMoney(100);
  5469. this.OnClickClose();
  5470. }), Laya.Handler.create(this, this.OnSignError), true);
  5471. }
  5472. OnSignError(e) {
  5473. console.log(e);
  5474. }
  5475. GetSkinReward() {
  5476. var reward_item = this.firstreward.rewarditem;
  5477. let param = [{ "reward_item": reward_item.toString() }, { "reward_num": this.firstreward.rewardnum.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
  5478. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
  5479. Laya.LocalStorage.setItem("firstshare", "1");
  5480. if (this.firstreward.type == rewardtype.money) {
  5481. GameUtils.GetMoney(this.firstreward.rewardnum, null, Laya.Handler.create(this, () => {
  5482. this.OnClickClose();
  5483. }));
  5484. }
  5485. else {
  5486. this.OnClickClose();
  5487. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, this.firstreward);
  5488. }
  5489. }), Laya.Handler.create(this, this.OnSignError), true);
  5490. }
  5491. get GetReward() {
  5492. var getskin = false;
  5493. var rewardskin;
  5494. var videoskins = [];
  5495. var skins = PlayerAccount.CurAccountData.m_skinDic;
  5496. for (var i = 0; i < skins.values.length; i++) {
  5497. var skin = skins.values[i];
  5498. if (skin.curskinstate == skinstate.lock && skin.require_type != 6) {
  5499. videoskins.push(skin);
  5500. }
  5501. }
  5502. if (videoskins.length > 0) {
  5503. getskin = true;
  5504. var random = GameUtils.getRandomInt(0, videoskins.length - 1);
  5505. rewardskin = videoskins[random];
  5506. }
  5507. else {
  5508. return null;
  5509. }
  5510. if (getskin) {
  5511. var skinreward = new rewarddata(6000 + rewardskin.skinid);
  5512. skinreward.rewardicon = rewardskin.skinicon;
  5513. skinreward.rewardname = rewardskin.skinname;
  5514. skinreward.rewardnum = 1;
  5515. skinreward.type = rewardtype.role;
  5516. return skinreward;
  5517. }
  5518. else {
  5519. var goldreward = new rewarddata(1000);
  5520. goldreward.rewardicon = "jb";
  5521. goldreward.rewardname = "金币";
  5522. goldreward.rewardnum = 100;
  5523. goldreward.type = rewardtype.money;
  5524. return goldreward;
  5525. }
  5526. }
  5527. }
  5528. class BaoXiangWindow extends ui.Window.BaoXiangWindowUI {
  5529. constructor() {
  5530. super();
  5531. this.firstbx = false;
  5532. BaoXiangWindow.instance = this;
  5533. BaoXiangWindow.instance.InitSize();
  5534. }
  5535. static get Instance() {
  5536. return BaoXiangWindow.instance;
  5537. }
  5538. InitSize() {
  5539. this.height = Laya.stage.height;
  5540. this.pan.y = Laya.stage.height / 1280 * this.pan.y;
  5541. this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
  5542. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  5543. }
  5544. OnOpen(_data = null) {
  5545. this.visible = false;
  5546. Laya.timer.once(500, this, () => {
  5547. this.visible = true;
  5548. });
  5549. this.RegButton();
  5550. var sfsf = Laya.LocalStorage.getItem("firstbx");
  5551. this.firstbg.visible = false;
  5552. if (!sfsf) {
  5553. this.firstbx = true;
  5554. this.firstbg.visible = true;
  5555. }
  5556. this.curreward = this.GetReward;
  5557. InputManager.Instance.OnTouchOut();
  5558. InputManager.caninput = false;
  5559. if (!this.curreward) {
  5560. this.OnClickClose();
  5561. return;
  5562. }
  5563. if (this.curreward.type != rewardtype.egg) {
  5564. this.icon.skin = "icon/" + this.curreward.rewardicon + ".png";
  5565. this.gettex.text = "开启宝箱";
  5566. }
  5567. else {
  5568. this.icon.skin = "game/egg.png";
  5569. this.gettex.text = "开启彩蛋";
  5570. }
  5571. var desc = this.curreward.type == rewardtype.money ? "金币+" + this.curreward.rewardnum : this.curreward.rewardname;
  5572. this.skindesc.text = desc;
  5573. TtSdk.Showbanner();
  5574. }
  5575. RegButton() {
  5576. this.getbtn.clickHandler = Laya.Handler.create(this, this.GetSkinReward, null, false);
  5577. this.passbtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
  5578. }
  5579. OnHide() {
  5580. InputManager.caninput = true;
  5581. }
  5582. get GetReward() {
  5583. var getskin = false;
  5584. var rewardskin;
  5585. var videoskins = [];
  5586. var skins = PlayerAccount.CurAccountData.m_skinDic;
  5587. for (var i = 0; i < skins.values.length; i++) {
  5588. var skin = skins.values[i];
  5589. if (skin.curskinstate == skinstate.lock) {
  5590. videoskins.push(skin);
  5591. }
  5592. }
  5593. if (videoskins.length > 0) {
  5594. getskin = true;
  5595. var random = GameUtils.getRandomInt(0, videoskins.length - 1);
  5596. rewardskin = videoskins[random];
  5597. }
  5598. else {
  5599. return null;
  5600. }
  5601. if (!this.firstbx && Math.random() > 0.35 && TaskManager.GetEgg) {
  5602. var getegg = TaskManager.GetEgg(true);
  5603. var skinreward = new rewarddata(getegg.id);
  5604. skinreward.rewardnum = 1;
  5605. skinreward.type = rewardtype.egg;
  5606. skinreward.rewardname = "神秘彩蛋";
  5607. return skinreward;
  5608. }
  5609. else {
  5610. if (getskin && ((Math.random() > 0.4) || this.firstbx)) {
  5611. var skinreward = new rewarddata(6000 + rewardskin.skinid);
  5612. skinreward.rewardicon = rewardskin.skinicon;
  5613. skinreward.rewardname = rewardskin.skinname;
  5614. skinreward.rewardnum = 1;
  5615. skinreward.type = rewardtype.role;
  5616. return skinreward;
  5617. }
  5618. else {
  5619. var goldreward = new rewarddata(1000);
  5620. goldreward.rewardicon = "jb";
  5621. goldreward.rewardname = "金币";
  5622. goldreward.rewardnum = 100;
  5623. goldreward.type = rewardtype.money;
  5624. return goldreward;
  5625. }
  5626. }
  5627. }
  5628. GetSkinReward() {
  5629. if (this.curreward.type == rewardtype.egg) {
  5630. this.VideoGetEgg();
  5631. }
  5632. else {
  5633. this.VideoGetSkin();
  5634. }
  5635. }
  5636. VideoGetEgg() {
  5637. if (Laya.Browser.onPC) {
  5638. this.OnClickClose();
  5639. var task = TaskManager.taskdic.getValue(this.curreward.rewarditem);
  5640. WindowManager.Instance.OpenPopView(WindowType.TaskContentView, [task, false, false]);
  5641. }
  5642. else {
  5643. ADHelper.showVideoAd((flag) => {
  5644. if (flag) {
  5645. this.OnClickClose();
  5646. var task = TaskManager.taskdic.getValue(this.curreward.rewarditem);
  5647. WindowManager.Instance.OpenPopView(WindowType.TaskContentView, [task, false, false]);
  5648. }
  5649. });
  5650. }
  5651. }
  5652. VideoGetSkin() {
  5653. if (Laya.Browser.onPC) {
  5654. var reward_item = this.curreward.rewarditem;
  5655. let param = [{ "reward_item": reward_item.toString() }, { "reward_num": this.curreward.rewardnum.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
  5656. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
  5657. if (this.firstbx)
  5658. Laya.LocalStorage.setItem("firstbx", "1");
  5659. if (this.curreward.type == rewardtype.money) {
  5660. GameUtils.GetMoney(this.curreward.rewardnum, null, Laya.Handler.create(this, () => {
  5661. this.OnClickClose();
  5662. }));
  5663. }
  5664. else {
  5665. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, this.curreward);
  5666. WindowManager.Instance.ClosePopView(WindowType.BaoXiangWindow);
  5667. }
  5668. }), Laya.Handler.create(this, this.OnSignError), true);
  5669. }
  5670. else {
  5671. ADHelper.showVideoAd((flag) => {
  5672. if (flag) {
  5673. var reward_item = this.curreward.rewarditem;
  5674. let param = [{ "reward_item": reward_item.toString() }, { "reward_num": this.curreward.rewardnum.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
  5675. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
  5676. if (this.firstbx)
  5677. Laya.LocalStorage.setItem("firstbx", "1");
  5678. if (this.curreward.type == rewardtype.money) {
  5679. GameUtils.GetMoney(this.curreward.rewardnum, null, Laya.Handler.create(this, () => {
  5680. this.OnClickClose();
  5681. }));
  5682. }
  5683. else {
  5684. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, this.curreward);
  5685. WindowManager.Instance.ClosePopView(WindowType.BaoXiangWindow);
  5686. }
  5687. }), Laya.Handler.create(this, this.OnSignError), true);
  5688. }
  5689. });
  5690. }
  5691. }
  5692. OnSignError(e) {
  5693. console.log(e);
  5694. }
  5695. OnClickClose() {
  5696. WindowManager.Instance.ClosePopView(WindowType.BaoXiangWindow);
  5697. Player.mainpalyer.SetWuDi(2000);
  5698. }
  5699. }
  5700. class TaskWindow extends ui.Window.TaskWindowUI {
  5701. constructor() {
  5702. super();
  5703. this.cddatas = [];
  5704. this.completelevels = [];
  5705. TaskWindow.instance = this;
  5706. }
  5707. static get Instance() {
  5708. return TaskWindow.instance;
  5709. }
  5710. InitSize() {
  5711. this.height = Laya.stage.height;
  5712. this.homebtn.y = Laya.stage.height / 1280 * this.homebtn.y;
  5713. this.listpan.top = Laya.stage.height / 1280 * this.listpan.top;
  5714. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  5715. }
  5716. OnOpen(_data = null) {
  5717. this.InitSize();
  5718. this.RegButton();
  5719. this.RefreshCDList();
  5720. }
  5721. RegButton() {
  5722. this.homebtn.clickHandler = Laya.Handler.create(this, this.OnBackHome, null, false);
  5723. }
  5724. OnHide() {
  5725. }
  5726. OnBackHome() {
  5727. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  5728. }
  5729. static get canshoweffview() {
  5730. var mdatas = [];
  5731. for (var i = 0; i < TaskManager.taskdic.values.length; i++) {
  5732. var mfasa = TaskManager.taskdic.values[i];
  5733. if (mfasa.find == 1) {
  5734. mdatas.push(mfasa);
  5735. }
  5736. }
  5737. return mdatas;
  5738. }
  5739. RefreshCDList() {
  5740. this.cddatas = TaskWindow.canshoweffview;
  5741. this.cdlist.vScrollBarSkin = "";
  5742. this.cdlist.array = this.cddatas;
  5743. this.cdlist.renderHandler = Laya.Handler.create(this, this.OnRender, null, false);
  5744. this.completelevels = this.CheckEggComplete();
  5745. if (this.completelevels.length > 0) {
  5746. this.ShowCompleteTask();
  5747. }
  5748. }
  5749. ShowCompleteTask() {
  5750. var curtask = this.completelevels[0];
  5751. WindowManager.Instance.OpenPopView(WindowType.TaskContentView, [curtask, true, false]);
  5752. this.cddatas = TaskWindow.canshoweffview;
  5753. this.cdlist.array = this.cddatas;
  5754. }
  5755. ReCompleteCheck(_task) {
  5756. var index = this.completelevels.indexOf(_task);
  5757. if (index != -1) {
  5758. this.completelevels.splice(index, 1);
  5759. }
  5760. if (this.completelevels.length > 0) {
  5761. this.ShowCompleteTask();
  5762. }
  5763. }
  5764. CheckEggComplete() {
  5765. var completes = [];
  5766. var curlevel = LevelManager.Instance.curlevel;
  5767. for (var i = 0; i < curlevel.leveltasks.length; i++) {
  5768. var matsk = curlevel.leveltasks[i];
  5769. if (matsk.id == 4 && matsk.state == 1) {
  5770. var getskins = [];
  5771. for (var k = 0; k < PlayerAccount.CurAccountData.m_skinDic.values.length; k++) {
  5772. var mskin = PlayerAccount.CurAccountData.m_skinDic.values[k];
  5773. if (mskin.curskinstate != skinstate.lock && mskin.skintype == skintype.weapon) {
  5774. getskins.push(mskin);
  5775. }
  5776. }
  5777. if (getskins.length >= 8) {
  5778. completes.push(matsk);
  5779. TaskManager.CompleteEgg(matsk);
  5780. }
  5781. }
  5782. else if (matsk.id == 9 && matsk.state == 1) {
  5783. var getskins = [];
  5784. for (var j = 0; j < PlayerAccount.CurAccountData.m_skinDic.values.length; j++) {
  5785. var mskin = PlayerAccount.CurAccountData.m_skinDic.values[j];
  5786. if (mskin.curskinstate != skinstate.lock && mskin.skintype == skintype.role) {
  5787. getskins.push(mskin);
  5788. }
  5789. }
  5790. if (getskins.length >= 4) {
  5791. completes.push(matsk);
  5792. TaskManager.CompleteEgg(matsk);
  5793. }
  5794. }
  5795. }
  5796. return completes;
  5797. }
  5798. OnRender(_cell) {
  5799. var taskdata = _cell.dataSource;
  5800. var bg = _cell.getChildAt(0);
  5801. var egg = bg.getChildAt(0);
  5802. var desc = bg.getChildAt(1);
  5803. desc.visible = false;
  5804. var videobtn = bg.getChildAt(2);
  5805. videobtn.visible = false;
  5806. var readbtn = bg.getChildAt(3);
  5807. readbtn.visible = false;
  5808. var geted = _cell.getChildAt(1);
  5809. geted.visible = false;
  5810. var lockbg = _cell.getChildAt(2);
  5811. lockbg.visible = false;
  5812. if (taskdata.state == taskstate.lock) {
  5813. egg.visible = true;
  5814. lockbg.visible = true;
  5815. videobtn.visible = true;
  5816. videobtn.clickHandler = Laya.Handler.create(this, this.OnClickVideoGet, [taskdata], false);
  5817. }
  5818. else if (taskdata.state == taskstate.open) {
  5819. egg.visible = true;
  5820. lockbg.visible = false;
  5821. readbtn.visible = true;
  5822. readbtn.clickHandler = Laya.Handler.create(this, this.OnReadTask, [taskdata], false);
  5823. }
  5824. else if (taskdata.state == taskstate.complete) {
  5825. desc.visible = true;
  5826. desc.text = "兑换码:" + taskdata.cdk.toString();
  5827. egg.alpha = 0.4;
  5828. }
  5829. else if (taskdata.state == taskstate.geted) {
  5830. desc.visible = true;
  5831. geted.visible = true;
  5832. desc.text = "兑换码:" + taskdata.cdk.toString();
  5833. egg.alpha = 0.4;
  5834. }
  5835. }
  5836. OnReadTask(_data) {
  5837. WindowManager.Instance.OpenPopView(WindowType.TaskContentView, [_data, false, false]);
  5838. }
  5839. OnClickVideoGet(_data) {
  5840. if (_data.state == taskstate.lock) {
  5841. if (Laya.Browser.onPC) {
  5842. _data.state = taskstate.open;
  5843. TaskManager.SetData(_data);
  5844. this.RefreshCDList();
  5845. }
  5846. else {
  5847. ADHelper.showVideoAd((flag) => {
  5848. if (flag) {
  5849. _data.state = taskstate.open;
  5850. TaskManager.SetData(_data);
  5851. this.RefreshCDList();
  5852. }
  5853. });
  5854. }
  5855. }
  5856. }
  5857. }
  5858. class TaskContentView extends ui.Window.TaskContentViewUI {
  5859. constructor() {
  5860. super();
  5861. this.settlement = false;
  5862. TaskContentView.instance = this;
  5863. TaskContentView.instance.InitSize();
  5864. }
  5865. static get Instance() {
  5866. return TaskContentView.instance;
  5867. }
  5868. InitSize() {
  5869. this.height = Laya.stage.height;
  5870. this.mespan.y = Laya.stage.height / 1280 * this.mespan.y;
  5871. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  5872. }
  5873. OnOpen(_data = null) {
  5874. InputManager.caninput = false;
  5875. if (_data == null)
  5876. this.OnClickClose();
  5877. this.RegButton();
  5878. this.taskdata = _data[0];
  5879. this.complete = _data[1];
  5880. this.settlement = _data[2];
  5881. this.tips.visible = this.complete;
  5882. this.cdktex.visible = this.complete;
  5883. if (this.complete) {
  5884. this.cdktex.text = "兑换码:" + this.taskdata.cdk;
  5885. this.ani1.play(null, false);
  5886. }
  5887. TaskManager.OpenEgg(this.taskdata);
  5888. LevelManager.Instance.curlevel.GetTask();
  5889. this.title.text = this.taskdata.title;
  5890. this.content.text = this.taskdata.content;
  5891. }
  5892. RegButton() {
  5893. this.closemesview.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
  5894. }
  5895. OnHide() {
  5896. InputManager.caninput = true;
  5897. }
  5898. OnClickClose() {
  5899. WindowManager.Instance.ClosePopView(WindowType.TaskContentView);
  5900. Player.mainpalyer.SetWuDi(2000);
  5901. if (this.complete) {
  5902. if (this.settlement) {
  5903. GameManager.Instance.ReCompleteCheck(this.taskdata);
  5904. }
  5905. else {
  5906. TaskWindow.Instance.ReCompleteCheck(this.taskdata);
  5907. }
  5908. }
  5909. }
  5910. OnShare() {
  5911. TtSdk.Share();
  5912. }
  5913. }
  5914. class CDKView extends ui.Window.CDKViewUI {
  5915. constructor() {
  5916. super();
  5917. CDKView.instance = this;
  5918. CDKView.instance.InitSize();
  5919. }
  5920. static get Instance() {
  5921. return CDKView.instance;
  5922. }
  5923. InitSize() {
  5924. this.height = Laya.stage.height;
  5925. this.pan.y = Laya.stage.height / 1280 * this.pan.y;
  5926. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  5927. }
  5928. OnOpen(_data = null) {
  5929. this.RegButton();
  5930. this.inputtext.text = "";
  5931. }
  5932. RegButton() {
  5933. this.closebtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
  5934. this.backbtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
  5935. this.getbtn.clickHandler = Laya.Handler.create(this, this.OnGetSkin, null, false);
  5936. }
  5937. OnHide() {
  5938. }
  5939. OnClickClose() {
  5940. WindowManager.Instance.ClosePopView(WindowType.CDKView);
  5941. }
  5942. OnGetSkin() {
  5943. console.log(this.inputtext.text);
  5944. var targetcdk = Number(this.inputtext.text);
  5945. var targetskin;
  5946. var skins = PlayerAccount.CurAccountData.m_skinDic.values;
  5947. for (var i = 0; i < skins.length; i++) {
  5948. var curskin = skins[i];
  5949. if (curskin.cdk == targetcdk) {
  5950. targetskin = curskin;
  5951. break;
  5952. }
  5953. }
  5954. if (targetskin == null) {
  5955. TtSdk.showToast("兑换码错误");
  5956. }
  5957. else {
  5958. if (targetskin.curskinstate != skinstate.lock) {
  5959. TtSdk.showToast("已兑换");
  5960. }
  5961. else {
  5962. this.GetSkinAward(targetskin);
  5963. }
  5964. }
  5965. }
  5966. GetSkinAward(_skin) {
  5967. if (_skin.curskinstate != skinstate.lock) {
  5968. TaskManager.GeEgg(_skin.cdk);
  5969. return;
  5970. }
  5971. var reward_item = _skin.skinid + 6000;
  5972. let param = [{ "reward_item": reward_item.toString() }, { "reward_num": "1" }, { "t": PlayerAccount.ServerTime.toString() }];
  5973. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
  5974. TaskManager.GeEgg(_skin.cdk);
  5975. WindowManager.Instance.ClosePopView(WindowType.CDKView);
  5976. EventManager.Trigger(EventType.UseSkin);
  5977. var reward = new rewarddata(reward_item);
  5978. reward.type = 1;
  5979. reward.rewardicon = _skin.skinicon;
  5980. reward.rewardname = _skin.skinname;
  5981. reward.rewardnum = 1;
  5982. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
  5983. }), Laya.Handler.create(this, this.OnSignError), true);
  5984. }
  5985. OnSignError(e) {
  5986. console.log(e);
  5987. }
  5988. }
  5989. class ChestData {
  5990. constructor() {
  5991. this.cheststate = 0;
  5992. this.canvideoopen = false;
  5993. }
  5994. get chesticon() {
  5995. if (this.chesttype == 1000) {
  5996. return "jb";
  5997. }
  5998. else {
  5999. var skin = PlayerAccount.CurAccountData.m_skinDic.getValue(this.chestid);
  6000. return skin.skinicon;
  6001. }
  6002. }
  6003. }
  6004. class ChestWindow extends ui.Window.ChestWindowUI {
  6005. constructor() {
  6006. super();
  6007. this.chestdatas = [];
  6008. this.keynum = 2;
  6009. this.canhome = false;
  6010. this.video = false;
  6011. this.getkey = false;
  6012. this.gamewin = false;
  6013. ChestWindow.instance = this;
  6014. }
  6015. static get Instance() {
  6016. return ChestWindow.instance;
  6017. }
  6018. InitList() {
  6019. var datas = [];
  6020. for (var i = 0; i < 9; i++) {
  6021. var curchest = new ChestData();
  6022. if (i > 5) {
  6023. curchest.canvideoopen = true;
  6024. }
  6025. datas.push(curchest);
  6026. }
  6027. return datas;
  6028. }
  6029. EnterChest() {
  6030. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.entertreasure, null, new Laya.Handler(null, (_data) => {
  6031. var targetChest = new ChestData();
  6032. targetChest.chesttype = 6000;
  6033. targetChest.chestid = _data.theme_id;
  6034. this.InitChest(targetChest);
  6035. }), new Laya.Handler(this, (_data) => {
  6036. console.log("err" + _data);
  6037. }));
  6038. }
  6039. InitChest(_chestdata) {
  6040. this.targetChest = _chestdata;
  6041. this.chestdatas = this.InitList();
  6042. this.chestlist.array = this.chestdatas;
  6043. this.chestlist.renderHandler = Laya.Handler.create(this, this.OnRender, null, false);
  6044. this.getys.visible = false;
  6045. this.getys.clickHandler = Laya.Handler.create(this, this.OnGetKey, null, false);
  6046. this.homebtn.clickHandler = Laya.Handler.create(this, this.OnBackHome, null, false);
  6047. this.RefreshChestDatas();
  6048. }
  6049. OnOpen(_win = false) {
  6050. this.gamewin = _win;
  6051. this.EnterChest();
  6052. this.chestpan.y = Laya.stage.height / 1280 * this.chestpan.y;
  6053. this.height = Laya.stage.height;
  6054. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  6055. }
  6056. OnHide() {
  6057. }
  6058. OnRender(_cell, _index) {
  6059. var data = _cell.dataSource;
  6060. var chest = _cell.getChildAt(1);
  6061. chest.visible = data.cheststate == 0;
  6062. var videobg = chest.getChildAt(0);
  6063. videobg.visible = data.canvideoopen;
  6064. var skin = _cell.getChildAt(2);
  6065. skin.visible = data.cheststate == 1 && data.chesttype > 1000;
  6066. if (skin.visible) {
  6067. var icon = skin.getChildAt(0);
  6068. icon.skin = "icon/" + data.chesticon + ".png";
  6069. }
  6070. var gold = _cell.getChildAt(3);
  6071. gold.visible = data.cheststate == 1 && data.chesttype == 1000;
  6072. if (gold.visible) {
  6073. var mgold = gold.getChildAt(1);
  6074. mgold.text = data.chestnum.toString();
  6075. }
  6076. var getbtn = _cell.getChildAt(4);
  6077. if (data.cheststate == 0) {
  6078. if (data.canvideoopen) {
  6079. getbtn.clickHandler = Laya.Handler.create(this, this.VideoOpenTreasure, [false, _index], false);
  6080. }
  6081. else {
  6082. getbtn.clickHandler = Laya.Handler.create(this, this.OpenTreasure, [false, true, _index], false);
  6083. }
  6084. }
  6085. else {
  6086. getbtn.clickHandler = null;
  6087. }
  6088. }
  6089. OnBackHome() {
  6090. GameManager.Instance.RessetGame();
  6091. }
  6092. SetChestData(_index, _data) {
  6093. this.chestdatas[_index] = _data;
  6094. this.RefreshChestDatas();
  6095. }
  6096. get getTarget() {
  6097. for (var i = 0; i < this.chestdatas.length; i++) {
  6098. var curdata = this.chestdatas[i];
  6099. if (curdata.chesttype != 1000 && curdata.chestid == this.targetChest.chestid) {
  6100. return true;
  6101. }
  6102. }
  6103. return false;
  6104. }
  6105. RefreshChestDatas() {
  6106. this.chestlist.array = this.chestdatas;
  6107. this.chestlist.renderHandler = Laya.Handler.create(this, this.OnRender, null, false);
  6108. this.key1.visible = this.keynum > 0;
  6109. this.key2.visible = this.keynum > 1;
  6110. this.key3.visible = this.keynum > 2;
  6111. this.opspr.visible = this.keynum > 0;
  6112. var allopen = true;
  6113. for (var i = 0; i < this.chestdatas.length; i++) {
  6114. if (this.chestdatas[i].cheststate == 0) {
  6115. allopen = false;
  6116. break;
  6117. }
  6118. }
  6119. if (this.canhome == false && this.keynum == 0 || allopen) {
  6120. this.canhome = true;
  6121. }
  6122. this.homebtn.visible = this.canhome;
  6123. this.getys.visible = this.keynum == 0 && !allopen;
  6124. if (this.getys.visible)
  6125. this.getys.clickHandler = Laya.Handler.create(this, this.OnGetKey, null, false);
  6126. }
  6127. OnGetKey() {
  6128. this.getkey = true;
  6129. if (Laya.Browser.onPC) {
  6130. this.keynum = 3;
  6131. this.video = true;
  6132. this.RefreshChestDatas();
  6133. }
  6134. else {
  6135. ADHelper.showVideoAd((flag) => {
  6136. if (flag) {
  6137. this.keynum = 3;
  6138. this.video = true;
  6139. this.RefreshChestDatas();
  6140. }
  6141. });
  6142. }
  6143. }
  6144. VideoOpenTreasure(_usekey, _index) {
  6145. if (Laya.Browser.onPC) {
  6146. this.OpenTreasure(true, _usekey, _index);
  6147. }
  6148. else {
  6149. ADHelper.showVideoAd((flag) => {
  6150. if (flag) {
  6151. this.OpenTreasure(true, _usekey, _index);
  6152. }
  6153. });
  6154. }
  6155. }
  6156. OpenTreasure(_video, _usekey, _index) {
  6157. if (_usekey && this.keynum <= 0) {
  6158. TtSdk.showToast("钥匙用完啦!");
  6159. return;
  6160. }
  6161. if (!_video && _usekey && PlayerAccount.CurAccountData.videonum) {
  6162. this.VideoOpenTreasure(true, _index);
  6163. return;
  6164. }
  6165. var channel = _video && !this.video ? "key:treasure_open" : "video:treasure_open";
  6166. var arges = [{ "t": PlayerAccount.CurrentAccount.ServerTime.toString() }, { "channel": channel }];
  6167. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.opentreasure, arges, new Laya.Handler(null, (_data) => {
  6168. if (_usekey)
  6169. this.keynum -= 1;
  6170. var rewarditem = new ChestData();
  6171. rewarditem.cheststate = 1;
  6172. for (var key in _data.rewards) {
  6173. var item = Number(key);
  6174. if (item == 1000) {
  6175. rewarditem.chesttype = 1000;
  6176. rewarditem.chestnum = Number(_data.rewards[key]);
  6177. }
  6178. else {
  6179. rewarditem.chesttype = 6000;
  6180. rewarditem.chestid = item % 6000;
  6181. }
  6182. }
  6183. this.SetChestData(_index, rewarditem);
  6184. if (item > 1000) {
  6185. var reward = new rewarddata(rewarditem.chestid);
  6186. reward.type = rewardtype.role;
  6187. var skin = PlayerAccount.CurAccountData.m_skinDic.getValue(rewarditem.chestid);
  6188. reward.rewardicon = skin.skinicon;
  6189. reward.rewardname = skin.skinname;
  6190. reward.rewardnum = 1;
  6191. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
  6192. }
  6193. this.RefreshChestDatas();
  6194. }), new Laya.Handler(this, (_data) => {
  6195. console.log("err" + _data);
  6196. }));
  6197. }
  6198. }
  6199. class TaoZhuangWindow extends ui.Window.TaoZhuangWindowUI {
  6200. constructor() {
  6201. super();
  6202. this.tzpre = 0;
  6203. TaoZhuangWindow.instance = this;
  6204. }
  6205. static get Instance() {
  6206. return TaoZhuangWindow.instance;
  6207. }
  6208. InitSize() {
  6209. this.height = Laya.stage.height;
  6210. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  6211. this.pan.y = Laya.stage.height / 1280 * this.pan.y;
  6212. }
  6213. OnOpen(_data = null) {
  6214. this.InitSize();
  6215. this.RegButton();
  6216. this.GetAwardDatas();
  6217. this.ShowPre();
  6218. }
  6219. RegButton() {
  6220. this.getbtn.clickHandler = Laya.Handler.create(this, this.OnGetSkins, null, false);
  6221. this.backbtn.clickHandler = Laya.Handler.create(this, this.OnBack, null, false);
  6222. }
  6223. OnHide() {
  6224. }
  6225. GetAwardDatas() {
  6226. var roleskin = PlayerAccount.CurAccountData.m_skinDic.getValue(22);
  6227. var weaponskin = PlayerAccount.CurAccountData.m_skinDic.getValue(17);
  6228. var rolecan = roleskin && roleskin.curskinstate == skinstate.lock;
  6229. var weaponcan = weaponskin && weaponskin.curskinstate == skinstate.lock;
  6230. if (rolecan) {
  6231. var roleaward = new rewarddata(roleskin.skinid + 6000);
  6232. roleaward.rewardicon = roleskin.skinicon;
  6233. roleaward.rewardname = roleskin.skinname;
  6234. roleaward.type = rewardtype.role;
  6235. roleaward.rewardnum = 1;
  6236. this.roleaward = roleaward;
  6237. }
  6238. if (weaponcan) {
  6239. var weaponaward = new rewarddata(weaponskin.skinid + 6000);
  6240. weaponaward.rewardicon = weaponskin.skinicon;
  6241. weaponaward.rewardname = weaponskin.skinname;
  6242. weaponaward.type = rewardtype.weapon;
  6243. weaponaward.rewardnum = 1;
  6244. this.weaponaward = weaponaward;
  6245. }
  6246. }
  6247. static canshow() {
  6248. var roleskin = PlayerAccount.CurAccountData.m_skinDic.getValue(22);
  6249. var weaponskin = PlayerAccount.CurAccountData.m_skinDic.getValue(17);
  6250. var rolecan = roleskin && roleskin.curskinstate == skinstate.lock;
  6251. var weaponcan = weaponskin && weaponskin.curskinstate == skinstate.lock;
  6252. if (rolecan || weaponcan) {
  6253. return true;
  6254. }
  6255. else {
  6256. return false;
  6257. }
  6258. }
  6259. ShowPre() {
  6260. var curpre = TaoZhuangWindow.GetPre();
  6261. var pre1p = this.pre1.getChildAt(0);
  6262. pre1p.visible = curpre > 0;
  6263. var pre2p = this.pre2.getChildAt(0);
  6264. pre2p.visible = curpre > 1;
  6265. var pre3p = this.pre3.getChildAt(0);
  6266. pre3p.visible = curpre > 2;
  6267. if (curpre >= 3) {
  6268. this.getbtn.mouseEnabled = false;
  6269. this.GetRole();
  6270. }
  6271. }
  6272. OnGetSkins() {
  6273. if (ADHelper.IsAndroid) {
  6274. ADHelper.showVideoAd((flag) => {
  6275. if (flag) {
  6276. this.SetPre(1);
  6277. this.ShowPre();
  6278. }
  6279. });
  6280. }
  6281. else {
  6282. this.SetPre(1);
  6283. this.ShowPre();
  6284. }
  6285. }
  6286. SetPre(_num) {
  6287. var tzpre = Laya.LocalStorage.getItem("tzpre");
  6288. var mtz = 0;
  6289. if (tzpre) {
  6290. mtz = Number(tzpre) + _num;
  6291. Laya.LocalStorage.setItem("tzpre", mtz.toString());
  6292. }
  6293. else {
  6294. mtz = _num;
  6295. Laya.LocalStorage.setItem("tzpre", _num.toString());
  6296. }
  6297. return mtz;
  6298. }
  6299. static GetPre() {
  6300. var tzpre = Laya.LocalStorage.getItem("tzpre");
  6301. if (tzpre) {
  6302. return Number(tzpre);
  6303. }
  6304. else {
  6305. return 0;
  6306. }
  6307. }
  6308. GetRole() {
  6309. var roleskin = PlayerAccount.CurAccountData.m_skinDic.getValue(22);
  6310. var rolecan = roleskin && roleskin.curskinstate == skinstate.lock;
  6311. if (rolecan) {
  6312. this.GetAward(this.roleaward, () => {
  6313. this.GetWeapon();
  6314. });
  6315. }
  6316. else {
  6317. this.GetWeapon();
  6318. }
  6319. }
  6320. GetWeapon() {
  6321. var weaponskin = PlayerAccount.CurAccountData.m_skinDic.getValue(17);
  6322. var weaponcan = weaponskin && weaponskin.curskinstate == skinstate.lock;
  6323. if (weaponcan) {
  6324. this.GetAward(this.weaponaward, () => {
  6325. this.OnBack();
  6326. });
  6327. }
  6328. else {
  6329. this.OnBack();
  6330. }
  6331. }
  6332. GetAward(_reward, cb) {
  6333. var reward_item = _reward.rewarditem;
  6334. let param = [{ "reward_item": reward_item.toString() }, { "reward_num": _reward.rewardnum.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
  6335. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
  6336. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, _reward);
  6337. RewardWindow.Instance.closeback = () => {
  6338. cb();
  6339. };
  6340. }), Laya.Handler.create(this, this.OnSignError), true);
  6341. }
  6342. OnSignError(e) {
  6343. console.log(e);
  6344. }
  6345. OnBack() {
  6346. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  6347. }
  6348. }
  6349. var WindowType;
  6350. (function (WindowType) {
  6351. WindowType[WindowType["HomeWindow"] = 0] = "HomeWindow";
  6352. WindowType[WindowType["InGameWindow"] = 1] = "InGameWindow";
  6353. WindowType[WindowType["ChestWindow"] = 2] = "ChestWindow";
  6354. WindowType[WindowType["TaoZhuangWindow"] = 3] = "TaoZhuangWindow";
  6355. WindowType[WindowType["BaoXiangWindow"] = 4] = "BaoXiangWindow";
  6356. WindowType[WindowType["CDKView"] = 5] = "CDKView";
  6357. WindowType[WindowType["TaskContentView"] = 6] = "TaskContentView";
  6358. WindowType[WindowType["TaskWindow"] = 7] = "TaskWindow";
  6359. WindowType[WindowType["CheatWindow"] = 8] = "CheatWindow";
  6360. WindowType[WindowType["SettlementWindow"] = 9] = "SettlementWindow";
  6361. WindowType[WindowType["SkinWindow"] = 10] = "SkinWindow";
  6362. WindowType[WindowType["ResurrectionWindow"] = 11] = "ResurrectionWindow";
  6363. WindowType[WindowType["PlaneGiftWindow"] = 12] = "PlaneGiftWindow";
  6364. WindowType[WindowType["SignWindow"] = 13] = "SignWindow";
  6365. WindowType[WindowType["LotteryWindow"] = 14] = "LotteryWindow";
  6366. WindowType[WindowType["TryOutWindow"] = 15] = "TryOutWindow";
  6367. WindowType[WindowType["RewardWindow"] = 16] = "RewardWindow";
  6368. WindowType[WindowType["ShareVideoWindow"] = 17] = "ShareVideoWindow";
  6369. })(WindowType || (WindowType = {}));
  6370. class WindowManager {
  6371. constructor() {
  6372. this.ViewDic = [];
  6373. this.popViewDic = [];
  6374. this.viewCont = new Laya.Sprite;
  6375. this.popCont = new Laya.Sprite;
  6376. WindowManager.WindowManagerInstance = this;
  6377. this.Init();
  6378. }
  6379. static get Instance() {
  6380. if (WindowManager.WindowManagerInstance) {
  6381. return WindowManager.WindowManagerInstance;
  6382. }
  6383. else {
  6384. return new WindowManager();
  6385. }
  6386. }
  6387. Init() {
  6388. this.ViewDic[WindowType.HomeWindow] = HomeWindow;
  6389. this.ViewDic[WindowType.InGameWindow] = InGameWindow;
  6390. this.ViewDic[WindowType.SettlementWindow] = SettlementWindow;
  6391. this.ViewDic[WindowType.ResurrectionWindow] = ReviveWindow;
  6392. this.ViewDic[WindowType.SkinWindow] = SkinWindow;
  6393. this.ViewDic[WindowType.RewardWindow] = RewardWindow;
  6394. this.ViewDic[WindowType.TryOutWindow] = TryoutWindow;
  6395. this.ViewDic[WindowType.SignWindow] = SignWindow;
  6396. this.ViewDic[WindowType.ShareVideoWindow] = ShareVideoWindow;
  6397. this.ViewDic[WindowType.CheatWindow] = CheatWindow;
  6398. this.ViewDic[WindowType.BaoXiangWindow] = BaoXiangWindow;
  6399. this.ViewDic[WindowType.TaskWindow] = TaskWindow;
  6400. this.ViewDic[WindowType.TaskContentView] = TaskContentView;
  6401. this.ViewDic[WindowType.CDKView] = CDKView;
  6402. this.ViewDic[WindowType.ChestWindow] = ChestWindow;
  6403. this.ViewDic[WindowType.TaoZhuangWindow] = TaoZhuangWindow;
  6404. Laya.stage.addChild(this.viewCont);
  6405. Laya.stage.addChild(this.popCont);
  6406. }
  6407. ShowWindow(_type, _data = null) {
  6408. if (this.curOpenedView != null) {
  6409. this.curOpenedView.OnHide();
  6410. this.curOpenedView.destroy();
  6411. this.curOpenedView.removeSelf();
  6412. }
  6413. TtSdk.Clear();
  6414. this.ClearPopViews();
  6415. console.log(WindowType[_type]);
  6416. this.curOpenedView = new this.ViewDic[_type];
  6417. this.curOpenedView.name = WindowType[_type];
  6418. this.viewCont.addChild(this.curOpenedView);
  6419. this.curOpenedView.OnOpen(_data);
  6420. }
  6421. OpenPopView(viewType, data = null) {
  6422. var popView;
  6423. if (this.popViewDic[viewType]) {
  6424. popView = this.popViewDic[viewType];
  6425. if (popView.visible)
  6426. return;
  6427. this.popCont.setChildIndex(popView, this.popCont.numChildren - 1);
  6428. popView.visible = true;
  6429. }
  6430. else {
  6431. popView = new this.ViewDic[viewType];
  6432. this.popCont.addChild(popView);
  6433. this.popViewDic[viewType] = popView;
  6434. }
  6435. TtSdk.Clear();
  6436. popView.OnOpen(data);
  6437. }
  6438. ClosePopView(viewType) {
  6439. var popView = this.popViewDic[viewType];
  6440. if (popView == null || !popView.visible)
  6441. return;
  6442. popView.OnHide();
  6443. TtSdk.Clear();
  6444. popView.visible = false;
  6445. }
  6446. CloseCurrentWindow() {
  6447. this.curOpenedView.OnHide();
  6448. this.curOpenedView.destroy();
  6449. this.curOpenedView.removeSelf();
  6450. }
  6451. ClearPopViews() {
  6452. this.ClosePopView(WindowType.PlaneGiftWindow);
  6453. this.ClosePopView(WindowType.ShareVideoWindow);
  6454. }
  6455. }
  6456. var Vector3$f = Laya.Vector3;
  6457. class Barrier extends Building {
  6458. constructor() {
  6459. super(...arguments);
  6460. this.cut = false;
  6461. }
  6462. OnInit() {
  6463. if (this.mdata.buildid != 7) {
  6464. this.mcollider = this.cursprite.getChildAt(2).getComponent(Laya.PhysicsCollider);
  6465. this.mcollider.collisionGroup = ColliderLay.obstacle;
  6466. this.mcollider.enabled = true;
  6467. this.downsprite = this.cursprite.getChildAt(0);
  6468. this.upsprite = this.cursprite.getChildAt(1);
  6469. }
  6470. else {
  6471. this.mcollider = this.cursprite.getChildAt(1).getComponent(Laya.PhysicsCollider);
  6472. this.mcollider.collisionGroup = ColliderLay.obstacle;
  6473. this.mcollider1 = this.cursprite.getChildAt(2).getComponent(Laya.PhysicsCollider);
  6474. this.mcollider1.collisionGroup = ColliderLay.obstacle;
  6475. this.mcollider1.enabled = true;
  6476. this.downsprite = this.cursprite.getChildAt(1);
  6477. this.downsprite1 = this.cursprite.getChildAt(2);
  6478. this.upsprite = this.cursprite.getChildAt(0);
  6479. this.mcollider.enabled = true;
  6480. }
  6481. if (this.mdata.buildid == 6) {
  6482. this.mcollider.collisionGroup = ColliderLay.grass;
  6483. }
  6484. for (var i = 0; i < this.cursprite.numChildren; i++) {
  6485. var curspr = this.cursprite.getChildAt(i);
  6486. curspr.active = true;
  6487. }
  6488. this.OnReg();
  6489. }
  6490. OnReg() {
  6491. EventManager.On(EventType.Cut, this, this.OnCut);
  6492. }
  6493. OnClear() {
  6494. EventManager.Off(EventType.Cut, this, this.OnCut);
  6495. if (this.uprig)
  6496. this.uprig.Clear();
  6497. if (this.downrig)
  6498. this.downrig.Clear();
  6499. if (this.copysprite) {
  6500. for (var i = 0; i < this.copysprite.numChildren; i++) {
  6501. var curspr = this.copysprite.getChildAt(i);
  6502. curspr.active = true;
  6503. }
  6504. PoolManager.RecoverSprite3D(this.copysprite, true);
  6505. }
  6506. if (this.cuteffect)
  6507. PoolManager.RecoverSprite3D(this.cuteffect);
  6508. }
  6509. OnCut(_collider) {
  6510. if (this.cut)
  6511. return;
  6512. if (this.mcollider == _collider || (this.mcollider1 && this.mcollider1 == _collider)) {
  6513. this.BeCut(_collider);
  6514. }
  6515. }
  6516. BeCut(_collider) {
  6517. if (this.cut)
  6518. return;
  6519. this.cut = true;
  6520. this.die = true;
  6521. this.mcollider.enabled = false;
  6522. TtSdk.Shake();
  6523. if (this.mdata.buildid == 4) {
  6524. var boomrange = 5;
  6525. var boomcount = 0;
  6526. for (var i = 0; i < LevelManager.Instance.curlevel.gameroles.length; i++) {
  6527. var currole = LevelManager.Instance.curlevel.gameroles[i];
  6528. if (currole == Player.mainpalyer)
  6529. continue;
  6530. var dis = Vector3$f.distance(this.cursprite.transform.position, currole.cursprite.transform.position);
  6531. if (dis < boomrange) {
  6532. currole.BeBoom();
  6533. boomcount++;
  6534. }
  6535. if (boomcount > 2) {
  6536. LevelManager.Instance.curlevel.allboomree = true;
  6537. }
  6538. }
  6539. for (var i = 0; i < LevelManager.Instance.curlevel.builds.length; i++) {
  6540. var curbuild = LevelManager.Instance.curlevel.builds[i];
  6541. if (curbuild == this)
  6542. continue;
  6543. var dis = Vector3$f.distance(this.cursprite.transform.position, curbuild.cursprite.transform.position);
  6544. if (dis < boomrange) {
  6545. if (curbuild.mdata.type == 0) {
  6546. var curbarr = curbuild;
  6547. if (!curbarr.cut)
  6548. curbarr.BeCut(null);
  6549. }
  6550. else if (curbuild.mdata.type == 1) {
  6551. var curstand = curbuild;
  6552. curstand.BeCut();
  6553. }
  6554. }
  6555. }
  6556. }
  6557. var cuteffid = 4;
  6558. if (this.mdata.buildid == 4) {
  6559. cuteffid = 2;
  6560. AudioControl.PlayVoice(VoiceType.boom);
  6561. }
  6562. else if (this.mdata.buildid == 2) {
  6563. cuteffid = 5;
  6564. AudioControl.PlayVoice(VoiceType.cut);
  6565. }
  6566. else if (this.mdata.buildid == 6) {
  6567. AudioControl.PlayVoice(VoiceType.cutgrass);
  6568. }
  6569. else {
  6570. AudioControl.PlayVoice(VoiceType.cut);
  6571. }
  6572. if (this.mdata.buildid == 8) {
  6573. WindowManager.Instance.OpenPopView(WindowType.BaoXiangWindow);
  6574. }
  6575. var cutasset = AssetManager.effect.getValue(cuteffid);
  6576. this.cuteffect = PoolManager.GetSprite3D(cutasset);
  6577. SceneManager.mainscene.addChild(this.cuteffect);
  6578. if (this.mdata.buildid != 2) {
  6579. this.cuteffect.transform.position = this.upsprite.transform.position.clone();
  6580. }
  6581. else {
  6582. this.cuteffect.transform.position = this.cursprite.transform.position.clone();
  6583. }
  6584. this.copysprite = PoolManager.GetSprite3D(AssetManager.BuildAsset(buildtype.barrier, this.mdata.buildid));
  6585. SceneManager.mainscene.addChild(this.copysprite);
  6586. this.copysprite.transform.position = this.cursprite.transform.position.clone();
  6587. this.copysprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
  6588. if (this.mdata.buildid == 7) {
  6589. var up = this.copysprite.getChildAt(0);
  6590. up.active = false;
  6591. var ccid = _collider == this.mcollider1 ? 1 : 2;
  6592. var gas = this.copysprite.getChildAt(ccid);
  6593. gas.active = false;
  6594. }
  6595. else {
  6596. var dieupsprite = this.copysprite.getChildAt(1);
  6597. dieupsprite.active = false;
  6598. var diedownspr = this.copysprite.getChildAt(0);
  6599. diedownspr.active = true;
  6600. var downrig = new RigObj(this.copysprite, null, 1, 1.2);
  6601. downrig.minhight = 0;
  6602. var downforce = this.mdata.buildid == 6 ? 0 : 0.5;
  6603. downrig.AddForce(new Laya.Vector3(0, 1, downforce), 0.3);
  6604. var sffcollider = this.copysprite.getChildAt(2).getComponent(Laya.PhysicsCollider);
  6605. sffcollider.enabled = false;
  6606. }
  6607. if (_collider != null && _collider == this.mcollider1) {
  6608. this.downsprite1.active = false;
  6609. }
  6610. else {
  6611. this.downsprite.active = false;
  6612. }
  6613. this.uprig = new RigObj(this.cursprite, () => {
  6614. if (downrig)
  6615. downrig.Clear();
  6616. this.copysprite.active = false;
  6617. this.cursprite.active = false;
  6618. }, 1.5, 1.5);
  6619. this.uprig.minhight = 1;
  6620. this.uprig.AddForce(new Laya.Vector3(0, 1, 0.4), 1);
  6621. }
  6622. }
  6623. class StandBuild extends Building {
  6624. constructor() {
  6625. super(...arguments);
  6626. this.cut = false;
  6627. }
  6628. OnInit() {
  6629. this.mcollider = this.cursprite.getChildAt(2).getComponent(Laya.PhysicsCollider);
  6630. this.mcollider.collisionGroup = ColliderLay.obstacle;
  6631. this.downsprite = this.cursprite.getChildAt(0);
  6632. this.upsprite = this.cursprite.getChildAt(1);
  6633. this.standnode = this.cursprite.getChildAt(3);
  6634. var standpos = this.standnode.transform.position.clone();
  6635. var pos = new Laya.Vector4(standpos.x, standpos.y, standpos.z, this.standnode.transform.rotationEuler.y);
  6636. var shooterdata = new MonsterData(this.mdata.monsterid, pos);
  6637. shooterdata.boos = this.mdata.boos;
  6638. this.mshooter = Shooter.Create(shooterdata);
  6639. this.mshooter.SkinShow(1, 6);
  6640. this.OnReg();
  6641. }
  6642. OnReg() {
  6643. EventManager.On(EventType.Cut, this, this.OnCut);
  6644. if (this.uprig)
  6645. this.uprig.Clear();
  6646. if (this.downrig)
  6647. this.downrig.Clear();
  6648. if (this.copysprite)
  6649. PoolManager.RecoverSprite3D(this.copysprite);
  6650. }
  6651. OnClear() {
  6652. EventManager.Off(EventType.Cut, this, this.OnCut);
  6653. if (this.copysprite)
  6654. this.copysprite.destroy();
  6655. if (!this.cut)
  6656. this.mshooter.Clear();
  6657. if (this.cuteffect)
  6658. PoolManager.RecoverSprite3D(this.cuteffect);
  6659. }
  6660. OnCut(_collider) {
  6661. if (this.mcollider != _collider || this.cut)
  6662. return;
  6663. this.BeCut();
  6664. LevelManager.Instance.curlevel.gameroles.push(this.mshooter);
  6665. this.mshooter.FallLand(this.cursprite.transform.position.y);
  6666. }
  6667. BeCut() {
  6668. this.cut = true;
  6669. TtSdk.Shake();
  6670. AudioControl.PlayVoice(VoiceType.cut);
  6671. var cutasset = AssetManager.effect.getValue(4);
  6672. this.cuteffect = PoolManager.GetSprite3D(cutasset);
  6673. SceneManager.mainscene.addChild(this.cuteffect);
  6674. this.cuteffect.transform.position = this.upsprite.transform.position.clone();
  6675. this.copysprite = PoolManager.GetSprite3D(AssetManager.BuildAsset(buildtype.stand, this.mdata.buildid));
  6676. SceneManager.mainscene.addChild(this.copysprite);
  6677. this.copysprite.transform.position = this.cursprite.transform.position.clone();
  6678. this.copysprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
  6679. var dieupsprite = this.copysprite.getChildAt(1);
  6680. dieupsprite.active = false;
  6681. this.downrig = new RigObj(this.copysprite, null, 1);
  6682. this.downrig.minhight = 1;
  6683. this.downrig.AddForce(new Laya.Vector3(0, 1, 0.1), 0.5);
  6684. this.downsprite.active = false;
  6685. this.uprig = new RigObj(this.cursprite, () => {
  6686. this.Clear();
  6687. }, 1.5, 1.5);
  6688. this.uprig.minhight = 1;
  6689. this.uprig.AddForce(new Laya.Vector3(0, 1, 0.4), 0.5);
  6690. }
  6691. }
  6692. class GameManager {
  6693. constructor() {
  6694. this.curgamestate = GameState.None;
  6695. this.play_id = 0;
  6696. this.gamecount = 0;
  6697. this.goldnum = 0;
  6698. this.begin = false;
  6699. this.completelevels = [];
  6700. GameManager.instance = this;
  6701. console.log("游戏初始化...");
  6702. this.GameInit();
  6703. }
  6704. static get Instance() {
  6705. return GameManager.instance;
  6706. }
  6707. static GetBuild(data) {
  6708. var mbuild = new GameManager.builddic[data.type];
  6709. mbuild.Init(data);
  6710. mbuild.clear = false;
  6711. return mbuild;
  6712. }
  6713. GameInit() {
  6714. GameManager.builddic[buildtype.barrier] = Barrier;
  6715. GameManager.builddic[buildtype.stand] = StandBuild;
  6716. GameManager.builddic[buildtype.road] = Barrier;
  6717. new TaskManager();
  6718. new MonsterDataManager();
  6719. new LevelManager();
  6720. new InputManager();
  6721. this.RegEvent();
  6722. this.ChangeGameState(GameState.Ready);
  6723. }
  6724. RegEvent() {
  6725. EventManager.GameOn(GameState.Ready, this, this.GameReady);
  6726. EventManager.GameOn(GameState.Idle, this, this.GameIdle);
  6727. EventManager.GameOn(GameState.Start, this, this.OnGameStart);
  6728. EventManager.GameOn(GameState.Playing, this, this.GamePlaying);
  6729. EventManager.GameOn(GameState.Die, this, this.GameDie);
  6730. EventManager.GameOn(GameState.Lose, this, this.GameLose);
  6731. EventManager.GameOn(GameState.Win, this, this.GameWin);
  6732. EventManager.GameOn(GameState.Over, this, this.GameOver);
  6733. EventManager.On(EventType.GameIdle, this, this.OnGameIdle);
  6734. }
  6735. ChangeGameState(_state, args = null) {
  6736. if (_state == this.curgamestate)
  6737. return;
  6738. this.curgamestate = _state;
  6739. console.log("GameState:", GameState[_state]);
  6740. EventManager.GameTrigger(_state, args);
  6741. }
  6742. OnGameIdle() {
  6743. this.ChangeGameState(GameState.Idle);
  6744. }
  6745. GameIdle() {
  6746. }
  6747. GameReady() {
  6748. LevelManager.Instance.ReadyLevel();
  6749. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  6750. this.ChangeGameState(GameState.Idle);
  6751. this.begin = false;
  6752. if (HomeWindow.sign && GameManager.Instance.gamecount > 0 && SignWindow.canSgin) {
  6753. HomeWindow.sign = false;
  6754. WindowManager.Instance.ShowWindow(WindowType.SignWindow);
  6755. return;
  6756. }
  6757. var skin = !HomeWindow.sign || !SignWindow.canSgin;
  6758. if (skin && HomeWindow.skin && GameManager.Instance.gamecount > 0) {
  6759. HomeWindow.skin = false;
  6760. WindowManager.Instance.ShowWindow(WindowType.SkinWindow);
  6761. return;
  6762. }
  6763. if (GameManager.Instance.gamecount > 1 && GameManager.Instance.gamecount % 3 == 0 && TaoZhuangWindow.canshow) {
  6764. WindowManager.Instance.ShowWindow(WindowType.TaoZhuangWindow);
  6765. }
  6766. }
  6767. BeginGame() {
  6768. if (this.curgamestate == GameState.Idle && !this.begin) {
  6769. this.begin = true;
  6770. var agrs = [{ "t": PlayerAccount.CurrentAccount.ServerTime.toString() }];
  6771. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.game, agrs, new Laya.Handler(null, (_data) => {
  6772. GameManager.Instance.play_id = _data.play_id;
  6773. this.OnGameBegin();
  6774. }), new Laya.Handler(this, (_data) => {
  6775. this.begin = false;
  6776. console.log("err" + _data);
  6777. }));
  6778. }
  6779. }
  6780. OnGameBegin() {
  6781. TtSdk.Instance.RecordStart();
  6782. if (LevelManager.Instance.curlevel.leveldata.missiondata.trial) {
  6783. WindowManager.Instance.ShowWindow(WindowType.TryOutWindow);
  6784. }
  6785. else {
  6786. this.RecordLevelStart();
  6787. this.ChangeGameState(GameState.Start);
  6788. }
  6789. }
  6790. OnGameStart() {
  6791. this.curlevel = LevelManager.Instance.curlevel;
  6792. this.gamecount++;
  6793. this.goldnum = 0;
  6794. console.log("打开游戏中界面...");
  6795. this.ChangeGameState(GameState.Playing);
  6796. }
  6797. GamePlaying() {
  6798. AudioControl.PlayBgm(BgmType.bgm);
  6799. WindowManager.Instance.ShowWindow(WindowType.InGameWindow);
  6800. }
  6801. GameDie() {
  6802. WindowManager.Instance.ClearPopViews();
  6803. this.ChangeGameState(GameState.Lose);
  6804. }
  6805. GameLose() {
  6806. this.curwin = false;
  6807. console.log("打开结算界面(游戏失败)");
  6808. WindowManager.Instance.ShowWindow(WindowType.ResurrectionWindow);
  6809. this.RecropLevelEnd(false);
  6810. }
  6811. GameWin() {
  6812. this.curwin = true;
  6813. console.log("打开结算界面(游戏胜利)");
  6814. GameManager.alllose = 0;
  6815. this.CheckComplete(true);
  6816. this.RecropLevelEnd(true);
  6817. LevelManager.teststage++;
  6818. }
  6819. CheckComplete(_win) {
  6820. this.completelevels = this.CheckLevelTask();
  6821. if (this.completelevels.length == 0) {
  6822. WindowManager.Instance.ShowWindow(WindowType.SettlementWindow, _win);
  6823. }
  6824. else {
  6825. this.ShowCompleteTask();
  6826. }
  6827. }
  6828. ShowCompleteTask() {
  6829. var curtask = this.completelevels[0];
  6830. WindowManager.Instance.OpenPopView(WindowType.TaskContentView, [curtask, true, true]);
  6831. }
  6832. ReCompleteCheck(_task) {
  6833. var index = this.completelevels.indexOf(_task);
  6834. if (index != -1) {
  6835. this.completelevels.splice(index, 1);
  6836. }
  6837. if (this.completelevels.length > 0) {
  6838. this.ShowCompleteTask();
  6839. }
  6840. else {
  6841. WindowManager.Instance.ShowWindow(WindowType.SettlementWindow, true);
  6842. }
  6843. }
  6844. GameOver(_win) {
  6845. AudioControl.ClearAudio();
  6846. if (_win) {
  6847. WindowManager.Instance.ShowWindow(WindowType.ChestWindow, true);
  6848. }
  6849. else {
  6850. this.RessetGame();
  6851. }
  6852. }
  6853. RessetGame() {
  6854. if (this.curlevel)
  6855. this.curlevel.Clear();
  6856. this.ChangeGameState(GameState.Ready);
  6857. }
  6858. RecordLevelStart() {
  6859. if (!Laya.Browser.onWeiXin)
  6860. return;
  6861. this.curlevel = LevelManager.Instance.curlevel;
  6862. var stageid = this.curlevel.levelid.toString();
  6863. var stagename = this.curlevel.levelname;
  6864. var useid = PlayerAccount.CurAccountData.UseId;
  6865. }
  6866. RecropLevelEnd(_win) {
  6867. if (!Laya.Browser.onWeiXin)
  6868. return;
  6869. var stageid = this.curlevel.levelid.toString();
  6870. var useid = PlayerAccount.CurAccountData.UseId;
  6871. var stagename = LevelManager.Instance.curlevel.levelname;
  6872. if (_win) ;
  6873. else {
  6874. var equipid = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[1];
  6875. }
  6876. }
  6877. CheckLevelTask() {
  6878. var completelevel = [];
  6879. for (var i = 0; i < this.curlevel.leveltasks.length; i++) {
  6880. var matsk = this.curlevel.leveltasks[i];
  6881. if (matsk.id == 1 && matsk.state == 1) {
  6882. if (this.curlevel.allccclear) {
  6883. completelevel.push(matsk);
  6884. TaskManager.CompleteEgg(matsk);
  6885. }
  6886. }
  6887. else if (matsk.id == 2 && matsk.state == 1) {
  6888. if (this.curlevel.alllenemynoneclear && this.curwin) {
  6889. completelevel.push(matsk);
  6890. TaskManager.CompleteEgg(matsk);
  6891. }
  6892. }
  6893. else if (matsk.id == 3 && matsk.state == 1) {
  6894. if (Player.mainpalyer.allfall) {
  6895. completelevel.push(matsk);
  6896. TaskManager.CompleteEgg(matsk);
  6897. }
  6898. }
  6899. else if (matsk.id == 4 && matsk.state == 1) {
  6900. var getskins = [];
  6901. for (var j = 0; j < PlayerAccount.CurAccountData.m_skinDic.values.length; j++) {
  6902. var mskin = PlayerAccount.CurAccountData.m_skinDic.values[j];
  6903. if (mskin.curskinstate != skinstate.lock && mskin.skintype == skintype.weapon) {
  6904. getskins.push(mskin);
  6905. }
  6906. }
  6907. if (getskins.length >= 8) {
  6908. completelevel.push(matsk);
  6909. TaskManager.CompleteEgg(matsk);
  6910. }
  6911. }
  6912. else if (matsk.id == 5 && matsk.state == 1) {
  6913. if (GameManager.alllose > 2) {
  6914. completelevel.push(matsk);
  6915. TaskManager.CompleteEgg(matsk);
  6916. }
  6917. }
  6918. else if (matsk.id == 6 && matsk.state == 1) {
  6919. if (this.curlevel.allboomree) {
  6920. completelevel.push(matsk);
  6921. TaskManager.CompleteEgg(matsk);
  6922. }
  6923. }
  6924. else if (matsk.id == 7 && matsk.state == 1) {
  6925. if (Player.mainpalyer.allstand && this.curwin) {
  6926. completelevel.push(matsk);
  6927. TaskManager.CompleteEgg(matsk);
  6928. }
  6929. }
  6930. else if (matsk.id == 8 && matsk.state == 1) {
  6931. if (this.curlevel.allbuildnoclear && this.curwin) {
  6932. completelevel.push(matsk);
  6933. TaskManager.CompleteEgg(matsk);
  6934. }
  6935. }
  6936. else if (matsk.id == 9 && matsk.state == 1) {
  6937. var getskins = [];
  6938. for (var k = 0; k < PlayerAccount.CurAccountData.m_skinDic.values.length; k++) {
  6939. var mskin = PlayerAccount.CurAccountData.m_skinDic.values[k];
  6940. if (mskin.curskinstate != skinstate.lock && mskin.skintype == skintype.role) {
  6941. getskins.push(mskin);
  6942. }
  6943. }
  6944. if (getskins.length >= 4) {
  6945. completelevel.push(matsk);
  6946. TaskManager.CompleteEgg(matsk);
  6947. }
  6948. }
  6949. }
  6950. return completelevel;
  6951. }
  6952. }
  6953. GameManager.builddic = [];
  6954. GameManager.alllose = 0;
  6955. var Vector3$g = Laya.Vector3;
  6956. class SceneManager {
  6957. constructor(_scene) {
  6958. this.frist = true;
  6959. SceneManager.instance = this;
  6960. SceneManager.mainscene = _scene;
  6961. SceneManager.endsprite = _scene.getChildByName("end");
  6962. SceneManager.endsprite.active = false;
  6963. var endcollider = SceneManager.endsprite.getComponent(Laya.PhysicsCollider);
  6964. endcollider.collisionGroup = ColliderLay.end;
  6965. SceneManager.mapparent = new Laya.Node();
  6966. SceneManager.mapparent.name = "mapparent";
  6967. SceneManager.mainscene.addChild(SceneManager.mapparent);
  6968. SceneManager.maincamera = _scene.getChildByName("Main Camera");
  6969. SceneManager.maincamera.addComponent(CameraManager);
  6970. SceneManager.maincamera.enableHDR = false;
  6971. SceneManager.maincamera.clearColor = new Laya.Vector4(130 / 255, 201 / 255, 254 / 255, 1);
  6972. SceneManager.camerastartpos = SceneManager.maincamera.transform.position.clone();
  6973. SceneManager.camerastartrot = SceneManager.maincamera.transform.rotation.clone();
  6974. SceneManager.mainlight = _scene.getChildByName("Directional Light");
  6975. console.log("场景开始初始化...");
  6976. EventManager.On(EventType.LevelCreateComplete, this, this.OnLevelCreate);
  6977. new GameManager();
  6978. }
  6979. static get Instance() {
  6980. return SceneManager.instance;
  6981. }
  6982. OnLevelCreate() {
  6983. if (this.frist) {
  6984. this.frist = false;
  6985. this.FirstEnter();
  6986. }
  6987. EventManager.Trigger(EventType.GameIdle);
  6988. }
  6989. FirstEnter() {
  6990. SceneManager.mainscene.visible = true;
  6991. console.log("场景首次打开...");
  6992. for (var i = 0; i < AssetManager.effect.values.length; i++) {
  6993. var cureffect = AssetManager.effect.values[i];
  6994. SceneManager.mainscene.addChild(cureffect);
  6995. cureffect.transform.position = new Vector3$g(0, 0, 5000);
  6996. cureffect.active = true;
  6997. }
  6998. Laya.timer.once(3500, this, () => {
  6999. for (var i = 0; i < AssetManager.effect.values.length; i++) {
  7000. var cureffect = AssetManager.effect.values[i];
  7001. cureffect.removeSelf();
  7002. cureffect.transform.position = new Vector3$g(0, 0, 0);
  7003. cureffect.active = false;
  7004. }
  7005. });
  7006. }
  7007. }
  7008. SceneManager.camerastartpos = new Vector3$g();
  7009. SceneManager.camerastartrot = new Laya.Quaternion();
  7010. var Vector3$h = Laya.Vector3;
  7011. class GameUtils {
  7012. static ScaleVector3(v3, f) {
  7013. return new Vector3$h(v3.x * f, v3.y * f, v3.z * f);
  7014. }
  7015. static getConverseVector3(_vector3) {
  7016. return new Vector3$h(-_vector3.x, -_vector3.y, -_vector3.z);
  7017. }
  7018. static angleToEangle(_angle) {
  7019. return _angle * Math.PI / 180;
  7020. }
  7021. static absEangle(_angle) {
  7022. var x = _angle.x;
  7023. if (x == -0) {
  7024. x = 0;
  7025. }
  7026. var y = _angle.y;
  7027. if (y == -0) {
  7028. y = 0;
  7029. }
  7030. var z = _angle.z;
  7031. if (z == -0) {
  7032. z = 0;
  7033. }
  7034. return new Vector3$h(x, y, z);
  7035. }
  7036. static debugVector3(_vector3) {
  7037. console.log(_vector3.x + " " + _vector3.y + " " + _vector3.z);
  7038. }
  7039. static getRandomInt(left, right) {
  7040. if (left > right) {
  7041. return 0;
  7042. }
  7043. var size = right - left + 1;
  7044. var curNumber = Math.random() * size + left;
  7045. return Math.floor(curNumber);
  7046. }
  7047. static getRandomfloat(left, right) {
  7048. if (left >= right) {
  7049. return 0;
  7050. }
  7051. var size = right - left;
  7052. var curNumber = Math.random() * size + left;
  7053. return curNumber;
  7054. }
  7055. static Vector2Length(_pos1, _pos2) {
  7056. var offestx = _pos1.x - _pos2.x;
  7057. var offestz = _pos1.y - _pos2.y;
  7058. var v1 = Math.pow(offestx, 2);
  7059. var v2 = Math.pow(offestz, 2);
  7060. var dis = Math.sqrt(v1 + v2);
  7061. return dis;
  7062. }
  7063. static Vector32Length(_pos1, _pos2) {
  7064. var offestx = _pos1.x - _pos2.x;
  7065. var offestz = _pos1.z - _pos2.z;
  7066. var v1 = Math.pow(offestx, 2);
  7067. var v2 = Math.pow(offestz, 2);
  7068. var dis = Math.sqrt(v1 + v2);
  7069. return dis;
  7070. }
  7071. static Vector3Angle(_dir1, _dir2) {
  7072. var v = Vector3$h.dot(_dir1, _dir2);
  7073. var av = Vector3$h.scalarLength(_dir1);
  7074. var bv = Vector3$h.scalarLength(_dir2);
  7075. var vv = av * bv;
  7076. var cosa = v / vv;
  7077. var angle = Math.acos(cosa) * 180 / Math.PI;
  7078. return angle;
  7079. }
  7080. static Angle(ma, mb) {
  7081. var v1 = (ma.x * mb.x) + (ma.y * mb.y) + (ma.z * mb.z);
  7082. var ma_val = Math.sqrt(ma.x * ma.x + ma.y * ma.y + ma.z * ma.z);
  7083. var mb_val = Math.sqrt(mb.x * mb.x + mb.y * mb.y + mb.z * mb.z);
  7084. var cosM = v1 / (ma_val * mb_val);
  7085. var angleAMB = Math.acos(cosM) * 180 / Math.PI;
  7086. return angleAMB;
  7087. }
  7088. static SetColliderLay(_node, _lay) {
  7089. var childNumber = _node.numChildren;
  7090. var PhysicsCollider = _node.getComponent(Laya.PhysicsCollider);
  7091. if (PhysicsCollider) {
  7092. PhysicsCollider.collisionGroup = _lay;
  7093. PhysicsCollider.friction = 1;
  7094. PhysicsCollider.restitution = 0;
  7095. }
  7096. for (var i = 0; i < childNumber; i++) {
  7097. var eChildNumber = _node.getChildAt(i).numChildren;
  7098. if (eChildNumber > 0) {
  7099. this.SetColliderLay(_node.getChildAt(i), _lay);
  7100. }
  7101. var PhysicsCollider = _node.getChildAt(i).getComponent(Laya.PhysicsCollider);
  7102. if (PhysicsCollider) {
  7103. PhysicsCollider.collisionGroup = _lay;
  7104. PhysicsCollider.friction = 1;
  7105. PhysicsCollider.restitution = 0;
  7106. }
  7107. }
  7108. }
  7109. static TweenButton(_btn, _complete) {
  7110. _btn.mouseEnabled = false;
  7111. if (_btn.anchorX != 0.5) {
  7112. _btn.anchorX = 0.5;
  7113. _btn.anchorY = 0.5;
  7114. _btn.x += _btn.width / 2;
  7115. _btn.y += _btn.height / 2;
  7116. }
  7117. Laya.Tween.to(_btn, { scaleX: 1.2, scaleY: 1.2 }, 150, Laya.Ease.quadOut, Laya.Handler.create(this, () => {
  7118. Laya.Tween.to(_btn, { scaleX: 1, scaleY: 1 }, 100, Laya.Ease.quadIn, Laya.Handler.create(this, () => {
  7119. _btn.mouseEnabled = true;
  7120. _complete();
  7121. }));
  7122. }));
  7123. }
  7124. static TweenMove(targetTransform, TargetPos, duration, _completeHandle = null, ease = null, lookPos = null) {
  7125. var curPos = targetTransform.position;
  7126. var tween = Laya.Tween.to(curPos, { x: TargetPos.x, y: TargetPos.y, z: TargetPos.z, update: new Laya.Handler(this, function () {
  7127. if (lookPos)
  7128. targetTransform.lookAt(lookPos, new Laya.Vector3(0, 1, 0));
  7129. targetTransform.position = curPos;
  7130. }) }, duration * 1000, ease, Laya.Handler.create(this, function () {
  7131. tween.clear();
  7132. if (_completeHandle != null) {
  7133. _completeHandle.run();
  7134. }
  7135. }));
  7136. return tween;
  7137. }
  7138. static TweenERot(targetTransform, TargetRot, duration, _completeHandle = null, ease = null) {
  7139. var curPos = targetTransform.rotationEuler;
  7140. var tween = Laya.Tween.to(curPos, { x: TargetRot.x, y: TargetRot.y, z: TargetRot.z, update: new Laya.Handler(this, function () {
  7141. targetTransform.rotationEuler = curPos;
  7142. }) }, duration * 1000, ease, Laya.Handler.create(this, function () {
  7143. tween.clear();
  7144. if (_completeHandle != null) {
  7145. _completeHandle.run();
  7146. }
  7147. }));
  7148. return tween;
  7149. }
  7150. static TweenProgress(_progress, _fromValue, _tovalue, _duration, _completeHandle = null) {
  7151. _progress.value = _fromValue;
  7152. var tween = Laya.Tween.to(_progress, { value: _tovalue }, _duration * 1000, null, _completeHandle);
  7153. return tween;
  7154. }
  7155. static lerp(form, to, t) {
  7156. if (t <= 0) {
  7157. return form;
  7158. }
  7159. else if (t >= 1) {
  7160. return to;
  7161. }
  7162. var a = t * to + (1 - t) * form;
  7163. return a;
  7164. }
  7165. static DelayToDo(_delayDuration, _doFunction) {
  7166. Laya.timer.once(_delayDuration * 1000, this, _doFunction);
  7167. }
  7168. static ArrayContainsItem(_array, _item) {
  7169. let index = _array.indexOf(_item);
  7170. if (index != -1) {
  7171. return true;
  7172. }
  7173. return false;
  7174. }
  7175. static PathangleLength(pts) {
  7176. var le = 0;
  7177. for (var i = 0; i < pts.length - 1; i++) {
  7178. var dis = Vector3$h.distance(pts[i], pts[i + 1]);
  7179. le += dis;
  7180. }
  7181. return le;
  7182. }
  7183. static TweenText(message, _hight, _completeHandle = null, _duration = 1000) {
  7184. var mes = new Laya.Text();
  7185. mes.width = message.size.x;
  7186. mes.height = message.size.y;
  7187. mes.align = "center";
  7188. mes.valign = "middle";
  7189. mes.font = "Microsoft YaHei";
  7190. mes.fontSize = message.fontSize;
  7191. mes.pivotX = mes.width / 2;
  7192. mes.pivotY = mes.height / 2;
  7193. mes.color = "#5ad122";
  7194. mes.bold = true;
  7195. mes.stroke = 5;
  7196. mes.strokeColor = "#ffffff";
  7197. if (message.color) {
  7198. message.color = message.color;
  7199. }
  7200. mes.text = message.message;
  7201. mes.zOrder = 1;
  7202. Laya.stage.addChildAt(mes, Laya.stage.numChildren - 1);
  7203. mes.pos(message.pos.x, message.pos.y);
  7204. var tween = Laya.Tween.to(mes, { y: mes.y - _hight, update: new Laya.Handler(this, function () {
  7205. }) }, _duration, Laya.Ease.expoInOut, Laya.Handler.create(this, function () {
  7206. tween.clear();
  7207. mes.destroy();
  7208. if (_completeHandle) {
  7209. _completeHandle.run();
  7210. }
  7211. }));
  7212. Laya.Tween.to(mes, { alpha: 0.4 }, _duration, Laya.Ease.backInOut);
  7213. return mes;
  7214. }
  7215. static TweenGold(_vector3, _topos) {
  7216. var viewpos = new Laya.Vector4();
  7217. SceneManager.maincamera.worldToViewportPoint(_vector3, viewpos);
  7218. var goldsprite = new Laya.Image;
  7219. goldsprite.width = 51;
  7220. goldsprite.height = 53;
  7221. goldsprite.pivotX = goldsprite.width / 2;
  7222. goldsprite.pivotY = goldsprite.height / 2;
  7223. Laya.stage.addChild(goldsprite);
  7224. goldsprite.x = viewpos.x;
  7225. goldsprite.y = viewpos.y;
  7226. goldsprite.skin = "game/zhujiemian-1-7.png";
  7227. Laya.Tween.to(goldsprite, {
  7228. x: _topos.x, y: _topos.y, alpha: 0.4
  7229. }, 1000, null, Laya.Handler.create(this, () => {
  7230. if (goldsprite)
  7231. goldsprite.destroy();
  7232. }), null, false);
  7233. }
  7234. static GetMoney(_num, _pos = null, _completeHandle = null) {
  7235. if (_num == 0)
  7236. return;
  7237. var mbox = new Laya.Box;
  7238. mbox.width = 400;
  7239. mbox.height = 100;
  7240. mbox.pivotX = mbox.width / 2;
  7241. mbox.pivotY = mbox.height / 2;
  7242. if (_pos == null) {
  7243. _pos = new Laya.Vector2(Laya.stage.width / 2, Laya.stage.height / 2);
  7244. }
  7245. mbox.pos(_pos.x, _pos.y);
  7246. var mimage = new Laya.Image;
  7247. mimage.skin = "game/jiesuan-1-6.png";
  7248. mimage.width = 81;
  7249. mimage.height = 87;
  7250. mimage.left = 50;
  7251. mimage.y = 10;
  7252. mbox.addChild(mimage);
  7253. var mtext = new Laya.Text;
  7254. mtext.width = 300;
  7255. mtext.height = 50;
  7256. mtext.align = "left";
  7257. mtext.valign = "middle";
  7258. mtext.font = "Microsoft YaHei";
  7259. mtext.fontSize = 45;
  7260. mtext.color = "#FFFFFF";
  7261. mtext.bold = true;
  7262. mtext.font = "Microsoft YaHei";
  7263. mtext.text = "金币 +" + _num;
  7264. mtext.x = 150;
  7265. mtext.y = 25;
  7266. mbox.addChild(mtext);
  7267. Laya.stage.addChild(mbox);
  7268. var curtween = Laya.Tween.to(mbox, { y: mbox.y - 200 }, 1500, Laya.Ease.expoInOut, Laya.Handler.create(this, () => {
  7269. curtween.clear();
  7270. mbox.destroy();
  7271. if (_completeHandle) {
  7272. _completeHandle.run();
  7273. }
  7274. }), 100);
  7275. return mbox;
  7276. }
  7277. static DirToAngle(_dir) {
  7278. var dir = new Vector3$h(Math.round(_dir.x * 10) / 10, Math.round(_dir.y * 10) / 10, Math.round(_dir.z * 10) / 10);
  7279. if (dir.x == -0) {
  7280. dir = new Vector3$h(0, dir.y, dir.z);
  7281. }
  7282. if (dir.y == -0) {
  7283. dir = new Vector3$h(dir.x, 0, dir.z);
  7284. }
  7285. if (dir.z == -0) {
  7286. dir = new Vector3$h(dir.x, dir.y, 0);
  7287. }
  7288. var reangle = Math.atan(dir.y / dir.z) * 180 / Math.PI;
  7289. if (dir.z < 0)
  7290. reangle += 180;
  7291. reangle -= 90;
  7292. var hangle = reangle * Math.PI / 180;
  7293. return hangle;
  7294. }
  7295. static YNAngleToVe(_dir) {
  7296. var hangle = this.DirToAngle(_dir);
  7297. var dirx = Math.cos(hangle);
  7298. var diry = Math.sin(hangle);
  7299. return new Vector3$h(0, diry, dirx);
  7300. }
  7301. static DirRotYToDir(_dir, _angle) {
  7302. var outdir = new Vector3$h();
  7303. return outdir;
  7304. }
  7305. }
  7306. class SkinData {
  7307. constructor(_id, _type) {
  7308. this.skinid = _id;
  7309. this.skintype = _type;
  7310. this.GetSkinState(this.skintype);
  7311. }
  7312. GetSkinState(_skintype) {
  7313. var usetheme = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[_skintype];
  7314. var useing = usetheme == this.skinid.toString();
  7315. var gettheme = PlayerAccount.CurAccountData.HasTheme(this.skinid);
  7316. if (useing) {
  7317. this.curskinstate = skinstate.useing;
  7318. }
  7319. else if (!useing && gettheme) {
  7320. this.curskinstate = skinstate.getnoues;
  7321. }
  7322. else {
  7323. this.curskinstate = skinstate.lock;
  7324. }
  7325. }
  7326. }
  7327. class VerCheck {
  7328. static get checkgame() {
  7329. var mgame = true;
  7330. if (!VerCheck.game) {
  7331. mgame = false;
  7332. }
  7333. else {
  7334. VerCheck.game = false;
  7335. this.GameInit();
  7336. }
  7337. return mgame;
  7338. }
  7339. static GameInit() {
  7340. console.log("gameinit");
  7341. console.log("Ver", this.mVer);
  7342. }
  7343. }
  7344. VerCheck.mVer = "1.3.3";
  7345. VerCheck.game = true;
  7346. VerCheck.WX = false;
  7347. class AccountData {
  7348. constructor(_token, _appSetting, _user, _userbase, _useInvite = null, _user_stage = null, _user_sign, _user_achievement, _lottery, _user_video) {
  7349. this.city_deny = false;
  7350. this.openid = "";
  7351. this.userId = "";
  7352. this.scene = "";
  7353. this.top_scene = "";
  7354. this.roadconfig = {};
  7355. this.m_RewardDic = {};
  7356. this.m_EntityDic = {};
  7357. this.m_AchievementDic = {};
  7358. this.m_skinDic = new Dictionary();
  7359. this.m_token = _token;
  7360. this.m_app_setting = _appSetting;
  7361. this.m_user = _user;
  7362. this.m_user_base = _userbase;
  7363. this.m_sign = _user_sign;
  7364. this.m_task = _user_achievement;
  7365. this.lottery = _lottery;
  7366. this.m_user_video = _user_video;
  7367. this.userId = this.m_user["user_id"];
  7368. this.openid = this.m_user_base["openid"];
  7369. this.scene = this.m_user_base["scene"];
  7370. this.top_scene = this.m_user_base["top_scene"];
  7371. console.log("user_id:" + this.userId);
  7372. }
  7373. get lotterytime() {
  7374. return Number(this.lottery["day_video_times"]);
  7375. }
  7376. get share() {
  7377. return this.m_app_setting["share"] == "1";
  7378. }
  7379. get sharecontent() {
  7380. return this.m_app_setting["sharecontent"];
  7381. }
  7382. get ShareImage() {
  7383. return this.m_app_setting["ShareImage"];
  7384. }
  7385. get cheattime() {
  7386. return Number(this.m_app_setting["cheattime"]);
  7387. }
  7388. get banner() {
  7389. return this.m_app_setting["banner"] == "1";
  7390. }
  7391. get video() {
  7392. return this.m_app_setting["video"] == "1";
  7393. }
  7394. get checkscence() {
  7395. return this.m_app_setting["checkscence"] == "1";
  7396. }
  7397. get bgm() {
  7398. return this.m_app_setting["bgm"] == "1";
  7399. }
  7400. get newaccount() {
  7401. return this.m_user["game_times"] == "0" && GameManager.Instance.gamecount == 0;
  7402. }
  7403. get ctnfilename() {
  7404. return this.m_app_setting["ctnfilename"];
  7405. }
  7406. get cheat() {
  7407. return this.m_app_setting["cheat"] == "1";
  7408. }
  7409. get shakestage() {
  7410. return this.m_app_setting["shakestage"] && this.m_app_setting["shakestage"] == "1";
  7411. }
  7412. get videlAdUnitId() {
  7413. return this.m_app_setting["videlAdUnitId"];
  7414. }
  7415. get bannerAdUnitId() {
  7416. return this.m_app_setting["bannerAdUnitId"];
  7417. }
  7418. get tri() {
  7419. return this.m_app_setting["tri"] == "1";
  7420. }
  7421. get recommend() {
  7422. return this.m_app_setting["recommend"] == "1";
  7423. }
  7424. get recommendbanner() {
  7425. return this.m_app_setting["recommendbanner"] == "1";
  7426. }
  7427. get chest() {
  7428. return this.m_app_setting["chest"] == "1";
  7429. }
  7430. get egg() {
  7431. return Number(this.m_app_setting["egg"]) > Math.random();
  7432. }
  7433. get cheatback() {
  7434. return this.m_app_setting["cheatback"] == "1";
  7435. }
  7436. get cuteffect() {
  7437. return this.m_app_setting["cuteffect"] == "1";
  7438. }
  7439. get videolock() {
  7440. return false;
  7441. }
  7442. get videonum() {
  7443. return false;
  7444. }
  7445. get UseId() {
  7446. return this.userId;
  7447. }
  7448. GetConfig(_type) {
  7449. var type = AccountConfig[_type];
  7450. return this.m_configs[type];
  7451. }
  7452. GetUser(_type) {
  7453. var type = AccountUser[_type];
  7454. return this.m_user[type];
  7455. }
  7456. get GetVideoTotal() {
  7457. return Number(this.m_user_video["total"]);
  7458. }
  7459. GetSign(_datatype) {
  7460. var type = signdata[_datatype];
  7461. return this.m_sign[type];
  7462. }
  7463. GetRewardConfig(_rewardid) {
  7464. var reward = this.m_RewardDic[_rewardid];
  7465. return reward;
  7466. }
  7467. GetEntity(_id, attr) {
  7468. if (!this.m_EntityDic[_id])
  7469. return null;
  7470. return this.m_EntityDic[_id][entity[attr]];
  7471. }
  7472. GetRewardDic() {
  7473. var config = this.GetConfig(AccountConfig.rewards);
  7474. for (var key in config) {
  7475. this.m_RewardDic[config[key].id] = config[key];
  7476. }
  7477. }
  7478. GetEntityDic() {
  7479. var config = this.GetConfig(AccountConfig.entity);
  7480. for (var key in config) {
  7481. this.m_EntityDic[config[key].entity_id] = config[key];
  7482. }
  7483. }
  7484. GetThemeById(_id) {
  7485. var data = this.GetConfig(AccountConfig.theme);
  7486. if (data) {
  7487. for (let index = 0; index < data.length; index++) {
  7488. const element = data[index];
  7489. if (element.id == _id) {
  7490. return element;
  7491. }
  7492. }
  7493. }
  7494. }
  7495. GetSkinAttr(_id) {
  7496. var config = this.GetConfig(AccountConfig.theme);
  7497. for (var i = 0; i < config.length; i++) {
  7498. if (config[i].id == _id) {
  7499. return config[i];
  7500. }
  7501. }
  7502. }
  7503. GetAchievementData() {
  7504. var data = this.GetConfig(AccountConfig.achievement);
  7505. var dic = {};
  7506. for (var key1 in data) {
  7507. var type1 = data[key1].type;
  7508. if (dic[type1]) {
  7509. continue;
  7510. }
  7511. var array = [];
  7512. for (var key2 in data) {
  7513. var type2 = data[key2].type;
  7514. if (type1 == type2) {
  7515. array.push(data[key2]);
  7516. }
  7517. }
  7518. dic[type1] = array;
  7519. }
  7520. this.m_AchievementDic = dic;
  7521. }
  7522. HasTheme(_id) {
  7523. var has = false;
  7524. var getthemes = this.GetUser(AccountUser.get_themes);
  7525. for (var i = 0; i < getthemes.length; i++) {
  7526. if (getthemes[i] == _id) {
  7527. has = true;
  7528. }
  7529. }
  7530. return has;
  7531. }
  7532. GetSkinDic(_config) {
  7533. var themes = _config.theme;
  7534. for (var i = 0; i < themes.length; i++) {
  7535. var config = themes[i];
  7536. var data = new SkinData(Number(config.id), 0);
  7537. data.skinname = config.name;
  7538. data.skintype = Number(config.type);
  7539. data.achievement_type = Number(config.achievement_type);
  7540. data.quality = Number(config.quality);
  7541. data.require_type = Number(config.require_type);
  7542. data.require_num = Number(config.require_num);
  7543. data.skinicon = config.icon;
  7544. data.prefab = config.prefab;
  7545. data.lev_big = Number(config.lev_big);
  7546. data.prop = Number(config.prop);
  7547. data.cdk = Number(config.code);
  7548. data.shield = Number(config.shield);
  7549. data.GetSkinState(data.skintype);
  7550. if (data.shield == 0) {
  7551. this.m_skinDic.add(Number(config.id), data);
  7552. }
  7553. }
  7554. }
  7555. GetReward(_skintype) {
  7556. var rewardskin;
  7557. var videoskins = [];
  7558. var skins = PlayerAccount.CurAccountData.m_skinDic;
  7559. for (var i = 0; i < skins.values.length; i++) {
  7560. var skin = skins.values[i];
  7561. if (skin.curskinstate == skinstate.lock && skin.require_type != 6 && skin.skintype == _skintype) {
  7562. videoskins.push(skin);
  7563. }
  7564. }
  7565. if (videoskins.length > 0) {
  7566. var random = GameUtils.getRandomInt(0, videoskins.length - 1);
  7567. rewardskin = videoskins[random];
  7568. var skinreward = new rewarddata(6000 + rewardskin.skinid);
  7569. skinreward.rewardicon = rewardskin.skinicon;
  7570. skinreward.rewardname = rewardskin.skinname;
  7571. skinreward.rewardnum = 1;
  7572. skinreward.type = rewardtype.role;
  7573. return skinreward;
  7574. }
  7575. else {
  7576. return null;
  7577. }
  7578. }
  7579. GetSeverConfig(_config) {
  7580. this.m_configs = _config;
  7581. this.GetSkinDic(this.m_configs);
  7582. this.GetRewardDic();
  7583. }
  7584. UpdateSkinDic() {
  7585. this.GetSkinDic(this.m_configs);
  7586. }
  7587. GetGlobe(_key) {
  7588. var globe = this.GetConfig(AccountConfig.global);
  7589. for (var key in globe) {
  7590. var obj = globe[key];
  7591. var kkk = obj["key"];
  7592. if (kkk == _key) {
  7593. var value = obj["value"];
  7594. return value;
  7595. }
  7596. }
  7597. return null;
  7598. }
  7599. }
  7600. class PlayerAccount {
  7601. constructor(_code, _nickname, _avatar, _gender, _country, _province, _city, _device, _shareid, _scence, _ver) {
  7602. this.localTime = Laya.timer.currTimer;
  7603. this.Code = _code;
  7604. this.NickName = _nickname;
  7605. this.Avatar = _avatar;
  7606. this.Gender = _gender;
  7607. this.Country = _country;
  7608. this.Province = _province;
  7609. this.City = _city;
  7610. this.Device = _device;
  7611. this.ShareId = _shareid;
  7612. this.Scene = _scence;
  7613. this.ver = _ver;
  7614. PlayerAccount.instance = this;
  7615. }
  7616. static get CurrentAccount() {
  7617. if (PlayerAccount.instance == null) {
  7618. console.log("生成本地测试账号...");
  7619. return PlayerAccount.TestAccount;
  7620. }
  7621. return PlayerAccount.instance;
  7622. }
  7623. static get TestAccount() {
  7624. var code = Laya.LocalStorage.getItem("localcode");
  7625. if (!code) {
  7626. var time = new Date().getTime().toString();
  7627. var random = GameUtils.getRandomInt(10000, 99999).toString();
  7628. code = "xj_" + time + random;
  7629. Laya.LocalStorage.setItem("localcode", code);
  7630. console.log(time, random);
  7631. console.log("新用户", code);
  7632. }
  7633. else {
  7634. console.log("老用户", code);
  7635. }
  7636. var curaccount = new PlayerAccount(code, null, null, null, null, null, null, null, null, null, VerCheck.mVer);
  7637. return curaccount;
  7638. }
  7639. SetAccountData(data, completecb) {
  7640. var token = data["token"];
  7641. var app_setting = data["app_setting"];
  7642. var user = data["user"];
  7643. var user_base = data["user_base"];
  7644. var user_sign = data["user_sign"];
  7645. var user_achievement = data["user_achievement"];
  7646. var user_lottery = data["user_lottery"];
  7647. var user_video = data["user_video"];
  7648. var city_deny = data["city_deny"];
  7649. if (PlayerAccount.CurAccountData == null) {
  7650. console.log("开始获取config数据");
  7651. PlayerAccount.CurAccountData = new AccountData(token, app_setting, user, user_base, null, null, user_sign, user_achievement, user_lottery, user_video);
  7652. PlayerAccount.CurAccountData.city_deny = city_deny;
  7653. PlayerAccount.day_first = data["day_first"] == 1;
  7654. PlayerAccount.is_new = data["is_new"] ? true : false;
  7655. this.CheckLocalConfig(data.table_version, (_config) => {
  7656. PlayerAccount.CurAccountData.GetSeverConfig(_config);
  7657. if (completecb != null) {
  7658. completecb.runWith(data);
  7659. }
  7660. });
  7661. }
  7662. else {
  7663. if (user) {
  7664. PlayerAccount.CurAccountData.m_user = user;
  7665. }
  7666. if (user_base) {
  7667. PlayerAccount.CurAccountData.m_user_base = user_base;
  7668. }
  7669. if (user_sign) {
  7670. PlayerAccount.CurAccountData.m_sign = user_sign;
  7671. }
  7672. if (user_achievement) {
  7673. PlayerAccount.CurAccountData.m_task = user_achievement;
  7674. }
  7675. if (user_lottery) {
  7676. PlayerAccount.CurAccountData.lottery = user_lottery;
  7677. }
  7678. if (user_video) {
  7679. PlayerAccount.CurAccountData.m_user_video = user_video;
  7680. }
  7681. if (PlayerAccount.CurAccountData.m_configs != null) {
  7682. PlayerAccount.CurAccountData.GetSeverConfig(PlayerAccount.CurAccountData.m_configs);
  7683. }
  7684. }
  7685. }
  7686. CheckLocalConfig(_ver, cb) {
  7687. var curconfig = Laya.LocalStorage.getJSON(PlayerAccount.localcofigkey);
  7688. if (curconfig) {
  7689. if (curconfig.ver == _ver) {
  7690. console.log("sever配置是最新的...", _ver);
  7691. console.log("config接口获取成功");
  7692. cb(curconfig);
  7693. }
  7694. else {
  7695. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Config, null, Laya.Handler.create(this, (data) => {
  7696. data.configs.ver = _ver;
  7697. Laya.LocalStorage.setJSON(PlayerAccount.localcofigkey, data.configs);
  7698. console.log("sever配置更新完成...", _ver);
  7699. console.log("config接口获取成功");
  7700. cb(data.configs);
  7701. }), Laya.Handler.create(this, (data) => {
  7702. console.log("配置获取失败" + data);
  7703. console.log("config接口获取失败");
  7704. }));
  7705. }
  7706. }
  7707. else {
  7708. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Config, null, Laya.Handler.create(this, (data) => {
  7709. data.configs.ver = _ver;
  7710. Laya.LocalStorage.setJSON(PlayerAccount.localcofigkey, data.configs);
  7711. console.log("sever保存配置完成...", _ver);
  7712. console.log("config接口获取成功");
  7713. cb(data.configs);
  7714. }), Laya.Handler.create(this, (data) => {
  7715. console.log("配置获取失败" + data);
  7716. console.log("config接口获取失败");
  7717. }));
  7718. }
  7719. }
  7720. get ServerTime() {
  7721. let time = Laya.timer.currTimer;
  7722. let stime = PlayerAccount.ServerTime + Math.ceil((time - this.localTime) / 1000);
  7723. return stime;
  7724. }
  7725. }
  7726. PlayerAccount.localcofigkey = "mconfig";
  7727. PlayerAccount.day_first = false;
  7728. PlayerAccount.is_new = false;
  7729. var Tween = Laya.Tween;
  7730. class LoadWindow extends ui.Window.LoadWindowUI {
  7731. constructor() {
  7732. super();
  7733. this.respaths = [];
  7734. this.prenum = new Laya.Vector2();
  7735. LoadWindow.instance = this;
  7736. Laya.stage.addChild(this);
  7737. this.logo.y = Laya.stage.height / 1280 * this.logo.y;
  7738. this.logo1.y = Laya.stage.height / 1280 * this.logo1.y;
  7739. this.Open();
  7740. EventManager.On(EventType.LevelCreateComplete, this, this.OnHomeInit);
  7741. }
  7742. static get Instance() {
  7743. return LoadWindow.instance;
  7744. }
  7745. Open(_data = null) {
  7746. console.log("Landing...");
  7747. this.LoginWx();
  7748. this.TweenProgress(0, 65, 1, this.ShowProgress);
  7749. TtSdk.RecordEvent("enterLoad");
  7750. this.height = Laya.stage.height;
  7751. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  7752. }
  7753. LoginWx() {
  7754. this.LoginLocalSever();
  7755. }
  7756. LoginLocal() {
  7757. var code = Laya.LocalStorage.getItem("ttcode");
  7758. if (!code) {
  7759. var time = new Date().getTime().toString();
  7760. var random = GameUtils.getRandomInt(10000, 99999).toString();
  7761. code = "xj_" + time + random;
  7762. Laya.LocalStorage.setItem("ttcode", code);
  7763. console.log(time, random);
  7764. console.log("新用户", code);
  7765. }
  7766. else {
  7767. console.log("老用户", code);
  7768. }
  7769. new PlayerAccount(code, "", "", 0, "", "", "", "", "", "", VerCheck.mVer);
  7770. NetworkManager.Instance.login(null, Laya.Handler.create(this, this.OnLoginLocalComplete), Laya.Handler.create(this, this.OnLoginError));
  7771. }
  7772. LoadSbp() {
  7773. this.LoadScene();
  7774. }
  7775. LoginLocalSever(res = null) {
  7776. console.log("开始本地登录");
  7777. NetworkManager.Instance.login(null, Laya.Handler.create(this, this.OnLoginLocalComplete), Laya.Handler.create(this, this.OnLoginError));
  7778. }
  7779. OnLoginLocalComplete() {
  7780. console.log("本地服务器登录完成...");
  7781. ADHelper.initAd();
  7782. this.LoadScene();
  7783. }
  7784. OnLoginError(e) {
  7785. console.log(e);
  7786. this.LoginWx();
  7787. }
  7788. CompleteProgress() {
  7789. this.TweenProgress(this.prenum.x, 100, 0.3, this.LoadEnd);
  7790. }
  7791. ShowProgress() {
  7792. this.TweenProgress(this.prenum.x, 95, 50);
  7793. }
  7794. Hide() {
  7795. Laya.loader.clearRes("res/atlas/load.atlas");
  7796. Laya.loader.clearRes("res/atlas/load.png");
  7797. this.destroy();
  7798. }
  7799. LoadScene() {
  7800. Laya.Scene3D.load(AssetPath.mainscene, Laya.Handler.create(this, (scene) => {
  7801. this.mainscene = scene;
  7802. this.mainscene.visible = false;
  7803. Laya.stage.addChildAt(this.mainscene, 1);
  7804. console.log("场景加载完成...");
  7805. this.LoadResources();
  7806. }));
  7807. }
  7808. LoadResources() {
  7809. var respath = [];
  7810. respath = respath.concat(AssetPath.prefab);
  7811. Laya.loader.create(respath, Laya.Handler.create(this, () => {
  7812. var roleasset = Laya.loader.getRes(AssetPath.prefab[0]);
  7813. for (var i = 0; i < roleasset.numChildren; i++) {
  7814. var curroleasset = roleasset.getChildAt(i);
  7815. curroleasset.active = false;
  7816. AssetManager.role.add(i + 1, curroleasset);
  7817. }
  7818. Laya.loader.clearRes(AssetPath.prefab[0]);
  7819. var girlasset = Laya.loader.getRes(AssetPath.prefab[1]);
  7820. for (var i = 0; i < girlasset.numChildren; i++) {
  7821. var curgirlasset = girlasset.getChildAt(i);
  7822. curgirlasset.active = false;
  7823. AssetManager.girl.add(i + 1, curgirlasset);
  7824. }
  7825. Laya.loader.clearRes(AssetPath.prefab[1]);
  7826. var enemyasset = Laya.loader.getRes(AssetPath.prefab[2]);
  7827. for (var i = 0; i < enemyasset.numChildren; i++) {
  7828. var curenemyasset = enemyasset.getChildAt(i);
  7829. curenemyasset.active = false;
  7830. AssetManager.enemy.add(i + 1, curenemyasset);
  7831. }
  7832. Laya.loader.clearRes(AssetPath.prefab[2]);
  7833. var obstacleasset = Laya.loader.getRes(AssetPath.prefab[3]);
  7834. for (var i = 0; i < obstacleasset.numChildren; i++) {
  7835. var curobsasset = obstacleasset.getChildAt(i);
  7836. curobsasset.active = false;
  7837. AssetManager.obstacle.add(i + 1, curobsasset);
  7838. }
  7839. Laya.loader.clearRes(AssetPath.prefab[3]);
  7840. var bulletasset = Laya.loader.getRes(AssetPath.prefab[4]);
  7841. for (var i = 0; i < bulletasset.numChildren; i++) {
  7842. var curbullet = bulletasset.getChildAt(i);
  7843. curbullet.active = false;
  7844. AssetManager.bullet.add(i + 1, curbullet);
  7845. }
  7846. Laya.loader.clearRes(AssetPath.prefab[4]);
  7847. var effectasset = Laya.loader.getRes(AssetPath.prefab[5]);
  7848. for (var i = 0; i < effectasset.numChildren; i++) {
  7849. var cureffect = effectasset.getChildAt(i);
  7850. cureffect.active = false;
  7851. AssetManager.effect.add(i + 1, cureffect);
  7852. }
  7853. Laya.loader.clearRes(AssetPath.prefab[5]);
  7854. var standasset = Laya.loader.getRes(AssetPath.prefab[6]);
  7855. for (var i = 0; i < standasset.numChildren; i++) {
  7856. var curstand = standasset.getChildAt(i);
  7857. curstand.active = false;
  7858. AssetManager.standbuild.add(i + 1, curstand);
  7859. }
  7860. Laya.loader.clearRes(AssetPath.prefab[6]);
  7861. var roadasset = Laya.loader.getRes(AssetPath.prefab[7]);
  7862. for (var i = 0; i < roadasset.numChildren; i++) {
  7863. var curroad = roadasset.getChildAt(i);
  7864. curroad.active = false;
  7865. AssetManager.road.add(i + 1, curroad);
  7866. }
  7867. Laya.loader.clearRes(AssetPath.prefab[7]);
  7868. var weaponasset = Laya.loader.getRes(AssetPath.prefab[8]);
  7869. for (var i = 0; i < weaponasset.numChildren; i++) {
  7870. var curweapon = weaponasset.getChildAt(i);
  7871. curweapon.active = false;
  7872. AssetManager.weapon.add(i + 1, curweapon);
  7873. }
  7874. Laya.loader.clearRes(AssetPath.prefab[8]);
  7875. var twasset = Laya.loader.getRes(AssetPath.prefab[9]);
  7876. for (var i = 0; i < twasset.numChildren; i++) {
  7877. var curtw = twasset.getChildAt(i);
  7878. curtw.active = false;
  7879. AssetManager.tw.add(i + 1, curtw);
  7880. }
  7881. Laya.loader.clearRes(AssetPath.prefab[9]);
  7882. var handasset = Laya.loader.getRes(AssetPath.prefab[10]);
  7883. handasset.active = false;
  7884. AssetManager.hand = handasset;
  7885. Laya.loader.clearRes(AssetPath.prefab[10]);
  7886. console.log("游戏资源加载完成...");
  7887. this.CompleteProgress();
  7888. }));
  7889. }
  7890. LoadEnd() {
  7891. console.log("加载完成...");
  7892. this.ProgressTween.clear();
  7893. new SceneManager(this.mainscene);
  7894. }
  7895. OnHomeInit() {
  7896. EventManager.Off(EventType.LevelCreateComplete, this, this.OnHomeInit);
  7897. this.Hide();
  7898. }
  7899. TweenProgress(_start, _end, _duration, _complete = null) {
  7900. if (this.ProgressTween)
  7901. this.ProgressTween.clear();
  7902. this.prenum = new Laya.Vector2(_start, 0);
  7903. this.ProgressTween = Tween.to(this.prenum, { x: _end, update: new Laya.Handler(this, () => {
  7904. this.preclip.value = Math.floor(this.prenum.x).toString();
  7905. }) }, _duration * 1000, null, Laya.Handler.create(this, _complete), null, true, true);
  7906. }
  7907. }
  7908. class Main {
  7909. constructor() {
  7910. if (window["Laya3D"])
  7911. Laya3D.init(GameConfig.width, GameConfig.height);
  7912. else
  7913. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  7914. Laya["Physics"] && Laya["Physics"].enable();
  7915. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  7916. Laya.stage.scaleMode = GameConfig.scaleMode;
  7917. Laya.stage.screenMode = GameConfig.screenMode;
  7918. Laya.stage.alignV = GameConfig.alignV;
  7919. Laya.stage.alignH = GameConfig.alignH;
  7920. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  7921. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  7922. Laya.enableDebugPanel();
  7923. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  7924. Laya["PhysicsDebugDraw"].enable();
  7925. if (GameConfig.stat)
  7926. Laya.Stat.show();
  7927. console.log("Ver", VerCheck.mVer);
  7928. if (!Laya.Browser.onPC) {
  7929. VerCheck.WX = true;
  7930. }
  7931. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  7932. }
  7933. onVersionLoaded() {
  7934. Laya.AtlasInfoManager.enable("fileconfig.json", Laya.Handler.create(this, this.onConfigLoaded));
  7935. }
  7936. onConfigLoaded() {
  7937. new LoadWindow();
  7938. }
  7939. }
  7940. new Main();
  7941. }());
  7942. //# sourceMappingURL=bundle.js.map