Trait rpgstat::stats::NormalPremade [−][src]
pub trait NormalPremade<T: Copy + Default + AddAssign + Add<Output = T> + Div<Output = T> + DivAssign + Mul<Output = T> + MulAssign + Neg<Output = T> + Rem<Output = T> + RemAssign + Sub<Output = T> + SubAssign + PartialOrd + NumCast> {
Show 30 methods
fn stat(&self) -> Normal<T>;
fn set_hp(&mut self, amount: T);
fn set_mp(&mut self, amount: T);
fn set_xp(&mut self, amount: T);
fn set_hp_max(&mut self, amount: T);
fn set_mp_max(&mut self, amount: T);
fn set_xp_next(&mut self, amount: T);
fn set_gp(&mut self, amount: T);
fn set_atk(&mut self, amount: T);
fn set_def(&mut self, amount: T);
fn set_m_atk(&mut self, amount: T);
fn set_m_def(&mut self, amount: T);
fn id(&self) -> T { ... }
fn hp(&self) -> T { ... }
fn mp(&self) -> T { ... }
fn xp(&self) -> T { ... }
fn hp_max(&self) -> T { ... }
fn mp_max(&self) -> T { ... }
fn xp_next(&self) -> T { ... }
fn level(&self) -> T { ... }
fn speed(&self) -> T { ... }
fn gp(&self) -> T { ... }
fn atk(&self) -> T { ... }
fn def(&self) -> T { ... }
fn m_atk(&self) -> T { ... }
fn m_def(&self) -> T { ... }
fn damage(&mut self, amount: T) { ... }
fn heal(&mut self, amount: T) { ... }
fn attack_stable(&self, other: Normal<T>) -> T { ... }
fn attack(&self, other: Normal<T>) -> T { ... }
}Required methods
Functions you need to imlement
stat returns the Normal<T> you created
fn set_hp_max(&mut self, amount: T)
fn set_hp_max(&mut self, amount: T)
Set the Normal<T> Max Health Points
fn set_mp_max(&mut self, amount: T)
fn set_mp_max(&mut self, amount: T)
Set the Normal<T> Max Mana Points
fn set_xp_next(&mut self, amount: T)
fn set_xp_next(&mut self, amount: T)
Set the Normal<T> Next Experience Points
Provided methods
Predefined functions
Return the Normal<T> id number
fn attack_stable(&self, other: Normal<T>) -> T
fn attack_stable(&self, other: Normal<T>) -> T
Stable attack forumla attack*(100/(100+defense))
Scalable attack forumla damage = att * att / (att + def)