Skip to content

Commit

Permalink
feat: buf NC pacifist pathing to die less often
Browse files Browse the repository at this point in the history
Now it's the guards which constantly die...
  • Loading branch information
kiedtl committed Feb 9, 2023
1 parent 80e9ec4 commit 1d34c4a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
21 changes: 10 additions & 11 deletions src/ai.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1238,17 +1238,6 @@ pub fn nightCreatureWork(mob: *Mob, alloc: mem.Allocator) void {
}
};

// Now check if there are enemies adjacent to us, and face them to
// be disposed of next turn.
for (&DIRECTIONS) |d| if (mob.coord.move(d, state.mapgeometry)) |neighbor| {
if (state.dungeon.at(neighbor).mob) |othermob| {
if (othermob.isHostileTo(mob) and !othermob.ai.flag(.IgnoredByEnemies)) {
mob.facing = d;
tryRest(mob); // Rest to avoid moving and resetting face direction.
}
}
};

var to = mob.ai.work_area.items[0];

if ((mob.ai.work_phase == .NC_PatrolTo and mob.cansee(to)) or
Expand All @@ -1259,6 +1248,16 @@ pub fn nightCreatureWork(mob: *Mob, alloc: mem.Allocator) void {
} else {
mob.tryMoveTo(to);
}

// Now check if there are enemies adjacent to us, and face them to
// be disposed of next turn.
for (&DIRECTIONS) |d| if (mob.coord.move(d, state.mapgeometry)) |neighbor| {
if (state.dungeon.at(neighbor).mob) |othermob| {
if (othermob.isHostileTo(mob) and !othermob.ai.flag(.IgnoredByEnemies)) {
mob.facing = d;
}
}
};
},
else => unreachable,
}
Expand Down
2 changes: 1 addition & 1 deletion src/spells.zig
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ pub const BOLT_AOE_AMNESIA = Spell{
.bolt_multitarget = false,
.bolt_avoids_allies = true,
// .checks_will = true,
.bolt_aoe = 3, // XXX: Need to update particle effect if changing this
.bolt_aoe = 4, // XXX: Need to update particle effect if changing this
.animation = .{ .Particle = .{ .name = "zap-mass-amnesia" } },
.noise = .Silent,
.effect_type = .{ .Status = .Amnesia },
Expand Down

0 comments on commit 1d34c4a

Please sign in to comment.