diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index efe52a37a1..ea04589752 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -1142,6 +1142,7 @@ bullet.interval = [stat]{0}/sec[lightgray] interval bullets: bullet.frags = [stat]{0}x[lightgray] frag bullets: bullet.lightning = [stat]{0}x[lightgray] lightning ~ [stat]{1}[lightgray] damage bullet.buildingdamage = [stat]{0}%[lightgray] building damage +bullet.shielddamage = [stat]{0}%[lightgray] shield damage bullet.knockback = [stat]{0}[lightgray] knockback bullet.pierce = [stat]{0}x[lightgray] pierce bullet.infinitepierce = [stat]pierce diff --git a/core/src/mindustry/entities/abilities/ForceFieldAbility.java b/core/src/mindustry/entities/abilities/ForceFieldAbility.java index d4cdac20d4..2ef8e8e804 100644 --- a/core/src/mindustry/entities/abilities/ForceFieldAbility.java +++ b/core/src/mindustry/entities/abilities/ForceFieldAbility.java @@ -41,8 +41,7 @@ public class ForceFieldAbility extends Ability{ if(trait.team != paramUnit.team && trait.type.absorbable && Intersector.isInRegularPolygon(paramField.sides, paramUnit.x, paramUnit.y, realRad, paramField.rotation, trait.x(), trait.y()) && paramUnit.shield > 0){ trait.absorb(); Fx.absorb.at(trait); - - paramUnit.shield -= trait.damage(); + paramUnit.shield -= trait.type().shieldDamage(trait); paramField.alpha = 1f; } }; diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index cb177512f0..5f958bb013 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -84,6 +84,8 @@ public class BulletType extends Content implements Cloneable{ public float reloadMultiplier = 1f; /** Multiplier of how much base damage is done to tiles. */ public float buildingDamageMultiplier = 1f; + /** Multiplier of how much base damage is done to force shields. */ + public float shieldDamageMultiplier = 1f; /** Recoil from shooter entities. */ public float recoil; /** Whether to kill the shooter when this is shot. For suicide bombers. */ @@ -569,6 +571,14 @@ public class BulletType extends Content implements Cloneable{ } } + public float buildingDamage(Bullet b){ + return b.damage() * buildingDamageMultiplier; + } + + public float shieldDamage(Bullet b){ + return b.damage() * shieldDamageMultiplier; + } + public void draw(Bullet b){ drawTrail(b); drawParts(b); diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index cdb4d7303a..49ccaa2ee5 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -1645,7 +1645,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, public boolean collision(Bullet other){ boolean wasDead = health <= 0; - float damage = other.damage() * other.type().buildingDamageMultiplier; + float damage = other.type.buildingDamage(other); if(!other.type.pierceArmor){ damage = Damage.applyArmor(damage, block.armor); } diff --git a/core/src/mindustry/world/blocks/defense/ForceProjector.java b/core/src/mindustry/world/blocks/defense/ForceProjector.java index 9611bf2e2b..7aa49ecb98 100644 --- a/core/src/mindustry/world/blocks/defense/ForceProjector.java +++ b/core/src/mindustry/world/blocks/defense/ForceProjector.java @@ -55,7 +55,7 @@ public class ForceProjector extends Block{ bullet.absorb(); paramEffect.at(bullet); paramEntity.hit = 1f; - paramEntity.buildup += bullet.damage; + paramEntity.buildup += bullet.type.shieldDamage(bullet); } }; diff --git a/core/src/mindustry/world/meta/StatValues.java b/core/src/mindustry/world/meta/StatValues.java index 1e553c4272..917dfd4f70 100644 --- a/core/src/mindustry/world/meta/StatValues.java +++ b/core/src/mindustry/world/meta/StatValues.java @@ -644,6 +644,10 @@ public class StatValues{ sep(bt, Core.bundle.format("bullet.range", ammoStat(type.rangeChange / tilesize))); } + if(type.shieldDamageMultiplier != 1){ + sep(bt, Core.bundle.format("bullet.shielddamage", (int)(type.shieldDamageMultiplier * 100))); + } + if(type.splashDamage > 0){ sep(bt, Core.bundle.format("bullet.splashdamage", (int)type.splashDamage, Strings.fixed(type.splashDamageRadius / tilesize, 1))); }