Skip to main content

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.

Constructors​

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

Fields​

9 private and internal fields
MemberWhat it is
private MultiArrowConfiguration arrowConfigurationOffsets and damage multiplier for the extra arrows.
private Dictionary<ISkillInputMethod, BowString> bowStringsBow string for each registered skill input.
private NetworkPrefab extraArrowPrefabPrefab spawned for each extra arrow.
private Dictionary<BowString, ISkillInputMethod> inputsSkill input for each bow string.
private TransformEvent onCancelledEvent raised with the entity's transform when the skill is cancelled.
private TransformEvent onChargedEvent raised with the entity's transform when the skill finishes charging.
private TransformEvent onChargingStartedEvent raised with the entity's transform when charging starts.
private TransformEvent onConsumedEvent raised with the entity's transform when the skill is used.
private List<PickupTag> validItemsTagsPickup tags this skill applies to.

Methods​

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