diff options
author | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-11-06 16:23:26 -0600 |
---|---|---|
committer | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-11-06 16:23:26 -0600 |
commit | 4cc5a6812537ba01f1c9ae96f5ad25e0a9f63134 (patch) | |
tree | 2bad7e57c5c4a21ce2f3c31b79739cb953fbba27 | |
parent | f9b61b5115bb93a1381cfc3032820489875624c5 (diff) | |
download | crawl-ref-4cc5a6812537ba01f1c9ae96f5ad25e0a9f63134.tar.gz crawl-ref-4cc5a6812537ba01f1c9ae96f5ad25e0a9f63134.zip |
Use coord_defs in a few more places.
-rw-r--r-- | crawl-ref/source/acr.cc | 19 | ||||
-rw-r--r-- | crawl-ref/source/mon-act.cc | 2 |
2 files changed, 7 insertions, 14 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 5ed7364a32..5c58d312f7 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -3175,19 +3175,15 @@ static void _open_door(coord_def move, bool check_confused) if (check_confused && you.confused() && !one_chance_in(3)) { do - { - move.x = random2(3) - 1; - move.y = random2(3) - 1; - } + move = coord_def(random2(3) - 1, random2(3) - 1); while (move.origin()); } if (_untrap_target(move, check_confused)) return; } - // If we get here, the player either hasn't picked a direction yet + // If we get here, the player either hasn't picked a direction yet, // or the chosen direction actually contains a closed door. - if (!player_can_open_doors()) { mpr("You can't open doors in your present form."); @@ -3226,10 +3222,7 @@ static void _open_door(coord_def move, bool check_confused) if (check_confused && you.confused() && !one_chance_in(3)) { do - { - door_move.delta.x = random2(3) - 1; - door_move.delta.y = random2(3) - 1; - } + door_move.delta = coord_def(random2(3) - 1, random2(3) - 1); while (door_move.delta.origin()); } @@ -3272,7 +3265,7 @@ static void _open_door(coord_def move, bool check_confused) if (is_exclude_root(doorpos) && !(check_confused && you.confused())) { std::string prompt = - make_stringf("This %s%s is marked as excluded! Open it " + make_stringf("This %s%s is marked as excluded! Open it " "anyway?", adj, noun); if (!yesno(prompt.c_str(), true, 'n', true, false)) @@ -3303,7 +3296,7 @@ static void _open_door(coord_def move, bool check_confused) else { const char* verb = (you.airborne() ? "reach down and open" - : "open"); + : "open"); mprf("You %s the %s%s.", verb, adj, noun); } @@ -3466,7 +3459,7 @@ static void _close_door(coord_def move) else { const char* verb = you.airborne() ? "reach down and close" - : "close"; + : "close"; mprf("You %s the %s%s.", verb, adj, noun); } diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc index 088774e2a1..527944a726 100644 --- a/crawl-ref/source/mon-act.cc +++ b/crawl-ref/source/mon-act.cc @@ -2680,7 +2680,7 @@ static void _mons_open_door(monsters* monster, const coord_def &pos) monster->lose_energy(EUT_MOVE); } -static bool _habitat_okay( const monsters *monster, dungeon_feature_type targ ) +static bool _habitat_okay(const monsters *monster, dungeon_feature_type targ) { return (monster_habitable_grid(monster, targ)); } |