Made armor-regenaration disableable

This commit is contained in:
Fierelier 2018-05-15 10:24:55 +02:00
parent 94bbbbb104
commit 6bd4804acb

View File

@ -75,16 +75,18 @@ namespace pdHealth
} }
} }
if (pl.Armor < armorVal) { timeUntilRegen = armorRegenDelay; } if (armorRegen > 0) {
if (pl.Health < healthVal) { timeUntilRegen = armorRegenDelay; } if (pl.Armor < armorVal) { timeUntilRegen = armorRegenDelay; }
if (pl.Health < healthVal) { timeUntilRegen = armorRegenDelay; }
if (timeUntilRegen > 0) {
timeUntilRegen = timeUntilRegen - tickTime; if (timeUntilRegen > 0) {
if (timeUntilRegen < 0) { timeUntilRegen = 0; } timeUntilRegen = timeUntilRegen - tickTime;
} else { if (timeUntilRegen < 0) { timeUntilRegen = 0; }
if (pl.Armor < armorRegen) { } else {
pl.Armor = pl.Armor + armorRegenSpeed; if (pl.Armor < armorRegen) {
if (pl.Armor > armorRegen) { pl.Armor = armorRegen; } pl.Armor = pl.Armor + armorRegenSpeed;
if (pl.Armor > armorRegen) { pl.Armor = armorRegen; }
}
} }
} }