From dbc7001c097564dc69a832ad739bcb8cae3c793f Mon Sep 17 00:00:00 2001 From: Aubri Seebauer Date: Mon, 3 Apr 2023 16:56:21 -0400 Subject: [PATCH] Revert ""Tag" raider on death" This reverts commit f260e28ae13fc08e5412a0b58343a0ea82c8860f. --- .../me/ShermansWorld/AlathraWar/Raid.java | 51 ++++--------------- 1 file changed, 11 insertions(+), 40 deletions(-) diff --git a/src/main/java/me/ShermansWorld/AlathraWar/Raid.java b/src/main/java/me/ShermansWorld/AlathraWar/Raid.java index e893ba6..7f59177 100644 --- a/src/main/java/me/ShermansWorld/AlathraWar/Raid.java +++ b/src/main/java/me/ShermansWorld/AlathraWar/Raid.java @@ -6,7 +6,6 @@ import com.palmergames.bukkit.towny.exceptions.TownyException; import com.palmergames.bukkit.towny.object.Town; import com.palmergames.bukkit.towny.object.TownBlock; import com.palmergames.bukkit.towny.object.WorldCoord; -import com.sun.tools.javac.util.Pair; import me.ShermansWorld.AlathraWar.commands.RaidCommands; import me.ShermansWorld.AlathraWar.data.RaidPhase; import org.bukkit.Bukkit; @@ -37,11 +36,11 @@ The raid is split into two phases: v/ Defenders are given time to get to the town. (travel is announced way in ahead) - COMBAT PHASE v/ Raiders go to town - v/ Combat occurs + - Combat occurs - Decides outcome of raid TODO LIST: -v/ No teleporting by raiders (also defenders) +- No teleporting by raiders v/ Points management v/ Raider death is negative score v/ Defender death is positive score @@ -76,7 +75,7 @@ public class Raid { int[] bukkitId; public ArrayList raiderPlayers; public ArrayList defenderPlayers; - public ArrayList> activeRaiders; + public ArrayList activeRaiders; // Constructs raid for staging phase public Raid(final int id, final War war, final Town raidedTown, final Town gatherTown, final String raiders, final String defenders, @@ -86,7 +85,7 @@ public class Raid { this.bukkitId = new int[1]; this.raiderPlayers = new ArrayList(); this.defenderPlayers = new ArrayList(); - this.activeRaiders = new ArrayList>(); + this.activeRaiders = new ArrayList(); this.war = war; this.raidedTown = raidedTown; this.gatherTown = gatherTown; @@ -283,8 +282,7 @@ public class Raid { } /** - * Use only during combat phase of raid - * @param event + * Need to add call to KillsListener (defined seperate from Siege) */ public void raiderKilledInCombat(PlayerDeathEvent event) { @@ -313,20 +311,10 @@ public class Raid { throw new RuntimeException(e); } } - - //Tag that the player has been killed in the raid - for(Pair p : this.activeRaiders) { - if(p.fst.equals(killed.getName()) && !p.snd) { - Pair newP = new Pair(p.fst, true); - this.activeRaiders.remove(p); - this.activeRaiders.add(newP); - } - } } /** - * Use only during combat phase of raid - * @param event + * Need to add call to KillsListener (defined seperate from Siege) */ public void defenderKilledInCombat(PlayerDeathEvent event) { this.addPointsToRaidScore(20); @@ -356,8 +344,7 @@ public class Raid { } /** - * Use only out of combat phase of raid - * @param event + * Need to add call to KillsListener (defined seperate from Siege) */ public void raiderKilledOutofCombat(PlayerDeathEvent event) { @@ -388,8 +375,7 @@ public class Raid { } /** - * Use only out of combat phase of raid - * @param event + * Need to add call to KillsListener (defined seperate from Siege) */ public void defenderKilledOutofCombat(PlayerDeathEvent event) { for (final String playerName : this.getActiveRaiders()) { @@ -537,33 +523,18 @@ public class Raid { } public ArrayList getActiveRaiders() { - ArrayList raidersNames = new ArrayList<>(); - for(Pair p : this.activeRaiders) { - raidersNames.add(p.fst); - } - return raidersNames; - } - - public ArrayList> getActiveRaidersRaw() { return this.activeRaiders; } - public void setActiveRaiders(ArrayList> activeRaiders) { + public void setActiveRaiders(ArrayList activeRaiders) { this.activeRaiders = activeRaiders; } public void addActiveRaider(String player) { - this.activeRaiders.add(new Pair(player, false)); + this.activeRaiders.add(player); } - /** - * Finds first!!!! and removes - * @param name - */ public void removeActiveRaider(String name) { - for(Pair p : this.activeRaiders) { - if(p.fst.equals(name)) this.activeRaiders.remove(p); - return; - } + this.activeRaiders.remove(name); } }