mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +01:00
[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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user