Skip to main content

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.

Constructors​

MemberWhat it is
AreaAttackSkill()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

MemberWhat it is
protected float minimumEffectivenessNot read anywhere in this build.
protected ImpactChannel[] toolRequiredChannelsTool channels that allow the skill.
8 private and internal fields
MemberWhat it is
private LayerMask collectionLayersPhysics layers searched for colliders around the hit.
private ShapeImpactCollector[] collectionOverLevelsCollection shape per skill level; the player's level picks the entry (capped at the last one).
private AnimationCurve damageOverRadiusMaps squared distance over squared shape size (0 to 1) to the hit effectiveness used for each target.
private bool dealsDamageToKinematicObjectsIf false, colliders on kinematic rigidbodies are skipped.
private float hitDamageMultiplierSerialized multiplier that nothing in this class reads.
private PositionEvent hitObjectEffectEffect invoked on clients at each hit position when the skill's consumed state is read from the network.
private List<AreaAttackSkill.HitInformation> hitObjectPositionsPositions and chunks of the objects hit by the last DealDamage, sent to clients in SerializeInternal (up to 31).
private ImpactChannel[] targetChannelsImpact channels a target must have to be damaged, also checked on the main hit.

Methods​

MemberWhat 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.