Status effect display for bullets
This commit is contained in:
@@ -35,9 +35,6 @@ public class LaserTurret extends PowerTurret{
|
||||
|
||||
stats.remove(Stat.booster);
|
||||
stats.add(Stat.input, new BoosterListValue(reloadTime, consumes.<ConsumeLiquidBase>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{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<T extends UnlockableContent> 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<T extends UnlockableContent> 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<T extends UnlockableContent> 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<T extends UnlockableContent> 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){
|
||||
|
||||
Reference in New Issue
Block a user