From 3042cfde668ec85df2f85265eb33abcc34bdcc86 Mon Sep 17 00:00:00 2001 From: Coolrune206 <71326864+Coolrune206@users.noreply.github.com> Date: Thu, 29 Dec 2022 05:02:17 +1000 Subject: [PATCH] Removes RnG from the Ablative Trenchcoat and Armor (#19958) * removes RnG from the Ablative Trenchcoat and Armor * Snowball suggestion * don't ever let anyone tell you I'm smart * Charlie Requests * HAHA I AM SMART * Hal8999 Review * merge conflicts, who knows how they work? I don't --- code/modules/clothing/suits/armor.dm | 11 +++++++++-- code/modules/clothing/suits/miscellaneous.dm | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index d8626b71505..1478e394665 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -315,12 +315,19 @@ item_state = "armor_reflec" blood_overlay_type = "armor" armor = list(MELEE = 5, BULLET = 5, LASER = 75, ENERGY = 50, BOMB = 0, BIO = 0, RAD = 0, FIRE = INFINITY, ACID = INFINITY) - var/hit_reflect_chance = 40 + var/last_reflect_time + var/reflect_cooldown = 5 SECONDS /obj/item/clothing/suit/armor/laserproof/IsReflect() var/mob/living/carbon/human/user = loc - if(prob(hit_reflect_chance) && (user.wear_suit == src)) + if(user.wear_suit != src) + return 0 + if(world.time - last_reflect_time >= reflect_cooldown) + last_reflect_time = world.time return 1 + if(world.time - last_reflect_time <= 1) // This is so if multiple energy projectiles hit at once, they're all reflected + return 1 + return 0 /obj/item/clothing/suit/armor/vest/det_suit name = "armor" diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index a2822e0c316..1d7816250b9 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -535,12 +535,19 @@ put_on_delay = 4 SECONDS sprite_sheets = list("Vox" = 'icons/mob/clothing/species/vox/suit.dmi', "Grey" = 'icons/mob/clothing/species/grey/suit.dmi') - var/hit_reflect_chance = 50 + var/last_reflect_time + var/reflect_cooldown = 4 SECONDS /obj/item/clothing/suit/hooded/ablative/IsReflect() var/mob/living/carbon/human/user = loc - if(prob(hit_reflect_chance) && (user.wear_suit == src)) + if(user.wear_suit != src) + return 0 + if(world.time - last_reflect_time >= reflect_cooldown) + last_reflect_time = world.time return 1 + if(world.time - last_reflect_time <= 1) // This is so if multiple energy projectiles hit at once, they're all reflected + return 1 + return 0 /* * Misc