[MIRROR] Fixes ooze eating (#8366)

* Fixes ooze eating (#61029)

Oozes now properly communicates with the edible component to be able to eat objects.

* Fixes ooze eating

Co-authored-by: AMonkeyThatCodes <20987591+AMonkeyThatCodes@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-09-24 18:25:29 +01:00
committed by GitHub
co-authored by AMonkeyThatCodes
parent 8d6d043edd
commit 75c6aeaa82
3 changed files with 26 additions and 34 deletions
+12
View File
@@ -70,6 +70,7 @@ Behavior that's still missing from this component that original food items had t
RegisterSignal(parent, COMSIG_ATOM_CREATEDBY_PROCESSING, .proc/OnProcessed)
RegisterSignal(parent, COMSIG_ITEM_MICROWAVE_COOKED, .proc/OnMicrowaveCooked)
RegisterSignal(parent, COMSIG_EDIBLE_INGREDIENT_ADDED, .proc/edible_ingredient_added)
RegisterSignal(parent, COMSIG_OOZE_EAT_ATOM, .proc/on_ooze_eat)
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = .proc/on_entered,
@@ -485,3 +486,14 @@ Behavior that's still missing from this component that original food items had t
tastes[t] += E.tastes[t]
foodtypes |= E.foodtypes
/// Response to oozes trying to eat something edible
/datum/component/edible/proc/on_ooze_eat(datum/source, mob/eater, edible_flags)
SIGNAL_HANDLER
if(foodtypes & edible_flags)
var/atom/eaten_food = parent
eaten_food.reagents.trans_to(eater, eaten_food.reagents.total_volume, transfered_by = eater)
eater.visible_message(span_warning("[src] eats [eaten_food]!"), span_notice("You eat [eaten_food]."))
playsound(get_turf(eater),'sound/items/eatfood.ogg', rand(30,50), TRUE)
qdel(eaten_food)
return COMPONENT_ATOM_EATEN