Fixed vitality not decreasing if you had items with negative consumption rate.

Contributed by facab.
This commit is contained in:
MobiusDevelopment 2020-05-07 11:01:52 +00:00
parent 31ae41bb48
commit b07848fb1e
15 changed files with 45 additions and 90 deletions

View File

@ -547,15 +547,12 @@ public class PlayerStat extends PlayableStat
if (points < 0) // vitality consumed
{
final int stat = (int) getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (stat == 0)
double consumeRate = getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (consumeRate <= 0)
{
return;
}
if (stat < 0)
{
points = -points;
}
points *= consumeRate;
}
if (points > 0)

View File

@ -549,15 +549,12 @@ public class PlayerStat extends PlayableStat
if (points < 0) // vitality consumed
{
final int stat = (int) getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (stat == 0)
double consumeRate = getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (consumeRate <= 0)
{
return;
}
if (stat < 0)
{
points = -points;
}
points *= consumeRate;
}
if (points > 0)

View File

@ -549,15 +549,12 @@ public class PlayerStat extends PlayableStat
if (points < 0) // vitality consumed
{
final int stat = (int) getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (stat == 0)
double consumeRate = getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (consumeRate <= 0)
{
return;
}
if (stat < 0)
{
points = -points;
}
points *= consumeRate;
}
if (points > 0)

View File

@ -544,15 +544,12 @@ public class PlayerStat extends PlayableStat
if (points < 0) // vitality consumed
{
final int stat = (int) getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (stat == 0)
double consumeRate = getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (consumeRate <= 0)
{
return;
}
if (stat < 0)
{
points = -points;
}
points *= consumeRate;
}
if (points > 0)

View File

@ -550,15 +550,12 @@ public class PlayerStat extends PlayableStat
if (points < 0) // vitality consumed
{
final int stat = (int) getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (stat == 0)
double consumeRate = getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (consumeRate <= 0)
{
return;
}
if (stat < 0)
{
points = -points;
}
points *= consumeRate;
}
if (points > 0)

View File

@ -550,15 +550,12 @@ public class PlayerStat extends PlayableStat
if (points < 0) // vitality consumed
{
final int stat = (int) getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (stat == 0)
double consumeRate = getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (consumeRate <= 0)
{
return;
}
if (stat < 0)
{
points = -points;
}
points *= consumeRate;
}
if (points > 0)

View File

@ -550,15 +550,12 @@ public class PlayerStat extends PlayableStat
if (points < 0) // vitality consumed
{
final int stat = (int) getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (stat == 0)
double consumeRate = getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (consumeRate <= 0)
{
return;
}
if (stat < 0)
{
points = -points;
}
points *= consumeRate;
}
if (points > 0)

View File

@ -548,15 +548,12 @@ public class PlayerStat extends PlayableStat
if (points < 0) // vitality consumed
{
final int stat = (int) getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (stat == 0)
double consumeRate = getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (consumeRate <= 0)
{
return;
}
if (stat < 0)
{
points = -points;
}
points *= consumeRate;
}
if (points > 0)

View File

@ -544,15 +544,12 @@ public class PlayerStat extends PlayableStat
if (points < 0) // vitality consumed
{
final int stat = (int) getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (stat == 0)
double consumeRate = getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (consumeRate <= 0)
{
return;
}
if (stat < 0)
{
points = -points;
}
points *= consumeRate;
}
if (points > 0)

View File

@ -544,15 +544,12 @@ public class PlayerStat extends PlayableStat
if (points < 0) // vitality consumed
{
final int stat = (int) getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (stat == 0)
double consumeRate = getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (consumeRate <= 0)
{
return;
}
if (stat < 0)
{
points = -points;
}
points *= consumeRate;
}
if (points > 0)

View File

@ -544,15 +544,12 @@ public class PlayerStat extends PlayableStat
if (points < 0) // vitality consumed
{
final int stat = (int) getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (stat == 0)
double consumeRate = getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (consumeRate <= 0)
{
return;
}
if (stat < 0)
{
points = -points;
}
points *= consumeRate;
}
if (points > 0)

View File

@ -545,15 +545,12 @@ public class PlayerStat extends PlayableStat
if (points < 0) // vitality consumed
{
final int stat = (int) getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (stat == 0)
double consumeRate = getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (consumeRate <= 0)
{
return;
}
if (stat < 0)
{
points = -points;
}
points *= consumeRate;
}
if (points > 0)

View File

@ -545,15 +545,12 @@ public class PlayerStat extends PlayableStat
if (points < 0) // vitality consumed
{
final int stat = (int) getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (stat == 0)
double consumeRate = getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (consumeRate <= 0)
{
return;
}
if (stat < 0)
{
points = -points;
}
points *= consumeRate;
}
if (points > 0)

View File

@ -543,15 +543,12 @@ public class PlayerStat extends PlayableStat
if (points < 0) // vitality consumed
{
final int stat = (int) getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (stat == 0)
double consumeRate = getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (consumeRate <= 0)
{
return;
}
if (stat < 0)
{
points = -points;
}
points *= consumeRate;
}
if (points > 0)

View File

@ -544,15 +544,12 @@ public class PlayerStat extends PlayableStat
if (points < 0) // vitality consumed
{
final int stat = (int) getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (stat == 0)
double consumeRate = getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (consumeRate <= 0)
{
return;
}
if (stat < 0)
{
points = -points;
}
points *= consumeRate;
}
if (points > 0)