mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-09 04:09:07 +07:00
Option to parentize status effect effects (#6030)
This commit is contained in:
parent
6f27fd1ea2
commit
b60acf2c37
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user