HellsBells #275
@ -23,6 +23,7 @@ import de.steamwar.core.CommandRemover;
|
|||||||
import de.steamwar.core.Core;
|
import de.steamwar.core.Core;
|
||||||
import de.steamwar.fightsystem.commands.*;
|
import de.steamwar.fightsystem.commands.*;
|
||||||
import de.steamwar.fightsystem.countdown.*;
|
import de.steamwar.fightsystem.countdown.*;
|
||||||
|
import de.steamwar.fightsystem.event.HellsBells;
|
||||||
import de.steamwar.fightsystem.fight.Fight;
|
import de.steamwar.fightsystem.fight.Fight;
|
||||||
import de.steamwar.fightsystem.fight.FightTeam;
|
import de.steamwar.fightsystem.fight.FightTeam;
|
||||||
import de.steamwar.fightsystem.fight.FightWorld;
|
import de.steamwar.fightsystem.fight.FightWorld;
|
||||||
@ -106,6 +107,9 @@ public class FightSystem extends JavaPlugin {
|
|||||||
new RankedPlayerLeftWincondition();
|
new RankedPlayerLeftWincondition();
|
||||||
new WinconditionPercentTimeout();
|
new WinconditionPercentTimeout();
|
||||||
|
|
||||||
|
//noinspection InstantiationOfUtilityClass
|
||||||
Zeanon markierte diese Unterhaltung als gelöst
|
|||||||
|
new HellsBells();
|
||||||
|
|
||||||
new NoPlayersOnlineCountdown();
|
new NoPlayersOnlineCountdown();
|
||||||
new PreSchemCountdown();
|
new PreSchemCountdown();
|
||||||
new PostSchemCountdown();
|
new PostSchemCountdown();
|
||||||
|
288
FightSystem_Main/src/de/steamwar/fightsystem/event/HellsBells.java
Normale Datei
288
FightSystem_Main/src/de/steamwar/fightsystem/event/HellsBells.java
Normale Datei
@ -0,0 +1,288 @@
|
|||||||
|
package de.steamwar.fightsystem.event;
|
||||||
|
|
||||||
|
import de.steamwar.fightsystem.Config;
|
||||||
|
import de.steamwar.fightsystem.FightSystem;
|
||||||
|
import de.steamwar.fightsystem.countdown.Countdown;
|
||||||
|
import de.steamwar.fightsystem.countdown.SWSound;
|
||||||
|
import de.steamwar.fightsystem.states.FightState;
|
||||||
|
import de.steamwar.fightsystem.states.StateDependent;
|
||||||
|
import de.steamwar.fightsystem.winconditions.Winconditions;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
|
|
||||||
|
public class HellsBells {
|
||||||
|
|
||||||
|
public static final Random random = new Random();
|
||||||
|
|
||||||
|
public HellsBells() {
|
||||||
|
new StateDependent(Winconditions.HELLS_BELLS, FightState.Running) {
|
||||||
|
|
||||||
|
private HellsBellsEvent event = null;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enable() {
|
||||||
|
if (event != null) {
|
||||||
|
event.terminate();
|
||||||
|
}
|
||||||
|
event = new HellsBellsEvent();
|
||||||
|
event.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disable() {
|
||||||
|
if (event != null) {
|
||||||
|
event.terminate();
|
||||||
|
}
|
||||||
|
event = null;
|
||||||
|
}
|
||||||
|
}.register();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class HellsBellsEvent {
|
||||||
|
|
||||||
|
private final World world = Bukkit.getWorlds().get(0);
|
||||||
|
private final int xLength = Config.RedPasteRegion.getMaxX() - Config.RedPasteRegion.getMinX();
|
||||||
|
private final int zLength = Config.RedPasteRegion.getMaxZ() - Config.RedPasteRegion.getMinZ();
|
||||||
|
private State current = State.PRE;
|
||||||
|
private long stateStart = 0;
|
||||||
|
private HellsBellsCountdown currentCountdown;
|
||||||
|
private static final List<String> startMessages = Arrays.asList("§c!!Achtung!! Bomber im Anflug, noch ca. eine Minute bis zur Ankunft.",
|
||||||
|
"§cBomber im Anflug, ca. eine Minute bis zur Ankunft.",
|
||||||
|
"§cBomber auf dem Radar gesichtet, geschätzte Ankunftszeit: eine Minute.",
|
||||||
|
"§cUnbekanntes Flugobjekt gesichtet, trifft in ca. einer Minute ein.",
|
||||||
|
"§cFlugobjekt gesichtet. Ankunft in ca. einer Minute.",
|
||||||
|
"§cBomber erschienen, Ankunft ca. eine Minute.");
|
||||||
|
|
||||||
|
|
||||||
|
public void init() {
|
||||||
|
stateStart = System.currentTimeMillis();
|
||||||
|
startCountdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void terminate() {
|
||||||
|
current = State.NONE;
|
||||||
|
currentCountdown.disable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void startCountdown() {
|
||||||
|
if (current != State.NONE) {
|
||||||
|
long currentTime = System.currentTimeMillis();
|
||||||
|
if (current != State.LAST && currentTime >= stateStart + (current.switchAfter * 1000L)) {
|
||||||
|
if (current != State.PRE) {
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§aDie Bomben fallen nun schneller.");
|
||||||
|
}
|
||||||
|
|
||||||
|
current = current.getNext();
|
||||||
|
stateStart = currentTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
int timer = current.minTime + random.nextInt(current.maxTime - current.minTime);
|
||||||
|
if (current == State.PRE) {
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + (startMessages.get(random.nextInt(startMessages.size()))));
|
||||||
|
}
|
||||||
|
currentCountdown = new HellsBellsCountdown(timer, SWSound.BLOCK_NOTE_BASS, true);
|
||||||
|
currentCountdown.enable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void drop() {
|
||||||
|
if (random.nextBoolean()) {
|
||||||
Zeanon markierte diese Unterhaltung als gelöst
Lixfel
hat
Das StateDependent sollte nur die Sachen (de-)aktivieren, nicht das ganze Behaviour innehaben. Um die Nestung zu verringern: Nimm den ganzen Code bis auf die Enable und Disable und bewege den in die HellsBells-Klasse. (Also die übergeordnete) Das StateDependent sollte nur die Sachen (de-)aktivieren, nicht das ganze Behaviour innehaben. Um die Nestung zu verringern: Nimm den ganzen Code bis auf die Enable und Disable und bewege den in die HellsBells-Klasse. (Also die übergeordnete)
|
|||||||
|
sideRun(random.nextBoolean());
|
||||||
|
} else {
|
||||||
|
frontRun(random.nextBoolean());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void sideRun(boolean invert) {
|
||||||
|
int length = 10 + random.nextInt(zLength - 10);
|
||||||
|
int xOffset = getWidthStart(xLength);
|
||||||
|
int zOffset = getLengthStart(zLength, length);
|
||||||
|
int yOffset = 25 + getHeightStart();
|
||||||
|
|
||||||
|
|
||||||
|
Point redStart;
|
||||||
|
Point blueStart;
|
||||||
|
|
||||||
|
if (invert) {
|
||||||
|
redStart = new Point(Config.RedPasteRegion.getMaxX() - xOffset, Config.RedPasteRegion.getMaxY() + yOffset, Config.RedPasteRegion.getMaxZ() - zOffset);
|
||||||
|
blueStart = new Point(Config.BluePasteRegion.getMinX() + xOffset, Config.BluePasteRegion.getMaxY() + yOffset, Config.BluePasteRegion.getMinZ() + zOffset);
|
||||||
|
} else {
|
||||||
|
redStart = new Point(Config.RedPasteRegion.getMinX() + xOffset, Config.RedPasteRegion.getMaxY() + yOffset, Config.RedPasteRegion.getMinZ() + zOffset);
|
||||||
|
blueStart = new Point(Config.BluePasteRegion.getMaxX() - xOffset, Config.BluePasteRegion.getMaxY() + yOffset, Config.BluePasteRegion.getMaxZ() - zOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
dropSideBombPart(redStart, blueStart, new int[]{length}, invert);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dropSideBombPart(Point redStart, Point blueStart, int[] x, boolean invert) {
|
||||||
|
Bukkit.getScheduler().scheduleSyncRepeatingTask(FightSystem.getPlugin(), () -> new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
for (int z = 0; z < 4; z++) {
|
||||||
|
if (invert) {
|
||||||
|
world.spawnEntity(redStart.subtractAndToLocation(world, x[0], 0, z), EntityType.PRIMED_TNT);
|
||||||
|
|
||||||
|
world.spawnEntity(blueStart.addAndToLocation(world, x[0], 0, z), EntityType.PRIMED_TNT);
|
||||||
|
} else {
|
||||||
|
world.spawnEntity(redStart.addAndToLocation(world, x[0], 0, z), EntityType.PRIMED_TNT);
|
||||||
|
|
||||||
|
world.spawnEntity(blueStart.subtractAndToLocation(world, x[0], 0, z), EntityType.PRIMED_TNT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (x[0] < 2) {
|
||||||
|
this.cancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
x[0] -= 2;
|
||||||
|
}
|
||||||
|
}, 0, 4L);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void frontRun(boolean invert) {
|
||||||
|
int length = 10 + random.nextInt(xLength - 10);
|
||||||
|
int xOffset = getWidthStart(zLength);
|
||||||
|
int zOffset = getLengthStart(xLength, length);
|
||||||
|
int yOffset = 25 + getHeightStart();
|
||||||
|
|
||||||
|
Point redStart;
|
||||||
|
Point blueStart;
|
||||||
|
|
||||||
|
if (invert) {
|
||||||
|
redStart = new Point(Config.RedPasteRegion.getMaxX() - xOffset, Config.RedPasteRegion.getMaxY() + yOffset, Config.RedPasteRegion.getMaxZ() - zOffset);
|
||||||
|
blueStart = new Point(Config.BluePasteRegion.getMinX() + xOffset, Config.BluePasteRegion.getMaxY() + yOffset, Config.BluePasteRegion.getMinZ() + zOffset);
|
||||||
|
} else {
|
||||||
|
redStart = new Point(Config.RedPasteRegion.getMinX() + xOffset, Config.RedPasteRegion.getMaxY() + yOffset, Config.RedPasteRegion.getMinZ() + zOffset);
|
||||||
|
blueStart = new Point(Config.BluePasteRegion.getMaxX() - xOffset, Config.BluePasteRegion.getMaxY() + yOffset, Config.BluePasteRegion.getMaxZ() - zOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
dropFrontBombPart(redStart, blueStart, new int[]{length}, invert);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dropFrontBombPart(Point redStart, Point blueStart, int[] z, boolean invert) {
|
||||||
|
Bukkit.getScheduler().scheduleSyncRepeatingTask(FightSystem.getPlugin(), () -> new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
for (int x = 0; x < 4; x++) {
|
||||||
|
if (invert) {
|
||||||
|
world.spawnEntity(redStart.subtractAndToLocation(world, x, 0, z[0]), EntityType.PRIMED_TNT);
|
||||||
|
|
||||||
|
world.spawnEntity(blueStart.addAndToLocation(world, x, 0, z[0]), EntityType.PRIMED_TNT);
|
||||||
|
} else {
|
||||||
|
world.spawnEntity(redStart.addAndToLocation(world, x, 0, z[0]), EntityType.PRIMED_TNT);
|
||||||
|
|
||||||
|
world.spawnEntity(blueStart.subtractAndToLocation(world, x, 0, z[0]), EntityType.PRIMED_TNT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (z[0] < 2) {
|
||||||
|
this.cancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
z[0] -= 2;
|
||||||
|
}
|
||||||
|
}, 0, 4L);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getLengthStart(int regionSize, int length) {
|
||||||
|
return random.nextInt(regionSize - length);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getWidthStart(int regionSize) {
|
||||||
|
return random.nextInt(regionSize - 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getHeightStart() {
|
||||||
|
return random.nextInt(15);
|
||||||
Zeanon markierte diese Unterhaltung als gelöst
Lixfel
hat
Ich weiß nicht, aber ich glaube, dafür, dass an einer Stelle mal ein subtract und ein add ausgeführt wird (generalisierbar mit * +-1) ist es etwas overkill, eine eigene Klasse dafür vorzuhalten, selbst wenn Location in der 1.8 (glaube war der Grund) eine .add o.ä. Methode bereitstellt, ist etwas overkill. Dann hat man halt beim Aufruf etwas (mehr) Arithmetik. Ich weiß nicht, aber ich glaube, dafür, dass an einer Stelle mal ein subtract und ein add ausgeführt wird (generalisierbar mit * +-1) ist es etwas overkill, eine eigene Klasse dafür vorzuhalten, selbst wenn Location in der 1.8 (glaube war der Grund) eine .add o.ä. Methode bereitstellt, ist etwas overkill. Dann hat man halt beim Aufruf etwas (mehr) Arithmetik.
|
|||||||
|
}
|
||||||
|
|
||||||
|
private class HellsBellsCountdown extends Countdown {
|
||||||
|
|
||||||
|
public HellsBellsCountdown(int time, SWSound sound, boolean level) {
|
||||||
|
super(time, sound, level);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String countdownCounting() {
|
||||||
|
return "bis die Bomben fallen";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void countdownFinished() {
|
||||||
|
drop();
|
||||||
|
|
||||||
|
startCountdown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class Point {
|
||||||
|
|
||||||
|
private final int x;
|
||||||
|
private final int y;
|
||||||
|
private final int z;
|
||||||
|
|
||||||
|
public Point(int x, int y, int z) {
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.z = z;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Location addAndToLocation(World world, int x, int y, int z) {
|
||||||
|
return new Location(world, this.x + x, this.y + y, this.z + z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Location subtractAndToLocation(World world, int x, int y, int z) {
|
||||||
|
return new Location(world, this.x - x, this.y - y, this.z - z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private enum State {
|
||||||
|
|
||||||
|
NONE(0, 0, -1),
|
||||||
|
PRE(60, 80, 50),
|
||||||
|
FIRST(40, 60, 5 * 60),
|
||||||
|
SECOND(30, 40, 4 * 60),
|
||||||
|
THIRD(20, 30, 3 * 60),
|
||||||
|
LAST(10, 20, -1);
|
||||||
|
|
||||||
|
|
||||||
|
State(int minTime, int maxTime, int switchAfter) {
|
||||||
|
this.minTime = minTime;
|
||||||
|
this.maxTime = maxTime;
|
||||||
|
this.switchAfter = switchAfter;
|
||||||
|
}
|
||||||
|
|
||||||
|
private final int minTime;
|
||||||
|
private final int maxTime;
|
||||||
|
private final int switchAfter;
|
||||||
|
|
||||||
|
|
||||||
|
public State getNext() {
|
||||||
|
switch (this) {
|
||||||
|
case PRE:
|
||||||
|
return FIRST;
|
||||||
|
case FIRST:
|
||||||
|
return SECOND;
|
||||||
|
case SECOND:
|
||||||
|
return THIRD;
|
||||||
|
case THIRD:
|
||||||
|
case LAST:
|
||||||
|
return LAST;
|
||||||
|
default:
|
||||||
|
return NONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,46 +0,0 @@
|
|||||||
package de.steamwar.fightsystem.event;
|
|
||||||
|
|
||||||
import de.steamwar.fightsystem.countdown.Countdown;
|
|
||||||
import de.steamwar.fightsystem.countdown.SWSound;
|
|
||||||
import de.steamwar.fightsystem.states.FightState;
|
|
||||||
import de.steamwar.fightsystem.states.StateDependent;
|
|
||||||
import de.steamwar.fightsystem.winconditions.Winconditions;
|
|
||||||
|
|
||||||
|
|
||||||
public class Hells_Bells {
|
|
||||||
|
|
||||||
public Hells_Bells() {
|
|
||||||
(new StateDependent(Winconditions.HELLS_BELLS, FightState.Running) {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void enable() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void disable() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}).register();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class Hells_Bells_Event {
|
|
||||||
|
|
||||||
private static class Hells_Bells_Countdown extends Countdown {
|
|
||||||
|
|
||||||
public Hells_Bells_Countdown(int time, SWSound sound, boolean level) {
|
|
||||||
super(time, sound, level);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String countdownCounting() {
|
|
||||||
return "bis die Bomben fallen";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void countdownFinished() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,135 +0,0 @@
|
|||||||
package de.steamwar.fightsystem.winconditions;
|
|
||||||
|
|
||||||
import de.steamwar.fightsystem.FightSystem;
|
|
||||||
import de.steamwar.fightsystem.states.StateDependentCountdown;
|
|
||||||
import java.util.Random;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
|
|
||||||
|
|
||||||
public class Hells_Bells extends WinconditionAllDead {
|
|
||||||
|
|
||||||
private static int overlap = 5;
|
|
||||||
private static int distance = 3;
|
|
||||||
private static int width = 65;
|
|
||||||
private static int length = 40;
|
|
||||||
private static int height = 70;
|
|
||||||
|
|
||||||
private static int startTime = 40;
|
|
||||||
private static int endTime = 20;
|
|
||||||
private static int warningTime = 10;
|
|
||||||
private static int steps = 20;
|
|
||||||
private static int currentStep = 0;
|
|
||||||
private static int nextTime = startTime;
|
|
||||||
|
|
||||||
public static Random randomGenerator = new Random();
|
|
||||||
public static boolean debug = false;
|
|
||||||
private static int scheduler1 = 0;
|
|
||||||
private static int scheduler2 = 0;
|
|
||||||
private static World world = null; //TODO Woher bekomm ich die?
|
|
||||||
|
|
||||||
private static int getNextTime(int step) {
|
|
||||||
if (step == 0) {
|
|
||||||
return startTime;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
float temp = (startTime - (((startTime - endTime)/steps) * step));
|
|
||||||
if ((temp <= startTime) && (temp >= endTime)) {
|
|
||||||
return ((int) temp + getNextTime(step - 1));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return endTime + getNextTime(step - 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void hellsBells(int time) {
|
|
||||||
if (time == nextTime) {
|
|
||||||
if (randomGenerator.nextInt(2) == 1) {
|
|
||||||
Double temp = randomGenerator.nextDouble();
|
|
||||||
if (debug) {
|
|
||||||
Bukkit.broadcastMessage("SideBombRun ; Route = " + temp.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
sideBombRun(temp);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Double temp = randomGenerator.nextDouble();
|
|
||||||
if (debug) {
|
|
||||||
Bukkit.broadcastMessage("FrontBombRun ; Route = " + temp.toString());
|
|
||||||
}
|
|
||||||
frontBombRun(temp);
|
|
||||||
}
|
|
||||||
currentStep++;
|
|
||||||
nextTime = getNextTime(currentStep);
|
|
||||||
if (debug) {
|
|
||||||
Bukkit.broadcastMessage("currentStep = " + currentStep + " ; nextTime = " + nextTime);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (time == nextTime - warningTime) {
|
|
||||||
Bukkit.broadcastMessage("Achtung! In " + warningTime + " Sekunden fallen Bomben!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void sideBombRun(Double route) {
|
|
||||||
Location temp1 = new Location(world, Main.ArenaMidX + overlap + (int)(width/2), Main.ArenaMidY + height, Main.ArenaMidZ + 25 + distance + (int)(route * (length - (2 * distance))));
|
|
||||||
Location temp2 = new Location(world, Main.ArenaMidX - overlap - (int)(width/2), Main.ArenaMidY + height, Main.ArenaMidZ - 25 - distance - (int)(route * (length - (2 * distance))));
|
|
||||||
sideBomb(temp1, temp2, (int)((width + 2 * overlap)/2));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void sideBomb(Location loc1, Location loc2, int count){
|
|
||||||
world.spawnEntity(new Location(loc1.getWorld(), loc1.getX(), loc1.getY(), loc1.getZ() - 2), EntityType.PRIMED_TNT);
|
|
||||||
world.spawnEntity(new Location(loc1.getWorld(), loc1.getX(), loc1.getY(), loc1.getZ() - 1), EntityType.PRIMED_TNT);
|
|
||||||
world.spawnEntity(new Location(loc1.getWorld(), loc1.getX(), loc1.getY(), loc1.getZ() + 1), EntityType.PRIMED_TNT);
|
|
||||||
world.spawnEntity(new Location(loc1.getWorld(), loc1.getX(), loc1.getY(), loc1.getZ() + 2), EntityType.PRIMED_TNT);
|
|
||||||
|
|
||||||
world.spawnEntity(new Location(loc2.getWorld(), loc2.getX(), loc2.getY(), loc2.getZ() - 2), EntityType.PRIMED_TNT);
|
|
||||||
world.spawnEntity(new Location(loc2.getWorld(), loc2.getX(), loc2.getY(), loc2.getZ() - 1), EntityType.PRIMED_TNT);
|
|
||||||
world.spawnEntity(new Location(loc2.getWorld(), loc2.getX(), loc2.getY(), loc2.getZ() + 1), EntityType.PRIMED_TNT);
|
|
||||||
world.spawnEntity(new Location(loc2.getWorld(), loc2.getX(), loc2.getY(), loc2.getZ() + 2), EntityType.PRIMED_TNT);
|
|
||||||
|
|
||||||
if (count >= 1) {
|
|
||||||
final Location temp1 = new Location(loc1.getWorld(), loc1.getX() - 2, loc1.getY(), loc1.getZ());
|
|
||||||
final Location temp2 = new Location(loc2.getWorld(), loc2.getX() + 2, loc2.getY(), loc2.getZ());
|
|
||||||
final int temp3 = count - 1;
|
|
||||||
scheduler1 = Bukkit.getScheduler().scheduleSyncDelayedTask(FightSystem.getPlugin(), () -> sideBomb(temp1, temp2, temp3), 4L);
|
|
||||||
// Bukkit.getScheduler().cancelTask(scheduler1);
|
|
||||||
// scheduler1 = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void frontBombRun(Double route) {
|
|
||||||
Location temp1 = new Location(world, Main.ArenaMidX + distance + (int)(route * (width - (2 * distance))) - (int) (width / 2), Main.ArenaMidY + height, Main.ArenaMidZ + 25 - overlap);
|
|
||||||
Location temp2 = new Location(world, Main.ArenaMidX - distance - (int)(route * (width - (2 * distance))) + (int) (width / 2), Main.ArenaMidY + height, Main.ArenaMidZ - 25 + overlap);
|
|
||||||
frontBomb(temp1, temp2, (int)((length + 2 * overlap) / 2));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void frontBomb(Location loc1, Location loc2, int count){
|
|
||||||
world.spawnEntity(new Location(loc1.getWorld(), loc1.getX() - 2, loc1.getY(), loc1.getZ()), EntityType.PRIMED_TNT);
|
|
||||||
world.spawnEntity(new Location(loc1.getWorld(), loc1.getX() - 1, loc1.getY(), loc1.getZ()), EntityType.PRIMED_TNT);
|
|
||||||
world.spawnEntity(new Location(loc1.getWorld(), loc1.getX() + 1, loc1.getY(), loc1.getZ()), EntityType.PRIMED_TNT);
|
|
||||||
world.spawnEntity(new Location(loc1.getWorld(), loc1.getX() + 2, loc1.getY(), loc1.getZ()), EntityType.PRIMED_TNT);
|
|
||||||
|
|
||||||
world.spawnEntity(new Location(loc2.getWorld(), loc2.getX() - 2, loc2.getY(), loc2.getZ()), EntityType.PRIMED_TNT);
|
|
||||||
world.spawnEntity(new Location(loc2.getWorld(), loc2.getX() - 1, loc2.getY(), loc2.getZ()), EntityType.PRIMED_TNT);
|
|
||||||
world.spawnEntity(new Location(loc2.getWorld(), loc2.getX() + 1, loc2.getY(), loc2.getZ()), EntityType.PRIMED_TNT);
|
|
||||||
world.spawnEntity(new Location(loc2.getWorld(), loc2.getX() + 2, loc2.getY(), loc2.getZ()), EntityType.PRIMED_TNT);
|
|
||||||
|
|
||||||
if (count >= 1) {
|
|
||||||
final Location temp1 = new Location(loc1.getWorld(), loc1.getX(), loc1.getY(), loc1.getZ() + 2);
|
|
||||||
final Location temp2 = new Location(loc2.getWorld(), loc2.getX(), loc2.getY(), loc2.getZ() - 2);
|
|
||||||
final int temp3 = count - 1;
|
|
||||||
scheduler2 = Bukkit.getScheduler().scheduleSyncDelayedTask(FightSystem.getPlugin(), () -> frontBomb(temp1, temp2, temp3), 4L);
|
|
||||||
// Bukkit.getScheduler().cancelTask(scheduler2);
|
|
||||||
// scheduler2 = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void EndHellsBells() {
|
|
||||||
nextTime = startTime;
|
|
||||||
currentStep = 0;
|
|
||||||
}
|
|
||||||
}
|
|
In neuem Issue referenzieren
Einen Benutzer sperren
Bitte rausnehmen (sollte auch nicht nötig sein?!?)