Option to parentize status effect effects (#6030)

This commit is contained in:
Matthew Peng 2021-09-21 05:36:34 -07:00 committed by GitHub
parent 6f27fd1ea2
commit b60acf2c37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,8 @@ public class StatusEffect extends UnlockableContent{
public float damage;
/** Chance of effect appearing. */
public float effectChance = 0.15f;
/** Should the effect be given a parent */
public boolean parentizeEffect;
/** If true, the effect never disappears. */
public boolean permanent;
/** If true, this effect will only react with other effects and cannot be applied. */
@ -120,7 +122,7 @@ public class StatusEffect extends UnlockableContent{
if(effect != Fx.none && Mathf.chanceDelta(effectChance)){
Tmp.v1.rnd(Mathf.range(unit.type.hitSize/2f));
effect.at(unit.x + Tmp.v1.x, unit.y + Tmp.v1.y, color);
effect.at(unit.x + Tmp.v1.x, unit.y + Tmp.v1.y, 0, color, parentizeEffect ? unit : null);
}
}