Files
Bubberstation/code/datums/components/creamed.dm
SkyratBot 3a0bbe9498 Acid Component (#53273) (#661)
Makes acid levels a component.
    Merges the acid effect object into the component.
    Reworks acids decay rates slightly.
    Rebalances xenos acid spit so that they can still melt through walls.

Misc. associated changes:

    Adds defines for a lot of the acid associated constants.
    Documents clean types and adds CLEAN_TYPE_ACID
    Adds and implements a return bitflag for COMSIG_COMPONENT_CLEAN_ACT
    Adds a looping sound for acid.
    Makes /atom/proc/acid_act return a boolean.
    Fixes waterclosets creating a new reagent holder datum every time they are used.
    Removes waterclosets regenerating reagents on-use and restricts their reaction volume to 5 units.
    Adds and implements a couple reagent signals.
    Renames a few vars so Rohesie can stop telling me to rename more vars.

Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
2020-09-07 03:52:59 +02:00

67 lines
1.7 KiB
Plaintext

GLOBAL_LIST_INIT(creamable, typecacheof(list(
/mob/living/carbon/human,
/mob/living/carbon/monkey,
/mob/living/simple_animal/pet/dog/corgi,
/mob/living/silicon/ai)))
/**
* Creamed component
*
* For when you have pie on your face
*/
/datum/component/creamed
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
var/mutable_appearance/creamface
/datum/component/creamed/Initialize()
if(!is_type_in_typecache(parent, GLOB.creamable))
return COMPONENT_INCOMPATIBLE
creamface = mutable_appearance('icons/effects/creampie.dmi')
if(ishuman(parent))
var/mob/living/carbon/human/H = parent
if(H.dna.species.limbs_id == "lizard")
creamface.icon_state = "creampie_lizard"
else
creamface.icon_state = "creampie_human"
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "creampie", /datum/mood_event/creampie)
else if(ismonkey(parent))
creamface.icon_state = "creampie_monkey"
else if(iscorgi(parent))
creamface.icon_state = "creampie_corgi"
else if(isAI(parent))
creamface.icon_state = "creampie_ai"
var/atom/A = parent
A.add_overlay(creamface)
/datum/component/creamed/Destroy(force, silent)
var/atom/A = parent
A.cut_overlay(creamface)
qdel(creamface)
if(ishuman(A))
SEND_SIGNAL(A, COMSIG_CLEAR_MOOD_EVENT, "creampie")
return ..()
/datum/component/creamed/RegisterWithParent()
RegisterSignal(parent, list(
COMSIG_COMPONENT_CLEAN_ACT,
COMSIG_COMPONENT_CLEAN_FACE_ACT),
.proc/clean_up)
/datum/component/creamed/UnregisterFromParent()
UnregisterSignal(parent, list(
COMSIG_COMPONENT_CLEAN_ACT,
COMSIG_COMPONENT_CLEAN_FACE_ACT))
///Callback to remove pieface
/datum/component/creamed/proc/clean_up(datum/source, clean_types)
SIGNAL_HANDLER
. = NONE
if(!(clean_types & CLEAN_TYPE_BLOOD))
qdel(src)
return COMPONENT_CLEANED