Skip to content

Commit

Permalink
Adding bellows.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Jan 9, 2025
1 parent e0991fd commit eb2a758
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 3 deletions.
14 changes: 11 additions & 3 deletions code/game/objects/structures/fires.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
var/lit = FIRE_OUT
/// How much fuel is left?
var/fuel = 0

/// Have we been fed by a bellows recently?
var/bellows_oxygenation = 0

/obj/structure/fire_source/Initialize()
. = ..()
Expand Down Expand Up @@ -138,6 +139,7 @@

/obj/structure/fire_source/proc/die()
if(lit == FIRE_LIT)
bellows_oxygenation = 0
lit = FIRE_DEAD
last_fuel_ignite_temperature = null
last_fuel_burn_temperature = T20C
Expand Down Expand Up @@ -386,7 +388,9 @@
return 0
var/ambient_temperature = get_ambient_temperature(absolute = TRUE)
// The effective burn temperature can't go below ambient (no cold flames) or above the actual burn temperature.
return clamp((last_fuel_burn_temperature - T0C) * draught_mult + T0C, ambient_temperature, last_fuel_burn_temperature)
. = clamp((last_fuel_burn_temperature - T0C) * draught_mult + T0C, ambient_temperature, last_fuel_burn_temperature)
if(bellows_oxygenation)
. = round(. * 1.25) // Burns 25% hotter while oxygenated.

// If absolute == TRUE, return our actual ambient temperature, otherwise return our effective burn temperature when lit.
/obj/structure/fire_source/get_ambient_temperature(absolute = FALSE)
Expand All @@ -413,6 +417,10 @@
die()
return

// Spend our bellows charge.
if(bellows_oxygenation > 0)
bellows_oxygenation--

fuel -= (FUEL_CONSUMPTION_CONSTANT * get_draught_multiplier())
if(!process_fuel())
die()
Expand Down Expand Up @@ -461,7 +469,7 @@

switch(lit)
if(FIRE_LIT)
if(fuel >= HIGH_FUEL)
if(bellows_oxygenation || fuel >= HIGH_FUEL)
var/image/I = image(icon, "[icon_state]_lit")
I.appearance_flags |= RESET_COLOR | RESET_ALPHA | KEEP_APART
add_overlay(I)
Expand Down
40 changes: 40 additions & 0 deletions code/modules/crafting/forging/bellows.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/obj/structure/working/bellows
name = "bellows"
desc = "An air pump used to improve the heat of a furnace."
icon = 'icons/obj/structures/forging/bellows.dmi'
obj_flags = OBJ_FLAG_ANCHORABLE | OBJ_FLAG_ROTATABLE
work_skill = SKILL_HAULING
var/decl/material/bellows_material = /decl/material/solid/organic/leather

/obj/structure/working/bellows/Initialize()
bellows_material = GET_DECL(bellows_material)
. = ..()

/obj/structure/working/bellows/on_update_icon()
. = ..()
underlays = list(overlay_image(icon, "[icon_state]-bellows", bellows_material.color, RESET_COLOR))

/obj/structure/working/bellows/try_start_working(mob/user)

var/obj/structure/fire_source/stoking = locate() in get_step(loc, EAST)
if(!istype(stoking) || !stoking.lit)
to_chat(user, SPAN_WARNING("\The [src] must face east towards a lit fire source; it would be pointless to work them currently."))
return TRUE

to_chat(user, SPAN_NOTICE("You begin working \the [src], stoking \the [stoking] to a hotter flame."))
start_working()
while(user.do_skilled(3 SECONDS, work_skill, src))
if(QDELETED(src) || QDELETED(user) || user.get_stamina() <= 0)
break
stoking = locate() in get_step(loc, EAST)
if(!istype(stoking) || !stoking.lit)
break
user.adjust_stamina(-25)
stoking.bellows_oxygenation = max(50, stoking.bellows_oxygenation+3)

if(!QDELETED(user))
to_chat(user, SPAN_NOTICE("You stop working \the [src]."))

stop_working()
return TRUE

Binary file added icons/obj/structures/forging/bellows.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions nebula.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2214,6 +2214,7 @@
#include "code\modules\codex\entries\weapons.dm"
#include "code\modules\crafting\handmade_fancy.dm"
#include "code\modules\crafting\handmade_items.dm"
#include "code\modules\crafting\forging\bellows.dm"
#include "code\modules\crafting\metalwork\metalwork_items.dm"
#include "code\modules\crafting\pottery\pottery_moulds.dm"
#include "code\modules\crafting\pottery\pottery_structures.dm"
Expand Down

0 comments on commit eb2a758

Please sign in to comment.