Block damage multiplier rule

This commit is contained in:
Anuken
2020-06-15 09:58:46 -04:00
parent 0968f0be59
commit d04ce2a750
13 changed files with 45 additions and 33 deletions

View File

@@ -18,6 +18,7 @@ import static mindustry.Vars.*;
@Component
abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Drawc, Shielderc, Ownerc, Velc, Bulletc, Timerc{
@Import Team team;
@Import Entityc owner;
IntSeq collided = new IntSeq(6);
Object data;
@@ -49,9 +50,9 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
@Override
public float damageMultiplier(){
if(owner() instanceof Unitc){
return ((Unitc)owner()).damageMultiplier();
}
if(owner instanceof Unitc) return ((Unitc)owner).damageMultiplier() * state.rules.unitDamageMultiplier;
if(owner instanceof Tilec) return state.rules.blockDamageMultiplier;
return 1f;
}
@@ -133,8 +134,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
Draw.z(Layer.bullet);
type.draw(this);
//TODO refactor
Drawf.light(x(), y(), 16f, Pal.powerLight, 0.3f);
type.drawLight(this);
}
/** Sets the bullet's rotation in degrees. */