diff options
author | Guillaume <g@bitimplosion.com> | 2019-11-12 14:57:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-12 14:57:54 +0100 |
commit | e8e931794052455d93517d35c75bb98b7829e70d (patch) | |
tree | 99df93ff7678775a4cb179fbd6a0b52a15ede426 /src/entities.rs | |
parent | 8fa3fa881bc3b954e136295fe6cc7022737ae9db (diff) | |
parent | 76fc41b3c803ad4db3c19a76d408ab301438aa1e (diff) |
Merge pull request #5 from iagogarrido/master
Add state
Diffstat (limited to 'src/entities.rs')
-rw-r--r-- | src/entities.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/entities.rs b/src/entities.rs index 51cefc1..145741c 100644 --- a/src/entities.rs +++ b/src/entities.rs @@ -149,8 +149,8 @@ impl Player for Character { fn stats(&self) -> String {
format!(
- "{} - hp: {} attack: {} dodge: {} luck: {} experience: {}",
- self.class, self.health, self.attack, self.dodge, self.luck, self.xp
+ "{} - hp: {}/{} attack: {} dodge: {} luck: {} experience: {}",
+ self.class, self.health, self.max_health, self.attack, self.dodge, self.luck, self.xp
)
}
}
@@ -160,8 +160,8 @@ mod tests { use super::*;
fn test_attack() {
- let player: Character = Player::new("".to_string(), "Rogue".to_string(), 1, 4, 1, 4, (0,0));
+ let bob: Character = Enemy::new("Rogue".to_string(), 1, 4, 1, 4, (0, 0));
- assert_eq!(player.attack(), 6);
+ assert_eq!(bob.attack(), 6);
}
}
|