Class KnockoutWeaponDecision
java.lang.Object
privbot.mechanics.KnockoutWeaponDecision
Pure KO-weapon switch timing adapted from the Dharok-mode policy. The caller selects a verified weapon and supplies
detached observations and accepted-send history; no equip or attack is dispatched here.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic enumKEEP also covers an accepted equip that has not yet appeared in the worn read; it is not a new dispatch. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intKnown absence of a prior accepted equip or confirmed fire; null instead denotes unreadable history. -
Method Summary
Modifier and TypeMethodDescriptiondecide(int tick, Boolean enabled, Boolean fighting, Boolean specialActive, Boolean trigger, Boolean worn, Boolean carried, Boolean setAside, Integer lastAskedTick, Integer lastFiredTick, Boolean firedWithWeapon, Integer readyTick, Integer sendDelay, Boolean underKoLine, Integer nextHitTick) Null facts are unreadable and hold.static BooleanfinisherTrigger(Integer theirHpPercent, int threshold, Integer energy, int specCost) Finisher fallback: an observed low opponent and insufficient energy for the primary special.static BooleanTrue when either readable HP percentage meets its configured threshold.
-
Field Details
-
NEVER
public static final int NEVERKnown absence of a prior accepted equip or confirmed fire; null instead denotes unreadable history.- See Also:
-
-
Method Details
-
trigger
public static Boolean trigger(Integer ourHpPercent, int ourThreshold, Integer theirHpPercent, int theirThreshold) True when either readable HP percentage meets its configured threshold. Null means a missing value could change a negative answer. Thresholds are caller supplied; this rule does not imply that a set effect is active. -
finisherTrigger
-
decide
public static KnockoutWeaponDecision.Decision decide(int tick, Boolean enabled, Boolean fighting, Boolean specialActive, Boolean trigger, Boolean worn, Boolean carried, Boolean setAside, Integer lastAskedTick, Integer lastFiredTick, Boolean firedWithWeapon, Integer readyTick, Integer sendDelay, Boolean underKoLine, Integer nextHitTick) Null facts are unreadable and hold. UseNEVERfor a known absent lastAskedTick or lastFiredTick. firedWithWeapon must describe a confirmed fire, not an accepted click. readyTick and sendDelay are caller-calculated; when the KO line is active, the incoming hit must be later than the earliest possible weapon swing. An unknown KO-line result, or an unknown incoming-hit deadline while under it, never authorizes a switch. A worn weapon stays on until the trigger clears and a confirmed swing or ten-tick timeout resolves it. An accepted equip is not assumed to have landed.
-