Merge branch 'stable'

This commit is contained in:
Dylan K. Taylor
2020-12-29 18:00:09 +00:00
4 changed files with 38 additions and 7 deletions

View File

@ -269,13 +269,20 @@ abstract class Living extends Entity{
* etc.
*/
public function consumeObject(Consumable $consumable) : bool{
$this->applyConsumptionResults($consumable);
return true;
}
/**
* Applies effects from consuming the object. This shouldn't do any can-consume checks (those are expected to be
* handled by the caller).
*/
protected function applyConsumptionResults(Consumable $consumable) : void{
foreach($consumable->getAdditionalEffects() as $effect){
$this->effectManager->add($effect);
}
$consumable->onConsume($this);
return true;
}
/**