mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-26 17:11:52 +00:00
* Don't initialize the atom_colours list on atoms until it's actually needed * Moved bloody_hands var to mob/living/carbon/human instead * Added COMSIG_COMPONENT_CLEAN_RADIATION signal to reduce moms spaghetti The shower and suit storage unit now calls this signal instead of either doing it manually or doing it via the washed proc * Cleaned up carbon washing, renamed washed to wash * The wash proc now doesn't take the washer as first arg because that wasn't used anywhere * The wash strength is no longer optional * Carbons now overrides the wash proc instead of using the signal * Properly check for obscuredness before washing any equipped items * Properly wash all items and bloody hands etc * Added clean_lips proc for humans for cleaning any lipstick * Cleaned up washing. Washy stuff now calls wash instead of calling the clean signal directly * Renamed is_cleanable to ismopable, gives this category a more fitting purpose. Many things beyond floor decals are cleanable. It is now also determined using the atom layer instead to make it more generic. * Properly utilize the is_cleanable define * Added wash override for turfs where they also wash any mopables on the same tile * Space cleaner and cleaning element etc now simply washes the mob instead of doing its own manual cleaning on ~some~ equipped items * Non-component washables now simply override wash instead of registering for the clean signal * Fixed some left over clean signal registers not returning true * Added clean_strength var to space cleaner * Moved human wash proc next to the other washing procs * Also wash glasses and mask if not obscured when washing face * Fixed attempting to "scoop up" cleanable decals using a rag * Fixed plasmaman spacehelm icon not updating when washed Also removed a duplicated worn_overlays proc * Fixed head icon not updating when washing lipstick * Moved radioactive clean signal register to where it should be * Added atom radiate VV verb for debugging * Redesigned the CLEAN constants into a more sensible flags setup This makes it more dynamic, cleaning apparatuses can clean more specific than just a cleaning strength. * CLEAN_TYPE_* flags indicate a specific cleanable, such as blood, fingerprints or disease * CLEAN_* consts consist of a combination of cleaning types to make cleaning apparatuses have a consistent behaviour on what they clean * Fixed broken rad removal logic in showers * Apply suggestions from code review Co-authored-by: Rohesie <rohesie@gmail.com> * Removed unneccesary bool from sink code * Fixed wrongly named variable in turf wash * Renamed bloody_hands to blood_in_hands Co-authored-by: Rohesie <rohesie@gmail.com>
90 lines
2.9 KiB
Plaintext
90 lines
2.9 KiB
Plaintext
/datum/component/decal
|
|
dupe_mode = COMPONENT_DUPE_ALLOWED
|
|
can_transfer = TRUE
|
|
var/cleanable
|
|
var/description
|
|
var/mutable_appearance/pic
|
|
|
|
var/first_dir // This only stores the dir arg from init
|
|
|
|
/datum/component/decal/Initialize(_icon, _icon_state, _dir, _cleanable=FALSE, _color, _layer=TURF_LAYER, _description, _alpha=255)
|
|
if(!isatom(parent) || !generate_appearance(_icon, _icon_state, _dir, _layer, _color, _alpha))
|
|
return COMPONENT_INCOMPATIBLE
|
|
first_dir = _dir
|
|
description = _description
|
|
cleanable = _cleanable
|
|
|
|
apply()
|
|
|
|
/datum/component/decal/RegisterWithParent()
|
|
if(first_dir)
|
|
RegisterSignal(parent, COMSIG_ATOM_DIR_CHANGE, .proc/rotate_react)
|
|
if(cleanable != FALSE)
|
|
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, .proc/clean_react)
|
|
if(description)
|
|
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/examine)
|
|
|
|
/datum/component/decal/UnregisterFromParent()
|
|
UnregisterSignal(parent, list(COMSIG_ATOM_DIR_CHANGE, COMSIG_COMPONENT_CLEAN_ACT, COMSIG_PARENT_EXAMINE))
|
|
|
|
/datum/component/decal/Destroy()
|
|
remove()
|
|
return ..()
|
|
|
|
/datum/component/decal/PreTransfer()
|
|
remove()
|
|
|
|
/datum/component/decal/PostTransfer()
|
|
remove()
|
|
apply()
|
|
|
|
/datum/component/decal/proc/generate_appearance(_icon, _icon_state, _dir, _layer, _color, _alpha)
|
|
if(!_icon || !_icon_state)
|
|
return FALSE
|
|
// It has to be made from an image or dir breaks because of a byond bug
|
|
var/temp_image = image(_icon, null, _icon_state, _layer, _dir)
|
|
pic = new(temp_image)
|
|
pic.color = _color
|
|
pic.alpha = _alpha
|
|
return TRUE
|
|
|
|
/datum/component/decal/proc/apply(atom/thing)
|
|
var/atom/master = thing || parent
|
|
RegisterSignal(master,COMSIG_ATOM_UPDATE_OVERLAYS,.proc/apply_overlay)
|
|
if(master.flags_1 & INITIALIZED_1)
|
|
master.update_icon() //could use some queuing here now maybe.
|
|
else
|
|
RegisterSignal(master,COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZE,.proc/late_update_icon)
|
|
if(isitem(master))
|
|
addtimer(CALLBACK(master, /obj/item/.proc/update_slot_icon), 0, TIMER_UNIQUE)
|
|
|
|
/datum/component/decal/proc/late_update_icon(atom/source)
|
|
if(source && istype(source))
|
|
source.update_icon()
|
|
UnregisterSignal(source,COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZE)
|
|
|
|
/datum/component/decal/proc/apply_overlay(atom/source, list/overlay_list)
|
|
overlay_list += pic
|
|
|
|
/datum/component/decal/proc/remove(atom/thing)
|
|
var/atom/master = thing || parent
|
|
UnregisterSignal(master,COMSIG_ATOM_UPDATE_OVERLAYS)
|
|
master.update_icon()
|
|
if(isitem(master))
|
|
addtimer(CALLBACK(master, /obj/item/.proc/update_slot_icon), 0, TIMER_UNIQUE)
|
|
|
|
/datum/component/decal/proc/rotate_react(datum/source, old_dir, new_dir)
|
|
if(old_dir == new_dir)
|
|
return
|
|
remove()
|
|
pic.dir = turn(pic.dir, dir2angle(old_dir) - dir2angle(new_dir))
|
|
apply()
|
|
|
|
/datum/component/decal/proc/clean_react(datum/source, clean_types)
|
|
if(clean_types & cleanable)
|
|
qdel(src)
|
|
return TRUE
|
|
|
|
/datum/component/decal/proc/examine(datum/source, mob/user, list/examine_list)
|
|
examine_list += description
|