Fighter
namespace Griff.Modules.Strategy;
public sealed class Fighter : ComponentFights for a Unit or a Building (a tower): it attacks enemies that come within its unit’s sight on its own, and whatever it’s told to. Up close it hits straight away; with a Projectile it fires one that flies to the target and hurts it on arrival.
This is a component: its saved properties are on its component page.
Properties
Section titled “Properties”Cooldown
Section titled “Cooldown”public float Cooldown { get; set; }Seconds between hits.
Damage
Section titled “Damage”public float Damage { get; set; }Hit points each hit takes off the target’s Health.
Projectile
Section titled “Projectile”public string? Projectile { get; set; }A prefab it fires at the target, e.g. “Arrow”. Empty hits straight away.
ProjectileSpeed
Section titled “ProjectileSpeed”public float ProjectileSpeed { get; set; }How fast its projectile flies, in world units per second.
public float Range { get; set; }How close it has to be to hit, from its edge to the target’s, in world units.
public string? Sound { get; set; }A sound played with each hit or shot, e.g. “Sounds/swing.wav”.
Target
Section titled “Target”public Entity? Target { get; }The enemy it’s hitting, if any.
Events
Section titled “Events”public event Action<Entity>? SwungRaised with each hit or shot, with its target.