Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex
This commit is contained in:
commit
3830ab8e0f
@ -54,6 +54,12 @@ public class UtilInv
|
|||||||
|
|
||||||
public static boolean contains(Player player, Material item, byte data, int required)
|
public static boolean contains(Player player, Material item, byte data, int required)
|
||||||
{
|
{
|
||||||
|
return contains(player, null, item, data, required);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean contains(Player player, String itemNameContains, Material item, byte data, int required)
|
||||||
|
{
|
||||||
|
|
||||||
for (int i : player.getInventory().all(item).keySet())
|
for (int i : player.getInventory().all(item).keySet())
|
||||||
{
|
{
|
||||||
if (required <= 0)
|
if (required <= 0)
|
||||||
@ -61,10 +67,21 @@ public class UtilInv
|
|||||||
|
|
||||||
ItemStack stack = player.getInventory().getItem(i);
|
ItemStack stack = player.getInventory().getItem(i);
|
||||||
|
|
||||||
if (stack != null && stack.getAmount() > 0 && (stack.getData() == null || stack.getData().getData() == data))
|
if (stack == null)
|
||||||
{
|
continue;
|
||||||
required -= stack.getAmount();
|
|
||||||
}
|
if (stack.getAmount() <= 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (data >=0 &&
|
||||||
|
stack.getData() != null && stack.getData().getData() != data)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (itemNameContains != null &&
|
||||||
|
(stack.getItemMeta().getDisplayName() == null || !stack.getItemMeta().getDisplayName().contains(itemNameContains)))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
required -= stack.getAmount();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (required <= 0)
|
if (required <= 0)
|
||||||
@ -196,10 +213,15 @@ public class UtilInv
|
|||||||
|
|
||||||
public static boolean IsItem(ItemStack item, Material type, byte data)
|
public static boolean IsItem(ItemStack item, Material type, byte data)
|
||||||
{
|
{
|
||||||
return IsItem(item, type.getId(), data);
|
return IsItem(item, null, type.getId(), data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean IsItem(ItemStack item, int id, byte data)
|
public static boolean IsItem(ItemStack item, String name, Material type, byte data)
|
||||||
|
{
|
||||||
|
return IsItem(item, name, type.getId(), data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean IsItem(ItemStack item, String name, int id, byte data)
|
||||||
{
|
{
|
||||||
if (item == null)
|
if (item == null)
|
||||||
return false;
|
return false;
|
||||||
@ -210,6 +232,9 @@ public class UtilInv
|
|||||||
if (data != -1 && GetData(item) != data)
|
if (data != -1 && GetData(item) != data)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (name != null && (item.getItemMeta().getDisplayName() == null || !item.getItemMeta().getDisplayName().contains(name)))
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,12 +272,12 @@ public class UtilInv
|
|||||||
{
|
{
|
||||||
boolean match = false;
|
boolean match = false;
|
||||||
|
|
||||||
if (IsItem(event.getCurrentItem(), type, data))
|
if (IsItem(event.getCurrentItem(), name, type, data))
|
||||||
match = true;
|
match = true;
|
||||||
|
|
||||||
if (IsItem(event.getWhoClicked().getInventory().getItem(event.getHotbarButton()), type, data))
|
if (IsItem(event.getWhoClicked().getInventory().getItem(event.getHotbarButton()), name, type, data))
|
||||||
match = true;
|
match = true;
|
||||||
|
|
||||||
if (!match)
|
if (!match)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -266,10 +291,10 @@ public class UtilInv
|
|||||||
if (event.getCurrentItem() == null)
|
if (event.getCurrentItem() == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IsItem(event.getCurrentItem(), type, data);
|
IsItem(event.getCurrentItem(), name, type, data);
|
||||||
|
|
||||||
//Type
|
//Type
|
||||||
if (!IsItem(event.getCurrentItem(), type, data))
|
if (!IsItem(event.getCurrentItem(), name, type, data))
|
||||||
return;
|
return;
|
||||||
//Inform
|
//Inform
|
||||||
UtilPlayer.message(event.getWhoClicked(), F.main("Inventory", "You cannot move " + F.item(name) + "."));
|
UtilPlayer.message(event.getWhoClicked(), F.main("Inventory", "You cannot move " + F.item(name) + "."));
|
||||||
|
@ -54,7 +54,7 @@ import mineplex.core.common.util.UtilPlayer;
|
|||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
import mineplex.core.common.util.UtilWorld;
|
import mineplex.core.common.util.UtilWorld;
|
||||||
import mineplex.core.treasure.TreasureManager;
|
import mineplex.core.treasure.TreasureManager;
|
||||||
import mineplex.minecraft.game.core.condition.ConditionManager;
|
import mineplex.minecraft.game.core.condition.ConditionManager;
|
||||||
import mineplex.core.cosmetic.CosmeticManager;
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
import mineplex.core.disguise.DisguiseManager;
|
import mineplex.core.disguise.DisguiseManager;
|
||||||
|
@ -109,7 +109,7 @@ public class CompassAddon extends MiniPlugin
|
|||||||
" " + C.cWhite + C.Bold + "Distance: " + targetTeam.GetColor() + UtilMath.trim(1, bestDist) +
|
" " + C.cWhite + C.Bold + "Distance: " + targetTeam.GetColor() + UtilMath.trim(1, bestDist) +
|
||||||
" " + C.cWhite + C.Bold + "Height: " + targetTeam.GetColor() + UtilMath.trim(1, heightDiff));
|
" " + C.cWhite + C.Bold + "Height: " + targetTeam.GetColor() + UtilMath.trim(1, heightDiff));
|
||||||
stack.setItemMeta(itemMeta);
|
stack.setItemMeta(itemMeta);
|
||||||
|
|
||||||
player.getInventory().setItem(i, stack);
|
player.getInventory().setItem(i, stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,9 @@ import org.bukkit.entity.Player;
|
|||||||
public class GameTeam
|
public class GameTeam
|
||||||
{
|
{
|
||||||
private Game Host;
|
private Game Host;
|
||||||
|
|
||||||
private double _respawnTime = 0;
|
private double _respawnTime = 0;
|
||||||
|
|
||||||
public enum PlayerState
|
public enum PlayerState
|
||||||
{
|
{
|
||||||
IN("In", ChatColor.GREEN),
|
IN("In", ChatColor.GREEN),
|
||||||
@ -66,14 +66,14 @@ public class GameTeam
|
|||||||
private int _spawnDistance = 0;
|
private int _spawnDistance = 0;
|
||||||
|
|
||||||
private boolean _visible = true;
|
private boolean _visible = true;
|
||||||
|
|
||||||
//Records order players go out in
|
//Records order players go out in
|
||||||
protected ArrayList<Player> _places = new ArrayList<Player>();
|
protected ArrayList<Player> _places = new ArrayList<Player>();
|
||||||
|
|
||||||
public GameTeam(Game host, String name, ChatColor color, ArrayList<Location> spawns)
|
public GameTeam(Game host, String name, ChatColor color, ArrayList<Location> spawns)
|
||||||
{
|
{
|
||||||
Host = host;
|
Host = host;
|
||||||
|
|
||||||
_name = name;
|
_name = name;
|
||||||
_color = color;
|
_color = color;
|
||||||
_spawns = spawns;
|
_spawns = spawns;
|
||||||
@ -96,7 +96,7 @@ public class GameTeam
|
|||||||
|
|
||||||
public Location GetSpawn()
|
public Location GetSpawn()
|
||||||
{
|
{
|
||||||
// ArrayList<Location> valid = new ArrayList<Location>();
|
// ArrayList<Location> valid = new ArrayList<Location>();
|
||||||
|
|
||||||
Location best = null;
|
Location best = null;
|
||||||
double bestDist = 0;
|
double bestDist = 0;
|
||||||
@ -119,14 +119,14 @@ public class GameTeam
|
|||||||
bestDist = closestPlayer;
|
bestDist = closestPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (closestPlayer > _spawnDistance * _spawnDistance)
|
// if (closestPlayer > _spawnDistance * _spawnDistance)
|
||||||
// {
|
// {
|
||||||
// valid.add(loc);
|
// valid.add(loc);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (valid.size() > 0)
|
// if (valid.size() > 0)
|
||||||
// valid.get(UtilMath.r(valid.size()));
|
// valid.get(UtilMath.r(valid.size()));
|
||||||
|
|
||||||
if (best != null)
|
if (best != null)
|
||||||
return best;
|
return best;
|
||||||
@ -228,7 +228,7 @@ public class GameTeam
|
|||||||
{
|
{
|
||||||
SpawnTeleport(true);
|
SpawnTeleport(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SpawnTeleport(boolean aliveOnly)
|
public void SpawnTeleport(boolean aliveOnly)
|
||||||
{
|
{
|
||||||
for (Player player : GetPlayers(aliveOnly))
|
for (Player player : GetPlayers(aliveOnly))
|
||||||
@ -342,7 +342,7 @@ public class GameTeam
|
|||||||
{
|
{
|
||||||
_respawnTime = i;
|
_respawnTime = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double GetRespawnTime()
|
public double GetRespawnTime()
|
||||||
{
|
{
|
||||||
return _respawnTime;
|
return _respawnTime;
|
||||||
@ -351,32 +351,33 @@ public class GameTeam
|
|||||||
public void SetPlacement(Player player, PlayerState state)
|
public void SetPlacement(Player player, PlayerState state)
|
||||||
{
|
{
|
||||||
if (state == PlayerState.OUT)
|
if (state == PlayerState.OUT)
|
||||||
|
{
|
||||||
if (!_places.contains(player))
|
if (!_places.contains(player))
|
||||||
_places.add(0, player);
|
_places.add(0, player);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
_places.remove(player);
|
_places.remove(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<Player> GetPlacements(boolean includeAlivePlayers)
|
public ArrayList<Player> GetPlacements(boolean includeAlivePlayers)
|
||||||
{
|
{
|
||||||
if (includeAlivePlayers)
|
if (includeAlivePlayers)
|
||||||
{
|
{
|
||||||
ArrayList<Player> placesClone = new ArrayList<Player>();
|
ArrayList<Player> placesClone = new ArrayList<Player>();
|
||||||
|
|
||||||
for (Player player : _places)
|
for (Player player : _places)
|
||||||
{
|
{
|
||||||
placesClone.add(player);
|
placesClone.add(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Player player : GetPlayers(true))
|
for (Player player : GetPlayers(true))
|
||||||
{
|
{
|
||||||
placesClone.add(0, player);
|
placesClone.add(0, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
return placesClone;
|
return placesClone;
|
||||||
}
|
}
|
||||||
|
|
||||||
return _places;
|
return _places;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,6 +73,7 @@ import nautilus.game.arcade.events.GameStateChangeEvent;
|
|||||||
import nautilus.game.arcade.events.PlayerPrepareTeleportEvent;
|
import nautilus.game.arcade.events.PlayerPrepareTeleportEvent;
|
||||||
import nautilus.game.arcade.game.GameTeam;
|
import nautilus.game.arcade.game.GameTeam;
|
||||||
import nautilus.game.arcade.game.TeamGame;
|
import nautilus.game.arcade.game.TeamGame;
|
||||||
|
import nautilus.game.arcade.game.GameTeam.PlayerState;
|
||||||
import nautilus.game.arcade.game.games.hideseek.forms.BlockForm;
|
import nautilus.game.arcade.game.games.hideseek.forms.BlockForm;
|
||||||
import nautilus.game.arcade.game.games.hideseek.forms.CreatureForm;
|
import nautilus.game.arcade.game.games.hideseek.forms.CreatureForm;
|
||||||
import nautilus.game.arcade.game.games.hideseek.forms.Form;
|
import nautilus.game.arcade.game.games.hideseek.forms.Form;
|
||||||
@ -958,6 +959,10 @@ public class HideSeek extends TeamGame
|
|||||||
|
|
||||||
public void SetSeeker(Player player, boolean forced)
|
public void SetSeeker(Player player, boolean forced)
|
||||||
{
|
{
|
||||||
|
GameTeam pastTeam = GetTeam(player);
|
||||||
|
if (pastTeam != null && pastTeam.equals(_hiders))
|
||||||
|
pastTeam.SetPlacement(player, PlayerState.OUT);
|
||||||
|
|
||||||
SetPlayerTeam(player, _seekers, true);
|
SetPlayerTeam(player, _seekers, true);
|
||||||
|
|
||||||
Manager.GetDisguise().undisguise(player);
|
Manager.GetDisguise().undisguise(player);
|
||||||
@ -1011,12 +1016,25 @@ public class HideSeek extends TeamGame
|
|||||||
|
|
||||||
if (_hiders.GetPlayers(true).isEmpty())
|
if (_hiders.GetPlayers(true).isEmpty())
|
||||||
{
|
{
|
||||||
SetState(GameState.End);
|
ArrayList<Player> places = _hiders.GetPlacements(true);
|
||||||
AnnounceEnd(_seekers);
|
|
||||||
|
AnnounceEnd(_hiders.GetPlacements(true));
|
||||||
|
|
||||||
|
//Gems
|
||||||
|
if (places.size() >= 1)
|
||||||
|
AddGems(places.get(0), 20, "1st Place", false);
|
||||||
|
|
||||||
|
if (places.size() >= 2)
|
||||||
|
AddGems(places.get(1), 15, "2nd Place", false);
|
||||||
|
|
||||||
|
if (places.size() >= 3)
|
||||||
|
AddGems(places.get(2), 10, "3rd Place", false);
|
||||||
|
|
||||||
for (Player player : GetPlayers(false))
|
for (Player player : GetPlayers(false))
|
||||||
if (player.isOnline())
|
if (player.isOnline())
|
||||||
AddGems(player, 10, "Participation", false);
|
AddGems(player, 10, "Participation", false);
|
||||||
|
|
||||||
|
SetState(GameState.End);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1084,8 +1102,7 @@ public class HideSeek extends TeamGame
|
|||||||
if (timeLeft <= 0)
|
if (timeLeft <= 0)
|
||||||
{
|
{
|
||||||
WriteScoreboard();
|
WriteScoreboard();
|
||||||
|
|
||||||
SetState(GameState.End);
|
|
||||||
AnnounceEnd(_hiders);
|
AnnounceEnd(_hiders);
|
||||||
|
|
||||||
for (Player player : _hiders.GetPlayers(true))
|
for (Player player : _hiders.GetPlayers(true))
|
||||||
@ -1094,6 +1111,8 @@ public class HideSeek extends TeamGame
|
|||||||
for (Player player : GetPlayers(false))
|
for (Player player : GetPlayers(false))
|
||||||
if (player.isOnline())
|
if (player.isOnline())
|
||||||
AddGems(player, 10, "Participation", false);
|
AddGems(player, 10, "Participation", false);
|
||||||
|
|
||||||
|
SetState(GameState.End);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,8 @@ import org.bukkit.entity.Item;
|
|||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Painting;
|
import org.bukkit.entity.Painting;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Projectile;
|
||||||
|
import org.bukkit.entity.Snowball;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
||||||
@ -51,6 +53,7 @@ import mineplex.core.common.util.C;
|
|||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilAction;
|
import mineplex.core.common.util.UtilAction;
|
||||||
import mineplex.core.common.util.UtilAlg;
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilBlock;
|
||||||
import mineplex.core.common.util.UtilEnt;
|
import mineplex.core.common.util.UtilEnt;
|
||||||
import mineplex.core.common.util.UtilEvent;
|
import mineplex.core.common.util.UtilEvent;
|
||||||
import mineplex.core.common.util.UtilGear;
|
import mineplex.core.common.util.UtilGear;
|
||||||
@ -87,6 +90,7 @@ import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
|
|||||||
import nautilus.game.arcade.game.games.minestrike.items.equipment.armor.Armor;
|
import nautilus.game.arcade.game.games.minestrike.items.equipment.armor.Armor;
|
||||||
import nautilus.game.arcade.game.games.minestrike.items.grenades.Grenade;
|
import nautilus.game.arcade.game.games.minestrike.items.grenades.Grenade;
|
||||||
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
|
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.guns.GunType;
|
||||||
import nautilus.game.arcade.game.games.minestrike.items.guns.pistol.Glock18;
|
import nautilus.game.arcade.game.games.minestrike.items.guns.pistol.Glock18;
|
||||||
import nautilus.game.arcade.game.games.minestrike.items.guns.pistol.P2000;
|
import nautilus.game.arcade.game.games.minestrike.items.guns.pistol.P2000;
|
||||||
import nautilus.game.arcade.game.games.minestrike.items.guns.rifle.AWP;
|
import nautilus.game.arcade.game.games.minestrike.items.guns.rifle.AWP;
|
||||||
@ -104,8 +108,11 @@ public class MineStrike extends TeamGame
|
|||||||
private int _roundsToWin = 10;
|
private int _roundsToWin = 10;
|
||||||
private long _roundTime = 120000;
|
private long _roundTime = 120000;
|
||||||
|
|
||||||
private boolean _bulletInstant = true;
|
private boolean _debug = false;
|
||||||
|
private int _bulletInstant = 2; //0 = Slow, 1 = Instant, 2 = Mix
|
||||||
|
private boolean _customHitbox = true;
|
||||||
|
private boolean _bulletAlternate = false;
|
||||||
|
|
||||||
//Map Data
|
//Map Data
|
||||||
private ArrayList<Location> _bombSites;
|
private ArrayList<Location> _bombSites;
|
||||||
|
|
||||||
@ -123,7 +130,7 @@ public class MineStrike extends TeamGame
|
|||||||
|
|
||||||
private HashMap<Entity, Bullet> _bullets = new HashMap<Entity, Bullet>();
|
private HashMap<Entity, Bullet> _bullets = new HashMap<Entity, Bullet>();
|
||||||
private HashMap<Entity, Grenade> _grenadesThrown = new HashMap<Entity, Grenade>();
|
private HashMap<Entity, Grenade> _grenadesThrown = new HashMap<Entity, Grenade>();
|
||||||
|
|
||||||
private HashMap<Location, Long> _incendiary = new HashMap<Location, Long>();
|
private HashMap<Location, Long> _incendiary = new HashMap<Location, Long>();
|
||||||
|
|
||||||
private Bomb _bomb = null;
|
private Bomb _bomb = null;
|
||||||
@ -177,16 +184,20 @@ public class MineStrike extends TeamGame
|
|||||||
|
|
||||||
this._help = new String[]
|
this._help = new String[]
|
||||||
{
|
{
|
||||||
"Tap Crouch when close to an ally to Boost",
|
//"Tap Crouch when close to an ally to Boost",
|
||||||
|
"Open Inventory at spawn to buy guns",
|
||||||
|
"Hold Right-Click to Plant Bomb",
|
||||||
|
"Hold Right-Click with knife to Defuse Bomb",
|
||||||
"Moving decreases accuracy",
|
"Moving decreases accuracy",
|
||||||
"Sprinting heavily decreases accuracy",
|
"Sprinting heavily decreases accuracy",
|
||||||
"Jumping massively decreases accuracy",
|
"Jumping massively decreases accuracy",
|
||||||
"Crouching increases accuracy",
|
"Crouching increases accuracy",
|
||||||
"Hold Right-Click to Plant Bomb",
|
|
||||||
"Hold Right-Click with knife to Defuse Bomb",
|
|
||||||
"Left-Click to roll Grenades",
|
"Left-Click to roll Grenades",
|
||||||
"Right-Click to throw Grenades",
|
"Right-Click to throw Grenades",
|
||||||
"Burst Fire for greater accuracy",
|
"Burst Fire for greater accuracy",
|
||||||
|
"Sniper Rifles are only accurate while scoped",
|
||||||
|
"Rifles have 30% recoil reduction while scoped",
|
||||||
|
"Pick up better weapons from dead players"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,7 +239,7 @@ public class MineStrike extends TeamGame
|
|||||||
|
|
||||||
//Sneak
|
//Sneak
|
||||||
disguiseSneak(event.GetPlayer(), team);
|
disguiseSneak(event.GetPlayer(), team);
|
||||||
|
|
||||||
//Armor
|
//Armor
|
||||||
giveTeamArmor(event.GetPlayer(), Color.fromRGB(255, 0, 0));
|
giveTeamArmor(event.GetPlayer(), Color.fromRGB(255, 0, 0));
|
||||||
}
|
}
|
||||||
@ -244,7 +255,7 @@ public class MineStrike extends TeamGame
|
|||||||
|
|
||||||
//Sneak
|
//Sneak
|
||||||
disguiseSneak(event.GetPlayer(), team);
|
disguiseSneak(event.GetPlayer(), team);
|
||||||
|
|
||||||
//Armor
|
//Armor
|
||||||
giveTeamArmor(event.GetPlayer(), Color.fromRGB(0, 0, 255));
|
giveTeamArmor(event.GetPlayer(), Color.fromRGB(0, 0, 255));
|
||||||
}
|
}
|
||||||
@ -441,7 +452,7 @@ public class MineStrike extends TeamGame
|
|||||||
{
|
{
|
||||||
_grenadesThrown.put(ent, grenade);
|
_grenadesThrown.put(ent, grenade);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerIncendiary(Location loc, long endTime)
|
public void registerIncendiary(Location loc, long endTime)
|
||||||
{
|
{
|
||||||
_incendiary.put(loc, endTime);
|
_incendiary.put(loc, endTime);
|
||||||
@ -652,7 +663,7 @@ public class MineStrike extends TeamGame
|
|||||||
primaryDropped = true;
|
primaryDropped = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Drop Remaining
|
//Drop Remaining
|
||||||
boolean grenadeDropped = false;
|
boolean grenadeDropped = false;
|
||||||
for (StrikeItem item : toDrop)
|
for (StrikeItem item : toDrop)
|
||||||
@ -660,14 +671,14 @@ public class MineStrike extends TeamGame
|
|||||||
//Record Primary Dropped
|
//Record Primary Dropped
|
||||||
if (item.getType() == StrikeItemType.PRIMARY_WEAPON)
|
if (item.getType() == StrikeItemType.PRIMARY_WEAPON)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//Pistol
|
//Pistol
|
||||||
if (item.getType() == StrikeItemType.SECONDARY_WEAPON)
|
if (item.getType() == StrikeItemType.SECONDARY_WEAPON)
|
||||||
{
|
{
|
||||||
item.drop(this, player, true, primaryDropped);
|
item.drop(this, player, true, primaryDropped);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Grenade
|
//Grenade
|
||||||
if (item.getType() == StrikeItemType.GRENADE)
|
if (item.getType() == StrikeItemType.GRENADE)
|
||||||
{
|
{
|
||||||
@ -675,7 +686,7 @@ public class MineStrike extends TeamGame
|
|||||||
grenadeDropped = true;
|
grenadeDropped = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Other
|
//Other
|
||||||
item.drop(this, player, true, false);
|
item.drop(this, player, true, false);
|
||||||
}
|
}
|
||||||
@ -761,31 +772,106 @@ public class MineStrike extends TeamGame
|
|||||||
gun.reduceCone();
|
gun.reduceCone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void slowBulletHit(final ProjectileHitEvent event)
|
||||||
|
{
|
||||||
|
if (!(event.getEntity() instanceof Snowball))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Bullet bullet = _bullets.get(event.getEntity());
|
||||||
|
|
||||||
|
//Particle
|
||||||
|
if (bullet != null && bullet.Shooter != null)
|
||||||
|
UtilParticle.PlayParticle(bullet.Shooter, ParticleType.FIREWORKS_SPARK, event.getEntity().getLocation(), 0, 0, 0, 0, 1);
|
||||||
|
|
||||||
|
//Hit Block Sound
|
||||||
|
event.getEntity().getWorld().playSound(event.getEntity().getLocation(), Sound.ENDERMAN_HIT, 1f, 1f);
|
||||||
|
|
||||||
|
//Block Particle
|
||||||
|
Location loc = event.getEntity().getLocation().add(event.getEntity().getVelocity().multiply(0.8));
|
||||||
|
Block block = loc.getBlock();
|
||||||
|
|
||||||
|
if (block.getType() == Material.AIR)
|
||||||
|
{
|
||||||
|
Block closest = null;
|
||||||
|
double closestDist = 0;
|
||||||
|
|
||||||
|
for (Block other : UtilBlock.getSurrounding(block, true))
|
||||||
|
{
|
||||||
|
if (other.getType() == Material.AIR)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
double dist = UtilMath.offset(loc, other.getLocation().add(0.5, 0.5, 0.5));
|
||||||
|
|
||||||
|
if (closest == null || dist < closestDist)
|
||||||
|
{
|
||||||
|
closest = other;
|
||||||
|
closestDist = dist;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (closest != null)
|
||||||
|
block = closest;
|
||||||
|
}
|
||||||
|
|
||||||
|
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void slowBulletWhizz(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Entity ent : _bullets.keySet())
|
||||||
|
{
|
||||||
|
if (ent instanceof Snowball)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (ent.getTicksLived() < 10)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Bullet bullet = _bullets.get(ent);
|
||||||
|
|
||||||
|
for (Player player : UtilServer.getPlayers())
|
||||||
|
{
|
||||||
|
if (UtilMath.offset(ent, player) < 4)
|
||||||
|
{
|
||||||
|
if (!bullet.WhizzSound.contains(player))
|
||||||
|
{
|
||||||
|
player.playSound(ent.getLocation(), Sound.BAT_IDLE, (float)(0.5 + Math.random() * 0.5), 1f);
|
||||||
|
bullet.WhizzSound.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void projectileHitParticle(final ProjectileHitEvent event)
|
public void instantBulletHit(final ProjectileHitEvent event)
|
||||||
{
|
{
|
||||||
if (!(event.getEntity() instanceof Arrow))
|
if (!(event.getEntity() instanceof Arrow))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable()
|
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable()
|
||||||
{
|
{
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
Arrow arrow = (Arrow)event.getEntity();
|
Arrow arrow = (Arrow)event.getEntity();
|
||||||
|
|
||||||
Bullet bullet = _bullets.get(arrow);
|
Bullet bullet = _bullets.get(arrow);
|
||||||
|
|
||||||
//Particle
|
//Particle
|
||||||
if (bullet != null && bullet.Shooter != null)
|
if (bullet != null && bullet.Shooter != null)
|
||||||
UtilParticle.PlayParticle(bullet.Shooter, ParticleType.FIREWORKS_SPARK, arrow.getLocation(), 0, 0, 0, 0, 1);
|
UtilParticle.PlayParticle(bullet.Shooter, ParticleType.FIREWORKS_SPARK, arrow.getLocation(), 0, 0, 0, 0, 1);
|
||||||
|
|
||||||
//Hit Block Sound
|
//Hit Block Sound
|
||||||
arrow.getWorld().playSound(arrow.getLocation(), Sound.ENDERMAN_HIT, 1f, 1f);
|
arrow.getWorld().playSound(arrow.getLocation(), Sound.ENDERMAN_HIT, 1f, 1f);
|
||||||
|
|
||||||
//Bullet Whiz Sound
|
//Bullet Whiz Sound
|
||||||
bulletWhizzSound(arrow.getLocation(), bullet);
|
instantBulletWhizz(arrow.getLocation(), bullet);
|
||||||
|
|
||||||
//Block Particle
|
//Block Particle
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -810,61 +896,72 @@ public class MineStrike extends TeamGame
|
|||||||
{
|
{
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
_bullets.remove(arrow);
|
_bullets.remove(arrow);
|
||||||
arrow.remove();
|
arrow.remove();
|
||||||
}
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bulletWhizzSound(Location bulletEndLocation, Bullet bullet)
|
private void instantBulletWhizz(Location bulletEndLocation, Bullet bullet)
|
||||||
{
|
{
|
||||||
if (bullet == null)
|
if (bullet == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Location loc = bullet.Origin.clone();
|
Location loc = bullet.Origin.clone();
|
||||||
|
|
||||||
HashSet<Player> hasPlayedFor = new HashSet<Player>();
|
|
||||||
|
|
||||||
if (bullet.Shooter != null)
|
if (bullet.Shooter != null)
|
||||||
hasPlayedFor.add(bullet.Shooter);
|
bullet.WhizzSound.add(bullet.Shooter);
|
||||||
|
|
||||||
//Move between points, check players
|
//Move between points, check players
|
||||||
while (UtilMath.offset(loc, bulletEndLocation) > 1)
|
while (UtilMath.offset(loc, bulletEndLocation) > 1)
|
||||||
{
|
{
|
||||||
//This is used to calculate whether players are between current/end.
|
//This is used to calculate whether players are between current/end.
|
||||||
//Add 5 so you still hear the whizz if it hits just infront of you.
|
//Add 5 so you still hear the whizz if it hits just infront of you.
|
||||||
double offsetStartToEnd = UtilMath.offset(loc, bulletEndLocation) + 4;
|
double offsetStartToEnd = UtilMath.offset(loc, bulletEndLocation) + 4;
|
||||||
|
|
||||||
for (Player player : UtilServer.getPlayers())
|
for (Player player : UtilServer.getPlayers())
|
||||||
{
|
{
|
||||||
if (hasPlayedFor.contains(player))
|
if (bullet.WhizzSound.contains(player))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//Remove players who are not between current/end points
|
//Remove players who are not between current/end points
|
||||||
if (offsetStartToEnd < UtilMath.offset(player.getEyeLocation(), loc) &&
|
if (offsetStartToEnd < UtilMath.offset(player.getEyeLocation(), loc) &&
|
||||||
offsetStartToEnd < UtilMath.offset(player.getEyeLocation(), bulletEndLocation))
|
offsetStartToEnd < UtilMath.offset(player.getEyeLocation(), bulletEndLocation))
|
||||||
{
|
{
|
||||||
hasPlayedFor.add(player);
|
bullet.WhizzSound.add(player);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check
|
//Check
|
||||||
if (UtilMath.offset(player.getEyeLocation(), loc) < 4)
|
if (UtilMath.offset(player.getEyeLocation(), loc) < 4)
|
||||||
{
|
{
|
||||||
player.playSound(loc, Sound.BAT_IDLE, (float)(0.5 + Math.random() * 0.5), 1f);
|
player.playSound(loc, Sound.BAT_IDLE, (float)(0.5 + Math.random() * 0.5), 1f);
|
||||||
hasPlayedFor.add(player);
|
bullet.WhizzSound.add(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Move Closer
|
//Move Closer
|
||||||
loc.add(UtilAlg.getTrajectory(loc, bulletEndLocation));
|
loc.add(UtilAlg.getTrajectory(loc, bulletEndLocation));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@EventHandler(priority=EventPriority.MONITOR)
|
||||||
|
public void removeArrowsFromPlayer(CustomDamageEvent event)
|
||||||
|
{
|
||||||
|
if (event.GetDamageePlayer() != null)
|
||||||
|
((CraftPlayer) event.GetDamageePlayer()).getHandle().p(0);
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority=EventPriority.HIGH)
|
@EventHandler(priority=EventPriority.HIGH)
|
||||||
public void damage(CustomDamageEvent event)
|
public void damage(CustomDamageEvent event)
|
||||||
{
|
{
|
||||||
|
if (event.GetDamageePlayer() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
if (event.GetCause() == DamageCause.FALL)
|
if (event.GetCause() == DamageCause.FALL)
|
||||||
{
|
{
|
||||||
event.AddMod(GetName(), "Fall Reduction", -2, false);
|
event.AddMod(GetName(), "Fall Reduction", -2, false);
|
||||||
@ -927,16 +1024,33 @@ public class MineStrike extends TeamGame
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Gun
|
//Gun
|
||||||
Bullet bullet = _bullets.remove(event.GetProjectile());
|
Bullet bullet = _bullets.remove(event.GetProjectile());
|
||||||
if (bullet == null)
|
if (bullet == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
//Get Hit Area
|
||||||
|
int hitArea = 0;
|
||||||
|
|
||||||
|
if (_customHitbox)
|
||||||
|
{
|
||||||
|
if (event.GetProjectile() instanceof Arrow)
|
||||||
|
hitArea = getArrowHitArea(event.GetDamageePlayer(), bullet.Origin.clone(), bullet.Direction.clone());
|
||||||
|
else
|
||||||
|
hitArea = getSnowballHitArea(event.GetDamageePlayer(), event.GetProjectile());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (hitArea == -1)
|
||||||
|
{
|
||||||
|
event.SetCancelled("Miss");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//Bullet Whiz Sound
|
//Bullet Whiz Sound
|
||||||
bulletWhizzSound(event.GetDamageePlayer().getEyeLocation(), bullet);
|
if (event.GetProjectile() instanceof Arrow)
|
||||||
|
instantBulletWhizz(event.GetDamageePlayer().getEyeLocation(), bullet);
|
||||||
|
|
||||||
//Wipe previous data!
|
//Wipe previous data!
|
||||||
event.GetCancellers().clear();
|
event.GetCancellers().clear();
|
||||||
@ -945,28 +1059,107 @@ public class MineStrike extends TeamGame
|
|||||||
if (!Manager.CanHurt(event.GetDamageePlayer(), event.GetDamagerPlayer(true)))
|
if (!Manager.CanHurt(event.GetDamageePlayer(), event.GetDamagerPlayer(true)))
|
||||||
event.SetCancelled("Team Damage");
|
event.SetCancelled("Team Damage");
|
||||||
|
|
||||||
event.AddMod(GetName(), "Negate Arrow", -event.GetDamageInitial(), false);
|
event.AddMod(GetName(), "Negate Default", -event.GetDamageInitial(), false);
|
||||||
|
|
||||||
event.AddMod(GetName(), bullet.Gun.getName(), bullet.getDamage(event.GetDamageeEntity().getLocation()), true);
|
|
||||||
|
|
||||||
if (event.GetDamageePlayer() != null)
|
//Damage + Dropoff
|
||||||
|
double damage = bullet.getDamage();
|
||||||
|
double damageDropoff = bullet.getDamageDropoff(event.GetDamageeEntity().getLocation());
|
||||||
|
|
||||||
|
//Add Damages
|
||||||
|
event.AddMod(bullet.Shooter.getName(), bullet.Gun.getName(), damage, true);
|
||||||
|
event.AddMod(bullet.Shooter.getName(), "Distance Dropoff", damageDropoff, false);
|
||||||
|
|
||||||
|
//Headshot
|
||||||
|
if (hitArea == 1)
|
||||||
{
|
{
|
||||||
//Damage Reduction
|
event.AddMod(bullet.Shooter.getName(), "Headshot", damage*2, true);
|
||||||
if (Armor.isArmor(event.GetDamageePlayer().getInventory().getChestplate()))
|
|
||||||
|
if (Armor.isArmor(event.GetDamageePlayer().getInventory().getHelmet()))
|
||||||
{
|
{
|
||||||
event.AddMod(GetName(), "Kevlar", -0.25 * bullet.getDamage(event.GetDamageeEntity().getLocation()), false);
|
event.AddMod(event.GetDamageePlayer().getName(), "Helmet", -damage*1, false);
|
||||||
|
event.GetDamageePlayer().getWorld().playSound(event.GetDamageePlayer().getEyeLocation(), Sound.SPIDER_DEATH, 1f, 1f);
|
||||||
}
|
}
|
||||||
//Mini-Stun
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
event.GetDamageePlayer().setVelocity(new Vector(0,0,0));
|
|
||||||
|
event.GetDamageePlayer().getWorld().playSound(event.GetDamageePlayer().getEyeLocation(), Sound.SLIME_ATTACK, 1f, 1f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Kevlar - Body Hit
|
||||||
|
if (hitArea == 0 && Armor.isArmor(event.GetDamageePlayer().getInventory().getChestplate()))
|
||||||
|
{
|
||||||
|
double damageArmor = -(1 - bullet.Gun.getArmorPenetration()) * (damage + damageDropoff);
|
||||||
|
|
||||||
|
event.AddMod(event.GetDamageePlayer().getName(), "Kevlar", damageArmor, false);
|
||||||
|
}
|
||||||
|
//Mini-Stun
|
||||||
|
else
|
||||||
|
{
|
||||||
|
event.GetDamageePlayer().setVelocity(new Vector(0,0,0));
|
||||||
|
}
|
||||||
|
|
||||||
event.SetKnockback(false);
|
event.SetKnockback(false);
|
||||||
event.SetIgnoreRate(true);
|
event.SetIgnoreRate(true);
|
||||||
event.SetIgnoreArmor(true);
|
event.SetIgnoreArmor(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getArrowHitArea(Player damagee, Location origin, Vector trajectory)
|
||||||
|
{
|
||||||
|
//Move to near-player
|
||||||
|
Location start = origin.clone().add(trajectory.multiply(UtilMath.offset(origin, damagee.getEyeLocation()) - 2));
|
||||||
|
|
||||||
|
Location loc = start.clone();
|
||||||
|
|
||||||
|
while (!hitHead(damagee, loc) && !hitBody(damagee, loc) && UtilMath.offset(damagee.getLocation(), loc) < 6)
|
||||||
|
{
|
||||||
|
loc.add(trajectory.clone().multiply(0.1));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hitHead(damagee, loc))
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
if (hitBody(damagee, loc))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSnowballHitArea(Player damagee, Projectile snowball)
|
||||||
|
{
|
||||||
|
//Move to near-player
|
||||||
|
Location start = snowball.getLocation();
|
||||||
|
|
||||||
|
Location loc = start.clone();
|
||||||
|
|
||||||
|
while (!hitHead(damagee, loc) && !hitBody(damagee, loc) && UtilMath.offset(damagee.getLocation(), loc) < 6)
|
||||||
|
{
|
||||||
|
loc.add(snowball.getVelocity().clone().multiply(0.1));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hitHead(damagee, loc))
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
if (hitBody(damagee, loc))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hitBody(Player player, Location loc)
|
||||||
|
{
|
||||||
|
return UtilMath.offset2d(loc, player.getLocation()) < 0.6 && //0.6 is ideal
|
||||||
|
loc.getY() > player.getLocation().getY() &&
|
||||||
|
loc.getY() < player.getEyeLocation().getY() - 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hitHead(Player player, Location loc)
|
||||||
|
{
|
||||||
|
return UtilMath.offset2d(loc, player.getLocation()) < 0.3 && //0.3 is ideal
|
||||||
|
loc.getY() >= player.getEyeLocation().getY() - 0.2 &&
|
||||||
|
loc.getY() < player.getEyeLocation().getY() + 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void killReward(CombatDeathEvent event)
|
public void killReward(CombatDeathEvent event)
|
||||||
@ -1223,6 +1416,8 @@ public class MineStrike extends TeamGame
|
|||||||
_bombDefuser.setExp(0f);
|
_bombDefuser.setExp(0f);
|
||||||
|
|
||||||
UtilPlayer.message(player, F.main("Game", "You are defusing the Bomb."));
|
UtilPlayer.message(player, F.main("Game", "You are defusing the Bomb."));
|
||||||
|
|
||||||
|
_bombDefuser.getWorld().playSound(_bombDefuser.getLocation(), Sound.PISTON_RETRACT, 2f, 1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -1251,9 +1446,6 @@ public class MineStrike extends TeamGame
|
|||||||
|
|
||||||
_bombDefuser.setExp(Math.min(_bombDefuser.getExp() + defuseRate, 0.99999f));
|
_bombDefuser.setExp(Math.min(_bombDefuser.getExp() + defuseRate, 0.99999f));
|
||||||
|
|
||||||
if (Math.random() > 0.95)
|
|
||||||
_bombDefuser.getWorld().playSound(_bombDefuser.getLocation(), Sound.PISTON_RETRACT, 1f, (float)(Math.random() + 1f));
|
|
||||||
|
|
||||||
if (_bombDefuser.getExp() >= 0.98f)
|
if (_bombDefuser.getExp() >= 0.98f)
|
||||||
{
|
{
|
||||||
_bomb.defuse();
|
_bomb.defuse();
|
||||||
@ -1528,6 +1720,28 @@ public class MineStrike extends TeamGame
|
|||||||
for (GameTeam team : GetTeamList())
|
for (GameTeam team : GetTeamList())
|
||||||
for (Player teamMember : team.GetPlayers(true))
|
for (Player teamMember : team.GetPlayers(true))
|
||||||
GetScoreboard().SetPlayerTeam(teamMember, team.GetName().toUpperCase());
|
GetScoreboard().SetPlayerTeam(teamMember, team.GetName().toUpperCase());
|
||||||
|
|
||||||
|
//Alternate Bullets
|
||||||
|
if (_bulletAlternate)
|
||||||
|
_bulletInstant = (_bulletInstant + 1)%3;
|
||||||
|
|
||||||
|
//Debug Details
|
||||||
|
if (_debug)
|
||||||
|
{
|
||||||
|
Announce(C.cDPurple + C.Bold + "ROUND SETTINGS:");
|
||||||
|
|
||||||
|
if (_customHitbox)
|
||||||
|
Announce(C.cPurple + C.Bold + "Hitbox: " + ChatColor.RESET + "Accurate with Headshots");
|
||||||
|
else
|
||||||
|
Announce(C.cPurple + C.Bold + "Hitbox: " + ChatColor.RESET + "Default with No Headshot");
|
||||||
|
|
||||||
|
if (_bulletInstant == 0)
|
||||||
|
Announce(C.cPurple + C.Bold + "Bullets: " + ChatColor.RESET + "Slow and Visible");
|
||||||
|
else if (_bulletInstant == 1)
|
||||||
|
Announce(C.cPurple + C.Bold + "Bullets: " + ChatColor.RESET + "Instant and Invisible");
|
||||||
|
else
|
||||||
|
Announce(C.cPurple + C.Bold + "Bullets: " + ChatColor.RESET + "Slow and Visible with Instant Sniper");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void giveMoney()
|
public void giveMoney()
|
||||||
@ -1612,7 +1826,7 @@ public class MineStrike extends TeamGame
|
|||||||
for (Entity ent : _bullets.keySet())
|
for (Entity ent : _bullets.keySet())
|
||||||
ent.remove();
|
ent.remove();
|
||||||
_bullets.clear();
|
_bullets.clear();
|
||||||
|
|
||||||
//Incendiary
|
//Incendiary
|
||||||
_incendiary.clear();
|
_incendiary.clear();
|
||||||
|
|
||||||
@ -1620,6 +1834,10 @@ public class MineStrike extends TeamGame
|
|||||||
for (Gun gun : _gunsEquipped.keySet())
|
for (Gun gun : _gunsEquipped.keySet())
|
||||||
gun.restockAmmo(_gunsEquipped.get(gun));
|
gun.restockAmmo(_gunsEquipped.get(gun));
|
||||||
|
|
||||||
|
//Health
|
||||||
|
for (Player player : UtilServer.getPlayers())
|
||||||
|
player.setHealth(20);
|
||||||
|
|
||||||
//Reset Shop
|
//Reset Shop
|
||||||
for (Player player : UtilServer.getPlayers())
|
for (Player player : UtilServer.getPlayers())
|
||||||
_shopManager.leaveShop(player, false, false);
|
_shopManager.leaveShop(player, false, false);
|
||||||
@ -1628,7 +1846,7 @@ public class MineStrike extends TeamGame
|
|||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void specToTeam(PlayerJoinEvent event)
|
public void specToTeam(PlayerJoinEvent event)
|
||||||
{
|
{
|
||||||
if (GetState() == GameState.Recruit)
|
if (GetState() == GameState.Recruit || GetState() == GameState.Loading)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//Target Team
|
//Target Team
|
||||||
@ -1691,7 +1909,7 @@ public class MineStrike extends TeamGame
|
|||||||
event.setTo(event.getFrom());
|
event.setTo(event.getFrom());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
//@EventHandler
|
||||||
public void boostClimb(PlayerToggleSneakEvent event)
|
public void boostClimb(PlayerToggleSneakEvent event)
|
||||||
{
|
{
|
||||||
if (!IsLive())
|
if (!IsLive())
|
||||||
@ -1742,7 +1960,7 @@ public class MineStrike extends TeamGame
|
|||||||
if (gun == null)
|
if (gun == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!(gun instanceof AWP))
|
if (!gun.hasScope())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//Enable
|
//Enable
|
||||||
@ -1752,9 +1970,11 @@ public class MineStrike extends TeamGame
|
|||||||
Manager.GetCondition().Factory().Slow("Scope", event.getPlayer(), null, 9999, 2, false, false, false, false);
|
Manager.GetCondition().Factory().Slow("Scope", event.getPlayer(), null, 9999, 2, false, false, false, false);
|
||||||
event.getPlayer().getInventory().setHelmet(new ItemStack(Material.PUMPKIN));
|
event.getPlayer().getInventory().setHelmet(new ItemStack(Material.PUMPKIN));
|
||||||
|
|
||||||
event.getPlayer().getWorld().playSound(event.getPlayer().getEyeLocation(), Sound.GHAST_DEATH, 0.8f, 1f);
|
if (gun.getGunType() == GunType.SNIPER)
|
||||||
|
{
|
||||||
Manager.GetCondition().Factory().Blind("Scope Blind", event.getPlayer(), null, 1, 1, false, false, false);
|
event.getPlayer().getWorld().playSound(event.getPlayer().getEyeLocation(), Sound.GHAST_DEATH, 0.8f, 1f);
|
||||||
|
Manager.GetCondition().Factory().Blind("Scope Blind", event.getPlayer(), null, 1, 1, false, false, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1777,13 +1997,13 @@ public class MineStrike extends TeamGame
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
Gun gun = getGunInHand(player, null);
|
Gun gun = getGunInHand(player, null);
|
||||||
if (gun == null || !(gun instanceof AWP) || !player.isSneaking())
|
if (!gun.hasScope() || !player.isSneaking())
|
||||||
{
|
{
|
||||||
removeScope(player);
|
removeScope(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeScope(Player player)
|
public void removeScope(Player player)
|
||||||
{
|
{
|
||||||
ItemStack stack = _scoped.remove(player);
|
ItemStack stack = _scoped.remove(player);
|
||||||
@ -1792,8 +2012,8 @@ public class MineStrike extends TeamGame
|
|||||||
|
|
||||||
player.getWorld().playSound(player.getEyeLocation(), Sound.GHAST_DEATH, 0.8f, 1f);
|
player.getWorld().playSound(player.getEyeLocation(), Sound.GHAST_DEATH, 0.8f, 1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
//@EventHandler
|
||||||
public void speedUpdate(UpdateEvent event)
|
public void speedUpdate(UpdateEvent event)
|
||||||
{
|
{
|
||||||
if (!IsLive())
|
if (!IsLive())
|
||||||
@ -1810,32 +2030,49 @@ public class MineStrike extends TeamGame
|
|||||||
Manager.GetCondition().EndCondition(player, ConditionType.SPEED, null);
|
Manager.GetCondition().EndCondition(player, ConditionType.SPEED, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void incendiaryUpdate(UpdateEvent event)
|
public void incendiaryUpdate(UpdateEvent event)
|
||||||
{
|
{
|
||||||
if (event.getType() == UpdateType.TICK)
|
if (event.getType() == UpdateType.TICK)
|
||||||
for (Player player : UtilServer.getPlayers())
|
for (Player player : UtilServer.getPlayers())
|
||||||
player.setFireTicks(0);
|
player.setFireTicks(0);
|
||||||
|
|
||||||
if (event.getType() != UpdateType.SLOW)
|
if (event.getType() != UpdateType.SLOW)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Iterator<Location> fireIterator = _incendiary.keySet().iterator();
|
Iterator<Location> fireIterator = _incendiary.keySet().iterator();
|
||||||
|
|
||||||
while (fireIterator.hasNext())
|
while (fireIterator.hasNext())
|
||||||
{
|
{
|
||||||
Location loc = fireIterator.next();
|
Location loc = fireIterator.next();
|
||||||
|
|
||||||
if (_incendiary.get(loc) < System.currentTimeMillis())
|
if (_incendiary.get(loc) < System.currentTimeMillis())
|
||||||
fireIterator.remove();
|
fireIterator.remove();
|
||||||
|
|
||||||
else
|
else
|
||||||
loc.getWorld().playSound(loc, Sound.PIG_DEATH, 1f, 1f);
|
loc.getWorld().playSound(loc, Sound.PIG_DEATH, 1f, 1f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void bombBurnUpdate(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (_bombItem == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!_bombItem.isValid())
|
||||||
|
{
|
||||||
|
Location loc = _bombItem.getLocation();
|
||||||
|
|
||||||
|
_bombItem.remove();
|
||||||
|
|
||||||
|
_bombItem = loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.GOLD_SWORD));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -2028,6 +2265,9 @@ public class MineStrike extends TeamGame
|
|||||||
{
|
{
|
||||||
if (!IsLive())
|
if (!IsLive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
Location target = null;
|
Location target = null;
|
||||||
if (_bombItem != null)
|
if (_bombItem != null)
|
||||||
@ -2113,34 +2353,71 @@ public class MineStrike extends TeamGame
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInstantBullets()
|
public int getBulletType()
|
||||||
{
|
{
|
||||||
return _bulletInstant;
|
return _bulletInstant;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void debugBullets(PlayerCommandPreprocessEvent event)
|
|
||||||
{
|
|
||||||
if (!event.getPlayer().isOp())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (event.getMessage().contains("debugbullets"))
|
|
||||||
{
|
|
||||||
_bulletInstant = !_bulletInstant;
|
|
||||||
|
|
||||||
Announce(C.cPurple + C.Bold + "Instant Bullets: " + ChatColor.RESET + _bulletInstant);
|
|
||||||
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Cleans entities that may not have been removed due to unloaded chunks
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void debug(PlayerCommandPreprocessEvent event)
|
public void debug(PlayerCommandPreprocessEvent event)
|
||||||
{
|
{
|
||||||
if (!event.getPlayer().isOp())
|
if (!event.getPlayer().isOp())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (event.getMessage().contains("money"))
|
||||||
|
{
|
||||||
|
_shopManager.addMoney(event.getPlayer(), 16000, "Debug");
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getMessage().contains("instant"))
|
||||||
|
{
|
||||||
|
_bulletInstant = (_bulletInstant + 1)%3;
|
||||||
|
|
||||||
|
if (_bulletInstant == 0)
|
||||||
|
Announce(C.cPurple + C.Bold + "Bullets: " + ChatColor.RESET + "Slow and Visible");
|
||||||
|
else if (_bulletInstant == 1)
|
||||||
|
Announce(C.cPurple + C.Bold + "Bullets: " + ChatColor.RESET + "Instant and Invisible");
|
||||||
|
else
|
||||||
|
Announce(C.cPurple + C.Bold + "Bullets: " + ChatColor.RESET + "Slow and Visible with Instant Sniper");
|
||||||
|
|
||||||
|
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getMessage().contains("hitbox"))
|
||||||
|
{
|
||||||
|
_customHitbox = !_customHitbox;
|
||||||
|
|
||||||
|
if (_customHitbox)
|
||||||
|
Announce(C.cPurple + C.Bold + "Hitbox: " + ChatColor.RESET + "Accurate with Headshots");
|
||||||
|
else
|
||||||
|
Announce(C.cPurple + C.Bold + "Hitbox: " + ChatColor.RESET + "Default with No Headshot");
|
||||||
|
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getMessage().contains("alternate"))
|
||||||
|
{
|
||||||
|
_bulletAlternate = !_bulletAlternate;
|
||||||
|
|
||||||
|
Announce(C.cPurple + C.Bold + "Alternate Bullet Type: " + ChatColor.RESET + _bulletAlternate);
|
||||||
|
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getMessage().contains("god"))
|
||||||
|
{
|
||||||
|
if (HealthSet == 20)
|
||||||
|
HealthSet = -1;
|
||||||
|
else
|
||||||
|
HealthSet = 20;
|
||||||
|
|
||||||
|
Announce(C.cPurple + C.Bold + "God Mode: " + ChatColor.RESET + (HealthSet == 20));
|
||||||
|
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
if (event.getMessage().contains("debugplayer"))
|
if (event.getMessage().contains("debugplayer"))
|
||||||
{
|
{
|
||||||
Announce(C.Bold + "PLAYER DEBUG:");
|
Announce(C.Bold + "PLAYER DEBUG:");
|
||||||
@ -2176,6 +2453,4 @@ public class MineStrike extends TeamGame
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -61,19 +61,25 @@ public class ShopManager
|
|||||||
//Pistols
|
//Pistols
|
||||||
slot = 9;
|
slot = 9;
|
||||||
addItem(team.GetColor() == ChatColor.RED ? new Glock18() : new P2000(), player, slot++);
|
addItem(team.GetColor() == ChatColor.RED ? new Glock18() : new P2000(), player, slot++);
|
||||||
|
addItem(new P250(), player, slot++);
|
||||||
addItem(new CZ75(), player, slot++);
|
addItem(new CZ75(), player, slot++);
|
||||||
addItem(new Deagle(), player, slot++);
|
addItem(new Deagle(), player, slot++);
|
||||||
|
|
||||||
//Shotgun
|
//Shotgun
|
||||||
slot = 18;
|
slot = 18;
|
||||||
addItem(new Nova(), player, slot++);
|
addItem(new Nova(), player, slot++);
|
||||||
|
addItem(new XM1014(), player, slot++);
|
||||||
|
|
||||||
//SMG
|
//SMG
|
||||||
|
addItem(new PPBizon(), player, slot++);
|
||||||
addItem(new P90(), player, slot++);
|
addItem(new P90(), player, slot++);
|
||||||
|
|
||||||
//Rifles
|
//Rifles
|
||||||
slot = 27;
|
slot = 27;
|
||||||
addItem(team.GetColor() == ChatColor.RED ? new AK47() : new M4A1(), player, slot++);
|
addItem(team.GetColor() == ChatColor.RED ? new Galil() : new Famas(), player, slot++);
|
||||||
|
addItem(team.GetColor() == ChatColor.RED ? new AK47() : new M4A4(), player, slot++);
|
||||||
|
addItem(team.GetColor() == ChatColor.RED ? new SG553() : new AUG(), player, slot++);
|
||||||
|
addItem(new SSG08(), player, slot++);
|
||||||
addItem(new AWP(), player, slot++);
|
addItem(new AWP(), player, slot++);
|
||||||
|
|
||||||
//Grenades
|
//Grenades
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
package nautilus.game.arcade.game.games.minestrike.data;
|
package nautilus.game.arcade.game.games.minestrike.data;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
import nautilus.game.arcade.game.games.minestrike.MineStrike;
|
import nautilus.game.arcade.game.games.minestrike.MineStrike;
|
||||||
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
|
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import mineplex.core.common.util.UtilMath;
|
import mineplex.core.common.util.UtilMath;
|
||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
@ -16,15 +19,18 @@ public class Bullet
|
|||||||
public Entity Bullet;
|
public Entity Bullet;
|
||||||
public Gun Gun;
|
public Gun Gun;
|
||||||
public Location Origin;
|
public Location Origin;
|
||||||
|
public Vector Direction;
|
||||||
|
|
||||||
public long LastSound = System.currentTimeMillis() - 100;
|
public long LastSound = System.currentTimeMillis() - 100;
|
||||||
|
|
||||||
|
public HashSet<Player> WhizzSound = new HashSet<Player>();
|
||||||
|
|
||||||
public Bullet(Entity bullet, Gun gun, Player shooter, MineStrike game)
|
public Bullet(Entity bullet, Gun gun, Player shooter, MineStrike game)
|
||||||
{
|
{
|
||||||
Bullet = bullet;
|
Bullet = bullet;
|
||||||
Gun = gun;
|
Gun = gun;
|
||||||
Origin = shooter.getEyeLocation();
|
Origin = shooter.getEyeLocation();
|
||||||
|
Direction = shooter.getLocation().getDirection();
|
||||||
Shooter = shooter;
|
Shooter = shooter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,9 +39,14 @@ public class Bullet
|
|||||||
return Bullet.isValid();
|
return Bullet.isValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getDamage(Location destination)
|
public double getDamage()
|
||||||
{
|
{
|
||||||
return Gun.getDamage() * (1 - (Gun.getDropOff() * UtilMath.offset(Origin, destination)));
|
return Gun.getDamage();
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getDamageDropoff(Location destination)
|
||||||
|
{
|
||||||
|
return -Gun.getDamage() * (Gun.getDropOff() * UtilMath.offset(Origin, destination));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean bulletSound()
|
public boolean bulletSound()
|
||||||
|
@ -9,7 +9,7 @@ public class Helmet extends Armor
|
|||||||
{
|
{
|
||||||
super("Helmet", new String[]
|
super("Helmet", new String[]
|
||||||
{
|
{
|
||||||
"Reduces damage from headshots"
|
"Reduces damage from head shots"
|
||||||
},
|
},
|
||||||
350, 0, Material.LEATHER_HELMET);
|
350, 0, Material.LEATHER_HELMET);
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ public class Kevlar extends Armor
|
|||||||
{
|
{
|
||||||
super("Kevlar", new String[]
|
super("Kevlar", new String[]
|
||||||
{
|
{
|
||||||
"Reduces bullet damage by 25%"
|
"Reduces damage from body shots"
|
||||||
},
|
},
|
||||||
650, 0, Material.LEATHER_CHESTPLATE);
|
650, 0, Material.LEATHER_CHESTPLATE);
|
||||||
}
|
}
|
||||||
|
@ -140,8 +140,8 @@ public abstract class Grenade extends StrikeItem
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//X Rebound
|
//X Rebound
|
||||||
if ((_vel.getX() > 0 && ent.getLocation().getX() - _lastLoc.getX() <= 0) ||
|
if ((_vel.getX() > 0.05 && ent.getLocation().getX() - _lastLoc.getX() <= 0) ||
|
||||||
(_vel.getX() < 0 && ent.getLocation().getX() - _lastLoc.getX() >= 0))
|
(_vel.getX() < 0.05 && ent.getLocation().getX() - _lastLoc.getX() >= 0))
|
||||||
{
|
{
|
||||||
_vel = _velHistory.get(0);
|
_vel = _velHistory.get(0);
|
||||||
_vel.setX(-_vel.getX());
|
_vel.setX(-_vel.getX());
|
||||||
@ -153,8 +153,8 @@ public abstract class Grenade extends StrikeItem
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Z Rebound
|
//Z Rebound
|
||||||
else if ((_vel.getZ() > 0 && ent.getLocation().getZ() - _lastLoc.getZ() <= 0) ||
|
else if ((_vel.getZ() > 0.05 && ent.getLocation().getZ() - _lastLoc.getZ() <= 0) ||
|
||||||
(_vel.getZ() < 0 && ent.getLocation().getZ() - _lastLoc.getZ() >= 0))
|
(_vel.getZ() < 0.05 && ent.getLocation().getZ() - _lastLoc.getZ() >= 0))
|
||||||
{
|
{
|
||||||
_vel = _velHistory.get(0);
|
_vel = _velHistory.get(0);
|
||||||
_vel.setZ(-_vel.getZ());
|
_vel.setZ(-_vel.getZ());
|
||||||
|
@ -17,7 +17,7 @@ public class HighExplosive extends Grenade
|
|||||||
{
|
{
|
||||||
public HighExplosive()
|
public HighExplosive()
|
||||||
{
|
{
|
||||||
super("HE Grenade", new String[]
|
super("High Explosive", new String[]
|
||||||
{
|
{
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -34,8 +34,7 @@ public class HighExplosive extends Grenade
|
|||||||
ent.getWorld().playSound(ent.getLocation(),
|
ent.getWorld().playSound(ent.getLocation(),
|
||||||
Sound.EXPLODE, 3f, 0.8f);
|
Sound.EXPLODE, 3f, 0.8f);
|
||||||
|
|
||||||
HashMap<Player, Double> players = UtilPlayer.getInRadius(
|
HashMap<Player, Double> players = UtilPlayer.getInRadius(ent.getLocation(), 10);
|
||||||
ent.getLocation(), 8);
|
|
||||||
for (Player player : players.keySet())
|
for (Player player : players.keySet())
|
||||||
{
|
{
|
||||||
if (!game.IsAlive(player))
|
if (!game.IsAlive(player))
|
||||||
|
@ -6,6 +6,6 @@ public class Incendiary extends FireGrenadeBase
|
|||||||
{
|
{
|
||||||
public Incendiary()
|
public Incendiary()
|
||||||
{
|
{
|
||||||
super("Incendiary", 600, 0, Material.PORK, 10000);
|
super("Incendiary", 600, 0, Material.PORK, 6000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,6 @@ public class Molotov extends FireGrenadeBase
|
|||||||
{
|
{
|
||||||
public Molotov()
|
public Molotov()
|
||||||
{
|
{
|
||||||
super("Molotov", 400, 0, Material.GRILLED_PORK, 8000);
|
super("Molotov", 400, 0, Material.GRILLED_PORK, 6000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ public class Smoke extends Grenade
|
|||||||
{
|
{
|
||||||
public Smoke()
|
public Smoke()
|
||||||
{
|
{
|
||||||
super("Smoke Grenade", new String[]
|
super("Smoke", new String[]
|
||||||
{
|
{
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -4,6 +4,7 @@ import mineplex.core.common.util.C;
|
|||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilAlg;
|
import mineplex.core.common.util.UtilAlg;
|
||||||
import mineplex.core.common.util.UtilEnt;
|
import mineplex.core.common.util.UtilEnt;
|
||||||
|
import mineplex.core.common.util.UtilGear;
|
||||||
import mineplex.core.common.util.UtilMath;
|
import mineplex.core.common.util.UtilMath;
|
||||||
import mineplex.core.common.util.UtilParticle;
|
import mineplex.core.common.util.UtilParticle;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
@ -24,6 +25,7 @@ import org.bukkit.Sound;
|
|||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Snowball;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
@ -40,13 +42,15 @@ public abstract class Gun extends StrikeItem
|
|||||||
protected long _reloadTime;
|
protected long _reloadTime;
|
||||||
protected double _damage;
|
protected double _damage;
|
||||||
protected double _dropOffPerBlock;
|
protected double _dropOffPerBlock;
|
||||||
protected double _bulletSpeed;
|
protected double _armorPen;
|
||||||
protected Sound _fireSound;
|
protected Sound _fireSound;
|
||||||
|
|
||||||
protected double _coneMin;
|
protected double _coneMin;
|
||||||
protected double _coneMax;
|
protected double _coneMax;
|
||||||
protected double _coneReduceRate;
|
protected double _coneReduceRate;
|
||||||
protected double _coneIncreaseRate;
|
protected double _coneIncreaseRate;
|
||||||
|
|
||||||
|
protected boolean _scope = false;
|
||||||
|
|
||||||
|
|
||||||
//Active Data
|
//Active Data
|
||||||
@ -60,7 +64,7 @@ public abstract class Gun extends StrikeItem
|
|||||||
int cost, int gemCost,
|
int cost, int gemCost,
|
||||||
int clipSize, int clipReserve,
|
int clipSize, int clipReserve,
|
||||||
long fireRate, long reloadTime,
|
long fireRate, long reloadTime,
|
||||||
double damage, double dropOffPerBlock, double bulletSpeed,
|
double damage, double dropOffPerBlock, double armorPen,
|
||||||
double coneMin, double coneMax,
|
double coneMin, double coneMax,
|
||||||
double coneIncrease, double coneReduce,
|
double coneIncrease, double coneReduce,
|
||||||
Material skin, Sound sound)
|
Material skin, Sound sound)
|
||||||
@ -80,7 +84,7 @@ public abstract class Gun extends StrikeItem
|
|||||||
_reloadTime = reloadTime;
|
_reloadTime = reloadTime;
|
||||||
_damage = damage;
|
_damage = damage;
|
||||||
_dropOffPerBlock = dropOffPerBlock;
|
_dropOffPerBlock = dropOffPerBlock;
|
||||||
_bulletSpeed = bulletSpeed;
|
_armorPen = armorPen;
|
||||||
|
|
||||||
_fireSound = sound;
|
_fireSound = sound;
|
||||||
|
|
||||||
@ -158,8 +162,15 @@ public abstract class Gun extends StrikeItem
|
|||||||
|
|
||||||
public Bullet fireBullet(Player player, MineStrike game)
|
public Bullet fireBullet(Player player, MineStrike game)
|
||||||
{
|
{
|
||||||
|
//Instant?
|
||||||
|
boolean instant = game.getBulletType() == 1 || (game.getBulletType() == 2 && _gunType == GunType.SNIPER);
|
||||||
|
|
||||||
//Shoot
|
//Shoot
|
||||||
Entity bullet = player.launchProjectile(Arrow.class);
|
Entity bullet;
|
||||||
|
if (instant)
|
||||||
|
bullet = player.launchProjectile(Arrow.class);
|
||||||
|
else
|
||||||
|
bullet = player.launchProjectile(Snowball.class);
|
||||||
|
|
||||||
//COF
|
//COF
|
||||||
double cone = getCone(player);
|
double cone = getCone(player);
|
||||||
@ -172,13 +183,19 @@ public abstract class Gun extends StrikeItem
|
|||||||
cof.add(player.getLocation().getDirection());
|
cof.add(player.getLocation().getDirection());
|
||||||
cof.normalize();
|
cof.normalize();
|
||||||
|
|
||||||
bullet.setVelocity(cof.multiply(game.isInstantBullets() ? 200 : _bulletSpeed));
|
//Velocity
|
||||||
|
bullet.setVelocity(cof.multiply(instant ? 200 : 4));
|
||||||
|
|
||||||
//Increase COF
|
//Increase COF
|
||||||
_cone = Math.min(_coneMax, _cone + _coneIncreaseRate);
|
_cone = Math.min(_coneMax, _cone + _coneIncreaseRate);
|
||||||
|
|
||||||
return new Bullet(bullet, this, player, game);
|
return new Bullet(bullet, this, player, game);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getArmorPenetration()
|
||||||
|
{
|
||||||
|
return _armorPen;
|
||||||
|
}
|
||||||
|
|
||||||
public double getCone(Player player)
|
public double getCone(Player player)
|
||||||
{
|
{
|
||||||
@ -202,11 +219,20 @@ public abstract class Gun extends StrikeItem
|
|||||||
|
|
||||||
|
|
||||||
//Sniper Zoomed
|
//Sniper Zoomed
|
||||||
if (_gunType == GunType.SNIPER)
|
if (_scope && UtilGear.isMat(player.getInventory().getHelmet(), Material.PUMPKIN))
|
||||||
{
|
{
|
||||||
if (player.isSneaking())
|
//Snipers Perfectly Accurate if not jumping
|
||||||
|
if (_gunType == GunType.SNIPER)
|
||||||
{
|
{
|
||||||
cone -= _cone;
|
cone = 0;
|
||||||
|
|
||||||
|
if (!UtilEnt.isGrounded(player))
|
||||||
|
cone += _gunType.getJumpPenalty();
|
||||||
|
}
|
||||||
|
//30% Recoil Decrease
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cone = cone * 0.7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,6 +250,11 @@ public abstract class Gun extends StrikeItem
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getReloadTime()
|
||||||
|
{
|
||||||
|
return _reloadTime;
|
||||||
|
}
|
||||||
|
|
||||||
public void reload(Player player)
|
public void reload(Player player)
|
||||||
{
|
{
|
||||||
@ -242,8 +273,8 @@ public abstract class Gun extends StrikeItem
|
|||||||
_reserveAmmo = Math.max(0, ammo - _clipSize);
|
_reserveAmmo = Math.max(0, ammo - _clipSize);
|
||||||
|
|
||||||
//Recharge
|
//Recharge
|
||||||
Recharge.Instance.useForce(player, getName() + " Shoot", _reloadTime);
|
Recharge.Instance.useForce(player, getName() + " Shoot", getReloadTime());
|
||||||
Recharge.Instance.use(player, getName() + " Reload", _reloadTime, false, true);
|
Recharge.Instance.use(player, getName() + " Reload", getReloadTime(), false, true);
|
||||||
|
|
||||||
//Sound
|
//Sound
|
||||||
soundReload(player.getLocation());
|
soundReload(player.getLocation());
|
||||||
@ -268,11 +299,6 @@ public abstract class Gun extends StrikeItem
|
|||||||
player.getInventory().setItem(_slot, getStack());
|
player.getInventory().setItem(_slot, getStack());
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getDamage()
|
|
||||||
{
|
|
||||||
return _damage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getDropOff()
|
public double getDropOff()
|
||||||
{
|
{
|
||||||
return _dropOffPerBlock;
|
return _dropOffPerBlock;
|
||||||
@ -363,8 +389,11 @@ public abstract class Gun extends StrikeItem
|
|||||||
_reserveAmmo = _clipReserve * _clipSize;
|
_reserveAmmo = _clipReserve * _clipSize;
|
||||||
|
|
||||||
updateWeaponName(player);
|
updateWeaponName(player);
|
||||||
|
}
|
||||||
player.setHealth(20);
|
|
||||||
|
public double getDamage()
|
||||||
|
{
|
||||||
|
return _damage/5d;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -372,4 +401,28 @@ public abstract class Gun extends StrikeItem
|
|||||||
{
|
{
|
||||||
return C.cDGreen + C.Bold + _gunType.getName() + ChatColor.RESET;
|
return C.cDGreen + C.Bold + _gunType.getName() + ChatColor.RESET;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getShopItemCustom()
|
||||||
|
{
|
||||||
|
return new String[]
|
||||||
|
{
|
||||||
|
C.cYellow + C.Bold + "Clip / Spare Ammo: " + ChatColor.RESET + _clipSize + "/" + _clipReserve*_clipSize,
|
||||||
|
C.cYellow + C.Bold + "Damage per Bullet: " + ChatColor.RESET + UtilMath.trim(1, getDamage()),
|
||||||
|
C.cYellow + C.Bold + "Armor Penetration: " + ChatColor.RESET + (int)(_armorPen*100) + "%",
|
||||||
|
C.cYellow + C.Bold + "Damage Dropoff: " + ChatColor.RESET + (int)(_dropOffPerBlock*1000d) + "% per 10 Blocks",
|
||||||
|
C.cYellow + C.Bold + "Recoil per Shot: " + ChatColor.RESET + _coneIncreaseRate,
|
||||||
|
C.cYellow + C.Bold + "Recoil Recovery: " + ChatColor.RESET + _coneReduceRate + " per Second",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasScope()
|
||||||
|
{
|
||||||
|
return _scope;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GunType getGunType()
|
||||||
|
{
|
||||||
|
return _gunType;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,8 +56,11 @@ public abstract class Shotgun extends Gun
|
|||||||
@Override
|
@Override
|
||||||
public void soundRefire(Location loc)
|
public void soundRefire(Location loc)
|
||||||
{
|
{
|
||||||
loc.getWorld().playSound(loc, Sound.PISTON_RETRACT, 0.8f, 1.2f);
|
if (_fireRate >= 500)
|
||||||
loc.getWorld().playSound(loc, Sound.PISTON_RETRACT, 0.8f, 1.2f);
|
{
|
||||||
|
loc.getWorld().playSound(loc, Sound.PISTON_RETRACT, 0.8f, 1.2f);
|
||||||
|
loc.getWorld().playSound(loc, Sound.PISTON_RETRACT, 0.8f, 1.2f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -71,4 +74,10 @@ public abstract class Shotgun extends Gun
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getReloadTime()
|
||||||
|
{
|
||||||
|
return _reloadTime * Math.min(_reserveAmmo, _clipSize - _loadedAmmo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,12 +16,12 @@ public class CZ75 extends Gun
|
|||||||
{
|
{
|
||||||
|
|
||||||
},
|
},
|
||||||
300, 0, //Cost, Gem Cost
|
500, 0, //Cost, Gem Cost
|
||||||
12, 1, //Clip Size, Spare Ammo
|
12, 1, //Clip Size, Spare Ammo
|
||||||
80, 2700, //ROF, Reload Time
|
80, 2700, //ROF, Reload Time
|
||||||
6, 0.01, 3.5, //Damage, Dropoff, Bullet Speed
|
35, 0.006, 0.77, //Damage, Dropoff, Armor Penetration
|
||||||
0, 0.15, //COF Min, COF Max
|
0, 0.25, //COF Min, COF Max
|
||||||
0.06, 0.4, //COF Inc per Bullet, COF Dec per Second
|
0.06, 0.3, //COF Inc per Bullet, COF Dec per Second
|
||||||
Material.IRON_HOE, Sound.ENDERMAN_DEATH);
|
Material.IRON_HOE, Sound.ENDERMAN_DEATH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,10 +18,10 @@ public class Deagle extends Gun
|
|||||||
},
|
},
|
||||||
800, 0, //Cost, Gem Cost
|
800, 0, //Cost, Gem Cost
|
||||||
7, 5, //Clip Size, Spare Ammo
|
7, 5, //Clip Size, Spare Ammo
|
||||||
300, 2000, //ROF, Reload Time
|
300, 2200, //ROF, Reload Time
|
||||||
9, 0.01, 3.5, //Damage, Dropoff, Bullet Speed
|
68, 0.007, 0.85, //Damage, Dropoff, Armor Penetration
|
||||||
0, 0.2, //COF Min, COF Max
|
0, 0.25, //COF Min, COF Max
|
||||||
0.12, 0.2, //COF Inc per Bullet, COF Dec per Second
|
0.18, 0.2, //COF Inc per Bullet, COF Dec per Second
|
||||||
Material.GOLD_HOE, Sound.BAT_DEATH);
|
Material.GOLD_HOE, Sound.BAT_DEATH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,10 +18,10 @@ public class Glock18 extends Gun
|
|||||||
},
|
},
|
||||||
200, 0, //Cost, Gem Cost
|
200, 0, //Cost, Gem Cost
|
||||||
20, 6, //Clip Size, Spare Ammo
|
20, 6, //Clip Size, Spare Ammo
|
||||||
120, 2000, //ROF, Reload Time
|
120, 2200, //ROF, Reload Time
|
||||||
5, 0.01, 3.5, //Damage, Dropoff, Bullet Speed
|
28, 0.008, 0.47, //Damage, Dropoff, Armor Penetration
|
||||||
0, 0.15, //COF Min, COF Max
|
0, 0.18, //COF Min, COF Max
|
||||||
0.08, 0.3, //COF Inc per Bullet, COF Dec per Second
|
0.07, 0.3, //COF Inc per Bullet, COF Dec per Second
|
||||||
Material.STONE_HOE, Sound.BAT_LOOP);
|
Material.STONE_HOE, Sound.BAT_LOOP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,9 +19,9 @@ public class P2000 extends Gun
|
|||||||
200, 0, //Cost, Gem Cost
|
200, 0, //Cost, Gem Cost
|
||||||
13, 4, //Clip Size, Spare Ammo
|
13, 4, //Clip Size, Spare Ammo
|
||||||
130, 2200, //ROF, Reload Time
|
130, 2200, //ROF, Reload Time
|
||||||
6, 0.01, 3.5, //Damage, Dropoff, Bullet Speed
|
35, 0.008, 0.50, //Damage, Dropoff, Armor Penetration
|
||||||
0, 0.15, //COF Min, COF Max
|
0, 0.18, //COF Min, COF Max
|
||||||
0.08, 0.3, //COF Inc per Bullet, COF Dec per Second
|
0.07, 0.3, //COF Inc per Bullet, COF Dec per Second
|
||||||
Material.WOOD_HOE, Sound.GHAST_SCREAM2);
|
Material.WOOD_HOE, Sound.GHAST_SCREAM2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
package nautilus.game.arcade.game.games.minestrike.items.guns.pistol;
|
||||||
|
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.guns.GunType;
|
||||||
|
|
||||||
|
public class P250 extends Gun
|
||||||
|
{
|
||||||
|
public P250()
|
||||||
|
{
|
||||||
|
super(StrikeItemType.SECONDARY_WEAPON, GunType.PISTOL, "P250", new String[]
|
||||||
|
{
|
||||||
|
|
||||||
|
},
|
||||||
|
300, 0, //Cost, Gem Cost
|
||||||
|
13, 4, //Clip Size, Spare Ammo
|
||||||
|
130, 2200, //ROF, Reload Time
|
||||||
|
35, 0.005, 0.77, //Damage, Dropoff, Armor Penetration
|
||||||
|
0, 0.15, //COF Min, COF Max
|
||||||
|
0.06, 0.3, //COF Inc per Bullet, COF Dec per Second
|
||||||
|
Material.DIAMOND_HOE, Sound.SILVERFISH_KILL);
|
||||||
|
}
|
||||||
|
}
|
@ -18,10 +18,10 @@ public class AK47 extends Gun
|
|||||||
},
|
},
|
||||||
2700, 5000, //Cost, Gem Cost
|
2700, 5000, //Cost, Gem Cost
|
||||||
30, 3, //Clip Size, Spare Ammo
|
30, 3, //Clip Size, Spare Ammo
|
||||||
80, 3600, //ROF, Reload Time
|
80, 2500, //ROF, Reload Time
|
||||||
7.5, 0.005, 4, //Damage, Dropoff, Bullet Speed
|
36, 0.004, 0.78, //Damage, Dropoff, Armor Penetration
|
||||||
0, 0.25, //COF Min, COF Max
|
0, 0.3, //COF Min, COF Max
|
||||||
0.050, 0.4, //COF Inc per Bullet, COF Dec per Second
|
0.051, 0.35, //COF Inc per Bullet, COF Dec per Second
|
||||||
Material.WOOD_SPADE, Sound.BURP);
|
Material.WOOD_SPADE, Sound.BURP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
package nautilus.game.arcade.game.games.minestrike.items.guns.rifle;
|
||||||
|
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.guns.GunType;
|
||||||
|
|
||||||
|
public class AUG extends Gun
|
||||||
|
{
|
||||||
|
public AUG()
|
||||||
|
{
|
||||||
|
super(StrikeItemType.PRIMARY_WEAPON, GunType.RIFLE, "Steyr AUG", new String[]
|
||||||
|
{
|
||||||
|
|
||||||
|
},
|
||||||
|
3300, 5000, //Cost, Gem Cost
|
||||||
|
30, 3, //Clip Size, Spare Ammo
|
||||||
|
80, 3800, //ROF, Reload Time
|
||||||
|
28, 0.004, 0.9, //Damage, Dropoff, Armor Penetration
|
||||||
|
0, 0.25, //COF Min, COF Max
|
||||||
|
0.05, 0.4, //COF Inc per Bullet, COF Dec per Second
|
||||||
|
Material.GOLD_PICKAXE, Sound.VILLAGER_DEATH);
|
||||||
|
|
||||||
|
_scope = true;
|
||||||
|
}
|
||||||
|
}
|
@ -19,10 +19,12 @@ public class AWP extends Gun
|
|||||||
4750, 5000, //Cost, Gem Cost
|
4750, 5000, //Cost, Gem Cost
|
||||||
10, 3, //Clip Size, Spare Ammo
|
10, 3, //Clip Size, Spare Ammo
|
||||||
1500, 3600, //ROF, Reload Time
|
1500, 3600, //ROF, Reload Time
|
||||||
30, 0.002, 4.3, //Damage, Dropoff, Bullet Speed
|
115, 0, 0.97, //Damage, Dropoff, Armor Penetration
|
||||||
0.05, 0.05, //COF Min, COF Max
|
0.1, 0.1, //COF Min, COF Max
|
||||||
0, 0, //COF Inc per Bullet, COF Dec per Second
|
0, 0, //COF Inc per Bullet, COF Dec per Second
|
||||||
Material.GOLD_SPADE, Sound.DRINK);
|
Material.GOLD_SPADE, Sound.DRINK);
|
||||||
|
|
||||||
|
_scope = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
package nautilus.game.arcade.game.games.minestrike.items.guns.rifle;
|
||||||
|
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.guns.GunType;
|
||||||
|
|
||||||
|
public class Famas extends Gun
|
||||||
|
{
|
||||||
|
public Famas()
|
||||||
|
{
|
||||||
|
super(StrikeItemType.PRIMARY_WEAPON, GunType.RIFLE, "FAMAS", new String[]
|
||||||
|
{
|
||||||
|
|
||||||
|
},
|
||||||
|
2250, 5000, //Cost, Gem Cost
|
||||||
|
25, 4, //Clip Size, Spare Ammo
|
||||||
|
80, 3300, //ROF, Reload Time
|
||||||
|
30, 0.004, 0.7, //Damage, Dropoff, Armor Penetration
|
||||||
|
0, 0.28, //COF Min, COF Max
|
||||||
|
0.040, 0.30, //COF Inc per Bullet, COF Dec per Second
|
||||||
|
Material.WOOD_PICKAXE, Sound.WITHER_DEATH);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package nautilus.game.arcade.game.games.minestrike.items.guns.rifle;
|
||||||
|
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.guns.GunType;
|
||||||
|
|
||||||
|
public class Galil extends Gun
|
||||||
|
{
|
||||||
|
public Galil()
|
||||||
|
{
|
||||||
|
super(StrikeItemType.PRIMARY_WEAPON, GunType.RIFLE, "Galil AR", new String[]
|
||||||
|
{
|
||||||
|
|
||||||
|
},
|
||||||
|
2000, 5000, //Cost, Gem Cost
|
||||||
|
35, 3, //Clip Size, Spare Ammo
|
||||||
|
80, 2600, //ROF, Reload Time
|
||||||
|
30, 0.004, 0.75, //Damage, Dropoff, Armor Penetration
|
||||||
|
0, 0.30, //COF Min, COF Max
|
||||||
|
0.042, 0.30, //COF Inc per Bullet, COF Dec per Second
|
||||||
|
Material.STONE_PICKAXE, Sound.WITHER_SHOOT);
|
||||||
|
}
|
||||||
|
}
|
@ -8,9 +8,9 @@ import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
|
|||||||
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
|
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
|
||||||
import nautilus.game.arcade.game.games.minestrike.items.guns.GunType;
|
import nautilus.game.arcade.game.games.minestrike.items.guns.GunType;
|
||||||
|
|
||||||
public class M4A1 extends Gun
|
public class M4A4 extends Gun
|
||||||
{
|
{
|
||||||
public M4A1()
|
public M4A4()
|
||||||
{
|
{
|
||||||
super(StrikeItemType.PRIMARY_WEAPON, GunType.RIFLE, "M4A4", new String[]
|
super(StrikeItemType.PRIMARY_WEAPON, GunType.RIFLE, "M4A4", new String[]
|
||||||
{
|
{
|
||||||
@ -18,10 +18,10 @@ public class M4A1 extends Gun
|
|||||||
},
|
},
|
||||||
2900, 5000, //Cost, Gem Cost
|
2900, 5000, //Cost, Gem Cost
|
||||||
30, 3, //Clip Size, Spare Ammo
|
30, 3, //Clip Size, Spare Ammo
|
||||||
80, 3600, //ROF, Reload Time
|
80, 3000, //ROF, Reload Time
|
||||||
7, 0.005, 4, //Damage, Dropoff, Bullet Speed
|
33, 0.004, 0.7, //Damage, Dropoff, Armor Penetration
|
||||||
0, 0.2, //COF Min, COF Max
|
0, 0.26, //COF Min, COF Max
|
||||||
0.048, 0.4, //COF Inc per Bullet, COF Dec per Second
|
0.048, 0.35, //COF Inc per Bullet, COF Dec per Second
|
||||||
Material.STONE_SPADE, Sound.BAT_TAKEOFF);
|
Material.STONE_SPADE, Sound.BAT_TAKEOFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package nautilus.game.arcade.game.games.minestrike.items.guns.rifle;
|
||||||
|
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.guns.GunType;
|
||||||
|
|
||||||
|
public class SG553 extends Gun
|
||||||
|
{
|
||||||
|
public SG553()
|
||||||
|
{
|
||||||
|
super(StrikeItemType.PRIMARY_WEAPON, GunType.RIFLE, "SG553", new String[]
|
||||||
|
{
|
||||||
|
|
||||||
|
},
|
||||||
|
3000, 5000, //Cost, Gem Cost
|
||||||
|
30, 3, //Clip Size, Spare Ammo
|
||||||
|
80, 3800, //ROF, Reload Time
|
||||||
|
30, 0.004, 1.00, //Damage, Dropoff, Armor Penetration
|
||||||
|
0, 0.25, //COF Min, COF Max
|
||||||
|
0.052, 0.4, //COF Inc per Bullet, COF Dec per Second
|
||||||
|
Material.IRON_PICKAXE, Sound.WITHER_SPAWN);
|
||||||
|
|
||||||
|
_scope = true;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package nautilus.game.arcade.game.games.minestrike.items.guns.rifle;
|
||||||
|
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.guns.GunType;
|
||||||
|
|
||||||
|
public class SSG08 extends Gun
|
||||||
|
{
|
||||||
|
public SSG08()
|
||||||
|
{
|
||||||
|
super(StrikeItemType.PRIMARY_WEAPON, GunType.SNIPER, "SSG 08", new String[]
|
||||||
|
{
|
||||||
|
|
||||||
|
},
|
||||||
|
1700, 5000, //Cost, Gem Cost
|
||||||
|
10, 6, //Clip Size, Spare Ammo
|
||||||
|
1250, 3700, //ROF, Reload Time
|
||||||
|
88, 0.001, 0.85, //Damage, Dropoff, Armor Penetration
|
||||||
|
0.08, 0.08, //COF Min, COF Max
|
||||||
|
0, 0, //COF Inc per Bullet, COF Dec per Second
|
||||||
|
Material.DIAMOND_PICKAXE, Sound.WOLF_DEATH);
|
||||||
|
|
||||||
|
_scope = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -17,8 +17,8 @@ public class Nova extends Shotgun
|
|||||||
},
|
},
|
||||||
1200, 5000, //Cost, Gem Cost
|
1200, 5000, //Cost, Gem Cost
|
||||||
8, 4, //Clip Size, Spare Ammo
|
8, 4, //Clip Size, Spare Ammo
|
||||||
1000, 4000, //ROF, Reload Time
|
1000, 800, //ROF, Reload Time
|
||||||
5, 0.02, 3.5, //Damage, Dropoff, Bullet Speed
|
26, 0.01, 0.5, //Damage, Dropoff, Armor Penetration
|
||||||
0.15, 0.15, //COF Min, COF Max
|
0.15, 0.15, //COF Min, COF Max
|
||||||
0, 0, //COF Inc per Bullet, COF Dec per Second
|
0, 0, //COF Inc per Bullet, COF Dec per Second
|
||||||
Material.GOLD_AXE, Sound.BLAZE_DEATH, 9);
|
Material.GOLD_AXE, Sound.BLAZE_DEATH, 9);
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
package nautilus.game.arcade.game.games.minestrike.items.guns.shotgun;
|
||||||
|
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.guns.Shotgun;
|
||||||
|
|
||||||
|
public class XM1014 extends Shotgun
|
||||||
|
{
|
||||||
|
public XM1014()
|
||||||
|
{
|
||||||
|
super(StrikeItemType.PRIMARY_WEAPON, "XM1014", new String[]
|
||||||
|
{
|
||||||
|
|
||||||
|
},
|
||||||
|
2000, 5000, //Cost, Gem Cost
|
||||||
|
7, 4, //Clip Size, Spare Ammo
|
||||||
|
260, 800, //ROF, Reload Time
|
||||||
|
20, 0.01, 0.8, //Damage, Dropoff, Armor Penetration
|
||||||
|
0.15, 0.15, //COF Min, COF Max
|
||||||
|
0, 0, //COF Inc per Bullet, COF Dec per Second
|
||||||
|
Material.DIAMOND_AXE, Sound.SKELETON_DEATH, 6);
|
||||||
|
}
|
||||||
|
}
|
@ -18,10 +18,10 @@ public class P90 extends Gun
|
|||||||
},
|
},
|
||||||
2350, 5000, //Cost, Gem Cost
|
2350, 5000, //Cost, Gem Cost
|
||||||
50, 2, //Clip Size, Spare Ammo
|
50, 2, //Clip Size, Spare Ammo
|
||||||
35, 2800, //ROF, Reload Time
|
35, 3300, //ROF, Reload Time
|
||||||
4, 0.02, 3.5, //Damage, Dropoff, Bullet Speed
|
22, 0.006, 0.65, //Damage, Dropoff, Armor Penetration
|
||||||
0, 0.2, //COF Min, COF Max
|
0, 0.25, //COF Min, COF Max
|
||||||
0.03, 0.4, //COF Inc per Bullet, COF Dec per Second
|
0.022, 0.3, //COF Inc per Bullet, COF Dec per Second
|
||||||
Material.STONE_AXE, Sound.CREEPER_DEATH);
|
Material.STONE_AXE, Sound.CREEPER_DEATH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
package nautilus.game.arcade.game.games.minestrike.items.guns.smg;
|
||||||
|
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.guns.GunType;
|
||||||
|
|
||||||
|
public class PPBizon extends Gun
|
||||||
|
{
|
||||||
|
public PPBizon()
|
||||||
|
{
|
||||||
|
super(StrikeItemType.PRIMARY_WEAPON, GunType.SMG, "PP-Bizon", new String[]
|
||||||
|
{
|
||||||
|
|
||||||
|
},
|
||||||
|
1400, 5000, //Cost, Gem Cost
|
||||||
|
64, 2, //Clip Size, Spare Ammo
|
||||||
|
60, 2400, //ROF, Reload Time
|
||||||
|
27, 0.007, 0.47, //Damage, Dropoff, Armor Penetration
|
||||||
|
0, 0.3, //COF Min, COF Max
|
||||||
|
0.045, 0.3, //COF Inc per Bullet, COF Dec per Second
|
||||||
|
Material.WOOD_AXE, Sound.SHEEP_SHEAR);
|
||||||
|
}
|
||||||
|
}
|
@ -50,7 +50,7 @@ public abstract class OrderCraft extends Order
|
|||||||
if (event.getSlotType() != SlotType.RESULT)
|
if (event.getSlotType() != SlotType.RESULT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!UtilInv.IsItem(event.getCurrentItem(), _id, _data))
|
if (!UtilInv.IsItem(event.getCurrentItem(), null, _id, _data))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!(event.getWhoClicked() instanceof Player))
|
if (!(event.getWhoClicked() instanceof Player))
|
||||||
|
@ -45,7 +45,7 @@ public abstract class OrderGather extends Order
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void Pickup(PlayerPickupItemEvent event)
|
public void Pickup(PlayerPickupItemEvent event)
|
||||||
{
|
{
|
||||||
if (!UtilInv.IsItem(event.getItem().getItemStack(), _id, _data))
|
if (!UtilInv.IsItem(event.getItem().getItemStack(), null, _id, _data))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Has(event.getPlayer()))
|
if (Has(event.getPlayer()))
|
||||||
|
@ -66,7 +66,7 @@ public class PerkCreeperSulphurBomb extends Perk implements IThrown
|
|||||||
|
|
||||||
UtilInv.Update(player);
|
UtilInv.Update(player);
|
||||||
|
|
||||||
org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.FIREWORK_CHARGE, (byte)6));
|
org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.COAL, (byte)0));
|
||||||
|
|
||||||
UtilAction.velocity(ent, player.getLocation().getDirection(), 1, false, 0, 0.2, 10, false);
|
UtilAction.velocity(ent, player.getLocation().getDirection(), 1, false, 0, 0.2, 10, false);
|
||||||
|
|
||||||
|
@ -14,9 +14,12 @@ import org.bukkit.event.entity.PlayerDeathEvent;
|
|||||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilGear;
|
||||||
import mineplex.core.common.util.UtilInv;
|
import mineplex.core.common.util.UtilInv;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
@ -45,6 +48,22 @@ public class PerkFletcher extends Perk
|
|||||||
_max = max;
|
_max = max;
|
||||||
_remove = remove;
|
_remove = remove;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFletchedArrow(ItemStack stack)
|
||||||
|
{
|
||||||
|
if (!UtilGear.isMat(stack, Material.ARROW))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
ItemMeta meta = stack.getItemMeta();
|
||||||
|
|
||||||
|
if (meta.getDisplayName() == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!meta.getDisplayName().contains("Fletched Arrow"))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void FletchShootBow(EntityShootBowEvent event)
|
public void FletchShootBow(EntityShootBowEvent event)
|
||||||
@ -58,12 +77,11 @@ public class PerkFletcher extends Perk
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
for (int i=0 ; i<=8 ; i++)
|
for (int i=0 ; i<=8 ; i++)
|
||||||
if (player.getInventory().getItem(i) != null)
|
if (isFletchedArrow(player.getInventory().getItem(i)))
|
||||||
if (UtilInv.IsItem(player.getInventory().getItem(i), Material.ARROW, (byte)1))
|
{
|
||||||
{
|
_fletchArrows.add(event.getProjectile());
|
||||||
_fletchArrows.add(event.getProjectile());
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -94,11 +112,11 @@ public class PerkFletcher extends Perk
|
|||||||
if (!Recharge.Instance.use(cur, GetName(), _time * 1000, false, false))
|
if (!Recharge.Instance.use(cur, GetName(), _time * 1000, false, false))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (UtilInv.contains(cur, Material.ARROW, (byte)1, _max))
|
if (UtilInv.contains(cur, "Fletched Arrow", Material.ARROW, (byte)0, _max))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//Add
|
//Add
|
||||||
cur.getInventory().addItem(ItemStackFactory.Instance.CreateStack(262, (byte)1, 1, F.item("Fletched Arrow")));
|
cur.getInventory().addItem(ItemStackFactory.Instance.CreateStack(262, (byte)0, 1, F.item("Fletched Arrow")));
|
||||||
|
|
||||||
cur.playSound(cur.getLocation(), Sound.ITEM_PICKUP, 2f, 1f);
|
cur.playSound(cur.getLocation(), Sound.ITEM_PICKUP, 2f, 1f);
|
||||||
}
|
}
|
||||||
@ -110,7 +128,7 @@ public class PerkFletcher extends Perk
|
|||||||
if (event.isCancelled())
|
if (event.isCancelled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!UtilInv.IsItem(event.getItemDrop().getItemStack(), Material.ARROW, (byte)1))
|
if (!isFletchedArrow(event.getItemDrop().getItemStack()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//Cancel
|
//Cancel
|
||||||
@ -126,7 +144,7 @@ public class PerkFletcher extends Perk
|
|||||||
HashSet<org.bukkit.inventory.ItemStack> remove = new HashSet<org.bukkit.inventory.ItemStack>();
|
HashSet<org.bukkit.inventory.ItemStack> remove = new HashSet<org.bukkit.inventory.ItemStack>();
|
||||||
|
|
||||||
for (org.bukkit.inventory.ItemStack item : event.getDrops())
|
for (org.bukkit.inventory.ItemStack item : event.getDrops())
|
||||||
if (UtilInv.IsItem(item, Material.ARROW, (byte)1))
|
if (isFletchedArrow(item))
|
||||||
remove.add(item);
|
remove.add(item);
|
||||||
|
|
||||||
for (org.bukkit.inventory.ItemStack item : remove)
|
for (org.bukkit.inventory.ItemStack item : remove)
|
||||||
@ -136,7 +154,7 @@ public class PerkFletcher extends Perk
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void FletchInvClick(InventoryClickEvent event)
|
public void FletchInvClick(InventoryClickEvent event)
|
||||||
{
|
{
|
||||||
UtilInv.DisallowMovementOf(event, "Fletched Arrow", Material.ARROW, (byte)1, true);
|
UtilInv.DisallowMovementOf(event, "Fletched Arrow", Material.ARROW, (byte)0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
@ -950,6 +950,9 @@ public class GameFlagManager implements Listener
|
|||||||
|
|
||||||
if (event.getType() != UpdateType.SLOWER)
|
if (event.getType() != UpdateType.SLOWER)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (Manager.GetGame().GetType() == GameType.MineStrike)
|
||||||
|
return;
|
||||||
|
|
||||||
for (Player player : UtilServer.getPlayers())
|
for (Player player : UtilServer.getPlayers())
|
||||||
{
|
{
|
||||||
@ -961,6 +964,4 @@ public class GameFlagManager implements Listener
|
|||||||
UtilPlayer.message(player, C.cWhite + C.Bold + "The next game will be starting soon...");
|
UtilPlayer.message(player, C.cWhite + C.Bold + "The next game will be starting soon...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ public class GameGemManager implements Listener
|
|||||||
|
|
||||||
Game game = Manager.GetGame();
|
Game game = Manager.GetGame();
|
||||||
if (game == null) return;
|
if (game == null) return;
|
||||||
|
|
||||||
if (!(event.GetEvent().getEntity() instanceof Player))
|
if (!(event.GetEvent().getEntity() instanceof Player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ public class GameGemManager implements Listener
|
|||||||
if (event.GetState() != PlayerState.OUT)
|
if (event.GetState() != PlayerState.OUT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (event.GetGame().GetType() == GameType.Paintball)
|
if (event.GetGame().GetType() == GameType.Paintball || event.GetGame().GetType() == GameType.MineStrike)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
RewardGems(event.GetGame(), event.GetPlayer(), false);
|
RewardGems(event.GetGame(), event.GetPlayer(), false);
|
||||||
|
Loading…
Reference in New Issue
Block a user