This commit is contained in:
Chiss 2013-11-07 19:49:21 +11:00
parent 8fa7b9f283
commit dc062c7bb6
8 changed files with 140 additions and 32 deletions

View File

@ -44,7 +44,7 @@ public class HideSeek extends TeamGame
private GameTeam _hiders; private GameTeam _hiders;
private GameTeam _seekers; private GameTeam _seekers;
private long _hideTime = 15000; private long _hideTime = 20000;
private long _gameTime = 300000; private long _gameTime = 300000;
private boolean _started = false; private boolean _started = false;
@ -92,6 +92,8 @@ public class HideSeek extends TeamGame
_allowedBlocks.add(Material.ANVIL); _allowedBlocks.add(Material.ANVIL);
_allowedBlocks.add(Material.HAY_BLOCK); _allowedBlocks.add(Material.HAY_BLOCK);
_allowedBlocks.add(Material.CAKE); _allowedBlocks.add(Material.CAKE);
Manager.GetExplosion().SetRegenerate(true);
} }
public Material GetItemEquivilent(Material mat) public Material GetItemEquivilent(Material mat)
@ -164,7 +166,7 @@ public class HideSeek extends TeamGame
{ {
DisguiseBlock disguise = new DisguiseBlock(player, type.getId(), 0); DisguiseBlock disguise = new DisguiseBlock(player, type.getId(), 0);
_disguises.put(player, disguise); _disguises.put(player, disguise);
//Manager.GetDisguise().disguise(disguise); Manager.GetDisguise().disguise(disguise);
//Inform //Inform
UtilPlayer.message(player, F.main("Game", C.cWhite + "You are now a " + F.elem(ItemStackFactory.Instance.GetName(type, (byte)0, false) + " Block") + "!")); UtilPlayer.message(player, F.main("Game", C.cWhite + "You are now a " + F.elem(ItemStackFactory.Instance.GetName(type, (byte)0, false) + " Block") + "!"));
@ -389,6 +391,12 @@ public class HideSeek extends TeamGame
} }
} }
@Override
public double GetKillsGems(Player killer, Player killed, boolean assist)
{
return 4;
}
@EventHandler @EventHandler
public void Timer(UpdateEvent event) public void Timer(UpdateEvent event)
{ {
@ -401,29 +409,29 @@ public class HideSeek extends TeamGame
//Hide Time //Hide Time
if (!_started) if (!_started)
{ {
long timeLeft = _gameTime - (System.currentTimeMillis() - GetStateTime()); long timeLeft = _hideTime - (System.currentTimeMillis() - GetStateTime());
if (timeLeft > 0) if (timeLeft > 0)
{ {
GetObjectiveSide().setDisplayName( GetObjectiveSide().setDisplayName(
ChatColor.WHITE + "§lSeek Time: " + C.cGreen + "§l" ChatColor.AQUA + "§lHide Time: " + C.cGreen + "§l"
+ UtilTime.MakeStr(timeLeft)); + UtilTime.MakeStr(timeLeft));
} }
else else
{ {
_started = true; _started = true;
Announce(C.Bold + "The " + F.elem(C.cRed + C.Bold + "Seekers") + " have been released!"); Announce(C.Bold + "The " + F.elem(C.cRed + C.Bold + "Seekers") + ChatColor.RESET + C.Bold + " have been released!");
} }
} }
//Seek Time //Seek Time
else else
{ {
long timeLeft = _gameTime - (System.currentTimeMillis() - GetStateTime()); long timeLeft = _gameTime - (System.currentTimeMillis() - GetStateTime() - _hideTime);
if (timeLeft > 0) if (timeLeft > 0)
{ {
GetObjectiveSide().setDisplayName( GetObjectiveSide().setDisplayName(
ChatColor.WHITE + "§lSeek Time: " + C.cGreen + "§l" ChatColor.RED + "§lSeek Time: " + C.cGreen + "§l"
+ UtilTime.MakeStr(timeLeft)); + UtilTime.MakeStr(timeLeft));
} }
else else

View File

@ -5,11 +5,14 @@ import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitAvailability;
@ -36,33 +39,11 @@ public class KitSeekerArcher extends Kit
} }
@EventHandler
public void FireItemResist(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
if (Manager.GetGame() == null)
return;
for (Player player : Manager.GetGame().GetPlayers(true))
{
if (!HasKit(player))
continue;
Manager.GetCondition().Factory().FireItemImmunity(GetName(), player, player, 1.9, false);
}
}
@Override @Override
public void GiveItems(Player player) public void GiveItems(Player player)
{ {
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.STONE_SWORD)); player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW)); player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.ARROW, 32));
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.CHAINMAIL_HELMET)); player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET));
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE)); player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE));
@ -78,4 +59,20 @@ public class KitSeekerArcher extends Kit
ent.getEquipment().setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS)); ent.getEquipment().setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS));
ent.getEquipment().setBoots(new ItemStack(Material.CHAINMAIL_BOOTS)); ent.getEquipment().setBoots(new ItemStack(Material.CHAINMAIL_BOOTS));
} }
@EventHandler(priority = EventPriority.LOW)
public void Damage(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetCause() != DamageCause.ENTITY_EXPLOSION)
return;
Player damagee = event.GetDamageePlayer();
if (damagee == null) return;
if (HasKit(damagee))
event.SetCancelled("TNT Resistant");
}
} }

View File

@ -2,10 +2,15 @@ package nautilus.game.arcade.game.games.hideseek.kits;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitAvailability;
@ -43,5 +48,28 @@ public class KitSeekerRadar extends Kit
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BOOTS)); player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BOOTS));
} }
@Override
public void SpawnCustom(LivingEntity ent)
{
ent.getEquipment().setHelmet(new ItemStack(Material.DIAMOND_HELMET));
ent.getEquipment().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
ent.getEquipment().setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
ent.getEquipment().setBoots(new ItemStack(Material.DIAMOND_BOOTS));
}
@EventHandler(priority = EventPriority.LOW)
public void Damage(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetCause() != DamageCause.ENTITY_EXPLOSION)
return;
Player damagee = event.GetDamageePlayer();
if (damagee == null) return;
if (HasKit(damagee))
event.SetCancelled("TNT Resistant");
}
} }

View File

@ -2,10 +2,15 @@ package nautilus.game.arcade.game.games.hideseek.kits;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitAvailability;
@ -41,4 +46,29 @@ public class KitSeekerTNT extends Kit
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.GOLD_LEGGINGS)); player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.GOLD_LEGGINGS));
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.GOLD_BOOTS)); player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.GOLD_BOOTS));
} }
@Override
public void SpawnCustom(LivingEntity ent)
{
ent.getEquipment().setHelmet(new ItemStack(Material.GOLD_HELMET));
ent.getEquipment().setChestplate(new ItemStack(Material.GOLD_CHESTPLATE));
ent.getEquipment().setLeggings(new ItemStack(Material.GOLD_LEGGINGS));
ent.getEquipment().setBoots(new ItemStack(Material.GOLD_BOOTS));
}
@EventHandler(priority = EventPriority.LOW)
public void Damage(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetCause() != DamageCause.ENTITY_EXPLOSION)
return;
Player damagee = event.GetDamageePlayer();
if (damagee == null) return;
if (HasKit(damagee))
event.SetCancelled("TNT Resistant");
}
} }

View File

@ -62,7 +62,7 @@ public class PerkRadar extends Perk
closest = dist; closest = dist;
} }
double scale = Math.max(0, Math.min(1, (closest - 2) / 8d)); double scale = Math.max(0, Math.min(1, (closest - 3) / 10d));
//Bi-Directional Cooldown //Bi-Directional Cooldown
if (_lastTick.containsKey(player) && !UtilTime.elapsed(_lastTick.get(player), (long)(2000 * scale)) && !Recharge.Instance.usable(player, "Radar")) if (_lastTick.containsKey(player) && !UtilTime.elapsed(_lastTick.get(player), (long)(2000 * scale)) && !Recharge.Instance.usable(player, "Radar"))

View File

@ -143,6 +143,7 @@ public class GameCreationManager implements Listener
Manager.GetDamage().DisableDamageChanges = false; Manager.GetDamage().DisableDamageChanges = false;
Manager.GetCreature().SetDisableCustomDrops(false); Manager.GetCreature().SetDisableCustomDrops(false);
Manager.GetDamage().SetEnabled(true); Manager.GetDamage().SetEnabled(true);
Manager.GetExplosion().SetRegenerate(false);
HashMap<String, ChatColor> pastTeams = null; HashMap<String, ChatColor> pastTeams = null;

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Nautilus.Game.CaptureThePig</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>auto,full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/CaptureThePig.launch</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Nautilus.Game.Deathmatch</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>