Move bullet damage multiplier to bulletType

This commit is contained in:
MEEP of Faith
2022-08-23 12:13:37 -07:00
parent 57c07b7ebb
commit ee31adb1c9
2 changed files with 8 additions and 4 deletions

View File

@@ -364,6 +364,13 @@ public class BulletType extends Content implements Cloneable{
}
}
public float damageMultiplier(Bullet b){
if(b.owner instanceof Unit u) return u.damageMultiplier() * state.rules.unitDamage(b.team);
if(b.owner instanceof Building) return state.rules.blockDamage(b.team);
return 1f;
}
public void hit(Bullet b){
hit(b, b.x, b.y);
}

View File

@@ -82,10 +82,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
@Override
public float damageMultiplier(){
if(owner instanceof Unit u) return u.damageMultiplier() * state.rules.unitDamage(team);
if(owner instanceof Building) return state.rules.blockDamage(team);
return 1f;
return type.damageMultiplier(self());
}
@Override