From b7da743e7dca0ed0b8f96b02e184d8aed230526a Mon Sep 17 00:00:00 2001 From: Jacquerel Date: Sun, 26 Feb 2023 22:41:43 +0000 Subject: [PATCH] [no GBP] Corrects the speed at which spiders stop being on fire (#73601) ## About The Pull Request As noted in #73584 spiders stopped being on fire faster when they were simple mobs than they do now, and I have restored this behaviour. While I was there I noticed that spiders were the only simple mobs which could catch fire so I just remove that behaviour. I also changed the boolean "flammable" into a flag, not sure if that's actually better but maybe it is? I tried a little to see if I could make this into a component but there's basically no way as all of this behaviour is inside a status effect. ## Why It's Good For The Game Restores original behaviour. Maybe in the future I'll (or someone else will) use this to make some other basic mobs able to be set on fire, no obvious reason they shouldn't be able to be. ## Changelog :cl: fix: Spiders will stop being on fire marginally faster, as they used to. /:cl: --- code/__DEFINES/basic_mobs.dm | 2 +- .../status_effects/debuffs/fire_stacks.dm | 16 ++-------- code/modules/mob/living/basic/basic.dm | 4 +-- .../space_fauna/giant_spider/giant_spider.dm | 2 +- code/modules/mob/living/living_defines.dm | 3 ++ code/modules/mob/living/silicon/silicon.dm | 1 + .../mob/living/simple_animal/simple_animal.dm | 29 ------------------- 7 files changed, 9 insertions(+), 48 deletions(-) diff --git a/code/__DEFINES/basic_mobs.dm b/code/__DEFINES/basic_mobs.dm index 00d84c7b56e..8c544adb459 100644 --- a/code/__DEFINES/basic_mobs.dm +++ b/code/__DEFINES/basic_mobs.dm @@ -4,4 +4,4 @@ #define DEL_ON_DEATH (1<<0) #define FLIP_ON_DEATH (1<<1) #define REMAIN_DENSE_WHILE_DEAD (1<<2) - +#define FLAMMABLE_MOB (1<<3) diff --git a/code/datums/status_effects/debuffs/fire_stacks.dm b/code/datums/status_effects/debuffs/fire_stacks.dm index 6951ae2c4d8..d8dde3e9a0f 100644 --- a/code/datums/status_effects/debuffs/fire_stacks.dm +++ b/code/datums/status_effects/debuffs/fire_stacks.dm @@ -28,13 +28,7 @@ if(isbasicmob(owner)) var/mob/living/basic/basic_owner = owner - if(!basic_owner.flammable) - qdel(src) - return - - if(isanimal(owner)) - var/mob/living/simple_animal/animal_owner = owner - if(!animal_owner.flammable) + if(!(basic_owner.basic_mob_flags & FLAMMABLE_MOB)) qdel(src) return @@ -150,13 +144,7 @@ if(!on_fire) return TRUE - if(isanimal(owner)) - var/mob/living/simple_animal/animal_owner = owner - adjust_stacks(animal_owner.fire_stack_removal_speed * delta_time) - else if(iscyborg(owner)) - adjust_stacks(-0.55 * delta_time) - else - adjust_stacks(-0.05 * delta_time) + adjust_stacks(owner.fire_stack_decay_rate * delta_time) if(stacks <= 0) qdel(src) diff --git a/code/modules/mob/living/basic/basic.dm b/code/modules/mob/living/basic/basic.dm index d051a1dee7e..6fbde7470c3 100644 --- a/code/modules/mob/living/basic/basic.dm +++ b/code/modules/mob/living/basic/basic.dm @@ -7,6 +7,7 @@ gender = PLURAL living_flags = MOVES_ON_ITS_OWN status_flags = CANPUSH + fire_stack_decay_rate = -5 // Reasonably fast as NPCs will not usually actively extinguish themselves var/basic_mob_flags = NONE @@ -97,9 +98,6 @@ ///This damage is taken when the body temp is too hot. Set both this and unsuitable_cold_damage to 0 to avoid adding the basic_body_temp_sensitive element. var/unsuitable_heat_damage = 1 - ///Whether or not this mob can catch on fire - var/flammable = FALSE - /mob/living/basic/Initialize(mapload) . = ..() diff --git a/code/modules/mob/living/basic/space_fauna/giant_spider/giant_spider.dm b/code/modules/mob/living/basic/space_fauna/giant_spider/giant_spider.dm index cbbbb192023..2108bc77465 100644 --- a/code/modules/mob/living/basic/space_fauna/giant_spider/giant_spider.dm +++ b/code/modules/mob/living/basic/space_fauna/giant_spider/giant_spider.dm @@ -23,6 +23,7 @@ maxHealth = 80 health = 80 damage_coeff = list(BRUTE = 1, BURN = 1.25, TOX = 1, CLONE = 1, STAMINA = 1, OXY = 1) + basic_mob_flags = FLAMMABLE_MOB status_flags = NONE unsuitable_cold_damage = 4 unsuitable_heat_damage = 4 @@ -42,7 +43,6 @@ lighting_cutoff_red = 22 lighting_cutoff_green = 5 lighting_cutoff_blue = 5 - flammable = TRUE ai_controller = /datum/ai_controller/basic_controller/giant_spider /// Speed modifier to apply if controlled by a human player var/player_speed_modifier = -4 diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 67f652090f1..5284087aeb2 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -33,6 +33,9 @@ ///Damage caused by being cloned or ejected from the cloner early. slimes also deal cloneloss damage to victims var/cloneloss = 0 + /// Rate at which fire stacks should decay from this mob + var/fire_stack_decay_rate = -0.05 + /// when the mob goes from "normal" to crit var/crit_threshold = HEALTH_THRESHOLD_CRIT ///When the mob enters hard critical state and is fully incapacitated. diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 7844f8c31da..dbe8f85e218 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -12,6 +12,7 @@ speech_span = SPAN_ROBOT flags_1 = PREVENT_CONTENTS_EXPLOSION_1 examine_cursor_icon = null + fire_stack_decay_rate = -0.55 var/datum/ai_laws/laws = null//Now... THEY ALL CAN ALL HAVE LAWS var/last_lawchange_announce = 0 var/list/alarms_to_show = list() diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index ad7c164a5fd..10dabd378eb 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -79,10 +79,6 @@ ///This damage is taken when atmos doesn't fit all the requirements above. var/unsuitable_atmos_damage = 1 - ///Whether or not this mob is flammable - var/flammable = FALSE - ///How quickly should fire stacks on this mob diminish? - var/fire_stack_removal_speed = -5 ///How fast the mob's temperature normalizes. The greater the value, the slower their temperature normalizes. Should always be greater than 0. var/temperature_normalization_speed = 5 @@ -487,31 +483,6 @@ return FALSE return TRUE -/mob/living/simple_animal/ignite_mob(silent) - if(!flammable) - return FALSE - return ..() - -/mob/living/simple_animal/on_fire_stack(delta_time, times_fired, datum/status_effect/fire_handler/fire_stacks/fire_handler) - adjust_bodytemperature((maxbodytemp + (fire_handler.stacks * 12)) * 0.5 * delta_time) - -/mob/living/simple_animal/update_fire_overlay(stacks, on_fire, last_icon_state, suffix = "") - var/mutable_appearance/fire_overlay = mutable_appearance('icons/mob/effects/onfire.dmi', "generic_fire") - if(on_fire && isnull(last_icon_state)) - add_overlay(fire_overlay) - return fire_overlay - else if(!on_fire && !isnull(last_icon_state)) - cut_overlay(fire_overlay) - return null - else if(on_fire && !isnull(last_icon_state)) - return last_icon_state - return null - -/mob/living/simple_animal/extinguish_mob() - if(!flammable) - return - return ..() - /mob/living/simple_animal/revive(full_heal_flags = NONE, excess_healing = 0, force_grab_ghost = FALSE) . = ..() if(!.)