pub struct ArtifactOwnershipBonusStat {
pub attribute_id: AttributeId,
pub percent: f64,
pub percent_per_level: f64,
}Expand description
One stat an artifact pays for being OWNED, in percent of the composed stat.
Mirrors the StoneStat idiom (value + value_per_level) so the two
collections scale the same way and a reader who knows one knows the other.
The difference is the unit: a stone stat is a flat attribute delta, this is a
PERCENT written into <code>.mod.
An artifact carries a whole list of these, so “5% hp + 10% armor” is one template — the shared three-column table this replaced could only ever express one artifact-wide row per level.
Fields§
§attribute_id: AttributeId§percent: f64§percent_per_level: f64Implementations§
Source§impl ArtifactOwnershipBonusStat
impl ArtifactOwnershipBonusStat
Sourcepub fn percent_at_level(&self, level: i64) -> f64
pub fn percent_at_level(&self, level: i64) -> f64
The percent this stat pays on an artifact of level. Level 1 (and any
nonsense below it) is the base percent.
Trait Implementations§
Source§impl Clone for ArtifactOwnershipBonusStat
impl Clone for ArtifactOwnershipBonusStat
Source§fn clone(&self) -> ArtifactOwnershipBonusStat
fn clone(&self) -> ArtifactOwnershipBonusStat
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 ArtifactOwnershipBonusStat
impl Debug for ArtifactOwnershipBonusStat
Source§impl<'de> Deserialize<'de> for ArtifactOwnershipBonusStat
impl<'de> Deserialize<'de> for ArtifactOwnershipBonusStat
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 From<ArtifactOwnershipBonusStat> for JsValuewhere
ArtifactOwnershipBonusStat: Serialize,
impl From<ArtifactOwnershipBonusStat> for JsValuewhere
ArtifactOwnershipBonusStat: Serialize,
Source§fn from(value: ArtifactOwnershipBonusStat) -> Self
fn from(value: ArtifactOwnershipBonusStat) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for ArtifactOwnershipBonusStatwhere
Self: DeserializeOwned,
impl FromWasmAbi for ArtifactOwnershipBonusStatwhere
Self: DeserializeOwned,
Source§impl JsonSchema for ArtifactOwnershipBonusStat
impl JsonSchema for ArtifactOwnershipBonusStat
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 OptionFromWasmAbi for ArtifactOwnershipBonusStatwhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for ArtifactOwnershipBonusStatwhere
Self: DeserializeOwned,
Source§impl OptionIntoWasmAbi for ArtifactOwnershipBonusStatwhere
ArtifactOwnershipBonusStat: Serialize,
impl OptionIntoWasmAbi for ArtifactOwnershipBonusStatwhere
ArtifactOwnershipBonusStat: Serialize,
Source§impl RefFromWasmAbi for ArtifactOwnershipBonusStatwhere
Self: DeserializeOwned,
impl RefFromWasmAbi for ArtifactOwnershipBonusStatwhere
Self: DeserializeOwned,
Source§type Abi = <JsType as RefFromWasmAbi>::Abi
type Abi = <JsType as RefFromWasmAbi>::Abi
The Wasm ABI type references to
Self are recovered from.Source§type Anchor = SelfOwner<ArtifactOwnershipBonusStat>
type Anchor = SelfOwner<ArtifactOwnershipBonusStat>
The type that holds the reference to
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 Tsify for ArtifactOwnershipBonusStat
impl Tsify for ArtifactOwnershipBonusStat
const DECL: &'static str = "/**\n * One stat an artifact pays for being OWNED, in percent of the composed stat.\n *\n * Mirrors the `StoneStat` idiom (`value` + `value_per_level`) so the two\n * collections scale the same way and a reader who knows one knows the other.\n * The difference is the unit: a stone stat is a flat attribute delta, this is a\n * PERCENT written into `<code>.mod`.\n *\n * An artifact carries a whole list of these, so \\\"5% hp + 10% armor\\\" is one\n * template \u{2014} the shared three-column table this replaced could only ever\n * express one artifact-wide row per level.\n */\nexport interface ArtifactOwnershipBonusStat {\n attribute_id: AttributeId;\n percent: number;\n percent_per_level: number;\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>
Source§impl VectorFromWasmAbi for ArtifactOwnershipBonusStatwhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for ArtifactOwnershipBonusStatwhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
Source§impl VectorIntoWasmAbi for ArtifactOwnershipBonusStatwhere
ArtifactOwnershipBonusStat: Serialize,
impl VectorIntoWasmAbi for ArtifactOwnershipBonusStatwhere
ArtifactOwnershipBonusStat: Serialize,
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
Source§impl WasmDescribeVector for ArtifactOwnershipBonusStat
impl WasmDescribeVector for ArtifactOwnershipBonusStat
impl Copy for ArtifactOwnershipBonusStat
Auto Trait Implementations§
impl Freeze for ArtifactOwnershipBonusStat
impl RefUnwindSafe for ArtifactOwnershipBonusStat
impl Send for ArtifactOwnershipBonusStat
impl Sync for ArtifactOwnershipBonusStat
impl Unpin for ArtifactOwnershipBonusStat
impl UnwindSafe for ArtifactOwnershipBonusStat
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
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
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.