Skip to main content

BowStringPullbackInputMethod

A class in Root.Township, the global namespace.

Skill input that activates when a bow string with an arrow nocked is pulled past a set amount for long enough, for chargeable bow skills. Made by BowStringPullbackStructure.GetNewInput.

Constructors​

MemberWhat it is
BowStringPullbackInputMethod()Creates a BowStringPullbackInputMethod with default values.

Fields​

MemberWhat it is
protected static Logger loggerNLog logger for this class.
10 private and internal fields
MemberWhat it is
private NetworkEntity arrowEntityThe arrow currently nocked.
private BowString bowStringThe bow string on the held pickup.
private HeldPickupHandler handlerBacking field for the handler.
private bool isActiveWhether the input is charged.
private bool isInPullbackRangeWhether the string is past the pull threshold.
private bool isTimeCriteriaMetWhether the minimum pull time has passed.
private BowStringPullbackStructure pullbackStructureThe settings: pull threshold, minimum time and timeout.
private IChargeableProfessionSkill skillThe chargeable skill told about charge start and cancel.
private AltaCoroutine timeoutCoroutineThe running timeout wait.
private AltaCoroutine waitForTimeThe running minimum time wait.

Properties​

5 private and internal properties
MemberWhat it is
private HeldPickupHandler ISkillInputMethod.Handler { get; }The held pickup handler this input belongs to.
private bool ISkillInputMethod.IsActive { get; }True while the string is held past the threshold long enough.
private bool ISkillInputMethod.NeedsUpdate { get; }Always false; it's driven by string pull events.
private bool ISkillInputMethod.ReceivesHits { get; }Always false.
private Player Player { get; }The player holding the bow.

Events​

MemberWhat it is
event Action<bool, ISkillInputMethod> ChangedActiveFired when the input becomes charged (true) or is cancelled (false).

Methods​

MemberWhat it is
void Reset(bool isCallingEvent)Deactivates and clears the time flag.
protected virtual void OnCancelled()Releases the skill's effect on the arrow. Virtual.
protected virtual void OnCharged()Hook called when the charge completes. Empty here.
14 private and internal methods
MemberWhat it is
private void CheckForPullback(float currentPull)String pull handler: with an arrow nocked, starts waiting for the charge once pull passes the threshold and cancels when it drops back.
private IEnumerator CheckForTime() (iterator)Coroutine: waits the structure's minimum pull time, then marks the input charged.
private void ISkillInputMethod.Clear()Next frame, resets the input and unsubscribes from the bow string.
private void Deactivate(bool isCallingEvent)Stops the timers, tells the skill charging was cancelled for the arrow, and fires ChangedActive false if it was active.
private bool ISkillInputMethod.ReceiveHit(HeldPickupHandler handler, ImpactHitWithTool hitWithTool, ProfessionSkill skill)Ignores hits and returns false.
private void ISkillInputMethod.RegisterHandler(HeldPickupHandler pickupHandler, SkillInputStructure structure, ProfessionSkill skill)Binds to the pickup's BowString (logs an error if there is none) and tracks the nocked arrow.
private void SetArrowEntity(Interactor interactor, Pickup pickup, PickupDock dock)Remembers the arrow docked on the string.
private void StopTimeCheck()Stops the minimum pull time wait.
private void StopTimeoutCoroutine()Stops the timeout wait.
private void TimedOut()Resets the input when the charge times out, but stays in pullback range so it won't restart until the pull drops.
private IEnumerator TimeoutInput() (iterator)Coroutine: waits the timeout duration, then calls TimedOut.
private void ISkillInputMethod.Update()Does nothing.
private void WaitedLongEnough()Activates the input, fires ChangedActive true, starts the timeout if set and calls OnCharged.
private void WaitForCharge()Marks pullback range, tells the skill charging started and starts the minimum time wait.