removed border attack stuff

This commit is contained in:
Mini-Chiss 2015-05-11 21:00:38 -05:00
parent 643ed2c047
commit ed90e97c68

View File

@ -298,7 +298,6 @@ public class UHC extends TeamGame
// 24 @ 100+ reduced to 0 at 32-
double borderAttackDist = Math.max(8, (Math.min(100, border) - 28d) / 3d);
double borderCheckDist = borderAttackDist + 6;
for (Player player : UtilServer.getPlayers())
{
@ -326,84 +325,6 @@ public class UHC extends TeamGame
}
}
}
if (border < 32)
continue;
// Attack Players who are nearby
boolean isX = true;
Location attackSource = null;
if (loc.getX() > (border - borderCheckDist))
{
attackSource = player.getLocation();
attackSource.setX(border);
}
else if (loc.getX() < (-border - borderCheckDist))
{
attackSource = player.getLocation();
attackSource.setX(border);
}
else if (loc.getZ() > (border - borderCheckDist))
{
attackSource = player.getLocation();
attackSource.setZ(border);
isX = false;
}
else if (loc.getZ() < (-border - borderCheckDist))
{
attackSource = player.getLocation();
attackSource.setZ(border);
isX = false;
}
if (attackSource != null)
{
double dist = UtilMath.offset(player.getLocation(), attackSource);
double scale = 1 - (dist / borderAttackDist);
player.playSound(player.getLocation().add(UtilAlg.getTrajectory(player.getLocation(), attackSource).multiply(8)),
Sound.PORTAL, (float) (1 - (dist / borderCheckDist)) * 2, 2f);
if (!Manager.IsAlive(player))
continue;
// Shoot more frequently when they get closer
if (dist < borderAttackDist && Math.random() < scale)
{
// Spawn Fireball
Location spawn = attackSource.clone();
spawn.add(isX ? 0 : (Math.random() - 0.5) * 12, 4 + Math.random() * 2 + (Math.random() * 12 * scale),
isX ? (Math.random() - 0.5) * 12 : 0);
// Raytrace back
double maxBack = 8;
double back = 0;
while (spawn.getBlock().getType() == Material.AIR && back < maxBack)
{
spawn.subtract(UtilAlg.getTrajectory(spawn, player.getLocation()).multiply(0.2));
back += 0.1;
}
// Move out of block
spawn.add(UtilAlg.getTrajectory(spawn, player.getLocation()).multiply(Math.min(back, 1)));
Fireball ball = player.getWorld().spawn(spawn, Fireball.class);
// Trajectory
Vector traj = UtilAlg.getTrajectory(spawn, player.getLocation());
traj.add(new Vector((Math.random() - 0.5) * 0.2, (Math.random() - 0.5) * 0.2, (Math.random() - 0.5) * 0.2));
EntityLargeFireball eFireball = ((CraftLargeFireball) ball).getHandle();
eFireball.dirX = traj.getX() * 0.1;
eFireball.dirY = traj.getY() * 0.1;
eFireball.dirZ = traj.getZ() * 0.1;
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, spawn, 0, 0, 0, 0, 1, ViewDist.MAX,
UtilServer.getPlayers());
player.getWorld().playSound(attackSource, Sound.GHAST_FIREBALL, 2f, 2f);
}
}
}
}
@ -498,8 +419,8 @@ public class UHC extends TeamGame
for (int i = 0; i < chunksPerTick; i++)
{
// Unload Previous
if (_chunk != null)
_chunk.unload(true);
// if (_chunk != null)
// _chunk.unload(true);
// Load Chunks
_chunk = WorldData.World.getChunkAt(_chunkX, _chunkZ);