among_us.txt 177 KB

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