12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708 |
- /*
- --- Version 2 ---
- //PERMS
- Hats
- Sabotage: Door Closing
- Visual Tasks
- Stay in lobby after win
- rauswerf animation. tp auf tisch. float effect.
- setting: full vision/blindness (darkness effect? 1.19)
- */
- @game_core
- event.load("entity_dismount");
- event.load("snuvi_click");
- event.load("player_drop");
- player_colors = map.new();
- minigame.setSpecificLobbyHandling(true);
- minigame.setNoLobbyTeleport(true);
- minigame.setPlayerResetInCore(false);
- minigame.setManualStart(true);
- gamename = "§cAmong Us";
- game_short = "among_us";
- rankingtable = "among_us_ranks";
- item_arrow_left = item.custom.create("ARROW_LEFT", 1, null, null);
- item_arrow_right = item.custom.create("ARROW_RIGHT", 1, null, null);
- item_arrow_up = item.custom.create("ARROW_UP", 1, null, null);
- item_arrow_down = item.custom.create("ARROW_DOWN", 1, null, null);
-
- sabotage_menu = inv.new("222200000", text.new("§cSABOTAGE"));
- inv.setItem(sabotage_menu, 0, item.create("REDSTONE_LAMP", 1, "§fSabotage Light", null));
- inv.setItem(sabotage_menu, 1, item.create("END_CRYSTAL", 1, "§fSabotage Reactor", null));
- inv.setItem(sabotage_menu, 2, item.create("OAK_SAPLING", 1, "§fSabotage Oxygen", null));
- inv.setItem(sabotage_menu, 3, item.create("PAPER", 1, "§fSabotage Communication", null));
- settings_inv = inv.new("222222222222222222222222222222222222222222222222222222", text.new("§cSettings"));
- for(i = 0; i < 9; i++) {
- inv.setItem(settings_inv, i, item_arrow_up);
- }
- inv.setItem(settings_inv, 9, item.custom.create("GEAR", 1, string.concat("§rImpostors: ", string.number(amount_impostors)), null));
- inv.setItem(settings_inv, 10, item.custom.create("GEAR", 1, string.concat("§rShort Tasks: ", string.number(amount_short)), null));
- inv.setItem(settings_inv, 11, item.custom.create("GEAR", 1, string.concat("§rCommon Tasks: ", string.number(amount_common)), null));
- inv.setItem(settings_inv, 12, item.custom.create("GEAR", 1, string.concat("§rLong Tasks: ", string.number(amount_long)), null));
- inv.setItem(settings_inv, 13, item.custom.create("GEAR", 1, string.concat("§rAmount Meetings: ", string.number(amount_meetings)), null));
- inv.setItem(settings_inv, 14, item.custom.create("GEAR", 1, string.concat("§rMeeting Cooldown: ", string.number(meeting_cooldown)), null));
- inv.setItem(settings_inv, 15, item.custom.create("GEAR", 1, string.concat("§rDiscussion Time: ", string.number(discuss_time)), null));
- inv.setItem(settings_inv, 16, item.custom.create("GEAR", 1, string.concat("§rVoting Time: ", string.number(vote_time)), null));
- inv.setItem(settings_inv, 17, item.custom.create("GEAR", 1, string.concat("§rSpeed: ", string.number(move_speed)), null));
- for(i = 18; i < 27; i++) {
- inv.setItem(settings_inv, i, item_arrow_down);
- }
- for(i = 27; i < 29; i++) {
- inv.setItem(settings_inv, i, item_arrow_up);
- }
- inv.setItem(settings_inv, 36, item.custom.create("GEAR", 1, string.concat("§rKill Cooldown: ", string.number(kill_cooldown)), null));
- inv.setItem(settings_inv, 37, item.custom.create("GEAR", 1, string.concat("§rConfirm Ejects: ", confirm_ejects), null));
- //inv.setItem(settings_inv, 38, item.custom.create("GEAR", 1, string.concat("§r: ", string.number()), null));
- //inv.setItem(settings_inv, 39, item.custom.create("GEAR", 1, string.concat("§r: ", string.number()), null));
- //inv.setItem(settings_inv, 40, item.custom.create("GEAR", 1, string.concat("§r: ", string.number()), null));
- //inv.setItem(settings_inv, 41, item.custom.create("GEAR", 1, string.concat("§r: ", string.number()), null));
- //inv.setItem(settings_inv, 42, item.custom.create("GEAR", 1, string.concat("§r: ", string.number()), null));
- //inv.setItem(settings_inv, 43, item.custom.create("GEAR", 1, string.concat("§r: ", string.number()), null));
- //inv.setItem(settings_inv, 44, item.custom.create("GEAR", 1, string.concat("§r: ", string.number()), null));
- for(i = 45; i < 47; i++) {
- inv.setItem(settings_inv, i, item_arrow_down);
- }
- color_list = list.new();
- list.add(color_list, "dark_gray");
- list.add(color_list, "cyan");
- list.add(color_list, "red");
- list.add(color_list, "blue");
- list.add(color_list, "orange");
- list.add(color_list, "green");
- list.add(color_list, "gray");
- list.add(color_list, "white");
- list.add(color_list, "pink");
- list.add(color_list, "purple");
- list.add(color_list, "yellow");
- list.add(color_list, "lime");
- cloth_code_map = map.new();
- map.add(cloth_code_map, "dark_gray", 4673362);
- map.add(cloth_code_map, "cyan", 1481884);
- map.add(cloth_code_map, "red", 11546150);
- map.add(cloth_code_map, "blue", 3949738);
- map.add(cloth_code_map, "orange", 16351261);
- map.add(cloth_code_map, "green", 6192150);
- map.add(cloth_code_map, "gray", 10329495);
- map.add(cloth_code_map, "white", 16383998);
- map.add(cloth_code_map, "pink", 15961002);
- map.add(cloth_code_map, "purple", 8991416);
- map.add(cloth_code_map, "yellow", 16701501);
- map.add(cloth_code_map, "lime", 8439583);
- color_code_map = map.new();
- map.add(color_code_map, "dark_gray", "§8");
- map.add(color_code_map, "cyan", "§b");
- map.add(color_code_map, "red", "§c");
- map.add(color_code_map, "blue", "§9");
- map.add(color_code_map, "orange", "§6");
- map.add(color_code_map, "green", "§2");
- map.add(color_code_map, "gray", "§7");
- map.add(color_code_map, "white", "§f");
- map.add(color_code_map, "pink", "§d");
- map.add(color_code_map, "purple", "§5");
- map.add(color_code_map, "yellow", "§e");
- map.add(color_code_map, "lime", "§a");
- prev_cam_item = item.custom.create("ARROW_LEFT", 1, "§fPrevious cam", null);
- next_cam_item = item.custom.create("ARROW_RIGHT", 1, "§fNext cam", null);
- leave_cam_item = item.custom.create("CROSS_RED", 1, "§fLeave cam", null);
- leave_vent_item = item.custom.create("CROSS_RED", 1, "§fLeave vent", null);
- kill_item = item.create("IRON_SWORD", 1, "§fKill", null);
- item.addFlag(kill_item, "HIDE_ATTRIBUTES");
- sabotage_item = item.custom.create("GEAR", 1, "§fSabotage", null);
- open_vote_menu_item = item.custom.create("CROSS_GREEN", 1, "§fOpen vote menu", null);
- color_choose_item = item.create("RED_CONCRETE", 1, "§fChoose color", null);
- color_choose_inv = inv.new("222222222222000000", text.new("§cChoose your color"));
- index = 0;
- iter = iterator(color_list);
- while(hasNext(iter)) {
- color_name = next(iter);
- cloth_code = map.get(cloth_code_map, color_name);
- color_name = string.upperFirstLetter(color_name);
- item = read.item(string.concat("{id:\"minecraft:leather_chestplate\",Count:1b,tag:{Damage:0,display:{color:", cloth_code, ",Name:'{\"text\":\"§r", color_name, "\"}'}}}"));
- item.addFlag(item, "HIDE_ATTRIBUTES");
- inv.setItem(color_choose_inv, index++, item);
- }
- minigame.initStart();
- minigame.setLobbyCounter(5);
- goto("simplelobby");
- @specificLobbyHandling
- if(event == "minigame_join") {
- resetplayer(player);
- assignSeat(player);
- if(lobby_leader == null) {
- lobby_leader = player.getUuid(player);
- settings_item = item.custom.create("GEAR", 1, "§fSettings", null);
- player.giveItem(player, settings_item);
- }
- sb.add(player, 99, string.concat("Lobby-Leader: §a", player.getName(lobby_leader)));
- sb.add(player, 98, gamename);
- sb.add(player, 97, string.concat("Impostors: §a", string.number(amount_impostors)));
- sb.add(player, 96, string.concat("Short Tasks: §a", string.number(amount_short)));
- sb.add(player, 95, string.concat("Common Tasks: §a", string.number(amount_common)));
- sb.add(player, 94, string.concat("Long Tasks: §a", string.number(amount_long)));
- sb.add(player, 93, string.concat("Amount Meetings: §a", string.number(amount_meetings)));
- sb.add(player, 92, string.concat("Meeting Cooldown: §a", string.number(meeting_cooldown), " s"));
- sb.add(player, 91, string.concat("Discussion Time: §a", string.number(discuss_time), " s"));
- sb.add(player, 90, string.concat("Voting Time: §a", string.number(vote_time), " s"));
- sb.add(player, 89, string.concat("Speed: §a", string.number(move_speed)));
- sb.add(player, 88, string.concat("Kill Cooldown: §a", string.number(kill_cooldown), " s"));
- sb.add(player, 87, string.concat("Confirm Ejects: §a", confirm_ejects));
- sb.add(player, 86, sb.getSpacer());
- player.giveItem(player, color_choose_item);
- player.setSpeed(player, move_speed);
- player.setHunger(player, 20);
- player.setSaturation(player, 100);
- return;
- }
- if(event == "player_drop") {
- cancel = true;
- return;
- }
- if(event == "block_click") {
- if(action != "RIGHT_CLICK_BLOCK" && action != "RIGHT_CLICK_AIR") {
- return;
- }
- if(block != null && block.getLocation(block) == start_sign_loc) {
- if(player.getUuid(player) != lobby_leader) {
- msg.prefix(player, gamename, "You are not the Lobby-Leader.");
- return;
- }
- if(!minigame.canStartIndiv()) {
- msg.prefix(player, gamename, "You need to be alone for singleplayer. For multiplayer more than 2 players are needed.");
- return;
- }
- goto("startcountdown");
- }
- item = living.getHand(player);
- if(item == settings_item) {
- if(player.getUuid(player) != lobby_leader) {
- return;
- }
- inv.open(settings_inv, player);
- return;
- }
- if(item == color_choose_item) {
- inv.open(color_choose_inv, player);
- return;
- }
- return;
- }
- if(event == "snuvi_click") {
- title_string = string.text(inv_title);
- if(title_string == "§cSettings") {
- //amount_impostors
- if(inv_slot == 0 || inv_slot == 9 || inv_slot == 18) {
- if(inv_slot == 0 || inv_slot == 9) {
- if(amount_impostors < amount_impostors_max) {
- amount_impostors++;
- }
- } elseif(inv_slot == 18) {
- if(amount_impostors > amount_impostors_min) {
- amount_impostors--;
- }
- }
- minigame.displayAll(97, string.concat("Impostors: §a", string.number(amount_impostors)));
- inv.setItem(settings_inv, 9, item.custom.create("GEAR", 1, string.concat("§rImpostors: ", string.number(amount_impostors)), null));
- return;
- }
- //short_tasks
- if(inv_slot == 1 || inv_slot == 10 || inv_slot == 19) {
- if(inv_slot == 1 || inv_slot == 10) {
- if(amount_short < amount_short_max) {
- amount_short++;
- }
- } elseif(inv_slot == 19) {
- if(amount_short > amount_short_min) {
- amount_short--;
- }
- }
- minigame.displayAll(96, string.concat("Short Tasks: §a", string.number(amount_short)));
- inv.setItem(settings_inv, 10, item.custom.create("GEAR", 1, string.concat("§rShort Tasks: ", string.number(amount_short)), null));
- return;
- }
- //common_tasks
- if(inv_slot == 2 || inv_slot == 11 || inv_slot == 20) {
- if(inv_slot == 2 || inv_slot == 11) {
- if(amount_common < amount_common_max) {
- amount_common++;
- }
- } elseif(inv_slot == 20) {
- if(amount_common > amount_common_min) {
- amount_common--;
- }
- }
- minigame.displayAll(95, string.concat("Common Tasks: §a", string.number(amount_common)));
- inv.setItem(settings_inv, 11, item.custom.create("GEAR", 1, string.concat("§rCommon Tasks: ", string.number(amount_common)), null));
- return;
- }
- //long_tasks
- if(inv_slot == 3 || inv_slot == 12 || inv_slot == 21) {
- if(inv_slot == 3 || inv_slot == 12) {
- if(amount_long < amount_long_max) {
- amount_long++;
- }
- } elseif(inv_slot == 21) {
- if(amount_long > amount_long_min) {
- amount_long--;
- }
- }
- minigame.displayAll(94, string.concat("Long Tasks: §a", string.number(amount_long)));
- inv.setItem(settings_inv, 12, item.custom.create("GEAR", 1, string.concat("§rLong Tasks: ", string.number(amount_long)), null));
- return;
- }
- //amount_meetings
- if(inv_slot == 4 || inv_slot == 13 || inv_slot == 22) {
- if(inv_slot == 4 || inv_slot == 13) {
- if(amount_meetings < amount_meetings_max) {
- amount_meetings++;
- }
- } elseif(inv_slot == 22) {
- if(amount_meetings > amount_meetings_min) {
- amount_meetings--;
- }
- }
- minigame.displayAll(93, string.concat("Amount Meetings: §a", string.number(amount_meetings)));
- inv.setItem(settings_inv, 13, item.custom.create("GEAR", 1, string.concat("§rAmount Meetings: ", string.number(amount_meetings)), null));
- return;
- }
- //meeting_cooldown
- if(inv_slot == 5 || inv_slot == 14 || inv_slot == 23) {
- if(inv_slot == 5 || inv_slot == 14) {
- if(meeting_cooldown < meeting_cooldown_max) {
- meeting_cooldown += 5;
- }
- } elseif(inv_slot == 23) {
- if(meeting_cooldown > meeting_cooldown_min) {
- meeting_cooldown -= 5;
- }
- }
- minigame.displayAll(92, string.concat("Meeting Cooldown: §a", string.number(meeting_cooldown), " s"));
- inv.setItem(settings_inv, 14, item.custom.create("GEAR", 1, string.concat("§rMeeting Cooldown: ", string.number(meeting_cooldown)), null));
- return;
- }
- //discuss_time
- if(inv_slot == 6 || inv_slot == 15 || inv_slot == 24) {
- if(inv_slot == 6 || inv_slot == 15) {
- if(discuss_time < discuss_time_max) {
- discuss_time += 5;
- }
- } elseif(inv_slot == 24) {
- if(discuss_time > discuss_time_min) {
- discuss_time -= 5;
- }
- }
- minigame.displayAll(91, string.concat("Discussion Time: §a", string.number(discuss_time), " s"));
- inv.setItem(settings_inv, 15, item.custom.create("GEAR", 1, string.concat("§rDiscussion Time: ", string.number(discuss_time)), null));
- return;
- }
- //vote_time
- if(inv_slot == 7 || inv_slot == 16 || inv_slot == 25) {
- if(inv_slot == 7 || inv_slot == 16) {
- if(vote_time < vote_time_max) {
- vote_time += 5;
- }
- } elseif(inv_slot == 25) {
- if(vote_time > vote_time_min) {
- vote_time -= 5;
- }
- }
- minigame.displayAll(90, string.concat("Voting Time: §a", string.number(vote_time), " s"));
- inv.setItem(settings_inv, 16, item.custom.create("GEAR", 1, string.concat("§rVoting Time: ", string.number(vote_time)), null));
- return;
- }
- //move_speed
- if(inv_slot == 8 || inv_slot == 17 || inv_slot == 26) {
- if(inv_slot == 8 || inv_slot == 17) {
- if(move_speed < move_speed_max) {
- move_speed += 0.25;
- }
- } elseif(inv_slot == 26) {
- if(move_speed > move_speed_min) {
- move_speed -= 0.25;
- }
- }
- iter = iterator(minigame.getPlayers(script_id));
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- player.setSpeed(p, move_speed);
- }
- minigame.displayAll(89, string.concat("Speed: §a", string.number(move_speed)));
- inv.setItem(settings_inv, 17, item.custom.create("GEAR", 1, string.concat("§rSpeed: ", string.number(move_speed)), null));
- return;
- }
- //kill_cooldown
- if(inv_slot == 27 || inv_slot == 36 || inv_slot == 45) {
- if(inv_slot == 27 || inv_slot == 36) {
- if(kill_cooldown < kill_cooldown_max) {
- kill_cooldown++;
- }
- } elseif(inv_slot == 45) {
- if(kill_cooldown > kill_cooldown_min) {
- kill_cooldown--;
- }
- }
- minigame.displayAll(88, string.concat("Kill Cooldown: §a", string.number(kill_cooldown), " s"));
- inv.setItem(settings_inv, 36, item.custom.create("GEAR", 1, string.concat("§rKill Cooldown: ", string.number(kill_cooldown)), null));
- return;
- }
- //confirm_ejects
- if(inv_slot == 28 || inv_slot == 37 || inv_slot == 46) {
- if(confirm_ejects) {
- confirm_ejects = false;
- } else {
- confirm_ejects = true;
- }
- minigame.displayAll(87, string.concat("Confirm Ejects: §a", confirm_ejects));
- inv.setItem(settings_inv, 37, item.custom.create("GEAR", 1, string.concat("§rConfirm Ejects: ", confirm_ejects), null));
- return;
- }
- return;
- }
- if(title_string == "§cChoose your color") {
- clicked_item = inv.getItem(inv, inv_slot);
- item_name = string.text(item.getName(clicked_item));
- if(string.startsWith(item_name, "§cUsed", 0)) {
- return;
- }
- color = amongus.getPlayerColor(player);
- if(color != null) {
- item.setName(inv.getItem(inv, list.getIndexOf(color_list, color)), text.new(string.concat("§r", string.upperFirstLetter(color))));
- }
- new_color = string.removeFormat(string.toLowerCase(item_name));
- cloth_color = map.get(cloth_code_map, new_color);
- amongus.setPlayerColor(player, new_color);
- item.setName(clicked_item, text.new(string.concat("§cUsed by ", player.getName(player))));
- amongus.equip(player, new_color);
- }
- return;
- }
- if(event == "entity_dismount") {
- if(isPlayer(entity)) {
- leaveSeat(entity);
- }
- return;
- }
- if(event == "player_quit" || event == "player_giveup") {
- leaveSeat(player);
- if(lobby_leader == player.getUuid(player)) {
- list = minigame.getPlayers(script_id);
- if(list.getSize(list) != 0) {
- lobby_leader = list.getIndex(list, 0);
- }
- }
- }
- return;
- @finalstart
- player_list = minigame.getPlayers(script_id);
- air_item = item.getAir();
- lime_glass = item.create("lime_stained_glass_pane", 1, "", null);
- green_glass = item.create("green_stained_glass_pane", 1, "", null);
- red_glass = item.create("red_stained_glass_pane", 1, "", null);
- gray_glass = item.create("gray_stained_glass_pane", 1, "", null);
- black_glass = item.create("black_stained_glass_pane", 1, "", null);
- yellow_glass = item.create("yellow_stained_glass_pane", 1, "", null);
- blue_glass = item.create("blue_stained_glass_pane", 1, "", null);
- cyan_glass = item.create("cyan_stained_glass_pane", 1, "", null);
- light_gray_glass = item.create("light_gray_stained_glass_pane", 1, "", null);
- item.addFlag(light_gray_glass, "HIDE_DESTROYS");
- gosub("init_map_specific");
- progress_bar = boss.create("TOTAL TASKS COMPLETED", "GREEN", "SOLID");
- boss.setProgress(progress_bar, 0);
- meeting_bar = boss.create("Discussion Time", "WHITE", "SOLID"); //Bossbar für Discussion + Voting
- boss.setProgress(meeting_bar, 0);
- sabotage_cooldown_bar = boss.create("Sabotage Cooldown", "PURPLE", "SOLID");
- boss.setProgress(sabotage_cooldown_bar, 0);
- wooden_trapdoors_tag = block.getTag("minecraft:wooden_trapdoors");
- shulker_tag = block.getTag("minecraft:shulker_boxes");
- master_sound_category = sound.getCategory("MASTER");
- kill_sound = sound.get("ENTITY_SLIME_HURT");
- task_sound = sound.get("BLOCK_NOTE_BLOCK_CHIME");
- vote_sound = sound.get("BLOCK_NOTE_BLOCK_PLING");
- vote_ends_sound = sound.get("BLOCK_NOTE_BLOCK_BELL");
- crit_sabo_sound = sound.get("BLOCK_NOTE_BLOCK_BELL");
- all_list = list.new(); //All players (Ingame + Ghost + Left)
- vote_inv_map = map.new();
- sabo_par_list = list.new();
- ghosts = list.new();
- dead_bodies = list.new();
- roles = map.new();
- player_tasks = map.new();
- task_steps = map.new();
- all_tasks = map.new();
- auto_close_list = list.new();
- auto_close_list_2 = list.new();
- task_part_map = map.new();
- admin_table_map = map.new(); //In welchem Raum befindet sich ein Spieler? (Geister ausgenommen)
- admin_table_map_2 = map.new(); //Wie viele Spieler befinden sich in einem Raum? (Geister ausgenommen)
- impostors_list = list.new(); //Impostors (Ingame + Ghost + Left)
- impostors_list_2 = list.new(); //Impostors (Ingame + Ghost)
- impostors_list_3 = list.new(); //Impostors (Ingame)
- imp_kill_bars = map.new(); //UUID -> Kill Bossbar
- holded_kill_cooldown = map.new();
- report_map = map.new();
- meeting_amounts = map.new();
- removed_perms = list.new(); //Spieler-Uuids, denen Building-Perms entfernt wurden
- gravity_list = list.new();
- short_tasks = list.new();
- list.addAll(short_tasks, 1, 3, 5, 6, 7, 9, 14, 15, 17);
- common_tasks = list.new();
- list.addAll(common_tasks, 10, 11);
- long_tasks = list.new();
- list.addAll(long_tasks, 2, 4, 8, 12, 13, 16);
- amount_done_tasks = 0;
- sabo_list = list.new();
- comms_state_list = list.new();
- comms_fix_list = list.new();
- comms_fix_map = map.new();
- comms_state_map = map.new();
- comms_counter_map = map.new();
- comms_inv_map = map.new();
- oxygen_map = map.new();
- vent_list = list.new();
- vent_map_2 = map.new();
- vent_map_4 = map.new();
- vent_loop = false;
- cam_list = list.new();
- cam_map = map.new();
- cam_map_2 = map.new();
- cam_map_3 = map.new();
- cam_map_4 = map.new();
- align_engine_map = map.new(); //Position des Engine-Outputs für jeden Spieler
- align_engine_map_2 = map.new(); //Dient zur Zuordnung zur Engine-Location bei korrekt ausgerichtetem Engine-Output
- align_le_engine_set = set.new(); //Spieler, die Align-Engine bei Lower-Engine gemacht haben
- align_ue_engine_set = set.new(); //Spieler, die Align-Engine bei Upper-Engine gemacht haben
- submit_scan_list = list.new();
- submit_scan_list_2 = list.new();
- submit_scan_map = map.new();
- submit_scan_map_2 = map.new();
- ast_directions = array.new(8);
- ast_start_pos = list.new();
- ast_start_pos_dirs = map.new();
- clear_ast_list = list.new();
- clear_ast_list_2 = list.new();
- clear_ast_list_3 = list.new();
- clear_ast_map = map.new();
- clear_ast_map_2 = map.new();
- clear_ast_map_3 = map.new();
- fuel_counter = map.new();
- download_counter = map.new();
- download_map = map.new();
- download_map_3 = map.new();
- download_list = list.new();
- download_list_2 = list.new();
- chart_course_counter = map.new();
- chart_course_pattern = map.new();
- manifolds_counter = map.new();
- manifolds_list = list.new();
- manifolds_list_2 = list.new();
- reactor_draw_list_1 = list.new();
- reactor_draw_list_2 = list.new();
- reset_reactor_draw_list = list.new();
- reactor_block_list = list.new();
- reset_reactor_click_list = list.new();
- reset_reactor_click_list_2 = list.new();
- reactor_false_click_list = list.new();
- start_reactor_map = map.new();
- sample_list = list.new();
- sample_list_2 = list.new();
- empty_garb_list = list.new();
- empty_garb_list_2 = list.new();
- empty_garb_map = map.new();
- empty_garb_map_2 = map.new();
- empty_garb_map_3 = map.new();
- sample_map = map.new();
- calibrate_dist_list = list.new();
- calibrate_dist_list_2 = list.new();
- calibrate_dist_map = map.new();
- wires_map = map.new();
- wires_map_2 = map.new();
- wires_map_4 = map.new();
- swipe_card_map = map.new();
- divert_pow_map_3 = map.new();
- clean_o2_map = map.new();
- align_engine_array = array.new(11);
- temp_list = list.new();
- list.addAll(temp_list, 34, 42);
- align_engine_array[0] = temp_list;
- temp_list = list.new();
- list.addAll(temp_list, 25, 32, 33, 39, 40);
- align_engine_array[1] = temp_list;
- temp_list = list.new();
- list.addAll(temp_list, 24, 25, 30, 31, 32, 36, 37, 38);
- align_engine_array[2] = temp_list;
- temp_list = list.new();
- list.addAll(temp_list, 23, 24, 25, 28, 29, 30, 31, 36);
- align_engine_array[3] = temp_list;
- temp_list = list.new();
- list.addAll(temp_list, 22, 23, 24, 25, 27, 28, 29, 30);
- align_engine_array[4] = temp_list;
- temp_list = list.new();
- list.addAll(temp_list, 18, 19, 20, 21, 22, 23, 24, 25);
- align_engine_array[5] = temp_list;
- temp_list = list.new();
- list.addAll(temp_list, 9, 10, 11, 12, 22, 23, 24, 25);
- align_engine_array[6] = temp_list;
- temp_list = list.new();
- list.addAll(temp_list, 0, 10, 11, 12, 13, 23, 24, 25);
- align_engine_array[7] = temp_list;
- temp_list = list.new();
- list.addAll(temp_list, 0, 1, 2, 12, 13, 14, 24, 25);
- align_engine_array[8] = temp_list;
- temp_list = list.new();
- list.addAll(temp_list, 3, 4, 14, 15, 25);
- align_engine_array[9] = temp_list;
- temp_list = list.new();
- list.addAll(temp_list, 6, 16);
- align_engine_array[10] = temp_list;
- calibrate_dist_array = array.new(12);
- calibrate_dist_array[0] = 14;
- calibrate_dist_array[1] = 13;
- calibrate_dist_array[2] = 12;
- calibrate_dist_array[3] = 20;
- calibrate_dist_array[4] = 29;
- calibrate_dist_array[5] = 38;
- calibrate_dist_array[6] = 48;
- calibrate_dist_array[7] = 49;
- calibrate_dist_array[8] = 50;
- calibrate_dist_array[9] = 42;
- calibrate_dist_array[10] = 33;
- calibrate_dist_array[11] = 24;
- wires_list = list.new();
- list.add(wires_list, item.create("blue_stained_glass_pane", 1, "§rBlue Wire", null));
- list.add(wires_list, item.create("green_stained_glass_pane", 1, "§rGreen Wire", null));
- list.add(wires_list, item.create("red_stained_glass_pane", 1, "§rRed Wire", null));
- list.add(wires_list, item.create("yellow_stained_glass_pane", 1, "§rYellow Wire", null));
- garb_items = list.new();
- list.add(garb_items, item.new(material.get("diamond")));
- list.add(garb_items, item.new(material.get("dead_bush")));
- list.add(garb_items, item.new(material.get("rotten_flesh")));
- list.add(garb_items, item.new(material.get("totem_of_undying")));
- list.add(garb_items, item.new(material.get("bone")));
- list.add(garb_items, item.new(material.get("bone_meal")));
- addAstDirection(0, 1, 0); //rechts
- addAstDirection(1, -1, 0); //links
- addAstDirection(2, 0, -1); //oben
- addAstDirection(3, 0, 1); //unten
- addAstDirection(4, 1, -1); //rechts oben
- addAstDirection(5, -1, 1); //links unten
- addAstDirection(6, 1, 1); //rechts unten
- addAstDirection(7, -1, -1); //links oben
- addAstStartPos(0, 6, 6, 6);
- addAstStartPos(1, 3, 5, 6);
- addAstStartPos(2, 3, 5, 6);
- addAstStartPos(3, 3, 5, 6);
- addAstStartPos(4, 3, 5, 6);
- addAstStartPos(5, 3, 5, 6);
- addAstStartPos(6, 3, 5, 6);
- addAstStartPos(7, 3, 5, 6);
- addAstStartPos(8, 5, 5, 5);
- addAstStartPos(9, 0, 4, 6);
- addAstStartPos(17, 1, 5, 7);
- addAstStartPos(18, 0, 4, 6);
- addAstStartPos(26, 1, 5, 7);
- addAstStartPos(27, 0, 4, 6);
- addAstStartPos(35, 1, 5, 7);
- addAstStartPos(36, 0, 4, 6);
- addAstStartPos(44, 1, 5, 7);
- addAstStartPos(45, 4, 4, 4);
- addAstStartPos(46, 2, 4, 7);
- addAstStartPos(47, 2, 4, 7);
- addAstStartPos(48, 2, 4, 7);
- addAstStartPos(49, 2, 4, 7);
- addAstStartPos(50, 2, 4, 7);
- addAstStartPos(51, 2, 4, 7);
- addAstStartPos(52, 2, 4, 7);
- addAstStartPos(53, 7, 7, 7);
- asteroid_item = item.create("BEDROCK", 1, "§rAsteroid", null);
- oak_leaves = item.create("OAK_LEAVES", 1, null, null);
- spruce_leaves = item.create("SPRUCE_LEAVES", 1, null, null);
- birch_leaves = item.create("BIRCH_LEAVES", 1, null, null);
- jungle_leaves = item.create("JUNGLE_LEAVES", 1, null, null);
- acacia_leaves = item.create("ACACIA_LEAVES", 1, null, null);
- dark_oak_leaves = item.create("DARK_OAK_LEAVES", 1, null, null);
- zombie_head = item.create("zombie_head", 1, "", null);
- zombie_head_mat = material.get("ZOMBIE_HEAD");
- player_head_mat = material.get("PLAYER_HEAD");
- redstone_lamp_mat = material.get("REDSTONE_LAMP");
- redstone_torch_mat = material.get("REDSTONE_TORCH");
- stone_button_mat = material.get("STONE_BUTTON");
- gunpowder_mat = material.get("GUNPOWDER");
- lever_mat = material.get("LEVER");
- oak_leaves_mat = material.get("OAK_LEAVES");
- light_gray_glass_mat = material.get("LIGHT_GRAY_STAINED_GLASS_PANE");
- lime_glass_mat = material.get("LIME_STAINED_GLASS_PANE");
- red_glass_mat = material.get("RED_STAINED_GLASS_PANE");
- green_glass_mat = material.get("GREEN_STAINED_GLASS_PANE");
- blue_glass_mat = material.get("BLUE_STAINED_GLASS_PANE");
- black_glass_mat = material.get("BLACK_STAINED_GLASS_PANE");
- arrow_left_mat = item.custom.get("ARROW_LEFT");
- arrow_right_mat = item.custom.get("ARROW_RIGHT");
- arrow_down_mat = item.custom.get("ARROW_DOWN");
- arrow_up_mat = item.custom.get("ARROW_UP");
- check_green_mat = item.custom.get("CHECK_GREEN");
- return_green_mat = item.custom.get("RETURN_GREEN");
- cross_red_mat = item.custom.get("CROSS_RED");
- space_par = particle.get("END_ROD");
- task_par = particle.get("COMPOSTER");
- cam_par = particle.get("SPELL_WITCH");
- sabo_par = particle.get("SPELL_WITCH");
- imp_par = particle.get("SPELL_WITCH");
- cam_loop = false;
- meeting = false;
- amongus.setAlert(false);
- lights_sabotaged = false;
- comms_sabotaged = false;
- reactor_sabotaged = false;
- oxygen_sabotaged = false;
- reactor_used = false;
- lights_inv = inv.new("202020202", text.new("§cFix Lights"));
- reactor_inv_1 = inv.new("222222222222222222222222222222222222222222222222222222", text.new("§cPRESS TO STOP MELTDOWN"));
- reactor_inv_2 = inv.new("222222222222222222222222222222222222222222222222222222", text.new("§cPRESS TO STOP MELTDOWN"));
- sabotage.holdReactor(reactor_inv_1, false);
- sabotage.holdReactor(reactor_inv_2, false);
- reactor_hold_list_1 = list.new();
- reactor_hold_list_2 = list.new();
- common_tasks_2 = list.new();
- for(i = 0; i < amount_common; i++) {
- index = math.random(0, list.getSize(common_tasks) - 1);
- id = list.getIndex(common_tasks, index);
- list.add(common_tasks_2, id);
- }
- registerTask(1, 97, "STO", "Fuel Engines", 4);
- registerTask(2, 96, "[Room]", "Download Data", 2);
- registerTask(3, 95, "SHI", "Prime Shields", 1);
- registerTask(4, 94, "REA", "Start Reactor", 1);
- registerTask(5, 93, "REA", "Unlock Manifolds", 1);
- registerTask(6, 92, "NAV", "Chart Course", 1);
- registerTask(7, 91, "NAV", "Stabilize Steering", 1);
- registerTask(8, 90, "MED", "Inspect Sample", 1);
- registerTask(9, 89, "ELE", "Calibrate Distributor", 1);
- registerTask(10, 88, "CAF", "Fix Wiring", 3);
- registerTask(11, 87, "ADM", "Swipe Card", 1);
- registerTask(12, 86, "CAF", "Empty Garbage", 2);
- registerTask(13, 85, "WEA", "Clear Asteroids", 20);
- registerTask(14, 84, "ELE", "Divert Power to [Room]", 2);
- registerTask(15, 83, "O2", "Clean O2 Filter", 1);
- registerTask(16, 82, "MED", "Submit Scan", 1);
- registerTask(17, 81, "UE/LE", "Align Engine", 2);
- player_list_size = list.getSize(player_list);
- if(player_list_size < 6) {
- amount_impostors = 1;
- }
- imps = set.new();
- for(i = 0; i < amount_impostors; i++) {
- index = math.random(0, player_list_size - 1);
- while(set.contains(imps, index)) {
- index = math.random(0, player_list_size - 1);
- }
- set.add(imps, index);
- }
- if(player_list_size == 1) {
- amount_all_tasks = 17;
- amount_all_tasks_per_player = amount_all_tasks;
- freeplay = true;
- minigame.setSingleplayer();
- } else {
- amount_crew = player_list_size - amount_impostors;
- amount_all_tasks_per_player = amount_short + amount_common + amount_long;
- amount_all_tasks = amount_all_tasks_per_player * amount_crew;
- freeplay = false;
- }
- for(i = 0; i < player_list_size; i++) {
- p_uuid = list.getIndex(player_list, i);
- p = player.get(p_uuid);
- if(amount_impostors > 1) {
- msg.prefix(p, gamename, string.concat("There are §c", string.number(amount_impostors), " Impostors §ramong us."));
- } else {
- msg.prefix(p, gamename, string.concat("There is §c", string.number(amount_impostors), " Impostor §ramong us."));
- }
- entity.teleport(p, list.getIndex(spawn_locs, i));
- sound.spawnForPlayer(p, pling_sound, sound_category_ambient);
- player.setGamemode(p, "SURVIVAL");
- player.setFly(p, false);
- }
- for(h = 0; h < player_list_size; h++) {
- p_uuid = list.getIndex(player_list, h);
- p = player.get(p_uuid);
- list.add(all_list, p_uuid);
- boss.addPlayer(progress_bar, p);
- data.setTimer(p, "Meeting Cooldown", $meeting_cooldown * 20);
- player.setSpeed(p, move_speed);
- map.add(meeting_amounts, p_uuid, amount_meetings);
- player.clearInventory(p);
- player.giveItem(p, item.new(material.get("MAP")));
- inv.close(p);
- player.gameMute(p, true);
- living.setInvisible(p, true);
- //Building-Perms entfernen
- if(perm.has("plot.bypass", p)) {
- //PERMS perm.unregisterPlayer(p_uuid, 1);
- //PERMS perm.unregisterPlayer(p_uuid, 15);
- list.add(removed_perms, p_uuid);
- }
- //Farbe zuweisen bzw. erneut forcen
- color = amongus.getPlayerColor(p);
- if(color == null) {
- iter = iterator(color_list);
- while(hasNext(iter)) {
- color = next(iter);
- if(!amongus.isUsedPlayerColor(color)) {
- amongus.setPlayerColor(p, color);
- amongus.equip(p, color);
- break;
- }
- }
- } else {
- amongus.equip(p, color);
- }
-
- sb.clearGame(p);
- sb.add(p, 79, sb.getSpacer());
- if(freeplay) {
- setSpeedrunner(p);
- giveTask(p, 1, "STO", "Fuel Engines", 0, 4, null);
- giveTask(p, 2, "[Room]", "Download Data", 0, 2, null);
- giveTask(p, 3, "SHI", "Prime Shields", 0, 1, null);
- giveTask(p, 4, "REA", "Start Reactor", 0, 1, null);
- giveTask(p, 5, "REA", "Unlock Manifolds", 0, 1, null);
- giveTask(p, 6, "NAV", "Chart Course", 0, 1, null);
- giveTask(p, 7, "NAV", "Stabilize Steering", 0, 1, null);
- giveTask(p, 8, "MED", "Inspect Sample", 0, 1, null);
- giveTask(p, 9, "ELE", "Calibrate Distributor", 0, 1, null);
- giveTask(p, 10, "CAF", "Fix Wiring", 0, 3, null);
- giveTask(p, 11, "ADM", "Swipe Card", 0, 1, null);
- giveTask(p, 12, "CAF", "Empty Garbage", 0, 2, null);
- giveTask(p, 13, "WEA", "Clear Asteroids", 0, 20, null);
- giveTask(p, 14, "ELE", "Divert Power to [Room]", 0, 2, null);
- giveTask(p, 15, "O2", "Clean O2 Filter", 0, 1, null);
- giveTask(p, 16, "MED", "Submit Scan", 0, 1, null);
- giveTask(p, 17, "UE/LE", "Align Engine", 0, 2, null);
- } else {
- if(set.contains(imps, h)) {
- setImpostor(p);
- } else {
- setCrewmate(p);
- }
- for(i = 0; i < list.getSize(common_tasks_2); i++) {
- id = list.getIndex(common_tasks_2, i);
- a = map.get(all_tasks, id);
- giveTask(p, id, a[0], a[1], a[2], a[3], null);
- }
- i = 0;
- while(i != amount_short) {
- index = math.random(0, list.getSize(short_tasks) - 1);
- id = list.getIndex(short_tasks, index);
- if(hasTask(p, id)) {
- continue;
- }
- i++;
- a = map.get(all_tasks, id);
- giveTask(p, id, a[0], a[1], a[2], a[3], null);
- }
- i = 0;
- while(i != amount_long) {
- index = math.random(0, list.getSize(long_tasks) - 1);
- id = list.getIndex(long_tasks, index);
- if(hasTask(p, id)) {
- continue;
- }
- i++;
- a = map.get(all_tasks, id);
- giveTask(p, id, a[0], a[1], a[2], a[3], null);
- }
- }
- }
- if(freeplay) {
- starttime = time.getMillis();
- } else {
- imp_string = "";
- iter = iterator(impostors_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p_name = player.getName(p_uuid);
- if(imp_string == "") {
- imp_string = p_name;
- } else {
- imp_string = string.concat(imp_string, ", ", amongus.getPlayerColorCode(p_uuid), p_name);
- }
- }
- for(i = 0; i < list.getSize(impostors_list); i++) {
- p_uuid = list.getIndex(impostors_list, i);
- p = player.get(p_uuid);
- map.remove(player_tasks, p_uuid);
- msg.prefix(p, gamename, string.concat("§4Impostors: §r", imp_string));
- }
- }
- setSaboCooldown(default_sabo_cooldown);
- event.unload("entity_dismount");
- event.load("chat");
- event.load("player_move");
- event.load("inv_click");
- event.load("inv_close");
- event.load("player_data_tick");
- sgoto(10, "space_loop");
- sgoto(10, "task_part_loop");
- sgoto(5, "imp_par_loop");
- sbtoggle = false;
- if(amount_all_tasks_per_player > 8) {
- sbtoggle = true;
- sgoto(100, "scoreboard_toggler");
- }
- switchLights(true);
- goto("loop");
- @checkgame
- wait();
- if(event == "entity_damage") {
- if(isPlayer(entity)) {
- //damaged entity is a player
- damaged_player = entity;
- if(player.hasMinigameId(damaged_player, script_id)) {
- cancel = true;
- }
- attacker = player.getFromDamageSource(damage_source);
- if(attacker == null) {
- goto("checkgame");
- }
- if(!isPlayer(attacker)) {
- goto("checkgame");
- }
- if(!player.hasMinigameId(attacker, script_id)) {
- goto("checkgame");
- }
- if(!isImpostor(attacker)) {
- goto("checkgame");
- }
- //kill crewmate
- item = living.getHand(attacker);
- if(item != kill_item) {
- goto("checkgame");
- }
- cooldown = data.getTimer(attacker, "Kill Cooldown");
- if(cooldown == null || cooldown == -1) {
- if(!player.isOnCam(damaged_player) && !player.isGhost(damaged_player)) {
- if(isCrewmate(damaged_player)) {
- killCrewmate(attacker, damaged_player);
- goto("checkwin");
- }
- msg.prefix(attacker, gamename, "Not a crewmate.");
- goto("checkgame");
- }
- } else {
- msg.prefix(attacker, gamename, string.concat("Remaining kill cooldown: ", string.number(math.roundDown(cooldown / 20)), "s"));
- }
- goto("checkgame");
- }
- //damaged entity is not a player
- attacker = player.getFromDamageSource(damage_source);
- if(attacker == null) {
- goto("checkgame");
- }
- if(player.hasMinigameId(attacker, script_id)) {
- cancel = true;
- }
- //report body
- if(entity.getType(entity) == "zombie") {
- if(player.isGhost(attacker)) {
- goto("checkgame");
- }
- found_player_uuid = map.get(report_map, entity);
- if(found_player_uuid == null) {
- entity.remove(entity);
- msg.prefix(attacker, gamename, "Defect entity removed.");
- goto("checkgame");
- }
- reportBody(attacker, found_player_uuid);
- }
- //kill crewmate at cam
- if(entity.isHuman(entity)) {
- item = living.getHand(attacker);
- if(item != kill_item) {
- goto("checkgame");
- }
- cooldown = data.getTimer(attacker, "Kill Cooldown");
- if(cooldown == null || cooldown == -1) {
- p_uuid = map.get(cam_map_4, entity);
- if(p_uuid == null) {
- entity.remove(entity);
- msg.prefix(attacker, gamename, "Defect entity removed.");
- goto("checkgame");
- }
- p = player.get(p_uuid);
- if(isCrewmate(p)) {
- cam.leave(p);
- killCrewmate(attacker, p);
- goto("checkwin");
- }
- msg.prefix(attacker, gamename, "Not a crewmate.");
- } else {
- msg.prefix(attacker, gamename, string.concat("Remaining kill cooldown: ", string.number(math.roundDown(cooldown / 20)), "s"));
- }
- }
- goto("checkgame");
- }
- if(player.hasMinigameId(player, script_id)) {
- ignoreGoto(event);
- }
- goto("checkgame");
- @chat
- cancel = true;
- if(player.isGhost(player)) {
- iter = iterator(ghosts);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- if(!list.contains(player_list, p_uuid)) {
- continue;
- }
- p = player.get(p_uuid);
- msg.prefix(p, string.concat("Ghost ", amongus.getPlayerColorCode(player), player.getName(player)), message);
- }
- goto("checkgame");
- }
- if(meeting) {
- minigame.speakAll(string.concat(amongus.getPlayerColorCode(player), player.getName(player)), message);
- }
- goto("checkgame");
- @player_move
- player_uuid = player.getUuid(player);
- player.action(player, text.new(map.getOrDefault(move_id_map, id, "")));
- if(player.isOnCam(player)) {
- goto("checkgame");
- }
- if(player.isGhost(player)) {
- goto("checkgame");
- }
- old_room_id = map.getOrDefault(admin_table_map, player_uuid, "");
- if(old_room_id != id) {
- map.add(admin_table_map, player_uuid, id);
- //Neuer Raum
- amount_players = map.getOrDefault(admin_table_map_2, id, 0) + 1;
- map.add(admin_table_map_2, id, amount_players);
- amongus.updateAdminTable(id, amount_players);
- //Alter Raum
- amount_players = map.getOrDefault(admin_table_map_2, old_room_id, 0) - 1;
- map.add(admin_table_map_2, old_room_id, amount_players);
- amongus.updateAdminTable(old_room_id, amount_players);
- }
- goto("checkgame");
- function amongus.setMeeting(bool) {
- $meeting = bool;
- }
- function amongus.isMeeting() {
- return $meeting;
- }
- function amongus.manageEffects(player) {
- living.clearEffects(player);
- if(amongus.isMeeting()) {
- time = $discuss_time * 20 + $vote_time * 20;
- living.addEffect(player, "JUMP", time, 128, false);
- living.addEffect(player, "SLOW", time, 6, false);
- return;
- }
- if(player.isGhost(player)) {
- living.addEffect(player, "NIGHT_VISION", 999999, 0, false);
- return;
- }
- if(player.isOnCam(player)) {
- living.addEffect(player, "NIGHT_VISION", 999999, 0, false);
- return;
- }
- if($lights_sabotaged) {
- if(isImpostor(player)) {
- living.addEffect(player, "NIGHT_VISION", 999999, 0, false);
- } else {
- living.addEffect(player, "BLINDNESS", 999999, 0, false);
- }
- return;
- }
- }
- function amongus.updateAdminTable(room_id, amount_players) {
- if(amount_players == 0) {
- if(room_id == $move_id_le) {
- inv.setItem($admin_table_inv, 37, item.create("blue_stained_glass_pane", 1, "§rLower Engine", null));
- } elseif(room_id == $move_id_sec) {
- inv.setItem($admin_table_inv, 20, item.create("blue_stained_glass_pane", 1, "§rSecurity", null));
- } elseif(room_id == $move_id_ue) {
- inv.setItem($admin_table_inv, 1, item.create("blue_stained_glass_pane", 1, "§rUpper Engine", null));
- } elseif(room_id == $move_id_reac) {
- inv.setItem($admin_table_inv, 18, item.create("blue_stained_glass_pane", 1, "§rReactor", null));
- } elseif(room_id == $move_id_o2) {
- inv.setItem($admin_table_inv, 15, item.create("blue_stained_glass_pane", 1, "§rO2", null));
- } elseif(room_id == $move_id_navi) {
- inv.setItem($admin_table_inv, 26, item.create("blue_stained_glass_pane", 1, "§rNavigation", null));
- } elseif(room_id == $move_id_weap) {
- inv.setItem($admin_table_inv, 7, item.create("blue_stained_glass_pane", 1, "§rWeapons", null));
- } elseif(room_id == $move_id_shie) {
- inv.setItem($admin_table_inv, 43, item.create("blue_stained_glass_pane", 1, "§rShields", null));
- } elseif(room_id == $move_id_comm) {
- inv.setItem($admin_table_inv, 51, item.create("blue_stained_glass_pane", 1, "§rCommunications", null));
- } elseif(room_id == $move_id_stor1 || room_id == $move_id_stor2) {
- inv.setItem($admin_table_inv, 41, item.create("blue_stained_glass_pane", 1, "§rStorage", null));
- } elseif(room_id == $move_id_elec1 || room_id == $move_id_elec2) {
- inv.setItem($admin_table_inv, 30, item.create("blue_stained_glass_pane", 1, "§rElectrical", null));
- } elseif(room_id == $move_id_med1 || room_id == $move_id_med2) {
- inv.setItem($admin_table_inv, 12, item.create("blue_stained_glass_pane", 1, "§rMedBay", null));
- } elseif(room_id == $move_id_cafe) {
- inv.setItem($admin_table_inv, 5, item.create("blue_stained_glass_pane", 1, "§rCafeteria", null));
- } elseif(room_id == $move_id_admin) {
- inv.setItem($admin_table_inv, 24, item.create("blue_stained_glass_pane", 1, "§rAdmin", null));
- }
- } else {
- if(room_id == move_id_le) {
- inv.setItem($admin_table_inv, 37, item.create("sticky_piston", amount_players, "§rLower Engine", null));
- } elseif(room_id == $move_id_sec) {
- inv.setItem($admin_table_inv, 20, item.create("observer", amount_players, "§rSecurity", null));
- } elseif(room_id == $move_id_ue) {
- inv.setItem($admin_table_inv, 1, item.create("sticky_piston", amount_players, "§rUpper Engine", null));
- } elseif(room_id == $move_id_reac) {
- inv.setItem($admin_table_inv, 18, item.create("tnt", amount_players, "§rReactor", null));
- } elseif(room_id == $move_id_o2) {
- inv.setItem($admin_table_inv, 15, item.create("kelp", amount_players, "§rO2", null));
- } elseif(room_id == $move_id_navi) {
- inv.setItem($admin_table_inv, 26, item.create("compass", amount_players, "§rNavigation", null));
- } elseif(room_id == $move_id_weap) {
- sword_item = item.create("golden_sword", amount_players, "§rWeapons", null);
- item.addFlag(sword_item, "HIDE_ATTRIBUTES");
- inv.setItem($admin_table_inv, 7, sword_item);
- } elseif(room_id == $move_id_shie) {
- inv.setItem($admin_table_inv, 43, item.create("shield", amount_players, "§rShields", null));
- } elseif(room_id == $move_id_comm) {
- inv.setItem($admin_table_inv, 51, item.create("end_rod", amount_players, "§rCommunications", null));
- } elseif(room_id == $move_id_stor1 || room_id == $move_id_stor2) {
- inv.setItem($admin_table_inv, 41, item.create("red_shulker_box", amount_players, "§rStorage", null));
- } elseif(room_id == $move_id_elec1 || room_id == $move_id_elec2) {
- inv.setItem($admin_table_inv, 30, item.create("redstone", amount_players, "§rElectrical", null));
- } elseif(room_id == $move_id_med1 || room_id == $move_id_med2) {
- inv.setItem($admin_table_inv, 12, item.custom.create("PLUS_RED", amount_players, "§rMedBay", null));
- } elseif(room_id == $move_id_cafe) {
- inv.setItem($admin_table_inv, 5, item.create("cake", amount_players, "§rCafeteria", null));
- } elseif(room_id == $move_id_admin) {
- inv.setItem($admin_table_inv, 24, item.create("lectern", amount_players, "§rAdmin", null));
- }
- }
- }
- @block_click
- if(slot.isOffHand(hand)) {
- goto("checkgame");
- }
- if(action != "RIGHT_CLICK_BLOCK" && action != "RIGHT_CLICK_AIR") {
- goto("checkgame");
- }
- if(block != null) {
- if(block.hasTag(block, shulker_tag)) {
- cancel = true;
- goto("checkgame");
- }
- if(block.hasTag(block, wooden_trapdoors_tag)) {
- cancel = true;
- goto("checkgame");
- }
- }
- player_uuid = player.getUuid(player);
- item = living.getHand(player);
- //sabotage
- if(item == sabotage_item) {
- inv.open(sabotage_menu, player);
- goto("checkgame");
- }
- //vents
- if(list.contains(vent_list, player_uuid)) {
- if(player.isGhost(player)) {
- goto("checkgame");
- }
- //leave vent
- if(item == leave_vent_item) {
- vent_leave(player);
- }
- //vent button 1
- inv_slot = getInvSlotFromItem(player, item);
- if(inv_slot == 6) {
- vent_loc = map.get(vent_map_4, player_uuid);
- a = map.get($vent_map_3, vent_loc);
- vent_loc_1 = a[1];
- if(vent_loc_1 != null) {
- vent_enter(player, vent_loc_1);
- }
- } elseif(inv_slot == 7) {
- //vent button 2
- vent_loc = map.get(vent_map_4, player_uuid);
- a = map.get($vent_map_3, vent_loc);
- vent_loc_2 = a[3];
- if(vent_loc_2 != null) {
- vent_enter(player, vent_loc_2);
- }
- }
- goto("checkgame");
- }
- //cams
- if(player.isOnCam(player)) {
- cam_number = map.get(cam_map, player_uuid);
- number_of_cams = set.getSize(cams_locs);
- if(item == prev_cam_item) {
- cam_number--;
- if(cam_number < 0) {
- cam_number = number_of_cams - 1;
- }
- } elseif(item == next_cam_item) {
- cam_number++;
- if(cam_number >= number_of_cams) {
- cam_number = 0;
- }
- } elseif(item == leave_cam_item) {
- cam.leave(player);
- } else {
- goto("checkgame");
- }
- map.add(cam_map, player_uuid, cam_number);
- goto("checkgame");
- }
- //meeting
- if(meeting) {
- if(item == open_vote_menu_item) {
- if(data.getTimer(player, "Discussion Time") < 0) {
- vote_inv = getVoteInv(player);
- inv.open(vote_inv, player);
- }
- }
- goto("checkgame");
- }
- //ONLY RIGHT_CLICK_BLOCK
- if(action != "RIGHT_CLICK_BLOCK") {
- goto("checkgame");
- }
- block_loc = block.getLocation(block);
- //enter vent
- if(list.contains(all_vent_locs, block_loc)) {
- if(isCrewmate(player)) {
- goto("checkgame");
- }
- if(player.isGhost(player)) {
- goto("checkgame");
- }
- cooldown = data.getTimer(player, "Kill Cooldown");
- map.add(holded_kill_cooldown, player_uuid, cooldown);
- vent_enter(player, block_loc);
- goto("checkgame");
- }
- if(set.contains(cams_locs, block_loc)) {
- cam_number = 0;
- player_uuid = player.getUuid(player);
- map.add(cam_map, player_uuid, cam_number);
- player_loc = entity.getLocation(player);
- map.add(cam_map_2, player_uuid, player_loc);
- if(!player.isGhost(player)) {
- ent = human.spawn(player_loc, "");
- human.setAi(ent, 0);
- map.add(cam_map_3, player_uuid, ent);
- map.add(cam_map_4, ent, player_uuid);
- human.setSkinUuid(ent, player_uuid);
- color = amongus.getPlayerColor(player);
- amongus.equipHuman(ent, color, player);
- living.setInvisible(ent, true);
- }
- cam.enter(player);
- goto("checkgame");
- }
- if(set.contains(med_scan_locs, block_loc)) {
- task_id = 16;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- if(loc.distance(entity.getLocation(player), block_loc) > 3) {
- msg.prefix(player, gamename, "Get closer.");
- goto("checkgame");
- }
- player_uuid = player.getUuid(player);
- inv = inv.new("000000000000000000000000000000000000000000000000000000", text.new("§cSubmit Scan"));
- for(i = 0; i < 54; i++) {
- inv.setItem(inv, i, light_gray_glass);
- }
- inv.setItem(inv, 13, player.getHead(player_uuid, player.getName(player)));
- color = amongus.getPlayerColor(player);
- color_code = map.get(cloth_code_map, color);
- item = read.item(string.concat("{id:\"minecraft:leather_chestplate\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
- item.addFlag(item, "HIDE_ATTRIBUTES");
- inv.setItem(inv, 22, item);
- item = read.item(string.concat("{id:\"minecraft:leather_leggings\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
- item.addFlag(item, "HIDE_ATTRIBUTES");
- inv.setItem(inv, 31, item);
- item = read.item(string.concat("{id:\"minecraft:leather_boots\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
- item.addFlag(item, "HIDE_ATTRIBUTES");
- inv.setItem(inv, 40, item);
- inv.open(inv, player);
- list.add(submit_scan_list, player_uuid);
- map.add(submit_scan_map, player_uuid, 0);
- map.add(submit_scan_map_2, player_uuid, inv);
- sgoto(20, "submit_scan");
- goto("checkgame");
- }
- if(set.contains(clear_ast_locs, block_loc)) {
- task_id = 13;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step == 20) {
- goto("checkgame");
- }
- //inv = inv.new("222222222 222222222 222222222 222222222 222222222 222222222");
- inv = inv.new("222222222222222222222222222222222222222222222222222222", text.new("§cClear Asteroids"));
- a = array.new(7);
- a[0] = inv;
- slot = list.getIndex(ast_start_pos, math.random(0, 25));
- a[1] = slot;
- inv.setItem(inv, slot, asteroid_item);
- inv.open(inv, player);
- b = getAstDirection(slot);
- a[2] = b[0]; //x_dir
- a[3] = b[1]; //y_dir
- a[4] = false; //reached end
- a[5] = math.random(1, 2); //speed
- a[6] = 0; //speed counter
- my_list = list.new();
- list.add(my_list, a);
- player_uuid = player.getUuid(player);
- map.add(clear_ast_map, player_uuid, my_list);
- map.add(clear_ast_map_2, player_uuid, 0);
- map.add(clear_ast_map_3, player_uuid, inv);
- if(list.getSize(clear_ast_list) == 0) {
- sgoto(5, "clear_ast");
- }
- list.add(clear_ast_list, player_uuid);
- goto("checkgame");
- }
- if(set.contains(inspect_sample_locs, block_loc)) {
- task_id = 8;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- player_uuid = player.getUuid(player);
- inv = map.get(sample_map, player_uuid);
- if(inv == null) {
- sample = item.create("white_stained_glass_pane", 1, "§rSample", null);
- //inv = inv.new("000000000 000000000 000000000 000000000 202020202 000000002");
- inv = inv.new("000000000000000000000000000000000000202020202000000002", text.new("§cInspect Sample"));
- for(i = 0; i < 54; i++) {
- inv.setItem(inv, i, light_gray_glass);
- }
- h = 0;
- for(i = 0; i < 3; i++) {
- inv.setItem(inv, 0 + h, sample);
- inv.setItem(inv, 2 + h, sample);
- inv.setItem(inv, 4 + h, sample);
- inv.setItem(inv, 6 + h, sample);
- inv.setItem(inv, 8 + h, sample);
- h += 9;
- }
- select_sample = item.create("gray_stained_glass_pane", 1, "§rSelect sample", null);
- inv.setItem(inv, 36, select_sample);
- inv.setItem(inv, 38, select_sample);
- inv.setItem(inv, 40, select_sample);
- inv.setItem(inv, 42, select_sample);
- inv.setItem(inv, 44, select_sample);
- inv.setItem(inv, 53, item.create("green_stained_glass_pane", 1, "§rPress to start", null));
- }
- inv.open(inv, player);
- goto("checkgame");
- }
- if(block_loc == admin_table_loc) {
- if(comms_sabotaged) {
- msg.prefix(player, gamename, "Communications disabled.");
- goto("checkgame");
- }
- inv.open(admin_table_inv, player);
- goto("checkgame");
- }
- if(block_loc == ue_align_loc || block_loc == le_align_loc) {
- task_id = 17;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step == 2) {
- goto("checkgame");
- }
- player_uuid = player.getUuid(player);
- if(block_loc == ue_align_loc && set.contains(align_ue_engine_set, player_uuid)) {
- goto("checkgame");
- }
- if(block_loc == le_align_loc && set.contains(align_le_engine_set, player_uuid)) {
- goto("checkgame");
- }
- //inv = inv.new("000000002 000000000 000000000 000000000 000000002");
- inv = inv.new("000000002000000000000000000000000000000000002", text.new("§cAlign Engine"));
- for(i = 18; i < 27; i++) {
- inv.setItem(inv, i, light_gray_glass);
- }
- inv.setItem(inv, 8, item_arrow_up);
- inv.setItem(inv, 44, item_arrow_down);
- inv.setItem(inv, 26, green_glass);
- inv.open(inv, player);
- pos = math.random(0, 10);
- while(pos == 5) {
- pos = math.random(0, 10);
- }
- map.add(align_engine_map, player_uuid, pos);
- map.add(align_engine_map_2, player_uuid, block_loc);
- set_engine(player, inv, null);
- goto("checkgame");
- }
- if(block_loc == clean_o2_loc) {
- task_id = 15;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- //inv = inv.new("022222222 022222222 222222222 222222222 022222222 022222222");
- inv = inv.new("022222222022222222222222222222222222022222222022222222", text.new("§cClean O2 Filter"));
- for(i = 1; i < 54; i++) {
- if(i == 9 || i == 36 || i == 45) {
- continue;
- }
- inv.setItem(inv, i, light_gray_glass);
- }
- for(i = 0; i < 6; i++) {
- slot = math.random(1, 53);
- while(slot % 9 == 0 || inv.getItem(inv, slot) != light_gray_glass) {
- slot = math.random(1, 53);
- }
- inv.setItem(inv, slot, item.create("oak_leaves", 1, null, null));
- if(slot < 18) {
- if(item.getType(inv.getItem(inv, slot + 9)) == light_gray_glass_mat) {
- inv.setItem(inv, slot + 9, item_arrow_down);
- continue;
- }
- }
- if(slot > 36) {
- if(item.getType(inv.getItem(inv, slot - 9)) == light_gray_glass_mat) {
- inv.setItem(inv, slot - 9, item_arrow_up);
- continue;
- }
- }
- if(item.getType(inv.getItem(inv, slot - 1)) == light_gray_glass_mat) {
- inv.setItem(inv, slot - 1, item_arrow_left);
- }
- }
- inv.open(inv, player);
- goto("checkgame");
- }
- if(block_loc == elec_power_loc) {
- task_id = 14;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step != 0) {
- goto("checkgame");
- }
- //inv = inv.new("000000000 000000000 000000000 000000000 222222220 000000000");
- inv = inv.new("000000000000000000000000000000000000222222220000000000", text.new("§cDivert Power"));
- gunpowder = item.create("GUNPOWDER", 1, null, null);
- inv.setItem(inv, 4, gunpowder);
- for(i = 11; i < 16; i++) {
- inv.setItem(inv, i, gunpowder);
- }
- for(i = 19; i < 26; i++) {
- inv.setItem(inv, i, gunpowder);
- }
- for(i = 27; i < 36; i++) {
- inv.setItem(inv, i, gunpowder);
- }
- for(i = 36; i < 45; i++) {
- inv.setItem(inv, i, item.create("LEVER", 1, map.get(divert_pow_map, i), null));
- }
- r = map.get(divert_pow_map_3, player.getUuid(player));
- inv.setItem(inv, r, item.create("REDSTONE_TORCH", 1, map.get(divert_pow_map, r), null));
- inv.open(inv, player);
- goto("checkgame");
- }
- r = map.get(divert_pow_map_3, player.getUuid(player));
- if(r != null && block_loc == map.get(divert_pow_map_2, r)) {
- task_id = 14;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step != 1) {
- goto("checkgame");
- }
- //inv = inv.new("000000000 000000000 000000000 000020000 002002002 220000220");
- inv = inv.new("002200002220200220020202002222222220002002002220000220", text.new("§cDivert Power"));
- gunpowder = item.create("gunpowder", 1, null, null);
- redstone = item.create("redstone", 1, null, null);
- inv.setItem(inv, 2, redstone);
- inv.setItem(inv, 3, redstone);
- inv.setItem(inv, 8, gunpowder);
- inv.setItem(inv, 9, redstone);
- inv.setItem(inv, 10, redstone);
- inv.setItem(inv, 12, redstone);
- inv.setItem(inv, 15, gunpowder);
- inv.setItem(inv, 16, gunpowder);
- inv.setItem(inv, 19, redstone);
- inv.setItem(inv, 21, redstone);
- inv.setItem(inv, 23, gunpowder);
- inv.setItem(inv, 26, gunpowder);
- inv.setItem(inv, 27, redstone);
- inv.setItem(inv, 28, redstone);
- inv.setItem(inv, 29, redstone);
- inv.setItem(inv, 30, redstone);
- inv.setItem(inv, 31, item.create("stone_button", 1, "§rConnect Grids", null));
- inv.setItem(inv, 32, gunpowder);
- inv.setItem(inv, 33, gunpowder);
- inv.setItem(inv, 34, gunpowder);
- inv.setItem(inv, 38, redstone);
- inv.setItem(inv, 41, gunpowder);
- inv.setItem(inv, 44, gunpowder);
- inv.setItem(inv, 45, redstone);
- inv.setItem(inv, 46, redstone);
- inv.setItem(inv, 51, gunpowder);
- inv.setItem(inv, 52, gunpowder);
- inv.open(inv, player);
- goto("checkgame");
- }
- if(block_loc == cafe_garb_loc || block_loc == o2_garb_loc) {
- cancel = true;
- task_id = 12;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step != 0) {
- goto("checkgame");
- }
- player_uuid = player.getUuid(player);
- r = map.get(empty_garb_map_3, player_uuid);
- if(r == 0 && block_loc == o2_garb_loc) {
- goto("checkgame");
- }
- if(r == 1 && block_loc == cafe_garb_loc) {
- goto("checkgame");
- }
- //inv = inv.new("000000000 000000000 000000000 000000000 000000002 000000000");
- inv = inv.new("000000000000000000000000000000000000000000002000000000", text.new("§cEmpty Garbage"));
- for(i = 1; i < 8; i++) {
- inv.setItem(inv, i, light_gray_glass);
- }
- i = 10;
- for(row = 1; row < 6; row++) {
- for(col = 0; col < 7; col++) {
- r = math.random(1, 6);
- if(r == 1) {
- leaves_item = oak_leaves;
- } elseif(r == 2) {
- leaves_item = spruce_leaves;
- } elseif(r == 3) {
- leaves_item = birch_leaves;
- } elseif(r == 4) {
- leaves_item = jungle_leaves;
- } elseif(r == 5) {
- leaves_item = acacia_leaves;
- } else {
- leaves_item = dark_oak_leaves;
- }
- inv.setItem(inv, i, leaves_item);
- i++;
- }
- i += 2;
- }
- inv.setItem(inv, 44, item.custom.create("ARROW_DOWN", 1, "§rEmpty Garbage", null));
- inv.open(inv, player);
- goto("checkgame");
- }
- if(block_loc == stor_garb_loc) {
- cancel = true;
- task_id = 12;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step != 1) {
- goto("checkgame");
- }
- //inv = inv.new("000000000 000000000 000000000 000000000 000000002 000000000");
- inv = inv.new("000000000000000000000000000000000000000000002000000000", text.new("§cEmpty Garbage"));
- for(i = 1; i < 8; i++) {
- inv.setItem(inv, i, light_gray_glass);
- }
- i = 10;
- for(row = 1; row < 6; row++) {
- for(col = 0; col < 7; col++) {
- r = math.random(1, 6);
- if(r == 1) {
- leaves_item = oak_leaves;
- } elseif(r == 2) {
- leaves_item = spruce_leaves;
- } elseif(r == 3) {
- leaves_item = birch_leaves;
- } elseif(r == 4) {
- leaves_item = jungle_leaves;
- } elseif(r == 5) {
- leaves_item = acacia_leaves;
- } else {
- leaves_item = dark_oak_leaves;
- }
- inv.setItem(inv, i, leaves_item);
- i++;
- }
- i += 2;
- }
- list.shuffle(garb_items);
- inv.setItem(inv, math.random(10, 16), list.getIndex(garb_items, 0));
- inv.setItem(inv, math.random(19, 25), list.getIndex(garb_items, 1));
- inv.setItem(inv, math.random(37, 43), list.getIndex(garb_items, 2));
- inv.setItem(inv, 44, item.custom.create("ARROW_DOWN", 1, "§rEmpty Garbage", null));
- inv.open(inv, player);
- goto("checkgame");
- }
- if(block_loc == swipe_card_loc) {
- task_id = 11;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- //inv = inv.new("000000000 002222200 000000000");
- inv = inv.new("000000000003333320000000000", text.new("§cSwipe Card"));
- for(i = 11; i < 16; i++) {
- inv.setItem(inv, i, light_gray_glass);
- }
- inv.open(inv, player);
- goto("checkgame");
- }
- if(block_loc == calibrate_dist_loc) {
- task_id = 9;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- //inv = inv.new("000000000 000000000 000000000 000000000 000000002 000000000");
- inv = inv.new("000000000000000000000000000000000000000000002000000000", text.new("§cCalibrate Distributor"));
- for(i = 0; i < 54; i++) {
- inv.setItem(inv, i, light_gray_glass);
- }
- inv.setItem(inv, 3, item.custom.create("CROSS_RED", 1, null, null));
- inv.setItem(inv, 4, item.custom.create("CROSS_RED", 1, null, null));
- inv.setItem(inv, 5, item.custom.create("CROSS_RED", 1, null, null));
- for(i = 0; i < 12; i++) {
- inv.setItem(inv, calibrate_dist_array[i], black_glass);
- }
- inv.setItem(inv, 34, yellow_glass);
- inv.setItem(inv, 35, yellow_glass);
- inv.setItem(inv, 44, item.custom.create("MINUS_GREEN", 1, "§rPress", null));
- inv.open(inv, player);
- start_index = math.random(0, 8);
- a = array.new(5);
- player_uuid = player.getUuid(player);
- a[0] = player_uuid;
- a[1] = inv;
- a[2] = start_index;
- a[3] = start_index; //index
- a[4] = 0; //stage
- list.add(calibrate_dist_list, player_uuid);
- map.add(calibrate_dist_map, player_uuid, a);
- sgoto(7, "calibrate_dist");
- goto("checkgame");
- }
- if(block_loc == steering_loc) {
- task_id = 7;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- //inv = inv.new("222222222 222222222 222222222 222222222 222222222");
- inv = inv.new("222222222222222222222222222222222222222222222", text.new("§cStabilize Steering"));
- for(i = 0; i < 45; i++) {
- inv.setItem(inv, i, light_gray_glass);
- }
- inv.setItem(inv, 22, item.custom.create("PLUS_RED", 1, null, null));
- r = math.random(0, 3);
- if(r == 0) {
- slot = 6;
- slot_left = 5;
- slot_right = 7;
- slot_down = 15;
- slot_up = -1;
- } elseif(r == 1) {
- slot = 9;
- slot_left = -1;
- slot_right = 10;
- slot_down = 18;
- slot_up = 0;
- } elseif(r == 2) {
- slot = 28;
- slot_left = 27;
- slot_right = 29;
- slot_down = 37;
- slot_up = 19;
- } else {
- slot = 35;
- slot_left = 34;
- slot_right = -1;
- slot_down = 44;
- slot_up = 26;
- }
- if(slot_left != -1) {
- inv.setItem(inv, slot_left, item_arrow_left);
- }
- if(slot_right != -1) {
- inv.setItem(inv, slot_right, item_arrow_right);
- }
- if(slot_up != -1) {
- inv.setItem(inv, slot_up, item_arrow_up);
- }
- if(slot_down != -1) {
- inv.setItem(inv, slot_down, item_arrow_down);
- }
- inv.setItem(inv, slot, item.custom.create("PLUS_RED", 1, null, null));
- inv.open(inv, player);
- goto("checkgame");
- }
- if(block_loc == chart_course_loc) {
- task_id = 6;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- a = array.new(9);
- r = math.random(0, 2);
- inv = inv.new("222222222222222222222222222222222222222222222222222222", text.new("§cChart Course"));
- if(r == 0) {
- a[0] = 27;
- a[1] = 19;
- a[2] = 29;
- a[3] = 39;
- a[4] = 31;
- a[5] = 23;
- a[6] = 15;
- a[7] = 25;
- a[8] = 35;
- } elseif(r == 1) {
- a[0] = 18;
- a[1] = 28;
- a[2] = 38;
- a[3] = 30;
- a[4] = 22;
- a[5] = 32;
- a[6] = 42;
- a[7] = 34;
- a[8] = 26;
- } else {
- a[0] = 36;
- a[1] = 28;
- a[2] = 20;
- a[3] = 21;
- a[4] = 13;
- a[5] = 23;
- a[6] = 33;
- a[7] = 25;
- a[8] = 26;
- }
- for(i = 0; i < 54; i++) {
- inv.setItem(inv, i, light_gray_glass);
- }
- for(i = 0; i < 9; i++) {
- inv.setItem(inv, a[i], black_glass);
- }
- player_uuid = player.getUuid(player);
- map.add(chart_course_pattern, player_uuid, a);
- inv.open(inv, player);
- goto("checkgame");
- }
- if(block_loc == unlock_manifolds_loc) {
- task_id = 5;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- //inv = inv.new("002222200 002222200");
- inv = inv.new("002222200002222200", text.new("§cUnlock Manifolds"));
- list = list.new();
- for(i = 0; i < 10; i++) {
- list.add(list, item.create("BLUE_STAINED_GLASS_PANE", i + 1, null, null));
- }
- list.shuffle(list);
- a = 2;
- for(i = 0; i < 10; i++) {
- inv.setItem(inv, a++, list.getIndex(list, i));
- if(a == 7) {
- a = 11;
- }
- }
- inv.open(inv, player);
- goto("checkgame");
- }
- if(block_loc == start_reactor_loc) {
- task_id = 4;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- if(reactor_used) {
- msg.prefix(player, gamename, "Another player already starts the reactor.");
- goto("checkgame");
- }
- reactor_used = true;
- reactor_array = reactor.get(player);
- if(reactor_array == null) {
- //inv = inv.new("000000000 000000000 000002220 000002220 000002220 000000000");
- inv = inv.new("000000000000000000000002220000002220000002220000000000", text.new("§cStart Reactor"));
- for(i = 0; i < 54; i++) {
- inv.setItem(inv, i, light_gray_glass);
- }
- reactor_array = array.new(5);
- reactor.setInv(reactor_array, inv);
- reactor.setStage(reactor_array, 0);
- reactor.setPattern(reactor_array);
- } else {
- inv = reactor.getInv(reactor_array);
- }
- reactor.setCounter(reactor_array, 0);
- reactor.setPhase(reactor_array, "draw");
- reactor.save(reactor_array, player);
- reactor.setHeader(inv, light_gray_glass);
- reactor.setLeftSide(inv, black_glass);
- reactor.setRightSide(inv, black_glass);
- inv.open(inv, player);
- list.add(reactor_draw_list_1, player.getUuid(player));
- sgoto(20, "draw_pattern_1");
- goto("checkgame");
- }
- if(block_loc == prime_shields_loc) {
- task_id = 3;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- //inv = inv.new("000000000 000222000 002222200 002222200 000222000 000000000");
- inv = inv.new("000000000000222000002222200002222200000222000000000000", text.new("§cPrime Shields"));
- for(i = 12; i < 42; i++) {
- r = math.random(0, 1);
- if(r == 0) {
- inv.setItem(inv, i, green_glass);
- } else {
- inv.setItem(inv, i, red_glass);
- }
- if(i == 14) {
- i = 19;
- } elseif(i == 24) {
- i = 28;
- } elseif(i == 33) {
- i = 38;
- }
- }
- inv.open(inv, player);
- goto("checkgame");
- }
- if(block_loc == fix_o2_loc_1 || block_loc == fix_o2_loc_2) {
- if(player.isGhost(player)) {
- goto("checkgame");
- }
- if(oxygen_sabotaged) {
- if(block_loc == fix_o2_loc_1) {
- map.add(oxygen_map, player.getUuid(player), fix_o2_loc_1);
- if(oxy_fixed_1) {
- goto("checkgame");
- }
- } elseif(block_loc == fix_o2_loc_2) {
- map.add(oxygen_map, player.getUuid(player), fix_o2_loc_2);
- if(oxy_fixed_2) {
- goto("checkgame");
- }
- }
- //oxygen_inv = inv.new("000000000 000000000 000222000 000222000 000222000 000222000");
- oxygen_inv = inv.new("000000000000000000000222000000222000000222000000222000", text.new("§cENTER CODE"));
- inv.setItem(oxygen_inv, 8, item.create("PAPER", 1, string.concat("§f", string.number(oxy_code)), null));
- inv.setItem(oxygen_inv, 21, item.custom.create("DIGIT_0", 1, "§f0", null));
- inv.setItem(oxygen_inv, 22, item.custom.create("DIGIT_1", 1, "§f1", null));
- inv.setItem(oxygen_inv, 23, item.custom.create("DIGIT_2", 1, "§f2", null));
- inv.setItem(oxygen_inv, 30, item.custom.create("DIGIT_3", 1, "§f3", null));
- inv.setItem(oxygen_inv, 31, item.custom.create("DIGIT_4", 1, "§f4", null));
- inv.setItem(oxygen_inv, 32, item.custom.create("DIGIT_5", 1, "§f5", null));
- inv.setItem(oxygen_inv, 39, item.custom.create("DIGIT_6", 1, "§f6", null));
- inv.setItem(oxygen_inv, 40, item.custom.create("DIGIT_7", 1, "§f7", null));
- inv.setItem(oxygen_inv, 41, item.custom.create("DIGIT_8", 1, "§f8", null));
- inv.setItem(oxygen_inv, 48, item.custom.create("CROSS_RED", 1, null, null));
- inv.setItem(oxygen_inv, 49, item.custom.create("DIGIT_9", 1, "§f9", null));
- inv.setItem(oxygen_inv, 50, item.custom.create("CHECK_GREEN", 1, null, null));
- inv.open(oxygen_inv, player);
- sabotage.openedInv(player);
- }
- goto("checkgame");
- }
- if(block_loc == fix_reactor_loc_1 || block_loc == fix_reactor_loc_2) {
- if(player.isGhost(player)) {
- goto("checkgame");
- }
- if(reactor_sabotaged) {
- if(block_loc == fix_reactor_loc_1) {
- sabotage.openedInv(player);
- inv.open(reactor_inv_1, player);
- list.add(reactor_hold_list_1, player.getUuid(player));
- goto("checkgame");
- }
- if(block_loc == fix_reactor_loc_2) {
- sabotage.openedInv(player);
- inv.open(reactor_inv_2, player);
- list.add(reactor_hold_list_2, player.getUuid(player));
- }
- }
- goto("checkgame");
- }
- if(block_loc == fix_comms_loc) {
- if(player.isGhost(player)) {
- goto("checkgame");
- }
- if(comms_sabotaged) {
- player_uuid = player.getUuid(player);
- inv = inv.new("000000000000000000000000000000000000000000000000202000", text.new("§cFix Communications"));
- inv.setItem(inv, 48, item.custom.create("ARROW_LEFT", 1, null, null));
- inv.setItem(inv, 49, item.create("BLACK_STAINED_GLASS_PANE", 32, null, null));
- inv.setItem(inv, 50, item.custom.create("ARROW_RIGHT", 1, null, null));
- inv.open(inv, player);
- sabotage.openedInv(player);
- diff = math.abs(32 - comms_fix_freq);
- if(diff == 0) {
- comms.drawCorrect(inv, player);
- } elseif(diff < 4) {
- comms.drawClose(inv, player);
- } else {
- comms.drawWorst(inv, player);
- }
- map.add(comms_inv_map, player_uuid, inv);
- if(!list.contains(comms_state_list, player_uuid)) {
- list.add(comms_state_list, player_uuid);
- sgoto(5, "draw_comms");
- }
- }
- goto("checkgame");
- }
- if(block_loc == fix_lights_loc_1 || block_loc == fix_lights_loc_2) {
- if(player.isGhost(player)) {
- goto("checkgame");
- }
- if(lights_sabotaged) {
- sabotage.openedInv(player);
- inv.open(lights_inv, player);
- }
- goto("checkgame");
- }
- if(block_loc == meeting_button_loc) {
- if(player.isGhost(player)) {
- goto("checkgame");
- }
- if(amongus.isAlert()) {
- msg.prefix(player, gamename, "No meetings allowed while sabotaged.");
- goto("checkgame");
- }
- if(!meeting) {
- callMeeting(player);
- }
- goto("checkgame");
- }
- block_type = block.getType(block);
- if(block_type == lever_mat) {
- cancel = true;
- }
- if(block_type == redstone_lamp_mat) {
- task_id = 10;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step == 3) {
- goto("checkgame");
- }
- my_list = map.get(wires_map_4, player.getUuid(player));
- if(block_loc != list.getIndex(my_list, step)) {
- goto("checkgame");
- }
- //inv = inv.new("000000000 002202200 002202200 002202200 002202200 000000000");
- inv = inv.new("000000000002202200002202200002202200002202200000000000", text.new("§cFix Wiring"));
- for(i = 0; i < 54; i++) {
- inv.setItem(inv, i, light_gray_glass);
- }
- inv.setItem(inv, 12, item.custom.create("CROSS_RED", 1, "§rDisconnected", null));
- inv.setItem(inv, 14, item.custom.create("CROSS_RED", 1, "§rDisconnected", null));
- inv.setItem(inv, 21, item.custom.create("CROSS_RED", 1, "§rDisconnected", null));
- inv.setItem(inv, 23, item.custom.create("CROSS_RED", 1, "§rDisconnected", null));
- inv.setItem(inv, 30, item.custom.create("CROSS_RED", 1, "§rDisconnected", null));
- inv.setItem(inv, 32, item.custom.create("CROSS_RED", 1, "§rDisconnected", null));
- inv.setItem(inv, 39, item.custom.create("CROSS_RED", 1, "§rDisconnected", null));
- inv.setItem(inv, 41, item.custom.create("CROSS_RED", 1, "§rDisconnected", null));
- list.shuffle(wires_list);
- inv.setItem(inv, 11, list.getIndex(wires_list, 0));
- inv.setItem(inv, 20, list.getIndex(wires_list, 1));
- inv.setItem(inv, 29, list.getIndex(wires_list, 2));
- inv.setItem(inv, 38, list.getIndex(wires_list, 3));
- list.shuffle(wires_list);
- inv.setItem(inv, 15, list.getIndex(wires_list, 0));
- inv.setItem(inv, 24, list.getIndex(wires_list, 1));
- inv.setItem(inv, 33, list.getIndex(wires_list, 2));
- inv.setItem(inv, 42, list.getIndex(wires_list, 3));
- inv.open(inv, player);
- goto("checkgame");
- }
- if(list.contains(download_list_3, block_loc) || block_loc == admin_upload_loc) {
- cancel = true;
- task_id = 2;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(block_loc == admin_upload_loc) {
- if(step != 1) {
- goto("checkgame");
- }
- //Upload
- inv = inv.new("000000000000000000000020000", text.new("§cUpload Data"));
- for(i = 0; i < 9; i++) {
- inv.setItem(inv, i, light_gray_glass);
- }
- inv.setItem(inv, 9, item.create("birch_trapdoor", 1, "§rMy Laptop", null));
- inv.setItem(inv, 17, item.create("redstone_torch", 1, "§rHeadquarters", null));
- inv.setItem(inv, 22, item.custom.create("ARROW_UP", 1, "§rUpload", null));
- inv.open(inv, player);
- goto("checkgame");
- }
- if(step != 0) {
- goto("checkgame");
- }
- r = map.get(download_map_3, player.getUuid(player));
- down_loc = list.getIndex(download_list_3, r);
- if(down_loc != block_loc) {
- goto("checkgame");
- }
- //Download
- inv = inv.new("000000000000000000000020000", text.new("§cDownload Data"));
- for(i = 0; i < 9; i++) {
- inv.setItem(inv, i, light_gray_glass);
- }
- inv.setItem(inv, 9, item.create("CHEST", 1, map.get(download_map_2, block_loc), null));
- inv.setItem(inv, 17, item.create("BIRCH_TRAPDOOR", 1, "§rMy Laptop", null));
- inv.setItem(inv, 22, item.custom.create("ARROW_DOWN", 1, "§rDownload", null));
- inv.open(inv, player);
- goto("checkgame");
- }
- if(block_loc == get_fuel_loc) {
- task_id = 1;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step == 1 || step == 3 || step == 4) {
- goto("checkgame");
- }
- lime_terra_item = item.create("LIME_TERRACOTTA", 1, null, null);
- //inv = inv.new(000000002 000000000 000000000 000000000 000000000 000000000);
- inv = inv.new("000000002000000000000000000000000000000000000000000000", text.new("§cFuel"));
- player_uuid = player.getUuid(player);
- c = map.getOrDefault(fuel_counter, player_uuid, 0);
- for(row = 0; row < 6; row++) {
- for(col = 0; col < 7; col++) {
- i = row * 9 + col;
- inv.setItem(inv, i, lime_terra_item);
- }
- }
- inv.setItem(inv, 8, item.custom.create("ARROW_DOWN", 1, "§rGet fuel", null));
- inv.open(inv, player);
- goto("checkgame");
- }
- if(block_loc == upper_engine_loc || block_loc == lower_engine_loc) {
- task_id = 1;
- cancel = true;
- if(!hasTask(player, task_id)) {
- goto("checkgame");
- }
- step = task.getStep(player, task_id);
- if(step == 0 || step == 2 || step == 4) {
- goto("checkgame");
- }
- if(step == 1 && block_loc != upper_engine_loc) {
- goto("checkgame");
- }
- if(step == 3 && block_loc != lower_engine_loc) {
- goto("checkgame");
- }
- //inv = inv.new(000000002 000000000 000000000 000000000 000000000 000000000);
- inv = inv.new("000000002000000000000000000000000000000000000000000000", text.new("§cEngine"));
- for(row = 0; row < 6; row++) {
- for(col = 0; col < 7; col++) {
- i = row * 9 + col;
- inv.setItem(inv, i, light_gray_glass);
- }
- }
- inv.setItem(inv, 8, item.custom.create("ARROW_UP", 1, "§rFill engine", null));
- inv.open(inv, player);
- goto("checkgame");
- }
- goto("checkgame");
- @inv_click
- if(inv_slot >= 36 && inv_slot <= 39) {
- cancel = true;
- }
- goto("checkgame");
- @inv_close
- player_uuid = player.getUuid(player);
- if(list.contains(auto_close_list, player_uuid)) {
- list.add(auto_close_list_2, player_uuid);
- }
- if(amongus.isAlert()) {
- sabotage.closedInv(player);
- }
- if(reactor_sabotaged) {
- if(inv_id == inv.getId(reactor_inv_1)) {
- list.remove(reactor_hold_list_1, player_uuid);
- if(list.getSize(reactor_hold_list_1) == 0) {
- sabotage.holdReactor(reactor_inv_1, false);
- hold_reactor_1 = false;
- }
- goto("checkgame");
- }
- if(inv_id == inv.getId(reactor_inv_2)) {
- list.remove(reactor_hold_list_2, player_uuid);
- if(list.getSize(reactor_hold_list_2) == 0) {
- sabotage.holdReactor(reactor_inv_2, false);
- hold_reactor_2 = false;
- }
- goto("checkgame");
- }
- }
- title_string = string.text(inv_title);
- if(title_string == "§cFuel" || title_string == "§cEngine") {
- map.remove(fuel_counter, player_uuid);
- goto("checkgame");
- }
- if(title_string == "§cFix Wiring") {
- map.remove(wires_map, player_uuid);
- goto("checkgame");
- }
- if(title_string == "§cFix Communications") {
- map.remove(comms_inv_map, player_uuid);
- map.remove(comms_fix_map, player_uuid);
- goto("checkgame");
- }
- if(title_string == "§cClean O2 Filter") {
- map.remove(clean_o2_map, player_uuid);
- goto("checkgame");
- }
- if(title_string == "§cSubmit Scan") {
- list.add(submit_scan_list_2, player_uuid);
- sgoto(20, "unblock_submit_scan");
- goto("checkgame");
- }
- if(title_string == "§cCalibrate Distributor") {
- list.add(calibrate_dist_list_2, player_uuid);
- sgoto(7, "unblock_calib_dist");
- goto("checkgame");
- }
- if(title_string == "§cChart Course") {
- map.remove(chart_course_counter, player_uuid);
- map.remove(chart_course_pattern, player_uuid);
- goto("checkgame");
- }
- if(title_string == "§cEmpty Garbage") {
- list.add(empty_garb_list_2, player_uuid);
- sgoto(25, "unblock_empty_garb");
- goto("checkgame");
- }
- if(title_string == "§cClear Asteroids") {
- list.add(clear_ast_list_2, player_uuid);
- sgoto(5, "unblock_clear_ast");
- goto("checkgame");
- }
- if(title_string == "§cUnlock Manifolds") {
- map.remove(manifolds_counter, player_uuid);
- goto("checkgame");
- }
- if(title_string == "§cStart Reactor") {
- reactor_used = false;
- list.add(reactor_block_list, player_uuid);
- sgoto(20, "unblock_start_reactor");
- goto("checkgame");
- }
- if(title_string == "§cDownload Data" || title_string == "§cUpload Data") {
- list.add(download_list_2, player_uuid);
- sgoto(25, "unblock_download");
- }
- goto("checkgame");
- @snuvi_click
- item = inv.getItem(inv, inv_slot);
- item.removeFlag(item, "HIDE_DESTROYS");
- title_string = string.text(inv_title);
- if(title_string == "§cSABOTAGE") {
- //Keine Sabotagen während bestehender Sabotage möglich
- if(amongus.isAlert()) {
- msg.prefix(player, gamename, "A sabotage is already active.");
- goto("checkgame");
- }
- if(meeting) {
- msg.prefix(player, gamename, "Sabotage during meeting not possible.");
- goto("checkgame");
- }
- cooldown = data.getTimer(player, "Sabotage Cooldown");
- if(cooldown != null && cooldown != -1) {
- msg.prefix(player, gamename, string.concat("Remaining sabotage cooldown: ", string.number(math.roundDown(cooldown / 20)), "s"));
- goto("checkgame");
- }
- //sabotage light
- if(inv_slot == 0) {
- sabotage_light();
- goto("checkgame");
- }
- //sabotage reactor
- if(inv_slot == 1) {
- sabotage_reactor();
- goto("checkgame");
- }
- //sabotage oxygen
- if(inv_slot == 2) {
- sabotage_oxygen();
- goto("checkgame");
- }
- //sabotage communication
- if(inv_slot == 3) {
- sabotage_comms();
- goto("checkgame");
- }
- goto("checkgame");
- }
- if(title_string == "§cVOTE") {
- if(player.isGhost(player)) {
- goto("checkgame");
- }
- player_uuid = player.getUuid(player);
- if(map.contains(vote_count_map_2, player_uuid)) {
- goto("checkgame");
- }
- item_type = item.getType(item);
- if(item.custom.isType(item, return_green_mat) || item_type == player_head_mat && item.getType(inv.getItem(inv, inv_slot - 1)) != zombie_head_mat) {
- inv.setItem(inv, 2, black_glass);
- inv.setItem(inv, 3, black_glass);
- inv.setItem(inv, 7, black_glass);
- inv.setItem(inv, 8, black_glass);
- inv.setItem(inv, 11, black_glass);
- inv.setItem(inv, 12, black_glass);
- inv.setItem(inv, 16, black_glass);
- inv.setItem(inv, 17, black_glass);
- inv.setItem(inv, 20, black_glass);
- inv.setItem(inv, 21, black_glass);
- inv.setItem(inv, 25, black_glass);
- inv.setItem(inv, 26, black_glass);
- inv.setItem(inv, 29, black_glass);
- inv.setItem(inv, 30, black_glass);
- inv.setItem(inv, 34, black_glass);
- inv.setItem(inv, 35, black_glass);
- inv.setItem(inv, 38, black_glass);
- inv.setItem(inv, 39, black_glass);
- inv.setItem(inv, 43, black_glass);
- inv.setItem(inv, 44, black_glass);
- inv.setItem(inv, 47, black_glass);
- inv.setItem(inv, 48, black_glass);
- inv.setItem(inv, inv_slot + 1, item.custom.create("CHECK_GREEN", 1, "§rConfirm", null));
- inv.setItem(inv, inv_slot + 2, item.custom.create("CROSS_RED", 1, "§rCancel", null));
- goto("checkgame");
- }
- if(item.custom.isType(item, cross_red_mat)) {
- inv.setItem(inv, inv_slot, black_glass);
- inv.setItem(inv, inv_slot - 1, black_glass);
- goto("checkgame");
- }
- if(item.custom.isType(item, check_green_mat)) {
- if(item.getType(inv.getItem(inv, inv_slot - 2)) != zombie_head_mat) {
- vote_item = inv.getItem(inv, inv_slot - 1);
- if(item.custom.isType(vote_item, return_green_mat)) {
- map.add(vote_count_map, "skip", map.getOrDefault(vote_count_map, "skip", 0) + 1);
- map.add(vote_count_map_2, player_uuid, "skip");
- } else {
- vote_item_name = string.text(item.getName(vote_item));
- a = string.split(" ", vote_item_name);
- vote_name = a[2];
- vote_uuid = player.getUuid(string.removeFormat(vote_name));
- map.add(vote_count_map, vote_uuid, map.getOrDefault(vote_count_map, vote_uuid, 0) + 1);
- map.add(vote_count_map_2, player_uuid, vote_uuid);
- }
- inv.setItem(inv, inv_slot, black_glass);
- inv.setItem(inv, inv_slot + 1, black_glass);
- //Bei allen Spielern anzeigen, dass player gevoted hat
- index = list.getIndexOf(all_list, player_uuid);
- if(index % 2 == 0) {
- voted_slot = (index / 2) * 9;
- } else {
- voted_slot = ((index - 1) / 2) * 9 + 5;
- }
- voted_item = item.custom.create("CHECK_RED", 1, string.concat(amongus.getPlayerColorCode(player), player.getName(player), "§r has voted"), null);
- iter = iterator(player_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- inv = getVoteInv(p);
- inv.setItem(inv, voted_slot, voted_item);
- }
- sound.spawnForPlayer(player, vote_sound, master_sound_category);
- //Haben bereits alle gevoted?
- if(map.getSize(vote_count_map_2) == list.getSize(player_list) - list.getSize(ghosts)) {
- goto("score_evaluation");
- }
- }
- }
- goto("checkgame");
- }
- if(title_string == "§cENTER CODE") {
- //CODE eingeben
- if(item.isDigit(item)) {
- number = string.text(item.getName(item));
- for(i = 2; i < 7; i++) {
- if(item.getType(inv.getItem(inv, i)) == black_glass_mat) {
- break;
- }
- }
- if(i == 7) {
- goto("checkgame");
- }
- inv.setItem(inv, i, item);
- inv.setItem(inv, 7, black_glass);
- goto("checkgame");
- }
- //CODEEINGABE CANCELN
- if(inv_slot == 48) {
- for(i = 2; i < 7; i++) {
- inv.setItem(inv, i, black_glass);
- }
- goto("checkgame");
- }
- //CODE BESTÄTIGEN
- if(inv_slot == 50) {
- number = "";
- for(i = 2; i < 7; i++) {
- item = inv.getItem(inv, i);
- if(item.getType(item) == black_glass_mat) {
- for(h = 2; h < 7; h++) {
- inv.setItem(inv, h, black_glass);
- }
- goto("checkgame");
- }
- number = string.concat(number, string.text(item.getName(item)));
- }
- number = read.number(string.removeFormat(number));
- if(number == oxy_code) {
- player_uuid = player.getUuid(player);
- sgoto_auto_close_inv(player_uuid);
- inv.setItem(inv, 7, item.custom.create("CHECK_GREEN", 1, "§rCorrect code", null));
- loc = map.get(oxygen_map, player_uuid);
- if(loc == fix_o2_loc_1) {
- oxy_fixed_1 = true;
- removeSaboParticles(fix_o2_par_loc_1, null);
- if(oxy_fixed_2) {
- fix_oxygen();
- }
- } elseif(loc == fix_o2_loc_2) {
- oxy_fixed_2 = true;
- removeSaboParticles(fix_o2_par_loc_2, null);
- if(oxy_fixed_1) {
- fix_oxygen();
- }
- }
- } else {
- inv.setItem(inv, 7, item.custom.create("CROSS_RED", 1, "§rFalse code", null));
- for(i = 2; i < 7; i++) {
- inv.setItem(inv, i, black_glass);
- }
- }
- }
- goto("checkgame");
- }
- if(title_string == "§cAlign Engine") {
- task_id = 17;
- step = task.getStep(player, task_id);
- if(step == 2) {
- goto("checkgame");
- }
- player_uuid = player.getUuid(player);
- loc = map.get(align_engine_map_2, player_uuid);
- if(block_loc == ue_align_loc && set.contains(align_ue_engine_set, player_uuid)) {
- goto("checkgame");
- }
- if(block_loc == le_align_loc && set.contains(align_le_engine_set, player_uuid)) {
- goto("checkgame");
- }
- if(item.custom.isType(item, arrow_up_mat)) {
- temp = set_engine(player, inv, "up");
- } elseif(item.custom.isType(item, arrow_down_mat)) {
- temp = set_engine(player, inv, "down");
- } else {
- goto("checkgame");
- }
- if(temp) {
- if(loc == le_align_loc) {
- set.add(align_le_engine_set, player_uuid);
- removeTaskParticle(player, le_align_par_loc);
- } else {
- set.add(align_ue_engine_set, player_uuid);
- removeTaskParticle(player, ue_align_par_loc);
- }
- step = task.stepIncrease(player, task_id);
- giveTask(player, 17, "UE/LE", "Align Engine", step, 2, null);
- sgoto_auto_close_inv(player_uuid);
- }
- goto("checkgame");
- }
- if(title_string == "§cClean O2 Filter") {
- task_id = 15;
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- if(item.custom.isType(item, arrow_up_mat)) {
- old_slot = inv_slot + 9;
- } elseif(item.custom.isType(item, arrow_left_mat)) {
- old_slot = inv_slot + 1;
- } elseif(item.custom.isType(item, arrow_down_mat)) {
- old_slot = inv_slot - 9;
- } else {
- goto("checkgame");
- }
- inv.setItem(inv, inv_slot, item.create("oak_leaves", 1, null, null));
- inv.setItem(inv, old_slot, light_gray_glass);
- if(inv_slot == 18 || inv_slot == 27) {
- inv.setItem(inv, inv_slot, light_gray_glass);
- player_uuid = player.getUuid(player);
- c = map.getOrDefault(clean_o2_map, player_uuid, 0) + 1;
- map.add(clean_o2_map, player_uuid, c);
- if(c == 6) {
- removeTaskParticle(player, clean_o2_par_loc);
- step = task.stepIncrease(player, task_id);
- giveTask(player, 15, "O2", "Clean O2 Filter", 1, 1, null);
- sgoto_auto_close_inv(player_uuid);
- goto("checkgame");
- }
- }
- for(slot = 1; slot < 53; slot++) {
- if(item.getType(inv.getItem(inv, slot)) == oak_leaves_mat) {
- if(slot < 18) {
- a = inv.getItem(inv, slot + 9);
- b = inv.getItem(inv, slot - 1);
- if(item.custom.isType(a, arrow_down_mat) || item.custom.isType(b, arrow_left_mat)) {
- continue;
- }
- a_type = item.getType(a);
- if(a_type == light_gray_glass_mat) {
- inv.setItem(inv, slot + 9, item_arrow_down);
- continue;
- }
- }
- if(slot > 36) {
- a = inv.getItem(inv, slot - 9);
- b = inv.getItem(inv, slot - 1);
- if(item.custom.isType(a, arrow_up_mat) || item.custom.isType(b, arrow_left_mat)) {
- continue;
- }
- a_type = item.getType(a);
- if(a_type == light_gray_glass_mat) {
- inv.setItem(inv, slot - 9, item_arrow_up);
- continue;
- }
- }
- if(item.getType(inv.getItem(inv, slot - 1)) == light_gray_glass_mat) {
- inv.setItem(inv, slot - 1, item_arrow_left);
- }
- }
- }
- goto("checkgame");
- }
- if(title_string == "§cDivert Power") {
- task_id = 14;
- step = task.getStep(player, task_id);
- if(step == 2) {
- goto("checkgame");
- }
- item_type = item.getType(item);
- if(item_type == redstone_torch_mat) {
- if(step == 1) {
- goto("checkgame");
- }
- redstone = item.create("redstone", 1, null, null);
- inv.setItem(inv, 4, redstone);
- inv.setItem(inv, 13, redstone);
- inv.setItem(inv, inv_slot - 9, redstone);
- if(inv_slot < 40) {
- inv.setItem(inv, inv_slot - 17, redstone);
- if(inv_slot < 38) {
- inv.setItem(inv, inv_slot - 24, redstone);
- inv.setItem(inv, inv_slot - 25, redstone);
- }
- } elseif(inv_slot > 40) {
- inv.setItem(inv, inv_slot - 19, redstone);
- if(inv_slot > 42) {
- inv.setItem(inv, inv_slot - 29, redstone);
- inv.setItem(inv, inv_slot - 30, redstone);
- }
- } else {
- inv.setItem(inv, inv_slot - 18, redstone);
- }
- player_uuid = player.getUuid(player);
- removeTaskParticle(player, elec_power_par_loc);
- r = map.get(divert_pow_map_3, player_uuid);
- addTaskParticle(player, map.get(divert_pow_map_4, r));
- step = task.stepIncrease(player, task_id);
- giveTask(player, task_id, "[Room]", "Divert power to [Room]", step, 2, null);
- sgoto_auto_close_inv(player_uuid);
- goto("checkgame");
- }
- if(item_type == stone_button_mat) {
- redstone = item.create("redstone", 1, null, null);
- inv.setItem(inv, 8, redstone);
- inv.setItem(inv, 15, redstone);
- inv.setItem(inv, 16, redstone);
- inv.setItem(inv, 23, redstone);
- inv.setItem(inv, 26, redstone);
- inv.setItem(inv, 32, redstone);
- inv.setItem(inv, 33, redstone);
- inv.setItem(inv, 34, redstone);
- inv.setItem(inv, 41, redstone);
- inv.setItem(inv, 44, redstone);
- inv.setItem(inv, 51, redstone);
- inv.setItem(inv, 52, redstone);
- player_uuid = player.getUuid(player);
- r = map.get(divert_pow_map_3, player_uuid);
- removeTaskParticle(player, map.get(divert_pow_map_4, r));
- step = task.stepIncrease(player, task_id);
- giveTask(player, task_id, "[Room]", "Divert power to [Room]", step, 2, null);
- sgoto_auto_close_inv(player.getUuid(player));
- }
- goto("checkgame");
- }
- if(title_string == "§cClear Asteroids") {
- task_id = 13;
- step = task.getStep(player, task_id);
- if(step == 20) {
- goto("checkgame");
- }
- if(item == asteroid_item) {
- inv.setItem(inv, inv_slot, black_glass);
- player_uuid = player.getUuid(player);
- my_list = map.get(clear_ast_map, player_uuid);
- iter = iterator(my_list);
- while(hasNext(iter)) {
- a = next(iter);
- slot = a[1];
- if(slot == inv_slot) {
- step = task.stepIncrease(player, task_id);
- giveTask(player, 13, "WEA", "Clear Asteroids", step, 20, null);
- if(step == 20) {
- removeTaskParticle(player, clear_ast_par_loc);
- sgoto_auto_close_inv(player_uuid);
- list.add(clear_ast_list_3, player_uuid);
- break;
- }
- remove(iter);
- continue;
- }
- }
- }
- goto("checkgame");
- }
- if(title_string == "§cEmpty Garbage") {
- task_id = 12;
- step = task.getStep(player, task_id);
- if(step == 2) {
- goto("checkgame");
- }
- if(item.custom.isType(item, arrow_down_mat)) {
- inv.setItem(inv, inv_slot, black_glass);
- player_uuid = player.getUuid(player);
- list.add(empty_garb_list, player_uuid);
- map.add(empty_garb_map, player_uuid, 0);
- map.add(empty_garb_map_2, player_uuid, inv);
- sgoto(20, "empty_garb");
- }
- goto("checkgame");
- }
- if(title_string == "§cSwipe Card") {
- task_id = 11;
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- if(inv_slot == 11 || (item.getType(item) == light_gray_glass_mat && item.getType(inv.getItem(inv, inv_slot - 1)) == lime_glass_mat)) {
- player_uuid = player.getUuid(player);
- if(inv_slot == 11) {
- map.add(swipe_card_map, player_uuid, time.getMillis());
- }
- inv.setItem(inv, inv_slot, lime_glass);
- if(inv_slot == 15) {
- start_time = map.get(swipe_card_map, player_uuid);
- time = (time.getMillis() - start_time) / 1000;
- if(time < 1.8) {
- inv.setItem(inv, 16, item.custom.create("CROSS_RED", 1, string.concat("§rToo fast ", math.roundComma(time, 1), "s"), null));
- for(i = 11; i < 16; i++) {
- inv.setItem(inv, i, light_gray_glass);
- }
- } elseif(time > 2.2) {
- inv.setItem(inv, 16, item.custom.create("CROSS_RED", 1, string.concat("§rToo slow ", math.roundComma(time, 1), "s"), null));
- for(i = 11; i < 16; i++) {
- inv.setItem(inv, i, light_gray_glass);
- }
- } else {
- removeTaskParticle(player, swipe_card_par_loc);
- inv.setItem(inv, 16, item.custom.create("CHECK_GREEN", 1, "§rTask completed", null));
- step = task.stepIncrease(player, task_id);
- giveTask(player, 11, "ADM", "Swipe Card", 1, 1, null);
- sgoto_auto_close_inv(player_uuid);
- }
- }
- }
- goto("checkgame");
- }
- if(title_string == "§cFix Wiring") {
- task_id = 10;
- step = task.getStep(player, task_id);
- if(step == 3) {
- goto("checkgame");
- }
- player_uuid = player.getUuid(player);
- if(inv_slot == 11 || inv_slot == 20 || inv_slot == 29 || inv_slot == 38) {
- map.add(wires_map_2, player_uuid, inv_slot);
- }
- if(inv_slot == 15 || inv_slot == 24 || inv_slot == 33 || inv_slot == 42) {
- slot = map.get(wires_map_2, player_uuid);
- if(slot == null) {
- goto("checkgame");
- }
- map.remove(wires_map_2, player_uuid);
- if(inv.getItem(inv, slot) == item && item.custom.isType(inv.getItem(inv, inv_slot - 1), cross_red_mat)) {
- inv.setItem(inv, slot + 1, item.custom.create("CHECK_GREEN", 1, "§rConnected", null));
- inv.setItem(inv, inv_slot - 1, item.custom.create("CHECK_GREEN", 1, "§rConnected", null));
- c = map.getOrDefault(wires_map, player_uuid, 0) + 1;
- map.add(wires_map, player_uuid, c);
- if(c == 4) {
- map.remove(wires_map, player_uuid);
- step = task.stepIncrease(player, task_id);
- giveTask(player, 10, "CAF", "Fix Wiring", step, 3, null);
- sgoto_auto_close_inv(player_uuid);
- }
- }
- }
- goto("checkgame");
- }
- if(title_string == "§cCalibrate Distributor") {
- task_id = 9;
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- if(inv_slot == 44) {
- player_uuid = player.getUuid(player);
- a = map.get(calibrate_dist_map, player_uuid);
- if(inv.getItem(inv, 33) == inv.getItem(inv, 34)) {
- stage = a[4] + 1;
- a[4] = stage;
- if(stage == 1) {
- inv.setItem(inv, 3, item.custom.create("CHECK_GREEN", 1, null, null));
- inv.setItem(inv, 34, blue_glass);
- inv.setItem(inv, 35, blue_glass);
- } elseif(stage == 2) {
- inv.setItem(inv, 4, item.custom.create("CHECK_GREEN", 1, null, null));
- inv.setItem(inv, 34, cyan_glass);
- inv.setItem(inv, 35, cyan_glass);
- } elseif(stage == 3) {
- removeTaskParticle(player, calibrate_dist_par_loc);
- inv.setItem(inv, 5, item.custom.create("CHECK_GREEN", 1, null, null));
- step = task.stepIncrease(player, task_id);
- giveTask(player, 9, "ELE", "Calibrate Distributor", 1, 1, null);
- sgoto_auto_close_inv(player_uuid);
- }
- } else {
- a[4] = 0;
- inv.setItem(inv, 3, item.custom.create("CROSS_RED", 1, null, null));
- inv.setItem(inv, 4, item.custom.create("CROSS_RED", 1, null, null));
- inv.setItem(inv, 5, item.custom.create("CROSS_RED", 1, null, null));
- inv.setItem(inv, 34, yellow_glass);
- inv.setItem(inv, 35, yellow_glass);
- }
- a[3] = a[2]; //Index = Start_index
- map.add(calibrate_dist_map, player_uuid, a);
- for(h = 0; h < 12; h++) {
- inv.setItem(inv, calibrate_dist_array[h], black_glass);
- }
- }
- goto("checkgame");
- }
- if(title_string == "§cInspect Sample") {
- task_id = 8;
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- item_type = item.getType(item);
- if(item_type == green_glass_mat) {
- if(inv_slot == 53) {
- inv.setItem(inv, 53, item.create("gray_stained_glass_pane", 59, "§rGo grab a coffee", null));
- giveTask(player, 8, "MED", "Inspect Sample", 0, 1, 59);
- player_uuid = player.getUuid(player);
- list.add(sample_list, player_uuid);
- list.add(sample_list_2, 59);
- map.add(sample_map, player_uuid, inv);
- sgoto(20, "countdown_sample");
- goto("checkgame");
- }
- if(inv_slot >= 36) {
- if(item.getType(inv.getItem(inv, inv_slot - 18)) == red_glass_mat) {
- removeTaskParticle(player, inspect_par_loc);
- step = task.stepIncrease(player, task_id);
- giveTask(player, 8, "MED", "Inspect Sample", 1, 1, null);
- sgoto_auto_close_inv(player.getUuid(player));
- } else {
- h = 0;
- for(i = 0; i < 3; i++) {
- inv.setItem(inv, 0 + h, sample);
- inv.setItem(inv, 2 + h, sample);
- inv.setItem(inv, 4 + h, sample);
- inv.setItem(inv, 6 + h, sample);
- inv.setItem(inv, 8 + h, sample);
- h += 9;
- }
- select_sample = item.create("gray_stained_glass_pane", 1, "§rSelect sample", null);
- inv.setItem(inv, 36, select_sample);
- inv.setItem(inv, 38, select_sample);
- inv.setItem(inv, 40, select_sample);
- inv.setItem(inv, 42, select_sample);
- inv.setItem(inv, 44, select_sample);
- inv.setItem(inv, 53, item.create("green_stained_glass_pane", 1, "§rPress to start", null));
- giveTask(player, 8, "MED", "Inspect Sample", 0, 1, null);
- }
- }
- }
- goto("checkgame");
- }
- if(title_string == "§cStabilize Steering") {
- task_id = 7;
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- new_cross_slot = inv_slot;
- if(item.custom.isType(item, arrow_down_mat)) {
- cross_slot = inv_slot - 9;
- if(cross_slot == 22) {
- new_cross_slot = cross_slot;
- cross_slot -= 9;
- }
- } elseif(item.custom.isType(item, arrow_up_mat)) {
- cross_slot = inv_slot + 9;
- if(cross_slot == 22) {
- new_cross_slot = cross_slot;
- cross_slot += 9;
- }
- } elseif(item.custom.isType(item, arrow_left_mat)) {
- cross_slot = inv_slot + 1;
- if(cross_slot == 22) {
- new_cross_slot = cross_slot;
- cross_slot++;
- }
- } elseif(item.custom.isType(item, arrow_right_mat)) {
- cross_slot = inv_slot - 1;
- if(cross_slot == 22) {
- new_cross_slot = cross_slot;
- cross_slot--;
- }
- } else {
- goto("checkgame");
- }
- //remove old plus
- if(cross_slot != 22) {
- inv.setItem(inv, cross_slot, light_gray_glass);
- }
- temp_slot = cross_slot - 1;
- if(temp_slot == 22) {
- temp_slot--;
- }
- if(temp_slot >= 0 && cross_slot % 9 != 0) {
- inv.setItem(inv, temp_slot, light_gray_glass);
- }
- temp_slot = cross_slot + 1;
- if(temp_slot == 22) {
- temp_slot++;
- }
- if(temp_slot >= 0 && temp_slot % 9 != 0) {
- inv.setItem(inv, temp_slot, light_gray_glass);
- }
- temp_slot = cross_slot - 9;
- if(temp_slot == 22) {
- temp_slot -= 9;
- }
- if(temp_slot >= 0) {
- inv.setItem(inv, temp_slot, light_gray_glass);
- }
- temp_slot = cross_slot + 9;
- if(temp_slot == 22) {
- temp_slot += 9;
- }
- if(temp_slot < 45) {
- inv.setItem(inv, temp_slot, light_gray_glass);
- }
- //set new plus
- inv.setItem(inv, new_cross_slot, item.custom.create("PLUS_RED", 1, null, null));
- temp_slot = new_cross_slot - 1;
- if(temp_slot == 22) {
- inv.setItem(inv, temp_slot - 1, item_arrow_left);
- } else {
- if(temp_slot >= 0 && new_cross_slot % 9 != 0) {
- inv.setItem(inv, temp_slot, item_arrow_left);
- }
- }
- temp_slot = new_cross_slot + 1;
- if(temp_slot == 22) {
- inv.setItem(inv, temp_slot + 1, item_arrow_right);
- } else {
- if(temp_slot >= 0 && temp_slot % 9 != 0) {
- inv.setItem(inv, temp_slot, item_arrow_right);
- }
- }
- temp_slot = new_cross_slot - 9;
- if(temp_slot == 22) {
- inv.setItem(inv, temp_slot - 9, item_arrow_up);
- } else {
- if(temp_slot >= 0) {
- inv.setItem(inv, temp_slot, item_arrow_up);
- }
- }
- temp_slot = new_cross_slot + 9;
- if(temp_slot == 22) {
- inv.setItem(inv, temp_slot + 9, item_arrow_down);
- } else {
- if(temp_slot < 45) {
- inv.setItem(inv, temp_slot, item_arrow_down);
- }
- }
- //finish task
- if(new_cross_slot == 22) {
- removeTaskParticle(player, steering_par_loc);
- inv.setItem(inv, 44, item.custom.create("CHECK_GREEN", 1, "§rTask completed", null));
- step = task.stepIncrease(player, task_id);
- giveTask(player, task_id, "NAV", "Stabilize Steering", 1, 1, null);
- sgoto_auto_close_inv(player.getUuid(player));
- }
- goto("checkgame");
- }
- if(title_string == "§cChart Course") {
- task_id = 6;
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- player_uuid = player.getUuid(player);
- a = map.get(chart_course_pattern, player_uuid);
- c = map.getOrDefault(chart_course_counter, player_uuid, 0);
- if(a[c] == inv_slot) {
- inv.setItem(inv, inv_slot, green_glass);
- map.add(chart_course_counter, player_uuid, c + 1);
- if(c == 8) {
- inv.setItem(inv, 53, item.custom.create("CHECK_GREEN", 1, "§rTask completed", null));
- removeTaskParticle(player, chart_course_par_loc);
- step = task.stepIncrease(player, task_id);
- giveTask(player, task_id, "NAV", "Chart Course", 1, 1, null);
- sgoto_auto_close_inv(player_uuid);
- }
- }
- goto("checkgame");
- }
- if(title_string == "§cUnlock Manifolds") {
- task_id = 5;
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- item_type = item.getType(item);
- if(item_type == blue_glass_mat) {
- player_uuid = player.getUuid(player);
- amount = map.getOrDefault(manifolds_counter, player_uuid, 1);
- if(amount == item.getAmount(item)) {
- inv.setItem(inv, inv_slot, item.create("GREEN_STAINED_GLASS_PANE", amount, null, null));
- map.add(manifolds_counter, player_uuid, amount + 1);
- if(amount == 10) {
- removeTaskParticle(player, unlock_manifolds_par_loc);
- step = task.stepIncrease(player, task_id);
- giveTask(player, task_id, "REA", "Unlock Manifolds", 1, 1, null);
- sgoto_auto_close_inv(player_uuid);
- }
- goto("checkgame");
- }
- goto("false_manifolds_click");
- }
- if(item_type == green_glass_mat) {
- goto("false_manifolds_click");
- }
- goto("checkgame");
- }
- if(title_string == "§cStart Reactor") {
- task_id = 4;
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- if(!(inv_slot > 22 && inv_slot < 26 || inv_slot > 31 && inv_slot < 35 || inv_slot > 40 && inv_slot < 44)) {
- goto("checkgame");
- }
- player_uuid = player.getUuid(player);
- item_type = item.getType(item);
- if(item_type == red_glass_mat) {
- goto("checkgame");
- }
- if(item_type == black_glass_mat) {
- goto("false_reactor_click");
- }
- if(reactor.getPhase(reactor_array) == "draw") {
- goto("false_reactor_click");
- }
- reactor_array = reactor.get(player);
- stage = reactor.getStage(reactor_array);
- counter = reactor.getCounter(reactor_array);
- pattern = reactor.getPattern(reactor_array);
- if(inv_slot - 4 != pattern[counter]) {
- goto("false_reactor_click");
- }
- inv.setItem(inv, inv_slot, blue_glass);
- list.add(reset_reactor_click_list, player_uuid);
- list.add(reset_reactor_click_list_2, inv_slot);
- sgoto(10, "reset_reactor_click");
- if(counter == stage && stage < 5) {
- stage++;
- reactor.setStage(reactor_array, stage);
- reactor.setCounter(reactor_array, 0);
- reactor.setPhase(reactor_array, "draw");
- reactor.save(reactor_array, player);
- if(stage == 5) {
- removeTaskParticle(player, start_reactor_par_loc);
- step = task.stepIncrease(player, task_id);
- giveTask(player, task_id, "REA", "Start Reactor", 1, 1, null);
- sgoto_auto_close_inv(player_uuid);
- reactor_used = false;
- goto("checkgame");
- }
- list.add(reactor_draw_list_1, player_uuid);
- sgoto(20, "draw_pattern_1");
- goto("checkgame");
- }
- reactor.setCounter(reactor_array, ++counter);
- reactor.save(reactor_array, player);
- goto("checkgame");
- }
- if(title_string == "§cPrime Shields") {
- task_id = 3;
- step = task.getStep(player, task_id);
- if(step == 1) {
- goto("checkgame");
- }
- if(item == green_glass) {
- inv.setItem(inv, inv_slot, red_glass);
- goto("checkgame");
- }
- if(item == red_glass) {
- inv.setItem(inv, inv_slot, green_glass);
- for(i = 9; i < 42; i++) {
- if(item.getType(inv.getItem(inv, i)) == red_glass_mat) {
- goto("checkgame");
- }
- }
- removeTaskParticle(player, prime_shields_par_loc);
- step = task.stepIncrease(player, task_id);
- giveTask(player, task_id, "SHI", "Prime Shields", 1, 1, null);
- sgoto_auto_close_inv(player.getUuid(player));
- }
- goto("checkgame");
- }
- inv_id = inv.getId(inv);
- if(inv_id == inv.getId(reactor_inv_1)) {
- if(reactor_sabotaged) {
- sabotage.holdReactor(reactor_inv_1, true);
- hold_reactor_1 = true;
- if(hold_reactor_2) {
- fix_meltdown();
- }
- }
- goto("checkgame");
- }
- if(inv_id == inv.getId(reactor_inv_2)) {
- if(reactor_sabotaged) {
- sabotage.holdReactor(reactor_inv_2, true);
- hold_reactor_2 = true;
- if(hold_reactor_1) {
- fix_meltdown();
- }
- }
- goto("checkgame");
- }
- if(title_string == "§cFix Communications") {
- if(!comms_sabotaged) {
- goto("checkgame");
- }
- if(inv_slot == 48) {
- comms_freq = item.getAmount(inv.getItem(inv, 49)) - 1;
- } elseif(inv_slot == 50) {
- comms_freq = item.getAmount(inv.getItem(inv, 49)) + 1;
- } else {
- goto("checkgame");
- }
- if(comms_freq < 1 || comms_freq > 64) {
- goto("checkgame");
- }
- inv.setItem(inv, 49, item.create("BLACK_STAINED_GLASS_PANE", comms_freq, null, null));
- player_uuid = player.getUuid(player);
- comms_state = map.get(comms_state_map, player_uuid);
- diff = math.abs(comms_freq - comms_fix_freq);
- if(diff == 0) {
- if(comms_state != 2) {
- comms.drawCorrect(inv, player);
- }
- list.add(comms_fix_list, player_uuid);
- map.add(comms_fix_map, player_uuid, time.getMillis());
- sgoto(40, "scheduled_fix_comms");
- goto("checkgame");
- } elseif(diff < 4) {
- if(comms_state != 1) {
- comms.drawClose(inv, player);
- }
- map.remove(comms_fix_map, player_uuid);
- } else {
- if(comms_state != 0) {
- comms.drawWorst(inv, player);
- }
- map.remove(comms_fix_map, player_uuid);
- }
- goto("checkgame");
- }
- if(title_string == "§cFix Lights") {
- if(!lights_sabotaged) {
- goto("checkgame");
- }
- item_type = item.getType(item);
- if(item_type == red_glass_mat) {
- inv.setItem(lights_inv, inv_slot, item.create("GREEN_STAINED_GLASS_PANE", 1, "§fOn", null));
- c = 0;
- for(i = 0; i < 9; i+=2) {
- if(item.getType(inv.getitem(lights_inv, i)) == green_glass_mat) {
- c++;
- }
- }
- if(c == 5) {
- fix_light();
- }
- goto("checkgame");
- }
- if(item_type == green_glass_mat) {
- inv.setItem(lights_inv, inv_slot, item.create("RED_STAINED_GLASS_PANE", 1, "§fOff", null));
- }
- goto("checkgame");
- }
- if(title_string == "§cDownload Data") {
- if(item.custom.isType(item, arrow_down_mat)) {
- inv.setItem(inv, 22, gray_glass);
- goto("download_data_2");
- }
- goto("checkgame");
- }
- if(title_string == "§cUpload Data") {
- if(item.custom.isType(item, arrow_up_mat)) {
- inv.setItem(inv, 22, gray_glass);
- goto("download_data_2");
- }
- goto("checkgame");
- }
- if(title_string == "§cFuel") {
- task_id = 1;
- step = task.getStep(player, task_id);
- if(step == 1 || step == 3 || step == 4) {
- goto("checkgame");
- }
- if(item.custom.isType(item, arrow_down_mat)) {
- player_uuid = player.getUuid(player);
- c = map.getOrDefault(fuel_counter, player_uuid, 0);
- if((c + 2) % 9 == 0) {
- c += 2;
- }
- inv.setItem(inv, c++, light_gray_glass);
- map.add(fuel_counter, player_uuid, c);
- if(c == 52) {
- step = task.stepIncrease(player, task_id);
- map.remove(fuel_counter, player_uuid);
- removeTaskParticle(player, get_fuel_par_loc);
- if(step == 1) {
- addTaskParticle(player, upper_engine_par_loc);
- giveTask(player, task_id, "UE", "Fuel Engines", 1, 4, null);
- sgoto_auto_close_inv(player_uuid);
- } elseif(step == 3) {
- addTaskParticle(player, lower_engine_par_loc);
- giveTask(player, task_id, "LE", "Fuel Engines", 3, 4, null);
- sgoto_auto_close_inv(player_uuid);
- }
- }
- }
- goto("checkgame");
- }
- if(title_string == "§cEngine") {
- task_id = 1;
- step = task.getStep(player, task_id);
- if(step == 0 || step == 2 || step == 4) {
- goto("checkgame");
- }
- if(item.custom.isType(item, arrow_up_mat)) {
- player_uuid = player.getUuid(player);
- c = map.getOrDefault(fuel_counter, player_uuid, 51);
- if((c + 1) % 9 == 0) {
- c -= 2;
- }
- inv.setItem(inv, c--, lime_terra_item);
- map.add(fuel_counter, player_uuid, c);
- if(c == -1) {
- map.remove(fuel_counter, player_uuid);
- if(step == 1) {
- removeTaskParticle(player, upper_engine_par_loc);
- addTaskParticle(player, get_fuel_par_loc);
- giveTask(player, task_id, "STO", "Fuel Engines", 2, 4, null);
- sgoto_auto_close_inv(player_uuid);
- } elseif(step == 3) {
- removeTaskParticle(player, lower_engine_par_loc);
- giveTask(player, task_id, "LE", "Fuel Engines", 4, 4, null);
- sgoto_auto_close_inv(player_uuid);
- }
- step = task.stepIncrease(player, task_id);
- }
- }
- goto("checkgame");
- }
- goto("checkgame");
- @score_evaluation
- sort_array = map.sort(vote_count_map, false);
- //Ausgabe der Votes
- minigame.speakAll(gamename, "§0------------------------");
- sort_array_size = array.getSize(sort_array);
- for(i = 0; i < sort_array_size; i++) {
- p_uuid = sort_array[i, 0];
- value = sort_array[i, 1];
- if(p_uuid == "skip") {
- minigame.speakAll(gamename, string.concat("Skipped: ", string.number(value)));
- } else {
- minigame.speakAll(gamename, string.concat(amongus.getPlayerColorCode(p_uuid), player.getName(p_uuid), "§r ", string.number(value)));
- }
- }
- //Auswertung der Votes
- if(sort_array_size == 0) {
- message = "Nobody voted (Skipped).";
- minigame.speakAll(gamename, message);
- minigame.titleAll("Voting ended", message, 20, 60, 20);
- continueGame();
- goto("checkgame");
- } elseif(sort_array_size == 1) {
- kick_uuid = sort_array[0, 0];
- } else {
- value_0 = sort_array[0, 1];
- value_1 = sort_array[1, 1];
- if(value_0 > value_1) {
- kick_uuid = sort_array[0, 0];
- } else {
- message = "No one ejected (Tie).";
- minigame.speakAll(gamename, message);
- minigame.titleAll("Voting ended", message, 20, 60, 20);
- continueGame();
- goto("checkgame");
- }
- }
- if(kick_uuid == "skip") {
- message = "No one ejected (Skipped).";
- minigame.speakAll(gamename, message);
- minigame.titleAll("Voting ended", message, 20, 60, 20);
- continueGame();
- goto("checkgame");
- }
- //Vollstreckung
- if(confirm_ejects) {
- if(isImpostor(kick_uuid)) {
- message = "§r was an §cimpostor§r.";
- } else {
- message = "§r was a §bcrewmate§r.";
- }
- } else {
- message = "§r was ejected.";
- }
- message = string.concat(amongus.getPlayerColorCode(kick_uuid), player.getName(kick_uuid), message);
- minigame.speakAll(gamename, message);
- list.add(ghosts, kick_uuid);
- list.remove(impostors_list_3, kick_uuid);
- kick_player = player.get(kick_uuid);
- player.hideOnline(kick_player);
- amongus.removeEquip(kick_player);
- minigame.titleAll("Voting ended", message, 20, 60, 20);
- //Checkwin
- imps_alive = 0;
- crew_alive = 0;
- iter = iterator(player_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- if(!player.isGhost(p)) {
- if(isImpostor(p)) {
- imps_alive++;
- } else {
- crew_alive++;
- }
- }
- }
- boss.removeAll(meeting_bar);
- if(imps_alive == 0) {
- winners = "§bCrewmates";
- goto("win");
- }
- if(imps_alive >= crew_alive) {
- winners = "§cImpostors";
- goto("win");
- }
- continueGame();
- goto("checkgame");
- @player_quit
- @player_giveup
- minigame.speakAll(gamename, string.concat(amongus.getPlayerColorCode(player), player.getName(player), " §rhas left the game."));
- player.setGamemode(player, "SURVIVAL");
- boss.removePlayer(progress_bar, player);
- boss.removePlayer(meeting_bar, player);
- boss.removePlayer(sabotage_cooldown_bar, player);
- my_kill_bar = map.get(imp_kill_bars, player.getUuid(player));
- if(my_kill_bar != null) {
- boss.removePlayer(my_kill_bar, player);
- }
- script = script.getFromId(script_id);
- minigame.kickplayer(script, player);
- player.gameMute(player, false);
- player.showOnline(player);
- living.setInvisible(player, false);
- if(isImpostor(player)) {
- list.remove(impostors_list_2, player_uuid);
- list.remove(impostors_list_3, player_uuid);
- }
- //Building-Perms wieder geben
- player_uuid = player.getUuid(player);
- if(list.contains(removed_perms, player_uuid)) {
- list.remove(removed_perms, player_uuid);
- //PERMS perm.registerPlayer(player_uuid, 1);
- //PERMS perm.registerPlayer(player_uuid, 15);
- }
- if(freeplay) {
- removeDeadBodies();
- removeCamBodies();
- minigame.kickAllPlayers(script);
- minigame.term(script, gamesignloc);
- term();
- }
- //checkwin
- imps_alive = 0;
- crew_alive = 0;
- iter = iterator(player_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- if(!player.isGhost(p)) {
- if(isImpostor(p)) {
- imps_alive++;
- } else {
- crew_alive++;
- }
- }
- }
- if(imps_alive == 0) {
- winners = "§bCrewmates";
- goto("win");
- }
- if(imps_alive >= crew_alive) {
- winners = "§cImpostors";
- goto("win");
- }
- if(!player.isGhost(player)) {
- amongus.removeFromAdminTable(player);
- }
- amount_all_tasks = (amount_short + amount_common + amount_long) * crew_alive;
- pct = amount_done_tasks / amount_all_tasks;
- boss.setProgress(progress_bar, pct);
- if(meeting) {
- //Vote des leavenden Spielers entfernen
- vote_uuid = map.get(vote_count_map_2, player_uuid);
- if(vote_uuid != null) {
- votes = map.get(vote_count_map, vote_uuid) - 1;
- if(votes == 0) {
- map.remove(vote_count_map, vote_uuid);
- } else {
- map.add(vote_count_map, vote_uuid, votes);
- }
- map.remove(vote_count_map_2, player_uuid);
- }
- //Alle Votes entfernen, die auf den leavenden Spieler lauten
- iter = map.iterator(vote_count_map_2);
- while(hasNext(iter)) {
- element = next(iter);
- vote_uuid = map.getValue(element);
- if(vote_uuid == player_uuid) {
- //Spieler neu voten lassen
- voter_uuid = map.getKey(element);
- remove(iter);
- map.remove(vote_count_map_2, voter_uuid);
- //Vote-Menu aktualisieren
- index = list.getIndexOf(all_list, voter_uuid);
- voted_slot = index * 4;
- setItemInVoteInv(voted_slot, air_item);
- }
- }
- //Vote-Menu aktualisieren
- index = list.getIndexOf(all_list, player_uuid);
- voted_slot = index * 4;
- setItemInVoteInv(voted_slot, zombie_head);
- }
- goto("checkgame");
- @player_data_tick
- if(var == "Discussion Time") {
- player.giveItem(player, open_vote_menu_item);
- tick_time = vote_time * 20; //s
- boss.setTitle(meeting_bar, "Voting Time");
- updateMeetingBar(vote_time, false);
- data.setTimer(player, "Voting Time", tick_time - 20);
- vote_inv = getVoteInv(player);
- inv.open(vote_inv, player);
- data.setTimer(player, "sound.vote.end.10", tick_time - 200);
- data.setTimer(player, "sound.vote.end.5", tick_time - 100);
- data.setTimer(player, "sound.vote.end.4", tick_time - 80);
- data.setTimer(player, "sound.vote.end.3", tick_time - 60);
- data.setTimer(player, "sound.vote.end.2", tick_time - 40);
- data.setTimer(player, "sound.vote.end.1", tick_time - 20);
- goto("checkgame");
- }
- if(!meeting) {
- goto("checkgame");
- }
- if(var == "Voting Time") {
- boss.removeAll(meeting_bar);
- goto("score_evaluation");
- }
- if(var == "sound.vote.end.10") {
- sound.spawnForPlayer(player, vote_ends_sound, master_sound_category);
- goto("checkgame");
- }
- if(var == "sound.vote.end.5") {
- sound.spawnForPlayer(player, vote_ends_sound, master_sound_category);
- goto("checkgame");
- }
- if(var == "sound.vote.end.4") {
- sound.spawnForPlayer(player, vote_ends_sound, master_sound_category);
- goto("checkgame");
- }
- if(var == "sound.vote.end.3") {
- sound.spawnForPlayer(player, vote_ends_sound, master_sound_category);
- goto("checkgame");
- }
- if(var == "sound.vote.end.2") {
- sound.spawnForPlayer(player, vote_ends_sound, master_sound_category);
- goto("checkgame");
- }
- if(var == "sound.vote.end.1") {
- sound.spawnForPlayer(player, vote_ends_sound, master_sound_category);
- goto("checkgame");
- }
- goto("checkgame");
- @player_drop
- cancel = true;
- goto("checkgame");
- function getInvSlotFromItem(player, item) {
- inv = player.getInv(player);
- for(i = 0; i < inv.getSize(inv); i++) {
- if(item == inv.getItem(inv, i)) {
- return i;
- }
- }
- return -1;
- }
- function giveCrewmateItems(player) {
- //nothing
- }
- function removeImpostorItems(player) {
- player.removeItem(player, $kill_item);
- player.removeItem(player, $sabotage_item);
- }
- function giveImpostorItems(player) {
- player.giveItem(player, $kill_item);
- player.giveItem(player, $sabotage_item);
- }
- function giveSpeedrunnerItems(player) {
- //nothing
- }
- function setSpeedrunner(player) {
- player_uuid = player.getUuid(player);
- map.add($roles, player_uuid, "speedrunner");
- msg.prefix(player, $gamename, "You are §dSpeedrunner!");
- giveSpeedrunnerItems(player);
- sb.add(player, 99, "You are §dSpeedrunner");
- }
- function setImpostor(player) {
- data.setTimer(player, "Kill Cooldown", $start_kill_cooldown * 20);
- player_uuid = player.getUuid(player);
- map.add($roles, player_uuid, "impostor");
- my_kill_bar = createKillBossBar(player);
- updateKillBossBar(my_kill_bar, $start_kill_cooldown);
- list.add($impostors_list, player_uuid);
- list.add($impostors_list_2, player_uuid);
- list.add($impostors_list_3, player_uuid);
- msg.prefix(player, $gamename, "You are §cImpostor!");
- giveImpostorItems(player);
- sb.add(player, 99, "You are §cImpostor");
- sb.add(player, 98, "§cFake Tasks:");
- }
- function createKillBossBar(player) {
- player_uuid = player.getUuid(player);
- my_kill_bar = boss.create("Kill Cooldown", "PURPLE", "SOLID");
- boss.setProgress(my_kill_bar, 0);
- boss.addPlayer(my_kill_bar, player);
- map.add($imp_kill_bars, player_uuid, my_kill_bar);
- return my_kill_bar;
- }
- function updateKillBossBar(bar, time) {
- if(time < 0) {
- time = 0;
- boss.setProgress(bar, 1);
- boss.setTitle(bar, string.concat("Kill Cooldown: 0"));
- return;
- }
- boss.setProgress(bar, ($kill_cooldown - time) / $kill_cooldown);
- boss.setTitle(bar, string.concat("Kill Cooldown: ", string.number(math.roundDown(time))));
- }
- function updateSabotageCooldownBar(time) {
- if(time < 0) {
- time = 0;
- boss.setProgress($sabotage_cooldown_bar, 1);
- boss.setTitle($sabotage_cooldown_bar, string.concat("Sabotage Cooldown: 0"));
- return;
- }
- boss.setProgress($sabotage_cooldown_bar, ($default_sabo_cooldown - time) / $default_sabo_cooldown);
- boss.setTitle($sabotage_cooldown_bar, string.concat("Sabotage Cooldown: ", string.number(math.roundDown(time))));
- }
- function updateMeetingBar(time, discussion) {
- if(time < 0) {
- time = 0;
- return;
- }
- if(discussion) {
- progress = time / $discuss_time;
- pre_title = "Discussion Time";
- } else {
- progress = time / $vote_time;
- pre_title = "Voting Time";
-
- }
- boss.setTitle($meeting_bar, string.concat(pre_title, ": ", string.number(math.roundDown(time))));
- boss.setProgress($meeting_bar, progress);
- }
- function setCrewmate(player) {
- map.add($roles, player.getUuid(player), "crewmate");
- msg.prefix(player, $gamename, "You are §bCrewmate.");
- giveCrewmateItems(player);
- sb.add(player, 99, "You are §bCrewmate");
- }
- function isSpeedrunner(player_or_uuid) {
- if(isPlayer(player_or_uuid)) {
- player_or_uuid = player.getUuid(player_or_uuid);
- }
- role = map.get($roles, player_or_uuid);
- return role == "impostor";
- }
- function isImpostor(player_or_uuid) {
- if(isPlayer(player_or_uuid)) {
- player_or_uuid = player.getUuid(player_or_uuid);
- }
- role = map.get($roles, player_or_uuid);
- return role == "impostor";
- }
- function isCrewmate(player_or_uuid) {
- if(isPlayer(player_or_uuid)) {
- player_or_uuid = player.getUuid(player_or_uuid);
- }
- role = map.get($roles, player_or_uuid);
- return role == "crewmate";
- }
- function player.isGhost(player_or_uuid) {
- if(isPlayer(player_or_uuid)) {
- player_or_uuid = player.getUuid(player_or_uuid);
- }
- return list.contains($ghosts, player_or_uuid);
- }
- function tpAllMiddle(reporter) {
- $vote_count_map = map.new(); //Wieviel Spieler haben einen Spieler gevoted
- $vote_count_map_2 = map.new(); //Welcher Spieler hat für wen gevoted
- amongus.setMeeting(true);
- $reactor_used = false;
- removeDeadBodies();
- amongus.clearAdminTable();
- boss.setTitle($meeting_bar, "Discussion Time");
- updateMeetingBar($discuss_time, true);
- hideSabotageCooldownBar();
- if($lights_sabotaged) {
- switchLights(true);
- }
- for(i = 0; i < list.getSize($player_list); i++) {
- p_uuid = list.getIndex($player_list, i);
- p = player.get(p_uuid);
- createVoteInv(p, player.getUuid(reporter));
- if(list.contains($vent_list, p_uuid)) {
- vent_leave(p);
- }
- if(player.isOnCam(p)) {
- cam.leave(p);
- }
- amongus.manageEffects(p);
- entity.teleport(p, list.getIndex($spawn_locs, i));
- player.setSpeed(p, 0);
- inv.close(p);
- data.setTimer(p, "Discussion Time", $discuss_time * 20);
- boss.addPlayer($meeting_bar, p);
- }
- iter = iterator($impostors_list_3);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- kill_bar = map.get($imp_kill_bars, p_uuid);
- boss.removePlayer(kill_bar, player.get(p_uuid));
- }
- }
- function fix_oxygen() {
- if($oxygen_sabotaged) {
- amongus.setAlert(false);
- $oxygen_sabotaged = false;
- hideSabotageDisplay();
- setSaboCooldown($default_sabo_cooldown);
- sgoto(40, "scheduled_sabo_close");
- }
- }
- function fix_light() {
- amongus.setAlert(false);
- $lights_sabotaged = false;
- removeSaboParticles($fix_lights_par_loc_1, $fix_lights_par_loc_2);
- iter = iterator($player_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- hideSabotageDisplay();
- amongus.manageEffects(p);
- }
- setSaboCooldown($default_sabo_cooldown);
- switchLights(true);
- sgoto(40, "scheduled_sabo_close");
- }
- function hideSabotageCooldownBar() {
- iter = iterator($impostors_list_2);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- boss.removePlayer($sabotage_cooldown_bar, p);
- }
- }
- function sabotage_oxygen() {
- hideSabotageCooldownBar();
- amongus.setAlert(true);
- $oxygen_sabotaged = true;
- $oxy_fixed_1 = false;
- $oxy_fixed_2 = false;
- $depletion_time = 30;
- addSaboParticles($fix_o2_par_loc_1, $fix_o2_par_loc_2);
- displaySabotage("§cO2/ADM | Fix Oxygen ", 0, 2, $depletion_time);
- $oxy_code = math.random(10000, 99999);
- sgoto(20, "oxygen_depletion");
- iter = iterator($player_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- title.send(p, text.new("§cSabotage!!!"), text.new("Oxygen Depletion"));
- }
- sgoto(20, "crit_sabo_sound_loop");
- }
-
- @oxygen_depletion
- if(!oxygen_sabotaged) {
- goto("checkgame");
- }
- depletion_time--;
- fixed = 0;
- if(oxy_fixed_1) {
- fixed++;
- }
- if(oxy_fixed_2) {
- fixed++;
- }
- displaySabotage("§cO2/ADM | Fix Oxygen ", fixed, 2, depletion_time);
- if(depletion_time == 0) {
- if(freeplay) {
- minigame.speakAll($gamename, "Normally the impostors would have just won because of the critical sabotage. Instead we just shut it off.");
- removeSaboParticles(fix_o2_par_loc_1, fix_o2_par_loc_2);
- fix_oxygen();
- } else {
- winners = "§cImpostors";
- goto("win");
- }
- goto("checkgame");
- }
- sgoto(20, "oxygen_depletion");
- goto("checkgame");
- @crit_sabo_sound_loop
- if(!amongus.isAlert()) {
- goto("checkgame");
- }
- iter = iterator(player_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- sound.spawnForPlayer(p, crit_sabo_sound, master_sound_category);
- }
- sgoto(20, "crit_sabo_sound_loop");
- goto("checkgame");
- function sabotage_reactor() {
- hideSabotageCooldownBar();
- amongus.setAlert(true);
- $reactor_sabotaged = true;
- $hold_reactor_1 = false;
- $hold_reactor_2 = false;
- addSaboParticles($fix_reactor_par_loc_1, $fix_reactor_par_loc_2);
- $meltdown_time = 30;
- displaySabotage("§cREA | Prevent Meltdown ", 0, 2, $meltdown_time);
- sgoto(20, "meltdown");
- iter = iterator($player_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- title.send(p, text.new("§cSabotage!!!"), text.new("Reactor Meltdown"));
- }
- sgoto(20, "crit_sabo_sound_loop");
- }
- @meltdown
- if(!reactor_sabotaged) {
- goto("checkgame");
- }
- meltdown_time--;
- holded = 0;
- if(hold_reactor_1) {
- holded++;
- }
- if(hold_reactor_2) {
- holded++;
- }
- displaySabotage("§cREA | Preven Meltdown ", holded, 2, meltdown_time);
- if(meltdown_time == 0) {
- if(freeplay) {
- minigame.speakAll($gamename, "Normally the impostors would have just won because of the critical sabotage. Instead we just shut it off.");
- fix_meltdown();
- } else {
- winners = "§cImpostors";
- goto("win");
- }
- goto("checkgame");
- }
- sgoto(20, "meltdown");
- goto("checkgame");
- function setSaboCooldown(sabotage_cooldown) {
- iter = iterator($impostors_list_2);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- data.setTimer(p, "Sabotage Cooldown", sabotage_cooldown * 20);
- boss.addPlayer($sabotage_cooldown_bar, p);
- updateSabotageCooldownBar(sabotage_cooldown);
- }
- }
- function fix_meltdown() {
- $reactor_sabotaged = false;
- amongus.setAlert(false);
- removeSaboParticles($fix_reactor_par_loc_1, $fix_reactor_par_loc_2);
- hideSabotageDisplay();
- setSaboCooldown($default_sabo_cooldown);
- sgoto(40, "scheduled_sabo_close");
- }
- function fix_comms() {
- $comms_sabotaged = false;
- amongus.setAlert(false);
- removeSaboParticles($fix_comms_par_loc, null);
- hideSabotageDisplay();
- setSaboCooldown($default_sabo_cooldown);
- showTasks();
- sgoto(40, "scheduled_sabo_close");
- }
- function sabotage_comms() {
- hideSabotageCooldownBar();
- amongus.setAlert(true);
- $comms_sabotaged = true;
- addSaboParticles($fix_comms_par_loc, null);
- $comms_fix_freq = math.random(1, 64);
- while($comms_fix_freq == 32) {
- $comms_fix_freq = math.random(1, 64);
- }
- displaySabotage("§cCOM | Fix Comms", 1, 1, null);
- boss.setTitle($progress_bar, "COMMS DISABLED");
- boss.setProgress($progress_bar, 0);
- hideTasks();
- }
- function hideTasks() {
- iter = iterator($player_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- if(isCrewmate(p) || $freeplay) {
- for(i = 81; i < 98; i++) {
- sb.remove(p, i);
- }
- }
- }
- }
- function showTasks() {
- boss.setProgress($progress_bar, $amount_done_tasks / $amount_all_tasks);
- boss.setTitle($progress_bar, "TOTAL TASKS COMPLETED");
- iter = iterator($player_list);
- while(hasNext(iter)) {
- player_uuid = next(iter);
- player = player.get(player_uuid);
- if(isCrewmate(player) || $freeplay) {
- set = map.get($player_tasks, player_uuid);
- iterator(set);
- task_iter = iterator(set);
- while(hasNext(task_iter)) {
- task_id = next(task_iter);
- a = map.get($all_tasks, task_id);
- room = a[0];
- description = a[1];
- step = task.getStep(player, task_id);
- number_2 = a[3];
- time = null;
- if(time != null) {
- color = "§e";
- } elseif(step == 0) {
- color = "§r";
- } elseif(step == number_2) {
- color = "§a";
- } else {
- color = "§e";
- }
-
- if(task_id == 12) {
- if(step == 0) {
- r = map.get($empty_garb_map_3, player_uuid);
- if(r == 0) {
- room = "CAF";
- } else {
- room = "O2";
- }
- } else {
- room = "STO";
- }
- }
- if(task_id == 2) {
- if(step == 0) {
- r = map.get($download_map_3, player_uuid);
- room = map.get($download_map_4, list.getIndex($download_list_3, r));
- } else {
- room = "ADM";
- description = "Upload Data";
- }
- }
- if(task_id == 10) {
- my_list = map.get($wires_map_4, player_uuid);
- if(step == 3) {
- wire_loc = list.getIndex(my_list, 2);
- } else {
- wire_loc = list.getIndex(my_list, step);
- }
- room = map.get($wires_map_3, wire_loc);
- } elseif(task_id == 14) {
- r = map.get($divert_pow_map_3, player_uuid);
- room_2 = map.get($divert_pow_map_5, r);
- description = string.concat("Divert power to ", room_2);
- if(step != 0) {
- room = room_2;
- }
- }
- sb_id = a[4];
- if((number_2 == 1 && time == null) || time == 0) {
- sb.add(player, sb_id, string.concat(color, room, " §8| ", color, description));
- } elseif(time != null) {
- sb.add(player, sb_id, string.concat(color, room, " §8| ", color, description, " (", string.number(time), ")"));
- } else {
- sb.add(player, sb_id, string.concat(color, room, " §8| ", color, description, " (", string.number(step), "/", string.number(number_2), ")"));
- }
- }
- }
- }
- }
- @scoreboard_toggler
- if(sbtoggle) {
- sbToggle.hideTasks();
- sbtoggle = false;
- } elseif(!comms_sabotaged) {
- showTasks();
- sbtoggle = true;
- }
- sgoto(100, "scoreboard_toggler");
- goto("checkgame");
- function sbToggle.hideTasks() {
- iter = iterator($player_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- for(i = 84; i < 98; i++) {
- sb.remove(p, i);
- }
- }
- }
- function sabotage_light() {
- hideSabotageCooldownBar();
- amongus.setAlert(true);
- $lights_sabotaged = true;
- addSaboParticles($fix_lights_par_loc_1, $fix_lights_par_loc_2);
- iter = iterator($player_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- amongus.manageEffects(p);
- }
- displaySabotage("§cELE | Fix Lights", 1, 1, null);
- inv.setItem($lights_inv, 0, item.create("RED_STAINED_GLASS_PANE", 1, "§fOff", null));
- for(i = 0; i < 9; i+=2) {
- r = math.random(0, 1);
- if(r == 0) {
- inv.setItem($lights_inv, i, item.create("GREEN_STAINED_GLASS_PANE", 1, "§fOn", null));
- } else {
- inv.setItem($lights_inv, i, item.create("RED_STAINED_GLASS_PANE", 1, "§fOff", null));
- }
- }
- switchLights(false);
- }
- function hideSabotageDisplay() {
- minigame.displayRemoveAll(80);
- }
- function displaySabotage(text, number_1, number_2, time) {
- if(time == null) {
- if(number_2 == 1) {
- minigame.displayAll(80, text);
- } else {
- minigame.displayAll(80, string.concat(text, " (", string.number(number_1), "/", string.number(number_2), ")"));
- }
- } else {
- if(number_2 == 1) {
- minigame.displayAll(80, text, string.number(time));
- } else {
- minigame.displayAll(80, string.concat(text, string.number(time), " (", string.number(number_1), "/", string.number(number_2), ")"));
- }
- }
- }
- function callMeeting(reporter) {
- reporter_uuid = player.getUuid(reporter);
- amount = map.get($meeting_amounts, reporter_uuid);
- if(amount <= 0) {
- msg.prefix(reporter, $gamename, "You have no emergency meetings left.");
- return;
- }
- cooldown = data.getTimer(reporter, "Meeting Cooldown");
- if(cooldown == null || cooldown == -1) {
- tpAllMiddle(reporter);
- reporter_name = player.getName(reporter);
- color_code = amongus.getPlayerColorCode(reporter);
- minigame.titleAll("§cEMERGENY MEETING", string.concat("called by ", color_code, reporter_name), 20, 60, 20);
- minigame.speakAll($gamename, string.concat(color_code, reporter_name, " §rcalls an emergency meeting!"));
- new_amount = amount - 1;
- map.add($meeting_amounts, reporter_uuid, new_amount);
- msg.prefix(reporter, $gamename, string.concat("You have §c", string.number(new_amount), "§r emergeny meetings left."));
- } else {
- msg.prefix(reporter, $gamename, string.concat("Remaining meeting cooldown: ", string.number(math.roundDown(cooldown / 20)), "s"));
- }
- }
- function reportBody(reporter, found_player_uuid) {
- tpAllMiddle(reporter);
- reporter_name = player.getName(reporter);
- found_player_name = player.getName(found_player_uuid);
- minigame.titleAll("§cREPORT", string.concat(reporter_name, " found ", found_player_name), 20, 60, 20);
- minigame.speakAll($gamename, string.concat(amongus.getPlayerColorCode(reporter), reporter_name, " §rfound the body of ", amongus.getPlayerColorCode(found_player_uuid), found_player_name, "."));
- if(amongus.isAlert()) {
- if($oxygen_sabotaged) {
- fix_oxygen();
- }
- if($reactor_sabotaged) {
- fix_meltdown();
- }
- }
- }
- function continueGame() {
- $meeting = false;
- iter = iterator($player_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- inv.close(p);
- amongus.manageEffects(p);
- if(player.isGhost(p)) {
- player.setSpeed(p, $move_speed * 1.5);
- } else {
- player.removeItem(p, $open_vote_menu_item);
- player.setSpeed(p, $move_speed);
- if(isImpostor(p) && !player.isGhost(p)) {
- data.setTimer(p, "Kill Cooldown", $kill_cooldown * 20);
- kill_bar = map.get($imp_kill_bars, p_uuid);
- updateKillBossBar(kill_bar, $kill_cooldown);
- }
- }
- boss.removeAll($meeting_bar);
- data.setTimer(p, "Voting Time", -1);
- data.setTimer(p, "Meeting Cooldown", $meeting_cooldown * 20);
- }
- if($lights_sabotaged) {
- sabotage_light();
- return;
- }
- if(!amongus.isAlert()) {
- setSaboCooldown($default_sabo_cooldown);
- }
- }
- function killCrewmate(killer, crewmate) {
- loc = entity.getLocation(crewmate);
- sound.spawnForPlayer(killer, $kill_sound, $master_sound_category);
- sound.spawnForPlayer(crewmate, $kill_sound, $master_sound_category);
- killer_name = player.getName(killer);
- killer_color_code = amongus.getPlayerColorCode(killer);
- msg.prefix(crewmate, $gamename, string.concat(killer_color_code, killer_name, "§r killed you."));
- msg.prefix(killer, $gamename, string.concat("You killed ", amongus.getPlayerColorCode(crewmate), player.getName(crewmate), "§r."));
- //Killer zu Mord-Location teleportieren
- entity.teleport(killer, loc);
- data.setTimer(killer, "Kill Cooldown", $kill_cooldown * 20);
- kill_bar = map.get($imp_kill_bars, player.getUuid(killer));
- updateKillBossBar(kill_bar, $kill_cooldown);
- //Crewmate zum Geist machen
- amongus.manageEffects(crewmate);
- player.hideOnline(crewmate);
- crew_uuid = player.getUuid(crewmate);
- list.add($ghosts, crew_uuid);
- amongus.removeEquip(crewmate);
- title.send(crewmate, text.new("§cKILLED!!!"), text.new(string.concat("by ", killer_color_code, killer_name)));
- inv.close(crewmate);
- $reactor_used = false;
- sabotage.closedInv(crewmate);
- player.setSpeed(crewmate, $move_speed * 1.5);
- //Leiche an Mord-Location platzieren
- ent = entity.spawn(loc, "ZOMBIE");
- list.add($dead_bodies, ent);
- map.add($report_map, ent, crew_uuid);
- living.setAi(ent, false);
- living.setHand(ent, $air_item);
- entity.setSilent(ent, true);
- living.setInvisible(ent, true);
- color = amongus.getPlayerColor(crewmate);
- amongus.equip(ent, color);
- }
- function amongus.clearAdminTable() {
- map.clear($admin_table_map);
- map.clear($admin_table_map_2);
- }
- function amongus.removeFromAdminTable(player) {
- player_uuid = player.getUuid(player);
- room_id = map.get($admin_table_map, player_uuid);
- if(room_id == null) {
- return;
- }
- map.remove($admin_table_map, player_uuid);
- map.add($admin_table_map_2, room_id, map.get($admin_table_map_2, room_id) - 1);
- }
- function removeCamBodies() {
- iter = map.iterator($cam_map_3);
- while(hasNext(iter)) {
- element = next(iter);
- entity.remove(map.getValue(element));
- }
- }
- function removeDeadBodies() {
- iter = iterator($dead_bodies);
- while(hasNext(iter)) {
- entity.remove(next(iter));
- }
- }
- function task.getSbId(task_id) {
- a = map.get($all_tasks, task_id);
- return a[4];
- }
- function registerTask(task_id, sb_id, room, description, steps_amount) {
- a = array.new(5);
- a[0] = room;
- a[1] = description;
- a[2] = 0; //starting step
- a[3] = steps_amount;
- a[4] = sb_id;
- map.add($all_tasks, task_id, a);
- }
- function giveTask(player, task_id, room, description, number_1, number_2, time) {
- player_uuid = player.getUuid(player);
- if(time != null) {
- color = "§e";
- } elseif(number_1 == 0) {
- color = "§r";
- } elseif(number_1 == number_2) {
- sound.spawnForPlayer(player, $task_sound, $master_sound_category);
- $amount_done_tasks++;
- color = "§a";
- if(!$comms_sabotaged) {
- iter = iterator($player_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- pct = $amount_done_tasks / $amount_all_tasks;
- boss.setProgress($progress_bar, pct);
- if(pct == 1) {
- sgoto(2, "crewmate_win");
- }
- }
- }
- } else {
- color = "§e";
- }
- step = task.getStep(player, task_id);
- if(step == 0) {
- if(task_id == 1) {
- addTaskParticle(player, $get_fuel_par_loc);
- } elseif(task_id == 2) {
- r = map.getOrDefault($download_map_3, player_uuid, math.random(0, 4));
- map.add($download_map_3, player_uuid, r);
- addTaskParticle(player, list.getIndex($download_list_4, r));
- room = map.get($download_map_4, list.getIndex($download_list_3, r));
- } elseif(task_id == 3) {
- addTaskParticle(player, $prime_shields_par_loc);
- } elseif(task_id == 4) {
- addTaskParticle(player, $start_reactor_par_loc);
- } elseif(task_id == 5) {
- addTaskParticle(player, $unlock_manifolds_par_loc);
- } elseif(task_id == 6) {
- addTaskParticle(player, $chart_course_par_loc);
- } elseif(task_id == 7) {
- addTaskParticle(player, $steering_par_loc);
- } elseif(task_id == 8 && time == null) {
- addTaskParticle(player, $inspect_par_loc);
- } elseif(task_id == 9) {
- addTaskParticle(player, $calibrate_dist_par_loc);
- } elseif(task_id == 11) {
- addTaskParticle(player, $swipe_card_par_loc);
- } elseif(task_id == 13) {
- addTaskParticle(player, $clear_ast_par_loc);
- } elseif(task_id == 15) {
- addTaskParticle(player, $clean_o2_par_loc);
- } elseif(task_id == 16) {
- addTaskParticle(player, $scan_par_loc);
- } elseif(task_id == 17) {
- addTaskParticle(player, $ue_align_par_loc);
- addTaskParticle(player, $le_align_par_loc);
- }
- }
- if(task_id == 12) {
- if(step == 0) {
- r = map.getOrDefault($empty_garb_map_3, player_uuid, math.random(0, 1));
- map.add($empty_garb_map_3, player_uuid, r);
- if(r == 0) {
- addTaskParticle(player, $cafe_garb_par_loc);
- room = "CAF";
- } else {
- addTaskParticle(player, $o2_garb_par_loc);
- room = "O2";
- }
- } else {
- room = "STO";
- }
- }
- if(task_id == 10) {
- my_list = map.getOrDefault($wires_map_4, player_uuid, list.new());
- if(step == 0) {
- //Electrical > Storage > Admin > Navigation > Cafeteria > Security
- //1.Wire
- index_1 = math.random(0, 3);
- wire_loc_1 = list.getIndex($wires_list_2, index_1);
- list.add(my_list, wire_loc_1);
- //2.Wire
- index_2 = math.random(1 + index_1, 4);
- wire_loc_2 = list.getIndex($wires_list_2, index_2);
- while(list.contains(my_list, wire_loc_2)) {
- index_2 = math.random(1 + index_1, 4);
- wire_loc_2 = list.getIndex($wires_list_2, index_2);
- }
- list.add(my_list, wire_loc_2);
- //3.Wire
- index_3 = math.random(1 + index_2, 5);
- wire_loc_3 = list.getIndex($wires_list_2, index_3);
- while(list.contains(my_list, wire_loc_3)) {
- index_3 = math.random(1 + index_2, 5);
- wire_loc_3 = list.getIndex($wires_list_2, index_3);
- }
- list.add(my_list, wire_loc_3);
- map.add($wires_map_4, player_uuid, my_list);
- }
- if(step < 3) {
- wire_loc = list.getIndex(my_list, step);
- room = map.get($wires_map_3, wire_loc);
- addTaskParticle(player, map.get($wires_map_5, wire_loc));
- if(step > 0) {
- old_wire_loc = list.getIndex(my_list, step - 1);
- removeTaskParticle(player, map.get($wires_map_5, old_wire_loc));
- }
- } else {
- wire_loc = list.getIndex(my_list, 2);
- removeTaskParticle(player, map.get($wires_map_5, wire_loc));
- }
- } elseif(task_id == 14) {
- r = map.getOrDefault($divert_pow_map_3, player_uuid, math.random(36, 43));
- map.add($divert_pow_map_3, player_uuid, r);
- room_2 = map.get($divert_pow_map_5, r);
- description = string.concat("Divert power to ", room_2);
- if(step == 0) {
- addTaskParticle(player, $elec_power_par_loc);
- } else {
- room = room_2;
- }
- }
- if(!$comms_sabotaged) {
- sb_id = task.getSbId(task_id);
- if((number_2 == 1 && time == null) || time == 0) {
- sb.add(player, sb_id, string.concat(color, room, " §8| ", color, description));
- } elseif(time != null) {
- if($sbtoggle && sb_id > 83) {
- sb.add(player, sb_id, string.concat(color, room, " §8| ", color, description, " (", string.number(time), ")"));
- }
- } else {
- sb.add(player, sb_id, string.concat(color, room, " §8| ", color, description, " (", string.number(number_1), "/", string.number(number_2), ")"));
- }
- }
- set = map.get($player_tasks, player_uuid);
- if(set == null) {
- set = set.new();
- }
- set.add(set, task_id);
- map.add($player_tasks, player_uuid, set);
- }
- function sgoto_auto_close_inv(player_uuid) {
- list.add($auto_close_list, player_uuid);
- sgoto(40, "auto_close_inv");
- }
- @auto_close_inv
- p_uuid = list.getIndex(auto_close_list, 0);
- list.removeIndex(auto_close_list, 0);
- if(list.contains(auto_close_list_2, p_uuid)) {
- list.remove(auto_close_list_2, p_uuid);
- } else {
- inv.close(player.get(p_uuid));
- }
- goto("checkgame");
- function hasTask(player, task_id) {
- player_uuid = player.getUuid(player);
- set = map.getOrDefault($player_tasks, player_uuid, set.new());
- return set.contains(set, task_id);
- }
- function addAstDirection(id, x, y) {
- a = array.new(2);
- a[0] = x;
- a[1] = y;
- $ast_directions[id] = a;
- }
- function addAstStartPos(slot, dir_id_1, dir_id_2, dir_id_3) {
- list.add($ast_start_pos, slot);
- my_list = list.new();
- list.add(my_list, dir_id_1);
- list.add(my_list, dir_id_2);
- list.add(my_list, dir_id_3);
- map.add($ast_start_pos_dirs, slot, my_list);
- }
- function getAstDirection(slot) {
- my_list = map.get($ast_start_pos_dirs, slot);
- dir_id = list.getIndex(my_list, math.random(0, 2));
- a = $ast_directions[dir_id];
- return a;
- }
- @loop
- iter = iterator(player_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- player.setHunger(p, 4);
- player.setSaturation(p, 0);
- }
- //Kill Cooldown Bossbar
- if(!meeting) {
- iter = iterator(impostors_list_3);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- kill_bar = map.get(imp_kill_bars, p_uuid);
- cooldown = data.getTimer(player.get(p_uuid), "Kill Cooldown");
- updateKillBossBar(kill_bar, cooldown / 20);
- }
- }
- //Meeting Bossbar
- if(meeting) {
- discussion = true;
- p = player.get(list.getIndex(player_list, 0));
- time = data.getTimer(p, "Discussion Time");
- if(time == null || time == -1) {
- time = data.getTimer(p, "Voting Time");
- discussion = false;
- }
- updateMeetingBar(time / 20, discussion);
- }
- //Sabotage Cooldown Bossbar
- if(!freeplay) {
- if(!meeting) {
- p = player.get(list.getIndex(impostors_list_2, 0));
- time = data.getTimer(p, "Sabotage Cooldown");
- updateSabotageCooldownBar(time / 20);
- }
- }
- sgoto(20, "loop");
- goto("checkgame");
- @imp_par_loop
- iter = iterator(impostors_list_2);
- while(hasNext(iter)) {
- p_uuid_1 = next(iter);
- p_1 = player.get(p_uuid_1);
- iter_2 = iterator(impostors_list_2);
- while(hasNext(iter_2)) {
- p_uuid_2 = next(iter_2);
- p_2 = player.get(p_uuid_2);
- if(!player.isGhost(p_2)) {
- p_2_loc = entity.getLocation(p_2);
- loc.add(p_2_loc, 0, 2.3, 0);
- particle.spawnPlayer(p_2_loc, imp_par, p_1);
- }
- }
- }
- sgoto(5, "imp_par_loop");
- goto("checkgame");
- @download_data_2
- player_uuid = player.getUuid(player);
- c = 0;
- inv.setItem(inv, c++, lime_glass);
- map.add(download_counter, player_uuid, c);
- list.add(download_list, player_uuid);
- map.add(download_map, player_uuid, inv);
- sgoto(20, "download_data");
- goto("checkgame");
- @download_data
- task_id = 2;
- player_uuid = list.getIndex(download_list, 0);
- inv = map.get(download_map, player_uuid);
- player = player.get(player_uuid);
- list.removeIndex(download_list, 0);
- c = map.get(download_counter, player_uuid);
- if(list.contains(download_list_2, player_uuid)) {
- goto("checkgame");
- }
- inv.setItem(inv, c++, lime_glass);
- map.add(download_counter, player_uuid, c);
- if(c < 9) {
- list.add(download_list, player_uuid);
- map.add(download_map, player_uuid, inv);
- sgoto(20, "download_data");
- } else {
- inv.setItem(inv, 22, item.custom.create("CHECK_GREEN", 1, "§rTask completed", null));
- map.remove(download_counter, player_uuid);
- step = task.getStep(player, task_id);
- step = task.stepIncrease(player, task_id);
- if(step == 1) {
- r = map.get(download_map_3, player_uuid);
- removeTaskParticle(player, list.getIndex(download_list_4, r));
- addTaskParticle(player, admin_upload_par_loc);
- } else {
- removeTaskParticle(player, admin_upload_par_loc);
- }
- giveTask(player, task_id, "ADM", "Upload Data", step, 2, null);
- sgoto_auto_close_inv(player_uuid);
- }
- goto("checkgame");
- @draw_pattern_1
- player_uuid = list.getIndex(reactor_draw_list_1, 0);
- list.removeIndex(reactor_draw_list_1, 0);
- if(list.contains(reactor_block_list, player_uuid)) {
- goto("checkgame");
- }
- reactor_array = reactor.get(player_uuid);
- inv = reactor.getInv(reactor_array);
- stage = reactor.getStage(reactor_array);
- for(i = 0; i <= stage; i++) {
- inv.setItem(inv, i + 2, green_glass);
- }
- reactor.setRightSide(inv, black_glass);
- player = player.get(player_uuid);
- list.add(reactor_draw_list_2, player_uuid);
- goto("draw_pattern_2");
- @draw_pattern_2
- player_uuid = list.getIndex(reactor_draw_list_2, 0);
- list.removeIndex(reactor_draw_list_2, 0);
- if(list.contains(reactor_block_list, player_uuid)) {
- goto("checkgame");
- }
- reactor_array = reactor.get(player_uuid);
- inv = reactor.getInv(reactor_array);
- stage = reactor.getStage(reactor_array);
- counter = reactor.getCounter(reactor_array);
- pattern = reactor.getPattern(reactor_array);
- player = player.get(player_uuid);
- if(counter > stage) {
- reactor.setCounter(reactor_array, 0);
- reactor.setPhase(reactor_array, "click");
- reactor.save(reactor_array, player);
- reactor.setRightSide(inv, gray_glass);
- goto("checkgame");
- }
- inv.setItem(inv, pattern[counter], blue_glass);
- counter++;
- reactor.setCounter(reactor_array, counter);
- reactor.save(reactor_array, player);
- if(counter < 6) {
- list.add(reactor_draw_list_2, player_uuid);
- list.add(reset_reactor_draw_list, player_uuid);
- sgoto(10, "reset_reactor_draw");
- sgoto(12, "draw_pattern_2");
- }
- goto("checkgame");
- @reset_reactor_draw
- player_uuid = list.getIndex(reset_reactor_draw_list, 0);
- list.removeIndex(reset_reactor_draw_list, 0);
- reactor_array = reactor.get(player_uuid);
- inv = reactor.getInv(reactor_array);
- counter = reactor.getCounter(reactor_array) - 1;
- pattern = reactor.getPattern(reactor_array);
- if(counter >= 0) {
- inv.setItem(inv, pattern[counter], black_glass);
- player = player.get(player_uuid);
- }
- goto("checkgame");
- @reset_reactor_click
- player_uuid = list.getIndex(reset_reactor_click_list, 0);
- slot = list.getIndex(reset_reactor_click_list_2, 0);
- list.removeIndex(reset_reactor_click_list, 0);
- list.removeIndex(reset_reactor_click_list_2, 0);
- if(list.contains(reactor_block_list, player_uuid)) {
- goto("checkgame");
- }
- reactor_array = reactor.get(player_uuid);
- inv = reactor.getInv(reactor_array);
- inv.setItem(inv, slot, gray_glass);
- player = player.get(player_uuid);
- goto("checkgame");
- @unblock_start_reactor
- list.removeIndex(reactor_block_list, 0);
- goto("checkgame");
- @unblock_submit_scan
- list.removeIndex(submit_scan_list_2, 0);
- goto("checkgame");
- @unblock_calib_dist
- list.removeIndex(calibrate_dist_list_2, 0);
- goto("checkgame");
- @unblock_empty_garb
- list.removeIndex(empty_garb_list_2, 0);
- goto("checkgame");
- @unblock_download
- list.removeIndex(download_list_2, 0);
- goto("checkgame");
- @unblock_clear_ast
- list.removeIndex(clear_ast_list_2, 0);
- goto("checkgame");
- @new_reactor
- player_uuid = list.getIndex(reactor_false_click_list, 0);
- list.removeIndex(reactor_false_click_list, 0);
- reactor_array = reactor.get(player_uuid);
- inv = reactor.getInv(reactor_array);
- reactor.setHeader(inv, light_gray_glass);
- reactor.setLeftSide(inv, black_glass);
- reactor.setRightSide(inv, black_glass);
- player = player.get(player_uuid);
- reactor_array = array.new(5);
- reactor.setInv(reactor_array, inv);
- reactor.setStage(reactor_array, 0);
- reactor.setCounter(reactor_array, 0);
- reactor.setPattern(reactor_array);
- reactor.save(reactor_array, player);
- list.add(reactor_draw_list_1, player_uuid);
- sgoto(20, "draw_pattern_1");
- goto("checkgame");
- @false_reactor_click
- reactor.setHeader(inv, red_glass);
- reactor.setRightSide(inv, red_glass);
- list.add(reactor_block_list, player_uuid);
- list.add(reactor_false_click_list, player_uuid);
- sgoto(20, "unblock_start_reactor");
- sgoto(40, "new_reactor");
- goto("checkgame");
- @false_manifolds_click
- for(i = 2; i < 16; i++) {
- if(i == 7) {
- i = 11;
- }
- inv.setItem(inv, i, item.create("RED_STAINED_GLASS_PANE", item.getAmount(inv.getItem(inv, i)), null, null));
- }
- list.add(manifolds_list, inv);
- list.add(manifolds_list_2, player);
- sgoto(30, "redo_manifolds");
- goto("checkgame");
- @redo_manifolds
- inv = list.getIndex(manifolds_list, 0);
- player_uuid = player.getUuid(list.getIndex(manifolds_list_2, 0));
- list.removeIndex(manifolds_list, 0);
- list.removeIndex(manifolds_list_2, 0);
- map.remove(manifolds_counter, player_uuid);
- for(i = 2; i < 16; i++) {
- if(i == 7) {
- i = 11;
- }
- inv.setItem(inv, i, item.create("BLUE_STAINED_GLASS_PANE", item.getAmount(inv.getItem(inv, i)), null, null));
- }
- goto("checkgame");
- @countdown_sample
- player_uuid = list.getIndex(sample_list, 0);
- player = player.get(player_uuid);
- time = list.getIndex(sample_list_2, 0) - 1;
- list.removeIndex(sample_list, 0);
- list.removeIndex(sample_list_2, 0);
- inv = map.get(sample_map, player_uuid);
- sample = item.create("blue_stained_glass_pane", 1, "§rSample", null);
- if(time == 58) {
- inv.setItem(inv, 0, sample);
- inv.setItem(inv, 9, sample);
- inv.setItem(inv, 18, sample);
- } elseif(time == 57) {
- inv.setItem(inv, 2, sample);
- inv.setItem(inv, 11, sample);
- inv.setItem(inv, 20, sample);
- } elseif(time == 56) {
- inv.setItem(inv, 4, sample);
- inv.setItem(inv, 13, sample);
- inv.setItem(inv, 22, sample);
- } elseif(time == 55) {
- inv.setItem(inv, 6, sample);
- inv.setItem(inv, 15, sample);
- inv.setItem(inv, 24, sample);
- } elseif(time == 54) {
- inv.setItem(inv, 8, sample);
- inv.setItem(inv, 17, sample);
- inv.setItem(inv, 26, sample);
- }
- if(time == 0) {
- inv.setItem(inv, 53, item.create("gray_stained_glass_pane", 1, "§rSelect anomaly", null));
- r = math.random(0, 4) * 2;
- inv.setItem(inv, r, item.create("red_stained_glass_pane", 1, "§rSample", null));
- inv.setItem(inv, r + 9, item.create("red_stained_glass_pane", 1, "§rSample", null));
- inv.setItem(inv, r + 18, item.create("red_stained_glass_pane", 1, "§rSample", null));
- select_sample = item.create("green_stained_glass_pane", 1, "§rSelect sample", null);
- inv.setItem(inv, 36, item.create("green_stained_glass_pane", 1, "§rSelect sample", null));
- inv.setItem(inv, 38, item.create("green_stained_glass_pane", 1, "§rSelect sample", null));
- inv.setItem(inv, 40, item.create("green_stained_glass_pane", 1, "§rSelect sample", null));
- inv.setItem(inv, 42, item.create("green_stained_glass_pane", 1, "§rSelect sample", null));
- inv.setItem(inv, 44, item.create("green_stained_glass_pane", 1, "§rSelect sample", null));
- giveTask(player, 8, "MED", "Inspect Sample", 0, 1, 0);
- goto("checkgame");
- }
- giveTask(player, 8, "MED", "Inspect Sample", 0, 1, time);
- inv.setItem(inv, 53, item.create("gray_stained_glass_pane", time, "§rGo grab a coffee", null));
- list.add(sample_list, player_uuid);
- list.add(sample_list_2, time);
- sgoto(20, "countdown_sample");
- goto("checkgame");
- @calibrate_dist
- p_uuid = list.getIndex(calibrate_dist_list, 0);
- list.removeIndex(calibrate_dist_list, 0);
- if(list.contains(calibrate_dist_list_2, p_uuid)) {
- goto("checkgame");
- }
- a = map.get(calibrate_dist_map, p_uuid);
- inv = a[1];
- index = a[3];
- stage = a[4];
- inv.setItem(inv, calibrate_dist_array[index++], black_glass);
- if(index == 12) {
- index = 0;
- }
- a[3] = index;
- if(stage == 0) {
- inv.setItem(inv, calibrate_dist_array[index], yellow_glass);
- } elseif(stage == 1) {
- inv.setItem(inv, calibrate_dist_array[index], blue_glass);
- } elseif(stage == 2) {
- inv.setItem(inv, calibrate_dist_array[index], cyan_glass);
- }
- if(stage < 3) {
- map.add(calibrate_dist_map, p_uuid, a);
- list.add(calibrate_dist_list, p_uuid);
- sgoto(7, "calibrate_dist");
- }
- goto("checkgame");
- @empty_garb
- p_uuid = list.getIndex(empty_garb_list, 0);
- list.removeIndex(empty_garb_list, 0);
- c = map.get(empty_garb_map, p_uuid);
- inv = map.get(empty_garb_map_2, p_uuid);
- if(list.contains(empty_garb_list_2, p_uuid)) {
- goto("checkgame");
- }
- for(slot = 52; slot > 9; slot--) {
- if(slot == 44) {
- continue;
- }
- inv.setItem(inv, slot, inv.getItem(inv, slot - 9));
- }
- p = player.get(p_uuid);
- if(++c == 5) {
- step = task.stepIncrease(p, 12);
- if(step == 1) {
- addTaskParticle(p, stor_garb_par_loc);
- r = map.get(empty_garb_map_3, player_uuid);
- if(r == 0) {
- removeTaskParticle(p, cafe_garb_par_loc);
- } else {
- removeTaskParticle(p, o2_garb_par_loc);
- }
- } else {
- removeTaskParticle(p, stor_garb_par_loc);
- }
- inv.setItem(inv, 44, item.custom.create("CHECK_GREEN", 1, "§rTask completed", null));
- map.remove(empty_garb_map, p_uuid);
-
- giveTask(p, 12, "STO", "Empty Garbage", step, 2, null);
- sgoto_auto_close_inv(p_uuid);
- } else {
- map.add(empty_garb_map, p_uuid, c);
- map.add(empty_garb_map_2, p_uuid, inv);
- list.add(empty_garb_list, p_uuid);
- sgoto(20, "empty_garb");
- }
- goto("checkgame");
- @clear_ast
- p_uuid = list.getIndex(clear_ast_list, 0);
- list.removeIndex(clear_ast_list, 0);
- if(list.contains(clear_ast_list_2, p_uuid)) {
- if(list.getSize(clear_ast_list) == 0) {
- goto("checkgame");
- }
- }
- inv = map.get(clear_ast_map_3, p_uuid);
- my_list = map.get(clear_ast_map, p_uuid);
- iter = iterator(my_list);
- while(hasNext(iter)) {
- a = next(iter);
- slot = a[1];
- x_dir = a[2];
- y_dir = a[3];
- reached_end = a[4];
- speed = a[5];
- speed_counter = a[6];
- if(speed_counter == speed) {
- inv.setItem(inv, slot, black_glass);
- if(reached_end) {
- remove(iter);
- continue;
- }
- slot += x_dir;
- slot += (y_dir * 9);
- a[1] = slot;
- if(list.contains(ast_start_pos, slot)) {
- a[4] = true;
- }
- inv.setItem(inv, slot, asteroid_item);
- a[6] = 0;
- } else {
- a[6] = speed_counter + 1;
- }
- }
- c = map.get(clear_ast_map_2, p_uuid) + 1;
- if(c == 3 && !list.contains(clear_ast_list_3, p_uuid)) {
- c = 0;
- //new asteroid
- a = array.new(7);
- slot = list.getIndex(ast_start_pos, math.random(0, 25));
- a[1] = slot;
- inv.setItem(inv, slot, asteroid_item);
- b = getAstDirection(slot);
- a[2] = b[0]; //x_dir
- a[3] = b[1]; //y_dir
- a[4] = false; //reached end
- a[5] = math.random(1, 2); //speed
- a[6] = 0; //speed counter
- list.add(my_list, a);
- }
- map.add(clear_ast_map, p_uuid, my_list);
- map.add(clear_ast_map_2, p_uuid, c);
- list.add(clear_ast_list, p_uuid);
- sgoto(5, "clear_ast");
- goto("checkgame");
- function assignSeat(player) {
- for(i = 0; i < 10; i++) {
- if($seat_array[i] == null) {
- entity.teleport(player, $lobbyspawnloc);
- player_uuid = player.getUuid(player);
- $seat_array[i] = player_uuid;
- map.add($seat_map_index, player_uuid, i);
- list.add($seat_list_join, player_uuid);
- sgoto(10, "lobby_join_seat");
- return;
- }
- }
- }
- @lobby_join_seat
- player_uuid = list.getIndex(seat_list_join, 0);
- list.removeIndex(seat_list_join, 0);
- i = map.get(seat_map_index, player_uuid);
- loc = list.getIndex(seat_locs, i);
- ent = read.spawnMob(loc, "{Facing:1b,Invisible:1b,Invulnerable:1b,OnGround:0b,Rotation:[0.0f,-90.0f],id:\"minecraft:item_frame\"}");
- entity.frame.setfixed(ent, true);
- map.add(seat_map, player_uuid, ent);
- player = player.get(player_uuid);
- if(player != null) {
- entity.mount(player, ent);
- list.add(seat_list_leave, player_uuid);
- sgoto(60, "lobby_leave_seat");
- }
- goto("simplelobby");
- @lobby_leave_seat
- player_uuid = list.getIndex(seat_list_leave, 0);
- list.removeIndex(seat_list_leave, 0);
- leaveSeat(player_uuid);
- goto("simplelobby");
- function leaveSeat(player_or_uuid) {
- if(isPlayer(player_or_uuid)) {
- player_uuid = player.getUuid(player_or_uuid);
- } else {
- player_uuid = player_or_uuid;
- }
- for(i = 0; i < 10; i++) {
- if($seat_array[i] == player_uuid) {
- $seat_array[i] = null;
- ent = map.get($seat_map, player_uuid);
- if(ent != null) {
- entity.remove(ent);
- map.remove($seat_map, player_uuid);
- }
- }
- }
- }
- @submit_scan
- p_uuid = list.getIndex(submit_scan_list, 0);
- list.removeIndex(submit_scan_list, 0);
- if(list.contains(submit_scan_list_2, p_uuid)) {
- goto("checkgame");
- }
- c = map.get(submit_scan_map, p_uuid);
- inv = map.get(submit_scan_map_2, p_uuid);
- p = player.get(p_uuid);
- if(c == 0) {
- inv.setItem(inv, 2, lime_glass);
- inv.setItem(inv, 3, lime_glass);
- inv.setItem(inv, 4, lime_glass);
- inv.setItem(inv, 5, lime_glass);
- inv.setItem(inv, 6, lime_glass);
- } elseif(c == 1) {
- inv.setItem(inv, 0, item.create("black_stained_glass_pane", 1, string.concat("§rID: ", string.toUpperCase(amongus.getPlayerColor(p), "P0")), null));
- inv.setItem(inv, 2, light_gray_glass);
- inv.setItem(inv, 3, light_gray_glass);
- inv.setItem(inv, 4, light_gray_glass);
- inv.setItem(inv, 5, light_gray_glass);
- inv.setItem(inv, 6, light_gray_glass);
- inv.setItem(inv, 11, lime_glass);
- inv.setItem(inv, 12, lime_glass);
- inv.setItem(inv, 14, lime_glass);
- inv.setItem(inv, 15, lime_glass);
- inv.setItem(inv, 47, green_glass);
- } elseif(c == 2) {
- inv.setItem(inv, 11, light_gray_glass);
- inv.setItem(inv, 12, light_gray_glass);
- inv.setItem(inv, 14, light_gray_glass);
- inv.setItem(inv, 15, light_gray_glass);
- inv.setItem(inv, 20, lime_glass);
- inv.setItem(inv, 21, lime_glass);
- inv.setItem(inv, 23, lime_glass);
- inv.setItem(inv, 24, lime_glass);
- } elseif(c == 3) {
- inv.setItem(inv, 8, item.create("black_stained_glass_pane", 1, "§rHT: 3' 6''", null));
- inv.setItem(inv, 20, light_gray_glass);
- inv.setItem(inv, 21, light_gray_glass);
- inv.setItem(inv, 23, light_gray_glass);
- inv.setItem(inv, 24, light_gray_glass);
- inv.setItem(inv, 29, lime_glass);
- inv.setItem(inv, 30, lime_glass);
- inv.setItem(inv, 32, lime_glass);
- inv.setItem(inv, 33, lime_glass);
- inv.setItem(inv, 48, green_glass);
- } elseif(c == 4) {
- inv.setItem(inv, 29, light_gray_glass);
- inv.setItem(inv, 30, light_gray_glass);
- inv.setItem(inv, 32, light_gray_glass);
- inv.setItem(inv, 33, light_gray_glass);
- inv.setItem(inv, 38, lime_glass);
- inv.setItem(inv, 39, lime_glass);
- inv.setItem(inv, 41, lime_glass);
- inv.setItem(inv, 42, lime_glass);
- } elseif(c == 5) {
- inv.setItem(inv, 18, item.create("black_stained_glass_pane", 1, "§rWT: 92 lbs", null));
- inv.setItem(inv, 38, light_gray_glass);
- inv.setItem(inv, 39, light_gray_glass);
- inv.setItem(inv, 41, light_gray_glass);
- inv.setItem(inv, 42, light_gray_glass);
- inv.setItem(inv, 29, lime_glass);
- inv.setItem(inv, 30, lime_glass);
- inv.setItem(inv, 32, lime_glass);
- inv.setItem(inv, 33, lime_glass);
- inv.setItem(inv, 49, green_glass);
- } elseif(c == 6) {
- inv.setItem(inv, 29, light_gray_glass);
- inv.setItem(inv, 30, light_gray_glass);
- inv.setItem(inv, 32, light_gray_glass);
- inv.setItem(inv, 33, light_gray_glass);
- inv.setItem(inv, 20, lime_glass);
- inv.setItem(inv, 21, lime_glass);
- inv.setItem(inv, 23, lime_glass);
- inv.setItem(inv, 24, lime_glass);
- } elseif(c == 7) {
- inv.setItem(inv, 26, item.create("black_stained_glass_pane", 1, string.concat("§rC: ", string.toUpperCase(amongus.getPlayerColor(p))), null));
- inv.setItem(inv, 20, light_gray_glass);
- inv.setItem(inv, 21, light_gray_glass);
- inv.setItem(inv, 23, light_gray_glass);
- inv.setItem(inv, 24, light_gray_glass);
- inv.setItem(inv, 11, lime_glass);
- inv.setItem(inv, 12, lime_glass);
- inv.setItem(inv, 14, lime_glass);
- inv.setItem(inv, 15, lime_glass);
- inv.setItem(inv, 50, green_glass);
- } elseif(c == 8) {
- inv.setItem(inv, 11, light_gray_glass);
- inv.setItem(inv, 12, light_gray_glass);
- inv.setItem(inv, 14, light_gray_glass);
- inv.setItem(inv, 15, light_gray_glass);
- inv.setItem(inv, 2, lime_glass);
- inv.setItem(inv, 3, lime_glass);
- inv.setItem(inv, 4, lime_glass);
- inv.setItem(inv, 5, lime_glass);
- inv.setItem(inv, 6, lime_glass);
- } elseif(c == 9) {
- inv.setItem(inv, 36, item.create("black_stained_glass_pane", 1, "§rBT: O-", null));
- inv.setItem(inv, 2, light_gray_glass);
- inv.setItem(inv, 3, light_gray_glass);
- inv.setItem(inv, 4, light_gray_glass);
- inv.setItem(inv, 5, light_gray_glass);
- inv.setItem(inv, 6, light_gray_glass);
- inv.setItem(inv, 51, green_glass);
- } else {
- inv.setItem(inv, 44, item.custom.create("CHECK_GREEN", 1, "§rTask completed", null));
- removeTaskParticle(p, scan_par_loc);
- step = task.stepIncrease(p, 16);
- giveTask(p, 16, "MED", "Submit Scan", 1, 1, null);
- sgoto_auto_close_inv(p_uuid);
- goto("checkgame");
- }
- map.add(submit_scan_map, p_uuid, c + 1);
- list.add(submit_scan_list, p_uuid);
- sgoto(20, "submit_scan");
- goto("checkgame");
- function set_engine(player, inv, direction) {
- player_uuid = player.getUuid(player);
- pos = map.get($align_engine_map, player_uuid);
- if(direction == "up") {
- new_pos = pos + 1;
- } elseif(direction == "down") {
- new_pos = pos - 1;
- } else {
- new_pos = pos;
- }
- if(new_pos < 0 || new_pos > 10) {
- return false;
- }
- map.add($align_engine_map, player_uuid, new_pos);
- //remove old pattern
- temp_list = $align_engine_array[pos];
- iter = iterator(temp_list);
- while(hasNext(iter)) {
- slot = next(iter);
- if(slot < 18 || slot > 26) {
- inv.setItem(inv, slot, $gray_glass);
- } else {
- inv.setItem(inv, slot, $light_gray_glass);
- }
- }
- //set new pattern
- temp_list = $align_engine_array[new_pos];
- iter = iterator(temp_list);
- while(hasNext(iter)) {
- slot = next(iter);
- if(slot < 18 || slot > 26) {
- inv.setItem(inv, slot, $red_glass);
- } else {
- inv.setItem(inv, slot, $green_glass);
- }
- }
- return new_pos == 5;
- }
- function cam.enter(player) {
- if(player.isOnCam(player)) {
- return;
- }
- player.hideOnline(player);
- amongus.manageEffects(player);
- entity.setGravity(player, false);
- player_uuid = player.getUuid(player);
- list.add($cam_list, player_uuid);
- player.giveItem(player, $prev_cam_item);
- player.giveItem(player, $next_cam_item);
- player.giveItem(player, $leave_cam_item);
- if(isImpostor(player)) {
- cooldown = data.getTimer(player, "Kill Cooldown");
- map.add($holded_kill_cooldown, player_uuid, cooldown);
- }
- if($cam_loop == false) {
- $cam_loop = true;
- sgoto(10, "cam_tp_loop");
- }
- }
- function cam.leave(player) {
- player_uuid = player.getUuid(player);
- list.remove($cam_list, player_uuid);
- map.remove($cam_map, player_uuid);
- ent = map.get($cam_map_3, player_uuid);
- if(ent != null) {
- map.remove($cam_map_3, ent);
- map.remove($cam_map_4, ent);
- entity.remove(ent);
- }
- entity.teleport(player, map.get($cam_map_2, player_uuid));
- list.add($gravity_list, player.getUuid(player));
- sgoto(2, "setGravity");
- if(list.getSize($cam_list) == 0) {
- $cam_loop = false;
- }
- player.removeItem(player, $prev_cam_item);
- player.removeItem(player, $next_cam_item);
- player.removeItem(player, $leave_cam_item);
- amongus.manageEffects(player);
- if(!player.isGhost(player)) {
- player.showOnline(player);
- }
- }
- @setGravity
- p_uuid = list.getIndex(gravity_list, 0);
- list.removeIndex(gravity_list, 0);
- p = player.get(p_uuid);
- if(p != null) {
- entity.setGravity(p, true);
- }
- goto("checkgame");
- function player.isOnCam(player) {
- return list.contains($cam_list, player.getUuid(player));
- }
- @cam_tp_loop
- show_cam_pars = false;
- iter = iterator(cam_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- cam_number = map.get(cam_map, p_uuid);
- tp_loc = list.getIndex(cams_locs_tp, cam_number);
- entity.teleport(p, tp_loc);
- if(isImpostor(p)) {
- cooldown = map.getOrDefault(holded_kill_cooldown, player_uuid, -1);
- if(cooldown != -1) {
- data.setTimer(p, "Kill Cooldown", cooldown);
- kill_bar = map.get(imp_kill_bars, player_uuid);
- updateKillBossBar(kill_bar, cooldown / 20);
- }
- }
- if(!player.isGhost(p)) {
- show_cam_pars = true;
- }
- }
- if(show_cam_pars) {
- iter = iterator(cams_par_locs);
- while(hasNext(iter)) {
- particle.spawn(next(iter), cam_par);
- }
- }
- if(cam_loop) {
- sgoto(10, "cam_tp_loop");
- }
- goto("checkgame");
- function vent_enter(player, vent_loc) {
- tp_loc = map.get($vent_map, vent_loc);
- entity.teleport(player, tp_loc);
- player.hideOnline(player);
- removeImpostorItems(player);
- player_uuid = player.getUuid(player);
- map.add($vent_map_2, player_uuid, tp_loc);
- map.add($vent_map_4, player_uuid, vent_loc);
- a = map.get($vent_map_3, vent_loc);
- icon_1 = a[0];
- icon_2 = a[2];
- inv = player.getInv(player);
- if(icon_1 == null) {
- inv.setItem(inv, 6, null);
- } else {
- inv.setItem(inv, 6, icon_1);
- }
- if(!list.contains($vent_list, player_uuid)) {
- list.add($vent_list, player_uuid);
- }
- if(icon_2 == null) {
- inv.setItem(inv, 7, null);
- } else {
- inv.setItem(inv, 7, icon_2);
- }
- inv.setItem(inv, 8, $leave_vent_item);
- if($vent_loop == false) {
- $vent_loop = true;
- sgoto(10, "vent_tp_loop");
- }
- }
- function vent_leave(player) {
- player_uuid = player.getUuid(player);
- list.remove($vent_list, player_uuid);
- map.remove($vent_map_2, player_uuid);
- map.remove($vent_map_4, player_uuid);
- player.showOnline(player);
- if(list.getSize($vent_list) == 0) {
- $vent_loop = false;
- }
- color = amongus.getPlayerColor(player);
- player.removeItem(player, $vent_left_item);
- player.removeItem(player, $vent_right_item);
- player.removeItem(player, $vent_up_item);
- player.removeItem(player, $vent_down_item);
- player.removeItem(player, $leave_vent_item);
- if(isImpostor(player)) {
- giveImpostorItems(player);
- }
- }
- @vent_tp_loop
- iter = iterator(vent_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- tp_loc = map.get(vent_map_2, p_uuid);
- entity.teleport(p, tp_loc);
- if(isImpostor(p)) {
- cooldown = map.getOrDefault(holded_kill_cooldown, player_uuid, -1);
- if(cooldown != -1) {
- data.setTimer(p, "Kill Cooldown", cooldown);
- kill_bar = map.get(imp_kill_bars, player_uuid);
- updateKillBossBar(kill_bar, cooldown / 20);
- }
- }
- }
- if(vent_loop) {
- sgoto(10, "vent_tp_loop");
- }
- goto("checkgame");
- @space_loop
- loc_iter = iterator(space_locs);
- while(hasNext(loc_iter)) {
- particle.spawn(next(loc_iter), space_par);
- }
- sgoto(50, "space_loop");
- goto("checkgame");
- @task_part_loop
- iter = iterator(player_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- my_list = map.get(task_part_map, p_uuid);
- if(my_list != null) {
- loc_iter = iterator(my_list);
- while(hasNext(loc_iter)) {
- particle.spawnPlayer(next(loc_iter), task_par, p, 1, 0, 0.05, 0.05, 0.05);
- }
- }
- }
- sgoto(10, "task_part_loop");
- goto("checkgame");
- function addSaboParticles(location1, location2) {
- list.add($sabo_par_list, location1);
- if(location2 != null) {
- list.add($sabo_par_list, location2);
- }
- sgoto(10, "sabo_par_loop");
- }
- function removeSaboParticles(location1, location2) {
- list.remove($sabo_par_list, location1);
- if(location2 != null) {
- list.remove($sabo_par_list, location2);
- }
- }
- @sabo_par_loop
- if(!amongus.isAlert()) {
- goto("checkgame");
- }
- loc_iter = iterator(sabo_par_list);
- while(hasNext(loc_iter)) {
- particle.spawn(next(loc_iter), sabo_par);
- }
- sgoto(10, "sabo_par_loop");
- goto("checkgame");
- function addTaskParticle(player, location) {
- if(isCrewmate(player) || $freeplay) {
- player_uuid = player.getUuid(player);
- my_list = map.get($task_part_map, player_uuid);
- if(my_list == null) {
- my_list = list.new();
- map.add($task_part_map, player_uuid, my_list);
- }
- list.add(my_list, location);
- }
- }
- function removeTaskParticle(player, location) {
- player_uuid = player.getUuid(player);
- my_list = map.get($task_part_map, player_uuid);
- if(my_list == null) {
- my_list = list.new();
- map.add($task_part_map, player_uuid, my_list);
- }
- list.remove(my_list, location);
- }
- function reactor.setHeader(inv, item) {
- for(i = 2; i < 7; i++) {
- inv.setItem(inv, i, item);
- }
- }
- function reactor.setLeftSide(inv, item) {
- inv.setItem(inv, 19, item);
- inv.setItem(inv, 20, item);
- inv.setItem(inv, 21, item);
- inv.setItem(inv, 28, item);
- inv.setItem(inv, 29, item);
- inv.setItem(inv, 30, item);
- inv.setItem(inv, 37, item);
- inv.setItem(inv, 38, item);
- inv.setItem(inv, 39, item);
- }
- function reactor.setRightSide(inv, item) {
- inv.setItem(inv, 23, item);
- inv.setItem(inv, 24, item);
- inv.setItem(inv, 25, item);
- inv.setItem(inv, 32, item);
- inv.setItem(inv, 33, item);
- inv.setItem(inv, 34, item);
- inv.setItem(inv, 41, item);
- inv.setItem(inv, 42, item);
- inv.setItem(inv, 43, item);
- }
- function reactor.get(player_or_uuid) {
- if(isPlayer(player_or_uuid)) {
- player_or_uuid = player.getUuid(player_or_uuid);
- }
- reactor_array = map.get($start_reactor_map, player_or_uuid);
- return reactor_array;
- }
- function reactor.save(reactor_array, player) {
- player_uuid = player.getUuid(player);
- map.add($start_reactor_map, player_uuid, reactor_array);
- }
- function reactor.setInv(reactor_array, inv) {
- reactor_array[0] = inv;
- }
- function reactor.getInv(reactor_array) {
- return reactor_array[0];
- }
- function reactor.setStage(reactor_array, stage) {
- reactor_array[1] = stage;
- }
- function reactor.getStage(reactor_array) {
- return reactor_array[1];
- }
- function reactor.setCounter(reactor_array, counter) {
- reactor_array[2] = counter;
- }
- function reactor.getCounter(reactor_array) {
- return reactor_array[2];
- }
- function reactor.setPattern(reactor_array) {
- pattern = array.new(5);
- for(i = 0; i < 5; i++) {
- r = math.random(1, 9);
- if(r < 4) {
- r += 18;
- } elseif(r < 7) {
- r += 24;
- } else {
- r += 30;
- }
- pattern[i] = r;
- }
- reactor_array[3] = pattern;
- }
- function reactor.getPattern(reactor_array) {
- return reactor_array[3];
- }
- function reactor.setPhase(reactor_array, phase) {
- reactor_array[4] = phase;
- }
- function reactor.getPhase(reactor_array) {
- return reactor_array[4];
- }
- function sabotage.holdReactor(inv, hold) {
- if(hold) {
- item = $lime_glass;
- } else {
- item = $red_glass;
- }
- for(i = 0; i < 54; i++) {
- inv.setItem(inv, i, item);
- }
- }
- function switchLights(boolean) {
- if(boolean) {
- mat = material.get("sea_lantern");
- } else {
- mat = material.get("smooth_stone");
- }
- iter = iterator($lights_blocks);
- while(hasNext(iter)) {
- block.setMaterial(next(iter), mat);
- }
- }
- @draw_comms
- player_uuid = list.getIndex(comms_state_list, 0);
- list.removeIndex(comms_state_list, 0);
- if(!comms_sabotaged) {
- goto("checkgame");
- }
- inv = map.get(comms_inv_map, player_uuid);
- if(inv == null) {
- goto("checkgame");
- }
- comms_state = map.get(comms_state_map, player_uuid);
- counter = map.getOrDefault(comms_counter_map, player_uuid, 0);
- if(comms_state == 0) {
- //worst
- for(i = 26; i >= 9; i--) {
- inv.setItem(inv, i, inv.getItem(inv, i - 1));
- }
- if(counter == 1) {
- counter = 0;
- } else {
- inv.setItem(inv, 9, red_glass);
- counter++;
- }
- } elseif(comms_state == 1) {
- //close
- for(i = 26; i > 0; i--) {
- inv.setItem(inv, i, inv.getItem(inv, i - 1));
- }
- if(counter == 3) {
- inv.setItem(inv, 0, yellow_glass);
- inv.setItem(inv, 18, black_glass);
- counter = 0;
- } elseif(counter == 2) {
- inv.setItem(inv, 9, yellow_glass);
- counter++;
- } elseif(counter == 0) {
- inv.setItem(inv, 0, black_glass);
- counter++;
- } else {
- counter++;
- }
- } elseif(comms_state == 2) {
- //correct
- for(i = 35; i > 0; i--) {
- inv.setItem(inv, i, inv.getItem(inv, i - 1));
- }
- if(counter == 5) {
- inv.setItem(inv, 0, lime_glass);
- counter = 0;
- } elseif(counter == 4) {
- inv.setItem(inv, 9, lime_glass);
- inv.setItem(inv, 27, black_glass);
- counter++;
- } elseif(counter == 2) {
- inv.setItem(inv, 9, black_glass);
- inv.setItem(inv, 27, lime_glass);
- counter++;
- } elseif(counter == 0) {
- inv.setItem(inv, 0, black_glass);
- inv.setItem(inv, 9, lime_glass);
- inv.setItem(inv, 27, black_glass);
- counter++;
- } else {
- counter++;
- }
- }
- map.add(comms_counter_map, player_uuid, counter);
- list.add(comms_state_list, player_uuid);
- sgoto(5, "draw_comms");
- goto("checkgame");
- function comms.drawCorrect(inv, player) {
- player_uuid = player.getUuid(player);
- map.add($comms_state_map, player_uuid, 2);
- map.remove($comms_counter_map, player_uuid);
- for(i = 0; i < 36; i++) {
- inv.setItem(inv, i, $black_glass);
- }
- inv.setItem(inv, 0, $lime_glass);
- inv.setItem(inv, 6, $lime_glass);
- inv.setItem(inv, 10, $lime_glass);
- inv.setItem(inv, 14, $lime_glass);
- inv.setItem(inv, 16, $lime_glass);
- inv.setItem(inv, 20, $lime_glass);
- inv.setItem(inv, 22, $lime_glass);
- inv.setItem(inv, 26, $lime_glass);
- inv.setItem(inv, 30, $lime_glass);
- }
- function comms.drawClose(inv, player) {
- player_uuid = player.getUuid(player);
- map.add($comms_state_map, player_uuid, 1);
- map.remove($comms_counter_map, player_uuid);
- for(i = 0; i < 36; i++) {
- inv.setItem(inv, i, $black_glass);
- }
- inv.setItem(inv, 0, $yellow_glass);
- inv.setItem(inv, 4, $yellow_glass);
- inv.setItem(inv, 8, $yellow_glass);
- inv.setItem(inv, 10, $yellow_glass);
- inv.setItem(inv, 12, $yellow_glass);
- inv.setItem(inv, 14, $yellow_glass);
- inv.setItem(inv, 16, $yellow_glass);
- inv.setItem(inv, 20, $yellow_glass);
- inv.setItem(inv, 24, $yellow_glass);
- }
- function comms.drawWorst(inv, player) {
- player_uuid = player.getUuid(player);
- map.add($comms_state_map, player_uuid, 0);
- map.remove($comms_counter_map, player_uuid);
- for(i = 0; i < 9; i++) {
- inv.setItem(inv, i, $black_glass);
- }
- for(i = 27; i < 36; i++) {
- inv.setItem(inv, i, $black_glass);
- }
- for(i = 9; i < 27; i = i + 2) {
- inv.setItem(inv, i, $black_glass);
- }
- for(i = 10; i < 27; i = i + 2) {
- inv.setItem(inv, i, $red_glass);
- }
- }
- @scheduled_fix_comms
- player_uuid = list.getIndex(comms_fix_list, 0);
- list.removeIndex(comms_fix_list, 0);
- time = map.get(comms_fix_map, player_uuid);
- if(time == null) {
- goto("checkgame");
- }
- if(time.getMillis() - time <= 2000) {
- fix_comms();
- }
- goto("checkgame");
- function sabotage.openedInv(player) {
- list.add($sabo_list, player.getUuid(player));
- }
- function sabotage.closedInv(player) {
- list.remove($sabo_list, player.getUuid(player));
- }
- function sabotage.closeInvs() {
- iter = iterator($sabo_list);
- while(hasNext(iter)) {
- inv.close(player.get(next(iter)));
- }
- }
- @scheduled_sabo_close
- sabotage.closeInvs();
- goto("checkgame");
- function task.stepIncrease(player, task_id) {
- player_uuid = player.getUuid(player);
- map = map.get($task_steps, player_uuid);
- if(map == null) {
- map = map.new();
- }
- step = map.getOrDefault(map, task_id, 0) + 1;
- map.add(map, task_id, step);
- map.add($task_steps, player_uuid, map);
- return step;
- }
- function task.getStep(player, task_id) {
- map = map.get($task_steps, player.getUuid(player));
- if(map == null) {
- return 0;
- }
- return map.getOrDefault(map, task_id, 0);
- }
- function task.resetSteps(player) {
- map.add($task_steps, player.getUuid(player), map.new());
- }
- function amongus.setPlayerColor(player, color) {
- player_uuid = player.getUuid(player);
- map.add($player_colors, player_uuid, color);
- }
- function amongus.getPlayerColor(player_or_uuid) {
- if(isPlayer(player_or_uuid)) {
- player_or_uuid = player.getUuid(player_or_uuid);
- }
- return map.get($player_colors, player_or_uuid);
- }
- function amongus.getPlayerColorCode(player_or_uuid) {
- color = amongus.getPlayerColor(player_or_uuid);
- return map.getOrDefault($color_code_map, color, "§r");
- }
- function amongus.isUsedPlayerColor(color) {
- iter = map.iterator($player_colors);
- while(hasNext(iter)) {
- element = next(iter);
- value = map.getValue(element);
- if(value == color) {
- return true;
- }
- }
- return false;
- }
- function amongus.removeEquip(player) {
- living.setEquip(player, slot.getHead(), $air_item);
- living.setEquip(player, slot.getChest(), $air_item);
- living.setEquip(player, slot.getLegs(), $air_item);
- living.setEquip(player, slot.getFeet(), $air_item);
- }
- function amongus.equipHuman(human, color, player) {
- item = player.getHead(player.getUuid(player), player.getName(player));
- living.setEquip(human, slot.getHead(), item);
- amongus.equip(human, color);
- }
- function amongus.equip(entity, color) {
- color_code = map.get($cloth_code_map, color);
- if(isPlayer(entity)) {
- item = player.getHead(player.getUuid(entity), player.getName(entity));
- living.setEquip(entity, slot.getHead(), item);
- }
- item = read.item(string.concat("{id:\"minecraft:leather_chestplate\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
- item.addFlag(item, "HIDE_ATTRIBUTES");
- living.setEquip(entity, slot.getChest(), item);
- item = read.item(string.concat("{id:\"minecraft:leather_leggings\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
- item.addFlag(item, "HIDE_ATTRIBUTES");
- living.setEquip(entity, slot.getLegs(), item);
- item = read.item(string.concat("{id:\"minecraft:leather_boots\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
- item.addFlag(item, "HIDE_ATTRIBUTES");
- living.setEquip(entity, slot.getFeet(), item);
- }
- function createVoteInv(player, reporter_uuid) {
- //inv = inv.new("022200222 022200222 022200222 022200222 022200222 022200000");
- inv = inv.new("022200222022200222022200222022200222022200222022200000", text.new("§cVOTE"));
- index = 1;
- iter = iterator($all_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p_name = player.getName(p_uuid);
- head = player.getHead(p_uuid, p_name);
- color = amongus.getPlayerColorCode(p_uuid);
- if(player.isGhost(p_uuid)) {
- item.setName(head, text.new(string.concat("§r", color, p_name)));
- inv.setItem(inv, index - 1, $zombie_head);
- } else {
- item.setName(head, text.new(string.concat("§rVote for ", color, p_name)));
- if(p_uuid == reporter_uuid) {
- item.setAmount(head, 2);
- }
- }
- inv.setItem(inv, index, head);
- if((index - 1) % 9 == 0) {
- index = index + 5;
- } else {
- index = index + 4;
- }
- }
- inv.setItem(inv, 46, item.custom.create("RETURN_GREEN", 1, "§rSkip Vote", null));
- map.add($vote_inv_map, player.getUuid(player), inv);
- }
- function getVoteInv(player) {
- return map.get($vote_inv_map, player.getUuid(player));
- }
- function setItemInVoteInv(slot, item) {
- iter = iterator($player_list);
- while(hasNext(iter)) {
- p = player.get(next(iter));
- inv = getVoteInv(p);
- inv.setItem(inv, slot, item);
- }
- }
- function amongus.isAlert() {
- return $alert;
- }
- function amongus.setAlert(bool) {
- $alert = bool;
- }
- function addVentIcons(vent_loc, icon_1, vent_tp_loc_1, icon_2, vent_tp_loc_2) {
- a = array.new(4);
- a[0] = icon_1;
- a[1] = vent_tp_loc_1;
- a[2] = icon_2;
- a[3] = vent_tp_loc_2;
- map.add($vent_map_3, vent_loc, a);
- }
- function minigame.canStartIndiv() {
- if(minigame.isStarting()) {
- return false;
- }
- player_list = minigame.getPlayers($script_id);
- p_amount = list.getSize(player_list);
- return p_amount == minigame.getMinPlayers() || p_amount >= $multi_minplayers;
- }
- @crewmate_win
- winners = "§bCrewmates";
- if(freeplay) {
- endtime = time.getMillis();
-
- p_uuid = list.getIndex(player_list, 0);
- p = player.get(p_uuid);
- time = math.round((endtime - starttime) / 1000);
- last_record = ranking.getPoints(rankingtable, p);
- if(last_record == 0 || time < last_record) {
- record = time;
- diff = last_record - time;
- } else {
- record = last_record;
- }
- ranking.setPoints(rankingtable, p, record);
- mins = math.roundDown(time / 60);
- secs = math.roundComma(time % 60, 2);
- rec_mins = math.roundDown(record / 60);
- rec_secs = math.roundComma(record % 60, 2);
- minigame.statsHeader(p, gamename, "§e");
- minigame.statsLine(p, "§e", "Time", string.concat(string.number(mins), " min ", string.number(secs), " s"));
- minigame.statsLine(p, "§e", "Your record", string.concat(string.number(rec_mins), " min ", string.number(rec_secs), " s"));
- if(diff != null) {
- msg(p, " §e- §rBeat own record by §e", string.concat(string.number(diff), " s"));
- }
- }
- goto("win");
- @checkwin
- imps_alive = 0;
- crew_alive = 0;
- iter = iterator(player_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- if(!player.isGhost(p)) {
- if(isImpostor(p)) {
- imps_alive++;
- } else {
- crew_alive++;
- }
- }
- }
- if(imps_alive == 0) {
- winners = "§bCrewmates";
- goto("win");
- }
- if(imps_alive >= crew_alive) {
- winners = "§cImpostors";
- goto("win");
- }
- goto("checkgame");
- @win
- imp_string = "";
- iter = iterator(impostors_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p_name = player.getName(p_uuid);
- p = player.get(p_uuid);
- string = string.concat(amongus.getPlayerColorCode(p_uuid), p_name);
- if(imp_string == "") {
- imp_string = string;
- } else {
- imp_string = string.concat(imp_string, ", ", string);
- }
- if(winners == "§cImpostors") {
- //money.addBoost(p, 128);
- } else {
- //money.addBoost(p, 32);
- }
- }
- iter = iterator(player_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- msg.prefix(p, $gamename, string.concat("The ", winners, "§r have won the game."));
- msg.prefix(p, $gamename, string.concat("§4Impostors: §r", imp_string));
- inv.close(p);
- boss.removePlayer(progress_bar, p);
- player.gameMute(p, false);
- player.showOnline(p);
- living.setInvisible(p, false);
- if(winners == "§bCrewmates") {
- //money.addBoost(p, 128);
- } else {
- //money.addBoost(p, 32);
- }
- }
- //Building-Perms wieder geben
- for(i = 0; i < list.getSize(removed_perms); i++) {
- player_uuid = list.getIndex(removed_perms, i);
- //PERMS perm.registerPlayer(player_uuid, 1);
- //PERMS perm.registerPlayer(player_uuid, 15);
- }
- script = script.getFromId(script_id);
- removeDeadBodies();
- removeCamBodies();
- minigame.kickAllPlayers(script);
- minigame.term(script, gamesignloc);
- term();
- @on_error
- msg.dev("Error Handler activated");
- if(progress_bar != null) {
- boss.removeAll(progress_bar);
- }
- if(meeting_bar != null) {
- boss.removeAll(meeting_bar);
- }
- if(sabotage_cooldown_bar != null) {
- boss.removeAll(sabotage_cooldown_bar);
- }
- if(script_id != null) {
- minigame.msgAll("§cThere was an error in the game.");
- if(imp_kill_bars != null) {
- player_list = minigame.getPlayers(script_id);
- iter = iterator(player_list);
- while(hasNext(iter)) {
- p_uuid = next(iter);
- p = player.get(p_uuid);
- if(p != null) {
- living.clearEffects(p);
- player.showOnline(p);
- living.setInvisible(p, false);
- entity.setGravity(p, false);
- }
- my_kill_bar = map.get(imp_kill_bars, p_uuid);
- if(my_kill_bar != null) {
- boss.removeAll(my_kill_bar);
- }
- }
- }
- minigame.kickAllPlayers(script_id);
- }
- msg.dev("Script terminated (Minigame).");
- term();
|