Readying for decimal armor regeneration

This commit is contained in:
Fierelier 2018-05-19 14:31:49 +02:00
parent b484e1e541
commit ef51805cb8

View File

@ -16,12 +16,9 @@ namespace pdHealth
}
//SETTINGS
//Script
int tickTime = 100; //Tick-Rate in ms.
//Regeneration
int armorRegen = 25; //How far to regenerate the armor. Set to 0 to disable regenaration entirely.
int armorRegenSpeed = 1; //How much armor to regenerate per tick.
int armorRegenSpeed = 1; //How much armor to regenerate per second.
int armorRegenDelay = 5000; //Delay after damage before recharging armor. Set to 0 to disable delay.
//Max Armor/Health
@ -55,7 +52,6 @@ namespace pdHealth
armorVal = -1;
healthVal = -1;
timeUntilRegen = 0;
Wait(tickTime);
return;
}
@ -83,7 +79,7 @@ namespace pdHealth
if (pl.Health < healthVal) { timeUntilRegen = armorRegenDelay; }
if (timeUntilRegen > 0) {
timeUntilRegen = timeUntilRegen - tickTime;
timeUntilRegen = timeUntilRegen - 17;
if (timeUntilRegen < 0) { timeUntilRegen = 0; }
} else {
if (pl.Armor < armorRegen) {
@ -95,7 +91,6 @@ namespace pdHealth
armorVal = pl.Armor;
healthVal = pl.Health;
Wait(tickTime);
}
}
}