Skip to content

Commit

Permalink
Zasstopscreamingplease (#809)
Browse files Browse the repository at this point in the history
* fix fire zones

* it didnt call update health, im in shambles

* oops
  • Loading branch information
Kapu1178 authored Feb 12, 2024
1 parent 4a08344 commit cb4e21c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
3 changes: 3 additions & 0 deletions code/controllers/subsystem/zas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ SUBSYSTEM_DEF(zas)
zones -= z
zones_to_update -= z
zones_with_sensitive_contents -= z
active_fire_zones -= z
if(processing_fires)
processing_fires -= z
if (processing_zones)
processing_zones -= z

Expand Down
22 changes: 15 additions & 7 deletions code/datums/status_effects/debuffs/fire_stacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
var/turf/location = get_turf(owner)
location.hotspot_expose(700, 25 * delta_time, TRUE)

#define BODYTEMP_FIRE_TEMP_SOFTCAP 1200
/**
* Used to deal damage to humans and count their protection.
*
Expand All @@ -206,21 +207,26 @@
* - no_protection: When set to TRUE, fire will ignore any possible fire protection
*
*/

/datum/status_effect/fire_handler/fire_stacks/proc/harm_human(delta_time, times_fired, no_protection = FALSE)
var/mob/living/carbon/human/victim = owner
var/thermal_protection = victim.get_thermal_protection()

if(thermal_protection >= FIRE_IMMUNITY_MAX_TEMP_PROTECT && !no_protection)
return
if(!no_protection)
if(thermal_protection >= FIRE_IMMUNITY_MAX_TEMP_PROTECT)
return
if(thermal_protection >= FIRE_SUIT_MAX_TEMP_PROTECT)
victim.adjust_bodytemperature(5.5 * delta_time)
return

if(thermal_protection >= FIRE_SUIT_MAX_TEMP_PROTECT && !no_protection)
victim.adjust_bodytemperature(5.5 * delta_time)
return
var/amount_to_heat = (BODYTEMP_HEATING_MAX + (stacks * 12)) * 0.5 * delta_time
if(owner.bodytemperature > BODYTEMP_FIRE_TEMP_SOFTCAP)
// Apply dimishing returns upon temp beyond the soft cap
amount_to_heat = amount_to_heat ** (BODYTEMP_FIRE_TEMP_SOFTCAP / owner.bodytemperature)

victim.adjust_bodytemperature((BODYTEMP_HEATING_MAX + (stacks * 12)) * 0.5 * delta_time)
victim.adjust_bodytemperature(amount_to_heat)
victim.mind?.add_memory(MEMORY_FIRE, list(DETAIL_PROTAGONIST = victim), story_value = STORY_VALUE_OKAY)

#undef BODYTEMP_FIRE_TEMP_SOFTCAP
/**
* Handles mob ignition, should be the only way to set on_fire to TRUE
*
Expand All @@ -236,6 +242,8 @@
on_fire = TRUE
if(!silent)
owner.visible_message(span_warning("[owner] catches fire!"), span_userdanger("You're set on fire!"))
spawn(-1)
owner.emote("scream")

if(firelight_type)
firelight_ref = WEAKREF(new firelight_type(owner))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/atmospherics/ZAS/Zone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Class Procs:
invalid = 1
SSzas.remove_zone(src)
atmos_sensitive_contents = null
fire_tiles = null
fire_tiles.Cut()
fuel_objs = null
#ifdef ZASDBG
for(var/turf/T as anything in contents)
Expand Down
3 changes: 2 additions & 1 deletion code/modules/mob/living/carbon/human/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1536,10 +1536,11 @@ GLOBAL_LIST_EMPTY(features_by_species)

// 40% for level 3 damage on humans to scream in pain
if (humi.stat < UNCONSCIOUS && (prob(burn_damage) * 10) / 4)
humi.emote("scream")
humi.pain_emote(1000, TRUE) //AGONY!!!!

// Apply the damage to all body parts
humi.adjustFireLoss(burn_damage, FALSE)
. = TRUE

if(humi.coretemperature < cold_level_1 && !HAS_TRAIT(humi, TRAIT_RESISTCOLD) && !CHEM_EFFECT_MAGNITUDE(humi, CE_CRYO))
var/damage_mod = coldmod * humi.physiology.cold_mod
Expand Down

0 comments on commit cb4e21c

Please sign in to comment.