Class RangedAttackDef
An independently timed ranged attack.
public sealed class RangedAttackDef
- Inheritance
-
RangedAttackDef
- Inherited Members
Constructors
RangedAttackDef(float, float, DamageDef, ProjectileDef, bool, bool, float)
Creates ranged attack data.
public RangedAttackDef(float range, float cooldown, DamageDef damage, ProjectileDef projectile, bool targetsFlying = true, bool targetsGround = true, float minimumRange = 0)
Parameters
rangefloatcooldownfloatdamageDamageDefprojectileProjectileDeftargetsFlyingbooltargetsGroundboolminimumRangefloat
Properties
Cooldown
Seconds between attacks.
public float Cooldown { get; }
Property Value
Cycle
Projectile release timing within one attack cycle.
public AttackCycleDef Cycle { get; }
Property Value
Damage
Attack damage.
public DamageDef Damage { get; }
Property Value
IgnoreFlyingMinimumRange
Optional friendly-search policy bypassing only the inner range check for flying recipients. Maximum range and flight permission still apply.
public bool IgnoreFlyingMinimumRange { get; }
Property Value
MinimumRange
Inner exclusion radius, including its boundary when positive. Zero allows the center.
public float MinimumRange { get; }
Property Value
Projectile
Projectile travel settings.
public ProjectileDef Projectile { get; }
Property Value
Range
Attack range in horizontally measured world units.
public float Range { get; }
Property Value
TargetsFlying
Whether this attack can target flying enemies.
public bool TargetsFlying { get; }
Property Value
TargetsGround
Whether this attack can target ground enemies.
public bool TargetsGround { get; }
Property Value
Methods
WithCycle(AttackCycleDef)
Copies a ranged attack with explicit multi-release timing.
public RangedAttackDef WithCycle(AttackCycleDef cycle)
Parameters
cycleAttackCycleDef
Returns
WithFlyingMinimumRangeBypass(bool)
Copies the attack with an explicitly authored flying minimum-range exception.
public RangedAttackDef WithFlyingMinimumRangeBypass(bool enabled = true)
Parameters
enabledbool