Skip to content

Commit

Permalink
feat: prevent attacking allies/neutrals
Browse files Browse the repository at this point in the history
  • Loading branch information
kiedtl committed Feb 9, 2023
1 parent 730ef52 commit 423b45f
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/ui.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2226,7 +2226,6 @@ pub fn drawExamineScreen(starting_focus: ?ExamineTileFocus) bool {
var desc_scroll: usize = 0;

var kbd_s = false;
var kbd_a = false;

const moblist = state.createMobList(false, true, state.player.coord.z, state.GPA.allocator());
defer moblist.deinit();
Expand Down Expand Up @@ -2289,11 +2288,6 @@ pub fn drawExamineScreen(starting_focus: ?ExamineTileFocus) bool {
.Spells => _writerWrite(writer, "Press $bs$. to see mob.\n", .{}),
}
}

if (mob != state.player and state.player.canMelee(mob)) {
kbd_a = true;
_writerWrite(writer, "Press $bA$. to attack.\n", .{});
}
} else if (tile_focus == .Surface and has_surf) {
// nothing
}
Expand Down Expand Up @@ -2417,10 +2411,6 @@ pub fn drawExamineScreen(starting_focus: ?ExamineTileFocus) bool {
'e', 'u' => coord = coord.move(.NorthEast, state.mapgeometry) orelse coord,
'z', 'b' => coord = coord.move(.SouthWest, state.mapgeometry) orelse coord,
'c', 'n' => coord = coord.move(.SouthEast, state.mapgeometry) orelse coord,
'A' => if (kbd_a) {
state.player.fight(state.dungeon.at(coord).mob.?, .{});
return true;
},
's' => if (kbd_s) {
mob_tile_focus = switch (mob_tile_focus) {
.Main => .Stats,
Expand Down

0 comments on commit 423b45f

Please sign in to comment.