SteamWar/FightSystem
Archiviert
13
1

Merge pull request 'HellsBells improvements' (#358) from hbFixes into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #358
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Lixfel 2022-07-24 21:53:36 +02:00
Commit 4a59c93042

Datei anzeigen

@ -43,8 +43,8 @@ public class HellsBells {
public static final Random random = new Random();
private final int xLength = Config.RedExtendRegion.getMaxX() - Config.RedExtendRegion.getMinX();
private final int zLength = Config.RedExtendRegion.getMaxZ() - Config.RedExtendRegion.getMinZ();
private final int xLength = Config.BlueExtendRegion.getSizeX();
private final int zLength = Config.BlueExtendRegion.getSizeZ();
private State current = State.PRE;
private int currentDrops = 0;
private HellsBellsCountdown currentCountdown;
@ -113,7 +113,7 @@ public class HellsBells {
}
private int getStart(int regionSize, int length) {
double randomNumber = (random.nextDouble() - random.nextDouble()) / 2 + 0.5;
double randomNumber = (Math.max(Math.min(random.nextGaussian(), -2), 2) + 2) / 4;
Bukkit.getLogger().log(Level.INFO, "Calculated Start: " + (int) (randomNumber * (regionSize - length)));
return Math.max(Math.min((int) (randomNumber * (regionSize - length)), regionSize - length), 0);
}
@ -126,6 +126,8 @@ public class HellsBells {
new StateDependent(Winconditions.HELLS_BELLS, FightState.Running) {
@Override
public void enable() {
current = State.PRE;
currentDrops = 0;
startCountdown();
}