Move damage and knockback to hitEntity (#5000)
* Move damge and knockback to `hitEntity` * b.damage, not damage
This commit is contained in:
@@ -185,8 +185,15 @@ public abstract class BulletType extends Content{
|
||||
}
|
||||
}
|
||||
|
||||
public void hitEntity(Bullet b, Hitboxc other, float initialHealth){
|
||||
public void hitEntity(Bullet b, Hitboxc entity, float initialHealth){
|
||||
if(entity instanceof Healthc h){
|
||||
h.damage(b.damage);
|
||||
}
|
||||
|
||||
if(entity instanceof Unit unit){
|
||||
unit.impulse(Tmp.v3.set(unit).sub(b.x, b.y).nor().scl(knockback * 80f));
|
||||
unit.apply(status, statusDuration);
|
||||
}
|
||||
}
|
||||
|
||||
public void hit(Bullet b){
|
||||
|
||||
@@ -71,6 +71,7 @@ public class RailBulletType extends BulletType{
|
||||
@Override
|
||||
public void hitEntity(Bullet b, Hitboxc entity, float initialHealth){
|
||||
handle(b, entity, initialHealth);
|
||||
super.hitEntity(b, entity, initialHealth);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user