diff --git a/src/gui.rs b/src/gui.rs index fea8a28..5356f7f 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -176,7 +176,10 @@ pub fn print_options(inventory: BTreeMap<(String, String), i32>, mut y: i32, ctx x += 2; ctx.print(x, y, name.1.to_string()); } else { - if ['a', 'e', 'i', 'o', 'u'].iter().any(|&v| name.0.starts_with(v)) { + if name.0.ends_with("s") { + ctx.print(x, y, "some"); + x += 5; + } else if ['a', 'e', 'i', 'o', 'u'].iter().any(|&v| name.0.starts_with(v)) { // If one and starts with a vowel, print 'an' // i.e. (a) an apple ctx.print(x, y, "an"); diff --git a/src/main.rs b/src/main.rs index 0a0db61..c0dea07 100644 --- a/src/main.rs +++ b/src/main.rs @@ -134,8 +134,8 @@ impl State { let mut particle_system = particle_system::ParticleSpawnSystem {}; vis.run_now(&self.ecs); - mob.run_now(&self.ecs); mapindex.run_now(&self.ecs); + mob.run_now(&self.ecs); trigger_system.run_now(&self.ecs); inventory_system.run_now(&self.ecs); item_use_system.run_now(&self.ecs); diff --git a/src/player.rs b/src/player.rs index 4a15979..dadd676 100644 --- a/src/player.rs +++ b/src/player.rs @@ -31,6 +31,9 @@ pub fn try_door(i: i32, j: i32, ecs: &mut World) -> RunState { { let destination_idx = map.xy_idx(pos.x + delta_x, pos.y + delta_y); + if map.tile_content[destination_idx].len() == 0 { + gamelog::Logger::new().append("You see no door there.").log(); + } for potential_target in map.tile_content[destination_idx].iter() { let door = doors.get_mut(*potential_target); if let Some(door) = door { @@ -62,7 +65,6 @@ pub fn try_door(i: i32, j: i32, ecs: &mut World) -> RunState { } } } - gamelog::Logger::new().append("You see no door there.").log(); return RunState::AwaitingInput; } @@ -90,6 +92,9 @@ pub fn open(i: i32, j: i32, ecs: &mut World) -> RunState { { let destination_idx = map.xy_idx(pos.x + delta_x, pos.y + delta_y); + if map.tile_content[destination_idx].len() == 0 { + gamelog::Logger::new().append("You see no door there.").log(); + } for potential_target in map.tile_content[destination_idx].iter() { let door = doors.get_mut(*potential_target); if let Some(door) = door { @@ -111,7 +116,6 @@ pub fn open(i: i32, j: i32, ecs: &mut World) -> RunState { } } } - gamelog::Logger::new().append("You see no door there.").log(); return RunState::AwaitingInput; }