From bb2b6d85fdd3d8353ae31cde9daeb6d50f0f67a6 Mon Sep 17 00:00:00 2001
From: Contrabang <91113370+Contrabang@users.noreply.github.com>
Date: Sun, 10 Sep 2023 11:02:16 -0400
Subject: [PATCH] Fixes some issues with revs (#22308)
* fixes to revs
* Update code/game/objects/items/weapons/implants/implant_mindshield.dm
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
* UH OH.
---------
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
---
code/game/gamemodes/revolution/revolution.dm | 17 ++++++++---------
.../weapons/implants/implant_mindshield.dm | 2 +-
.../revolutionary/team_revolution.dm | 2 +-
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm
index 6e7b0ad1c77..1bcb2c2ed5f 100644
--- a/code/game/gamemodes/revolution/revolution.dm
+++ b/code/game/gamemodes/revolution/revolution.dm
@@ -1,10 +1,9 @@
-// To add a rev to the list of revolutionaries, make sure it's rev (with if(ticker.mode.name == "revolution)),
-// then call ticker.mode:add_revolutionary(_THE_PLAYERS_MIND_)
+// then call SSticker.mode.add_revolutionary(_THE_PLAYERS_MIND_)
// nothing else needs to be done, as that proc will check if they are a valid target.
// Just make sure the converter is a head before you call it!
-// To remove a rev (from brainwashing or w/e), call ticker.mode:remove_revolutionary(_THE_PLAYERS_MIND_),
+// To remove a rev (from brainwashing or w/e), call SSticker.mode.remove_revolutionary(_THE_PLAYERS_MIND_),
// this will also check they're not a head, so it can just be called freely
-// If the game somtimes isn't registering a win properly, then ticker.mode.check_win() isn't being called somewhere.
+// If the game somtimes isn't registering a win properly, then SSticker.mode.check_win() isn't being called somewhere.
#define REV_VICTORY 1
#define STATION_VICTORY 2
@@ -243,10 +242,10 @@
var/comcount = 0
var/revcount = 0
var/loycount = 0
- for(var/datum/mind/M in SSticker.mode:head_revolutionaries)
+ for(var/datum/mind/M in SSticker.mode.head_revolutionaries)
if(M.current && M.current.stat != DEAD)
foecount++
- for(var/datum/mind/M in SSticker.mode:revolutionaries)
+ for(var/datum/mind/M in SSticker.mode.revolutionaries)
if(M.current && M.current.stat != DEAD)
revcount++
@@ -284,13 +283,13 @@
return dat
/proc/is_revolutionary(mob/living/M)
- return istype(M) && (M?.mind in SSticker?.mode?.revolutionaries)
+ return istype(M) && M?.mind?.has_antag_datum(/datum/antagonist/rev, FALSE)
/proc/is_headrev(mob/living/M)
- return istype(M) && (M?.mind in SSticker?.mode?.head_revolutionaries)
+ return istype(M) && M?.mind?.has_antag_datum(/datum/antagonist/rev/head)
/proc/is_any_revolutionary(mob/living/M)
- return is_revolutionary(M) || is_headrev(M)
+ return istype(M) && M?.mind?.has_antag_datum(/datum/antagonist/rev)
#undef REV_VICTORY
#undef STATION_VICTORY
diff --git a/code/game/objects/items/weapons/implants/implant_mindshield.dm b/code/game/objects/items/weapons/implants/implant_mindshield.dm
index e29db6b1757..6aa9070145c 100644
--- a/code/game/objects/items/weapons/implants/implant_mindshield.dm
+++ b/code/game/objects/items/weapons/implants/implant_mindshield.dm
@@ -7,7 +7,7 @@
implant_state = "implant-nanotrasen"
/obj/item/implant/mindshield/can_implant(mob/source, mob/user)
- if(source.mind in SSticker.mode.head_revolutionaries)
+ if(source.mind?.has_antag_datum(/datum/antagonist/rev/head))
source.visible_message("[source] seems to resist [src]!",
"You feel something interfering with your mental conditioning, but you resist it!")
return FALSE
diff --git a/code/modules/antagonists/revolutionary/team_revolution.dm b/code/modules/antagonists/revolutionary/team_revolution.dm
index 724a9204e09..b11b5b74d19 100644
--- a/code/modules/antagonists/revolutionary/team_revolution.dm
+++ b/code/modules/antagonists/revolutionary/team_revolution.dm
@@ -102,7 +102,7 @@
var/sec_diminish = (8 - sec) / 3 // 2 seccies = 2, 5 seccies = 1, 8 seccies = 0
var/potential = round(heads - sec_diminish) // more sec, increases. more heads, increases
- var/how_many_more_headrevs = clamp(potential, clamp_at, head_revolutionaries - max_headrevs)
+ var/how_many_more_headrevs = clamp(potential, clamp_at, max_headrevs - head_revolutionaries)
return how_many_more_headrevs