bundle.js 433 KB

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