Sneaky Assassins balance+polish

This commit is contained in:
Chiss 2014-08-10 21:05:41 +10:00
parent 06bcf5079b
commit d81b32bd3a
8 changed files with 132 additions and 76 deletions

View File

@ -29,8 +29,8 @@ public class SneakyAssassins extends SoloGame
static
{
SWORD_DAMAGE.put(Material.WOOD_SWORD, 3.0);
SWORD_DAMAGE.put(Material.STONE_SWORD, 4.0);
SWORD_DAMAGE.put(Material.WOOD_SWORD, 4.0);
SWORD_DAMAGE.put(Material.STONE_SWORD, 4.5);
SWORD_DAMAGE.put(Material.GOLD_SWORD, 5.0);
SWORD_DAMAGE.put(Material.IRON_SWORD, 6.0);
SWORD_DAMAGE.put(Material.DIAMOND_SWORD, 7.0);
@ -165,6 +165,7 @@ public class SneakyAssassins extends SoloGame
return;
player.setMaxHealth(player.getMaxHealth() + 2);
UtilPlayer.health(player, 2);
player.getInventory().addItem(SneakyAssassinKit.SMOKE_BOMB.clone());
}

View File

@ -19,7 +19,7 @@ public class KitAssassin extends SneakyAssassinKit
},
new Perk[]
{
new PerkSmokebomb(Material.INK_SACK, 4, true)
new PerkSmokebomb(Material.INK_SACK, 3, true)
},
new ItemStack(Material.BOW),
disguiseType);

View File

@ -18,7 +18,7 @@ public class KitEscapeArtist extends SneakyAssassinKit
},
new Perk[]
{
new PerkSmokebomb(Material.INK_SACK, 4, true)
new PerkSmokebomb(Material.INK_SACK, 3, true)
},
new ItemStack(Material.INK_SACK),
disguiseType);

View File

@ -21,7 +21,7 @@ public class KitRevealer extends SneakyAssassinKit
},
new Perk[]
{
new PerkSmokebomb(Material.INK_SACK, 4, true),
new PerkSmokebomb(Material.INK_SACK, 3, true),
new PerkRevealer()
},
new ItemStack(Material.INK_SACK),

View File

@ -40,10 +40,13 @@ public class ArmorPowerUp extends PowerUp
@Override
public boolean powerUpPlayer(Player player, Random random)
{
return powerUpArmor(player, random);
/*
boolean powerUp1 = powerUpArmor(player, random);
boolean powerUp2 = powerUpArmor(player, random);
return powerUp1 || powerUp2;
*/
}
public static boolean powerUpArmor(Player player, Random random)

View File

@ -1,12 +1,16 @@
package nautilus.game.arcade.game.games.sneakyassassins.powerups;
import mineplex.core.common.util.*;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.updater.*;
import mineplex.core.updater.event.*;
import org.bukkit.*;
import org.bukkit.block.*;
import org.bukkit.entity.*;
import org.bukkit.entity.Skeleton.SkeletonType;
import org.bukkit.inventory.*;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.util.*;
/**
@ -19,7 +23,7 @@ public class PowerUpItem
private Location _effectLocation;
private Block _beaconBlock;
private BlockState[][][] _originalBeaconBlocks = new BlockState[3][2][3];
private Item _item;
private Skeleton _npc;
public PowerUpItem(PowerUpManager powerUpManager, Location location)
{
@ -97,30 +101,54 @@ public class PowerUpItem
UtilFirework.playFirework(itemLocation, effect);
_item = itemLocation.getWorld().dropItem(itemLocation, new ItemStack(Material.CHEST));
_item.setVelocity(new Vector(0, 0.15, 0));
_powerUpManager.getGame().CreatureAllowOverride = true;
_npc = itemLocation.getWorld().spawn(itemLocation, Skeleton.class);
_powerUpManager.getGame().CreatureAllowOverride = false;
UtilEnt.Vegetate(_npc);
UtilEnt.ghost(_npc, true, false);
_npc.getEquipment().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
_npc.getEquipment().setItemInHand(new ItemStack(Material.DIAMOND_SWORD));
_npc.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999, 0, true));
_npc.setRemoveWhenFarAway(false);
//_npc.setSkeletonType(SkeletonType.WITHER);
_beaconBlock.setType(Material.GLASS);
}
}
}
public Item getItem()
public Skeleton getNPC()
{
return _item;
return _npc;
}
public void remove()
{
if (getItem() != null)
if (getNPC() != null)
{
getItem().remove();
_item = null;
getNPC().remove();
_npc = null;
}
getPowerUpManager().removePowerUp(this);
//Remove Beacon
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 void powerupParticles()
{
if (getNPC() == null)
return;
float x = (float) (Math.sin(getNPC().getTicksLived()/4d) * 1f);
float z = (float) (Math.cos(getNPC().getTicksLived()/4d) * 1f);
float y = (float) (Math.cos(getNPC().getTicksLived()/7d) * 1f + 1f);
UtilParticle.PlayParticle(ParticleType.HAPPY_VILLAGER, getNPC().getLocation().add(x, y, z), 0f, 0f, 0f, 0, 1);
}
}

View File

@ -3,6 +3,7 @@ package nautilus.game.arcade.game.games.sneakyassassins.powerups;
import mineplex.core.common.util.*;
import mineplex.core.updater.*;
import mineplex.core.updater.event.*;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.events.*;
import nautilus.game.arcade.game.*;
import nautilus.game.arcade.game.Game.*;
@ -142,59 +143,78 @@ public class PowerUpManager implements Listener
HandlerList.unregisterAll(this);
}
@EventHandler(ignoreCancelled = true)
public void onPowerUpDespawn(ItemDespawnEvent event)
{
if (getPowerUpByItem(event.getEntity()) != null)
event.setCancelled(true);
}
@EventHandler
public void onPlayerPickUpPowerUp(PlayerPickupItemEvent event)
public void onPowerUpProximity(UpdateEvent event)
{
if (!getGame().IsAlive(event.getPlayer()))
if (event.getType() != UpdateType.TICK)
return;
PowerUpItem powerUp = getPowerUpByItem(event.getItem());
if (powerUp == null)
return;
event.setCancelled(true);
int count = getPowerUpCount(event.getPlayer());
if (count <= 4)
Player closestPlayer = null;
double closestOffset = 0;
PowerUpItem powerUp = null;
//Pickup?
for (Player player : UtilServer.getPlayers())
{
powerUp.remove();
if (PowerUpType.SMOKE_BOMB.powerUpPlayer(event.getPlayer(), getRandom()))
UtilPlayer.message(event.getPlayer(), F.main("Power-Up", "+1 " + F.item("Smoke Bomb")));
if (count == 4)
if (!getGame().IsAlive(player))
continue;
for (PowerUpItem cur : _powerUps)
{
PowerUpType.COMPASS.powerUpPlayer(event.getPlayer(), getRandom());
UtilPlayer.message(event.getPlayer(), F.main("Game", "You now have a " + F.item("Compass") + " for tracking players"));
getGame().Announce(F.main("Game", F.name(C.Bold + event.getPlayer().getName()) + " has become a " + F.skill(C.Bold + "Master Assassin")));
for (Player player : UtilServer.getPlayers())
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 1f, 1f);
if (cur.getNPC() == null)
continue;
double offset = UtilMath.offset(player, cur.getNPC());
if (offset < 1 && (closestPlayer == null || offset < closestOffset))
{
closestPlayer = player;
closestOffset = offset;
powerUp = cur;
}
}
else
{
PowerUpType.WEAPON.powerUpPlayer(event.getPlayer(), getRandom());
PowerUpType.ARMOR.powerUpPlayer(event.getPlayer(), getRandom());
UtilPlayer.message(event.getPlayer(), F.main("Game", "Your " + F.item("Sword") + " and " + F.item("Armor") + " have been upgraded!"));
getGame().Announce(F.main("Game", F.name(event.getPlayer().getName()) + " collected a " + F.skill("Powerup") + "."));
}
incrementPowerUpCount(event.getPlayer());
}
//Collect
if (closestPlayer != null)
{
int count = getPowerUpCount(closestPlayer);
schedulePowerUpSpawn(10);
if (count <= 4)
{
powerUp.remove();
//Give Smoke Bomb
PowerUpType.SMOKE_BOMB.powerUpPlayer(closestPlayer, getRandom());
//Master
if (count == 4)
{
PowerUpType.COMPASS.powerUpPlayer(closestPlayer, getRandom());
UtilPlayer.message(closestPlayer, F.main("Game", "You now have a " + F.item("Compass") + " for tracking players"));
getGame().Announce(F.main("Game", F.name(C.Bold + closestPlayer.getName()) + " has become a " + F.skill(C.Bold + "Master Assassin")));
for (Player player : UtilServer.getPlayers())
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 1f, 1f);
}
//Armor + Weapon
else
{
PowerUpType.WEAPON.powerUpPlayer(closestPlayer, getRandom());
PowerUpType.ARMOR.powerUpPlayer(closestPlayer, getRandom());
UtilPlayer.message(closestPlayer, F.main("Game", "Your " + F.item("Sword") + " and " + F.item("Armor") + " have been upgraded!"));
getGame().Announce(F.main("Game", F.name(closestPlayer.getName()) + " collected a " + F.skill("Powerup") + "."));
}
incrementPowerUpCount(closestPlayer);
}
schedulePowerUpSpawn(10);
}
}
@EventHandler
@ -241,20 +261,6 @@ public class PowerUpManager implements Listener
}
}
public PowerUpItem getPowerUpByItem(Item item)
{
if (item == null)
return null;
for (PowerUpItem powerUp : getPowerUps())
{
if (powerUp.getItem() != null && powerUp.getItem().equals(item))
return powerUp;
}
return null;
}
public int getPowerUpCount(Player player)
{
Integer count = _powerUpCount.get(player.getUniqueId());
@ -270,4 +276,22 @@ public class PowerUpManager implements Listener
return count;
}
@EventHandler
public void cancelNpcDamage(CustomDamageEvent event)
{
if (event.GetDamageeEntity() instanceof Skeleton)
event.SetCancelled("NPC Cancel");
}
@EventHandler
public void playNpcParticles(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (PowerUpItem cur : _powerUps)
cur.powerupParticles();
}
}

View File

@ -93,7 +93,7 @@ public class PerkSmokebomb extends Perk
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
//Action
Manager.GetCondition().Factory().Cloak(GetName(), player, player, 2, false, false);
Manager.GetCondition().Factory().Cloak(GetName(), player, player, 1.2, false, false);
//Manager.GetCondition().Factory().Vulnerable(GetName(), player, player, 6, 3, false, false, true);
//Blind