From eab7cbe385a97163528ac55c10847e71416e8627 Mon Sep 17 00:00:00 2001 From: phobia Date: Tue, 29 Mar 2016 16:29:03 +1100 Subject: [PATCH] PC-35 --- .../tutorials/clans/objective/AttackEnemyObjective.java | 9 +++++++++ .../objective/goals/attackenemy/BlowUpWallGoal.java | 1 + .../objective/goals/attackenemy/MountCannonGoal.java | 8 +++----- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java index f0d05b9dd..65f8c6af4 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java @@ -1,5 +1,6 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective; +import mineplex.game.clans.clans.siege.weapon.Cannon; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; @@ -13,8 +14,14 @@ import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy. import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy.MountCannonGoal; import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy.StealEnemyPotatoesGoal; +import java.util.HashMap; +import java.util.Map; + public class AttackEnemyObjective extends OrderedObjective { + + private Map _cannon = new HashMap<>(); + public AttackEnemyObjective(ClansMainTutorial clansMainTutorial, JavaPlugin javaPlugin) { super(clansMainTutorial, javaPlugin, "Attack Enemy", "Attack and raid this enemy!"); @@ -36,4 +43,6 @@ public class AttackEnemyObjective extends OrderedObjective protected void customFinish(Player player) { } + + public Map getCannons() {return _cannon; } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/BlowUpWallGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/BlowUpWallGoal.java index ab5ff9cd1..d81edc9e4 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/BlowUpWallGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/BlowUpWallGoal.java @@ -107,5 +107,6 @@ public class BlowUpWallGoal extends ObjectiveGoal @Override protected void customFinish(Player player) { + getObjective().getCannons().remove(player.getName()).kill(); //Kill cannon after goal complete } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/MountCannonGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/MountCannonGoal.java index 23e537956..f707b34e6 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/MountCannonGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/MountCannonGoal.java @@ -18,8 +18,6 @@ import mineplex.game.clans.tutorial.tutorials.clans.objective.AttackEnemyObjecti public class MountCannonGoal extends ObjectiveGoal { - private Map _cannon = new HashMap<>(); - public MountCannonGoal(AttackEnemyObjective objective) { super(objective, "Get on Cannon", "Right click on the Cannon to hop on!"); @@ -28,14 +26,14 @@ public class MountCannonGoal extends ObjectiveGoal @Override protected void customStart(Player player) { - _cannon.put(player.getName(), SiegeManager.Instance.spawnCannon(player, getObjective().getPlugin().getPoint(getObjective().getPlugin().getRegion(player), Point.CANNON), false)); - _cannon.get(player.getName()).SetForcedVelocity(0.4, 2.45); + getObjective().getCannons().put(player.getName(), SiegeManager.Instance.spawnCannon(player, getObjective().getPlugin().getPoint(getObjective().getPlugin().getRegion(player), Point.CANNON), false)); + getObjective().getCannons().get(player.getName()).SetForcedVelocity(0.4, 2.45); } @Override protected void clean(Player player, TutorialRegion region) { - _cannon.remove(player.getName()).kill(); + getObjective().getCannons().remove(player.getName()).kill(); } @Override