Wrap Immunities in unit stats (#6946)
* Don't display move effect ability in stats * Wrap the immunities list
This commit is contained in:
@@ -3794,7 +3794,7 @@ public class UnitTypes{
|
|||||||
x = 43f * i / 4f;
|
x = 43f * i / 4f;
|
||||||
particles = parts;
|
particles = parts;
|
||||||
//visual only, the middle one does the actual suppressing
|
//visual only, the middle one does the actual suppressing
|
||||||
active = false;
|
display = active = false;
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import mindustry.gen.*;
|
|||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
|
|
||||||
public abstract class Ability implements Cloneable{
|
public abstract class Ability implements Cloneable{
|
||||||
|
/** If false, this ability does not show in unit stats. */
|
||||||
|
public boolean display = true;
|
||||||
//the one and only data variable that is synced.
|
//the one and only data variable that is synced.
|
||||||
public float data;
|
public float data;
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ public class MoveEffectAbility extends Ability{
|
|||||||
this.color = color;
|
this.color = color;
|
||||||
this.effect = effect;
|
this.effect = effect;
|
||||||
this.interval = interval;
|
this.interval = interval;
|
||||||
|
display = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MoveEffectAbility(){
|
public MoveEffectAbility(){
|
||||||
|
|||||||
@@ -566,7 +566,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
var unique = new ObjectSet<String>();
|
var unique = new ObjectSet<String>();
|
||||||
|
|
||||||
for(Ability a : abilities){
|
for(Ability a : abilities){
|
||||||
if(unique.add(a.localized())){
|
if(a.display && unique.add(a.localized())){
|
||||||
stats.add(Stat.abilities, a.localized());
|
stats.add(Stat.abilities, a.localized());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -609,9 +609,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
if(naval){
|
if(naval){
|
||||||
imm.remove(StatusEffects.wet);
|
imm.remove(StatusEffects.wet);
|
||||||
}
|
}
|
||||||
for(var i : imm){
|
stats.add(Stat.immunities, StatValues.statusEffects(imm));
|
||||||
stats.add(Stat.immunities, i.emoji() + " " + i.localizedName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1537,4 +1535,4 @@ public class UnitType extends UnlockableContent{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,8 +206,8 @@ public class StatValues{
|
|||||||
|
|
||||||
if(item instanceof Block block && block.itemDrop != null && !block.itemDrop.unlocked()) continue;
|
if(item instanceof Block block && block.itemDrop != null && !block.itemDrop.unlocked()) continue;
|
||||||
|
|
||||||
l.image(item.uiIcon).size(iconSmall).padRight(2).padLeft(2).padTop(3).padBottom(3);
|
if(item.uiIcon.found()) l.image(item.uiIcon).size(iconSmall).padRight(2).padLeft(2).padTop(3).padBottom(3);
|
||||||
l.add(item.localizedName).left().padLeft(1).padRight(4);
|
l.add(item.localizedName).left().padLeft(1).padRight(4).colspan(item.uiIcon.found() ? 1 : 2);
|
||||||
if(i % 5 == 4){
|
if(i % 5 == 4){
|
||||||
l.row();
|
l.row();
|
||||||
}
|
}
|
||||||
@@ -223,6 +223,10 @@ public class StatValues{
|
|||||||
return content(list.as());
|
return content(list.as());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static StatValue statusEffects(Seq<StatusEffect> list){
|
||||||
|
return content(list.as());
|
||||||
|
}
|
||||||
|
|
||||||
public static StatValue boosters(float reload, float maxUsed, float multiplier, boolean baseReload, Boolf<Liquid> filter){
|
public static StatValue boosters(float reload, float maxUsed, float multiplier, boolean baseReload, Boolf<Liquid> filter){
|
||||||
return table -> {
|
return table -> {
|
||||||
table.row();
|
table.row();
|
||||||
|
|||||||
Reference in New Issue
Block a user