Sneaky Assassins changes :)
This commit is contained in:
parent
fb0469adfa
commit
a4d579789c
|
@ -3,6 +3,7 @@ package nautilus.game.arcade.game.games.sneakyassassins.kits;
|
||||||
import nautilus.game.arcade.*;
|
import nautilus.game.arcade.*;
|
||||||
import nautilus.game.arcade.kit.*;
|
import nautilus.game.arcade.kit.*;
|
||||||
import nautilus.game.arcade.kit.perks.*;
|
import nautilus.game.arcade.kit.perks.*;
|
||||||
|
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.entity.*;
|
import org.bukkit.entity.*;
|
||||||
import org.bukkit.inventory.*;
|
import org.bukkit.inventory.*;
|
||||||
|
@ -11,7 +12,16 @@ public class KitAssassin extends SneakyAssassinKit
|
||||||
{
|
{
|
||||||
public KitAssassin(ArcadeManager manager)
|
public KitAssassin(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Assassin", KitAvailability.Free, new String[]{""}, new Perk[]{new PerkSmokebomb(Material.INK_SACK, 5, true)}, new ItemStack(Material.BOW));
|
super(manager, "Ranged Assassin", KitAvailability.Free,
|
||||||
|
new String[]
|
||||||
|
{
|
||||||
|
"Skilled at ranged assassination!"
|
||||||
|
},
|
||||||
|
new Perk[]
|
||||||
|
{
|
||||||
|
new PerkSmokebomb(Material.INK_SACK, 5, true)
|
||||||
|
},
|
||||||
|
new ItemStack(Material.BOW));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -11,7 +11,16 @@ public class KitEscapeArtist extends SneakyAssassinKit
|
||||||
{
|
{
|
||||||
public KitEscapeArtist(ArcadeManager manager)
|
public KitEscapeArtist(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Escape Artist", KitAvailability.Free, new String[]{""}, new Perk[]{new PerkSmokebomb(Material.INK_SACK, 5, true)}, new ItemStack(Material.INK_SACK));
|
super(manager, "Escape Artist", KitAvailability.Free,
|
||||||
|
new String[]
|
||||||
|
{
|
||||||
|
"Carries two extra Smokebombs!"
|
||||||
|
},
|
||||||
|
new Perk[]
|
||||||
|
{
|
||||||
|
new PerkSmokebomb(Material.INK_SACK, 5, true)
|
||||||
|
},
|
||||||
|
new ItemStack(Material.INK_SACK));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,6 +5,7 @@ import mineplex.core.itemstack.*;
|
||||||
import nautilus.game.arcade.*;
|
import nautilus.game.arcade.*;
|
||||||
import nautilus.game.arcade.kit.*;
|
import nautilus.game.arcade.kit.*;
|
||||||
import nautilus.game.arcade.kit.perks.*;
|
import nautilus.game.arcade.kit.perks.*;
|
||||||
|
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.entity.*;
|
import org.bukkit.entity.*;
|
||||||
import org.bukkit.inventory.*;
|
import org.bukkit.inventory.*;
|
||||||
|
@ -13,7 +14,17 @@ public class KitRevealer extends SneakyAssassinKit
|
||||||
{
|
{
|
||||||
public KitRevealer(ArcadeManager manager)
|
public KitRevealer(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Revealer", KitAvailability.Free, new String[]{""}, new Perk[]{new PerkSmokebomb(Material.INK_SACK, 5, true), new PerkRevealer()}, new ItemStack(Material.EMERALD));
|
super(manager, "Revealer", KitAvailability.Free,
|
||||||
|
new String[]
|
||||||
|
{
|
||||||
|
"Carries two extra Smokebombs!"
|
||||||
|
},
|
||||||
|
new Perk[]
|
||||||
|
{
|
||||||
|
new PerkSmokebomb(Material.INK_SACK, 5, true),
|
||||||
|
new PerkRevealer()
|
||||||
|
},
|
||||||
|
new ItemStack(Material.INK_SACK));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -32,9 +32,9 @@ public abstract class SneakyAssassinKit extends Kit
|
||||||
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Smoke Bomb",
|
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Smoke Bomb",
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
ChatColor.RESET + "Throw a smoke bomb.",
|
ChatColor.RESET + "Throw a Smoke Bomb.",
|
||||||
ChatColor.RESET + "Everyone within 5 blocks",
|
ChatColor.RESET + "Everyone within 6 blocks",
|
||||||
ChatColor.RESET + "gets blindness for 5 seconds.",
|
ChatColor.RESET + "gets Blindness for 6 seconds.",
|
||||||
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package nautilus.game.arcade.game.games.sneakyassassins.npc;
|
package nautilus.game.arcade.game.games.sneakyassassins.npc;
|
||||||
|
|
||||||
import mineplex.core.common.util.*;
|
import mineplex.core.common.util.*;
|
||||||
|
import mineplex.core.timing.TimingManager;
|
||||||
import mineplex.core.updater.*;
|
import mineplex.core.updater.*;
|
||||||
import mineplex.core.updater.event.*;
|
import mineplex.core.updater.event.*;
|
||||||
import nautilus.game.arcade.game.*;
|
import nautilus.game.arcade.game.*;
|
||||||
|
@ -53,21 +54,7 @@ public class NpcManager implements Listener
|
||||||
|
|
||||||
public Location getNpcSpawn()
|
public Location getNpcSpawn()
|
||||||
{
|
{
|
||||||
Location best = null;
|
return UtilAlg.Random(getGame().GetTeamList().get(0).GetSpawns());
|
||||||
double farthest = Double.NaN;
|
|
||||||
|
|
||||||
for (Location spawn : getGame().GetTeamList().get(0).GetSpawns())
|
|
||||||
{
|
|
||||||
double distance = getNearestVillagerDistanceSquared(spawn);
|
|
||||||
|
|
||||||
if (Double.isNaN(farthest) || distance > farthest)
|
|
||||||
{
|
|
||||||
best = spawn;
|
|
||||||
farthest = distance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return best;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
@ -78,17 +65,24 @@ public class NpcManager implements Listener
|
||||||
|
|
||||||
if (getGame().GetState() != Game.GameState.Live)
|
if (getGame().GetState() != Game.GameState.Live)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bustle();
|
bustle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onEntityDeath(EntityDeathEvent event)
|
public void onEntityDeath(EntityDeathEvent event)
|
||||||
{
|
{
|
||||||
if(event.getEntity().getWorld() == getGame().WorldData.World)
|
try
|
||||||
{
|
{
|
||||||
event.setDroppedExp(0);
|
if (event.getEntity().getWorld() == getGame().WorldData.World)
|
||||||
event.getDrops().clear();
|
{
|
||||||
|
event.setDroppedExp(0);
|
||||||
|
event.getDrops().clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,34 +97,11 @@ public class NpcManager implements Listener
|
||||||
if (loc.getWorld().getHighestBlockYAt(loc) > 0)
|
if (loc.getWorld().getHighestBlockYAt(loc) > 0)
|
||||||
{
|
{
|
||||||
UtilEnt.CreatureMove(npc, loc, 0.8f);
|
UtilEnt.CreatureMove(npc, loc, 0.8f);
|
||||||
|
|
||||||
npc.teleport(npc.getLocation().add(0, 1.2, 0));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private double getNearestVillagerDistanceSquared(Location location)
|
|
||||||
{
|
|
||||||
double nearest = Double.NaN;
|
|
||||||
|
|
||||||
for (Entity entity : getGame().GetPlayers(true))
|
|
||||||
{
|
|
||||||
double distance = entity.getLocation().distanceSquared(location);
|
|
||||||
|
|
||||||
nearest = Double.isNaN(nearest) ? distance : Math.min(nearest, distance);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Entity entity : getNpcs())
|
|
||||||
{
|
|
||||||
double distance = entity.getLocation().distanceSquared(location);
|
|
||||||
|
|
||||||
nearest = Double.isNaN(nearest) ? distance : Math.min(nearest, distance);
|
|
||||||
}
|
|
||||||
|
|
||||||
return nearest;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Random getRandom()
|
public Random getRandom()
|
||||||
{
|
{
|
||||||
return _random;
|
return _random;
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class PerkRevealer extends Perk implements IThrown
|
||||||
|
|
||||||
public PerkRevealer()
|
public PerkRevealer()
|
||||||
{
|
{
|
||||||
super("Revealer", new String[]{C.cYellow + "Right-Click" + C.cGray + " with Emerald to " + C.cGreen + "throw Revealer"});
|
super("Revealer", new String[]{C.cYellow + "Right-Click" + C.cGray + " with Emerald to " + C.cGreen + "Throw Revealer"});
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
|
|
@ -26,25 +26,25 @@ import java.util.*;
|
||||||
public class PerkSmokebomb extends Perk
|
public class PerkSmokebomb extends Perk
|
||||||
{
|
{
|
||||||
private final Set<Material> activatorTypes;
|
private final Set<Material> activatorTypes;
|
||||||
private final int blindnessDuration;
|
private final int effectDuration;
|
||||||
private final boolean itemConsumed;
|
private final boolean itemConsumed;
|
||||||
|
|
||||||
public PerkSmokebomb(Material activatorType, int blindnessDuration, boolean itemConsumed)
|
public PerkSmokebomb(Material activatorType, int effectDuration, boolean itemConsumed)
|
||||||
{
|
{
|
||||||
this(activatorType, blindnessDuration, itemConsumed, C.cYellow + "Right-Click" + C.cGray + " to " + C.cGreen + "Smoke Bomb");
|
this(activatorType, effectDuration, itemConsumed, C.cYellow + "Right-Click" + C.cGray + " to " + C.cGreen + "Smoke Bomb");
|
||||||
}
|
}
|
||||||
|
|
||||||
public PerkSmokebomb(Material activatorType, int blindnessDuration, boolean itemConsumed, String... description)
|
public PerkSmokebomb(Material activatorType, int effectDuration, boolean itemConsumed, String... description)
|
||||||
{
|
{
|
||||||
this(EnumSet.of(activatorType), blindnessDuration, itemConsumed, description);
|
this(EnumSet.of(activatorType), effectDuration, itemConsumed, description);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PerkSmokebomb(Set<Material> activatorTypes, int blindnessDuration, boolean itemConsumed, String... description)
|
public PerkSmokebomb(Set<Material> activatorTypes, int effectDuration, boolean itemConsumed, String... description)
|
||||||
{
|
{
|
||||||
super("Smoke Bomb", description);
|
super("Smoke Bomb", description);
|
||||||
|
|
||||||
this.activatorTypes = activatorTypes;
|
this.activatorTypes = activatorTypes;
|
||||||
this.blindnessDuration = blindnessDuration;
|
this.effectDuration = effectDuration;
|
||||||
this.itemConsumed = itemConsumed;
|
this.itemConsumed = itemConsumed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,9 +53,9 @@ public class PerkSmokebomb extends Perk
|
||||||
return activatorTypes;
|
return activatorTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getBlindnessDuration()
|
public int geteffectDuration()
|
||||||
{
|
{
|
||||||
return blindnessDuration;
|
return effectDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isItemConsumed()
|
public boolean isItemConsumed()
|
||||||
|
@ -90,7 +90,7 @@ public class PerkSmokebomb extends Perk
|
||||||
}
|
}
|
||||||
|
|
||||||
//Action
|
//Action
|
||||||
Manager.GetCondition().Factory().Cloak(GetName(), player, player, 8, false, false);
|
//Manager.GetCondition().Factory().Cloak(GetName(), player, player, 8, false, false);
|
||||||
//Manager.GetCondition().Factory().Vulnerable(GetName(), player, player, 6, 3, false, false, true);
|
//Manager.GetCondition().Factory().Vulnerable(GetName(), player, player, 6, 3, false, false, true);
|
||||||
|
|
||||||
//Blind
|
//Blind
|
||||||
|
@ -99,7 +99,8 @@ public class PerkSmokebomb extends Perk
|
||||||
if (other.equals(player))
|
if (other.equals(player))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Manager.GetCondition().Factory().Blind(GetName(), other, player, getBlindnessDuration(), 0, false, false, true);
|
Manager.GetCondition().Factory().Blind(GetName(), other, player, geteffectDuration(), 0, false, false, true);
|
||||||
|
Manager.GetCondition().Factory().Slow(GetName(), other, player, geteffectDuration(), 1, false, false, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Effects
|
//Effects
|
||||||
|
|
Loading…
Reference in New Issue