From 0a9d891b424c9f8b91d894c652367f7153ca1779 Mon Sep 17 00:00:00 2001 From: GDN <96800819+GDNgit@users.noreply.github.com> Date: Mon, 27 Mar 2023 14:28:29 -0500 Subject: [PATCH] fixes revolution not working (#20709) --- code/game/gamemodes/game_mode.dm | 4 --- code/game/gamemodes/revolution/revolution.dm | 27 +++++++++++++------- code/modules/mob/living/living.dm | 1 - 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 70f8809a33d..4afa4e0ac9c 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -253,10 +253,6 @@ return 0 */ -///Called when a mob changes Z-level -/datum/game_mode/proc/transit_z(mob/living/player) - return - /datum/game_mode/proc/num_players() . = 0 for(var/mob/new_player/P in GLOB.player_list) diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index 59357f46691..e7b67b7a8a6 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -20,6 +20,7 @@ var/finished = 0 var/max_headrevs = 3 + var/check_counter = 0 var/list/datum/mind/heads_to_kill = list() var/list/possible_revolutionaries = list() @@ -78,14 +79,22 @@ SSshuttle.emergencyNoEscape = 1 ..() -////////////////////////////////////////////////////////////////////////// -//Check if heads and head revolutionaries are still alive and on Z-level// -////////////////////////////////////////////////////////////////////////// -/datum/game_mode/revolution/transit_z(mob/living/player) - if(!finished) - var/list/heads = get_all_heads() - if(player.mind && ((player.mind in heads) || (player.mind in head_revolutionaries))) - SSticker.mode.check_win() +/datum/game_mode/revolution/process() // to anyone who thinks "why don't we use a normal actually sane check here instead of process for checking Z level changes" It's because equip code is dogshit and you change z levels upon spawning in + check_counter++ + if(check_counter >= 5) + if(!finished) + check_heads() + check_counter = 0 + return FALSE + +/datum/game_mode/revolution/proc/check_heads() + var/list/heads = get_all_heads() + if(length(heads_to_kill) < length(heads)) + var/list/new_heads = heads - heads_to_kill + for(var/datum/mind/head_mind in new_heads) + for(var/datum/mind/rev_mind in head_revolutionaries) + mark_for_death(rev_mind, head_mind) + /datum/game_mode/proc/forge_revolutionary_objectives(datum/mind/rev_mind) var/list/heads = get_living_heads() @@ -273,7 +282,7 @@ "You have been brainwashed! You are no longer a revolutionary! Your memory is hazy from the time you were a rebel... the only thing you remember is the name of the one who brainwashed you...") rev_mind.current.Paralyse(10 SECONDS) update_rev_icons_removed(rev_mind) - + ///////////////////////////////////// //Adds the rev hud to a new convert// ///////////////////////////////////// diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 2b314534cec..479d57d126f 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1089,7 +1089,6 @@ /mob/living/onTransitZ(old_z,new_z) ..() update_z(new_z) - SSticker.mode.transit_z(src) /mob/living/rad_act(amount) . = ..()