Files
GS13NG/code/game/objects/structures/fireplace.dm
Poojawa cf59ac1c3d 12/21 modernizations from TG live (#103)
* sync (#3)

* shuttle auto call

* Merge /vore into /master (#39)

* progress

* Compile errors fixed

No idea if it's test worthy tho as conflicts with race overhaul and
narky removal.

* Update admins.txt

* efforts continue

Fuck grab code, seriously

* grab code is cancer

* Execute the Narkism

Do not hesitate.

Show no mercy.

* holy shit grab code is awful

* have I bitched about grab code

My bitching, let me show you it

* código de agarre es una mierda

No really it is

* yeah I don't even know anymore.

* Lolnope. Fuck grab code

* I'm not even sure what to fix anymore

* Self eating is not an acceptable fate

* Taste the void, son.

* My code doesn't pass it's own sanity check.

Maybe it's a sign of things to come.

* uncommented and notes

* It Works and I Don't Know Why (#38)

* shuttle auto call

* it works and I don't know why

* Subsystem 12/21

Most Recent TG subsystem folder

* globalvars 12/21

Tossed out the flavor_misc and parallax files

* Onclick 12/21

as well as .dme updates

* _defines 12/21

ommited old _MC.dm

* _HELPERS 12/21

Preserved snowflake placement of furry sprites

* _defeines/genetics

reapplied narkism holdover for snowflake races.

* Oops forgot mutant colors

* modules porting 12/21 + Sounds/icons

Admin, Client and most of mob life files ommitted

* enviroment file

* Admin optimizations

ahelp log system kept

* Mob ports 12/21

Flavor text preserved

* datums ported 12/21

* Game ported 12/21

* batch of duplicate fixes/dogborg work

Dogborgs need to be modernized to refractored borg standards.

* moar fixes

* Maps and futher compile fixes
2016-12-22 03:57:55 -06:00

154 lines
3.9 KiB
Plaintext

#define LOG_BURN_TIMER 150
#define PAPER_BURN_TIMER 5
#define MAXIMUM_BURN_TIMER 3000
/obj/structure/fireplace
name = "fireplace"
desc = "A large stone brick fireplace."
icon = 'icons/obj/fireplace.dmi'
icon_state = "fireplace"
density = FALSE
anchored = TRUE
pixel_x = -16
resistance_flags = FIRE_PROOF
var/lit = FALSE
var/fuel_added = 0
var/flame_expiry_timer
/obj/structure/fireplace/New()
..()
START_PROCESSING(SSobj, src)
/obj/structure/fireplace/Destroy()
STOP_PROCESSING(SSobj, src)
. = ..()
/obj/structure/fireplace/proc/try_light(obj/item/O, mob/user)
if(lit)
user << "<span class='warning'>It's already lit!</span>"
return FALSE
if(!fuel_added)
user << "<span class='warning'>[src] needs some fuel to burn!</span>"
return FALSE
var/msg = O.ignition_effect(src, user)
if(msg)
visible_message(msg)
ignite()
return TRUE
/obj/structure/fireplace/attackby(obj/item/T, mob/user)
if(istype(T,/obj/item/stack/sheet/mineral/wood))
var/obj/item/stack/sheet/mineral/wood/wood = T
var/space_remaining = MAXIMUM_BURN_TIMER - burn_time_remaining()
var/space_for_logs = round(space_remaining / LOG_BURN_TIMER)
if(space_for_logs < 1)
user << "<span class='warning'>You can't fit any more of [T] in \
[src]!</span>"
return
var/logs_used = min(space_for_logs, wood.amount)
wood.use(logs_used)
adjust_fuel_timer(LOG_BURN_TIMER * logs_used)
user.visible_message("<span class='notice'>[user] tosses some \
wood into [src].</span>", "<span class='notice'>You add \
some fuel to [src].</span>")
else if(istype(T, /obj/item/weapon/paper_bin))
var/obj/item/weapon/paper_bin/paper_bin = T
user.visible_message("<span class='notice'>[user] throws [T] into \
[src].</span>", "<span class='notice'>You add [T] to [src].\
</span>")
adjust_fuel_timer(PAPER_BURN_TIMER * paper_bin.total_paper)
qdel(paper_bin)
else if(istype(T, /obj/item/weapon/paper))
user.visible_message("<span class='notice'>[user] throws [T] into \
[src].</span>", "<span class='notice'>You throw [T] into [src].\
</span>")
adjust_fuel_timer(PAPER_BURN_TIMER)
qdel(T)
else if(try_light(T,user))
return
else
. = ..()
/obj/structure/fireplace/update_icon()
cut_overlays()
if(lit)
switch(burn_time_remaining())
if(0 to 500)
add_overlay("fireplace_fire0")
if(500 to 1000)
add_overlay("fireplace_fire1")
if(1000 to 1500)
add_overlay("fireplace_fire2")
if(1500 to 2000)
add_overlay("fireplace_fire3")
if(2000 to MAXIMUM_BURN_TIMER)
add_overlay("fireplace_fire4")
add_overlay("fireplace_glow")
/obj/structure/fireplace/proc/adjust_light()
if(!lit)
SetLuminosity(0)
return
switch(burn_time_remaining())
if(0 to 500)
SetLuminosity(1)
if(500 to 1000)
SetLuminosity(2)
if(1000 to 1500)
SetLuminosity(3)
if(1500 to 2000)
SetLuminosity(4)
if(2000 to MAXIMUM_BURN_TIMER)
SetLuminosity(6)
/obj/structure/fireplace/process()
if(!lit)
return
if(world.time > flame_expiry_timer)
put_out()
return
playsound(src, 'sound/effects/comfyfire.ogg',50,0, 0, 1)
var/turf/T = get_turf(src)
T.hotspot_expose(700, 5)
update_icon()
adjust_light()
/obj/structure/fireplace/extinguish()
if(lit)
var/fuel = burn_time_remaining()
flame_expiry_timer = 0
put_out()
adjust_fuel_timer(fuel)
. = ..()
/obj/structure/fireplace/proc/adjust_fuel_timer(amount)
if(lit)
flame_expiry_timer += amount
if(burn_time_remaining() < MAXIMUM_BURN_TIMER)
flame_expiry_timer = world.time + MAXIMUM_BURN_TIMER
else
fuel_added = Clamp(fuel_added + amount, 0, MAXIMUM_BURN_TIMER)
/obj/structure/fireplace/proc/burn_time_remaining()
if(lit)
return max(0, flame_expiry_timer - world.time)
else
return max(0, fuel_added)
/obj/structure/fireplace/proc/ignite()
lit = TRUE
desc = "A large stone brick fireplace, warm and cozy."
flame_expiry_timer = world.time + fuel_added
fuel_added = 0
update_icon()
adjust_light()
/obj/structure/fireplace/proc/put_out()
lit = FALSE
update_icon()
adjust_light()
desc = initial(desc)