Skip to main content

PowerHit

A class in Root.Township, the global namespace.

A skill that multiplies the damage of a strong enough hit with a tool on a given impact channel, by an amount that grows with the skill's level. A ScriptableObject asset.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private float[] damageModifierPerLevelDamage multiplier for each skill level, index 0 being level 1.
private float minimumEffectivenesSmallest hit effectiveness (0 to 1) that triggers the skill.
private ImpactChannel targetImpactChannelThe impact channel the tool must have for the skill to apply.

Methods​

MemberWhat it is
override void ExecuteWithHit(HeldPickupHandler handler, ImpactHitWithTool hitWithTool, bool hasHit = true)Multiplies the hit's damage by the modifier for the player's level in this skill, then runs the base skill.
override bool ValidateExecutionHit(ProgressionPath path, ImpactHitWithTool hitWithTool)True when the hit is at least minimumEffectivenes effective and the tool hits on targetImpactChannel (as its first channel, if it has one).
override bool ValidatePickup(HeldPickupHandler pickupHandler)True when the held pickup is a tool with targetImpactChannel.