1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
/*!
# Stats
This contains the basic structures for the entire statistics library
*/
/*
# The Basic HP/MP/XP stat model
This basic model of stats is easy to work with for beginners, but powerful enough to be used by the most experienced.
*/
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Basic {
/// Experience Points
pub xp:f64,
/// Health Points
pub hp:f64,
/// Mana Points
pub mp:f64,
/// Experience Points multiplier for next level
pub xp_next:f64,
/// Max Health Points
pub hp_max:f64,
/// Max Mana Points
pub mp_max:f64,
/// Current Level
pub level:f64,
/// The speed
pub speed:f64,
/// your currency points
pub gp:f64,
}
impl Basic {
/// make empty stats
pub fn empty() -> Self where Self:Sized {
Basic {
xp:0.0,
xp_next:0.0,
mp:0.0,
hp:0.0,
mp_max:0.0,
hp_max:0.0,
level:0.0,
speed:0.0,
gp:0.0,
}
}
}
impl Default for Basic {
fn default() -> Self {
Self::empty()
}
}
/*
# The Normal
This model provides fine tuning of attack and defense without needing all the fine tuning of a full stat sheet
*/
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Normal {
/// Experience Points
pub xp:f64,
/// Health Points
pub hp:f64,
/// Mana Points
pub mp:f64,
/// Experience Points multiplier for next level
pub xp_next:f64,
/// Max Health Points
pub hp_max:f64,
/// Max Mana Points
pub mp_max:f64,
/// Current Level
pub level:f64,
/// The speed
pub speed:f64,
/// your currency points
pub gp:f64,
/// Attack
pub atk:f64,
/// Defense
pub def:f64,
/// Mana Attack
pub m_atk:f64,
/// Mana Defense
pub m_def:f64,
}
impl Normal {
/// make empty stats
pub fn empty() -> Self where Self:Sized {
Normal {
xp:0.0,
xp_next:0.0,
mp:0.0,
hp:0.0,
mp_max:0.0,
hp_max:0.0,
level:0.0,
speed:0.0,
gp:0.0,
atk:0.0,
def:0.0,
m_atk:0.0,
m_def:0.0,
}
}
}
impl Default for Normal {
fn default() -> Self {
Self::empty()
}
}
/*
# The Advanced stat model
The entire stat sheet for fine tuned algorithms using all the information possible!
*/
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Advanced {
/// Experience Points
pub xp:f64,
/// Health Points
pub hp:f64,
/// Mana Points
pub mp:f64,
/// Experience Points multiplier for next level
pub xp_next:f64,
/// Max Health Points
pub hp_max:f64,
/// Max Mana Points
pub mp_max:f64,
/// Current Level
pub level:f64,
/// The speed
pub speed:f64,
/// your currency points
pub gp:f64,
/// Attack
pub atk:f64,
/// Defense
pub def:f64,
/// Mana Attack
pub m_atk:f64,
/// Mana Defense
pub m_def:f64,
/// The agility Points
pub agility:f64,
/// The strength Points
pub strength:f64,
/// The dexterity Points
pub dexterity:f64,
/// The constitution Points
pub constitution:f64,
/// The intelligence Points
pub intelligence:f64,
/// The charisma Points
pub charisma:f64,
/// The wisdom Points
pub wisdom:f64,
/// The current age
pub age:f64,
}
impl Advanced {
/// make empty stats
pub fn empty() -> Self where Self:Sized {
Advanced {
xp:0.0,
xp_next:0.0,
mp:0.0,
hp:0.0,
mp_max:0.0,
hp_max:0.0,
level:0.0,
speed:0.0,
gp:0.0,
atk:0.0,
def:0.0,
m_atk:0.0,
m_def:0.0,
agility:0.0,
strength:0.0,
dexterity:0.0,
constitution:0.0,
intelligence:0.0,
charisma:0.0,
wisdom:0.0,
age:0.0,
}
}
}
impl Default for Advanced {
fn default() -> Self {
Self::empty()
}
}