Additional kit changes

This commit is contained in:
Sam 2017-03-26 13:39:12 +01:00
parent 60231c817f
commit 28fa092b20
6 changed files with 40 additions and 12 deletions

View File

@ -185,7 +185,7 @@ public class Bridge extends TeamGame implements OreObsfucation
WorldTimeSet = 2000;
WorldWaterDamage = 0;
WorldBoundaryKill = false;
WorldBoundaryKill = true;
DeathDropItems = true;
@ -1744,7 +1744,7 @@ public class Bridge extends TeamGame implements OreObsfucation
if (!UtilAlg.inBoundingBox(location, one, two))
{
player.setVelocity(UtilAlg.getTrajectory(location, average).multiply(3).add(new Vector(0, 0.5, 0)));
player.setVelocity(UtilAlg.getTrajectory(location, average).multiply(2).add(new Vector(0, 0.5, 0)));
player.sendMessage(C.cRedB + "STAY ON YOUR ISLAND!");
player.playSound(player.getLocation(), Sound.NOTE_PLING, 1, 0.5F);
}

View File

@ -16,12 +16,12 @@ public class KitApple extends ProgressingKit
private static final String[] DESCRIPTION = {
"Possess the rare skill of finding apples frequently!",
"",
receiveItem("apple", 1, 17, 0),
receiveItem("apple", 1, 10, 0),
click(true, "the apple to throw it")
};
private static final Perk[] PERKS = {
new PerkApple(17000)
new PerkApple(10000, 500)
};
private static final ItemStack IN_HAND = new ItemStack(Material.APPLE);

View File

@ -25,7 +25,7 @@ public class KitBerserker extends ProgressingKit
};
private static final Perk[] PERKS = {
new PerkLeap("Beserker Leap", 1.2, 1.2, 14000),
new PerkLeap("Beserker Leap", 1.2, 1.2, 10000),
new PerkAxeman(),
};

View File

@ -20,14 +20,14 @@ public class KitBrawler extends ProgressingKit
"Giant and muscular, easily smacks others around.",
" ",
"Begin with an Iron Sword",
"Take " + C.cGreen + "75%" + C.cWhite + " knockback",
"Deal " + C.cGreen + "125%" + C.cWhite + " knockback",
"Take " + C.cGreen + "-0.5" + C.cWhite + " damage from all attacks"
"Take " + C.cGreen + "85%" + C.cWhite + " knockback",
"Deal " + C.cGreen + "115%" + C.cWhite + " knockback",
"Take " + C.cGreen + "-1" + C.cWhite + " damage from all attacks"
};
private static final Perk[] PERKS = {
new PerkMammoth(),
new PerkIronSkin(0.5)
new PerkIronSkin(1)
};
private static final ItemStack[] PLAYER_ITEMS = {

View File

@ -28,7 +28,7 @@ public class KitBrawlAppler extends ProgressingKit
private static final Perk[] PERKS =
{
new PerkApple(3000)
new PerkApple(3000, 0)
};
private static final ItemStack IN_HAND = new ItemStack(Material.APPLE);

View File

@ -21,14 +21,19 @@ 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.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import java.util.Iterator;
public class PerkApple extends Perk implements IThrown
{
private long _spawnDelay;
public PerkApple(long delay)
private long _throwDelay;
public PerkApple(long delay, long throwDelay)
{
super("Apple Thrower", new String[]
{
@ -37,6 +42,7 @@ public class PerkApple extends Perk implements IThrown
});
_spawnDelay = delay;
_throwDelay = throwDelay;
}
@EventHandler
@ -80,6 +86,11 @@ public class PerkApple extends Perk implements IThrown
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, getMessage(player) + " Throw", _throwDelay, true, false))
{
return;
}
event.setCancelled(true);
@ -132,6 +143,23 @@ public class PerkApple extends Perk implements IThrown
}
@EventHandler
public void playerDeath(PlayerDeathEvent event)
{
if (!hasPerk(event.getEntity()))
{
return;
}
for (ItemStack itemStack : event.getDrops())
{
if (itemStack.getType() == Material.APPLE)
{
itemStack.setAmount((int) Math.ceil((double) itemStack.getAmount() / 2D));
}
}
}
private Material getMaterial(Player player)
{
if (Manager.getCosmeticManager().getGadgetManager().isKitModifierActive(KitModifier.Bridges_Apple_Potato, player))