diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index d6fe7ce69d..3fbb0b606e 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -1237,6 +1237,9 @@ bullet.armorpierce = [stat]armor piercing bullet.armorweakness = [red]{0}x[lightgray] armor weakness bullet.partialarmorpierce = [stat]{0}%[lightgray] armor pierce bullet.antiarmor = [stat]{0}x[lightgray] anti-armor +bullet.blockarmorweakness = [red]{0}x[lightgray] building armor weakness +bullet.blockpartialarmorpierce = [stat]{0}%[lightgray] building armor pierce +bullet.blockantiarmor = [stat]{0}x[lightgray] building anti-armor bullet.maxdamagefraction = [stat]{0}%[lightgray] damage limit bullet.suppression = [stat]{0}[lightgray] seconds of repair suppression ~ [stat]{1}[lightgray] tiles bullet.empradius = [stat]{0}[lightgray] tiles EMP radius diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 46d80e8052..0581b29dae 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -3915,12 +3915,13 @@ public class UnitTypes{ mirror = false; shoot = new ShootHelix(); - bullet = new BasicBulletType(5f, 34){{ + bullet = new BasicBulletType(5f, 22f / 0.75f){{ width = 7f; height = 12f; lifetime = 18f; //floating point inaccuracy makes 0.6f show as -39% buildingDamageMultiplier = 0.599999f; + blockArmorMultiplier = 0.5f; shootEffect = Fx.sparkShoot; smokeEffect = Fx.shootBigSmoke; hitColor = backColor = trailColor = Pal.suppress; @@ -3931,13 +3932,12 @@ public class UnitTypes{ fragOnDespawn = false; fragBullets = 2; - fragBullet = new BasicBulletType(3f, 15){{ + fragBullet = new BasicBulletType(3f, 10){{ width = 5f; height = 8f; lifetime = 14f; fragVelocityMax = 1f; fragVelocityMin = 0.7f; - buildingDamageMultiplier = 0.5f; hitColor = backColor = trailColor = Pal.suppress; frontColor = Color.white; trailWidth = 1.2f; diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index b58f83c18d..10d99f323c 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -185,8 +185,10 @@ public class BulletType extends Content implements Cloneable{ public boolean fragOnAbsorb = true; /** If true, unit armor is ignored in damage calculations. */ public boolean pierceArmor = false; - /** Multiplies the unit armor used in damage calculations. Used for armor weakness, armor piercing, and anti-armor. */ + /** Multiplies the unit/building armor used in damage calculations. Used for armor weakness, armor piercing, and anti-armor. */ public float armorMultiplier = 1f; + /** Multiplies only the building armor used in damage calculations. */ + public float blockArmorMultiplier = 1f; /** If true, the bullet will "stick" to enemies and get deactivated on collision. */ public boolean sticky = false; /** Extra time added to bullet when it sticks to something. */ diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 50ef3ce0b6..eb79bc7fc2 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -21,6 +21,7 @@ import mindustry.core.*; import mindustry.ctype.*; import mindustry.editor.*; import mindustry.entities.*; +import mindustry.entities.bullet.*; import mindustry.game.EventType.*; import mindustry.game.*; import mindustry.game.Teams.*; @@ -1729,10 +1730,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, * @return whether the bullet should be removed. */ public boolean collision(Bullet other){ boolean wasDead = health <= 0; + BulletType t = other.type; float damage = other.type.buildingDamage(other); - if(!other.type.pierceArmor){ - damage = Damage.applyArmor(damage, block.armor * other.type.armorMultiplier); + if(!t.pierceArmor){ + damage = Damage.applyArmor(damage, block.armor * t.armorMultiplier * t.blockArmorMultiplier); } damage(other, other.team, damage); diff --git a/core/src/mindustry/world/meta/StatValues.java b/core/src/mindustry/world/meta/StatValues.java index ed4923b10a..7ddbfdf540 100644 --- a/core/src/mindustry/world/meta/StatValues.java +++ b/core/src/mindustry/world/meta/StatValues.java @@ -733,13 +733,25 @@ public class StatValues{ sep(bt, "@bullet.armorpierce"); } - if(type.armorMultiplier != 1f && !type.pierceArmor){ - if(type.armorMultiplier > 1f){ - sep(bt, Core.bundle.format("bullet.armorweakness", (type.armorMultiplier))); - }else if(Mathf.sign(type.armorMultiplier) == 1){ - sep(bt, Core.bundle.format("bullet.partialarmorpierce", (int)((1 - type.armorMultiplier) * 100))); - }else{ - sep(bt, Core.bundle.format("bullet.antiarmor", (-type.armorMultiplier))); + if(!type.pierceArmor){ + if(type.armorMultiplier != 1f){ + if(type.armorMultiplier > 1f){ + sep(bt, Core.bundle.format("bullet.armorweakness", (type.armorMultiplier))); + }else if(Mathf.sign(type.armorMultiplier) == 1){ + sep(bt, Core.bundle.format("bullet.partialarmorpierce", (int)((1 - type.armorMultiplier) * 100))); + }else{ + sep(bt, Core.bundle.format("bullet.antiarmor", (-type.armorMultiplier))); + } + } + + if(type.blockArmorMultiplier != 1f){ + if(type.blockArmorMultiplier > 1f){ + sep(bt, Core.bundle.format("bullet.blockarmorweakness", (type.blockArmorMultiplier))); + }else if(Mathf.sign(type.blockArmorMultiplier) == 1){ + sep(bt, Core.bundle.format("bullet.blockpartialarmorpierce", (int)((1 - type.blockArmorMultiplier) * 100))); + }else{ + sep(bt, Core.bundle.format("bullet.blockantiarmor", (-type.blockArmorMultiplier))); + } } }