onShoot on StatusFieldAbility (#7221)
* onShoot on StatusFieldAbility allows for more JSON gaming * hmm
This commit is contained in:
@@ -11,6 +11,7 @@ import mindustry.type.*;
|
|||||||
public class StatusFieldAbility extends Ability{
|
public class StatusFieldAbility extends Ability{
|
||||||
public StatusEffect effect;
|
public StatusEffect effect;
|
||||||
public float duration = 60, reload = 100, range = 20;
|
public float duration = 60, reload = 100, range = 20;
|
||||||
|
public boolean onShoot = false;
|
||||||
public Effect applyEffect = Fx.none;
|
public Effect applyEffect = Fx.none;
|
||||||
public Effect activeEffect = Fx.overdriveWave;
|
public Effect activeEffect = Fx.overdriveWave;
|
||||||
public float effectX, effectY;
|
public float effectX, effectY;
|
||||||
@@ -36,7 +37,7 @@ public class StatusFieldAbility extends Ability{
|
|||||||
public void update(Unit unit){
|
public void update(Unit unit){
|
||||||
timer += Time.delta;
|
timer += Time.delta;
|
||||||
|
|
||||||
if(timer >= reload){
|
if(timer >= reload && (!onShoot || unit.isShooting)){
|
||||||
Units.nearby(unit.team, unit.x, unit.y, range, other -> {
|
Units.nearby(unit.team, unit.x, unit.y, range, other -> {
|
||||||
other.apply(effect, duration);
|
other.apply(effect, duration);
|
||||||
applyEffect.at(other, parentizeEffects);
|
applyEffect.at(other, parentizeEffects);
|
||||||
|
|||||||
Reference in New Issue
Block a user