Files
Bubberstation/code/game/objects/structures.dm
SkyratBot 327ebcb31c [MIRROR] Reworks burning objects to be a component [MDB IGNORE] (#20543)
* Reworks burning objects to be a component (#74688)

## About The Pull Request

Title.

## Why It's Good For The Game

Simply put, allows for atoms which are not /obj but use atom_integrity
to burn up too, which is nice and good.
But also, it allows for neat behavior like burning particle effects
(only structures use that right now to spawn smoke)

![image](https://user-images.githubusercontent.com/82850673/231595051-2a8d0574-33cc-4cd9-9d61-65566decf4ef.png)

## Changelog

🆑
add: Burning structures spawn smoke particles. Sick.
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>

* Reworks burning objects to be a component

* modular

---------

Co-authored-by: ChungusGamer666 <82850673+ChungusGamer666@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
2023-04-14 23:44:14 +01:00

69 lines
1.9 KiB
Plaintext

/// Inert structures, such as girders, machine frames, and crates/lockers.
/obj/structure
icon = 'icons/obj/structures.dmi'
pressure_resistance = 8
max_integrity = 300
interaction_flags_atom = INTERACT_ATOM_ATTACK_HAND | INTERACT_ATOM_UI_INTERACT
layer = BELOW_OBJ_LAYER
flags_ricochet = RICOCHET_HARD
receive_ricochet_chance_mod = 0.6
pass_flags_self = PASSSTRUCTURE
blocks_emissive = EMISSIVE_BLOCK_GENERIC
armor_type = /datum/armor/obj_structure
burning_particles = /particles/smoke/burning
var/broken = FALSE
/datum/armor/obj_structure
fire = 50
acid = 50
/obj/structure/Initialize(mapload)
. = ..()
if(smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK))
QUEUE_SMOOTH(src)
QUEUE_SMOOTH_NEIGHBORS(src)
if(smoothing_flags & SMOOTH_CORNERS)
icon_state = ""
GLOB.cameranet.updateVisibility(src)
/obj/structure/Destroy()
GLOB.cameranet.updateVisibility(src)
if(smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK))
QUEUE_SMOOTH_NEIGHBORS(src)
return ..()
/obj/structure/ui_act(action, params)
add_fingerprint(usr)
return ..()
/obj/structure/examine(mob/user)
. = ..()
if(!(resistance_flags & INDESTRUCTIBLE))
if(resistance_flags & ON_FIRE)
. += span_warning("It's on fire!")
if(broken)
. += span_notice("It appears to be broken.")
var/examine_status = examine_status(user)
if(examine_status)
. += examine_status
/obj/structure/proc/examine_status(mob/user) //An overridable proc, mostly for falsewalls.
var/healthpercent = (atom_integrity/max_integrity) * 100
switch(healthpercent)
if(50 to 99)
return "It looks slightly damaged."
if(25 to 50)
return "It appears heavily damaged."
if(0 to 25)
if(!broken)
return span_warning("It's falling apart!")
/obj/structure/rust_heretic_act()
take_damage(500, BRUTE, "melee", 1)
/obj/structure/zap_act(power, zap_flags)
if(zap_flags & ZAP_OBJ_DAMAGE)
take_damage(power/8000, BURN, "energy")
power -= power/2000 //walls take a lot out of ya
. = ..()