improve combat system

This commit is contained in:
2024-10-20 22:12:28 +02:00
parent efc4cdd363
commit cefb0cc5f2
6 changed files with 89 additions and 45 deletions

View File

@@ -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 {