diff options
| author | Freya Murphy <freya@freyacat.org> | 2025-11-19 23:10:38 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2025-11-19 23:11:05 -0500 |
| commit | 9f2df31db6fe5450826cc68fd2158fe218dd8000 (patch) | |
| tree | 07096790eb1ca63512700a130c2baae3b4d151b3 /dungeon/src/entity.rs | |
| parent | dungeon: implement items (diff) | |
| download | DungeonCrawl-9f2df31db6fe5450826cc68fd2158fe218dd8000.tar.gz DungeonCrawl-9f2df31db6fe5450826cc68fd2158fe218dd8000.tar.bz2 DungeonCrawl-9f2df31db6fe5450826cc68fd2158fe218dd8000.zip | |
dungeon: inventory usage
Diffstat (limited to 'dungeon/src/entity.rs')
| -rw-r--r-- | dungeon/src/entity.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/dungeon/src/entity.rs b/dungeon/src/entity.rs index a0750dd..9af27bd 100644 --- a/dungeon/src/entity.rs +++ b/dungeon/src/entity.rs @@ -337,6 +337,7 @@ pub struct Player { pub weapon: Weapon, // How long until we reset potion effects? pub potion_timer: Option<Instant>, + pub active_inv_slot: usize, } impl Player { /// Instantiates the game player at a given `Pos` @@ -354,11 +355,13 @@ impl Player { let inventory = vec![]; let weapon = Weapon::RustyKnife; let potion_timer = None; + let active_inv_slot = 0; Self { entity, inventory, weapon, potion_timer, + active_inv_slot, } } } @@ -517,7 +520,7 @@ impl Dungeon { }; updater.update_entity(&mut self.player.entity); - for enemy in &mut self.enemies { + for enemy in &mut self.entities { updater.update_entity(enemy); } } |