among_us.txt 176 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708
  1. /*
  2. --- Version 2 ---
  3. //PERMS
  4. Hats
  5. Sabotage: Door Closing
  6. Visual Tasks
  7. Stay in lobby after win
  8. rauswerf animation. tp auf tisch. float effect.
  9. setting: full vision/blindness (darkness effect? 1.19)
  10. */
  11. @game_core
  12. event.load("entity_dismount");
  13. event.load("snuvi_click");
  14. event.load("player_drop");
  15. player_colors = map.new();
  16. minigame.setSpecificLobbyHandling(true);
  17. minigame.setNoLobbyTeleport(true);
  18. minigame.setPlayerResetInCore(false);
  19. minigame.setManualStart(true);
  20. gamename = "§cAmong Us";
  21. game_short = "among_us";
  22. rankingtable = "among_us_ranks";
  23. item_arrow_left = item.custom.create("ARROW_LEFT", 1, null, null);
  24. item_arrow_right = item.custom.create("ARROW_RIGHT", 1, null, null);
  25. item_arrow_up = item.custom.create("ARROW_UP", 1, null, null);
  26. item_arrow_down = item.custom.create("ARROW_DOWN", 1, null, null);
  27. sabotage_menu = inv.new("222200000", text.new("§cSABOTAGE"));
  28. inv.setItem(sabotage_menu, 0, item.create("REDSTONE_LAMP", 1, "§fSabotage Light", null));
  29. inv.setItem(sabotage_menu, 1, item.create("END_CRYSTAL", 1, "§fSabotage Reactor", null));
  30. inv.setItem(sabotage_menu, 2, item.create("OAK_SAPLING", 1, "§fSabotage Oxygen", null));
  31. inv.setItem(sabotage_menu, 3, item.create("PAPER", 1, "§fSabotage Communication", null));
  32. settings_inv = inv.new("222222222222222222222222222222222222222222222222222222", text.new("§cSettings"));
  33. for(i = 0; i < 9; i++) {
  34. inv.setItem(settings_inv, i, item_arrow_up);
  35. }
  36. inv.setItem(settings_inv, 9, item.custom.create("GEAR", 1, string.concat("§rImpostors: ", string.number(amount_impostors)), null));
  37. inv.setItem(settings_inv, 10, item.custom.create("GEAR", 1, string.concat("§rShort Tasks: ", string.number(amount_short)), null));
  38. inv.setItem(settings_inv, 11, item.custom.create("GEAR", 1, string.concat("§rCommon Tasks: ", string.number(amount_common)), null));
  39. inv.setItem(settings_inv, 12, item.custom.create("GEAR", 1, string.concat("§rLong Tasks: ", string.number(amount_long)), null));
  40. inv.setItem(settings_inv, 13, item.custom.create("GEAR", 1, string.concat("§rAmount Meetings: ", string.number(amount_meetings)), null));
  41. inv.setItem(settings_inv, 14, item.custom.create("GEAR", 1, string.concat("§rMeeting Cooldown: ", string.number(meeting_cooldown)), null));
  42. inv.setItem(settings_inv, 15, item.custom.create("GEAR", 1, string.concat("§rDiscussion Time: ", string.number(discuss_time)), null));
  43. inv.setItem(settings_inv, 16, item.custom.create("GEAR", 1, string.concat("§rVoting Time: ", string.number(vote_time)), null));
  44. inv.setItem(settings_inv, 17, item.custom.create("GEAR", 1, string.concat("§rSpeed: ", string.number(move_speed)), null));
  45. for(i = 18; i < 27; i++) {
  46. inv.setItem(settings_inv, i, item_arrow_down);
  47. }
  48. for(i = 27; i < 29; i++) {
  49. inv.setItem(settings_inv, i, item_arrow_up);
  50. }
  51. inv.setItem(settings_inv, 36, item.custom.create("GEAR", 1, string.concat("§rKill Cooldown: ", string.number(kill_cooldown)), null));
  52. inv.setItem(settings_inv, 37, item.custom.create("GEAR", 1, string.concat("§rConfirm Ejects: ", confirm_ejects), null));
  53. //inv.setItem(settings_inv, 38, item.custom.create("GEAR", 1, string.concat("§r: ", string.number()), null));
  54. //inv.setItem(settings_inv, 39, item.custom.create("GEAR", 1, string.concat("§r: ", string.number()), null));
  55. //inv.setItem(settings_inv, 40, item.custom.create("GEAR", 1, string.concat("§r: ", string.number()), null));
  56. //inv.setItem(settings_inv, 41, item.custom.create("GEAR", 1, string.concat("§r: ", string.number()), null));
  57. //inv.setItem(settings_inv, 42, item.custom.create("GEAR", 1, string.concat("§r: ", string.number()), null));
  58. //inv.setItem(settings_inv, 43, item.custom.create("GEAR", 1, string.concat("§r: ", string.number()), null));
  59. //inv.setItem(settings_inv, 44, item.custom.create("GEAR", 1, string.concat("§r: ", string.number()), null));
  60. for(i = 45; i < 47; i++) {
  61. inv.setItem(settings_inv, i, item_arrow_down);
  62. }
  63. color_list = list.new();
  64. list.add(color_list, "dark_gray");
  65. list.add(color_list, "cyan");
  66. list.add(color_list, "red");
  67. list.add(color_list, "blue");
  68. list.add(color_list, "orange");
  69. list.add(color_list, "green");
  70. list.add(color_list, "gray");
  71. list.add(color_list, "white");
  72. list.add(color_list, "pink");
  73. list.add(color_list, "purple");
  74. list.add(color_list, "yellow");
  75. list.add(color_list, "lime");
  76. cloth_code_map = map.new();
  77. map.add(cloth_code_map, "dark_gray", 4673362);
  78. map.add(cloth_code_map, "cyan", 1481884);
  79. map.add(cloth_code_map, "red", 11546150);
  80. map.add(cloth_code_map, "blue", 3949738);
  81. map.add(cloth_code_map, "orange", 16351261);
  82. map.add(cloth_code_map, "green", 6192150);
  83. map.add(cloth_code_map, "gray", 10329495);
  84. map.add(cloth_code_map, "white", 16383998);
  85. map.add(cloth_code_map, "pink", 15961002);
  86. map.add(cloth_code_map, "purple", 8991416);
  87. map.add(cloth_code_map, "yellow", 16701501);
  88. map.add(cloth_code_map, "lime", 8439583);
  89. color_code_map = map.new();
  90. map.add(color_code_map, "dark_gray", "§8");
  91. map.add(color_code_map, "cyan", "§b");
  92. map.add(color_code_map, "red", "§c");
  93. map.add(color_code_map, "blue", "§9");
  94. map.add(color_code_map, "orange", "§6");
  95. map.add(color_code_map, "green", "§2");
  96. map.add(color_code_map, "gray", "§7");
  97. map.add(color_code_map, "white", "§f");
  98. map.add(color_code_map, "pink", "§d");
  99. map.add(color_code_map, "purple", "§5");
  100. map.add(color_code_map, "yellow", "§e");
  101. map.add(color_code_map, "lime", "§a");
  102. prev_cam_item = item.custom.create("ARROW_LEFT", 1, "§fPrevious cam", null);
  103. next_cam_item = item.custom.create("ARROW_RIGHT", 1, "§fNext cam", null);
  104. leave_cam_item = item.custom.create("CROSS_RED", 1, "§fLeave cam", null);
  105. leave_vent_item = item.custom.create("CROSS_RED", 1, "§fLeave vent", null);
  106. kill_item = item.create("IRON_SWORD", 1, "§fKill", null);
  107. item.addFlag(kill_item, "HIDE_ATTRIBUTES");
  108. sabotage_item = item.custom.create("GEAR", 1, "§fSabotage", null);
  109. open_vote_menu_item = item.custom.create("CROSS_GREEN", 1, "§fOpen vote menu", null);
  110. color_choose_item = item.create("RED_CONCRETE", 1, "§fChoose color", null);
  111. color_choose_inv = inv.new("222222222222000000", text.new("§cChoose your color"));
  112. index = 0;
  113. iter = iterator(color_list);
  114. while(hasNext(iter)) {
  115. color_name = next(iter);
  116. cloth_code = map.get(cloth_code_map, color_name);
  117. color_name = string.upperFirstLetter(color_name);
  118. item = read.item(string.concat("{id:\"minecraft:leather_chestplate\",Count:1b,tag:{Damage:0,display:{color:", cloth_code, ",Name:'{\"text\":\"§r", color_name, "\"}'}}}"));
  119. item.addFlag(item, "HIDE_ATTRIBUTES");
  120. inv.setItem(color_choose_inv, index++, item);
  121. }
  122. minigame.initStart();
  123. minigame.setLobbyCounter(5);
  124. goto("simplelobby");
  125. @specificLobbyHandling
  126. if(event == "minigame_join") {
  127. resetplayer(player);
  128. assignSeat(player);
  129. if(lobby_leader == null) {
  130. lobby_leader = player.getUuid(player);
  131. settings_item = item.custom.create("GEAR", 1, "§fSettings", null);
  132. player.giveItem(player, settings_item);
  133. }
  134. sb.add(player, 99, string.concat("Lobby-Leader: §a", player.getName(lobby_leader)));
  135. sb.add(player, 98, gamename);
  136. sb.add(player, 97, string.concat("Impostors: §a", string.number(amount_impostors)));
  137. sb.add(player, 96, string.concat("Short Tasks: §a", string.number(amount_short)));
  138. sb.add(player, 95, string.concat("Common Tasks: §a", string.number(amount_common)));
  139. sb.add(player, 94, string.concat("Long Tasks: §a", string.number(amount_long)));
  140. sb.add(player, 93, string.concat("Amount Meetings: §a", string.number(amount_meetings)));
  141. sb.add(player, 92, string.concat("Meeting Cooldown: §a", string.number(meeting_cooldown), " s"));
  142. sb.add(player, 91, string.concat("Discussion Time: §a", string.number(discuss_time), " s"));
  143. sb.add(player, 90, string.concat("Voting Time: §a", string.number(vote_time), " s"));
  144. sb.add(player, 89, string.concat("Speed: §a", string.number(move_speed)));
  145. sb.add(player, 88, string.concat("Kill Cooldown: §a", string.number(kill_cooldown), " s"));
  146. sb.add(player, 87, string.concat("Confirm Ejects: §a", confirm_ejects));
  147. sb.add(player, 86, sb.getSpacer());
  148. player.giveItem(player, color_choose_item);
  149. player.setSpeed(player, move_speed);
  150. player.setHunger(player, 20);
  151. player.setSaturation(player, 100);
  152. return;
  153. }
  154. if(event == "player_drop") {
  155. cancel = true;
  156. return;
  157. }
  158. if(event == "block_click") {
  159. if(action != "RIGHT_CLICK_BLOCK" && action != "RIGHT_CLICK_AIR") {
  160. return;
  161. }
  162. if(block != null && block.getLocation(block) == start_sign_loc) {
  163. if(player.getUuid(player) != lobby_leader) {
  164. msg.prefix(player, gamename, "You are not the Lobby-Leader.");
  165. return;
  166. }
  167. if(!minigame.canStartIndiv()) {
  168. msg.prefix(player, gamename, "You need to be alone for singleplayer. For multiplayer more than 2 players are needed.");
  169. return;
  170. }
  171. goto("startcountdown");
  172. }
  173. item = living.getHand(player);
  174. if(item == settings_item) {
  175. if(player.getUuid(player) != lobby_leader) {
  176. return;
  177. }
  178. inv.open(settings_inv, player);
  179. return;
  180. }
  181. if(item == color_choose_item) {
  182. inv.open(color_choose_inv, player);
  183. return;
  184. }
  185. return;
  186. }
  187. if(event == "snuvi_click") {
  188. title_string = string.text(inv_title);
  189. if(title_string == "§cSettings") {
  190. //amount_impostors
  191. if(inv_slot == 0 || inv_slot == 9 || inv_slot == 18) {
  192. if(inv_slot == 0 || inv_slot == 9) {
  193. if(amount_impostors < amount_impostors_max) {
  194. amount_impostors++;
  195. }
  196. } elseif(inv_slot == 18) {
  197. if(amount_impostors > amount_impostors_min) {
  198. amount_impostors--;
  199. }
  200. }
  201. minigame.displayAll(97, string.concat("Impostors: §a", string.number(amount_impostors)));
  202. inv.setItem(settings_inv, 9, item.custom.create("GEAR", 1, string.concat("§rImpostors: ", string.number(amount_impostors)), null));
  203. return;
  204. }
  205. //short_tasks
  206. if(inv_slot == 1 || inv_slot == 10 || inv_slot == 19) {
  207. if(inv_slot == 1 || inv_slot == 10) {
  208. if(amount_short < amount_short_max) {
  209. amount_short++;
  210. }
  211. } elseif(inv_slot == 19) {
  212. if(amount_short > amount_short_min) {
  213. amount_short--;
  214. }
  215. }
  216. minigame.displayAll(96, string.concat("Short Tasks: §a", string.number(amount_short)));
  217. inv.setItem(settings_inv, 10, item.custom.create("GEAR", 1, string.concat("§rShort Tasks: ", string.number(amount_short)), null));
  218. return;
  219. }
  220. //common_tasks
  221. if(inv_slot == 2 || inv_slot == 11 || inv_slot == 20) {
  222. if(inv_slot == 2 || inv_slot == 11) {
  223. if(amount_common < amount_common_max) {
  224. amount_common++;
  225. }
  226. } elseif(inv_slot == 20) {
  227. if(amount_common > amount_common_min) {
  228. amount_common--;
  229. }
  230. }
  231. minigame.displayAll(95, string.concat("Common Tasks: §a", string.number(amount_common)));
  232. inv.setItem(settings_inv, 11, item.custom.create("GEAR", 1, string.concat("§rCommon Tasks: ", string.number(amount_common)), null));
  233. return;
  234. }
  235. //long_tasks
  236. if(inv_slot == 3 || inv_slot == 12 || inv_slot == 21) {
  237. if(inv_slot == 3 || inv_slot == 12) {
  238. if(amount_long < amount_long_max) {
  239. amount_long++;
  240. }
  241. } elseif(inv_slot == 21) {
  242. if(amount_long > amount_long_min) {
  243. amount_long--;
  244. }
  245. }
  246. minigame.displayAll(94, string.concat("Long Tasks: §a", string.number(amount_long)));
  247. inv.setItem(settings_inv, 12, item.custom.create("GEAR", 1, string.concat("§rLong Tasks: ", string.number(amount_long)), null));
  248. return;
  249. }
  250. //amount_meetings
  251. if(inv_slot == 4 || inv_slot == 13 || inv_slot == 22) {
  252. if(inv_slot == 4 || inv_slot == 13) {
  253. if(amount_meetings < amount_meetings_max) {
  254. amount_meetings++;
  255. }
  256. } elseif(inv_slot == 22) {
  257. if(amount_meetings > amount_meetings_min) {
  258. amount_meetings--;
  259. }
  260. }
  261. minigame.displayAll(93, string.concat("Amount Meetings: §a", string.number(amount_meetings)));
  262. inv.setItem(settings_inv, 13, item.custom.create("GEAR", 1, string.concat("§rAmount Meetings: ", string.number(amount_meetings)), null));
  263. return;
  264. }
  265. //meeting_cooldown
  266. if(inv_slot == 5 || inv_slot == 14 || inv_slot == 23) {
  267. if(inv_slot == 5 || inv_slot == 14) {
  268. if(meeting_cooldown < meeting_cooldown_max) {
  269. meeting_cooldown += 5;
  270. }
  271. } elseif(inv_slot == 23) {
  272. if(meeting_cooldown > meeting_cooldown_min) {
  273. meeting_cooldown -= 5;
  274. }
  275. }
  276. minigame.displayAll(92, string.concat("Meeting Cooldown: §a", string.number(meeting_cooldown), " s"));
  277. inv.setItem(settings_inv, 14, item.custom.create("GEAR", 1, string.concat("§rMeeting Cooldown: ", string.number(meeting_cooldown)), null));
  278. return;
  279. }
  280. //discuss_time
  281. if(inv_slot == 6 || inv_slot == 15 || inv_slot == 24) {
  282. if(inv_slot == 6 || inv_slot == 15) {
  283. if(discuss_time < discuss_time_max) {
  284. discuss_time += 5;
  285. }
  286. } elseif(inv_slot == 24) {
  287. if(discuss_time > discuss_time_min) {
  288. discuss_time -= 5;
  289. }
  290. }
  291. minigame.displayAll(91, string.concat("Discussion Time: §a", string.number(discuss_time), " s"));
  292. inv.setItem(settings_inv, 15, item.custom.create("GEAR", 1, string.concat("§rDiscussion Time: ", string.number(discuss_time)), null));
  293. return;
  294. }
  295. //vote_time
  296. if(inv_slot == 7 || inv_slot == 16 || inv_slot == 25) {
  297. if(inv_slot == 7 || inv_slot == 16) {
  298. if(vote_time < vote_time_max) {
  299. vote_time += 5;
  300. }
  301. } elseif(inv_slot == 25) {
  302. if(vote_time > vote_time_min) {
  303. vote_time -= 5;
  304. }
  305. }
  306. minigame.displayAll(90, string.concat("Voting Time: §a", string.number(vote_time), " s"));
  307. inv.setItem(settings_inv, 16, item.custom.create("GEAR", 1, string.concat("§rVoting Time: ", string.number(vote_time)), null));
  308. return;
  309. }
  310. //move_speed
  311. if(inv_slot == 8 || inv_slot == 17 || inv_slot == 26) {
  312. if(inv_slot == 8 || inv_slot == 17) {
  313. if(move_speed < move_speed_max) {
  314. move_speed += 0.25;
  315. }
  316. } elseif(inv_slot == 26) {
  317. if(move_speed > move_speed_min) {
  318. move_speed -= 0.25;
  319. }
  320. }
  321. iter = iterator(minigame.getPlayers(script_id));
  322. while(hasNext(iter)) {
  323. p_uuid = next(iter);
  324. p = player.get(p_uuid);
  325. player.setSpeed(p, move_speed);
  326. }
  327. minigame.displayAll(89, string.concat("Speed: §a", string.number(move_speed)));
  328. inv.setItem(settings_inv, 17, item.custom.create("GEAR", 1, string.concat("§rSpeed: ", string.number(move_speed)), null));
  329. return;
  330. }
  331. //kill_cooldown
  332. if(inv_slot == 27 || inv_slot == 36 || inv_slot == 45) {
  333. if(inv_slot == 27 || inv_slot == 36) {
  334. if(kill_cooldown < kill_cooldown_max) {
  335. kill_cooldown++;
  336. }
  337. } elseif(inv_slot == 45) {
  338. if(kill_cooldown > kill_cooldown_min) {
  339. kill_cooldown--;
  340. }
  341. }
  342. minigame.displayAll(88, string.concat("Kill Cooldown: §a", string.number(kill_cooldown), " s"));
  343. inv.setItem(settings_inv, 36, item.custom.create("GEAR", 1, string.concat("§rKill Cooldown: ", string.number(kill_cooldown)), null));
  344. return;
  345. }
  346. //confirm_ejects
  347. if(inv_slot == 28 || inv_slot == 37 || inv_slot == 46) {
  348. if(confirm_ejects) {
  349. confirm_ejects = false;
  350. } else {
  351. confirm_ejects = true;
  352. }
  353. minigame.displayAll(87, string.concat("Confirm Ejects: §a", confirm_ejects));
  354. inv.setItem(settings_inv, 37, item.custom.create("GEAR", 1, string.concat("§rConfirm Ejects: ", confirm_ejects), null));
  355. return;
  356. }
  357. return;
  358. }
  359. if(title_string == "§cChoose your color") {
  360. clicked_item = inv.getItem(inv, inv_slot);
  361. item_name = string.text(item.getName(clicked_item));
  362. if(string.startsWith(item_name, "§cUsed", 0)) {
  363. return;
  364. }
  365. color = amongus.getPlayerColor(player);
  366. if(color != null) {
  367. item.setName(inv.getItem(inv, list.getIndexOf(color_list, color)), text.new(string.concat("§r", string.upperFirstLetter(color))));
  368. }
  369. new_color = string.removeFormat(string.toLowerCase(item_name));
  370. cloth_color = map.get(cloth_code_map, new_color);
  371. amongus.setPlayerColor(player, new_color);
  372. item.setName(clicked_item, text.new(string.concat("§cUsed by ", player.getName(player))));
  373. amongus.equip(player, new_color);
  374. }
  375. return;
  376. }
  377. if(event == "entity_dismount") {
  378. if(isPlayer(entity)) {
  379. leaveSeat(entity);
  380. }
  381. return;
  382. }
  383. if(event == "player_quit" || event == "player_giveup") {
  384. leaveSeat(player);
  385. if(lobby_leader == player.getUuid(player)) {
  386. list = minigame.getPlayers(script_id);
  387. if(list.getSize(list) != 0) {
  388. lobby_leader = list.getIndex(list, 0);
  389. }
  390. }
  391. }
  392. return;
  393. @finalstart
  394. player_list = minigame.getPlayers(script_id);
  395. air_item = item.getAir();
  396. lime_glass = item.create("lime_stained_glass_pane", 1, "", null);
  397. green_glass = item.create("green_stained_glass_pane", 1, "", null);
  398. red_glass = item.create("red_stained_glass_pane", 1, "", null);
  399. gray_glass = item.create("gray_stained_glass_pane", 1, "", null);
  400. black_glass = item.create("black_stained_glass_pane", 1, "", null);
  401. yellow_glass = item.create("yellow_stained_glass_pane", 1, "", null);
  402. blue_glass = item.create("blue_stained_glass_pane", 1, "", null);
  403. cyan_glass = item.create("cyan_stained_glass_pane", 1, "", null);
  404. light_gray_glass = item.create("light_gray_stained_glass_pane", 1, "", null);
  405. item.addFlag(light_gray_glass, "HIDE_DESTROYS");
  406. gosub("init_map_specific");
  407. progress_bar = boss.create("TOTAL TASKS COMPLETED", "GREEN", "SOLID");
  408. boss.setProgress(progress_bar, 0);
  409. meeting_bar = boss.create("Discussion Time", "WHITE", "SOLID"); //Bossbar für Discussion + Voting
  410. boss.setProgress(meeting_bar, 0);
  411. sabotage_cooldown_bar = boss.create("Sabotage Cooldown", "PURPLE", "SOLID");
  412. boss.setProgress(sabotage_cooldown_bar, 0);
  413. wooden_trapdoors_tag = block.getTag("minecraft:wooden_trapdoors");
  414. shulker_tag = block.getTag("minecraft:shulker_boxes");
  415. master_sound_category = sound.getCategory("MASTER");
  416. kill_sound = sound.get("ENTITY_SLIME_HURT");
  417. task_sound = sound.get("BLOCK_NOTE_BLOCK_CHIME");
  418. vote_sound = sound.get("BLOCK_NOTE_BLOCK_PLING");
  419. vote_ends_sound = sound.get("BLOCK_NOTE_BLOCK_BELL");
  420. crit_sabo_sound = sound.get("BLOCK_NOTE_BLOCK_BELL");
  421. all_list = list.new(); //All players (Ingame + Ghost + Left)
  422. vote_inv_map = map.new();
  423. sabo_par_list = list.new();
  424. ghosts = list.new();
  425. dead_bodies = list.new();
  426. roles = map.new();
  427. player_tasks = map.new();
  428. task_steps = map.new();
  429. all_tasks = map.new();
  430. auto_close_list = list.new();
  431. auto_close_list_2 = list.new();
  432. task_part_map = map.new();
  433. admin_table_map = map.new(); //In welchem Raum befindet sich ein Spieler? (Geister ausgenommen)
  434. admin_table_map_2 = map.new(); //Wie viele Spieler befinden sich in einem Raum? (Geister ausgenommen)
  435. impostors_list = list.new(); //Impostors (Ingame + Ghost + Left)
  436. impostors_list_2 = list.new(); //Impostors (Ingame + Ghost)
  437. impostors_list_3 = list.new(); //Impostors (Ingame)
  438. imp_kill_bars = map.new(); //UUID -> Kill Bossbar
  439. holded_kill_cooldown = map.new();
  440. report_map = map.new();
  441. meeting_amounts = map.new();
  442. removed_perms = list.new(); //Spieler-Uuids, denen Building-Perms entfernt wurden
  443. gravity_list = list.new();
  444. short_tasks = list.new();
  445. list.addAll(short_tasks, 1, 3, 5, 6, 7, 9, 14, 15, 17);
  446. common_tasks = list.new();
  447. list.addAll(common_tasks, 10, 11);
  448. long_tasks = list.new();
  449. list.addAll(long_tasks, 2, 4, 8, 12, 13, 16);
  450. amount_done_tasks = 0;
  451. sabo_list = list.new();
  452. comms_state_list = list.new();
  453. comms_fix_list = list.new();
  454. comms_fix_map = map.new();
  455. comms_state_map = map.new();
  456. comms_counter_map = map.new();
  457. comms_inv_map = map.new();
  458. oxygen_map = map.new();
  459. vent_list = list.new();
  460. vent_map_2 = map.new();
  461. vent_map_4 = map.new();
  462. vent_loop = false;
  463. cam_list = list.new();
  464. cam_map = map.new();
  465. cam_map_2 = map.new();
  466. cam_map_3 = map.new();
  467. cam_map_4 = map.new();
  468. align_engine_map = map.new(); //Position des Engine-Outputs für jeden Spieler
  469. align_engine_map_2 = map.new(); //Dient zur Zuordnung zur Engine-Location bei korrekt ausgerichtetem Engine-Output
  470. align_le_engine_set = set.new(); //Spieler, die Align-Engine bei Lower-Engine gemacht haben
  471. align_ue_engine_set = set.new(); //Spieler, die Align-Engine bei Upper-Engine gemacht haben
  472. submit_scan_list = list.new();
  473. submit_scan_list_2 = list.new();
  474. submit_scan_map = map.new();
  475. submit_scan_map_2 = map.new();
  476. ast_directions = array.new(8);
  477. ast_start_pos = list.new();
  478. ast_start_pos_dirs = map.new();
  479. clear_ast_list = list.new();
  480. clear_ast_list_2 = list.new();
  481. clear_ast_list_3 = list.new();
  482. clear_ast_map = map.new();
  483. clear_ast_map_2 = map.new();
  484. clear_ast_map_3 = map.new();
  485. fuel_counter = map.new();
  486. download_counter = map.new();
  487. download_map = map.new();
  488. download_map_3 = map.new();
  489. download_list = list.new();
  490. download_list_2 = list.new();
  491. chart_course_counter = map.new();
  492. chart_course_pattern = map.new();
  493. manifolds_counter = map.new();
  494. manifolds_list = list.new();
  495. manifolds_list_2 = list.new();
  496. reactor_draw_list_1 = list.new();
  497. reactor_draw_list_2 = list.new();
  498. reset_reactor_draw_list = list.new();
  499. reactor_block_list = list.new();
  500. reset_reactor_click_list = list.new();
  501. reset_reactor_click_list_2 = list.new();
  502. reactor_false_click_list = list.new();
  503. start_reactor_map = map.new();
  504. sample_list = list.new();
  505. sample_list_2 = list.new();
  506. empty_garb_list = list.new();
  507. empty_garb_list_2 = list.new();
  508. empty_garb_map = map.new();
  509. empty_garb_map_2 = map.new();
  510. empty_garb_map_3 = map.new();
  511. sample_map = map.new();
  512. calibrate_dist_list = list.new();
  513. calibrate_dist_list_2 = list.new();
  514. calibrate_dist_map = map.new();
  515. wires_map = map.new();
  516. wires_map_2 = map.new();
  517. wires_map_4 = map.new();
  518. swipe_card_map = map.new();
  519. divert_pow_map_3 = map.new();
  520. clean_o2_map = map.new();
  521. align_engine_array = array.new(11);
  522. temp_list = list.new();
  523. list.addAll(temp_list, 34, 42);
  524. align_engine_array[0] = temp_list;
  525. temp_list = list.new();
  526. list.addAll(temp_list, 25, 32, 33, 39, 40);
  527. align_engine_array[1] = temp_list;
  528. temp_list = list.new();
  529. list.addAll(temp_list, 24, 25, 30, 31, 32, 36, 37, 38);
  530. align_engine_array[2] = temp_list;
  531. temp_list = list.new();
  532. list.addAll(temp_list, 23, 24, 25, 28, 29, 30, 31, 36);
  533. align_engine_array[3] = temp_list;
  534. temp_list = list.new();
  535. list.addAll(temp_list, 22, 23, 24, 25, 27, 28, 29, 30);
  536. align_engine_array[4] = temp_list;
  537. temp_list = list.new();
  538. list.addAll(temp_list, 18, 19, 20, 21, 22, 23, 24, 25);
  539. align_engine_array[5] = temp_list;
  540. temp_list = list.new();
  541. list.addAll(temp_list, 9, 10, 11, 12, 22, 23, 24, 25);
  542. align_engine_array[6] = temp_list;
  543. temp_list = list.new();
  544. list.addAll(temp_list, 0, 10, 11, 12, 13, 23, 24, 25);
  545. align_engine_array[7] = temp_list;
  546. temp_list = list.new();
  547. list.addAll(temp_list, 0, 1, 2, 12, 13, 14, 24, 25);
  548. align_engine_array[8] = temp_list;
  549. temp_list = list.new();
  550. list.addAll(temp_list, 3, 4, 14, 15, 25);
  551. align_engine_array[9] = temp_list;
  552. temp_list = list.new();
  553. list.addAll(temp_list, 6, 16);
  554. align_engine_array[10] = temp_list;
  555. calibrate_dist_array = array.new(12);
  556. calibrate_dist_array[0] = 14;
  557. calibrate_dist_array[1] = 13;
  558. calibrate_dist_array[2] = 12;
  559. calibrate_dist_array[3] = 20;
  560. calibrate_dist_array[4] = 29;
  561. calibrate_dist_array[5] = 38;
  562. calibrate_dist_array[6] = 48;
  563. calibrate_dist_array[7] = 49;
  564. calibrate_dist_array[8] = 50;
  565. calibrate_dist_array[9] = 42;
  566. calibrate_dist_array[10] = 33;
  567. calibrate_dist_array[11] = 24;
  568. wires_list = list.new();
  569. list.add(wires_list, item.create("blue_stained_glass_pane", 1, "§rBlue Wire", null));
  570. list.add(wires_list, item.create("green_stained_glass_pane", 1, "§rGreen Wire", null));
  571. list.add(wires_list, item.create("red_stained_glass_pane", 1, "§rRed Wire", null));
  572. list.add(wires_list, item.create("yellow_stained_glass_pane", 1, "§rYellow Wire", null));
  573. garb_items = list.new();
  574. list.add(garb_items, item.new(material.get("diamond")));
  575. list.add(garb_items, item.new(material.get("dead_bush")));
  576. list.add(garb_items, item.new(material.get("rotten_flesh")));
  577. list.add(garb_items, item.new(material.get("totem_of_undying")));
  578. list.add(garb_items, item.new(material.get("bone")));
  579. list.add(garb_items, item.new(material.get("bone_meal")));
  580. addAstDirection(0, 1, 0); //rechts
  581. addAstDirection(1, -1, 0); //links
  582. addAstDirection(2, 0, -1); //oben
  583. addAstDirection(3, 0, 1); //unten
  584. addAstDirection(4, 1, -1); //rechts oben
  585. addAstDirection(5, -1, 1); //links unten
  586. addAstDirection(6, 1, 1); //rechts unten
  587. addAstDirection(7, -1, -1); //links oben
  588. addAstStartPos(0, 6, 6, 6);
  589. addAstStartPos(1, 3, 5, 6);
  590. addAstStartPos(2, 3, 5, 6);
  591. addAstStartPos(3, 3, 5, 6);
  592. addAstStartPos(4, 3, 5, 6);
  593. addAstStartPos(5, 3, 5, 6);
  594. addAstStartPos(6, 3, 5, 6);
  595. addAstStartPos(7, 3, 5, 6);
  596. addAstStartPos(8, 5, 5, 5);
  597. addAstStartPos(9, 0, 4, 6);
  598. addAstStartPos(17, 1, 5, 7);
  599. addAstStartPos(18, 0, 4, 6);
  600. addAstStartPos(26, 1, 5, 7);
  601. addAstStartPos(27, 0, 4, 6);
  602. addAstStartPos(35, 1, 5, 7);
  603. addAstStartPos(36, 0, 4, 6);
  604. addAstStartPos(44, 1, 5, 7);
  605. addAstStartPos(45, 4, 4, 4);
  606. addAstStartPos(46, 2, 4, 7);
  607. addAstStartPos(47, 2, 4, 7);
  608. addAstStartPos(48, 2, 4, 7);
  609. addAstStartPos(49, 2, 4, 7);
  610. addAstStartPos(50, 2, 4, 7);
  611. addAstStartPos(51, 2, 4, 7);
  612. addAstStartPos(52, 2, 4, 7);
  613. addAstStartPos(53, 7, 7, 7);
  614. asteroid_item = item.create("BEDROCK", 1, "§rAsteroid", null);
  615. oak_leaves = item.create("OAK_LEAVES", 1, null, null);
  616. spruce_leaves = item.create("SPRUCE_LEAVES", 1, null, null);
  617. birch_leaves = item.create("BIRCH_LEAVES", 1, null, null);
  618. jungle_leaves = item.create("JUNGLE_LEAVES", 1, null, null);
  619. acacia_leaves = item.create("ACACIA_LEAVES", 1, null, null);
  620. dark_oak_leaves = item.create("DARK_OAK_LEAVES", 1, null, null);
  621. zombie_head = item.create("zombie_head", 1, "", null);
  622. zombie_head_mat = material.get("ZOMBIE_HEAD");
  623. player_head_mat = material.get("PLAYER_HEAD");
  624. redstone_lamp_mat = material.get("REDSTONE_LAMP");
  625. redstone_torch_mat = material.get("REDSTONE_TORCH");
  626. stone_button_mat = material.get("STONE_BUTTON");
  627. gunpowder_mat = material.get("GUNPOWDER");
  628. lever_mat = material.get("LEVER");
  629. oak_leaves_mat = material.get("OAK_LEAVES");
  630. light_gray_glass_mat = material.get("LIGHT_GRAY_STAINED_GLASS_PANE");
  631. lime_glass_mat = material.get("LIME_STAINED_GLASS_PANE");
  632. red_glass_mat = material.get("RED_STAINED_GLASS_PANE");
  633. green_glass_mat = material.get("GREEN_STAINED_GLASS_PANE");
  634. blue_glass_mat = material.get("BLUE_STAINED_GLASS_PANE");
  635. black_glass_mat = material.get("BLACK_STAINED_GLASS_PANE");
  636. arrow_left_mat = item.custom.get("ARROW_LEFT");
  637. arrow_right_mat = item.custom.get("ARROW_RIGHT");
  638. arrow_down_mat = item.custom.get("ARROW_DOWN");
  639. arrow_up_mat = item.custom.get("ARROW_UP");
  640. check_green_mat = item.custom.get("CHECK_GREEN");
  641. return_green_mat = item.custom.get("RETURN_GREEN");
  642. cross_red_mat = item.custom.get("CROSS_RED");
  643. space_par = particle.get("END_ROD");
  644. task_par = particle.get("COMPOSTER");
  645. cam_par = particle.get("SPELL_WITCH");
  646. sabo_par = particle.get("SPELL_WITCH");
  647. imp_par = particle.get("SPELL_WITCH");
  648. cam_loop = false;
  649. meeting = false;
  650. amongus.setAlert(false);
  651. lights_sabotaged = false;
  652. comms_sabotaged = false;
  653. reactor_sabotaged = false;
  654. oxygen_sabotaged = false;
  655. reactor_used = false;
  656. lights_inv = inv.new("202020202", text.new("§cFix Lights"));
  657. reactor_inv_1 = inv.new("222222222222222222222222222222222222222222222222222222", text.new("§cPRESS TO STOP MELTDOWN"));
  658. reactor_inv_2 = inv.new("222222222222222222222222222222222222222222222222222222", text.new("§cPRESS TO STOP MELTDOWN"));
  659. sabotage.holdReactor(reactor_inv_1, false);
  660. sabotage.holdReactor(reactor_inv_2, false);
  661. reactor_hold_list_1 = list.new();
  662. reactor_hold_list_2 = list.new();
  663. common_tasks_2 = list.new();
  664. for(i = 0; i < amount_common; i++) {
  665. index = math.random(0, list.getSize(common_tasks) - 1);
  666. id = list.getIndex(common_tasks, index);
  667. list.add(common_tasks_2, id);
  668. }
  669. registerTask(1, 97, "STO", "Fuel Engines", 4);
  670. registerTask(2, 96, "[Room]", "Download Data", 2);
  671. registerTask(3, 95, "SHI", "Prime Shields", 1);
  672. registerTask(4, 94, "REA", "Start Reactor", 1);
  673. registerTask(5, 93, "REA", "Unlock Manifolds", 1);
  674. registerTask(6, 92, "NAV", "Chart Course", 1);
  675. registerTask(7, 91, "NAV", "Stabilize Steering", 1);
  676. registerTask(8, 90, "MED", "Inspect Sample", 1);
  677. registerTask(9, 89, "ELE", "Calibrate Distributor", 1);
  678. registerTask(10, 88, "CAF", "Fix Wiring", 3);
  679. registerTask(11, 87, "ADM", "Swipe Card", 1);
  680. registerTask(12, 86, "CAF", "Empty Garbage", 2);
  681. registerTask(13, 85, "WEA", "Clear Asteroids", 20);
  682. registerTask(14, 84, "ELE", "Divert Power to [Room]", 2);
  683. registerTask(15, 83, "O2", "Clean O2 Filter", 1);
  684. registerTask(16, 82, "MED", "Submit Scan", 1);
  685. registerTask(17, 81, "UE/LE", "Align Engine", 2);
  686. player_list_size = list.getSize(player_list);
  687. if(player_list_size < 6) {
  688. amount_impostors = 1;
  689. }
  690. imps = set.new();
  691. for(i = 0; i < amount_impostors; i++) {
  692. index = math.random(0, player_list_size - 1);
  693. while(set.contains(imps, index)) {
  694. index = math.random(0, player_list_size - 1);
  695. }
  696. set.add(imps, index);
  697. }
  698. if(player_list_size == 1) {
  699. amount_all_tasks = 17;
  700. amount_all_tasks_per_player = amount_all_tasks;
  701. freeplay = true;
  702. minigame.setSingleplayer();
  703. } else {
  704. amount_crew = player_list_size - amount_impostors;
  705. amount_all_tasks_per_player = amount_short + amount_common + amount_long;
  706. amount_all_tasks = amount_all_tasks_per_player * amount_crew;
  707. freeplay = false;
  708. }
  709. for(i = 0; i < player_list_size; i++) {
  710. p_uuid = list.getIndex(player_list, i);
  711. p = player.get(p_uuid);
  712. if(amount_impostors > 1) {
  713. msg.prefix(p, gamename, string.concat("There are §c", string.number(amount_impostors), " Impostors §ramong us."));
  714. } else {
  715. msg.prefix(p, gamename, string.concat("There is §c", string.number(amount_impostors), " Impostor §ramong us."));
  716. }
  717. entity.teleport(p, list.getIndex(spawn_locs, i));
  718. sound.spawnForPlayer(p, pling_sound, sound_category_ambient);
  719. player.setGamemode(p, "SURVIVAL");
  720. player.setFly(p, false);
  721. }
  722. for(h = 0; h < player_list_size; h++) {
  723. p_uuid = list.getIndex(player_list, h);
  724. p = player.get(p_uuid);
  725. list.add(all_list, p_uuid);
  726. boss.addPlayer(progress_bar, p);
  727. data.setTimer(p, "Meeting Cooldown", $meeting_cooldown * 20);
  728. player.setSpeed(p, move_speed);
  729. map.add(meeting_amounts, p_uuid, amount_meetings);
  730. player.clearInventory(p);
  731. player.giveItem(p, item.new(material.get("MAP")));
  732. inv.close(p);
  733. player.gameMute(p, true);
  734. living.setInvisible(p, true);
  735. //Building-Perms entfernen
  736. if(perm.has("plot.bypass", p)) {
  737. //PERMS perm.unregisterPlayer(p_uuid, 1);
  738. //PERMS perm.unregisterPlayer(p_uuid, 15);
  739. list.add(removed_perms, p_uuid);
  740. }
  741. //Farbe zuweisen bzw. erneut forcen
  742. color = amongus.getPlayerColor(p);
  743. if(color == null) {
  744. iter = iterator(color_list);
  745. while(hasNext(iter)) {
  746. color = next(iter);
  747. if(!amongus.isUsedPlayerColor(color)) {
  748. amongus.setPlayerColor(p, color);
  749. amongus.equip(p, color);
  750. break;
  751. }
  752. }
  753. } else {
  754. amongus.equip(p, color);
  755. }
  756. sb.clearGame(p);
  757. sb.add(p, 79, sb.getSpacer());
  758. if(freeplay) {
  759. setSpeedrunner(p);
  760. giveTask(p, 1, "STO", "Fuel Engines", 0, 4, null);
  761. giveTask(p, 2, "[Room]", "Download Data", 0, 2, null);
  762. giveTask(p, 3, "SHI", "Prime Shields", 0, 1, null);
  763. giveTask(p, 4, "REA", "Start Reactor", 0, 1, null);
  764. giveTask(p, 5, "REA", "Unlock Manifolds", 0, 1, null);
  765. giveTask(p, 6, "NAV", "Chart Course", 0, 1, null);
  766. giveTask(p, 7, "NAV", "Stabilize Steering", 0, 1, null);
  767. giveTask(p, 8, "MED", "Inspect Sample", 0, 1, null);
  768. giveTask(p, 9, "ELE", "Calibrate Distributor", 0, 1, null);
  769. giveTask(p, 10, "CAF", "Fix Wiring", 0, 3, null);
  770. giveTask(p, 11, "ADM", "Swipe Card", 0, 1, null);
  771. giveTask(p, 12, "CAF", "Empty Garbage", 0, 2, null);
  772. giveTask(p, 13, "WEA", "Clear Asteroids", 0, 20, null);
  773. giveTask(p, 14, "ELE", "Divert Power to [Room]", 0, 2, null);
  774. giveTask(p, 15, "O2", "Clean O2 Filter", 0, 1, null);
  775. giveTask(p, 16, "MED", "Submit Scan", 0, 1, null);
  776. giveTask(p, 17, "UE/LE", "Align Engine", 0, 2, null);
  777. } else {
  778. if(set.contains(imps, h)) {
  779. setImpostor(p);
  780. } else {
  781. setCrewmate(p);
  782. }
  783. for(i = 0; i < list.getSize(common_tasks_2); i++) {
  784. id = list.getIndex(common_tasks_2, i);
  785. a = map.get(all_tasks, id);
  786. giveTask(p, id, a[0], a[1], a[2], a[3], null);
  787. }
  788. i = 0;
  789. while(i != amount_short) {
  790. index = math.random(0, list.getSize(short_tasks) - 1);
  791. id = list.getIndex(short_tasks, index);
  792. if(hasTask(p, id)) {
  793. continue;
  794. }
  795. i++;
  796. a = map.get(all_tasks, id);
  797. giveTask(p, id, a[0], a[1], a[2], a[3], null);
  798. }
  799. i = 0;
  800. while(i != amount_long) {
  801. index = math.random(0, list.getSize(long_tasks) - 1);
  802. id = list.getIndex(long_tasks, index);
  803. if(hasTask(p, id)) {
  804. continue;
  805. }
  806. i++;
  807. a = map.get(all_tasks, id);
  808. giveTask(p, id, a[0], a[1], a[2], a[3], null);
  809. }
  810. }
  811. }
  812. if(freeplay) {
  813. starttime = time.getMillis();
  814. } else {
  815. imp_string = "";
  816. iter = iterator(impostors_list);
  817. while(hasNext(iter)) {
  818. p_uuid = next(iter);
  819. p_name = player.getName(p_uuid);
  820. if(imp_string == "") {
  821. imp_string = p_name;
  822. } else {
  823. imp_string = string.concat(imp_string, ", ", amongus.getPlayerColorCode(p_uuid), p_name);
  824. }
  825. }
  826. for(i = 0; i < list.getSize(impostors_list); i++) {
  827. p_uuid = list.getIndex(impostors_list, i);
  828. p = player.get(p_uuid);
  829. map.remove(player_tasks, p_uuid);
  830. msg.prefix(p, gamename, string.concat("§4Impostors: §r", imp_string));
  831. }
  832. }
  833. setSaboCooldown(default_sabo_cooldown);
  834. event.unload("entity_dismount");
  835. event.load("chat");
  836. event.load("player_move");
  837. event.load("inv_click");
  838. event.load("inv_close");
  839. event.load("player_data_tick");
  840. sgoto(10, "space_loop");
  841. sgoto(10, "task_part_loop");
  842. sgoto(5, "imp_par_loop");
  843. sbtoggle = false;
  844. if(amount_all_tasks_per_player > 8) {
  845. sbtoggle = true;
  846. sgoto(100, "scoreboard_toggler");
  847. }
  848. switchLights(true);
  849. goto("loop");
  850. @checkgame
  851. wait();
  852. if(event == "entity_damage") {
  853. if(isPlayer(entity)) {
  854. //damaged entity is a player
  855. damaged_player = entity;
  856. if(player.hasMinigameId(damaged_player, script_id)) {
  857. cancel = true;
  858. }
  859. attacker = player.getFromDamageSource(damage_source);
  860. if(attacker == null) {
  861. goto("checkgame");
  862. }
  863. if(!isPlayer(attacker)) {
  864. goto("checkgame");
  865. }
  866. if(!player.hasMinigameId(attacker, script_id)) {
  867. goto("checkgame");
  868. }
  869. if(!isImpostor(attacker)) {
  870. goto("checkgame");
  871. }
  872. //kill crewmate
  873. item = living.getHand(attacker);
  874. if(item != kill_item) {
  875. goto("checkgame");
  876. }
  877. cooldown = data.getTimer(attacker, "Kill Cooldown");
  878. if(cooldown == null || cooldown == -1) {
  879. if(!player.isOnCam(damaged_player) && !player.isGhost(damaged_player)) {
  880. if(isCrewmate(damaged_player)) {
  881. killCrewmate(attacker, damaged_player);
  882. goto("checkwin");
  883. }
  884. msg.prefix(attacker, gamename, "Not a crewmate.");
  885. goto("checkgame");
  886. }
  887. } else {
  888. msg.prefix(attacker, gamename, string.concat("Remaining kill cooldown: ", string.number(math.roundDown(cooldown / 20)), "s"));
  889. }
  890. goto("checkgame");
  891. }
  892. //damaged entity is not a player
  893. attacker = player.getFromDamageSource(damage_source);
  894. if(attacker == null) {
  895. goto("checkgame");
  896. }
  897. if(player.hasMinigameId(attacker, script_id)) {
  898. cancel = true;
  899. }
  900. //report body
  901. if(entity.getType(entity) == "zombie") {
  902. if(player.isGhost(attacker)) {
  903. goto("checkgame");
  904. }
  905. found_player_uuid = map.get(report_map, entity);
  906. if(found_player_uuid == null) {
  907. entity.remove(entity);
  908. msg.prefix(attacker, gamename, "Defect entity removed.");
  909. goto("checkgame");
  910. }
  911. reportBody(attacker, found_player_uuid);
  912. }
  913. //kill crewmate at cam
  914. if(entity.isHuman(entity)) {
  915. item = living.getHand(attacker);
  916. if(item != kill_item) {
  917. goto("checkgame");
  918. }
  919. cooldown = data.getTimer(attacker, "Kill Cooldown");
  920. if(cooldown == null || cooldown == -1) {
  921. p_uuid = map.get(cam_map_4, entity);
  922. if(p_uuid == null) {
  923. entity.remove(entity);
  924. msg.prefix(attacker, gamename, "Defect entity removed.");
  925. goto("checkgame");
  926. }
  927. p = player.get(p_uuid);
  928. if(isCrewmate(p)) {
  929. cam.leave(p);
  930. killCrewmate(attacker, p);
  931. goto("checkwin");
  932. }
  933. msg.prefix(attacker, gamename, "Not a crewmate.");
  934. } else {
  935. msg.prefix(attacker, gamename, string.concat("Remaining kill cooldown: ", string.number(math.roundDown(cooldown / 20)), "s"));
  936. }
  937. }
  938. goto("checkgame");
  939. }
  940. if(player.hasMinigameId(player, script_id)) {
  941. ignoreGoto(event);
  942. }
  943. goto("checkgame");
  944. @chat
  945. cancel = true;
  946. if(player.isGhost(player)) {
  947. iter = iterator(ghosts);
  948. while(hasNext(iter)) {
  949. p_uuid = next(iter);
  950. if(!list.contains(player_list, p_uuid)) {
  951. continue;
  952. }
  953. p = player.get(p_uuid);
  954. msg.prefix(p, string.concat("Ghost ", amongus.getPlayerColorCode(player), player.getName(player)), message);
  955. }
  956. goto("checkgame");
  957. }
  958. if(meeting) {
  959. minigame.speakAll(string.concat(amongus.getPlayerColorCode(player), player.getName(player)), message);
  960. }
  961. goto("checkgame");
  962. @player_move
  963. player_uuid = player.getUuid(player);
  964. player.action(player, text.new(map.getOrDefault(move_id_map, id, "")));
  965. if(player.isOnCam(player)) {
  966. goto("checkgame");
  967. }
  968. if(player.isGhost(player)) {
  969. goto("checkgame");
  970. }
  971. old_room_id = map.getOrDefault(admin_table_map, player_uuid, "");
  972. if(old_room_id != id) {
  973. map.add(admin_table_map, player_uuid, id);
  974. //Neuer Raum
  975. amount_players = map.getOrDefault(admin_table_map_2, id, 0) + 1;
  976. map.add(admin_table_map_2, id, amount_players);
  977. amongus.updateAdminTable(id, amount_players);
  978. //Alter Raum
  979. amount_players = map.getOrDefault(admin_table_map_2, old_room_id, 0) - 1;
  980. map.add(admin_table_map_2, old_room_id, amount_players);
  981. amongus.updateAdminTable(old_room_id, amount_players);
  982. }
  983. goto("checkgame");
  984. function amongus.setMeeting(bool) {
  985. $meeting = bool;
  986. }
  987. function amongus.isMeeting() {
  988. return $meeting;
  989. }
  990. function amongus.manageEffects(player) {
  991. living.clearEffects(player);
  992. if(amongus.isMeeting()) {
  993. time = $discuss_time * 20 + $vote_time * 20;
  994. living.addEffect(player, "JUMP", time, 128, false);
  995. living.addEffect(player, "SLOW", time, 6, false);
  996. return;
  997. }
  998. if(player.isGhost(player)) {
  999. living.addEffect(player, "NIGHT_VISION", 999999, 0, false);
  1000. return;
  1001. }
  1002. if(player.isOnCam(player)) {
  1003. living.addEffect(player, "NIGHT_VISION", 999999, 0, false);
  1004. return;
  1005. }
  1006. if($lights_sabotaged) {
  1007. if(isImpostor(player)) {
  1008. living.addEffect(player, "NIGHT_VISION", 999999, 0, false);
  1009. } else {
  1010. living.addEffect(player, "BLINDNESS", 999999, 0, false);
  1011. }
  1012. return;
  1013. }
  1014. }
  1015. function amongus.updateAdminTable(room_id, amount_players) {
  1016. if(amount_players == 0) {
  1017. if(room_id == $move_id_le) {
  1018. inv.setItem($admin_table_inv, 37, item.create("blue_stained_glass_pane", 1, "§rLower Engine", null));
  1019. } elseif(room_id == $move_id_sec) {
  1020. inv.setItem($admin_table_inv, 20, item.create("blue_stained_glass_pane", 1, "§rSecurity", null));
  1021. } elseif(room_id == $move_id_ue) {
  1022. inv.setItem($admin_table_inv, 1, item.create("blue_stained_glass_pane", 1, "§rUpper Engine", null));
  1023. } elseif(room_id == $move_id_reac) {
  1024. inv.setItem($admin_table_inv, 18, item.create("blue_stained_glass_pane", 1, "§rReactor", null));
  1025. } elseif(room_id == $move_id_o2) {
  1026. inv.setItem($admin_table_inv, 15, item.create("blue_stained_glass_pane", 1, "§rO2", null));
  1027. } elseif(room_id == $move_id_navi) {
  1028. inv.setItem($admin_table_inv, 26, item.create("blue_stained_glass_pane", 1, "§rNavigation", null));
  1029. } elseif(room_id == $move_id_weap) {
  1030. inv.setItem($admin_table_inv, 7, item.create("blue_stained_glass_pane", 1, "§rWeapons", null));
  1031. } elseif(room_id == $move_id_shie) {
  1032. inv.setItem($admin_table_inv, 43, item.create("blue_stained_glass_pane", 1, "§rShields", null));
  1033. } elseif(room_id == $move_id_comm) {
  1034. inv.setItem($admin_table_inv, 51, item.create("blue_stained_glass_pane", 1, "§rCommunications", null));
  1035. } elseif(room_id == $move_id_stor1 || room_id == $move_id_stor2) {
  1036. inv.setItem($admin_table_inv, 41, item.create("blue_stained_glass_pane", 1, "§rStorage", null));
  1037. } elseif(room_id == $move_id_elec1 || room_id == $move_id_elec2) {
  1038. inv.setItem($admin_table_inv, 30, item.create("blue_stained_glass_pane", 1, "§rElectrical", null));
  1039. } elseif(room_id == $move_id_med1 || room_id == $move_id_med2) {
  1040. inv.setItem($admin_table_inv, 12, item.create("blue_stained_glass_pane", 1, "§rMedBay", null));
  1041. } elseif(room_id == $move_id_cafe) {
  1042. inv.setItem($admin_table_inv, 5, item.create("blue_stained_glass_pane", 1, "§rCafeteria", null));
  1043. } elseif(room_id == $move_id_admin) {
  1044. inv.setItem($admin_table_inv, 24, item.create("blue_stained_glass_pane", 1, "§rAdmin", null));
  1045. }
  1046. } else {
  1047. if(room_id == move_id_le) {
  1048. inv.setItem($admin_table_inv, 37, item.create("sticky_piston", amount_players, "§rLower Engine", null));
  1049. } elseif(room_id == $move_id_sec) {
  1050. inv.setItem($admin_table_inv, 20, item.create("observer", amount_players, "§rSecurity", null));
  1051. } elseif(room_id == $move_id_ue) {
  1052. inv.setItem($admin_table_inv, 1, item.create("sticky_piston", amount_players, "§rUpper Engine", null));
  1053. } elseif(room_id == $move_id_reac) {
  1054. inv.setItem($admin_table_inv, 18, item.create("tnt", amount_players, "§rReactor", null));
  1055. } elseif(room_id == $move_id_o2) {
  1056. inv.setItem($admin_table_inv, 15, item.create("kelp", amount_players, "§rO2", null));
  1057. } elseif(room_id == $move_id_navi) {
  1058. inv.setItem($admin_table_inv, 26, item.create("compass", amount_players, "§rNavigation", null));
  1059. } elseif(room_id == $move_id_weap) {
  1060. sword_item = item.create("golden_sword", amount_players, "§rWeapons", null);
  1061. item.addFlag(sword_item, "HIDE_ATTRIBUTES");
  1062. inv.setItem($admin_table_inv, 7, sword_item);
  1063. } elseif(room_id == $move_id_shie) {
  1064. inv.setItem($admin_table_inv, 43, item.create("shield", amount_players, "§rShields", null));
  1065. } elseif(room_id == $move_id_comm) {
  1066. inv.setItem($admin_table_inv, 51, item.create("end_rod", amount_players, "§rCommunications", null));
  1067. } elseif(room_id == $move_id_stor1 || room_id == $move_id_stor2) {
  1068. inv.setItem($admin_table_inv, 41, item.create("red_shulker_box", amount_players, "§rStorage", null));
  1069. } elseif(room_id == $move_id_elec1 || room_id == $move_id_elec2) {
  1070. inv.setItem($admin_table_inv, 30, item.create("redstone", amount_players, "§rElectrical", null));
  1071. } elseif(room_id == $move_id_med1 || room_id == $move_id_med2) {
  1072. inv.setItem($admin_table_inv, 12, item.custom.create("PLUS_RED", amount_players, "§rMedBay", null));
  1073. } elseif(room_id == $move_id_cafe) {
  1074. inv.setItem($admin_table_inv, 5, item.create("cake", amount_players, "§rCafeteria", null));
  1075. } elseif(room_id == $move_id_admin) {
  1076. inv.setItem($admin_table_inv, 24, item.create("lectern", amount_players, "§rAdmin", null));
  1077. }
  1078. }
  1079. }
  1080. @block_click
  1081. if(slot.isOffHand(hand)) {
  1082. goto("checkgame");
  1083. }
  1084. if(action != "RIGHT_CLICK_BLOCK" && action != "RIGHT_CLICK_AIR") {
  1085. goto("checkgame");
  1086. }
  1087. if(block != null) {
  1088. if(block.hasTag(block, shulker_tag)) {
  1089. cancel = true;
  1090. goto("checkgame");
  1091. }
  1092. if(block.hasTag(block, wooden_trapdoors_tag)) {
  1093. cancel = true;
  1094. goto("checkgame");
  1095. }
  1096. }
  1097. player_uuid = player.getUuid(player);
  1098. item = living.getHand(player);
  1099. //sabotage
  1100. if(item == sabotage_item) {
  1101. inv.open(sabotage_menu, player);
  1102. goto("checkgame");
  1103. }
  1104. //vents
  1105. if(list.contains(vent_list, player_uuid)) {
  1106. if(player.isGhost(player)) {
  1107. goto("checkgame");
  1108. }
  1109. //leave vent
  1110. if(item == leave_vent_item) {
  1111. vent_leave(player);
  1112. }
  1113. //vent button 1
  1114. inv_slot = getInvSlotFromItem(player, item);
  1115. if(inv_slot == 6) {
  1116. vent_loc = map.get(vent_map_4, player_uuid);
  1117. a = map.get($vent_map_3, vent_loc);
  1118. vent_loc_1 = a[1];
  1119. if(vent_loc_1 != null) {
  1120. vent_enter(player, vent_loc_1);
  1121. }
  1122. } elseif(inv_slot == 7) {
  1123. //vent button 2
  1124. vent_loc = map.get(vent_map_4, player_uuid);
  1125. a = map.get($vent_map_3, vent_loc);
  1126. vent_loc_2 = a[3];
  1127. if(vent_loc_2 != null) {
  1128. vent_enter(player, vent_loc_2);
  1129. }
  1130. }
  1131. goto("checkgame");
  1132. }
  1133. //cams
  1134. if(player.isOnCam(player)) {
  1135. cam_number = map.get(cam_map, player_uuid);
  1136. number_of_cams = set.getSize(cams_locs);
  1137. if(item == prev_cam_item) {
  1138. cam_number--;
  1139. if(cam_number < 0) {
  1140. cam_number = number_of_cams - 1;
  1141. }
  1142. } elseif(item == next_cam_item) {
  1143. cam_number++;
  1144. if(cam_number >= number_of_cams) {
  1145. cam_number = 0;
  1146. }
  1147. } elseif(item == leave_cam_item) {
  1148. cam.leave(player);
  1149. } else {
  1150. goto("checkgame");
  1151. }
  1152. map.add(cam_map, player_uuid, cam_number);
  1153. goto("checkgame");
  1154. }
  1155. //meeting
  1156. if(meeting) {
  1157. if(item == open_vote_menu_item) {
  1158. if(data.getTimer(player, "Discussion Time") < 0) {
  1159. vote_inv = getVoteInv(player);
  1160. inv.open(vote_inv, player);
  1161. }
  1162. }
  1163. goto("checkgame");
  1164. }
  1165. //ONLY RIGHT_CLICK_BLOCK
  1166. if(action != "RIGHT_CLICK_BLOCK") {
  1167. goto("checkgame");
  1168. }
  1169. block_loc = block.getLocation(block);
  1170. //enter vent
  1171. if(list.contains(all_vent_locs, block_loc)) {
  1172. if(isCrewmate(player)) {
  1173. goto("checkgame");
  1174. }
  1175. if(player.isGhost(player)) {
  1176. goto("checkgame");
  1177. }
  1178. cooldown = data.getTimer(player, "Kill Cooldown");
  1179. map.add(holded_kill_cooldown, player_uuid, cooldown);
  1180. vent_enter(player, block_loc);
  1181. goto("checkgame");
  1182. }
  1183. if(set.contains(cams_locs, block_loc)) {
  1184. cam_number = 0;
  1185. player_uuid = player.getUuid(player);
  1186. map.add(cam_map, player_uuid, cam_number);
  1187. player_loc = entity.getLocation(player);
  1188. map.add(cam_map_2, player_uuid, player_loc);
  1189. if(!player.isGhost(player)) {
  1190. ent = human.spawn(player_loc, "");
  1191. human.setAi(ent, 0);
  1192. map.add(cam_map_3, player_uuid, ent);
  1193. map.add(cam_map_4, ent, player_uuid);
  1194. human.setSkinUuid(ent, player_uuid);
  1195. color = amongus.getPlayerColor(player);
  1196. amongus.equipHuman(ent, color, player);
  1197. living.setInvisible(ent, true);
  1198. }
  1199. cam.enter(player);
  1200. goto("checkgame");
  1201. }
  1202. if(set.contains(med_scan_locs, block_loc)) {
  1203. task_id = 16;
  1204. if(!hasTask(player, task_id)) {
  1205. goto("checkgame");
  1206. }
  1207. step = task.getStep(player, task_id);
  1208. if(step == 1) {
  1209. goto("checkgame");
  1210. }
  1211. if(loc.distance(entity.getLocation(player), block_loc) > 3) {
  1212. msg.prefix(player, gamename, "Get closer.");
  1213. goto("checkgame");
  1214. }
  1215. player_uuid = player.getUuid(player);
  1216. inv = inv.new("000000000000000000000000000000000000000000000000000000", text.new("§cSubmit Scan"));
  1217. for(i = 0; i < 54; i++) {
  1218. inv.setItem(inv, i, light_gray_glass);
  1219. }
  1220. inv.setItem(inv, 13, player.getHead(player_uuid, player.getName(player)));
  1221. color = amongus.getPlayerColor(player);
  1222. color_code = map.get(cloth_code_map, color);
  1223. item = read.item(string.concat("{id:\"minecraft:leather_chestplate\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
  1224. item.addFlag(item, "HIDE_ATTRIBUTES");
  1225. inv.setItem(inv, 22, item);
  1226. item = read.item(string.concat("{id:\"minecraft:leather_leggings\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
  1227. item.addFlag(item, "HIDE_ATTRIBUTES");
  1228. inv.setItem(inv, 31, item);
  1229. item = read.item(string.concat("{id:\"minecraft:leather_boots\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
  1230. item.addFlag(item, "HIDE_ATTRIBUTES");
  1231. inv.setItem(inv, 40, item);
  1232. inv.open(inv, player);
  1233. list.add(submit_scan_list, player_uuid);
  1234. map.add(submit_scan_map, player_uuid, 0);
  1235. map.add(submit_scan_map_2, player_uuid, inv);
  1236. sgoto(20, "submit_scan");
  1237. goto("checkgame");
  1238. }
  1239. if(set.contains(clear_ast_locs, block_loc)) {
  1240. task_id = 13;
  1241. if(!hasTask(player, task_id)) {
  1242. goto("checkgame");
  1243. }
  1244. step = task.getStep(player, task_id);
  1245. if(step == 20) {
  1246. goto("checkgame");
  1247. }
  1248. //inv = inv.new("222222222 222222222 222222222 222222222 222222222 222222222");
  1249. inv = inv.new("222222222222222222222222222222222222222222222222222222", text.new("§cClear Asteroids"));
  1250. a = array.new(7);
  1251. a[0] = inv;
  1252. slot = list.getIndex(ast_start_pos, math.random(0, 25));
  1253. a[1] = slot;
  1254. inv.setItem(inv, slot, asteroid_item);
  1255. inv.open(inv, player);
  1256. b = getAstDirection(slot);
  1257. a[2] = b[0]; //x_dir
  1258. a[3] = b[1]; //y_dir
  1259. a[4] = false; //reached end
  1260. a[5] = math.random(1, 2); //speed
  1261. a[6] = 0; //speed counter
  1262. my_list = list.new();
  1263. list.add(my_list, a);
  1264. player_uuid = player.getUuid(player);
  1265. map.add(clear_ast_map, player_uuid, my_list);
  1266. map.add(clear_ast_map_2, player_uuid, 0);
  1267. map.add(clear_ast_map_3, player_uuid, inv);
  1268. if(list.getSize(clear_ast_list) == 0) {
  1269. sgoto(5, "clear_ast");
  1270. }
  1271. list.add(clear_ast_list, player_uuid);
  1272. goto("checkgame");
  1273. }
  1274. if(set.contains(inspect_sample_locs, block_loc)) {
  1275. task_id = 8;
  1276. if(!hasTask(player, task_id)) {
  1277. goto("checkgame");
  1278. }
  1279. step = task.getStep(player, task_id);
  1280. if(step == 1) {
  1281. goto("checkgame");
  1282. }
  1283. player_uuid = player.getUuid(player);
  1284. inv = map.get(sample_map, player_uuid);
  1285. if(inv == null) {
  1286. sample = item.create("white_stained_glass_pane", 1, "§rSample", null);
  1287. //inv = inv.new("000000000 000000000 000000000 000000000 202020202 000000002");
  1288. inv = inv.new("000000000000000000000000000000000000202020202000000002", text.new("§cInspect Sample"));
  1289. for(i = 0; i < 54; i++) {
  1290. inv.setItem(inv, i, light_gray_glass);
  1291. }
  1292. h = 0;
  1293. for(i = 0; i < 3; i++) {
  1294. inv.setItem(inv, 0 + h, sample);
  1295. inv.setItem(inv, 2 + h, sample);
  1296. inv.setItem(inv, 4 + h, sample);
  1297. inv.setItem(inv, 6 + h, sample);
  1298. inv.setItem(inv, 8 + h, sample);
  1299. h += 9;
  1300. }
  1301. select_sample = item.create("gray_stained_glass_pane", 1, "§rSelect sample", null);
  1302. inv.setItem(inv, 36, select_sample);
  1303. inv.setItem(inv, 38, select_sample);
  1304. inv.setItem(inv, 40, select_sample);
  1305. inv.setItem(inv, 42, select_sample);
  1306. inv.setItem(inv, 44, select_sample);
  1307. inv.setItem(inv, 53, item.create("green_stained_glass_pane", 1, "§rPress to start", null));
  1308. }
  1309. inv.open(inv, player);
  1310. goto("checkgame");
  1311. }
  1312. if(block_loc == admin_table_loc) {
  1313. if(comms_sabotaged) {
  1314. msg.prefix(player, gamename, "Communications disabled.");
  1315. goto("checkgame");
  1316. }
  1317. inv.open(admin_table_inv, player);
  1318. goto("checkgame");
  1319. }
  1320. if(block_loc == ue_align_loc || block_loc == le_align_loc) {
  1321. task_id = 17;
  1322. if(!hasTask(player, task_id)) {
  1323. goto("checkgame");
  1324. }
  1325. step = task.getStep(player, task_id);
  1326. if(step == 2) {
  1327. goto("checkgame");
  1328. }
  1329. player_uuid = player.getUuid(player);
  1330. if(block_loc == ue_align_loc && set.contains(align_ue_engine_set, player_uuid)) {
  1331. goto("checkgame");
  1332. }
  1333. if(block_loc == le_align_loc && set.contains(align_le_engine_set, player_uuid)) {
  1334. goto("checkgame");
  1335. }
  1336. //inv = inv.new("000000002 000000000 000000000 000000000 000000002");
  1337. inv = inv.new("000000002000000000000000000000000000000000002", text.new("§cAlign Engine"));
  1338. for(i = 18; i < 27; i++) {
  1339. inv.setItem(inv, i, light_gray_glass);
  1340. }
  1341. inv.setItem(inv, 8, item_arrow_up);
  1342. inv.setItem(inv, 44, item_arrow_down);
  1343. inv.setItem(inv, 26, green_glass);
  1344. inv.open(inv, player);
  1345. pos = math.random(0, 10);
  1346. while(pos == 5) {
  1347. pos = math.random(0, 10);
  1348. }
  1349. map.add(align_engine_map, player_uuid, pos);
  1350. map.add(align_engine_map_2, player_uuid, block_loc);
  1351. set_engine(player, inv, null);
  1352. goto("checkgame");
  1353. }
  1354. if(block_loc == clean_o2_loc) {
  1355. task_id = 15;
  1356. if(!hasTask(player, task_id)) {
  1357. goto("checkgame");
  1358. }
  1359. step = task.getStep(player, task_id);
  1360. if(step == 1) {
  1361. goto("checkgame");
  1362. }
  1363. //inv = inv.new("022222222 022222222 222222222 222222222 022222222 022222222");
  1364. inv = inv.new("022222222022222222222222222222222222022222222022222222", text.new("§cClean O2 Filter"));
  1365. for(i = 1; i < 54; i++) {
  1366. if(i == 9 || i == 36 || i == 45) {
  1367. continue;
  1368. }
  1369. inv.setItem(inv, i, light_gray_glass);
  1370. }
  1371. for(i = 0; i < 6; i++) {
  1372. slot = math.random(1, 53);
  1373. while(slot % 9 == 0 || inv.getItem(inv, slot) != light_gray_glass) {
  1374. slot = math.random(1, 53);
  1375. }
  1376. inv.setItem(inv, slot, item.create("oak_leaves", 1, null, null));
  1377. if(slot < 18) {
  1378. if(item.getType(inv.getItem(inv, slot + 9)) == light_gray_glass_mat) {
  1379. inv.setItem(inv, slot + 9, item_arrow_down);
  1380. continue;
  1381. }
  1382. }
  1383. if(slot > 36) {
  1384. if(item.getType(inv.getItem(inv, slot - 9)) == light_gray_glass_mat) {
  1385. inv.setItem(inv, slot - 9, item_arrow_up);
  1386. continue;
  1387. }
  1388. }
  1389. if(item.getType(inv.getItem(inv, slot - 1)) == light_gray_glass_mat) {
  1390. inv.setItem(inv, slot - 1, item_arrow_left);
  1391. }
  1392. }
  1393. inv.open(inv, player);
  1394. goto("checkgame");
  1395. }
  1396. if(block_loc == elec_power_loc) {
  1397. task_id = 14;
  1398. if(!hasTask(player, task_id)) {
  1399. goto("checkgame");
  1400. }
  1401. step = task.getStep(player, task_id);
  1402. if(step != 0) {
  1403. goto("checkgame");
  1404. }
  1405. //inv = inv.new("000000000 000000000 000000000 000000000 222222220 000000000");
  1406. inv = inv.new("000000000000000000000000000000000000222222220000000000", text.new("§cDivert Power"));
  1407. gunpowder = item.create("GUNPOWDER", 1, null, null);
  1408. inv.setItem(inv, 4, gunpowder);
  1409. for(i = 11; i < 16; i++) {
  1410. inv.setItem(inv, i, gunpowder);
  1411. }
  1412. for(i = 19; i < 26; i++) {
  1413. inv.setItem(inv, i, gunpowder);
  1414. }
  1415. for(i = 27; i < 36; i++) {
  1416. inv.setItem(inv, i, gunpowder);
  1417. }
  1418. for(i = 36; i < 45; i++) {
  1419. inv.setItem(inv, i, item.create("LEVER", 1, map.get(divert_pow_map, i), null));
  1420. }
  1421. r = map.get(divert_pow_map_3, player.getUuid(player));
  1422. inv.setItem(inv, r, item.create("REDSTONE_TORCH", 1, map.get(divert_pow_map, r), null));
  1423. inv.open(inv, player);
  1424. goto("checkgame");
  1425. }
  1426. r = map.get(divert_pow_map_3, player.getUuid(player));
  1427. if(r != null && block_loc == map.get(divert_pow_map_2, r)) {
  1428. task_id = 14;
  1429. if(!hasTask(player, task_id)) {
  1430. goto("checkgame");
  1431. }
  1432. step = task.getStep(player, task_id);
  1433. if(step != 1) {
  1434. goto("checkgame");
  1435. }
  1436. //inv = inv.new("000000000 000000000 000000000 000020000 002002002 220000220");
  1437. inv = inv.new("002200002220200220020202002222222220002002002220000220", text.new("§cDivert Power"));
  1438. gunpowder = item.create("gunpowder", 1, null, null);
  1439. redstone = item.create("redstone", 1, null, null);
  1440. inv.setItem(inv, 2, redstone);
  1441. inv.setItem(inv, 3, redstone);
  1442. inv.setItem(inv, 8, gunpowder);
  1443. inv.setItem(inv, 9, redstone);
  1444. inv.setItem(inv, 10, redstone);
  1445. inv.setItem(inv, 12, redstone);
  1446. inv.setItem(inv, 15, gunpowder);
  1447. inv.setItem(inv, 16, gunpowder);
  1448. inv.setItem(inv, 19, redstone);
  1449. inv.setItem(inv, 21, redstone);
  1450. inv.setItem(inv, 23, gunpowder);
  1451. inv.setItem(inv, 26, gunpowder);
  1452. inv.setItem(inv, 27, redstone);
  1453. inv.setItem(inv, 28, redstone);
  1454. inv.setItem(inv, 29, redstone);
  1455. inv.setItem(inv, 30, redstone);
  1456. inv.setItem(inv, 31, item.create("stone_button", 1, "§rConnect Grids", null));
  1457. inv.setItem(inv, 32, gunpowder);
  1458. inv.setItem(inv, 33, gunpowder);
  1459. inv.setItem(inv, 34, gunpowder);
  1460. inv.setItem(inv, 38, redstone);
  1461. inv.setItem(inv, 41, gunpowder);
  1462. inv.setItem(inv, 44, gunpowder);
  1463. inv.setItem(inv, 45, redstone);
  1464. inv.setItem(inv, 46, redstone);
  1465. inv.setItem(inv, 51, gunpowder);
  1466. inv.setItem(inv, 52, gunpowder);
  1467. inv.open(inv, player);
  1468. goto("checkgame");
  1469. }
  1470. if(block_loc == cafe_garb_loc || block_loc == o2_garb_loc) {
  1471. cancel = true;
  1472. task_id = 12;
  1473. if(!hasTask(player, task_id)) {
  1474. goto("checkgame");
  1475. }
  1476. step = task.getStep(player, task_id);
  1477. if(step != 0) {
  1478. goto("checkgame");
  1479. }
  1480. player_uuid = player.getUuid(player);
  1481. r = map.get(empty_garb_map_3, player_uuid);
  1482. if(r == 0 && block_loc == o2_garb_loc) {
  1483. goto("checkgame");
  1484. }
  1485. if(r == 1 && block_loc == cafe_garb_loc) {
  1486. goto("checkgame");
  1487. }
  1488. //inv = inv.new("000000000 000000000 000000000 000000000 000000002 000000000");
  1489. inv = inv.new("000000000000000000000000000000000000000000002000000000", text.new("§cEmpty Garbage"));
  1490. for(i = 1; i < 8; i++) {
  1491. inv.setItem(inv, i, light_gray_glass);
  1492. }
  1493. i = 10;
  1494. for(row = 1; row < 6; row++) {
  1495. for(col = 0; col < 7; col++) {
  1496. r = math.random(1, 6);
  1497. if(r == 1) {
  1498. leaves_item = oak_leaves;
  1499. } elseif(r == 2) {
  1500. leaves_item = spruce_leaves;
  1501. } elseif(r == 3) {
  1502. leaves_item = birch_leaves;
  1503. } elseif(r == 4) {
  1504. leaves_item = jungle_leaves;
  1505. } elseif(r == 5) {
  1506. leaves_item = acacia_leaves;
  1507. } else {
  1508. leaves_item = dark_oak_leaves;
  1509. }
  1510. inv.setItem(inv, i, leaves_item);
  1511. i++;
  1512. }
  1513. i += 2;
  1514. }
  1515. inv.setItem(inv, 44, item.custom.create("ARROW_DOWN", 1, "§rEmpty Garbage", null));
  1516. inv.open(inv, player);
  1517. goto("checkgame");
  1518. }
  1519. if(block_loc == stor_garb_loc) {
  1520. cancel = true;
  1521. task_id = 12;
  1522. if(!hasTask(player, task_id)) {
  1523. goto("checkgame");
  1524. }
  1525. step = task.getStep(player, task_id);
  1526. if(step != 1) {
  1527. goto("checkgame");
  1528. }
  1529. //inv = inv.new("000000000 000000000 000000000 000000000 000000002 000000000");
  1530. inv = inv.new("000000000000000000000000000000000000000000002000000000", text.new("§cEmpty Garbage"));
  1531. for(i = 1; i < 8; i++) {
  1532. inv.setItem(inv, i, light_gray_glass);
  1533. }
  1534. i = 10;
  1535. for(row = 1; row < 6; row++) {
  1536. for(col = 0; col < 7; col++) {
  1537. r = math.random(1, 6);
  1538. if(r == 1) {
  1539. leaves_item = oak_leaves;
  1540. } elseif(r == 2) {
  1541. leaves_item = spruce_leaves;
  1542. } elseif(r == 3) {
  1543. leaves_item = birch_leaves;
  1544. } elseif(r == 4) {
  1545. leaves_item = jungle_leaves;
  1546. } elseif(r == 5) {
  1547. leaves_item = acacia_leaves;
  1548. } else {
  1549. leaves_item = dark_oak_leaves;
  1550. }
  1551. inv.setItem(inv, i, leaves_item);
  1552. i++;
  1553. }
  1554. i += 2;
  1555. }
  1556. list.shuffle(garb_items);
  1557. inv.setItem(inv, math.random(10, 16), list.getIndex(garb_items, 0));
  1558. inv.setItem(inv, math.random(19, 25), list.getIndex(garb_items, 1));
  1559. inv.setItem(inv, math.random(37, 43), list.getIndex(garb_items, 2));
  1560. inv.setItem(inv, 44, item.custom.create("ARROW_DOWN", 1, "§rEmpty Garbage", null));
  1561. inv.open(inv, player);
  1562. goto("checkgame");
  1563. }
  1564. if(block_loc == swipe_card_loc) {
  1565. task_id = 11;
  1566. if(!hasTask(player, task_id)) {
  1567. goto("checkgame");
  1568. }
  1569. step = task.getStep(player, task_id);
  1570. if(step == 1) {
  1571. goto("checkgame");
  1572. }
  1573. //inv = inv.new("000000000 002222200 000000000");
  1574. inv = inv.new("000000000003333320000000000", text.new("§cSwipe Card"));
  1575. for(i = 11; i < 16; i++) {
  1576. inv.setItem(inv, i, light_gray_glass);
  1577. }
  1578. inv.open(inv, player);
  1579. goto("checkgame");
  1580. }
  1581. if(block_loc == calibrate_dist_loc) {
  1582. task_id = 9;
  1583. if(!hasTask(player, task_id)) {
  1584. goto("checkgame");
  1585. }
  1586. step = task.getStep(player, task_id);
  1587. if(step == 1) {
  1588. goto("checkgame");
  1589. }
  1590. //inv = inv.new("000000000 000000000 000000000 000000000 000000002 000000000");
  1591. inv = inv.new("000000000000000000000000000000000000000000002000000000", text.new("§cCalibrate Distributor"));
  1592. for(i = 0; i < 54; i++) {
  1593. inv.setItem(inv, i, light_gray_glass);
  1594. }
  1595. inv.setItem(inv, 3, item.custom.create("CROSS_RED", 1, null, null));
  1596. inv.setItem(inv, 4, item.custom.create("CROSS_RED", 1, null, null));
  1597. inv.setItem(inv, 5, item.custom.create("CROSS_RED", 1, null, null));
  1598. for(i = 0; i < 12; i++) {
  1599. inv.setItem(inv, calibrate_dist_array[i], black_glass);
  1600. }
  1601. inv.setItem(inv, 34, yellow_glass);
  1602. inv.setItem(inv, 35, yellow_glass);
  1603. inv.setItem(inv, 44, item.custom.create("MINUS_GREEN", 1, "§rPress", null));
  1604. inv.open(inv, player);
  1605. start_index = math.random(0, 8);
  1606. a = array.new(5);
  1607. player_uuid = player.getUuid(player);
  1608. a[0] = player_uuid;
  1609. a[1] = inv;
  1610. a[2] = start_index;
  1611. a[3] = start_index; //index
  1612. a[4] = 0; //stage
  1613. list.add(calibrate_dist_list, player_uuid);
  1614. map.add(calibrate_dist_map, player_uuid, a);
  1615. sgoto(7, "calibrate_dist");
  1616. goto("checkgame");
  1617. }
  1618. if(block_loc == steering_loc) {
  1619. task_id = 7;
  1620. if(!hasTask(player, task_id)) {
  1621. goto("checkgame");
  1622. }
  1623. step = task.getStep(player, task_id);
  1624. if(step == 1) {
  1625. goto("checkgame");
  1626. }
  1627. //inv = inv.new("222222222 222222222 222222222 222222222 222222222");
  1628. inv = inv.new("222222222222222222222222222222222222222222222", text.new("§cStabilize Steering"));
  1629. for(i = 0; i < 45; i++) {
  1630. inv.setItem(inv, i, light_gray_glass);
  1631. }
  1632. inv.setItem(inv, 22, item.custom.create("PLUS_RED", 1, null, null));
  1633. r = math.random(0, 3);
  1634. if(r == 0) {
  1635. slot = 6;
  1636. slot_left = 5;
  1637. slot_right = 7;
  1638. slot_down = 15;
  1639. slot_up = -1;
  1640. } elseif(r == 1) {
  1641. slot = 9;
  1642. slot_left = -1;
  1643. slot_right = 10;
  1644. slot_down = 18;
  1645. slot_up = 0;
  1646. } elseif(r == 2) {
  1647. slot = 28;
  1648. slot_left = 27;
  1649. slot_right = 29;
  1650. slot_down = 37;
  1651. slot_up = 19;
  1652. } else {
  1653. slot = 35;
  1654. slot_left = 34;
  1655. slot_right = -1;
  1656. slot_down = 44;
  1657. slot_up = 26;
  1658. }
  1659. if(slot_left != -1) {
  1660. inv.setItem(inv, slot_left, item_arrow_left);
  1661. }
  1662. if(slot_right != -1) {
  1663. inv.setItem(inv, slot_right, item_arrow_right);
  1664. }
  1665. if(slot_up != -1) {
  1666. inv.setItem(inv, slot_up, item_arrow_up);
  1667. }
  1668. if(slot_down != -1) {
  1669. inv.setItem(inv, slot_down, item_arrow_down);
  1670. }
  1671. inv.setItem(inv, slot, item.custom.create("PLUS_RED", 1, null, null));
  1672. inv.open(inv, player);
  1673. goto("checkgame");
  1674. }
  1675. if(block_loc == chart_course_loc) {
  1676. task_id = 6;
  1677. if(!hasTask(player, task_id)) {
  1678. goto("checkgame");
  1679. }
  1680. step = task.getStep(player, task_id);
  1681. if(step == 1) {
  1682. goto("checkgame");
  1683. }
  1684. a = array.new(9);
  1685. r = math.random(0, 2);
  1686. inv = inv.new("222222222222222222222222222222222222222222222222222222", text.new("§cChart Course"));
  1687. if(r == 0) {
  1688. a[0] = 27;
  1689. a[1] = 19;
  1690. a[2] = 29;
  1691. a[3] = 39;
  1692. a[4] = 31;
  1693. a[5] = 23;
  1694. a[6] = 15;
  1695. a[7] = 25;
  1696. a[8] = 35;
  1697. } elseif(r == 1) {
  1698. a[0] = 18;
  1699. a[1] = 28;
  1700. a[2] = 38;
  1701. a[3] = 30;
  1702. a[4] = 22;
  1703. a[5] = 32;
  1704. a[6] = 42;
  1705. a[7] = 34;
  1706. a[8] = 26;
  1707. } else {
  1708. a[0] = 36;
  1709. a[1] = 28;
  1710. a[2] = 20;
  1711. a[3] = 21;
  1712. a[4] = 13;
  1713. a[5] = 23;
  1714. a[6] = 33;
  1715. a[7] = 25;
  1716. a[8] = 26;
  1717. }
  1718. for(i = 0; i < 54; i++) {
  1719. inv.setItem(inv, i, light_gray_glass);
  1720. }
  1721. for(i = 0; i < 9; i++) {
  1722. inv.setItem(inv, a[i], black_glass);
  1723. }
  1724. player_uuid = player.getUuid(player);
  1725. map.add(chart_course_pattern, player_uuid, a);
  1726. inv.open(inv, player);
  1727. goto("checkgame");
  1728. }
  1729. if(block_loc == unlock_manifolds_loc) {
  1730. task_id = 5;
  1731. if(!hasTask(player, task_id)) {
  1732. goto("checkgame");
  1733. }
  1734. step = task.getStep(player, task_id);
  1735. if(step == 1) {
  1736. goto("checkgame");
  1737. }
  1738. //inv = inv.new("002222200 002222200");
  1739. inv = inv.new("002222200002222200", text.new("§cUnlock Manifolds"));
  1740. list = list.new();
  1741. for(i = 0; i < 10; i++) {
  1742. list.add(list, item.create("BLUE_STAINED_GLASS_PANE", i + 1, null, null));
  1743. }
  1744. list.shuffle(list);
  1745. a = 2;
  1746. for(i = 0; i < 10; i++) {
  1747. inv.setItem(inv, a++, list.getIndex(list, i));
  1748. if(a == 7) {
  1749. a = 11;
  1750. }
  1751. }
  1752. inv.open(inv, player);
  1753. goto("checkgame");
  1754. }
  1755. if(block_loc == start_reactor_loc) {
  1756. task_id = 4;
  1757. if(!hasTask(player, task_id)) {
  1758. goto("checkgame");
  1759. }
  1760. step = task.getStep(player, task_id);
  1761. if(step == 1) {
  1762. goto("checkgame");
  1763. }
  1764. if(reactor_used) {
  1765. msg.prefix(player, gamename, "Another player already starts the reactor.");
  1766. goto("checkgame");
  1767. }
  1768. reactor_used = true;
  1769. reactor_array = reactor.get(player);
  1770. if(reactor_array == null) {
  1771. //inv = inv.new("000000000 000000000 000002220 000002220 000002220 000000000");
  1772. inv = inv.new("000000000000000000000002220000002220000002220000000000", text.new("§cStart Reactor"));
  1773. for(i = 0; i < 54; i++) {
  1774. inv.setItem(inv, i, light_gray_glass);
  1775. }
  1776. reactor_array = array.new(5);
  1777. reactor.setInv(reactor_array, inv);
  1778. reactor.setStage(reactor_array, 0);
  1779. reactor.setPattern(reactor_array);
  1780. } else {
  1781. inv = reactor.getInv(reactor_array);
  1782. }
  1783. reactor.setCounter(reactor_array, 0);
  1784. reactor.setPhase(reactor_array, "draw");
  1785. reactor.save(reactor_array, player);
  1786. reactor.setHeader(inv, light_gray_glass);
  1787. reactor.setLeftSide(inv, black_glass);
  1788. reactor.setRightSide(inv, black_glass);
  1789. inv.open(inv, player);
  1790. list.add(reactor_draw_list_1, player.getUuid(player));
  1791. sgoto(20, "draw_pattern_1");
  1792. goto("checkgame");
  1793. }
  1794. if(block_loc == prime_shields_loc) {
  1795. task_id = 3;
  1796. if(!hasTask(player, task_id)) {
  1797. goto("checkgame");
  1798. }
  1799. step = task.getStep(player, task_id);
  1800. if(step == 1) {
  1801. goto("checkgame");
  1802. }
  1803. //inv = inv.new("000000000 000222000 002222200 002222200 000222000 000000000");
  1804. inv = inv.new("000000000000222000002222200002222200000222000000000000", text.new("§cPrime Shields"));
  1805. for(i = 12; i < 42; i++) {
  1806. r = math.random(0, 1);
  1807. if(r == 0) {
  1808. inv.setItem(inv, i, green_glass);
  1809. } else {
  1810. inv.setItem(inv, i, red_glass);
  1811. }
  1812. if(i == 14) {
  1813. i = 19;
  1814. } elseif(i == 24) {
  1815. i = 28;
  1816. } elseif(i == 33) {
  1817. i = 38;
  1818. }
  1819. }
  1820. inv.open(inv, player);
  1821. goto("checkgame");
  1822. }
  1823. if(block_loc == fix_o2_loc_1 || block_loc == fix_o2_loc_2) {
  1824. if(player.isGhost(player)) {
  1825. goto("checkgame");
  1826. }
  1827. if(oxygen_sabotaged) {
  1828. if(block_loc == fix_o2_loc_1) {
  1829. map.add(oxygen_map, player.getUuid(player), fix_o2_loc_1);
  1830. if(oxy_fixed_1) {
  1831. goto("checkgame");
  1832. }
  1833. } elseif(block_loc == fix_o2_loc_2) {
  1834. map.add(oxygen_map, player.getUuid(player), fix_o2_loc_2);
  1835. if(oxy_fixed_2) {
  1836. goto("checkgame");
  1837. }
  1838. }
  1839. //oxygen_inv = inv.new("000000000 000000000 000222000 000222000 000222000 000222000");
  1840. oxygen_inv = inv.new("000000000000000000000222000000222000000222000000222000", text.new("§cENTER CODE"));
  1841. inv.setItem(oxygen_inv, 8, item.create("PAPER", 1, string.concat("§f", string.number(oxy_code)), null));
  1842. inv.setItem(oxygen_inv, 21, item.custom.create("DIGIT_0", 1, "§f0", null));
  1843. inv.setItem(oxygen_inv, 22, item.custom.create("DIGIT_1", 1, "§f1", null));
  1844. inv.setItem(oxygen_inv, 23, item.custom.create("DIGIT_2", 1, "§f2", null));
  1845. inv.setItem(oxygen_inv, 30, item.custom.create("DIGIT_3", 1, "§f3", null));
  1846. inv.setItem(oxygen_inv, 31, item.custom.create("DIGIT_4", 1, "§f4", null));
  1847. inv.setItem(oxygen_inv, 32, item.custom.create("DIGIT_5", 1, "§f5", null));
  1848. inv.setItem(oxygen_inv, 39, item.custom.create("DIGIT_6", 1, "§f6", null));
  1849. inv.setItem(oxygen_inv, 40, item.custom.create("DIGIT_7", 1, "§f7", null));
  1850. inv.setItem(oxygen_inv, 41, item.custom.create("DIGIT_8", 1, "§f8", null));
  1851. inv.setItem(oxygen_inv, 48, item.custom.create("CROSS_RED", 1, null, null));
  1852. inv.setItem(oxygen_inv, 49, item.custom.create("DIGIT_9", 1, "§f9", null));
  1853. inv.setItem(oxygen_inv, 50, item.custom.create("CHECK_GREEN", 1, null, null));
  1854. inv.open(oxygen_inv, player);
  1855. sabotage.openedInv(player);
  1856. }
  1857. goto("checkgame");
  1858. }
  1859. if(block_loc == fix_reactor_loc_1 || block_loc == fix_reactor_loc_2) {
  1860. if(player.isGhost(player)) {
  1861. goto("checkgame");
  1862. }
  1863. if(reactor_sabotaged) {
  1864. if(block_loc == fix_reactor_loc_1) {
  1865. sabotage.openedInv(player);
  1866. inv.open(reactor_inv_1, player);
  1867. list.add(reactor_hold_list_1, player.getUuid(player));
  1868. goto("checkgame");
  1869. }
  1870. if(block_loc == fix_reactor_loc_2) {
  1871. sabotage.openedInv(player);
  1872. inv.open(reactor_inv_2, player);
  1873. list.add(reactor_hold_list_2, player.getUuid(player));
  1874. }
  1875. }
  1876. goto("checkgame");
  1877. }
  1878. if(block_loc == fix_comms_loc) {
  1879. if(player.isGhost(player)) {
  1880. goto("checkgame");
  1881. }
  1882. if(comms_sabotaged) {
  1883. player_uuid = player.getUuid(player);
  1884. inv = inv.new("000000000000000000000000000000000000000000000000202000", text.new("§cFix Communications"));
  1885. inv.setItem(inv, 48, item.custom.create("ARROW_LEFT", 1, null, null));
  1886. inv.setItem(inv, 49, item.create("BLACK_STAINED_GLASS_PANE", 32, null, null));
  1887. inv.setItem(inv, 50, item.custom.create("ARROW_RIGHT", 1, null, null));
  1888. inv.open(inv, player);
  1889. sabotage.openedInv(player);
  1890. diff = math.abs(32 - comms_fix_freq);
  1891. if(diff == 0) {
  1892. comms.drawCorrect(inv, player);
  1893. } elseif(diff < 4) {
  1894. comms.drawClose(inv, player);
  1895. } else {
  1896. comms.drawWorst(inv, player);
  1897. }
  1898. map.add(comms_inv_map, player_uuid, inv);
  1899. if(!list.contains(comms_state_list, player_uuid)) {
  1900. list.add(comms_state_list, player_uuid);
  1901. sgoto(5, "draw_comms");
  1902. }
  1903. }
  1904. goto("checkgame");
  1905. }
  1906. if(block_loc == fix_lights_loc_1 || block_loc == fix_lights_loc_2) {
  1907. if(player.isGhost(player)) {
  1908. goto("checkgame");
  1909. }
  1910. if(lights_sabotaged) {
  1911. sabotage.openedInv(player);
  1912. inv.open(lights_inv, player);
  1913. }
  1914. goto("checkgame");
  1915. }
  1916. if(block_loc == meeting_button_loc) {
  1917. if(player.isGhost(player)) {
  1918. goto("checkgame");
  1919. }
  1920. if(amongus.isAlert()) {
  1921. msg.prefix(player, gamename, "No meetings allowed while sabotaged.");
  1922. goto("checkgame");
  1923. }
  1924. if(!meeting) {
  1925. callMeeting(player);
  1926. }
  1927. goto("checkgame");
  1928. }
  1929. block_type = block.getType(block);
  1930. if(block_type == lever_mat) {
  1931. cancel = true;
  1932. }
  1933. if(block_type == redstone_lamp_mat) {
  1934. task_id = 10;
  1935. if(!hasTask(player, task_id)) {
  1936. goto("checkgame");
  1937. }
  1938. step = task.getStep(player, task_id);
  1939. if(step == 3) {
  1940. goto("checkgame");
  1941. }
  1942. my_list = map.get(wires_map_4, player.getUuid(player));
  1943. if(block_loc != list.getIndex(my_list, step)) {
  1944. goto("checkgame");
  1945. }
  1946. //inv = inv.new("000000000 002202200 002202200 002202200 002202200 000000000");
  1947. inv = inv.new("000000000002202200002202200002202200002202200000000000", text.new("§cFix Wiring"));
  1948. for(i = 0; i < 54; i++) {
  1949. inv.setItem(inv, i, light_gray_glass);
  1950. }
  1951. inv.setItem(inv, 12, item.custom.create("CROSS_RED", 1, "§rDisconnected", null));
  1952. inv.setItem(inv, 14, item.custom.create("CROSS_RED", 1, "§rDisconnected", null));
  1953. inv.setItem(inv, 21, item.custom.create("CROSS_RED", 1, "§rDisconnected", null));
  1954. inv.setItem(inv, 23, item.custom.create("CROSS_RED", 1, "§rDisconnected", null));
  1955. inv.setItem(inv, 30, item.custom.create("CROSS_RED", 1, "§rDisconnected", null));
  1956. inv.setItem(inv, 32, item.custom.create("CROSS_RED", 1, "§rDisconnected", null));
  1957. inv.setItem(inv, 39, item.custom.create("CROSS_RED", 1, "§rDisconnected", null));
  1958. inv.setItem(inv, 41, item.custom.create("CROSS_RED", 1, "§rDisconnected", null));
  1959. list.shuffle(wires_list);
  1960. inv.setItem(inv, 11, list.getIndex(wires_list, 0));
  1961. inv.setItem(inv, 20, list.getIndex(wires_list, 1));
  1962. inv.setItem(inv, 29, list.getIndex(wires_list, 2));
  1963. inv.setItem(inv, 38, list.getIndex(wires_list, 3));
  1964. list.shuffle(wires_list);
  1965. inv.setItem(inv, 15, list.getIndex(wires_list, 0));
  1966. inv.setItem(inv, 24, list.getIndex(wires_list, 1));
  1967. inv.setItem(inv, 33, list.getIndex(wires_list, 2));
  1968. inv.setItem(inv, 42, list.getIndex(wires_list, 3));
  1969. inv.open(inv, player);
  1970. goto("checkgame");
  1971. }
  1972. if(list.contains(download_list_3, block_loc) || block_loc == admin_upload_loc) {
  1973. cancel = true;
  1974. task_id = 2;
  1975. if(!hasTask(player, task_id)) {
  1976. goto("checkgame");
  1977. }
  1978. step = task.getStep(player, task_id);
  1979. if(block_loc == admin_upload_loc) {
  1980. if(step != 1) {
  1981. goto("checkgame");
  1982. }
  1983. //Upload
  1984. inv = inv.new("000000000000000000000020000", text.new("§cUpload Data"));
  1985. for(i = 0; i < 9; i++) {
  1986. inv.setItem(inv, i, light_gray_glass);
  1987. }
  1988. inv.setItem(inv, 9, item.create("birch_trapdoor", 1, "§rMy Laptop", null));
  1989. inv.setItem(inv, 17, item.create("redstone_torch", 1, "§rHeadquarters", null));
  1990. inv.setItem(inv, 22, item.custom.create("ARROW_UP", 1, "§rUpload", null));
  1991. inv.open(inv, player);
  1992. goto("checkgame");
  1993. }
  1994. if(step != 0) {
  1995. goto("checkgame");
  1996. }
  1997. r = map.get(download_map_3, player.getUuid(player));
  1998. down_loc = list.getIndex(download_list_3, r);
  1999. if(down_loc != block_loc) {
  2000. goto("checkgame");
  2001. }
  2002. //Download
  2003. inv = inv.new("000000000000000000000020000", text.new("§cDownload Data"));
  2004. for(i = 0; i < 9; i++) {
  2005. inv.setItem(inv, i, light_gray_glass);
  2006. }
  2007. inv.setItem(inv, 9, item.create("CHEST", 1, map.get(download_map_2, block_loc), null));
  2008. inv.setItem(inv, 17, item.create("BIRCH_TRAPDOOR", 1, "§rMy Laptop", null));
  2009. inv.setItem(inv, 22, item.custom.create("ARROW_DOWN", 1, "§rDownload", null));
  2010. inv.open(inv, player);
  2011. goto("checkgame");
  2012. }
  2013. if(block_loc == get_fuel_loc) {
  2014. task_id = 1;
  2015. if(!hasTask(player, task_id)) {
  2016. goto("checkgame");
  2017. }
  2018. step = task.getStep(player, task_id);
  2019. if(step == 1 || step == 3 || step == 4) {
  2020. goto("checkgame");
  2021. }
  2022. lime_terra_item = item.create("LIME_TERRACOTTA", 1, null, null);
  2023. //inv = inv.new(000000002 000000000 000000000 000000000 000000000 000000000);
  2024. inv = inv.new("000000002000000000000000000000000000000000000000000000", text.new("§cFuel"));
  2025. player_uuid = player.getUuid(player);
  2026. c = map.getOrDefault(fuel_counter, player_uuid, 0);
  2027. for(row = 0; row < 6; row++) {
  2028. for(col = 0; col < 7; col++) {
  2029. i = row * 9 + col;
  2030. inv.setItem(inv, i, lime_terra_item);
  2031. }
  2032. }
  2033. inv.setItem(inv, 8, item.custom.create("ARROW_DOWN", 1, "§rGet fuel", null));
  2034. inv.open(inv, player);
  2035. goto("checkgame");
  2036. }
  2037. if(block_loc == upper_engine_loc || block_loc == lower_engine_loc) {
  2038. task_id = 1;
  2039. cancel = true;
  2040. if(!hasTask(player, task_id)) {
  2041. goto("checkgame");
  2042. }
  2043. step = task.getStep(player, task_id);
  2044. if(step == 0 || step == 2 || step == 4) {
  2045. goto("checkgame");
  2046. }
  2047. if(step == 1 && block_loc != upper_engine_loc) {
  2048. goto("checkgame");
  2049. }
  2050. if(step == 3 && block_loc != lower_engine_loc) {
  2051. goto("checkgame");
  2052. }
  2053. //inv = inv.new(000000002 000000000 000000000 000000000 000000000 000000000);
  2054. inv = inv.new("000000002000000000000000000000000000000000000000000000", text.new("§cEngine"));
  2055. for(row = 0; row < 6; row++) {
  2056. for(col = 0; col < 7; col++) {
  2057. i = row * 9 + col;
  2058. inv.setItem(inv, i, light_gray_glass);
  2059. }
  2060. }
  2061. inv.setItem(inv, 8, item.custom.create("ARROW_UP", 1, "§rFill engine", null));
  2062. inv.open(inv, player);
  2063. goto("checkgame");
  2064. }
  2065. goto("checkgame");
  2066. @inv_click
  2067. if(inv_slot >= 36 && inv_slot <= 39) {
  2068. cancel = true;
  2069. }
  2070. goto("checkgame");
  2071. @inv_close
  2072. player_uuid = player.getUuid(player);
  2073. if(list.contains(auto_close_list, player_uuid)) {
  2074. list.add(auto_close_list_2, player_uuid);
  2075. }
  2076. if(amongus.isAlert()) {
  2077. sabotage.closedInv(player);
  2078. }
  2079. if(reactor_sabotaged) {
  2080. if(inv_id == inv.getId(reactor_inv_1)) {
  2081. list.remove(reactor_hold_list_1, player_uuid);
  2082. if(list.getSize(reactor_hold_list_1) == 0) {
  2083. sabotage.holdReactor(reactor_inv_1, false);
  2084. hold_reactor_1 = false;
  2085. }
  2086. goto("checkgame");
  2087. }
  2088. if(inv_id == inv.getId(reactor_inv_2)) {
  2089. list.remove(reactor_hold_list_2, player_uuid);
  2090. if(list.getSize(reactor_hold_list_2) == 0) {
  2091. sabotage.holdReactor(reactor_inv_2, false);
  2092. hold_reactor_2 = false;
  2093. }
  2094. goto("checkgame");
  2095. }
  2096. }
  2097. title_string = string.text(inv_title);
  2098. if(title_string == "§cFuel" || title_string == "§cEngine") {
  2099. map.remove(fuel_counter, player_uuid);
  2100. goto("checkgame");
  2101. }
  2102. if(title_string == "§cFix Wiring") {
  2103. map.remove(wires_map, player_uuid);
  2104. goto("checkgame");
  2105. }
  2106. if(title_string == "§cFix Communications") {
  2107. map.remove(comms_inv_map, player_uuid);
  2108. map.remove(comms_fix_map, player_uuid);
  2109. goto("checkgame");
  2110. }
  2111. if(title_string == "§cClean O2 Filter") {
  2112. map.remove(clean_o2_map, player_uuid);
  2113. goto("checkgame");
  2114. }
  2115. if(title_string == "§cSubmit Scan") {
  2116. list.add(submit_scan_list_2, player_uuid);
  2117. sgoto(20, "unblock_submit_scan");
  2118. goto("checkgame");
  2119. }
  2120. if(title_string == "§cCalibrate Distributor") {
  2121. list.add(calibrate_dist_list_2, player_uuid);
  2122. sgoto(7, "unblock_calib_dist");
  2123. goto("checkgame");
  2124. }
  2125. if(title_string == "§cChart Course") {
  2126. map.remove(chart_course_counter, player_uuid);
  2127. map.remove(chart_course_pattern, player_uuid);
  2128. goto("checkgame");
  2129. }
  2130. if(title_string == "§cEmpty Garbage") {
  2131. list.add(empty_garb_list_2, player_uuid);
  2132. sgoto(25, "unblock_empty_garb");
  2133. goto("checkgame");
  2134. }
  2135. if(title_string == "§cClear Asteroids") {
  2136. list.add(clear_ast_list_2, player_uuid);
  2137. sgoto(5, "unblock_clear_ast");
  2138. goto("checkgame");
  2139. }
  2140. if(title_string == "§cUnlock Manifolds") {
  2141. map.remove(manifolds_counter, player_uuid);
  2142. goto("checkgame");
  2143. }
  2144. if(title_string == "§cStart Reactor") {
  2145. reactor_used = false;
  2146. list.add(reactor_block_list, player_uuid);
  2147. sgoto(20, "unblock_start_reactor");
  2148. goto("checkgame");
  2149. }
  2150. if(title_string == "§cDownload Data" || title_string == "§cUpload Data") {
  2151. list.add(download_list_2, player_uuid);
  2152. sgoto(25, "unblock_download");
  2153. }
  2154. goto("checkgame");
  2155. @snuvi_click
  2156. item = inv.getItem(inv, inv_slot);
  2157. item.removeFlag(item, "HIDE_DESTROYS");
  2158. title_string = string.text(inv_title);
  2159. if(title_string == "§cSABOTAGE") {
  2160. //Keine Sabotagen während bestehender Sabotage möglich
  2161. if(amongus.isAlert()) {
  2162. msg.prefix(player, gamename, "A sabotage is already active.");
  2163. goto("checkgame");
  2164. }
  2165. if(meeting) {
  2166. msg.prefix(player, gamename, "Sabotage during meeting not possible.");
  2167. goto("checkgame");
  2168. }
  2169. cooldown = data.getTimer(player, "Sabotage Cooldown");
  2170. if(cooldown != null && cooldown != -1) {
  2171. msg.prefix(player, gamename, string.concat("Remaining sabotage cooldown: ", string.number(math.roundDown(cooldown / 20)), "s"));
  2172. goto("checkgame");
  2173. }
  2174. //sabotage light
  2175. if(inv_slot == 0) {
  2176. sabotage_light();
  2177. goto("checkgame");
  2178. }
  2179. //sabotage reactor
  2180. if(inv_slot == 1) {
  2181. sabotage_reactor();
  2182. goto("checkgame");
  2183. }
  2184. //sabotage oxygen
  2185. if(inv_slot == 2) {
  2186. sabotage_oxygen();
  2187. goto("checkgame");
  2188. }
  2189. //sabotage communication
  2190. if(inv_slot == 3) {
  2191. sabotage_comms();
  2192. goto("checkgame");
  2193. }
  2194. goto("checkgame");
  2195. }
  2196. if(title_string == "§cVOTE") {
  2197. if(player.isGhost(player)) {
  2198. goto("checkgame");
  2199. }
  2200. player_uuid = player.getUuid(player);
  2201. if(map.contains(vote_count_map_2, player_uuid)) {
  2202. goto("checkgame");
  2203. }
  2204. item_type = item.getType(item);
  2205. if(item.custom.isType(item, return_green_mat) || item_type == player_head_mat && item.getType(inv.getItem(inv, inv_slot - 1)) != zombie_head_mat) {
  2206. inv.setItem(inv, 2, black_glass);
  2207. inv.setItem(inv, 3, black_glass);
  2208. inv.setItem(inv, 7, black_glass);
  2209. inv.setItem(inv, 8, black_glass);
  2210. inv.setItem(inv, 11, black_glass);
  2211. inv.setItem(inv, 12, black_glass);
  2212. inv.setItem(inv, 16, black_glass);
  2213. inv.setItem(inv, 17, black_glass);
  2214. inv.setItem(inv, 20, black_glass);
  2215. inv.setItem(inv, 21, black_glass);
  2216. inv.setItem(inv, 25, black_glass);
  2217. inv.setItem(inv, 26, black_glass);
  2218. inv.setItem(inv, 29, black_glass);
  2219. inv.setItem(inv, 30, black_glass);
  2220. inv.setItem(inv, 34, black_glass);
  2221. inv.setItem(inv, 35, black_glass);
  2222. inv.setItem(inv, 38, black_glass);
  2223. inv.setItem(inv, 39, black_glass);
  2224. inv.setItem(inv, 43, black_glass);
  2225. inv.setItem(inv, 44, black_glass);
  2226. inv.setItem(inv, 47, black_glass);
  2227. inv.setItem(inv, 48, black_glass);
  2228. inv.setItem(inv, inv_slot + 1, item.custom.create("CHECK_GREEN", 1, "§rConfirm", null));
  2229. inv.setItem(inv, inv_slot + 2, item.custom.create("CROSS_RED", 1, "§rCancel", null));
  2230. goto("checkgame");
  2231. }
  2232. if(item.custom.isType(item, cross_red_mat)) {
  2233. inv.setItem(inv, inv_slot, black_glass);
  2234. inv.setItem(inv, inv_slot - 1, black_glass);
  2235. goto("checkgame");
  2236. }
  2237. if(item.custom.isType(item, check_green_mat)) {
  2238. if(item.getType(inv.getItem(inv, inv_slot - 2)) != zombie_head_mat) {
  2239. vote_item = inv.getItem(inv, inv_slot - 1);
  2240. if(item.custom.isType(vote_item, return_green_mat)) {
  2241. map.add(vote_count_map, "skip", map.getOrDefault(vote_count_map, "skip", 0) + 1);
  2242. map.add(vote_count_map_2, player_uuid, "skip");
  2243. } else {
  2244. vote_item_name = string.text(item.getName(vote_item));
  2245. a = string.split(" ", vote_item_name);
  2246. vote_name = a[2];
  2247. vote_uuid = player.getUuid(string.removeFormat(vote_name));
  2248. map.add(vote_count_map, vote_uuid, map.getOrDefault(vote_count_map, vote_uuid, 0) + 1);
  2249. map.add(vote_count_map_2, player_uuid, vote_uuid);
  2250. }
  2251. inv.setItem(inv, inv_slot, black_glass);
  2252. inv.setItem(inv, inv_slot + 1, black_glass);
  2253. //Bei allen Spielern anzeigen, dass player gevoted hat
  2254. index = list.getIndexOf(all_list, player_uuid);
  2255. if(index % 2 == 0) {
  2256. voted_slot = (index / 2) * 9;
  2257. } else {
  2258. voted_slot = ((index - 1) / 2) * 9 + 5;
  2259. }
  2260. voted_item = item.custom.create("CHECK_RED", 1, string.concat(amongus.getPlayerColorCode(player), player.getName(player), "§r has voted"), null);
  2261. iter = iterator(player_list);
  2262. while(hasNext(iter)) {
  2263. p_uuid = next(iter);
  2264. p = player.get(p_uuid);
  2265. inv = getVoteInv(p);
  2266. inv.setItem(inv, voted_slot, voted_item);
  2267. }
  2268. sound.spawnForPlayer(player, vote_sound, master_sound_category);
  2269. //Haben bereits alle gevoted?
  2270. if(map.getSize(vote_count_map_2) == list.getSize(player_list) - list.getSize(ghosts)) {
  2271. goto("score_evaluation");
  2272. }
  2273. }
  2274. }
  2275. goto("checkgame");
  2276. }
  2277. if(title_string == "§cENTER CODE") {
  2278. //CODE eingeben
  2279. if(item.isDigit(item)) {
  2280. number = string.text(item.getName(item));
  2281. for(i = 2; i < 7; i++) {
  2282. if(item.getType(inv.getItem(inv, i)) == black_glass_mat) {
  2283. break;
  2284. }
  2285. }
  2286. if(i == 7) {
  2287. goto("checkgame");
  2288. }
  2289. inv.setItem(inv, i, item);
  2290. inv.setItem(inv, 7, black_glass);
  2291. goto("checkgame");
  2292. }
  2293. //CODEEINGABE CANCELN
  2294. if(inv_slot == 48) {
  2295. for(i = 2; i < 7; i++) {
  2296. inv.setItem(inv, i, black_glass);
  2297. }
  2298. goto("checkgame");
  2299. }
  2300. //CODE BESTÄTIGEN
  2301. if(inv_slot == 50) {
  2302. number = "";
  2303. for(i = 2; i < 7; i++) {
  2304. item = inv.getItem(inv, i);
  2305. if(item.getType(item) == black_glass_mat) {
  2306. for(h = 2; h < 7; h++) {
  2307. inv.setItem(inv, h, black_glass);
  2308. }
  2309. goto("checkgame");
  2310. }
  2311. number = string.concat(number, string.text(item.getName(item)));
  2312. }
  2313. number = read.number(string.removeFormat(number));
  2314. if(number == oxy_code) {
  2315. player_uuid = player.getUuid(player);
  2316. sgoto_auto_close_inv(player_uuid);
  2317. inv.setItem(inv, 7, item.custom.create("CHECK_GREEN", 1, "§rCorrect code", null));
  2318. loc = map.get(oxygen_map, player_uuid);
  2319. if(loc == fix_o2_loc_1) {
  2320. oxy_fixed_1 = true;
  2321. removeSaboParticles(fix_o2_par_loc_1, null);
  2322. if(oxy_fixed_2) {
  2323. fix_oxygen();
  2324. }
  2325. } elseif(loc == fix_o2_loc_2) {
  2326. oxy_fixed_2 = true;
  2327. removeSaboParticles(fix_o2_par_loc_2, null);
  2328. if(oxy_fixed_1) {
  2329. fix_oxygen();
  2330. }
  2331. }
  2332. } else {
  2333. inv.setItem(inv, 7, item.custom.create("CROSS_RED", 1, "§rFalse code", null));
  2334. for(i = 2; i < 7; i++) {
  2335. inv.setItem(inv, i, black_glass);
  2336. }
  2337. }
  2338. }
  2339. goto("checkgame");
  2340. }
  2341. if(title_string == "§cAlign Engine") {
  2342. task_id = 17;
  2343. step = task.getStep(player, task_id);
  2344. if(step == 2) {
  2345. goto("checkgame");
  2346. }
  2347. player_uuid = player.getUuid(player);
  2348. loc = map.get(align_engine_map_2, player_uuid);
  2349. if(block_loc == ue_align_loc && set.contains(align_ue_engine_set, player_uuid)) {
  2350. goto("checkgame");
  2351. }
  2352. if(block_loc == le_align_loc && set.contains(align_le_engine_set, player_uuid)) {
  2353. goto("checkgame");
  2354. }
  2355. if(item.custom.isType(item, arrow_up_mat)) {
  2356. temp = set_engine(player, inv, "up");
  2357. } elseif(item.custom.isType(item, arrow_down_mat)) {
  2358. temp = set_engine(player, inv, "down");
  2359. } else {
  2360. goto("checkgame");
  2361. }
  2362. if(temp) {
  2363. if(loc == le_align_loc) {
  2364. set.add(align_le_engine_set, player_uuid);
  2365. removeTaskParticle(player, le_align_par_loc);
  2366. } else {
  2367. set.add(align_ue_engine_set, player_uuid);
  2368. removeTaskParticle(player, ue_align_par_loc);
  2369. }
  2370. step = task.stepIncrease(player, task_id);
  2371. giveTask(player, 17, "UE/LE", "Align Engine", step, 2, null);
  2372. sgoto_auto_close_inv(player_uuid);
  2373. }
  2374. goto("checkgame");
  2375. }
  2376. if(title_string == "§cClean O2 Filter") {
  2377. task_id = 15;
  2378. step = task.getStep(player, task_id);
  2379. if(step == 1) {
  2380. goto("checkgame");
  2381. }
  2382. if(item.custom.isType(item, arrow_up_mat)) {
  2383. old_slot = inv_slot + 9;
  2384. } elseif(item.custom.isType(item, arrow_left_mat)) {
  2385. old_slot = inv_slot + 1;
  2386. } elseif(item.custom.isType(item, arrow_down_mat)) {
  2387. old_slot = inv_slot - 9;
  2388. } else {
  2389. goto("checkgame");
  2390. }
  2391. inv.setItem(inv, inv_slot, item.create("oak_leaves", 1, null, null));
  2392. inv.setItem(inv, old_slot, light_gray_glass);
  2393. if(inv_slot == 18 || inv_slot == 27) {
  2394. inv.setItem(inv, inv_slot, light_gray_glass);
  2395. player_uuid = player.getUuid(player);
  2396. c = map.getOrDefault(clean_o2_map, player_uuid, 0) + 1;
  2397. map.add(clean_o2_map, player_uuid, c);
  2398. if(c == 6) {
  2399. removeTaskParticle(player, clean_o2_par_loc);
  2400. step = task.stepIncrease(player, task_id);
  2401. giveTask(player, 15, "O2", "Clean O2 Filter", 1, 1, null);
  2402. sgoto_auto_close_inv(player_uuid);
  2403. goto("checkgame");
  2404. }
  2405. }
  2406. for(slot = 1; slot < 53; slot++) {
  2407. if(item.getType(inv.getItem(inv, slot)) == oak_leaves_mat) {
  2408. if(slot < 18) {
  2409. a = inv.getItem(inv, slot + 9);
  2410. b = inv.getItem(inv, slot - 1);
  2411. if(item.custom.isType(a, arrow_down_mat) || item.custom.isType(b, arrow_left_mat)) {
  2412. continue;
  2413. }
  2414. a_type = item.getType(a);
  2415. if(a_type == light_gray_glass_mat) {
  2416. inv.setItem(inv, slot + 9, item_arrow_down);
  2417. continue;
  2418. }
  2419. }
  2420. if(slot > 36) {
  2421. a = inv.getItem(inv, slot - 9);
  2422. b = inv.getItem(inv, slot - 1);
  2423. if(item.custom.isType(a, arrow_up_mat) || item.custom.isType(b, arrow_left_mat)) {
  2424. continue;
  2425. }
  2426. a_type = item.getType(a);
  2427. if(a_type == light_gray_glass_mat) {
  2428. inv.setItem(inv, slot - 9, item_arrow_up);
  2429. continue;
  2430. }
  2431. }
  2432. if(item.getType(inv.getItem(inv, slot - 1)) == light_gray_glass_mat) {
  2433. inv.setItem(inv, slot - 1, item_arrow_left);
  2434. }
  2435. }
  2436. }
  2437. goto("checkgame");
  2438. }
  2439. if(title_string == "§cDivert Power") {
  2440. task_id = 14;
  2441. step = task.getStep(player, task_id);
  2442. if(step == 2) {
  2443. goto("checkgame");
  2444. }
  2445. item_type = item.getType(item);
  2446. if(item_type == redstone_torch_mat) {
  2447. if(step == 1) {
  2448. goto("checkgame");
  2449. }
  2450. redstone = item.create("redstone", 1, null, null);
  2451. inv.setItem(inv, 4, redstone);
  2452. inv.setItem(inv, 13, redstone);
  2453. inv.setItem(inv, inv_slot - 9, redstone);
  2454. if(inv_slot < 40) {
  2455. inv.setItem(inv, inv_slot - 17, redstone);
  2456. if(inv_slot < 38) {
  2457. inv.setItem(inv, inv_slot - 24, redstone);
  2458. inv.setItem(inv, inv_slot - 25, redstone);
  2459. }
  2460. } elseif(inv_slot > 40) {
  2461. inv.setItem(inv, inv_slot - 19, redstone);
  2462. if(inv_slot > 42) {
  2463. inv.setItem(inv, inv_slot - 29, redstone);
  2464. inv.setItem(inv, inv_slot - 30, redstone);
  2465. }
  2466. } else {
  2467. inv.setItem(inv, inv_slot - 18, redstone);
  2468. }
  2469. player_uuid = player.getUuid(player);
  2470. removeTaskParticle(player, elec_power_par_loc);
  2471. r = map.get(divert_pow_map_3, player_uuid);
  2472. addTaskParticle(player, map.get(divert_pow_map_4, r));
  2473. step = task.stepIncrease(player, task_id);
  2474. giveTask(player, task_id, "[Room]", "Divert power to [Room]", step, 2, null);
  2475. sgoto_auto_close_inv(player_uuid);
  2476. goto("checkgame");
  2477. }
  2478. if(item_type == stone_button_mat) {
  2479. redstone = item.create("redstone", 1, null, null);
  2480. inv.setItem(inv, 8, redstone);
  2481. inv.setItem(inv, 15, redstone);
  2482. inv.setItem(inv, 16, redstone);
  2483. inv.setItem(inv, 23, redstone);
  2484. inv.setItem(inv, 26, redstone);
  2485. inv.setItem(inv, 32, redstone);
  2486. inv.setItem(inv, 33, redstone);
  2487. inv.setItem(inv, 34, redstone);
  2488. inv.setItem(inv, 41, redstone);
  2489. inv.setItem(inv, 44, redstone);
  2490. inv.setItem(inv, 51, redstone);
  2491. inv.setItem(inv, 52, redstone);
  2492. player_uuid = player.getUuid(player);
  2493. r = map.get(divert_pow_map_3, player_uuid);
  2494. removeTaskParticle(player, map.get(divert_pow_map_4, r));
  2495. step = task.stepIncrease(player, task_id);
  2496. giveTask(player, task_id, "[Room]", "Divert power to [Room]", step, 2, null);
  2497. sgoto_auto_close_inv(player.getUuid(player));
  2498. }
  2499. goto("checkgame");
  2500. }
  2501. if(title_string == "§cClear Asteroids") {
  2502. task_id = 13;
  2503. step = task.getStep(player, task_id);
  2504. if(step == 20) {
  2505. goto("checkgame");
  2506. }
  2507. if(item == asteroid_item) {
  2508. inv.setItem(inv, inv_slot, black_glass);
  2509. player_uuid = player.getUuid(player);
  2510. my_list = map.get(clear_ast_map, player_uuid);
  2511. iter = iterator(my_list);
  2512. while(hasNext(iter)) {
  2513. a = next(iter);
  2514. slot = a[1];
  2515. if(slot == inv_slot) {
  2516. step = task.stepIncrease(player, task_id);
  2517. giveTask(player, 13, "WEA", "Clear Asteroids", step, 20, null);
  2518. if(step == 20) {
  2519. removeTaskParticle(player, clear_ast_par_loc);
  2520. sgoto_auto_close_inv(player_uuid);
  2521. list.add(clear_ast_list_3, player_uuid);
  2522. break;
  2523. }
  2524. remove(iter);
  2525. continue;
  2526. }
  2527. }
  2528. }
  2529. goto("checkgame");
  2530. }
  2531. if(title_string == "§cEmpty Garbage") {
  2532. task_id = 12;
  2533. step = task.getStep(player, task_id);
  2534. if(step == 2) {
  2535. goto("checkgame");
  2536. }
  2537. if(item.custom.isType(item, arrow_down_mat)) {
  2538. inv.setItem(inv, inv_slot, black_glass);
  2539. player_uuid = player.getUuid(player);
  2540. list.add(empty_garb_list, player_uuid);
  2541. map.add(empty_garb_map, player_uuid, 0);
  2542. map.add(empty_garb_map_2, player_uuid, inv);
  2543. sgoto(20, "empty_garb");
  2544. }
  2545. goto("checkgame");
  2546. }
  2547. if(title_string == "§cSwipe Card") {
  2548. task_id = 11;
  2549. step = task.getStep(player, task_id);
  2550. if(step == 1) {
  2551. goto("checkgame");
  2552. }
  2553. if(inv_slot == 11 || (item.getType(item) == light_gray_glass_mat && item.getType(inv.getItem(inv, inv_slot - 1)) == lime_glass_mat)) {
  2554. player_uuid = player.getUuid(player);
  2555. if(inv_slot == 11) {
  2556. map.add(swipe_card_map, player_uuid, time.getMillis());
  2557. }
  2558. inv.setItem(inv, inv_slot, lime_glass);
  2559. if(inv_slot == 15) {
  2560. start_time = map.get(swipe_card_map, player_uuid);
  2561. time = (time.getMillis() - start_time) / 1000;
  2562. if(time < 1.8) {
  2563. inv.setItem(inv, 16, item.custom.create("CROSS_RED", 1, string.concat("§rToo fast ", math.roundComma(time, 1), "s"), null));
  2564. for(i = 11; i < 16; i++) {
  2565. inv.setItem(inv, i, light_gray_glass);
  2566. }
  2567. } elseif(time > 2.2) {
  2568. inv.setItem(inv, 16, item.custom.create("CROSS_RED", 1, string.concat("§rToo slow ", math.roundComma(time, 1), "s"), null));
  2569. for(i = 11; i < 16; i++) {
  2570. inv.setItem(inv, i, light_gray_glass);
  2571. }
  2572. } else {
  2573. removeTaskParticle(player, swipe_card_par_loc);
  2574. inv.setItem(inv, 16, item.custom.create("CHECK_GREEN", 1, "§rTask completed", null));
  2575. step = task.stepIncrease(player, task_id);
  2576. giveTask(player, 11, "ADM", "Swipe Card", 1, 1, null);
  2577. sgoto_auto_close_inv(player_uuid);
  2578. }
  2579. }
  2580. }
  2581. goto("checkgame");
  2582. }
  2583. if(title_string == "§cFix Wiring") {
  2584. task_id = 10;
  2585. step = task.getStep(player, task_id);
  2586. if(step == 3) {
  2587. goto("checkgame");
  2588. }
  2589. player_uuid = player.getUuid(player);
  2590. if(inv_slot == 11 || inv_slot == 20 || inv_slot == 29 || inv_slot == 38) {
  2591. map.add(wires_map_2, player_uuid, inv_slot);
  2592. }
  2593. if(inv_slot == 15 || inv_slot == 24 || inv_slot == 33 || inv_slot == 42) {
  2594. slot = map.get(wires_map_2, player_uuid);
  2595. if(slot == null) {
  2596. goto("checkgame");
  2597. }
  2598. map.remove(wires_map_2, player_uuid);
  2599. if(inv.getItem(inv, slot) == item && item.custom.isType(inv.getItem(inv, inv_slot - 1), cross_red_mat)) {
  2600. inv.setItem(inv, slot + 1, item.custom.create("CHECK_GREEN", 1, "§rConnected", null));
  2601. inv.setItem(inv, inv_slot - 1, item.custom.create("CHECK_GREEN", 1, "§rConnected", null));
  2602. c = map.getOrDefault(wires_map, player_uuid, 0) + 1;
  2603. map.add(wires_map, player_uuid, c);
  2604. if(c == 4) {
  2605. map.remove(wires_map, player_uuid);
  2606. step = task.stepIncrease(player, task_id);
  2607. giveTask(player, 10, "CAF", "Fix Wiring", step, 3, null);
  2608. sgoto_auto_close_inv(player_uuid);
  2609. }
  2610. }
  2611. }
  2612. goto("checkgame");
  2613. }
  2614. if(title_string == "§cCalibrate Distributor") {
  2615. task_id = 9;
  2616. step = task.getStep(player, task_id);
  2617. if(step == 1) {
  2618. goto("checkgame");
  2619. }
  2620. if(inv_slot == 44) {
  2621. player_uuid = player.getUuid(player);
  2622. a = map.get(calibrate_dist_map, player_uuid);
  2623. if(inv.getItem(inv, 33) == inv.getItem(inv, 34)) {
  2624. stage = a[4] + 1;
  2625. a[4] = stage;
  2626. if(stage == 1) {
  2627. inv.setItem(inv, 3, item.custom.create("CHECK_GREEN", 1, null, null));
  2628. inv.setItem(inv, 34, blue_glass);
  2629. inv.setItem(inv, 35, blue_glass);
  2630. } elseif(stage == 2) {
  2631. inv.setItem(inv, 4, item.custom.create("CHECK_GREEN", 1, null, null));
  2632. inv.setItem(inv, 34, cyan_glass);
  2633. inv.setItem(inv, 35, cyan_glass);
  2634. } elseif(stage == 3) {
  2635. removeTaskParticle(player, calibrate_dist_par_loc);
  2636. inv.setItem(inv, 5, item.custom.create("CHECK_GREEN", 1, null, null));
  2637. step = task.stepIncrease(player, task_id);
  2638. giveTask(player, 9, "ELE", "Calibrate Distributor", 1, 1, null);
  2639. sgoto_auto_close_inv(player_uuid);
  2640. }
  2641. } else {
  2642. a[4] = 0;
  2643. inv.setItem(inv, 3, item.custom.create("CROSS_RED", 1, null, null));
  2644. inv.setItem(inv, 4, item.custom.create("CROSS_RED", 1, null, null));
  2645. inv.setItem(inv, 5, item.custom.create("CROSS_RED", 1, null, null));
  2646. inv.setItem(inv, 34, yellow_glass);
  2647. inv.setItem(inv, 35, yellow_glass);
  2648. }
  2649. a[3] = a[2]; //Index = Start_index
  2650. map.add(calibrate_dist_map, player_uuid, a);
  2651. for(h = 0; h < 12; h++) {
  2652. inv.setItem(inv, calibrate_dist_array[h], black_glass);
  2653. }
  2654. }
  2655. goto("checkgame");
  2656. }
  2657. if(title_string == "§cInspect Sample") {
  2658. task_id = 8;
  2659. step = task.getStep(player, task_id);
  2660. if(step == 1) {
  2661. goto("checkgame");
  2662. }
  2663. item_type = item.getType(item);
  2664. if(item_type == green_glass_mat) {
  2665. if(inv_slot == 53) {
  2666. inv.setItem(inv, 53, item.create("gray_stained_glass_pane", 59, "§rGo grab a coffee", null));
  2667. giveTask(player, 8, "MED", "Inspect Sample", 0, 1, 59);
  2668. player_uuid = player.getUuid(player);
  2669. list.add(sample_list, player_uuid);
  2670. list.add(sample_list_2, 59);
  2671. map.add(sample_map, player_uuid, inv);
  2672. sgoto(20, "countdown_sample");
  2673. goto("checkgame");
  2674. }
  2675. if(inv_slot >= 36) {
  2676. if(item.getType(inv.getItem(inv, inv_slot - 18)) == red_glass_mat) {
  2677. removeTaskParticle(player, inspect_par_loc);
  2678. step = task.stepIncrease(player, task_id);
  2679. giveTask(player, 8, "MED", "Inspect Sample", 1, 1, null);
  2680. sgoto_auto_close_inv(player.getUuid(player));
  2681. } else {
  2682. h = 0;
  2683. for(i = 0; i < 3; i++) {
  2684. inv.setItem(inv, 0 + h, sample);
  2685. inv.setItem(inv, 2 + h, sample);
  2686. inv.setItem(inv, 4 + h, sample);
  2687. inv.setItem(inv, 6 + h, sample);
  2688. inv.setItem(inv, 8 + h, sample);
  2689. h += 9;
  2690. }
  2691. select_sample = item.create("gray_stained_glass_pane", 1, "§rSelect sample", null);
  2692. inv.setItem(inv, 36, select_sample);
  2693. inv.setItem(inv, 38, select_sample);
  2694. inv.setItem(inv, 40, select_sample);
  2695. inv.setItem(inv, 42, select_sample);
  2696. inv.setItem(inv, 44, select_sample);
  2697. inv.setItem(inv, 53, item.create("green_stained_glass_pane", 1, "§rPress to start", null));
  2698. giveTask(player, 8, "MED", "Inspect Sample", 0, 1, null);
  2699. }
  2700. }
  2701. }
  2702. goto("checkgame");
  2703. }
  2704. if(title_string == "§cStabilize Steering") {
  2705. task_id = 7;
  2706. step = task.getStep(player, task_id);
  2707. if(step == 1) {
  2708. goto("checkgame");
  2709. }
  2710. new_cross_slot = inv_slot;
  2711. if(item.custom.isType(item, arrow_down_mat)) {
  2712. cross_slot = inv_slot - 9;
  2713. if(cross_slot == 22) {
  2714. new_cross_slot = cross_slot;
  2715. cross_slot -= 9;
  2716. }
  2717. } elseif(item.custom.isType(item, arrow_up_mat)) {
  2718. cross_slot = inv_slot + 9;
  2719. if(cross_slot == 22) {
  2720. new_cross_slot = cross_slot;
  2721. cross_slot += 9;
  2722. }
  2723. } elseif(item.custom.isType(item, arrow_left_mat)) {
  2724. cross_slot = inv_slot + 1;
  2725. if(cross_slot == 22) {
  2726. new_cross_slot = cross_slot;
  2727. cross_slot++;
  2728. }
  2729. } elseif(item.custom.isType(item, arrow_right_mat)) {
  2730. cross_slot = inv_slot - 1;
  2731. if(cross_slot == 22) {
  2732. new_cross_slot = cross_slot;
  2733. cross_slot--;
  2734. }
  2735. } else {
  2736. goto("checkgame");
  2737. }
  2738. //remove old plus
  2739. if(cross_slot != 22) {
  2740. inv.setItem(inv, cross_slot, light_gray_glass);
  2741. }
  2742. temp_slot = cross_slot - 1;
  2743. if(temp_slot == 22) {
  2744. temp_slot--;
  2745. }
  2746. if(temp_slot >= 0 && cross_slot % 9 != 0) {
  2747. inv.setItem(inv, temp_slot, light_gray_glass);
  2748. }
  2749. temp_slot = cross_slot + 1;
  2750. if(temp_slot == 22) {
  2751. temp_slot++;
  2752. }
  2753. if(temp_slot >= 0 && temp_slot % 9 != 0) {
  2754. inv.setItem(inv, temp_slot, light_gray_glass);
  2755. }
  2756. temp_slot = cross_slot - 9;
  2757. if(temp_slot == 22) {
  2758. temp_slot -= 9;
  2759. }
  2760. if(temp_slot >= 0) {
  2761. inv.setItem(inv, temp_slot, light_gray_glass);
  2762. }
  2763. temp_slot = cross_slot + 9;
  2764. if(temp_slot == 22) {
  2765. temp_slot += 9;
  2766. }
  2767. if(temp_slot < 45) {
  2768. inv.setItem(inv, temp_slot, light_gray_glass);
  2769. }
  2770. //set new plus
  2771. inv.setItem(inv, new_cross_slot, item.custom.create("PLUS_RED", 1, null, null));
  2772. temp_slot = new_cross_slot - 1;
  2773. if(temp_slot == 22) {
  2774. inv.setItem(inv, temp_slot - 1, item_arrow_left);
  2775. } else {
  2776. if(temp_slot >= 0 && new_cross_slot % 9 != 0) {
  2777. inv.setItem(inv, temp_slot, item_arrow_left);
  2778. }
  2779. }
  2780. temp_slot = new_cross_slot + 1;
  2781. if(temp_slot == 22) {
  2782. inv.setItem(inv, temp_slot + 1, item_arrow_right);
  2783. } else {
  2784. if(temp_slot >= 0 && temp_slot % 9 != 0) {
  2785. inv.setItem(inv, temp_slot, item_arrow_right);
  2786. }
  2787. }
  2788. temp_slot = new_cross_slot - 9;
  2789. if(temp_slot == 22) {
  2790. inv.setItem(inv, temp_slot - 9, item_arrow_up);
  2791. } else {
  2792. if(temp_slot >= 0) {
  2793. inv.setItem(inv, temp_slot, item_arrow_up);
  2794. }
  2795. }
  2796. temp_slot = new_cross_slot + 9;
  2797. if(temp_slot == 22) {
  2798. inv.setItem(inv, temp_slot + 9, item_arrow_down);
  2799. } else {
  2800. if(temp_slot < 45) {
  2801. inv.setItem(inv, temp_slot, item_arrow_down);
  2802. }
  2803. }
  2804. //finish task
  2805. if(new_cross_slot == 22) {
  2806. removeTaskParticle(player, steering_par_loc);
  2807. inv.setItem(inv, 44, item.custom.create("CHECK_GREEN", 1, "§rTask completed", null));
  2808. step = task.stepIncrease(player, task_id);
  2809. giveTask(player, task_id, "NAV", "Stabilize Steering", 1, 1, null);
  2810. sgoto_auto_close_inv(player.getUuid(player));
  2811. }
  2812. goto("checkgame");
  2813. }
  2814. if(title_string == "§cChart Course") {
  2815. task_id = 6;
  2816. step = task.getStep(player, task_id);
  2817. if(step == 1) {
  2818. goto("checkgame");
  2819. }
  2820. player_uuid = player.getUuid(player);
  2821. a = map.get(chart_course_pattern, player_uuid);
  2822. c = map.getOrDefault(chart_course_counter, player_uuid, 0);
  2823. if(a[c] == inv_slot) {
  2824. inv.setItem(inv, inv_slot, green_glass);
  2825. map.add(chart_course_counter, player_uuid, c + 1);
  2826. if(c == 8) {
  2827. inv.setItem(inv, 53, item.custom.create("CHECK_GREEN", 1, "§rTask completed", null));
  2828. removeTaskParticle(player, chart_course_par_loc);
  2829. step = task.stepIncrease(player, task_id);
  2830. giveTask(player, task_id, "NAV", "Chart Course", 1, 1, null);
  2831. sgoto_auto_close_inv(player_uuid);
  2832. }
  2833. }
  2834. goto("checkgame");
  2835. }
  2836. if(title_string == "§cUnlock Manifolds") {
  2837. task_id = 5;
  2838. step = task.getStep(player, task_id);
  2839. if(step == 1) {
  2840. goto("checkgame");
  2841. }
  2842. item_type = item.getType(item);
  2843. if(item_type == blue_glass_mat) {
  2844. player_uuid = player.getUuid(player);
  2845. amount = map.getOrDefault(manifolds_counter, player_uuid, 1);
  2846. if(amount == item.getAmount(item)) {
  2847. inv.setItem(inv, inv_slot, item.create("GREEN_STAINED_GLASS_PANE", amount, null, null));
  2848. map.add(manifolds_counter, player_uuid, amount + 1);
  2849. if(amount == 10) {
  2850. removeTaskParticle(player, unlock_manifolds_par_loc);
  2851. step = task.stepIncrease(player, task_id);
  2852. giveTask(player, task_id, "REA", "Unlock Manifolds", 1, 1, null);
  2853. sgoto_auto_close_inv(player_uuid);
  2854. }
  2855. goto("checkgame");
  2856. }
  2857. goto("false_manifolds_click");
  2858. }
  2859. if(item_type == green_glass_mat) {
  2860. goto("false_manifolds_click");
  2861. }
  2862. goto("checkgame");
  2863. }
  2864. if(title_string == "§cStart Reactor") {
  2865. task_id = 4;
  2866. step = task.getStep(player, task_id);
  2867. if(step == 1) {
  2868. goto("checkgame");
  2869. }
  2870. if(!(inv_slot > 22 && inv_slot < 26 || inv_slot > 31 && inv_slot < 35 || inv_slot > 40 && inv_slot < 44)) {
  2871. goto("checkgame");
  2872. }
  2873. player_uuid = player.getUuid(player);
  2874. item_type = item.getType(item);
  2875. if(item_type == red_glass_mat) {
  2876. goto("checkgame");
  2877. }
  2878. if(item_type == black_glass_mat) {
  2879. goto("false_reactor_click");
  2880. }
  2881. if(reactor.getPhase(reactor_array) == "draw") {
  2882. goto("false_reactor_click");
  2883. }
  2884. reactor_array = reactor.get(player);
  2885. stage = reactor.getStage(reactor_array);
  2886. counter = reactor.getCounter(reactor_array);
  2887. pattern = reactor.getPattern(reactor_array);
  2888. if(inv_slot - 4 != pattern[counter]) {
  2889. goto("false_reactor_click");
  2890. }
  2891. inv.setItem(inv, inv_slot, blue_glass);
  2892. list.add(reset_reactor_click_list, player_uuid);
  2893. list.add(reset_reactor_click_list_2, inv_slot);
  2894. sgoto(10, "reset_reactor_click");
  2895. if(counter == stage && stage < 5) {
  2896. stage++;
  2897. reactor.setStage(reactor_array, stage);
  2898. reactor.setCounter(reactor_array, 0);
  2899. reactor.setPhase(reactor_array, "draw");
  2900. reactor.save(reactor_array, player);
  2901. if(stage == 5) {
  2902. removeTaskParticle(player, start_reactor_par_loc);
  2903. step = task.stepIncrease(player, task_id);
  2904. giveTask(player, task_id, "REA", "Start Reactor", 1, 1, null);
  2905. sgoto_auto_close_inv(player_uuid);
  2906. reactor_used = false;
  2907. goto("checkgame");
  2908. }
  2909. list.add(reactor_draw_list_1, player_uuid);
  2910. sgoto(20, "draw_pattern_1");
  2911. goto("checkgame");
  2912. }
  2913. reactor.setCounter(reactor_array, ++counter);
  2914. reactor.save(reactor_array, player);
  2915. goto("checkgame");
  2916. }
  2917. if(title_string == "§cPrime Shields") {
  2918. task_id = 3;
  2919. step = task.getStep(player, task_id);
  2920. if(step == 1) {
  2921. goto("checkgame");
  2922. }
  2923. if(item == green_glass) {
  2924. inv.setItem(inv, inv_slot, red_glass);
  2925. goto("checkgame");
  2926. }
  2927. if(item == red_glass) {
  2928. inv.setItem(inv, inv_slot, green_glass);
  2929. for(i = 9; i < 42; i++) {
  2930. if(item.getType(inv.getItem(inv, i)) == red_glass_mat) {
  2931. goto("checkgame");
  2932. }
  2933. }
  2934. removeTaskParticle(player, prime_shields_par_loc);
  2935. step = task.stepIncrease(player, task_id);
  2936. giveTask(player, task_id, "SHI", "Prime Shields", 1, 1, null);
  2937. sgoto_auto_close_inv(player.getUuid(player));
  2938. }
  2939. goto("checkgame");
  2940. }
  2941. inv_id = inv.getId(inv);
  2942. if(inv_id == inv.getId(reactor_inv_1)) {
  2943. if(reactor_sabotaged) {
  2944. sabotage.holdReactor(reactor_inv_1, true);
  2945. hold_reactor_1 = true;
  2946. if(hold_reactor_2) {
  2947. fix_meltdown();
  2948. }
  2949. }
  2950. goto("checkgame");
  2951. }
  2952. if(inv_id == inv.getId(reactor_inv_2)) {
  2953. if(reactor_sabotaged) {
  2954. sabotage.holdReactor(reactor_inv_2, true);
  2955. hold_reactor_2 = true;
  2956. if(hold_reactor_1) {
  2957. fix_meltdown();
  2958. }
  2959. }
  2960. goto("checkgame");
  2961. }
  2962. if(title_string == "§cFix Communications") {
  2963. if(!comms_sabotaged) {
  2964. goto("checkgame");
  2965. }
  2966. if(inv_slot == 48) {
  2967. comms_freq = item.getAmount(inv.getItem(inv, 49)) - 1;
  2968. } elseif(inv_slot == 50) {
  2969. comms_freq = item.getAmount(inv.getItem(inv, 49)) + 1;
  2970. } else {
  2971. goto("checkgame");
  2972. }
  2973. if(comms_freq < 1 || comms_freq > 64) {
  2974. goto("checkgame");
  2975. }
  2976. inv.setItem(inv, 49, item.create("BLACK_STAINED_GLASS_PANE", comms_freq, null, null));
  2977. player_uuid = player.getUuid(player);
  2978. comms_state = map.get(comms_state_map, player_uuid);
  2979. diff = math.abs(comms_freq - comms_fix_freq);
  2980. if(diff == 0) {
  2981. if(comms_state != 2) {
  2982. comms.drawCorrect(inv, player);
  2983. }
  2984. list.add(comms_fix_list, player_uuid);
  2985. map.add(comms_fix_map, player_uuid, time.getMillis());
  2986. sgoto(40, "scheduled_fix_comms");
  2987. goto("checkgame");
  2988. } elseif(diff < 4) {
  2989. if(comms_state != 1) {
  2990. comms.drawClose(inv, player);
  2991. }
  2992. map.remove(comms_fix_map, player_uuid);
  2993. } else {
  2994. if(comms_state != 0) {
  2995. comms.drawWorst(inv, player);
  2996. }
  2997. map.remove(comms_fix_map, player_uuid);
  2998. }
  2999. goto("checkgame");
  3000. }
  3001. if(title_string == "§cFix Lights") {
  3002. if(!lights_sabotaged) {
  3003. goto("checkgame");
  3004. }
  3005. item_type = item.getType(item);
  3006. if(item_type == red_glass_mat) {
  3007. inv.setItem(lights_inv, inv_slot, item.create("GREEN_STAINED_GLASS_PANE", 1, "§fOn", null));
  3008. c = 0;
  3009. for(i = 0; i < 9; i+=2) {
  3010. if(item.getType(inv.getitem(lights_inv, i)) == green_glass_mat) {
  3011. c++;
  3012. }
  3013. }
  3014. if(c == 5) {
  3015. fix_light();
  3016. }
  3017. goto("checkgame");
  3018. }
  3019. if(item_type == green_glass_mat) {
  3020. inv.setItem(lights_inv, inv_slot, item.create("RED_STAINED_GLASS_PANE", 1, "§fOff", null));
  3021. }
  3022. goto("checkgame");
  3023. }
  3024. if(title_string == "§cDownload Data") {
  3025. if(item.custom.isType(item, arrow_down_mat)) {
  3026. inv.setItem(inv, 22, gray_glass);
  3027. goto("download_data_2");
  3028. }
  3029. goto("checkgame");
  3030. }
  3031. if(title_string == "§cUpload Data") {
  3032. if(item.custom.isType(item, arrow_up_mat)) {
  3033. inv.setItem(inv, 22, gray_glass);
  3034. goto("download_data_2");
  3035. }
  3036. goto("checkgame");
  3037. }
  3038. if(title_string == "§cFuel") {
  3039. task_id = 1;
  3040. step = task.getStep(player, task_id);
  3041. if(step == 1 || step == 3 || step == 4) {
  3042. goto("checkgame");
  3043. }
  3044. if(item.custom.isType(item, arrow_down_mat)) {
  3045. player_uuid = player.getUuid(player);
  3046. c = map.getOrDefault(fuel_counter, player_uuid, 0);
  3047. if((c + 2) % 9 == 0) {
  3048. c += 2;
  3049. }
  3050. inv.setItem(inv, c++, light_gray_glass);
  3051. map.add(fuel_counter, player_uuid, c);
  3052. if(c == 52) {
  3053. step = task.stepIncrease(player, task_id);
  3054. map.remove(fuel_counter, player_uuid);
  3055. removeTaskParticle(player, get_fuel_par_loc);
  3056. if(step == 1) {
  3057. addTaskParticle(player, upper_engine_par_loc);
  3058. giveTask(player, task_id, "UE", "Fuel Engines", 1, 4, null);
  3059. sgoto_auto_close_inv(player_uuid);
  3060. } elseif(step == 3) {
  3061. addTaskParticle(player, lower_engine_par_loc);
  3062. giveTask(player, task_id, "LE", "Fuel Engines", 3, 4, null);
  3063. sgoto_auto_close_inv(player_uuid);
  3064. }
  3065. }
  3066. }
  3067. goto("checkgame");
  3068. }
  3069. if(title_string == "§cEngine") {
  3070. task_id = 1;
  3071. step = task.getStep(player, task_id);
  3072. if(step == 0 || step == 2 || step == 4) {
  3073. goto("checkgame");
  3074. }
  3075. if(item.custom.isType(item, arrow_up_mat)) {
  3076. player_uuid = player.getUuid(player);
  3077. c = map.getOrDefault(fuel_counter, player_uuid, 51);
  3078. if((c + 1) % 9 == 0) {
  3079. c -= 2;
  3080. }
  3081. inv.setItem(inv, c--, lime_terra_item);
  3082. map.add(fuel_counter, player_uuid, c);
  3083. if(c == -1) {
  3084. map.remove(fuel_counter, player_uuid);
  3085. if(step == 1) {
  3086. removeTaskParticle(player, upper_engine_par_loc);
  3087. addTaskParticle(player, get_fuel_par_loc);
  3088. giveTask(player, task_id, "STO", "Fuel Engines", 2, 4, null);
  3089. sgoto_auto_close_inv(player_uuid);
  3090. } elseif(step == 3) {
  3091. removeTaskParticle(player, lower_engine_par_loc);
  3092. giveTask(player, task_id, "LE", "Fuel Engines", 4, 4, null);
  3093. sgoto_auto_close_inv(player_uuid);
  3094. }
  3095. step = task.stepIncrease(player, task_id);
  3096. }
  3097. }
  3098. goto("checkgame");
  3099. }
  3100. goto("checkgame");
  3101. @score_evaluation
  3102. sort_array = map.sort(vote_count_map, false);
  3103. //Ausgabe der Votes
  3104. minigame.speakAll(gamename, "§0------------------------");
  3105. sort_array_size = array.getSize(sort_array);
  3106. for(i = 0; i < sort_array_size; i++) {
  3107. p_uuid = sort_array[i, 0];
  3108. value = sort_array[i, 1];
  3109. if(p_uuid == "skip") {
  3110. minigame.speakAll(gamename, string.concat("Skipped: ", string.number(value)));
  3111. } else {
  3112. minigame.speakAll(gamename, string.concat(amongus.getPlayerColorCode(p_uuid), player.getName(p_uuid), "§r ", string.number(value)));
  3113. }
  3114. }
  3115. //Auswertung der Votes
  3116. if(sort_array_size == 0) {
  3117. message = "Nobody voted (Skipped).";
  3118. minigame.speakAll(gamename, message);
  3119. minigame.titleAll("Voting ended", message, 20, 60, 20);
  3120. continueGame();
  3121. goto("checkgame");
  3122. } elseif(sort_array_size == 1) {
  3123. kick_uuid = sort_array[0, 0];
  3124. } else {
  3125. value_0 = sort_array[0, 1];
  3126. value_1 = sort_array[1, 1];
  3127. if(value_0 > value_1) {
  3128. kick_uuid = sort_array[0, 0];
  3129. } else {
  3130. message = "No one ejected (Tie).";
  3131. minigame.speakAll(gamename, message);
  3132. minigame.titleAll("Voting ended", message, 20, 60, 20);
  3133. continueGame();
  3134. goto("checkgame");
  3135. }
  3136. }
  3137. if(kick_uuid == "skip") {
  3138. message = "No one ejected (Skipped).";
  3139. minigame.speakAll(gamename, message);
  3140. minigame.titleAll("Voting ended", message, 20, 60, 20);
  3141. continueGame();
  3142. goto("checkgame");
  3143. }
  3144. //Vollstreckung
  3145. if(confirm_ejects) {
  3146. if(isImpostor(kick_uuid)) {
  3147. message = "§r was an §cimpostor§r.";
  3148. } else {
  3149. message = "§r was a §bcrewmate§r.";
  3150. }
  3151. } else {
  3152. message = "§r was ejected.";
  3153. }
  3154. message = string.concat(amongus.getPlayerColorCode(kick_uuid), player.getName(kick_uuid), message);
  3155. minigame.speakAll(gamename, message);
  3156. list.add(ghosts, kick_uuid);
  3157. list.remove(impostors_list_3, kick_uuid);
  3158. kick_player = player.get(kick_uuid);
  3159. player.hideOnline(kick_player);
  3160. amongus.removeEquip(kick_player);
  3161. minigame.titleAll("Voting ended", message, 20, 60, 20);
  3162. //Checkwin
  3163. imps_alive = 0;
  3164. crew_alive = 0;
  3165. iter = iterator(player_list);
  3166. while(hasNext(iter)) {
  3167. p_uuid = next(iter);
  3168. p = player.get(p_uuid);
  3169. if(!player.isGhost(p)) {
  3170. if(isImpostor(p)) {
  3171. imps_alive++;
  3172. } else {
  3173. crew_alive++;
  3174. }
  3175. }
  3176. }
  3177. boss.removeAll(meeting_bar);
  3178. if(imps_alive == 0) {
  3179. winners = "§bCrewmates";
  3180. goto("win");
  3181. }
  3182. if(imps_alive >= crew_alive) {
  3183. winners = "§cImpostors";
  3184. goto("win");
  3185. }
  3186. continueGame();
  3187. goto("checkgame");
  3188. @player_quit
  3189. @player_giveup
  3190. minigame.speakAll(gamename, string.concat(amongus.getPlayerColorCode(player), player.getName(player), " §rhas left the game."));
  3191. player.setGamemode(player, "SURVIVAL");
  3192. boss.removePlayer(progress_bar, player);
  3193. boss.removePlayer(meeting_bar, player);
  3194. boss.removePlayer(sabotage_cooldown_bar, player);
  3195. my_kill_bar = map.get(imp_kill_bars, player.getUuid(player));
  3196. if(my_kill_bar != null) {
  3197. boss.removePlayer(my_kill_bar, player);
  3198. }
  3199. script = script.getFromId(script_id);
  3200. minigame.kickplayer(script, player);
  3201. player.gameMute(player, false);
  3202. player.showOnline(player);
  3203. living.setInvisible(player, false);
  3204. if(isImpostor(player)) {
  3205. list.remove(impostors_list_2, player_uuid);
  3206. list.remove(impostors_list_3, player_uuid);
  3207. }
  3208. //Building-Perms wieder geben
  3209. player_uuid = player.getUuid(player);
  3210. if(list.contains(removed_perms, player_uuid)) {
  3211. list.remove(removed_perms, player_uuid);
  3212. //PERMS perm.registerPlayer(player_uuid, 1);
  3213. //PERMS perm.registerPlayer(player_uuid, 15);
  3214. }
  3215. if(freeplay) {
  3216. removeDeadBodies();
  3217. removeCamBodies();
  3218. minigame.kickAllPlayers(script);
  3219. minigame.term(script, gamesignloc);
  3220. term();
  3221. }
  3222. //checkwin
  3223. imps_alive = 0;
  3224. crew_alive = 0;
  3225. iter = iterator(player_list);
  3226. while(hasNext(iter)) {
  3227. p_uuid = next(iter);
  3228. p = player.get(p_uuid);
  3229. if(!player.isGhost(p)) {
  3230. if(isImpostor(p)) {
  3231. imps_alive++;
  3232. } else {
  3233. crew_alive++;
  3234. }
  3235. }
  3236. }
  3237. if(imps_alive == 0) {
  3238. winners = "§bCrewmates";
  3239. goto("win");
  3240. }
  3241. if(imps_alive >= crew_alive) {
  3242. winners = "§cImpostors";
  3243. goto("win");
  3244. }
  3245. if(!player.isGhost(player)) {
  3246. amongus.removeFromAdminTable(player);
  3247. }
  3248. amount_all_tasks = (amount_short + amount_common + amount_long) * crew_alive;
  3249. pct = amount_done_tasks / amount_all_tasks;
  3250. boss.setProgress(progress_bar, pct);
  3251. if(meeting) {
  3252. //Vote des leavenden Spielers entfernen
  3253. vote_uuid = map.get(vote_count_map_2, player_uuid);
  3254. if(vote_uuid != null) {
  3255. votes = map.get(vote_count_map, vote_uuid) - 1;
  3256. if(votes == 0) {
  3257. map.remove(vote_count_map, vote_uuid);
  3258. } else {
  3259. map.add(vote_count_map, vote_uuid, votes);
  3260. }
  3261. map.remove(vote_count_map_2, player_uuid);
  3262. }
  3263. //Alle Votes entfernen, die auf den leavenden Spieler lauten
  3264. iter = map.iterator(vote_count_map_2);
  3265. while(hasNext(iter)) {
  3266. element = next(iter);
  3267. vote_uuid = map.getValue(element);
  3268. if(vote_uuid == player_uuid) {
  3269. //Spieler neu voten lassen
  3270. voter_uuid = map.getKey(element);
  3271. remove(iter);
  3272. map.remove(vote_count_map_2, voter_uuid);
  3273. //Vote-Menu aktualisieren
  3274. index = list.getIndexOf(all_list, voter_uuid);
  3275. voted_slot = index * 4;
  3276. setItemInVoteInv(voted_slot, air_item);
  3277. }
  3278. }
  3279. //Vote-Menu aktualisieren
  3280. index = list.getIndexOf(all_list, player_uuid);
  3281. voted_slot = index * 4;
  3282. setItemInVoteInv(voted_slot, zombie_head);
  3283. }
  3284. goto("checkgame");
  3285. @player_data_tick
  3286. if(var == "Discussion Time") {
  3287. player.giveItem(player, open_vote_menu_item);
  3288. tick_time = vote_time * 20; //s
  3289. boss.setTitle(meeting_bar, "Voting Time");
  3290. updateMeetingBar(vote_time, false);
  3291. data.setTimer(player, "Voting Time", tick_time - 20);
  3292. vote_inv = getVoteInv(player);
  3293. inv.open(vote_inv, player);
  3294. data.setTimer(player, "sound.vote.end.10", tick_time - 200);
  3295. data.setTimer(player, "sound.vote.end.5", tick_time - 100);
  3296. data.setTimer(player, "sound.vote.end.4", tick_time - 80);
  3297. data.setTimer(player, "sound.vote.end.3", tick_time - 60);
  3298. data.setTimer(player, "sound.vote.end.2", tick_time - 40);
  3299. data.setTimer(player, "sound.vote.end.1", tick_time - 20);
  3300. goto("checkgame");
  3301. }
  3302. if(!meeting) {
  3303. goto("checkgame");
  3304. }
  3305. if(var == "Voting Time") {
  3306. boss.removeAll(meeting_bar);
  3307. goto("score_evaluation");
  3308. }
  3309. if(var == "sound.vote.end.10") {
  3310. sound.spawnForPlayer(player, vote_ends_sound, master_sound_category);
  3311. goto("checkgame");
  3312. }
  3313. if(var == "sound.vote.end.5") {
  3314. sound.spawnForPlayer(player, vote_ends_sound, master_sound_category);
  3315. goto("checkgame");
  3316. }
  3317. if(var == "sound.vote.end.4") {
  3318. sound.spawnForPlayer(player, vote_ends_sound, master_sound_category);
  3319. goto("checkgame");
  3320. }
  3321. if(var == "sound.vote.end.3") {
  3322. sound.spawnForPlayer(player, vote_ends_sound, master_sound_category);
  3323. goto("checkgame");
  3324. }
  3325. if(var == "sound.vote.end.2") {
  3326. sound.spawnForPlayer(player, vote_ends_sound, master_sound_category);
  3327. goto("checkgame");
  3328. }
  3329. if(var == "sound.vote.end.1") {
  3330. sound.spawnForPlayer(player, vote_ends_sound, master_sound_category);
  3331. goto("checkgame");
  3332. }
  3333. goto("checkgame");
  3334. @player_drop
  3335. cancel = true;
  3336. goto("checkgame");
  3337. function getInvSlotFromItem(player, item) {
  3338. inv = player.getInv(player);
  3339. for(i = 0; i < inv.getSize(inv); i++) {
  3340. if(item == inv.getItem(inv, i)) {
  3341. return i;
  3342. }
  3343. }
  3344. return -1;
  3345. }
  3346. function giveCrewmateItems(player) {
  3347. //nothing
  3348. }
  3349. function removeImpostorItems(player) {
  3350. player.removeItem(player, $kill_item);
  3351. player.removeItem(player, $sabotage_item);
  3352. }
  3353. function giveImpostorItems(player) {
  3354. player.giveItem(player, $kill_item);
  3355. player.giveItem(player, $sabotage_item);
  3356. }
  3357. function giveSpeedrunnerItems(player) {
  3358. //nothing
  3359. }
  3360. function setSpeedrunner(player) {
  3361. player_uuid = player.getUuid(player);
  3362. map.add($roles, player_uuid, "speedrunner");
  3363. msg.prefix(player, $gamename, "You are §dSpeedrunner!");
  3364. giveSpeedrunnerItems(player);
  3365. sb.add(player, 99, "You are §dSpeedrunner");
  3366. }
  3367. function setImpostor(player) {
  3368. data.setTimer(player, "Kill Cooldown", $start_kill_cooldown * 20);
  3369. player_uuid = player.getUuid(player);
  3370. map.add($roles, player_uuid, "impostor");
  3371. my_kill_bar = createKillBossBar(player);
  3372. updateKillBossBar(my_kill_bar, $start_kill_cooldown);
  3373. list.add($impostors_list, player_uuid);
  3374. list.add($impostors_list_2, player_uuid);
  3375. list.add($impostors_list_3, player_uuid);
  3376. msg.prefix(player, $gamename, "You are §cImpostor!");
  3377. giveImpostorItems(player);
  3378. sb.add(player, 99, "You are §cImpostor");
  3379. sb.add(player, 98, "§cFake Tasks:");
  3380. }
  3381. function createKillBossBar(player) {
  3382. player_uuid = player.getUuid(player);
  3383. my_kill_bar = boss.create("Kill Cooldown", "PURPLE", "SOLID");
  3384. boss.setProgress(my_kill_bar, 0);
  3385. boss.addPlayer(my_kill_bar, player);
  3386. map.add($imp_kill_bars, player_uuid, my_kill_bar);
  3387. return my_kill_bar;
  3388. }
  3389. function updateKillBossBar(bar, time) {
  3390. if(time < 0) {
  3391. time = 0;
  3392. boss.setProgress(bar, 1);
  3393. boss.setTitle(bar, string.concat("Kill Cooldown: 0"));
  3394. return;
  3395. }
  3396. boss.setProgress(bar, ($kill_cooldown - time) / $kill_cooldown);
  3397. boss.setTitle(bar, string.concat("Kill Cooldown: ", string.number(math.roundDown(time))));
  3398. }
  3399. function updateSabotageCooldownBar(time) {
  3400. if(time < 0) {
  3401. time = 0;
  3402. boss.setProgress($sabotage_cooldown_bar, 1);
  3403. boss.setTitle($sabotage_cooldown_bar, string.concat("Sabotage Cooldown: 0"));
  3404. return;
  3405. }
  3406. boss.setProgress($sabotage_cooldown_bar, ($default_sabo_cooldown - time) / $default_sabo_cooldown);
  3407. boss.setTitle($sabotage_cooldown_bar, string.concat("Sabotage Cooldown: ", string.number(math.roundDown(time))));
  3408. }
  3409. function updateMeetingBar(time, discussion) {
  3410. if(time < 0) {
  3411. time = 0;
  3412. return;
  3413. }
  3414. if(discussion) {
  3415. progress = time / $discuss_time;
  3416. pre_title = "Discussion Time";
  3417. } else {
  3418. progress = time / $vote_time;
  3419. pre_title = "Voting Time";
  3420. }
  3421. boss.setTitle($meeting_bar, string.concat(pre_title, ": ", string.number(math.roundDown(time))));
  3422. boss.setProgress($meeting_bar, progress);
  3423. }
  3424. function setCrewmate(player) {
  3425. map.add($roles, player.getUuid(player), "crewmate");
  3426. msg.prefix(player, $gamename, "You are §bCrewmate.");
  3427. giveCrewmateItems(player);
  3428. sb.add(player, 99, "You are §bCrewmate");
  3429. }
  3430. function isSpeedrunner(player_or_uuid) {
  3431. if(isPlayer(player_or_uuid)) {
  3432. player_or_uuid = player.getUuid(player_or_uuid);
  3433. }
  3434. role = map.get($roles, player_or_uuid);
  3435. return role == "impostor";
  3436. }
  3437. function isImpostor(player_or_uuid) {
  3438. if(isPlayer(player_or_uuid)) {
  3439. player_or_uuid = player.getUuid(player_or_uuid);
  3440. }
  3441. role = map.get($roles, player_or_uuid);
  3442. return role == "impostor";
  3443. }
  3444. function isCrewmate(player_or_uuid) {
  3445. if(isPlayer(player_or_uuid)) {
  3446. player_or_uuid = player.getUuid(player_or_uuid);
  3447. }
  3448. role = map.get($roles, player_or_uuid);
  3449. return role == "crewmate";
  3450. }
  3451. function player.isGhost(player_or_uuid) {
  3452. if(isPlayer(player_or_uuid)) {
  3453. player_or_uuid = player.getUuid(player_or_uuid);
  3454. }
  3455. return list.contains($ghosts, player_or_uuid);
  3456. }
  3457. function tpAllMiddle(reporter) {
  3458. $vote_count_map = map.new(); //Wieviel Spieler haben einen Spieler gevoted
  3459. $vote_count_map_2 = map.new(); //Welcher Spieler hat für wen gevoted
  3460. amongus.setMeeting(true);
  3461. $reactor_used = false;
  3462. removeDeadBodies();
  3463. amongus.clearAdminTable();
  3464. boss.setTitle($meeting_bar, "Discussion Time");
  3465. updateMeetingBar($discuss_time, true);
  3466. hideSabotageCooldownBar();
  3467. if($lights_sabotaged) {
  3468. switchLights(true);
  3469. }
  3470. for(i = 0; i < list.getSize($player_list); i++) {
  3471. p_uuid = list.getIndex($player_list, i);
  3472. p = player.get(p_uuid);
  3473. createVoteInv(p, player.getUuid(reporter));
  3474. if(list.contains($vent_list, p_uuid)) {
  3475. vent_leave(p);
  3476. }
  3477. if(player.isOnCam(p)) {
  3478. cam.leave(p);
  3479. }
  3480. amongus.manageEffects(p);
  3481. entity.teleport(p, list.getIndex($spawn_locs, i));
  3482. player.setSpeed(p, 0);
  3483. inv.close(p);
  3484. data.setTimer(p, "Discussion Time", $discuss_time * 20);
  3485. boss.addPlayer($meeting_bar, p);
  3486. }
  3487. iter = iterator($impostors_list_3);
  3488. while(hasNext(iter)) {
  3489. p_uuid = next(iter);
  3490. kill_bar = map.get($imp_kill_bars, p_uuid);
  3491. boss.removePlayer(kill_bar, player.get(p_uuid));
  3492. }
  3493. }
  3494. function fix_oxygen() {
  3495. if($oxygen_sabotaged) {
  3496. amongus.setAlert(false);
  3497. $oxygen_sabotaged = false;
  3498. hideSabotageDisplay();
  3499. setSaboCooldown($default_sabo_cooldown);
  3500. sgoto(40, "scheduled_sabo_close");
  3501. }
  3502. }
  3503. function fix_light() {
  3504. amongus.setAlert(false);
  3505. $lights_sabotaged = false;
  3506. removeSaboParticles($fix_lights_par_loc_1, $fix_lights_par_loc_2);
  3507. iter = iterator($player_list);
  3508. while(hasNext(iter)) {
  3509. p_uuid = next(iter);
  3510. p = player.get(p_uuid);
  3511. hideSabotageDisplay();
  3512. amongus.manageEffects(p);
  3513. }
  3514. setSaboCooldown($default_sabo_cooldown);
  3515. switchLights(true);
  3516. sgoto(40, "scheduled_sabo_close");
  3517. }
  3518. function hideSabotageCooldownBar() {
  3519. iter = iterator($impostors_list_2);
  3520. while(hasNext(iter)) {
  3521. p_uuid = next(iter);
  3522. p = player.get(p_uuid);
  3523. boss.removePlayer($sabotage_cooldown_bar, p);
  3524. }
  3525. }
  3526. function sabotage_oxygen() {
  3527. hideSabotageCooldownBar();
  3528. amongus.setAlert(true);
  3529. $oxygen_sabotaged = true;
  3530. $oxy_fixed_1 = false;
  3531. $oxy_fixed_2 = false;
  3532. $depletion_time = 30;
  3533. addSaboParticles($fix_o2_par_loc_1, $fix_o2_par_loc_2);
  3534. displaySabotage("§cO2/ADM | Fix Oxygen ", 0, 2, $depletion_time);
  3535. $oxy_code = math.random(10000, 99999);
  3536. sgoto(20, "oxygen_depletion");
  3537. iter = iterator($player_list);
  3538. while(hasNext(iter)) {
  3539. p_uuid = next(iter);
  3540. p = player.get(p_uuid);
  3541. title.send(p, text.new("§cSabotage!!!"), text.new("Oxygen Depletion"));
  3542. }
  3543. sgoto(20, "crit_sabo_sound_loop");
  3544. }
  3545. @oxygen_depletion
  3546. if(!oxygen_sabotaged) {
  3547. goto("checkgame");
  3548. }
  3549. depletion_time--;
  3550. fixed = 0;
  3551. if(oxy_fixed_1) {
  3552. fixed++;
  3553. }
  3554. if(oxy_fixed_2) {
  3555. fixed++;
  3556. }
  3557. displaySabotage("§cO2/ADM | Fix Oxygen ", fixed, 2, depletion_time);
  3558. if(depletion_time == 0) {
  3559. if(freeplay) {
  3560. minigame.speakAll($gamename, "Normally the impostors would have just won because of the critical sabotage. Instead we just shut it off.");
  3561. removeSaboParticles(fix_o2_par_loc_1, fix_o2_par_loc_2);
  3562. fix_oxygen();
  3563. } else {
  3564. winners = "§cImpostors";
  3565. goto("win");
  3566. }
  3567. goto("checkgame");
  3568. }
  3569. sgoto(20, "oxygen_depletion");
  3570. goto("checkgame");
  3571. @crit_sabo_sound_loop
  3572. if(!amongus.isAlert()) {
  3573. goto("checkgame");
  3574. }
  3575. iter = iterator(player_list);
  3576. while(hasNext(iter)) {
  3577. p_uuid = next(iter);
  3578. p = player.get(p_uuid);
  3579. sound.spawnForPlayer(p, crit_sabo_sound, master_sound_category);
  3580. }
  3581. sgoto(20, "crit_sabo_sound_loop");
  3582. goto("checkgame");
  3583. function sabotage_reactor() {
  3584. hideSabotageCooldownBar();
  3585. amongus.setAlert(true);
  3586. $reactor_sabotaged = true;
  3587. $hold_reactor_1 = false;
  3588. $hold_reactor_2 = false;
  3589. addSaboParticles($fix_reactor_par_loc_1, $fix_reactor_par_loc_2);
  3590. $meltdown_time = 30;
  3591. displaySabotage("§cREA | Prevent Meltdown ", 0, 2, $meltdown_time);
  3592. sgoto(20, "meltdown");
  3593. iter = iterator($player_list);
  3594. while(hasNext(iter)) {
  3595. p_uuid = next(iter);
  3596. p = player.get(p_uuid);
  3597. title.send(p, text.new("§cSabotage!!!"), text.new("Reactor Meltdown"));
  3598. }
  3599. sgoto(20, "crit_sabo_sound_loop");
  3600. }
  3601. @meltdown
  3602. if(!reactor_sabotaged) {
  3603. goto("checkgame");
  3604. }
  3605. meltdown_time--;
  3606. holded = 0;
  3607. if(hold_reactor_1) {
  3608. holded++;
  3609. }
  3610. if(hold_reactor_2) {
  3611. holded++;
  3612. }
  3613. displaySabotage("§cREA | Preven Meltdown ", holded, 2, meltdown_time);
  3614. if(meltdown_time == 0) {
  3615. if(freeplay) {
  3616. minigame.speakAll($gamename, "Normally the impostors would have just won because of the critical sabotage. Instead we just shut it off.");
  3617. fix_meltdown();
  3618. } else {
  3619. winners = "§cImpostors";
  3620. goto("win");
  3621. }
  3622. goto("checkgame");
  3623. }
  3624. sgoto(20, "meltdown");
  3625. goto("checkgame");
  3626. function setSaboCooldown(sabotage_cooldown) {
  3627. iter = iterator($impostors_list_2);
  3628. while(hasNext(iter)) {
  3629. p_uuid = next(iter);
  3630. p = player.get(p_uuid);
  3631. data.setTimer(p, "Sabotage Cooldown", sabotage_cooldown * 20);
  3632. boss.addPlayer($sabotage_cooldown_bar, p);
  3633. updateSabotageCooldownBar(sabotage_cooldown);
  3634. }
  3635. }
  3636. function fix_meltdown() {
  3637. $reactor_sabotaged = false;
  3638. amongus.setAlert(false);
  3639. removeSaboParticles($fix_reactor_par_loc_1, $fix_reactor_par_loc_2);
  3640. hideSabotageDisplay();
  3641. setSaboCooldown($default_sabo_cooldown);
  3642. sgoto(40, "scheduled_sabo_close");
  3643. }
  3644. function fix_comms() {
  3645. $comms_sabotaged = false;
  3646. amongus.setAlert(false);
  3647. removeSaboParticles($fix_comms_par_loc, null);
  3648. hideSabotageDisplay();
  3649. setSaboCooldown($default_sabo_cooldown);
  3650. showTasks();
  3651. sgoto(40, "scheduled_sabo_close");
  3652. }
  3653. function sabotage_comms() {
  3654. hideSabotageCooldownBar();
  3655. amongus.setAlert(true);
  3656. $comms_sabotaged = true;
  3657. addSaboParticles($fix_comms_par_loc, null);
  3658. $comms_fix_freq = math.random(1, 64);
  3659. while($comms_fix_freq == 32) {
  3660. $comms_fix_freq = math.random(1, 64);
  3661. }
  3662. displaySabotage("§cCOM | Fix Comms", 1, 1, null);
  3663. boss.setTitle($progress_bar, "COMMS DISABLED");
  3664. boss.setProgress($progress_bar, 0);
  3665. hideTasks();
  3666. }
  3667. function hideTasks() {
  3668. iter = iterator($player_list);
  3669. while(hasNext(iter)) {
  3670. p_uuid = next(iter);
  3671. p = player.get(p_uuid);
  3672. if(isCrewmate(p) || $freeplay) {
  3673. for(i = 81; i < 98; i++) {
  3674. sb.remove(p, i);
  3675. }
  3676. }
  3677. }
  3678. }
  3679. function showTasks() {
  3680. boss.setProgress($progress_bar, $amount_done_tasks / $amount_all_tasks);
  3681. boss.setTitle($progress_bar, "TOTAL TASKS COMPLETED");
  3682. iter = iterator($player_list);
  3683. while(hasNext(iter)) {
  3684. player_uuid = next(iter);
  3685. player = player.get(player_uuid);
  3686. if(isCrewmate(player) || $freeplay) {
  3687. set = map.get($player_tasks, player_uuid);
  3688. iterator(set);
  3689. task_iter = iterator(set);
  3690. while(hasNext(task_iter)) {
  3691. task_id = next(task_iter);
  3692. a = map.get($all_tasks, task_id);
  3693. room = a[0];
  3694. description = a[1];
  3695. step = task.getStep(player, task_id);
  3696. number_2 = a[3];
  3697. time = null;
  3698. if(time != null) {
  3699. color = "§e";
  3700. } elseif(step == 0) {
  3701. color = "§r";
  3702. } elseif(step == number_2) {
  3703. color = "§a";
  3704. } else {
  3705. color = "§e";
  3706. }
  3707. if(task_id == 12) {
  3708. if(step == 0) {
  3709. r = map.get($empty_garb_map_3, player_uuid);
  3710. if(r == 0) {
  3711. room = "CAF";
  3712. } else {
  3713. room = "O2";
  3714. }
  3715. } else {
  3716. room = "STO";
  3717. }
  3718. }
  3719. if(task_id == 2) {
  3720. if(step == 0) {
  3721. r = map.get($download_map_3, player_uuid);
  3722. room = map.get($download_map_4, list.getIndex($download_list_3, r));
  3723. } else {
  3724. room = "ADM";
  3725. description = "Upload Data";
  3726. }
  3727. }
  3728. if(task_id == 10) {
  3729. my_list = map.get($wires_map_4, player_uuid);
  3730. if(step == 3) {
  3731. wire_loc = list.getIndex(my_list, 2);
  3732. } else {
  3733. wire_loc = list.getIndex(my_list, step);
  3734. }
  3735. room = map.get($wires_map_3, wire_loc);
  3736. } elseif(task_id == 14) {
  3737. r = map.get($divert_pow_map_3, player_uuid);
  3738. room_2 = map.get($divert_pow_map_5, r);
  3739. description = string.concat("Divert power to ", room_2);
  3740. if(step != 0) {
  3741. room = room_2;
  3742. }
  3743. }
  3744. sb_id = a[4];
  3745. if((number_2 == 1 && time == null) || time == 0) {
  3746. sb.add(player, sb_id, string.concat(color, room, " §8| ", color, description));
  3747. } elseif(time != null) {
  3748. sb.add(player, sb_id, string.concat(color, room, " §8| ", color, description, " (", string.number(time), ")"));
  3749. } else {
  3750. sb.add(player, sb_id, string.concat(color, room, " §8| ", color, description, " (", string.number(step), "/", string.number(number_2), ")"));
  3751. }
  3752. }
  3753. }
  3754. }
  3755. }
  3756. @scoreboard_toggler
  3757. if(sbtoggle) {
  3758. sbToggle.hideTasks();
  3759. sbtoggle = false;
  3760. } elseif(!comms_sabotaged) {
  3761. showTasks();
  3762. sbtoggle = true;
  3763. }
  3764. sgoto(100, "scoreboard_toggler");
  3765. goto("checkgame");
  3766. function sbToggle.hideTasks() {
  3767. iter = iterator($player_list);
  3768. while(hasNext(iter)) {
  3769. p_uuid = next(iter);
  3770. p = player.get(p_uuid);
  3771. for(i = 84; i < 98; i++) {
  3772. sb.remove(p, i);
  3773. }
  3774. }
  3775. }
  3776. function sabotage_light() {
  3777. hideSabotageCooldownBar();
  3778. amongus.setAlert(true);
  3779. $lights_sabotaged = true;
  3780. addSaboParticles($fix_lights_par_loc_1, $fix_lights_par_loc_2);
  3781. iter = iterator($player_list);
  3782. while(hasNext(iter)) {
  3783. p_uuid = next(iter);
  3784. p = player.get(p_uuid);
  3785. amongus.manageEffects(p);
  3786. }
  3787. displaySabotage("§cELE | Fix Lights", 1, 1, null);
  3788. inv.setItem($lights_inv, 0, item.create("RED_STAINED_GLASS_PANE", 1, "§fOff", null));
  3789. for(i = 0; i < 9; i+=2) {
  3790. r = math.random(0, 1);
  3791. if(r == 0) {
  3792. inv.setItem($lights_inv, i, item.create("GREEN_STAINED_GLASS_PANE", 1, "§fOn", null));
  3793. } else {
  3794. inv.setItem($lights_inv, i, item.create("RED_STAINED_GLASS_PANE", 1, "§fOff", null));
  3795. }
  3796. }
  3797. switchLights(false);
  3798. }
  3799. function hideSabotageDisplay() {
  3800. minigame.displayRemoveAll(80);
  3801. }
  3802. function displaySabotage(text, number_1, number_2, time) {
  3803. if(time == null) {
  3804. if(number_2 == 1) {
  3805. minigame.displayAll(80, text);
  3806. } else {
  3807. minigame.displayAll(80, string.concat(text, " (", string.number(number_1), "/", string.number(number_2), ")"));
  3808. }
  3809. } else {
  3810. if(number_2 == 1) {
  3811. minigame.displayAll(80, text, string.number(time));
  3812. } else {
  3813. minigame.displayAll(80, string.concat(text, string.number(time), " (", string.number(number_1), "/", string.number(number_2), ")"));
  3814. }
  3815. }
  3816. }
  3817. function callMeeting(reporter) {
  3818. reporter_uuid = player.getUuid(reporter);
  3819. amount = map.get($meeting_amounts, reporter_uuid);
  3820. if(amount <= 0) {
  3821. msg.prefix(reporter, $gamename, "You have no emergency meetings left.");
  3822. return;
  3823. }
  3824. cooldown = data.getTimer(reporter, "Meeting Cooldown");
  3825. if(cooldown == null || cooldown == -1) {
  3826. tpAllMiddle(reporter);
  3827. reporter_name = player.getName(reporter);
  3828. color_code = amongus.getPlayerColorCode(reporter);
  3829. minigame.titleAll("§cEMERGENY MEETING", string.concat("called by ", color_code, reporter_name), 20, 60, 20);
  3830. minigame.speakAll($gamename, string.concat(color_code, reporter_name, " §rcalls an emergency meeting!"));
  3831. new_amount = amount - 1;
  3832. map.add($meeting_amounts, reporter_uuid, new_amount);
  3833. msg.prefix(reporter, $gamename, string.concat("You have §c", string.number(new_amount), "§r emergeny meetings left."));
  3834. } else {
  3835. msg.prefix(reporter, $gamename, string.concat("Remaining meeting cooldown: ", string.number(math.roundDown(cooldown / 20)), "s"));
  3836. }
  3837. }
  3838. function reportBody(reporter, found_player_uuid) {
  3839. tpAllMiddle(reporter);
  3840. reporter_name = player.getName(reporter);
  3841. found_player_name = player.getName(found_player_uuid);
  3842. minigame.titleAll("§cREPORT", string.concat(reporter_name, " found ", found_player_name), 20, 60, 20);
  3843. minigame.speakAll($gamename, string.concat(amongus.getPlayerColorCode(reporter), reporter_name, " §rfound the body of ", amongus.getPlayerColorCode(found_player_uuid), found_player_name, "."));
  3844. if(amongus.isAlert()) {
  3845. if($oxygen_sabotaged) {
  3846. fix_oxygen();
  3847. }
  3848. if($reactor_sabotaged) {
  3849. fix_meltdown();
  3850. }
  3851. }
  3852. }
  3853. function continueGame() {
  3854. $meeting = false;
  3855. iter = iterator($player_list);
  3856. while(hasNext(iter)) {
  3857. p_uuid = next(iter);
  3858. p = player.get(p_uuid);
  3859. inv.close(p);
  3860. amongus.manageEffects(p);
  3861. if(player.isGhost(p)) {
  3862. player.setSpeed(p, $move_speed * 1.5);
  3863. } else {
  3864. player.removeItem(p, $open_vote_menu_item);
  3865. player.setSpeed(p, $move_speed);
  3866. if(isImpostor(p) && !player.isGhost(p)) {
  3867. data.setTimer(p, "Kill Cooldown", $kill_cooldown * 20);
  3868. kill_bar = map.get($imp_kill_bars, p_uuid);
  3869. updateKillBossBar(kill_bar, $kill_cooldown);
  3870. }
  3871. }
  3872. boss.removeAll($meeting_bar);
  3873. data.setTimer(p, "Voting Time", -1);
  3874. data.setTimer(p, "Meeting Cooldown", $meeting_cooldown * 20);
  3875. }
  3876. if($lights_sabotaged) {
  3877. sabotage_light();
  3878. return;
  3879. }
  3880. if(!amongus.isAlert()) {
  3881. setSaboCooldown($default_sabo_cooldown);
  3882. }
  3883. }
  3884. function killCrewmate(killer, crewmate) {
  3885. loc = entity.getLocation(crewmate);
  3886. sound.spawnForPlayer(killer, $kill_sound, $master_sound_category);
  3887. sound.spawnForPlayer(crewmate, $kill_sound, $master_sound_category);
  3888. killer_name = player.getName(killer);
  3889. killer_color_code = amongus.getPlayerColorCode(killer);
  3890. msg.prefix(crewmate, $gamename, string.concat(killer_color_code, killer_name, "§r killed you."));
  3891. msg.prefix(killer, $gamename, string.concat("You killed ", amongus.getPlayerColorCode(crewmate), player.getName(crewmate), "§r."));
  3892. //Killer zu Mord-Location teleportieren
  3893. entity.teleport(killer, loc);
  3894. data.setTimer(killer, "Kill Cooldown", $kill_cooldown * 20);
  3895. kill_bar = map.get($imp_kill_bars, player.getUuid(killer));
  3896. updateKillBossBar(kill_bar, $kill_cooldown);
  3897. //Crewmate zum Geist machen
  3898. amongus.manageEffects(crewmate);
  3899. player.hideOnline(crewmate);
  3900. crew_uuid = player.getUuid(crewmate);
  3901. list.add($ghosts, crew_uuid);
  3902. amongus.removeEquip(crewmate);
  3903. title.send(crewmate, text.new("§cKILLED!!!"), text.new(string.concat("by ", killer_color_code, killer_name)));
  3904. inv.close(crewmate);
  3905. $reactor_used = false;
  3906. sabotage.closedInv(crewmate);
  3907. player.setSpeed(crewmate, $move_speed * 1.5);
  3908. //Leiche an Mord-Location platzieren
  3909. ent = entity.spawn(loc, "ZOMBIE");
  3910. list.add($dead_bodies, ent);
  3911. map.add($report_map, ent, crew_uuid);
  3912. living.setAi(ent, false);
  3913. living.setHand(ent, $air_item);
  3914. entity.setSilent(ent, true);
  3915. living.setInvisible(ent, true);
  3916. color = amongus.getPlayerColor(crewmate);
  3917. amongus.equip(ent, color);
  3918. }
  3919. function amongus.clearAdminTable() {
  3920. map.clear($admin_table_map);
  3921. map.clear($admin_table_map_2);
  3922. }
  3923. function amongus.removeFromAdminTable(player) {
  3924. player_uuid = player.getUuid(player);
  3925. room_id = map.get($admin_table_map, player_uuid);
  3926. if(room_id == null) {
  3927. return;
  3928. }
  3929. map.remove($admin_table_map, player_uuid);
  3930. map.add($admin_table_map_2, room_id, map.get($admin_table_map_2, room_id) - 1);
  3931. }
  3932. function removeCamBodies() {
  3933. iter = map.iterator($cam_map_3);
  3934. while(hasNext(iter)) {
  3935. element = next(iter);
  3936. entity.remove(map.getValue(element));
  3937. }
  3938. }
  3939. function removeDeadBodies() {
  3940. iter = iterator($dead_bodies);
  3941. while(hasNext(iter)) {
  3942. entity.remove(next(iter));
  3943. }
  3944. }
  3945. function task.getSbId(task_id) {
  3946. a = map.get($all_tasks, task_id);
  3947. return a[4];
  3948. }
  3949. function registerTask(task_id, sb_id, room, description, steps_amount) {
  3950. a = array.new(5);
  3951. a[0] = room;
  3952. a[1] = description;
  3953. a[2] = 0; //starting step
  3954. a[3] = steps_amount;
  3955. a[4] = sb_id;
  3956. map.add($all_tasks, task_id, a);
  3957. }
  3958. function giveTask(player, task_id, room, description, number_1, number_2, time) {
  3959. player_uuid = player.getUuid(player);
  3960. if(time != null) {
  3961. color = "§e";
  3962. } elseif(number_1 == 0) {
  3963. color = "§r";
  3964. } elseif(number_1 == number_2) {
  3965. sound.spawnForPlayer(player, $task_sound, $master_sound_category);
  3966. $amount_done_tasks++;
  3967. color = "§a";
  3968. if(!$comms_sabotaged) {
  3969. iter = iterator($player_list);
  3970. while(hasNext(iter)) {
  3971. p_uuid = next(iter);
  3972. p = player.get(p_uuid);
  3973. pct = $amount_done_tasks / $amount_all_tasks;
  3974. boss.setProgress($progress_bar, pct);
  3975. if(pct == 1) {
  3976. sgoto(2, "crewmate_win");
  3977. }
  3978. }
  3979. }
  3980. } else {
  3981. color = "§e";
  3982. }
  3983. step = task.getStep(player, task_id);
  3984. if(step == 0) {
  3985. if(task_id == 1) {
  3986. addTaskParticle(player, $get_fuel_par_loc);
  3987. } elseif(task_id == 2) {
  3988. r = map.getOrDefault($download_map_3, player_uuid, math.random(0, 4));
  3989. map.add($download_map_3, player_uuid, r);
  3990. addTaskParticle(player, list.getIndex($download_list_4, r));
  3991. room = map.get($download_map_4, list.getIndex($download_list_3, r));
  3992. } elseif(task_id == 3) {
  3993. addTaskParticle(player, $prime_shields_par_loc);
  3994. } elseif(task_id == 4) {
  3995. addTaskParticle(player, $start_reactor_par_loc);
  3996. } elseif(task_id == 5) {
  3997. addTaskParticle(player, $unlock_manifolds_par_loc);
  3998. } elseif(task_id == 6) {
  3999. addTaskParticle(player, $chart_course_par_loc);
  4000. } elseif(task_id == 7) {
  4001. addTaskParticle(player, $steering_par_loc);
  4002. } elseif(task_id == 8 && time == null) {
  4003. addTaskParticle(player, $inspect_par_loc);
  4004. } elseif(task_id == 9) {
  4005. addTaskParticle(player, $calibrate_dist_par_loc);
  4006. } elseif(task_id == 11) {
  4007. addTaskParticle(player, $swipe_card_par_loc);
  4008. } elseif(task_id == 13) {
  4009. addTaskParticle(player, $clear_ast_par_loc);
  4010. } elseif(task_id == 15) {
  4011. addTaskParticle(player, $clean_o2_par_loc);
  4012. } elseif(task_id == 16) {
  4013. addTaskParticle(player, $scan_par_loc);
  4014. } elseif(task_id == 17) {
  4015. addTaskParticle(player, $ue_align_par_loc);
  4016. addTaskParticle(player, $le_align_par_loc);
  4017. }
  4018. }
  4019. if(task_id == 12) {
  4020. if(step == 0) {
  4021. r = map.getOrDefault($empty_garb_map_3, player_uuid, math.random(0, 1));
  4022. map.add($empty_garb_map_3, player_uuid, r);
  4023. if(r == 0) {
  4024. addTaskParticle(player, $cafe_garb_par_loc);
  4025. room = "CAF";
  4026. } else {
  4027. addTaskParticle(player, $o2_garb_par_loc);
  4028. room = "O2";
  4029. }
  4030. } else {
  4031. room = "STO";
  4032. }
  4033. }
  4034. if(task_id == 10) {
  4035. my_list = map.getOrDefault($wires_map_4, player_uuid, list.new());
  4036. if(step == 0) {
  4037. //Electrical > Storage > Admin > Navigation > Cafeteria > Security
  4038. //1.Wire
  4039. index_1 = math.random(0, 3);
  4040. wire_loc_1 = list.getIndex($wires_list_2, index_1);
  4041. list.add(my_list, wire_loc_1);
  4042. //2.Wire
  4043. index_2 = math.random(1 + index_1, 4);
  4044. wire_loc_2 = list.getIndex($wires_list_2, index_2);
  4045. while(list.contains(my_list, wire_loc_2)) {
  4046. index_2 = math.random(1 + index_1, 4);
  4047. wire_loc_2 = list.getIndex($wires_list_2, index_2);
  4048. }
  4049. list.add(my_list, wire_loc_2);
  4050. //3.Wire
  4051. index_3 = math.random(1 + index_2, 5);
  4052. wire_loc_3 = list.getIndex($wires_list_2, index_3);
  4053. while(list.contains(my_list, wire_loc_3)) {
  4054. index_3 = math.random(1 + index_2, 5);
  4055. wire_loc_3 = list.getIndex($wires_list_2, index_3);
  4056. }
  4057. list.add(my_list, wire_loc_3);
  4058. map.add($wires_map_4, player_uuid, my_list);
  4059. }
  4060. if(step < 3) {
  4061. wire_loc = list.getIndex(my_list, step);
  4062. room = map.get($wires_map_3, wire_loc);
  4063. addTaskParticle(player, map.get($wires_map_5, wire_loc));
  4064. if(step > 0) {
  4065. old_wire_loc = list.getIndex(my_list, step - 1);
  4066. removeTaskParticle(player, map.get($wires_map_5, old_wire_loc));
  4067. }
  4068. } else {
  4069. wire_loc = list.getIndex(my_list, 2);
  4070. removeTaskParticle(player, map.get($wires_map_5, wire_loc));
  4071. }
  4072. } elseif(task_id == 14) {
  4073. r = map.getOrDefault($divert_pow_map_3, player_uuid, math.random(36, 43));
  4074. map.add($divert_pow_map_3, player_uuid, r);
  4075. room_2 = map.get($divert_pow_map_5, r);
  4076. description = string.concat("Divert power to ", room_2);
  4077. if(step == 0) {
  4078. addTaskParticle(player, $elec_power_par_loc);
  4079. } else {
  4080. room = room_2;
  4081. }
  4082. }
  4083. if(!$comms_sabotaged) {
  4084. sb_id = task.getSbId(task_id);
  4085. if((number_2 == 1 && time == null) || time == 0) {
  4086. sb.add(player, sb_id, string.concat(color, room, " §8| ", color, description));
  4087. } elseif(time != null) {
  4088. if($sbtoggle && sb_id > 83) {
  4089. sb.add(player, sb_id, string.concat(color, room, " §8| ", color, description, " (", string.number(time), ")"));
  4090. }
  4091. } else {
  4092. sb.add(player, sb_id, string.concat(color, room, " §8| ", color, description, " (", string.number(number_1), "/", string.number(number_2), ")"));
  4093. }
  4094. }
  4095. set = map.get($player_tasks, player_uuid);
  4096. if(set == null) {
  4097. set = set.new();
  4098. }
  4099. set.add(set, task_id);
  4100. map.add($player_tasks, player_uuid, set);
  4101. }
  4102. function sgoto_auto_close_inv(player_uuid) {
  4103. list.add($auto_close_list, player_uuid);
  4104. sgoto(40, "auto_close_inv");
  4105. }
  4106. @auto_close_inv
  4107. p_uuid = list.getIndex(auto_close_list, 0);
  4108. list.removeIndex(auto_close_list, 0);
  4109. if(list.contains(auto_close_list_2, p_uuid)) {
  4110. list.remove(auto_close_list_2, p_uuid);
  4111. } else {
  4112. inv.close(player.get(p_uuid));
  4113. }
  4114. goto("checkgame");
  4115. function hasTask(player, task_id) {
  4116. player_uuid = player.getUuid(player);
  4117. set = map.getOrDefault($player_tasks, player_uuid, set.new());
  4118. return set.contains(set, task_id);
  4119. }
  4120. function addAstDirection(id, x, y) {
  4121. a = array.new(2);
  4122. a[0] = x;
  4123. a[1] = y;
  4124. $ast_directions[id] = a;
  4125. }
  4126. function addAstStartPos(slot, dir_id_1, dir_id_2, dir_id_3) {
  4127. list.add($ast_start_pos, slot);
  4128. my_list = list.new();
  4129. list.add(my_list, dir_id_1);
  4130. list.add(my_list, dir_id_2);
  4131. list.add(my_list, dir_id_3);
  4132. map.add($ast_start_pos_dirs, slot, my_list);
  4133. }
  4134. function getAstDirection(slot) {
  4135. my_list = map.get($ast_start_pos_dirs, slot);
  4136. dir_id = list.getIndex(my_list, math.random(0, 2));
  4137. a = $ast_directions[dir_id];
  4138. return a;
  4139. }
  4140. @loop
  4141. iter = iterator(player_list);
  4142. while(hasNext(iter)) {
  4143. p_uuid = next(iter);
  4144. p = player.get(p_uuid);
  4145. player.setHunger(p, 4);
  4146. player.setSaturation(p, 0);
  4147. }
  4148. //Kill Cooldown Bossbar
  4149. if(!meeting) {
  4150. iter = iterator(impostors_list_3);
  4151. while(hasNext(iter)) {
  4152. p_uuid = next(iter);
  4153. kill_bar = map.get(imp_kill_bars, p_uuid);
  4154. cooldown = data.getTimer(player.get(p_uuid), "Kill Cooldown");
  4155. updateKillBossBar(kill_bar, cooldown / 20);
  4156. }
  4157. }
  4158. //Meeting Bossbar
  4159. if(meeting) {
  4160. discussion = true;
  4161. p = player.get(list.getIndex(player_list, 0));
  4162. time = data.getTimer(p, "Discussion Time");
  4163. if(time == null || time == -1) {
  4164. time = data.getTimer(p, "Voting Time");
  4165. discussion = false;
  4166. }
  4167. updateMeetingBar(time / 20, discussion);
  4168. }
  4169. //Sabotage Cooldown Bossbar
  4170. if(!freeplay) {
  4171. if(!meeting) {
  4172. p = player.get(list.getIndex(impostors_list_2, 0));
  4173. time = data.getTimer(p, "Sabotage Cooldown");
  4174. updateSabotageCooldownBar(time / 20);
  4175. }
  4176. }
  4177. sgoto(20, "loop");
  4178. goto("checkgame");
  4179. @imp_par_loop
  4180. iter = iterator(impostors_list_2);
  4181. while(hasNext(iter)) {
  4182. p_uuid_1 = next(iter);
  4183. p_1 = player.get(p_uuid_1);
  4184. iter_2 = iterator(impostors_list_2);
  4185. while(hasNext(iter_2)) {
  4186. p_uuid_2 = next(iter_2);
  4187. p_2 = player.get(p_uuid_2);
  4188. if(!player.isGhost(p_2)) {
  4189. p_2_loc = entity.getLocation(p_2);
  4190. loc.add(p_2_loc, 0, 2.3, 0);
  4191. particle.spawnPlayer(p_2_loc, imp_par, p_1);
  4192. }
  4193. }
  4194. }
  4195. sgoto(5, "imp_par_loop");
  4196. goto("checkgame");
  4197. @download_data_2
  4198. player_uuid = player.getUuid(player);
  4199. c = 0;
  4200. inv.setItem(inv, c++, lime_glass);
  4201. map.add(download_counter, player_uuid, c);
  4202. list.add(download_list, player_uuid);
  4203. map.add(download_map, player_uuid, inv);
  4204. sgoto(20, "download_data");
  4205. goto("checkgame");
  4206. @download_data
  4207. task_id = 2;
  4208. player_uuid = list.getIndex(download_list, 0);
  4209. inv = map.get(download_map, player_uuid);
  4210. player = player.get(player_uuid);
  4211. list.removeIndex(download_list, 0);
  4212. c = map.get(download_counter, player_uuid);
  4213. if(list.contains(download_list_2, player_uuid)) {
  4214. goto("checkgame");
  4215. }
  4216. inv.setItem(inv, c++, lime_glass);
  4217. map.add(download_counter, player_uuid, c);
  4218. if(c < 9) {
  4219. list.add(download_list, player_uuid);
  4220. map.add(download_map, player_uuid, inv);
  4221. sgoto(20, "download_data");
  4222. } else {
  4223. inv.setItem(inv, 22, item.custom.create("CHECK_GREEN", 1, "§rTask completed", null));
  4224. map.remove(download_counter, player_uuid);
  4225. step = task.getStep(player, task_id);
  4226. step = task.stepIncrease(player, task_id);
  4227. if(step == 1) {
  4228. r = map.get(download_map_3, player_uuid);
  4229. removeTaskParticle(player, list.getIndex(download_list_4, r));
  4230. addTaskParticle(player, admin_upload_par_loc);
  4231. } else {
  4232. removeTaskParticle(player, admin_upload_par_loc);
  4233. }
  4234. giveTask(player, task_id, "ADM", "Upload Data", step, 2, null);
  4235. sgoto_auto_close_inv(player_uuid);
  4236. }
  4237. goto("checkgame");
  4238. @draw_pattern_1
  4239. player_uuid = list.getIndex(reactor_draw_list_1, 0);
  4240. list.removeIndex(reactor_draw_list_1, 0);
  4241. if(list.contains(reactor_block_list, player_uuid)) {
  4242. goto("checkgame");
  4243. }
  4244. reactor_array = reactor.get(player_uuid);
  4245. inv = reactor.getInv(reactor_array);
  4246. stage = reactor.getStage(reactor_array);
  4247. for(i = 0; i <= stage; i++) {
  4248. inv.setItem(inv, i + 2, green_glass);
  4249. }
  4250. reactor.setRightSide(inv, black_glass);
  4251. player = player.get(player_uuid);
  4252. list.add(reactor_draw_list_2, player_uuid);
  4253. goto("draw_pattern_2");
  4254. @draw_pattern_2
  4255. player_uuid = list.getIndex(reactor_draw_list_2, 0);
  4256. list.removeIndex(reactor_draw_list_2, 0);
  4257. if(list.contains(reactor_block_list, player_uuid)) {
  4258. goto("checkgame");
  4259. }
  4260. reactor_array = reactor.get(player_uuid);
  4261. inv = reactor.getInv(reactor_array);
  4262. stage = reactor.getStage(reactor_array);
  4263. counter = reactor.getCounter(reactor_array);
  4264. pattern = reactor.getPattern(reactor_array);
  4265. player = player.get(player_uuid);
  4266. if(counter > stage) {
  4267. reactor.setCounter(reactor_array, 0);
  4268. reactor.setPhase(reactor_array, "click");
  4269. reactor.save(reactor_array, player);
  4270. reactor.setRightSide(inv, gray_glass);
  4271. goto("checkgame");
  4272. }
  4273. inv.setItem(inv, pattern[counter], blue_glass);
  4274. counter++;
  4275. reactor.setCounter(reactor_array, counter);
  4276. reactor.save(reactor_array, player);
  4277. if(counter < 6) {
  4278. list.add(reactor_draw_list_2, player_uuid);
  4279. list.add(reset_reactor_draw_list, player_uuid);
  4280. sgoto(10, "reset_reactor_draw");
  4281. sgoto(12, "draw_pattern_2");
  4282. }
  4283. goto("checkgame");
  4284. @reset_reactor_draw
  4285. player_uuid = list.getIndex(reset_reactor_draw_list, 0);
  4286. list.removeIndex(reset_reactor_draw_list, 0);
  4287. reactor_array = reactor.get(player_uuid);
  4288. inv = reactor.getInv(reactor_array);
  4289. counter = reactor.getCounter(reactor_array) - 1;
  4290. pattern = reactor.getPattern(reactor_array);
  4291. if(counter >= 0) {
  4292. inv.setItem(inv, pattern[counter], black_glass);
  4293. player = player.get(player_uuid);
  4294. }
  4295. goto("checkgame");
  4296. @reset_reactor_click
  4297. player_uuid = list.getIndex(reset_reactor_click_list, 0);
  4298. slot = list.getIndex(reset_reactor_click_list_2, 0);
  4299. list.removeIndex(reset_reactor_click_list, 0);
  4300. list.removeIndex(reset_reactor_click_list_2, 0);
  4301. if(list.contains(reactor_block_list, player_uuid)) {
  4302. goto("checkgame");
  4303. }
  4304. reactor_array = reactor.get(player_uuid);
  4305. inv = reactor.getInv(reactor_array);
  4306. inv.setItem(inv, slot, gray_glass);
  4307. player = player.get(player_uuid);
  4308. goto("checkgame");
  4309. @unblock_start_reactor
  4310. list.removeIndex(reactor_block_list, 0);
  4311. goto("checkgame");
  4312. @unblock_submit_scan
  4313. list.removeIndex(submit_scan_list_2, 0);
  4314. goto("checkgame");
  4315. @unblock_calib_dist
  4316. list.removeIndex(calibrate_dist_list_2, 0);
  4317. goto("checkgame");
  4318. @unblock_empty_garb
  4319. list.removeIndex(empty_garb_list_2, 0);
  4320. goto("checkgame");
  4321. @unblock_download
  4322. list.removeIndex(download_list_2, 0);
  4323. goto("checkgame");
  4324. @unblock_clear_ast
  4325. list.removeIndex(clear_ast_list_2, 0);
  4326. goto("checkgame");
  4327. @new_reactor
  4328. player_uuid = list.getIndex(reactor_false_click_list, 0);
  4329. list.removeIndex(reactor_false_click_list, 0);
  4330. reactor_array = reactor.get(player_uuid);
  4331. inv = reactor.getInv(reactor_array);
  4332. reactor.setHeader(inv, light_gray_glass);
  4333. reactor.setLeftSide(inv, black_glass);
  4334. reactor.setRightSide(inv, black_glass);
  4335. player = player.get(player_uuid);
  4336. reactor_array = array.new(5);
  4337. reactor.setInv(reactor_array, inv);
  4338. reactor.setStage(reactor_array, 0);
  4339. reactor.setCounter(reactor_array, 0);
  4340. reactor.setPattern(reactor_array);
  4341. reactor.save(reactor_array, player);
  4342. list.add(reactor_draw_list_1, player_uuid);
  4343. sgoto(20, "draw_pattern_1");
  4344. goto("checkgame");
  4345. @false_reactor_click
  4346. reactor.setHeader(inv, red_glass);
  4347. reactor.setRightSide(inv, red_glass);
  4348. list.add(reactor_block_list, player_uuid);
  4349. list.add(reactor_false_click_list, player_uuid);
  4350. sgoto(20, "unblock_start_reactor");
  4351. sgoto(40, "new_reactor");
  4352. goto("checkgame");
  4353. @false_manifolds_click
  4354. for(i = 2; i < 16; i++) {
  4355. if(i == 7) {
  4356. i = 11;
  4357. }
  4358. inv.setItem(inv, i, item.create("RED_STAINED_GLASS_PANE", item.getAmount(inv.getItem(inv, i)), null, null));
  4359. }
  4360. list.add(manifolds_list, inv);
  4361. list.add(manifolds_list_2, player);
  4362. sgoto(30, "redo_manifolds");
  4363. goto("checkgame");
  4364. @redo_manifolds
  4365. inv = list.getIndex(manifolds_list, 0);
  4366. player_uuid = player.getUuid(list.getIndex(manifolds_list_2, 0));
  4367. list.removeIndex(manifolds_list, 0);
  4368. list.removeIndex(manifolds_list_2, 0);
  4369. map.remove(manifolds_counter, player_uuid);
  4370. for(i = 2; i < 16; i++) {
  4371. if(i == 7) {
  4372. i = 11;
  4373. }
  4374. inv.setItem(inv, i, item.create("BLUE_STAINED_GLASS_PANE", item.getAmount(inv.getItem(inv, i)), null, null));
  4375. }
  4376. goto("checkgame");
  4377. @countdown_sample
  4378. player_uuid = list.getIndex(sample_list, 0);
  4379. player = player.get(player_uuid);
  4380. time = list.getIndex(sample_list_2, 0) - 1;
  4381. list.removeIndex(sample_list, 0);
  4382. list.removeIndex(sample_list_2, 0);
  4383. inv = map.get(sample_map, player_uuid);
  4384. sample = item.create("blue_stained_glass_pane", 1, "§rSample", null);
  4385. if(time == 58) {
  4386. inv.setItem(inv, 0, sample);
  4387. inv.setItem(inv, 9, sample);
  4388. inv.setItem(inv, 18, sample);
  4389. } elseif(time == 57) {
  4390. inv.setItem(inv, 2, sample);
  4391. inv.setItem(inv, 11, sample);
  4392. inv.setItem(inv, 20, sample);
  4393. } elseif(time == 56) {
  4394. inv.setItem(inv, 4, sample);
  4395. inv.setItem(inv, 13, sample);
  4396. inv.setItem(inv, 22, sample);
  4397. } elseif(time == 55) {
  4398. inv.setItem(inv, 6, sample);
  4399. inv.setItem(inv, 15, sample);
  4400. inv.setItem(inv, 24, sample);
  4401. } elseif(time == 54) {
  4402. inv.setItem(inv, 8, sample);
  4403. inv.setItem(inv, 17, sample);
  4404. inv.setItem(inv, 26, sample);
  4405. }
  4406. if(time == 0) {
  4407. inv.setItem(inv, 53, item.create("gray_stained_glass_pane", 1, "§rSelect anomaly", null));
  4408. r = math.random(0, 4) * 2;
  4409. inv.setItem(inv, r, item.create("red_stained_glass_pane", 1, "§rSample", null));
  4410. inv.setItem(inv, r + 9, item.create("red_stained_glass_pane", 1, "§rSample", null));
  4411. inv.setItem(inv, r + 18, item.create("red_stained_glass_pane", 1, "§rSample", null));
  4412. select_sample = item.create("green_stained_glass_pane", 1, "§rSelect sample", null);
  4413. inv.setItem(inv, 36, item.create("green_stained_glass_pane", 1, "§rSelect sample", null));
  4414. inv.setItem(inv, 38, item.create("green_stained_glass_pane", 1, "§rSelect sample", null));
  4415. inv.setItem(inv, 40, item.create("green_stained_glass_pane", 1, "§rSelect sample", null));
  4416. inv.setItem(inv, 42, item.create("green_stained_glass_pane", 1, "§rSelect sample", null));
  4417. inv.setItem(inv, 44, item.create("green_stained_glass_pane", 1, "§rSelect sample", null));
  4418. giveTask(player, 8, "MED", "Inspect Sample", 0, 1, 0);
  4419. goto("checkgame");
  4420. }
  4421. giveTask(player, 8, "MED", "Inspect Sample", 0, 1, time);
  4422. inv.setItem(inv, 53, item.create("gray_stained_glass_pane", time, "§rGo grab a coffee", null));
  4423. list.add(sample_list, player_uuid);
  4424. list.add(sample_list_2, time);
  4425. sgoto(20, "countdown_sample");
  4426. goto("checkgame");
  4427. @calibrate_dist
  4428. p_uuid = list.getIndex(calibrate_dist_list, 0);
  4429. list.removeIndex(calibrate_dist_list, 0);
  4430. if(list.contains(calibrate_dist_list_2, p_uuid)) {
  4431. goto("checkgame");
  4432. }
  4433. a = map.get(calibrate_dist_map, p_uuid);
  4434. inv = a[1];
  4435. index = a[3];
  4436. stage = a[4];
  4437. inv.setItem(inv, calibrate_dist_array[index++], black_glass);
  4438. if(index == 12) {
  4439. index = 0;
  4440. }
  4441. a[3] = index;
  4442. if(stage == 0) {
  4443. inv.setItem(inv, calibrate_dist_array[index], yellow_glass);
  4444. } elseif(stage == 1) {
  4445. inv.setItem(inv, calibrate_dist_array[index], blue_glass);
  4446. } elseif(stage == 2) {
  4447. inv.setItem(inv, calibrate_dist_array[index], cyan_glass);
  4448. }
  4449. if(stage < 3) {
  4450. map.add(calibrate_dist_map, p_uuid, a);
  4451. list.add(calibrate_dist_list, p_uuid);
  4452. sgoto(7, "calibrate_dist");
  4453. }
  4454. goto("checkgame");
  4455. @empty_garb
  4456. p_uuid = list.getIndex(empty_garb_list, 0);
  4457. list.removeIndex(empty_garb_list, 0);
  4458. c = map.get(empty_garb_map, p_uuid);
  4459. inv = map.get(empty_garb_map_2, p_uuid);
  4460. if(list.contains(empty_garb_list_2, p_uuid)) {
  4461. goto("checkgame");
  4462. }
  4463. for(slot = 52; slot > 9; slot--) {
  4464. if(slot == 44) {
  4465. continue;
  4466. }
  4467. inv.setItem(inv, slot, inv.getItem(inv, slot - 9));
  4468. }
  4469. p = player.get(p_uuid);
  4470. if(++c == 5) {
  4471. step = task.stepIncrease(p, 12);
  4472. if(step == 1) {
  4473. addTaskParticle(p, stor_garb_par_loc);
  4474. r = map.get(empty_garb_map_3, player_uuid);
  4475. if(r == 0) {
  4476. removeTaskParticle(p, cafe_garb_par_loc);
  4477. } else {
  4478. removeTaskParticle(p, o2_garb_par_loc);
  4479. }
  4480. } else {
  4481. removeTaskParticle(p, stor_garb_par_loc);
  4482. }
  4483. inv.setItem(inv, 44, item.custom.create("CHECK_GREEN", 1, "§rTask completed", null));
  4484. map.remove(empty_garb_map, p_uuid);
  4485. giveTask(p, 12, "STO", "Empty Garbage", step, 2, null);
  4486. sgoto_auto_close_inv(p_uuid);
  4487. } else {
  4488. map.add(empty_garb_map, p_uuid, c);
  4489. map.add(empty_garb_map_2, p_uuid, inv);
  4490. list.add(empty_garb_list, p_uuid);
  4491. sgoto(20, "empty_garb");
  4492. }
  4493. goto("checkgame");
  4494. @clear_ast
  4495. p_uuid = list.getIndex(clear_ast_list, 0);
  4496. list.removeIndex(clear_ast_list, 0);
  4497. if(list.contains(clear_ast_list_2, p_uuid)) {
  4498. if(list.getSize(clear_ast_list) == 0) {
  4499. goto("checkgame");
  4500. }
  4501. }
  4502. inv = map.get(clear_ast_map_3, p_uuid);
  4503. my_list = map.get(clear_ast_map, p_uuid);
  4504. iter = iterator(my_list);
  4505. while(hasNext(iter)) {
  4506. a = next(iter);
  4507. slot = a[1];
  4508. x_dir = a[2];
  4509. y_dir = a[3];
  4510. reached_end = a[4];
  4511. speed = a[5];
  4512. speed_counter = a[6];
  4513. if(speed_counter == speed) {
  4514. inv.setItem(inv, slot, black_glass);
  4515. if(reached_end) {
  4516. remove(iter);
  4517. continue;
  4518. }
  4519. slot += x_dir;
  4520. slot += (y_dir * 9);
  4521. a[1] = slot;
  4522. if(list.contains(ast_start_pos, slot)) {
  4523. a[4] = true;
  4524. }
  4525. inv.setItem(inv, slot, asteroid_item);
  4526. a[6] = 0;
  4527. } else {
  4528. a[6] = speed_counter + 1;
  4529. }
  4530. }
  4531. c = map.get(clear_ast_map_2, p_uuid) + 1;
  4532. if(c == 3 && !list.contains(clear_ast_list_3, p_uuid)) {
  4533. c = 0;
  4534. //new asteroid
  4535. a = array.new(7);
  4536. slot = list.getIndex(ast_start_pos, math.random(0, 25));
  4537. a[1] = slot;
  4538. inv.setItem(inv, slot, asteroid_item);
  4539. b = getAstDirection(slot);
  4540. a[2] = b[0]; //x_dir
  4541. a[3] = b[1]; //y_dir
  4542. a[4] = false; //reached end
  4543. a[5] = math.random(1, 2); //speed
  4544. a[6] = 0; //speed counter
  4545. list.add(my_list, a);
  4546. }
  4547. map.add(clear_ast_map, p_uuid, my_list);
  4548. map.add(clear_ast_map_2, p_uuid, c);
  4549. list.add(clear_ast_list, p_uuid);
  4550. sgoto(5, "clear_ast");
  4551. goto("checkgame");
  4552. function assignSeat(player) {
  4553. for(i = 0; i < 10; i++) {
  4554. if($seat_array[i] == null) {
  4555. entity.teleport(player, $lobbyspawnloc);
  4556. player_uuid = player.getUuid(player);
  4557. $seat_array[i] = player_uuid;
  4558. map.add($seat_map_index, player_uuid, i);
  4559. list.add($seat_list_join, player_uuid);
  4560. sgoto(10, "lobby_join_seat");
  4561. return;
  4562. }
  4563. }
  4564. }
  4565. @lobby_join_seat
  4566. player_uuid = list.getIndex(seat_list_join, 0);
  4567. list.removeIndex(seat_list_join, 0);
  4568. i = map.get(seat_map_index, player_uuid);
  4569. loc = list.getIndex(seat_locs, i);
  4570. ent = read.spawnMob(loc, "{Facing:1b,Invisible:1b,Invulnerable:1b,OnGround:0b,Rotation:[0.0f,-90.0f],id:\"minecraft:item_frame\"}");
  4571. entity.frame.setfixed(ent, true);
  4572. map.add(seat_map, player_uuid, ent);
  4573. player = player.get(player_uuid);
  4574. if(player != null) {
  4575. entity.mount(player, ent);
  4576. list.add(seat_list_leave, player_uuid);
  4577. sgoto(60, "lobby_leave_seat");
  4578. }
  4579. goto("simplelobby");
  4580. @lobby_leave_seat
  4581. player_uuid = list.getIndex(seat_list_leave, 0);
  4582. list.removeIndex(seat_list_leave, 0);
  4583. leaveSeat(player_uuid);
  4584. goto("simplelobby");
  4585. function leaveSeat(player_or_uuid) {
  4586. if(isPlayer(player_or_uuid)) {
  4587. player_uuid = player.getUuid(player_or_uuid);
  4588. } else {
  4589. player_uuid = player_or_uuid;
  4590. }
  4591. for(i = 0; i < 10; i++) {
  4592. if($seat_array[i] == player_uuid) {
  4593. $seat_array[i] = null;
  4594. ent = map.get($seat_map, player_uuid);
  4595. if(ent != null) {
  4596. entity.remove(ent);
  4597. map.remove($seat_map, player_uuid);
  4598. }
  4599. }
  4600. }
  4601. }
  4602. @submit_scan
  4603. p_uuid = list.getIndex(submit_scan_list, 0);
  4604. list.removeIndex(submit_scan_list, 0);
  4605. if(list.contains(submit_scan_list_2, p_uuid)) {
  4606. goto("checkgame");
  4607. }
  4608. c = map.get(submit_scan_map, p_uuid);
  4609. inv = map.get(submit_scan_map_2, p_uuid);
  4610. p = player.get(p_uuid);
  4611. if(c == 0) {
  4612. inv.setItem(inv, 2, lime_glass);
  4613. inv.setItem(inv, 3, lime_glass);
  4614. inv.setItem(inv, 4, lime_glass);
  4615. inv.setItem(inv, 5, lime_glass);
  4616. inv.setItem(inv, 6, lime_glass);
  4617. } elseif(c == 1) {
  4618. inv.setItem(inv, 0, item.create("black_stained_glass_pane", 1, string.concat("§rID: ", string.toUpperCase(amongus.getPlayerColor(p), "P0")), null));
  4619. inv.setItem(inv, 2, light_gray_glass);
  4620. inv.setItem(inv, 3, light_gray_glass);
  4621. inv.setItem(inv, 4, light_gray_glass);
  4622. inv.setItem(inv, 5, light_gray_glass);
  4623. inv.setItem(inv, 6, light_gray_glass);
  4624. inv.setItem(inv, 11, lime_glass);
  4625. inv.setItem(inv, 12, lime_glass);
  4626. inv.setItem(inv, 14, lime_glass);
  4627. inv.setItem(inv, 15, lime_glass);
  4628. inv.setItem(inv, 47, green_glass);
  4629. } elseif(c == 2) {
  4630. inv.setItem(inv, 11, light_gray_glass);
  4631. inv.setItem(inv, 12, light_gray_glass);
  4632. inv.setItem(inv, 14, light_gray_glass);
  4633. inv.setItem(inv, 15, light_gray_glass);
  4634. inv.setItem(inv, 20, lime_glass);
  4635. inv.setItem(inv, 21, lime_glass);
  4636. inv.setItem(inv, 23, lime_glass);
  4637. inv.setItem(inv, 24, lime_glass);
  4638. } elseif(c == 3) {
  4639. inv.setItem(inv, 8, item.create("black_stained_glass_pane", 1, "§rHT: 3' 6''", null));
  4640. inv.setItem(inv, 20, light_gray_glass);
  4641. inv.setItem(inv, 21, light_gray_glass);
  4642. inv.setItem(inv, 23, light_gray_glass);
  4643. inv.setItem(inv, 24, light_gray_glass);
  4644. inv.setItem(inv, 29, lime_glass);
  4645. inv.setItem(inv, 30, lime_glass);
  4646. inv.setItem(inv, 32, lime_glass);
  4647. inv.setItem(inv, 33, lime_glass);
  4648. inv.setItem(inv, 48, green_glass);
  4649. } elseif(c == 4) {
  4650. inv.setItem(inv, 29, light_gray_glass);
  4651. inv.setItem(inv, 30, light_gray_glass);
  4652. inv.setItem(inv, 32, light_gray_glass);
  4653. inv.setItem(inv, 33, light_gray_glass);
  4654. inv.setItem(inv, 38, lime_glass);
  4655. inv.setItem(inv, 39, lime_glass);
  4656. inv.setItem(inv, 41, lime_glass);
  4657. inv.setItem(inv, 42, lime_glass);
  4658. } elseif(c == 5) {
  4659. inv.setItem(inv, 18, item.create("black_stained_glass_pane", 1, "§rWT: 92 lbs", null));
  4660. inv.setItem(inv, 38, light_gray_glass);
  4661. inv.setItem(inv, 39, light_gray_glass);
  4662. inv.setItem(inv, 41, light_gray_glass);
  4663. inv.setItem(inv, 42, light_gray_glass);
  4664. inv.setItem(inv, 29, lime_glass);
  4665. inv.setItem(inv, 30, lime_glass);
  4666. inv.setItem(inv, 32, lime_glass);
  4667. inv.setItem(inv, 33, lime_glass);
  4668. inv.setItem(inv, 49, green_glass);
  4669. } elseif(c == 6) {
  4670. inv.setItem(inv, 29, light_gray_glass);
  4671. inv.setItem(inv, 30, light_gray_glass);
  4672. inv.setItem(inv, 32, light_gray_glass);
  4673. inv.setItem(inv, 33, light_gray_glass);
  4674. inv.setItem(inv, 20, lime_glass);
  4675. inv.setItem(inv, 21, lime_glass);
  4676. inv.setItem(inv, 23, lime_glass);
  4677. inv.setItem(inv, 24, lime_glass);
  4678. } elseif(c == 7) {
  4679. inv.setItem(inv, 26, item.create("black_stained_glass_pane", 1, string.concat("§rC: ", string.toUpperCase(amongus.getPlayerColor(p))), null));
  4680. inv.setItem(inv, 20, light_gray_glass);
  4681. inv.setItem(inv, 21, light_gray_glass);
  4682. inv.setItem(inv, 23, light_gray_glass);
  4683. inv.setItem(inv, 24, light_gray_glass);
  4684. inv.setItem(inv, 11, lime_glass);
  4685. inv.setItem(inv, 12, lime_glass);
  4686. inv.setItem(inv, 14, lime_glass);
  4687. inv.setItem(inv, 15, lime_glass);
  4688. inv.setItem(inv, 50, green_glass);
  4689. } elseif(c == 8) {
  4690. inv.setItem(inv, 11, light_gray_glass);
  4691. inv.setItem(inv, 12, light_gray_glass);
  4692. inv.setItem(inv, 14, light_gray_glass);
  4693. inv.setItem(inv, 15, light_gray_glass);
  4694. inv.setItem(inv, 2, lime_glass);
  4695. inv.setItem(inv, 3, lime_glass);
  4696. inv.setItem(inv, 4, lime_glass);
  4697. inv.setItem(inv, 5, lime_glass);
  4698. inv.setItem(inv, 6, lime_glass);
  4699. } elseif(c == 9) {
  4700. inv.setItem(inv, 36, item.create("black_stained_glass_pane", 1, "§rBT: O-", null));
  4701. inv.setItem(inv, 2, light_gray_glass);
  4702. inv.setItem(inv, 3, light_gray_glass);
  4703. inv.setItem(inv, 4, light_gray_glass);
  4704. inv.setItem(inv, 5, light_gray_glass);
  4705. inv.setItem(inv, 6, light_gray_glass);
  4706. inv.setItem(inv, 51, green_glass);
  4707. } else {
  4708. inv.setItem(inv, 44, item.custom.create("CHECK_GREEN", 1, "§rTask completed", null));
  4709. removeTaskParticle(p, scan_par_loc);
  4710. step = task.stepIncrease(p, 16);
  4711. giveTask(p, 16, "MED", "Submit Scan", 1, 1, null);
  4712. sgoto_auto_close_inv(p_uuid);
  4713. goto("checkgame");
  4714. }
  4715. map.add(submit_scan_map, p_uuid, c + 1);
  4716. list.add(submit_scan_list, p_uuid);
  4717. sgoto(20, "submit_scan");
  4718. goto("checkgame");
  4719. function set_engine(player, inv, direction) {
  4720. player_uuid = player.getUuid(player);
  4721. pos = map.get($align_engine_map, player_uuid);
  4722. if(direction == "up") {
  4723. new_pos = pos + 1;
  4724. } elseif(direction == "down") {
  4725. new_pos = pos - 1;
  4726. } else {
  4727. new_pos = pos;
  4728. }
  4729. if(new_pos < 0 || new_pos > 10) {
  4730. return false;
  4731. }
  4732. map.add($align_engine_map, player_uuid, new_pos);
  4733. //remove old pattern
  4734. temp_list = $align_engine_array[pos];
  4735. iter = iterator(temp_list);
  4736. while(hasNext(iter)) {
  4737. slot = next(iter);
  4738. if(slot < 18 || slot > 26) {
  4739. inv.setItem(inv, slot, $gray_glass);
  4740. } else {
  4741. inv.setItem(inv, slot, $light_gray_glass);
  4742. }
  4743. }
  4744. //set new pattern
  4745. temp_list = $align_engine_array[new_pos];
  4746. iter = iterator(temp_list);
  4747. while(hasNext(iter)) {
  4748. slot = next(iter);
  4749. if(slot < 18 || slot > 26) {
  4750. inv.setItem(inv, slot, $red_glass);
  4751. } else {
  4752. inv.setItem(inv, slot, $green_glass);
  4753. }
  4754. }
  4755. return new_pos == 5;
  4756. }
  4757. function cam.enter(player) {
  4758. if(player.isOnCam(player)) {
  4759. return;
  4760. }
  4761. player.hideOnline(player);
  4762. amongus.manageEffects(player);
  4763. entity.setGravity(player, false);
  4764. player_uuid = player.getUuid(player);
  4765. list.add($cam_list, player_uuid);
  4766. player.giveItem(player, $prev_cam_item);
  4767. player.giveItem(player, $next_cam_item);
  4768. player.giveItem(player, $leave_cam_item);
  4769. if(isImpostor(player)) {
  4770. cooldown = data.getTimer(player, "Kill Cooldown");
  4771. map.add($holded_kill_cooldown, player_uuid, cooldown);
  4772. }
  4773. if($cam_loop == false) {
  4774. $cam_loop = true;
  4775. sgoto(10, "cam_tp_loop");
  4776. }
  4777. }
  4778. function cam.leave(player) {
  4779. player_uuid = player.getUuid(player);
  4780. list.remove($cam_list, player_uuid);
  4781. map.remove($cam_map, player_uuid);
  4782. ent = map.get($cam_map_3, player_uuid);
  4783. if(ent != null) {
  4784. map.remove($cam_map_3, ent);
  4785. map.remove($cam_map_4, ent);
  4786. entity.remove(ent);
  4787. }
  4788. entity.teleport(player, map.get($cam_map_2, player_uuid));
  4789. list.add($gravity_list, player.getUuid(player));
  4790. sgoto(2, "setGravity");
  4791. if(list.getSize($cam_list) == 0) {
  4792. $cam_loop = false;
  4793. }
  4794. player.removeItem(player, $prev_cam_item);
  4795. player.removeItem(player, $next_cam_item);
  4796. player.removeItem(player, $leave_cam_item);
  4797. amongus.manageEffects(player);
  4798. if(!player.isGhost(player)) {
  4799. player.showOnline(player);
  4800. }
  4801. }
  4802. @setGravity
  4803. p_uuid = list.getIndex(gravity_list, 0);
  4804. list.removeIndex(gravity_list, 0);
  4805. p = player.get(p_uuid);
  4806. if(p != null) {
  4807. entity.setGravity(p, true);
  4808. }
  4809. goto("checkgame");
  4810. function player.isOnCam(player) {
  4811. return list.contains($cam_list, player.getUuid(player));
  4812. }
  4813. @cam_tp_loop
  4814. show_cam_pars = false;
  4815. iter = iterator(cam_list);
  4816. while(hasNext(iter)) {
  4817. p_uuid = next(iter);
  4818. p = player.get(p_uuid);
  4819. cam_number = map.get(cam_map, p_uuid);
  4820. tp_loc = list.getIndex(cams_locs_tp, cam_number);
  4821. entity.teleport(p, tp_loc);
  4822. if(isImpostor(p)) {
  4823. cooldown = map.getOrDefault(holded_kill_cooldown, player_uuid, -1);
  4824. if(cooldown != -1) {
  4825. data.setTimer(p, "Kill Cooldown", cooldown);
  4826. kill_bar = map.get(imp_kill_bars, player_uuid);
  4827. updateKillBossBar(kill_bar, cooldown / 20);
  4828. }
  4829. }
  4830. if(!player.isGhost(p)) {
  4831. show_cam_pars = true;
  4832. }
  4833. }
  4834. if(show_cam_pars) {
  4835. iter = iterator(cams_par_locs);
  4836. while(hasNext(iter)) {
  4837. particle.spawn(next(iter), cam_par);
  4838. }
  4839. }
  4840. if(cam_loop) {
  4841. sgoto(10, "cam_tp_loop");
  4842. }
  4843. goto("checkgame");
  4844. function vent_enter(player, vent_loc) {
  4845. tp_loc = map.get($vent_map, vent_loc);
  4846. entity.teleport(player, tp_loc);
  4847. player.hideOnline(player);
  4848. removeImpostorItems(player);
  4849. player_uuid = player.getUuid(player);
  4850. map.add($vent_map_2, player_uuid, tp_loc);
  4851. map.add($vent_map_4, player_uuid, vent_loc);
  4852. a = map.get($vent_map_3, vent_loc);
  4853. icon_1 = a[0];
  4854. icon_2 = a[2];
  4855. inv = player.getInv(player);
  4856. if(icon_1 == null) {
  4857. inv.setItem(inv, 6, null);
  4858. } else {
  4859. inv.setItem(inv, 6, icon_1);
  4860. }
  4861. if(!list.contains($vent_list, player_uuid)) {
  4862. list.add($vent_list, player_uuid);
  4863. }
  4864. if(icon_2 == null) {
  4865. inv.setItem(inv, 7, null);
  4866. } else {
  4867. inv.setItem(inv, 7, icon_2);
  4868. }
  4869. inv.setItem(inv, 8, $leave_vent_item);
  4870. if($vent_loop == false) {
  4871. $vent_loop = true;
  4872. sgoto(10, "vent_tp_loop");
  4873. }
  4874. }
  4875. function vent_leave(player) {
  4876. player_uuid = player.getUuid(player);
  4877. list.remove($vent_list, player_uuid);
  4878. map.remove($vent_map_2, player_uuid);
  4879. map.remove($vent_map_4, player_uuid);
  4880. player.showOnline(player);
  4881. if(list.getSize($vent_list) == 0) {
  4882. $vent_loop = false;
  4883. }
  4884. color = amongus.getPlayerColor(player);
  4885. player.removeItem(player, $vent_left_item);
  4886. player.removeItem(player, $vent_right_item);
  4887. player.removeItem(player, $vent_up_item);
  4888. player.removeItem(player, $vent_down_item);
  4889. player.removeItem(player, $leave_vent_item);
  4890. if(isImpostor(player)) {
  4891. giveImpostorItems(player);
  4892. }
  4893. }
  4894. @vent_tp_loop
  4895. iter = iterator(vent_list);
  4896. while(hasNext(iter)) {
  4897. p_uuid = next(iter);
  4898. p = player.get(p_uuid);
  4899. tp_loc = map.get(vent_map_2, p_uuid);
  4900. entity.teleport(p, tp_loc);
  4901. if(isImpostor(p)) {
  4902. cooldown = map.getOrDefault(holded_kill_cooldown, player_uuid, -1);
  4903. if(cooldown != -1) {
  4904. data.setTimer(p, "Kill Cooldown", cooldown);
  4905. kill_bar = map.get(imp_kill_bars, player_uuid);
  4906. updateKillBossBar(kill_bar, cooldown / 20);
  4907. }
  4908. }
  4909. }
  4910. if(vent_loop) {
  4911. sgoto(10, "vent_tp_loop");
  4912. }
  4913. goto("checkgame");
  4914. @space_loop
  4915. loc_iter = iterator(space_locs);
  4916. while(hasNext(loc_iter)) {
  4917. particle.spawn(next(loc_iter), space_par);
  4918. }
  4919. sgoto(50, "space_loop");
  4920. goto("checkgame");
  4921. @task_part_loop
  4922. iter = iterator(player_list);
  4923. while(hasNext(iter)) {
  4924. p_uuid = next(iter);
  4925. p = player.get(p_uuid);
  4926. my_list = map.get(task_part_map, p_uuid);
  4927. if(my_list != null) {
  4928. loc_iter = iterator(my_list);
  4929. while(hasNext(loc_iter)) {
  4930. particle.spawnPlayer(next(loc_iter), task_par, p, 1, 0, 0.05, 0.05, 0.05);
  4931. }
  4932. }
  4933. }
  4934. sgoto(10, "task_part_loop");
  4935. goto("checkgame");
  4936. function addSaboParticles(location1, location2) {
  4937. list.add($sabo_par_list, location1);
  4938. if(location2 != null) {
  4939. list.add($sabo_par_list, location2);
  4940. }
  4941. sgoto(10, "sabo_par_loop");
  4942. }
  4943. function removeSaboParticles(location1, location2) {
  4944. list.remove($sabo_par_list, location1);
  4945. if(location2 != null) {
  4946. list.remove($sabo_par_list, location2);
  4947. }
  4948. }
  4949. @sabo_par_loop
  4950. if(!amongus.isAlert()) {
  4951. goto("checkgame");
  4952. }
  4953. loc_iter = iterator(sabo_par_list);
  4954. while(hasNext(loc_iter)) {
  4955. particle.spawn(next(loc_iter), sabo_par);
  4956. }
  4957. sgoto(10, "sabo_par_loop");
  4958. goto("checkgame");
  4959. function addTaskParticle(player, location) {
  4960. if(isCrewmate(player) || $freeplay) {
  4961. player_uuid = player.getUuid(player);
  4962. my_list = map.get($task_part_map, player_uuid);
  4963. if(my_list == null) {
  4964. my_list = list.new();
  4965. map.add($task_part_map, player_uuid, my_list);
  4966. }
  4967. list.add(my_list, location);
  4968. }
  4969. }
  4970. function removeTaskParticle(player, location) {
  4971. player_uuid = player.getUuid(player);
  4972. my_list = map.get($task_part_map, player_uuid);
  4973. if(my_list == null) {
  4974. my_list = list.new();
  4975. map.add($task_part_map, player_uuid, my_list);
  4976. }
  4977. list.remove(my_list, location);
  4978. }
  4979. function reactor.setHeader(inv, item) {
  4980. for(i = 2; i < 7; i++) {
  4981. inv.setItem(inv, i, item);
  4982. }
  4983. }
  4984. function reactor.setLeftSide(inv, item) {
  4985. inv.setItem(inv, 19, item);
  4986. inv.setItem(inv, 20, item);
  4987. inv.setItem(inv, 21, item);
  4988. inv.setItem(inv, 28, item);
  4989. inv.setItem(inv, 29, item);
  4990. inv.setItem(inv, 30, item);
  4991. inv.setItem(inv, 37, item);
  4992. inv.setItem(inv, 38, item);
  4993. inv.setItem(inv, 39, item);
  4994. }
  4995. function reactor.setRightSide(inv, item) {
  4996. inv.setItem(inv, 23, item);
  4997. inv.setItem(inv, 24, item);
  4998. inv.setItem(inv, 25, item);
  4999. inv.setItem(inv, 32, item);
  5000. inv.setItem(inv, 33, item);
  5001. inv.setItem(inv, 34, item);
  5002. inv.setItem(inv, 41, item);
  5003. inv.setItem(inv, 42, item);
  5004. inv.setItem(inv, 43, item);
  5005. }
  5006. function reactor.get(player_or_uuid) {
  5007. if(isPlayer(player_or_uuid)) {
  5008. player_or_uuid = player.getUuid(player_or_uuid);
  5009. }
  5010. reactor_array = map.get($start_reactor_map, player_or_uuid);
  5011. return reactor_array;
  5012. }
  5013. function reactor.save(reactor_array, player) {
  5014. player_uuid = player.getUuid(player);
  5015. map.add($start_reactor_map, player_uuid, reactor_array);
  5016. }
  5017. function reactor.setInv(reactor_array, inv) {
  5018. reactor_array[0] = inv;
  5019. }
  5020. function reactor.getInv(reactor_array) {
  5021. return reactor_array[0];
  5022. }
  5023. function reactor.setStage(reactor_array, stage) {
  5024. reactor_array[1] = stage;
  5025. }
  5026. function reactor.getStage(reactor_array) {
  5027. return reactor_array[1];
  5028. }
  5029. function reactor.setCounter(reactor_array, counter) {
  5030. reactor_array[2] = counter;
  5031. }
  5032. function reactor.getCounter(reactor_array) {
  5033. return reactor_array[2];
  5034. }
  5035. function reactor.setPattern(reactor_array) {
  5036. pattern = array.new(5);
  5037. for(i = 0; i < 5; i++) {
  5038. r = math.random(1, 9);
  5039. if(r < 4) {
  5040. r += 18;
  5041. } elseif(r < 7) {
  5042. r += 24;
  5043. } else {
  5044. r += 30;
  5045. }
  5046. pattern[i] = r;
  5047. }
  5048. reactor_array[3] = pattern;
  5049. }
  5050. function reactor.getPattern(reactor_array) {
  5051. return reactor_array[3];
  5052. }
  5053. function reactor.setPhase(reactor_array, phase) {
  5054. reactor_array[4] = phase;
  5055. }
  5056. function reactor.getPhase(reactor_array) {
  5057. return reactor_array[4];
  5058. }
  5059. function sabotage.holdReactor(inv, hold) {
  5060. if(hold) {
  5061. item = $lime_glass;
  5062. } else {
  5063. item = $red_glass;
  5064. }
  5065. for(i = 0; i < 54; i++) {
  5066. inv.setItem(inv, i, item);
  5067. }
  5068. }
  5069. function switchLights(boolean) {
  5070. if(boolean) {
  5071. mat = material.get("sea_lantern");
  5072. } else {
  5073. mat = material.get("smooth_stone");
  5074. }
  5075. iter = iterator($lights_blocks);
  5076. while(hasNext(iter)) {
  5077. block.setMaterial(next(iter), mat);
  5078. }
  5079. }
  5080. @draw_comms
  5081. player_uuid = list.getIndex(comms_state_list, 0);
  5082. list.removeIndex(comms_state_list, 0);
  5083. if(!comms_sabotaged) {
  5084. goto("checkgame");
  5085. }
  5086. inv = map.get(comms_inv_map, player_uuid);
  5087. if(inv == null) {
  5088. goto("checkgame");
  5089. }
  5090. comms_state = map.get(comms_state_map, player_uuid);
  5091. counter = map.getOrDefault(comms_counter_map, player_uuid, 0);
  5092. if(comms_state == 0) {
  5093. //worst
  5094. for(i = 26; i >= 9; i--) {
  5095. inv.setItem(inv, i, inv.getItem(inv, i - 1));
  5096. }
  5097. if(counter == 1) {
  5098. counter = 0;
  5099. } else {
  5100. inv.setItem(inv, 9, red_glass);
  5101. counter++;
  5102. }
  5103. } elseif(comms_state == 1) {
  5104. //close
  5105. for(i = 26; i > 0; i--) {
  5106. inv.setItem(inv, i, inv.getItem(inv, i - 1));
  5107. }
  5108. if(counter == 3) {
  5109. inv.setItem(inv, 0, yellow_glass);
  5110. inv.setItem(inv, 18, black_glass);
  5111. counter = 0;
  5112. } elseif(counter == 2) {
  5113. inv.setItem(inv, 9, yellow_glass);
  5114. counter++;
  5115. } elseif(counter == 0) {
  5116. inv.setItem(inv, 0, black_glass);
  5117. counter++;
  5118. } else {
  5119. counter++;
  5120. }
  5121. } elseif(comms_state == 2) {
  5122. //correct
  5123. for(i = 35; i > 0; i--) {
  5124. inv.setItem(inv, i, inv.getItem(inv, i - 1));
  5125. }
  5126. if(counter == 5) {
  5127. inv.setItem(inv, 0, lime_glass);
  5128. counter = 0;
  5129. } elseif(counter == 4) {
  5130. inv.setItem(inv, 9, lime_glass);
  5131. inv.setItem(inv, 27, black_glass);
  5132. counter++;
  5133. } elseif(counter == 2) {
  5134. inv.setItem(inv, 9, black_glass);
  5135. inv.setItem(inv, 27, lime_glass);
  5136. counter++;
  5137. } elseif(counter == 0) {
  5138. inv.setItem(inv, 0, black_glass);
  5139. inv.setItem(inv, 9, lime_glass);
  5140. inv.setItem(inv, 27, black_glass);
  5141. counter++;
  5142. } else {
  5143. counter++;
  5144. }
  5145. }
  5146. map.add(comms_counter_map, player_uuid, counter);
  5147. list.add(comms_state_list, player_uuid);
  5148. sgoto(5, "draw_comms");
  5149. goto("checkgame");
  5150. function comms.drawCorrect(inv, player) {
  5151. player_uuid = player.getUuid(player);
  5152. map.add($comms_state_map, player_uuid, 2);
  5153. map.remove($comms_counter_map, player_uuid);
  5154. for(i = 0; i < 36; i++) {
  5155. inv.setItem(inv, i, $black_glass);
  5156. }
  5157. inv.setItem(inv, 0, $lime_glass);
  5158. inv.setItem(inv, 6, $lime_glass);
  5159. inv.setItem(inv, 10, $lime_glass);
  5160. inv.setItem(inv, 14, $lime_glass);
  5161. inv.setItem(inv, 16, $lime_glass);
  5162. inv.setItem(inv, 20, $lime_glass);
  5163. inv.setItem(inv, 22, $lime_glass);
  5164. inv.setItem(inv, 26, $lime_glass);
  5165. inv.setItem(inv, 30, $lime_glass);
  5166. }
  5167. function comms.drawClose(inv, player) {
  5168. player_uuid = player.getUuid(player);
  5169. map.add($comms_state_map, player_uuid, 1);
  5170. map.remove($comms_counter_map, player_uuid);
  5171. for(i = 0; i < 36; i++) {
  5172. inv.setItem(inv, i, $black_glass);
  5173. }
  5174. inv.setItem(inv, 0, $yellow_glass);
  5175. inv.setItem(inv, 4, $yellow_glass);
  5176. inv.setItem(inv, 8, $yellow_glass);
  5177. inv.setItem(inv, 10, $yellow_glass);
  5178. inv.setItem(inv, 12, $yellow_glass);
  5179. inv.setItem(inv, 14, $yellow_glass);
  5180. inv.setItem(inv, 16, $yellow_glass);
  5181. inv.setItem(inv, 20, $yellow_glass);
  5182. inv.setItem(inv, 24, $yellow_glass);
  5183. }
  5184. function comms.drawWorst(inv, player) {
  5185. player_uuid = player.getUuid(player);
  5186. map.add($comms_state_map, player_uuid, 0);
  5187. map.remove($comms_counter_map, player_uuid);
  5188. for(i = 0; i < 9; i++) {
  5189. inv.setItem(inv, i, $black_glass);
  5190. }
  5191. for(i = 27; i < 36; i++) {
  5192. inv.setItem(inv, i, $black_glass);
  5193. }
  5194. for(i = 9; i < 27; i = i + 2) {
  5195. inv.setItem(inv, i, $black_glass);
  5196. }
  5197. for(i = 10; i < 27; i = i + 2) {
  5198. inv.setItem(inv, i, $red_glass);
  5199. }
  5200. }
  5201. @scheduled_fix_comms
  5202. player_uuid = list.getIndex(comms_fix_list, 0);
  5203. list.removeIndex(comms_fix_list, 0);
  5204. time = map.get(comms_fix_map, player_uuid);
  5205. if(time == null) {
  5206. goto("checkgame");
  5207. }
  5208. if(time.getMillis() - time <= 2000) {
  5209. fix_comms();
  5210. }
  5211. goto("checkgame");
  5212. function sabotage.openedInv(player) {
  5213. list.add($sabo_list, player.getUuid(player));
  5214. }
  5215. function sabotage.closedInv(player) {
  5216. list.remove($sabo_list, player.getUuid(player));
  5217. }
  5218. function sabotage.closeInvs() {
  5219. iter = iterator($sabo_list);
  5220. while(hasNext(iter)) {
  5221. inv.close(player.get(next(iter)));
  5222. }
  5223. }
  5224. @scheduled_sabo_close
  5225. sabotage.closeInvs();
  5226. goto("checkgame");
  5227. function task.stepIncrease(player, task_id) {
  5228. player_uuid = player.getUuid(player);
  5229. map = map.get($task_steps, player_uuid);
  5230. if(map == null) {
  5231. map = map.new();
  5232. }
  5233. step = map.getOrDefault(map, task_id, 0) + 1;
  5234. map.add(map, task_id, step);
  5235. map.add($task_steps, player_uuid, map);
  5236. return step;
  5237. }
  5238. function task.getStep(player, task_id) {
  5239. map = map.get($task_steps, player.getUuid(player));
  5240. if(map == null) {
  5241. return 0;
  5242. }
  5243. return map.getOrDefault(map, task_id, 0);
  5244. }
  5245. function task.resetSteps(player) {
  5246. map.add($task_steps, player.getUuid(player), map.new());
  5247. }
  5248. function amongus.setPlayerColor(player, color) {
  5249. player_uuid = player.getUuid(player);
  5250. map.add($player_colors, player_uuid, color);
  5251. }
  5252. function amongus.getPlayerColor(player_or_uuid) {
  5253. if(isPlayer(player_or_uuid)) {
  5254. player_or_uuid = player.getUuid(player_or_uuid);
  5255. }
  5256. return map.get($player_colors, player_or_uuid);
  5257. }
  5258. function amongus.getPlayerColorCode(player_or_uuid) {
  5259. color = amongus.getPlayerColor(player_or_uuid);
  5260. return map.getOrDefault($color_code_map, color, "§r");
  5261. }
  5262. function amongus.isUsedPlayerColor(color) {
  5263. iter = map.iterator($player_colors);
  5264. while(hasNext(iter)) {
  5265. element = next(iter);
  5266. value = map.getValue(element);
  5267. if(value == color) {
  5268. return true;
  5269. }
  5270. }
  5271. return false;
  5272. }
  5273. function amongus.removeEquip(player) {
  5274. living.setEquip(player, slot.getHead(), $air_item);
  5275. living.setEquip(player, slot.getChest(), $air_item);
  5276. living.setEquip(player, slot.getLegs(), $air_item);
  5277. living.setEquip(player, slot.getFeet(), $air_item);
  5278. }
  5279. function amongus.equipHuman(human, color, player) {
  5280. item = player.getHead(player.getUuid(player), player.getName(player));
  5281. living.setEquip(human, slot.getHead(), item);
  5282. amongus.equip(human, color);
  5283. }
  5284. function amongus.equip(entity, color) {
  5285. color_code = map.get($cloth_code_map, color);
  5286. if(isPlayer(entity)) {
  5287. item = player.getHead(player.getUuid(entity), player.getName(entity));
  5288. living.setEquip(entity, slot.getHead(), item);
  5289. }
  5290. item = read.item(string.concat("{id:\"minecraft:leather_chestplate\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
  5291. item.addFlag(item, "HIDE_ATTRIBUTES");
  5292. living.setEquip(entity, slot.getChest(), item);
  5293. item = read.item(string.concat("{id:\"minecraft:leather_leggings\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
  5294. item.addFlag(item, "HIDE_ATTRIBUTES");
  5295. living.setEquip(entity, slot.getLegs(), item);
  5296. item = read.item(string.concat("{id:\"minecraft:leather_boots\",Count:1b,tag:{Damage:0,display:{color:", color_code, "}}}"));
  5297. item.addFlag(item, "HIDE_ATTRIBUTES");
  5298. living.setEquip(entity, slot.getFeet(), item);
  5299. }
  5300. function createVoteInv(player, reporter_uuid) {
  5301. //inv = inv.new("022200222 022200222 022200222 022200222 022200222 022200000");
  5302. inv = inv.new("022200222022200222022200222022200222022200222022200000", text.new("§cVOTE"));
  5303. index = 1;
  5304. iter = iterator($all_list);
  5305. while(hasNext(iter)) {
  5306. p_uuid = next(iter);
  5307. p_name = player.getName(p_uuid);
  5308. head = player.getHead(p_uuid, p_name);
  5309. color = amongus.getPlayerColorCode(p_uuid);
  5310. if(player.isGhost(p_uuid)) {
  5311. item.setName(head, text.new(string.concat("§r", color, p_name)));
  5312. inv.setItem(inv, index - 1, $zombie_head);
  5313. } else {
  5314. item.setName(head, text.new(string.concat("§rVote for ", color, p_name)));
  5315. if(p_uuid == reporter_uuid) {
  5316. item.setAmount(head, 2);
  5317. }
  5318. }
  5319. inv.setItem(inv, index, head);
  5320. if((index - 1) % 9 == 0) {
  5321. index = index + 5;
  5322. } else {
  5323. index = index + 4;
  5324. }
  5325. }
  5326. inv.setItem(inv, 46, item.custom.create("RETURN_GREEN", 1, "§rSkip Vote", null));
  5327. map.add($vote_inv_map, player.getUuid(player), inv);
  5328. }
  5329. function getVoteInv(player) {
  5330. return map.get($vote_inv_map, player.getUuid(player));
  5331. }
  5332. function setItemInVoteInv(slot, item) {
  5333. iter = iterator($player_list);
  5334. while(hasNext(iter)) {
  5335. p = player.get(next(iter));
  5336. inv = getVoteInv(p);
  5337. inv.setItem(inv, slot, item);
  5338. }
  5339. }
  5340. function amongus.isAlert() {
  5341. return $alert;
  5342. }
  5343. function amongus.setAlert(bool) {
  5344. $alert = bool;
  5345. }
  5346. function addVentIcons(vent_loc, icon_1, vent_tp_loc_1, icon_2, vent_tp_loc_2) {
  5347. a = array.new(4);
  5348. a[0] = icon_1;
  5349. a[1] = vent_tp_loc_1;
  5350. a[2] = icon_2;
  5351. a[3] = vent_tp_loc_2;
  5352. map.add($vent_map_3, vent_loc, a);
  5353. }
  5354. function minigame.canStartIndiv() {
  5355. if(minigame.isStarting()) {
  5356. return false;
  5357. }
  5358. player_list = minigame.getPlayers($script_id);
  5359. p_amount = list.getSize(player_list);
  5360. return p_amount == minigame.getMinPlayers() || p_amount >= $multi_minplayers;
  5361. }
  5362. @crewmate_win
  5363. winners = "§bCrewmates";
  5364. if(freeplay) {
  5365. endtime = time.getMillis();
  5366. p_uuid = list.getIndex(player_list, 0);
  5367. p = player.get(p_uuid);
  5368. time = math.round((endtime - starttime) / 1000);
  5369. last_record = ranking.getPoints(rankingtable, p);
  5370. if(last_record == 0 || time < last_record) {
  5371. record = time;
  5372. diff = last_record - time;
  5373. } else {
  5374. record = last_record;
  5375. }
  5376. ranking.setPoints(rankingtable, p, record);
  5377. mins = math.roundDown(time / 60);
  5378. secs = math.roundComma(time % 60, 2);
  5379. rec_mins = math.roundDown(record / 60);
  5380. rec_secs = math.roundComma(record % 60, 2);
  5381. minigame.statsHeader(p, gamename, "§e");
  5382. minigame.statsLine(p, "§e", "Time", string.concat(string.number(mins), " min ", string.number(secs), " s"));
  5383. minigame.statsLine(p, "§e", "Your record", string.concat(string.number(rec_mins), " min ", string.number(rec_secs), " s"));
  5384. if(diff != null) {
  5385. msg(p, " §e- §rBeat own record by §e", string.concat(string.number(diff), " s"));
  5386. }
  5387. }
  5388. goto("win");
  5389. @checkwin
  5390. imps_alive = 0;
  5391. crew_alive = 0;
  5392. iter = iterator(player_list);
  5393. while(hasNext(iter)) {
  5394. p_uuid = next(iter);
  5395. p = player.get(p_uuid);
  5396. if(!player.isGhost(p)) {
  5397. if(isImpostor(p)) {
  5398. imps_alive++;
  5399. } else {
  5400. crew_alive++;
  5401. }
  5402. }
  5403. }
  5404. if(imps_alive == 0) {
  5405. winners = "§bCrewmates";
  5406. goto("win");
  5407. }
  5408. if(imps_alive >= crew_alive) {
  5409. winners = "§cImpostors";
  5410. goto("win");
  5411. }
  5412. goto("checkgame");
  5413. @win
  5414. imp_string = "";
  5415. iter = iterator(impostors_list);
  5416. while(hasNext(iter)) {
  5417. p_uuid = next(iter);
  5418. p_name = player.getName(p_uuid);
  5419. p = player.get(p_uuid);
  5420. string = string.concat(amongus.getPlayerColorCode(p_uuid), p_name);
  5421. if(imp_string == "") {
  5422. imp_string = string;
  5423. } else {
  5424. imp_string = string.concat(imp_string, ", ", string);
  5425. }
  5426. if(winners == "§cImpostors") {
  5427. //money.addBoost(p, 128);
  5428. } else {
  5429. //money.addBoost(p, 32);
  5430. }
  5431. }
  5432. iter = iterator(player_list);
  5433. while(hasNext(iter)) {
  5434. p_uuid = next(iter);
  5435. p = player.get(p_uuid);
  5436. msg.prefix(p, $gamename, string.concat("The ", winners, "§r have won the game."));
  5437. msg.prefix(p, $gamename, string.concat("§4Impostors: §r", imp_string));
  5438. inv.close(p);
  5439. boss.removePlayer(progress_bar, p);
  5440. player.gameMute(p, false);
  5441. player.showOnline(p);
  5442. living.setInvisible(p, false);
  5443. if(winners == "§bCrewmates") {
  5444. //money.addBoost(p, 128);
  5445. } else {
  5446. //money.addBoost(p, 32);
  5447. }
  5448. }
  5449. //Building-Perms wieder geben
  5450. for(i = 0; i < list.getSize(removed_perms); i++) {
  5451. player_uuid = list.getIndex(removed_perms, i);
  5452. //PERMS perm.registerPlayer(player_uuid, 1);
  5453. //PERMS perm.registerPlayer(player_uuid, 15);
  5454. }
  5455. script = script.getFromId(script_id);
  5456. removeDeadBodies();
  5457. removeCamBodies();
  5458. minigame.kickAllPlayers(script);
  5459. minigame.term(script, gamesignloc);
  5460. term();
  5461. @on_error
  5462. msg.dev("Error Handler activated");
  5463. if(progress_bar != null) {
  5464. boss.removeAll(progress_bar);
  5465. }
  5466. if(meeting_bar != null) {
  5467. boss.removeAll(meeting_bar);
  5468. }
  5469. if(sabotage_cooldown_bar != null) {
  5470. boss.removeAll(sabotage_cooldown_bar);
  5471. }
  5472. if(script_id != null) {
  5473. minigame.msgAll("§cThere was an error in the game.");
  5474. if(imp_kill_bars != null) {
  5475. player_list = minigame.getPlayers(script_id);
  5476. iter = iterator(player_list);
  5477. while(hasNext(iter)) {
  5478. p_uuid = next(iter);
  5479. p = player.get(p_uuid);
  5480. if(p != null) {
  5481. living.clearEffects(p);
  5482. player.showOnline(p);
  5483. living.setInvisible(p, false);
  5484. entity.setGravity(p, false);
  5485. }
  5486. my_kill_bar = map.get(imp_kill_bars, p_uuid);
  5487. if(my_kill_bar != null) {
  5488. boss.removeAll(my_kill_bar);
  5489. }
  5490. }
  5491. }
  5492. minigame.kickAllPlayers(script_id);
  5493. }
  5494. msg.dev("Script terminated (Minigame).");
  5495. term();