SteamWar/FightSystem
Archiviert
13
1

fixed for airship
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
Zeanon 2022-02-06 19:42:37 +01:00
Ursprung 1e7e94d359
Commit fa5b20b680
3 geänderte Dateien mit 23 neuen und 19 gelöschten Zeilen

Datei anzeigen

@ -108,7 +108,7 @@ WinConditions: # defaults to none if missing
# - PUMPKIN_TECH_KO
# - HELLS_BELLS
# - METEOR
- METEOR
WinConditionParams:
# The time of any of the timeout win conditions in seconds

Datei anzeigen

@ -31,6 +31,7 @@ import de.steamwar.fightsystem.winconditions.Winconditions;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Fireball;
import org.bukkit.entity.LargeFireball;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@ -58,7 +59,7 @@ public class Meteor implements Listener {
private BukkitTask currentDropping;
public void startCountdown() {
if (current == Meteor.State.PRE) {
if (current == Meteor.State.PRE || current == Meteor.State.FIRST) {
Bukkit.getOnlinePlayers().forEach(player -> {
player.sendMessage("Starting");
});
@ -76,7 +77,7 @@ public class Meteor implements Listener {
currentCountdown.enable();
}
@EventHandler
//@EventHandler
public void explode(ProjectileHitEvent event) {
if (event.getEntity() instanceof Fireball) {
TNTPrimed tnt = world.spawn(event.getEntity().getLocation(), TNTPrimed.class);
@ -106,13 +107,13 @@ public class Meteor implements Listener {
vector.setX(random.nextDouble() - 0.5);
vector.setZ(random.nextDouble() - 0.5);
Fireball fireballRed = world.spawn(redStart.toLocation(world), Fireball.class);
LargeFireball fireballRed = world.spawn(redStart.toLocation(world), LargeFireball.class);
fireballRed.setDirection(vector);
fireballRed.setBounce(false);
fireballRed.setIsIncendiary(false);
fireballRed.setYield(current.explosionSize);
Fireball fireballBlue = world.spawn(blueStart.toLocation(world), Fireball.class);
LargeFireball fireballBlue = world.spawn(blueStart.toLocation(world), LargeFireball.class);
vector.setZ(vector.getZ() * -1);
fireballBlue.setDirection(vector);
fireballBlue.setBounce(false);
@ -167,11 +168,11 @@ public class Meteor implements Listener {
private enum State {
PRE(60, 80, 1, 0, 0, 0),
FIRST(25, 35, 6, 2, 2, 4),
SECOND(20, 30, 7, 4, 3, 6),
THIRD(15, 25, 7, 4, 4, 8),
FOURTH(10, 20, 8, 6, 6, 11),
LAST(5, 10, 0, 6, 8, 16);
FIRST(25, 35, 6, 2, 3, 6),
SECOND(20, 30, 7, 4, 4, 8),
THIRD(15, 25, 7, 4, 5, 10),
FOURTH(10, 20, 8, 6, 7, 14),
LAST(5, 10, 0, 6, 9, 18);
State(int minTime, int maxTime, int switchAfter, int explosionSize, int minAmount, int maxAmount) {

Datei anzeigen

@ -29,6 +29,7 @@ import de.steamwar.fightsystem.utils.Message;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityExplodeEvent;
@ -105,6 +106,7 @@ public class PercentWincondition extends Wincondition implements PrintableWincon
@EventHandler
public void onEntityExplode(EntityExplodeEvent event) {
if (event.getEntityType() != EntityType.FIREBALL) {
if (explosionFilter.getAsBoolean() || !team.getExtendRegion().inRegion(event.getEntity().getLocation())) {
return;
}
@ -117,6 +119,7 @@ public class PercentWincondition extends Wincondition implements PrintableWincon
checkWin.accept(team);
}
}
private void enable() {
totalBlocks = totalBlockCalc.applyAsInt(team);