mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Fixed absorption application logic, close #518
This commit is contained in:
parent
202bac28fc
commit
1c2895eb12
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user