Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stubs and getters/setters for atom fires. #4645

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions code/_helpers/washing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
if(!istype(washing))
return
var/mob/living/L = washing
if(L.on_fire)
if(L.is_on_fire())
L.visible_message("<span class='danger'>A cloud of steam rises up as the water hits \the [L]!</span>")
L.ExtinguishMob()
L.fire_stacks = -20 //Douse ourselves with water to avoid fire more easily
L.extinguish_fire()
L.adjust_fire_intensity(-20) //Douse ourselves with water to avoid fire more easily
washing.clean()
21 changes: 21 additions & 0 deletions code/game/atoms_fires.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Stubs for atom fire system, TODO.
/atom/proc/set_fire_intensity(amount)
return

/atom/proc/get_fire_intensity()
return 0

/atom/proc/adjust_fire_intensity(amount)
return

/atom/proc/can_ignite()
return FALSE

/atom/proc/ignite_fire()
return

/atom/proc/extinguish_fire(mob/user, no_message = FALSE)
return

/atom/proc/is_on_fire()
return FALSE
18 changes: 7 additions & 11 deletions code/game/machinery/igniter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
/obj/machinery/igniter/interface_interact(mob/user)
if(!CanInteract(user, DefaultTopicState()))
return FALSE
ignite()
create_sparks()
visible_message(SPAN_NOTICE("\The [user] toggles \the [src]."))
return TRUE

Expand All @@ -51,7 +51,7 @@
location.hotspot_expose(1000,500,1)
return 1

/obj/machinery/igniter/proc/ignite()
/obj/machinery/igniter/proc/create_sparks()
use_power_oneoff(2000)
on = !on
if(on)
Expand All @@ -73,7 +73,7 @@
/decl/public_access/public_method/igniter_toggle
name = "igniter toggle"
desc = "Toggle the igniter on or off."
call_proc = TYPE_PROC_REF(/obj/machinery/igniter, ignite)
call_proc = TYPE_PROC_REF(/obj/machinery/igniter, create_sparks)

/decl/stock_part_preset/radio/receiver/igniter
frequency = BUTTON_FREQ
Expand Down Expand Up @@ -133,19 +133,15 @@
return ..()

/obj/machinery/sparker/attack_ai()
if (anchored)
return ignite()
else
return
return anchored ? create_sparks() : null

/obj/machinery/sparker/proc/ignite()
/obj/machinery/sparker/proc/create_sparks()
if (stat & NOPOWER)
return

if (disable || (last_spark && world.time < last_spark + 50))
return


flick("[base_state]-spark", src)
spark_at(src, amount=2, cardinal_only = TRUE)
src.last_spark = world.time
Expand All @@ -159,13 +155,13 @@
if(stat & (BROKEN|NOPOWER))
..(severity)
return
ignite()
create_sparks()
..(severity)

/decl/public_access/public_method/sparker_spark
name = "spark"
desc = "Creates sparks to ignite nearby gases."
call_proc = TYPE_PROC_REF(/obj/machinery/sparker, ignite)
call_proc = TYPE_PROC_REF(/obj/machinery/sparker, create_sparks)

/decl/stock_part_preset/radio/receiver/sparker
frequency = BUTTON_FREQ
Expand Down
23 changes: 10 additions & 13 deletions code/game/objects/items/flame/_flame.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
loc.update_icon()

/obj/item/flame/Destroy()
extinguish(null, TRUE)
extinguish_fire(null, TRUE)
return ..()

/obj/item/flame/proc/get_available_scents()
Expand Down Expand Up @@ -115,7 +115,7 @@

return ..()

/obj/item/flame/proc/extinguish(var/mob/user, var/no_message)
/obj/item/flame/extinguish_fire(mob/user, no_message = FALSE)
if(!lit)
return FALSE
lit = FALSE
Expand Down Expand Up @@ -147,7 +147,7 @@
return TRUE

if(lit && can_manually_extinguish)
extinguish(user)
extinguish_fire(user)
return TRUE

return ..()
Expand Down Expand Up @@ -175,7 +175,7 @@
else
check_depth = FLUID_SHALLOW
if(fluids.total_volume >= check_depth)
extinguish(no_message = TRUE)
extinguish_fire(no_message = TRUE)

/obj/item/flame/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
. = ..()
Expand Down Expand Up @@ -216,17 +216,14 @@
/obj/item/flame/Process()

if((!waterproof && submerged()) || !expend_fuel(_fuel_spend_amt))
extinguish()
extinguish_fire()
return PROCESS_KILL

update_icon()
if(istype(loc, /obj/structure/wall_sconce))
loc.update_icon()

// TODO: generalized ignition proc
if(isliving(loc))
var/mob/living/M = loc
M.IgniteMob()
if(loc)
if(istype(loc, /obj/structure/wall_sconce))
loc.update_icon()
loc.ignite_fire()

var/turf/location = get_turf(src)
if(location)
Expand All @@ -239,7 +236,7 @@
var/turf/location = loc
if(istype(location))
location.hotspot_expose(700, 5)
extinguish()
extinguish_fire()
return ..()

/obj/item/flame/spark_act(obj/effect/sparks/sparks)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/flame/flame_fuelled_lighter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
user.visible_message(SPAN_NOTICE("After a few attempts, \the [user] manages to light \the [src], burning their finger in the process."))
playsound(src.loc, "light_bic", 100, 1, -4)

/obj/item/flame/fuelled/lighter/extinguish(var/mob/user, var/no_message)
/obj/item/flame/fuelled/lighter/extinguish_fire(mob/user, no_message = FALSE)
if(!no_message && user)
no_message = TRUE
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/flame/flame_matches.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/obj/item/flame/match/light(mob/user, no_message)
. = !burnt && ..()

/obj/item/flame/match/extinguish(var/mob/user, var/no_message)
/obj/item/flame/match/extinguish_fire(mob/user, no_message = FALSE)
. = ..()
if(. && !burnt)
_fuel = 0
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/flame/flame_torch.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

update_icon()

/obj/item/flame/torch/extinguish(var/mob/user, var/no_message)
/obj/item/flame/torch/extinguish_fire(mob/user, no_message = FALSE)
. = ..()
if(. && _fuel <= 0 && !burnt)
burnt = TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/flamethrower.dm
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
target.create_fire(tank.air_contents.temperature * 2 + 400)
target.hotspot_expose(1000, 100)
for(var/mob/living/M in target)
M.IgniteMob(1)
M.ignite_fire()

// slightly weird looking initialize cuz it has to do some stuff first
/obj/item/flamethrower/full/Initialize()
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/material/ashtray.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
var/obj/item/clothing/mask/smokable/cigarette/cig = W
if (cig.lit == 1)
visible_message(SPAN_NOTICE("\The [user] crushes \the [cig] in \the [src], putting it out."))
W = cig.extinguish(no_message = 1)
W = cig.extinguish_fire(no_message = TRUE)
else if (cig.lit == 0)
to_chat(user, SPAN_NOTICE("You place \the [cig] in \the [src] without even smoking it. Why would you do that?"))
else
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/weapons/tanks/tanks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ var/global/list/global/tank_gauge_cache = list()
return ..()

/obj/item/tankassemblyproxy/receive_signal() //This is mainly called by the sensor through sense() to the holder, and from the holder to here.
tank.ignite() //boom (or not boom if you made shijwtty mix)
tank.cause_explosion() //boom (or not boom if you made shijwtty mix)

/obj/item/tank/proc/assemble_bomb(W,user) //Bomb assembly proc. This turns assembly+tank into a bomb
var/obj/item/assembly_holder/S = W
Expand All @@ -573,7 +573,7 @@ var/global/list/global/tank_gauge_cache = list()

update_icon(TRUE)

/obj/item/tank/proc/ignite() //This happens when a bomb is told to explode
/obj/item/tank/proc/cause_explosion() //This happens when a bomb is told to explode
var/obj/item/assembly_holder/assy = proxyassembly.assembly
var/ign = assy.a_right
var/obj/item/other = assy.a_left
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/weapons/tools/weldingtool.dm
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
var/turf/location = get_turf(user)
if(isliving(O))
var/mob/living/L = O
L.IgniteMob()
L.ignite_fire()
else if(isatom(O))
O.handle_external_heating(WELDING_TOOL_HOTSPOT_TEMP_ACTIVE, src, user)
if (isturf(location))
Expand Down Expand Up @@ -243,7 +243,7 @@
var/mob/living/L = loc
if(!(src in L.get_held_items()))
fuel_usage = max(fuel_usage, 2)
L.IgniteMob()
L.ignite_fire()
else if(isturf(loc))
var/turf/location = get_turf(src)
location.hotspot_expose(WELDING_TOOL_HOTSPOT_TEMP_IDLE, 5) //a bit colder when idling
Expand Down
12 changes: 6 additions & 6 deletions code/modules/clothing/head/misc_special.dm
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
icon = 'icons/clothing/head/cakehat.dmi'
body_parts_covered = SLOT_HEAD
item_flags = null
var/is_on_fire = FALSE
VAR_PRIVATE/_on_fire = FALSE

/obj/item/clothing/head/cakehat/equipped(mob/user, slot)
. = ..()
Expand All @@ -217,7 +217,7 @@
/obj/item/clothing/head/cakehat/on_update_icon(mob/user)
. = ..()
z_flags &= ~ZMM_MANGLE_PLANES
if(is_on_fire && check_state_in_icon("[icon_state]-flame", icon))
if(is_on_fire() && check_state_in_icon("[icon_state]-flame", icon))
if(plane == HUD_PLANE)
add_overlay("[icon_state]-flame")
else
Expand All @@ -230,7 +230,7 @@
return emissive_overlay(overlay.icon, "[overlay.icon_state]-flame")

/obj/item/clothing/head/cakehat/apply_additional_mob_overlays(mob/living/user_mob, bodytype, image/overlay, slot, bodypart, use_fallback_if_icon_missing = TRUE)
if(overlay && is_on_fire)
if(overlay && is_on_fire())
var/image/I = get_mob_flame_overlay(overlay, bodytype)
if(I)
overlay.overlays += I
Expand All @@ -241,7 +241,7 @@
return ..()

/obj/item/clothing/head/cakehat/Process()
if(!is_on_fire)
if(!is_on_fire())
STOP_PROCESSING(SSobj, src)
return
var/turf/location = loc
Expand All @@ -255,9 +255,9 @@
/obj/item/clothing/head/cakehat/attack_self(mob/user)
. = ..()
if(!.)
is_on_fire = !is_on_fire
_on_fire = !_on_fire
update_icon()
if(is_on_fire)
if(is_on_fire())
atom_damage_type = BURN
START_PROCESSING(SSobj, src)
else
Expand Down
4 changes: 2 additions & 2 deletions code/modules/clothing/masks/chewable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
/obj/item/clothing/mask/chewable/Process()
chew(1)
if(chewtime < 1)
extinguish()
extinguish_fire()

/obj/item/clothing/mask/chewable/tobacco
name = "wad"
Expand All @@ -72,7 +72,7 @@
desc = "A disgusting spitwad."
icon = 'icons/clothing/mask/chewables/chew_spit.dmi'

/obj/item/clothing/mask/chewable/proc/extinguish(var/mob/user, var/no_message)
/obj/item/clothing/mask/chewable/extinguish_fire(mob/user, no_message = FALSE)
STOP_PROCESSING(SSobj, src)
if(type_butt)
var/obj/item/trash/cigbutt/butt = new type_butt(get_turf(src))
Expand Down
18 changes: 9 additions & 9 deletions code/modules/clothing/masks/smokable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
if (src == user.get_equipped_item(slot_wear_mask_str) && user.internal)
environment = user.internal.return_air()
if(environment.get_by_flag(XGM_GAS_OXIDIZER) < gas_consumption)
extinguish()
extinguish_fire()
else
environment.remove_by_flag(XGM_GAS_OXIDIZER, gas_consumption)
environment.adjust_gas(/decl/material/gas/carbon_dioxide, 0.5*gas_consumption,0)
Expand All @@ -91,7 +91,7 @@
/obj/item/clothing/mask/smokable/Process()
var/turf/location = get_turf(src)
if(submerged() || smoketime < 1)
extinguish()
extinguish_fire()
return
smoke(1)
if(location)
Expand Down Expand Up @@ -126,7 +126,7 @@
var/turf/location = get_turf(src)
if(location)
location.hotspot_expose(700, 5)
extinguish(no_message = TRUE)
extinguish_fire(no_message = TRUE)

/obj/item/clothing/mask/smokable/proc/light(var/flavor_text = "[usr] lights \the [src].")
if(QDELETED(src))
Expand All @@ -152,7 +152,7 @@
smoke_amount = reagents.total_volume / smoketime
START_PROCESSING(SSobj, src)

/obj/item/clothing/mask/smokable/proc/extinguish(var/mob/user, var/no_message)
/obj/item/clothing/mask/smokable/extinguish_fire(mob/user, no_message = FALSE)
lit = FALSE
atom_damage_type = BRUTE
STOP_PROCESSING(SSobj, src)
Expand Down Expand Up @@ -182,7 +182,7 @@
return ..()

/obj/item/clothing/mask/smokable/use_on_mob(mob/living/target, mob/living/user, animate = TRUE)
if(target.on_fire)
if(target.is_on_fire())
user.do_attack_animation(target)
light(SPAN_NOTICE("\The [user] coldly lights the \the [src] with the burning body of \the [target]."))
return TRUE
Expand Down Expand Up @@ -221,7 +221,7 @@
if(is_processing)
set_scent_by_reagents(src)

/obj/item/clothing/mask/smokable/extinguish(var/mob/user, var/no_message)
/obj/item/clothing/mask/smokable/extinguish_fire(mob/user, no_message = FALSE)
..()
remove_extension(src, /datum/extension/scent)
if (type_butt)
Expand Down Expand Up @@ -384,7 +384,7 @@
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
return TRUE

if(!lit && target.on_fire)
if(!lit && target.is_on_fire())
user.do_attack_animation(target)
light(target, user)
return TRUE
Expand Down Expand Up @@ -412,7 +412,7 @@
/obj/item/clothing/mask/smokable/cigarette/attack_self(var/mob/user)
if(lit == 1)
user.visible_message(SPAN_NOTICE("[user] calmly drops and treads on the lit [src], putting it out instantly."))
extinguish(no_message = 1)
extinguish_fire(no_message = TRUE)
return ..()

////////////
Expand Down Expand Up @@ -530,7 +530,7 @@
set_scent_by_reagents(src)
update_icon()

/obj/item/clothing/mask/smokable/pipe/extinguish(var/mob/user, var/no_message)
/obj/item/clothing/mask/smokable/pipe/extinguish_fire(mob/user, no_message)
..()
new /obj/effect/decal/cleanable/ash(get_turf(src))
if(ismob(loc))
Expand Down
Loading
Loading