mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-23 11:26:37 +00:00
Effect: Implement Saturation effect
I thought I did this months ago, but apparently not. Whatever, it's here now.
This commit is contained in:
parent
b7aaf54a6f
commit
329fe7d844
@ -317,6 +317,7 @@ class Effect{
|
|||||||
return true;
|
return true;
|
||||||
case Effect::INSTANT_DAMAGE:
|
case Effect::INSTANT_DAMAGE:
|
||||||
case Effect::INSTANT_HEALTH:
|
case Effect::INSTANT_HEALTH:
|
||||||
|
case Effect::SATURATION:
|
||||||
//If forced to last longer than 1 tick, these apply every tick.
|
//If forced to last longer than 1 tick, these apply every tick.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -367,6 +368,12 @@ class Effect{
|
|||||||
//TODO: add particles (witch spell)
|
//TODO: add particles (witch spell)
|
||||||
$entity->attack(new EntityDamageEvent($entity, EntityDamageEvent::CAUSE_MAGIC, 4 << $this->amplifier));
|
$entity->attack(new EntityDamageEvent($entity, EntityDamageEvent::CAUSE_MAGIC, 4 << $this->amplifier));
|
||||||
break;
|
break;
|
||||||
|
case Effect::SATURATION:
|
||||||
|
if($entity instanceof Human){
|
||||||
|
$entity->addFood($this->getEffectLevel());
|
||||||
|
$entity->addSaturation($this->getEffectLevel() * 2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user