Files
Paradise/code/datums/elements/rust_element.dm
Kyani 203105788c [IDB Ignore] Heretic: The Mansus Re-Opened (#30738)
* fixes

* fuck my stupid chungus life

* Minion limit, heal fix, dead sac fix

* cooldown, no sacrificing star gazer or ascended alive heretics

* blade debuff

* oopsy

* Update tgui.bundle.js

* map diff bot what ya doing

* fuck that chat spam

* lets heretic armour hold a haunted longsword

* why not it makes sense

* do_after

* god I hate this bullshit

* other lewc stuff

* push

* heretic id card fix

* she tg on my ui till I css

* yes

* spent

* fix / ipc buff (real)™️

* moderate again

* revert

* no reserve

* bringing up to master

* update map files to master

* didnt replace centcomm

* beginning some rebalancing

* aggressive spread tweaks

* lots of tweaks and fixes

* trying to un-key the maps

* maybe this time

* this time????

* oops

* sql fix

* basicmob conversion

* paintings! and a critical influence fix

* rust + tweaks

* monster tweak

* small change

* removing this

* more tweaks. no more dusting

* added some examine_more

* flower seeds

* various tweaks. more to come

* no more conduit spacing

* fixed some dumb stuff

* silly stuff

* its always prettier

* bugfixes and linters

* linters, wow

* oops

* bah

* linter

* fuck you

* temp check

* hidden influence drain

* influence visible message

* tweak fix

* void cloak bugfix

* small fixes

* fixes

* do_after_once broken

* fixes and tweaks

* heretic blade potential fix + sacrifice changes

* batch of fixes

* tiny tweak

* rebuilt TGUI

* no greentext + rerolls

* logging + bugfix

* unused var

* small fix

* various fixes

* comment

* projectile change

* tgui rebuild

* tgui bundle redo

* rune issue solved

* influence visible now

* fix ui reloading

* new moon ascension + fixes + icons

* tweaks, species sprites

* tgui rebuild

* small tweak + linter

* harvester icon tweak

* spans

* fixes and tweaks

* caretaker nerf + tweaks

* potential fix for knowledge

* roller fix

* mad mask

* Update tgui.bundle.js

* void phase tweak

* Update tgui.bundle.js

* misc tweaks

* fix heretic not retargeting correctly with cryo

* simplify logic

* this is better

* lots of fixes and tweaks

* Update tgui.bundle.js

* linter

* linter

* fireshark and greyscale insanity

* fish

* Update tgui.bundle.js

* linter

* linter

* tgui

* no window shopping

* fish fix

* tgui rebundle

* moon smile runtime fix

* various fixes

* sacrifice fixes

* insanity is easier now, madness mask changes.

* bugfixing + teleport change

* linters + tweaks

* Update code/modules/antagonists/heretic/status_effects/mark_effects.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com>

* Update code/modules/antagonists/heretic/status_effects/mark_effects.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com>

---------

Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com>
Co-authored-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: warriorstar-orion <orion@snowfrost.garden>
Co-authored-by: Paul <pmerkamp@gmail.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
2026-01-27 20:36:52 +00:00

127 lines
4.5 KiB
Plaintext

/**
* Adding this element to an atom will have it automatically render an overlay.
*/
/datum/element/rust
element_flags = ELEMENT_BESPOKE | ELEMENT_DETACH_ON_HOST_DESTROY // Detach for turfs
argument_hash_start_idx = 2
/// The rust image itself, since the icon and icon state are only used as an argument
var/image/rust_overlay
/datum/element/rust/Attach(atom/target, rust_icon = 'icons/effects/rust_overlay.dmi', rust_icon_state = "rust_default")
. = ..()
if(!isatom(target))
return ELEMENT_INCOMPATIBLE
rust_overlay = image(rust_icon, "rust[rand(1, 6)]")
ADD_TRAIT(target, TRAIT_RUSTY, "rusted_turf")
RegisterSignal(target, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(apply_rust_overlay))
RegisterSignal(target, COMSIG_PARENT_EXAMINE, PROC_REF(handle_examine))
RegisterSignal(target, COMSIG_INTERACT_TARGET, PROC_REF(on_interaction))
RegisterSignal(target, COMSIG_TOOL_ATTACK, PROC_REF(welder_tool_act))
// Unfortunately registering with parent sometimes doesn't cause an overlay update
target.update_appearance()
/datum/element/rust/Detach(atom/source)
. = ..()
UnregisterSignal(source, COMSIG_ATOM_UPDATE_OVERLAYS)
UnregisterSignal(source, COMSIG_PARENT_EXAMINE)
UnregisterSignal(source, COMSIG_TOOL_ATTACK)
UnregisterSignal(source, COMSIG_INTERACT_TARGET)
REMOVE_TRAIT(source, TRAIT_RUSTY, "rusted_turf")
source.cut_overlays()
source.update_appearance()
/datum/element/rust/proc/handle_examine(datum/source, mob/user, list/examine_list)
SIGNAL_HANDLER //COMSIG_PARENT_EXAMINE
examine_list += SPAN_NOTICE("[source] is very rusty, you could probably <b>burn</b> it off.")
/datum/element/rust/proc/apply_rust_overlay(atom/parent_atom, list/overlays)
SIGNAL_HANDLER //COMSIG_ATOM_UPDATE_OVERLAYS
if(rust_overlay)
overlays += rust_overlay
/// Because do_after sleeps we register the signal here and defer via an async call
/datum/element/rust/proc/welder_tool_act(atom/source, obj/item/item, mob/user)
SIGNAL_HANDLER // COMSIG_TOOL_ATTACK
INVOKE_ASYNC(src, PROC_REF(handle_tool_use), source, item, user)
return COMPONENT_CANCEL_TOOLACT
/// We call this from secondary_tool_act because we sleep with do_after
/datum/element/rust/proc/handle_tool_use(atom/source, obj/item/item, mob/user)
switch(item.tool_behaviour)
if(TOOL_WELDER)
if(!item.tool_start_check(source, user, amount=1))
return
to_chat(user, SPAN_NOTICE("You start burning off the rust..."))
if(!item.use_tool(source, user, 5 SECONDS, volume = item.tool_volume))
return
to_chat(user, SPAN_NOTICE("You burn off the rust!"))
Detach(source)
return
/// Prevents placing floor tiles on rusted turf
/datum/element/rust/proc/on_interaction(datum/source, mob/living/user, obj/item/tool, list/modifiers)
SIGNAL_HANDLER // COMSIG_INTERACT_TARGET
if(istype(tool, /obj/item/stack/tile) || istype(tool, /obj/item/stack/rods) || istype(tool, /obj/item/rcd))
to_chat(user, SPAN_WARNING("[source] is too rusted to build on!"))
return ITEM_INTERACT_COMPLETE
/// For rust applied by heretics (if that ever happens) / revenants
/datum/element/rust/heretic
/datum/element/rust/heretic/Attach(atom/target, rust_icon, rust_icon_state)
. = ..()
if(. == ELEMENT_INCOMPATIBLE)
return .
RegisterSignal(target, COMSIG_ATOM_ENTERED, PROC_REF(on_entered))
RegisterSignal(target, COMSIG_ATOM_EXITED, PROC_REF(on_exited))
/datum/element/rust/heretic/Detach(atom/source)
. = ..()
UnregisterSignal(source, COMSIG_ATOM_ENTERED)
UnregisterSignal(source, COMSIG_ATOM_EXITED)
for(var/obj/effect/glowing_rune/rune_to_remove in source)
qdel(rune_to_remove)
for(var/mob/living/victim in source)
victim.remove_status_effect(STATUS_EFFECT_RUST_CORRUPTION)
/datum/element/rust/heretic/proc/on_entered(turf/source, atom/movable/entered, ...)
SIGNAL_HANDLER
if(!isliving(entered))
return
var/mob/living/victim = entered
if(istype(victim, /mob/living/basic/revenant))
return
if(IS_HERETIC_OR_MONSTER(victim))
return
victim.apply_status_effect(STATUS_EFFECT_RUST_CORRUPTION)
/datum/element/rust/heretic/proc/on_exited(turf/source, atom/movable/gone)
SIGNAL_HANDLER
if(!isliving(gone))
return
var/mob/living/leaver = gone
if(IS_HERETIC_OR_MONSTER(leaver))
return
leaver.remove_status_effect(STATUS_EFFECT_RUST_CORRUPTION)
// Small visual effect imparted onto rusted things by revenants.
/obj/effect/glowing_rune
icon = 'icons/effects/eldritch.dmi'
icon_state = "small_rune_1"
plane = FLOOR_PLANE
layer = SIGIL_LAYER
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/obj/effect/glowing_rune/Initialize(mapload)
. = ..()
pixel_y = rand(-6, 6)
pixel_x = rand(-6, 6)
icon_state = "small_rune_[rand(1, 12)]"
update_appearance()