improve combat system
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use rand::Rng;
|
||||
use std::cmp::{max, min};
|
||||
|
||||
use crate::position::{HasPosition, Position};
|
||||
@@ -60,6 +61,10 @@ impl Player {
|
||||
pub fn get_experience(&self) -> usize {
|
||||
self.experience
|
||||
}
|
||||
|
||||
pub fn damage(&self) -> usize {
|
||||
rand::thread_rng().gen_range(1..4)
|
||||
}
|
||||
}
|
||||
|
||||
impl HasPosition for Player {
|
||||
|
||||
Reference in New Issue
Block a user