Merge branch 'master' of ssh://dev1.mineplex.com:7999/min/Mineplex
This commit is contained in:
commit
eb1d1c1ed2
@ -8,6 +8,8 @@ import java.util.List;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -385,6 +387,14 @@ public class UtilPlayer
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
public static boolean isChargingBow(Player player)
|
||||
{
|
||||
if (!UtilGear.isMat(player.getItemInHand(), Material.BOW))
|
||||
return false;
|
||||
|
||||
return (((CraftEntity)player).getHandle().getDataWatcher().getByte(0) & 1 << 4) != 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
@ -10,6 +10,7 @@ import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.antihack.types.*;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
@ -70,8 +71,8 @@ public class AntiHack extends MiniPlugin
|
||||
Punish = punish;
|
||||
Portal = portal;
|
||||
|
||||
_repository = new AntiHackRepository(plugin.getConfig().getString("serverstatus.name"));
|
||||
_repository.initialize();
|
||||
//_repository = new AntiHackRepository(plugin.getConfig().getString("serverstatus.name"));
|
||||
//_repository.initialize();
|
||||
|
||||
_detectors = new ArrayList<Detector>();
|
||||
|
||||
@ -198,8 +199,8 @@ public class AntiHack extends MiniPlugin
|
||||
_suspicion.get(player).get(type).add(System.currentTimeMillis());
|
||||
|
||||
for (Player admin : UtilServer.getPlayers())
|
||||
if (admin.isOp() && admin.getGameMode() == GameMode.CREATIVE)
|
||||
UtilPlayer.message(admin, C.cGold + C.Bold + player.getName() + " suspected for " + type + ".");
|
||||
if (admin.isOp() && UtilGear.isMat(admin.getItemInHand(), Material.PAPER))
|
||||
UtilPlayer.message(admin, C.cRed + C.Bold + player.getName() + " suspected for " + type + ".");
|
||||
|
||||
// Print (Debug)
|
||||
System.out.println("[Offense] " + player.getName() + " received suspicion for " + type + ".");
|
||||
|
@ -48,7 +48,7 @@ public class Fly extends MiniPlugin implements Detector
|
||||
}
|
||||
|
||||
updateHover(player);
|
||||
updateRise(player);
|
||||
//updateRise(player);
|
||||
updateMomentum(player, event);
|
||||
}
|
||||
|
||||
|
@ -40,37 +40,37 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
public class ItemStackFactory extends MiniPlugin
|
||||
{
|
||||
public static ItemStackFactory Instance;
|
||||
|
||||
|
||||
private HashMap<Integer, HashMap<Byte, Entry<String, Boolean>>> _names;
|
||||
private HashMap<Integer, HashMap<Byte, String[]>> _lores;
|
||||
|
||||
private String _nameFormat = "§r" + C.mItem;
|
||||
|
||||
|
||||
private HashSet<Listener> _statListeners = new HashSet<Listener>();
|
||||
|
||||
|
||||
private boolean _customNames = false;
|
||||
|
||||
protected ItemStackFactory(JavaPlugin plugin, boolean customNames)
|
||||
{
|
||||
super("ItemStack Factory", plugin);
|
||||
|
||||
|
||||
AddDefault();
|
||||
|
||||
|
||||
if (customNames)
|
||||
SetCustom();
|
||||
}
|
||||
|
||||
|
||||
public static void Initialize(JavaPlugin plugin, boolean customNames)
|
||||
{
|
||||
Instance = new ItemStackFactory(plugin, customNames);
|
||||
}
|
||||
|
||||
|
||||
public void AddStatListener(Listener listener)
|
||||
{
|
||||
_statListeners.add(listener);
|
||||
RegisterEvents(listener);
|
||||
}
|
||||
|
||||
|
||||
private void SetCustom()
|
||||
{
|
||||
Add(0, (byte)0, "Unarmed", false);
|
||||
@ -112,7 +112,7 @@ public class ItemStackFactory extends MiniPlugin
|
||||
}, true);
|
||||
|
||||
Add(Material.RECORD_5, (byte)0, "50,000 Coin Token", true);
|
||||
|
||||
|
||||
Add(Material.IRON_HELMET, (byte)0, "Knights Helm", true);
|
||||
Add(Material.IRON_CHESTPLATE, (byte)0, "Knights Chestplate", true);
|
||||
Add(Material.IRON_LEGGINGS, (byte)0, "Knights Leggings", true);
|
||||
@ -275,20 +275,30 @@ public class ItemStackFactory extends MiniPlugin
|
||||
{
|
||||
try
|
||||
{
|
||||
String name = "";
|
||||
|
||||
//Get Name
|
||||
ItemStack stack = new ItemStack(id, 1, data);
|
||||
String name = CraftItemStack.asNMSCopy(stack).getName();
|
||||
if (CraftItemStack.asNMSCopy(stack) != null && CraftItemStack.asNMSCopy(stack).getName() != null)
|
||||
name = CraftItemStack.asNMSCopy(stack).getName();
|
||||
|
||||
if (id == 140)
|
||||
name = "Flower Pot";
|
||||
|
||||
|
||||
if (name.length() == 0)
|
||||
name = Clean(mat.toString());
|
||||
|
||||
//No Duplicates
|
||||
boolean duplicate = false;
|
||||
for (Entry<String, Boolean> cur : variants.values())
|
||||
if (cur.getKey().equals(name))
|
||||
continue;
|
||||
{
|
||||
duplicate = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (duplicate)
|
||||
continue;
|
||||
|
||||
variants.put(data, new AbstractMap.SimpleEntry<String, Boolean>(name, (mat.getMaxStackSize() == 1)));
|
||||
|
||||
@ -317,7 +327,7 @@ public class ItemStackFactory extends MiniPlugin
|
||||
|
||||
return out.substring(0, out.length() - 1);
|
||||
}
|
||||
|
||||
|
||||
public String GetItemStackName(ItemStack stack)
|
||||
{
|
||||
return ((CraftItemStack)stack).getHandle().getName();
|
||||
@ -350,16 +360,25 @@ public class ItemStackFactory extends MiniPlugin
|
||||
if (formatted)
|
||||
out = _nameFormat;
|
||||
|
||||
System.out.println("Searching A: " + id + ":" + data);
|
||||
|
||||
if (!_names.containsKey(id))
|
||||
return out + "Unknown";
|
||||
|
||||
if (!_names.get(id).containsKey(data))
|
||||
System.out.println("Searching B");
|
||||
|
||||
if (!_names.get(id).containsKey(data))
|
||||
{
|
||||
if (_names.get(id).containsKey(0))
|
||||
return out + _names.get(id).get(0).getKey();
|
||||
System.out.println("Searching C");
|
||||
for (Entry<String, Boolean> cur : _names.get(id).values())
|
||||
return cur.getKey();
|
||||
System.out.println("Searching D");
|
||||
return out + "Unknown";
|
||||
}
|
||||
|
||||
else
|
||||
return out + "Unknown";
|
||||
System.out.println("Searching E");
|
||||
|
||||
return out + _names.get(id).get(data).getKey();
|
||||
}
|
||||
@ -398,7 +417,7 @@ public class ItemStackFactory extends MiniPlugin
|
||||
{
|
||||
if (!_customNames)
|
||||
return;
|
||||
|
||||
|
||||
if (item == null)
|
||||
return;
|
||||
|
||||
@ -408,19 +427,19 @@ public class ItemStackFactory extends MiniPlugin
|
||||
damage += GetLoreVar(item, "Damage Tanked", 0);
|
||||
|
||||
SetLoreVar(item, "Damage Tanked", "" + damage);
|
||||
|
||||
|
||||
if (damage >= 10000) item.addEnchantment(Enchantment.DURABILITY, 1);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void StatsBlockMined(BlockBreakEvent event)
|
||||
{
|
||||
if (!_customNames)
|
||||
return;
|
||||
|
||||
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
||||
|
||||
ItemStack item = event.getPlayer().getItemInHand();
|
||||
|
||||
if (item == null)
|
||||
@ -438,7 +457,7 @@ public class ItemStackFactory extends MiniPlugin
|
||||
{
|
||||
if (!_customNames)
|
||||
return;
|
||||
|
||||
|
||||
if (!(event.getEntity() instanceof Monster))
|
||||
return;
|
||||
|
||||
@ -446,7 +465,7 @@ public class ItemStackFactory extends MiniPlugin
|
||||
|
||||
if (ent.getKiller() == null)
|
||||
return;
|
||||
|
||||
|
||||
if (ent.getKiller().isBlocking())
|
||||
return;
|
||||
|
||||
@ -468,7 +487,7 @@ public class ItemStackFactory extends MiniPlugin
|
||||
{
|
||||
if (!_customNames)
|
||||
return;
|
||||
|
||||
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
||||
@ -488,7 +507,7 @@ public class ItemStackFactory extends MiniPlugin
|
||||
{
|
||||
if (!_customNames)
|
||||
return;
|
||||
|
||||
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
||||
@ -510,20 +529,20 @@ public class ItemStackFactory extends MiniPlugin
|
||||
{
|
||||
if (!_customNames)
|
||||
return;
|
||||
|
||||
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
||||
ItemStack stack = event.getItem().getItemStack();
|
||||
|
||||
|
||||
if (stack.getType() != Material.ARROW)
|
||||
return;
|
||||
|
||||
|
||||
//Ignore Named Items
|
||||
String color = ChatColor.getLastColors(GetItemStackName(stack));
|
||||
if (color != null && color.length() >= 2 && color.charAt(1) != 'f')
|
||||
return;
|
||||
|
||||
|
||||
//Data
|
||||
byte data = 0;
|
||||
if (stack.getData() != null)
|
||||
@ -532,22 +551,22 @@ public class ItemStackFactory extends MiniPlugin
|
||||
//Remove
|
||||
event.setCancelled(true);
|
||||
event.getItem().remove();
|
||||
|
||||
|
||||
//Fletched
|
||||
if (data == 1)
|
||||
return;
|
||||
|
||||
|
||||
event.getPlayer().getInventory().addItem(CreateStack(stack.getTypeId(), data, stack.getAmount()));
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void RenameSmelt(FurnaceSmeltEvent event)
|
||||
{
|
||||
if (!_customNames)
|
||||
return;
|
||||
|
||||
|
||||
ItemStack stack = event.getResult();
|
||||
|
||||
|
||||
byte data = 0;
|
||||
if (stack.getData() != null)
|
||||
data= stack.getData().getData();
|
||||
@ -562,7 +581,7 @@ public class ItemStackFactory extends MiniPlugin
|
||||
{
|
||||
if (!_customNames)
|
||||
return;
|
||||
|
||||
|
||||
ItemStack stack = event.getInventory().getResult();
|
||||
|
||||
byte data = 0;
|
||||
@ -583,7 +602,7 @@ public class ItemStackFactory extends MiniPlugin
|
||||
{
|
||||
if (!_customNames)
|
||||
return;
|
||||
|
||||
|
||||
if (!event.isShiftClick())
|
||||
return;
|
||||
|
||||
@ -787,7 +806,7 @@ public class ItemStackFactory extends MiniPlugin
|
||||
return null;
|
||||
|
||||
boolean setMeta = false;
|
||||
|
||||
|
||||
//Set Name
|
||||
if (name != null)
|
||||
{
|
||||
@ -806,7 +825,7 @@ public class ItemStackFactory extends MiniPlugin
|
||||
itemMeta.setLore(ArrayToList(_lores.get(id).get(data)));
|
||||
setMeta = true;
|
||||
}
|
||||
|
||||
|
||||
//Owner Lore
|
||||
if (owner != null)
|
||||
{
|
||||
@ -825,7 +844,7 @@ public class ItemStackFactory extends MiniPlugin
|
||||
|
||||
if (itemMeta.getLore() != null) itemMeta.setLore(CombineLore(itemMeta.getLore(), ArrayToList(ownerLore)));
|
||||
else itemMeta.setLore(ArrayToList(ownerLore));
|
||||
|
||||
|
||||
setMeta = true;
|
||||
}
|
||||
|
||||
@ -834,7 +853,7 @@ public class ItemStackFactory extends MiniPlugin
|
||||
{
|
||||
if (itemMeta.getLore() != null) itemMeta.setLore(CombineLore(itemMeta.getLore(), lore));
|
||||
else itemMeta.setLore(lore);
|
||||
|
||||
|
||||
setMeta = true;
|
||||
}
|
||||
|
||||
@ -965,12 +984,12 @@ public class ItemStackFactory extends MiniPlugin
|
||||
|
||||
stack.setItemMeta(meta);
|
||||
}
|
||||
|
||||
|
||||
public void SetUseCustomNames(boolean var)
|
||||
{
|
||||
_customNames = var;
|
||||
}
|
||||
|
||||
|
||||
public void SetCustomNameFormat(String format)
|
||||
{
|
||||
_nameFormat = format;
|
||||
|
@ -99,7 +99,7 @@ public class Evade extends SkillActive
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void Damage(CustomDamageEvent event)
|
||||
{
|
||||
if (event.IsCancelled())
|
||||
|
@ -122,7 +122,7 @@ public class HiltSmash extends SkillActive
|
||||
if (!(ent instanceof LivingEntity))
|
||||
return;
|
||||
|
||||
if (UtilMath.offset(player, ent) > 2.2)
|
||||
if (UtilMath.offset(player, ent) > 4)
|
||||
{
|
||||
UtilPlayer.message(player, F.main(GetClassType().name(), "You missed " + F.skill(GetName()) + "."));
|
||||
return;
|
||||
|
@ -49,7 +49,7 @@ public class Riposte extends SkillActive
|
||||
"to riposte.",
|
||||
"",
|
||||
"If successful, you gain 1 health",
|
||||
"and deal #0#1 bonus damage.",
|
||||
"and deal #0#0.5 bonus damage.",
|
||||
"",
|
||||
"You must block, parry, then riposte",
|
||||
"all within 1 second of each other."
|
||||
@ -147,13 +147,12 @@ public class Riposte extends SkillActive
|
||||
_prepare.remove(damager);
|
||||
|
||||
//Damage
|
||||
event.AddMod(damager.getName(), GetName(), 2, true);
|
||||
event.AddMod(damager.getName(), GetName(), 0.5 + 0.5 * level, true);
|
||||
|
||||
//Effect
|
||||
damager.getWorld().playSound(damager.getLocation(), Sound.ZOMBIE_METAL, 1f, 1.2f);
|
||||
|
||||
//Energy
|
||||
Factory.Energy().ModifyEnergy(damager, 20);
|
||||
UtilPlayer.health(damager, 1);
|
||||
|
||||
UtilParticle.PlayParticle(ParticleType.HEART, damager.getEyeLocation(), 0, 0.3f, 0, 0, 1);
|
||||
|
@ -6,6 +6,7 @@ import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilEvent;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
@ -95,8 +96,11 @@ public abstract class SkillChargeBow extends SkillCharge implements Listener
|
||||
}
|
||||
|
||||
// Client sends a packet when you stop charging a bow and sets this datawatcher value.
|
||||
if ((((CraftEntity)cur).getHandle().getDataWatcher().getByte(0) & 1 << 4) == 0)
|
||||
if (!UtilPlayer.isChargingBow(cur))
|
||||
{
|
||||
_charge.remove(cur);
|
||||
continue;
|
||||
}
|
||||
|
||||
//Flags
|
||||
if (!_canChargeInAir && !UtilEnt.isGrounded(cur))
|
||||
|
@ -296,7 +296,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
||||
AddSkill(new Riposte(this, "Riposte", ClassType.Knight, SkillType.Sword,
|
||||
5, 5,
|
||||
0, 0,
|
||||
15000, -1000, false,
|
||||
10000, -1000, false,
|
||||
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
|
||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||
|
||||
|
@ -7,7 +7,6 @@ public interface IItem
|
||||
Material GetType();
|
||||
int GetAmount();
|
||||
int GetGemCost();
|
||||
boolean IsFree();
|
||||
int GetSalesPackageId();
|
||||
String GetName();
|
||||
String[] GetDesc();
|
||||
|
@ -77,12 +77,6 @@ public class Item implements IItem, Listener
|
||||
event.SetCancelled("Item Damage Cancel");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean IsFree()
|
||||
{
|
||||
return _free;
|
||||
}
|
||||
|
||||
public void Update(ItemToken itemToken)
|
||||
{
|
||||
_salesPackageId = itemToken.SalesPackage.GameSalesPackageId;
|
||||
|
@ -1,5 +1,5 @@
|
||||
package nautilus.game.arcade;
|
||||
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.DataInputStream;
|
||||
@ -39,67 +39,67 @@ import mineplex.minecraft.game.core.damage.DamageManager;
|
||||
import nautilus.game.arcade.game.GameServerConfig;
|
||||
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
|
||||
public class Arcade extends JavaPlugin implements INautilusPlugin
|
||||
{
|
||||
private String WEB_CONFIG = "webServer";
|
||||
|
||||
|
||||
//Modules
|
||||
private CoreClientManager _clientManager;
|
||||
private DonationManager _donationManager;
|
||||
private DamageManager _damageManager;
|
||||
|
||||
|
||||
private ArcadeManager _gameManager;
|
||||
|
||||
|
||||
@Override
|
||||
public void onEnable()
|
||||
{
|
||||
//Delete Old Games Folders
|
||||
DeleteFolders();
|
||||
|
||||
|
||||
//Configs
|
||||
getConfig().addDefault(WEB_CONFIG, "http://accounts.mineplex.com/");
|
||||
getConfig().set(WEB_CONFIG, getConfig().getString(WEB_CONFIG));
|
||||
saveConfig();
|
||||
|
||||
|
||||
_clientManager = CoreClientManager.Initialize(this, GetWebServerAddress());
|
||||
|
||||
|
||||
CommandCenter.Initialize(this, _clientManager);
|
||||
|
||||
|
||||
ItemStackFactory.Initialize(this, false);
|
||||
Recharge.Initialize(this);
|
||||
|
||||
|
||||
_donationManager = new DonationManager(this, GetWebServerAddress());
|
||||
ConditionManager conditionManager = new ConditionManager(this);
|
||||
|
||||
|
||||
new MessageManager(this, _clientManager);
|
||||
|
||||
|
||||
AntiStack antistack = new AntiStack(this);
|
||||
|
||||
|
||||
Creature creature = new Creature(this);
|
||||
Spawn spawn = new Spawn(this);
|
||||
Spawn spawn = new Spawn(this);
|
||||
Teleport teleport = new Teleport(this, _clientManager, spawn);
|
||||
new FileUpdater(this, new Portal(this));
|
||||
ServerStatusManager serverStatusManager = new ServerStatusManager(this, new LagMeter(this, _clientManager));
|
||||
|
||||
|
||||
PacketHandler packetHandler = new PacketHandler(this);
|
||||
DisguiseManager disguiseManager = new DisguiseManager(this, packetHandler);
|
||||
|
||||
|
||||
_damageManager = new DamageManager(this, new CombatManager(this), new NpcManager(this, creature), disguiseManager);
|
||||
|
||||
|
||||
Portal portal = new Portal(this);
|
||||
|
||||
|
||||
//Arcade Manager
|
||||
_gameManager = new ArcadeManager(this, serverStatusManager, ReadServerConfig(), _clientManager, _donationManager, conditionManager, _damageManager, disguiseManager, creature, teleport, new Blood(this), antistack, portal, packetHandler, GetWebServerAddress());
|
||||
|
||||
|
||||
Punish punish = new Punish(this, GetWebServerAddress(), _clientManager);
|
||||
AntiHack.Initialize(this, punish, portal);
|
||||
|
||||
|
||||
new MemoryFix(this);
|
||||
|
||||
|
||||
//Updates
|
||||
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1);
|
||||
}
|
||||
@ -180,7 +180,7 @@ public class Arcade extends JavaPlugin implements INautilusPlugin
|
||||
|
||||
if (!config.IsValid())
|
||||
config = GetDefaultConfig();
|
||||
|
||||
|
||||
WriteServerConfig(config);
|
||||
return config;
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
|
||||
_projectileManager = new ProjectileManager(plugin);
|
||||
|
||||
if (serverConfig.GameList.contains(GameType.Dominate))
|
||||
if (serverConfig.GameList.contains(GameType.ChampionsDominate) || serverConfig.GameList.contains(GameType.ChampionsTDM) || serverConfig.GameList.contains(GameType.ChampionsMOBA))
|
||||
{
|
||||
_skillFactory = new SkillFactory(plugin, damageManager, this, _damageManager.GetCombatManager(), conditionManager, _projectileManager, _blockRestore, _fire, new Movement(plugin), teleport, new Energy(plugin), webAddress);
|
||||
_classManager = new ClassManager(plugin, clientManager, donationManager, _skillFactory, webAddress);
|
||||
|
@ -9,7 +9,8 @@ import nautilus.game.arcade.game.games.baconbrawl.BaconBrawl;
|
||||
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.champions_dominate.Dominate;
|
||||
import nautilus.game.arcade.game.games.champions.ChampionsDominate;
|
||||
import nautilus.game.arcade.game.games.champions.ChampionsTDM;
|
||||
import nautilus.game.arcade.game.games.christmas.Christmas;
|
||||
import nautilus.game.arcade.game.games.deathtag.DeathTag;
|
||||
import nautilus.game.arcade.game.games.dragonescape.DragonEscape;
|
||||
@ -27,6 +28,7 @@ import nautilus.game.arcade.game.games.quiver.Quiver;
|
||||
import nautilus.game.arcade.game.games.runner.Runner;
|
||||
import nautilus.game.arcade.game.games.sheep.SheepGame;
|
||||
import nautilus.game.arcade.game.games.smash.SuperSmash;
|
||||
import nautilus.game.arcade.game.games.smash.SuperSmashDominate;
|
||||
import nautilus.game.arcade.game.games.smash.SuperSmashTeam;
|
||||
import nautilus.game.arcade.game.games.snake.Snake;
|
||||
import nautilus.game.arcade.game.games.snowfight.SnowFight;
|
||||
@ -49,38 +51,40 @@ public class GameFactory
|
||||
|
||||
public Game CreateGame(GameType gameType, HashMap<String, ChatColor> pastTeams)
|
||||
{
|
||||
if (gameType == GameType.Barbarians) return new Barbarians(_manager);
|
||||
else if (gameType == GameType.BaconBrawl) return new BaconBrawl(_manager);
|
||||
else if (gameType == GameType.Bridge) return new Bridge(_manager);
|
||||
else if (gameType == GameType.CastleSiege) return new CastleSiege(_manager);
|
||||
else if (gameType == GameType.Christmas) return new Christmas(_manager);
|
||||
else if (gameType == GameType.DeathTag) return new DeathTag(_manager);
|
||||
else if (gameType == GameType.Dominate) return new Dominate(_manager);
|
||||
else if (gameType == GameType.Dragons) return new Dragons(_manager);
|
||||
else if (gameType == GameType.DragonEscape) return new DragonEscape(_manager);
|
||||
else if (gameType == GameType.DragonRiders) return new DragonRiders(_manager);
|
||||
else if (gameType == GameType.Draw) return new Draw(_manager);
|
||||
else if (gameType == GameType.Evolution) return new Evolution(_manager);
|
||||
else if (gameType == GameType.Gravity) return new Gravity(_manager);
|
||||
else if (gameType == GameType.Halloween) return new Halloween(_manager);
|
||||
else if (gameType == GameType.HideSeek) return new HideSeek(_manager);
|
||||
else if (gameType == GameType.HungerGames) return new HungerGames(_manager);
|
||||
else if (gameType == GameType.MineWare) return new MineWare(_manager);
|
||||
else if (gameType == GameType.MilkCow) return new MilkCow(_manager);
|
||||
else if (gameType == GameType.Paintball) return new Paintball(_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);
|
||||
else if (gameType == GameType.Sheep) return new SheepGame(_manager);
|
||||
else if (gameType == GameType.Smash) return new SuperSmash(_manager);
|
||||
else if (gameType == GameType.SmashTeams) return new SuperSmashTeam(_manager);
|
||||
else if (gameType == GameType.Snake) return new Snake(_manager);
|
||||
else if (gameType == GameType.Spleef) return new Spleef(_manager);
|
||||
else if (gameType == GameType.SquidShooter) return new SquidShooter(_manager);
|
||||
else if (gameType == GameType.Stacker) return new Stacker(_manager);
|
||||
else if (gameType == GameType.TurfWars) return new TurfForts(_manager);
|
||||
else if (gameType == GameType.UHC) return new UHC(_manager);
|
||||
else if (gameType == GameType.ZombieSurvival) return new ZombieSurvival(_manager);
|
||||
else return null;
|
||||
if (gameType == GameType.Barbarians) return new Barbarians(_manager);
|
||||
else if (gameType == GameType.BaconBrawl) return new BaconBrawl(_manager);
|
||||
else if (gameType == GameType.Bridge) return new Bridge(_manager);
|
||||
else if (gameType == GameType.CastleSiege) return new CastleSiege(_manager);
|
||||
else if (gameType == GameType.Christmas) return new Christmas(_manager);
|
||||
else if (gameType == GameType.DeathTag) return new DeathTag(_manager);
|
||||
else if (gameType == GameType.ChampionsDominate) return new ChampionsDominate(_manager);
|
||||
else if (gameType == GameType.ChampionsTDM) return new ChampionsTDM(_manager);
|
||||
else if (gameType == GameType.Dragons) return new Dragons(_manager);
|
||||
else if (gameType == GameType.DragonEscape) return new DragonEscape(_manager);
|
||||
else if (gameType == GameType.DragonRiders) return new DragonRiders(_manager);
|
||||
else if (gameType == GameType.Draw) return new Draw(_manager);
|
||||
else if (gameType == GameType.Evolution) return new Evolution(_manager);
|
||||
else if (gameType == GameType.Gravity) return new Gravity(_manager);
|
||||
else if (gameType == GameType.Halloween) return new Halloween(_manager);
|
||||
else if (gameType == GameType.HideSeek) return new HideSeek(_manager);
|
||||
else if (gameType == GameType.HungerGames) return new HungerGames(_manager);
|
||||
else if (gameType == GameType.MineWare) return new MineWare(_manager);
|
||||
else if (gameType == GameType.MilkCow) return new MilkCow(_manager);
|
||||
else if (gameType == GameType.Paintball) return new Paintball(_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);
|
||||
else if (gameType == GameType.Sheep) return new SheepGame(_manager);
|
||||
else if (gameType == GameType.Smash) return new SuperSmash(_manager);
|
||||
else if (gameType == GameType.SmashTeams) return new SuperSmashTeam(_manager);
|
||||
else if (gameType == GameType.SmashDomination) return new SuperSmashDominate(_manager);
|
||||
else if (gameType == GameType.Snake) return new Snake(_manager);
|
||||
else if (gameType == GameType.Spleef) return new Spleef(_manager);
|
||||
else if (gameType == GameType.SquidShooter) return new SquidShooter(_manager);
|
||||
else if (gameType == GameType.Stacker) return new Stacker(_manager);
|
||||
else if (gameType == GameType.TurfWars) return new TurfForts(_manager);
|
||||
else if (gameType == GameType.UHC) return new UHC(_manager);
|
||||
else if (gameType == GameType.ZombieSurvival) return new ZombieSurvival(_manager);
|
||||
else return null;
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,9 @@ public enum GameType
|
||||
Barbarians("A Barbarians Life"),
|
||||
Bridge("The Bridges"),
|
||||
CastleSiege("Castle Siege"),
|
||||
Dominate("Domination"),
|
||||
ChampionsTDM("Champions TDM", "Champions"),
|
||||
ChampionsDominate("Champions Domination", "Champions"),
|
||||
ChampionsMOBA("Champions MOBA", "Champions"),
|
||||
Christmas("Christmas Chaos"),
|
||||
DeathTag("Death Tag"),
|
||||
DragonEscape("Dragon Escape"),
|
||||
@ -28,7 +30,8 @@ public enum GameType
|
||||
Runner("Runner"),
|
||||
Sheep("Sheep Quest"),
|
||||
Smash("Super Smash Mobs"),
|
||||
SmashTeams("Super Smash Mobs Teams"),
|
||||
SmashTeams("Super Smash Mobs Teams", "Super Smash Mobs"),
|
||||
SmashDomination("Super Smash Mobs Domination", "Super Smash Mobs"),
|
||||
Snake("Snake"),
|
||||
SnowFight("Snow Fight"),
|
||||
Spleef("Super Spleef"),
|
||||
@ -39,14 +42,27 @@ public enum GameType
|
||||
ZombieSurvival("Zombie Survival");
|
||||
|
||||
String _name;
|
||||
String _lobbyName;
|
||||
|
||||
GameType(String name)
|
||||
{
|
||||
_name = name;
|
||||
_lobbyName = name;
|
||||
}
|
||||
|
||||
GameType(String name, String lobbyName)
|
||||
{
|
||||
_name = name;
|
||||
_lobbyName = lobbyName;
|
||||
}
|
||||
|
||||
public String GetName()
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
public String GetLobbyName()
|
||||
{
|
||||
return _lobbyName;
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@ import org.bukkit.entity.Player;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import mineplex.core.command.CommandBase;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
|
||||
public class StartCommand extends CommandBase<ArcadeManager>
|
||||
{
|
||||
@ -18,9 +19,15 @@ public class StartCommand extends CommandBase<ArcadeManager>
|
||||
{
|
||||
if (Plugin.GetGame() == null)
|
||||
return;
|
||||
|
||||
if (Plugin.GetGame().InProgress())
|
||||
{
|
||||
caller.sendMessage("Game is already in progress...");
|
||||
return;
|
||||
}
|
||||
|
||||
Plugin.GetGameManager().StateCountdown(Plugin.GetGame(), 10, true);
|
||||
|
||||
caller.sendMessage("Force Starting Game!");
|
||||
Plugin.GetGame().Announce(C.cAqua + C.Bold + caller.getName() + " has started the game.");
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.game.Game.GameState;
|
||||
import mineplex.core.command.CommandBase;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
|
||||
public class StopCommand extends CommandBase<ArcadeManager>
|
||||
{
|
||||
@ -23,7 +24,7 @@ public class StopCommand extends CommandBase<ArcadeManager>
|
||||
|
||||
HandlerList.unregisterAll(Plugin.GetGame());
|
||||
Plugin.GetGame().SetState(GameState.End);
|
||||
|
||||
caller.sendMessage("Stopped Game! Please wait for 10s.");
|
||||
|
||||
Plugin.GetGame().Announce(C.cAqua + C.Bold + caller.getName() + " has stopped the game.");
|
||||
}
|
||||
}
|
||||
|
@ -224,6 +224,11 @@ public abstract class Game implements Listener
|
||||
{
|
||||
return _gameType.GetName();
|
||||
}
|
||||
|
||||
public String GetMode()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public GameType GetType()
|
||||
{
|
||||
@ -1023,4 +1028,6 @@ public abstract class Game implements Listener
|
||||
{
|
||||
return _prepareCountdown;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,82 @@
|
||||
package nautilus.game.arcade.game.games.champions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.combat.DeathMessageType;
|
||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.games.champions.kits.KitAssassin;
|
||||
import nautilus.game.arcade.game.games.champions.kits.KitBrute;
|
||||
import nautilus.game.arcade.game.games.champions.kits.KitKnight;
|
||||
import nautilus.game.arcade.game.games.champions.kits.KitMage;
|
||||
import nautilus.game.arcade.game.games.champions.kits.KitRanger;
|
||||
import nautilus.game.arcade.game.games.common.Domination;
|
||||
import nautilus.game.arcade.game.games.common.dominate_data.CapturePoint;
|
||||
import nautilus.game.arcade.game.games.common.dominate_data.Emerald;
|
||||
import nautilus.game.arcade.game.games.common.dominate_data.Resupply;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.ItemDespawnEvent;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
|
||||
public class ChampionsDominate extends Domination
|
||||
{
|
||||
public ChampionsDominate(ArcadeManager manager)
|
||||
{
|
||||
super(manager, GameType.ChampionsDominate,
|
||||
|
||||
new Kit[]
|
||||
{
|
||||
new KitBrute(manager),
|
||||
new KitRanger(manager),
|
||||
new KitKnight(manager),
|
||||
new KitMage(manager),
|
||||
new KitAssassin(manager),
|
||||
});
|
||||
|
||||
_help = new String[]
|
||||
{
|
||||
"Capture Beacons faster with more people!",
|
||||
"Make sure you use all of your Skill/Item Tokens",
|
||||
"Collect Emeralds to get 500 Points",
|
||||
"Collect Resupply Chests to restock your inventory",
|
||||
"Customize your Class to suit your play style",
|
||||
"Diamond Sword boosts Sword Skill by 1 Level",
|
||||
"Diamond Axe boosts Axe Skill by 1 Level",
|
||||
"Gold Weapons deal 7 damage",
|
||||
"Iron Weapons deal 6 damage",
|
||||
"Diamond Weapons deal 5 damage",
|
||||
|
||||
};
|
||||
|
||||
this.Manager.GetDamage().UseSimpleWeaponDamage = false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void ValidateKit(Player player, GameTeam team)
|
||||
{
|
||||
// NOTHING
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeathMessageType GetDeathMessageType()
|
||||
{
|
||||
return DeathMessageType.Detailed;
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package nautilus.game.arcade.game.games.champions;
|
||||
|
||||
public class ChampionsMOBA
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,163 @@
|
||||
package nautilus.game.arcade.game.games.champions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.TeamGame;
|
||||
import nautilus.game.arcade.game.GameTeam.PlayerState;
|
||||
import nautilus.game.arcade.game.games.champions.kits.KitAssassin;
|
||||
import nautilus.game.arcade.game.games.champions.kits.KitBrute;
|
||||
import nautilus.game.arcade.game.games.champions.kits.KitKnight;
|
||||
import nautilus.game.arcade.game.games.champions.kits.KitMage;
|
||||
import nautilus.game.arcade.game.games.champions.kits.KitRanger;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
|
||||
public class ChampionsTDM extends TeamGame
|
||||
{
|
||||
private ArrayList<String> _lastScoreboard = new ArrayList<String>();
|
||||
private HashMap<Player, Integer> _kills = new HashMap<Player, Integer>();
|
||||
|
||||
public ChampionsTDM(ArcadeManager manager)
|
||||
{
|
||||
super(manager, GameType.ChampionsTDM,
|
||||
|
||||
new Kit[]
|
||||
{
|
||||
new KitBrute(manager),
|
||||
new KitRanger(manager),
|
||||
new KitKnight(manager),
|
||||
new KitMage(manager),
|
||||
new KitAssassin(manager),
|
||||
},
|
||||
|
||||
new String[]
|
||||
{
|
||||
"Each player has " + C.cRed + C.Bold + "ONE LIFE",
|
||||
"Kill the other team to win!",
|
||||
|
||||
});
|
||||
|
||||
this.DeathOut = true;
|
||||
this.HungerSet = 20;
|
||||
this.WorldTimeSet = 2000;
|
||||
this.CompassEnabled = true;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void PlayerKillAward(CombatDeathEvent event)
|
||||
{
|
||||
if (!(event.GetEvent().getEntity() instanceof Player))
|
||||
return;
|
||||
|
||||
Player killed = (Player)event.GetEvent().getEntity();
|
||||
SetPlayerState(killed, PlayerState.OUT);
|
||||
|
||||
GameTeam killedTeam = GetTeam(killed);
|
||||
if (killedTeam == null)
|
||||
return;
|
||||
|
||||
if (event.GetLog().GetKiller() != null)
|
||||
{
|
||||
Player killer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
|
||||
|
||||
if (killer != null && !killer.equals(killed))
|
||||
{
|
||||
GameTeam killerTeam = GetTeam(killer);
|
||||
if (killerTeam == null)
|
||||
return;
|
||||
|
||||
int kills = 1;
|
||||
if (killedTeam.equals(killerTeam))
|
||||
kills = -1;
|
||||
|
||||
if (_kills.containsKey(killer))
|
||||
kills += _kills.get(killer);
|
||||
|
||||
_kills.put(killer, kills);
|
||||
|
||||
ScoreboardRefresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler
|
||||
public void ScoreboardUpdate(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
return;
|
||||
|
||||
if (!InProgress())
|
||||
return;
|
||||
|
||||
ScoreboardRefresh();
|
||||
}
|
||||
|
||||
public void ScoreboardRefresh()
|
||||
{
|
||||
//Wipe Last
|
||||
for (String string : _lastScoreboard)
|
||||
GetScoreboard().resetScores(Bukkit.getOfflinePlayer(string));
|
||||
_lastScoreboard.clear();
|
||||
|
||||
int pos = 1;
|
||||
String space = " ";
|
||||
|
||||
for (GameTeam team : this.GetTeamList())
|
||||
{
|
||||
for (Player player : team.GetPlayers(false))
|
||||
{
|
||||
int kills = 0;
|
||||
if (_kills.containsKey(player))
|
||||
kills = _kills.get(player);
|
||||
|
||||
String out = kills + " ";
|
||||
|
||||
if (IsAlive(player))
|
||||
out += team.GetColor() + player.getName();
|
||||
else
|
||||
out += C.cGray + player.getName();
|
||||
|
||||
if (out.length() >= 16)
|
||||
out = out.substring(0, 15);
|
||||
|
||||
_lastScoreboard.add(out);
|
||||
|
||||
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(out)).setScore(pos++);
|
||||
}
|
||||
|
||||
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(space)).setScore(pos++);
|
||||
|
||||
space += " ";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public double GetKillsGems(Player killer, Player killed, boolean assist)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
public String GetMode()
|
||||
{
|
||||
return "Team Deathmatch";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ValidateKit(Player player, GameTeam team)
|
||||
{
|
||||
// NOTHING
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package nautilus.game.arcade.game.games.champions_dominate.kits;
|
||||
package nautilus.game.arcade.game.games.champions.kits;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package nautilus.game.arcade.game.games.champions_dominate.kits;
|
||||
package nautilus.game.arcade.game.games.champions.kits;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package nautilus.game.arcade.game.games.champions_dominate.kits;
|
||||
package nautilus.game.arcade.game.games.champions.kits;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package nautilus.game.arcade.game.games.champions_dominate.kits;
|
||||
package nautilus.game.arcade.game.games.champions.kits;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package nautilus.game.arcade.game.games.champions_dominate.kits;
|
||||
package nautilus.game.arcade.game.games.champions.kits;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package nautilus.game.arcade.game.games.champions_dominate;
|
||||
package nautilus.game.arcade.game.games.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ -17,23 +17,17 @@ import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.combat.DeathMessageType;
|
||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.TeamGame;
|
||||
import nautilus.game.arcade.game.games.champions_dominate.kits.KitAssassin;
|
||||
import nautilus.game.arcade.game.games.champions_dominate.kits.KitBrute;
|
||||
import nautilus.game.arcade.game.games.champions_dominate.kits.KitKnight;
|
||||
import nautilus.game.arcade.game.games.champions_dominate.kits.KitMage;
|
||||
import nautilus.game.arcade.game.games.champions_dominate.kits.KitRanger;
|
||||
import nautilus.game.arcade.game.games.champions_dominate.map.*;
|
||||
import nautilus.game.arcade.game.games.champions.ChampionsDominate;
|
||||
import nautilus.game.arcade.game.games.common.dominate_data.*;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
|
||||
public class Dominate extends TeamGame
|
||||
public class Domination extends TeamGame
|
||||
{
|
||||
//Map Data
|
||||
private ArrayList<CapturePoint> _points = new ArrayList<CapturePoint>();
|
||||
@ -48,18 +42,9 @@ public class Dominate extends TeamGame
|
||||
private int _redScore = 0;
|
||||
private int _blueScore = 0;
|
||||
|
||||
public Dominate(ArcadeManager manager)
|
||||
public Domination(ArcadeManager manager, GameType type, Kit[] kits)
|
||||
{
|
||||
super(manager, GameType.Dominate,
|
||||
|
||||
new Kit[]
|
||||
{
|
||||
new KitBrute(manager),
|
||||
new KitRanger(manager),
|
||||
new KitKnight(manager),
|
||||
new KitMage(manager),
|
||||
new KitAssassin(manager),
|
||||
},
|
||||
super(manager, type, kits,
|
||||
|
||||
new String[]
|
||||
{
|
||||
@ -69,62 +54,50 @@ public class Dominate extends TeamGame
|
||||
"First team to 15000 Points wins"
|
||||
|
||||
});
|
||||
|
||||
_help = new String[]
|
||||
{
|
||||
"Capture Beacons faster with more people!",
|
||||
"Make sure you use all of your Skill/Item Tokens",
|
||||
"Collect Emeralds to get 500 Points",
|
||||
"Collect Resupply Chests to restock your inventory",
|
||||
"Customize your Class to suit your play style",
|
||||
"Diamond Sword boosts Sword Skill by 1 Level",
|
||||
"Diamond Axe boosts Axe Skill by 1 Level",
|
||||
"Gold Weapons deal 7 damage",
|
||||
"Iron Weapons deal 6 damage",
|
||||
"Diamond Weapons deal 5 damage",
|
||||
|
||||
};
|
||||
|
||||
|
||||
this.DeathOut = false;
|
||||
this.PrepareFreeze = false;
|
||||
this.PrepareFreeze = true;
|
||||
this.HungerSet = 20;
|
||||
this.WorldTimeSet = 2000;
|
||||
this.WorldTimeSet = 2000;
|
||||
|
||||
this.DeathSpectateSecs = 10;
|
||||
|
||||
this.Manager.GetDamage().UseSimpleWeaponDamage = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@Override
|
||||
public void ParseData()
|
||||
{
|
||||
for (String pointName : WorldData.GetAllCustomLocs().keySet())
|
||||
{
|
||||
_points.add(new CapturePoint(this, pointName, WorldData.GetAllCustomLocs().get(pointName).get(0)));
|
||||
}
|
||||
}
|
||||
|
||||
for (Location loc : WorldData.GetDataLocs("YELLOW"))
|
||||
{
|
||||
{
|
||||
_resupply.add(new Resupply(this, loc));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (Location loc : WorldData.GetDataLocs("LIME"))
|
||||
{
|
||||
_emerald.add(new Emerald(this, loc));
|
||||
}
|
||||
}
|
||||
|
||||
CreatureAllowOverride = true;
|
||||
|
||||
for (int i = 0; i < GetKits().length && i < WorldData.GetDataLocs("RED").size() && i < WorldData.GetDataLocs("BLUE").size(); i++)
|
||||
//Spawn Kits
|
||||
if (this instanceof ChampionsDominate)
|
||||
{
|
||||
Entity ent = GetKits()[i].SpawnEntity(WorldData.GetDataLocs("RED").get(i));
|
||||
Manager.GetLobby().AddKitLocation(ent, GetKits()[i], WorldData.GetDataLocs("RED").get(i));
|
||||
CreatureAllowOverride = true;
|
||||
|
||||
ent = GetKits()[i].SpawnEntity(WorldData.GetDataLocs("BLUE").get(i));
|
||||
Manager.GetLobby().AddKitLocation(ent, GetKits()[i], WorldData.GetDataLocs("BLUE").get(i));
|
||||
for (int i = 0; i < GetKits().length && i < WorldData.GetDataLocs("RED").size() && i < WorldData.GetDataLocs("BLUE").size(); i++)
|
||||
{
|
||||
Entity ent = GetKits()[i].SpawnEntity(WorldData.GetDataLocs("RED").get(i));
|
||||
Manager.GetLobby().AddKitLocation(ent, GetKits()[i], WorldData.GetDataLocs("RED").get(i));
|
||||
|
||||
ent = GetKits()[i].SpawnEntity(WorldData.GetDataLocs("BLUE").get(i));
|
||||
Manager.GetLobby().AddKitLocation(ent, GetKits()[i], WorldData.GetDataLocs("BLUE").get(i));
|
||||
}
|
||||
|
||||
CreatureAllowOverride = false;
|
||||
}
|
||||
|
||||
CreatureAllowOverride = false;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -306,12 +279,6 @@ public class Dominate extends TeamGame
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ValidateKit(Player player, GameTeam team)
|
||||
{
|
||||
// NOTHING
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void InventoryLock(InventoryClickEvent event)
|
||||
{
|
||||
@ -322,9 +289,8 @@ public class Dominate extends TeamGame
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeathMessageType GetDeathMessageType()
|
||||
public String GetMode()
|
||||
{
|
||||
return DeathMessageType.Detailed;
|
||||
return "Domination";
|
||||
}
|
||||
}
|
@ -1,15 +1,13 @@
|
||||
package nautilus.game.arcade.game.games.champions_dominate.map;
|
||||
package nautilus.game.arcade.game.games.common.dominate_data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
import mineplex.core.common.util.UtilFirework;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.games.champions_dominate.Dominate;
|
||||
import nautilus.game.arcade.game.games.common.Domination;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Color;
|
||||
@ -24,7 +22,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
public class CapturePoint
|
||||
{
|
||||
private Dominate Host;
|
||||
private Domination Host;
|
||||
|
||||
private String _name;
|
||||
|
||||
@ -44,7 +42,7 @@ public class CapturePoint
|
||||
|
||||
private int _indicatorTick = 0;
|
||||
|
||||
public CapturePoint(Dominate host, String name, Location loc)
|
||||
public CapturePoint(Domination host, String name, Location loc)
|
||||
{
|
||||
Host = host;
|
||||
|
@ -1,11 +1,11 @@
|
||||
package nautilus.game.arcade.game.games.champions_dominate.map;
|
||||
package nautilus.game.arcade.game.games.common.dominate_data;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilFirework;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.games.champions_dominate.Dominate;
|
||||
import nautilus.game.arcade.game.games.common.Domination;
|
||||
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.FireworkEffect;
|
||||
@ -21,14 +21,14 @@ import org.bukkit.util.Vector;
|
||||
|
||||
public class Emerald
|
||||
{
|
||||
private Dominate Host;
|
||||
private Domination Host;
|
||||
|
||||
private Location _loc;
|
||||
|
||||
private long _time;
|
||||
private Item _ent;
|
||||
|
||||
public Emerald(Dominate host, Location loc)
|
||||
public Emerald(Domination host, Location loc)
|
||||
{
|
||||
Host = host;
|
||||
|
@ -1,11 +1,11 @@
|
||||
package nautilus.game.arcade.game.games.champions_dominate.map;
|
||||
package nautilus.game.arcade.game.games.common.dominate_data;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilFirework;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.games.champions_dominate.Dominate;
|
||||
import nautilus.game.arcade.game.games.common.Domination;
|
||||
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.FireworkEffect;
|
||||
@ -21,14 +21,14 @@ import org.bukkit.util.Vector;
|
||||
|
||||
public class Resupply
|
||||
{
|
||||
private Dominate Host;
|
||||
private Domination Host;
|
||||
|
||||
private Location _loc;
|
||||
|
||||
private long _time;
|
||||
private Item _ent;
|
||||
|
||||
public Resupply(Dominate host, Location loc)
|
||||
public Resupply(Domination host, Location loc)
|
||||
{
|
||||
Host = host;
|
||||
|
@ -29,7 +29,6 @@ public class GravityPlayer extends GravityObject
|
||||
public GravityPlayer(Gravity host, Entity ent, double mass, Vector vel)
|
||||
{
|
||||
super(host, ent, mass, 2, vel);
|
||||
|
||||
SetMovingBat(false);
|
||||
}
|
||||
|
||||
|
@ -67,6 +67,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.events.PlayerPrepareTeleportEvent;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.TeamGame;
|
||||
import nautilus.game.arcade.game.games.hideseek.forms.BlockForm;
|
||||
@ -278,13 +279,10 @@ public class HideSeek extends TeamGame
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void InitialDisguise(GameStateChangeEvent event)
|
||||
public void InitialDisguise(PlayerPrepareTeleportEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.Prepare)
|
||||
return;
|
||||
|
||||
for (Player player : _hiders.GetPlayers(true))
|
||||
_forms.put(player, new BlockForm(this, player, _allowedBlocks.get(UtilMath.r(_allowedBlocks.size()))));
|
||||
if (_hiders.HasPlayer(event.GetPlayer().getName(), true))
|
||||
_forms.put(event.GetPlayer(), new BlockForm(this, event.GetPlayer(), _allowedBlocks.get(UtilMath.r(_allowedBlocks.size()))));
|
||||
}
|
||||
|
||||
|
||||
@ -826,7 +824,7 @@ public class HideSeek extends TeamGame
|
||||
{
|
||||
//Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(player, null, null,
|
||||
DamageCause.DROWNING, 1, false, false, false,
|
||||
DamageCause.DROWNING, 2, false, false, false,
|
||||
"Water", "Water Damage");
|
||||
|
||||
player.getWorld().playSound(player.getLocation(),
|
||||
|
@ -40,6 +40,8 @@ public class BlockForm extends Form
|
||||
|
||||
_mat = mat;
|
||||
_loc = player.getLocation();
|
||||
|
||||
System.out.println("Block Form: " + _mat + " " + _mat.getId());
|
||||
|
||||
Apply();
|
||||
}
|
||||
@ -68,7 +70,11 @@ public class BlockForm extends Form
|
||||
FallingBlockCheck();
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(Player, F.main("Game", C.cWhite + "You are now a " + F.elem(ItemStackFactory.Instance.GetName(_mat, (byte)0, false) + " Block") + "!"));
|
||||
String blockName = F.elem(ItemStackFactory.Instance.GetName(_mat, (byte)0, false));
|
||||
if (!blockName.contains("Block"))
|
||||
UtilPlayer.message(Player, F.main("Game", C.cWhite + "You are now a " + F.elem(ItemStackFactory.Instance.GetName(_mat, (byte)0, false) + " Block") + "!"));
|
||||
else
|
||||
UtilPlayer.message(Player, F.main("Game", C.cWhite + "You are now a " + F.elem(ItemStackFactory.Instance.GetName(_mat, (byte)0, false)) + "!"));
|
||||
|
||||
//Give Item
|
||||
Player.getInventory().setItem(8, new ItemStack(Host.GetItemEquivilent(_mat)));
|
||||
|
@ -383,4 +383,9 @@ public class SuperSmash extends SoloGame
|
||||
int amount = Math.max(1, (int)(event.GetDamage()/2));
|
||||
UtilPlayer.hunger(damager, amount);
|
||||
}
|
||||
|
||||
public String GetMode()
|
||||
{
|
||||
return "Deathmatch";
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,40 @@
|
||||
package nautilus.game.arcade.game.games.smash;
|
||||
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.game.games.common.Domination;
|
||||
import nautilus.game.arcade.game.games.smash.kits.*;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
|
||||
public class SuperSmashDominate extends Domination
|
||||
{
|
||||
public SuperSmashDominate(ArcadeManager manager)
|
||||
{
|
||||
super(manager, GameType.SmashDomination,
|
||||
|
||||
new Kit[]
|
||||
{
|
||||
|
||||
new KitSkeleton(manager),
|
||||
new KitGolem(manager),
|
||||
new KitSpider(manager),
|
||||
new KitSlime(manager),
|
||||
|
||||
new KitCreeper(manager),
|
||||
new KitEnderman(manager),
|
||||
new KitSnowman(manager),
|
||||
new KitWolf(manager),
|
||||
|
||||
|
||||
new KitBlaze(manager),
|
||||
new KitWitch(manager),
|
||||
new KitChicken(manager),
|
||||
new KitSkeletalHorse(manager),
|
||||
new KitPig(manager),
|
||||
new KitSkySquid(manager),
|
||||
new KitWitherSkeleton(manager),
|
||||
new KitMagmaCube(manager),
|
||||
|
||||
});
|
||||
}
|
||||
}
|
@ -132,12 +132,12 @@ public class PerkBarrage extends Perk
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void BarrageFireBow(EntityShootBowEvent event)
|
||||
{
|
||||
if (event.isCancelled() || !event.getProjectile().isValid())
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
||||
if (!Manager.GetGame().IsLive())
|
||||
return;
|
||||
|
||||
|
||||
if (!(event.getEntity() instanceof Player))
|
||||
return;
|
||||
|
||||
|
@ -96,7 +96,7 @@ public class PerkSlimeRocket extends Perk implements IThrown
|
||||
if (!Kit.HasKit(player))
|
||||
return;
|
||||
|
||||
if (!Recharge.Instance.use(player, GetName(), 4000, true, false))
|
||||
if (!Recharge.Instance.use(player, GetName(), 4000, true, true))
|
||||
return;
|
||||
|
||||
//Spawn Slime
|
||||
|
@ -25,7 +25,9 @@ import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
@ -73,7 +75,7 @@ public class PerkWitherSkull extends Perk
|
||||
WitherSkull skull = player.launchProjectile(WitherSkull.class);
|
||||
skull.setDirection(player.getLocation().getDirection());
|
||||
|
||||
_active.put(skull, player.getLocation().getDirection());
|
||||
_active.put(skull, player.getLocation().getDirection().multiply(0.6));
|
||||
|
||||
//Sound
|
||||
player.getWorld().playSound(player.getLocation(), Sound.WITHER_SHOOT, 1f, 1f);
|
||||
|
@ -259,7 +259,10 @@ public class GameLobbyManager implements IPacketRunnable, Listener
|
||||
if (event.GetState() != GameState.Recruit)
|
||||
return;
|
||||
|
||||
WriteGameLine(event.GetGame().WorldData.MapName, 1, 159, (byte)4);
|
||||
if (event.GetGame().GetMode() == null)
|
||||
WriteGameLine(event.GetGame().WorldData.MapName, 1, 159, (byte)4);
|
||||
else
|
||||
WriteGameLine(event.GetGame().WorldData.MapName, 2, 159, (byte)4);
|
||||
|
||||
CreateTeams(event.GetGame());
|
||||
}
|
||||
@ -714,7 +717,7 @@ public class GameLobbyManager implements IPacketRunnable, Listener
|
||||
{
|
||||
WriteAdvertiseLine("KEEP CALM", 0, 159, (byte)4);
|
||||
WriteAdvertiseLine("AND", 1, 159, (byte)15);
|
||||
WriteAdvertiseLine("PLAY MINEPLEX", 2, 159, (byte)15);
|
||||
WriteAdvertiseLine("PLAY MINEPLEX", 2, 159, (byte)4);
|
||||
|
||||
WriteAdvertiseLine("www.mineplex.com", 4, 159, (byte)15);
|
||||
}
|
||||
@ -800,8 +803,12 @@ public class GameLobbyManager implements IPacketRunnable, Listener
|
||||
|
||||
public void DisplayNext(Game game, HashMap<String, ChatColor> pastTeams)
|
||||
{
|
||||
WriteGameLine(game.GetName(), 0, 159, (byte)14);
|
||||
WriteGameLine(" ", 1, 159, (byte)4);
|
||||
WriteGameLine(game.GetType().GetLobbyName(), 0, 159, (byte)14);
|
||||
|
||||
if (game.GetMode() == null)
|
||||
WriteGameLine(" ", 1, 159, (byte)14);
|
||||
else
|
||||
WriteGameLine(game.GetMode(), 1, 159, (byte)14);
|
||||
|
||||
|
||||
DisplayWaiting();
|
||||
|
Loading…
Reference in New Issue
Block a user