Dieser Commit ist enthalten in:
Ursprung
1e7e94d359
Commit
fa5b20b680
@ -108,7 +108,7 @@ WinConditions: # defaults to none if missing
|
|||||||
# - PUMPKIN_TECH_KO
|
# - PUMPKIN_TECH_KO
|
||||||
|
|
||||||
# - HELLS_BELLS
|
# - HELLS_BELLS
|
||||||
# - METEOR
|
- METEOR
|
||||||
|
|
||||||
WinConditionParams:
|
WinConditionParams:
|
||||||
# The time of any of the timeout win conditions in seconds
|
# The time of any of the timeout win conditions in seconds
|
||||||
|
@ -31,6 +31,7 @@ import de.steamwar.fightsystem.winconditions.Winconditions;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Fireball;
|
import org.bukkit.entity.Fireball;
|
||||||
|
import org.bukkit.entity.LargeFireball;
|
||||||
import org.bukkit.entity.TNTPrimed;
|
import org.bukkit.entity.TNTPrimed;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
@ -58,7 +59,7 @@ public class Meteor implements Listener {
|
|||||||
private BukkitTask currentDropping;
|
private BukkitTask currentDropping;
|
||||||
|
|
||||||
public void startCountdown() {
|
public void startCountdown() {
|
||||||
if (current == Meteor.State.PRE) {
|
if (current == Meteor.State.PRE || current == Meteor.State.FIRST) {
|
||||||
Bukkit.getOnlinePlayers().forEach(player -> {
|
Bukkit.getOnlinePlayers().forEach(player -> {
|
||||||
player.sendMessage("Starting");
|
player.sendMessage("Starting");
|
||||||
});
|
});
|
||||||
@ -76,7 +77,7 @@ public class Meteor implements Listener {
|
|||||||
currentCountdown.enable();
|
currentCountdown.enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
//@EventHandler
|
||||||
public void explode(ProjectileHitEvent event) {
|
public void explode(ProjectileHitEvent event) {
|
||||||
if (event.getEntity() instanceof Fireball) {
|
if (event.getEntity() instanceof Fireball) {
|
||||||
TNTPrimed tnt = world.spawn(event.getEntity().getLocation(), TNTPrimed.class);
|
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.setX(random.nextDouble() - 0.5);
|
||||||
vector.setZ(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.setDirection(vector);
|
||||||
fireballRed.setBounce(false);
|
fireballRed.setBounce(false);
|
||||||
fireballRed.setIsIncendiary(false);
|
fireballRed.setIsIncendiary(false);
|
||||||
fireballRed.setYield(current.explosionSize);
|
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);
|
vector.setZ(vector.getZ() * -1);
|
||||||
fireballBlue.setDirection(vector);
|
fireballBlue.setDirection(vector);
|
||||||
fireballBlue.setBounce(false);
|
fireballBlue.setBounce(false);
|
||||||
@ -167,11 +168,11 @@ public class Meteor implements Listener {
|
|||||||
private enum State {
|
private enum State {
|
||||||
|
|
||||||
PRE(60, 80, 1, 0, 0, 0),
|
PRE(60, 80, 1, 0, 0, 0),
|
||||||
FIRST(25, 35, 6, 2, 2, 4),
|
FIRST(25, 35, 6, 2, 3, 6),
|
||||||
SECOND(20, 30, 7, 4, 3, 6),
|
SECOND(20, 30, 7, 4, 4, 8),
|
||||||
THIRD(15, 25, 7, 4, 4, 8),
|
THIRD(15, 25, 7, 4, 5, 10),
|
||||||
FOURTH(10, 20, 8, 6, 6, 11),
|
FOURTH(10, 20, 8, 6, 7, 14),
|
||||||
LAST(5, 10, 0, 6, 8, 16);
|
LAST(5, 10, 0, 6, 9, 18);
|
||||||
|
|
||||||
|
|
||||||
State(int minTime, int maxTime, int switchAfter, int explosionSize, int minAmount, int maxAmount) {
|
State(int minTime, int maxTime, int switchAfter, int explosionSize, int minAmount, int maxAmount) {
|
||||||
|
@ -29,6 +29,7 @@ import de.steamwar.fightsystem.utils.Message;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
@ -105,6 +106,7 @@ public class PercentWincondition extends Wincondition implements PrintableWincon
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onEntityExplode(EntityExplodeEvent event) {
|
public void onEntityExplode(EntityExplodeEvent event) {
|
||||||
|
if (event.getEntityType() != EntityType.FIREBALL) {
|
||||||
if (explosionFilter.getAsBoolean() || !team.getExtendRegion().inRegion(event.getEntity().getLocation())) {
|
if (explosionFilter.getAsBoolean() || !team.getExtendRegion().inRegion(event.getEntity().getLocation())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -117,6 +119,7 @@ public class PercentWincondition extends Wincondition implements PrintableWincon
|
|||||||
|
|
||||||
checkWin.accept(team);
|
checkWin.accept(team);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void enable() {
|
private void enable() {
|
||||||
totalBlocks = totalBlockCalc.applyAsInt(team);
|
totalBlocks = totalBlockCalc.applyAsInt(team);
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren