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.
- Listed in Global namespace: A to B
- Inherits or implements
ISkillInputMethod
Constructors
| Member | What it is |
|---|---|
BowStringPullbackInputMethod() | Creates a BowStringPullbackInputMethod with default values. |
Fields
| Member | What it is |
|---|---|
protected static Logger logger | NLog logger for this class. |
10 private and internal fields
| Member | What it is |
|---|---|
private NetworkEntity arrowEntity | The arrow currently nocked. |
private BowString bowString | The bow string on the held pickup. |
private HeldPickupHandler handler | Backing field for the handler. |
private bool isActive | Whether the input is charged. |
private bool isInPullbackRange | Whether the string is past the pull threshold. |
private bool isTimeCriteriaMet | Whether the minimum pull time has passed. |
private BowStringPullbackStructure pullbackStructure | The settings: pull threshold, minimum time and timeout. |
private IChargeableProfessionSkill skill | The chargeable skill told about charge start and cancel. |
private AltaCoroutine timeoutCoroutine | The running timeout wait. |
private AltaCoroutine waitForTime | The running minimum time wait. |
Properties
5 private and internal properties
| Member | What 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
| Member | What it is |
|---|---|
event Action<bool, ISkillInputMethod> ChangedActive | Fired when the input becomes charged (true) or is cancelled (false). |
Methods
14 private and internal methods
| Member | What 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. |