Minestrike update
This commit is contained in:
parent
d5766d62ae
commit
1dec79c0fa
@ -6,7 +6,6 @@ import java.util.HashMap;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Color;
|
import org.bukkit.Color;
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
@ -71,6 +70,7 @@ import mineplex.core.recharge.RechargedEvent;
|
|||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||||
|
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
||||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
import nautilus.game.arcade.ArcadeManager;
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
import nautilus.game.arcade.GameType;
|
import nautilus.game.arcade.GameType;
|
||||||
@ -83,6 +83,7 @@ import nautilus.game.arcade.game.GameTeam.PlayerState;
|
|||||||
import nautilus.game.arcade.game.games.minestrike.data.Bomb;
|
import nautilus.game.arcade.game.games.minestrike.data.Bomb;
|
||||||
import nautilus.game.arcade.game.games.minestrike.data.Bullet;
|
import nautilus.game.arcade.game.games.minestrike.data.Bullet;
|
||||||
import nautilus.game.arcade.game.games.minestrike.items.StrikeItem;
|
import nautilus.game.arcade.game.games.minestrike.items.StrikeItem;
|
||||||
|
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;
|
||||||
@ -122,6 +123,8 @@ 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 Bomb _bomb = null;
|
private Bomb _bomb = null;
|
||||||
private Item _bombItem = null;
|
private Item _bombItem = null;
|
||||||
@ -437,6 +440,11 @@ public class MineStrike extends TeamGame
|
|||||||
{
|
{
|
||||||
_grenadesThrown.put(ent, grenade);
|
_grenadesThrown.put(ent, grenade);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void registerIncendiary(Location loc, long endTime)
|
||||||
|
{
|
||||||
|
_incendiary.put(loc, endTime);
|
||||||
|
}
|
||||||
|
|
||||||
public Gun getGunInHand(Player player, ItemStack overrideStack)
|
public Gun getGunInHand(Player player, ItemStack overrideStack)
|
||||||
{
|
{
|
||||||
@ -570,7 +578,7 @@ public class MineStrike extends TeamGame
|
|||||||
Gun gun = getGunInHand(event.getPlayer(), event.getItemDrop().getItemStack());
|
Gun gun = getGunInHand(event.getPlayer(), event.getItemDrop().getItemStack());
|
||||||
if (gun != null)
|
if (gun != null)
|
||||||
{
|
{
|
||||||
gun.drop(this, event.getPlayer(), false);
|
gun.drop(this, event.getPlayer(), false, false);
|
||||||
event.getItemDrop().remove();
|
event.getItemDrop().remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -579,7 +587,7 @@ public class MineStrike extends TeamGame
|
|||||||
Grenade grenade = getGrenadeInHand(event.getPlayer(), event.getItemDrop().getItemStack());
|
Grenade grenade = getGrenadeInHand(event.getPlayer(), event.getItemDrop().getItemStack());
|
||||||
if (grenade != null)
|
if (grenade != null)
|
||||||
{
|
{
|
||||||
grenade.drop(this, event.getPlayer(), false);
|
grenade.drop(this, event.getPlayer(), false, false);
|
||||||
event.getItemDrop().remove();
|
event.getItemDrop().remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -633,9 +641,42 @@ public class MineStrike extends TeamGame
|
|||||||
toDrop.add(item);
|
toDrop.add(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Drop Primary
|
||||||
|
boolean primaryDropped = false;
|
||||||
for (StrikeItem item : toDrop)
|
for (StrikeItem item : toDrop)
|
||||||
{
|
{
|
||||||
item.drop(this, player, true);
|
if (item.getType() == StrikeItemType.PRIMARY_WEAPON)
|
||||||
|
{
|
||||||
|
item.drop(this, player, true, false);
|
||||||
|
primaryDropped = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Drop Remaining
|
||||||
|
boolean grenadeDropped = false;
|
||||||
|
for (StrikeItem item : toDrop)
|
||||||
|
{
|
||||||
|
//Record Primary Dropped
|
||||||
|
if (item.getType() == StrikeItemType.PRIMARY_WEAPON)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//Pistol
|
||||||
|
if (item.getType() == StrikeItemType.SECONDARY_WEAPON)
|
||||||
|
{
|
||||||
|
item.drop(this, player, true, primaryDropped);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Grenade
|
||||||
|
if (item.getType() == StrikeItemType.GRENADE)
|
||||||
|
{
|
||||||
|
item.drop(this, player, true, grenadeDropped);
|
||||||
|
grenadeDropped = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Other
|
||||||
|
item.drop(this, player, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Bomb
|
//Bomb
|
||||||
@ -732,12 +773,18 @@ public class MineStrike extends TeamGame
|
|||||||
{
|
{
|
||||||
Arrow arrow = (Arrow)event.getEntity();
|
Arrow arrow = (Arrow)event.getEntity();
|
||||||
|
|
||||||
//Particle
|
Bullet bullet = _bullets.get(arrow);
|
||||||
UtilParticle.PlayParticle(ParticleType.FIREWORKS_SPARK, arrow.getLocation(), 0, 0, 0, 0, 1);
|
|
||||||
|
|
||||||
//Sound
|
//Particle
|
||||||
arrow.getWorld().playSound(event.getEntity().getLocation(), Sound.ENDERMAN_HIT, 1f, 1f);
|
if (bullet != null && bullet.Shooter != null)
|
||||||
|
UtilParticle.PlayParticle(bullet.Shooter, ParticleType.FIREWORKS_SPARK, arrow.getLocation(), 0, 0, 0, 0, 1);
|
||||||
|
|
||||||
|
//Hit Block Sound
|
||||||
|
arrow.getWorld().playSound(arrow.getLocation(), Sound.ENDERMAN_HIT, 1f, 1f);
|
||||||
|
|
||||||
|
//Bullet Whiz Sound
|
||||||
|
bulletWhizzSound(arrow.getLocation(), bullet);
|
||||||
|
|
||||||
//Block Particle
|
//Block Particle
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -763,32 +810,78 @@ public class MineStrike extends TeamGame
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_bullets.remove(arrow);
|
||||||
arrow.remove();
|
arrow.remove();
|
||||||
}
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
private void bulletWhizzSound(Location bulletEndLocation, Bullet bullet)
|
||||||
public void bulletFlybySound(UpdateEvent event)
|
|
||||||
{
|
{
|
||||||
if (event.getType() != UpdateType.TICK)
|
if (bullet == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (Player player : UtilServer.getPlayers())
|
long start = System.currentTimeMillis();
|
||||||
|
|
||||||
|
Location loc = bullet.Origin.clone();
|
||||||
|
|
||||||
|
HashSet<Player> hasPlayedFor = new HashSet<Player>();
|
||||||
|
|
||||||
|
if (bullet.Shooter != null)
|
||||||
|
hasPlayedFor.add(bullet.Shooter);
|
||||||
|
|
||||||
|
//Move between points, check players
|
||||||
|
while (UtilMath.offset(loc, bulletEndLocation) > 1)
|
||||||
{
|
{
|
||||||
for (Entity ent : _bullets.keySet())
|
//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.
|
||||||
|
double offsetStartToEnd = UtilMath.offset(loc, bulletEndLocation) + 4;
|
||||||
|
|
||||||
|
for (Player player : UtilServer.getPlayers())
|
||||||
{
|
{
|
||||||
if (UtilMath.offset(player.getEyeLocation(), ent.getLocation()) < 4)
|
if (hasPlayedFor.contains(player))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//Remove players who are not between current/end points
|
||||||
|
if (offsetStartToEnd < UtilMath.offset(player.getEyeLocation(), loc) &&
|
||||||
|
offsetStartToEnd < UtilMath.offset(player.getEyeLocation(), bulletEndLocation))
|
||||||
{
|
{
|
||||||
if (_bullets.get(ent).bulletSound())
|
hasPlayedFor.add(player);
|
||||||
{
|
continue;
|
||||||
player.playSound(ent.getLocation(), Sound.BAT_IDLE, (float)(0.2 + UtilMath.offset(player.getEyeLocation(), ent.getLocation()) / 4d), 1f);
|
}
|
||||||
}
|
|
||||||
|
//Check
|
||||||
|
if (UtilMath.offset(player.getEyeLocation(), loc) < 4)
|
||||||
|
{
|
||||||
|
player.playSound(loc, Sound.BAT_IDLE, (float)(0.5 + Math.random() * 0.5), 1f);
|
||||||
|
hasPlayedFor.add(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Move Closer
|
||||||
|
loc.add(UtilAlg.getTrajectory(loc, bulletEndLocation));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bullets++;
|
||||||
|
whizzTime += (System.currentTimeMillis() - start);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//XXX Debug
|
||||||
|
public int bullets = 0;
|
||||||
|
public long whizzTime = 0;
|
||||||
|
@EventHandler
|
||||||
|
public void debugWhizzTime(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.SLOWER)
|
||||||
|
return;
|
||||||
|
|
||||||
|
System.out.println("Bullets Fired: " + bullets);
|
||||||
|
System.out.println("Bullet Whizz Time: " + whizzTime);
|
||||||
|
|
||||||
|
bullets = 0;
|
||||||
|
whizzTime = 0;
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority=EventPriority.HIGH)
|
@EventHandler(priority=EventPriority.HIGH)
|
||||||
public void damage(CustomDamageEvent event)
|
public void damage(CustomDamageEvent event)
|
||||||
{
|
{
|
||||||
@ -854,11 +947,16 @@ 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;
|
||||||
|
|
||||||
|
//Bullet Whiz Sound
|
||||||
|
bulletWhizzSound(event.GetDamageePlayer().getEyeLocation(), bullet);
|
||||||
|
|
||||||
//Wipe previous data!
|
//Wipe previous data!
|
||||||
event.GetCancellers().clear();
|
event.GetCancellers().clear();
|
||||||
@ -941,7 +1039,7 @@ public class MineStrike extends TeamGame
|
|||||||
{
|
{
|
||||||
Entity bullet = bulletIterator.next();
|
Entity bullet = bulletIterator.next();
|
||||||
|
|
||||||
if (!bullet.isValid() || bullet.getTicksLived() > 200)
|
if (!bullet.isValid() || bullet.getTicksLived() > 40)
|
||||||
{
|
{
|
||||||
bulletIterator.remove();
|
bulletIterator.remove();
|
||||||
bullet.remove();
|
bullet.remove();
|
||||||
@ -984,7 +1082,7 @@ public class MineStrike extends TeamGame
|
|||||||
|
|
||||||
if (gun.isStack(player.getInventory().getItem(slot)))
|
if (gun.isStack(player.getInventory().getItem(slot)))
|
||||||
{
|
{
|
||||||
gun.drop(this, player, false);
|
gun.drop(this, player, false, false);
|
||||||
player.getInventory().setItem(slot, null);
|
player.getInventory().setItem(slot, null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1534,6 +1632,9 @@ 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.clear();
|
||||||
|
|
||||||
//Restock Ammo
|
//Restock Ammo
|
||||||
for (Gun gun : _gunsEquipped.keySet())
|
for (Gun gun : _gunsEquipped.keySet())
|
||||||
@ -1696,6 +1797,44 @@ public class MineStrike extends TeamGame
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void speedUpdate(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (!IsLive())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Player player : GetPlayers(true))
|
||||||
|
{
|
||||||
|
if (UtilGear.isMat(player.getItemInHand(), Material.IRON_AXE) || UtilGear.isMat(player.getItemInHand(), Material.IRON_SWORD))
|
||||||
|
Manager.GetCondition().Factory().Speed("Knife", player, player, 1.9, 0, false, false, false);
|
||||||
|
else
|
||||||
|
Manager.GetCondition().EndCondition(player, ConditionType.SPEED, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void incendiaryUpdate(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.SLOW)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Iterator<Location> fireIterator = _incendiary.keySet().iterator();
|
||||||
|
|
||||||
|
while (fireIterator.hasNext())
|
||||||
|
{
|
||||||
|
Location loc = fireIterator.next();
|
||||||
|
|
||||||
|
if (_incendiary.get(loc) < System.currentTimeMillis())
|
||||||
|
fireIterator.remove();
|
||||||
|
|
||||||
|
else
|
||||||
|
loc.getWorld().playSound(loc, Sound.PIG_DEATH, 1f, 1f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void removeScope(Player player)
|
public void removeScope(Player player)
|
||||||
{
|
{
|
||||||
|
@ -15,6 +15,7 @@ import nautilus.game.arcade.game.GameTeam;
|
|||||||
import nautilus.game.arcade.game.games.minestrike.items.StrikeItem;
|
import nautilus.game.arcade.game.games.minestrike.items.StrikeItem;
|
||||||
import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
|
import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
|
||||||
import nautilus.game.arcade.game.games.minestrike.items.equipment.DefusalKit;
|
import nautilus.game.arcade.game.games.minestrike.items.equipment.DefusalKit;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.items.equipment.armor.Armor;
|
||||||
import nautilus.game.arcade.game.games.minestrike.items.equipment.armor.Helmet;
|
import nautilus.game.arcade.game.games.minestrike.items.equipment.armor.Helmet;
|
||||||
import nautilus.game.arcade.game.games.minestrike.items.equipment.armor.Kevlar;
|
import nautilus.game.arcade.game.games.minestrike.items.equipment.armor.Kevlar;
|
||||||
import nautilus.game.arcade.game.games.minestrike.items.grenades.*;
|
import nautilus.game.arcade.game.games.minestrike.items.grenades.*;
|
||||||
@ -29,7 +30,6 @@ import org.bukkit.Color;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ public class ShopManager
|
|||||||
|
|
||||||
//Pistols
|
//Pistols
|
||||||
slot = 9;
|
slot = 9;
|
||||||
//addItem(team.GetColor() == ChatColor.RED ? new Glock18() : new USP(), player, slot++);
|
addItem(team.GetColor() == ChatColor.RED ? new Glock18() : new P2000(), player, slot++);
|
||||||
addItem(new CZ75(), player, slot++);
|
addItem(new CZ75(), player, slot++);
|
||||||
addItem(new Deagle(), player, slot++);
|
addItem(new Deagle(), player, slot++);
|
||||||
|
|
||||||
@ -77,9 +77,10 @@ public class ShopManager
|
|||||||
addItem(new AWP(), player, slot++);
|
addItem(new AWP(), player, slot++);
|
||||||
|
|
||||||
//Grenades
|
//Grenades
|
||||||
addItem(new FlashBang(), player, 15);
|
addItem(new FlashBang(), player, 14);
|
||||||
addItem(new HighExplosive(), player, 16);
|
addItem(new HighExplosive(), player, 15);
|
||||||
addItem(new Smoke(), player, 17);
|
addItem(new Smoke(), player, 16);
|
||||||
|
addItem(team.GetColor() == ChatColor.RED ? new Molotov() : new Incendiary(), player, 17);
|
||||||
|
|
||||||
//Gear
|
//Gear
|
||||||
if (team.GetColor() == ChatColor.AQUA)
|
if (team.GetColor() == ChatColor.AQUA)
|
||||||
@ -133,20 +134,15 @@ public class ShopManager
|
|||||||
|
|
||||||
if (item instanceof Kevlar)
|
if (item instanceof Kevlar)
|
||||||
{
|
{
|
||||||
System.out.println("Checking Kevlar");
|
if (Armor.isArmor(player.getInventory().getChestplate()))
|
||||||
|
|
||||||
Kevlar armor = (Kevlar)item;
|
|
||||||
if (armor.isArmor(player.getInventory().getChestplate()))
|
|
||||||
{
|
{
|
||||||
System.out.println("Checking Kevlar TRUE");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item instanceof Helmet)
|
if (item instanceof Helmet)
|
||||||
{
|
{
|
||||||
Helmet armor = (Helmet)item;
|
if (Armor.isArmor(player.getInventory().getHelmet()))
|
||||||
if (armor.isArmor(player.getInventory().getHelmet()))
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ public abstract class StrikeItem
|
|||||||
return _skin;
|
return _skin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drop(MineStrike game, Player player, boolean natural)
|
public void drop(MineStrike game, Player player, boolean natural, boolean onlyDeregisterAndRemove)
|
||||||
{
|
{
|
||||||
Entity ent;
|
Entity ent;
|
||||||
|
|
||||||
|
@ -0,0 +1,86 @@
|
|||||||
|
package nautilus.game.arcade.game.games.minestrike.items.grenades;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilBlock;
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.MineStrike;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.block.BlockFace;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
|
||||||
|
public abstract class FireGrenadeBase extends Grenade
|
||||||
|
{
|
||||||
|
private long _baseTime;
|
||||||
|
|
||||||
|
public FireGrenadeBase(String name, int price, int gemCost, Material skin, long burnTime)
|
||||||
|
{
|
||||||
|
super(name, new String[]
|
||||||
|
{
|
||||||
|
|
||||||
|
},
|
||||||
|
price, gemCost, Material.PORK, 1);
|
||||||
|
|
||||||
|
_baseTime = burnTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateCustom(MineStrike game, Entity ent)
|
||||||
|
{
|
||||||
|
if (UtilEnt.isGrounded(ent))
|
||||||
|
{
|
||||||
|
createFire(game, ent.getLocation());
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createFire(final MineStrike game, final Location loc)
|
||||||
|
{
|
||||||
|
//Sound
|
||||||
|
loc.getWorld().playSound(loc, Sound.IRONGOLEM_THROW, 1f, 1f);
|
||||||
|
|
||||||
|
//Particle
|
||||||
|
UtilParticle.PlayParticle(ParticleType.LAVA, loc.add(0, 0.2, 0), 0.3f, 0f, 0.3f, 0, 30);
|
||||||
|
|
||||||
|
//Fire Blocks
|
||||||
|
final HashMap<Block, Double> blocks = UtilBlock.getInRadius(loc, 3.5d);
|
||||||
|
for (final Block block : blocks.keySet())
|
||||||
|
{
|
||||||
|
if (block.getType() != Material.AIR)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!UtilBlock.solid(block.getRelative(BlockFace.DOWN)))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(game.Manager.GetPlugin(), new Runnable()
|
||||||
|
{
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
game.Manager.GetBlockRestore().Add(block, 51, (byte)0, (long) (_baseTime + blocks.get(block) * _baseTime));
|
||||||
|
}
|
||||||
|
}, 60 - (int)(60d * blocks.get(block)));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Initial Burn Sound
|
||||||
|
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(game.Manager.GetPlugin(), new Runnable()
|
||||||
|
{
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
loc.getWorld().playSound(loc, Sound.PIG_DEATH, 1f, 1f);
|
||||||
|
}
|
||||||
|
}, 20);
|
||||||
|
|
||||||
|
//Register
|
||||||
|
game.registerIncendiary(loc, System.currentTimeMillis() + (_baseTime*2-4000));
|
||||||
|
}
|
||||||
|
}
|
@ -1,48 +1,11 @@
|
|||||||
package nautilus.game.arcade.game.games.minestrike.items.grenades;
|
package nautilus.game.arcade.game.games.minestrike.items.grenades;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import mineplex.core.common.util.UtilBlock;
|
|
||||||
import mineplex.core.common.util.UtilEnt;
|
|
||||||
import mineplex.core.common.util.UtilParticle;
|
|
||||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
|
||||||
import nautilus.game.arcade.game.games.minestrike.MineStrike;
|
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.entity.Entity;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
|
||||||
|
|
||||||
public class Incendiary extends Grenade
|
public class Incendiary extends FireGrenadeBase
|
||||||
{
|
{
|
||||||
public Incendiary()
|
public Incendiary()
|
||||||
{
|
{
|
||||||
super("HE Grenade", new String[]
|
super("Incendiary", 600, 0, Material.PORK, 10000);
|
||||||
{
|
|
||||||
|
|
||||||
},
|
|
||||||
300, 0, Material.APPLE, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean updateCustom(MineStrike game, Entity ent)
|
|
||||||
{
|
|
||||||
if (UtilEnt.isGrounded(ent))
|
|
||||||
{
|
|
||||||
createFire(ent.getLocation().getBlock());
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createFire(Block block)
|
|
||||||
{
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
package nautilus.game.arcade.game.games.minestrike.items.grenades;
|
package nautilus.game.arcade.game.games.minestrike.items.grenades;
|
||||||
|
|
||||||
public class Molotov
|
import org.bukkit.Material;
|
||||||
{
|
|
||||||
|
|
||||||
|
public class Molotov extends FireGrenadeBase
|
||||||
|
{
|
||||||
|
public Molotov()
|
||||||
|
{
|
||||||
|
super("Molotov", 400, 0, Material.GRILLED_PORK, 8000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ public class Glock18 extends Gun
|
|||||||
{
|
{
|
||||||
|
|
||||||
},
|
},
|
||||||
0, 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, 2000, //ROF, Reload Time
|
||||||
5, 0.01, 3.5, //Damage, Dropoff, Bullet Speed
|
5, 0.01, 3.5, //Damage, Dropoff, Bullet Speed
|
||||||
|
@ -16,7 +16,7 @@ public class P2000 extends Gun
|
|||||||
{
|
{
|
||||||
|
|
||||||
},
|
},
|
||||||
0, 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
|
6, 0.01, 3.5, //Damage, Dropoff, Bullet Speed
|
||||||
|
Loading…
Reference in New Issue
Block a user