Block damage multiplier rule
This commit is contained in:
@@ -93,6 +93,10 @@ public abstract class BulletType extends Content{
|
||||
public float weaveMag = -1f;
|
||||
public float hitShake = 0f;
|
||||
|
||||
public float lightRadius = 16f;
|
||||
public float lightOpacity = 0.3f;
|
||||
public Color lightColor = Pal.powerLight;
|
||||
|
||||
public BulletType(float speed, float damage){
|
||||
this.speed = speed;
|
||||
this.damage = damage;
|
||||
@@ -161,6 +165,10 @@ public abstract class BulletType extends Content{
|
||||
public void draw(Bulletc b){
|
||||
}
|
||||
|
||||
public void drawLight(Bulletc b){
|
||||
Drawf.light(b, lightRadius, lightColor, lightOpacity);
|
||||
}
|
||||
|
||||
public void init(Bulletc b){
|
||||
if(killShooter && b.owner() instanceof Healthc){
|
||||
((Healthc)b.owner()).kill();
|
||||
|
||||
@@ -28,6 +28,9 @@ public class ContinuousLaserBulletType extends BulletType{
|
||||
pierce = true;
|
||||
hittable = false;
|
||||
hitColor = colors[2];
|
||||
incendAmount = 1;
|
||||
incendSpread = 5;
|
||||
incendChance = 0.4f;
|
||||
}
|
||||
|
||||
protected ContinuousLaserBulletType(){
|
||||
@@ -53,15 +56,6 @@ public class ContinuousLaserBulletType extends BulletType{
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public void hit(Bulletc b, float hitx, float hity){
|
||||
hitEffect.at(hitx, hity, colors[2]);
|
||||
if(Mathf.chance(0.4)){
|
||||
Fires.create(world.tileWorld(hitx + Mathf.range(5f), hity + Mathf.range(5f)));
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public void draw(Bulletc b){
|
||||
float baseLen = length * b.fout();
|
||||
@@ -82,4 +76,9 @@ public class ContinuousLaserBulletType extends BulletType{
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawLight(Bulletc b){
|
||||
//no light drawn here
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -95,4 +95,9 @@ public class LaserBulletType extends BulletType{
|
||||
Tmp.v1.trns(b.rotation(), baseLen * 1.1f);
|
||||
Drawf.light(b.x(), b.y(), b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, width * 1.4f * b.fout(), colors[0], 0.6f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawLight(Bulletc b){
|
||||
//no light drawn here
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user