pub enum LawCondition {
Show 13 variants
NthBasicAttack,
OriginalSkillCast,
CriticalHit,
Dodge,
NthHitTaken,
SkillWithTag,
SkillMinTargets,
SkillManaAtMost,
SkillManaAtLeast,
KilledEnemy,
HpFellBelow,
PhaseStarted,
DistinctSkillsWithin,
}Expand description
What makes a law fire. Every variant is a Core occurrence or a property of one — nothing a law (or any other modifier) produced can satisfy any of them, which is the anti-loop rule of the design (plan §8).
The numeric parameter of a condition lives in
LawTemplate::condition_value and its tag in
LawTemplate::condition_tag, so retuning “every 5th” to “every 4th” is a
config edit.
NthBasicAttack— everycondition_value-th Core Basic Attack.OriginalSkillCast— one Core cast of a non-basic ability.CriticalHit— a Core critical hit landed by the owner.Dodge— a Core evasion by the owner.NthHitTaken— everycondition_value-th Core hit landed on the owner.SkillWithTag— a Core original Skill carryingcondition_tagresolved.SkillMinTargets— a Core original Skill that damaged at leastcondition_valuedistinct targets.SkillManaAtMost/SkillManaAtLeast— per-cast mana cost bounds. Mana does not exist on this branch, so laws using these ship INACTIVE (LawTemplate::is_active) and are never evaluated.KilledEnemy— a Core action of the owner killed an enemy.HpFellBelow— the owner’s HP crossedcondition_valuepermyriad of max HP downwards.PhaseStarted— the owner’s own side just came up.DistinctSkillsWithin—condition_valueDIFFERENT original Skills resolved insideLawTemplate::condition_window_ticks.
Variant docs live on the enum rather than on the variants so the admin
schema generates a plain picker instead of a oneOf of one-value enums.
Variants§
NthBasicAttack
OriginalSkillCast
CriticalHit
Dodge
NthHitTaken
SkillWithTag
SkillMinTargets
SkillManaAtMost
SkillManaAtLeast
KilledEnemy
HpFellBelow
PhaseStarted
DistinctSkillsWithin
Implementations§
Source§impl LawCondition
impl LawCondition
Sourcepub const fn needs_mana(self) -> bool
pub const fn needs_mana(self) -> bool
Whether this condition prices the cast off the per-cast mana cost the pool actually charged. Implemented since the mana wiring — kept as the explicit list of which conditions read the pool.
Sourcepub const fn is_pre_cast(self) -> bool
pub const fn is_pre_cast(self) -> bool
Whether this condition is decided BEFORE the triggering cast resolves.
Those laws are evaluated from the cast entry point so an effect that
changes the cast itself (RL-01 “this strike deals +100%”) lands on the
strike that triggered it.
Trait Implementations§
Source§impl Clone for LawCondition
impl Clone for LawCondition
Source§fn clone(&self) -> LawCondition
fn clone(&self) -> LawCondition
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LawCondition
impl Debug for LawCondition
Source§impl Default for LawCondition
impl Default for LawCondition
Source§fn default() -> LawCondition
fn default() -> LawCondition
Source§impl<'de> Deserialize<'de> for LawCondition
impl<'de> Deserialize<'de> for LawCondition
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 Display for LawCondition
impl Display for LawCondition
Source§impl From<LawCondition> for JsValuewhere
LawCondition: Serialize,
impl From<LawCondition> for JsValuewhere
LawCondition: Serialize,
Source§fn from(value: LawCondition) -> Self
fn from(value: LawCondition) -> Self
Source§impl FromStr for LawCondition
impl FromStr for LawCondition
Source§impl FromWasmAbi for LawConditionwhere
Self: DeserializeOwned,
impl FromWasmAbi for LawConditionwhere
Self: DeserializeOwned,
Source§impl Hash for LawCondition
impl Hash for LawCondition
Source§impl IntoWasmAbi for LawConditionwhere
LawCondition: Serialize,
impl IntoWasmAbi for LawConditionwhere
LawCondition: Serialize,
Source§impl JsonSchema for LawCondition
impl JsonSchema for LawCondition
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 LawConditionwhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for LawConditionwhere
Self: DeserializeOwned,
Source§impl OptionIntoWasmAbi for LawConditionwhere
LawCondition: Serialize,
impl OptionIntoWasmAbi for LawConditionwhere
LawCondition: Serialize,
Source§impl PartialEq for LawCondition
impl PartialEq for LawCondition
Source§impl RefFromWasmAbi for LawConditionwhere
Self: DeserializeOwned,
impl RefFromWasmAbi for LawConditionwhere
Self: DeserializeOwned,
Source§type Abi = <JsType as RefFromWasmAbi>::Abi
type Abi = <JsType as RefFromWasmAbi>::Abi
Self are recovered from.Source§type Anchor = SelfOwner<LawCondition>
type Anchor = SelfOwner<LawCondition>
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 LawCondition
impl Serialize for LawCondition
Source§impl TryFrom<&str> for LawCondition
impl TryFrom<&str> for LawCondition
Source§impl Tsify for LawCondition
impl Tsify for LawCondition
const DECL: &'static str = "/**\n * What makes a law fire. Every variant is a Core occurrence or a property of\n * one \u{2014} nothing a law (or any other modifier) produced can satisfy any of\n * them, which is the anti-loop rule of the design (plan \u{a7}8).\n *\n * The numeric parameter of a condition lives in\n * [`LawTemplate::condition_value`] and its tag in\n * [`LawTemplate::condition_tag`], so retuning \\\"every 5th\\\" to \\\"every 4th\\\" is a\n * config edit.\n *\n * * `NthBasicAttack` \u{2014} every `condition_value`-th Core Basic Attack.\n * * `OriginalSkillCast` \u{2014} one Core cast of a non-basic ability.\n * * `CriticalHit` \u{2014} a Core critical hit landed by the owner.\n * * `Dodge` \u{2014} a Core evasion by the owner.\n * * `NthHitTaken` \u{2014} every `condition_value`-th Core hit landed on the owner.\n * * `SkillWithTag` \u{2014} a Core original Skill carrying `condition_tag` resolved.\n * * `SkillMinTargets` \u{2014} a Core original Skill that damaged at least\n * `condition_value` distinct targets.\n * * `SkillManaAtMost` / `SkillManaAtLeast` \u{2014} per-cast mana cost bounds. Mana\n * does not exist on this branch, so laws using these ship INACTIVE\n * ([`LawTemplate::is_active`]) and are never evaluated.\n * * `KilledEnemy` \u{2014} a Core action of the owner killed an enemy.\n * * `HpFellBelow` \u{2014} the owner\\\'s HP crossed `condition_value` permyriad of max\n * HP downwards.\n * * `PhaseStarted` \u{2014} the owner\\\'s own side just came up.\n * * `DistinctSkillsWithin` \u{2014} `condition_value` DIFFERENT original Skills\n * resolved inside [`LawTemplate::condition_window_ticks`].\n *\n * Variant docs live on the enum rather than on the variants so the admin\n * schema generates a plain picker instead of a `oneOf` of one-value enums.\n */\nexport type LawCondition = \"NthBasicAttack\" | \"OriginalSkillCast\" | \"CriticalHit\" | \"Dodge\" | \"NthHitTaken\" | \"SkillWithTag\" | \"SkillMinTargets\" | \"SkillManaAtMost\" | \"SkillManaAtLeast\" | \"KilledEnemy\" | \"HpFellBelow\" | \"PhaseStarted\" | \"DistinctSkillsWithin\";"
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 LawConditionwhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for LawConditionwhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
Source§impl VectorIntoWasmAbi for LawConditionwhere
LawCondition: Serialize,
impl VectorIntoWasmAbi for LawConditionwhere
LawCondition: Serialize,
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
Source§impl WasmDescribeVector for LawCondition
impl WasmDescribeVector for LawCondition
impl Copy for LawCondition
impl Eq for LawCondition
impl StructuralPartialEq for LawCondition
Auto Trait Implementations§
impl Freeze for LawCondition
impl RefUnwindSafe for LawCondition
impl Send for LawCondition
impl Sync for LawCondition
impl Unpin for LawCondition
impl UnwindSafe for LawCondition
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<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.