From f7c76befff2432f41bc2c9b7726cb0f59b053b1e Mon Sep 17 00:00:00 2001 From: FalseIncarnate Date: Tue, 25 Apr 2017 23:55:40 -0400 Subject: [PATCH] Variable rename and operator change Changes the variable name to avoid confusion, and changes the math to use the *= operator. Also does the same for the spacevines, for consistency. --- code/game/objects/effects/glowshroom.dm | 8 ++++---- code/modules/events/spacevine.dm | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/code/game/objects/effects/glowshroom.dm b/code/game/objects/effects/glowshroom.dm index 25ca97fcfa9..f641cb26c32 100644 --- a/code/game/objects/effects/glowshroom.dm +++ b/code/game/objects/effects/glowshroom.dm @@ -153,17 +153,17 @@ /obj/structure/glowshroom/attackby(obj/item/I, mob/user) ..() - var/force = I.force + var/damage_to_do = I.force if(istype(I, /obj/item/weapon/scythe)) var/obj/item/weapon/scythe/S = I if(S.extend) //so folded telescythes won't get damage boosts / insta-clears (they instead will instead be treated like non-scythes) - force = force * 4 + damage_to_do *= 4 for(var/obj/structure/glowshroom/G in range(1,src)) - G.endurance -= force + G.endurance -= damage_to_do G.CheckEndurance() return if(I.damtype != STAMINA) - endurance -= force + endurance -= damage_to_do CheckEndurance() /obj/structure/glowshroom/ex_act(severity) diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index 9008edcec70..f0408a9bdc0 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -485,29 +485,29 @@ if (!W || !user || !W.type) return user.changeNext_move(CLICK_CD_MELEE) - var/force = W.force + var/damage_to_do = W.force if(istype(W, /obj/item/weapon/scythe)) var/obj/item/weapon/scythe/S = W if(S.extend) //so folded telescythes won't get damage boosts / insta-clears (they instead will instead be treated like non-scythes) - force = force * 4 + damage_to_do *= 4 for(var/obj/structure/spacevine/B in range(1,src)) - if(B.health > force) //this only is going to occur for woodening mutation vines (increased health) or if we nerf scythe damage/multiplier - B.health -= force + if(B.health > damage_to_do) //this only is going to occur for woodening mutation vines (increased health) or if we nerf scythe damage/multiplier + B.health -= damage_to_do else B.wither() return if(is_sharp(W)) - force = force * 4 + damage_to_do *= 4 if(W && W.damtype == "fire") - force = force * 4 + damage_to_do *= 4 for(var/datum/spacevine_mutation/SM in mutations) - force = SM.on_hit(src, user, W, force) //on_hit now takes override damage as arg and returns new value for other mutations to permutate further + damage_to_do = SM.on_hit(src, user, W, damage_to_do) //on_hit now takes override damage as arg and returns new value for other mutations to permutate further - health -= force + health -= damage_to_do if(health < 1) wither()