diff --git a/doc/MAGIC.md b/doc/MAGIC.md index c476b69c66518..25b43ee0dccf4 100644 --- a/doc/MAGIC.md +++ b/doc/MAGIC.md @@ -67,7 +67,7 @@ In `data/mods/Magiclysm` there is a template spell, copied here for your perusal "components": [requirement_id] // an id from a requirement, like the ones you use for crafting. spell components require to cast. "difficulty": 12, // the difficulty to learn/cast the spell "max_level": 10, // maximum level you can achieve in the spell - "exp_formula": "constant", // choose between "constant", "linear", "exponential". Exp Per level: Constant: a, Linear: a(level), Exponential (probably): e^(level * b) * e^(b) * e^(-c * b) - e^(level * b) * e^(-c * b). Defaults to exponential if no value is given. + "exp_formula": "constant", // choose between "constant", "linear", "exponential". Exp Per level: Constant: a, Linear: a(level), Exponential (probably): e^(level * b) * e^(-c * b) * ( e^(b) - 1 ). Defaults to exponential if no value is given. "experience_calc_constant_a": 1000, // adjusts the constants used in the experience level calculation formula. "experience_calc_constant_b": 0.146661, "experience_calc_constant_c": -62.5, diff --git a/src/magic.cpp b/src/magic.cpp index f63431dc8d591..ff13c5a66c571 100644 --- a/src/magic.cpp +++ b/src/magic.cpp @@ -201,6 +201,7 @@ std::string enum_to_string( xp_formula data ) case xp_formula::exponential: return "exponential"; case xp_formula::linear: return "linear"; case xp_formula::constant: return "constant"; + case xp_formula::num_formulas: break; } cata_fatal( "Invalid xp_formula" ); } @@ -1668,9 +1669,6 @@ bool spell::ignore_by_species_id( const tripoint_bub_ms &p ) const return valid; } - - - std::string spell::description() const { return type->description.translated(); diff --git a/src/magic.h b/src/magic.h index 5e14d44407683..25e7fc7775ce3 100644 --- a/src/magic.h +++ b/src/magic.h @@ -129,12 +129,13 @@ enum class spell_shape : int { }; enum class xp_formula : int { - // e^(level * b) * e^(b) * e^(-c * b) - e^(level * b) * e^(-c * b). Probably + // e^(level * b) * e^(-c * b) * ( e^(b) - 1 ) per level. Probably exponential, - // a(level) + // a(level) per level linear, - // a - constant + // a per level + constant, + num_formulas }; template<> @@ -159,7 +160,7 @@ struct enum_traits { template<> struct enum_traits { - static constexpr xp_formula last = xp_formula::exponential; + static constexpr xp_formula last = xp_formula::num_formulas; }; struct fake_spell {