pub struct CharacterLevelFormula {
pub anchor_level: i64,
pub anchor_experience: i64,
pub experience_marginal_base: i64,
pub experience_marginal_growth: f64,
pub experience_late_band_level: i64,
pub experience_marginal_growth_late: f64,
pub ability_slots: u64,
pub attributes: Vec<CharacterLevelAttributeFormula>,
}Expand description
Formula-driven, unbounded extrapolation of character levels ABOVE the
authored character_levels table. For level <= anchor_level the authored
table is used verbatim; for level > anchor_level stats and experience are
computed from these parameters, so levels are uncapped.
Experience is cumulative and grows in TWO bands (BAL-009): up to
experience_late_band_level each level costs
experience_marginal_growth times the previous one, starting from
experience_marginal_base at anchor_level + 1; above it the ratio drops to
experience_marginal_growth_late. The seam is continuous — the late band’s
first marginal cost is the first band’s last one times the late growth — so
no second base is authored and the two can never drift apart.
ability_slots is constant (kept at the authored cap) so slots never grow
with infinite levels.
Fields§
§anchor_level: i64§anchor_experience: i64§experience_marginal_base: i64§experience_marginal_growth: f64§experience_late_band_level: i64§experience_marginal_growth_late: f64§ability_slots: u64§attributes: Vec<CharacterLevelAttributeFormula>Implementations§
Source§impl CharacterLevelFormula
impl CharacterLevelFormula
Sourcepub fn required_experience(&self, level: i64) -> i64
pub fn required_experience(&self, level: i64) -> i64
Cumulative experience required to REACH level (for level > anchor_level).
Saturates at i64::MAX for astronomically high levels (with geometric
growth the cost exceeds i64 around ~150 levels past the anchor — a level
no real income can ever fund) instead of overflowing. Levels stay
unbounded: the function is defined and finite for every input.
Sourcepub fn level_for_experience(&self, experience: i64) -> i64
pub fn level_for_experience(&self, experience: i64) -> i64
Highest level whose required_experience <= experience, for the
unbounded region (returns anchor_level when experience is below the
first extrapolated level’s cost). Inverts required_experience.
Sourcepub fn attributes_for_level(&self, level: i64) -> Vec<EntityAttribute>
pub fn attributes_for_level(&self, level: i64) -> Vec<EntityAttribute>
Computed attributes for a level in the unbounded region.
Sourcepub fn character_level(&self, level: i64) -> CharacterLevel
pub fn character_level(&self, level: i64) -> CharacterLevel
Full computed CharacterLevel for a level ABOVE anchor_level.
Trait Implementations§
Source§impl Clone for CharacterLevelFormula
impl Clone for CharacterLevelFormula
Source§fn clone(&self) -> CharacterLevelFormula
fn clone(&self) -> CharacterLevelFormula
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CharacterLevelFormula
impl Debug for CharacterLevelFormula
Source§impl<'de> Deserialize<'de> for CharacterLevelFormula
impl<'de> Deserialize<'de> for CharacterLevelFormula
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 JsonSchema for CharacterLevelFormula
impl JsonSchema for CharacterLevelFormula
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 more