Merge branch 'master' of ssh://dev1.mineplex.com:7999/min/master

Conflicts:
	Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java
This commit is contained in:
Jonathan Williams 2013-09-11 13:54:41 -07:00
commit a02b726303
50 changed files with 1485 additions and 133 deletions

View File

@ -103,6 +103,12 @@ public class PartyCommand extends CommandBase<PartyManager>
UtilPlayer.message(caller, F.main("Party", F.name(target.getName()) + " is already in the Party."));
caller.playSound(caller.getLocation(), Sound.NOTE_BASS, 1f, 1.5f);
}
//Decline
else if (party.GetInvitees().contains(target))
{
UtilPlayer.message(caller, F.main("Party", F.name(target.getName()) + " is already invited to the Party."));
caller.playSound(caller.getLocation(), Sound.NOTE_BASS, 1f, 1.5f);
}
//Invite
else if (party.GetLeader().equals(caller.getName()))
{

View File

@ -246,7 +246,7 @@ public class DamageManager extends MiniPlugin
//Knockback
double knockback = event.GetDamage();
if (knockback < 1) knockback = 1;
if (knockback < 2) knockback = 2;
knockback = Math.log10(knockback);
for (double cur : event.GetKnockback().values())
@ -435,6 +435,7 @@ public class DamageManager extends MiniPlugin
else
{
UtilEnt.PlayDamageSound(damagee);
return;
}
damagee.getWorld().playSound(damagee.getLocation(), sound, vol, pitch);

View File

@ -336,6 +336,12 @@ public class ArcadeManager extends MiniPlugin implements IRelation
if (_game == null || _game.GetState() == GameState.Recruit)
{
if (_game != null && _game.GetType() == GameType.UHC)
{
event.setMotd(ChatColor.RED + "UHC - Season 2");
return;
}
if (_game != null && _game.GetCountdown() != -1)
{
event.setMotd(ChatColor.GREEN + "Starting in " + _game.GetCountdown() + " Seconds" + extrainformation);

View File

@ -5,10 +5,12 @@ import java.util.HashMap;
import org.bukkit.ChatColor;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.games.barbarians.Barbarians;
import nautilus.game.arcade.game.games.bridge.Bridge;
import nautilus.game.arcade.game.games.castlesiege.CastleSiege;
import nautilus.game.arcade.game.games.deathtag.DeathTag;
import nautilus.game.arcade.game.games.dragonescape.DragonEscape;
import nautilus.game.arcade.game.games.dragons.Dragons;
import nautilus.game.arcade.game.games.escape.DragonEscape;
import nautilus.game.arcade.game.games.evolution.Evolution;
import nautilus.game.arcade.game.games.mineware.MineWare;
import nautilus.game.arcade.game.games.quiver.Quiver;
@ -31,12 +33,14 @@ public class GameFactory
public Game CreateGame(GameType gameType, HashMap<String, ChatColor> pastTeams)
{
if (gameType == GameType.Bridge) return new Bridge(_manager);
if (gameType == GameType.Barbarians) return new Barbarians(_manager);
else if (gameType == GameType.Bridge) return new Bridge(_manager);
else if (gameType == GameType.CastleSiege) return new CastleSiege(_manager, pastTeams);
else if (gameType == GameType.DeathTag) return new DeathTag(_manager);
else if (gameType == GameType.Dragons) return new Dragons(_manager);
else if (gameType == GameType.DragonEscape) return new DragonEscape(_manager);
else if (gameType == GameType.CastleSiege) return new CastleSiege(_manager, pastTeams);
else if (gameType == GameType.MineWare) return new MineWare(_manager);
else if (gameType == GameType.Evolution) return new Evolution(_manager);
else if (gameType == GameType.MineWare) return new MineWare(_manager);
else if (gameType == GameType.Quiver) return new Quiver(_manager);
else if (gameType == GameType.Runner) return new Runner(_manager);
else if (gameType == GameType.SnowFight) return new SnowFight(_manager);

View File

@ -3,19 +3,20 @@ package nautilus.game.arcade;
public enum GameType
{
//Mini
Barbarians("A Barbarians Life"),
Bridge("The Bridges"),
DeathTag("Death Tag"),
CastleSiege("Castle Siege"),
Dragons("Dragons"),
MineWare("MineWare"),
Horse("Horseback"),
Evolution("Evolution"),
Smash("Super Smash Mobs"),
Spleef("Super Spleef"),
DeathTag("Death Tag"),
DragonEscape("Dragon Escape"),
Dragons("Dragons"),
Evolution("Evolution"),
Horse("Horseback"),
MineWare("MineWare"),
Quiver("One in the Quiver"),
Runner("Runner"),
Smash("Super Smash Mobs"),
SnowFight("Snow Fight"),
Spleef("Super Spleef"),
TurfForts("Turf Forts"),
UHC("Ultra Hardcore"),
ZombieSurvival("Zombie Survival");

View File

@ -128,7 +128,7 @@ public abstract class Game implements Listener
public boolean PrivateBlocks = false;
public boolean DeathOut = true;
public boolean DeathDropItems = true;
public boolean DeathDropItems = false;
public boolean DeathMessages = true;
public boolean QuitOut = true;

View File

@ -0,0 +1,50 @@
package nautilus.game.arcade.game.games.barbarians;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.barbarians.kits.*;
import nautilus.game.arcade.kit.Kit;
public class Barbarians extends SoloGame
{
public Barbarians(ArcadeManager manager)
{
super(manager, GameType.Barbarians,
new Kit[]
{
new KitBrute(manager),
new KitArcher(manager),
new KitBomber(manager)
},
new String[]
{
"Free for all fight to the death!",
"Wooden blocks are breakable.",
"Last player alive wins!"
});
this.HungerSet = 20;
this.DamageTeamSelf = true;
this.BlockBreakAllow.add(5);
this.BlockBreakAllow.add(17);
this.BlockBreakAllow.add(18);
this.BlockBreakAllow.add(20);
this.BlockBreakAllow.add(30);
this.BlockBreakAllow.add(47);
this.BlockBreakAllow.add(53);
this.BlockBreakAllow.add(54);
this.BlockBreakAllow.add(58);
this.BlockBreakAllow.add(64);
this.BlockBreakAllow.add(83);
this.BlockBreakAllow.add(85);
this.BlockBreakAllow.add(96);
this.BlockBreakAllow.add(125);
this.BlockBreakAllow.add(126);
this.BlockBreakAllow.add(134);
this.BlockBreakAllow.add(135);
this.BlockBreakAllow.add(136);
}
}

View File

@ -0,0 +1,58 @@
package nautilus.game.arcade.game.games.barbarians.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkFletcher;
import nautilus.game.arcade.kit.perks.PerkRopedArrow;
public class KitArcher extends Kit
{
public KitArcher(ArcadeManager manager)
{
super(manager, "Barbarian Archer", KitAvailability.Green,
new String[]
{
"Uses some kind of less barbaric ranged weapon..."
},
new Perk[]
{
new PerkRopedArrow("Roped Arrow", 1, 6000),
new PerkFletcher(2, 2, true),
},
EntityType.PLAYER,
new ItemStack(Material.BOW));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET));
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE));
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS));
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS));
}
@Override
public void SpawnCustom(LivingEntity ent)
{
ent.getEquipment().setHelmet(new ItemStack(Material.CHAINMAIL_HELMET));
ent.getEquipment().setChestplate(new ItemStack(Material.CHAINMAIL_CHESTPLATE));
ent.getEquipment().setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS));
ent.getEquipment().setBoots(new ItemStack(Material.CHAINMAIL_BOOTS));
}
}

View File

@ -1,11 +1,12 @@
package nautilus.game.arcade.game.games.deathtag.kits;
package nautilus.game.arcade.game.games.barbarians.kits;
import org.bukkit.Material;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.F;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
@ -13,32 +14,35 @@ import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.*;
public class KitArcher extends Kit
public class KitBomber extends Kit
{
public KitArcher(ArcadeManager manager)
public KitBomber(ArcadeManager manager)
{
super(manager, "Archer", KitAvailability.Blue,
super(manager, "Bomber", KitAvailability.Blue,
new String[]
{
"BOWBOW"
"Crazy bomb throwing barbarian. BOOM!"
},
new Perk[]
{
new PerkFletcher(2, 8, true),
new PerkBarrage(5, 250, true)
new PerkBomber(8, 2, 30),
new PerkLeap("Leap", 1, 1, 8000)
},
EntityType.SKELETON,
new ItemStack(Material.BOW));
EntityType.ZOMBIE,
new ItemStack(Material.TNT));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.TNT, (byte)0, 1, F.item("Throwing TNT")));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET));
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE));
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS));

View File

@ -0,0 +1,56 @@
package nautilus.game.arcade.game.games.barbarians.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkBodySlam;
public class KitBrute extends Kit
{
public KitBrute(ArcadeManager manager)
{
super(manager, "Barbarian Brute", KitAvailability.Free,
new String[]
{
"A true barbarian, loves to kill people!"
},
new Perk[]
{
new PerkBodySlam()
},
EntityType.PLAYER,
new ItemStack(Material.IRON_AXE));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.IRON_HELMET));
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.IRON_CHESTPLATE));
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.IRON_LEGGINGS));
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.IRON_BOOTS));
}
@Override
public void SpawnCustom(LivingEntity ent)
{
ent.getEquipment().setHelmet(new ItemStack(Material.IRON_HELMET));
ent.getEquipment().setChestplate(new ItemStack(Material.IRON_CHESTPLATE));
ent.getEquipment().setLeggings(new ItemStack(Material.IRON_LEGGINGS));
ent.getEquipment().setBoots(new ItemStack(Material.IRON_BOOTS));
}
}

View File

@ -134,6 +134,8 @@ public class Bridge extends TeamGame implements OreObsfucation
this.WorldWaterDamage = 4;
this.CompassEnabled = true;
this.DeathDropItems = true;
}
@EventHandler

View File

@ -24,7 +24,7 @@ public class KitBomber extends Kit
new Perk[]
{
new PerkBomber(30, 2)
new PerkBomber(30, 2, -1)
},
EntityType.ZOMBIE,
new ItemStack(Material.TNT));

View File

@ -96,7 +96,6 @@ public class CastleSiege extends AsymTeamGame
this.HungerSet = 20;
this.DeathOut = false;
this.DeathDropItems = false;
this.WorldTimeSet = 14000; //14000
this.BlockPlaceAllow.add(85);

View File

@ -1,26 +1,313 @@
package nautilus.game.arcade.game.games.deathtag;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.deathtag.kits.*;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.NullKit;
public class DeathTag extends TeamGame
public class DeathTag extends SoloGame
{
private GameTeam _runners;
private GameTeam _chasers;
private NautHashMap<Player, Location> _deathLocation = new NautHashMap<Player, Location>();
private int _currentSpeed = -1;
public DeathTag(ArcadeManager manager)
{
super(manager, GameType.DeathTag,
new Kit[]
{
new KitArcher(manager),
new KitRunnerBasher(manager),
new KitRunnerArcher(manager),
new KitRunnerTraitor(manager),
new NullKit(manager),
new KitAlphaChaser(manager),
new KitChaser(manager),
},
new String[] {
"Tag opponents by killing then.",
"Revive tagged allies by standing near them.",
"Win by Tagging all opponents."
});
new String[]
{
"Run from the Undead!",
"If you die, you become Undead!",
"The last Runner alive wins!"
});
this.DeathOut = false;
this.HungerSet = 20;
this.CompassEnabled = true;
}
@Override
public void ParseData()
{
if (!WorldData.GetDataLocs("WHITE").isEmpty())
WorldHeightLimit = WorldData.GetDataLocs("WHITE").get(0).getBlockY();
}
@Override
public void RestrictKits()
{
for (Kit kit : GetKits())
{
for (GameTeam team : GetTeamList())
{
if (team.GetColor() == ChatColor.RED)
{
if (kit.GetName().contains("ZOMBIE"))
team.GetRestrictedKits().add(kit);
}
else
{
if (kit.GetName().contains("Chaser"))
team.GetRestrictedKits().add(kit);
}
}
}
}
@Override
@EventHandler
public void CustomTeamGeneration(GameStateChangeEvent event)
{
if (event.GetState() != GameState.Recruit)
return;
_runners = this.GetTeamList().get(0);
_runners.SetName("Runners");
//Undead Team
_chasers = new GameTeam("Chasers", ChatColor.RED, _runners.GetSpawns());
GetTeamList().add(_chasers);
RestrictKits();
}
@Override
public GameTeam ChooseTeam(Player player)
{
return _runners;
}
@EventHandler
public void UpdateSpeed(UpdateEvent event)
{
if (!IsLive())
return;
if (event.getType() != UpdateType.SLOW)
return;
double ratio = (double)_chasers.GetPlayers(false).size() / (double)GetPlayers(false).size();
if (_currentSpeed == -1 && ratio > 0.25)
{
Announce(C.cGreen + C.Bold + "Runners receive Speed I");
_currentSpeed = 0;
}
else if (_currentSpeed == -1 && ratio > 0.50)
{
Announce(C.cGreen + C.Bold + "Runners receive Speed II");
_currentSpeed = 1;
}
else if (_currentSpeed == -1 && ratio > 0.75)
{
Announce(C.cGreen + C.Bold + "Runners receive Speed III");
_currentSpeed = 2;
}
}
@EventHandler
public void ApplyConditions(UpdateEvent event)
{
if (!IsLive())
return;
if (event.getType() != UpdateType.FAST)
return;
if (_currentSpeed >= 0)
for (Player player : _runners.GetPlayers(false))
{
Manager.GetCondition().Factory().Speed("Runner", player, player, 1.9, _currentSpeed, false, false, true);
}
for (Player player : _chasers.GetPlayers(false))
{
Manager.GetCondition().Factory().Regen("Undying", player, player, 1.9, 4, false, false, false);
if (_currentSpeed < 0)
Manager.GetCondition().Factory().Speed("Haste", player, player, 1.9, 0, false, false, true);
}
}
@EventHandler
public void UpdateChasers(UpdateEvent event)
{
if (!IsLive())
return;
if (event.getType() != UpdateType.FAST)
return;
int req = 1 + _runners.GetPlayers(true).size()/20;
while (_chasers.GetPlayers(true).size() < req && _runners.GetPlayers(true).size() > 0)
{
Player player = _runners.GetPlayers(true).get(UtilMath.r(_runners.GetPlayers(true).size()));
SetChaser(player, true);
}
}
@EventHandler
public void PlayerDeath(PlayerDeathEvent event)
{
if (_runners.HasPlayer(event.getEntity()))
{
_deathLocation.put(event.getEntity(), event.getEntity().getLocation());
SetChaser(event.getEntity(), false);
}
}
public void SetChaser(Player player, boolean forced)
{
if (!GetPlaces().contains(player))
GetPlaces().add(0, player);
SetPlayerTeam(player, _chasers);
//Kit
Kit newKit = GetKits()[5]; //Normal
if (forced) newKit = GetKits()[4]; //Alpha
SetKit(player, newKit, false);
newKit.ApplyKit(player);
//Refresh
for (Player other : UtilServer.getPlayers())
{
other.hidePlayer(player);
other.showPlayer(player);
}
if (forced)
{
AddGems(player, 10, "Forced Chaser", false);
Announce(F.main("Game", F.elem(_runners.GetColor() + player.getName()) + " has become an " +
F.elem(_chasers.GetColor() + newKit.GetName()) + "."));
player.getWorld().strikeLightningEffect(player.getLocation());
}
UtilPlayer.message(player, C.cRed + C.Bold + "You are now a Chaser!");
}
@Override
public void RespawnPlayer(final Player player)
{
Manager.Clear(player);
if (_chasers.HasPlayer(player))
{
player.eject();
if (_deathLocation.containsKey(player))
player.teleport(_deathLocation.remove(player));
else
player.teleport(_chasers.GetSpawn());
}
//Re-Give Kit
Manager.GetPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable()
{
public void run()
{
GetKit(player).ApplyKit(player);
//Refresh on Spawn
for (Player other : UtilServer.getPlayers())
{
other.hidePlayer(player);
other.showPlayer(player);
}
}
}, 0);
}
@Override
public void EndCheck()
{
if (!IsLive())
return;
if (_runners.GetPlayers(true).size() <= 1)
{
if (_runners.GetPlayers(true).size() == 1)
GetPlaces().add(0, GetPlayers(true).get(0));
if (GetPlaces().size() >= 1)
AddGems(GetPlaces().get(0), 15, "1st Place", false);
if (GetPlaces().size() >= 2)
AddGems(GetPlaces().get(1), 10, "2nd Place", false);
if (GetPlaces().size() >= 3)
AddGems(GetPlaces().get(2), 5, "3rd Place", false);
for (Player player : GetPlayers(false))
if (player.isOnline())
AddGems(player, 10, "Participation", false);
SetState(GameState.End);
AnnounceEnd(GetPlaces());
}
}
@Override
@EventHandler
public void ScoreboardUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
if (_runners == null || _chasers == null)
return;
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(_runners.GetColor() + _runners.GetName())).setScore(_runners.GetPlayers(true).size());
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(_chasers.GetColor() + _chasers.GetName())).setScore(_chasers.GetPlayers(true).size());
}
@Override
public boolean CanJoinTeam(GameTeam team)
{
if (team.GetColor() == ChatColor.RED)
{
return team.GetSize() < 1 + UtilServer.getPlayers().length/8;
}
return true;
}
}

View File

@ -0,0 +1,53 @@
package nautilus.game.arcade.game.games.deathtag.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.entity.Skeleton.SkeletonType;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.disguise.disguises.DisguiseSkeleton;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.SmashKit;
import nautilus.game.arcade.kit.perks.PerkDamageSet;
import nautilus.game.arcade.kit.perks.PerkKnockbackMultiplier;
public class KitAlphaChaser extends SmashKit
{
public KitAlphaChaser(ArcadeManager manager)
{
super(manager, "Alpha Chaser", KitAvailability.Free,
new String[]
{
},
new Perk[]
{
new PerkDamageSet(6),
new PerkKnockbackMultiplier(0.5)
},
EntityType.SKELETON,
new ItemStack(Material.IRON_AXE));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
//Disguise
DisguiseSkeleton disguise = new DisguiseSkeleton(player);
disguise.SetName(C.cRed + player.getName());
disguise.SetCustomNameVisible(true);
disguise.hideArmor();
disguise.SetSkeletonType(SkeletonType.WITHER);
Manager.GetDisguise().disguise(disguise);
}
}

View File

@ -0,0 +1,47 @@
package nautilus.game.arcade.game.games.deathtag.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.disguise.disguises.DisguiseSkeleton;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.SmashKit;
import nautilus.game.arcade.kit.perks.PerkDamageSet;
public class KitChaser extends SmashKit
{
public KitChaser(ArcadeManager manager)
{
super(manager, "Chaser", KitAvailability.Hide,
new String[]
{
},
new Perk[]
{
new PerkDamageSet(4)
},
EntityType.SKELETON,
new ItemStack(Material.IRON_AXE));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
//Disguise
DisguiseSkeleton disguise = new DisguiseSkeleton(player);
disguise.SetName(C.cRed + player.getName());
disguise.SetCustomNameVisible(true);
disguise.hideArmor();
Manager.GetDisguise().disguise(disguise);
}
}

View File

@ -0,0 +1,40 @@
package nautilus.game.arcade.game.games.deathtag.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkFletcher;
import nautilus.game.arcade.kit.perks.PerkKnockbackArrow;
public class KitRunnerArcher extends Kit
{
public KitRunnerArcher(ArcadeManager manager)
{
super(manager, "Runner Archer", KitAvailability.Green,
new String[]
{
"Fight off the Chasers with Arrows!"
},
new Perk[]
{
new PerkKnockbackArrow(3),
new PerkFletcher(2, 2, true),
},
EntityType.ZOMBIE,
new ItemStack(Material.BOW));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
}
}

View File

@ -0,0 +1,38 @@
package nautilus.game.arcade.game.games.deathtag.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkCripple;
public class KitRunnerBasher extends Kit
{
public KitRunnerBasher(ArcadeManager manager)
{
super(manager, "Runner Basher", KitAvailability.Free,
new String[]
{
"Your attacks cripple Chasers breifly!"
},
new Perk[]
{
new PerkCripple(3, 2),
},
EntityType.ZOMBIE,
new ItemStack(Material.IRON_SWORD));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD));
}
}

View File

@ -0,0 +1,38 @@
package nautilus.game.arcade.game.games.deathtag.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkKnockback;
public class KitRunnerTraitor extends Kit
{
public KitRunnerTraitor(ArcadeManager manager)
{
super(manager, "Runner Traitor", KitAvailability.Blue,
new String[]
{
"You can deal knockback to other runners!"
},
new Perk[]
{
new PerkKnockback(0.8),
},
EntityType.ZOMBIE,
new ItemStack(Material.IRON_AXE));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
}
}

View File

@ -1,26 +1,36 @@
package nautilus.game.arcade.game.games.escape;
package nautilus.game.arcade.game.games.dragonescape;
import java.util.ArrayList;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Color;
import org.bukkit.FireworkEffect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.FireworkEffect.Type;
import org.bukkit.entity.EnderDragon;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.escape.kits.*;
import nautilus.game.arcade.game.games.dragonescape.kits.*;
import nautilus.game.arcade.kit.Kit;
public class DragonEscape extends SoloGame
@ -33,13 +43,17 @@ public class DragonEscape extends SoloGame
private DragonEscapeData _dragonData;
private Player _winner = null;
public DragonEscape(ArcadeManager manager)
{
super(manager, GameType.DragonEscape,
new Kit[]
{
new KitLeaper(manager)
new KitLeaper(manager),
new KitWarper(manager),
new KitDisruptor(manager)
},
new String[]
@ -124,6 +138,9 @@ public class DragonEscape extends SoloGame
if (event.getType() != UpdateType.FAST)
return;
if (!IsLive())
return;
if (_dragonData == null)
return;
@ -133,34 +150,53 @@ public class DragonEscape extends SoloGame
{
double playerScore = GetScore(player);
if (SetScore(player, playerScore))
return;
if (player.getLocation().getY() < 50)
player.damage(50);
if (dragonScore > playerScore)
{
player.damage(50);
}
else
{
SetScore(player, playerScore);
}
}
}
public void SetScore(Player player, double playerScore)
public boolean SetScore(Player player, double playerScore)
{
//Rank
for (DragonScore score : _ranks)
{
if (score.Player.equals(player))
{
//debug
int preNode = (int)(score.Score/10000);
int postNode = (int)(playerScore/10000);
//Shortcut
if (postNode - preNode >= 2)
{
score.Player.damage(500);
UtilPlayer.message(player, F.main("Game", "You were killed for trying to cheat!"));
return false;
}
//Finish
if (GetWaypointIndex(player.getLocation()) == _waypoints.size() - 1)
{
_winner = player;
this.SetCustomWinLine(player.getName() + " reached the end of the course!");
return true;
}
score.Score = playerScore;
return;
return false;
}
}
_ranks.add(new DragonScore(player, playerScore));
return false;
}
public double GetScore(Entity ent)
@ -245,7 +281,7 @@ public class DragonEscape extends SoloGame
_lastScoreboard.add(out);
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(out)).setScore(16-i);
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(out)).setScore((int)score.Score); //16-i
}
}
@ -284,12 +320,22 @@ public class DragonEscape extends SoloGame
if (!IsLive())
return;
if (GetPlayers(true).size() <= 0)
if (GetPlayers(true).size() <= 0 || _winner != null)
{
SortScores();
_places.clear();
for (DragonScore score : _ranks)
_places.add(score.Player);
//Announce
AnnounceEnd(_places);
//Gems
if (_winner != null)
AddGems(_winner, 10, "Course Complete", false);
if (_places.size() >= 1)
AddGems(_places.get(0), 20, "1st Place", false);
@ -308,4 +354,86 @@ public class DragonEscape extends SoloGame
}
}
@EventHandler
public void Warp(PlayerInteractEvent event)
{
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK &&
event.getAction() != Action.LEFT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_AIR)
return;
Player player = event.getPlayer();
if (!UtilInv.IsItem(player.getItemInHand(), Material.ENDER_PEARL, (byte)0))
return;
event.setCancelled(true);
SortScores();
Player target = null;
boolean self = false;
for (int i=_ranks.size()-1 ; i>=0 ; i--)
{
DragonScore score = _ranks.get(i);
if (score.Player.equals(player))
{
self = true;
}
else if (self)
{
if (IsAlive(score.Player))
{
target = score.Player;
}
}
}
if (target != null)
{
UtilInv.remove(player, Material.ENDER_PEARL, (byte)0, 1);
UtilInv.Update(player);
//Firework
FireworkEffect effect = FireworkEffect.builder().flicker(false).withColor(Color.BLACK).with(Type.BALL).trail(false).build();
try
{
Manager.GetFirework().playFirework(player.getEyeLocation(), effect);
player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_UNFECT, 2f, 2f);
}
catch (Exception e)
{
e.printStackTrace();
}
//Teleport
player.teleport(target.getLocation().add(0, 0.5, 0));
player.setVelocity(new Vector(0,0,0));
player.setFallDistance(0);
//Inform
UtilPlayer.message(player, F.main("Game", "You warped to " + F.name(target.getName()) + "!"));
//Effect
player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_UNFECT, 1f, 1f);
//Firework
try
{
Manager.GetFirework().playFirework(player.getEyeLocation(), effect);
player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_UNFECT, 2f, 2f);
}
catch (Exception e)
{
e.printStackTrace();
}
}
else
{
UtilPlayer.message(player, F.main("Game", "There is no one infront of you!"));
}
}
}

View File

@ -1,4 +1,4 @@
package nautilus.game.arcade.game.games.escape;
package nautilus.game.arcade.game.games.dragonescape;
import mineplex.core.common.util.UtilAlg;
@ -39,7 +39,7 @@ public class DragonEscapeData
Turn();
double timeSpeed = 0.16 + (System.currentTimeMillis() - Host.GetStateTime())/3000000d;
System.out.println(timeSpeed);
//System.out.println(timeSpeed);
Location.add(Velocity.clone().multiply(timeSpeed));
Location.add(0, -Pitch, 0);

View File

@ -1,4 +1,4 @@
package nautilus.game.arcade.game.games.escape;
package nautilus.game.arcade.game.games.dragonescape;
import org.bukkit.entity.Player;

View File

@ -0,0 +1,44 @@
package nautilus.game.arcade.game.games.dragonescape.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.F;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.*;
public class KitDisruptor extends Kit
{
public KitDisruptor(ArcadeManager manager)
{
super(manager, "Disruptor", KitAvailability.Blue,
new String[]
{
"Place mini-explosives to stop other players!"
},
new Perk[]
{
new PerkLeap("Leap", 1, 1, 8000, 2),
new PerkDisruptor(8, 2)
},
EntityType.ZOMBIE,
new ItemStack(Material.TNT));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.TNT, (byte)0, 1, F.item("Disruptor")));
player.setExp(0.99f);
}
}

View File

@ -1,4 +1,4 @@
package nautilus.game.arcade.game.games.escape.kits;
package nautilus.game.arcade.game.games.dragonescape.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
@ -20,21 +20,22 @@ public class KitLeaper extends Kit
new String[]
{
"Leap to avoid falling to your death!"
"You get twice as many leaps!"
},
new Perk[]
{
new PerkLeap("Leap", 1.2, 1.2, 8000)
new PerkLeap("Leap", 1, 1, 8000, 4)
},
EntityType.ZOMBIE,
new ItemStack(Material.STONE_AXE));
new ItemStack(Material.IRON_AXE));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.STONE_AXE));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
player.setExp(0.99f);
}
}

View File

@ -0,0 +1,43 @@
package nautilus.game.arcade.game.games.dragonescape.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.*;
public class KitWarper extends Kit
{
public KitWarper(ArcadeManager manager)
{
super(manager, "Warper", KitAvailability.Green,
new String[]
{
"Use your Enderpearl to instantlyy warp",
"to the player in front of you!"
},
new Perk[]
{
new PerkLeap("Leap", 1, 1, 8000, 2)
},
EntityType.ZOMBIE,
new ItemStack(Material.ENDER_PEARL));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.ENDER_PEARL));
player.setExp(0.99f);
}
}

View File

@ -62,7 +62,6 @@ public class Dragons extends SoloGame
this.DamagePvP = false;
this.HungerSet = 20;
this.WorldWaterDamage = 4;
this.DeathDropItems = false;
}
@Override

View File

@ -27,7 +27,7 @@ public class KitCoward extends Kit
new Perk[]
{
new PerkLeap("Leap", 1.2, 1.0, 8000),
new PerkSpeed(0)
new PerkKnockback(0.3)
},
EntityType.ZOMBIE,
new ItemStack(Material.IRON_AXE));

View File

@ -11,8 +11,8 @@ import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkBarrage;
import nautilus.game.arcade.kit.perks.PerkFletcher;
import nautilus.game.arcade.kit.perks.PerkKnockback;
public class KitMarksman extends Kit
{
@ -25,8 +25,8 @@ public class KitMarksman extends Kit
},
new Perk[]
{
new PerkBarrage(5, 250, true),
new PerkFletcher(4, 4, true),
new PerkKnockback(0.3),
},
EntityType.ZOMBIE,
new ItemStack(Material.BOW));

View File

@ -26,7 +26,8 @@ public class KitPyrotechnic extends Kit
new Perk[]
{
new PerkSparkler(20, 2)
new PerkSparkler(20, 2),
new PerkKnockback(0.3)
},
EntityType.ZOMBIE,
new ItemStack(Material.EMERALD));

View File

@ -73,7 +73,6 @@ public class Evolution extends SoloGame
this.HungerSet = 20;
this.DeathOut = false;
this.DeathDropItems = false;
this.PrepareFreeze = false;

View File

@ -27,14 +27,14 @@ public class Horse extends AsymTeamGame
new String[]
{
"Riders must charge the ruins",
"Archers must defend the ruins",
"Last team alive wins!",
"Horsemen must charge the ruins",
"Horsemen win if they rid the ruins of Undead.",
"",
"Undead must defend the ruins",
"Undead win when all Horsemen are dead.",
"",
"Teams swap after game is over"
}, pastTeams);
DeathDropItems = false;
}
@Override

View File

@ -77,7 +77,6 @@ public class MineWare extends SoloGame
this.PrepareFreeze = false;
this.DamagePvP = false;
this.DeathDropItems = false;
this.BlockPlace = true;
this.BlockBreak = true;

View File

@ -63,7 +63,6 @@ public class Quiver extends SoloGame
});
this.HungerSet = 20;
this.DeathDropItems = false;
this.DeathOut = false;
this.DamageSelf = false;
this.DamageTeamSelf = true;

View File

@ -71,8 +71,6 @@ public class SuperSmash extends SoloGame
this.DeathOut = false;
this.DeathDropItems = false;
this.DamageTeamSelf = true;
this.HungerSet = 20;

View File

@ -11,9 +11,13 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.SoloGame;
@ -38,12 +42,11 @@ public class Spleef extends SoloGame
new String[]
{
"Punch blocks to break them!",
"Some blocks take multiple hits.",
"1 Hunger per block smashed!",
"Last player alive wins!"
});
this.DamagePvP = false;
this.HungerSet = 20;
this.WorldWaterDamage = 4;
this.PrepareFreeze = false;
@ -129,7 +132,9 @@ public class Spleef extends SoloGame
public void BlockFade(Block block, Player player)
{
this.AddGems(player, 0.02, "Spleef Blocks Broken", true);
this.AddGems(player, 0.015, "Spleef Blocks Broken", true);
UtilPlayer.hunger(player, 1);
//Wool and Stained Clay
if (block.getTypeId() == 35 || block.getTypeId() == 159)
@ -193,4 +198,26 @@ public class Spleef extends SoloGame
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getTypeId());
block.setTypeId(0);
}
@EventHandler
public void DamageUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
if (!IsLive())
return;
for (Player player : GetPlayers(true))
{
if (player.getFoodLevel() <= 0)
{
Manager.GetDamage().NewDamageEvent(player, null, null,
DamageCause.STARVATION, 1, false, true, false,
"Starvation", GetName());
}
UtilPlayer.hunger(player, -1);
}
}
}

View File

@ -18,6 +18,7 @@ import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
@ -91,7 +92,6 @@ public class TurfForts extends TeamGame
this.HungerSet = 20;
this.DeathOut = false;
this.DeathDropItems = false;
this.BlockPlaceAllow.add(35);
this.BlockBreakAllow.add(35);
this.ItemDrop = false;
@ -334,9 +334,6 @@ public class TurfForts extends TeamGame
@EventHandler
public void Damage(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (!_fight)
{
event.SetCancelled("Build Time");
@ -345,13 +342,19 @@ public class TurfForts extends TeamGame
Player damager = event.GetDamagerPlayer(true);
if (damager == null) return;
event.AddMod("Turf Forts", "Nullify", -event.GetDamageInitial(), false);
if (event.GetCause() == DamageCause.PROJECTILE)
{
event.AddMod("Turf Forts", "Nullify", -event.GetDamageInitial(), false);
if (GetKit(damager).GetName().contains("Shredder"))
{
event.AddMod("Turf Forts", "One Hit Kill", 15, false);
event.SetCancelled("Shredder");
Manager.GetDamage().NewDamageEvent(event.GetDamageeEntity(), damager, null,
DamageCause.CUSTOM, 6, true, true, false,
damager.getName(), "Barrage");
return;
}
else
{
@ -360,6 +363,8 @@ public class TurfForts extends TeamGame
}
else if (event.GetCause() == DamageCause.ENTITY_ATTACK)
{
event.AddMod("Turf Forts", "Nullify", -event.GetDamageInitial(), false);
if (UtilGear.isMat(damager.getItemInHand(), Material.IRON_SWORD))
{
event.AddMod("Turf Forts", "One Hit Kill", 12, false);
@ -488,6 +493,12 @@ public class TurfForts extends TeamGame
//return Math.min(5, 1 + (int)((System.currentTimeMillis() - GetStateTime() - 30000) / 60000));
}
@EventHandler
public void PlayerDeath(PlayerDeathEvent event)
{
_enemyTurf.remove(event.getEntity());
}
@EventHandler
public void Territory(UpdateEvent event)
{

View File

@ -108,6 +108,8 @@ public class UHC extends TeamGame
this.DamageSelf = true;
this.DamageTeamSelf = true;
this.DeathDropItems = true;
this.ItemDrop = true;
this.ItemPickup = true;
@ -194,13 +196,13 @@ public class UHC extends TeamGame
}
else if (_gameMinutes == 20)
{
Announce(ChatColor.WHITE + C.Bold + "PvP enabled!");
Announce(ChatColor.WHITE + C.Bold + "PvP enabled! 20 minutes have passed.");
for (Player player : UtilServer.getPlayers())
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 2f, 1f);
this.DamagePvP = true;
}
else if (_gameMinutes % 20 == 20)
else if (_gameMinutes % 20 == 0)
{
Announce(ChatColor.WHITE + C.Bold + _gameMinutes + " minutes have passed.");
}
@ -212,6 +214,8 @@ public class UHC extends TeamGame
if (event.GetState() != GameState.Prepare)
return;
WorldData.World.setTime(2000);
//Kill Mobs
for (Entity ent : WorldData.World.getEntities())
{
@ -229,6 +233,9 @@ public class UHC extends TeamGame
{
Manager.GetCondition().Factory().Blind("Start Blind", player, player, 8, 1, false, false, false);
Manager.GetCondition().Factory().Slow("Start Slow", player, player, 8, 4, false, false, false, false);
player.setSaturation(0f);
player.setExhaustion(0f);
}
}
@ -247,17 +254,17 @@ public class UHC extends TeamGame
//Allowed
if (
event.getTo().getX() <= 1000 &&
event.getTo().getX() >= -1000 &&
event.getTo().getZ() <= 1000 &&
event.getTo().getZ() >= -1000)
event.getTo().getX() <= 999.5 &&
event.getTo().getX() >= -999.5 &&
event.getTo().getZ() <= 999.5 &&
event.getTo().getZ() >= -999.5)
return;
Location from = event.getFrom();
if (from.getX() > 1000) from.setX(1000);
if (from.getX() < -1000) from.setX(-1000);
if (from.getZ() > 1000) from.setZ(1000);
if (from.getZ() < -1000) from.setZ(-1000);
if (from.getX() > 999.5) from.setX(999.5);
if (from.getX() < -999.5) from.setX(-999.5);
if (from.getZ() > 999.5) from.setZ(999.5);
if (from.getZ() < -999.5) from.setZ(-999.5);
event.setTo(event.getFrom());
@ -304,8 +311,8 @@ public class UHC extends TeamGame
block.getZ() >= -1000)
continue;
if (block.getTypeId() != 0)
MapUtil.QuickChangeBlockAt(block.getLocation(), 159, (byte)4);
if (block.getTypeId() != 0 || block.getY() <= 128)
MapUtil.QuickChangeBlockAt(block.getLocation(), 159, (byte)14);
}
}
@ -315,10 +322,10 @@ public class UHC extends TeamGame
Block block = event.getBlock();
if (
block.getX() <= 1000 &&
block.getX() >= -1000 &&
block.getZ() <= 1000 &&
block.getZ() >= -1000)
block.getX() < 1000 &&
block.getX() > -1000 &&
block.getZ() < 1000 &&
block.getZ() > -1000)
return;
event.setCancelled(true);
@ -1065,6 +1072,39 @@ public class UHC extends TeamGame
}
}
@Override
public void AnnounceEnd(GameTeam team)
{
for (Player player : UtilServer.getPlayers())
{
player.playSound(player.getLocation(), Sound.LEVEL_UP, 2f, 1f);
UtilPlayer.message(player, "");
UtilPlayer.message(player, ArcadeFormat.Line);
UtilPlayer.message(player, C.cYellow+ C.Bold + this.GetName());
UtilPlayer.message(player, "");
UtilPlayer.message(player, "");
if (team != null)
{
WinnerTeam = team;
Winner = team.GetName() + " Team";
UtilPlayer.message(player, team.GetColor() + C.Bold + "Team " + team.GetName() + " won the match!");
}
else
{
UtilPlayer.message(player, ChatColor.WHITE + "§lNobody won the game...");
}
UtilPlayer.message(player, "");
UtilPlayer.message(player, "");
UtilPlayer.message(player, C.cWhite + "Created and Hosted by " + C.cYellow + C.Bold + "Mineplex.com");
UtilPlayer.message(player, ArcadeFormat.Line);
}
}
@Override
public boolean AdvertiseText(GameLobbyManager gameLobbyManager, int _advertiseStage)
{

View File

@ -65,7 +65,6 @@ public class ZombieSurvival extends SoloGame
});
this.DeathOut = false;
this.DeathDropItems = false;
this.HungerSet = 20;
}

View File

@ -111,6 +111,7 @@ public abstract class Kit implements Listener
if (type == EntityType.PLAYER)
type = EntityType.ZOMBIE;
LivingEntity entity = (LivingEntity) Manager.GetCreature().SpawnEntity(loc, type);
entity.setRemoveWhenFarAway(false);
@ -118,7 +119,7 @@ public abstract class Kit implements Listener
entity.setCustomNameVisible(true);
entity.getEquipment().setItemInHand(_itemInHand);
if (type == EntityType.SKELETON && GetName().contains("Wither"))
if (type == EntityType.SKELETON && (GetName().contains("Wither") || GetName().contains("Alpha")))
{
Skeleton skel = (Skeleton)entity;
skel.setSkeletonType(SkeletonType.WITHER);

View File

@ -40,7 +40,7 @@ public class PerkBlink extends Perk
}
@EventHandler
public void Leap(PlayerInteractEvent event)
public void Blink(PlayerInteractEvent event)
{
if (event.isCancelled())
return;

View File

@ -0,0 +1,136 @@
package nautilus.game.arcade.kit.perks;
import java.util.HashMap;
import org.bukkit.GameMode;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.Perk;
public class PerkBodySlam extends Perk
{
private HashMap<LivingEntity, Long> _live = new HashMap<LivingEntity, Long>();
public PerkBodySlam()
{
super("Body Slam", new String[]
{
C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Body Slam"
});
}
@EventHandler
public void Leap(PlayerInteractEvent event)
{
if (event.isCancelled())
return;
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
return;
if (UtilBlock.usable(event.getClickedBlock()))
return;
if (event.getPlayer().getItemInHand() == null)
return;
if (!event.getPlayer().getItemInHand().getType().toString().contains("_AXE"))
return;
Player player = event.getPlayer();
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, GetName(), 8000, true))
return;
UtilAction.velocity(player, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 1.2, true);
//Record
_live.put(player, System.currentTimeMillis());
//Inform
UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + "."));
}
@EventHandler
public void End(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
//Collide
for (Player player : Manager.GetGame().GetPlayers(true))
if (_live.containsKey(player))
for (Player other : Manager.GetGame().GetPlayers(true))
if (other.getGameMode() == GameMode.SURVIVAL)
if (!other.equals(player))
if (UtilMath.offset(player, other) < 2)
{
DoSlam(player, other);
_live.remove(player);
return;
}
//End
for (Player player : Manager.GetGame().GetPlayers(true))
{
if (!UtilEnt.isGrounded(player))
continue;
if (!_live.containsKey(player))
continue;
if (!UtilTime.elapsed(_live.get(player), 1000))
continue;
_live.remove(player);
}
}
public void DoSlam(Player damager, LivingEntity damagee)
{
int damage = 8;
//Damage Event
Manager.GetDamage().NewDamageEvent(damager, damagee, null,
DamageCause.CUSTOM, damage/3d, true, true, false,
damager.getName(), GetName() + " Recoil");
//Damage Event
Manager.GetDamage().NewDamageEvent(damagee, damager, null,
DamageCause.CUSTOM, damage, true, true, false,
damager.getName(), GetName());
//Inform
UtilPlayer.message(damager, F.main("Game", "You hit " + F.name(UtilEnt.getName(damagee)) + " with " + F.skill(GetName()) + "."));
UtilPlayer.message(damagee, F.main("Game", F.name(damager.getName()) + " hit you with " + F.skill(GetName()) + "."));
}
@EventHandler
public void Knockback(CustomDamageEvent event)
{
if (event.GetReason() == null || !event.GetReason().contains(GetName()))
return;
event.AddKnockback(GetName(), 2);
}
}

View File

@ -34,8 +34,9 @@ public class PerkBomber extends Perk
private int _spawnRate;
private int _max;
private int _fuse;
public PerkBomber(int spawnRate, int max)
public PerkBomber(int spawnRate, int max, int fuse)
{
super("Bomber", new String[]
{
@ -45,6 +46,7 @@ public class PerkBomber extends Perk
_spawnRate = spawnRate;
_max = max;
_fuse = fuse;
}
public void Apply(Player player)
@ -136,6 +138,9 @@ public class PerkBomber extends Perk
TNTPrimed tnt = player.getWorld().spawn(player.getEyeLocation().add(player.getLocation().getDirection()), TNTPrimed.class);
if (_fuse != -1)
tnt.setFuseTicks(_fuse);
UtilAction.velocity(tnt, player.getLocation().getDirection(), 0.5, false, 0, 0.1, 10, false);
_tntMap.put(tnt, player);

View File

@ -0,0 +1,50 @@
package nautilus.game.arcade.kit.perks;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.common.util.C;
import nautilus.game.arcade.kit.Perk;
public class PerkCripple extends Perk
{
private int _power;
private double _time;
public PerkCripple(int power, double time)
{
super("Knockback", new String[]
{
C.cGray + "Attacks give Slow " + power + " for " + time + " seconds.",
});
_power = power;
_time = time;
}
@EventHandler(priority = EventPriority.HIGH)
public void Knockback(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetCause() != DamageCause.ENTITY_ATTACK)
return;
Player damager = event.GetDamagerPlayer(false);
if (damager == null) return;
if (!Kit.HasKit(damager))
return;
if (!Manager.IsAlive(damager))
return;
event.SetKnockback(false);
Manager.GetCondition().Factory().Slow("Cripple", event.GetDamageeEntity(), damager, _time, _power, false, false, false, false);
}
}

View File

@ -0,0 +1,130 @@
package nautilus.game.arcade.kit.perks;
import java.util.HashMap;
import org.bukkit.EntityEffect;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilServer;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import nautilus.game.arcade.kit.Perk;
public class PerkDisruptor extends Perk
{
private HashMap<Entity, Player> _tntMap = new HashMap<Entity, Player>();
private int _spawnRate;
private int _max;
public PerkDisruptor(int spawnRate, int max)
{
super("Bomber", new String[]
{
C.cGray + "Receive 1 Disruptor every " + spawnRate + " seconds. Maximum of " + max + ".",
C.cYellow + "Click" + C.cGray + " with TNT to " + C.cGreen + "Place Disruptor"
});
_spawnRate = spawnRate;
_max = max;
}
public void Apply(Player player)
{
Recharge.Instance.use(player, GetName(), _spawnRate*1000, false);
}
@EventHandler
public void Spawn(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
for (Player cur : UtilServer.getPlayers())
{
if (!Kit.HasKit(cur))
continue;
if (!Manager.GetGame().IsAlive(cur))
continue;
if (!Recharge.Instance.use(cur, GetName(), _spawnRate*1000, false))
continue;
if (UtilInv.contains(cur, Material.TNT, (byte)0, _max))
continue;
//Add
cur.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.TNT, (byte)0, 1, F.item("Disruptor")));
cur.playSound(cur.getLocation(), Sound.ITEM_PICKUP, 2f, 1f);
}
}
@EventHandler
public void Place(PlayerInteractEvent event)
{
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK &&
event.getAction() != Action.LEFT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_AIR)
return;
Player player = event.getPlayer();
if (!UtilInv.IsItem(player.getItemInHand(), Material.TNT, (byte)0))
return;
if (!Kit.HasKit(player))
return;
event.setCancelled(true);
UtilInv.remove(player, Material.TNT, (byte)0, 1);
UtilInv.Update(player);
Item item = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.TNT));
item.setVelocity(new Vector(0,0,0));
_tntMap.put(item, player);
}
@EventHandler
public void Explode(PlayerPickupItemEvent event)
{
if (!_tntMap.containsKey(event.getItem()))
return;
event.setCancelled(true);
if (event.getItem().getTicksLived() < 40)
return;
if (UtilMath.offset(event.getItem(), event.getPlayer()) > 2)
return;
//Dont Hit Self
if (event.getPlayer().equals(_tntMap.get(event.getItem())))
return;
_tntMap.remove(event.getItem());
event.getItem().remove();
event.getPlayer().setVelocity(new Vector(0,0.3,0));
event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.EXPLODE, 1f, 2f);
event.getPlayer().playEffect(EntityEffect.HURT);
}
}

View File

@ -10,6 +10,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilPlayer;
@ -24,6 +25,9 @@ public class PerkLeap extends Perk
private double _power;
private double _heightMax;
private long _recharge;
private int _maxUses;
private NautHashMap<String, Integer> _uses = new NautHashMap<String, Integer>();
public PerkLeap(String name, double power, double heightLimit, long recharge)
{
@ -36,6 +40,21 @@ public class PerkLeap extends Perk
_power = power;
_heightMax = heightLimit;
_recharge = recharge;
_maxUses = 0;
}
public PerkLeap(String name, double power, double heightLimit, long recharge, int uses)
{
super("Leaper", new String[]
{
C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + name + C.cGray + " (" + C.cWhite + uses + " Charges" + C.cGray + ")"
});
_name = name;
_power = power;
_heightMax = heightLimit;
_recharge = recharge;
_maxUses = uses;
}
@EventHandler
@ -61,9 +80,34 @@ public class PerkLeap extends Perk
if (!Kit.HasKit(player))
return;
//Check Uses
if (_maxUses > 0)
{
if (!_uses.containsKey(player.getName()))
_uses.put(player.getName(), _maxUses);
if (_uses.get(player.getName()) <= 0)
{
UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(_name) + " anymore."));
return;
}
}
//Energy
if (!Recharge.Instance.use(player, _name, _recharge, true))
return;
//Use Use
if (_maxUses > 0)
{
int count = _uses.get(player.getName());
count--;
player.setExp(Math.min(0.99f, (float)count/(float)_maxUses));
_uses.put(player.getName(), count);
}
Entity ent = player;
if (player.getVehicle() != null)

View File

@ -32,7 +32,7 @@ public class GameCreationManager implements Listener
private HashMap<String, ChatColor> _nextGameTeams = null;
private String _lastMap = "";
private GameType _lastGame = GameType.SnowFight;
private ArrayList<GameType> _lastGames = new ArrayList<GameType>();
public GameCreationManager(ArcadeManager manager)
{
@ -60,6 +60,9 @@ public class GameCreationManager implements Listener
if (Manager.GetGameList().isEmpty())
return;
while (_lastGames.size() > Manager.GetGameList().size() - 1)
_lastGames.remove(_lastGames.size()-1);
if (Manager.GetGame() == null && _ended.isEmpty())
{
CreateGame(null);
@ -159,12 +162,12 @@ public class GameCreationManager implements Listener
{
gameType = Manager.GetGameList().get(UtilMath.r(Manager.GetGameList().size()));
if (gameType != _lastGame)
if (!_lastGames.contains(gameType))
break;
}
}
_lastGame = gameType;
_lastGames.add(0, gameType);
//Make Game
Manager.SetGame(Manager.GetGameFactory().CreateGame(gameType, pastTeams));

View File

@ -166,12 +166,12 @@ public class GameFlagManager implements Listener
if (game == null || !game.IsAlive(player) || game.GetState() != GameState.Live)
{
if (!player.isOp() || player.getGameMode() != GameMode.CREATIVE)
if (player.isOp() && player.getGameMode() == GameMode.CREATIVE)
{
event.setCancelled(true);
return;
}
return;
event.setCancelled(true);
}

View File

@ -11,6 +11,7 @@ import mineplex.minecraft.game.core.combat.CombatComponent;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import nautilus.game.arcade.ArcadeFormat;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.events.PlayerStateChangeEvent;
import nautilus.game.arcade.game.Game;
@ -111,6 +112,9 @@ public class GameGemManager implements Listener
public void RewardGems(Game game, Player player, boolean give)
{
if (game.GetType() == GameType.UHC)
return;
//Inform Gems
AnnounceGems(game, player, game.GetPlayerGems().get(player), give);

View File

@ -53,6 +53,7 @@ import mineplex.core.packethandler.PacketHandler;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.AsymTeamGame;
import nautilus.game.arcade.game.Game;
@ -300,7 +301,7 @@ public class GameLobbyManager implements IPacketRunnable, Listener
//Standard
if (game.GetKits().length > 1)
if (game.GetKits().length > 1 || game.GetType() != GameType.UHC)
{
//Display
ArrayList<GameTeam> teams = game.GetTeamList();
@ -434,7 +435,7 @@ public class GameLobbyManager implements IPacketRunnable, Listener
block.setType(_kitBlocks.get(block));
_kitBlocks.clear();
if (game.GetKits().length <= 1)
if (game.GetKits().length <= 1 && game.GetType() == GameType.UHC)
{
WriteKitLine(" ", 0, 159, (byte)15);
WriteKitLine(" ", 1, 159, (byte)4);