diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm
index 0bfbe31fb1..043158da11 100644
--- a/code/__DEFINES/status_effects.dm
+++ b/code/__DEFINES/status_effects.dm
@@ -33,4 +33,8 @@
#define STATUS_EFFECT_SIGILMARK /datum/status_effect/sigil_mark
#define STATUS_EFFECT_BELLIGERENT /datum/status_effect/belligerent //forces the affected to walk, doing damage if they try to run
+#define STATUS_EFFECT_MANIAMOTOR /datum/status_effect/maniamotor //disrupts, damages, and confuses the affected as long as they're in range of the motor
+#define MAX_MANIA_SEVERITY 100 //how high the mania severity can go
+#define MANIA_DAMAGE_TO_CONVERT 90 //how much damage is required before it'll convert affected targets
+
#define STATUS_EFFECT_HISWRATH /datum/status_effect/his_wrath //His Wrath.
diff --git a/code/__DEFINES/status_effects.dm.rej b/code/__DEFINES/status_effects.dm.rej
new file mode 100644
index 0000000000..929dfc37dc
--- /dev/null
+++ b/code/__DEFINES/status_effects.dm.rej
@@ -0,0 +1,10 @@
+diff a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm (rejected hunks)
+@@ -33,4 +33,8 @@
+ #define STATUS_EFFECT_SIGILMARK /datum/status_effect/sigil_mark
+ #define STATUS_EFFECT_BELLIGERENT /datum/status_effect/belligerent //forces the affected to walk, doing damage if they try to run
+
++#define STATUS_EFFECT_MANIAMOTOR /datum/status_effect/maniamotor //disrupts, damages, and confuses the affected as long as they're in range of the motor
++#define MAX_MANIA_SEVERITY 100 //how high the mania severity can go
++#define MANIA_DAMAGE_TO_CONVERT 90 //how much damage is required before it'll convert affected targets
++
+ #define STATUS_EFFECT_HISWRATH /datum/status_effect/his_wrath //His Wrath.
diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm
index 8eec853047..9f6e481edb 100644
--- a/code/datums/status_effects/debuffs.dm
+++ b/code/datums/status_effects/debuffs.dm
@@ -76,3 +76,89 @@
/datum/status_effect/belligerent/on_remove()
if(owner.m_intent == MOVE_INTENT_WALK)
owner.toggle_move_intent()
+
+
+/datum/status_effect/maniamotor
+ id = "maniamotor"
+ duration = -1
+ tick_interval = 10
+ status_type = STATUS_EFFECT_MULTIPLE
+ alert_type = null
+ var/obj/structure/destructible/clockwork/powered/mania_motor/motor
+ var/severity = 0 //goes up to a maximum of MAX_MANIA_SEVERITY
+ var/warned_turnoff = FALSE //if we've warned that the motor is off
+ var/warned_outofsight = FALSE //if we've warned that the target is out of sight of the motor
+ var/static/list/mania_messages = list("Go nuts.", "Take a crack at crazy.", "Make a bid for insanity.", "Get kooky.", "Move towards mania.", "Become bewildered.", "Wax wild.", \
+ "Go round the bend.", "Land in lunacy.", "Try dementia.", "Strive to get a screw loose.", "Advance forward.", "Approach the transmitter.", "Touch the antennae.", \
+ "Move towards the mania motor.", "Come closer.", "Get over here already!", "Keep your eyes on the motor.")
+ var/static/list/flee_messages = list("Oh, NOW you flee.", "Get back here!", "If you were smarter, you'd come back.", "Only fools run.", "You'll be back.")
+ var/static/list/turnoff_messages = list("Why would they turn it-", "What are these idi-", "Fools, fools, all of-", "Are they trying to c-", "All this effort just f-")
+ var/static/list/powerloss_messages = list("\"Oh, the id**ts di***t s***e en**** pow**...\"", "\"D*dn't **ey mak* an **te***c*i*n le**?\"", "\"The** f**ls for**t t* make a ***** *f-\"", \
+ "\"No, *O, you **re so cl***-\"", "You hear a yell of frustration, cut off by static.")
+
+/datum/status_effect/maniamotor/Destroy()
+ motor = null
+ return ..()
+
+/datum/status_effect/maniamotor/tick()
+ var/is_servant = is_servant_of_ratvar(owner)
+ var/span_part = severity > 50 ? "" : "_small" //let's save like one check
+ if(QDELETED(motor))
+ if(!is_servant)
+ to_chat(owner, "You feel a frustrated voice quietly fade from your mind...")
+ qdel(src)
+ return
+ if(!motor.active) //it being off makes it fall off much faster
+ if(!is_servant && !warned_turnoff)
+ if(motor.total_accessable_power() > motor.mania_cost)
+ to_chat(owner, "\"[text2ratvar(pick(turnoff_messages))]\"")
+ else
+ to_chat(owner, "[text2ratvar(pick(powerloss_messages))]")
+ warned_turnoff = TRUE
+ severity = max(severity - 2, 0)
+ if(!severity)
+ qdel(src)
+ return
+ else
+ if(prob(severity * 2))
+ warned_turnoff = FALSE
+ if(!(owner in viewers(7, motor))) //not being in range makes it fall off slightly faster
+ if(!is_servant && !warned_outofsight)
+ to_chat(owner, "\"[text2ratvar(pick(flee_messages))]\"")
+ warned_outofsight = TRUE
+ severity = max(severity - 1, 0)
+ if(!severity)
+ qdel(src)
+ return
+ else if(prob(severity * 2))
+ warned_outofsight = FALSE
+ if(is_servant) //heals servants of braindamage, hallucination, druggy, dizziness, and confusion
+ if(owner.hallucination)
+ owner.hallucination = 0
+ if(owner.druggy)
+ owner.adjust_drugginess(-owner.druggy)
+ if(owner.dizziness)
+ owner.dizziness = 0
+ if(owner.confused)
+ owner.confused = 0
+ severity = 0
+ else if(!owner.null_rod_check() && owner.stat != DEAD && severity)
+ var/static/hum = get_sfx('sound/effects/screech.ogg') //same sound for every proc call
+ if(owner.getToxLoss() > MANIA_DAMAGE_TO_CONVERT)
+ if(is_eligible_servant(owner))
+ to_chat(owner, "\"[text2ratvar("You are mine and his, now.")]\"")
+ add_servant_of_ratvar(owner)
+ owner.Paralyse(5)
+ else
+ if(prob(severity * 0.15))
+ to_chat(owner, "\"[text2ratvar(pick(mania_messages))]\"")
+ owner.playsound_local(get_turf(motor), hum, severity, 1)
+ owner.adjust_drugginess(Clamp(max(severity * 0.075, 1), 0, max(0, 50 - owner.druggy))) //7.5% of severity per second, minimum 1
+ if(owner.hallucination < 50)
+ owner.hallucination = min(owner.hallucination + max(severity * 0.075, 1), 50) //7.5% of severity per second, minimum 1
+ if(owner.dizziness < 50)
+ owner.dizziness = min(owner.dizziness + round(severity * 0.05, 1), 50) //5% of severity per second above 10 severity
+ if(owner.confused < 25)
+ owner.confused = min(owner.confused + round(severity * 0.025, 1), 25) //2.5% of severity per second above 20 severity
+ owner.adjustToxLoss(severity * 0.02, TRUE, TRUE) //2% of severity per second
+ severity--
diff --git a/code/datums/status_effects/debuffs.dm.rej b/code/datums/status_effects/debuffs.dm.rej
new file mode 100644
index 0000000000..c70c0c6eec
--- /dev/null
+++ b/code/datums/status_effects/debuffs.dm.rej
@@ -0,0 +1,75 @@
+diff a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm (rejected hunks)
+@@ -108,20 +108,6 @@
+ to_chat(owner, "You feel a frustrated voice quietly fade from your mind...")
+ qdel(src)
+ return
+- if(!(owner in viewers(7, motor))) //not being in range makes it fall off much faster
+- if(!is_servant && !warned_outofsight)
+- to_chat(owner, "\"[text2ratvar(pick(flee_messages))]\"")
+- warned_outofsight = TRUE
+- if(severity)
+- severity--
+- if(!severity)
+- qdel(src)
+- return
+- else
+- qdel(src)
+- return
+- else if(prob(severity * 2))
+- warned_outofsight = FALSE
+ if(!motor.active) //it being off makes it fall off much faster
+ if(!is_servant && !warned_turnoff)
+ if(motor.total_accessable_power() > motor.mania_cost)
+@@ -129,20 +115,24 @@
+ else
+ to_chat(owner, "[text2ratvar(pick(powerloss_messages))]")
+ warned_turnoff = TRUE
+- if(severity)
+- severity--
++ severity = max(severity - 2, 0)
++ if(!severity)
++ qdel(src)
++ return
++ else
++ if(prob(severity * 2))
++ warned_turnoff = FALSE
++ if(!(owner in viewers(7, motor))) //not being in range makes it fall off slightly faster
++ if(!is_servant && !warned_outofsight)
++ to_chat(owner, "\"[text2ratvar(pick(flee_messages))]\"")
++ warned_outofsight = TRUE
++ severity = max(severity - 1, 0)
+ if(!severity)
+ qdel(src)
+ return
+- else
+- qdel(src)
+- return
+- else if(prob(severity * 2))
+- warned_turnoff = FALSE
++ else if(prob(severity * 2))
++ warned_outofsight = FALSE
+ if(is_servant) //heals servants of braindamage, hallucination, druggy, dizziness, and confusion
+- var/brainloss = owner.getBrainLoss()
+- if(brainloss)
+- owner.adjustBrainLoss(-brainloss)
+ if(owner.hallucination)
+ owner.hallucination = 0
+ if(owner.druggy)
+@@ -163,14 +153,12 @@
+ if(prob(severity * 0.15))
+ to_chat(owner, "\"[text2ratvar(pick(mania_messages))]\"")
+ owner.playsound_local(get_turf(motor), hum, severity, 1)
+- if(owner.getBrainLoss() <= 50)
+- owner.adjustBrainLoss(severity * 0.025) //2.5% of severity per second
+ owner.adjust_drugginess(Clamp(max(severity * 0.075, 1), 0, max(0, 50 - owner.druggy))) //7.5% of severity per second, minimum 1
+ if(owner.hallucination < 50)
+ owner.hallucination = min(owner.hallucination + max(severity * 0.075, 1), 50) //7.5% of severity per second, minimum 1
+- if(owner.dizziness < 25)
+- owner.dizziness = min(owner.dizziness + Floor(severity * 0.025), 25) //2.5% of severity per second above 20 severity
++ if(owner.dizziness < 50)
++ owner.dizziness = min(owner.dizziness + round(severity * 0.05, 1), 50) //5% of severity per second above 10 severity
+ if(owner.confused < 25)
+- owner.confused = min(owner.confused + Floor(severity * 0.025), 25) //2.5% of severity per second above 20 severity
++ owner.confused = min(owner.confused + round(severity * 0.025, 1), 25) //2.5% of severity per second above 20 severity
+ owner.adjustToxLoss(severity * 0.02, TRUE, TRUE) //2% of severity per second
+ severity--
diff --git a/code/datums/status_effects/status_effect.dm b/code/datums/status_effects/status_effect.dm
index 10dbd1a602..61c8607975 100644
--- a/code/datums/status_effects/status_effect.dm
+++ b/code/datums/status_effects/status_effect.dm
@@ -106,3 +106,11 @@
for(var/datum/status_effect/S in status_effects)
if(initial(S1.id) == S.id)
return S
+
+/mob/living/proc/has_status_effect_list(effect) //returns a list of effects with matching IDs that the mod owns; use for effects there can be multiple of
+ . = list()
+ if(status_effects)
+ var/datum/status_effect/S1 = effect
+ for(var/datum/status_effect/S in status_effects)
+ if(initial(S1.id) == S.id)
+ . += S
diff --git a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_applications.dm b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_applications.dm
index c1b5c0cfff..aa1a07ac2f 100644
--- a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_applications.dm
+++ b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_applications.dm
@@ -218,22 +218,22 @@
/datum/clockwork_scripture/create_object/mania_motor
descname = "Powered Structure, Area Denial"
name = "Mania Motor"
- desc = "Creates a mania motor which will cause brain damage and hallucinations in nearby non-Servant humans. It will also try to convert humans directly adjecent to the motor."
+ desc = "Creates a mania motor which causes minor damage and a variety of negative mental effects in nearby non-Servant humans, potentially up to and including conversion."
invocations = list("May this transmitter...", "...break the will of all who oppose us!")
channel_time = 80
consumed_components = list(GEIS_CAPACITOR = 5, REPLICANT_ALLOY = 2, HIEROPHANT_ANSIBLE = 2)
object_path = /obj/structure/destructible/clockwork/powered/mania_motor
- creator_message = "You form a mania motor which will cause brain damage and hallucinations in nearby humans while active."
+ creator_message = "You form a mania motor, which causes minor damage and negative mental effects in non-Servants."
observer_message = "A two-pronged machine rises from the ground!"
invokers_required = 2
multiple_invokers_used = TRUE
- usage_tip = "Eligible non-Servant humans next to the motor will be converted at an additional power cost. It will also cure hallucinations and brain damage in nearby Servants."
+ usage_tip = "It will also cure hallucinations and brain damage in nearby Servants."
tier = SCRIPTURE_APPLICATION
one_per_tile = TRUE
primary_component = GEIS_CAPACITOR
sort_priority = 8
quickbind = TRUE
- quickbind_desc = "Creates a Mania Motor, which can convert adjacent non-Servants with power."
+ quickbind_desc = "Creates a Mania Motor, which causes minor damage and negative mental effects in non-Servants."
//Tinkerer's Daemon: Creates an efficient machine that rapidly produces components at a power cost.
diff --git a/code/game/gamemodes/clock_cult/clock_structures/mania_motor.dm b/code/game/gamemodes/clock_cult/clock_structures/mania_motor.dm
index 09372044a9..dd26b5d404 100644
--- a/code/game/gamemodes/clock_cult/clock_structures/mania_motor.dm
+++ b/code/game/gamemodes/clock_cult/clock_structures/mania_motor.dm
@@ -1,8 +1,8 @@
-//Mania Motor: A pair of antenna that, while active, cause braindamage and hallucinations in nearby human mobs.
+//Mania Motor: A pair of antenna that, while active, cause a variety of negative mental effects in nearby human mobs.
/obj/structure/destructible/clockwork/powered/mania_motor
name = "mania motor"
desc = "A pair of antenna with what appear to be sockets around the base. It reminds you of an antlion."
- clockwork_desc = "A transmitter that allows Sevtug to whisper into the minds of nearby non-servants, causing hallucinations and brain damage as long as it remains powered."
+ clockwork_desc = "A transmitter that allows Sevtug to whisper into the minds of nearby non-servants, causing a variety of negative mental effects, up to and including conversion."
icon_state = "mania_motor_inactive"
active_icon = "mania_motor"
inactive_icon = "mania_motor_inactive"
@@ -16,22 +16,11 @@
/obj/item/clockwork/alloy_shards/small = 2, \
/obj/item/clockwork/component/geis_capacitor/antennae = 1)
var/mania_cost = 150
- var/convert_cost = 150
- var/static/list/mania_messages = list("Go nuts.", "Take a crack at crazy.", "Make a bid for insanity.", "Get kooky.", "Move towards mania.", "Become bewildered.", "Wax wild.", \
- "Go round the bend.", "Land in lunacy.", "Try dementia.", "Strive to get a screw loose.")
- var/static/list/compel_messages = list("Come closer.", "Approach the transmitter.", "Touch the antennae.", "I always have to deal with idiots. Move towards the mania motor.", \
- "Advance forward and place your head between the antennae - that's all it's good for.", "If you were smarter, you'd be over here already.", "Move FORWARD, you fool.")
- var/static/list/convert_messages = list("You won't do. Go to sleep while I tell these nitwits how to convert you.", "You are insufficient. I must instruct these idiots in the art of conversion.", \
- "Oh of course, someone we can't convert. These servants are fools.", "How hard is it to use a Sigil, anyway? All it takes is dragging someone onto it.", \
- "How do they fail to use a Sigil of Accession, anyway?", "Why is it that all servants are this inept?", "It's quite likely you'll be stuck here for a while.")
- var/static/list/close_messages = list("Well, you can't reach the motor from THERE, you moron.", "Interesting location. I'd prefer if you went somewhere you could ACTUALLY TOUCH THE ANTENNAE!", \
- "Amazing. You somehow managed to wedge yourself somewhere you can't actually reach the motor from.", "Such a show of idiocy is unparalleled. Perhaps I should put you on display?", \
- "Did you do this on purpose? I can't imagine you doing so accidentally. Oh, wait, I can.", "How is it that such smart creatures can still do something AS STUPID AS THIS!")
/obj/structure/destructible/clockwork/powered/mania_motor/examine(mob/user)
..()
if(is_servant_of_ratvar(user) || isobserver(user))
- to_chat(user, "It requires [mania_cost]W to run, and at least [convert_cost]W to attempt to convert humans adjacent to it.")
+ to_chat(user, "It requires [mania_cost]W to run.")
/obj/structure/destructible/clockwork/powered/mania_motor/forced_disable(bad_effects)
if(active)
@@ -60,82 +49,17 @@
if(!try_use_power(mania_cost))
forced_disable(FALSE)
return
- var/turf/T = get_turf(src)
- var/hum = get_sfx('sound/effects/screech.ogg') //like playsound, same sound for everyone affected
var/efficiency = get_efficiency_mod()
for(var/mob/living/carbon/human/H in viewers(7, src))
- if(is_servant_of_ratvar(H)) //heals servants of braindamage, hallucination, druggy, dizziness, and confusion
- var/brainloss = H.getBrainLoss()
- if(brainloss)
- H.adjustBrainLoss(-brainloss)
- if(H.hallucination)
- H.hallucination = 0
- if(H.druggy)
- H.adjust_drugginess(-H.druggy)
- if(H.dizziness)
- H.dizziness = 0
- if(H.confused)
- H.confused = 0
- else if(!H.null_rod_check() && H.stat != DEAD)
- var/distance = 0 + get_dist(T, get_turf(H))
- var/falloff_distance = min((110) - distance * 10, 80)
- var/sound_distance = falloff_distance * 0.5
- var/targetbrainloss = H.getBrainLoss()
- if(distance > 3 && prob(falloff_distance * 0.5))
- to_chat(H, "\"[text2ratvar(pick(mania_messages))]\"")
- if(distance <= 1)
- if(!H.Adjacent(src))
- to_chat(H, "\"[text2ratvar(pick(close_messages))]\"")
- H.playsound_local(T, hum, sound_distance, 1)
- else if(!try_use_power(convert_cost))
- visible_message("[src]'s antennae fizzle quietly.")
- playsound(src, 'sound/effects/light_flicker.ogg', 50, 1)
- else
- H.playsound_local(T, hum, 80, 1)
- if(!H.stat)
- if(H.getBrainLoss() < 100)
- H.adjustBrainLoss(20 * efficiency)
- H.visible_message("[H] reaches out and touches [src].", "You touch [src] involuntarily.")
- else
- H.Paralyse(3)
- else if(is_eligible_servant(H))
- to_chat(H, "\"[text2ratvar("You are mine and his, now.")]\"")
- add_servant_of_ratvar(H)
- H.Paralyse(5)
- else
- H.playsound_local(T, hum, sound_distance, 1)
- switch(distance)
- if(0 to 3)
- if(prob(falloff_distance * 0.5))
- if(prob(falloff_distance))
- to_chat(H, "\"[text2ratvar(pick(mania_messages))]\"")
- else
- to_chat(H, "\"[text2ratvar(pick(compel_messages))]\"")
- if(targetbrainloss <= 40)
- H.adjustBrainLoss(3 * efficiency)
- H.adjust_drugginess(Clamp(7 * efficiency, 0, 50 - H.druggy))
- H.hallucination = min(H.hallucination + (7 * efficiency), 50)
- H.dizziness = min(H.dizziness + (3 * efficiency), 20)
- H.confused = min(H.confused + (3 * efficiency), 20)
- if(3 to 5)
- if(targetbrainloss <= 20)
- H.adjustBrainLoss(2 * efficiency)
- H.adjust_drugginess(Clamp(5 * efficiency, 0, 25 - H.druggy))
- H.hallucination = min(H.hallucination + (5 * efficiency), 25)
- H.dizziness = min(H.dizziness + (2 * efficiency), 10)
- H.confused = min(H.confused + (2 * efficiency), 10)
- if(5 to 6)
- if(targetbrainloss <= 10)
- H.adjustBrainLoss(1 * efficiency)
- H.adjust_drugginess(Clamp(2 * efficiency, 0, 20 - H.druggy))
- H.hallucination = min(H.hallucination + (2 * efficiency), 20)
- H.dizziness = min(H.dizziness + (2 * efficiency), 5)
- H.confused = min(H.confused + (2 * efficiency), 5)
- if(6 to 7)
- if(targetbrainloss <= 5)
- H.adjustBrainLoss(1 * efficiency)
- H.adjust_drugginess(Clamp(2 * efficiency, 0, 10 - H.druggy))
- H.hallucination = min(H.hallucination + (2 * efficiency), 10)
- if(7 to INFINITY)
- H.adjust_drugginess(Clamp(2 * efficiency, 0, 5 - H.druggy))
- H.hallucination = min(H.hallucination + (2 * efficiency), 5)
+ if(is_servant_of_ratvar(H))
+ continue
+ var/list/effects = H.has_status_effect_list(STATUS_EFFECT_MANIAMOTOR)
+ var/datum/status_effect/maniamotor/M
+ for(var/datum/status_effect/maniamotor/MM in effects)
+ if(MM.motor == src)
+ M = MM
+ break
+ if(!M)
+ M = H.apply_status_effect(STATUS_EFFECT_MANIAMOTOR)
+ M.motor = src
+ M.severity = Clamp(M.severity + ((11 - get_dist(src, H)) * efficiency * efficiency), 0, MAX_MANIA_SEVERITY)