Meteor #324
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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,17 +106,19 @@ public class PercentWincondition extends Wincondition implements PrintableWincon
|
||||
|
||||
@EventHandler
|
||||
public void onEntityExplode(EntityExplodeEvent event) {
|
||||
if (explosionFilter.getAsBoolean() || !team.getExtendRegion().inRegion(event.getEntity().getLocation())) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.blockList().forEach(block -> {
|
||||
if (testBlock.test(block.getType())) {
|
||||
currentBlocks--;
|
||||
if (event.getEntityType() != EntityType.FIREBALL) {
|
||||
if (explosionFilter.getAsBoolean() || !team.getExtendRegion().inRegion(event.getEntity().getLocation())) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
checkWin.accept(team);
|
||||
event.blockList().forEach(block -> {
|
||||
if (testBlock.test(block.getType())) {
|
||||
currentBlocks--;
|
||||
}
|
||||
});
|
||||
|
||||
checkWin.accept(team);
|
||||
}
|
||||
}
|
||||
|
||||
private void enable() {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Warum hier ein TNT Spawnen und nicht einfach die Explosionsstärke des Fireballs hochdrehen?
Damit Wasser mit weggeht? Das geht nur bei TNT Schaden weg, und ich weiß nicht ob es so gut ist (für Feuerbälle) dies zu erweitern.
Das ist FUD. Der WaterRemover schert sich nicht darum, ob es Feuerball oder TNT ist: https://steamwar.de/devlabs/SteamWar/FightSystem/src/branch/master/FightSystem_Core/src/de/steamwar/fightsystem/listener/WaterRemover.java
Aber wenn ich einfach eine Explosion mache, macht er es nicht weg, dass war es nämlich vorher. Werden nicht auch die beiden arten von Explosionen, anders berechnet intern, muss ich mir mal angucken.
Es macht einen Unterschied, ob du einen Fireball oder einen Large_Fireball (o.ä.) spawnst. Der eine ist ein Dispenser-Fireball, der andere ein Ghast-/MissileWars-Fireball!