summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-05 22:17:29 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-05 22:17:29 +0000
commitde3ab3ce26d65fe03341feda94103982a01d8922 (patch)
tree55377a49eeddf30eee1354ca786f533ca4ae1eaa
parent46bf2998e5a6df900667ccb4f9ab4856c146d7d8 (diff)
downloadcrawl-ref-de3ab3ce26d65fe03341feda94103982a01d8922.tar.gz
crawl-ref-de3ab3ce26d65fe03341feda94103982a01d8922.zip
Fix 1985516: monsters fail to open doors
Fix 1985526: acquirement by scroll marked as {god gift} git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5492 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/effects.cc14
-rw-r--r--crawl-ref/source/monstuff.cc7
2 files changed, 11 insertions, 10 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index b6fbdf6106..f5ca575a5b 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1058,9 +1058,9 @@ static int find_acquirement_subtype(object_class_type class_wanted,
break;
}
- // mutation specific problems (horns allow caps)
- if ((type_wanted == ARM_BOOTS && !player_has_feet())
- || (you.has_claws(false) >= 3 && type_wanted == ARM_GLOVES))
+ // Mutation specific problems (horns allow caps).
+ if (type_wanted == ARM_BOOTS && !player_has_feet()
+ || type_wanted == ARM_GLOVES && you.has_claws(false) >= 3)
{
type_wanted = OBJ_RANDOM;
}
@@ -1153,7 +1153,7 @@ static int find_acquirement_subtype(object_class_type class_wanted,
mprf(MSGCH_DIAGNOSTICS,
"acquirement: iteration = %d, best_spell = %d",
iteration, best_spell );
-#endif //jmf: debugging
+#endif
switch (best_spell)
{
@@ -1725,17 +1725,17 @@ bool acquirement(object_class_type class_wanted, int agent,
}
int plusmod = random2(4);
- // more damage, less accuracy
if (agent == GOD_TROG)
{
+ // More damage, less accuracy.
thing.plus -= plusmod;
thing.plus2 += plusmod;
if (!is_random_artefact(thing))
thing.plus = std::max(static_cast<int>(thing.plus), 0);
}
- // more accuracy, less damage
else if (agent == GOD_OKAWARU)
{
+ // More accuracy, less damage.
thing.plus += plusmod;
thing.plus2 -= plusmod;
if (!is_random_artefact(thing))
@@ -1743,7 +1743,7 @@ bool acquirement(object_class_type class_wanted, int agent,
}
}
- if (agent == you.religion)
+ if (agent > AQ_SCROLL && agent == you.religion)
{
thing.inscription = "god gift";
if (is_random_artefact(thing))
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 3066ff5d03..f66abff62f 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -4826,6 +4826,7 @@ static bool _handle_throw(monsters *monster, bolt & beem)
return (false);
}
+ // Zombies are always to stupid to do this.
if (mons_itemuse(monster->type) < MONUSE_OPEN_DOORS)
return (false);
@@ -6045,13 +6046,13 @@ static void _mons_open_door(monsters* monster, const coord_def &pos)
if (grid == DNGN_SECRET_DOOR)
{
grid = grid_secret_door_appearance(pos.x, pos.y);
- grd(pos) = DNGN_OPEN_DOOR; // just a simple door, no gates etc.
+ grd(pos) = DNGN_OPEN_DOOR; // Just a simple door, no gates etc.
was_secret = true;
if (!see_grid(pos))
set_terrain_changed(pos);
}
- else // maybe several connected doors -> gate
+ else // Maybe several connected doors -> gate.
{
std::set<coord_def> all_door;
find_connected_identical(pos, grd(pos), all_door);
@@ -6441,7 +6442,7 @@ static bool _monster_move(monsters *monster)
return true;
}
}
- else if (mons_itemuse(monster->base_monster) >= MONUSE_OPEN_DOORS)
+ else if (mons_itemuse(monster->type) >= MONUSE_OPEN_DOORS)
{
_mons_open_door(monster, newpos);
return true;