onShoot on StatusFieldAbility (#7221)

* onShoot on StatusFieldAbility

allows for more JSON gaming

* hmm
This commit is contained in:
rly4498
2022-07-23 01:43:37 +08:00
committed by GitHub
parent b150bcfb10
commit f16894592f

View File

@@ -11,6 +11,7 @@ import mindustry.type.*;
public class StatusFieldAbility extends Ability{
public StatusEffect effect;
public float duration = 60, reload = 100, range = 20;
public boolean onShoot = false;
public Effect applyEffect = Fx.none;
public Effect activeEffect = Fx.overdriveWave;
public float effectX, effectY;
@@ -36,7 +37,7 @@ public class StatusFieldAbility extends Ability{
public void update(Unit unit){
timer += Time.delta;
if(timer >= reload){
if(timer >= reload && (!onShoot || unit.isShooting)){
Units.nearby(unit.team, unit.x, unit.y, range, other -> {
other.apply(effect, duration);
applyEffect.at(other, parentizeEffects);