mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-03-26 08:41:12 -07:00
Wrap Immunities in unit stats (#6946)
* Don't display move effect ability in stats * Wrap the immunities list
This commit is contained in:
parent
318447afaf
commit
68cc95c26d
5 changed files with 13 additions and 8 deletions
|
|
@ -3794,7 +3794,7 @@ public class UnitTypes{
|
|||
x = 43f * i / 4f;
|
||||
particles = parts;
|
||||
//visual only, the middle one does the actual suppressing
|
||||
active = false;
|
||||
display = active = false;
|
||||
}});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import mindustry.gen.*;
|
|||
import mindustry.type.*;
|
||||
|
||||
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.
|
||||
public float data;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ public class MoveEffectAbility extends Ability{
|
|||
this.color = color;
|
||||
this.effect = effect;
|
||||
this.interval = interval;
|
||||
display = false;
|
||||
}
|
||||
|
||||
public MoveEffectAbility(){
|
||||
|
|
|
|||
|
|
@ -566,7 +566,7 @@ public class UnitType extends UnlockableContent{
|
|||
var unique = new ObjectSet<String>();
|
||||
|
||||
for(Ability a : abilities){
|
||||
if(unique.add(a.localized())){
|
||||
if(a.display && unique.add(a.localized())){
|
||||
stats.add(Stat.abilities, a.localized());
|
||||
}
|
||||
}
|
||||
|
|
@ -609,9 +609,7 @@ public class UnitType extends UnlockableContent{
|
|||
if(naval){
|
||||
imm.remove(StatusEffects.wet);
|
||||
}
|
||||
for(var i : imm){
|
||||
stats.add(Stat.immunities, i.emoji() + " " + i.localizedName);
|
||||
}
|
||||
stats.add(Stat.immunities, StatValues.statusEffects(imm));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -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;
|
||||
|
||||
l.image(item.uiIcon).size(iconSmall).padRight(2).padLeft(2).padTop(3).padBottom(3);
|
||||
l.add(item.localizedName).left().padLeft(1).padRight(4);
|
||||
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).colspan(item.uiIcon.found() ? 1 : 2);
|
||||
if(i % 5 == 4){
|
||||
l.row();
|
||||
}
|
||||
|
|
@ -223,6 +223,10 @@ public class StatValues{
|
|||
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){
|
||||
return table -> {
|
||||
table.row();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue