Fix points
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
504f23f1d9
Commit
bffa12619c
@ -118,17 +118,20 @@ public class WinconditionPoints extends PercentWincondition implements Listener
|
|||||||
@Override
|
@Override
|
||||||
protected void enable() {
|
protected void enable() {
|
||||||
super.enable();
|
super.enable();
|
||||||
points = 0;
|
TeamPoints opponent = teamMap.get(Fight.getOpposite(fightTeam));
|
||||||
int ownBlocks = totalBlocks;
|
if(opponent.totalBlocks == 0)
|
||||||
int enemyBlocks = teamMap.get(Fight.getOpposite(fightTeam)).totalBlocks;
|
|
||||||
|
|
||||||
if(enemyBlocks == 0)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(enemyBlocks < ownBlocks) {
|
setup(opponent.totalBlocks);
|
||||||
|
opponent.setup(totalBlocks);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setup(int enemyBlocks){
|
||||||
|
points = 0;
|
||||||
|
if(enemyBlocks < totalBlocks) {
|
||||||
this.factor = 100; //Original mit 20 (20% = 0.2 ergeben 2000 Punkte
|
this.factor = 100; //Original mit 20 (20% = 0.2 ergeben 2000 Punkte
|
||||||
} else {
|
} else {
|
||||||
double f = 100.0 * ownBlocks / enemyBlocks;
|
double f = 100.0 * totalBlocks / enemyBlocks;
|
||||||
|
|
||||||
if(f > 100)
|
if(f > 100)
|
||||||
f = 100;
|
f = 100;
|
||||||
|
@ -41,5 +41,4 @@ public class WinconditionRelativeWhitelistPercent extends PercentWincondition im
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren