Effect: Fixed mistake in bitshifting with effect level in instant effects

This should be the amplifier, otherwise the effect will have double-effect on level 1.
This commit is contained in:
Dylan K. Taylor 2017-12-23 11:32:58 +00:00
parent 6332814a04
commit b7aaf54a6f

View File

@ -360,12 +360,12 @@ class Effect{
case Effect::INSTANT_HEALTH:
//TODO: add particles (witch spell)
if($entity->getHealth() < $entity->getMaxHealth()){
$entity->heal(new EntityRegainHealthEvent($entity, 4 << $this->getEffectLevel(), EntityRegainHealthEvent::CAUSE_MAGIC));
$entity->heal(new EntityRegainHealthEvent($entity, 4 << $this->amplifier, EntityRegainHealthEvent::CAUSE_MAGIC));
}
break;
case Effect::INSTANT_DAMAGE:
//TODO: add particles (witch spell)
$entity->attack(new EntityDamageEvent($entity, EntityDamageEvent::CAUSE_MAGIC, 4 << $this->getEffectLevel()));
$entity->attack(new EntityDamageEvent($entity, EntityDamageEvent::CAUSE_MAGIC, 4 << $this->amplifier));
break;
}
}