[MIRROR] Refactors burgers to use components & auto-eating (#569)

* Refactors burgers to use components & auto-eating (#53224)

* Refactors burgers to use components & auto-eating

Co-authored-by: Qustinnus <Floydje123@hotmail.com>
This commit is contained in:
SkyratBot
2020-08-30 05:13:44 +02:00
committed by GitHub
co-authored by Qustinnus
parent 3855bc2433
commit 656ee54f39
14 changed files with 433 additions and 468 deletions
+13 -1
View File
@@ -40,7 +40,7 @@ Behavior that's still missing from this component that original food items had t
food_flags = NONE,
foodtypes = NONE,
volume = 50,
eat_time = 30,
eat_time = 10,
list/tastes,
list/eatverbs = list("bite","chew","nibble","gnaw","gobble","chomp"),
bite_consumption = 2,
@@ -55,6 +55,9 @@ Behavior that's still missing from this component that original food items had t
if(isitem(parent))
RegisterSignal(parent, COMSIG_ITEM_ATTACK, .proc/UseFromHand)
RegisterSignal(parent, COMSIG_ITEM_FRIED, .proc/OnFried)
var/obj/item/item = parent
item.grind_results = list() //Cursed but this is how snacks did it, grinding needs a refactor in the future.
else if(isturf(parent))
RegisterSignal(parent, COMSIG_ATOM_ATTACK_HAND, .proc/TryToEatTurf)
@@ -144,8 +147,12 @@ Behavior that's still missing from this component that original food items had t
set waitfor = FALSE
if(QDELETED(parent))
return
var/atom/owner = parent
if(feeder.a_intent == INTENT_HARM)
return
if(!owner.reagents.total_volume)//Shouldn't be needed but it checks to see if it has anything left in it.
@@ -203,6 +210,11 @@ Behavior that's still missing from this component that original food items had t
TakeBite(eater, feeder)
//If we're not force-feeding, try take another bite
if(eater == feeder)
INVOKE_ASYNC(src, .proc/TryToEat, eater, feeder)
///This function lets the eater take a bite and transfers the reagents to the eater.
/datum/component/edible/proc/TakeBite(mob/living/eater, mob/living/feeder)