Files
JacquerelandGitHub faf2000100 Rust doesn't apply effects to people who aren't touching it (#94733)
## About The Pull Request

Heretic rusted tiles do not apply any effects to things which are
jaunting or inside vents.
They also don't apply any _negative_ effects to things that are flying
(but they do apply positive ones, just because flight is a cool thing to
have earned and it would be sad to lose your bonuses because you have
wings).

I also renamed the element so that it isn't named after the rust passive
(in fact, the rust heretics with that passive don't use the element) and
simply describes what it does, and removed a subtype in favour of just
passing in some arguments.

I also added a trait which bypasses the negative effects of standing in
rust, in case an admin creates a non-heretic creature and gives it rust
healing. They shouldn't have _both_ healing _and_ gain disgust and minor
damage from starting in rust (possibly the heretical harvester was being
effected by this?)

Finally I adjusted the `rust_heretic_act` and `rust_turf` procs to
remove a footgun I saw a developer fall into recently where they didn't
realise that the generically named "rust turf" proc actually assumes a
wizard did it, now if we add anything else that wants to non-magically
rust a turf then it will work the way you expect.
As a side effect this changes the two item sources of rust that heretics
get to actually use rust resistance rather than rusting every turf, I
set them to effect all inorganic turfs as a default.
And finally I noticed that rust heretic ascension was passing
"RUST_RESISTANCE_ABSOLUTE" as a value into its proc which reads `Should
not be rustable. EVER.` in its comment, which smelled like a bug. So I
changed it to just "things which should be rustable ever".

## Why It's Good For The Game

It is the logical way you would expect these things to work;
Heretics crawling in vents or (for instance) using space crawl should
not be healed for touching rust that they aren't touching, as they are
not readily accessible to other players. The idea of the rust healing is
that it's a tradeoff for exposing yourself in a visible "territory", so
you shouldn't be able to avoid it by being in that territory but
untouchable and invisible.
Similarly, players who have gained the ability to fly would not expect
to get sick from flying over rusty flooring. They're out of range.

## Changelog

🆑
balance: Eldritch rusted tiles don't apply their effects to anyone who
is jaunted or in vents, and don't apply negative effects to people who
are flying.
balance: Heretic items which apply rust (grenades and eldritch reagent)
check the rust resistance level of the turf rather than always rusting
it.
fix: Rust Heretics ascending don't rust unrustable turfs, like space
tiles.
/🆑
2026-01-15 12:43:39 +00:00

149 lines
5.3 KiB
Plaintext

// Base chasm, defaults to oblivion but can be overridden
/turf/open/chasm
name = "chasm"
desc = "Watch your step."
baseturfs = /turf/open/chasm
icon = 'icons/turf/floors/chasms.dmi'
icon_state = "chasms-255"
base_icon_state = "chasms"
smoothing_flags = SMOOTH_BITMASK | SMOOTH_BORDER
smoothing_groups = SMOOTH_GROUP_TURF_OPEN + SMOOTH_GROUP_TURF_CHASM
canSmoothWith = SMOOTH_GROUP_TURF_CHASM
turf_flags = NO_RUST
density = TRUE //This will prevent hostile mobs from pathing into chasms, while the canpass override will still let it function like an open turf
bullet_bounce_sound = null //abandon all hope ye who enter
rust_resistance = RUST_RESISTANCE_ABSOLUTE
/turf/open/chasm/Initialize(mapload)
. = ..()
apply_components(mapload)
/// Lets people walk into chasms.
/turf/open/chasm/CanAllowThrough(atom/movable/mover, border_dir)
. = ..()
return TRUE
/turf/open/chasm/proc/set_target(turf/target)
var/datum/component/chasm/chasm_component = GetComponent(/datum/component/chasm)
chasm_component.target_turf = target
/turf/open/chasm/proc/drop(atom/movable/AM)
var/datum/component/chasm/chasm_component = GetComponent(/datum/component/chasm)
chasm_component.drop(AM)
/turf/open/chasm/MakeSlippery(wet_setting, min_wet_time, wet_time_to_add, max_wet_time, permanent)
return
/turf/open/chasm/MakeDry()
return
/turf/open/chasm/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
if(the_rcd.mode == RCD_TURF && the_rcd.rcd_design_path == /turf/open/floor/plating/rcd)
return list("delay" = 0, "cost" = 3)
return FALSE
/turf/open/chasm/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, list/rcd_data)
if(rcd_data[RCD_DESIGN_MODE] == RCD_TURF && rcd_data[RCD_DESIGN_PATH] == /turf/open/floor/plating/rcd)
place_on_top(/turf/open/floor/plating, flags = CHANGETURF_INHERIT_AIR)
return TRUE
return FALSE
/turf/open/chasm/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
underlay_appearance.icon = /turf/open/misc/asteroid/basalt::icon
underlay_appearance.icon_state = /turf/open/misc/asteroid/basalt::icon_state
return TRUE
/turf/open/chasm/attackby(obj/item/C, mob/user, params, area/area_restriction)
. = ..()
if(ismetaltile(C))
build_with_floor_tiles(C, user)
return
if(!istype(C, /obj/item/stack/rods))
return
var/obj/item/stack/rods/R = C
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
return
if(!R.use(1))
to_chat(user, span_warning("You need one rod to build a lattice."))
return
to_chat(user, span_notice("You construct a lattice."))
playsound(src, 'sound/items/weapons/genhit.ogg', 50, TRUE)
// Create a lattice, without reverting to our baseturf
new /obj/structure/lattice(src)
/// Handles adding the chasm component to the turf (So stuff falls into it!)
/turf/open/chasm/proc/apply_components(mapload)
AddComponent(/datum/component/chasm, GET_TURF_BELOW(src), mapload)
/turf/open/chasm/can_cross_safely(atom/movable/crossing)
return HAS_TRAIT(src, TRAIT_CHASM_STOPPED) || HAS_TRAIT(crossing, TRAIT_MOVE_FLYING)
// Chasms for Lavaland, with planetary atmos and lava glow
/turf/open/chasm/lavaland
initial_gas_mix = LAVALAND_DEFAULT_ATMOS
planetary_atmos = TRUE
baseturfs = /turf/open/chasm/lavaland
light_range = 1.9 //slightly less range than lava
light_power = 0.65 //less bright, too
light_color = LIGHT_COLOR_LAVA //let's just say you're falling into lava, that makes sense right
// Chasms for Ice moon, with planetary atmos and glow
/turf/open/chasm/icemoon
icon = 'icons/turf/floors/icechasms.dmi'
icon_state = "icechasms-255"
base_icon_state = "icechasms"
initial_gas_mix = ICEMOON_DEFAULT_ATMOS
planetary_atmos = TRUE
baseturfs = /turf/open/chasm/icemoon
light_range = 1.9
light_power = 0.65
light_color = LIGHT_COLOR_PURPLE
/turf/open/chasm/icemoon/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
underlay_appearance.icon = /turf/open/misc/asteroid/snow/icemoon::icon
underlay_appearance.icon_state = /turf/open/misc/asteroid/snow/icemoon::icon_state
return TRUE
// Chasms for the jungle, with planetary atmos and a different icon
/turf/open/chasm/jungle
icon = 'icons/turf/floors/junglechasm.dmi'
icon_state = "junglechasm-255"
base_icon_state = "junglechasm"
planetary_atmos = TRUE
baseturfs = /turf/open/chasm/jungle
/turf/open/chasm/jungle/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
underlay_appearance.icon = /turf/open/misc/dirt::icon
underlay_appearance.icon_state = /turf/open/misc/dirt::icon_state
return TRUE
// Chasm that doesn't do any z-level nonsense and just kills/stores whoever steps into it.
/turf/open/chasm/true
desc = "There's nothing at the bottom. Absolutely nothing."
baseturfs = /turf/open/chasm/true
/turf/open/chasm/true/apply_components(mapload)
AddComponent(/datum/component/chasm, null, mapload) //Don't pass anything for below_turf.
/turf/open/chasm/true/no_smooth
smoothing_flags = NONE
/turf/open/chasm/true/no_smooth/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
return FALSE
/turf/open/chasm/true/no_smooth/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, list/rcd_data)
return FALSE
/turf/open/chasm/true/no_smooth/attackby(obj/item/item, mob/user, params, area/area_restriction)
if(istype(item, /obj/item/stack/rods))
return
else if(ismetaltile(item))
return
return ..()