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