SteamWar/FightSystem
Archiviert
13
1
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-01-20 18:46:52 +01:00
Ursprung 5a9e281c95
Commit 542547fd5b

Datei anzeigen

@ -97,7 +97,7 @@ public class WinconditionPoints extends PlayerWincondition {
public static class TeamPoints { public static class TeamPoints {
private final FightTeam enemy; private final FightTeam enemy;
private final WinconditionRelativePercent.TeamPercent enemyPercent; private final WinconditionRelativePercent.TeamPercent enemyPercent;
private final double factor; private double factor;
private static final int maxPoints = 2000; private static final int maxPoints = 2000;
private int points; private int points;
@ -107,18 +107,21 @@ public class WinconditionPoints extends PlayerWincondition {
this.enemyPercent = enemyPercent; this.enemyPercent = enemyPercent;
points = 0; points = 0;
if(enemyPercent.getBlockCount() < ownPercent.getBlockCount()) //Prevent NPE
this.factor = 10000; //Original mit 20 (20% = 0.2 ergeben 2000 Punkte Bukkit.getScheduler().runTask(FightSystem.getPlugin(), () ->{
else{ if(enemyPercent.getBlockCount() < ownPercent.getBlockCount())
double f = 10000.0 * ownPercent.getBlockCount() / enemyPercent.getBlockCount(); this.factor = 10000; //Original mit 20 (20% = 0.2 ergeben 2000 Punkte
else{
double f = 10000.0 * ownPercent.getBlockCount() / enemyPercent.getBlockCount();
if(f > 10000) if(f > 10000)
f = 10000; f = 10000;
else if(f < 4000) else if(f < 4000)
f = 4000; f = 4000;
this.factor = f; this.factor = f;
} }
});
} }
public int getPoints(){ public int getPoints(){