Skip to content

Commit

Permalink
Fire_act consolidation (tgstation#15624)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lumipharon authored Apr 14, 2024
1 parent 9cabae5 commit 762dd9a
Show file tree
Hide file tree
Showing 53 changed files with 128 additions and 245 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,6 @@ GLOBAL_LIST_INIT(restricted_camera_networks, list( //Those networks can only be

//cameras
#define SOM_CAMERA_NETWORK "som_camera_network"

///Burn level applied by lava if it calls fire_act
#define LAVA_BURN_LEVEL 60
2 changes: 1 addition & 1 deletion code/datums/components/harvester.dm
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@

if(/datum/reagent/medicine/kelotane)
target.apply_damage(weapon.force*0.6, BRUTE, user.zone_selected)
target.flamer_fire_act(10)
target.fire_act(10)

if(/datum/reagent/medicine/tramadol)
target.apply_damage(weapon.force*0.6, BRUTE, user.zone_selected)
Expand Down
13 changes: 4 additions & 9 deletions code/game/atoms/_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -425,14 +425,15 @@ directive is properly returned.
contents_explosion(severity, epicenter_dist, impact_range)
SEND_SIGNAL(src, COMSIG_ATOM_EX_ACT, severity, epicenter_dist, impact_range)

/atom/proc/fire_act()
///Effects of fire
/atom/proc/fire_act(burn_level)
return

///Effects of lava. Return true where we want the lava to keep processing
/atom/proc/lava_act()
if(resistance_flags & INDESTRUCTIBLE)
return FALSE
fire_act()
fire_act(LAVA_BURN_LEVEL)
return TRUE

/atom/proc/hitby(atom/movable/AM, speed = 5)
Expand All @@ -457,13 +458,7 @@ directive is properly returned.
SEND_SIGNAL(src, COMSIG_CONTENTS_EX_ACT, severity)
return //For handling the effects of explosions on contents that would not normally be effected


///Fire effects from a burning turf. Burn level is the base fire damage being received.
/atom/proc/flamer_fire_act(burnlevel)
return


///This proc is called on the location of an atom when the atom is Destroy()'d
//This proc is called on the location of an atom when the atom is Destroy()'d
/atom/proc/handle_atom_del(atom/A)
SHOULD_CALL_PARENT(TRUE)
SEND_SIGNAL(src, COMSIG_ATOM_CONTENTS_DEL, A)
Expand Down
5 changes: 0 additions & 5 deletions code/game/objects/effects/acid_hole.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
holed_wall = null
return ..()


/obj/effect/acid_hole/fire_act()
return


/obj/effect/acid_hole/MouseDrop_T(mob/M, mob/user)
. = ..()
if(!holed_wall)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/effects/decals/Cleanable/fuel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
ignite_fuel(I)
log_attack("[key_name(user)] ignites [src] in fuel in [AREACOORD(user)]")

/obj/effect/decal/cleanable/liquid_fuel/flamer_fire_act(burnlevel)
/obj/effect/decal/cleanable/liquid_fuel/fire_act(burn_level)
. = ..()
ignite_fuel()

Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/effects/effect_system/foam.dm
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@

// foam disolves when heated
// except metal foams
/obj/effect/particle_effect/foam/fire_act(exposed_temperature, exposed_volume)
if(!(foam_flags & METAL_FOAM|RAZOR_FOAM) && prob(max(0, exposed_temperature - 475)))
/obj/effect/particle_effect/foam/fire_act(burn_level)
if(!(foam_flags & METAL_FOAM|RAZOR_FOAM) && prob(min(burn_level * 3, 100)))
kill_foam()

/obj/effect/particle_effect/foam/can_slip()
Expand Down Expand Up @@ -173,6 +173,6 @@
SMOOTH_GROUP_FOAM_WALL,
)

/obj/structure/foamedmetal/fire_act() //flamerwallhacks go BRRR
take_damage(10, BURN, FIRE)
/obj/structure/foamedmetal/fire_act(burn_level)
take_damage(burn_level, BURN, FIRE)

43 changes: 0 additions & 43 deletions code/game/objects/effects/effect_system/particle_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,6 @@
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
allow_pass_flags = PASS_LOW_STRUCTURE|PASS_GRILLE|PASS_MOB

//Fire
/obj/effect/particle_effect/fire //Fire that ignites mobs and deletes itself after some time, but doesn't mess with atmos. Good fire flamethrowers and incendiary stuff.
name = "fire"
icon = 'icons/effects/fire.dmi'
icon_state = "3"
var/life = 0.5 //In seconds
mouse_opacity = MOUSE_OPACITY_TRANSPARENT


/obj/effect/particle_effect/fire/Initialize(mapload, ...)
. = ..()

if(!isturf(loc))
return INITIALIZE_HINT_QDEL

QDEL_IN(src, life SECONDS)

var/static/list/connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_cross),
)
AddElement(/datum/element/connect_loc, connections)

setDir(pick(GLOB.cardinals))
set_light(1, 3)

for(var/mob/living/L in loc)//Mobs
L.fire_act()
for(var/obj/alien/weeds/W in loc)//Weeds
W.fire_act()
for(var/obj/alien/egg/E in loc)//Eggs
E.fire_act()
for(var/obj/structure/bed/nest/N in loc)//Nests
N.fire_act()
for(var/turf/open/floor/plating/ground/snow/S in loc)//Snow
S.fire_act()

/obj/effect/particle_effect/fire/proc/on_cross(datum/source, mob/living/L, oldloc, oldlocs)
SIGNAL_HANDLER
if(isliving(L))
L.fire_act()

//End fire

/obj/effect/particle_effect/water
name = "water"
icon = 'icons/effects/effects.dmi'
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/items/bodybag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@
balloon_alert(bodybag_occupant, "[proj] jolts you out of the bag")
open()

/obj/structure/closet/bodybag/flamer_fire_act(burnlevel)
/obj/structure/closet/bodybag/fire_act(burn_level)
if(!opened && bodybag_occupant)
balloon_alert(bodybag_occupant, "The fire forces you out")
bodybag_occupant.flamer_fire_act(burnlevel)
bodybag_occupant.fire_act(burn_level)
open()

/obj/structure/closet/bodybag/ex_act(severity)
Expand Down Expand Up @@ -334,7 +334,7 @@

/obj/structure/closet/bodybag/cryobag/examine(mob/living/user)
. = ..()
var/mob/living/carbon/human/occupant = bodybag_occupant
var/mob/living/carbon/human/occupant = bodybag_occupant
if(!ishuman(occupant))
return
if(!hasHUD(user,"medical"))
Expand All @@ -361,7 +361,7 @@
. += span_scanner("Patient have [timer] seconds left before DNR")
else
. += span_scanner("Patient have [timer] seconds left before DNR")


/obj/structure/closet/bodybag/cryobag/Topic(href, href_list)
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/explosives/grenades/flares.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
. = ..()
fuel = rand(lower_fuel_limit, upper_fuel_limit) // Sorry for changing this so much but I keep under-estimating how long X number of ticks last in seconds.

/obj/item/explosive/grenade/flare/flamer_fire_act(burnlevel)
/obj/item/explosive/grenade/flare/fire_act(burn_level)
if(!fuel) //it's out of fuel, an empty shell.
return
if(!active)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/explosives/grenades/grenade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
explosion(loc, light_impact_range = src.light_impact_range, weak_impact_range = src.weak_impact_range)
qdel(src)

/obj/item/explosive/grenade/flamer_fire_act(burnlevel)
/obj/item/explosive/grenade/fire_act(burn_level)
activate()

/obj/item/explosive/grenade/attack_hand(mob/living/user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
det_time = initial(det_time) //these can be modified when fired by UGL
throw_range = initial(throw_range)

/obj/item/explosive/grenade/training/flamer_fire_act(burnlevel)
/obj/item/explosive/grenade/training/fire_act(burn_level)
return
4 changes: 2 additions & 2 deletions code/game/objects/items/explosives/mine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Stepping directly on the mine will also blow it up
INVOKE_ASYNC(src, PROC_REF(trigger_explosion))

/// Flamer fire will cause mines to trigger their explosion
/obj/item/explosive/mine/flamer_fire_act(burnlevel)
/obj/item/explosive/mine/fire_act(burn_level)
. = ..()
INVOKE_ASYNC(src, PROC_REF(trigger_explosion))

Expand Down Expand Up @@ -273,5 +273,5 @@ Stepping directly on the mine will also blow it up
return
INVOKE_ASYNC(src, PROC_REF(trigger_explosion))

/obj/item/explosive/mine/anti_tank/flamer_fire_act(burnlevel)
/obj/item/explosive/mine/anti_tank/fire_act(burn_level)
return //its highly exploitable if fire detonates these
38 changes: 20 additions & 18 deletions code/game/objects/items/stacks/sheets/leather.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
desc = "This leather has been cleaned but still needs to be dried."
singular_name = "wet leather piece"
icon_state = "sheet-wetleather"
var/wetness = 30 //Reduced when exposed to high temperautres
var/drying_threshold_temperature = 500 //Kelvin to start drying
///How damp it is
var/wetness = 30

/obj/item/stack/sheet/leather
name = "leather"
Expand Down Expand Up @@ -109,20 +109,22 @@
//Step two - washing..... it's actually in washing machine code.

//Step three - drying
/obj/item/stack/sheet/wetleather/fire_act(exposed_temperature, exposed_volume)
..()
if(exposed_temperature >= drying_threshold_temperature)
wetness--
if(wetness == 0)
//Try locating an exisitng stack on the tile and add to there if possible
for(var/obj/item/stack/sheet/leather/HS in src.loc)
if(HS.amount < 50)
HS.amount++
src.use(1)
wetness = initial(wetness)
break
//If it gets to here it means it did not find a suitable stack on the tile.
var/obj/item/stack/sheet/leather/HS = new(src.loc)
HS.amount = 1
/obj/item/stack/sheet/wetleather/fire_act(burn_level)
. = ..()
if(!wetness)
return
wetness--
if(wetness < 0)
return
//Try locating an exisitng stack on the tile and add to there if possible
for(var/obj/item/stack/sheet/leather/leather in loc)
if(leather.amount < 50)
leather.amount++
use(1)
wetness = initial(wetness)
src.use(1)
break
//If it gets to here it means it did not find a suitable stack on the tile.
var/obj/item/stack/sheet/leather/leather = new(loc)
leather.amount = 1
wetness = initial(wetness)
use(1)
7 changes: 4 additions & 3 deletions code/game/objects/machinery/fire_alarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ FIRE ALARM
if(A.alarm_state_flags & ALARM_WARNING_FIRE)
. += mutable_appearance(icon, "fire_o1")

/obj/machinery/firealarm/fire_act(temperature, volume)
if(detecting && (temperature > T0C+200))
alarm() // added check of detector status here
/obj/machinery/firealarm/fire_act(burn_level)
if(!detecting)
return
alarm()

/obj/machinery/firealarm/emp_act(severity)
if(prob(50/severity))
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/obj_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
return FALSE
if(QDELETED(src))
return FALSE
fire_act()
fire_act(LAVA_BURN_LEVEL)
return TRUE

/obj/hitby(atom/movable/AM, speed = 5)
Expand Down
6 changes: 2 additions & 4 deletions code/game/objects/structures/fence.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,8 @@
icon = 'icons/obj/smooth_objects/brokenfence.dmi'
return ..()

/obj/structure/fence/fire_act(exposed_temperature, exposed_volume)
if(exposed_temperature > T0C + 800)
take_damage(round(exposed_volume / 100), BURN, FIRE)
return ..()
/obj/structure/fence/fire_act(burn_level)
take_damage(burn_level, BURN, FIRE)

/obj/structure/fence/broken
chance_to_break = 100
13 changes: 4 additions & 9 deletions code/game/objects/structures/flora.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,8 @@
if(prob(10))
qdel(src)


/obj/structure/flora/flamer_fire_act(burnlevel)
take_damage(burnlevel, BURN, FIRE)

/obj/structure/flora/fire_act()
take_damage(25, BURN, FIRE)

/obj/structure/flora/fire_act(burn_level)
take_damage(burn_level, BURN, FIRE)

//TREES

Expand Down Expand Up @@ -103,8 +98,8 @@

qdel(src)

/obj/structure/flora/tree/flamer_fire_act(burnlevel)
take_damage(burnlevel/6, BURN, FIRE)
/obj/structure/flora/tree/fire_act(burn_level)
take_damage(burn_level * 0.3, BURN, FIRE)


/obj/structure/flora/tree/update_overlays()
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/structures/grille.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@
to_chat(user, span_notice("You place the [WD] on [src]."))
WD.update_icon()

/obj/structure/grille/fire_act(exposed_temperature, exposed_volume)
if(obj_integrity > integrity_failure && exposed_temperature > T0C + 1500)
take_damage(1, BURN, FIRE)
return ..()
/obj/structure/grille/fire_act(burn_level)
if(obj_integrity <= integrity_failure)
return
take_damage(1, BURN, FIRE)



Expand Down
7 changes: 2 additions & 5 deletions code/game/objects/structures/mine_structures.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@
coverage = 85
density = TRUE

/obj/structure/mine_structure/wooden/flamer_fire_act(burnlevel)
take_damage(burnlevel, BURN, FIRE)

/obj/structure/mine_structure/wooden/fire_act()
take_damage(25, BURN, FIRE)
/obj/structure/mine_structure/wooden/fire_act(burn_level)
take_damage(burn_level, BURN, FIRE)

/obj/structure/mine_structure/wooden/support_wall
name = "wooden support"
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/structures/mineral_doors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@
return ..()


/obj/structure/mineral_door/transparent/phoron/fire_act(exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
/obj/structure/mineral_door/transparent/phoron/fire_act(burn_level)
if(burn_level > 30)
var/turf/T = get_turf(src)
T.ignite(25, 25)

Expand Down
9 changes: 2 additions & 7 deletions code/game/objects/structures/reagent_dispensers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,8 @@
explosion(loc, light_impact_range = 2, flame_range = 2)
qdel(src)

/obj/structure/reagent_dispensers/fueltank/fire_act(temperature, volume)
if(temperature > T0C+500)
explode()
return ..()
/obj/structure/reagent_dispensers/fueltank/fire_act(burn_level)
explode()

/obj/structure/reagent_dispensers/fueltank/Moved(atom/old_loc, movement_dir, forced, list/old_locs)
. = ..()
Expand All @@ -218,9 +216,6 @@

playsound(src, 'sound/effects/glob.ogg', 25, 1)

/obj/structure/reagent_dispensers/fueltank/flamer_fire_act(burnlevel)
explode()

/obj/structure/reagent_dispensers/fueltank/barrel
name = "red barrel"
desc = "A red fuel barrel"
Expand Down
Loading

0 comments on commit 762dd9a

Please sign in to comment.