public override void Effect(Vector3 pos, ref List <Enemy> enemies, ref Bullet.Flags flags) { var nearby = Physics .SphereCastAll(pos, radius, Vector3.up) .Select(thing => thing.collider.GetComponent <Enemy>()) .Where(e => e != null); enemies.AddRange(nearby); }
public override void Effect(Vector3 vel, ref List <Enemy> enemies, ref Bullet.Flags flags) { Debug.Log($"Knockback Effect called, with {enemies.Count} enemies"); enemies.ForEach(enemy => { var rb = enemy.GetComponent <Rigidbody>(); var dir = vel.normalized; rb.AddForce(dir * knockbackForce); Debug.Log($"Knocking back, " + $"enemy: {enemy}, " + $"pos: {dir}, " + $"dir: {dir}"); }); }
public abstract void Effect(Vector3 pos, ref List <Enemy> enemy, ref Bullet.Flags flags);
public override void Effect(Vector3 pos, ref List <Enemy> enemies, ref Bullet.Flags flags) { enemies.ForEach(enemy => enemy.TakeDamage(damage)); }
public override void Effect(Vector3 pos, ref List <Enemy> enemy, ref Bullet.Flags flags) { Debug.Log("Shocking"); }
public override void Effect(Vector3 pos, ref List <Enemy> enemies, ref Bullet.Flags flags) { enemies.ForEach(enemy => enemy.Ignite()); }
public override void Effect(Vector3 pos, ref List <Enemy> enemy, ref Bullet.Flags flags) { flags |= Bullet.Flags.supressDestroy; }