From 1ae84f79f2651916cfa1ef7583c2e859c4cb18a3 Mon Sep 17 00:00:00 2001 From: Dennis Date: Tue, 6 Apr 2021 14:58:36 +0200 Subject: [PATCH] Moved nullified to own proc and reduced stacking effect of nullrod/prayer beads (#15809) * Moved nullified to own proc and reduced stacking * Fixed minor error. --- code/game/gamemodes/vampire/vampire.dm | 4 ++++ code/game/objects/items/weapons/holy_weapons.dm | 6 +++--- code/modules/reagents/chemistry/reagents/water.dm | 10 +++++----- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/code/game/gamemodes/vampire/vampire.dm b/code/game/gamemodes/vampire/vampire.dm index 7d2f0e404f5..8a3628a1717 100644 --- a/code/game/gamemodes/vampire/vampire.dm +++ b/code/game/gamemodes/vampire/vampire.dm @@ -220,6 +220,10 @@ You are weak to holy things and starlight. Don't go into space and avoid the Cha /obj/effect/proc_holder/spell/vampire/targetted/enthrall = 300, /datum/vampire_passive/full = 500) +/datum/vampire/proc/adjust_nullification(base, extra) + // First hit should give full nullification, while subsequent hits increase the value slower + nullified = max(nullified + extra, base) + /datum/vampire/New(gend = FEMALE) gender = gend diff --git a/code/game/objects/items/weapons/holy_weapons.dm b/code/game/objects/items/weapons/holy_weapons.dm index 59880fdcc8c..a9cfbbbe36b 100644 --- a/code/game/objects/items/weapons/holy_weapons.dm +++ b/code/game/objects/items/weapons/holy_weapons.dm @@ -39,7 +39,7 @@ if(ishuman(M) && M.mind?.vampire) if(!M.mind.vampire.get_ability(/datum/vampire_passive/full)) to_chat(M, "The nullrod's power interferes with your own!") - M.mind.vampire.nullified = max(5, M.mind.vampire.nullified + 2) + M.mind.vampire.adjust_nullification(5, 2) /obj/item/nullrod/pickup(mob/living/user) . = ..() @@ -476,7 +476,7 @@ return if(target.mind.vampire && !target.mind.vampire.get_ability(/datum/vampire_passive/full)) // Getting a full prayer off on a vampire will interrupt their powers for a large duration. - target.mind.vampire.nullified = max(120, target.mind.vampire.nullified + 120) + target.mind.vampire.adjust_nullification(120, 50) to_chat(target, "[user]'s prayer to [SSticker.Bible_deity_name] has interfered with your power!") praying = FALSE return @@ -500,7 +500,7 @@ if(holder.l_hand == src || holder.r_hand == src) // Holding this in your hand will for(var/mob/living/carbon/human/H in range(5, loc)) if(H.mind && H.mind.vampire && !H.mind.vampire.get_ability(/datum/vampire_passive/full)) - H.mind.vampire.nullified = max(5, H.mind.vampire.nullified + 2) + H.mind.vampire.adjust_nullification(5, 2) if(prob(10)) to_chat(H, "Being in the presence of [holder]'s [src] is interfering with your powers!") diff --git a/code/modules/reagents/chemistry/reagents/water.dm b/code/modules/reagents/chemistry/reagents/water.dm index cb69f3b7b31..c51972b99c6 100644 --- a/code/modules/reagents/chemistry/reagents/water.dm +++ b/code/modules/reagents/chemistry/reagents/water.dm @@ -284,7 +284,7 @@ update_flags |= M.adjustStaminaLoss(5, FALSE) if(prob(20)) M.emote("scream") - M.mind.vampire.nullified = max(5, M.mind.vampire.nullified + 2) + M.mind.vampire.adjust_nullification(5, 2) M.mind.vampire.bloodusable = max(M.mind.vampire.bloodusable - 3,0) if(M.mind.vampire.bloodusable) V.vomit(0,1) @@ -296,7 +296,7 @@ switch(current_cycle) if(1 to 4) to_chat(M, "Something sizzles in your veins!") - M.mind.vampire.nullified = max(5, M.mind.vampire.nullified + 2) + M.mind.vampire.adjust_nullification(5, 2) if(5 to 12) to_chat(M, "You feel an intense burning inside of you!") update_flags |= M.adjustFireLoss(1, FALSE) @@ -304,7 +304,7 @@ M.Jitter(20) if(prob(20)) M.emote("scream") - M.mind.vampire.nullified = max(5, M.mind.vampire.nullified + 2) + M.mind.vampire.adjust_nullification(5, 2) if(13 to INFINITY) to_chat(M, "You suddenly ignite in a holy fire!") for(var/mob/O in viewers(M, null)) @@ -316,7 +316,7 @@ M.Jitter(30) if(prob(40)) M.emote("scream") - M.mind.vampire.nullified = max(5, M.mind.vampire.nullified + 2) + M.mind.vampire.adjust_nullification(5, 2) return ..() | update_flags @@ -333,7 +333,7 @@ return else to_chat(M, "Something holy interferes with your powers!") - M.mind.vampire.nullified = max(5, M.mind.vampire.nullified + 2) + M.mind.vampire.adjust_nullification(5, 2) /datum/reagent/holywater/reaction_turf(turf/simulated/T, volume)