Sneaky Assassins: Revealed players have wither effect. Fireworks are yellow. Additional announce messages

This commit is contained in:
CoderTim 2014-08-06 01:41:50 -04:00
parent 16353c4bc9
commit bea6eabb95
4 changed files with 34 additions and 11 deletions

View File

@ -19,6 +19,7 @@ import org.bukkit.event.*;
import org.bukkit.event.entity.*;
import org.bukkit.event.hanging.*;
import org.bukkit.event.player.*;
import org.bukkit.potion.*;
import java.util.*;
@ -232,7 +233,10 @@ public class SneakyAssassins extends SoloGame
for (Player player : Bukkit.getOnlinePlayers())
{
if (IsAlive(player))
{
Manager.GetDisguise().undisguise(player);
player.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, 80, 0));
}
}
this.Announce(C.cRed + C.Bold + "Players Revealed!");
@ -242,7 +246,10 @@ public class SneakyAssassins extends SoloGame
for (Player player : Bukkit.getOnlinePlayers())
{
if (IsAlive(player))
{
Manager.GetDisguise().disguise(DisguiseFactory.createDisguise(player, _disguiseType));
player.removePotionEffect(PotionEffectType.WITHER);
}
}
_revealCountdown = 60;
@ -284,6 +291,13 @@ public class SneakyAssassins extends SoloGame
event.setCancelled(true);
}
@EventHandler(ignoreCancelled = true)
public void onWitherEffectDamager(CustomDamageEvent event)
{
if (event.GetCause() == EntityDamageEvent.DamageCause.WITHER)
event.SetCancelled("Wither damage disabled");
}
public NpcManager getNpcManager()
{
return _npcManager;

View File

@ -59,7 +59,7 @@ public class PowerUpItem
else if (x == 1 && z == 1)
beaconBaseBlock.setType(Material.BEACON);
else
beaconBaseBlock.setTypeIdAndData(Material.STAINED_GLASS.getId(), DyeColor.GREEN.getWoolData(), false);
beaconBaseBlock.setTypeIdAndData(Material.STAINED_GLASS.getId(), DyeColor.YELLOW.getWoolData(), false);
}
}
}
@ -72,7 +72,7 @@ public class PowerUpItem
FireworkEffect effect = FireworkEffect
.builder()
.flicker(false)
.withColor(Color.LIME)
.withColor(Color.YELLOW)
.with(FireworkEffect.Type.BURST)
.trail(false)
.build();
@ -90,7 +90,7 @@ public class PowerUpItem
effect = FireworkEffect
.builder()
.flicker(false)
.withColor(Color.LIME)
.withColor(Color.YELLOW)
.with(FireworkEffect.Type.BALL_LARGE)
.trail(true)
.build();

View File

@ -75,6 +75,8 @@ public class PowerUpManager implements Listener
getPowerUps().add(powerUp);
powerUp.activate();
getGame().Announce("Power-up spawning...");
}
public List<PowerUpItem> getPowerUps()
@ -166,14 +168,7 @@ public class PowerUpManager implements Listener
if (PowerUpType.SMOKE_BOMB.powerUpPlayer(event.getPlayer(), getRandom()))
UtilPlayer.message(event.getPlayer(), F.main("Power-Up", "+1 " + F.item("Smoke Bomb")));
if (count < 5)
{
PowerUpType.WEAPON.powerUpPlayer(event.getPlayer(), getRandom());
PowerUpType.ARMOR.powerUpPlayer(event.getPlayer(), getRandom());
UtilPlayer.message(event.getPlayer(), F.main("Power-Up", "Your " + F.item("Sword") + " and " + F.item("Armor") + " have been upgraded"));
}
else if (count == 5)
if (count == 5)
{
PowerUpType.COMPASS.powerUpPlayer(event.getPlayer(), getRandom());
@ -181,6 +176,18 @@ public class PowerUpManager implements Listener
getGame().Announce(F.name(event.getPlayer().getName()) + " has become a " + F.skill("Master Assassin"));
}
else
{
if (count < 5)
{
PowerUpType.WEAPON.powerUpPlayer(event.getPlayer(), getRandom());
PowerUpType.ARMOR.powerUpPlayer(event.getPlayer(), getRandom());
UtilPlayer.message(event.getPlayer(), F.main("Power-Up", "Your " + F.item("Sword") + " and " + F.item("Armor") + " have been upgraded"));
}
getGame().Announce(F.name(event.getPlayer().getName()) + " collected a " + F.skill("Power-Up"));
}
schedulePowerUpSpawn(10);
}

View File

@ -13,6 +13,7 @@ import org.bukkit.entity.*;
import org.bukkit.event.*;
import org.bukkit.event.block.*;
import org.bukkit.event.player.*;
import org.bukkit.potion.*;
import java.util.*;
@ -135,6 +136,7 @@ public class PerkRevealer extends Perk implements IThrown
getRevealedPlayers().put(player, info);
Manager.GetDisguise().undisguise(player);
player.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, 100, 0));
}
info._expirationSeconds = 5;