Finalized after QA testing. Pretty much ready to go

This commit is contained in:
Morten 2015-07-19 19:50:53 +02:00
parent 2cad6223a7
commit c5f7c4fe0e
3 changed files with 48 additions and 26 deletions

View File

@ -259,7 +259,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
return;
}
_maxY = GetTeamList().get(1).GetSpawn().getBlockY() - 5;
_maxY = GetTeamList().get(1).GetSpawn().getBlockY() - 4;
if(event.getBlock().getLocation().getBlockY() < _maxY)
{
event.getPlayer().sendMessage(F.main("BlockChecker", "You may not build under this height!"));
@ -284,7 +284,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
}
Location blockLocation = event.getBlock().getLocation();
_maxY = GetTeamList().get(1).GetSpawn().getBlockY() - 4;
_maxY = GetTeamList().get(1).GetSpawn().getBlockY() - 3;
if(blockLocation.add(0,1,0).getBlock().getType() == Material.AIR)
{
for(Player humans: _runners.GetPlayers(true))
@ -583,19 +583,33 @@ public class WitherGame extends TeamGame implements IBlockRestorer
if (event.getType() != UpdateType.FASTER)
return;
Location _spawn = GetTeamList().get(1).GetSpawn();
for (Player player : _withers.GetPlayers(true))
{
ArrayList<Location> collisions = new ArrayList<Location>();
_maxY = GetTeamList().get(1).GetSpawn().getBlockY();
// Fly Speed
double speed = 0.09 - (_yLimit - player.getLocation().getY()) * 0.006;
double distanceToGround = player.getLocation().distance(new Location(_spawn.getWorld(), player.getLocation().getX(), _spawn.getY(), player.getLocation().getZ()));
double speed;
if (speed > 0.16)
if (distanceToGround < 8)
{
speed = 0.16;
}
else
{
speed = 0.09 - (_yLimit - player.getLocation().getY()) * 0.006;
}
if (speed < 0.016)
if (distanceToGround < 4)
{
speed = 0.016;
}
else
{
speed = 0.09 - (_yLimit - player.getLocation().getY()) * 0.006;
}
player.setFlySpeed((float) speed);
@ -767,7 +781,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
_doubles.put(player, new PlayerCopy(this, player, ChatColor.YELLOW));
}
public void playerIn(final Player player, final LivingEntity copy)
public void playerIn(final Player player, final LivingEntity copy, Player revivedBy)
{
// State
SetPlayerState(player, PlayerState.IN);
@ -794,7 +808,14 @@ public class WitherGame extends TeamGame implements IBlockRestorer
player.getInventory().remove(Material.COMPASS);
// Inform
UtilPlayer.message(player, F.main("Game", "You have been revived!"));
if(revivedBy != null)
{
UtilPlayer.message(player, F.main("Game", "You have been revived by " + C.cGold + revivedBy.getName()));
}
else
{
UtilPlayer.message(player, F.main("Game", "You have been revived!"));
}
// Delayed Visibility
if (copy != null)
@ -841,7 +862,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
if (throwerTeam == null)
return;
// Revive
// Revive a copy
Iterator<PlayerCopy> copyIterator = _doubles.values().iterator();
while (copyIterator.hasNext())
{
@ -855,7 +876,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
event.getEntity().getLocation()) > 3)
continue;
playerIn(copy.GetPlayer(), copy.GetEntity());
playerIn(copy.GetPlayer(), copy.GetEntity(), thrower);
copyIterator.remove();
AddGems(thrower, 3, "Revived Ally", true, true);
@ -863,19 +884,19 @@ public class WitherGame extends TeamGame implements IBlockRestorer
Bukkit.getPluginManager().callEvent(new HumanReviveEvent(thrower, copy.GetPlayer()));
}
// Revive
for (Player player : GetPlayers(true))
{
GameTeam otherTeam = GetTeam(player);
if (otherTeam == null || !otherTeam.equals(throwerTeam))
continue;
if (UtilMath.offset(player.getLocation().add(0, 1, 0), event
.getEntity().getLocation()) > 3)
continue;
playerIn(player, null);
}
// Revive a player
// for (Player player : GetPlayers(true))
// {
// GameTeam otherTeam = GetTeam(player);
// if (otherTeam == null || !otherTeam.equals(throwerTeam))
// continue;
//
// if (UtilMath.offset(player.getLocation().add(0, 1, 0), event
// .getEntity().getLocation()) > 3)
// continue;
//
// playerIn(player, null, thrower);
// }
}
@EventHandler

View File

@ -6,6 +6,7 @@ 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.PerkDoubleJump;
import org.bukkit.ChatColor;
import org.bukkit.Material;
@ -21,11 +22,11 @@ public class KitHumanEditor extends Kit
super(manager, "Human Editor", KitAvailability.Gem, 5000,
new String[]
{
" ", "Can " + C.cYellow + "Edit " + C.cGray + "the terrain to him and his comrade's benefits", " "
" ", "Can " + C.cYellow + "Edit " + C.cGray + "the terrain to they and their comrade's benefits", " "
},
new Perk[]
{
new PerkDoubleJump("Double Jump", 1, 0.8, true, 6000, true),
},
EntityType.ZOMBIE, new ItemStack(Material.STONE_PICKAXE));
}

View File

@ -50,7 +50,7 @@ public class KitHumanMedic extends Kit
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
ItemStack potion = new ItemStack(Material.POTION, 1, (short)16429); // 16422
ItemStack potion = new ItemStack(Material.POTION, 2, (short)16429); // 16422
PotionMeta potionMeta = (PotionMeta)potion.getItemMeta();
potionMeta.setDisplayName(ChatColor.RESET + "Revival Potion");
potion.setItemMeta(potionMeta);