status effect applyEffect field for json (#7642)

* field for json

* another field

* aaaaaaa
This commit is contained in:
Mythril382
2022-10-01 20:24:52 +08:00
committed by GitHub
parent 2f6aefeb6f
commit e5d74cc10b

View File

@@ -35,7 +35,7 @@ public class StatusEffect extends UnlockableContent{
public float damage; public float damage;
/** Chance of effect appearing. */ /** Chance of effect appearing. */
public float effectChance = 0.15f; public float effectChance = 0.15f;
/** Should the effect be given a parent */ /** Should the effect be given a parent. */
public boolean parentizeEffect; public boolean parentizeEffect;
/** If true, the effect never disappears. */ /** If true, the effect never disappears. */
public boolean permanent; public boolean permanent;
@@ -47,6 +47,14 @@ public class StatusEffect extends UnlockableContent{
public Color color = Color.white.cpy(); public Color color = Color.white.cpy();
/** Effect that happens randomly on top of the affected unit. */ /** Effect that happens randomly on top of the affected unit. */
public Effect effect = Fx.none; public Effect effect = Fx.none;
/** Effect that is displayed once when applied to a unit. */
public Effect applyEffect = Fx.none;
/** Whether the apply effect should display even if effect is already on the unit. */
public boolean applyExtend;
/** Tint color of apply effect. */
public Color applyColor = Color.white.cpy();
/** Should the apply effect be given a parent. */
public boolean parentizeApplyEffect;
/** Affinity & opposite values for stat displays. */ /** Affinity & opposite values for stat displays. */
public ObjectSet<StatusEffect> affinities = new ObjectSet<>(), opposites = new ObjectSet<>(); public ObjectSet<StatusEffect> affinities = new ObjectSet<>(), opposites = new ObjectSet<>();
/** Set to false to disable outline generation. */ /** Set to false to disable outline generation. */
@@ -187,7 +195,9 @@ public class StatusEffect extends UnlockableContent{
return false; return false;
} }
public void applied(Unit unit, float time, boolean extend){} public void applied(Unit unit, float time, boolean extend){
if(!extend || applyExtend) applyEffect.at(unit.x, unit.y, 0, applyColor, parentizeApplyEffect ? unit : null);
}
@Override @Override
public void createIcons(MultiPacker packer){ public void createIcons(MultiPacker packer){