Effect: Hunger is supposed to apply every tick

This fixes oddities in the behaviour noticeable with higher effect levels.
This commit is contained in:
Dylan K. Taylor 2017-12-23 11:15:23 +00:00
parent 36f3accf4b
commit 9d4818d360

View File

@ -314,12 +314,6 @@ class Effect{
}
return true;
case Effect::HUNGER:
if($this->amplifier < 0){ // prevents hacking with amplifier -1
return false;
}
if(($interval = 20) > 0){
return ($this->duration % $interval) === 0;
}
return true;
case Effect::INSTANT_DAMAGE:
case Effect::INSTANT_HEALTH:
@ -360,7 +354,7 @@ class Effect{
case Effect::HUNGER:
if($entity instanceof Human){
$entity->exhaust(0.5 * $this->getEffectLevel(), PlayerExhaustEvent::CAUSE_POTION);
$entity->exhaust(0.025 * $this->getEffectLevel(), PlayerExhaustEvent::CAUSE_POTION);
}
break;
case Effect::INSTANT_HEALTH: