pub struct LawTemplate {Show 19 fields
pub id: LawTemplateId,
pub name: I18nString,
pub description: I18nString,
pub side: WorldSide,
pub unlock_core_level: i64,
pub condition: LawCondition,
pub condition_value: i64,
pub condition_tag: Option<AbilityTag>,
pub condition_window_ticks: i64,
pub once_per_phase: bool,
pub effect: LawEffect,
pub effect_value: i64,
pub effect_duration_ticks: i64,
pub resonance: i64,
pub is_active: bool,
pub modifiers: Vec<LawAttributeModifier>,
pub power_q_first_rank: f64,
pub power_q_max_rank: f64,
pub icon_path: String,
}Expand description
A law as authored in config.
Not Eq: the Power coefficients are floats (BAL-030).
Fields§
§id: LawTemplateId§name: I18nString§description: I18nString§side: WorldSide§unlock_core_level: i64Deterministic unlock: raising the core of Self::side to this level
grants the law outright, at level 1 with no copies. Random law-copy
drops stay what they always were — copy income for LEVELLING an owned
law, never the unlock path.
GameConfig::validate_cores_settings requires every law to be reachable
by CoresSettings::max_slot_level(), so “both cores at the last
slot-opening level” always means “every law owned”.
condition: LawCondition§condition_value: i64§condition_tag: Option<AbilityTag>§condition_window_ticks: i64§once_per_phase: bool§effect: LawEffect§effect_value: i64§effect_duration_ticks: i64§resonance: i64§is_active: bool§modifiers: Vec<LawAttributeModifier>§power_q_first_rank: f64§power_q_max_rank: f64§icon_path: StringTrait Implementations§
Source§impl Clone for LawTemplate
impl Clone for LawTemplate
Source§fn clone(&self) -> LawTemplate
fn clone(&self) -> LawTemplate
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LawTemplate
impl Debug for LawTemplate
Source§impl<'de> Deserialize<'de> for LawTemplate
impl<'de> Deserialize<'de> for LawTemplate
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for LawTemplate
impl JsonSchema for LawTemplate
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for LawTemplate
impl PartialEq for LawTemplate
Source§impl Serialize for LawTemplate
impl Serialize for LawTemplate
Source§impl Tsify for LawTemplate
impl Tsify for LawTemplate
const DECL: &'static str = "/**\n * A law as authored in config.\n *\n * Not `Eq`: the Power coefficients are floats (BAL-030).\n */\nexport interface LawTemplate {\n id: LawTemplateId;\n name: I18nString;\n description: I18nString;\n side: WorldSide;\n /**\n * Deterministic unlock: raising the core of [`Self::side`] to this level\n * grants the law outright, at level 1 with no copies. Random law-copy\n * drops stay what they always were \u{2014} copy income for LEVELLING an owned\n * law, never the unlock path.\n *\n * `GameConfig::validate_cores_settings` requires every law to be reachable\n * by `CoresSettings::max_slot_level()`, so \\\"both cores at the last\n * slot-opening level\\\" always means \\\"every law owned\\\".\n */\n unlock_core_level: number;\n condition: LawCondition;\n condition_value: number;\n condition_tag: AbilityTag | null;\n condition_window_ticks: number;\n once_per_phase: boolean;\n effect: LawEffect;\n effect_value: number;\n effect_duration_ticks: number;\n resonance: number;\n is_active: boolean;\n modifiers: LawAttributeModifier[];\n power_q_first_rank: number;\n power_q_max_rank: number;\n icon_path: string;\n}"
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>
impl StructuralPartialEq for LawTemplate
Auto Trait Implementations§
impl Freeze for LawTemplate
impl RefUnwindSafe for LawTemplate
impl Send for LawTemplate
impl Sync for LawTemplate
impl Unpin for LawTemplate
impl UnwindSafe for LawTemplate
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
Mutably borrows from an owned value. Read more