diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index e1d487b504..05d02d9c03 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -631,7 +631,7 @@ status.tarred.name = Tarred status.overclock.name = Overclock status.shocked.name = Shocked status.blasted.name = Blasted -status.unmoving = Unmoving +status.unmoving.name = Unmoving settings.language = Language settings.data = Game Data @@ -771,17 +771,14 @@ units.processorcontrol = [lightgray]Processor Controlled bullet.damage = [stat]{0}[lightgray] damage bullet.splashdamage = [stat]{0}[lightgray] area dmg ~[stat] {1}[lightgray] tiles bullet.incendiary = [stat]incendiary -bullet.sapping = [stat]sapping bullet.homing = [stat]homing -bullet.shock = [stat]shock bullet.frag = [stat]frag +bullet.lightning = [stat]{0}[lightgray]x lightning ~[stat]{1}[lightgray] damage bullet.buildingdamage = [stat]{0}%[lightgray] building damage bullet.knockback = [stat]{0}[lightgray] knockback bullet.pierce = [stat]{0}[lightgray]x pierce bullet.infinitepierce = [stat]pierce bullet.healpercent = [stat]{0}[lightgray]% healing -bullet.freezing = [stat]freezing -bullet.tarred = [stat]tarred bullet.multiplier = [stat]{0}[lightgray]x ammo multiplier bullet.reload = [stat]{0}[lightgray]x fire rate diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index e2a8a8b7c2..202a73d7e0 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -161,6 +161,11 @@ public abstract class BulletType extends Content{ return Math.max(speed * lifetime * (1f - drag), maxRange); } + /** @return continuous damage in damage/sec, or -1 if not continuous. */ + public float continuousDamage(){ + return -1f; + } + public boolean testCollision(Bullet bullet, Building tile){ return healPercent <= 0.001f || tile.team != bullet.team || tile.healthf() < 1f; } diff --git a/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java b/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java index 43113a0a99..9f1b375091 100644 --- a/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java +++ b/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java @@ -46,6 +46,11 @@ public class ContinuousLaserBulletType extends BulletType{ this(0); } + @Override + public float continuousDamage(){ + return damage / 5f * 60f; + } + @Override public float estimateDPS(){ //assume firing duration is about 100 by default, may not be accurate there's no way of knowing in this method diff --git a/core/src/mindustry/entities/bullet/LightningBulletType.java b/core/src/mindustry/entities/bullet/LightningBulletType.java index bf16cca660..578f055bae 100644 --- a/core/src/mindustry/entities/bullet/LightningBulletType.java +++ b/core/src/mindustry/entities/bullet/LightningBulletType.java @@ -19,6 +19,8 @@ public class LightningBulletType extends BulletType{ hitEffect = Fx.hitLancer; keepVelocity = false; hittable = false; + //for stats + status = StatusEffects.shocked; } @Override diff --git a/core/src/mindustry/world/blocks/defense/turrets/LaserTurret.java b/core/src/mindustry/world/blocks/defense/turrets/LaserTurret.java index 8ac3461dd3..22220e5644 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/LaserTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/LaserTurret.java @@ -35,9 +35,6 @@ public class LaserTurret extends PowerTurret{ stats.remove(Stat.booster); stats.add(Stat.input, new BoosterListValue(reloadTime, consumes.get(ConsumeType.liquid).amount, coolantMultiplier, false, l -> consumes.liquidfilters.get(l.id))); - stats.remove(Stat.damage); - //damages every 5 ticks, at least in meltdown's case - stats.add(Stat.damage, shootType.damage * 60f / 5f, StatUnit.perSecond); } public class LaserTurretBuild extends PowerTurretBuild{ diff --git a/core/src/mindustry/world/blocks/defense/turrets/PowerTurret.java b/core/src/mindustry/world/blocks/defense/turrets/PowerTurret.java index bf365f4439..fe568dedfc 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/PowerTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/PowerTurret.java @@ -1,8 +1,10 @@ package mindustry.world.blocks.defense.turrets; +import arc.struct.*; import mindustry.entities.bullet.*; import mindustry.logic.*; import mindustry.world.meta.*; +import mindustry.world.meta.values.*; public class PowerTurret extends Turret{ public BulletType shootType; @@ -16,7 +18,7 @@ public class PowerTurret extends Turret{ @Override public void setStats(){ super.setStats(); - stats.add(Stat.damage, shootType.damage, StatUnit.none); + stats.add(Stat.ammo, new AmmoListValue<>(OrderedMap.of(this, shootType))); } @Override diff --git a/core/src/mindustry/world/meta/values/AmmoListValue.java b/core/src/mindustry/world/meta/values/AmmoListValue.java index 15db897384..3e39819dc0 100644 --- a/core/src/mindustry/world/meta/values/AmmoListValue.java +++ b/core/src/mindustry/world/meta/values/AmmoListValue.java @@ -12,6 +12,7 @@ import mindustry.entities.bullet.*; import mindustry.gen.*; import mindustry.type.*; import mindustry.ui.*; +import mindustry.world.blocks.defense.turrets.*; import mindustry.world.meta.*; import static mindustry.Vars.*; @@ -34,7 +35,7 @@ public class AmmoListValue implements StatValue{ BulletType type = map.get(t); //no point in displaying unit icon twice - if(!unit){ + if(!unit & !(t instanceof PowerTurret)){ table.image(icon(t)).size(3 * 8).padRight(4).right().top(); table.add(t.localizedName).padRight(10).left().top(); } @@ -43,7 +44,11 @@ public class AmmoListValue implements StatValue{ bt.left().defaults().padRight(3).left(); if(type.damage > 0 && (type.collides || type.splashDamage <= 0)){ - bt.add(Core.bundle.format("bullet.damage", type.damage)); + if(type.continuousDamage() > 0){ + bt.add(Core.bundle.format("bullet.damage", type.damage) + " " + StatUnit.perSecond.localized()); + }else{ + bt.add(Core.bundle.format("bullet.damage", type.damage)); + } } if(type.buildingDamageMultiplier != 1){ @@ -74,20 +79,12 @@ public class AmmoListValue implements StatValue{ sep(bt, type.pierceCap == -1 ? "@bullet.infinitepierce" : Core.bundle.format("bullet.pierce", type.pierceCap)); } - if(type.status == StatusEffects.burning || type.status == StatusEffects.melting || type.incendAmount > 0){ + if(type.incendAmount > 0){ sep(bt, "@bullet.incendiary"); } - if(type.status == StatusEffects.freezing){ - sep(bt, "@bullet.freezing"); - } - - if(type.status == StatusEffects.tarred){ - sep(bt, "@bullet.tarred"); - } - - if(type.status == StatusEffects.sapped){ - sep(bt, "@bullet.sapping"); + if(type.status != StatusEffects.none){ + sep(bt, (type.minfo.mod == null ? type.status.emoji() : "") + "[stat]" + type.status.localizedName); } if(type.homingPower > 0.01f){ @@ -95,7 +92,7 @@ public class AmmoListValue implements StatValue{ } if(type.lightning > 0){ - sep(bt, "@bullet.shock"); + sep(bt, Core.bundle.format("bullet.lightning", type.lightning, type.lightningDamage < 0 ? type.damage : type.lightningDamage)); } if(type.fragBullet != null){