Files
Bubberstation/code/game/objects/structures.dm
SmArtKar 45d520f4df Another examine refactor: Tag edition (#86678)
## About The Pull Request
Another batch of changes to examine, ideas being courtesy of Melbert and
Swanni. When examining an item you will now see tags with tooltips
elaborating on their meaning instead of having each property displayed
in a separate line. Additionally, examines now use fieldsets, saving a
line previously spent on displaying an item's name and instead putting
it directly into the top outline. Embedding and slapcrafting also
display their properties as tags, and combat info now displays item's
sharpness.
Here are some examples, each tag previously taking up its own line.


![image](https://github.com/user-attachments/assets/f2cabc5a-daff-41b3-b320-4414eaf31c99)

![image](https://github.com/user-attachments/assets/3e2dff49-4f11-45dd-94a7-93205030f985)

![image](https://github.com/user-attachments/assets/359152ce-2a1d-4db2-8914-3a9416a6d4a9)

Additionally, protection classes now better elaborate on items'
temperature protection properties and tell you the exact temperatures
that an item can withstand


![image](https://github.com/user-attachments/assets/a75f989d-d7d3-4305-b87d-ccd3124c0b6f)
## Why It's Good For The Game

Tags are a very intuitive system used in many games and we could benefit
from it too. Compressing seven lines of text into one while retaining
readability and all information within by using tooltips will majorly
cut down on chat space used by examines.

## Changelog
🆑
refactor: Refactored how examines display item properties. A lot of them
are now displayed as tags that you can hover over to receive details
about, like item size, resistances and materials an object is made of.
qol: Protection classes now better elaborate on thermal resistances of
items, displaying the exact temperatures they can protect you from.
/🆑
2024-09-16 09:14:37 -04:00

82 lines
2.6 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 & USES_SMOOTHING)
QUEUE_SMOOTH(src)
QUEUE_SMOOTH_NEIGHBORS(src)
if(smoothing_flags & SMOOTH_CORNERS)
icon_state = ""
GLOB.cameranet.updateVisibility(src)
/obj/structure/Destroy(force)
GLOB.cameranet.updateVisibility(src)
if(smoothing_flags & USES_SMOOTHING)
QUEUE_SMOOTH_NEIGHBORS(src)
return ..()
/obj/structure/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
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/examine_descriptor(mob/user)
return "structure"
/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 * 2.5e-4, BURN, "energy")
power -= power * 5e-4 //walls take a lot out of ya
. = ..()
/obj/structure/animate_atom_living(mob/living/owner)
new /mob/living/simple_animal/hostile/mimic/copy(drop_location(), src, owner)
/// For when a mob comes flying through the window, smash it and damage the mob
/obj/structure/proc/smash_and_injure(mob/living/flying_mob, atom/oldloc, direction)
flying_mob.balloon_alert_to_viewers("smashed through!")
flying_mob.apply_damage(damage = rand(5, 15), damagetype = BRUTE, wound_bonus = 15, bare_wound_bonus = 25, sharpness = SHARP_EDGED, attack_direction = get_dir(src, oldloc))
new /obj/effect/decal/cleanable/glass(get_step(flying_mob, flying_mob.dir))
deconstruct(disassembled = FALSE)