Fixed absorption application logic, close #518

This commit is contained in:
Dylan K. Taylor 2017-04-05 21:15:58 +01:00
parent 202bac28fc
commit 1c2895eb12

View File

@ -440,14 +440,10 @@ class Effect{
$attr->setMaxValue($max);
break;
case Effect::ABSORPTION:
if($ev->willModify() and $oldEffect !== null){
$value = $entity->getAbsorption() - (4 * ($oldEffect->getAmplifier() + 1));
}else{
$value = $entity->getAbsorption();
$new = (4 * ($this->amplifier + 1));
if($new > $entity->getAbsorption()){
$entity->setAbsorption($new);
}
$value += (4 * ($this->amplifier + 1));
$entity->setAbsorption($value);
break;
}
@ -490,7 +486,7 @@ class Effect{
$attr->setMaxValue($attr->getMaxValue() - (4 * ($this->amplifier + 1)));
break;
case Effect::ABSORPTION:
$entity->setAbsorption($entity->getAbsorption() - (4 * ($this->amplifier + 1)));
$entity->setAbsorption(0);
break;
}
}