balance changes for SG

This commit is contained in:
Cheese 2015-03-20 20:43:42 +11:00
parent 57502c226f
commit 446951d8af
7 changed files with 155 additions and 18 deletions

View File

@ -2050,6 +2050,8 @@ public class SurvivalGames extends SoloGame
TNTPrimed tnt = player.getWorld()
.spawn(player.getEyeLocation().add(player.getLocation().getDirection()), TNTPrimed.class);
tnt.setFuseTicks(30);
UtilAction.velocity(tnt, player.getLocation().getDirection(), 0.5, false, 0, 0.1, 10, false);

View File

@ -57,7 +57,7 @@ public class PerkAxeThrower extends Perk implements IThrown
org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(player.getItemInHand().getType()));
UtilAction.velocity(ent, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false);
Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 2d);
Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 2.5d);
//Remove Axe
player.setItemInHand(null);

View File

@ -56,12 +56,12 @@ public class PerkBladeVortex extends Perk
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, GetName(), 30000, true, true))
if (!Recharge.Instance.use(player, GetName(), 24000, true, true))
return;
Recharge.Instance.setDisplayForce(player, GetName(), true);
event.setCancelled(true);
event.setCancelled(true);
//Pull + Damage
HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(player.getLocation(), 7);

View File

@ -68,15 +68,12 @@ public class PerkSeismicSlamHG extends Perk
if (cur.equals(player))
continue;
if (!UtilEnt.isGrounded(player))
continue;
cur.playEffect(EntityEffect.HURT);
//Velocity
UtilAction.velocity(cur,
UtilAlg.getTrajectory2d(player.getLocation().toVector(), cur.getLocation().toVector()),
1.8 * targets.get(cur), true, 0, 0.4 + 1.0 * targets.get(cur), 1.6, true);
1.8 * targets.get(cur), true, 0, 0.4 + 1.0 * targets.get(cur), 1.4, true);
//Condition
Manager.GetCondition().Factory().Falling(GetName(), cur, player, 10, false, true);

View File

@ -181,9 +181,9 @@ public class PerkSkeletons extends Perk
if (UtilMath.offset(skel, player) > range)
{
float speed = 1f;
float speed = 1.25f;
if (player.isSprinting())
speed = 1.4f;
speed = 1.75f;
//Move
Location target = skel.getLocation().add(UtilAlg.getTrajectory(skel, player).multiply(3));

View File

@ -2,29 +2,43 @@ package nautilus.game.arcade.kit.perks;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftTNTPrimed;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
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.UtilAlg;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilServer;
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 PerkTNTArrow extends Perk
{
private HashSet<Player> _active = new HashSet<Player>();
private HashMap<Entity, Player> _tntMap = new HashMap<Entity, Player>();
private HashSet<Arrow> _arrows = new HashSet<Arrow>();
public PerkTNTArrow()
{
@ -35,7 +49,7 @@ public class PerkTNTArrow extends Perk
}
@EventHandler
public void Fire(PlayerInteractEvent event)
public void activate(PlayerInteractEvent event)
{
if (!Manager.GetGame().IsLive())
return;
@ -80,7 +94,7 @@ public class PerkTNTArrow extends Perk
}
@EventHandler
public void ShootBow(EntityShootBowEvent event)
public void shootBow(EntityShootBowEvent event)
{
if (!(event.getEntity() instanceof Player))
return;
@ -96,10 +110,134 @@ public class PerkTNTArrow extends Perk
//Inform
UtilPlayer.message(player, F.main("Game", "You fired " + F.skill(GetName()) + "."));
//TNT
TNTPrimed tnt = player.getWorld().spawn(player.getLocation(), TNTPrimed.class);
((CraftTNTPrimed)tnt).getHandle().spectating = true;
event.getProjectile().setPassenger(tnt);
_tntMap.put(tnt, player);
_arrows.add((Arrow)event.getProjectile());
}
@EventHandler(priority = EventPriority.HIGH)
public void hitEntityTrigger(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetCause() != DamageCause.PROJECTILE)
return;
Projectile projectile = event.GetProjectile();
if (projectile == null)
return;
if (!_arrows.remove(event.GetProjectile()))
return;
event.SetCancelled(GetName());
Location loc = event.GetDamageeEntity().getLocation().subtract(event.GetProjectile().getVelocity().normalize().multiply(0.1));
trigger((Arrow)event.GetProjectile(), loc);
}
@EventHandler
public void hitBlockTrigger(ProjectileHitEvent event)
{
Projectile proj = event.getEntity();
if (!_arrows.contains(proj))
return;
if (proj.getShooter() == null)
return;
if (!(proj.getShooter() instanceof Player))
return;
final Arrow arrow = (Arrow)proj;
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), new Runnable()
{
public void run()
{
try
{
//If it hasnt already triggered (via damage)
if (_arrows.remove(arrow))
trigger(arrow, arrow.getLocation());
}
catch (Exception e)
{
e.printStackTrace();
}
}
}, 0);
//Remove
proj.remove();
}
@EventHandler
public void cleanTrigger(UpdateEvent event)
{
if (event.getType() != UpdateType.SEC)
return;
for (Iterator<Arrow> arrowIterator = _arrows.iterator(); arrowIterator.hasNext();)
{
Arrow arrow = arrowIterator.next();
if (arrow.isDead() || !arrow.isValid() || arrow.isOnGround() || arrow.getTicksLived() > 60)
{
arrowIterator.remove();
trigger(arrow, arrow.getLocation());
}
}
}
public void trigger(Arrow arrow, Location loc)
{
if (arrow == null)
return;
if (arrow.getShooter() == null || !(arrow.getShooter() instanceof Player))
{
arrow.remove();
return;
}
Player player = (Player)arrow.getShooter();
//Velocity Players
HashMap<Player,Double> hitMap = UtilPlayer.getInRadius(loc, 7);
for (Player cur : hitMap.keySet())
{
double range = hitMap.get(cur);
//Condition
Manager.GetCondition().Factory().Falling(GetName(), cur, player, 6, false, true);
//Damage Event
Manager.GetDamage().NewDamageEvent(cur, player, null,
DamageCause.CUSTOM, 8 * range, false, true, false,
player.getName(), GetName());
//Velocity
UtilAction.velocity(cur, UtilAlg.getTrajectory2d(loc, cur.getLocation().add(0, 1, 0)),
0.4 + 0.8 * range, false, 0, 0.2 + 0.5 * range, 1.2, true);
//Inform
if (cur instanceof Player)
UtilPlayer.message((Player)cur, F.main("Game", F.name(player.getName()) +" hit you with " + F.skill(GetName()) + "."));
}
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, loc, 0, 0, 0, 0, 1);
loc.getWorld().playSound(loc, Sound.EXPLODE, 2f, 0.75f);
}
@EventHandler
public void particle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Entity ent : _arrows)
UtilParticle.PlayParticle(ParticleType.LAVA, ent.getLocation(), 0, 0, 0, 0, 1);
}
}

View File

@ -102,7 +102,7 @@ public class PerkWolfPet extends Perk
wolf.setCollarColor(DyeColor.GREEN);
wolf.playEffect(EntityEffect.WOLF_HEARTS);
wolf.setAngry(true);
wolf.setMaxHealth(18);
wolf.setMaxHealth(14);
wolf.setHealth(wolf.getMaxHealth());
if (_baby)