SteamWar/FightSystem
Archiviert
13
1

HellsBells #275

Manuell gemergt
Lixfel hat 19 Commits von Hells_bells nach master 2021-06-25 07:17:45 +02:00 zusammengeführt
12 geänderte Dateien mit 200 neuen und 18 gelöschten Zeilen
Nur Änderungen aus Commit bf1368a34e werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -46,14 +46,14 @@
<artifactId>WorldEdit</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${main.basedir}/lib/WorldEdit-1.12.jar</systemPath>
<systemPath>${main.basedir}/../SteamwarLibs/WorldEdit-1.12.jar</systemPath>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>Spigot</artifactId>
<version>1.10</version>
<scope>system</scope>
<systemPath>${main.basedir}/lib/Spigot-1.10.jar</systemPath>
<systemPath>${main.basedir}/../SteamwarLibs/Spigot-1.10.jar</systemPath>
</dependency>
</dependencies>
</project>

Datei anzeigen

@ -46,14 +46,14 @@
<artifactId>WorldEdit</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${main.basedir}/lib/WorldEdit-1.12.jar</systemPath>
<systemPath>${main.basedir}/../SteamwarLibs/WorldEdit-1.12.jar</systemPath>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>Spigot</artifactId>
<version>1.12</version>
<scope>system</scope>
<systemPath>${main.basedir}/lib/Spigot-1.12.jar</systemPath>
<systemPath>${main.basedir}/../SteamwarLibs/Spigot-1.12.jar</systemPath>
</dependency>
</dependencies>
</project>

Datei anzeigen

@ -36,14 +36,14 @@
<artifactId>Spigot</artifactId>
<version>1.14</version>
<scope>system</scope>
<systemPath>${main.basedir}/lib/Spigot-1.14.jar</systemPath>
<systemPath>${main.basedir}/../SteamwarLibs/Spigot-1.14.jar</systemPath>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>WorldEdit</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${main.basedir}/lib/WorldEdit-1.15.jar</systemPath>
<systemPath>${main.basedir}/../SteamwarLibs/WorldEdit-1.15.jar</systemPath>
</dependency>
<dependency>
<groupId>steamwar</groupId>

Datei anzeigen

@ -36,14 +36,14 @@
<artifactId>Spigot</artifactId>
<version>1.15</version>
<scope>system</scope>
<systemPath>${main.basedir}/lib/Spigot-1.15.jar</systemPath>
<systemPath>${main.basedir}/../SteamwarLibs/Spigot-1.15.jar</systemPath>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>WorldEdit</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${main.basedir}/lib/WorldEdit-1.15.jar</systemPath>
<systemPath>${main.basedir}/../SteamwarLibs/WorldEdit-1.15.jar</systemPath>
</dependency>
<dependency>
<groupId>steamwar</groupId>

Datei anzeigen

@ -36,7 +36,7 @@
<artifactId>Spigot</artifactId>
<version>1.8</version>
<scope>system</scope>
<systemPath>${main.basedir}/lib/Spigot-1.8.jar</systemPath>
<systemPath>${main.basedir}/../SteamwarLibs/Spigot-1.8.jar</systemPath>
</dependency>
<dependency>
<groupId>steamwar</groupId>
@ -48,7 +48,7 @@
<artifactId>WorldEdit</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${main.basedir}/lib/WorldEdit-1.12.jar</systemPath>
<systemPath>${main.basedir}/../SteamwarLibs/WorldEdit-1.12.jar</systemPath>
</dependency>
</dependencies>
</project>

Datei anzeigen

@ -46,14 +46,14 @@
<artifactId>WorldEdit</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${main.basedir}/lib/WorldEdit-1.12.jar</systemPath>
<systemPath>${main.basedir}/../SteamwarLibs/WorldEdit-1.12.jar</systemPath>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>Spigot</artifactId>
<version>1.9</version>
<scope>system</scope>
<systemPath>${main.basedir}/lib/Spigot-1.9.jar</systemPath>
<systemPath>${main.basedir}/../SteamwarLibs/Spigot-1.9.jar</systemPath>
</dependency>
</dependencies>
</project>

Datei anzeigen

@ -36,7 +36,7 @@
<artifactId>Spigot</artifactId>
<version>1.12</version>
<scope>system</scope>
<systemPath>${main.basedir}/lib/Spigot-1.12.jar</systemPath>
<systemPath>${main.basedir}/../SteamwarLibs/Spigot-1.12.jar</systemPath>
</dependency>
</dependencies>
</project>

Datei anzeigen

@ -30,5 +30,6 @@ public enum Winconditions {
POINTS,
TIME_TECH_KO,
WATER_TECH_KO,
PUMPKIN_TECH_KO
PUMPKIN_TECH_KO,
HELLS_BELLS
}

Datei anzeigen

@ -52,14 +52,14 @@
<artifactId>Spigot</artifactId>
<version>1.15</version>
<scope>system</scope>
<systemPath>${main.basedir}/lib/Spigot-1.15.jar</systemPath>
<systemPath>${main.basedir}/../SteamwarLibs/Spigot-1.15.jar</systemPath>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>WorldEdit</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${main.basedir}/lib/WorldEdit-1.12.jar</systemPath>
<systemPath>${main.basedir}/../SteamwarLibs/WorldEdit-1.12.jar</systemPath>
</dependency>
<dependency>
<groupId>steamwar</groupId>

Datei anzeigen

@ -0,0 +1,46 @@
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() {
}
}
}
}

Datei anzeigen

@ -0,0 +1,135 @@
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;
}
}

Datei anzeigen

@ -46,14 +46,14 @@
<artifactId>SpigotCore</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${main.basedir}/lib/SpigotCore.jar</systemPath>
<systemPath>${main.basedir}/../SteamwarLibs/SpigotCore.jar</systemPath>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>ProtocolLib</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${main.basedir}/lib/ProtocolLib.jar</systemPath>
<systemPath>${main.basedir}/../SteamwarLibs/ProtocolLib.jar</systemPath>
</dependency>
</dependencies>