Renaming "timeUntilRegen" to "timeUntilArmorRegen"

Getting ready for health regen implementation.
This commit is contained in:
Fierelier 2018-05-21 13:03:49 +02:00
parent 1acc685861
commit c310e17754

View File

@ -18,7 +18,7 @@ namespace pdHealth
//SETTINGS
//Regeneration
int armorRegen = 25; //How far to regenerate the armor. Set to 0 to disable regenaration entirely.
float armorRegenSpeed = 5f; //How much armor to regenerate per second.
float armorRegenSpeed = 10f; //How much armor to regenerate per second.
float armorRegenDelay = 5f; //Delay after damage before recharging armor. Set to 0 to disable delay.
//Max Armor/Health
@ -32,7 +32,7 @@ namespace pdHealth
//VARIABLES (DO NOT TOUCH)
int armorVal = -1;
int healthVal = -1;
float timeUntilRegen = 0.0f;
float timeUntiArmorlRegen = 0.0f;
float armorDecimalRegen = 0.0f;
private void doHealthTick(object sender, EventArgs e)
@ -52,7 +52,7 @@ namespace pdHealth
if (pl.isAlive == false) {
armorVal = -1;
healthVal = -1;
timeUntilRegen = 0.0f;
timeUntiArmorlRegen = 0.0f;
armorDecimalRegen = 0.0f;
return;
}
@ -77,12 +77,12 @@ namespace pdHealth
}
if (armorRegen > 0) {
if (pl.Armor < armorVal) { armorDecimalRegen = 0.0f; timeUntilRegen = armorRegenDelay; }
if (pl.Health < healthVal) { armorDecimalRegen = 0.0f; timeUntilRegen = armorRegenDelay; }
if (pl.Armor < armorVal) { armorDecimalRegen = 0.0f; timeUntiArmorlRegen = armorRegenDelay; }
if (pl.Health < healthVal) { armorDecimalRegen = 0.0f; timeUntiArmorlRegen = armorRegenDelay; }
if (timeUntilRegen > 0) {
timeUntilRegen = timeUntilRegen - ((1000.0f/GTA.Game.FPS)/1000.0f);
if (timeUntilRegen < 0) { timeUntilRegen = 0; }
if (timeUntiArmorlRegen > 0) {
timeUntiArmorlRegen = timeUntiArmorlRegen - ((1000.0f/GTA.Game.FPS)/1000.0f);
if (timeUntiArmorlRegen < 0) { timeUntiArmorlRegen = 0; }
} else {
if (pl.Armor < armorRegen) {
armorDecimalRegen = armorDecimalRegen + (((1000.0f/GTA.Game.FPS)*armorRegenSpeed)/1000.0f);