Paintball update!
This commit is contained in:
parent
24723cd5e5
commit
0cbefc1280
@ -474,7 +474,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
((CraftPlayer)player).getHandle().spectating = false;
|
||||
((CraftPlayer)player).getHandle().m = true;
|
||||
|
||||
GetCondition().EndCondition(player, ConditionType.CLOAK, "Spectator");
|
||||
GetCondition().EndCondition(player, ConditionType.CLOAK, null);
|
||||
|
||||
HubClock(player);
|
||||
|
||||
|
@ -366,7 +366,8 @@ public abstract class Game implements Listener
|
||||
}
|
||||
else
|
||||
{
|
||||
_scoreboard.registerNewTeam(rank.Name + "SPEC").setPrefix(rank.Color + C.Bold + rank.Name.toUpperCase() + ChatColor.RESET + " " + ChatColor.GRAY);
|
||||
_scoreboard.registerNewTeam(rank.Name + "SPEC").setPrefix(ChatColor.GRAY + "");
|
||||
//_scoreboard.registerNewTeam(rank.Name + "SPEC").setPrefix(rank.Color + C.Bold + rank.Name.toUpperCase() + ChatColor.RESET + " " + ChatColor.GRAY);
|
||||
}
|
||||
}
|
||||
|
||||
@ -381,7 +382,8 @@ public abstract class Game implements Listener
|
||||
}
|
||||
else
|
||||
{
|
||||
_scoreboard.registerNewTeam(rank.Name + team.GetName().toUpperCase()).setPrefix(rank.Color + C.Bold + rank.Name.toUpperCase() + ChatColor.RESET + " " + team.GetColor());
|
||||
//_scoreboard.registerNewTeam(rank.Name + team.GetName().toUpperCase()).setPrefix(rank.Color + C.Bold + rank.Name.toUpperCase() + ChatColor.RESET + " " + team.GetColor());
|
||||
_scoreboard.registerNewTeam(rank.Name + team.GetName().toUpperCase()).setPrefix(team.GetColor() + "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.entity.Snowball;
|
||||
import org.bukkit.entity.ThrownPotion;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
||||
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
@ -77,7 +78,6 @@ public class Paintball extends TeamGame
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
@EventHandler
|
||||
public void CustomTeamGeneration(GameStateChangeEvent event)
|
||||
{
|
||||
@ -90,21 +90,35 @@ public class Paintball extends TeamGame
|
||||
this.GetTeamList().get(1).SetColor(ChatColor.RED);
|
||||
this.GetTeamList().get(1).SetName("Nether");
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void ColorArmor(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.Prepare)
|
||||
return;
|
||||
|
||||
for (Player player : GetPlayers(true))
|
||||
{
|
||||
CleanColorArmor(player);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void RefreshPlayers(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.Live)
|
||||
return;
|
||||
|
||||
for (Player player : GetPlayers(true))
|
||||
{
|
||||
for (Player other : GetPlayers(true))
|
||||
{
|
||||
other.hidePlayer(player);
|
||||
other.showPlayer(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -164,9 +178,6 @@ public class Paintball extends TeamGame
|
||||
@EventHandler
|
||||
public void PaintballDamage(CustomDamageEvent event)
|
||||
{
|
||||
if (event.IsCancelled())
|
||||
return;
|
||||
|
||||
if (event.GetProjectile() == null)
|
||||
return;
|
||||
|
||||
@ -184,7 +195,16 @@ public class Paintball extends TeamGame
|
||||
|
||||
Player damager = event.GetDamagerPlayer(true);
|
||||
if (damager == null) return;
|
||||
|
||||
GameTeam damageeTeam = GetTeam(damagee);
|
||||
if (damageeTeam == null) return;
|
||||
|
||||
GameTeam damagerTeam = GetTeam(damager);
|
||||
if (damagerTeam == null) return;
|
||||
|
||||
if (damagerTeam.equals(damageeTeam))
|
||||
return;
|
||||
|
||||
//Color
|
||||
Color color = Color.RED;
|
||||
if (event.GetProjectile() instanceof Snowball)
|
||||
@ -201,21 +221,25 @@ public class Paintball extends TeamGame
|
||||
}
|
||||
|
||||
//Out
|
||||
if (Color(damagee, color, count))
|
||||
if (Color(damagee, count))
|
||||
{
|
||||
PlayerOut(damagee);
|
||||
Announce(GetTeam(damagee).GetColor() + damagee.getName() + ChatColor.RESET + " was painted by " +
|
||||
GetTeam(damager).GetColor() + damager.getName());
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
UtilPlayer.message(player, damageeTeam.GetColor() + damagee.getName() + ChatColor.RESET + " was painted by " +
|
||||
damagerTeam.GetColor() + damager.getName() + ChatColor.RESET + "!");
|
||||
|
||||
AddGems(damager, 2, "Kill", true);
|
||||
}
|
||||
|
||||
|
||||
//Hit Sound
|
||||
Player player = event.GetDamagerPlayer(true);
|
||||
if (player != null)
|
||||
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 1f, 3f);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public boolean Color(Player player, Color color, int amount)
|
||||
public boolean Color(Player player, int amount)
|
||||
{
|
||||
//Get Non-Coloured
|
||||
ArrayList<ItemStack> nonColored = new ArrayList<ItemStack>();
|
||||
@ -226,7 +250,7 @@ public class Paintball extends TeamGame
|
||||
|
||||
LeatherArmorMeta meta = (LeatherArmorMeta)stack.getItemMeta();
|
||||
|
||||
if (meta.getColor().equals(Color.WHITE))
|
||||
if (meta.getColor().equals(Color.RED) || meta.getColor().equals(Color.AQUA))
|
||||
nonColored.add(stack);
|
||||
}
|
||||
|
||||
@ -239,7 +263,7 @@ public class Paintball extends TeamGame
|
||||
ItemStack armor = nonColored.remove(UtilMath.r(nonColored.size()));
|
||||
|
||||
LeatherArmorMeta meta = (LeatherArmorMeta)armor.getItemMeta();
|
||||
meta.setColor(color);
|
||||
meta.setColor(Color.PURPLE);
|
||||
armor.setItemMeta(meta);
|
||||
}
|
||||
|
||||
@ -368,17 +392,13 @@ public class Paintball extends TeamGame
|
||||
player.setFlying(false);
|
||||
((CraftPlayer)player).getHandle().spectating = false;
|
||||
((CraftPlayer)player).getHandle().m = true;
|
||||
|
||||
//Items
|
||||
player.getInventory().remove(Material.WATCH);
|
||||
player.getInventory().remove(Material.COMPASS);
|
||||
|
||||
//Clean Armor
|
||||
for (ItemStack stack : player.getInventory().getArmorContents())
|
||||
{
|
||||
if (!(stack.getItemMeta() instanceof LeatherArmorMeta))
|
||||
continue;
|
||||
|
||||
LeatherArmorMeta meta = (LeatherArmorMeta)stack.getItemMeta();
|
||||
meta.setColor(Color.WHITE);
|
||||
stack.setItemMeta(meta);
|
||||
}
|
||||
CleanColorArmor(player);
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(player, F.main("Game", "You have been cleaned!"));
|
||||
@ -391,7 +411,8 @@ public class Paintball extends TeamGame
|
||||
public void run()
|
||||
{
|
||||
//Remove Invis
|
||||
Manager.GetCondition().EndCondition(player, ConditionType.CLOAK, null);
|
||||
if (IsAlive(player))
|
||||
Manager.GetCondition().EndCondition(player, ConditionType.CLOAK, null);
|
||||
|
||||
//Remove Copy
|
||||
copy.remove();
|
||||
@ -399,4 +420,21 @@ public class Paintball extends TeamGame
|
||||
}, 4);
|
||||
}
|
||||
}
|
||||
|
||||
public void CleanColorArmor(Player player)
|
||||
{
|
||||
Color color = Color.RED;
|
||||
if (Manager.GetColor(player) != ChatColor.RED)
|
||||
color = Color.AQUA;
|
||||
|
||||
for (ItemStack stack : player.getInventory().getArmorContents())
|
||||
{
|
||||
if (!(stack.getItemMeta() instanceof LeatherArmorMeta))
|
||||
continue;
|
||||
|
||||
LeatherArmorMeta meta = (LeatherArmorMeta)stack.getItemMeta();
|
||||
meta.setColor(color);
|
||||
stack.setItemMeta(meta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,8 @@ public class PlayerCopy
|
||||
|
||||
//Armor
|
||||
_ent.getEquipment().setArmorContents(owner.getInventory().getArmorContents());
|
||||
_ent.setCustomName(C.cWhite + C.Bold + "OUT " + ChatColor.RESET + host.GetTeam(owner).GetColor() + owner.getName());
|
||||
|
||||
_ent.setCustomName(C.cWhite + C.Bold + C.Scramble + "XX" + ChatColor.RESET + " " + host.GetTeam(owner).GetColor() + owner.getName() + " " + C.cWhite + C.Bold + C.Scramble + "XX");
|
||||
_ent.setCustomNameVisible(true);
|
||||
|
||||
//Disguise
|
||||
|
@ -34,7 +34,7 @@ public class KitRifle extends Kit
|
||||
},
|
||||
EntityType.ZOMBIE,
|
||||
new ItemStack(Material.IRON_BARDING));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void GiveItems(Player player)
|
||||
|
@ -1,5 +1,6 @@
|
||||
package nautilus.game.arcade.game.games.paintball.kits;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EntityType;
|
||||
@ -24,7 +25,7 @@ public class KitShotgun extends Kit
|
||||
new String[]
|
||||
{
|
||||
"Pump action paintball shotgun.",
|
||||
C.cGold + "4 Hit Kill"
|
||||
C.cGold + "8 Pellets, 4 Pellet Hits Kill"
|
||||
},
|
||||
|
||||
new Perk[]
|
||||
|
@ -44,7 +44,7 @@ public class PerkPaintballMachineGun extends Perk
|
||||
continue;
|
||||
|
||||
if (Recharge.Instance.usable(player, "Cool"))
|
||||
player.setExp((float)Math.max(0f, player.getExp() - 0.015f));
|
||||
player.setExp((float)Math.max(0f, player.getExp() - 0.020f));
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,6 +76,7 @@ public class PerkPaintballMachineGun extends Perk
|
||||
|
||||
ShootPaintball(player, team);
|
||||
|
||||
/*
|
||||
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable()
|
||||
{
|
||||
public void run()
|
||||
@ -83,6 +84,7 @@ public class PerkPaintballMachineGun extends Perk
|
||||
ShootPaintball(player, team);
|
||||
}
|
||||
}, 2);
|
||||
*/
|
||||
}
|
||||
|
||||
public void ShootPaintball(Player player, GameTeam team)
|
||||
@ -90,7 +92,7 @@ public class PerkPaintballMachineGun extends Perk
|
||||
//Energy
|
||||
if (player.getExp() >= 0.97)
|
||||
return;
|
||||
player.setExp((float) (player.getExp() + 0.03));
|
||||
player.setExp((float) (player.getExp() + 0.025));
|
||||
|
||||
//Shoot
|
||||
Vector rand = new Vector(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);
|
||||
@ -114,8 +116,7 @@ public class PerkPaintballMachineGun extends Perk
|
||||
//proj.setVelocity(player.getLocation().getDirection().multiply(1.6).add(rand));
|
||||
//proj.setShooter(player);
|
||||
|
||||
//Projectile proj = player.launchProjectile(EnderPearl.class);
|
||||
Projectile proj = player.launchProjectile(Snowball.class);
|
||||
Projectile proj = player.launchProjectile(EnderPearl.class);
|
||||
proj.setVelocity(proj.getVelocity().multiply(1.6).add(rand));
|
||||
|
||||
//Sound
|
||||
|
@ -75,8 +75,7 @@ public class PerkPaintballRifle extends Perk
|
||||
}
|
||||
else
|
||||
{
|
||||
//Projectile proj = player.launchProjectile(EnderPearl.class);
|
||||
Projectile proj = player.launchProjectile(Snowball.class);
|
||||
Projectile proj = player.launchProjectile(EnderPearl.class);
|
||||
proj.setVelocity(proj.getVelocity().multiply(2));
|
||||
|
||||
//Sound
|
||||
|
@ -68,7 +68,7 @@ public class PerkPaintballShotgun extends Perk
|
||||
if (!Recharge.Instance.use(player, GetName(), 1400, true))
|
||||
return;
|
||||
|
||||
for (int i=0 ; i<6 ; i++)
|
||||
for (int i=0 ; i<8 ; i++)
|
||||
{
|
||||
Vector rand = new Vector(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);
|
||||
rand.multiply(0.4);
|
||||
@ -83,8 +83,7 @@ public class PerkPaintballShotgun extends Perk
|
||||
}
|
||||
else
|
||||
{
|
||||
//Projectile proj = player.launchProjectile(EnderPearl.class);
|
||||
Projectile proj = player.launchProjectile(Snowball.class);
|
||||
Projectile proj = player.launchProjectile(EnderPearl.class);
|
||||
proj.setVelocity(proj.getVelocity().multiply(1).add(rand));
|
||||
|
||||
//Sound
|
||||
|
@ -97,6 +97,9 @@ public class GameGemManager implements Listener
|
||||
if (event.GetState() != PlayerState.OUT)
|
||||
return;
|
||||
|
||||
if (event.GetGame().GetType() == GameType.Paintball)
|
||||
return;
|
||||
|
||||
RewardGems(event.GetGame(), event.GetPlayer(), false);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user