pub enum TriggerCondition {
Show 24 variants
EveryNthBasicAttack,
EveryNthHitTaken,
SkillManaAtMost,
EveryNthSkillCast,
EveryNthDefeat,
FirstAttackAfterSkill,
OnSkillCast,
OnCrit,
OnDefeat,
SkillHitsAtLeastTargets,
SkillDiffersFromPrevious,
CritAfterNonCrit,
OnEvasion,
SkillManaAtLeast,
HpCrossedBelowPercent,
OnCritStreak,
DistinctSkillsWithin,
SurvivedBigHitPercent,
DodgesWithin,
AllEquippedSkillsCastThisPhase,
SkillAttackSkillWithin,
SkillsWithoutDamageTaken,
SkillBelowHpPercent,
OnInterval,
}Expand description
Condition shape of a Trigger Stone. The numeric parameter (streak length,
counter period, percentage) lives in
TriggerStoneTemplate::condition_value and the time window in
TriggerStoneTemplate::condition_window_ticks, so a designer retunes a
trigger without a code change.
Triggers subscribe to Core combat outcomes only
([essences::combat_origin::CombatEventOrigin]).
Basic Attack is the most frequent Core event, so there is no plain “on every
attack” condition — the common tier counts (EveryNthBasicAttack) instead.
The variants map 1:1 onto the design catalog:
EveryNthBasicAttack—TR-C01: everycondition_value-th Basic Attack.EveryNthHitTaken—TR-C02: everycondition_value-th Core hit on the hero.SkillManaAtMost—TR-C03: an original Skill that cost ≤condition_valuemana.EveryNthSkillCast—TR-C04: everycondition_value-th original Skill Cast.EveryNthDefeat—TR-C05: everycondition_value-th enemy killed by a Core action.FirstAttackAfterSkill—TR-C06: the first Basic Attack after an original Skill Cast.OnSkillCast—TR-R01: every original Skill Cast.OnCrit—TR-R02: every Core Critical Hit.OnDefeat—TR-R03: a Core action killed an enemy.SkillHitsAtLeastTargets—TR-R04: an original Skill that reached ≥condition_valuetargets.SkillDiffersFromPrevious—TR-R05: an original Skill different from the previous one.CritAfterNonCrit—TR-R06: a Core Critical Hit straight after a Core non-critical hit.OnEvasion—TR-E01: every Core Dodge.SkillManaAtLeast—TR-E02: an original Skill that cost ≥condition_valuemana.HpCrossedBelowPercent—TR-E03: HP crossedcondition_value% downwards, once per phase.OnCritStreak—TR-E04/TR-L01:condition_valueCore Critical Hits in a row.DistinctSkillsWithin—TR-E05:condition_valuedifferent original Skills withincondition_window_ticks.SurvivedBigHitPercent—TR-E06: one Core hit took ≥condition_value% of Max HP and the hero lived.DodgesWithin—TR-L02:condition_valueCore Dodges withincondition_window_ticks.AllEquippedSkillsCastThisPhase—TR-L03: every equipped Skill cast at least once this phase.SkillAttackSkillWithin—TR-L04: original Skill → Basic Attack → different original Skill withincondition_window_ticks.SkillsWithoutDamageTaken—TR-L05:condition_valueoriginal Skills in a row with no Core damage taken.SkillBelowHpPercent—TR-L06: an original Skill cast belowcondition_value% HP, hero survived the action.
Variant docs live here rather than on the variants themselves: a documented
variant makes the admin schema generate a oneOf of one-value enums instead
of a plain picker.
Variants§
EveryNthBasicAttack
EveryNthHitTaken
SkillManaAtMost
EveryNthSkillCast
EveryNthDefeat
FirstAttackAfterSkill
OnSkillCast
OnCrit
OnDefeat
SkillHitsAtLeastTargets
SkillDiffersFromPrevious
CritAfterNonCrit
OnEvasion
SkillManaAtLeast
HpCrossedBelowPercent
OnCritStreak
DistinctSkillsWithin
SurvivedBigHitPercent
DodgesWithin
AllEquippedSkillsCastThisPhase
SkillAttackSkillWithin
SkillsWithoutDamageTaken
SkillBelowHpPercent
OnInterval
BAL-027 Battle Rhythm: fires every condition_value ms of fight
clock while a living hostile exists — a metronome, not an event
reaction.
Implementations§
Source§impl TriggerCondition
impl TriggerCondition
Sourcepub const fn needs_mana(self) -> bool
pub const fn needs_mana(self) -> bool
Whether the condition reads the mana cost of one specific cast.
Whether this condition prices the cast off the per-cast mana cost the
pool actually charged (TR-C03 Cheap Skill, TR-E02 Big Spend).
Implemented since the mana wiring — kept as the explicit list of which
conditions read the pool.
Sourcepub const fn needs_window(self) -> bool
pub const fn needs_window(self) -> bool
Whether the condition is defined over a time window and therefore needs
a positive TriggerStoneTemplate::condition_window_ticks.
Trait Implementations§
Source§impl Clone for TriggerCondition
impl Clone for TriggerCondition
Source§fn clone(&self) -> TriggerCondition
fn clone(&self) -> TriggerCondition
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TriggerCondition
impl Debug for TriggerCondition
Source§impl<'de> Deserialize<'de> for TriggerCondition
impl<'de> Deserialize<'de> for TriggerCondition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<TriggerCondition> for JsValuewhere
TriggerCondition: Serialize,
impl From<TriggerCondition> for JsValuewhere
TriggerCondition: Serialize,
Source§fn from(value: TriggerCondition) -> Self
fn from(value: TriggerCondition) -> Self
Source§impl FromWasmAbi for TriggerConditionwhere
Self: DeserializeOwned,
impl FromWasmAbi for TriggerConditionwhere
Self: DeserializeOwned,
Source§impl Hash for TriggerCondition
impl Hash for TriggerCondition
Source§impl IntoWasmAbi for TriggerConditionwhere
TriggerCondition: Serialize,
impl IntoWasmAbi for TriggerConditionwhere
TriggerCondition: Serialize,
Source§impl JsonSchema for TriggerCondition
impl JsonSchema for TriggerCondition
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl OptionFromWasmAbi for TriggerConditionwhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for TriggerConditionwhere
Self: DeserializeOwned,
Source§impl OptionIntoWasmAbi for TriggerConditionwhere
TriggerCondition: Serialize,
impl OptionIntoWasmAbi for TriggerConditionwhere
TriggerCondition: Serialize,
Source§impl PartialEq for TriggerCondition
impl PartialEq for TriggerCondition
Source§impl RefFromWasmAbi for TriggerConditionwhere
Self: DeserializeOwned,
impl RefFromWasmAbi for TriggerConditionwhere
Self: DeserializeOwned,
Source§type Abi = <JsType as RefFromWasmAbi>::Abi
type Abi = <JsType as RefFromWasmAbi>::Abi
Self are recovered from.Source§type Anchor = SelfOwner<TriggerCondition>
type Anchor = SelfOwner<TriggerCondition>
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl Serialize for TriggerCondition
impl Serialize for TriggerCondition
Source§impl Tsify for TriggerCondition
impl Tsify for TriggerCondition
const DECL: &'static str = "/**\n * Condition shape of a Trigger Stone. The numeric parameter (streak length,\n * counter period, percentage) lives in\n * [`TriggerStoneTemplate::condition_value`] and the time window in\n * [`TriggerStoneTemplate::condition_window_ticks`], so a designer retunes a\n * trigger without a code change.\n *\n * Triggers subscribe to Core combat outcomes only\n * ([`essences::combat_origin::CombatEventOrigin`]).\n *\n * Basic Attack is the most frequent Core event, so there is no plain \\\"on every\n * attack\\\" condition \u{2014} the common tier counts (`EveryNthBasicAttack`) instead.\n *\n * The variants map 1:1 onto the design catalog:\n *\n * * `EveryNthBasicAttack` \u{2014} `TR-C01`: every `condition_value`-th Basic Attack.\n * * `EveryNthHitTaken` \u{2014} `TR-C02`: every `condition_value`-th Core hit on the hero.\n * * `SkillManaAtMost` \u{2014} `TR-C03`: an original Skill that cost \u{2264} `condition_value` mana.\n * * `EveryNthSkillCast` \u{2014} `TR-C04`: every `condition_value`-th original Skill Cast.\n * * `EveryNthDefeat` \u{2014} `TR-C05`: every `condition_value`-th enemy killed by a Core action.\n * * `FirstAttackAfterSkill` \u{2014} `TR-C06`: the first Basic Attack after an original Skill Cast.\n * * `OnSkillCast` \u{2014} `TR-R01`: every original Skill Cast.\n * * `OnCrit` \u{2014} `TR-R02`: every Core Critical Hit.\n * * `OnDefeat` \u{2014} `TR-R03`: a Core action killed an enemy.\n * * `SkillHitsAtLeastTargets` \u{2014} `TR-R04`: an original Skill that reached \u{2265} `condition_value` targets.\n * * `SkillDiffersFromPrevious` \u{2014} `TR-R05`: an original Skill different from the previous one.\n * * `CritAfterNonCrit` \u{2014} `TR-R06`: a Core Critical Hit straight after a Core non-critical hit.\n * * `OnEvasion` \u{2014} `TR-E01`: every Core Dodge.\n * * `SkillManaAtLeast` \u{2014} `TR-E02`: an original Skill that cost \u{2265} `condition_value` mana.\n * * `HpCrossedBelowPercent` \u{2014} `TR-E03`: HP crossed `condition_value`% downwards, once per phase.\n * * `OnCritStreak` \u{2014} `TR-E04` / `TR-L01`: `condition_value` Core Critical Hits in a row.\n * * `DistinctSkillsWithin` \u{2014} `TR-E05`: `condition_value` different original Skills within `condition_window_ticks`.\n * * `SurvivedBigHitPercent` \u{2014} `TR-E06`: one Core hit took \u{2265} `condition_value`% of Max HP and the hero lived.\n * * `DodgesWithin` \u{2014} `TR-L02`: `condition_value` Core Dodges within `condition_window_ticks`.\n * * `AllEquippedSkillsCastThisPhase` \u{2014} `TR-L03`: every equipped Skill cast at least once this phase.\n * * `SkillAttackSkillWithin` \u{2014} `TR-L04`: original Skill \u{2192} Basic Attack \u{2192} *different* original Skill within `condition_window_ticks`.\n * * `SkillsWithoutDamageTaken` \u{2014} `TR-L05`: `condition_value` original Skills in a row with no Core damage taken.\n * * `SkillBelowHpPercent` \u{2014} `TR-L06`: an original Skill cast below `condition_value`% HP, hero survived the action.\n *\n * Variant docs live here rather than on the variants themselves: a documented\n * variant makes the admin schema generate a `oneOf` of one-value enums instead\n * of a plain picker.\n */\nexport type TriggerCondition = \"EveryNthBasicAttack\" | \"EveryNthHitTaken\" | \"SkillManaAtMost\" | \"EveryNthSkillCast\" | \"EveryNthDefeat\" | \"FirstAttackAfterSkill\" | \"OnSkillCast\" | \"OnCrit\" | \"OnDefeat\" | \"SkillHitsAtLeastTargets\" | \"SkillDiffersFromPrevious\" | \"CritAfterNonCrit\" | \"OnEvasion\" | \"SkillManaAtLeast\" | \"HpCrossedBelowPercent\" | \"OnCritStreak\" | \"DistinctSkillsWithin\" | \"SurvivedBigHitPercent\" | \"DodgesWithin\" | \"AllEquippedSkillsCastThisPhase\" | \"SkillAttackSkillWithin\" | \"SkillsWithoutDamageTaken\" | \"SkillBelowHpPercent\" | \"OnInterval\";"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
Source§impl VectorFromWasmAbi for TriggerConditionwhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for TriggerConditionwhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
Source§impl VectorIntoWasmAbi for TriggerConditionwhere
TriggerCondition: Serialize,
impl VectorIntoWasmAbi for TriggerConditionwhere
TriggerCondition: Serialize,
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
Source§impl WasmDescribeVector for TriggerCondition
impl WasmDescribeVector for TriggerCondition
impl Copy for TriggerCondition
impl Eq for TriggerCondition
impl StructuralPartialEq for TriggerCondition
Auto Trait Implementations§
impl Freeze for TriggerCondition
impl RefUnwindSafe for TriggerCondition
impl Send for TriggerCondition
impl Sync for TriggerCondition
impl Unpin for TriggerCondition
impl UnwindSafe for TriggerCondition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.