Increase arrow hitbox

This commit is contained in:
Sam 2017-11-24 22:30:22 +00:00 committed by Alexander Meech
parent 9920c2d9ab
commit 2720e78932
2 changed files with 43 additions and 3 deletions

View File

@ -3,16 +3,21 @@ package nautilus.game.arcade.game.games.christmasnew.section.six.attack;
import java.util.concurrent.TimeUnit;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Projectile;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.scheduler.BukkitTask;
import org.bukkit.util.Vector;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilTime;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import nautilus.game.arcade.game.games.christmasnew.section.six.phase.BossPhase;
public class AttackShootArrows extends BossAttack
public class AttackShootArrows extends BossAttack implements IThrown
{
private static final long DURATION = TimeUnit.SECONDS.toMillis(4);
@ -40,6 +45,8 @@ public class AttackShootArrows extends BossAttack
Arrow arrow = _boss.getWorld().spawn(location, Arrow.class);
arrow.setCritical(true);
arrow.setVelocity(new Vector((Math.random() - 0.5) / 1.5D, (Math.random() / 3) + 1, (Math.random() - 0.5) / 1.5D));
_phase.getHost().getArcadeManager().GetProjectile().AddThrow(arrow, _boss, this, -1, true, true, false, false, 1);
}, 1, 1);
}
@ -48,4 +55,32 @@ public class AttackShootArrows extends BossAttack
{
_task.cancel();
}
@Override
public void Collide(LivingEntity target, Block block, ProjectileUser data)
{
if (target != null)
{
String source = data.getThrown().getName();
_phase.getHost().getArcadeManager().GetDamage().NewDamageEvent(target, _boss, (Projectile) data.getThrown(), DamageCause.CUSTOM, 4, true, true, true, source, source);
}
}
@Override
public void Idle(ProjectileUser data)
{
}
@Override
public void Expire(ProjectileUser data)
{
}
@Override
public void ChunkUnload(ProjectileUser data)
{
data.getThrown().remove();
}
}

View File

@ -51,9 +51,14 @@ public abstract class BossPhase extends SectionChallenge
}
@Override
public void onUnregister()
public void deactivate()
{
super.deactivate();
if (_currentAttack != null)
{
_currentAttack.stop();
}
}
protected void addAttacks(BossAttack... attacks)