bundle.js 433 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989
  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/HomeWindow.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": { "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 }] }, { "type": "Box", "props": { "y": -334, "x": 0, "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 }] }] }], "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/gaungdi.png", "bg/Rays.png", "bg/qiriqd-2.png", "bg/guangi.png", "bg/qiriqd.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. console.log("newnewnewnewnew");
  1080. console.log(">>>>>>>>>>>>>>>>Ad000000000000000");
  1081. if (!Laya.Browser.window.conch)
  1082. return;
  1083. console.log(">>>>>>>>>>>>>>>>Ad111111111111111111");
  1084. ADHelper.Conch = Laya.Browser.window.conch;
  1085. ADHelper.PlatformClass = Laya.Browser.window.PlatformClass;
  1086. ADHelper.IsAndroid = ADHelper.Conch.config.getOS() == "Conch-android";
  1087. if (ADHelper.IsAndroid) {
  1088. console.log(">>>>>>>>>>>>>>>>Ad222222222222222");
  1089. ADHelper.JavaClassAdHelper = ADHelper.PlatformClass.createClass("ad.AdHelper");
  1090. ADHelper.JavaClassAdHelper.callWithBack((isOk) => {
  1091. console.log(">>>>>>>>>>>>>>>>Ad");
  1092. console.log(isOk);
  1093. ADHelper.IsReady = true;
  1094. console.log("[LOG]Java_initAd ok");
  1095. }, "initAd");
  1096. }
  1097. }
  1098. static showVideoAd(callback) {
  1099. if (ADHelper.IsAndroid) {
  1100. console.log(">>>>>>>>>>>>>>>>Ad");
  1101. console.log(ADHelper.JavaClassAdHelper);
  1102. ADHelper.JavaClassAdHelper.callWithBack(isOk => {
  1103. console.log(">>>>>>>>>>>>>");
  1104. console.log(isOk);
  1105. console.log("[LOG]Java_shwoVideoAd callback enter", isOk);
  1106. callback && callback(isOk);
  1107. }, "showVideoAd");
  1108. }
  1109. else {
  1110. callback && callback(true);
  1111. }
  1112. }
  1113. static showBanner() {
  1114. if (ADHelper.IsAndroid) {
  1115. ADHelper.IsBannerVisible = true;
  1116. ADHelper.JavaClassAdHelper.callWithBack(() => {
  1117. if (!ADHelper.IsBannerVisible) {
  1118. ADHelper.hideBanner();
  1119. }
  1120. }, "showBanner");
  1121. }
  1122. }
  1123. static hideBanner() {
  1124. if (ADHelper.IsAndroid) {
  1125. ADHelper.IsBannerVisible = false;
  1126. ADHelper.JavaClassAdHelper.call("hideBanner");
  1127. }
  1128. }
  1129. }
  1130. ADHelper.IsReady = false;
  1131. ADHelper.IsBannerVisible = false;
  1132. var Vector2 = Laya.Vector2;
  1133. var attacktype;
  1134. (function (attacktype) {
  1135. attacktype[attacktype["one"] = 0] = "one";
  1136. attacktype[attacktype["two"] = 1] = "two";
  1137. attacktype[attacktype["three"] = 2] = "three";
  1138. })(attacktype || (attacktype = {}));
  1139. class InGameWindow extends ui.Window.InGameWindowUI {
  1140. constructor() {
  1141. super();
  1142. this.skindatas = [];
  1143. this.enter = false;
  1144. this.path = [];
  1145. this.points = [];
  1146. InGameWindow.instance = this;
  1147. }
  1148. static get Instance() {
  1149. return InGameWindow.instance;
  1150. }
  1151. InitSize() {
  1152. this.height = Laya.stage.height;
  1153. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  1154. this.drawbany = Laya.stage.height - InGameWindow.Instance.drawpan.height + InGameWindow.Instance.drawban.y;
  1155. }
  1156. OnOpen(_win = false) {
  1157. this.skindatas = this.GetSkinDatas(skintype.weapon);
  1158. this.InitSize();
  1159. this.RegButton();
  1160. TtSdk.RecordEvent("enterGame");
  1161. }
  1162. RegButton() {
  1163. this.onebtn.clickHandler = Laya.Handler.create(this, this.OnClickOne, null, false);
  1164. this.twobtn.clickHandler = Laya.Handler.create(this, this.OnClickTwo, null, false);
  1165. this.threebtn.clickHandler = Laya.Handler.create(this, this.OnClickThree, null, false);
  1166. EventManager.InputOn(TouchState.down, this, this.OnDown);
  1167. EventManager.InputOn(TouchState.up, this, this.OnUp);
  1168. EventManager.InputOn(TouchState.slidermove, this, this.OnSlider);
  1169. this.OnClickOne();
  1170. }
  1171. OnClickOne() {
  1172. if (this.curattacktype == attacktype.one)
  1173. return;
  1174. this.skinlist.visible = true;
  1175. this.SetBtnShow(attacktype.one);
  1176. this.ShowWeaponList();
  1177. if (this.drawbg) {
  1178. this.drawbg.removeSelf();
  1179. this.drawbg.destroy();
  1180. this.drawbg = null;
  1181. }
  1182. this.drawtip.visible = false;
  1183. Player.mainpalyer.ShowWeapon(true);
  1184. }
  1185. OnClickTwo() {
  1186. if (this.curattacktype == attacktype.two)
  1187. return;
  1188. this.skinlist.visible = false;
  1189. this.SetBtnShow(attacktype.two);
  1190. if (this.drawbg) {
  1191. this.drawbg.removeSelf();
  1192. this.drawbg.destroy();
  1193. this.drawbg = null;
  1194. }
  1195. this.drawtip.visible = true;
  1196. }
  1197. OnClickThree() {
  1198. if (this.curattacktype == attacktype.three)
  1199. return;
  1200. this.skinlist.visible = false;
  1201. this.SetBtnShow(attacktype.three);
  1202. if (this.drawbg) {
  1203. this.drawbg.removeSelf();
  1204. this.drawbg.destroy();
  1205. this.drawbg = null;
  1206. }
  1207. this.drawtip.visible = true;
  1208. }
  1209. ShowWeaponList() {
  1210. this.skinlist.vScrollBarSkin = "";
  1211. this.skinlist.array = this.skindatas;
  1212. this.skinlist.renderHandler = Laya.Handler.create(this, this.OnRender, null, false);
  1213. }
  1214. OnRender(_cell) {
  1215. var data = _cell.dataSource;
  1216. var selected = _cell.getChildAt(1);
  1217. selected.visible = false;
  1218. var icon = _cell.getChildAt(2);
  1219. var state = _cell.getChildAt(3);
  1220. var geted = _cell.getChildAt(4);
  1221. icon.skin = "icon/" + data.skinicon + ".png";
  1222. this.SetGetBtn(state, data);
  1223. if (data.curskinstate == skinstate.getnoues) {
  1224. geted.clickHandler = Laya.Handler.create(this, this.OnUseSkin, [data], false);
  1225. }
  1226. else if (data.curskinstate == skinstate.lock) {
  1227. geted.clickHandler = Laya.Handler.create(this, this.OnVideoGet, [data], false);
  1228. }
  1229. else if (data.curskinstate == skinstate.useing) {
  1230. selected.visible = true;
  1231. }
  1232. }
  1233. OnHide() {
  1234. if (this.drawbg) {
  1235. this.drawbg.removeSelf();
  1236. this.drawbg.destroy();
  1237. this.drawbg = null;
  1238. }
  1239. EventManager.InputOff(TouchState.down, this, this.OnDown);
  1240. EventManager.InputOff(TouchState.up, this, this.OnUp);
  1241. EventManager.InputOff(TouchState.slidermove, this, this.OnSlider);
  1242. }
  1243. OnUseSkin(_data) {
  1244. if (this.wearskin == _data)
  1245. return;
  1246. this.WearSkin(_data);
  1247. }
  1248. OnVideoGet(_data) {
  1249. if (ADHelper.IsAndroid) {
  1250. ADHelper.showVideoAd((flag) => {
  1251. if (flag) {
  1252. this.OnUseSkin(_data);
  1253. }
  1254. });
  1255. }
  1256. }
  1257. WearSkin(_skin) {
  1258. console.log("wear:", _skin.skinid);
  1259. _skin.curskinstate = skinstate.useing;
  1260. EventManager.Trigger(EventType.UseSkin, [_skin]);
  1261. for (var i = 0; i < this.skindatas.length; i++) {
  1262. var mskin = this.skindatas[i];
  1263. if (mskin != _skin && mskin.curskinstate == skinstate.useing) {
  1264. mskin.curskinstate = skinstate.getnoues;
  1265. }
  1266. }
  1267. this.ShowWeaponList();
  1268. }
  1269. SetGetBtn(_btn, _data) {
  1270. var getuseing = _btn.getChildAt(1);
  1271. getuseing.visible = _data.curskinstate == skinstate.useing;
  1272. var getuse = _btn.getChildAt(2);
  1273. getuse.visible = _data.curskinstate == skinstate.getnoues;
  1274. var getvideo = _btn.getChildAt(3);
  1275. getvideo.visible = false;
  1276. if (_data.curskinstate == skinstate.lock) {
  1277. getvideo.visible = true;
  1278. }
  1279. }
  1280. SetBtnShow(_skintype) {
  1281. this.curattacktype = _skintype;
  1282. for (var i = 0; i < this.attackbox.numChildren; i++) {
  1283. var skin = this.attackbox.getChildAt(i);
  1284. var openskin = skin.getChildAt(0);
  1285. if (i == _skintype) {
  1286. openskin.visible = true;
  1287. }
  1288. else {
  1289. openskin.visible = false;
  1290. }
  1291. }
  1292. }
  1293. GetSkinDatas(_skintype) {
  1294. var skins = PlayerAccount.CurAccountData.m_skinDic.values;
  1295. var gets = [];
  1296. var locks = [];
  1297. for (var i = 0; i < skins.length; i++) {
  1298. var curskin = skins[i];
  1299. if (curskin.skintype != _skintype)
  1300. continue;
  1301. if (curskin.curskinstate != skinstate.lock) {
  1302. gets.push(curskin);
  1303. }
  1304. else {
  1305. locks.push(curskin);
  1306. }
  1307. }
  1308. return gets.concat(locks);
  1309. }
  1310. OnDown() {
  1311. if (this.curattacktype == attacktype.one)
  1312. return;
  1313. this.startpoint = new Vector2(this.drawban.mouseX, this.drawban.mouseY);
  1314. if (this.drawban.mouseY < 50) {
  1315. return;
  1316. }
  1317. if (this.drawban.mouseY > this.drawban.height) {
  1318. return;
  1319. }
  1320. if (this.drawban.mouseX < 0) {
  1321. return;
  1322. }
  1323. if (this.drawban.mouseX > this.drawban.width) {
  1324. return;
  1325. }
  1326. this.enter = true;
  1327. if (this.drawbg) {
  1328. this.drawbg.removeSelf();
  1329. this.drawbg.destroy();
  1330. this.drawbg = null;
  1331. }
  1332. this.drawbg = new Laya.Sprite();
  1333. this.drawbg.width = this.drawban.width;
  1334. this.drawbg.height = this.drawban.height;
  1335. this.drawbg.pos(this.drawban.x, this.drawban.y);
  1336. this.drawpan.addChild(this.drawbg);
  1337. this.points = [];
  1338. this.path = [];
  1339. }
  1340. OnUp() {
  1341. if (this.curattacktype == attacktype.one)
  1342. return;
  1343. if (this.drawbg) {
  1344. this.drawbg.graphics.clear();
  1345. this.drawbg.removeSelf();
  1346. this.drawbg.destroy();
  1347. this.drawbg = null;
  1348. }
  1349. if (this.drawban.mouseY < 50) {
  1350. return;
  1351. }
  1352. if (this.drawban.mouseY > this.drawban.height) {
  1353. return;
  1354. }
  1355. if (this.drawban.mouseX < 0) {
  1356. return;
  1357. }
  1358. if (this.drawban.mouseX > this.drawban.width) {
  1359. return;
  1360. }
  1361. this.enter = false;
  1362. if (this.path.length > 4) {
  1363. if (this.curattacktype == attacktype.two) {
  1364. EventManager.Trigger(EventType.DrawEnd, [this.path, true]);
  1365. }
  1366. else {
  1367. EventManager.Trigger(EventType.DrawEnd, [this.path, false]);
  1368. }
  1369. }
  1370. }
  1371. static get caninput() {
  1372. if (InGameWindow.Instance.drawban.mouseY > 50) {
  1373. return false;
  1374. }
  1375. else {
  1376. return true;
  1377. }
  1378. }
  1379. OnSlider() {
  1380. if (!this.enter)
  1381. return;
  1382. if (this.curattacktype == attacktype.one)
  1383. return;
  1384. this.curscreenpos = new Vector2(this.drawban.mouseX, this.drawban.mouseY);
  1385. if (this.startpoint == null) {
  1386. this.startpoint = this.curscreenpos.clone();
  1387. }
  1388. if (this.varpoint == null) {
  1389. this.varpoint = this.curscreenpos.clone();
  1390. }
  1391. if (this.drawban.mouseY < 50) {
  1392. this.curscreenpos = new Vector2(this.curscreenpos.x, 50);
  1393. }
  1394. if (this.drawban.mouseY > this.drawban.height) {
  1395. this.curscreenpos = new Vector2(this.curscreenpos.x, this.drawban.height);
  1396. }
  1397. if (this.drawban.mouseX < 0) {
  1398. this.curscreenpos = new Vector2(0, this.curscreenpos.y);
  1399. }
  1400. if (this.drawban.mouseX > this.drawban.width) {
  1401. this.curscreenpos = new Vector2(this.drawban.width, this.curscreenpos.y);
  1402. }
  1403. var curoffestx = this.curscreenpos.x - this.startpoint.x;
  1404. var curoffesty = this.curscreenpos.y - this.startpoint.y;
  1405. var dis = GameUtils.Vector2Length(this.varpoint, this.curscreenpos);
  1406. if (dis > 5) {
  1407. if (this.curattacktype == attacktype.two) {
  1408. this.path.push(new Laya.Vector3(curoffesty, Math.abs(curoffestx), 0));
  1409. }
  1410. else {
  1411. this.path.push(new Laya.Vector3(Math.abs(curoffestx), 0, curoffesty));
  1412. }
  1413. this.varpoint = this.curscreenpos;
  1414. }
  1415. this.points.push(curoffestx);
  1416. this.points.push(curoffesty);
  1417. if (this.drawbg) {
  1418. this.drawbg.graphics.clear();
  1419. this.curline = this.drawbg.graphics.drawLines(this.startpoint.x, this.startpoint.y, this.points, "#211f1e", 10);
  1420. }
  1421. }
  1422. }
  1423. var Vector3$3 = Laya.Vector3;
  1424. class CameraManager extends Laya.Script3D {
  1425. constructor() {
  1426. super();
  1427. this.follow = false;
  1428. this.offest = new Vector3$3();
  1429. this.followrate = 0.25;
  1430. this.curcamerapos = new Vector3$3();
  1431. this.curstarpos = new Vector3$3();
  1432. CameraManager.instance = this;
  1433. }
  1434. static get Instance() {
  1435. return CameraManager.instance;
  1436. }
  1437. SetFollow(_target) {
  1438. if (!this.m_cameranode) {
  1439. this.m_cameranode = SceneManager.maincamera;
  1440. }
  1441. this.follow = true;
  1442. this.FollowTarget = _target;
  1443. Vector3$3.subtract(_target.transform.position, this.m_cameranode.transform.position, this.offest);
  1444. }
  1445. SetOffest(_targetpos, _target) {
  1446. this.FollowTarget = _target;
  1447. Vector3$3.subtract(_target.transform.position, _targetpos, this.offest);
  1448. }
  1449. ResetTarget(_target) {
  1450. this.FollowTarget = _target;
  1451. this.follow = true;
  1452. }
  1453. StopFollow() {
  1454. this.follow = false;
  1455. this.FollowTarget = null;
  1456. }
  1457. onUpdate() {
  1458. if (this.follow && this.FollowTarget) {
  1459. Vector3$3.subtract(this.FollowTarget.transform.position, this.offest, this.curcamerapos);
  1460. var curposz = this.curcamerapos.z;
  1461. Vector3$3.lerp(SceneManager.maincamera.transform.position, this.curcamerapos, this.followrate, this.curcamerapos);
  1462. this.curcamerapos = new Vector3$3(this.curcamerapos.x, this.curcamerapos.y, curposz);
  1463. SceneManager.maincamera.transform.position = new Vector3$3(this.curcamerapos.x, this.curcamerapos.y, this.curcamerapos.z);
  1464. }
  1465. }
  1466. }
  1467. class WeaponTrigger extends Laya.Script3D {
  1468. onAwake() {
  1469. this.mainplayer = Player.mainpalyer;
  1470. }
  1471. onTriggerEnter(other) {
  1472. if (this.mainplayer.currolestate != RoleState.Runing)
  1473. return;
  1474. if (this.cantrigger(other)) {
  1475. EventManager.Trigger(EventType.Cut, [other]);
  1476. }
  1477. }
  1478. cantrigger(_collider) {
  1479. if (GameManager.Instance.curgamestate != GameState.Playing)
  1480. return;
  1481. if (_collider.collisionGroup == ColliderLay.monster) {
  1482. return true;
  1483. }
  1484. else if (_collider.collisionGroup == ColliderLay.bullet) {
  1485. return true;
  1486. }
  1487. else if (_collider.collisionGroup == ColliderLay.obstacle || _collider.collisionGroup == ColliderLay.grass) {
  1488. return true;
  1489. }
  1490. }
  1491. }
  1492. var Vector3$4 = Laya.Vector3;
  1493. class InputManager {
  1494. constructor() {
  1495. this.curtouthstate = TouchState.none;
  1496. this.touchPos = new Vector3$4();
  1497. this.curMousePos = new Vector3$4(0, 0, 0);
  1498. this.sliderawakesize = 5;
  1499. this.curdir = new Vector3$4();
  1500. this.curtouchpos = new Vector3$4();
  1501. InputManager.instance = this;
  1502. this.Init();
  1503. }
  1504. static get Instance() {
  1505. return InputManager.instance;
  1506. }
  1507. Init() {
  1508. Laya.stage.on(Laya.Event.MOUSE_DOWN, this, this.TouchEnter);
  1509. Laya.stage.on(Laya.Event.MOUSE_UP, this, this.OnTouchOut);
  1510. Laya.stage.on(Laya.Event.MOUSE_OUT, this, this.OnTouchOut);
  1511. Laya.stage.on(Laya.Event.MOUSE_MOVE, this, this.OnSliderMove);
  1512. EventManager.GameOn(GameState.Ready, this, this.OnGameReady);
  1513. EventManager.GameOn(GameState.Playing, this, this.OnGamePlaying);
  1514. EventManager.GameOn(GameState.Resurrection, this, this.OnGameResurrection);
  1515. EventManager.GameOn(GameState.Lose, this, this.OnGameLose);
  1516. EventManager.GameOn(GameState.Win, this, this.OnGameWin);
  1517. }
  1518. OnGameReady() {
  1519. Laya.timer.clear(this, this.OnTouchMove);
  1520. this.curtouthstate = TouchState.down;
  1521. InputManager.caninput = true;
  1522. }
  1523. OnGamePlaying() {
  1524. InputManager.caninput = true;
  1525. }
  1526. OnGameResurrection() {
  1527. Laya.timer.clear(this, this.OnTouchMove);
  1528. this.curtouthstate = TouchState.down;
  1529. InputManager.caninput = false;
  1530. }
  1531. OnGameLose() {
  1532. Laya.timer.clear(this, this.OnTouchMove);
  1533. this.curtouthstate = TouchState.down;
  1534. InputManager.caninput = false;
  1535. }
  1536. OnGameWin() {
  1537. Laya.timer.clear(this, this.OnTouchMove);
  1538. this.curtouthstate = TouchState.down;
  1539. InputManager.caninput = false;
  1540. }
  1541. TouchEnter(e) {
  1542. this.curtouthstate = TouchState.down;
  1543. EventManager.Trigger(EventType.InputState, [this.curtouthstate]);
  1544. if (!InputManager.caninput)
  1545. return;
  1546. this.curtouchpos = new Laya.Vector3(Laya.MouseManager.instance.mouseX, Laya.MouseManager.instance.mouseY, 0);
  1547. Laya.timer.clear(this, this.OnTouchMove);
  1548. EventManager.InputTrigger(TouchState.down, [this.curMousePos]);
  1549. Laya.timer.frameLoop(1, this, this.OnTouchMove);
  1550. }
  1551. OnTouchOut() {
  1552. this.curtouthstate = TouchState.up;
  1553. EventManager.Trigger(EventType.InputState, [this.curtouthstate]);
  1554. if (!InputManager.caninput)
  1555. return;
  1556. Laya.timer.clear(this, this.OnTouchMove);
  1557. EventManager.InputTrigger(TouchState.up);
  1558. }
  1559. OnTouchMove() {
  1560. this.curtouthstate = TouchState.slider;
  1561. EventManager.Trigger(EventType.InputState, [this.curtouthstate]);
  1562. if (!InputManager.caninput)
  1563. return;
  1564. this.curMousePos = new Laya.Vector3(Laya.MouseManager.instance.mouseX, Laya.MouseManager.instance.mouseY, 0);
  1565. var distance = Vector3$4.distance(this.curtouchpos, this.curMousePos);
  1566. if (distance > this.sliderawakesize) {
  1567. Vector3$4.subtract(this.curtouchpos, this.curMousePos, this.curdir);
  1568. Vector3$4.normalize(this.curdir, this.curdir);
  1569. EventManager.InputTrigger(TouchState.slider, [new Vector3$4(this.curdir.x, 0, this.curdir.y)]);
  1570. }
  1571. }
  1572. OnSliderMove() {
  1573. if (!InputManager.caninput)
  1574. return;
  1575. EventManager.InputTrigger(TouchState.slidermove);
  1576. }
  1577. }
  1578. InputManager.caninput = false;
  1579. var VoiceType;
  1580. (function (VoiceType) {
  1581. VoiceType[VoiceType["boom"] = 0] = "boom";
  1582. VoiceType[VoiceType["cut"] = 1] = "cut";
  1583. VoiceType[VoiceType["cutgrass"] = 2] = "cutgrass";
  1584. VoiceType[VoiceType["lose"] = 3] = "lose";
  1585. VoiceType[VoiceType["win"] = 4] = "win";
  1586. })(VoiceType || (VoiceType = {}));
  1587. var BgmType;
  1588. (function (BgmType) {
  1589. BgmType[BgmType["bgm"] = 0] = "bgm";
  1590. })(BgmType || (BgmType = {}));
  1591. class AudioControl {
  1592. static voiceres(_type) {
  1593. return "subpackage/res/sound/" + VoiceType[_type] + ".wav";
  1594. }
  1595. static PlayVoice(_type, _loop = false) {
  1596. if (!this.play)
  1597. return;
  1598. var loop = _loop ? 0 : 1;
  1599. Laya.SoundManager.playSound(this.voiceres(_type), loop);
  1600. }
  1601. static ClearAudio() {
  1602. Laya.SoundManager.stopAllSound();
  1603. }
  1604. static bgmres(_type) {
  1605. return "subpackage/res/sound/" + BgmType[_type] + ".mp3";
  1606. }
  1607. static PlayBgm(_type, _loop = true) {
  1608. if (!this.play)
  1609. return;
  1610. var loop = _loop ? 0 : 1;
  1611. Laya.SoundManager.playMusic(this.bgmres(_type), loop);
  1612. }
  1613. static ClearBgm() {
  1614. Laya.SoundManager.stopMusic();
  1615. }
  1616. }
  1617. AudioControl.play = true;
  1618. var Vector3$5 = Laya.Vector3;
  1619. var Vector4 = Laya.Vector4;
  1620. class PlayerData extends RoleData {
  1621. constructor(_id, _startpos) {
  1622. super(_id, _startpos);
  1623. }
  1624. }
  1625. class Player extends Role {
  1626. constructor() {
  1627. super(...arguments);
  1628. this.onland = true;
  1629. this.runpoint = [];
  1630. this.allfall = false;
  1631. this.allstand = false;
  1632. this.hands = [];
  1633. this.movespeed = 1.25;
  1634. this.curpos = new Vector3$5();
  1635. this.currot = new Laya.Quaternion();
  1636. this.landhit = new Laya.HitResult();
  1637. this.forwardhit = new Laya.HitResult();
  1638. this.playfall = false;
  1639. this.canfowardmove = true;
  1640. this.landg = 0;
  1641. this.falltime = 0;
  1642. this.standtime = -2;
  1643. this.startcamerapos = new Vector3$5();
  1644. this.startcamerarot = new Laya.Quaternion();
  1645. this.find = false;
  1646. }
  1647. static Create(_data, _roleskin) {
  1648. var roleid = _roleskin.skinid;
  1649. var curid = roleid <= 6 ? roleid : roleid - 12;
  1650. var roleasset = AssetManager.role.getValue(curid);
  1651. if (roleasset == null)
  1652. roleasset = AssetManager.role.getValue(1);
  1653. var model = PoolManager.GetSprite3D(roleasset);
  1654. SceneManager.mainscene.addChild(model);
  1655. model.transform.position = new Vector3$5(_data.startpos.x, _data.startpos.y + 0.2, _data.startpos.z);
  1656. model.transform.rotationEuler = new Vector3$5(model.transform.rotationEuler.x, 360 - _data.startpos.w, model.transform.rotationEuler.z);
  1657. var mainrole = model.addComponent(Player);
  1658. Player.mainpalyer = mainrole;
  1659. var mneck;
  1660. if (curid == 1 || curid == 7 || curid == 10) {
  1661. mneck = model.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(2).getChildAt(0);
  1662. }
  1663. else {
  1664. mneck = model.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(2).getChildAt(0).getChildAt(0);
  1665. }
  1666. mainrole.lefthandpoint = mneck.getChildAt(1).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0);
  1667. mainrole.righthandpoint = mneck.getChildAt(2).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0);
  1668. mainrole.WeaponShow();
  1669. mainrole.jseffect = PoolManager.GetSprite3D(AssetManager.effect.getValue(3));
  1670. model.addChild(mainrole.jseffect);
  1671. mainrole.jseffect.transform.localPosition = new Vector3$5(0, 0, 0);
  1672. mainrole.jseffect.active = false;
  1673. mainrole.mcollider = model.getChildAt(1).getComponent(Laya.PhysicsCollider);
  1674. mainrole.mcollider.collisionGroup = ColliderLay.player;
  1675. mainrole.handmaterial = new Laya.BlinnPhongMaterial;
  1676. mainrole.handmaterial.albedoColor = new Vector4(0, 0, 0);
  1677. mainrole.Init(model);
  1678. mainrole.OnInit();
  1679. return mainrole;
  1680. }
  1681. OnInit() {
  1682. this.mlevel = LevelManager.Instance.curlevel;
  1683. this.movespeed = this.mlevel.leveldata.missiondata.move;
  1684. this.RegEvent();
  1685. CameraManager.Instance.SetFollow(this.cursprite);
  1686. Laya.timer.frameLoop(1, this, this.OnLifeLoop);
  1687. this.runpoint.push(this.cursprite.transform.position.clone());
  1688. }
  1689. OnClear() {
  1690. this.ClearDraws();
  1691. EventManager.Off(EventType.DrawEnd, this, this.PathToCurve);
  1692. this.curlweapontrigger.destroy();
  1693. this.currweapontrigger.destroy();
  1694. PoolManager.RecoverSprite3D(this.curlweapon, true);
  1695. PoolManager.RecoverSprite3D(this.currweapon, true);
  1696. PoolManager.RecoverSprite3D(this.jseffect, true);
  1697. this.curlweaponeffect.destroy();
  1698. this.currweaponeffect.destroy();
  1699. if (this.wineffect)
  1700. PoolManager.RecoverSprite3D(this.wineffect);
  1701. EventManager.InputOff(TouchState.slider, this, this.OnSlider);
  1702. EventManager.InputOff(TouchState.up, this, this.OnUp);
  1703. EventManager.Off(EventType.Hit, this, this.OnHit);
  1704. EventManager.GameOff(GameState.Playing, this, this.OnGamePlaying);
  1705. Laya.timer.clear(this, this.OnLifeLoop);
  1706. this.runpoint = [];
  1707. }
  1708. ClearDraws() {
  1709. Laya.timer.clear(this, this.OnRotWeapon);
  1710. this.ClearHands();
  1711. if (this.currweaponrig != null) {
  1712. this.currweaponrig.destroy();
  1713. this.currdrawweaponcheck.destroy();
  1714. this.currweaponrig = null;
  1715. }
  1716. if (this.curlweaponrig != null) {
  1717. this.curlweaponrig.destroy();
  1718. this.curldrawweaponcheck.destroy();
  1719. this.curlweaponrig = null;
  1720. }
  1721. if (this.drawlweapon != null) {
  1722. this.drawlweapon.destroy();
  1723. this.drawlweapon = null;
  1724. }
  1725. if (this.drawrweapon != null) {
  1726. this.drawrweapon.destroy();
  1727. this.drawrweapon = null;
  1728. }
  1729. }
  1730. ShowWeapon(_active) {
  1731. this.curlweapon.active = _active;
  1732. this.currweapon.active = _active;
  1733. this.ClearDraws();
  1734. }
  1735. RegEvent() {
  1736. EventManager.InputOn(TouchState.slider, this, this.OnSlider);
  1737. EventManager.InputOn(TouchState.up, this, this.OnUp);
  1738. EventManager.On(EventType.Hit, this, this.OnHit);
  1739. EventManager.GameOn(GameState.Playing, this, this.OnGamePlaying);
  1740. EventManager.On(EventType.DrawEnd, this, this.PathToCurve);
  1741. }
  1742. OnGamePlaying() {
  1743. }
  1744. onStateChange(_state, _data) {
  1745. this.standtime = 0;
  1746. if (_state == RoleState.Die) {
  1747. this.OnEnterDie();
  1748. }
  1749. else if (_state == RoleState.Runing) {
  1750. this.OnEnterRunning();
  1751. }
  1752. else if (_state == RoleState.Idle) {
  1753. this.OnEnterIdle();
  1754. }
  1755. else if (_state == RoleState.Attack) {
  1756. this.OnEnterAttack(_data);
  1757. }
  1758. else if (_state == RoleState.Win) {
  1759. this.OnEnterWin();
  1760. }
  1761. }
  1762. ClearHands() {
  1763. for (var i = 0; i < this.hands.length; i++) {
  1764. var mhand = this.hands[i];
  1765. PoolManager.RecoverSprite3D(mhand);
  1766. }
  1767. this.hands = [];
  1768. }
  1769. PathToCurve(_path, one) {
  1770. this.curlweapon.active = false;
  1771. this.currweapon.active = false;
  1772. this.ClearDraws();
  1773. var lefthands = [];
  1774. var righthands = [];
  1775. this.drawlweapon = new Laya.Sprite3D();
  1776. SceneManager.mainscene.addChild(this.drawlweapon);
  1777. this.drawlweapon.transform.rotationEuler = new Vector3$5(0, 0, 0);
  1778. this.drawlweapon.transform.position = new Vector3$5(0, 0, 0);
  1779. this.drawrweapon = new Laya.Sprite3D();
  1780. SceneManager.mainscene.addChild(this.drawrweapon);
  1781. this.drawrweapon.transform.rotationEuler = new Vector3$5(0, 0, 0);
  1782. this.drawrweapon.transform.position = new Vector3$5(0, 0, 0);
  1783. this.curlweaponrig = this.drawlweapon.addComponent(Laya.Rigidbody3D);
  1784. this.comlbincollider = new Laya.CompoundColliderShape();
  1785. this.curlweaponrig.isKinematic = true;
  1786. this.curlweaponrig.colliderShape = this.comlbincollider;
  1787. this.curldrawweaponcheck = this.drawlweapon.addComponent(WeaponTrigger);
  1788. this.currweaponrig = this.drawrweapon.addComponent(Laya.Rigidbody3D);
  1789. this.comrbincollider = new Laya.CompoundColliderShape();
  1790. this.currweaponrig.isKinematic = true;
  1791. this.currweaponrig.colliderShape = this.comrbincollider;
  1792. this.currdrawweaponcheck = this.drawrweapon.addComponent(WeaponTrigger);
  1793. var leftpos = this.drawlweapon.transform.position;
  1794. var rightpos = this.drawrweapon.transform.position;
  1795. for (var i = 0; i < _path.length; i++) {
  1796. var curp = _path[i];
  1797. var curpoint = new Vector3$5(curp.x / 150, curp.y / 150, curp.z / 150);
  1798. var leftpoint = new Vector3$5(leftpos.x + curpoint.x, leftpos.y + curpoint.y, leftpos.z + curpoint.z);
  1799. lefthands.push(leftpoint);
  1800. var rightpoint = new Vector3$5(rightpos.x - curpoint.x, rightpos.y - curpoint.y, rightpos.z - curpoint.z);
  1801. righthands.push(rightpoint);
  1802. }
  1803. var leftcurve = new BezierCurve(lefthands);
  1804. var rightcurve = new BezierCurve(righthands);
  1805. this.CreateHand(leftcurve, rightcurve, one);
  1806. }
  1807. CreateHand(leftcurve, rightcurve, one) {
  1808. var PathLength = GameUtils.PathangleLength(leftcurve.pts);
  1809. var size = Math.floor(PathLength / 0.04);
  1810. for (var i = 0; i < size; i++) {
  1811. var pre = i * 0.02;
  1812. if (pre >= 1)
  1813. break;
  1814. var curpos = leftcurve.Interp(pre);
  1815. if (curpos == null || curpos == undefined) {
  1816. console.log(curpos);
  1817. return;
  1818. }
  1819. if (!one) {
  1820. curpos = new Vector3$5(curpos.x + 1, curpos.y + 1.2, curpos.z);
  1821. }
  1822. var lefthand = PoolManager.GetSprite3D(AssetManager.hand);
  1823. this.drawlweapon.addChild(lefthand);
  1824. this.hands.push(lefthand);
  1825. lefthand.transform.position = curpos;
  1826. lefthand.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  1827. if (pre > 0.9 || i % 20 == 0) {
  1828. var curshape = new Laya.SphereColliderShape(0.125);
  1829. var playerpos = this.drawlweapon.transform.position.clone();
  1830. curshape.localOffset = curpos;
  1831. this.comlbincollider.addChildShape(curshape);
  1832. }
  1833. var lookpos = leftcurve.Interp(pre + 0.01);
  1834. var quaternion1 = new Laya.Quaternion();
  1835. Laya.Quaternion.lookAt(lookpos, lefthand.transform.position, new Vector3$5(0, 0, 1), quaternion1);
  1836. quaternion1.invert(quaternion1);
  1837. lefthand.transform.rotation = quaternion1;
  1838. if (!one) {
  1839. var curpos = rightcurve.Interp(pre);
  1840. curpos = new Vector3$5(curpos.x - 1, curpos.y + 1.2, curpos.z);
  1841. }
  1842. var righthand = PoolManager.GetSprite3D(AssetManager.hand);
  1843. this.drawrweapon.addChild(righthand);
  1844. this.hands.push(righthand);
  1845. righthand.transform.position = curpos;
  1846. righthand.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  1847. if (pre > 0.9 || i % 20 == 0) {
  1848. var curshape = new Laya.SphereColliderShape(0.125);
  1849. var playerpos = this.drawrweapon.transform.position.clone();
  1850. curshape.localOffset = curpos;
  1851. this.comrbincollider.addChildShape(curshape);
  1852. }
  1853. var lookpos = leftcurve.Interp(pre + 0.01);
  1854. var quaternion1 = new Laya.Quaternion();
  1855. Laya.Quaternion.lookAt(lookpos, righthand.transform.position, new Vector3$5(0, 0, 1), quaternion1);
  1856. quaternion1.invert(quaternion1);
  1857. righthand.transform.rotation = quaternion1;
  1858. }
  1859. if (one) {
  1860. this.lefthandpoint.addChild(this.drawlweapon);
  1861. this.drawlweapon.transform.localPosition = new Vector3$5(0, 0, 0);
  1862. this.drawlweapon.transform.localRotationEuler = new Vector3$5(0, 0, 0);
  1863. this.drawlweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  1864. this.righthandpoint.addChild(this.drawrweapon);
  1865. this.drawrweapon.transform.localPosition = new Vector3$5(0, 0, 0);
  1866. this.drawrweapon.transform.localRotationEuler = new Vector3$5(0, 0, 0);
  1867. this.drawrweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  1868. }
  1869. else {
  1870. this.cursprite.addChild(this.drawlweapon);
  1871. this.drawlweapon.transform.localPosition = new Vector3$5(0, 0, 0);
  1872. this.drawlweapon.transform.localRotationEuler = new Vector3$5(0, 0, 0);
  1873. this.drawlweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  1874. this.cursprite.addChild(this.drawrweapon);
  1875. this.drawrweapon.transform.localPosition = new Vector3$5(0, 0, 0);
  1876. this.drawrweapon.transform.localRotationEuler = new Vector3$5(0, 0, 0);
  1877. this.drawrweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  1878. Laya.timer.frameLoop(1, this, this.OnRotWeapon);
  1879. }
  1880. }
  1881. OnRotWeapon() {
  1882. if (this.drawlweapon) {
  1883. this.drawlweapon.transform.rotate(new Vector3$5(0, 0.1, 0));
  1884. }
  1885. if (this.drawrweapon) {
  1886. this.drawrweapon.transform.rotate(new Vector3$5(0, 0.1, 0));
  1887. }
  1888. }
  1889. OnEnterWin() {
  1890. TtSdk.Shake(false);
  1891. this.curanimator.play("dance");
  1892. Laya.timer.clear(this, this.OnLifeLoop);
  1893. this.wineffect = PoolManager.GetSprite3D(AssetManager.effect.getValue(6));
  1894. SceneManager.mainscene.addChild(this.wineffect);
  1895. this.wineffect.transform.position = this.cursprite.transform.position;
  1896. AudioControl.ClearBgm();
  1897. AudioControl.PlayVoice(VoiceType.win);
  1898. Laya.timer.once(2500, this, () => {
  1899. GameManager.Instance.ChangeGameState(GameState.Win);
  1900. });
  1901. }
  1902. OnHit(_monster) {
  1903. if (InputManager.caninput == false)
  1904. return;
  1905. this.ChangeState(RoleState.Die);
  1906. }
  1907. OnEnterAttack(_sprite) {
  1908. }
  1909. OnEnterIdle() {
  1910. if (!this.playfall)
  1911. this.curanimator.play("idle");
  1912. }
  1913. OnEnterRunning() {
  1914. if (!this.playfall)
  1915. this.curanimator.play("run");
  1916. }
  1917. OnEnterDie() {
  1918. TtSdk.Shake(false);
  1919. AudioControl.ClearBgm();
  1920. AudioControl.PlayVoice(VoiceType.lose);
  1921. this.curanimator.play("die");
  1922. CameraManager.Instance.StopFollow();
  1923. Laya.timer.frameOnce(80, this, () => {
  1924. GameManager.Instance.ChangeGameState(GameState.Lose);
  1925. });
  1926. }
  1927. OnEnterLose() {
  1928. }
  1929. OnGameWin(_player) {
  1930. }
  1931. OnSlider(_dir) {
  1932. if (GameManager.Instance.curgamestate != GameState.Playing)
  1933. return;
  1934. if (!InGameWindow.caninput)
  1935. return;
  1936. var rotdir = _dir;
  1937. this.Move(_dir, rotdir);
  1938. }
  1939. get revivepoint() {
  1940. if (this.runpoint.length > 0) {
  1941. return this.runpoint[0];
  1942. }
  1943. var datapos = LevelManager.Instance.curlevel.leveldata.playerdata.startpos;
  1944. return new Vector3$5(datapos.x, datapos.y, datapos.z);
  1945. }
  1946. Revive() {
  1947. this.cursprite.transform.position = this.revivepoint;
  1948. this.end = false;
  1949. this.ChangeState(RoleState.Idle, true);
  1950. CameraManager.Instance.ResetTarget(this.cursprite);
  1951. this.SetWuDi();
  1952. }
  1953. SetWuDi(time = 5000) {
  1954. this.wudi = true;
  1955. Laya.timer.once(time, this, () => {
  1956. this.wudi = false;
  1957. });
  1958. }
  1959. Move(_dir, rotdir) {
  1960. this.ChangeState(RoleState.Runing);
  1961. if (this.currolestate != RoleState.Runing)
  1962. return;
  1963. var curdir = new Vector3$5(-rotdir.x, -rotdir.y, -rotdir.z);
  1964. Laya.Quaternion.rotationLookAt(curdir, new Vector3$5(0, 1, 0), this.currot);
  1965. this.currot.invert(this.currot);
  1966. Laya.Quaternion.slerp(this.cursprite.transform.rotation, this.currot, 0.06, this.currot);
  1967. this.cursprite.transform.rotation = this.currot;
  1968. Vector3$5.add(this.cursprite.transform.position, _dir, this.curpos);
  1969. var addv = 0.1 * this.movespeed;
  1970. Vector3$5.lerp(this.cursprite.transform.position, this.curpos, addv, this.curpos);
  1971. if (this.canfowardmove) {
  1972. this.cursprite.transform.position = this.curpos;
  1973. }
  1974. EventManager.Trigger(EventType.Running, [this.cursprite.transform.position.clone()]);
  1975. }
  1976. OnUp() {
  1977. this.ChangeState(RoleState.Idle);
  1978. }
  1979. WeaponShow(_skin = null) {
  1980. var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[skintype.weapon];
  1981. var equiipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
  1982. equiipskin = _skin == null ? equiipskin : _skin;
  1983. var assetid = equiipskin.skinid - 6;
  1984. if (this.curlweapon != null) {
  1985. PoolManager.RecoverSprite3D(this.curlweapon);
  1986. this.curlweaponeffect.destroy();
  1987. }
  1988. var weaponasset = AssetManager.weapon.getValue(assetid);
  1989. if (weaponasset == null)
  1990. weaponasset = AssetManager.weapon.getValue(1);
  1991. this.curlweapon = PoolManager.GetSprite3D(weaponasset);
  1992. this.curlweapontrigger = this.curlweapon.getChildAt(0).addComponent(WeaponTrigger);
  1993. this.lefthandpoint.addChild(this.curlweapon);
  1994. this.curlweapon.transform.localPosition = new Vector3$5(0, 0, 0);
  1995. this.curlweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  1996. var equiptw = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[skintype.tw];
  1997. var equiptwskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equiptw);
  1998. var twasset = AssetManager.tw.getValue(equiptwskin.skinid - 24);
  1999. this.curlweaponeffect = PoolManager.GetSprite3D(twasset);
  2000. this.curlweapon.addChild(this.curlweaponeffect);
  2001. this.curlweaponeffect.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  2002. this.curlweaponeffect.transform.localPosition = new Vector3$5(0, 1, 0);
  2003. if (this.currweapon != null) {
  2004. PoolManager.RecoverSprite3D(this.currweapon);
  2005. this.currweaponeffect.destroy();
  2006. }
  2007. this.currweapon = PoolManager.GetSprite3D(weaponasset);
  2008. this.currweapontrigger = this.currweapon.getChildAt(0).addComponent(WeaponTrigger);
  2009. this.righthandpoint.addChild(this.currweapon);
  2010. this.currweapon.transform.localPosition = new Vector3$5(0, 0, 0);
  2011. this.currweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  2012. this.currweaponeffect = PoolManager.GetSprite3D(twasset);
  2013. this.currweapon.addChild(this.currweaponeffect);
  2014. this.currweaponeffect.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  2015. this.currweaponeffect.transform.localPosition = new Vector3$5(0, 1, 0);
  2016. }
  2017. TurnWeaponEffect(_skin) {
  2018. var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[skintype.tw];
  2019. var equiipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
  2020. equiipskin = _skin == null ? equiipskin : _skin;
  2021. var assetid = equiipskin.skinid - 24;
  2022. var twasset = AssetManager.tw.getValue(assetid);
  2023. if (this.currweaponeffect)
  2024. PoolManager.RecoverSprite3D(this.currweaponeffect);
  2025. this.currweaponeffect = PoolManager.GetSprite3D(twasset);
  2026. this.currweapon.addChild(this.currweaponeffect);
  2027. this.currweaponeffect.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  2028. this.currweaponeffect.transform.localPosition = new Vector3$5(0, 1, 0);
  2029. if (this.curlweaponeffect)
  2030. PoolManager.RecoverSprite3D(this.curlweaponeffect);
  2031. this.curlweaponeffect = PoolManager.GetSprite3D(twasset);
  2032. this.curlweapon.addChild(this.curlweaponeffect);
  2033. this.curlweaponeffect.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
  2034. this.curlweaponeffect.transform.localPosition = new Vector3$5(0, 1, 0);
  2035. }
  2036. get LandCheck() {
  2037. var hitenter = false;
  2038. var curpos = this.cursprite.transform.position;
  2039. var startpoint = new Vector3$5(curpos.x, curpos.y + 10, curpos.z);
  2040. var dir = new Vector3$5(0, -1, 0);
  2041. var ray = new Laya.Ray(startpoint, dir);
  2042. var landlay = ColliderLay.plane | ColliderLay.end;
  2043. if (SceneManager.mainscene.physicsSimulation.rayCast(ray, this.landhit, 100, 1, landlay)) {
  2044. var hight = startpoint.y - this.landhit.point.y;
  2045. hitenter = true;
  2046. hitenter = (hight > 9 && hight < 11) ? true : false;
  2047. if (this.landhit.collider.collisionGroup == ColliderLay.end) {
  2048. this.ChangeState(RoleState.Win);
  2049. }
  2050. }
  2051. return hitenter;
  2052. }
  2053. get ForwardCheck() {
  2054. var hitenter = true;
  2055. var curpos = this.cursprite.transform.position;
  2056. var startpoint = new Vector3$5(curpos.x, curpos.y + 0.1, curpos.z);
  2057. var dir = new Vector3$5();
  2058. this.cursprite.transform.getForward(dir);
  2059. dir = new Vector3$5(-dir.x, -dir.y, -dir.z);
  2060. var ray = new Laya.Ray(startpoint, dir);
  2061. if (SceneManager.mainscene.physicsSimulation.rayCast(ray, this.forwardhit, 0.5)) {
  2062. if (this.forwardhit.collider.collisionGroup == ColliderLay.obstacle) {
  2063. return false;
  2064. }
  2065. }
  2066. return hitenter;
  2067. }
  2068. OnLifeLoop() {
  2069. if (GameManager.Instance.curgamestate != GameState.Playing)
  2070. return;
  2071. var curland = this.LandCheck;
  2072. if (curland) {
  2073. var mpos = this.cursprite.transform.position;
  2074. if (this.landhit) {
  2075. this.cursprite.transform.position = new Vector3$5(mpos.x, this.landhit.point.y, mpos.z);
  2076. this.runpoint.push(this.cursprite.transform.position.clone());
  2077. if (this.runpoint.length > 50) {
  2078. this.runpoint.splice(0, 1);
  2079. }
  2080. }
  2081. }
  2082. if (!this.onland && curland) {
  2083. this.playfall = false;
  2084. this.jseffect.active = false;
  2085. if (this.currolestate == RoleState.Idle) {
  2086. this.curanimator.play("idle");
  2087. }
  2088. else if (this.currolestate == RoleState.Runing) {
  2089. this.curanimator.play("run");
  2090. }
  2091. this.landg = 0;
  2092. this.falltime = 0;
  2093. }
  2094. this.onland = curland;
  2095. if (!this.onland) {
  2096. if (this.playfall == false) {
  2097. this.playfall = true;
  2098. this.curanimator.play("fall");
  2099. this.jseffect.active = true;
  2100. }
  2101. if (this.landg != 0.1)
  2102. this.landg = GameUtils.lerp(this.landg, 0.1, 0.025);
  2103. var mpos = this.cursprite.transform.position;
  2104. this.cursprite.transform.position = new Vector3$5(mpos.x, mpos.y - this.landg, mpos.z);
  2105. this.falltime += 0.016;
  2106. if (!this.allfall && this.falltime > 5) {
  2107. this.allfall = true;
  2108. }
  2109. this.CheckFallDie();
  2110. }
  2111. this.canfowardmove = this.ForwardCheck;
  2112. if (this.currolestate == RoleState.Idle) {
  2113. this.standtime += 0.016;
  2114. if (!this.allstand && this.standtime > 10) {
  2115. this.allstand = true;
  2116. }
  2117. }
  2118. }
  2119. CheckFallDie() {
  2120. if (this.cursprite.transform.position.y < LevelManager.Instance.curlevel.minhight - 3) {
  2121. this.ChangeState(RoleState.Die);
  2122. }
  2123. }
  2124. FindBoos(_boos) {
  2125. if (this.find)
  2126. return;
  2127. this.find = true;
  2128. InputManager.Instance.OnTouchOut();
  2129. InputManager.caninput = false;
  2130. this.startcamerapos = SceneManager.maincamera.transform.position.clone();
  2131. this.startcamerarot = SceneManager.maincamera.transform.rotation.clone();
  2132. CameraManager.Instance.StopFollow();
  2133. this.ChangeState(RoleState.Wait);
  2134. var lookdir = new Vector3$5();
  2135. var boospos = _boos.cursprite.transform.position.clone();
  2136. var mpos = Player.mainpalyer.cursprite.transform.position.clone();
  2137. Vector3$5.subtract(mpos, boospos, lookdir);
  2138. Vector3$5.normalize(lookdir, lookdir);
  2139. Vector3$5.scale(lookdir, 6, lookdir);
  2140. var lookpos = new Vector3$5();
  2141. Vector3$5.add(boospos, lookdir, lookpos);
  2142. lookpos = new Vector3$5(lookpos.x, lookpos.y + 3, lookpos.z);
  2143. var booslookpos = new Vector3$5(boospos.x, boospos.y + 1, boospos.z);
  2144. var ssf = GameUtils.TweenMove(SceneManager.maincamera.transform, lookpos, 1.2, Laya.Handler.create(this, () => {
  2145. ssf.clear();
  2146. _boos.Provocation(() => {
  2147. this.BackCa();
  2148. });
  2149. }), Laya.Ease.quadOut, booslookpos);
  2150. }
  2151. BackCa() {
  2152. SceneManager.maincamera.transform.rotation = this.startcamerarot;
  2153. CameraManager.Instance.ResetTarget(this.cursprite);
  2154. InputManager.caninput = true;
  2155. }
  2156. }
  2157. var Vector3$6 = Laya.Vector3;
  2158. class RigObj {
  2159. constructor(_target, _complete = null, autocleartime = 2.5, rottime = 0) {
  2160. this.awake = false;
  2161. this.minhight = 0;
  2162. this.mforce = 0;
  2163. this.starty = 0;
  2164. this.offestY = 0;
  2165. this.g = 0.1;
  2166. this.m_time = 0;
  2167. this.curPos = new Vector3$6();
  2168. this.screenhit = new Laya.HitResult();
  2169. this.enter = false;
  2170. this.completecallback = _complete;
  2171. Laya.timer.frameLoop(1, this, this.LifeLoop);
  2172. if (rottime < autocleartime)
  2173. rottime = 0;
  2174. this.rottime = rottime;
  2175. if (autocleartime > 0) {
  2176. var lifetime = autocleartime > rottime ? autocleartime : rottime;
  2177. Laya.timer.once(1000 * lifetime, this, this.Destory);
  2178. }
  2179. this.msprite = _target;
  2180. this.starty = _target.transform.position.y;
  2181. this.minhight = this.starty;
  2182. }
  2183. AddForce(_dir, _force, _rotSpeed = 1) {
  2184. this.awake = true;
  2185. this.curdir = new Vector3$6();
  2186. Vector3$6.normalize(_dir, this.curdir);
  2187. Vector3$6.scale(this.curdir, _force, this.curdir);
  2188. var xr = Math.random() > 0.5 ? 1 : -1;
  2189. var yr = Math.random() > 0.5 ? 1 : -1;
  2190. var zr = Math.random() > 0.5 ? 1 : -1;
  2191. this.currotdir = new Vector3$6(Math.random() * 0.02 * xr * _rotSpeed, Math.random() * 0.02 * yr * _rotSpeed, Math.random() * 0.02 * zr * _rotSpeed);
  2192. }
  2193. LifeLoop() {
  2194. if (!this.awake)
  2195. return;
  2196. var checkdis = this.PlaneCheck;
  2197. if (checkdis != null && checkdis <= 0) {
  2198. this.Destory();
  2199. return;
  2200. }
  2201. var mpos = this.msprite.transform.position;
  2202. this.m_time += 0.005;
  2203. this.offestY -= this.g * this.m_time * this.m_time;
  2204. Vector3$6.add(mpos, this.curdir, this.curPos);
  2205. Vector3$6.lerp(mpos, this.curPos, 0.12, this.curPos);
  2206. this.msprite.transform.rotate(this.currotdir);
  2207. if (this.msprite.transform.position.y >= this.minhight) {
  2208. var curoffestx = this.curPos.x - mpos.x;
  2209. var curoffesty = this.curPos.y - mpos.y + this.offestY;
  2210. var curoffextz = this.curPos.z - mpos.z;
  2211. Vector3$6.add(mpos, new Vector3$6(curoffestx, curoffesty, curoffextz), this.curPos);
  2212. this.msprite.transform.position = this.curPos;
  2213. }
  2214. if (curoffesty < 0 && this.msprite.transform.position.y < this.minhight && this.rottime > 0) {
  2215. this.msprite.transform.position = new Vector3$6(mpos.x, this.minhight, mpos.z);
  2216. this.Destory();
  2217. }
  2218. }
  2219. Destory() {
  2220. this.Clear();
  2221. this.FallDown(() => {
  2222. if (this.completecallback != null) {
  2223. this.completecallback();
  2224. }
  2225. });
  2226. }
  2227. Clear() {
  2228. Laya.timer.clearAll(this);
  2229. Laya.timer.clear(this, this.LifeLoop);
  2230. }
  2231. FallDown(_cb) {
  2232. var mpos = this.msprite.transform.position.clone();
  2233. var targetpos = new Vector3$6(mpos.x, mpos.y - 2, mpos.z);
  2234. GameUtils.TweenMove(this.msprite.transform, targetpos, 0.8, Laya.Handler.create(this, () => {
  2235. _cb();
  2236. }));
  2237. }
  2238. get PlaneCheck() {
  2239. var centerpos = this.msprite.transform.position;
  2240. var curray = new Laya.Ray(centerpos, new Vector3$6(0, -1, 0));
  2241. if (SceneManager.mainscene.physicsSimulation.rayCast(curray, this.screenhit, 100)) {
  2242. if (this.screenhit) {
  2243. var dis = this.msprite.transform.position.y - this.screenhit.point.y;
  2244. if (dis > 0) {
  2245. return dis;
  2246. }
  2247. }
  2248. return null;
  2249. }
  2250. else {
  2251. return null;
  2252. }
  2253. }
  2254. }
  2255. var MonsterType;
  2256. (function (MonsterType) {
  2257. MonsterType[MonsterType["BallBoss"] = 0] = "BallBoss";
  2258. MonsterType[MonsterType["Shooter"] = 1] = "Shooter";
  2259. MonsterType[MonsterType["Warrior"] = 2] = "Warrior";
  2260. })(MonsterType || (MonsterType = {}));
  2261. var Weapontype;
  2262. (function (Weapontype) {
  2263. Weapontype[Weapontype["Guitar"] = 1] = "Guitar";
  2264. Weapontype[Weapontype["Fireaxe"] = 2] = "Fireaxe";
  2265. Weapontype[Weapontype["Chair"] = 3] = "Chair";
  2266. Weapontype[Weapontype["Pole"] = 4] = "Pole";
  2267. Weapontype[Weapontype["shuriken"] = 5] = "shuriken";
  2268. Weapontype[Weapontype["Pistol"] = 6] = "Pistol";
  2269. Weapontype[Weapontype["missile"] = 7] = "missile";
  2270. Weapontype[Weapontype["wtaagsg"] = 8] = "wtaagsg";
  2271. })(Weapontype || (Weapontype = {}));
  2272. class MonsterConfig {
  2273. constructor() {
  2274. this.bulletamount = 1;
  2275. this.recognition = 6;
  2276. this.attack_range = 2;
  2277. this.move_speed = 0.3;
  2278. this.frequency = 1;
  2279. this.bullet_speed = 1;
  2280. }
  2281. }
  2282. class MonsterDataManager {
  2283. constructor() {
  2284. MonsterDataManager.OnInit();
  2285. }
  2286. static OnInit() {
  2287. var enemy = PlayerAccount.CurAccountData.GetConfig(AccountConfig.enemy);
  2288. for (var key in enemy) {
  2289. var curdata = enemy[key];
  2290. var id = Number(curdata.id);
  2291. var monsterdata = new MonsterConfig();
  2292. monsterdata.recognition = Number(curdata.recognition);
  2293. monsterdata.attack_range = Number(curdata.attack_range);
  2294. monsterdata.enemy_type = curdata.enemy_type;
  2295. monsterdata.move_speed = Number(curdata.move_speed);
  2296. monsterdata.frequency = Number(curdata.frequency);
  2297. monsterdata.bullet_speed = Number(curdata.bullet_speed);
  2298. this.MonsterDic.add(id, monsterdata);
  2299. }
  2300. var guitarmonster = this.MonsterDic.getValue(1);
  2301. guitarmonster.monstertype = MonsterType.Warrior;
  2302. guitarmonster.weapontype = Weapontype.Guitar;
  2303. var fireaxemonster = this.MonsterDic.getValue(2);
  2304. fireaxemonster.monstertype = MonsterType.Warrior;
  2305. fireaxemonster.weapontype = Weapontype.Fireaxe;
  2306. var chairmonster = this.MonsterDic.getValue(3);
  2307. chairmonster.monstertype = MonsterType.Warrior;
  2308. chairmonster.weapontype = Weapontype.Chair;
  2309. var polemonster = this.MonsterDic.getValue(4);
  2310. polemonster.monstertype = MonsterType.Warrior;
  2311. polemonster.weapontype = Weapontype.Pole;
  2312. var shurikenmonster1 = this.MonsterDic.getValue(5);
  2313. shurikenmonster1.monstertype = MonsterType.Shooter;
  2314. shurikenmonster1.bulletamount = 1;
  2315. shurikenmonster1.weapontype = Weapontype.shuriken;
  2316. var shurikenmonster2 = this.MonsterDic.getValue(6);
  2317. shurikenmonster2.monstertype = MonsterType.Shooter;
  2318. shurikenmonster2.weapontype = Weapontype.shuriken;
  2319. shurikenmonster2.bulletamount = 2;
  2320. var pistolmonster = this.MonsterDic.getValue(7);
  2321. pistolmonster.monstertype = MonsterType.Shooter;
  2322. pistolmonster.bulletamount = 1;
  2323. pistolmonster.weapontype = Weapontype.Pistol;
  2324. var pistolboos = this.MonsterDic.getValue(8);
  2325. pistolboos.monstertype = MonsterType.Shooter;
  2326. pistolboos.weapontype = Weapontype.Pistol;
  2327. pistolboos.bulletamount = 3;
  2328. pistolboos.masktype = 2;
  2329. pistolboos.provocationclip = "gunboosprovocation";
  2330. var shurikenboos = this.MonsterDic.getValue(9);
  2331. shurikenboos.monstertype = MonsterType.Shooter;
  2332. shurikenboos.weapontype = Weapontype.shuriken;
  2333. shurikenboos.bulletamount = 3;
  2334. shurikenboos.masktype = 3;
  2335. shurikenboos.provocationclip = "dartsboosprovocation";
  2336. var ballboos = this.MonsterDic.getValue(10);
  2337. ballboos.monstertype = MonsterType.BallBoss;
  2338. ballboos.weapontype = Weapontype.wtaagsg;
  2339. ballboos.bulletamount = 1;
  2340. ballboos.masktype = 5;
  2341. ballboos.provocationclip = "chuiboosprovocation";
  2342. var rooketboos = this.MonsterDic.getValue(11);
  2343. rooketboos.monstertype = MonsterType.Shooter;
  2344. rooketboos.weapontype = Weapontype.missile;
  2345. rooketboos.bulletamount = 1;
  2346. rooketboos.masktype = 4;
  2347. rooketboos.provocationclip = "paoboosprovocation";
  2348. }
  2349. }
  2350. MonsterDataManager.MonsterDic = new Dictionary();
  2351. var Vector3$7 = Laya.Vector3;
  2352. class MonsterData extends RoleData {
  2353. constructor(_id, _startpos) {
  2354. super(_id, _startpos);
  2355. this.boos = false;
  2356. this.monsterconfig = MonsterDataManager.MonsterDic.getValue(_id);
  2357. }
  2358. }
  2359. class Warrior extends Role {
  2360. constructor() {
  2361. super(...arguments);
  2362. this.movespeed = 0.3;
  2363. this.awakedistance = 8;
  2364. this.attackdistance = 2;
  2365. this.attackrate = 1;
  2366. this.life = false;
  2367. this.movedir = new Vector3$7();
  2368. this.movepos = new Vector3$7();
  2369. this.moverot = new Laya.Quaternion;
  2370. this.landhit = new Laya.HitResult();
  2371. }
  2372. static Create(_data) {
  2373. var roleid = _data.id;
  2374. var roleasset = AssetManager.enemy.getValue(1);
  2375. var model = PoolManager.GetSprite3D(roleasset);
  2376. SceneManager.mainscene.addChild(model);
  2377. model.transform.position = new Vector3$7(_data.startpos.x, _data.startpos.y, _data.startpos.z);
  2378. model.transform.rotationEuler = new Vector3$7(model.transform.rotationEuler.x, 360 - _data.startpos.w, model.transform.rotationEuler.z);
  2379. var monster = model.addComponent(Warrior);
  2380. monster.mdata = _data;
  2381. monster.provocationclip = _data.monsterconfig.provocationclip;
  2382. var neck = model.getChildAt(0).getChildAt(0).getChildAt(1).getChildAt(0).getChildAt(2).getChildAt(0);
  2383. monster.headpoint = neck.getChildAt(0).getChildAt(0);
  2384. monster.weaponpoint = neck.getChildAt(2).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0);
  2385. monster.Init(model);
  2386. monster.collider = model.getChildAt(1).getComponent(Laya.PhysicsCollider);
  2387. monster.collider.collisionGroup = ColliderLay.monster;
  2388. monster.collider.enabled = true;
  2389. monster.SkinShow(monster.mdata.monsterconfig.masktype, monster.mdata.monsterconfig.weapontype);
  2390. monster.awakedistance = _data.monsterconfig.recognition;
  2391. monster.attackdistance = _data.monsterconfig.attack_range;
  2392. monster.movespeed = _data.monsterconfig.move_speed;
  2393. monster.attackrate = _data.monsterconfig.frequency;
  2394. monster.upsprite = model.getChildAt(0).getChildAt(2);
  2395. monster.upsprite.active = true;
  2396. monster.downsprite = model.getChildAt(0).getChildAt(1);
  2397. monster.downsprite.active = true;
  2398. monster.OnInit();
  2399. return monster;
  2400. }
  2401. OnInit() {
  2402. this.mlevel = LevelManager.Instance.curlevel;
  2403. this.RegEvent();
  2404. if (this.mdata.boos) {
  2405. this.cursprite.transform.setWorldLossyScale(new Vector3$7(1.5, 1.5, 1.5));
  2406. }
  2407. }
  2408. OnClear() {
  2409. EventManager.Off(EventType.Cut, this, this.OnCut);
  2410. EventManager.Off(EventType.Running, this, this.OnRunning);
  2411. Laya.timer.clearAll(this);
  2412. Laya.timer.clear(this, this.CheckAttack);
  2413. Laya.timer.clear(this, this.AttackLoop);
  2414. Laya.timer.clear(this, this.MoveLoop);
  2415. Laya.timer.clear(this, this.OnLife);
  2416. this.SkinShow(0, 0);
  2417. if (this.cuteffect)
  2418. PoolManager.RecoverSprite3D(this.cuteffect);
  2419. this.curanimator.speed = 1;
  2420. if (this.diedownsprite) {
  2421. var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
  2422. dieani.speed = 1;
  2423. PoolManager.RecoverSprite3D(this.diedownsprite);
  2424. }
  2425. }
  2426. RegEvent() {
  2427. EventManager.On(EventType.Cut, this, this.OnCut);
  2428. EventManager.On(EventType.Running, this, this.OnRunning);
  2429. }
  2430. WithPlaying() {
  2431. if (this.mdata.boos) {
  2432. Player.mainpalyer.FindBoos(this);
  2433. }
  2434. }
  2435. OnCut(_collider) {
  2436. if (_collider != this.collider)
  2437. return;
  2438. TtSdk.Shake(false);
  2439. AudioControl.PlayVoice(VoiceType.cut);
  2440. if (this.AttackTarget)
  2441. this.StopMove();
  2442. this.ChangeState(RoleState.Die, !PlayerAccount.CurAccountData.cuteffect);
  2443. }
  2444. get displayer() {
  2445. var curpos = this.cursprite.transform.position.clone();
  2446. var mainplayerpos = Player.mainpalyer.cursprite.transform.position.clone();
  2447. var dis = GameUtils.Vector32Length(mainplayerpos, curpos);
  2448. return dis;
  2449. }
  2450. OnRunning(_playerpos) {
  2451. if (this.life)
  2452. return;
  2453. var curpos = this.cursprite.transform.position.clone();
  2454. var dis = GameUtils.Vector32Length(_playerpos, curpos);
  2455. if (dis < this.attackdistance && this.currolestate == RoleState.Idle) {
  2456. this.ChangeState(RoleState.Attack);
  2457. }
  2458. else if (dis < this.awakedistance && this.currolestate == RoleState.Idle) {
  2459. this.ChangeState(RoleState.Awake);
  2460. }
  2461. }
  2462. OnLife() {
  2463. if (Player.mainpalyer.currolestate == RoleState.Die || Player.mainpalyer.currolestate == RoleState.Win)
  2464. return;
  2465. if (this.displayer < this.attackdistance && this.currolestate == RoleState.Idle) {
  2466. this.ChangeState(RoleState.Attack);
  2467. }
  2468. else {
  2469. this.ChangeState(RoleState.Awake);
  2470. }
  2471. }
  2472. onStateChange(_state, _data) {
  2473. Laya.timer.clearAll(this);
  2474. Laya.timer.clear(this, this.AttackLoop);
  2475. Laya.timer.clear(this, this.MoveLoop);
  2476. Laya.timer.clear(this, this.OnLife);
  2477. if (_state == RoleState.Awake) {
  2478. this.OnEnterAwake();
  2479. }
  2480. else if (_state == RoleState.Die) {
  2481. this.OnEnterDie(_data);
  2482. }
  2483. else if (_state == RoleState.Attack) {
  2484. this.OnEnterAttack();
  2485. }
  2486. else if (_state == RoleState.Idle) {
  2487. this.OnEnterIdle();
  2488. }
  2489. }
  2490. OnEnterIdle() {
  2491. this.curanimator.play("warrioridle");
  2492. if (this.life) {
  2493. Laya.timer.frameOnce(40, this, () => {
  2494. Laya.timer.clear(this, this.OnLife);
  2495. Laya.timer.frameLoop(1, this, this.OnLife);
  2496. });
  2497. }
  2498. }
  2499. OnEnterAttack() {
  2500. Laya.timer.clear(this, this.AttackLoop);
  2501. this.AttackLoop();
  2502. }
  2503. AttackLoop() {
  2504. if (!InputManager.caninput)
  2505. return;
  2506. this.curanimator.play("attack");
  2507. Laya.timer.frameOnce(40, this, this.CheckAttack);
  2508. var attackduation = 100 / this.attackrate;
  2509. Laya.timer.frameOnce(attackduation, this, () => {
  2510. this.ChangeState(RoleState.Idle);
  2511. });
  2512. }
  2513. CheckAttack() {
  2514. if (this.currolestate == RoleState.Die)
  2515. return;
  2516. if (this.displayer < this.attackdistance * 1.4) {
  2517. Player.mainpalyer.ChangeState(RoleState.Die);
  2518. }
  2519. }
  2520. OnEnterAwake() {
  2521. EventManager.Off(EventType.Running, this, this.OnRunning);
  2522. this.life = true;
  2523. this.curanimator.play("run");
  2524. this.SetMove(Player.mainpalyer);
  2525. }
  2526. SetMove(_target) {
  2527. this.AttackTarget = _target;
  2528. Laya.timer.clear(this, this.MoveLoop);
  2529. Laya.timer.frameLoop(1, this, this.MoveLoop);
  2530. }
  2531. StopMove() {
  2532. Laya.timer.clear(this, this.MoveLoop);
  2533. this.AttackTarget = null;
  2534. }
  2535. MoveLoop() {
  2536. if (!InputManager.caninput)
  2537. return;
  2538. if (this.AttackTarget && this.AttackTarget.currolestate != RoleState.Wait) {
  2539. var mpos = this.cursprite.transform.position.clone();
  2540. Vector3$7.subtract(this.AttackTarget.cursprite.transform.position, mpos, this.movedir);
  2541. Vector3$7.normalize(this.movedir, this.movedir);
  2542. Vector3$7.scale(this.movedir, this.movespeed, this.movedir);
  2543. Vector3$7.add(mpos, this.movedir, this.movepos);
  2544. Vector3$7.lerp(mpos, this.movepos, 0.12, this.movepos);
  2545. var curland = this.LandCheck;
  2546. if (curland) {
  2547. var gasgag = this.cursprite.transform.position;
  2548. if (this.landhit) {
  2549. this.cursprite.transform.position = new Vector3$7(gasgag.x, this.landhit.point.y, gasgag.z);
  2550. }
  2551. this.cursprite.transform.position = this.movepos;
  2552. }
  2553. this.cursprite.transform.rotation = this.RotLook(this.AttackTarget.cursprite.transform.position);
  2554. if (this.displayer < this.attackdistance) {
  2555. this.ChangeState(RoleState.Attack);
  2556. }
  2557. }
  2558. }
  2559. RotLook(_targetpos, _lerp = true) {
  2560. var mpos = this.cursprite.transform.position.clone();
  2561. _targetpos = new Vector3$7(_targetpos.x, mpos.y, _targetpos.z);
  2562. Laya.Quaternion.lookAt(_targetpos, mpos, new Vector3$7(0, 1, 0), this.moverot);
  2563. this.moverot.invert(this.moverot);
  2564. if (_lerp)
  2565. Laya.Quaternion.slerp(this.cursprite.transform.rotation, this.moverot, 0.2, this.moverot);
  2566. this.cursprite.transform.rotation = this.moverot;
  2567. return this.moverot;
  2568. }
  2569. BeBoom() {
  2570. this.ChangeState(RoleState.Die, true);
  2571. }
  2572. OnEnterDie(_die = false) {
  2573. GameManager.Instance.goldnum += LevelManager.Instance.curlevel.leveldata.missiondata.masterdrop;
  2574. if (_die) {
  2575. this.collider.enabled = false;
  2576. this.curanimator.play("die");
  2577. if (this.mdata.boos)
  2578. EventManager.Trigger(EventType.BoosDie, [this]);
  2579. Laya.timer.frameOnce(80, this, () => {
  2580. this.FallLand(this.cursprite.transform.position.y - 1, () => {
  2581. this.Clear();
  2582. });
  2583. });
  2584. return;
  2585. }
  2586. var cutasset = AssetManager.effect.getValue(4);
  2587. this.cuteffect = PoolManager.GetSprite3D(cutasset);
  2588. SceneManager.mainscene.addChild(this.cuteffect);
  2589. this.cuteffect.transform.position = this.upsprite.transform.position.clone();
  2590. this.diedownsprite = PoolManager.GetSprite3D(AssetManager.enemy.getValue(1));
  2591. SceneManager.mainscene.addChild(this.diedownsprite);
  2592. this.diedownsprite.transform.position = this.cursprite.transform.position.clone();
  2593. this.diedownsprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
  2594. if (this.mdata.boos) {
  2595. this.diedownsprite.transform.setWorldLossyScale(new Vector3$7(1.5, 1.5, 1.5));
  2596. }
  2597. var dieupsprite = this.diedownsprite.getChildAt(0).getChildAt(2);
  2598. dieupsprite.active = false;
  2599. var dieupsprite2 = this.diedownsprite.getChildAt(0).getChildAt(1);
  2600. dieupsprite2.active = true;
  2601. var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
  2602. dieani.speed = 0;
  2603. var diec = this.diedownsprite.getChildAt(1).getComponent(Laya.PhysicsCollider);
  2604. diec.enabled = false;
  2605. var downrig = new RigObj(this.diedownsprite, null, 1, 1.2);
  2606. downrig.minhight = 1;
  2607. downrig.AddForce(new Laya.Vector3(0, 1, 0.5), 0.3);
  2608. this.curanimator.speed = 0;
  2609. this.downsprite.active = false;
  2610. var mrig = new RigObj(this.cursprite, () => {
  2611. mrig.Clear();
  2612. this.Clear();
  2613. }, 1);
  2614. mrig.AddForce(new Laya.Vector3(0, 1, 1), 0.5, 2);
  2615. if (this.mdata.boos)
  2616. EventManager.Trigger(EventType.BoosDie, [this]);
  2617. }
  2618. OnEnterLose() {
  2619. }
  2620. onUpdate() {
  2621. }
  2622. EscapeLoop() {
  2623. }
  2624. AwakeLoop() {
  2625. }
  2626. onTriggerEnter(_collider) {
  2627. }
  2628. SkinShow(headid, weaponid) {
  2629. for (var i = 0; i < this.headpoint.numChildren; i++) {
  2630. var head = this.headpoint.getChildAt(i);
  2631. head.active = headid - 1 == i;
  2632. }
  2633. for (var i = 0; i < this.weaponpoint.numChildren; i++) {
  2634. var weapon = this.weaponpoint.getChildAt(i);
  2635. if (weaponid - 1 == i) {
  2636. this.curweapon = weapon;
  2637. this.curweapon.active = true;
  2638. this.curweaponid = weaponid;
  2639. }
  2640. else {
  2641. weapon.active = false;
  2642. }
  2643. }
  2644. }
  2645. get LandCheck() {
  2646. var hitenter = false;
  2647. var curpos = this.cursprite.transform.position;
  2648. var startpoint = new Vector3$7(curpos.x, curpos.y + 10, curpos.z);
  2649. var dir = new Vector3$7(0, -1, 0);
  2650. var ray = new Laya.Ray(startpoint, dir);
  2651. var landlay = ColliderLay.plane | ColliderLay.end;
  2652. if (SceneManager.mainscene.physicsSimulation.rayCast(ray, this.landhit, 100, 1, landlay)) {
  2653. var hight = startpoint.y - this.landhit.point.y;
  2654. hitenter = true;
  2655. hitenter = (hight > 9 && hight < 13) ? true : false;
  2656. }
  2657. return hitenter;
  2658. }
  2659. }
  2660. var Vector3$8 = Laya.Vector3;
  2661. class Bullet {
  2662. constructor(_form, _startpos, _type, _speed) {
  2663. this.cut = false;
  2664. this.life = 10;
  2665. this.clear = false;
  2666. this.follower = false;
  2667. this.curpos = new Vector3$8();
  2668. this.currot = new Laya.Quaternion();
  2669. this.firedir = new Vector3$8();
  2670. this.tridis = 0.5;
  2671. this.forwardhit = new Laya.HitResult();
  2672. this.formonster = _form;
  2673. this.type = _type;
  2674. this.bulletspeed = _speed;
  2675. this.cursprite = PoolManager.GetSprite3D(AssetManager.bullet.getValue(this.type));
  2676. SceneManager.mainscene.addChild(this.cursprite);
  2677. this.cursprite.transform.position = _startpos;
  2678. if (this.type == 1 || this.type == 2) {
  2679. this.tw = PoolManager.GetSprite3D(AssetManager.effect.getValue(1));
  2680. this.cursprite.addChild(this.tw);
  2681. this.tw.transform.localPosition = new Vector3$8(0, 0, 0);
  2682. }
  2683. else if (this.type == 3) {
  2684. this.tw = PoolManager.GetSprite3D(AssetManager.effect.getValue(7));
  2685. this.cursprite.addChild(this.tw);
  2686. this.tw.transform.localPosition = new Vector3$8(0, 0, 0);
  2687. }
  2688. this.upsprite = this.cursprite.getChildAt(1);
  2689. this.downsprite = this.cursprite.getChildAt(0);
  2690. this.curcollider = this.cursprite.getChildAt(2).getComponent(Laya.PhysicsCollider);
  2691. this.curcollider.collisionGroup = ColliderLay.bullet;
  2692. this.OnInit();
  2693. }
  2694. OnInit() {
  2695. EventManager.On(EventType.Cut, this, this.OnCut);
  2696. EventManager.GameOn(GameState.Over, this, this.OnGameEnd);
  2697. }
  2698. OnGameEnd() {
  2699. this.Clear();
  2700. }
  2701. OnCut(_collider) {
  2702. if (_collider != this.curcollider || this.cut)
  2703. return;
  2704. this.BeCut();
  2705. }
  2706. Clear() {
  2707. if (this.clear)
  2708. return;
  2709. this.clear = true;
  2710. Laya.timer.clearAll(this);
  2711. Laya.timer.clear(this, this.FireLoop);
  2712. if (this.tw)
  2713. this.tw.destroy();
  2714. if (this.uprig)
  2715. this.uprig.Clear();
  2716. if (this.downrig)
  2717. this.downrig.Clear();
  2718. if (this.cuteffect) {
  2719. PoolManager.RecoverSprite3D(this.cuteffect);
  2720. }
  2721. if (this.copysprite) {
  2722. var dieupsprite1 = this.copysprite.getChildAt(1);
  2723. dieupsprite1.active = true;
  2724. PoolManager.RecoverSprite3D(this.copysprite);
  2725. }
  2726. this.downsprite.active = true;
  2727. PoolManager.RecoverSprite3D(this.cursprite);
  2728. EventManager.Off(EventType.Cut, this, this.OnCut);
  2729. EventManager.GameOff(GameState.Over, this, this.OnGameEnd);
  2730. }
  2731. Fire(_startdir, _target = null, _follower = false) {
  2732. this.firetarget = _target;
  2733. this.firedir = _startdir ? _startdir : this.firedir;
  2734. this.follower = _follower;
  2735. if (_follower && this.type != 2) {
  2736. var taretpos = this.firetarget.transform.position.clone();
  2737. var lookpos = new Vector3$8(taretpos.x, taretpos.y + 0.5, taretpos.z);
  2738. Laya.Quaternion.lookAt(lookpos, this.cursprite.transform.position, new Vector3$8(0, 1, 0), this.currot);
  2739. this.currot.invert(this.currot);
  2740. this.cursprite.transform.rotation = this.currot;
  2741. }
  2742. if (_target != null) {
  2743. var sfsf = _target.transform.position.clone();
  2744. var targetpos = new Vector3$8(sfsf.x, sfsf.y + 0.5, sfsf.z);
  2745. Vector3$8.subtract(targetpos, this.cursprite.transform.position, this.firedir);
  2746. }
  2747. this.follower = this.follower && _target != null;
  2748. Vector3$8.normalize(this.firedir, this.firedir);
  2749. Vector3$8.scale(this.firedir, this.bulletspeed, this.firedir);
  2750. Laya.timer.frameLoop(1, this, this.FireLoop);
  2751. Laya.timer.once(this.life * 1000, this, this.Clear);
  2752. }
  2753. FireLoop() {
  2754. if (!InputManager.caninput)
  2755. return;
  2756. Vector3$8.add(this.cursprite.transform.position, this.firedir, this.curpos);
  2757. Vector3$8.lerp(this.cursprite.transform.position, this.curpos, 0.12, this.curpos);
  2758. this.cursprite.transform.position = this.curpos;
  2759. if (this.follower) {
  2760. var sfsf = this.firetarget.transform.position.clone();
  2761. var targetpos = new Vector3$8(sfsf.x, sfsf.y + 0.5, sfsf.z);
  2762. Vector3$8.subtract(targetpos, this.cursprite.transform.position, this.firedir);
  2763. Vector3$8.normalize(this.firedir, this.firedir);
  2764. Vector3$8.scale(this.firedir, this.bulletspeed, this.firedir);
  2765. if (this.type != 2) {
  2766. var taretpos = this.firetarget.transform.position.clone();
  2767. var lookpos = new Vector3$8(taretpos.x, this.cursprite.transform.position.y, taretpos.z);
  2768. Laya.Quaternion.lookAt(lookpos, this.cursprite.transform.position, new Vector3$8(0, 1, 0), this.currot);
  2769. this.currot.invert(this.currot);
  2770. Laya.Quaternion.slerp(this.cursprite.transform.rotation, this.currot, 0.2, this.currot);
  2771. this.cursprite.transform.rotation = this.currot;
  2772. }
  2773. }
  2774. if (this.type == 2) {
  2775. this.cursprite.transform.rotate(new Vector3$8(0, 0.1, 0));
  2776. var hifbarrier = this.ForwardCheck(this.firedir);
  2777. if (hifbarrier) {
  2778. var normal = this.forwardhit.normal;
  2779. var newdir = new Vector3$8();
  2780. var fs = -2 * Vector3$8.dot(normal, this.firedir);
  2781. var gsg = new Vector3$8();
  2782. Vector3$8.scale(normal, fs, gsg);
  2783. Vector3$8.subtract(normal, gsg, newdir);
  2784. this.firedir = newdir;
  2785. Vector3$8.normalize(this.firedir, this.firedir);
  2786. Vector3$8.scale(this.firedir, this.bulletspeed, this.firedir);
  2787. }
  2788. }
  2789. if (this.displayer < this.tridis) {
  2790. this.Clear();
  2791. EventManager.Trigger(EventType.Hit, [this.formonster]);
  2792. }
  2793. }
  2794. BeCut() {
  2795. this.cut = true;
  2796. if (this.tw) {
  2797. this.tw.destroy();
  2798. this.tw = null;
  2799. }
  2800. Laya.timer.clear(this, this.FireLoop);
  2801. var cutasset = AssetManager.effect.getValue(4);
  2802. this.cuteffect = PoolManager.GetSprite3D(cutasset);
  2803. SceneManager.mainscene.addChild(this.cuteffect);
  2804. this.cuteffect.transform.position = this.upsprite.transform.position.clone();
  2805. AudioControl.PlayVoice(VoiceType.cut);
  2806. this.copysprite = PoolManager.GetSprite3D(AssetManager.bullet.getValue(this.type));
  2807. SceneManager.mainscene.addChild(this.copysprite);
  2808. this.copysprite.transform.position = this.cursprite.transform.position.clone();
  2809. this.copysprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
  2810. var dieupsprite = this.copysprite.getChildAt(1);
  2811. dieupsprite.active = false;
  2812. this.uprig = new RigObj(this.copysprite, null, 1);
  2813. this.uprig.minhight = 1;
  2814. this.uprig.AddForce(new Laya.Vector3(0, 1, 0.1), 0.5);
  2815. this.downsprite.active = false;
  2816. this.downrig = new RigObj(this.cursprite, () => {
  2817. this.Clear();
  2818. }, 1.2);
  2819. this.downrig.minhight = 1;
  2820. this.downrig.AddForce(new Laya.Vector3(0, 1, 0.1), 0.3);
  2821. }
  2822. get displayer() {
  2823. var curpos = this.cursprite.transform.position.clone();
  2824. var mainplayerpos = Player.mainpalyer.cursprite.transform.position.clone();
  2825. mainplayerpos = new Vector3$8(mainplayerpos.x, mainplayerpos.y + 0.5, mainplayerpos.z);
  2826. var dis = Vector3$8.distance(mainplayerpos, curpos);
  2827. return dis;
  2828. }
  2829. ForwardCheck(_dir) {
  2830. var hitenter = false;
  2831. var curpos = this.cursprite.transform.position;
  2832. var startpoint = new Vector3$8(curpos.x, curpos.y, curpos.z);
  2833. var ray = new Laya.Ray(startpoint, _dir);
  2834. if (SceneManager.mainscene.physicsSimulation.rayCast(ray, this.forwardhit, 0.5)) {
  2835. if (this.forwardhit.collider.collisionGroup == ColliderLay.obstacle) {
  2836. return true;
  2837. }
  2838. }
  2839. return hitenter;
  2840. }
  2841. }
  2842. var Vector3$9 = Laya.Vector3;
  2843. class Shooter extends Role {
  2844. constructor() {
  2845. super(...arguments);
  2846. this.awakespeed = 0.3;
  2847. this.awakedistance = 10;
  2848. this.attackdistance = 10;
  2849. this.attackrate = 1;
  2850. this.bulletspeed = 1;
  2851. this.life = false;
  2852. this.movedir = new Vector3$9();
  2853. this.movepos = new Vector3$9();
  2854. this.moverot = new Laya.Quaternion;
  2855. }
  2856. static Create(_data) {
  2857. var roleid = _data.id;
  2858. var roleasset = AssetManager.enemy.getValue(1);
  2859. var model = PoolManager.GetSprite3D(roleasset);
  2860. SceneManager.mainscene.addChild(model);
  2861. model.transform.position = new Vector3$9(_data.startpos.x, _data.startpos.y, _data.startpos.z);
  2862. model.transform.rotationEuler = new Vector3$9(model.transform.rotationEuler.x, 360 - _data.startpos.w, model.transform.rotationEuler.z);
  2863. var monster = model.addComponent(Shooter);
  2864. monster.mdata = _data;
  2865. monster.provocationclip = _data.monsterconfig.provocationclip;
  2866. var neck = model.getChildAt(0).getChildAt(0).getChildAt(1).getChildAt(0).getChildAt(2).getChildAt(0);
  2867. monster.headpoint = neck.getChildAt(0).getChildAt(0);
  2868. monster.weaponpoint = neck.getChildAt(2).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0);
  2869. monster.Init(model);
  2870. monster.collider = model.getChildAt(1).getComponent(Laya.PhysicsCollider);
  2871. monster.collider.collisionGroup = ColliderLay.monster;
  2872. monster.collider.enabled = true;
  2873. monster.SkinShow(monster.mdata.monsterconfig.masktype, monster.mdata.monsterconfig.weapontype);
  2874. monster.awakedistance = _data.monsterconfig.recognition;
  2875. monster.attackdistance = _data.monsterconfig.attack_range;
  2876. monster.movespeed = _data.monsterconfig.move_speed;
  2877. monster.attackrate = _data.monsterconfig.frequency;
  2878. monster.bulletspeed = _data.monsterconfig.bullet_speed;
  2879. monster.upsprite = model.getChildAt(0).getChildAt(2);
  2880. monster.upsprite.active = true;
  2881. monster.downsprite = model.getChildAt(0).getChildAt(1);
  2882. monster.downsprite.active = true;
  2883. monster.OnInit();
  2884. return monster;
  2885. }
  2886. OnInit() {
  2887. this.mlevel = LevelManager.Instance.curlevel;
  2888. this.RegEvent();
  2889. if (this.mdata.boos) {
  2890. this.cursprite.transform.setWorldLossyScale(new Vector3$9(1.5, 1.5, 1.5));
  2891. }
  2892. }
  2893. OnClear() {
  2894. EventManager.Off(EventType.Cut, this, this.OnCut);
  2895. EventManager.Off(EventType.Running, this, this.OnRunning);
  2896. Laya.timer.clearAll(this);
  2897. Laya.timer.clear(this, this.AttackLoop);
  2898. Laya.timer.clear(this, this.MoveLoop);
  2899. Laya.timer.clear(this, this.OnLife);
  2900. this.SkinShow(0, 0);
  2901. this.curanimator.speed = 1;
  2902. if (this.cuteffect)
  2903. PoolManager.RecoverSprite3D(this.cuteffect);
  2904. if (this.diedownsprite) {
  2905. var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
  2906. dieani.speed = 1;
  2907. PoolManager.RecoverSprite3D(this.diedownsprite);
  2908. }
  2909. }
  2910. RegEvent() {
  2911. EventManager.On(EventType.Cut, this, this.OnCut);
  2912. EventManager.On(EventType.Running, this, this.OnRunning);
  2913. }
  2914. WithPlaying() {
  2915. if (this.mdata.boos) {
  2916. Player.mainpalyer.FindBoos(this);
  2917. }
  2918. }
  2919. OnCut(_collider) {
  2920. if (_collider != this.collider)
  2921. return;
  2922. TtSdk.Shake(false);
  2923. AudioControl.PlayVoice(VoiceType.cut);
  2924. if (this.AttackTarget)
  2925. this.StopMove();
  2926. this.ChangeState(RoleState.Die, !PlayerAccount.CurAccountData.cuteffect);
  2927. }
  2928. get displayer() {
  2929. var curpos = this.cursprite.transform.position.clone();
  2930. var mainplayerpos = Player.mainpalyer.cursprite.transform.position.clone();
  2931. var dis = Vector3$9.distance(mainplayerpos, curpos);
  2932. return dis;
  2933. }
  2934. OnRunning(_playerpos) {
  2935. if (this.life)
  2936. return;
  2937. var curpos = this.cursprite.transform.position.clone();
  2938. var dis = Vector3$9.distance(_playerpos, curpos);
  2939. if (dis < this.attackdistance && this.currolestate == RoleState.Idle) {
  2940. this.ChangeState(RoleState.Attack);
  2941. }
  2942. if (this.AttackTarget)
  2943. this.cursprite.transform.rotation = this.RotLook(this.AttackTarget.transform.position, false);
  2944. }
  2945. OnLife() {
  2946. if (Player.mainpalyer.currolestate == RoleState.Die || Player.mainpalyer.currolestate == RoleState.Win)
  2947. return;
  2948. if (this.currolestate == RoleState.Idle) {
  2949. this.ChangeState(RoleState.Attack);
  2950. }
  2951. if (this.AttackTarget)
  2952. this.cursprite.transform.rotation = this.RotLook(this.AttackTarget.transform.position, false);
  2953. }
  2954. onStateChange(_state, _data) {
  2955. Laya.timer.clear(this, this.AttackLoop);
  2956. Laya.timer.clear(this, this.MoveLoop);
  2957. Laya.timer.clear(this, this.OnLife);
  2958. if (_state == RoleState.Awake) {
  2959. this.OnEnterAwake();
  2960. }
  2961. else if (_state == RoleState.Die) {
  2962. this.OnEnterDie(_data);
  2963. }
  2964. else if (_state == RoleState.Attack) {
  2965. this.OnEnterAttack();
  2966. }
  2967. else if (_state == RoleState.Idle) {
  2968. this.OnEnterIdle();
  2969. }
  2970. }
  2971. OnEnterIdle() {
  2972. if (this.curweaponid == 5) {
  2973. this.curanimator.crossFade("dartsidle", 0.2);
  2974. }
  2975. else if (this.curweaponid == 6) {
  2976. this.curanimator.crossFade("gunidle", 0.2);
  2977. }
  2978. else if (this.curweaponid == 7) {
  2979. this.curanimator.crossFade("paoboosidle", 0.2);
  2980. }
  2981. if (this.life) {
  2982. Laya.timer.frameOnce(80, this, () => {
  2983. Laya.timer.clear(this, this.OnLife);
  2984. Laya.timer.frameLoop(1, this, this.OnLife);
  2985. });
  2986. }
  2987. }
  2988. OnEnterAttack() {
  2989. this.life = true;
  2990. Laya.timer.clear(this, this.AttackLoop);
  2991. this.AttackLoop();
  2992. this.AttackTarget = Player.mainpalyer.cursprite;
  2993. this.cursprite.transform.rotation = this.RotLook(this.AttackTarget.transform.position, false);
  2994. }
  2995. AttackLoop() {
  2996. if (this.curweaponid == 5) {
  2997. this.curanimator.crossFade("darts", 0.2);
  2998. }
  2999. else if (this.curweaponid == 6) {
  3000. this.curanimator.play("shoot");
  3001. }
  3002. else if (this.curweaponid == 7) {
  3003. this.curanimator.crossFade("paoboosattack", 0.2);
  3004. }
  3005. Laya.timer.frameOnce(30, this, () => {
  3006. if (this.currolestate != RoleState.Die)
  3007. this.Fire();
  3008. });
  3009. var attackrate = 100 / this.attackrate;
  3010. Laya.timer.frameOnce(attackrate, this, () => {
  3011. this.ChangeState(RoleState.Idle);
  3012. });
  3013. }
  3014. Fire() {
  3015. if (!InputManager.caninput)
  3016. return;
  3017. var bulletid;
  3018. var firepo;
  3019. var follow = false;
  3020. var speed = this.mdata.monsterconfig.bullet_speed;
  3021. if (this.curweaponid == 5) {
  3022. bulletid = 2;
  3023. firepo = this.curweapon.transform.position;
  3024. }
  3025. else if (this.curweaponid == 6) {
  3026. bulletid = 1;
  3027. firepo = this.firepoint.transform.position;
  3028. }
  3029. else if (this.curweaponid == 7) {
  3030. bulletid = 3;
  3031. firepo = this.curweapon.transform.position;
  3032. follow = true;
  3033. }
  3034. if (this.mdata.monsterconfig.bulletamount == 1) {
  3035. var bullet = new Bullet(this, firepo, bulletid, speed);
  3036. bullet.Fire(null, Player.mainpalyer.cursprite, follow);
  3037. }
  3038. else if (this.mdata.monsterconfig.bulletamount == 2) {
  3039. var bullet1 = new Bullet(this, firepo, bulletid, speed);
  3040. bullet1.Fire(null, Player.mainpalyer.cursprite, follow);
  3041. var dir = new Vector3$9();
  3042. Vector3$9.subtract(Player.mainpalyer.cursprite.transform.position, bullet1.cursprite.transform.position, dir);
  3043. var ggy = Math.atan(dir.z / dir.x) * 180 / Math.PI;
  3044. var f = Vector3$9.scalarLength(dir);
  3045. if (dir.x > 0)
  3046. ggy += 180;
  3047. console.log("angle:", ggy);
  3048. var ggy1 = ggy + 5;
  3049. var xf1 = dir.x > 0 ? Math.abs(Math.sin(ggy1)) : -Math.abs(Math.sin(ggy1));
  3050. var zf1 = dir.z > 0 ? Math.abs(Math.sin(ggy1)) : -Math.abs(Math.sin(ggy1));
  3051. dir = new Vector3$9(xf1 * f, dir.y, zf1 * f);
  3052. var bullet2 = new Bullet(this, firepo, bulletid, speed);
  3053. bullet2.Fire(dir, null, follow);
  3054. }
  3055. else if (this.mdata.monsterconfig.bulletamount == 3) {
  3056. var bullet = new Bullet(this, firepo, bulletid, speed);
  3057. bullet.Fire(null, Player.mainpalyer.cursprite, follow);
  3058. var dir = new Vector3$9();
  3059. Vector3$9.subtract(Player.mainpalyer.cursprite.transform.position, bullet.cursprite.transform.position, dir);
  3060. var ggy = Math.atan(dir.z / dir.x) * 180 / Math.PI;
  3061. var f = Vector3$9.scalarLength(dir);
  3062. if (dir.x > 0)
  3063. ggy += 180;
  3064. var ggy1 = ggy + 5;
  3065. var xf1 = dir.x > 0 ? Math.abs(Math.sin(ggy1)) : -Math.abs(Math.sin(ggy1));
  3066. var zf1 = dir.z > 0 ? Math.abs(Math.sin(ggy1)) : -Math.abs(Math.sin(ggy1));
  3067. dir = new Vector3$9(xf1 * f, dir.y, zf1 * f);
  3068. var bullet2 = new Bullet(this, firepo, bulletid, speed);
  3069. bullet2.Fire(dir, null, follow);
  3070. var dir2 = new Vector3$9();
  3071. var ggy2 = ggy + 10;
  3072. var xf2 = dir.x > 0 ? Math.abs(Math.sin(ggy2)) : -Math.abs(Math.sin(ggy2));
  3073. var zf2 = dir.z > 0 ? Math.abs(Math.sin(ggy2)) : -Math.abs(Math.sin(ggy2));
  3074. dir2 = new Vector3$9(xf2 * f, dir.y, zf2 * f);
  3075. var bullet3 = new Bullet(this, firepo, bulletid, speed);
  3076. bullet3.Fire(dir2, null, follow);
  3077. }
  3078. }
  3079. OnEnterAwake() {
  3080. EventManager.Off(EventType.Running, this, this.OnRunning);
  3081. this.curanimator.play("run");
  3082. this.SetMove(Player.mainpalyer.cursprite);
  3083. }
  3084. SetMove(_target) {
  3085. this.AttackTarget = _target;
  3086. this.movespeed = this.awakespeed;
  3087. Laya.timer.clear(this, this.MoveLoop);
  3088. Laya.timer.frameLoop(1, this, this.MoveLoop);
  3089. }
  3090. StopMove() {
  3091. Laya.timer.clear(this, this.MoveLoop);
  3092. this.AttackTarget = null;
  3093. }
  3094. MoveLoop() {
  3095. if (this.AttackTarget) {
  3096. var mpos = this.cursprite.transform.position.clone();
  3097. Vector3$9.subtract(this.AttackTarget.transform.position, mpos, this.movedir);
  3098. Vector3$9.normalize(this.movedir, this.movedir);
  3099. Vector3$9.scale(this.movedir, this.movespeed, this.movedir);
  3100. Vector3$9.add(mpos, this.movedir, this.movepos);
  3101. Vector3$9.lerp(mpos, this.movepos, 0.12, this.movepos);
  3102. this.cursprite.transform.position = this.movepos;
  3103. this.cursprite.transform.rotation = this.RotLook(this.AttackTarget.transform.position);
  3104. if (this.displayer < this.attackdistance) {
  3105. this.ChangeState(RoleState.Attack);
  3106. }
  3107. }
  3108. }
  3109. RotLook(_targetpos, _lerp = true) {
  3110. var mpos = this.cursprite.transform.position.clone();
  3111. _targetpos = new Vector3$9(_targetpos.x, mpos.y, _targetpos.z);
  3112. Laya.Quaternion.lookAt(_targetpos, mpos, new Vector3$9(0, 1, 0), this.moverot);
  3113. this.moverot.invert(this.moverot);
  3114. if (_lerp)
  3115. Laya.Quaternion.slerp(this.cursprite.transform.rotation, this.moverot, 0.2, this.moverot);
  3116. this.cursprite.transform.rotation = this.moverot;
  3117. return this.moverot;
  3118. }
  3119. BeBoom() {
  3120. this.ChangeState(RoleState.Die, true);
  3121. }
  3122. OnEnterDie(_die = false) {
  3123. GameManager.Instance.goldnum += LevelManager.Instance.curlevel.leveldata.missiondata.masterdrop;
  3124. if (_die) {
  3125. this.collider.enabled = false;
  3126. this.curanimator.play("die");
  3127. if (this.mdata.boos)
  3128. EventManager.Trigger(EventType.BoosDie, [this]);
  3129. Laya.timer.frameOnce(80, this, () => {
  3130. this.FallLand(this.cursprite.transform.position.y - 1, () => {
  3131. this.Clear();
  3132. });
  3133. });
  3134. return;
  3135. }
  3136. var cutasset = AssetManager.effect.getValue(4);
  3137. this.cuteffect = PoolManager.GetSprite3D(cutasset);
  3138. SceneManager.mainscene.addChild(this.cuteffect);
  3139. this.cuteffect.transform.position = this.upsprite.transform.position.clone();
  3140. this.diedownsprite = PoolManager.GetSprite3D(AssetManager.enemy.getValue(1));
  3141. SceneManager.mainscene.addChild(this.diedownsprite);
  3142. this.diedownsprite.transform.position = this.cursprite.transform.position.clone();
  3143. this.diedownsprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
  3144. if (this.mdata.boos) {
  3145. this.diedownsprite.transform.setWorldLossyScale(new Vector3$9(1.5, 1.5, 1.5));
  3146. }
  3147. var dieupsprite = this.diedownsprite.getChildAt(0).getChildAt(2);
  3148. dieupsprite.active = false;
  3149. var dieupsprite2 = this.diedownsprite.getChildAt(0).getChildAt(1);
  3150. dieupsprite2.active = true;
  3151. var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
  3152. dieani.speed = 0;
  3153. var diec = this.diedownsprite.getChildAt(1).getComponent(Laya.PhysicsCollider);
  3154. diec.enabled = false;
  3155. var downrig = new RigObj(this.diedownsprite, null, 1, 1);
  3156. downrig.minhight = 1;
  3157. downrig.AddForce(new Laya.Vector3(0, 1, 0.5), 0.3);
  3158. this.curanimator.speed = 0;
  3159. this.downsprite.active = false;
  3160. var mrig = new RigObj(this.cursprite, () => {
  3161. mrig.Clear();
  3162. this.Clear();
  3163. }, 1);
  3164. mrig.AddForce(new Laya.Vector3(0, 1, 1), 0.5, 2);
  3165. if (this.mdata.boos)
  3166. EventManager.Trigger(EventType.BoosDie, [this]);
  3167. }
  3168. OnEnterLose() {
  3169. }
  3170. onUpdate() {
  3171. }
  3172. EscapeLoop() {
  3173. }
  3174. AwakeLoop() {
  3175. }
  3176. SkinShow(headid, weaponid) {
  3177. for (var i = 0; i < this.headpoint.numChildren; i++) {
  3178. var head = this.headpoint.getChildAt(i);
  3179. head.active = headid - 1 == i;
  3180. }
  3181. for (var i = 0; i < this.weaponpoint.numChildren; i++) {
  3182. var weapon = this.weaponpoint.getChildAt(i);
  3183. if (weaponid - 1 == i) {
  3184. this.curweapon = weapon;
  3185. this.curweapon.active = true;
  3186. this.curweaponid = weaponid;
  3187. if (weaponid == 6) {
  3188. this.firepoint = this.curweapon.getChildAt(1);
  3189. }
  3190. }
  3191. else {
  3192. weapon.active = false;
  3193. }
  3194. }
  3195. }
  3196. }
  3197. var Vector3$a = Laya.Vector3;
  3198. class RoadData {
  3199. constructor(_type) {
  3200. this.type = _type;
  3201. }
  3202. }
  3203. class Road {
  3204. constructor(_data) {
  3205. this.curdata = _data;
  3206. var roadasset = AssetManager.road.getValue(_data.type);
  3207. this.cursprite = PoolManager.GetSprite3D(roadasset);
  3208. SceneManager.mainscene.addChild(this.cursprite);
  3209. this.cursprite.transform.setWorldLossyScale(_data.scale);
  3210. this.cursprite.transform.position = new Vector3$a(_data.pos.x, _data.pos.y, _data.pos.z);
  3211. this.cursprite.transform.rotationEuler = new Vector3$a(_data.erot.x, 360 - _data.erot.y, _data.erot.z);
  3212. GameUtils.SetColliderLay(this.cursprite, ColliderLay.plane);
  3213. }
  3214. Clear() {
  3215. PoolManager.RecoverSprite3D(this.cursprite);
  3216. }
  3217. }
  3218. class ChuiCheck extends Laya.Script3D {
  3219. onAwake() {
  3220. this.mainplayer = Player.mainpalyer;
  3221. }
  3222. onTriggerEnter(other) {
  3223. if (this.mainplayer.currolestate == RoleState.Die)
  3224. return;
  3225. if (this.cantrigger(other)) {
  3226. EventManager.Trigger(EventType.Chui, [other]);
  3227. }
  3228. }
  3229. cantrigger(_collider) {
  3230. if (GameManager.Instance.curgamestate != GameState.Playing)
  3231. return false;
  3232. if (_collider.collisionGroup == ColliderLay.player) {
  3233. return true;
  3234. }
  3235. return false;
  3236. }
  3237. }
  3238. var Vector3$b = Laya.Vector3;
  3239. class BallBoos extends Role {
  3240. constructor() {
  3241. super(...arguments);
  3242. this.awakespeed = 0.3;
  3243. this.awakedistance = 8;
  3244. this.attackdistance = 6;
  3245. this.standattackdis = 2;
  3246. this.attackrate = 1;
  3247. this.life = false;
  3248. this.movedir = new Vector3$b();
  3249. this.movepos = new Vector3$b();
  3250. this.moverot = new Laya.Quaternion;
  3251. }
  3252. static Create(_data) {
  3253. var roleid = _data.id;
  3254. var roleasset = AssetManager.enemy.getValue(1);
  3255. var model = PoolManager.GetSprite3D(roleasset);
  3256. SceneManager.mainscene.addChild(model);
  3257. model.transform.position = new Vector3$b(_data.startpos.x, _data.startpos.y, _data.startpos.z);
  3258. model.transform.rotationEuler = new Vector3$b(model.transform.rotationEuler.x, 360 - _data.startpos.w, model.transform.rotationEuler.z);
  3259. var monster = model.addComponent(BallBoos);
  3260. monster.mdata = _data;
  3261. monster.provocationclip = _data.monsterconfig.provocationclip;
  3262. var neck = model.getChildAt(0).getChildAt(0).getChildAt(1).getChildAt(0).getChildAt(2).getChildAt(0);
  3263. monster.headpoint = neck.getChildAt(0).getChildAt(0);
  3264. monster.weaponpoint = neck.getChildAt(2).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0);
  3265. monster.Init(model);
  3266. monster.collider = model.getChildAt(1).getComponent(Laya.PhysicsCollider);
  3267. monster.collider.collisionGroup = ColliderLay.monster;
  3268. monster.SkinShow(_data.monsterconfig.masktype, 8);
  3269. monster.awakedistance = _data.monsterconfig.recognition;
  3270. monster.attackdistance = _data.monsterconfig.attack_range;
  3271. monster.movespeed = _data.monsterconfig.move_speed;
  3272. monster.attackrate = _data.monsterconfig.frequency;
  3273. monster.upsprite = model.getChildAt(0).getChildAt(2);
  3274. monster.upsprite.active = true;
  3275. monster.downsprite = model.getChildAt(0).getChildAt(1);
  3276. monster.downsprite.active = true;
  3277. monster.OnInit();
  3278. return monster;
  3279. }
  3280. OnInit() {
  3281. this.mlevel = LevelManager.Instance.curlevel;
  3282. this.RegEvent();
  3283. this.cursprite.transform.setWorldLossyScale(new Vector3$b(1.2, 1.2, 1.2));
  3284. }
  3285. OnClear() {
  3286. EventManager.Off(EventType.Cut, this, this.OnCut);
  3287. EventManager.Off(EventType.Running, this, this.OnRunning);
  3288. EventManager.Off(EventType.Chui, this, this.CheckAttack);
  3289. Laya.timer.clearAll(this);
  3290. Laya.timer.clear(this, this.CheckAttack);
  3291. Laya.timer.clear(this, this.AttackLoop);
  3292. Laya.timer.clear(this, this.MoveLoop);
  3293. Laya.timer.clear(this, this.OnLife);
  3294. var chuicheck = this.curweapon.getComponent(ChuiCheck);
  3295. if (chuicheck)
  3296. chuicheck.destroy();
  3297. if (this.cuteffect)
  3298. PoolManager.RecoverSprite3D(this.cuteffect);
  3299. this.curanimator.speed = 1;
  3300. this.SkinShow(0, 0);
  3301. if (this.diedownsprite) {
  3302. var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
  3303. dieani.speed = 1;
  3304. PoolManager.RecoverSprite3D(this.diedownsprite);
  3305. }
  3306. }
  3307. RegEvent() {
  3308. EventManager.On(EventType.Cut, this, this.OnCut);
  3309. EventManager.On(EventType.Running, this, this.OnRunning);
  3310. EventManager.On(EventType.Chui, this, this.CheckAttack);
  3311. }
  3312. WithPlaying() {
  3313. if (this.mdata.boos) {
  3314. Player.mainpalyer.FindBoos(this);
  3315. }
  3316. }
  3317. OnCut(_collider) {
  3318. if (_collider != this.collider)
  3319. return;
  3320. if (this.AttackTarget)
  3321. this.StopMove();
  3322. this.ChangeState(RoleState.Die, !PlayerAccount.CurAccountData.cuteffect);
  3323. TtSdk.Shake(false);
  3324. AudioControl.PlayVoice(VoiceType.cut);
  3325. var cutasset = AssetManager.effect.getValue(4);
  3326. this.cuteffect = PoolManager.GetSprite3D(cutasset);
  3327. SceneManager.mainscene.addChild(this.cuteffect);
  3328. this.cuteffect.transform.position = this.upsprite.transform.position.clone();
  3329. }
  3330. get displayer() {
  3331. var curpos = this.cursprite.transform.position.clone();
  3332. var mainplayerpos = Player.mainpalyer.cursprite.transform.position.clone();
  3333. var dis = GameUtils.Vector32Length(mainplayerpos, curpos);
  3334. return dis;
  3335. }
  3336. OnRunning(_playerpos) {
  3337. if (this.life)
  3338. return;
  3339. var curpos = this.cursprite.transform.position.clone();
  3340. var dis = GameUtils.Vector32Length(_playerpos, curpos);
  3341. if (dis < this.attackdistance && this.currolestate == RoleState.Idle) {
  3342. this.ChangeState(RoleState.Attack);
  3343. }
  3344. else if (dis < this.awakedistance && this.currolestate == RoleState.Idle) {
  3345. this.ChangeState(RoleState.Awake);
  3346. }
  3347. }
  3348. OnLife() {
  3349. if (Player.mainpalyer.currolestate == RoleState.Die)
  3350. return;
  3351. if (this.displayer < this.attackdistance && this.currolestate == RoleState.Idle) {
  3352. this.ChangeState(RoleState.Attack);
  3353. }
  3354. else {
  3355. this.ChangeState(RoleState.Awake);
  3356. }
  3357. }
  3358. onStateChange(_state, _data) {
  3359. Laya.timer.clearAll(this);
  3360. Laya.timer.clear(this, this.AttackLoop);
  3361. Laya.timer.clear(this, this.MoveLoop);
  3362. Laya.timer.clear(this, this.OnLife);
  3363. if (_state == RoleState.Awake) {
  3364. this.OnEnterAwake();
  3365. }
  3366. else if (_state == RoleState.Die) {
  3367. this.OnEnterDie(_data);
  3368. }
  3369. else if (_state == RoleState.Attack) {
  3370. this.OnEnterAttack();
  3371. }
  3372. else if (_state == RoleState.Idle) {
  3373. this.OnEnterIdle();
  3374. }
  3375. }
  3376. OnEnterIdle() {
  3377. this.curanimator.play("warrioridle");
  3378. this.curanimator.speed = 1;
  3379. if (this.life) {
  3380. Laya.timer.frameOnce(40, this, () => {
  3381. Laya.timer.clear(this, this.OnLife);
  3382. Laya.timer.frameLoop(1, this, this.OnLife);
  3383. });
  3384. }
  3385. }
  3386. OnEnterAttack() {
  3387. Laya.timer.clear(this, this.AttackLoop);
  3388. this.AttackLoop();
  3389. }
  3390. AttackLoop() {
  3391. this.curanimator.play("chuiboosattack");
  3392. this.curanimator.speed = 0.5;
  3393. var attackduation = 250 / this.attackrate;
  3394. if (this.displayer > this.standattackdis) {
  3395. this.AttackTarget = Player.mainpalyer;
  3396. this.movespeed = this.awakespeed;
  3397. Laya.timer.clear(this, this.MoveLoop);
  3398. Laya.timer.frameLoop(1, this, this.MoveLoop);
  3399. }
  3400. Laya.timer.frameOnce(attackduation, this, () => {
  3401. this.ChangeState(RoleState.Idle);
  3402. });
  3403. }
  3404. CheckAttack() {
  3405. if (this.currolestate == RoleState.Die)
  3406. return;
  3407. Player.mainpalyer.ChangeState(RoleState.Die);
  3408. }
  3409. OnEnterAwake() {
  3410. EventManager.Off(EventType.Running, this, this.OnRunning);
  3411. this.life = true;
  3412. this.curanimator.play("run");
  3413. this.curanimator.speed = 1;
  3414. this.SetMove(Player.mainpalyer);
  3415. }
  3416. SetMove(_target) {
  3417. this.AttackTarget = _target;
  3418. this.movespeed = this.awakespeed;
  3419. Laya.timer.clear(this, this.MoveLoop);
  3420. Laya.timer.frameLoop(1, this, this.MoveLoop);
  3421. }
  3422. StopMove() {
  3423. Laya.timer.clear(this, this.MoveLoop);
  3424. this.AttackTarget = null;
  3425. }
  3426. MoveLoop() {
  3427. if (!InputManager.caninput)
  3428. return;
  3429. if (this.AttackTarget && this.AttackTarget.currolestate != RoleState.Die) {
  3430. var mpos = this.cursprite.transform.position.clone();
  3431. Vector3$b.subtract(this.AttackTarget.cursprite.transform.position, mpos, this.movedir);
  3432. Vector3$b.normalize(this.movedir, this.movedir);
  3433. Vector3$b.scale(this.movedir, this.movespeed, this.movedir);
  3434. Vector3$b.add(mpos, this.movedir, this.movepos);
  3435. Vector3$b.lerp(mpos, this.movepos, 0.12, this.movepos);
  3436. this.cursprite.transform.position = this.movepos;
  3437. Laya.Quaternion.lookAt(this.AttackTarget.cursprite.transform.position, mpos, new Vector3$b(0, 1, 0), this.moverot);
  3438. this.moverot.invert(this.moverot);
  3439. Laya.Quaternion.slerp(this.cursprite.transform.rotation, this.moverot, 0.2, this.moverot);
  3440. this.cursprite.transform.rotation = this.moverot;
  3441. if (this.displayer < this.attackdistance) {
  3442. this.ChangeState(RoleState.Attack);
  3443. }
  3444. }
  3445. }
  3446. OnEnterDie(_die) {
  3447. GameManager.Instance.goldnum += LevelManager.Instance.curlevel.leveldata.missiondata.masterdrop;
  3448. if (_die) {
  3449. this.curanimator.play("die");
  3450. this.curanimator.speed = 1;
  3451. if (this.mdata.boos)
  3452. EventManager.Trigger(EventType.BoosDie, [this]);
  3453. Laya.timer.frameOnce(80, this, () => {
  3454. this.FallLand(this.cursprite.transform.position.y - 1, () => {
  3455. this.Clear();
  3456. });
  3457. });
  3458. return;
  3459. }
  3460. var cutasset = AssetManager.effect.getValue(4);
  3461. this.cuteffect = PoolManager.GetSprite3D(cutasset);
  3462. SceneManager.mainscene.addChild(this.cuteffect);
  3463. this.cuteffect.transform.position = this.upsprite.transform.position.clone();
  3464. this.diedownsprite = PoolManager.GetSprite3D(AssetManager.enemy.getValue(1));
  3465. SceneManager.mainscene.addChild(this.diedownsprite);
  3466. this.diedownsprite.transform.position = this.cursprite.transform.position.clone();
  3467. this.diedownsprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
  3468. this.diedownsprite.transform.setWorldLossyScale(new Vector3$b(1.2, 1.2, 1.2));
  3469. var dieupsprite = this.diedownsprite.getChildAt(0).getChildAt(2);
  3470. dieupsprite.active = false;
  3471. var dieupsprite2 = this.diedownsprite.getChildAt(0).getChildAt(1);
  3472. dieupsprite2.active = true;
  3473. var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
  3474. dieani.speed = 0;
  3475. var diec = this.diedownsprite.getChildAt(1).getComponent(Laya.PhysicsCollider);
  3476. diec.enabled = false;
  3477. var downrig = new RigObj(this.diedownsprite, null, 1, 1);
  3478. downrig.minhight = 1;
  3479. downrig.AddForce(new Laya.Vector3(0, 1, 0.5), 0.6);
  3480. this.curanimator.speed = 0;
  3481. this.downsprite.active = false;
  3482. var mrig = new RigObj(this.cursprite, () => {
  3483. this.Clear();
  3484. }, 1);
  3485. mrig.AddForce(new Laya.Vector3(0, 1, 0.6), 0.5, 2);
  3486. if (this.mdata.boos)
  3487. EventManager.Trigger(EventType.BoosDie, [this]);
  3488. }
  3489. BeBoom() {
  3490. this.ChangeState(RoleState.Die, true);
  3491. }
  3492. OnEnterLose() {
  3493. }
  3494. onUpdate() {
  3495. }
  3496. EscapeLoop() {
  3497. }
  3498. AwakeLoop() {
  3499. }
  3500. onTriggerEnter(_collider) {
  3501. }
  3502. SkinShow(headid, weaponid) {
  3503. for (var i = 0; i < this.headpoint.numChildren; i++) {
  3504. var head = this.headpoint.getChildAt(i);
  3505. head.active = headid - 1 == i;
  3506. }
  3507. for (var i = 0; i < this.weaponpoint.numChildren; i++) {
  3508. var weapon = this.weaponpoint.getChildAt(i);
  3509. if (weaponid - 1 == i) {
  3510. this.curweapon = weapon;
  3511. this.curweapon.active = true;
  3512. this.curweapon.addComponent(ChuiCheck);
  3513. this.curweaponid = weaponid;
  3514. }
  3515. else {
  3516. weapon.active = false;
  3517. }
  3518. }
  3519. }
  3520. }
  3521. var Vector3$c = Laya.Vector3;
  3522. class GirlData extends RoleData {
  3523. constructor(_id, _startpos) {
  3524. super(_id, _startpos);
  3525. }
  3526. }
  3527. class Girl extends Role {
  3528. constructor() {
  3529. super(...arguments);
  3530. this.awakedistance = 8;
  3531. this.life = false;
  3532. }
  3533. static Create(_data) {
  3534. var roleid = _data.id;
  3535. var roleasset = AssetManager.girl.getValue(roleid);
  3536. var model = PoolManager.GetSprite3D(roleasset);
  3537. SceneManager.mainscene.addChild(model);
  3538. model.transform.position = new Vector3$c(_data.startpos.x, _data.startpos.y, _data.startpos.z);
  3539. model.transform.rotationEuler = new Vector3$c(model.transform.rotationEuler.x, 360 - _data.startpos.w, model.transform.rotationEuler.z);
  3540. var monster = model.addComponent(Girl);
  3541. monster.Init(model);
  3542. monster.collider = model.getChildAt(1).getComponent(Laya.PhysicsCollider);
  3543. monster.collider.collisionGroup = ColliderLay.monster;
  3544. monster.OnInit();
  3545. return monster;
  3546. }
  3547. OnInit() {
  3548. this.mlevel = LevelManager.Instance.curlevel;
  3549. this.RegEvent();
  3550. }
  3551. OnClear() {
  3552. EventManager.Off(EventType.Cut, this, this.OnCut);
  3553. EventManager.Off(EventType.Running, this, this.OnRunning);
  3554. }
  3555. RegEvent() {
  3556. EventManager.On(EventType.Cut, this, this.OnCut);
  3557. EventManager.On(EventType.Running, this, this.OnRunning);
  3558. }
  3559. OnCut(_collider) {
  3560. if (_collider != this.collider)
  3561. return;
  3562. this.ChangeState(RoleState.Die);
  3563. }
  3564. get displayer() {
  3565. var curpos = this.cursprite.transform.position.clone();
  3566. var mainplayerpos = Player.mainpalyer.cursprite.transform.position.clone();
  3567. var dis = GameUtils.Vector32Length(mainplayerpos, curpos);
  3568. return dis;
  3569. }
  3570. OnRunning(_playerpos) {
  3571. if (this.life)
  3572. return;
  3573. var curpos = this.cursprite.transform.position.clone();
  3574. var dis = GameUtils.Vector32Length(_playerpos, curpos);
  3575. if (dis < this.awakedistance && this.currolestate == RoleState.Idle) {
  3576. this.ChangeState(RoleState.Awake);
  3577. }
  3578. }
  3579. OnLife() {
  3580. if (Player.mainpalyer.currolestate == RoleState.Die)
  3581. return;
  3582. this.ChangeState(RoleState.Awake);
  3583. }
  3584. onStateChange(_state, _data) {
  3585. Laya.timer.clearAll(this);
  3586. Laya.timer.clear(this, this.OnLife);
  3587. if (_state == RoleState.Awake) {
  3588. this.OnEnterAwake();
  3589. }
  3590. else if (_state == RoleState.Die) {
  3591. this.OnEnterDie();
  3592. }
  3593. else if (_state == RoleState.Attack) {
  3594. this.OnEnterAttack();
  3595. }
  3596. else if (_state == RoleState.Idle) {
  3597. this.OnEnterIdle();
  3598. }
  3599. }
  3600. OnEnterIdle() {
  3601. this.curanimator.play("idle");
  3602. if (this.life) {
  3603. Laya.timer.frameOnce(40, this, () => {
  3604. Laya.timer.clear(this, this.OnLife);
  3605. Laya.timer.frameLoop(1, this, this.OnLife);
  3606. });
  3607. }
  3608. }
  3609. OnEnterAttack() {
  3610. Laya.timer.clear(this, this.AttackLoop);
  3611. this.AttackLoop();
  3612. }
  3613. AttackLoop() {
  3614. this.curanimator.play("help");
  3615. var attackduation = 80;
  3616. Laya.timer.frameOnce(attackduation, this, () => {
  3617. this.ChangeState(RoleState.Idle);
  3618. });
  3619. }
  3620. OnEnterAwake() {
  3621. this.life = true;
  3622. }
  3623. OnEnterDie() {
  3624. this.curanimator.play("die");
  3625. Laya.timer.frameOnce(50, this, () => {
  3626. this.FallLand(0, () => {
  3627. this.Clear();
  3628. });
  3629. GameManager.Instance.ChangeGameState(GameState.Lose);
  3630. });
  3631. }
  3632. OnEnterLose() {
  3633. }
  3634. onUpdate() {
  3635. }
  3636. EscapeLoop() {
  3637. }
  3638. AwakeLoop() {
  3639. }
  3640. onTriggerEnter(_collider) {
  3641. }
  3642. }
  3643. var taskstate;
  3644. (function (taskstate) {
  3645. taskstate[taskstate["lock"] = 0] = "lock";
  3646. taskstate[taskstate["open"] = 1] = "open";
  3647. taskstate[taskstate["complete"] = 2] = "complete";
  3648. taskstate[taskstate["geted"] = 3] = "geted";
  3649. })(taskstate || (taskstate = {}));
  3650. class Task {
  3651. constructor(_id) {
  3652. this.state = 0;
  3653. this.find = 1;
  3654. this.id = _id;
  3655. }
  3656. }
  3657. class TaskManager {
  3658. constructor() {
  3659. TaskManager.Init();
  3660. }
  3661. static Init() {
  3662. if (PlayerAccount.is_new) {
  3663. Laya.LocalStorage.removeItem("cdtask");
  3664. Laya.LocalStorage.removeItem("firstbx");
  3665. Laya.LocalStorage.removeItem("firstshare");
  3666. Laya.LocalStorage.removeItem("curleveldata");
  3667. Laya.LocalStorage.removeItem("tzpre");
  3668. }
  3669. var cdtask = Laya.LocalStorage.getItem("cdtask");
  3670. if (cdtask) {
  3671. this.cdtask = JSON.parse(cdtask);
  3672. for (var i = 0; i < this.cdtask.length; i++) {
  3673. var cddata = this.cdtask[i];
  3674. var id = Number(cddata.id);
  3675. var curtask = new Task(id);
  3676. curtask.title = cddata.title;
  3677. curtask.content = cddata.content;
  3678. curtask.cdk = Number(cddata.cdk);
  3679. curtask.find = Number(cddata.find);
  3680. curtask.state = Number(cddata.state);
  3681. this.taskdic.add(id, curtask);
  3682. }
  3683. }
  3684. else {
  3685. var exchange = PlayerAccount.CurAccountData.GetConfig(AccountConfig.exchange);
  3686. if (exchange) {
  3687. for (var key in exchange) {
  3688. var data = exchange[key];
  3689. var id = Number(data.id);
  3690. var curtask = new Task(id);
  3691. curtask.title = data.name;
  3692. curtask.content = data.content;
  3693. curtask.cdk = Number(data.code);
  3694. this.taskdic.add(id, curtask);
  3695. }
  3696. }
  3697. for (var i = 0; i < this.taskdic.values.length; i++) {
  3698. var cuss = this.taskdic.values[i];
  3699. var mdd = {};
  3700. mdd["id"] = cuss.id;
  3701. mdd["title"] = cuss.title;
  3702. mdd["content"] = cuss.content;
  3703. mdd["cdk"] = cuss.cdk;
  3704. mdd["state"] = 0;
  3705. mdd["find"] = 1;
  3706. this.cdtask.push(mdd);
  3707. }
  3708. var mcdmes = JSON.stringify(this.cdtask);
  3709. Laya.LocalStorage.setItem("cdtask", mcdmes);
  3710. }
  3711. }
  3712. static SetData(_data = null) {
  3713. if (this.cdtask.length > 0) {
  3714. if (_data != null) {
  3715. for (var i = 0; i < this.cdtask.length; i++) {
  3716. if (_data.id == this.cdtask[i].id) {
  3717. this.cdtask[i].find = _data.find;
  3718. this.cdtask[i].state = _data.state;
  3719. break;
  3720. }
  3721. }
  3722. }
  3723. var mcdmes = JSON.stringify(this.cdtask);
  3724. Laya.LocalStorage.setItem("cdtask", mcdmes);
  3725. this.taskdic = new Dictionary();
  3726. for (var i = 0; i < this.cdtask.length; i++) {
  3727. var cddata = this.cdtask[i];
  3728. var id = Number(cddata.id);
  3729. var curtask = new Task(id);
  3730. curtask.title = cddata.title;
  3731. curtask.content = cddata.content;
  3732. curtask.cdk = Number(cddata.cdk);
  3733. curtask.find = Number(cddata.find);
  3734. curtask.state = Number(cddata.state);
  3735. this.taskdic.add(id, curtask);
  3736. }
  3737. }
  3738. }
  3739. static GetEgg(_set = false) {
  3740. if (this.cdtask.length > 0) {
  3741. var mcd;
  3742. var mms = [];
  3743. for (var i = 0; i < this.cdtask.length; i++) {
  3744. var fgg = this.cdtask[i];
  3745. if (fgg.find == 1) {
  3746. mms.push(fgg);
  3747. }
  3748. }
  3749. if (mms.length > 0) {
  3750. mcd = mms[GameUtils.getRandomInt(0, mms.length - 1)];
  3751. }
  3752. if (mcd != null && _set) {
  3753. mcd.find = 1;
  3754. this.SetData();
  3755. }
  3756. }
  3757. return mcd;
  3758. }
  3759. static OpenEgg(_egg) {
  3760. for (var i = 0; i < this.cdtask.length; i++) {
  3761. var mtassk = this.cdtask[i];
  3762. if (mtassk.id == _egg.id && mtassk.state == 0) {
  3763. mtassk.state = 1;
  3764. this.SetData();
  3765. break;
  3766. }
  3767. }
  3768. }
  3769. static CompleteEgg(_egg) {
  3770. for (var i = 0; i < this.cdtask.length; i++) {
  3771. var mtassk = this.cdtask[i];
  3772. if (mtassk.id == _egg.id && mtassk.state == 1) {
  3773. mtassk.state = 2;
  3774. this.SetData();
  3775. break;
  3776. }
  3777. }
  3778. }
  3779. static GeEgg(_id) {
  3780. var has = false;
  3781. var curtask;
  3782. for (var i = 0; i < this.taskdic.values.length; i++) {
  3783. var mtask = this.taskdic.values[i];
  3784. if (mtask.cdk == _id) {
  3785. has = true;
  3786. curtask = mtask;
  3787. break;
  3788. }
  3789. }
  3790. if (has) {
  3791. for (var i = 0; i < this.cdtask.length; i++) {
  3792. var mtassk = this.cdtask[i];
  3793. if (mtassk.id == curtask.id && mtassk.state == 2) {
  3794. mtassk.state = 3;
  3795. this.SetData();
  3796. break;
  3797. }
  3798. }
  3799. }
  3800. }
  3801. }
  3802. TaskManager.cdtask = [];
  3803. TaskManager.taskdic = new Dictionary();
  3804. var Vector3$d = Laya.Vector3;
  3805. class missiondata {
  3806. constructor(_id) {
  3807. this.color = new Laya.Vector4(130 / 255, 201 / 255, 254 / 255);
  3808. this.trial = false;
  3809. this.ID = _id;
  3810. }
  3811. }
  3812. class LevelData {
  3813. constructor(id) {
  3814. this.camerapos = new Vector3$d();
  3815. this.cameraerot = new Vector3$d();
  3816. this.girldatas = [];
  3817. this.enemydatas = [];
  3818. this.builddatas = [];
  3819. this.roaddatas = [];
  3820. this.move = 1.25;
  3821. this.color = new Laya.Vector4();
  3822. this.id = Number(id);
  3823. }
  3824. getbooslevel() {
  3825. var ss = false;
  3826. for (var i = 0; i < this.enemydatas.length; i++) {
  3827. var curenemy = this.enemydatas[i];
  3828. if (curenemy.boos) {
  3829. ss = true;
  3830. }
  3831. }
  3832. for (var i = 0; i < this.builddatas.length; i++) {
  3833. var curbuild = this.builddatas[i];
  3834. if (curbuild.boos) {
  3835. ss = true;
  3836. }
  3837. }
  3838. return ss;
  3839. }
  3840. }
  3841. class Level {
  3842. constructor(_id, _config) {
  3843. this.simple = false;
  3844. this.gameroles = [];
  3845. this.booss = [];
  3846. this.lenemys = [];
  3847. this.roads = [];
  3848. this.builds = [];
  3849. this.caocongs = [];
  3850. this.leveltasks = [];
  3851. this.minhight = 100;
  3852. this.allboomree = false;
  3853. this.create = false;
  3854. this.clear = false;
  3855. this.levelid = _id;
  3856. this.leveldata = _config;
  3857. this.Init();
  3858. }
  3859. Init() {
  3860. this.map = new Laya.Node();
  3861. this.levelname = "stage" + this.levelid;
  3862. this.map.name = this.levelname;
  3863. }
  3864. GetTask() {
  3865. this.leveltasks = [];
  3866. for (var i = 0; i < TaskManager.taskdic.values.length; i++) {
  3867. var mtask = TaskManager.taskdic.values[i];
  3868. if (mtask.state == taskstate.open) {
  3869. this.leveltasks.push(mtask);
  3870. }
  3871. }
  3872. }
  3873. Create() {
  3874. if (this.create)
  3875. return;
  3876. this.GetTask();
  3877. EventManager.On(EventType.BoosDie, this, this.OnBoosDie);
  3878. EventManager.On(EventType.UseSkin, this, this.OnUseSkin);
  3879. SceneManager.maincamera.clearColor = this.leveldata.missiondata.color;
  3880. SceneManager.maincamera.transform.position = this.leveldata.camerapos;
  3881. SceneManager.maincamera.transform.rotationEuler = this.leveldata.cameraerot;
  3882. if (this.leveldata.endpos) {
  3883. SceneManager.endsprite.active = true;
  3884. SceneManager.endsprite.transform.position = this.leveldata.endpos;
  3885. SceneManager.endsprite.transform.rotationEuler = new Vector3$d(0, this.leveldata.enderoty, 0);
  3886. }
  3887. else {
  3888. SceneManager.endsprite.active = false;
  3889. }
  3890. var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[skintype.role];
  3891. var equiipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
  3892. equiipskin = equiipskin == null ? PlayerAccount.CurAccountData.m_skinDic.getValue(1) : equiipskin;
  3893. var mainplayer = Player.Create(this.leveldata.playerdata, equiipskin);
  3894. this.gameroles.push(mainplayer);
  3895. for (var i = 0; i < this.leveldata.enemydatas.length; i++) {
  3896. var curenemydata = this.leveldata.enemydatas[i];
  3897. var monster;
  3898. if (curenemydata.monsterconfig.monstertype == MonsterType.Warrior) {
  3899. monster = Warrior.Create(curenemydata);
  3900. }
  3901. else if (curenemydata.monsterconfig.monstertype == MonsterType.Shooter) {
  3902. monster = Shooter.Create(curenemydata);
  3903. }
  3904. else {
  3905. monster = BallBoos.Create(curenemydata);
  3906. }
  3907. if (curenemydata.boos) {
  3908. this.booss.push(monster);
  3909. }
  3910. this.lenemys.push(monster);
  3911. this.gameroles.push(monster);
  3912. }
  3913. for (var i = 0; i < this.leveldata.girldatas.length; i++) {
  3914. var girldata = this.leveldata.girldatas[i];
  3915. var mgirl = Girl.Create(girldata);
  3916. this.gameroles.push(mgirl);
  3917. }
  3918. for (var i = 0; i < this.leveldata.builddatas.length; i++) {
  3919. var curbuilddata = this.leveldata.builddatas[i];
  3920. var mbuild = GameManager.GetBuild(curbuilddata);
  3921. SceneManager.mainscene.addChild(mbuild.cursprite);
  3922. mbuild.cursprite.transform.position = new Vector3$d(curbuilddata.startpos.x, curbuilddata.startpos.y, curbuilddata.startpos.z);
  3923. mbuild.cursprite.transform.rotationEuler = new Vector3$d(-mbuild.cursprite.transform.rotationEuler.x, 360 - curbuilddata.starteroty, mbuild.cursprite.transform.rotationEuler.z);
  3924. mbuild.OnInit();
  3925. this.builds.push(mbuild);
  3926. if (mbuild.mdata.buildid == 6) {
  3927. this.caocongs.push(mbuild);
  3928. }
  3929. }
  3930. for (var i = 0; i < this.leveldata.roaddatas.length; i++) {
  3931. var curroad = this.leveldata.roaddatas[i];
  3932. var mroad = new Road(curroad);
  3933. this.roads.push(mroad);
  3934. if (mroad.cursprite.transform.position.y < this.minhight) {
  3935. this.minhight = mroad.cursprite.transform.position.y;
  3936. }
  3937. }
  3938. console.log("minhight:", this.minhight);
  3939. console.log("Create Level", this.levelid);
  3940. this.create = true;
  3941. this.clear = false;
  3942. }
  3943. Clear() {
  3944. if (this.clear)
  3945. return;
  3946. SceneManager.endsprite.active = false;
  3947. EventManager.Off(EventType.UseSkin, this, this.OnUseSkin);
  3948. EventManager.Off(EventType.BoosDie, this, this.OnBoosDie);
  3949. this.leveltasks = [];
  3950. this.lenemys = [];
  3951. for (var i = 0; i < this.gameroles.length; i++) {
  3952. var currole = this.gameroles[i];
  3953. currole.Clear();
  3954. }
  3955. this.gameroles = [];
  3956. this.booss = [];
  3957. for (var i = 0; i < this.builds.length; i++) {
  3958. var curbuild = this.builds[i];
  3959. curbuild.Clear();
  3960. }
  3961. this.builds = [];
  3962. for (var i = 0; i < this.roads.length; i++) {
  3963. var curroad = this.roads[i];
  3964. curroad.Clear();
  3965. }
  3966. this.roads = [];
  3967. console.log("Clear Level", this.levelid);
  3968. this.create = false;
  3969. this.clear = true;
  3970. }
  3971. get allccclear() {
  3972. if (this.caocongs.length == 0)
  3973. return false;
  3974. for (var i = 0; i < this.caocongs.length; i++) {
  3975. var mcc = this.caocongs[i];
  3976. if (!mcc.die) {
  3977. return false;
  3978. }
  3979. }
  3980. return true;
  3981. }
  3982. get alllenemynoneclear() {
  3983. if (this.lenemys.length == 0)
  3984. return false;
  3985. for (var i = 0; i < this.lenemys.length; i++) {
  3986. var menene = this.lenemys[i];
  3987. if (menene.die) {
  3988. return false;
  3989. }
  3990. }
  3991. return true;
  3992. }
  3993. get allbuildnoclear() {
  3994. if (this.builds.length == 0)
  3995. return false;
  3996. for (var i = 0; i < this.builds.length; i++) {
  3997. var mbbd = this.builds[i];
  3998. if (mbbd.die) {
  3999. return false;
  4000. }
  4001. }
  4002. return true;
  4003. }
  4004. OnBoosDie(_role) {
  4005. console.log("BoosDie", this.booss.length);
  4006. var curboosindex = this.booss.indexOf(_role);
  4007. if (curboosindex != -1) {
  4008. this.booss.splice(curboosindex, 1);
  4009. }
  4010. if (this.booss.length == 0) {
  4011. Player.mainpalyer.ChangeState(RoleState.Win);
  4012. }
  4013. }
  4014. OnUseSkin(_skin) {
  4015. if (_skin == null)
  4016. return;
  4017. if (_skin.skintype == skintype.role) {
  4018. var curplayer = Player.mainpalyer;
  4019. var curstandpos = curplayer.revivepoint;
  4020. var curindex = this.gameroles.indexOf(curplayer);
  4021. this.gameroles.splice(curindex, 1);
  4022. curplayer.Clear();
  4023. this.leveldata.playerdata.startpos = new Laya.Vector4(curstandpos.x, curstandpos.y, curstandpos.z, 0);
  4024. var mainplayer = Player.Create(this.leveldata.playerdata, _skin);
  4025. this.gameroles.push(mainplayer);
  4026. }
  4027. else if (_skin.skintype == skintype.weapon) {
  4028. var curplayer = Player.mainpalyer;
  4029. curplayer.WeaponShow(_skin);
  4030. }
  4031. else {
  4032. var curplayer = Player.mainpalyer;
  4033. curplayer.TurnWeaponEffect(_skin);
  4034. }
  4035. }
  4036. }
  4037. var Vector3$e = Laya.Vector3;
  4038. class LevelManager {
  4039. constructor() {
  4040. this.missiondatas = new Dictionary();
  4041. this.leveldatas = new Dictionary();
  4042. this.levelConfigs = new Dictionary();
  4043. LevelManager.instance = this;
  4044. console.log("关卡初始化...");
  4045. this.LevelInit();
  4046. }
  4047. static get Instance() {
  4048. return LevelManager.instance;
  4049. }
  4050. LevelInit() {
  4051. this.LevelConfigInit();
  4052. }
  4053. LevelConfigInit() {
  4054. var mission = PlayerAccount.CurAccountData.GetConfig(AccountConfig.mission);
  4055. for (var key in mission) {
  4056. var misdata = mission[key];
  4057. var id = Number(misdata.ID);
  4058. var curmisdata = new missiondata(id);
  4059. curmisdata.win = Number(misdata.win);
  4060. curmisdata.lose = Number(misdata.lose);
  4061. curmisdata.masterdrop = Number(misdata.masterdrop);
  4062. curmisdata.move = Number(misdata.move);
  4063. var misdatacolor = misdata.color.split(";");
  4064. curmisdata.color = new Laya.Vector4(Number(misdatacolor[0]) / 255, Number(misdatacolor[1]) / 255, Number(misdatacolor[2]) / 255, 1);
  4065. var curmisdatatrial = misdata.trial;
  4066. curmisdata.trial = curmisdatatrial == 1;
  4067. curmisdata.type = misdata.type;
  4068. this.missiondatas.add(id, curmisdata);
  4069. }
  4070. var leveldataconfig = PlayerAccount.CurAccountData.GetConfig(AccountConfig.config);
  4071. var leveldataS = "";
  4072. for (var key in leveldataconfig) {
  4073. var curconfig = leveldataconfig[key]["config"];
  4074. leveldataS += curconfig;
  4075. }
  4076. leveldataconfig = JSON.parse(leveldataS);
  4077. for (var key in leveldataconfig) {
  4078. var configdata = leveldataconfig[key];
  4079. var id = Number(configdata.id);
  4080. var leveldata = new LevelData(id);
  4081. var camera = configdata.camera.split(",");
  4082. leveldata.camerapos = new Vector3$e(-Number(camera[0]), Number(camera[1]), Number(camera[2]));
  4083. leveldata.cameraerot = new Vector3$e(-Number(camera[3]), 180 - Number(camera[4]), Number(camera[5]));
  4084. var player = configdata.player.split(",");
  4085. leveldata.playerdata = new PlayerData(Number(player[0]), new Laya.Vector4(-Number(player[1]), Number(player[2]), Number(player[3])));
  4086. if (configdata["end"] && configdata["end"] != "") {
  4087. var curend = configdata["end"].split(",");
  4088. leveldata.endpos = new Vector3$e(-Number(curend[0]), Number(curend[1]), Number(curend[2]));
  4089. leveldata.enderoty = 360 - Number(curend[3]);
  4090. }
  4091. if (configdata.enemy && configdata.enemy != "") {
  4092. var curmonsters = configdata.enemy.split(":");
  4093. for (var i = 0; i < curmonsters.length; i++) {
  4094. var curmonster = curmonsters[i].split(",");
  4095. var curenemy = new MonsterData(Number(curmonster[0]), new Laya.Vector4(-Number(curmonster[1]), Number(curmonster[2]), Number(curmonster[3]), Number(curmonster[4])));
  4096. curenemy.boos = curmonster[5] == "1";
  4097. leveldata.enemydatas.push(curenemy);
  4098. }
  4099. }
  4100. if (configdata.barrier && configdata.barrier != "") {
  4101. var curbarriers = configdata.barrier.split(":");
  4102. for (var i = 0; i < curbarriers.length; i++) {
  4103. var curbarrier = curbarriers[i].split(",");
  4104. var curobs = new builddata(buildtype.barrier, Number(curbarrier[0]), new Laya.Vector4(-Number(curbarrier[1]), Number(curbarrier[2]), Number(curbarrier[3]), Number(curbarrier[4])));
  4105. leveldata.builddatas.push(curobs);
  4106. }
  4107. }
  4108. if (configdata.stand && configdata.stand != "") {
  4109. var curstands = configdata.stand.split(":");
  4110. for (var i = 0; i < curstands.length; i++) {
  4111. var curstand = curstands[i].split(",");
  4112. var curst = new builddata(buildtype.stand, Number(curstand[0]), new Laya.Vector4(-Number(curstand[3]), Number(curstand[4]), Number(curstand[5]), Number(curstand[6])));
  4113. curst.monsterid = Number(curstand[1]);
  4114. curst.boos = curstand[2] == 1;
  4115. leveldata.builddatas.push(curst);
  4116. }
  4117. }
  4118. if (configdata.road && configdata.road != "") {
  4119. var curroad = configdata.road.split(":");
  4120. for (var i = 0; i < curroad.length; i++) {
  4121. var currd = curroad[i].split(",");
  4122. var curr = new RoadData(Number(currd[0]));
  4123. curr.pos = new Vector3$e(-Number(currd[1]), Number(currd[2]), Number(currd[3]));
  4124. curr.erot = new Vector3$e(Number(currd[4]), Number(currd[5]), Number(currd[6]));
  4125. curr.scale = new Vector3$e(Number(currd[7]), Number(currd[8]), Number(currd[9]));
  4126. leveldata.roaddatas.push(curr);
  4127. }
  4128. }
  4129. if (configdata.girl && configdata.girl != "") {
  4130. var curgirl = configdata.girl.split(":");
  4131. for (var i = 0; i < curgirl.length; i++) {
  4132. var mg = curgirl[i].split(",");
  4133. var startpos = new Laya.Vector4(-Number(mg[1]), Number(mg[2]), Number(mg[3]), Number(mg[4]));
  4134. var mgdata = new GirlData(Number(mg[0]), startpos);
  4135. leveldata.girldatas.push(mgdata);
  4136. }
  4137. }
  4138. if (this.missiondatas.containKey(id)) {
  4139. var misda = this.missiondatas.getValue(id);
  4140. leveldata.missiondata = misda;
  4141. }
  4142. this.leveldatas.add(id, leveldata);
  4143. var curlevel = new Level(leveldata.id, leveldata);
  4144. this.levelConfigs.add(curlevel.levelid, curlevel);
  4145. }
  4146. var levelcount = this.levelConfigs.count;
  4147. while (this.levelConfigs.count < 500) {
  4148. var curcount = this.levelConfigs.count;
  4149. var randomindex = GameUtils.getRandomInt(levelcount * 0.5, this.levelConfigs.count);
  4150. var randomlevel = this.levelConfigs.getValue(randomindex);
  4151. var newdata = new LevelData(curcount + 1);
  4152. newdata.camerapos = randomlevel.leveldata.camerapos;
  4153. newdata.cameraerot = randomlevel.leveldata.cameraerot;
  4154. newdata.endpos = randomlevel.leveldata.endpos;
  4155. newdata.enderoty = randomlevel.leveldata.enderoty;
  4156. newdata.playerdata = randomlevel.leveldata.playerdata;
  4157. newdata.girldatas = randomlevel.leveldata.girldatas;
  4158. newdata.enemydatas = randomlevel.leveldata.enemydatas;
  4159. newdata.builddatas = randomlevel.leveldata.builddatas;
  4160. newdata.roaddatas = randomlevel.leveldata.roaddatas;
  4161. newdata.missiondata = randomlevel.leveldata.missiondata;
  4162. var curnelevel = new Level(curcount + 1, newdata);
  4163. this.levelConfigs.add(curnelevel.levelid, curnelevel);
  4164. }
  4165. }
  4166. CreateLevel(_level) {
  4167. this.curlevel = _level;
  4168. _level.Create();
  4169. EventManager.Trigger(EventType.LevelCreateComplete, [_level]);
  4170. }
  4171. ReadyLevel() {
  4172. var stage = Number(PlayerAccount.CurAccountData.GetUser(AccountUser.stage));
  4173. console.log("ready level", stage + 1);
  4174. this.curlevel = this.levelConfigs.getValue(Number(stage + 1));
  4175. this.CreateLevel(this.curlevel);
  4176. }
  4177. ClearLevel() {
  4178. if (this.curlevel)
  4179. this.curlevel.Clear();
  4180. }
  4181. }
  4182. LevelManager.teststage = 19;
  4183. class HomeWindow extends ui.Window.HomeWindowUI {
  4184. constructor() {
  4185. super();
  4186. this.showlevel = [];
  4187. this.cantouch = true;
  4188. HomeWindow.instance = this;
  4189. }
  4190. static get Instance() {
  4191. return HomeWindow.instance;
  4192. }
  4193. InitSize() {
  4194. this.height = Laya.stage.height;
  4195. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  4196. this.moneypan.y = Laya.stage.height / 1280 * this.moneypan.y;
  4197. this.bottombtnpan.y = Laya.stage.height / 1280 * this.bottombtnpan.y;
  4198. this.stagepan.y = Laya.stage.height / 1280 * this.stagepan.y;
  4199. this.videopan.y = Laya.stage.height / 1280 * this.videopan.y;
  4200. }
  4201. getshowleveldata() {
  4202. var levels = [];
  4203. var curstageid = Number(PlayerAccount.CurAccountData.GetUser(AccountUser.stage)) + 1;
  4204. var levelsdata = LevelManager.Instance.levelConfigs.values;
  4205. for (var i = 0; i < levelsdata.length; i++) {
  4206. var curdata = levelsdata[i].leveldata;
  4207. if (curdata.id >= curstageid - 2 && curdata.id <= curstageid + 2) {
  4208. curdata.booslevel = curdata.getbooslevel();
  4209. if (curdata.id < curstageid)
  4210. curdata.state = -1;
  4211. if (curdata.id == curstageid)
  4212. curdata.state = 0;
  4213. if (curdata.id > curstageid)
  4214. curdata.state = 1;
  4215. levels.push(curdata);
  4216. }
  4217. }
  4218. var maxstage = levels[levels.length - 1].id;
  4219. if (levels.length == 4) {
  4220. var nextlevel = LevelManager.Instance.levelConfigs.getValue(maxstage + 1).leveldata;
  4221. nextlevel.booslevel = nextlevel.getbooslevel();
  4222. levels.push(nextlevel);
  4223. }
  4224. else if (levels.length == 3) {
  4225. var nextlevel = LevelManager.Instance.levelConfigs.getValue(maxstage + 1).leveldata;
  4226. nextlevel.booslevel = nextlevel.getbooslevel();
  4227. nextlevel.state = 1;
  4228. var nextlevel2 = LevelManager.Instance.levelConfigs.getValue(maxstage + 2).leveldata;
  4229. nextlevel2.booslevel = nextlevel2.getbooslevel();
  4230. nextlevel2.state = 1;
  4231. levels.push(nextlevel);
  4232. levels.push(nextlevel2);
  4233. }
  4234. return levels;
  4235. }
  4236. OnOpen(data = false) {
  4237. console.log("主界面打开...");
  4238. TtSdk.RecordEvent("enterMain");
  4239. this.InitSize();
  4240. this.RegButton();
  4241. this.showlevel = this.getshowleveldata();
  4242. this.RenderStage();
  4243. this.moneyclip.text = PlayerAccount.CurAccountData.GetUser(AccountUser.money);
  4244. }
  4245. RegButton() {
  4246. this.startbtn.clickHandler = Laya.Handler.create(this, this.OnClickStart, null, false);
  4247. this.othergamebtn.clickHandler = Laya.Handler.create(this, this.OnClickMoreGame, null, false);
  4248. this.skinbtn.clickHandler = Laya.Handler.create(this, this.OnClickSkinShop, null, false);
  4249. this.signbtn.clickHandler = Laya.Handler.create(this, this.OnSign, null, false);
  4250. this.cdbtn.clickHandler = Laya.Handler.create(this, this.OnClickCD, null, false);
  4251. this.videogetweapon.clickHandler = Laya.Handler.create(this, this.OnClickVideoGetWeapon, null, false);
  4252. this.videogettw.clickHandler = Laya.Handler.create(this, this.OnClickVideoGetTw, null, false);
  4253. EventManager.InputOn(TouchState.slider, this, this.OnTouchStart);
  4254. }
  4255. OnClickVideoGetWeapon() {
  4256. var reward = PlayerAccount.CurAccountData.GetReward(skintype.weapon);
  4257. if (reward == null)
  4258. return;
  4259. ADHelper.showVideoAd((flag) => {
  4260. if (flag) {
  4261. this.VideoGet(reward);
  4262. }
  4263. });
  4264. }
  4265. OnClickVideoGetTw() {
  4266. var reward = PlayerAccount.CurAccountData.GetReward(skintype.tw);
  4267. if (reward == null)
  4268. return;
  4269. ADHelper.showVideoAd((flag) => {
  4270. if (flag) {
  4271. this.VideoGet(reward);
  4272. }
  4273. });
  4274. }
  4275. VideoGet(_reward) {
  4276. var reward_item = _reward.rewarditem;
  4277. let param = [{ "reward_item": reward_item.toString() }, { "reward_num": _reward.rewardnum.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
  4278. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
  4279. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, _reward);
  4280. }), Laya.Handler.create(this, this.OnSignError), true);
  4281. }
  4282. RenderStage() {
  4283. for (var i = 0; i < this.stagelist.numChildren; i++) {
  4284. var _cell = this.stagelist.getChildAt(i);
  4285. var curdata = this.showlevel[i];
  4286. var bg = _cell.getChildAt(0);
  4287. bg.visible = !curdata.booslevel;
  4288. var bgskin = "";
  4289. var stageid = bg.getChildAt(0);
  4290. stageid.text = curdata.id.toString();
  4291. if (curdata.state == -1) {
  4292. bgskin = "zhujiemian-1-1";
  4293. bg.gray = true;
  4294. }
  4295. else if (curdata.state == 0) {
  4296. bgskin = "zhujiemian-3-1";
  4297. }
  4298. else {
  4299. bgskin = "zhujiemian-1-1";
  4300. }
  4301. bg.skin = "game/" + bgskin + ".png";
  4302. var boosksin = "";
  4303. var boosbg = _cell.getChildAt(1);
  4304. boosbg.visible = curdata.booslevel;
  4305. if (curdata.state == -1) {
  4306. boosksin = "zhujiemian-1-3";
  4307. boosbg.gray = true;
  4308. }
  4309. else if (curdata.state == 0) {
  4310. boosksin = "zhujiemian-4-3";
  4311. }
  4312. else {
  4313. boosksin = "zhujiemian-1-3";
  4314. }
  4315. boosbg.skin = "game/" + boosksin + ".png";
  4316. }
  4317. }
  4318. OnHide() {
  4319. Laya.timer.clearAll(this);
  4320. EventManager.InputOff(TouchState.slider, this, this.OnTouchStart);
  4321. }
  4322. OnTouchStart() {
  4323. if (!this.cantouch)
  4324. return;
  4325. var startpoint = new Laya.Point();
  4326. startpoint = this.bottombtnpan.localToGlobal(new Laya.Point(this.startbtn.x, this.startbtn.y));
  4327. var touchpos = new Laya.Vector2(this.mouseX, this.mouseY);
  4328. if (this.mouseX < startpoint.x || this.mouseX > startpoint.x + this.startbtn.width)
  4329. return;
  4330. if (this.mouseY < startpoint.y || this.mouseY > startpoint.y + this.startbtn.height)
  4331. return;
  4332. EventManager.InputOff(TouchState.slider, this, this.OnTouchStart);
  4333. GameManager.Instance.BeginGame();
  4334. }
  4335. OnClickStart() {
  4336. GameManager.Instance.BeginGame();
  4337. }
  4338. OnClickSkinShop() {
  4339. GameUtils.TweenButton(this.skinbtn, () => {
  4340. WindowManager.Instance.ShowWindow(WindowType.SkinWindow);
  4341. });
  4342. }
  4343. OnSign() {
  4344. GameUtils.TweenButton(this.signbtn, () => {
  4345. WindowManager.Instance.ShowWindow(WindowType.SignWindow);
  4346. });
  4347. }
  4348. OnClickCD() {
  4349. WindowManager.Instance.ShowWindow(WindowType.TaskWindow);
  4350. }
  4351. OnClickMoreGame() {
  4352. GameUtils.TweenButton(this.othergamebtn, () => {
  4353. TtSdk.showToast("暂未开放");
  4354. });
  4355. }
  4356. OnSignError(e) {
  4357. console.log(e);
  4358. }
  4359. }
  4360. HomeWindow.sign = true;
  4361. HomeWindow.skin = true;
  4362. class SettlementWindow extends ui.Window.SettlementWindowUI {
  4363. constructor() {
  4364. super();
  4365. this.curwin = false;
  4366. this.videoopen = true;
  4367. this.settment = false;
  4368. SettlementWindow.instance = this;
  4369. }
  4370. static get Instance() {
  4371. return SettlementWindow.instance;
  4372. }
  4373. InitSize() {
  4374. this.height = Laya.stage.height;
  4375. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  4376. this.pan.y = Laya.stage.height / 1280 * this.pan.y;
  4377. this.moneypan.y = Laya.stage.height / 1280 * this.moneypan.y;
  4378. this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
  4379. }
  4380. OnOpen(_win = false) {
  4381. this.curwin = _win;
  4382. this.curlevel = LevelManager.Instance.curlevel;
  4383. var money = this.curwin ? this.curlevel.leveldata.missiondata.win : this.curlevel.leveldata.missiondata.lose;
  4384. money += GameManager.Instance.goldnum;
  4385. this.moneyclip.text = money.toString();
  4386. this.InitSize();
  4387. this.RegButton();
  4388. TtSdk.Instance.RecordStop();
  4389. TtSdk.RecordEvent("openResult");
  4390. this.winshow.visible = this.curwin;
  4391. this.loseshow.visible = !this.curwin;
  4392. this.videoopen = PlayerAccount.CurAccountData.videolock;
  4393. this.videopoint.visible = this.videoopen;
  4394. }
  4395. RegButton() {
  4396. this.nomalaward.clickHandler = Laya.Handler.create(this, this.OnClickNomalAward, null, false);
  4397. this.awardbtn.clickHandler = Laya.Handler.create(this, this.OnGetAward, null, false);
  4398. this.videobtn.clickHandler = Laya.Handler.create(this, this.OnClcikVideo, null, false);
  4399. }
  4400. OnHide() {
  4401. }
  4402. OnClcikVideo() {
  4403. this.videoopen = !this.videoopen;
  4404. this.videopoint.visible = this.videoopen;
  4405. }
  4406. GetSettment(_cb, double = false) {
  4407. if (this.settment) {
  4408. _cb();
  4409. GameManager.Instance.ChangeGameState(GameState.Over, this.curwin);
  4410. }
  4411. this.settment = true;
  4412. var money = this.curwin ? this.curlevel.leveldata.missiondata.win : this.curlevel.leveldata.missiondata.lose;
  4413. money += GameManager.Instance.goldnum;
  4414. if (double)
  4415. money *= 3;
  4416. var goldnum = money.toString();
  4417. var wins = this.curwin ? "1" : "0";
  4418. var agrs = [{ "t": PlayerAccount.CurrentAccount.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id.toString() }, { "win": wins }, { "money": goldnum }];
  4419. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.end, agrs, new Laya.Handler(this, (_data) => {
  4420. _cb();
  4421. }), new Laya.Handler(this, (_data) => {
  4422. console.log("游戏结果err", _data);
  4423. }));
  4424. }
  4425. OnClickNomalAward() {
  4426. GameUtils.TweenButton(this.nomalaward, this.OnSee);
  4427. }
  4428. OnSee() {
  4429. if (SettlementWindow.Instance.videoopen) {
  4430. SettlementWindow.Instance.OnGetAward();
  4431. }
  4432. else {
  4433. SettlementWindow.Instance.GetSettment(() => {
  4434. GameManager.Instance.ChangeGameState(GameState.Over, SettlementWindow.Instance.curwin);
  4435. });
  4436. }
  4437. }
  4438. OnGetAward() {
  4439. if (ADHelper.IsAndroid) {
  4440. ADHelper.showVideoAd((flag) => {
  4441. if (flag) {
  4442. this.GetSettment(() => {
  4443. GameManager.Instance.ChangeGameState(GameState.Over, this.curwin);
  4444. }, true);
  4445. }
  4446. });
  4447. }
  4448. else {
  4449. this.GetSettment(() => {
  4450. GameManager.Instance.ChangeGameState(GameState.Over, this.curwin);
  4451. }, true);
  4452. }
  4453. }
  4454. }
  4455. class RewardWindow extends ui.Window.RewardWindowUI {
  4456. constructor() {
  4457. super();
  4458. RewardWindow.instance = this;
  4459. this.pan.y = Laya.stage.height / 1280 * this.pan.y;
  4460. RewardWindow.btny = this.Btn.y;
  4461. }
  4462. static get Instance() {
  4463. return RewardWindow.instance;
  4464. }
  4465. OnOpen(_rewarddata = null) {
  4466. this.height = Laya.stage.height;
  4467. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  4468. this.Btn.y = Laya.stage.height / 1280 * RewardWindow.btny;
  4469. this.curreward = _rewarddata;
  4470. if (this.curreward == null) {
  4471. WindowManager.Instance.ClosePopView(WindowType.RewardWindow);
  4472. return;
  4473. }
  4474. this.skindesc.visible = false;
  4475. this.usebtn.visible = false;
  4476. this.ShowReward(_rewarddata);
  4477. TtSdk.Showbanner();
  4478. }
  4479. OnHide() {
  4480. }
  4481. OnClickClose() {
  4482. WindowManager.Instance.ClosePopView(WindowType.RewardWindow);
  4483. if (this.closeback) {
  4484. this.closeback();
  4485. this.closeback = null;
  4486. }
  4487. }
  4488. ShowReward(_data) {
  4489. this.closebtn.clickHandler = Laya.Handler.create(this, this.OnClickClose);
  4490. this.icon.skin = "icon/" + _data.rewardicon + ".png";
  4491. this.skindesc.visible = true;
  4492. this.skindesc.text = _data.rewardname;
  4493. this.usebtn.visible = true;
  4494. var skinid = _data.rewarditem % 6000;
  4495. this.usebtn.clickHandler = Laya.Handler.create(this, this.OnUseSkin, [skinid], false);
  4496. }
  4497. OnUseSkin(_id) {
  4498. var skinid = _id;
  4499. var curskin = PlayerAccount.CurAccountData.m_skinDic.getValue(_id);
  4500. var agrs = [{ "id": skinid.toString() }];
  4501. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Equip, agrs, Laya.Handler.create(this, () => {
  4502. PlayerAccount.CurAccountData.UpdateSkinDic();
  4503. this.OnClickClose();
  4504. EventManager.Trigger(EventType.UseSkin, [curskin]);
  4505. }), null);
  4506. }
  4507. }
  4508. RewardWindow.btny = 1;
  4509. class ReviveWindow extends ui.Window.ReviveWindowUI {
  4510. constructor() {
  4511. super();
  4512. this.counttime = 5;
  4513. this.play = true;
  4514. ReviveWindow.instance = this;
  4515. }
  4516. static get Instance() {
  4517. return ReviveWindow.instance;
  4518. }
  4519. InitSize() {
  4520. this.height = Laya.stage.height;
  4521. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  4522. this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
  4523. this.pan.y = Laya.stage.height / 1280 * this.pan.y;
  4524. }
  4525. OnOpen(_win = false) {
  4526. this.InitSize();
  4527. this.RegButton();
  4528. GameManager.alllose++;
  4529. Laya.timer.loop(1000, this, this.OnCountTime);
  4530. TtSdk.RecordEvent("openRelive");
  4531. TtSdk.Showbanner();
  4532. }
  4533. RegButton() {
  4534. this.passbtn.clickHandler = Laya.Handler.create(this, this.OnPass, null, false);
  4535. this.closebtn.clickHandler = Laya.Handler.create(this, this.OnClose, null, false);
  4536. }
  4537. OnHide() {
  4538. Laya.timer.clear(this, this.OnCountTime);
  4539. }
  4540. OnCountTime() {
  4541. if (!this.play)
  4542. return;
  4543. if (this.counttime > 0) {
  4544. this.counttime -= 1;
  4545. }
  4546. else {
  4547. Laya.timer.clear(this, this.OnCountTime);
  4548. this.counttime = 0;
  4549. this.OnClose();
  4550. }
  4551. this.timetex.text = this.counttime.toString();
  4552. }
  4553. OnPass() {
  4554. if (ADHelper.IsAndroid) {
  4555. this.play = false;
  4556. ADHelper.showVideoAd((flag) => {
  4557. if (flag) {
  4558. Player.mainpalyer.Revive();
  4559. GameManager.Instance.ChangeGameState(GameState.Playing);
  4560. }
  4561. else {
  4562. this.play = true;
  4563. }
  4564. });
  4565. }
  4566. else {
  4567. Player.mainpalyer.Revive();
  4568. GameManager.Instance.ChangeGameState(GameState.Playing);
  4569. }
  4570. }
  4571. OnClose() {
  4572. GameManager.Instance.CheckComplete(false);
  4573. }
  4574. }
  4575. class SkinWindow extends ui.Window.SkinWindowUI {
  4576. constructor() {
  4577. super();
  4578. this.curskindatas = [];
  4579. this.rootspeed1 = -0.015;
  4580. this.currotspeed = -0.015;
  4581. this.canwear = true;
  4582. SkinWindow.instance = this;
  4583. }
  4584. static get Instance() {
  4585. return SkinWindow.instance;
  4586. }
  4587. OnOpen(_data = null) {
  4588. this.height = Laya.stage.height;
  4589. this.moneypan.y = Laya.stage.height / 1280 * this.moneypan.y;
  4590. this.homebtn.y = Laya.stage.height / 1280 * this.homebtn.y;
  4591. this.listpan.top = Laya.stage.height / 1280 * this.listpan.top;
  4592. this.cdkbtn.y = Laya.stage.height / 1280 * this.cdkbtn.y;
  4593. this.RegEvent();
  4594. this.moneyclip.text = PlayerAccount.CurAccountData.GetUser(AccountUser.money);
  4595. Laya.timer.once(10, this, () => {
  4596. this.NewShow();
  4597. });
  4598. }
  4599. RegEvent() {
  4600. this.homebtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
  4601. this.pfbtn.clickHandler = Laya.Handler.create(this, this.OnClickXGG, null, false);
  4602. this.wqbtn.clickHandler = Laya.Handler.create(this, this.OnClickXJJ, null, false);
  4603. this.twbtn.clickHandler = Laya.Handler.create(this, this.OnClickTW, null, false);
  4604. this.cdkbtn.clickHandler = Laya.Handler.create(this, this.OnOpenCDkView, null, false);
  4605. EventManager.On(EventType.UseSkin, this, this.ReFreshData);
  4606. EventManager.On(EventType.getmoney, this, this.ReFreshData);
  4607. }
  4608. OnClickXGG() {
  4609. this.SetBtnShow(skintype.role);
  4610. this.ShowBoySkin();
  4611. }
  4612. OnClickXJJ() {
  4613. this.SetBtnShow(skintype.weapon);
  4614. this.ShowGirlSkin();
  4615. }
  4616. OnClickTW() {
  4617. this.SetBtnShow(skintype.tw);
  4618. this.ShowTwSkin();
  4619. }
  4620. OnOpenCDkView() {
  4621. WindowManager.Instance.OpenPopView(WindowType.CDKView);
  4622. }
  4623. SetBtnShow(_skintype) {
  4624. for (var i = 0; i < this.skinpan.numChildren; i++) {
  4625. var skin = this.skinpan.getChildAt(i);
  4626. var closeskin = skin.getChildAt(1);
  4627. if (i + 1 == _skintype) {
  4628. closeskin.visible = false;
  4629. }
  4630. else {
  4631. closeskin.visible = true;
  4632. }
  4633. }
  4634. }
  4635. OnHide() {
  4636. if (this.mainrole)
  4637. PoolManager.RecoverSprite3D(this.mainrole);
  4638. Laya.timer.clear(this, this.RotLoop);
  4639. if (this.panCamera) {
  4640. this.panCamera.active = false;
  4641. this.panCamera.removeSelf();
  4642. this.panCamera.destroy();
  4643. }
  4644. if (this.panlight) {
  4645. this.panlight.active = false;
  4646. this.panlight.removeSelf();
  4647. this.panlight.destroy();
  4648. }
  4649. if (this.showpan) {
  4650. this.showpan.active = false;
  4651. this.showpan.removeSelf();
  4652. this.showpan.destroy();
  4653. }
  4654. if (this.panScence) {
  4655. this.panScence.active = false;
  4656. this.panScence.removeSelf();
  4657. this.panScence.destroy();
  4658. }
  4659. EventManager.Off(EventType.UseSkin, this, this.ReFreshData);
  4660. EventManager.Off(EventType.getmoney, this, this.ReFreshData);
  4661. }
  4662. GetSkinDatas(_skintype) {
  4663. var skins = PlayerAccount.CurAccountData.m_skinDic.values;
  4664. var gets = [];
  4665. var locks = [];
  4666. for (var i = 0; i < skins.length; i++) {
  4667. var curskin = skins[i];
  4668. if (curskin.skintype != _skintype)
  4669. continue;
  4670. if (curskin.curskinstate != skinstate.lock) {
  4671. gets.push(curskin);
  4672. }
  4673. else {
  4674. locks.push(curskin);
  4675. }
  4676. }
  4677. return gets.concat(locks);
  4678. }
  4679. NewShow() {
  4680. this.panScence = new Laya.Scene3D();
  4681. this.addChild(this.panScence);
  4682. this.panCamera = new Laya.Camera();
  4683. this.panCamera.orthographic = true;
  4684. this.panScence.addChild(this.panCamera);
  4685. this.panCamera.transform.position = new Laya.Vector3(0, 10, 10);
  4686. this.panCamera.viewport = new Laya.Viewport(0, 0, Laya.stage.width, Laya.stage.height);
  4687. this.panCamera.clearFlag = 2;
  4688. var screensize = Laya.stage.height / 1280;
  4689. this.panCamera.orthographicVerticalSize = 20 * screensize;
  4690. this.panlight = new Laya.DirectionLight();
  4691. this.panScence.addChild(this.panlight);
  4692. this.panlight.intensity = 0.6;
  4693. this.showpan = new Laya.Sprite3D();
  4694. this.panScence.addChild(this.showpan);
  4695. var sfasf = this.patbg.localToGlobal(new Laya.Point(this.pt.x, this.pt.y));
  4696. var viewpos = new Laya.Vector3(sfasf.x, sfasf.y, 0);
  4697. var outworldpos = new Laya.Vector3();
  4698. this.panCamera.convertScreenCoordToOrthographicCoord(viewpos, outworldpos);
  4699. this.showpan.transform.position = new Laya.Vector3(outworldpos.x, outworldpos.y, 0);
  4700. Laya.timer.frameLoop(1, this, this.RotLoop);
  4701. this.skinlist.vScrollBarSkin = "";
  4702. this.skinlist.renderHandler = Laya.Handler.create(this, this.OnRender, null, false);
  4703. this.OnClickXGG();
  4704. }
  4705. RotLoop() {
  4706. if (this.mainrole && this.mainrole.active) {
  4707. this.showpan.transform.rotate(new Laya.Vector3(0, this.currotspeed, 0));
  4708. }
  4709. }
  4710. OnClickClose() {
  4711. GameUtils.TweenButton(this.homebtn, () => {
  4712. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  4713. });
  4714. }
  4715. OnRender(_cell, index) {
  4716. var data = _cell.dataSource;
  4717. var icon = _cell.getChildAt(2);
  4718. var selectim = _cell.getChildAt(1);
  4719. selectim.visible = false;
  4720. var getbtn = _cell.getChildAt(5);
  4721. getbtn.visible = false;
  4722. var getbtnbg = _cell.getChildAt(4);
  4723. this.SetGetBtn(getbtnbg, data);
  4724. getbtn.clickHandler = null;
  4725. if (data.curskinstate == skinstate.getnoues) {
  4726. getbtn.visible = true;
  4727. getbtn.clickHandler = Laya.Handler.create(this, this.WearSkin, [data], false);
  4728. }
  4729. else if (data.curskinstate == skinstate.lock) {
  4730. if (data.require_type == 2) {
  4731. getbtn.visible = true;
  4732. getbtn.clickHandler = Laya.Handler.create(this, this.MoneyGet, [data], false);
  4733. }
  4734. else if (data.require_type == 3) {
  4735. getbtn.visible = true;
  4736. getbtn.clickHandler = Laya.Handler.create(this, this.VideoGet, [data], false);
  4737. }
  4738. }
  4739. icon.skin = "icon/" + data.skinicon + ".png";
  4740. var showbtn = _cell.getChildAt(3);
  4741. showbtn.clickHandler = Laya.Handler.create(this, this.ShowRole, [data, index], false);
  4742. }
  4743. SetGetBtn(_btn, _data) {
  4744. var getuseing = _btn.getChildAt(1);
  4745. getuseing.visible = _data.curskinstate == skinstate.useing;
  4746. var getuse = _btn.getChildAt(2);
  4747. getuse.visible = _data.curskinstate == skinstate.getnoues;
  4748. var getvideo = _btn.getChildAt(3);
  4749. getvideo.visible = false;
  4750. var videoclip = getvideo.getChildAt(1);
  4751. var getmoney = _btn.getChildAt(4);
  4752. getmoney.visible = false;
  4753. var moneyclip = getmoney.getChildAt(1);
  4754. var getactiveity = _btn.getChildAt(5);
  4755. getactiveity.visible = false;
  4756. var getsign = _btn.getChildAt(6);
  4757. getsign.visible = false;
  4758. var getstage = _btn.getChildAt(7);
  4759. getstage.visible = false;
  4760. if (_data.curskinstate == skinstate.lock) {
  4761. if (_data.require_type == 2) {
  4762. getmoney.visible = true;
  4763. moneyclip.text = _data.require_num.toString();
  4764. }
  4765. else if (_data.require_type == 3) {
  4766. getvideo.visible = true;
  4767. videoclip.text = this.GetProgress(_data.skinid) + "/" + _data.require_num;
  4768. }
  4769. else if (_data.require_type == 5) {
  4770. getsign.visible = true;
  4771. }
  4772. else if (_data.require_type == 7) {
  4773. getstage.visible = true;
  4774. getstage.text = "通过第" + _data.require_num + "关";
  4775. }
  4776. else {
  4777. getactiveity.visible = true;
  4778. }
  4779. }
  4780. }
  4781. ShowRole(_skin, _cellindex = 0) {
  4782. for (var i = 0; i < this.skinlist.cells.length; i++) {
  4783. var selected = this.skinlist.cells[i].getChildAt(1);
  4784. selected.visible = i == _cellindex;
  4785. }
  4786. if (this.roomfangjianmaterial)
  4787. this.roomfangjianmaterial.albedoTexture = null;
  4788. if (!_skin || this.curskin == _skin) {
  4789. return;
  4790. }
  4791. this.showpan.transform.rotationEuler = new Laya.Vector3(0, 0, 0);
  4792. if (this.curskin != null && this.mainrole) {
  4793. PoolManager.RecoverSprite3D(this.mainrole);
  4794. }
  4795. this.curskin = _skin;
  4796. var asset;
  4797. if (this.curskin.skintype == skintype.role) {
  4798. var curid = this.curskin.skinid <= 6 ? this.curskin.skinid : this.curskin.skinid - 12;
  4799. asset = AssetManager.role.getValue(curid);
  4800. }
  4801. else if (this.curskin.skintype == skintype.weapon) {
  4802. asset = AssetManager.weapon.getValue(this.curskin.skinid - 6);
  4803. }
  4804. else {
  4805. asset = AssetManager.tw.getValue(this.curskin.skinid - 24);
  4806. }
  4807. this.mainrole = PoolManager.GetSprite3D(asset);
  4808. this.showpan.addChild(this.mainrole);
  4809. this.mainrole.transform.localPosition = new Laya.Vector3(0, 0, 0);
  4810. if (this.curskin.skintype != skintype.role) {
  4811. this.mainrole.transform.setWorldLossyScale(new Laya.Vector3(2.5, 2.5, 2.5));
  4812. }
  4813. else {
  4814. this.mainrole.transform.setWorldLossyScale(new Laya.Vector3(1.5, 1.5, 1.5));
  4815. }
  4816. if (_skin.skintype == skintype.tw) {
  4817. this.mainrole.transform.localPositionX = 2;
  4818. this.currotspeed = -0.1;
  4819. }
  4820. else {
  4821. this.currotspeed = 0;
  4822. }
  4823. }
  4824. GetProgress(_id) {
  4825. var ccc = PlayerAccount.CurAccountData.GetUser(AccountUser.progress_themes);
  4826. var progress = ccc[_id] ? ccc[_id] : 0;
  4827. return progress;
  4828. }
  4829. MoneyGet(_skindata) {
  4830. console.log("点击金币购买:" + _skindata.skinname, "1");
  4831. var money = Number(PlayerAccount.CurAccountData.GetUser(AccountUser.money));
  4832. if (money < _skindata.require_num) {
  4833. TtSdk.showToast("金币不足!");
  4834. return;
  4835. }
  4836. var key = PROTOCOLS.Buy;
  4837. var agrs = [{ "id": _skindata.skinid.toString() }];
  4838. NetworkManager.Instance.HttpPostRequest(key, agrs, Laya.Handler.create(this, () => {
  4839. this.ReFreshData();
  4840. console.log("点击金币购买成功:" + _skindata.skinname, "1");
  4841. var reward = new rewarddata(_skindata.skinid + 6000);
  4842. reward.type = 1;
  4843. reward.rewardicon = _skindata.skinicon;
  4844. reward.rewardname = _skindata.skinname;
  4845. reward.rewardnum = 1;
  4846. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
  4847. }), null);
  4848. }
  4849. VideoGet(_skindata) {
  4850. console.log("商城界面:点击看视频获得皮肤->" + _skindata.skinname, "1");
  4851. if (ADHelper.IsAndroid) {
  4852. ADHelper.showVideoAd((flag) => {
  4853. if (flag) {
  4854. var getkey = PROTOCOLS.fission;
  4855. var agrs = [{ "id": _skindata.skinid.toString() }, { "channel": "video" }, { "t": PlayerAccount.ServerTime.toString() }];
  4856. NetworkManager.Instance.HttpPostRequest(getkey, agrs, Laya.Handler.create(this, () => {
  4857. this.ReFreshData();
  4858. console.log("点击看视频获得皮肤成功:" + _skindata.skinname, "1");
  4859. var curskin = PlayerAccount.CurAccountData.m_skinDic.getValue(_skindata.skinid);
  4860. if (curskin.curskinstate == skinstate.getnoues) {
  4861. var reward = new rewarddata(_skindata.skinid + 6000);
  4862. reward.type = 1;
  4863. reward.rewardicon = _skindata.skinicon;
  4864. reward.rewardname = _skindata.skinname;
  4865. reward.rewardnum = 1;
  4866. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
  4867. }
  4868. }), Laya.Handler.create(this, () => { }));
  4869. }
  4870. });
  4871. }
  4872. else {
  4873. var getkey = PROTOCOLS.fission;
  4874. var agrs21 = [{ "id": _skindata.skinid.toString() }, { "channel": "video" }, { "t": PlayerAccount.ServerTime.toString() }];
  4875. NetworkManager.Instance.HttpPostRequest(getkey, agrs21, Laya.Handler.create(this, () => {
  4876. this.ReFreshData();
  4877. var curskin = PlayerAccount.CurAccountData.m_skinDic.getValue(_skindata.skinid);
  4878. if (curskin.curskinstate == skinstate.getnoues) {
  4879. var reward = new rewarddata(_skindata.skinid + 6000);
  4880. reward.type = 1;
  4881. reward.rewardicon = _skindata.skinicon;
  4882. reward.rewardname = _skindata.skinname;
  4883. reward.rewardnum = 1;
  4884. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
  4885. }
  4886. }), Laya.Handler.create(this, () => { }));
  4887. }
  4888. }
  4889. ReFreshData() {
  4890. this.moneyclip.text = PlayerAccount.CurAccountData.GetUser(AccountUser.money);
  4891. PlayerAccount.CurAccountData.UpdateSkinDic();
  4892. this.skinlist.array = this.GetSkinDatas(this.curskintype);
  4893. var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[this.curskintype];
  4894. var curskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
  4895. console.log(this.curskintype, equip, curskin);
  4896. this.ShowRole(curskin);
  4897. }
  4898. WearSkin(_skin) {
  4899. if (!this.canwear)
  4900. return;
  4901. this.canwear = false;
  4902. console.log("wear:", _skin.skinid);
  4903. var agrs = [{ "id": _skin.skinid.toString() }];
  4904. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Equip, agrs, Laya.Handler.create(this, (e) => {
  4905. this.ReFreshData();
  4906. var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[this.curskintype];
  4907. var curskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
  4908. EventManager.Trigger(EventType.UseSkin, [_skin]);
  4909. this.ShowRole(curskin);
  4910. this.canwear = true;
  4911. }), null);
  4912. }
  4913. ShowBoySkin() {
  4914. this.curskintype = skintype.role;
  4915. this.curskindatas = this.GetSkinDatas(skintype.role);
  4916. this.skinlist.array = this.curskindatas;
  4917. var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[this.curskintype];
  4918. var equipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
  4919. this.ShowRole(equipskin);
  4920. }
  4921. ShowGirlSkin() {
  4922. this.curskintype = skintype.weapon;
  4923. this.curskindatas = this.GetSkinDatas(skintype.weapon);
  4924. this.skinlist.array = this.curskindatas;
  4925. var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[this.curskintype];
  4926. var equipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
  4927. if (equipskin)
  4928. this.ShowRole(equipskin);
  4929. }
  4930. ShowTwSkin() {
  4931. this.curskintype = skintype.tw;
  4932. this.curskindatas = this.GetSkinDatas(skintype.tw);
  4933. this.skinlist.array = this.curskindatas;
  4934. var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[this.curskintype];
  4935. if (equip == undefined) {
  4936. equip = 25;
  4937. }
  4938. var equipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
  4939. if (equipskin)
  4940. this.ShowRole(equipskin);
  4941. }
  4942. }
  4943. class TryoutWindow extends ui.Window.TryoutWindowUI {
  4944. constructor() {
  4945. super();
  4946. this.lowskins = [];
  4947. this.highskins = [];
  4948. this.upskins = [];
  4949. TryoutWindow.instance = this;
  4950. }
  4951. static get Instance() {
  4952. return TryoutWindow.instance;
  4953. }
  4954. InitSize() {
  4955. this.height = Laya.stage.height;
  4956. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  4957. this.pan.y = Laya.stage.height / 1180 * this.pan.y;
  4958. this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
  4959. }
  4960. OnOpen(_data = null) {
  4961. this.InitSize();
  4962. this.RegButton();
  4963. this.GetSkinDatas();
  4964. if (this.lowskins.length == 0 && this.highskins.length == 0) {
  4965. this.OnClickClose();
  4966. }
  4967. else {
  4968. TtSdk.Showbanner();
  4969. TtSdk.RecordEvent("enterTry");
  4970. this.upskins = this.GetUpdatas(this.lowskins);
  4971. this.downskin = this.GetDowndatas();
  4972. if (this.upskins.length == 0 && !this.downskin) {
  4973. this.OnClickClose();
  4974. return;
  4975. }
  4976. this.ShowUpSkins();
  4977. this.ShowDownSkin();
  4978. }
  4979. }
  4980. RegButton() {
  4981. this.passbtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
  4982. }
  4983. OnHide() {
  4984. }
  4985. OnClickClose() {
  4986. GameManager.Instance.RecordLevelStart();
  4987. GameManager.Instance.ChangeGameState(GameState.Start);
  4988. }
  4989. OnClcikItem(_skin) {
  4990. if (ADHelper.IsAndroid) {
  4991. ADHelper.showVideoAd((flag) => {
  4992. if (flag) {
  4993. this.GetGetVideoAward(_skin);
  4994. }
  4995. });
  4996. }
  4997. else {
  4998. this.GetGetVideoAward(_skin);
  4999. }
  5000. }
  5001. GetGetVideoAward(_skin) {
  5002. EventManager.Trigger(EventType.UseSkin, [_skin]);
  5003. this.OnClickClose();
  5004. }
  5005. ShowUpSkins() {
  5006. this.upskinpan.x += (3 - this.upskins.length) * 99;
  5007. for (var i = 0; i < this.upskinpan.numChildren; i++) {
  5008. var skinpan = this.upskinpan.getChildAt(i);
  5009. if (i < this.upskins.length) {
  5010. var varskin = this.upskins[i];
  5011. var btn = skinpan.getChildAt(1);
  5012. var name = skinpan.getChildAt(2);
  5013. name.text = varskin.skinname;
  5014. var icon = skinpan.getChildAt(3);
  5015. icon.skin = "icon/" + varskin.skinicon + ".png";
  5016. btn.clickHandler = Laya.Handler.create(this, this.OnClcikItem, [varskin], false);
  5017. }
  5018. else {
  5019. skinpan.visible = false;
  5020. }
  5021. }
  5022. }
  5023. ShowDownSkin() {
  5024. this.downskinpan.visible = this.downskin != null;
  5025. if (this.downskinpan.visible) {
  5026. var name = this.downskinpan.getChildAt(0).getChildAt(0);
  5027. name.text = this.downskin.skinname;
  5028. var icon = this.downskinpan.getChildAt(0).getChildAt(1);
  5029. icon.skin = "icon/" + this.downskin.skinicon + ".png";
  5030. this.tribtn2.clickHandler = Laya.Handler.create(this, this.OnClcikItem, [this.downskin], false);
  5031. }
  5032. }
  5033. GetSkinDatas() {
  5034. for (var i = 0; i < PlayerAccount.CurAccountData.m_skinDic.values.length; i++) {
  5035. var skindata = PlayerAccount.CurAccountData.m_skinDic.values[i];
  5036. if (skindata.curskinstate == skinstate.lock && skindata.skintype == skintype.weapon && skindata.require_type != 6) {
  5037. if (skindata.quality == 1) {
  5038. this.lowskins.push(skindata);
  5039. }
  5040. else {
  5041. this.highskins.push(skindata);
  5042. }
  5043. }
  5044. }
  5045. }
  5046. GetUpdatas(_skindatas) {
  5047. var mskins = [];
  5048. var randomindex1 = GameUtils.getRandomInt(0, _skindatas.length - 1);
  5049. var randomskin1 = _skindatas[randomindex1];
  5050. mskins.push(randomskin1);
  5051. _skindatas.splice(randomindex1, 1);
  5052. if (_skindatas.length > 0) {
  5053. var randomindex2 = GameUtils.getRandomInt(0, _skindatas.length - 1);
  5054. var randomskin2 = _skindatas[randomindex2];
  5055. mskins.push(randomskin2);
  5056. _skindatas.splice(randomindex2, 1);
  5057. }
  5058. if (_skindatas.length > 0) {
  5059. var randomindex3 = GameUtils.getRandomInt(0, _skindatas.length - 1);
  5060. var randomskin3 = _skindatas[randomindex3];
  5061. mskins.push(randomskin3);
  5062. _skindatas.splice(randomindex3, 1);
  5063. }
  5064. return mskins;
  5065. }
  5066. GetDowndatas() {
  5067. var mskins;
  5068. if (this.highskins.length > 0) {
  5069. var randomindex1 = GameUtils.getRandomInt(0, this.highskins.length - 1);
  5070. mskins = this.highskins[randomindex1];
  5071. }
  5072. else {
  5073. if (this.lowskins.length > 0) {
  5074. var randomindex3 = GameUtils.getRandomInt(0, this.lowskins.length - 1);
  5075. mskins = this.lowskins[randomindex3];
  5076. }
  5077. }
  5078. return mskins;
  5079. }
  5080. OnSignError(e) {
  5081. console.log(e);
  5082. }
  5083. }
  5084. var SignItemState;
  5085. (function (SignItemState) {
  5086. SignItemState[SignItemState["ready"] = 0] = "ready";
  5087. SignItemState[SignItemState["videoready"] = 1] = "videoready";
  5088. SignItemState[SignItemState["locking"] = 2] = "locking";
  5089. SignItemState[SignItemState["complete"] = 3] = "complete";
  5090. })(SignItemState || (SignItemState = {}));
  5091. class RewardData {
  5092. constructor(_id, _num) {
  5093. this.rewardid = _id;
  5094. this.rewardnum = _num;
  5095. }
  5096. }
  5097. class SignItem {
  5098. get RewardsData() {
  5099. var rewardsdata = this.rewards.split(";");
  5100. if (rewardsdata.length > 1) {
  5101. return new RewardData(Number(6000), Number(1));
  5102. }
  5103. else {
  5104. return new RewardData(Number(this.rewards), Number(this.rewardsNum));
  5105. }
  5106. }
  5107. }
  5108. class SignWindow extends ui.Window.SignWindowUI {
  5109. constructor() {
  5110. super();
  5111. this.SignAwardDic = {};
  5112. this.curSignItems = [];
  5113. this.videoopen = true;
  5114. SignWindow.instance = this;
  5115. }
  5116. static get Instance() {
  5117. return SignWindow.instance;
  5118. }
  5119. OnOpen(_data = null) {
  5120. this.pan.y = Laya.stage.height / 1280 * this.pan.y;
  5121. this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
  5122. this.curSignItems = this.SignItemsData;
  5123. this.ReFreshSginList();
  5124. this.signBtn.visible = SignWindow.canSgin;
  5125. this.awardbtn.visible = SignWindow.canSgin;
  5126. this.signBtn.clickHandler = Laya.Handler.create(this, this.OOPO, null, false);
  5127. this.closebtn2.clickHandler = Laya.Handler.create(this, this.OnCloseClick);
  5128. this.awardbtn.clickHandler = Laya.Handler.create(this, this.OnClickDouble, null, false);
  5129. this.height = Laya.stage.height;
  5130. this.videobtn.clickHandler = Laya.Handler.create(this, this.OnClcikVideo, null, false);
  5131. TtSdk.Showbanner();
  5132. this.videoopen = PlayerAccount.CurAccountData.videolock;
  5133. this.videopoint.visible = this.videoopen;
  5134. }
  5135. OnCloseClick() {
  5136. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  5137. }
  5138. OnClcikVideo() {
  5139. this.videoopen = !this.videoopen;
  5140. this.videopoint.visible = this.videoopen;
  5141. }
  5142. get SignItemsData() {
  5143. var SignItems = [];
  5144. var config = PlayerAccount.CurAccountData.GetConfig(AccountConfig.sign);
  5145. var signday = Number(PlayerAccount.CurAccountData.GetSign(signdata.sign_days));
  5146. var signtime = Number(PlayerAccount.CurAccountData.GetSign(signdata.sign_time));
  5147. var frist = signday < 7;
  5148. var index = frist ? 0 : 7;
  5149. for (var i = index; i < index + 7; i++) {
  5150. this.SignAwardDic[config[i].id] = config[i].rewards;
  5151. }
  5152. for (var key in this.SignAwardDic) {
  5153. var rewardid = this.SignAwardDic[key];
  5154. var reward = PlayerAccount.CurAccountData.GetRewardConfig(rewardid);
  5155. var signitem = new SignItem();
  5156. signitem.desc = reward.group_name;
  5157. signitem.icon = reward.icon;
  5158. signitem.signId = Number(reward.id);
  5159. signitem.rewards = reward.reward_item;
  5160. signitem.rewardsNum = reward.reward_num;
  5161. signitem.weight = reward.reward_weight;
  5162. var daynum = Number(key);
  5163. if (signday + 1 > daynum) {
  5164. signitem.itemState = SignItemState.complete;
  5165. }
  5166. if (signday + 1 < daynum) {
  5167. signitem.itemState = SignItemState.locking;
  5168. }
  5169. if (signday + 1 == daynum) {
  5170. signitem.itemState = SignItemState.ready;
  5171. }
  5172. SignItems.push(signitem);
  5173. }
  5174. return SignItems;
  5175. }
  5176. static get canSgin() {
  5177. let todayZero = new Date(PlayerAccount.ServerTime * 1000);
  5178. todayZero.setHours(0, 0, 0, 0);
  5179. var zeroTime = todayZero.valueOf();
  5180. var signtime = Number(PlayerAccount.CurAccountData.GetSign(signdata.sign_time));
  5181. var signTime = signtime * 1000;
  5182. var can = signTime < zeroTime ? true : false;
  5183. return can;
  5184. }
  5185. ReFreshSginList() {
  5186. this.Btn.visible = SignWindow.canSgin;
  5187. this.closebtn2.visible = !SignWindow.canSgin;
  5188. for (var i = 0; i < this.signlist.numChildren; i++) {
  5189. var sign = this.signlist.getChildAt(i);
  5190. var data = this.curSignItems[i];
  5191. var showbox;
  5192. var showbox0 = sign.getChildAt(0);
  5193. showbox0.visible = false;
  5194. var showbox1 = sign.getChildAt(1);
  5195. showbox1.visible = false;
  5196. var showbox2 = sign.getChildAt(2);
  5197. showbox2.visible = false;
  5198. if (data.itemState == SignItemState.locking) {
  5199. showbox = showbox0;
  5200. }
  5201. else if (data.itemState == SignItemState.ready) {
  5202. showbox = showbox1;
  5203. }
  5204. else {
  5205. showbox = showbox2;
  5206. }
  5207. showbox.visible = true;
  5208. var awardtype = data.RewardsData.rewardid;
  5209. if (awardtype == 1000) {
  5210. var gold = showbox.getChildByName("gold");
  5211. gold.visible = true;
  5212. var clip = gold.getChildAt(1);
  5213. clip.text = data.RewardsData.rewardnum.toString();
  5214. }
  5215. else {
  5216. var car = showbox.getChildByName("car");
  5217. car.visible = true;
  5218. var skinid = awardtype % 6000;
  5219. var caricon = "";
  5220. if (PlayerAccount.CurAccountData.m_skinDic.containKey(skinid)) {
  5221. caricon = PlayerAccount.CurAccountData.m_skinDic.getValue(skinid).skinicon;
  5222. }
  5223. var sprite = car.getChildAt(0);
  5224. if (caricon)
  5225. sprite.skin = "icon/" + caricon + ".png";
  5226. }
  5227. if (data.itemState == SignItemState.ready) {
  5228. this.cursignitem = data;
  5229. }
  5230. }
  5231. }
  5232. OnClickDouble() {
  5233. if (ADHelper.IsAndroid) {
  5234. ADHelper.showVideoAd((flag) => {
  5235. if (flag) {
  5236. this.OnSign(true);
  5237. }
  5238. });
  5239. }
  5240. else {
  5241. this.OnSign(true);
  5242. }
  5243. }
  5244. OOPO() {
  5245. if (this.videoopen) {
  5246. this.OnClickDouble();
  5247. }
  5248. else {
  5249. this.OnSign();
  5250. }
  5251. }
  5252. OnSign(_double = false) {
  5253. if (!SignWindow.canSgin)
  5254. return;
  5255. var curgold = Number(PlayerAccount.CurAccountData.GetUser(AccountUser.money));
  5256. var curvideo = _double ? "0" : "0";
  5257. let param = [{ "video": curvideo }];
  5258. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Sign, param, Laya.Handler.create(this, (e) => {
  5259. var reward = new rewarddata(this.cursignitem.RewardsData.rewardid);
  5260. reward.type = reward.rewarditem > 1000 ? 1 : 0;
  5261. if (reward.type == 0) {
  5262. this.GetAward(_double, Number(this.cursignitem.rewardsNum), () => {
  5263. this.OnCloseClick();
  5264. });
  5265. return;
  5266. }
  5267. else {
  5268. var skinid = reward.rewarditem % 6000;
  5269. var skin = PlayerAccount.CurAccountData.m_skinDic.getValue(skinid);
  5270. if (skin) {
  5271. reward.rewardicon = skin.skinicon;
  5272. reward.rewardname = this.cursignitem.desc;
  5273. reward.rewardnum = this.cursignitem.RewardsData.rewardnum;
  5274. reward.rewarditem = this.cursignitem.RewardsData.rewardid;
  5275. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
  5276. }
  5277. }
  5278. this.curSignItems = this.SignItemsData;
  5279. SignWindow.Instance.ReFreshSginList();
  5280. }), Laya.Handler.create(this, this.OnSignError), true);
  5281. }
  5282. OnSignError(e) {
  5283. console.log(e);
  5284. }
  5285. OnHide() {
  5286. }
  5287. GetAward(double, _money, _complete) {
  5288. var moneycount = _money;
  5289. var showmoney = _money;
  5290. if (double) {
  5291. moneycount = _money * 2;
  5292. showmoney = _money * 3;
  5293. }
  5294. let param = [{ "reward_item": "1000" }, { "reward_num": moneycount.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
  5295. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
  5296. GameUtils.GetMoney(showmoney, null, Laya.Handler.create(this, () => {
  5297. _complete();
  5298. }));
  5299. }), Laya.Handler.create(this, this.OnSignError), true);
  5300. }
  5301. }
  5302. class drawitem {
  5303. constructor(_id, _icon) {
  5304. this.rewardid = _id;
  5305. this.rewardicon = _icon;
  5306. }
  5307. }
  5308. var rewardtype;
  5309. (function (rewardtype) {
  5310. rewardtype[rewardtype["role"] = 0] = "role";
  5311. rewardtype[rewardtype["weapon"] = 1] = "weapon";
  5312. rewardtype[rewardtype["money"] = 2] = "money";
  5313. rewardtype[rewardtype["egg"] = 3] = "egg";
  5314. })(rewardtype || (rewardtype = {}));
  5315. class CheatWindow extends ui.Window.CheatWindowUI {
  5316. constructor() {
  5317. super();
  5318. this.curooo = false;
  5319. this.currewarddic = new Dictionary();
  5320. this.clickcomplete = false;
  5321. CheatWindow.instance = this;
  5322. CheatWindow.instance.InitSize();
  5323. }
  5324. static get Instance() {
  5325. return CheatWindow.instance;
  5326. }
  5327. InitSize() {
  5328. this.height = Laya.stage.height;
  5329. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  5330. this.pan.y = Laya.stage.height / 1280 * this.pan.y;
  5331. this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
  5332. }
  5333. OnOpen(_ooo = true) {
  5334. this.RegButton();
  5335. this.curooo = _ooo;
  5336. this.tippan.visible = _ooo;
  5337. if (!_ooo)
  5338. this.ani1.play(null, false);
  5339. this.bg.visible = _ooo;
  5340. this.currewarddic = new Dictionary();
  5341. var rewards = PlayerAccount.CurAccountData.GetConfig(AccountConfig.lottery);
  5342. for (var key in rewards) {
  5343. var curconfig = rewards[key];
  5344. var id = Number(key);
  5345. var data = new drawitem(id, curconfig.icon);
  5346. data.name = curconfig.name;
  5347. data.reward_item = curconfig.reward_item;
  5348. data.reward_num = curconfig.reward_num;
  5349. data.weight = curconfig.weight;
  5350. this.currewarddic.add(id + 1, data);
  5351. }
  5352. InputManager.caninput = false;
  5353. this.clickcomplete = false;
  5354. }
  5355. RegButton() {
  5356. this.clickbtn.clickHandler = Laya.Handler.create(this, this.OnClickChect, null, false);
  5357. this.passbtn.clickHandler = Laya.Handler.create(this, this.OnPass, null, false);
  5358. }
  5359. OnClickChect() {
  5360. if (this.clickcomplete)
  5361. return;
  5362. if (Laya.Browser.onPC) {
  5363. this.OnGetGift();
  5364. }
  5365. else {
  5366. ADHelper.showVideoAd((flag) => {
  5367. if (flag) {
  5368. this.OnGetGift();
  5369. }
  5370. });
  5371. }
  5372. }
  5373. OnHide() {
  5374. InputManager.caninput = true;
  5375. }
  5376. OnPass() {
  5377. this.OnEnd();
  5378. }
  5379. OnGetGift() {
  5380. var agrs = [{ "t": PlayerAccount.CurrentAccount.ServerTime.toString() }, { "channel": "video" }];
  5381. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Lottery, agrs, Laya.Handler.create(this, (data) => {
  5382. this.clickcomplete = true;
  5383. var lottery_id = Number(data.lottery_id);
  5384. var curdata = this.currewarddic.getValue(lottery_id);
  5385. var reward = new rewarddata(curdata.reward_item);
  5386. if (reward.rewarditem == 1000 || reward.rewarditem == 2000) {
  5387. GameUtils.GetMoney(curdata.reward_num, null, Laya.Handler.create(this, () => {
  5388. this.OnEnd();
  5389. }));
  5390. }
  5391. else {
  5392. reward.type = reward.rewarditem == 6000 ? rewardtype.role : rewardtype.weapon;
  5393. reward.rewardicon = curdata.rewardicon;
  5394. reward.rewardname = curdata.name;
  5395. reward.rewardnum = curdata.reward_num;
  5396. reward.rewarditem = curdata.reward_item;
  5397. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
  5398. RewardWindow.Instance.closeback = () => {
  5399. this.OnEnd();
  5400. };
  5401. }
  5402. }), Laya.Handler.create(this, () => {
  5403. TtSdk.showToast("领取失败");
  5404. }));
  5405. }
  5406. OnEnd() {
  5407. if (this.curooo == false) {
  5408. WindowManager.Instance.ClosePopView(WindowType.CheatWindow);
  5409. }
  5410. else {
  5411. GameManager.Instance.RessetGame();
  5412. }
  5413. }
  5414. }
  5415. class ShareVideoWindow extends ui.Window.ShareVideoWindowUI {
  5416. constructor() {
  5417. super();
  5418. this.first = false;
  5419. ShareVideoWindow.instance = this;
  5420. }
  5421. static get Instance() {
  5422. return ShareVideoWindow.instance;
  5423. }
  5424. OnOpen(_data = null) {
  5425. this.ani1.play(0, false);
  5426. this.first = false;
  5427. var firstsharemes = Laya.LocalStorage.getItem("firstshare");
  5428. if (!firstsharemes) {
  5429. this.first = true;
  5430. this.firstreward = this.GetReward;
  5431. this.icon.skin = "icon/" + this.firstreward.rewardicon + ".png";
  5432. }
  5433. this.firstshare.visible = this.first;
  5434. this.sharetip.visible = !this.first;
  5435. this.sharemoney.visible = !this.first;
  5436. this.sharebtn.clickHandler = Laya.Handler.create(this, this.OnShareVideo, null, false);
  5437. this.closebtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
  5438. this.height = Laya.stage.height;
  5439. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  5440. }
  5441. OnHide() {
  5442. }
  5443. OnClickClose() {
  5444. WindowManager.Instance.ClosePopView(WindowType.ShareVideoWindow);
  5445. }
  5446. OnShareVideo() {
  5447. if (ADHelper.IsAndroid) {
  5448. TtSdk.Instance.ShareVideo((flag) => {
  5449. if (flag) {
  5450. this.GetVideoReward();
  5451. }
  5452. });
  5453. }
  5454. else {
  5455. this.GetVideoReward();
  5456. }
  5457. }
  5458. GetVideoReward() {
  5459. if (this.first) {
  5460. this.GetSkinReward();
  5461. }
  5462. else {
  5463. this.RewardShareGold();
  5464. }
  5465. }
  5466. RewardShareGold() {
  5467. let param = [{ "reward_item": "1000" }, { "reward_num": "100" }, { "t": PlayerAccount.ServerTime.toString() }];
  5468. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
  5469. GameUtils.GetMoney(100);
  5470. this.OnClickClose();
  5471. }), Laya.Handler.create(this, this.OnSignError), true);
  5472. }
  5473. OnSignError(e) {
  5474. console.log(e);
  5475. }
  5476. GetSkinReward() {
  5477. var reward_item = this.firstreward.rewarditem;
  5478. let param = [{ "reward_item": reward_item.toString() }, { "reward_num": this.firstreward.rewardnum.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
  5479. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
  5480. Laya.LocalStorage.setItem("firstshare", "1");
  5481. if (this.firstreward.type == rewardtype.money) {
  5482. GameUtils.GetMoney(this.firstreward.rewardnum, null, Laya.Handler.create(this, () => {
  5483. this.OnClickClose();
  5484. }));
  5485. }
  5486. else {
  5487. this.OnClickClose();
  5488. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, this.firstreward);
  5489. }
  5490. }), Laya.Handler.create(this, this.OnSignError), true);
  5491. }
  5492. get GetReward() {
  5493. var getskin = false;
  5494. var rewardskin;
  5495. var videoskins = [];
  5496. var skins = PlayerAccount.CurAccountData.m_skinDic;
  5497. for (var i = 0; i < skins.values.length; i++) {
  5498. var skin = skins.values[i];
  5499. if (skin.curskinstate == skinstate.lock && skin.require_type != 6) {
  5500. videoskins.push(skin);
  5501. }
  5502. }
  5503. if (videoskins.length > 0) {
  5504. getskin = true;
  5505. var random = GameUtils.getRandomInt(0, videoskins.length - 1);
  5506. rewardskin = videoskins[random];
  5507. }
  5508. else {
  5509. return null;
  5510. }
  5511. if (getskin) {
  5512. var skinreward = new rewarddata(6000 + rewardskin.skinid);
  5513. skinreward.rewardicon = rewardskin.skinicon;
  5514. skinreward.rewardname = rewardskin.skinname;
  5515. skinreward.rewardnum = 1;
  5516. skinreward.type = rewardtype.role;
  5517. return skinreward;
  5518. }
  5519. else {
  5520. var goldreward = new rewarddata(1000);
  5521. goldreward.rewardicon = "jb";
  5522. goldreward.rewardname = "金币";
  5523. goldreward.rewardnum = 100;
  5524. goldreward.type = rewardtype.money;
  5525. return goldreward;
  5526. }
  5527. }
  5528. }
  5529. class BaoXiangWindow extends ui.Window.BaoXiangWindowUI {
  5530. constructor() {
  5531. super();
  5532. this.firstbx = false;
  5533. BaoXiangWindow.instance = this;
  5534. BaoXiangWindow.instance.InitSize();
  5535. }
  5536. static get Instance() {
  5537. return BaoXiangWindow.instance;
  5538. }
  5539. InitSize() {
  5540. this.height = Laya.stage.height;
  5541. this.pan.y = Laya.stage.height / 1280 * this.pan.y;
  5542. this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
  5543. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  5544. }
  5545. OnOpen(_data = null) {
  5546. this.visible = false;
  5547. Laya.timer.once(500, this, () => {
  5548. this.visible = true;
  5549. });
  5550. this.RegButton();
  5551. var sfsf = Laya.LocalStorage.getItem("firstbx");
  5552. this.firstbg.visible = false;
  5553. if (!sfsf) {
  5554. this.firstbx = true;
  5555. this.firstbg.visible = true;
  5556. }
  5557. this.curreward = this.GetReward;
  5558. InputManager.Instance.OnTouchOut();
  5559. InputManager.caninput = false;
  5560. if (!this.curreward) {
  5561. this.OnClickClose();
  5562. return;
  5563. }
  5564. if (this.curreward.type != rewardtype.egg) {
  5565. this.icon.skin = "icon/" + this.curreward.rewardicon + ".png";
  5566. this.gettex.text = "开启宝箱";
  5567. }
  5568. else {
  5569. this.icon.skin = "game/egg.png";
  5570. this.gettex.text = "开启彩蛋";
  5571. }
  5572. var desc = this.curreward.type == rewardtype.money ? "金币+" + this.curreward.rewardnum : this.curreward.rewardname;
  5573. this.skindesc.text = desc;
  5574. TtSdk.Showbanner();
  5575. }
  5576. RegButton() {
  5577. this.getbtn.clickHandler = Laya.Handler.create(this, this.GetSkinReward, null, false);
  5578. this.passbtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
  5579. }
  5580. OnHide() {
  5581. InputManager.caninput = true;
  5582. }
  5583. get GetReward() {
  5584. var getskin = false;
  5585. var rewardskin;
  5586. var videoskins = [];
  5587. var skins = PlayerAccount.CurAccountData.m_skinDic;
  5588. for (var i = 0; i < skins.values.length; i++) {
  5589. var skin = skins.values[i];
  5590. if (skin.curskinstate == skinstate.lock) {
  5591. videoskins.push(skin);
  5592. }
  5593. }
  5594. if (videoskins.length > 0) {
  5595. getskin = true;
  5596. var random = GameUtils.getRandomInt(0, videoskins.length - 1);
  5597. rewardskin = videoskins[random];
  5598. }
  5599. else {
  5600. return null;
  5601. }
  5602. if (!this.firstbx && Math.random() > 0.35 && TaskManager.GetEgg) {
  5603. var getegg = TaskManager.GetEgg(true);
  5604. var skinreward = new rewarddata(getegg.id);
  5605. skinreward.rewardnum = 1;
  5606. skinreward.type = rewardtype.egg;
  5607. skinreward.rewardname = "神秘彩蛋";
  5608. return skinreward;
  5609. }
  5610. else {
  5611. if (getskin && ((Math.random() > 0.4) || this.firstbx)) {
  5612. var skinreward = new rewarddata(6000 + rewardskin.skinid);
  5613. skinreward.rewardicon = rewardskin.skinicon;
  5614. skinreward.rewardname = rewardskin.skinname;
  5615. skinreward.rewardnum = 1;
  5616. skinreward.type = rewardtype.role;
  5617. return skinreward;
  5618. }
  5619. else {
  5620. var goldreward = new rewarddata(1000);
  5621. goldreward.rewardicon = "jb";
  5622. goldreward.rewardname = "金币";
  5623. goldreward.rewardnum = 100;
  5624. goldreward.type = rewardtype.money;
  5625. return goldreward;
  5626. }
  5627. }
  5628. }
  5629. GetSkinReward() {
  5630. if (this.curreward.type == rewardtype.egg) {
  5631. this.VideoGetEgg();
  5632. }
  5633. else {
  5634. this.VideoGetSkin();
  5635. }
  5636. }
  5637. VideoGetEgg() {
  5638. if (Laya.Browser.onPC) {
  5639. this.OnClickClose();
  5640. var task = TaskManager.taskdic.getValue(this.curreward.rewarditem);
  5641. WindowManager.Instance.OpenPopView(WindowType.TaskContentView, [task, false, false]);
  5642. }
  5643. else {
  5644. ADHelper.showVideoAd((flag) => {
  5645. if (flag) {
  5646. this.OnClickClose();
  5647. var task = TaskManager.taskdic.getValue(this.curreward.rewarditem);
  5648. WindowManager.Instance.OpenPopView(WindowType.TaskContentView, [task, false, false]);
  5649. }
  5650. });
  5651. }
  5652. }
  5653. VideoGetSkin() {
  5654. if (Laya.Browser.onPC) {
  5655. var reward_item = this.curreward.rewarditem;
  5656. let param = [{ "reward_item": reward_item.toString() }, { "reward_num": this.curreward.rewardnum.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
  5657. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
  5658. if (this.firstbx)
  5659. Laya.LocalStorage.setItem("firstbx", "1");
  5660. if (this.curreward.type == rewardtype.money) {
  5661. GameUtils.GetMoney(this.curreward.rewardnum, null, Laya.Handler.create(this, () => {
  5662. this.OnClickClose();
  5663. }));
  5664. }
  5665. else {
  5666. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, this.curreward);
  5667. WindowManager.Instance.ClosePopView(WindowType.BaoXiangWindow);
  5668. }
  5669. }), Laya.Handler.create(this, this.OnSignError), true);
  5670. }
  5671. else {
  5672. ADHelper.showVideoAd((flag) => {
  5673. if (flag) {
  5674. var reward_item = this.curreward.rewarditem;
  5675. let param = [{ "reward_item": reward_item.toString() }, { "reward_num": this.curreward.rewardnum.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
  5676. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
  5677. if (this.firstbx)
  5678. Laya.LocalStorage.setItem("firstbx", "1");
  5679. if (this.curreward.type == rewardtype.money) {
  5680. GameUtils.GetMoney(this.curreward.rewardnum, null, Laya.Handler.create(this, () => {
  5681. this.OnClickClose();
  5682. }));
  5683. }
  5684. else {
  5685. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, this.curreward);
  5686. WindowManager.Instance.ClosePopView(WindowType.BaoXiangWindow);
  5687. }
  5688. }), Laya.Handler.create(this, this.OnSignError), true);
  5689. }
  5690. });
  5691. }
  5692. }
  5693. OnSignError(e) {
  5694. console.log(e);
  5695. }
  5696. OnClickClose() {
  5697. WindowManager.Instance.ClosePopView(WindowType.BaoXiangWindow);
  5698. Player.mainpalyer.SetWuDi(2000);
  5699. }
  5700. }
  5701. class TaskWindow extends ui.Window.TaskWindowUI {
  5702. constructor() {
  5703. super();
  5704. this.cddatas = [];
  5705. this.completelevels = [];
  5706. TaskWindow.instance = this;
  5707. }
  5708. static get Instance() {
  5709. return TaskWindow.instance;
  5710. }
  5711. InitSize() {
  5712. this.height = Laya.stage.height;
  5713. this.homebtn.y = Laya.stage.height / 1280 * this.homebtn.y;
  5714. this.listpan.top = Laya.stage.height / 1280 * this.listpan.top;
  5715. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  5716. }
  5717. OnOpen(_data = null) {
  5718. this.InitSize();
  5719. this.RegButton();
  5720. this.RefreshCDList();
  5721. }
  5722. RegButton() {
  5723. this.homebtn.clickHandler = Laya.Handler.create(this, this.OnBackHome, null, false);
  5724. }
  5725. OnHide() {
  5726. }
  5727. OnBackHome() {
  5728. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  5729. }
  5730. static get canshoweffview() {
  5731. var mdatas = [];
  5732. for (var i = 0; i < TaskManager.taskdic.values.length; i++) {
  5733. var mfasa = TaskManager.taskdic.values[i];
  5734. if (mfasa.find == 1) {
  5735. mdatas.push(mfasa);
  5736. }
  5737. }
  5738. return mdatas;
  5739. }
  5740. RefreshCDList() {
  5741. this.cddatas = TaskWindow.canshoweffview;
  5742. this.cdlist.vScrollBarSkin = "";
  5743. this.cdlist.array = this.cddatas;
  5744. this.cdlist.renderHandler = Laya.Handler.create(this, this.OnRender, null, false);
  5745. this.completelevels = this.CheckEggComplete();
  5746. if (this.completelevels.length > 0) {
  5747. this.ShowCompleteTask();
  5748. }
  5749. }
  5750. ShowCompleteTask() {
  5751. var curtask = this.completelevels[0];
  5752. WindowManager.Instance.OpenPopView(WindowType.TaskContentView, [curtask, true, false]);
  5753. this.cddatas = TaskWindow.canshoweffview;
  5754. this.cdlist.array = this.cddatas;
  5755. }
  5756. ReCompleteCheck(_task) {
  5757. var index = this.completelevels.indexOf(_task);
  5758. if (index != -1) {
  5759. this.completelevels.splice(index, 1);
  5760. }
  5761. if (this.completelevels.length > 0) {
  5762. this.ShowCompleteTask();
  5763. }
  5764. }
  5765. CheckEggComplete() {
  5766. var completes = [];
  5767. var curlevel = LevelManager.Instance.curlevel;
  5768. for (var i = 0; i < curlevel.leveltasks.length; i++) {
  5769. var matsk = curlevel.leveltasks[i];
  5770. if (matsk.id == 4 && matsk.state == 1) {
  5771. var getskins = [];
  5772. for (var k = 0; k < PlayerAccount.CurAccountData.m_skinDic.values.length; k++) {
  5773. var mskin = PlayerAccount.CurAccountData.m_skinDic.values[k];
  5774. if (mskin.curskinstate != skinstate.lock && mskin.skintype == skintype.weapon) {
  5775. getskins.push(mskin);
  5776. }
  5777. }
  5778. if (getskins.length >= 8) {
  5779. completes.push(matsk);
  5780. TaskManager.CompleteEgg(matsk);
  5781. }
  5782. }
  5783. else if (matsk.id == 9 && matsk.state == 1) {
  5784. var getskins = [];
  5785. for (var j = 0; j < PlayerAccount.CurAccountData.m_skinDic.values.length; j++) {
  5786. var mskin = PlayerAccount.CurAccountData.m_skinDic.values[j];
  5787. if (mskin.curskinstate != skinstate.lock && mskin.skintype == skintype.role) {
  5788. getskins.push(mskin);
  5789. }
  5790. }
  5791. if (getskins.length >= 4) {
  5792. completes.push(matsk);
  5793. TaskManager.CompleteEgg(matsk);
  5794. }
  5795. }
  5796. }
  5797. return completes;
  5798. }
  5799. OnRender(_cell) {
  5800. var taskdata = _cell.dataSource;
  5801. var bg = _cell.getChildAt(0);
  5802. var egg = bg.getChildAt(0);
  5803. var desc = bg.getChildAt(1);
  5804. desc.visible = false;
  5805. var videobtn = bg.getChildAt(2);
  5806. videobtn.visible = false;
  5807. var readbtn = bg.getChildAt(3);
  5808. readbtn.visible = false;
  5809. var geted = _cell.getChildAt(1);
  5810. geted.visible = false;
  5811. var lockbg = _cell.getChildAt(2);
  5812. lockbg.visible = false;
  5813. if (taskdata.state == taskstate.lock) {
  5814. egg.visible = true;
  5815. lockbg.visible = true;
  5816. videobtn.visible = true;
  5817. videobtn.clickHandler = Laya.Handler.create(this, this.OnClickVideoGet, [taskdata], false);
  5818. }
  5819. else if (taskdata.state == taskstate.open) {
  5820. egg.visible = true;
  5821. lockbg.visible = false;
  5822. readbtn.visible = true;
  5823. readbtn.clickHandler = Laya.Handler.create(this, this.OnReadTask, [taskdata], false);
  5824. }
  5825. else if (taskdata.state == taskstate.complete) {
  5826. desc.visible = true;
  5827. desc.text = "兑换码:" + taskdata.cdk.toString();
  5828. egg.alpha = 0.4;
  5829. }
  5830. else if (taskdata.state == taskstate.geted) {
  5831. desc.visible = true;
  5832. geted.visible = true;
  5833. desc.text = "兑换码:" + taskdata.cdk.toString();
  5834. egg.alpha = 0.4;
  5835. }
  5836. }
  5837. OnReadTask(_data) {
  5838. WindowManager.Instance.OpenPopView(WindowType.TaskContentView, [_data, false, false]);
  5839. }
  5840. OnClickVideoGet(_data) {
  5841. if (_data.state == taskstate.lock) {
  5842. if (ADHelper.IsAndroid) {
  5843. ADHelper.showVideoAd((flag) => {
  5844. if (flag) {
  5845. _data.state = taskstate.open;
  5846. TaskManager.SetData(_data);
  5847. this.RefreshCDList();
  5848. }
  5849. });
  5850. }
  5851. }
  5852. }
  5853. }
  5854. class TaskContentView extends ui.Window.TaskContentViewUI {
  5855. constructor() {
  5856. super();
  5857. this.settlement = false;
  5858. TaskContentView.instance = this;
  5859. TaskContentView.instance.InitSize();
  5860. }
  5861. static get Instance() {
  5862. return TaskContentView.instance;
  5863. }
  5864. InitSize() {
  5865. this.height = Laya.stage.height;
  5866. this.mespan.y = Laya.stage.height / 1280 * this.mespan.y;
  5867. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  5868. }
  5869. OnOpen(_data = null) {
  5870. InputManager.caninput = false;
  5871. if (_data == null)
  5872. this.OnClickClose();
  5873. this.RegButton();
  5874. this.taskdata = _data[0];
  5875. this.complete = _data[1];
  5876. this.settlement = _data[2];
  5877. this.tips.visible = this.complete;
  5878. this.cdktex.visible = this.complete;
  5879. if (this.complete) {
  5880. this.cdktex.text = "兑换码:" + this.taskdata.cdk;
  5881. this.ani1.play(null, false);
  5882. }
  5883. TaskManager.OpenEgg(this.taskdata);
  5884. LevelManager.Instance.curlevel.GetTask();
  5885. this.title.text = this.taskdata.title;
  5886. this.content.text = this.taskdata.content;
  5887. }
  5888. RegButton() {
  5889. this.closemesview.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
  5890. }
  5891. OnHide() {
  5892. InputManager.caninput = true;
  5893. }
  5894. OnClickClose() {
  5895. WindowManager.Instance.ClosePopView(WindowType.TaskContentView);
  5896. Player.mainpalyer.SetWuDi(2000);
  5897. if (this.complete) {
  5898. if (this.settlement) {
  5899. GameManager.Instance.ReCompleteCheck(this.taskdata);
  5900. }
  5901. else {
  5902. TaskWindow.Instance.ReCompleteCheck(this.taskdata);
  5903. }
  5904. }
  5905. }
  5906. OnShare() {
  5907. TtSdk.Share();
  5908. }
  5909. }
  5910. class CDKView extends ui.Window.CDKViewUI {
  5911. constructor() {
  5912. super();
  5913. CDKView.instance = this;
  5914. CDKView.instance.InitSize();
  5915. }
  5916. static get Instance() {
  5917. return CDKView.instance;
  5918. }
  5919. InitSize() {
  5920. this.height = Laya.stage.height;
  5921. this.pan.y = Laya.stage.height / 1280 * this.pan.y;
  5922. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  5923. }
  5924. OnOpen(_data = null) {
  5925. this.RegButton();
  5926. this.inputtext.text = "";
  5927. }
  5928. RegButton() {
  5929. this.closebtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
  5930. this.backbtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
  5931. this.getbtn.clickHandler = Laya.Handler.create(this, this.OnGetSkin, null, false);
  5932. }
  5933. OnHide() {
  5934. }
  5935. OnClickClose() {
  5936. WindowManager.Instance.ClosePopView(WindowType.CDKView);
  5937. }
  5938. OnGetSkin() {
  5939. console.log(this.inputtext.text);
  5940. var targetcdk = Number(this.inputtext.text);
  5941. var targetskin;
  5942. var skins = PlayerAccount.CurAccountData.m_skinDic.values;
  5943. for (var i = 0; i < skins.length; i++) {
  5944. var curskin = skins[i];
  5945. if (curskin.cdk == targetcdk) {
  5946. targetskin = curskin;
  5947. break;
  5948. }
  5949. }
  5950. if (targetskin == null) {
  5951. TtSdk.showToast("兑换码错误");
  5952. }
  5953. else {
  5954. if (targetskin.curskinstate != skinstate.lock) {
  5955. TtSdk.showToast("已兑换");
  5956. }
  5957. else {
  5958. this.GetSkinAward(targetskin);
  5959. }
  5960. }
  5961. }
  5962. GetSkinAward(_skin) {
  5963. if (_skin.curskinstate != skinstate.lock) {
  5964. TaskManager.GeEgg(_skin.cdk);
  5965. return;
  5966. }
  5967. var reward_item = _skin.skinid + 6000;
  5968. let param = [{ "reward_item": reward_item.toString() }, { "reward_num": "1" }, { "t": PlayerAccount.ServerTime.toString() }];
  5969. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
  5970. TaskManager.GeEgg(_skin.cdk);
  5971. WindowManager.Instance.ClosePopView(WindowType.CDKView);
  5972. EventManager.Trigger(EventType.UseSkin);
  5973. var reward = new rewarddata(reward_item);
  5974. reward.type = 1;
  5975. reward.rewardicon = _skin.skinicon;
  5976. reward.rewardname = _skin.skinname;
  5977. reward.rewardnum = 1;
  5978. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
  5979. }), Laya.Handler.create(this, this.OnSignError), true);
  5980. }
  5981. OnSignError(e) {
  5982. console.log(e);
  5983. }
  5984. }
  5985. class ChestData {
  5986. constructor() {
  5987. this.cheststate = 0;
  5988. this.canvideoopen = false;
  5989. }
  5990. get chesticon() {
  5991. if (this.chesttype == 1000) {
  5992. return "jb";
  5993. }
  5994. else {
  5995. var skin = PlayerAccount.CurAccountData.m_skinDic.getValue(this.chestid);
  5996. return skin.skinicon;
  5997. }
  5998. }
  5999. }
  6000. class ChestWindow extends ui.Window.ChestWindowUI {
  6001. constructor() {
  6002. super();
  6003. this.chestdatas = [];
  6004. this.keynum = 2;
  6005. this.canhome = false;
  6006. this.video = false;
  6007. this.getkey = false;
  6008. this.gamewin = false;
  6009. ChestWindow.instance = this;
  6010. }
  6011. static get Instance() {
  6012. return ChestWindow.instance;
  6013. }
  6014. InitList() {
  6015. var datas = [];
  6016. for (var i = 0; i < 9; i++) {
  6017. var curchest = new ChestData();
  6018. if (i > 5) {
  6019. curchest.canvideoopen = true;
  6020. }
  6021. datas.push(curchest);
  6022. }
  6023. return datas;
  6024. }
  6025. EnterChest() {
  6026. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.entertreasure, null, new Laya.Handler(null, (_data) => {
  6027. var targetChest = new ChestData();
  6028. targetChest.chesttype = 6000;
  6029. targetChest.chestid = _data.theme_id;
  6030. this.InitChest(targetChest);
  6031. }), new Laya.Handler(this, (_data) => {
  6032. console.log("err" + _data);
  6033. }));
  6034. }
  6035. InitChest(_chestdata) {
  6036. this.targetChest = _chestdata;
  6037. this.chestdatas = this.InitList();
  6038. this.chestlist.array = this.chestdatas;
  6039. this.chestlist.renderHandler = Laya.Handler.create(this, this.OnRender, null, false);
  6040. this.getys.visible = false;
  6041. this.getys.clickHandler = Laya.Handler.create(this, this.OnGetKey, null, false);
  6042. this.homebtn.clickHandler = Laya.Handler.create(this, this.OnBackHome, null, false);
  6043. this.RefreshChestDatas();
  6044. }
  6045. OnOpen(_win = false) {
  6046. this.gamewin = _win;
  6047. this.EnterChest();
  6048. this.chestpan.y = Laya.stage.height / 1280 * this.chestpan.y;
  6049. this.height = Laya.stage.height;
  6050. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  6051. }
  6052. OnHide() {
  6053. }
  6054. OnRender(_cell, _index) {
  6055. var data = _cell.dataSource;
  6056. var chest = _cell.getChildAt(1);
  6057. chest.visible = data.cheststate == 0;
  6058. var videobg = chest.getChildAt(0);
  6059. videobg.visible = data.canvideoopen;
  6060. var skin = _cell.getChildAt(2);
  6061. skin.visible = data.cheststate == 1 && data.chesttype > 1000;
  6062. if (skin.visible) {
  6063. var icon = skin.getChildAt(0);
  6064. icon.skin = "icon/" + data.chesticon + ".png";
  6065. }
  6066. var gold = _cell.getChildAt(3);
  6067. gold.visible = data.cheststate == 1 && data.chesttype == 1000;
  6068. if (gold.visible) {
  6069. var mgold = gold.getChildAt(1);
  6070. mgold.text = data.chestnum.toString();
  6071. }
  6072. var getbtn = _cell.getChildAt(4);
  6073. if (data.cheststate == 0) {
  6074. if (data.canvideoopen) {
  6075. getbtn.clickHandler = Laya.Handler.create(this, this.VideoOpenTreasure, [false, _index], false);
  6076. }
  6077. else {
  6078. getbtn.clickHandler = Laya.Handler.create(this, this.OpenTreasure, [false, true, _index], false);
  6079. }
  6080. }
  6081. else {
  6082. getbtn.clickHandler = null;
  6083. }
  6084. }
  6085. OnBackHome() {
  6086. GameManager.Instance.RessetGame();
  6087. }
  6088. SetChestData(_index, _data) {
  6089. this.chestdatas[_index] = _data;
  6090. this.RefreshChestDatas();
  6091. }
  6092. get getTarget() {
  6093. for (var i = 0; i < this.chestdatas.length; i++) {
  6094. var curdata = this.chestdatas[i];
  6095. if (curdata.chesttype != 1000 && curdata.chestid == this.targetChest.chestid) {
  6096. return true;
  6097. }
  6098. }
  6099. return false;
  6100. }
  6101. RefreshChestDatas() {
  6102. this.chestlist.array = this.chestdatas;
  6103. this.chestlist.renderHandler = Laya.Handler.create(this, this.OnRender, null, false);
  6104. this.key1.visible = this.keynum > 0;
  6105. this.key2.visible = this.keynum > 1;
  6106. this.key3.visible = this.keynum > 2;
  6107. this.opspr.visible = this.keynum > 0;
  6108. var allopen = true;
  6109. for (var i = 0; i < this.chestdatas.length; i++) {
  6110. if (this.chestdatas[i].cheststate == 0) {
  6111. allopen = false;
  6112. break;
  6113. }
  6114. }
  6115. if (this.canhome == false && this.keynum == 0 || allopen) {
  6116. this.canhome = true;
  6117. }
  6118. this.homebtn.visible = this.canhome;
  6119. this.getys.visible = this.keynum == 0 && !allopen;
  6120. if (this.getys.visible)
  6121. this.getys.clickHandler = Laya.Handler.create(this, this.OnGetKey, null, false);
  6122. }
  6123. OnGetKey() {
  6124. this.getkey = true;
  6125. if (ADHelper.IsAndroid) {
  6126. ADHelper.showVideoAd((flag) => {
  6127. if (flag) {
  6128. this.keynum = 3;
  6129. this.video = true;
  6130. this.RefreshChestDatas();
  6131. }
  6132. });
  6133. }
  6134. }
  6135. VideoOpenTreasure(_usekey, _index) {
  6136. if (ADHelper.IsAndroid) {
  6137. ADHelper.showVideoAd((flag) => {
  6138. if (flag) {
  6139. this.OpenTreasure(true, _usekey, _index);
  6140. }
  6141. });
  6142. }
  6143. }
  6144. OpenTreasure(_video, _usekey, _index) {
  6145. if (_usekey && this.keynum <= 0) {
  6146. TtSdk.showToast("钥匙用完啦!");
  6147. return;
  6148. }
  6149. if (!_video && _usekey && PlayerAccount.CurAccountData.videonum) {
  6150. this.VideoOpenTreasure(true, _index);
  6151. return;
  6152. }
  6153. var channel = _video && !this.video ? "key:treasure_open" : "video:treasure_open";
  6154. var arges = [{ "t": PlayerAccount.CurrentAccount.ServerTime.toString() }, { "channel": channel }];
  6155. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.opentreasure, arges, new Laya.Handler(null, (_data) => {
  6156. if (_usekey)
  6157. this.keynum -= 1;
  6158. var rewarditem = new ChestData();
  6159. rewarditem.cheststate = 1;
  6160. for (var key in _data.rewards) {
  6161. var item = Number(key);
  6162. if (item == 1000) {
  6163. rewarditem.chesttype = 1000;
  6164. rewarditem.chestnum = Number(_data.rewards[key]);
  6165. }
  6166. else {
  6167. rewarditem.chesttype = 6000;
  6168. rewarditem.chestid = item % 6000;
  6169. }
  6170. }
  6171. this.SetChestData(_index, rewarditem);
  6172. if (item > 1000) {
  6173. var reward = new rewarddata(rewarditem.chestid);
  6174. reward.type = rewardtype.role;
  6175. var skin = PlayerAccount.CurAccountData.m_skinDic.getValue(rewarditem.chestid);
  6176. reward.rewardicon = skin.skinicon;
  6177. reward.rewardname = skin.skinname;
  6178. reward.rewardnum = 1;
  6179. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
  6180. }
  6181. this.RefreshChestDatas();
  6182. }), new Laya.Handler(this, (_data) => {
  6183. console.log("err" + _data);
  6184. }));
  6185. }
  6186. }
  6187. class TaoZhuangWindow extends ui.Window.TaoZhuangWindowUI {
  6188. constructor() {
  6189. super();
  6190. this.tzpre = 0;
  6191. TaoZhuangWindow.instance = this;
  6192. }
  6193. static get Instance() {
  6194. return TaoZhuangWindow.instance;
  6195. }
  6196. InitSize() {
  6197. this.height = Laya.stage.height;
  6198. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  6199. this.pan.y = Laya.stage.height / 1280 * this.pan.y;
  6200. }
  6201. OnOpen(_data = null) {
  6202. this.InitSize();
  6203. this.RegButton();
  6204. this.GetAwardDatas();
  6205. this.ShowPre();
  6206. }
  6207. RegButton() {
  6208. this.getbtn.clickHandler = Laya.Handler.create(this, this.OnGetSkins, null, false);
  6209. this.backbtn.clickHandler = Laya.Handler.create(this, this.OnBack, null, false);
  6210. }
  6211. OnHide() {
  6212. }
  6213. GetAwardDatas() {
  6214. var roleskin = PlayerAccount.CurAccountData.m_skinDic.getValue(22);
  6215. var weaponskin = PlayerAccount.CurAccountData.m_skinDic.getValue(17);
  6216. var rolecan = roleskin && roleskin.curskinstate == skinstate.lock;
  6217. var weaponcan = weaponskin && weaponskin.curskinstate == skinstate.lock;
  6218. if (rolecan) {
  6219. var roleaward = new rewarddata(roleskin.skinid + 6000);
  6220. roleaward.rewardicon = roleskin.skinicon;
  6221. roleaward.rewardname = roleskin.skinname;
  6222. roleaward.type = rewardtype.role;
  6223. roleaward.rewardnum = 1;
  6224. this.roleaward = roleaward;
  6225. }
  6226. if (weaponcan) {
  6227. var weaponaward = new rewarddata(weaponskin.skinid + 6000);
  6228. weaponaward.rewardicon = weaponskin.skinicon;
  6229. weaponaward.rewardname = weaponskin.skinname;
  6230. weaponaward.type = rewardtype.weapon;
  6231. weaponaward.rewardnum = 1;
  6232. this.weaponaward = weaponaward;
  6233. }
  6234. }
  6235. static canshow() {
  6236. var roleskin = PlayerAccount.CurAccountData.m_skinDic.getValue(22);
  6237. var weaponskin = PlayerAccount.CurAccountData.m_skinDic.getValue(17);
  6238. var rolecan = roleskin && roleskin.curskinstate == skinstate.lock;
  6239. var weaponcan = weaponskin && weaponskin.curskinstate == skinstate.lock;
  6240. if (rolecan || weaponcan) {
  6241. return true;
  6242. }
  6243. else {
  6244. return false;
  6245. }
  6246. }
  6247. ShowPre() {
  6248. var curpre = TaoZhuangWindow.GetPre();
  6249. var pre1p = this.pre1.getChildAt(0);
  6250. pre1p.visible = curpre > 0;
  6251. var pre2p = this.pre2.getChildAt(0);
  6252. pre2p.visible = curpre > 1;
  6253. var pre3p = this.pre3.getChildAt(0);
  6254. pre3p.visible = curpre > 2;
  6255. if (curpre >= 3) {
  6256. this.getbtn.mouseEnabled = false;
  6257. this.GetRole();
  6258. }
  6259. }
  6260. OnGetSkins() {
  6261. if (ADHelper.IsAndroid) {
  6262. ADHelper.showVideoAd((flag) => {
  6263. if (flag) {
  6264. this.SetPre(1);
  6265. this.ShowPre();
  6266. }
  6267. });
  6268. }
  6269. else {
  6270. this.SetPre(1);
  6271. this.ShowPre();
  6272. }
  6273. }
  6274. SetPre(_num) {
  6275. var tzpre = Laya.LocalStorage.getItem("tzpre");
  6276. var mtz = 0;
  6277. if (tzpre) {
  6278. mtz = Number(tzpre) + _num;
  6279. Laya.LocalStorage.setItem("tzpre", mtz.toString());
  6280. }
  6281. else {
  6282. mtz = _num;
  6283. Laya.LocalStorage.setItem("tzpre", _num.toString());
  6284. }
  6285. return mtz;
  6286. }
  6287. static GetPre() {
  6288. var tzpre = Laya.LocalStorage.getItem("tzpre");
  6289. if (tzpre) {
  6290. return Number(tzpre);
  6291. }
  6292. else {
  6293. return 0;
  6294. }
  6295. }
  6296. GetRole() {
  6297. var roleskin = PlayerAccount.CurAccountData.m_skinDic.getValue(22);
  6298. var rolecan = roleskin && roleskin.curskinstate == skinstate.lock;
  6299. if (rolecan) {
  6300. this.GetAward(this.roleaward, () => {
  6301. this.GetWeapon();
  6302. });
  6303. }
  6304. else {
  6305. this.GetWeapon();
  6306. }
  6307. }
  6308. GetWeapon() {
  6309. var weaponskin = PlayerAccount.CurAccountData.m_skinDic.getValue(17);
  6310. var weaponcan = weaponskin && weaponskin.curskinstate == skinstate.lock;
  6311. if (weaponcan) {
  6312. this.GetAward(this.weaponaward, () => {
  6313. this.OnBack();
  6314. });
  6315. }
  6316. else {
  6317. this.OnBack();
  6318. }
  6319. }
  6320. GetAward(_reward, cb) {
  6321. var reward_item = _reward.rewarditem;
  6322. let param = [{ "reward_item": reward_item.toString() }, { "reward_num": _reward.rewardnum.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
  6323. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
  6324. WindowManager.Instance.OpenPopView(WindowType.RewardWindow, _reward);
  6325. RewardWindow.Instance.closeback = () => {
  6326. cb();
  6327. };
  6328. }), Laya.Handler.create(this, this.OnSignError), true);
  6329. }
  6330. OnSignError(e) {
  6331. console.log(e);
  6332. }
  6333. OnBack() {
  6334. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  6335. }
  6336. }
  6337. var WindowType;
  6338. (function (WindowType) {
  6339. WindowType[WindowType["HomeWindow"] = 0] = "HomeWindow";
  6340. WindowType[WindowType["InGameWindow"] = 1] = "InGameWindow";
  6341. WindowType[WindowType["ChestWindow"] = 2] = "ChestWindow";
  6342. WindowType[WindowType["TaoZhuangWindow"] = 3] = "TaoZhuangWindow";
  6343. WindowType[WindowType["BaoXiangWindow"] = 4] = "BaoXiangWindow";
  6344. WindowType[WindowType["CDKView"] = 5] = "CDKView";
  6345. WindowType[WindowType["TaskContentView"] = 6] = "TaskContentView";
  6346. WindowType[WindowType["TaskWindow"] = 7] = "TaskWindow";
  6347. WindowType[WindowType["CheatWindow"] = 8] = "CheatWindow";
  6348. WindowType[WindowType["SettlementWindow"] = 9] = "SettlementWindow";
  6349. WindowType[WindowType["SkinWindow"] = 10] = "SkinWindow";
  6350. WindowType[WindowType["ResurrectionWindow"] = 11] = "ResurrectionWindow";
  6351. WindowType[WindowType["PlaneGiftWindow"] = 12] = "PlaneGiftWindow";
  6352. WindowType[WindowType["SignWindow"] = 13] = "SignWindow";
  6353. WindowType[WindowType["LotteryWindow"] = 14] = "LotteryWindow";
  6354. WindowType[WindowType["TryOutWindow"] = 15] = "TryOutWindow";
  6355. WindowType[WindowType["RewardWindow"] = 16] = "RewardWindow";
  6356. WindowType[WindowType["ShareVideoWindow"] = 17] = "ShareVideoWindow";
  6357. })(WindowType || (WindowType = {}));
  6358. class WindowManager {
  6359. constructor() {
  6360. this.ViewDic = [];
  6361. this.popViewDic = [];
  6362. this.viewCont = new Laya.Sprite;
  6363. this.popCont = new Laya.Sprite;
  6364. WindowManager.WindowManagerInstance = this;
  6365. this.Init();
  6366. }
  6367. static get Instance() {
  6368. if (WindowManager.WindowManagerInstance) {
  6369. return WindowManager.WindowManagerInstance;
  6370. }
  6371. else {
  6372. return new WindowManager();
  6373. }
  6374. }
  6375. Init() {
  6376. this.ViewDic[WindowType.HomeWindow] = HomeWindow;
  6377. this.ViewDic[WindowType.InGameWindow] = InGameWindow;
  6378. this.ViewDic[WindowType.SettlementWindow] = SettlementWindow;
  6379. this.ViewDic[WindowType.ResurrectionWindow] = ReviveWindow;
  6380. this.ViewDic[WindowType.SkinWindow] = SkinWindow;
  6381. this.ViewDic[WindowType.RewardWindow] = RewardWindow;
  6382. this.ViewDic[WindowType.TryOutWindow] = TryoutWindow;
  6383. this.ViewDic[WindowType.SignWindow] = SignWindow;
  6384. this.ViewDic[WindowType.ShareVideoWindow] = ShareVideoWindow;
  6385. this.ViewDic[WindowType.CheatWindow] = CheatWindow;
  6386. this.ViewDic[WindowType.BaoXiangWindow] = BaoXiangWindow;
  6387. this.ViewDic[WindowType.TaskWindow] = TaskWindow;
  6388. this.ViewDic[WindowType.TaskContentView] = TaskContentView;
  6389. this.ViewDic[WindowType.CDKView] = CDKView;
  6390. this.ViewDic[WindowType.ChestWindow] = ChestWindow;
  6391. this.ViewDic[WindowType.TaoZhuangWindow] = TaoZhuangWindow;
  6392. Laya.stage.addChild(this.viewCont);
  6393. Laya.stage.addChild(this.popCont);
  6394. }
  6395. ShowWindow(_type, _data = null) {
  6396. if (this.curOpenedView != null) {
  6397. this.curOpenedView.OnHide();
  6398. this.curOpenedView.destroy();
  6399. this.curOpenedView.removeSelf();
  6400. }
  6401. TtSdk.Clear();
  6402. this.ClearPopViews();
  6403. console.log(WindowType[_type]);
  6404. this.curOpenedView = new this.ViewDic[_type];
  6405. this.curOpenedView.name = WindowType[_type];
  6406. this.viewCont.addChild(this.curOpenedView);
  6407. this.curOpenedView.OnOpen(_data);
  6408. }
  6409. OpenPopView(viewType, data = null) {
  6410. var popView;
  6411. if (this.popViewDic[viewType]) {
  6412. popView = this.popViewDic[viewType];
  6413. if (popView.visible)
  6414. return;
  6415. this.popCont.setChildIndex(popView, this.popCont.numChildren - 1);
  6416. popView.visible = true;
  6417. }
  6418. else {
  6419. popView = new this.ViewDic[viewType];
  6420. this.popCont.addChild(popView);
  6421. this.popViewDic[viewType] = popView;
  6422. }
  6423. TtSdk.Clear();
  6424. popView.OnOpen(data);
  6425. }
  6426. ClosePopView(viewType) {
  6427. var popView = this.popViewDic[viewType];
  6428. if (popView == null || !popView.visible)
  6429. return;
  6430. popView.OnHide();
  6431. TtSdk.Clear();
  6432. popView.visible = false;
  6433. }
  6434. CloseCurrentWindow() {
  6435. this.curOpenedView.OnHide();
  6436. this.curOpenedView.destroy();
  6437. this.curOpenedView.removeSelf();
  6438. }
  6439. ClearPopViews() {
  6440. this.ClosePopView(WindowType.PlaneGiftWindow);
  6441. this.ClosePopView(WindowType.ShareVideoWindow);
  6442. }
  6443. }
  6444. var Vector3$f = Laya.Vector3;
  6445. class Barrier extends Building {
  6446. constructor() {
  6447. super(...arguments);
  6448. this.cut = false;
  6449. }
  6450. OnInit() {
  6451. if (this.mdata.buildid != 7) {
  6452. this.mcollider = this.cursprite.getChildAt(2).getComponent(Laya.PhysicsCollider);
  6453. this.mcollider.collisionGroup = ColliderLay.obstacle;
  6454. this.mcollider.enabled = true;
  6455. this.downsprite = this.cursprite.getChildAt(0);
  6456. this.upsprite = this.cursprite.getChildAt(1);
  6457. }
  6458. else {
  6459. this.mcollider = this.cursprite.getChildAt(1).getComponent(Laya.PhysicsCollider);
  6460. this.mcollider.collisionGroup = ColliderLay.obstacle;
  6461. this.mcollider1 = this.cursprite.getChildAt(2).getComponent(Laya.PhysicsCollider);
  6462. this.mcollider1.collisionGroup = ColliderLay.obstacle;
  6463. this.mcollider1.enabled = true;
  6464. this.downsprite = this.cursprite.getChildAt(1);
  6465. this.downsprite1 = this.cursprite.getChildAt(2);
  6466. this.upsprite = this.cursprite.getChildAt(0);
  6467. this.mcollider.enabled = true;
  6468. }
  6469. if (this.mdata.buildid == 6) {
  6470. this.mcollider.collisionGroup = ColliderLay.grass;
  6471. }
  6472. for (var i = 0; i < this.cursprite.numChildren; i++) {
  6473. var curspr = this.cursprite.getChildAt(i);
  6474. curspr.active = true;
  6475. }
  6476. this.OnReg();
  6477. }
  6478. OnReg() {
  6479. EventManager.On(EventType.Cut, this, this.OnCut);
  6480. }
  6481. OnClear() {
  6482. EventManager.Off(EventType.Cut, this, this.OnCut);
  6483. if (this.uprig)
  6484. this.uprig.Clear();
  6485. if (this.downrig)
  6486. this.downrig.Clear();
  6487. if (this.copysprite) {
  6488. for (var i = 0; i < this.copysprite.numChildren; i++) {
  6489. var curspr = this.copysprite.getChildAt(i);
  6490. curspr.active = true;
  6491. }
  6492. PoolManager.RecoverSprite3D(this.copysprite, true);
  6493. }
  6494. if (this.cuteffect)
  6495. PoolManager.RecoverSprite3D(this.cuteffect);
  6496. }
  6497. OnCut(_collider) {
  6498. if (this.cut)
  6499. return;
  6500. if (this.mcollider == _collider || (this.mcollider1 && this.mcollider1 == _collider)) {
  6501. this.BeCut(_collider);
  6502. }
  6503. }
  6504. BeCut(_collider) {
  6505. if (this.cut)
  6506. return;
  6507. this.cut = true;
  6508. this.die = true;
  6509. this.mcollider.enabled = false;
  6510. TtSdk.Shake();
  6511. if (this.mdata.buildid == 4) {
  6512. var boomrange = 5;
  6513. var boomcount = 0;
  6514. for (var i = 0; i < LevelManager.Instance.curlevel.gameroles.length; i++) {
  6515. var currole = LevelManager.Instance.curlevel.gameroles[i];
  6516. if (currole == Player.mainpalyer)
  6517. continue;
  6518. var dis = Vector3$f.distance(this.cursprite.transform.position, currole.cursprite.transform.position);
  6519. if (dis < boomrange) {
  6520. currole.BeBoom();
  6521. boomcount++;
  6522. }
  6523. if (boomcount > 2) {
  6524. LevelManager.Instance.curlevel.allboomree = true;
  6525. }
  6526. }
  6527. for (var i = 0; i < LevelManager.Instance.curlevel.builds.length; i++) {
  6528. var curbuild = LevelManager.Instance.curlevel.builds[i];
  6529. if (curbuild == this)
  6530. continue;
  6531. var dis = Vector3$f.distance(this.cursprite.transform.position, curbuild.cursprite.transform.position);
  6532. if (dis < boomrange) {
  6533. if (curbuild.mdata.type == 0) {
  6534. var curbarr = curbuild;
  6535. if (!curbarr.cut)
  6536. curbarr.BeCut(null);
  6537. }
  6538. else if (curbuild.mdata.type == 1) {
  6539. var curstand = curbuild;
  6540. curstand.BeCut();
  6541. }
  6542. }
  6543. }
  6544. }
  6545. var cuteffid = 4;
  6546. if (this.mdata.buildid == 4) {
  6547. cuteffid = 2;
  6548. AudioControl.PlayVoice(VoiceType.boom);
  6549. }
  6550. else if (this.mdata.buildid == 2) {
  6551. cuteffid = 5;
  6552. AudioControl.PlayVoice(VoiceType.cut);
  6553. }
  6554. else if (this.mdata.buildid == 6) {
  6555. AudioControl.PlayVoice(VoiceType.cutgrass);
  6556. }
  6557. else {
  6558. AudioControl.PlayVoice(VoiceType.cut);
  6559. }
  6560. if (this.mdata.buildid == 8) {
  6561. WindowManager.Instance.OpenPopView(WindowType.BaoXiangWindow);
  6562. }
  6563. var cutasset = AssetManager.effect.getValue(cuteffid);
  6564. this.cuteffect = PoolManager.GetSprite3D(cutasset);
  6565. SceneManager.mainscene.addChild(this.cuteffect);
  6566. if (this.mdata.buildid != 2) {
  6567. this.cuteffect.transform.position = this.upsprite.transform.position.clone();
  6568. }
  6569. else {
  6570. this.cuteffect.transform.position = this.cursprite.transform.position.clone();
  6571. }
  6572. this.copysprite = PoolManager.GetSprite3D(AssetManager.BuildAsset(buildtype.barrier, this.mdata.buildid));
  6573. SceneManager.mainscene.addChild(this.copysprite);
  6574. this.copysprite.transform.position = this.cursprite.transform.position.clone();
  6575. this.copysprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
  6576. if (this.mdata.buildid == 7) {
  6577. var up = this.copysprite.getChildAt(0);
  6578. up.active = false;
  6579. var ccid = _collider == this.mcollider1 ? 1 : 2;
  6580. var gas = this.copysprite.getChildAt(ccid);
  6581. gas.active = false;
  6582. }
  6583. else {
  6584. var dieupsprite = this.copysprite.getChildAt(1);
  6585. dieupsprite.active = false;
  6586. var diedownspr = this.copysprite.getChildAt(0);
  6587. diedownspr.active = true;
  6588. var downrig = new RigObj(this.copysprite, null, 1, 1.2);
  6589. downrig.minhight = 0;
  6590. var downforce = this.mdata.buildid == 6 ? 0 : 0.5;
  6591. downrig.AddForce(new Laya.Vector3(0, 1, downforce), 0.3);
  6592. var sffcollider = this.copysprite.getChildAt(2).getComponent(Laya.PhysicsCollider);
  6593. sffcollider.enabled = false;
  6594. }
  6595. if (_collider != null && _collider == this.mcollider1) {
  6596. this.downsprite1.active = false;
  6597. }
  6598. else {
  6599. this.downsprite.active = false;
  6600. }
  6601. this.uprig = new RigObj(this.cursprite, () => {
  6602. if (downrig)
  6603. downrig.Clear();
  6604. this.copysprite.active = false;
  6605. this.cursprite.active = false;
  6606. }, 1.5, 1.5);
  6607. this.uprig.minhight = 1;
  6608. this.uprig.AddForce(new Laya.Vector3(0, 1, 0.4), 1);
  6609. }
  6610. }
  6611. class StandBuild extends Building {
  6612. constructor() {
  6613. super(...arguments);
  6614. this.cut = false;
  6615. }
  6616. OnInit() {
  6617. this.mcollider = this.cursprite.getChildAt(2).getComponent(Laya.PhysicsCollider);
  6618. this.mcollider.collisionGroup = ColliderLay.obstacle;
  6619. this.downsprite = this.cursprite.getChildAt(0);
  6620. this.upsprite = this.cursprite.getChildAt(1);
  6621. this.standnode = this.cursprite.getChildAt(3);
  6622. var standpos = this.standnode.transform.position.clone();
  6623. var pos = new Laya.Vector4(standpos.x, standpos.y, standpos.z, this.standnode.transform.rotationEuler.y);
  6624. var shooterdata = new MonsterData(this.mdata.monsterid, pos);
  6625. shooterdata.boos = this.mdata.boos;
  6626. this.mshooter = Shooter.Create(shooterdata);
  6627. this.mshooter.SkinShow(1, 6);
  6628. this.OnReg();
  6629. }
  6630. OnReg() {
  6631. EventManager.On(EventType.Cut, this, this.OnCut);
  6632. if (this.uprig)
  6633. this.uprig.Clear();
  6634. if (this.downrig)
  6635. this.downrig.Clear();
  6636. if (this.copysprite)
  6637. PoolManager.RecoverSprite3D(this.copysprite);
  6638. }
  6639. OnClear() {
  6640. EventManager.Off(EventType.Cut, this, this.OnCut);
  6641. if (this.copysprite)
  6642. this.copysprite.destroy();
  6643. if (!this.cut)
  6644. this.mshooter.Clear();
  6645. if (this.cuteffect)
  6646. PoolManager.RecoverSprite3D(this.cuteffect);
  6647. }
  6648. OnCut(_collider) {
  6649. if (this.mcollider != _collider || this.cut)
  6650. return;
  6651. this.BeCut();
  6652. LevelManager.Instance.curlevel.gameroles.push(this.mshooter);
  6653. this.mshooter.FallLand(this.cursprite.transform.position.y);
  6654. }
  6655. BeCut() {
  6656. this.cut = true;
  6657. TtSdk.Shake();
  6658. AudioControl.PlayVoice(VoiceType.cut);
  6659. var cutasset = AssetManager.effect.getValue(4);
  6660. this.cuteffect = PoolManager.GetSprite3D(cutasset);
  6661. SceneManager.mainscene.addChild(this.cuteffect);
  6662. this.cuteffect.transform.position = this.upsprite.transform.position.clone();
  6663. this.copysprite = PoolManager.GetSprite3D(AssetManager.BuildAsset(buildtype.stand, this.mdata.buildid));
  6664. SceneManager.mainscene.addChild(this.copysprite);
  6665. this.copysprite.transform.position = this.cursprite.transform.position.clone();
  6666. this.copysprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
  6667. var dieupsprite = this.copysprite.getChildAt(1);
  6668. dieupsprite.active = false;
  6669. this.downrig = new RigObj(this.copysprite, null, 1);
  6670. this.downrig.minhight = 1;
  6671. this.downrig.AddForce(new Laya.Vector3(0, 1, 0.1), 0.5);
  6672. this.downsprite.active = false;
  6673. this.uprig = new RigObj(this.cursprite, () => {
  6674. this.Clear();
  6675. }, 1.5, 1.5);
  6676. this.uprig.minhight = 1;
  6677. this.uprig.AddForce(new Laya.Vector3(0, 1, 0.4), 0.5);
  6678. }
  6679. }
  6680. class GameManager {
  6681. constructor() {
  6682. this.curgamestate = GameState.None;
  6683. this.play_id = 0;
  6684. this.gamecount = 0;
  6685. this.goldnum = 0;
  6686. this.begin = false;
  6687. this.completelevels = [];
  6688. GameManager.instance = this;
  6689. console.log("游戏初始化...");
  6690. this.GameInit();
  6691. }
  6692. static get Instance() {
  6693. return GameManager.instance;
  6694. }
  6695. static GetBuild(data) {
  6696. var mbuild = new GameManager.builddic[data.type];
  6697. mbuild.Init(data);
  6698. mbuild.clear = false;
  6699. return mbuild;
  6700. }
  6701. GameInit() {
  6702. GameManager.builddic[buildtype.barrier] = Barrier;
  6703. GameManager.builddic[buildtype.stand] = StandBuild;
  6704. GameManager.builddic[buildtype.road] = Barrier;
  6705. new TaskManager();
  6706. new MonsterDataManager();
  6707. new LevelManager();
  6708. new InputManager();
  6709. this.RegEvent();
  6710. this.ChangeGameState(GameState.Ready);
  6711. }
  6712. RegEvent() {
  6713. EventManager.GameOn(GameState.Ready, this, this.GameReady);
  6714. EventManager.GameOn(GameState.Idle, this, this.GameIdle);
  6715. EventManager.GameOn(GameState.Start, this, this.OnGameStart);
  6716. EventManager.GameOn(GameState.Playing, this, this.GamePlaying);
  6717. EventManager.GameOn(GameState.Die, this, this.GameDie);
  6718. EventManager.GameOn(GameState.Lose, this, this.GameLose);
  6719. EventManager.GameOn(GameState.Win, this, this.GameWin);
  6720. EventManager.GameOn(GameState.Over, this, this.GameOver);
  6721. EventManager.On(EventType.GameIdle, this, this.OnGameIdle);
  6722. }
  6723. ChangeGameState(_state, args = null) {
  6724. if (_state == this.curgamestate)
  6725. return;
  6726. this.curgamestate = _state;
  6727. console.log("GameState:", GameState[_state]);
  6728. EventManager.GameTrigger(_state, args);
  6729. }
  6730. OnGameIdle() {
  6731. this.ChangeGameState(GameState.Idle);
  6732. }
  6733. GameIdle() {
  6734. }
  6735. GameReady() {
  6736. LevelManager.Instance.ReadyLevel();
  6737. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  6738. this.ChangeGameState(GameState.Idle);
  6739. this.begin = false;
  6740. if (HomeWindow.sign && GameManager.Instance.gamecount > 0 && SignWindow.canSgin) {
  6741. HomeWindow.sign = false;
  6742. WindowManager.Instance.ShowWindow(WindowType.SignWindow);
  6743. return;
  6744. }
  6745. var skin = !HomeWindow.sign || !SignWindow.canSgin;
  6746. if (skin && HomeWindow.skin && GameManager.Instance.gamecount > 0) {
  6747. HomeWindow.skin = false;
  6748. WindowManager.Instance.ShowWindow(WindowType.SkinWindow);
  6749. return;
  6750. }
  6751. if (GameManager.Instance.gamecount > 1 && GameManager.Instance.gamecount % 3 == 0 && TaoZhuangWindow.canshow) {
  6752. WindowManager.Instance.ShowWindow(WindowType.TaoZhuangWindow);
  6753. }
  6754. }
  6755. BeginGame() {
  6756. if (this.curgamestate == GameState.Idle && !this.begin) {
  6757. this.begin = true;
  6758. var agrs = [{ "t": PlayerAccount.CurrentAccount.ServerTime.toString() }];
  6759. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.game, agrs, new Laya.Handler(null, (_data) => {
  6760. GameManager.Instance.play_id = _data.play_id;
  6761. this.OnGameBegin();
  6762. }), new Laya.Handler(this, (_data) => {
  6763. this.begin = false;
  6764. console.log("err" + _data);
  6765. }));
  6766. }
  6767. }
  6768. OnGameBegin() {
  6769. TtSdk.Instance.RecordStart();
  6770. if (LevelManager.Instance.curlevel.leveldata.missiondata.trial) {
  6771. WindowManager.Instance.ShowWindow(WindowType.TryOutWindow);
  6772. }
  6773. else {
  6774. this.RecordLevelStart();
  6775. this.ChangeGameState(GameState.Start);
  6776. }
  6777. }
  6778. OnGameStart() {
  6779. this.curlevel = LevelManager.Instance.curlevel;
  6780. this.gamecount++;
  6781. this.goldnum = 0;
  6782. console.log("打开游戏中界面...");
  6783. this.ChangeGameState(GameState.Playing);
  6784. }
  6785. GamePlaying() {
  6786. AudioControl.PlayBgm(BgmType.bgm);
  6787. WindowManager.Instance.ShowWindow(WindowType.InGameWindow);
  6788. }
  6789. GameDie() {
  6790. WindowManager.Instance.ClearPopViews();
  6791. this.ChangeGameState(GameState.Lose);
  6792. }
  6793. GameLose() {
  6794. this.curwin = false;
  6795. console.log("打开结算界面(游戏失败)");
  6796. WindowManager.Instance.ShowWindow(WindowType.ResurrectionWindow);
  6797. this.RecropLevelEnd(false);
  6798. }
  6799. GameWin() {
  6800. this.curwin = true;
  6801. console.log("打开结算界面(游戏胜利)");
  6802. GameManager.alllose = 0;
  6803. this.CheckComplete(true);
  6804. this.RecropLevelEnd(true);
  6805. LevelManager.teststage++;
  6806. }
  6807. CheckComplete(_win) {
  6808. this.completelevels = this.CheckLevelTask();
  6809. if (this.completelevels.length == 0) {
  6810. WindowManager.Instance.ShowWindow(WindowType.SettlementWindow, _win);
  6811. }
  6812. else {
  6813. this.ShowCompleteTask();
  6814. }
  6815. }
  6816. ShowCompleteTask() {
  6817. var curtask = this.completelevels[0];
  6818. WindowManager.Instance.OpenPopView(WindowType.TaskContentView, [curtask, true, true]);
  6819. }
  6820. ReCompleteCheck(_task) {
  6821. var index = this.completelevels.indexOf(_task);
  6822. if (index != -1) {
  6823. this.completelevels.splice(index, 1);
  6824. }
  6825. if (this.completelevels.length > 0) {
  6826. this.ShowCompleteTask();
  6827. }
  6828. else {
  6829. WindowManager.Instance.ShowWindow(WindowType.SettlementWindow, true);
  6830. }
  6831. }
  6832. GameOver(_win) {
  6833. AudioControl.ClearAudio();
  6834. if (_win) {
  6835. WindowManager.Instance.ShowWindow(WindowType.ChestWindow, true);
  6836. }
  6837. else {
  6838. this.RessetGame();
  6839. }
  6840. }
  6841. RessetGame() {
  6842. if (this.curlevel)
  6843. this.curlevel.Clear();
  6844. this.ChangeGameState(GameState.Ready);
  6845. }
  6846. RecordLevelStart() {
  6847. if (!Laya.Browser.onWeiXin)
  6848. return;
  6849. this.curlevel = LevelManager.Instance.curlevel;
  6850. var stageid = this.curlevel.levelid.toString();
  6851. var stagename = this.curlevel.levelname;
  6852. var useid = PlayerAccount.CurAccountData.UseId;
  6853. }
  6854. RecropLevelEnd(_win) {
  6855. if (!Laya.Browser.onWeiXin)
  6856. return;
  6857. var stageid = this.curlevel.levelid.toString();
  6858. var useid = PlayerAccount.CurAccountData.UseId;
  6859. var stagename = LevelManager.Instance.curlevel.levelname;
  6860. if (_win) ;
  6861. else {
  6862. var equipid = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[1];
  6863. }
  6864. }
  6865. CheckLevelTask() {
  6866. var completelevel = [];
  6867. for (var i = 0; i < this.curlevel.leveltasks.length; i++) {
  6868. var matsk = this.curlevel.leveltasks[i];
  6869. if (matsk.id == 1 && matsk.state == 1) {
  6870. if (this.curlevel.allccclear) {
  6871. completelevel.push(matsk);
  6872. TaskManager.CompleteEgg(matsk);
  6873. }
  6874. }
  6875. else if (matsk.id == 2 && matsk.state == 1) {
  6876. if (this.curlevel.alllenemynoneclear && this.curwin) {
  6877. completelevel.push(matsk);
  6878. TaskManager.CompleteEgg(matsk);
  6879. }
  6880. }
  6881. else if (matsk.id == 3 && matsk.state == 1) {
  6882. if (Player.mainpalyer.allfall) {
  6883. completelevel.push(matsk);
  6884. TaskManager.CompleteEgg(matsk);
  6885. }
  6886. }
  6887. else if (matsk.id == 4 && matsk.state == 1) {
  6888. var getskins = [];
  6889. for (var j = 0; j < PlayerAccount.CurAccountData.m_skinDic.values.length; j++) {
  6890. var mskin = PlayerAccount.CurAccountData.m_skinDic.values[j];
  6891. if (mskin.curskinstate != skinstate.lock && mskin.skintype == skintype.weapon) {
  6892. getskins.push(mskin);
  6893. }
  6894. }
  6895. if (getskins.length >= 8) {
  6896. completelevel.push(matsk);
  6897. TaskManager.CompleteEgg(matsk);
  6898. }
  6899. }
  6900. else if (matsk.id == 5 && matsk.state == 1) {
  6901. if (GameManager.alllose > 2) {
  6902. completelevel.push(matsk);
  6903. TaskManager.CompleteEgg(matsk);
  6904. }
  6905. }
  6906. else if (matsk.id == 6 && matsk.state == 1) {
  6907. if (this.curlevel.allboomree) {
  6908. completelevel.push(matsk);
  6909. TaskManager.CompleteEgg(matsk);
  6910. }
  6911. }
  6912. else if (matsk.id == 7 && matsk.state == 1) {
  6913. if (Player.mainpalyer.allstand && this.curwin) {
  6914. completelevel.push(matsk);
  6915. TaskManager.CompleteEgg(matsk);
  6916. }
  6917. }
  6918. else if (matsk.id == 8 && matsk.state == 1) {
  6919. if (this.curlevel.allbuildnoclear && this.curwin) {
  6920. completelevel.push(matsk);
  6921. TaskManager.CompleteEgg(matsk);
  6922. }
  6923. }
  6924. else if (matsk.id == 9 && matsk.state == 1) {
  6925. var getskins = [];
  6926. for (var k = 0; k < PlayerAccount.CurAccountData.m_skinDic.values.length; k++) {
  6927. var mskin = PlayerAccount.CurAccountData.m_skinDic.values[k];
  6928. if (mskin.curskinstate != skinstate.lock && mskin.skintype == skintype.role) {
  6929. getskins.push(mskin);
  6930. }
  6931. }
  6932. if (getskins.length >= 4) {
  6933. completelevel.push(matsk);
  6934. TaskManager.CompleteEgg(matsk);
  6935. }
  6936. }
  6937. }
  6938. return completelevel;
  6939. }
  6940. }
  6941. GameManager.builddic = [];
  6942. GameManager.alllose = 0;
  6943. var Vector3$g = Laya.Vector3;
  6944. class SceneManager {
  6945. constructor(_scene) {
  6946. this.frist = true;
  6947. SceneManager.instance = this;
  6948. SceneManager.mainscene = _scene;
  6949. SceneManager.endsprite = _scene.getChildByName("end");
  6950. SceneManager.endsprite.active = false;
  6951. var endcollider = SceneManager.endsprite.getComponent(Laya.PhysicsCollider);
  6952. endcollider.collisionGroup = ColliderLay.end;
  6953. SceneManager.mapparent = new Laya.Node();
  6954. SceneManager.mapparent.name = "mapparent";
  6955. SceneManager.mainscene.addChild(SceneManager.mapparent);
  6956. SceneManager.maincamera = _scene.getChildByName("Main Camera");
  6957. SceneManager.maincamera.addComponent(CameraManager);
  6958. SceneManager.maincamera.enableHDR = false;
  6959. SceneManager.maincamera.clearColor = new Laya.Vector4(130 / 255, 201 / 255, 254 / 255, 1);
  6960. SceneManager.camerastartpos = SceneManager.maincamera.transform.position.clone();
  6961. SceneManager.camerastartrot = SceneManager.maincamera.transform.rotation.clone();
  6962. SceneManager.mainlight = _scene.getChildByName("Directional Light");
  6963. console.log("场景开始初始化...");
  6964. EventManager.On(EventType.LevelCreateComplete, this, this.OnLevelCreate);
  6965. new GameManager();
  6966. }
  6967. static get Instance() {
  6968. return SceneManager.instance;
  6969. }
  6970. OnLevelCreate() {
  6971. if (this.frist) {
  6972. this.frist = false;
  6973. this.FirstEnter();
  6974. }
  6975. EventManager.Trigger(EventType.GameIdle);
  6976. }
  6977. FirstEnter() {
  6978. SceneManager.mainscene.visible = true;
  6979. console.log("场景首次打开...");
  6980. for (var i = 0; i < AssetManager.effect.values.length; i++) {
  6981. var cureffect = AssetManager.effect.values[i];
  6982. SceneManager.mainscene.addChild(cureffect);
  6983. cureffect.transform.position = new Vector3$g(0, 0, 5000);
  6984. cureffect.active = true;
  6985. }
  6986. Laya.timer.once(3500, this, () => {
  6987. for (var i = 0; i < AssetManager.effect.values.length; i++) {
  6988. var cureffect = AssetManager.effect.values[i];
  6989. cureffect.removeSelf();
  6990. cureffect.transform.position = new Vector3$g(0, 0, 0);
  6991. cureffect.active = false;
  6992. }
  6993. });
  6994. }
  6995. }
  6996. SceneManager.camerastartpos = new Vector3$g();
  6997. SceneManager.camerastartrot = new Laya.Quaternion();
  6998. var Vector3$h = Laya.Vector3;
  6999. class GameUtils {
  7000. static ScaleVector3(v3, f) {
  7001. return new Vector3$h(v3.x * f, v3.y * f, v3.z * f);
  7002. }
  7003. static getConverseVector3(_vector3) {
  7004. return new Vector3$h(-_vector3.x, -_vector3.y, -_vector3.z);
  7005. }
  7006. static angleToEangle(_angle) {
  7007. return _angle * Math.PI / 180;
  7008. }
  7009. static absEangle(_angle) {
  7010. var x = _angle.x;
  7011. if (x == -0) {
  7012. x = 0;
  7013. }
  7014. var y = _angle.y;
  7015. if (y == -0) {
  7016. y = 0;
  7017. }
  7018. var z = _angle.z;
  7019. if (z == -0) {
  7020. z = 0;
  7021. }
  7022. return new Vector3$h(x, y, z);
  7023. }
  7024. static debugVector3(_vector3) {
  7025. console.log(_vector3.x + " " + _vector3.y + " " + _vector3.z);
  7026. }
  7027. static getRandomInt(left, right) {
  7028. if (left > right) {
  7029. return 0;
  7030. }
  7031. var size = right - left + 1;
  7032. var curNumber = Math.random() * size + left;
  7033. return Math.floor(curNumber);
  7034. }
  7035. static getRandomfloat(left, right) {
  7036. if (left >= right) {
  7037. return 0;
  7038. }
  7039. var size = right - left;
  7040. var curNumber = Math.random() * size + left;
  7041. return curNumber;
  7042. }
  7043. static Vector2Length(_pos1, _pos2) {
  7044. var offestx = _pos1.x - _pos2.x;
  7045. var offestz = _pos1.y - _pos2.y;
  7046. var v1 = Math.pow(offestx, 2);
  7047. var v2 = Math.pow(offestz, 2);
  7048. var dis = Math.sqrt(v1 + v2);
  7049. return dis;
  7050. }
  7051. static Vector32Length(_pos1, _pos2) {
  7052. var offestx = _pos1.x - _pos2.x;
  7053. var offestz = _pos1.z - _pos2.z;
  7054. var v1 = Math.pow(offestx, 2);
  7055. var v2 = Math.pow(offestz, 2);
  7056. var dis = Math.sqrt(v1 + v2);
  7057. return dis;
  7058. }
  7059. static Vector3Angle(_dir1, _dir2) {
  7060. var v = Vector3$h.dot(_dir1, _dir2);
  7061. var av = Vector3$h.scalarLength(_dir1);
  7062. var bv = Vector3$h.scalarLength(_dir2);
  7063. var vv = av * bv;
  7064. var cosa = v / vv;
  7065. var angle = Math.acos(cosa) * 180 / Math.PI;
  7066. return angle;
  7067. }
  7068. static Angle(ma, mb) {
  7069. var v1 = (ma.x * mb.x) + (ma.y * mb.y) + (ma.z * mb.z);
  7070. var ma_val = Math.sqrt(ma.x * ma.x + ma.y * ma.y + ma.z * ma.z);
  7071. var mb_val = Math.sqrt(mb.x * mb.x + mb.y * mb.y + mb.z * mb.z);
  7072. var cosM = v1 / (ma_val * mb_val);
  7073. var angleAMB = Math.acos(cosM) * 180 / Math.PI;
  7074. return angleAMB;
  7075. }
  7076. static SetColliderLay(_node, _lay) {
  7077. var childNumber = _node.numChildren;
  7078. var PhysicsCollider = _node.getComponent(Laya.PhysicsCollider);
  7079. if (PhysicsCollider) {
  7080. PhysicsCollider.collisionGroup = _lay;
  7081. PhysicsCollider.friction = 1;
  7082. PhysicsCollider.restitution = 0;
  7083. }
  7084. for (var i = 0; i < childNumber; i++) {
  7085. var eChildNumber = _node.getChildAt(i).numChildren;
  7086. if (eChildNumber > 0) {
  7087. this.SetColliderLay(_node.getChildAt(i), _lay);
  7088. }
  7089. var PhysicsCollider = _node.getChildAt(i).getComponent(Laya.PhysicsCollider);
  7090. if (PhysicsCollider) {
  7091. PhysicsCollider.collisionGroup = _lay;
  7092. PhysicsCollider.friction = 1;
  7093. PhysicsCollider.restitution = 0;
  7094. }
  7095. }
  7096. }
  7097. static TweenButton(_btn, _complete) {
  7098. _btn.mouseEnabled = false;
  7099. if (_btn.anchorX != 0.5) {
  7100. _btn.anchorX = 0.5;
  7101. _btn.anchorY = 0.5;
  7102. _btn.x += _btn.width / 2;
  7103. _btn.y += _btn.height / 2;
  7104. }
  7105. Laya.Tween.to(_btn, { scaleX: 1.2, scaleY: 1.2 }, 150, Laya.Ease.quadOut, Laya.Handler.create(this, () => {
  7106. Laya.Tween.to(_btn, { scaleX: 1, scaleY: 1 }, 100, Laya.Ease.quadIn, Laya.Handler.create(this, () => {
  7107. _btn.mouseEnabled = true;
  7108. _complete();
  7109. }));
  7110. }));
  7111. }
  7112. static TweenMove(targetTransform, TargetPos, duration, _completeHandle = null, ease = null, lookPos = null) {
  7113. var curPos = targetTransform.position;
  7114. var tween = Laya.Tween.to(curPos, { x: TargetPos.x, y: TargetPos.y, z: TargetPos.z, update: new Laya.Handler(this, function () {
  7115. if (lookPos)
  7116. targetTransform.lookAt(lookPos, new Laya.Vector3(0, 1, 0));
  7117. targetTransform.position = curPos;
  7118. }) }, duration * 1000, ease, Laya.Handler.create(this, function () {
  7119. tween.clear();
  7120. if (_completeHandle != null) {
  7121. _completeHandle.run();
  7122. }
  7123. }));
  7124. return tween;
  7125. }
  7126. static TweenERot(targetTransform, TargetRot, duration, _completeHandle = null, ease = null) {
  7127. var curPos = targetTransform.rotationEuler;
  7128. var tween = Laya.Tween.to(curPos, { x: TargetRot.x, y: TargetRot.y, z: TargetRot.z, update: new Laya.Handler(this, function () {
  7129. targetTransform.rotationEuler = 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 TweenProgress(_progress, _fromValue, _tovalue, _duration, _completeHandle = null) {
  7139. _progress.value = _fromValue;
  7140. var tween = Laya.Tween.to(_progress, { value: _tovalue }, _duration * 1000, null, _completeHandle);
  7141. return tween;
  7142. }
  7143. static lerp(form, to, t) {
  7144. if (t <= 0) {
  7145. return form;
  7146. }
  7147. else if (t >= 1) {
  7148. return to;
  7149. }
  7150. var a = t * to + (1 - t) * form;
  7151. return a;
  7152. }
  7153. static DelayToDo(_delayDuration, _doFunction) {
  7154. Laya.timer.once(_delayDuration * 1000, this, _doFunction);
  7155. }
  7156. static ArrayContainsItem(_array, _item) {
  7157. let index = _array.indexOf(_item);
  7158. if (index != -1) {
  7159. return true;
  7160. }
  7161. return false;
  7162. }
  7163. static PathangleLength(pts) {
  7164. var le = 0;
  7165. for (var i = 0; i < pts.length - 1; i++) {
  7166. var dis = Vector3$h.distance(pts[i], pts[i + 1]);
  7167. le += dis;
  7168. }
  7169. return le;
  7170. }
  7171. static TweenText(message, _hight, _completeHandle = null, _duration = 1000) {
  7172. var mes = new Laya.Text();
  7173. mes.width = message.size.x;
  7174. mes.height = message.size.y;
  7175. mes.align = "center";
  7176. mes.valign = "middle";
  7177. mes.font = "Microsoft YaHei";
  7178. mes.fontSize = message.fontSize;
  7179. mes.pivotX = mes.width / 2;
  7180. mes.pivotY = mes.height / 2;
  7181. mes.color = "#5ad122";
  7182. mes.bold = true;
  7183. mes.stroke = 5;
  7184. mes.strokeColor = "#ffffff";
  7185. if (message.color) {
  7186. message.color = message.color;
  7187. }
  7188. mes.text = message.message;
  7189. mes.zOrder = 1;
  7190. Laya.stage.addChildAt(mes, Laya.stage.numChildren - 1);
  7191. mes.pos(message.pos.x, message.pos.y);
  7192. var tween = Laya.Tween.to(mes, { y: mes.y - _hight, update: new Laya.Handler(this, function () {
  7193. }) }, _duration, Laya.Ease.expoInOut, Laya.Handler.create(this, function () {
  7194. tween.clear();
  7195. mes.destroy();
  7196. if (_completeHandle) {
  7197. _completeHandle.run();
  7198. }
  7199. }));
  7200. Laya.Tween.to(mes, { alpha: 0.4 }, _duration, Laya.Ease.backInOut);
  7201. return mes;
  7202. }
  7203. static TweenGold(_vector3, _topos) {
  7204. var viewpos = new Laya.Vector4();
  7205. SceneManager.maincamera.worldToViewportPoint(_vector3, viewpos);
  7206. var goldsprite = new Laya.Image;
  7207. goldsprite.width = 51;
  7208. goldsprite.height = 53;
  7209. goldsprite.pivotX = goldsprite.width / 2;
  7210. goldsprite.pivotY = goldsprite.height / 2;
  7211. Laya.stage.addChild(goldsprite);
  7212. goldsprite.x = viewpos.x;
  7213. goldsprite.y = viewpos.y;
  7214. goldsprite.skin = "game/zhujiemian-1-7.png";
  7215. Laya.Tween.to(goldsprite, {
  7216. x: _topos.x, y: _topos.y, alpha: 0.4
  7217. }, 1000, null, Laya.Handler.create(this, () => {
  7218. if (goldsprite)
  7219. goldsprite.destroy();
  7220. }), null, false);
  7221. }
  7222. static GetMoney(_num, _pos = null, _completeHandle = null) {
  7223. if (_num == 0)
  7224. return;
  7225. var mbox = new Laya.Box;
  7226. mbox.width = 400;
  7227. mbox.height = 100;
  7228. mbox.pivotX = mbox.width / 2;
  7229. mbox.pivotY = mbox.height / 2;
  7230. if (_pos == null) {
  7231. _pos = new Laya.Vector2(Laya.stage.width / 2, Laya.stage.height / 2);
  7232. }
  7233. mbox.pos(_pos.x, _pos.y);
  7234. var mimage = new Laya.Image;
  7235. mimage.skin = "game/jiesuan-1-6.png";
  7236. mimage.width = 81;
  7237. mimage.height = 87;
  7238. mimage.left = 50;
  7239. mimage.y = 10;
  7240. mbox.addChild(mimage);
  7241. var mtext = new Laya.Text;
  7242. mtext.width = 300;
  7243. mtext.height = 50;
  7244. mtext.align = "left";
  7245. mtext.valign = "middle";
  7246. mtext.font = "Microsoft YaHei";
  7247. mtext.fontSize = 45;
  7248. mtext.color = "#FFFFFF";
  7249. mtext.bold = true;
  7250. mtext.font = "Microsoft YaHei";
  7251. mtext.text = "金币 +" + _num;
  7252. mtext.x = 150;
  7253. mtext.y = 25;
  7254. mbox.addChild(mtext);
  7255. Laya.stage.addChild(mbox);
  7256. var curtween = Laya.Tween.to(mbox, { y: mbox.y - 200 }, 1500, Laya.Ease.expoInOut, Laya.Handler.create(this, () => {
  7257. curtween.clear();
  7258. mbox.destroy();
  7259. if (_completeHandle) {
  7260. _completeHandle.run();
  7261. }
  7262. }), 100);
  7263. return mbox;
  7264. }
  7265. static DirToAngle(_dir) {
  7266. var dir = new Vector3$h(Math.round(_dir.x * 10) / 10, Math.round(_dir.y * 10) / 10, Math.round(_dir.z * 10) / 10);
  7267. if (dir.x == -0) {
  7268. dir = new Vector3$h(0, dir.y, dir.z);
  7269. }
  7270. if (dir.y == -0) {
  7271. dir = new Vector3$h(dir.x, 0, dir.z);
  7272. }
  7273. if (dir.z == -0) {
  7274. dir = new Vector3$h(dir.x, dir.y, 0);
  7275. }
  7276. var reangle = Math.atan(dir.y / dir.z) * 180 / Math.PI;
  7277. if (dir.z < 0)
  7278. reangle += 180;
  7279. reangle -= 90;
  7280. var hangle = reangle * Math.PI / 180;
  7281. return hangle;
  7282. }
  7283. static YNAngleToVe(_dir) {
  7284. var hangle = this.DirToAngle(_dir);
  7285. var dirx = Math.cos(hangle);
  7286. var diry = Math.sin(hangle);
  7287. return new Vector3$h(0, diry, dirx);
  7288. }
  7289. static DirRotYToDir(_dir, _angle) {
  7290. var outdir = new Vector3$h();
  7291. return outdir;
  7292. }
  7293. }
  7294. class SkinData {
  7295. constructor(_id, _type) {
  7296. this.skinid = _id;
  7297. this.skintype = _type;
  7298. this.GetSkinState(this.skintype);
  7299. }
  7300. GetSkinState(_skintype) {
  7301. var usetheme = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[_skintype];
  7302. var useing = usetheme == this.skinid.toString();
  7303. var gettheme = PlayerAccount.CurAccountData.HasTheme(this.skinid);
  7304. if (useing) {
  7305. this.curskinstate = skinstate.useing;
  7306. }
  7307. else if (!useing && gettheme) {
  7308. this.curskinstate = skinstate.getnoues;
  7309. }
  7310. else {
  7311. this.curskinstate = skinstate.lock;
  7312. }
  7313. }
  7314. }
  7315. class VerCheck {
  7316. static get checkgame() {
  7317. var mgame = true;
  7318. if (!VerCheck.game) {
  7319. mgame = false;
  7320. }
  7321. else {
  7322. VerCheck.game = false;
  7323. this.GameInit();
  7324. }
  7325. return mgame;
  7326. }
  7327. static GameInit() {
  7328. console.log("gameinit");
  7329. console.log("Ver", this.mVer);
  7330. }
  7331. }
  7332. VerCheck.mVer = "1.3.3";
  7333. VerCheck.game = true;
  7334. VerCheck.WX = false;
  7335. class AccountData {
  7336. constructor(_token, _appSetting, _user, _userbase, _useInvite = null, _user_stage = null, _user_sign, _user_achievement, _lottery, _user_video) {
  7337. this.city_deny = false;
  7338. this.openid = "";
  7339. this.userId = "";
  7340. this.scene = "";
  7341. this.top_scene = "";
  7342. this.roadconfig = {};
  7343. this.m_RewardDic = {};
  7344. this.m_EntityDic = {};
  7345. this.m_AchievementDic = {};
  7346. this.m_skinDic = new Dictionary();
  7347. this.m_token = _token;
  7348. this.m_app_setting = _appSetting;
  7349. this.m_user = _user;
  7350. this.m_user_base = _userbase;
  7351. this.m_sign = _user_sign;
  7352. this.m_task = _user_achievement;
  7353. this.lottery = _lottery;
  7354. this.m_user_video = _user_video;
  7355. this.userId = this.m_user["user_id"];
  7356. this.openid = this.m_user_base["openid"];
  7357. this.scene = this.m_user_base["scene"];
  7358. this.top_scene = this.m_user_base["top_scene"];
  7359. console.log("user_id:" + this.userId);
  7360. }
  7361. get lotterytime() {
  7362. return Number(this.lottery["day_video_times"]);
  7363. }
  7364. get share() {
  7365. return this.m_app_setting["share"] == "1";
  7366. }
  7367. get sharecontent() {
  7368. return this.m_app_setting["sharecontent"];
  7369. }
  7370. get ShareImage() {
  7371. return this.m_app_setting["ShareImage"];
  7372. }
  7373. get cheattime() {
  7374. return Number(this.m_app_setting["cheattime"]);
  7375. }
  7376. get banner() {
  7377. return this.m_app_setting["banner"] == "1";
  7378. }
  7379. get video() {
  7380. return this.m_app_setting["video"] == "1";
  7381. }
  7382. get checkscence() {
  7383. return this.m_app_setting["checkscence"] == "1";
  7384. }
  7385. get bgm() {
  7386. return this.m_app_setting["bgm"] == "1";
  7387. }
  7388. get newaccount() {
  7389. return this.m_user["game_times"] == "0" && GameManager.Instance.gamecount == 0;
  7390. }
  7391. get ctnfilename() {
  7392. return this.m_app_setting["ctnfilename"];
  7393. }
  7394. get cheat() {
  7395. return this.m_app_setting["cheat"] == "1";
  7396. }
  7397. get shakestage() {
  7398. return this.m_app_setting["shakestage"] && this.m_app_setting["shakestage"] == "1";
  7399. }
  7400. get videlAdUnitId() {
  7401. return this.m_app_setting["videlAdUnitId"];
  7402. }
  7403. get bannerAdUnitId() {
  7404. return this.m_app_setting["bannerAdUnitId"];
  7405. }
  7406. get tri() {
  7407. return this.m_app_setting["tri"] == "1";
  7408. }
  7409. get recommend() {
  7410. return this.m_app_setting["recommend"] == "1";
  7411. }
  7412. get recommendbanner() {
  7413. return this.m_app_setting["recommendbanner"] == "1";
  7414. }
  7415. get chest() {
  7416. return this.m_app_setting["chest"] == "1";
  7417. }
  7418. get egg() {
  7419. return Number(this.m_app_setting["egg"]) > Math.random();
  7420. }
  7421. get cheatback() {
  7422. return this.m_app_setting["cheatback"] == "1";
  7423. }
  7424. get cuteffect() {
  7425. return this.m_app_setting["cuteffect"] == "1";
  7426. }
  7427. get videolock() {
  7428. return false;
  7429. }
  7430. get videonum() {
  7431. return false;
  7432. }
  7433. get UseId() {
  7434. return this.userId;
  7435. }
  7436. GetConfig(_type) {
  7437. var type = AccountConfig[_type];
  7438. return this.m_configs[type];
  7439. }
  7440. GetUser(_type) {
  7441. var type = AccountUser[_type];
  7442. return this.m_user[type];
  7443. }
  7444. get GetVideoTotal() {
  7445. return Number(this.m_user_video["total"]);
  7446. }
  7447. GetSign(_datatype) {
  7448. var type = signdata[_datatype];
  7449. return this.m_sign[type];
  7450. }
  7451. GetRewardConfig(_rewardid) {
  7452. var reward = this.m_RewardDic[_rewardid];
  7453. return reward;
  7454. }
  7455. GetEntity(_id, attr) {
  7456. if (!this.m_EntityDic[_id])
  7457. return null;
  7458. return this.m_EntityDic[_id][entity[attr]];
  7459. }
  7460. GetRewardDic() {
  7461. var config = this.GetConfig(AccountConfig.rewards);
  7462. for (var key in config) {
  7463. this.m_RewardDic[config[key].id] = config[key];
  7464. }
  7465. }
  7466. GetEntityDic() {
  7467. var config = this.GetConfig(AccountConfig.entity);
  7468. for (var key in config) {
  7469. this.m_EntityDic[config[key].entity_id] = config[key];
  7470. }
  7471. }
  7472. GetThemeById(_id) {
  7473. var data = this.GetConfig(AccountConfig.theme);
  7474. if (data) {
  7475. for (let index = 0; index < data.length; index++) {
  7476. const element = data[index];
  7477. if (element.id == _id) {
  7478. return element;
  7479. }
  7480. }
  7481. }
  7482. }
  7483. GetSkinAttr(_id) {
  7484. var config = this.GetConfig(AccountConfig.theme);
  7485. for (var i = 0; i < config.length; i++) {
  7486. if (config[i].id == _id) {
  7487. return config[i];
  7488. }
  7489. }
  7490. }
  7491. GetAchievementData() {
  7492. var data = this.GetConfig(AccountConfig.achievement);
  7493. var dic = {};
  7494. for (var key1 in data) {
  7495. var type1 = data[key1].type;
  7496. if (dic[type1]) {
  7497. continue;
  7498. }
  7499. var array = [];
  7500. for (var key2 in data) {
  7501. var type2 = data[key2].type;
  7502. if (type1 == type2) {
  7503. array.push(data[key2]);
  7504. }
  7505. }
  7506. dic[type1] = array;
  7507. }
  7508. this.m_AchievementDic = dic;
  7509. }
  7510. HasTheme(_id) {
  7511. var has = false;
  7512. var getthemes = this.GetUser(AccountUser.get_themes);
  7513. for (var i = 0; i < getthemes.length; i++) {
  7514. if (getthemes[i] == _id) {
  7515. has = true;
  7516. }
  7517. }
  7518. return has;
  7519. }
  7520. GetSkinDic(_config) {
  7521. var themes = _config.theme;
  7522. for (var i = 0; i < themes.length; i++) {
  7523. var config = themes[i];
  7524. var data = new SkinData(Number(config.id), 0);
  7525. data.skinname = config.name;
  7526. data.skintype = Number(config.type);
  7527. data.achievement_type = Number(config.achievement_type);
  7528. data.quality = Number(config.quality);
  7529. data.require_type = Number(config.require_type);
  7530. data.require_num = Number(config.require_num);
  7531. data.skinicon = config.icon;
  7532. data.prefab = config.prefab;
  7533. data.lev_big = Number(config.lev_big);
  7534. data.prop = Number(config.prop);
  7535. data.cdk = Number(config.code);
  7536. data.shield = Number(config.shield);
  7537. data.GetSkinState(data.skintype);
  7538. if (data.shield == 0) {
  7539. this.m_skinDic.add(Number(config.id), data);
  7540. }
  7541. }
  7542. }
  7543. GetReward(_skintype) {
  7544. var rewardskin;
  7545. var videoskins = [];
  7546. var skins = PlayerAccount.CurAccountData.m_skinDic;
  7547. for (var i = 0; i < skins.values.length; i++) {
  7548. var skin = skins.values[i];
  7549. if (skin.curskinstate == skinstate.lock && skin.require_type != 6 && skin.skintype == _skintype) {
  7550. videoskins.push(skin);
  7551. }
  7552. }
  7553. if (videoskins.length > 0) {
  7554. var random = GameUtils.getRandomInt(0, videoskins.length - 1);
  7555. rewardskin = videoskins[random];
  7556. var skinreward = new rewarddata(6000 + rewardskin.skinid);
  7557. skinreward.rewardicon = rewardskin.skinicon;
  7558. skinreward.rewardname = rewardskin.skinname;
  7559. skinreward.rewardnum = 1;
  7560. skinreward.type = rewardtype.role;
  7561. return skinreward;
  7562. }
  7563. else {
  7564. return null;
  7565. }
  7566. }
  7567. GetSeverConfig(_config) {
  7568. this.m_configs = _config;
  7569. this.GetSkinDic(this.m_configs);
  7570. this.GetRewardDic();
  7571. }
  7572. UpdateSkinDic() {
  7573. this.GetSkinDic(this.m_configs);
  7574. }
  7575. GetGlobe(_key) {
  7576. var globe = this.GetConfig(AccountConfig.global);
  7577. for (var key in globe) {
  7578. var obj = globe[key];
  7579. var kkk = obj["key"];
  7580. if (kkk == _key) {
  7581. var value = obj["value"];
  7582. return value;
  7583. }
  7584. }
  7585. return null;
  7586. }
  7587. }
  7588. class PlayerAccount {
  7589. constructor(_code, _nickname, _avatar, _gender, _country, _province, _city, _device, _shareid, _scence, _ver) {
  7590. this.localTime = Laya.timer.currTimer;
  7591. this.Code = _code;
  7592. this.NickName = _nickname;
  7593. this.Avatar = _avatar;
  7594. this.Gender = _gender;
  7595. this.Country = _country;
  7596. this.Province = _province;
  7597. this.City = _city;
  7598. this.Device = _device;
  7599. this.ShareId = _shareid;
  7600. this.Scene = _scence;
  7601. this.ver = _ver;
  7602. PlayerAccount.instance = this;
  7603. }
  7604. static get CurrentAccount() {
  7605. if (PlayerAccount.instance == null) {
  7606. console.log("生成本地测试账号...");
  7607. return PlayerAccount.TestAccount;
  7608. }
  7609. return PlayerAccount.instance;
  7610. }
  7611. static get TestAccount() {
  7612. var code = Laya.LocalStorage.getItem("localcode");
  7613. if (!code) {
  7614. var time = new Date().getTime().toString();
  7615. var random = GameUtils.getRandomInt(10000, 99999).toString();
  7616. code = "xj_" + time + random;
  7617. Laya.LocalStorage.setItem("localcode", code);
  7618. console.log(time, random);
  7619. console.log("新用户", code);
  7620. }
  7621. else {
  7622. console.log("老用户", code);
  7623. }
  7624. var curaccount = new PlayerAccount(code, null, null, null, null, null, null, null, null, null, VerCheck.mVer);
  7625. return curaccount;
  7626. }
  7627. SetAccountData(data, completecb) {
  7628. var token = data["token"];
  7629. var app_setting = data["app_setting"];
  7630. var user = data["user"];
  7631. var user_base = data["user_base"];
  7632. var user_sign = data["user_sign"];
  7633. var user_achievement = data["user_achievement"];
  7634. var user_lottery = data["user_lottery"];
  7635. var user_video = data["user_video"];
  7636. var city_deny = data["city_deny"];
  7637. if (PlayerAccount.CurAccountData == null) {
  7638. console.log("开始获取config数据");
  7639. PlayerAccount.CurAccountData = new AccountData(token, app_setting, user, user_base, null, null, user_sign, user_achievement, user_lottery, user_video);
  7640. PlayerAccount.CurAccountData.city_deny = city_deny;
  7641. PlayerAccount.day_first = data["day_first"] == 1;
  7642. PlayerAccount.is_new = data["is_new"] ? true : false;
  7643. this.CheckLocalConfig(data.table_version, (_config) => {
  7644. PlayerAccount.CurAccountData.GetSeverConfig(_config);
  7645. if (completecb != null) {
  7646. completecb.runWith(data);
  7647. }
  7648. });
  7649. }
  7650. else {
  7651. if (user) {
  7652. PlayerAccount.CurAccountData.m_user = user;
  7653. }
  7654. if (user_base) {
  7655. PlayerAccount.CurAccountData.m_user_base = user_base;
  7656. }
  7657. if (user_sign) {
  7658. PlayerAccount.CurAccountData.m_sign = user_sign;
  7659. }
  7660. if (user_achievement) {
  7661. PlayerAccount.CurAccountData.m_task = user_achievement;
  7662. }
  7663. if (user_lottery) {
  7664. PlayerAccount.CurAccountData.lottery = user_lottery;
  7665. }
  7666. if (user_video) {
  7667. PlayerAccount.CurAccountData.m_user_video = user_video;
  7668. }
  7669. if (PlayerAccount.CurAccountData.m_configs != null) {
  7670. PlayerAccount.CurAccountData.GetSeverConfig(PlayerAccount.CurAccountData.m_configs);
  7671. }
  7672. }
  7673. }
  7674. CheckLocalConfig(_ver, cb) {
  7675. var curconfig = Laya.LocalStorage.getJSON(PlayerAccount.localcofigkey);
  7676. if (curconfig) {
  7677. if (curconfig.ver == _ver) {
  7678. console.log("sever配置是最新的...", _ver);
  7679. console.log("config接口获取成功");
  7680. cb(curconfig);
  7681. }
  7682. else {
  7683. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Config, null, Laya.Handler.create(this, (data) => {
  7684. data.configs.ver = _ver;
  7685. Laya.LocalStorage.setJSON(PlayerAccount.localcofigkey, data.configs);
  7686. console.log("sever配置更新完成...", _ver);
  7687. console.log("config接口获取成功");
  7688. cb(data.configs);
  7689. }), Laya.Handler.create(this, (data) => {
  7690. console.log("配置获取失败" + data);
  7691. console.log("config接口获取失败");
  7692. }));
  7693. }
  7694. }
  7695. else {
  7696. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Config, null, Laya.Handler.create(this, (data) => {
  7697. data.configs.ver = _ver;
  7698. Laya.LocalStorage.setJSON(PlayerAccount.localcofigkey, data.configs);
  7699. console.log("sever保存配置完成...", _ver);
  7700. console.log("config接口获取成功");
  7701. cb(data.configs);
  7702. }), Laya.Handler.create(this, (data) => {
  7703. console.log("配置获取失败" + data);
  7704. console.log("config接口获取失败");
  7705. }));
  7706. }
  7707. }
  7708. get ServerTime() {
  7709. let time = Laya.timer.currTimer;
  7710. let stime = PlayerAccount.ServerTime + Math.ceil((time - this.localTime) / 1000);
  7711. return stime;
  7712. }
  7713. }
  7714. PlayerAccount.localcofigkey = "mconfig";
  7715. PlayerAccount.day_first = false;
  7716. PlayerAccount.is_new = false;
  7717. var Tween = Laya.Tween;
  7718. class LoadWindow extends ui.Window.LoadWindowUI {
  7719. constructor() {
  7720. super();
  7721. this.respaths = [];
  7722. this.prenum = new Laya.Vector2();
  7723. LoadWindow.instance = this;
  7724. Laya.stage.addChild(this);
  7725. this.logo.y = Laya.stage.height / 1280 * this.logo.y;
  7726. this.logo1.y = Laya.stage.height / 1280 * this.logo1.y;
  7727. this.Open();
  7728. EventManager.On(EventType.LevelCreateComplete, this, this.OnHomeInit);
  7729. }
  7730. static get Instance() {
  7731. return LoadWindow.instance;
  7732. }
  7733. Open(_data = null) {
  7734. console.log("Landing...");
  7735. this.LoginWx();
  7736. this.TweenProgress(0, 65, 1, this.ShowProgress);
  7737. TtSdk.RecordEvent("enterLoad");
  7738. this.height = Laya.stage.height;
  7739. Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
  7740. }
  7741. LoginWx() {
  7742. this.LoginLocalSever();
  7743. }
  7744. LoginLocal() {
  7745. var code = Laya.LocalStorage.getItem("ttcode");
  7746. if (!code) {
  7747. var time = new Date().getTime().toString();
  7748. var random = GameUtils.getRandomInt(10000, 99999).toString();
  7749. code = "xj_" + time + random;
  7750. Laya.LocalStorage.setItem("ttcode", code);
  7751. console.log(time, random);
  7752. console.log("新用户", code);
  7753. }
  7754. else {
  7755. console.log("老用户", code);
  7756. }
  7757. new PlayerAccount(code, "", "", 0, "", "", "", "", "", "", VerCheck.mVer);
  7758. NetworkManager.Instance.login(null, Laya.Handler.create(this, this.OnLoginLocalComplete), Laya.Handler.create(this, this.OnLoginError));
  7759. }
  7760. LoadSbp() {
  7761. this.LoadScene();
  7762. }
  7763. LoginLocalSever(res = null) {
  7764. console.log("开始本地登录");
  7765. NetworkManager.Instance.login(null, Laya.Handler.create(this, this.OnLoginLocalComplete), Laya.Handler.create(this, this.OnLoginError));
  7766. }
  7767. OnLoginLocalComplete() {
  7768. console.log("本地服务器登录完成...");
  7769. ADHelper.initAd();
  7770. this.LoadScene();
  7771. }
  7772. OnLoginError(e) {
  7773. console.log(e);
  7774. this.LoginWx();
  7775. }
  7776. CompleteProgress() {
  7777. this.TweenProgress(this.prenum.x, 100, 0.3, this.LoadEnd);
  7778. }
  7779. ShowProgress() {
  7780. this.TweenProgress(this.prenum.x, 95, 50);
  7781. }
  7782. Hide() {
  7783. Laya.loader.clearRes("res/atlas/load.atlas");
  7784. Laya.loader.clearRes("res/atlas/load.png");
  7785. this.destroy();
  7786. }
  7787. LoadScene() {
  7788. Laya.Scene3D.load(AssetPath.mainscene, Laya.Handler.create(this, (scene) => {
  7789. this.mainscene = scene;
  7790. this.mainscene.visible = false;
  7791. Laya.stage.addChildAt(this.mainscene, 1);
  7792. console.log("场景加载完成...");
  7793. this.LoadResources();
  7794. }));
  7795. }
  7796. LoadResources() {
  7797. var respath = [];
  7798. respath = respath.concat(AssetPath.prefab);
  7799. Laya.loader.create(respath, Laya.Handler.create(this, () => {
  7800. var roleasset = Laya.loader.getRes(AssetPath.prefab[0]);
  7801. for (var i = 0; i < roleasset.numChildren; i++) {
  7802. var curroleasset = roleasset.getChildAt(i);
  7803. curroleasset.active = false;
  7804. AssetManager.role.add(i + 1, curroleasset);
  7805. }
  7806. Laya.loader.clearRes(AssetPath.prefab[0]);
  7807. var girlasset = Laya.loader.getRes(AssetPath.prefab[1]);
  7808. for (var i = 0; i < girlasset.numChildren; i++) {
  7809. var curgirlasset = girlasset.getChildAt(i);
  7810. curgirlasset.active = false;
  7811. AssetManager.girl.add(i + 1, curgirlasset);
  7812. }
  7813. Laya.loader.clearRes(AssetPath.prefab[1]);
  7814. var enemyasset = Laya.loader.getRes(AssetPath.prefab[2]);
  7815. for (var i = 0; i < enemyasset.numChildren; i++) {
  7816. var curenemyasset = enemyasset.getChildAt(i);
  7817. curenemyasset.active = false;
  7818. AssetManager.enemy.add(i + 1, curenemyasset);
  7819. }
  7820. Laya.loader.clearRes(AssetPath.prefab[2]);
  7821. var obstacleasset = Laya.loader.getRes(AssetPath.prefab[3]);
  7822. for (var i = 0; i < obstacleasset.numChildren; i++) {
  7823. var curobsasset = obstacleasset.getChildAt(i);
  7824. curobsasset.active = false;
  7825. AssetManager.obstacle.add(i + 1, curobsasset);
  7826. }
  7827. Laya.loader.clearRes(AssetPath.prefab[3]);
  7828. var bulletasset = Laya.loader.getRes(AssetPath.prefab[4]);
  7829. for (var i = 0; i < bulletasset.numChildren; i++) {
  7830. var curbullet = bulletasset.getChildAt(i);
  7831. curbullet.active = false;
  7832. AssetManager.bullet.add(i + 1, curbullet);
  7833. }
  7834. Laya.loader.clearRes(AssetPath.prefab[4]);
  7835. var effectasset = Laya.loader.getRes(AssetPath.prefab[5]);
  7836. for (var i = 0; i < effectasset.numChildren; i++) {
  7837. var cureffect = effectasset.getChildAt(i);
  7838. cureffect.active = false;
  7839. AssetManager.effect.add(i + 1, cureffect);
  7840. }
  7841. Laya.loader.clearRes(AssetPath.prefab[5]);
  7842. var standasset = Laya.loader.getRes(AssetPath.prefab[6]);
  7843. for (var i = 0; i < standasset.numChildren; i++) {
  7844. var curstand = standasset.getChildAt(i);
  7845. curstand.active = false;
  7846. AssetManager.standbuild.add(i + 1, curstand);
  7847. }
  7848. Laya.loader.clearRes(AssetPath.prefab[6]);
  7849. var roadasset = Laya.loader.getRes(AssetPath.prefab[7]);
  7850. for (var i = 0; i < roadasset.numChildren; i++) {
  7851. var curroad = roadasset.getChildAt(i);
  7852. curroad.active = false;
  7853. AssetManager.road.add(i + 1, curroad);
  7854. }
  7855. Laya.loader.clearRes(AssetPath.prefab[7]);
  7856. var weaponasset = Laya.loader.getRes(AssetPath.prefab[8]);
  7857. for (var i = 0; i < weaponasset.numChildren; i++) {
  7858. var curweapon = weaponasset.getChildAt(i);
  7859. curweapon.active = false;
  7860. AssetManager.weapon.add(i + 1, curweapon);
  7861. }
  7862. Laya.loader.clearRes(AssetPath.prefab[8]);
  7863. var twasset = Laya.loader.getRes(AssetPath.prefab[9]);
  7864. for (var i = 0; i < twasset.numChildren; i++) {
  7865. var curtw = twasset.getChildAt(i);
  7866. curtw.active = false;
  7867. AssetManager.tw.add(i + 1, curtw);
  7868. }
  7869. Laya.loader.clearRes(AssetPath.prefab[9]);
  7870. var handasset = Laya.loader.getRes(AssetPath.prefab[10]);
  7871. handasset.active = false;
  7872. AssetManager.hand = handasset;
  7873. Laya.loader.clearRes(AssetPath.prefab[10]);
  7874. console.log("游戏资源加载完成...");
  7875. this.CompleteProgress();
  7876. }));
  7877. }
  7878. LoadEnd() {
  7879. console.log("加载完成...");
  7880. this.ProgressTween.clear();
  7881. new SceneManager(this.mainscene);
  7882. }
  7883. OnHomeInit() {
  7884. EventManager.Off(EventType.LevelCreateComplete, this, this.OnHomeInit);
  7885. this.Hide();
  7886. }
  7887. TweenProgress(_start, _end, _duration, _complete = null) {
  7888. if (this.ProgressTween)
  7889. this.ProgressTween.clear();
  7890. this.prenum = new Laya.Vector2(_start, 0);
  7891. this.ProgressTween = Tween.to(this.prenum, { x: _end, update: new Laya.Handler(this, () => {
  7892. this.preclip.value = Math.floor(this.prenum.x).toString();
  7893. }) }, _duration * 1000, null, Laya.Handler.create(this, _complete), null, true, true);
  7894. }
  7895. }
  7896. class Main {
  7897. constructor() {
  7898. if (window["Laya3D"])
  7899. Laya3D.init(GameConfig.width, GameConfig.height);
  7900. else
  7901. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  7902. Laya["Physics"] && Laya["Physics"].enable();
  7903. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  7904. Laya.stage.scaleMode = GameConfig.scaleMode;
  7905. Laya.stage.screenMode = GameConfig.screenMode;
  7906. Laya.stage.alignV = GameConfig.alignV;
  7907. Laya.stage.alignH = GameConfig.alignH;
  7908. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  7909. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  7910. Laya.enableDebugPanel();
  7911. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  7912. Laya["PhysicsDebugDraw"].enable();
  7913. if (GameConfig.stat)
  7914. Laya.Stat.show();
  7915. console.log("Ver", VerCheck.mVer);
  7916. if (!Laya.Browser.onPC) {
  7917. VerCheck.WX = true;
  7918. }
  7919. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  7920. }
  7921. onVersionLoaded() {
  7922. Laya.AtlasInfoManager.enable("fileconfig.json", Laya.Handler.create(this, this.onConfigLoaded));
  7923. }
  7924. onConfigLoaded() {
  7925. new LoadWindow();
  7926. }
  7927. }
  7928. new Main();
  7929. }());
  7930. //# sourceMappingURL=bundle.js.map