Merge branch 'master' of ssh://184.154.0.242:7999/min/mineplex
This commit is contained in:
commit
0f9e72d623
@ -53,6 +53,7 @@ public class SneakyAssassins extends SoloGame
|
||||
|
||||
this.DamageTeamSelf = true;
|
||||
this.HungerSet = 20;
|
||||
this.PrepareFreeze = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -17,7 +17,7 @@ public class KitRevealer extends SneakyAssassinKit
|
||||
super(manager, "Revealer", KitAvailability.Blue,
|
||||
new String[]
|
||||
{
|
||||
"Carries two extra Smokebombs!"
|
||||
"Carries three Revealers which explode and reveal nearby assassins!"
|
||||
},
|
||||
new Perk[]
|
||||
{
|
||||
|
@ -63,10 +63,8 @@ public class NpcManager implements Listener
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
if (getGame().GetState() != Game.GameState.Live)
|
||||
return;
|
||||
|
||||
bustle();
|
||||
if (getGame().GetState() == Game.GameState.Live || getGame().GetState() == Game.GameState.Prepare)
|
||||
bustle();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -1,5 +1,6 @@
|
||||
package nautilus.game.arcade.game.games.sneakyassassins.powerups;
|
||||
|
||||
import mineplex.core.common.util.*;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.inventory.*;
|
||||
@ -39,15 +40,18 @@ public class ArmorPowerUp extends PowerUp
|
||||
@Override
|
||||
public boolean powerUpPlayer(Player player)
|
||||
{
|
||||
if (powerUpArmor(player) || powerUpArmor(player))
|
||||
{
|
||||
player.sendMessage("Your armor was upgraded!");
|
||||
boolean powerUp1 = powerUpArmor(player);
|
||||
boolean powerUp2 = powerUpArmor(player);
|
||||
|
||||
return true;
|
||||
if (powerUp1 || powerUp2)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Power-Up", "Your " + F.item("Armor") + " was upgraded."));
|
||||
|
||||
return super.powerUpPlayer(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendMessage("Your armor is already fully upgraded!");
|
||||
UtilPlayer.message(player, F.main("Power-Up", "Your " + F.item("Armor") + " is already fully upgraded!"));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.*;
|
||||
import org.bukkit.block.*;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.inventory.*;
|
||||
import org.bukkit.material.*;
|
||||
import org.bukkit.util.*;
|
||||
|
||||
public abstract class PowerUp
|
||||
@ -16,8 +17,7 @@ public abstract class PowerUp
|
||||
private final Location _location;
|
||||
private Location _effectLocation;
|
||||
private Block _beaconBlock;
|
||||
private BlockState _originalBeaconBlock;
|
||||
private BlockState[][] _originalBeaconBase = new BlockState[3][3];
|
||||
private BlockState[][][] _originalBeaconBlocks = new BlockState[3][2][3];
|
||||
private Item _item;
|
||||
|
||||
public PowerUp(PowerUpManager powerUpManager, PowerUpType powerUpType, Location location)
|
||||
@ -39,21 +39,28 @@ public abstract class PowerUp
|
||||
return _location;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void activate()
|
||||
{
|
||||
_beaconBlock = getLocation().getBlock().getRelative(BlockFace.DOWN);
|
||||
|
||||
_originalBeaconBlock = _beaconBlock.getState();
|
||||
_beaconBlock.setType(Material.BEACON);
|
||||
|
||||
for (int x = 0; x < 3; x++)
|
||||
{
|
||||
for (int z = 0; z < 3; z++)
|
||||
for (int y = 0; y < 2; y++)
|
||||
{
|
||||
Block beaconBaseBlock = _beaconBlock.getRelative(x-1, -1, z-1);
|
||||
for (int z = 0; z < 3; z++)
|
||||
{
|
||||
Block beaconBaseBlock = _beaconBlock.getRelative(x - 1, y - 1, z - 1);
|
||||
|
||||
_originalBeaconBase[x][z] = beaconBaseBlock.getState();
|
||||
beaconBaseBlock.setType(Material.IRON_BLOCK);
|
||||
_originalBeaconBlocks[x][y][z] = beaconBaseBlock.getState();
|
||||
|
||||
if (y == 0)
|
||||
beaconBaseBlock.setType(Material.IRON_BLOCK);
|
||||
else if (x == 1 && z == 1)
|
||||
beaconBaseBlock.setType(Material.BEACON);
|
||||
else
|
||||
beaconBaseBlock.setTypeIdAndData(Material.STAINED_GLASS.getId(), getPowerUpType().getDyeColor().getWoolData(), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -114,14 +121,18 @@ public abstract class PowerUp
|
||||
_item = null;
|
||||
}
|
||||
|
||||
_originalBeaconBlock.update(true, false);
|
||||
|
||||
for (int x = 0; x < _originalBeaconBase.length; x++)
|
||||
for (int z = 0; z < _originalBeaconBase[0].length; z++)
|
||||
_originalBeaconBase[x][z].update(true, false);
|
||||
for (int x = 0; x < _originalBeaconBlocks.length; x++)
|
||||
for (int y = 0; y < _originalBeaconBlocks[x].length; y++)
|
||||
for (int z = 0; z < _originalBeaconBlocks[x][y].length; z++)
|
||||
_originalBeaconBlocks[x][y][z].update(true, false);
|
||||
|
||||
getPowerUpManager().removePowerUp(this);
|
||||
}
|
||||
|
||||
public abstract boolean powerUpPlayer(Player player);
|
||||
public boolean powerUpPlayer(Player player)
|
||||
{
|
||||
player.playSound(player.getEyeLocation(), Sound.LEVEL_UP, 2f, 0.8f);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ public class PowerUpManager implements Listener
|
||||
if (_powerUpPickUpCooldown.get(event.getPlayer().getUniqueId()) == powerUp)
|
||||
_powerUpPickUpCooldown.remove(event.getPlayer().getUniqueId());
|
||||
}
|
||||
}, 2000);
|
||||
}, 40);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,13 +4,13 @@ import org.bukkit.*;
|
||||
|
||||
public enum PowerUpType
|
||||
{
|
||||
WEAPON(Material.DIAMOND_SWORD, Color.RED),
|
||||
ARMOR(Material.IRON_CHESTPLATE, Color.BLUE);
|
||||
WEAPON(Material.DIAMOND_SWORD, DyeColor.RED),
|
||||
ARMOR(Material.IRON_CHESTPLATE, DyeColor.BLUE);
|
||||
|
||||
private final Material _itemType;
|
||||
private final Color _color;
|
||||
private final DyeColor _color;
|
||||
|
||||
PowerUpType(Material type, Color color)
|
||||
PowerUpType(Material type, DyeColor color)
|
||||
{
|
||||
_itemType = type;
|
||||
_color = color;
|
||||
@ -22,6 +22,11 @@ public enum PowerUpType
|
||||
}
|
||||
|
||||
public Color getColor()
|
||||
{
|
||||
return getDyeColor().getColor();
|
||||
}
|
||||
|
||||
public DyeColor getDyeColor()
|
||||
{
|
||||
return _color;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package nautilus.game.arcade.game.games.sneakyassassins.powerups;
|
||||
|
||||
import mineplex.core.common.util.*;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.inventory.*;
|
||||
@ -30,16 +31,20 @@ public class WeaponPowerUp extends PowerUp
|
||||
|
||||
if (swordSlot != -1)
|
||||
{
|
||||
int newSwordType = Math.min(SWORD_PROGRESSION.size() - 1, swordType + 1);
|
||||
player.getInventory().setItem(swordSlot, new ItemStack(SWORD_PROGRESSION.get(newSwordType)));
|
||||
int newSwordType = swordType + 1;
|
||||
|
||||
player.sendMessage("You sword was upgraded!");
|
||||
if (newSwordType < SWORD_PROGRESSION.size())
|
||||
{
|
||||
player.getInventory().setItem(swordSlot, new ItemStack(SWORD_PROGRESSION.get(newSwordType)));
|
||||
|
||||
return true;
|
||||
UtilPlayer.message(player, F.main("Power-Up", "Your " + F.item("Sword") + " was upgraded."));
|
||||
|
||||
return super.powerUpPlayer(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
player.sendMessage("Your sword is already fully upgraded!");
|
||||
UtilPlayer.message(player, F.main("Power-Up", "Your " + F.item("Sword") + " is already fully upgraded!"));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -18,6 +18,14 @@ import java.util.*;
|
||||
|
||||
public class PerkRevealer extends Perk implements IThrown
|
||||
{
|
||||
private static final FireworkEffect REVEALER_FIREWORK_EFFECT = FireworkEffect
|
||||
.builder()
|
||||
.flicker(false)
|
||||
.withColor(Color.GREEN)
|
||||
.with(FireworkEffect.Type.BALL_LARGE)
|
||||
.trail(false)
|
||||
.build();
|
||||
|
||||
private static class RevealedPlayerInfo
|
||||
{
|
||||
public int _expirationSeconds = 5;
|
||||
@ -106,15 +114,11 @@ public class PerkRevealer extends Perk implements IThrown
|
||||
|
||||
private void explode(ProjectileUser data)
|
||||
{
|
||||
FireworkEffect effect = FireworkEffect
|
||||
.builder()
|
||||
.flicker(false)
|
||||
.withColor(Color.GREEN)
|
||||
.with(FireworkEffect.Type.BALL_LARGE)
|
||||
.trail(false)
|
||||
.build();
|
||||
// Workaround to make firework effect always visible
|
||||
for (int i = 0; i < 3; i++)
|
||||
UtilFirework.playFirework(data.GetThrown().getLocation(), REVEALER_FIREWORK_EFFECT);
|
||||
|
||||
UtilFirework.playFirework(data.GetThrown().getLocation(), effect);
|
||||
data.GetThrown().getLocation().getWorld().playSound(data.GetThrown().getLocation(), Sound.ZOMBIE_UNFECT, 2f, 0.5f);
|
||||
|
||||
for (Player player : Manager.GetGame().GetPlayers(true))
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
package nautilus.game.arcade.kit.perks;
|
||||
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
@ -53,7 +53,7 @@ public class PerkSmokebomb extends Perk
|
||||
return activatorTypes;
|
||||
}
|
||||
|
||||
public int geteffectDuration()
|
||||
public int getEffectDuration()
|
||||
{
|
||||
return effectDuration;
|
||||
}
|
||||
@ -94,18 +94,20 @@ public class PerkSmokebomb extends Perk
|
||||
//Manager.GetCondition().Factory().Vulnerable(GetName(), player, player, 6, 3, false, false, true);
|
||||
|
||||
//Blind
|
||||
for (Player other : UtilPlayer.getNearby(player.getLocation(), 6))
|
||||
for (Entity other : player.getNearbyEntities(6, 6, 6))
|
||||
{
|
||||
if (other.equals(player))
|
||||
if (other.equals(player) || !(other instanceof LivingEntity))
|
||||
continue;
|
||||
|
||||
LivingEntity living = (LivingEntity) other;
|
||||
|
||||
Manager.GetCondition().Factory().Blind(GetName(), other, player, geteffectDuration(), 0, false, false, true);
|
||||
Manager.GetCondition().Factory().Slow(GetName(), other, player, geteffectDuration(), 1, false, false, true, false);
|
||||
Manager.GetCondition().Factory().Blind(GetName(), living, player, getEffectDuration(), 0, false, false, true);
|
||||
Manager.GetCondition().Factory().Slow(GetName(), living, player, getEffectDuration(), 1, false, false, true, false);
|
||||
}
|
||||
|
||||
//Effects
|
||||
player.getWorld().playSound(player.getLocation(), Sound.FIZZ, 2f, 0.5f);
|
||||
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, player.getLocation(), 0f, 0f, 0f, 0, 1);
|
||||
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, player.getLocation(), 0f, 0f, 0f, 0, 1);
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
|
||||
|
Loading…
Reference in New Issue
Block a user