BowMultiArrowShot
A class in Root.Township, Alta.Progression.Skills.
Skill modifier that adds extra arrows to a bow while the skill is active, set by a MultiArrowConfiguration. A ScriptableObject asset.
- Listed in Players and characters
- Inherits or implements
PickupBasedSkillModifier - Derived types
BowMultiArrowShot.Create - Nested types
Create
Constructors
| Member | What it is |
|---|---|
BowMultiArrowShot() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
9 private and internal fields
| Member | What it is |
|---|---|
private MultiArrowConfiguration arrowConfiguration | Offsets and damage multiplier for the extra arrows. |
private Dictionary<ISkillInputMethod, BowString> bowStrings | Bow string for each registered skill input. |
private NetworkPrefab extraArrowPrefab | Prefab spawned for each extra arrow. |
private Dictionary<BowString, ISkillInputMethod> inputs | Skill input for each bow string. |
private TransformEvent onCancelled | Event raised with the entity's transform when the skill is cancelled. |
private TransformEvent onCharged | Event raised with the entity's transform when the skill finishes charging. |
private TransformEvent onChargingStarted | Event raised with the entity's transform when charging starts. |
private TransformEvent onConsumed | Event raised with the entity's transform when the skill is used. |
private List<PickupTag> validItemsTags | Pickup tags this skill applies to. |
Methods
| Member | What it is |
|---|---|
override void Deregister(ISkillInputMethod input) | Removes the input's bow string from the maps on the next frame. |
override void InputChangedState(bool isEnabled, ISkillInputMethod input) | Hooks the string's shoot event and creates extra arrows when enabled; destroys them when disabled. |
override void Register(ISkillInputMethod input) | Records the bow string on the held pickup for this input. |
protected override uint GetIdentifier(ISkillInputMethod input) | Uses the identifier of the arrow docked on the string, if any, instead of the default. |
protected override void HandleSkillStatus(IPlayer player, NetworkEntity entity, ToolBasedSkillStatus status) | Fires the matching transform event (charging started, charged, consumed or cancelled) for the entity. |
protected override void Modify(ISkillInputMethod input) | Does nothing. |
2 private and internal methods
| Member | What it is |
|---|---|
private void CreateExtraArrows(BowString bowString) | Spawns an extra arrow at each configured offset on the bow string, applies the damage multiplier and syncs them. |
private void OnArrowShot(BowString bowString, NetworkEntity shotEntity, Vector3 shotVelocity) | When the input is active: copies the shot arrow's settings to the extra arrows, sends consumed and resets the input. |