From 51e06c054764971800694444b6cb35369a5ce336 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sun, 15 Jun 2008 20:15:48 +0000 Subject: Fix the Vestibule having no upstairs. o_O Fix fleeing monsters shooting at you. (BR 1994462) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5861 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/acr.cc | 6 +++++- crawl-ref/source/branch.cc | 2 +- crawl-ref/source/debug.cc | 4 ---- crawl-ref/source/directn.cc | 4 ++-- crawl-ref/source/dungeon.cc | 6 ++++-- crawl-ref/source/misc.cc | 14 +++++++------- crawl-ref/source/monstuff.cc | 7 +++++++ crawl-ref/source/notes.cc | 6 +++++- 8 files changed, 31 insertions(+), 18 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 4b112ae7e6..169e7cd0b4 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -722,6 +722,7 @@ static void _handle_wizard_command( void ) case 'h': you.rotting = 0; + you.duration[DUR_CONF] = 0; you.duration[DUR_POISONING] = 0; you.disease = 0; set_hp( abs(you.hp_max), false ); @@ -730,13 +731,14 @@ static void _handle_wizard_command( void ) case 'H': you.rotting = 0; + you.duration[DUR_CONF] = 0; you.duration[DUR_POISONING] = 0; if (you.duration[DUR_BEHELD]) { you.duration[DUR_BEHELD] = 0; you.beheld_by.clear(); } - you.duration[DUR_CONF] = 0; + you.duration[DUR_LIQUID_FLAMES] = 0; you.disease = 0; inc_hp( 10, true ); set_hp( you.hp_max, false ); @@ -3214,6 +3216,8 @@ static void _world_reacts() if (you.cannot_act() && any_messages()) more(); + + spawn_random_monsters(); } #ifdef DGL_SIMPLE_MESSAGING diff --git a/crawl-ref/source/branch.cc b/crawl-ref/source/branch.cc index 9fd09b3e7e..2df448e731 100644 --- a/crawl-ref/source/branch.cc +++ b/crawl-ref/source/branch.cc @@ -245,7 +245,7 @@ Branch branches[] = { 0, 'G', false, true }, { BRANCH_VESTIBULE_OF_HELL, BRANCH_MAIN_DUNGEON, 1, -1, 0, 0, - DNGN_ENTER_HELL, NUM_FEATURES, // sentinel + DNGN_ENTER_HELL, DNGN_EXIT_HELL, // sentinel "Hell", "The Vestibule of Hell", "Hell", NULL, false, true, LIGHTGREY, LIGHTGREY, diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index 56d765d51e..b6c676abb6 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -656,22 +656,18 @@ static dungeon_feature_type _find_appropriate_stairs(bool down) } else return DNGN_ESCAPE_HATCH_UP; - break; case LEVEL_ABYSS: return DNGN_EXIT_ABYSS; - break; case LEVEL_PANDEMONIUM: if (down) return DNGN_TRANSIT_PANDEMONIUM; else return DNGN_EXIT_PANDEMONIUM; - break; case LEVEL_PORTAL_VAULT: return DNGN_EXIT_PORTAL_VAULT; - break; default: mpr("Unknown level type."); diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index 9bcc52bb8c..be41c25177 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -146,8 +146,6 @@ void direction_choose_compass( dist& moves, targeting_behaviour *beh) } } while ( !moves.isCancel && moves.dx == 0 && moves.dy == 0 ); - - return; } static int _targeting_cmd_to_compass( command_type command ) @@ -1800,6 +1798,8 @@ std::string raw_feature_description(dungeon_feature_type grid, return ("stone staircase leading up"); case DNGN_ENTER_HELL: return ("gateway to Hell"); + case DNGN_EXIT_HELL: + return ("gateway back into the Dungeon"); case DNGN_TRAP_MECHANICAL: return ("mechanical trap"); case DNGN_TRAP_MAGICAL: diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index bd80e1f1b1..fc7a5cfcc4 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -889,6 +889,7 @@ static void _fixup_branch_stairs() const dungeon_feature_type exit = your_branch().exit_stairs; for (int x = 1; x < GXM; x++) for (int y = 1; y < GYM; y++) + { if (grd[x][y] >= DNGN_STONE_STAIRS_UP_I && grd[x][y] <= DNGN_ESCAPE_HATCH_UP) { @@ -900,6 +901,7 @@ static void _fixup_branch_stairs() } grd[x][y] = exit; } + } } // Branches that consist of only 1 level (Hall of Blades). @@ -3017,7 +3019,7 @@ static void _builder_items(int level_number, char level_type, int items_wanted) } else if (player_in_branch( BRANCH_ORCISH_MINES )) { - specif_type = OBJ_GOLD; /* lots of gold in the orcish mines */ + specif_type = OBJ_GOLD; // Lots of gold in the orcish mines. } if (player_in_branch( BRANCH_VESTIBULE_OF_HELL ) @@ -3026,7 +3028,7 @@ static void _builder_items(int level_number, char level_type, int items_wanted) || player_in_branch( BRANCH_HALL_OF_BLADES ) || player_in_branch( BRANCH_ECUMENICAL_TEMPLE )) { - /* No random items in hell, the slime pits, the temple, the hall */ + // No random items in hell, the slime pits, the temple, the hall. return; } else diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 59f4ef04d8..f0d5b17aee 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1530,7 +1530,7 @@ void up_stairs(dungeon_feature_type force_stair, } if (you.your_level == 0 - && !yesno("Are you sure you want to leave the Dungeon?", false, 'n')) + && !yesno("Are you sure you want to leave the Dungeon?", false, 'n')) { mpr("Alright, then stay!"); return; @@ -1594,9 +1594,9 @@ void up_stairs(dungeon_feature_type force_stair, } // Did we take a branch stair? - for ( i = 0; i < NUM_BRANCHES; ++i ) + for (i = 0; i < NUM_BRANCHES; ++i) { - if ( branches[i].exit_stairs == stair_find ) + if (branches[i].exit_stairs == stair_find) { you.where_are_you = branches[i].parent_branch; @@ -1685,7 +1685,7 @@ void up_stairs(dungeon_feature_type force_stair, // First we update the old level's stair. level_pos lp; - lp.id = new_level_id; + lp.id = new_level_id; lp.pos.x = you.x_pos; lp.pos.y = you.y_pos; @@ -1899,9 +1899,9 @@ void down_stairs( int old_level, dungeon_feature_type force_stair, // Welcome message. // Try to find a branch stair. bool entered_branch = false; - for ( i = 0; i < NUM_BRANCHES; ++i ) + for (i = 0; i < NUM_BRANCHES; ++i) { - if ( branches[i].entry_stairs == stair_find ) + if (branches[i].entry_stairs == stair_find) { entered_branch = true; you.where_are_you = branches[i].id; @@ -2317,7 +2317,7 @@ bool go_berserk(bool intentional) bool mons_is_safe(const struct monsters *mon, bool want_move) { - int dist = grid_distance(you.x_pos, you.y_pos, mon->x, mon->y); + int dist = grid_distance(you.x_pos, you.y_pos, mon->x, mon->y); bool is_safe = (mons_wont_attack(mon) || mons_class_flag(mon->type, M_NO_EXP_GAIN) diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 869d705014..18452a2431 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -5360,6 +5360,10 @@ static bool _handle_throw(monsters *monster, bolt & beem) return (false); } + // Greatly lowered chances if the monster is fleeing. + if (mons_is_fleeing(monster) && !one_chance_in(8)) + return (false); + item_def *launcher = NULL; const item_def *weapon = NULL; const int mon_item = mons_pick_best_missile(monster, &launcher); @@ -5408,6 +5412,9 @@ static bool _handle_throw(monsters *monster, bolt & beem) // Good idea? if (mons_should_fire( beem )) { + // Monsters shouldn't shoot if fleeing, so let them "turn to attack". + _make_mons_stop_fleeing(monster); + if (launcher && launcher != weapon) monster->swap_weapons(); diff --git a/crawl-ref/source/notes.cc b/crawl-ref/source/notes.cc index 22638449f2..0930e3f000 100644 --- a/crawl-ref/source/notes.cc +++ b/crawl-ref/source/notes.cc @@ -192,6 +192,7 @@ static bool _is_noteworthy( const Note& note ) if (rnote.packed_place == note.packed_place) return (false); break; + case NOTE_LEARN_SPELL: if (spell_difficulty(static_cast(rnote.first)) >= spell_difficulty(static_cast(note.first))) @@ -199,10 +200,12 @@ static bool _is_noteworthy( const Note& note ) return (false); } break; + case NOTE_GOD_POWER: if (rnote.first == note.first && rnote.second == note.second) return (false); break; + case NOTE_HP_CHANGE: // Not if we have a recent warning // unless we've lost half our HP since then. @@ -212,6 +215,7 @@ static bool _is_noteworthy( const Note& note ) return (false); } break; + default: mpr("Buggy note passed: unknown note type"); // Return now, rather than give a "Buggy note passed" message @@ -419,7 +423,7 @@ void Note::load(reader& inf) type = static_cast(unmarshallLong( inf )); turn = unmarshallLong( inf ); packed_place = unmarshallShort( inf ); - first = unmarshallLong( inf ); + first = unmarshallLong( inf ); second = unmarshallLong( inf ); unmarshallString4( inf, name ); unmarshallString4( inf, desc ); -- cgit v1.2.3-54-g00ecf