Human: Fixed XP drop amount to match vanilla

In vanilla it doesn't drop the exact number of points you collected. Rather, you lose a little for every level above 1 you had (1 level requires 7 points, later levels require +2 per level), and can recover at most 100 points. Hence, if you had 10 levels, you get back enough points to fill 5 levels and most of a 6th. 14-15 levels gets you the upper bound of about 7.5 levels.
This commit is contained in:
Dylan K. Taylor 2019-01-23 12:39:25 +00:00
parent e6d1c1dfbc
commit dc89b48354

View File

@ -578,7 +578,9 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
}
public function getXpDropAmount() : int{
return (int) min(100, $this->getCurrentTotalXp());
//this causes some XP to be lost on death when above level 1 (by design), dropping at most enough points for
//about 7.5 levels of XP.
return (int) min(100, 7 * $this->getXpLevel());
}
public function getInventory(){