AreaAttackSkill
A class in Root.Township, the global namespace.
Progression skill where a tool hit also damages everything around the hit point, in a shape that grows with skill level. Damage falls off with distance.
- Listed in Global namespace: A to B
- Inherits or implements
PickupBasedSkill - Derived types
AreaAttackSkill.Create,DynamiteStrike - Nested types
Create,HitInformation
Constructors
| Member | What it is |
|---|---|
AreaAttackSkill() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
| Member | What it is |
|---|---|
protected float minimumEffectiveness | Not read anywhere in this build. |
protected ImpactChannel[] toolRequiredChannels | Tool channels that allow the skill. |
8 private and internal fields
| Member | What it is |
|---|---|
private LayerMask collectionLayers | Physics layers searched for colliders around the hit. |
private ShapeImpactCollector[] collectionOverLevels | Collection shape per skill level; the player's level picks the entry (capped at the last one). |
private AnimationCurve damageOverRadius | Maps squared distance over squared shape size (0 to 1) to the hit effectiveness used for each target. |
private bool dealsDamageToKinematicObjects | If false, colliders on kinematic rigidbodies are skipped. |
private float hitDamageMultiplier | Serialized multiplier that nothing in this class reads. |
private PositionEvent hitObjectEffect | Effect invoked on clients at each hit position when the skill's consumed state is read from the network. |
private List<AreaAttackSkill.HitInformation> hitObjectPositions | Positions and chunks of the objects hit by the last DealDamage, sent to clients in SerializeInternal (up to 31). |
private ImpactChannel[] targetChannels | Impact channels a target must have to be damaged, also checked on the main hit. |
Methods
| Member | What it is |
|---|---|
override void ExecuteWithHit(HeldPickupHandler handler, ImpactHitWithTool hitWithTool, bool hasHit = true) | Deals the area damage, then runs the normal skill execution. |
override bool ValidateExecutionHit(ProgressionPath path, ImpactHitWithTool hitWithTool) | True if the struck detector is on one of the target channels. |
override bool ValidatePickup(HeldPickupHandler pickupHandler) | True if the held tool has one of the required channels. |
protected bool DealDamage(ImpactHitWithTool hit, Player castingPlayer) | Hits everything in the level's shape with distance falloff, skipping the caster and things too hard for the tool. False if nothing was hit. |
protected override void SerializeInternal(Stream stream) | When consumed, sends the hit positions so clients can play hit effects there. |