Status effect display for bullets
This commit is contained in:
@@ -631,7 +631,7 @@ status.tarred.name = Tarred
|
|||||||
status.overclock.name = Overclock
|
status.overclock.name = Overclock
|
||||||
status.shocked.name = Shocked
|
status.shocked.name = Shocked
|
||||||
status.blasted.name = Blasted
|
status.blasted.name = Blasted
|
||||||
status.unmoving = Unmoving
|
status.unmoving.name = Unmoving
|
||||||
|
|
||||||
settings.language = Language
|
settings.language = Language
|
||||||
settings.data = Game Data
|
settings.data = Game Data
|
||||||
@@ -771,17 +771,14 @@ units.processorcontrol = [lightgray]Processor Controlled
|
|||||||
bullet.damage = [stat]{0}[lightgray] damage
|
bullet.damage = [stat]{0}[lightgray] damage
|
||||||
bullet.splashdamage = [stat]{0}[lightgray] area dmg ~[stat] {1}[lightgray] tiles
|
bullet.splashdamage = [stat]{0}[lightgray] area dmg ~[stat] {1}[lightgray] tiles
|
||||||
bullet.incendiary = [stat]incendiary
|
bullet.incendiary = [stat]incendiary
|
||||||
bullet.sapping = [stat]sapping
|
|
||||||
bullet.homing = [stat]homing
|
bullet.homing = [stat]homing
|
||||||
bullet.shock = [stat]shock
|
|
||||||
bullet.frag = [stat]frag
|
bullet.frag = [stat]frag
|
||||||
|
bullet.lightning = [stat]{0}[lightgray]x lightning ~[stat]{1}[lightgray] damage
|
||||||
bullet.buildingdamage = [stat]{0}%[lightgray] building damage
|
bullet.buildingdamage = [stat]{0}%[lightgray] building damage
|
||||||
bullet.knockback = [stat]{0}[lightgray] knockback
|
bullet.knockback = [stat]{0}[lightgray] knockback
|
||||||
bullet.pierce = [stat]{0}[lightgray]x pierce
|
bullet.pierce = [stat]{0}[lightgray]x pierce
|
||||||
bullet.infinitepierce = [stat]pierce
|
bullet.infinitepierce = [stat]pierce
|
||||||
bullet.healpercent = [stat]{0}[lightgray]% healing
|
bullet.healpercent = [stat]{0}[lightgray]% healing
|
||||||
bullet.freezing = [stat]freezing
|
|
||||||
bullet.tarred = [stat]tarred
|
|
||||||
bullet.multiplier = [stat]{0}[lightgray]x ammo multiplier
|
bullet.multiplier = [stat]{0}[lightgray]x ammo multiplier
|
||||||
bullet.reload = [stat]{0}[lightgray]x fire rate
|
bullet.reload = [stat]{0}[lightgray]x fire rate
|
||||||
|
|
||||||
|
|||||||
@@ -161,6 +161,11 @@ public abstract class BulletType extends Content{
|
|||||||
return Math.max(speed * lifetime * (1f - drag), maxRange);
|
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){
|
public boolean testCollision(Bullet bullet, Building tile){
|
||||||
return healPercent <= 0.001f || tile.team != bullet.team || tile.healthf() < 1f;
|
return healPercent <= 0.001f || tile.team != bullet.team || tile.healthf() < 1f;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,11 @@ public class ContinuousLaserBulletType extends BulletType{
|
|||||||
this(0);
|
this(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float continuousDamage(){
|
||||||
|
return damage / 5f * 60f;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float estimateDPS(){
|
public float estimateDPS(){
|
||||||
//assume firing duration is about 100 by default, may not be accurate there's no way of knowing in this method
|
//assume firing duration is about 100 by default, may not be accurate there's no way of knowing in this method
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ public class LightningBulletType extends BulletType{
|
|||||||
hitEffect = Fx.hitLancer;
|
hitEffect = Fx.hitLancer;
|
||||||
keepVelocity = false;
|
keepVelocity = false;
|
||||||
hittable = false;
|
hittable = false;
|
||||||
|
//for stats
|
||||||
|
status = StatusEffects.shocked;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -35,9 +35,6 @@ public class LaserTurret extends PowerTurret{
|
|||||||
|
|
||||||
stats.remove(Stat.booster);
|
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.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{
|
public class LaserTurretBuild extends PowerTurretBuild{
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package mindustry.world.blocks.defense.turrets;
|
package mindustry.world.blocks.defense.turrets;
|
||||||
|
|
||||||
|
import arc.struct.*;
|
||||||
import mindustry.entities.bullet.*;
|
import mindustry.entities.bullet.*;
|
||||||
import mindustry.logic.*;
|
import mindustry.logic.*;
|
||||||
import mindustry.world.meta.*;
|
import mindustry.world.meta.*;
|
||||||
|
import mindustry.world.meta.values.*;
|
||||||
|
|
||||||
public class PowerTurret extends Turret{
|
public class PowerTurret extends Turret{
|
||||||
public BulletType shootType;
|
public BulletType shootType;
|
||||||
@@ -16,7 +18,7 @@ public class PowerTurret extends Turret{
|
|||||||
@Override
|
@Override
|
||||||
public void setStats(){
|
public void setStats(){
|
||||||
super.setStats();
|
super.setStats();
|
||||||
stats.add(Stat.damage, shootType.damage, StatUnit.none);
|
stats.add(Stat.ammo, new AmmoListValue<>(OrderedMap.of(this, shootType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import mindustry.entities.bullet.*;
|
|||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
|
import mindustry.world.blocks.defense.turrets.*;
|
||||||
import mindustry.world.meta.*;
|
import mindustry.world.meta.*;
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
@@ -34,7 +35,7 @@ public class AmmoListValue<T extends UnlockableContent> implements StatValue{
|
|||||||
BulletType type = map.get(t);
|
BulletType type = map.get(t);
|
||||||
|
|
||||||
//no point in displaying unit icon twice
|
//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.image(icon(t)).size(3 * 8).padRight(4).right().top();
|
||||||
table.add(t.localizedName).padRight(10).left().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();
|
bt.left().defaults().padRight(3).left();
|
||||||
|
|
||||||
if(type.damage > 0 && (type.collides || type.splashDamage <= 0)){
|
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){
|
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));
|
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");
|
sep(bt, "@bullet.incendiary");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(type.status == StatusEffects.freezing){
|
if(type.status != StatusEffects.none){
|
||||||
sep(bt, "@bullet.freezing");
|
sep(bt, (type.minfo.mod == null ? type.status.emoji() : "") + "[stat]" + type.status.localizedName);
|
||||||
}
|
|
||||||
|
|
||||||
if(type.status == StatusEffects.tarred){
|
|
||||||
sep(bt, "@bullet.tarred");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(type.status == StatusEffects.sapped){
|
|
||||||
sep(bt, "@bullet.sapping");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(type.homingPower > 0.01f){
|
if(type.homingPower > 0.01f){
|
||||||
@@ -95,7 +92,7 @@ public class AmmoListValue<T extends UnlockableContent> implements StatValue{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(type.lightning > 0){
|
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){
|
if(type.fragBullet != null){
|
||||||
|
|||||||
Reference in New Issue
Block a user