Added self-destruct bullet property

This commit is contained in:
Anuken
2020-01-19 10:43:38 -05:00
parent 87b4c37d82
commit b1df52e0c8
5 changed files with 20 additions and 26 deletions

View File

@@ -39,6 +39,8 @@ public abstract class BulletType extends Content{
public float reloadMultiplier = 1f;
/** Recoil from shooter entities. */
public float recoil;
/** Whether to kill the shooter when this is shot. For suicide bombers. */
public boolean killShooter;
public float splashDamage = 0f;
/** Knockback in velocity. */
@@ -146,6 +148,9 @@ public abstract class BulletType extends Content{
}
public void init(Bullet b){
if(killShooter && b.getOwner() instanceof HealthTrait){
((HealthTrait)b.getOwner()).kill();
}
}
public void update(Bullet b){