From f57bdc39a254f734e0bcf6c30a2716aea6f919d6 Mon Sep 17 00:00:00 2001 From: Poojawa Date: Mon, 23 Sep 2019 02:03:37 -0500 Subject: [PATCH] I still fucking hate components. --- code/datums/components/cleaning.dm | 17 +++++++++++++---- code/game/machinery/suit_storage_unit.dm | 1 + code/game/machinery/washing_machine.dm | 1 + .../objects/effects/decals/cleanable/robots.dm | 1 - code/game/objects/items/mop.dm | 1 + code/game/objects/structures/watercloset.dm | 4 ++++ code/game/turfs/open.dm | 1 + code/modules/clothing/clothing.dm | 1 - .../mob/living/simple_animal/hostile/alien.dm | 1 + .../projectiles/projectile/bullets/smg.dm | 10 ++++++++++ .../chemistry/reagents/other_reagents.dm | 9 +++++++++ .../reagents/reagent_containers/blood_pack.dm | 5 ++++- 12 files changed, 45 insertions(+), 7 deletions(-) diff --git a/code/datums/components/cleaning.dm b/code/datums/components/cleaning.dm index e37b0f80df..5324a87fee 100644 --- a/code/datums/components/cleaning.dm +++ b/code/datums/components/cleaning.dm @@ -8,30 +8,39 @@ /datum/component/cleaning/proc/Clean() var/atom/movable/AM = parent - var/turf/tile = AM.loc - if(!isturf(tile)) - return - for(var/A in tile) + var/turf/T = AM.loc + SEND_SIGNAL(T, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) + for(var/A in T) if(is_cleanable(A)) qdel(A) else if(isitem(A)) var/obj/item/cleaned_item = A + SEND_SIGNAL(cleaned_item, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) cleaned_item.clean_blood() + if(ismob(cleaned_item.loc)) + var/mob/M = cleaned_item.loc + M.regenerate_icons() else if(ishuman(A)) var/mob/living/carbon/human/cleaned_human = A if(cleaned_human.lying) if(cleaned_human.head) + SEND_SIGNAL(cleaned_human.head, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) cleaned_human.head.clean_blood() cleaned_human.update_inv_head() if(cleaned_human.wear_suit) + SEND_SIGNAL(cleaned_human.wear_suit, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) cleaned_human.wear_suit.clean_blood() cleaned_human.update_inv_wear_suit() else if(cleaned_human.w_uniform) + SEND_SIGNAL(cleaned_human.w_uniform, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) cleaned_human.w_uniform.clean_blood() cleaned_human.update_inv_w_uniform() if(cleaned_human.shoes) + SEND_SIGNAL(cleaned_human.shoes, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) cleaned_human.shoes.clean_blood() cleaned_human.update_inv_shoes() + SEND_SIGNAL(cleaned_human, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) cleaned_human.clean_blood() cleaned_human.wash_cream() + cleaned_human.regenerate_icons() to_chat(cleaned_human, "[src] cleans your face!") \ No newline at end of file diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 1c14f0c2a4..34fcbf0590 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -247,6 +247,7 @@ visible_message("[src]'s door slides open, barraging you with the nauseating smell of charred flesh.") playsound(src, 'sound/machines/airlockclose.ogg', 25, 1) for(var/obj/item/I in src) //Scorches away blood and forensic evidence, although the SSU itself is unaffected + SEND_SIGNAL(I, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRONG) I.clean_blood() I.fingerprints = list() var/datum/component/radioactive/contamination = I.GetComponent(/datum/component/radioactive) diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm index 2ff7ee1a13..8be079656b 100644 --- a/code/game/machinery/washing_machine.dm +++ b/code/game/machinery/washing_machine.dm @@ -64,6 +64,7 @@ /obj/machinery/washing_machine/proc/wash_cycle() for(var/X in contents) var/atom/movable/AM = X + SEND_SIGNAL(AM, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) AM.clean_blood() AM.machine_wash(src) diff --git a/code/game/objects/effects/decals/cleanable/robots.dm b/code/game/objects/effects/decals/cleanable/robots.dm index bd88afbdfb..02bf51bdd9 100644 --- a/code/game/objects/effects/decals/cleanable/robots.dm +++ b/code/game/objects/effects/decals/cleanable/robots.dm @@ -50,7 +50,6 @@ random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7") blood_state = BLOOD_STATE_OIL bloodiness = BLOOD_AMOUNT_PER_DECAL - c /obj/effect/decal/cleanable/oil/Initialize() . = ..() diff --git a/code/game/objects/items/mop.dm b/code/game/objects/items/mop.dm index 65246aefa4..3f7fe7ee8d 100644 --- a/code/game/objects/items/mop.dm +++ b/code/game/objects/items/mop.dm @@ -26,6 +26,7 @@ /obj/item/mop/proc/clean(turf/A) if(reagents.has_reagent("water", 1) || reagents.has_reagent("holywater", 1) || reagents.has_reagent("vodka", 1) || reagents.has_reagent("cleaner", 1)) + SEND_SIGNAL(A, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_MEDIUM) A.clean_blood() for(var/obj/effect/O in A) if(is_cleanable(O)) diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 99c43d85be..39a42f592a 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -317,6 +317,7 @@ /obj/machinery/shower/proc/wash_obj(obj/O) + . = SEND_SIGNAL(O, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) . = O.clean_blood() O.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) if(isitem(O)) @@ -330,12 +331,14 @@ var/turf/tile = loc tile.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) tile.clean_blood() + SEND_SIGNAL(tile, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) for(var/obj/effect/E in tile) if(is_cleanable(E)) qdel(E) /obj/machinery/shower/proc/wash_mob(mob/living/L) + SEND_SIGNAL(L, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) L.wash_cream() L.ExtinguishMob() L.adjust_fire_stacks(-20) //Douse ourselves with water to avoid fire more easily @@ -553,6 +556,7 @@ busy = FALSE return 1 busy = FALSE + SEND_SIGNAL(O, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) O.clean_blood() O.acid_level = 0 create_reagents(5) diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm index 62cd626d5d..bd24e0ff93 100644 --- a/code/game/turfs/open.dm +++ b/code/game/turfs/open.dm @@ -250,6 +250,7 @@ for(var/mob/living/simple_animal/slime/M in src) M.apply_water() + SEND_SIGNAL(src, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) clean_blood() for(var/obj/effect/O in src) if(is_cleanable(O)) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 776709f5b8..ed3e9f9b89 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -157,7 +157,6 @@ cut_overlay(damaged_clothes_icons[index], TRUE) - /* SEE_SELF // can see self, no matter what SEE_MOBS // can see all mobs, no matter what diff --git a/code/modules/mob/living/simple_animal/hostile/alien.dm b/code/modules/mob/living/simple_animal/hostile/alien.dm index 004a298e30..5240b4d06c 100644 --- a/code/modules/mob/living/simple_animal/hostile/alien.dm +++ b/code/modules/mob/living/simple_animal/hostile/alien.dm @@ -176,6 +176,7 @@ qdel(target) return TRUE var/atom/movable/M = target + SEND_SIGNAL(M, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) M.clean_blood() visible_message("[src] polishes \the [target].") return TRUE diff --git a/code/modules/projectiles/projectile/bullets/smg.dm b/code/modules/projectiles/projectile/bullets/smg.dm index 836ca5ac83..42aef1ec9d 100644 --- a/code/modules/projectiles/projectile/bullets/smg.dm +++ b/code/modules/projectiles/projectile/bullets/smg.dm @@ -17,27 +17,37 @@ /obj/item/projectile/bullet/c45_cleaning/on_hit(atom/target, blocked = FALSE) . = ..() var/turf/T = get_turf(target) + SEND_SIGNAL(T, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) for(var/A in T) if(is_cleanable(A)) qdel(A) else if(isitem(A)) var/obj/item/cleaned_item = A + SEND_SIGNAL(cleaned_item, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) cleaned_item.clean_blood() + if(ismob(cleaned_item.loc)) + var/mob/M = cleaned_item.loc + M.regenerate_icons() else if(ishuman(A)) var/mob/living/carbon/human/cleaned_human = A if(cleaned_human.lying) if(cleaned_human.head) + SEND_SIGNAL(cleaned_human.head, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) cleaned_human.head.clean_blood() cleaned_human.update_inv_head() if(cleaned_human.wear_suit) + SEND_SIGNAL(cleaned_human.wear_suit, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) cleaned_human.wear_suit.clean_blood() cleaned_human.update_inv_wear_suit() else if(cleaned_human.w_uniform) + SEND_SIGNAL(cleaned_human.w_uniform, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) cleaned_human.w_uniform.clean_blood() cleaned_human.update_inv_w_uniform() if(cleaned_human.shoes) + SEND_SIGNAL(cleaned_human.shoes, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) cleaned_human.shoes.clean_blood() cleaned_human.update_inv_shoes() + SEND_SIGNAL(cleaned_human, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) cleaned_human.clean_blood() cleaned_human.wash_cream() cleaned_human.regenerate_icons() diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 4ec5bc469b..f2b884584b 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -1201,11 +1201,13 @@ else if(O) O.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) + SEND_SIGNAL(O, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) O.clean_blood() /datum/reagent/space_cleaner/reaction_turf(turf/T, reac_volume) if(reac_volume >= 1) T.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) + SEND_SIGNAL(T, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) T.clean_blood() for(var/obj/effect/decal/cleanable/C in T) qdel(C) @@ -1224,25 +1226,32 @@ H.lip_style = null H.update_body() for(var/obj/item/I in C.held_items) + SEND_SIGNAL(I, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) I.clean_blood() if(C.wear_mask) + SEND_SIGNAL(C.wear_mask, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) if(C.wear_mask.clean_blood()) C.update_inv_wear_mask() if(ishuman(M)) var/mob/living/carbon/human/H = C if(H.head) + SEND_SIGNAL(H.head, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) if(H.head.clean_blood()) H.update_inv_head() if(H.wear_suit) + SEND_SIGNAL(H.wear_suit, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) if(H.wear_suit.clean_blood()) H.update_inv_wear_suit() else if(H.w_uniform) + SEND_SIGNAL(H.w_uniform, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) if(H.w_uniform.clean_blood()) H.update_inv_w_uniform() if(H.shoes) + SEND_SIGNAL(H.shoes, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) if(H.shoes.clean_blood()) H.update_inv_shoes() H.wash_cream() + SEND_SIGNAL(M, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) M.clean_blood() /datum/reagent/space_cleaner/ez_clean diff --git a/code/modules/reagents/reagent_containers/blood_pack.dm b/code/modules/reagents/reagent_containers/blood_pack.dm index ae3b4f58fb..fe35981bfe 100644 --- a/code/modules/reagents/reagent_containers/blood_pack.dm +++ b/code/modules/reagents/reagent_containers/blood_pack.dm @@ -49,7 +49,7 @@ /obj/item/reagent_containers/blood/random/Initialize() icon_state = "bloodpack" - blood_type = pick("A+", "A-", "B+", "B-", "O+", "O-", "L", "SY", "HF", "GEL") + blood_type = pick("A+", "A-", "B+", "B-", "O+", "O-", "L", "SY", "HF", "GEL", "BUG") return ..() /obj/item/reagent_containers/blood/APlus @@ -85,6 +85,9 @@ /obj/item/reagent_containers/blood/jellyblood blood_type = "GEL" +/obj/item/reagent_containers/blood/insect + blood_type = "BUG" + /obj/item/reagent_containers/blood/attackby(obj/item/I, mob/user, params) if (istype(I, /obj/item/pen) || istype(I, /obj/item/toy/crayon)) if(!user.is_literate())