Skip to main content

QuickDrawApplication

A class in Root.Township, Alta.Enchantments.

Server-side quick draw trigger on one item: pulling the tool out of a valid dock charges it, and a good enough hit within the time limit fires the enchantment's effects.

Constructors​

MemberWhat it is
QuickDrawApplication(EnchantmentApplication enchantment, QuickDrawTrigger settings)Creates a QuickDrawApplication from enchantment and settings.

Fields​

3 private and internal fields
MemberWhat it is
private Timeline.IEntry entryTimeline entry for the pending timeout.
private TimeSpan nextChargeGame time before which the trigger can't charge again.
private ImpactTool toolThe item's impact tool, from the entity or a parent.

Methods​

MemberWhat it is
protected override void ApplyInternal()Listens for the item being undocked, if it has an impact tool.
protected override void RemoveInternal()Stops listening for undocks.
6 private and internal methods
MemberWhat it is
private void Cancel()Fires the cancelled events and uncharges when the time to hit runs out.
private void Charge(Interactor interactor, Pickup pickup, PickupDock dock)On undock by a player from a valid dock, after the cooldown: listens for hits, fires the charged events and starts the timeout.
private void Execute()Fires the executed events; uncharges if the trigger is one hit only.
private void Proc(ImpactHitWithTool hit, ImpactTool tool)Invokes the effects with the hit, runs Execute and starts the cooldown.
private void Uncharge()Cancels the timeout and stops listening for hits.
private void ValidateHit(ImpactHitWithTool hit, ImpactTool tool)Procs when a hit's effectiveness is above the trigger's minimum.