among_us.txt 176 KB

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