Replaces lava and chasm's "safeties" and ignoring turf slowdown on catwalks with traits and a new element. (#76376)

## About The Pull Request
This adds a new element for movables that grants turfs they're in
traits, changes lava and the chasm component to check for traits
instead, ditto for turf slowdown. It also implements another trait that
prevents wet floor from slipping people, as well as some other changes
(feel free to opine on them really):
- Tables and conveyor belts now stop turf slowdown, much like catwalks,
as I imagine people walking on them are not really touching the floor.
(I'd include protection against lava too... until they melt, but that'd
mean finding a way to have these objects burn in the first place, and
lava code is still stupid despite a years old refactor I did)
- Tables also stop slippery turfs from slipping (bananas, soaps etc.
still apply). I wish there were a way to make some objects slippery by
coating them in water vapor or splashing water/lube, but that's outside
the scope of this PR.
- Fixed an edge case in which a mob standing on a lava turf would be
left permanently visually on fire if the lava is changed to another kind
of turf.
- Removed unused code from stone tiles.

I'm going to include these traits in that global list for admin-added
traits... tomorrow perhaps. 💤

## Why It's Good For The Game
Replacing some hard-coded mechanics with easier to use traits and an
element, which I also need for the submerge element PR.

## Changelog

🆑
refactor: Replaced hardcoded "safeties" for lava, chasms and ignoring
turf slowdowns on catwalks with traits.
balance: much like catwalks, tables and conveyors also disable turf
slowdowns.
balance: slippery turfs won't slip you when walking on a table.
fix: Fixed an edge case in which a mob standing on a lava turf would be
left visually but permanently on fire if the lava is changed to another
kind of turf.
/🆑
This commit is contained in:
Ghom
2023-07-07 10:04:33 +01:00
committed by GitHub
parent 32f2f8b5c3
commit d4cdd6b63e
24 changed files with 237 additions and 159 deletions
+9
View File
@@ -16,6 +16,13 @@
canSmoothWith = SMOOTH_GROUP_LATTICE + SMOOTH_GROUP_WALLS + SMOOTH_GROUP_OPEN_FLOOR
var/number_of_mats = 1
var/build_material = /obj/item/stack/rods
var/list/give_turf_traits = list(TRAIT_CHASM_STOPPED)
/obj/structure/lattice/Initialize(mapload)
. = ..()
if(length(give_turf_traits))
give_turf_traits = string_list(give_turf_traits)
AddElement(/datum/element/give_turf_traits, give_turf_traits)
/datum/armor/structure_lattice
melee = 50
@@ -92,6 +99,7 @@
smoothing_groups = SMOOTH_GROUP_CATWALK + SMOOTH_GROUP_LATTICE + SMOOTH_GROUP_OPEN_FLOOR
canSmoothWith = SMOOTH_GROUP_CATWALK
obj_flags = CAN_BE_HIT | BLOCK_Z_OUT_DOWN | BLOCK_Z_IN_UP
give_turf_traits = list(TRAIT_TURF_IGNORE_SLOWDOWN, TRAIT_LAVA_STOPPED, TRAIT_CHASM_STOPPED)
/obj/structure/lattice/catwalk/Initialize(mapload)
. = ..()
@@ -146,6 +154,7 @@
canSmoothWith = SMOOTH_GROUP_LATTICE
obj_flags = CAN_BE_HIT | BLOCK_Z_OUT_DOWN | BLOCK_Z_IN_UP
resistance_flags = FIRE_PROOF | LAVA_PROOF
give_turf_traits = list(TRAIT_LAVA_STOPPED, TRAIT_CHASM_STOPPED)
/obj/structure/lattice/lava/deconstruction_hints(mob/user)
return span_notice("The rods look like they could be <b>cut</b>, but the <i>heat treatment will shatter off</i>. There's space for a <i>tile</i>.")
+10 -8
View File
@@ -23,6 +23,12 @@
pass_flags_self = PASSTABLE | LETPASSTHROW
layer = TABLE_LAYER
obj_flags = CAN_BE_HIT | IGNORE_DENSITY
custom_materials = list(/datum/material/iron =SHEET_MATERIAL_AMOUNT)
max_integrity = 100
integrity_failure = 0.33
smoothing_flags = SMOOTH_BITMASK
smoothing_groups = SMOOTH_GROUP_TABLES
canSmoothWith = SMOOTH_GROUP_TABLES
///TRUE if the table can be climbed on and have living mobs placed on it normally, FALSE otherwise
var/climbable = TRUE
var/frame = /obj/structure/table_frame
@@ -32,13 +38,7 @@
var/busy = FALSE
var/buildstackamount = 1
var/framestackamount = 2
var/deconstruction_ready = 1
custom_materials = list(/datum/material/iron =SHEET_MATERIAL_AMOUNT)
max_integrity = 100
integrity_failure = 0.33
smoothing_flags = SMOOTH_BITMASK
smoothing_groups = SMOOTH_GROUP_TABLES
canSmoothWith = SMOOTH_GROUP_TABLES
var/deconstruction_ready = TRUE
/obj/structure/table/Initialize(mapload, _buildstack)
. = ..()
@@ -54,6 +54,8 @@
)
AddElement(/datum/element/connect_loc, loc_connections)
var/static/list/give_turf_traits = list(TRAIT_TURF_IGNORE_SLOWDOWN, TRAIT_TURF_IGNORE_SLIPPERY)
AddElement(/datum/element/give_turf_traits, give_turf_traits)
register_context()
/obj/structure/table/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
@@ -593,7 +595,7 @@
icon = 'icons/obj/smooth_structures/reinforced_table.dmi'
icon_state = "reinforced_table-0"
base_icon_state = "reinforced_table"
deconstruction_ready = 0
deconstruction_ready = FALSE
buildstack = /obj/item/stack/sheet/plasteel
max_integrity = 200
integrity_failure = 0.25