Files
Mindustry/core/src/mindustry/entities/abilities/Ability.java
MEEPofFaith 68cc95c26d Wrap Immunities in unit stats (#6946)
* Don't display move effect ability in stats

* Wrap the immunities list
2022-06-08 08:42:17 -04:00

37 lines
1009 B
Java

package mindustry.entities.abilities;
import arc.*;
import arc.scene.ui.layout.*;
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;
public void update(Unit unit){}
public void draw(Unit unit){}
public void death(Unit unit){}
public void init(UnitType type){}
public Ability copy(){
try{
return (Ability)clone();
}catch(CloneNotSupportedException e){
//I am disgusted
throw new RuntimeException("java sucks", e);
}
}
public void displayBars(Unit unit, Table bars){
}
/** @return localized ability name; mods should override this. */
public String localized(){
return Core.bundle.get("ability." + getClass().getSimpleName().replace("Ability", "").toLowerCase());
}
}