From 7e7f8035490e36b72f7ddecd23b4da8611e991d0 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sun, 26 Apr 2009 12:13:36 +0000 Subject: * Fix _place_monster_aux() not interrupting autoexplore. Apparently, monsters can be directly placed at the edge of los, after all. * Change Ctrl-X -> Ctrl-S, V -> Ctrl-X, not documented yet. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9696 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/cmd-keys.h | 4 ++-- crawl-ref/source/command.cc | 9 +++++---- crawl-ref/source/dat/database/godspeak.txt | 2 +- crawl-ref/source/dat/descript/items.txt | 4 ---- crawl-ref/source/debug.cc | 22 ++++++++++++++-------- crawl-ref/source/delay.cc | 2 ++ crawl-ref/source/mon-util.cc | 2 +- crawl-ref/source/monplace.cc | 11 ++++++----- crawl-ref/source/view.cc | 23 ++++++++++++++--------- crawl-ref/source/view.h | 1 + 10 files changed, 46 insertions(+), 34 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/cmd-keys.h b/crawl-ref/source/cmd-keys.h index fbd51e72d9..0ec95978d7 100644 --- a/crawl-ref/source/cmd-keys.h +++ b/crawl-ref/source/cmd-keys.h @@ -70,8 +70,8 @@ {'Q', CMD_QUIVER_ITEM}, {'R', CMD_REMOVE_JEWELLERY}, {'S', CMD_SAVE_GAME}, +{CONTROL('S'), CMD_SAVE_GAME_NOW}, {'T', CMD_REMOVE_ARMOUR}, -{'V', CMD_FULL_VIEW}, {'W', CMD_WEAR_ARMOUR}, {'X', CMD_DISPLAY_MAP}, {'Z', CMD_ZAP_WAND}, @@ -137,7 +137,7 @@ {CONTROL('R'), CMD_REDRAW_SCREEN}, {CONTROL('T'), CMD_TOGGLE_FRIENDLY_PICKUP}, {CONTROL('W'), CMD_FIX_WAYPOINT}, -{CONTROL('X'), CMD_SAVE_GAME_NOW}, +{CONTROL('X'), CMD_FULL_VIEW}, {CONTROL('Z'), CMD_SUSPEND_GAME}, {ESCAPE, CMD_TARGET_CANCEL}, {'x', CMD_TARGET_CANCEL}, diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index 54628dc57a..746d6560c7 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -2171,7 +2171,7 @@ static void _add_formatted_keyhelp(column_composer &cols) 1, "Game Saving and Quitting:\n" "S : Save game and exit\n" - "Ctrl-X : save and eXit without query\n" + "Ctrl-S : save and eXit without query\n" "Ctrl-Q : Quit without saving\n", true, true, _cmdhelp_textfilter); @@ -2199,7 +2199,7 @@ static void _add_formatted_keyhelp(column_composer &cols) "; : examine occupied tile\n" "x : eXamine surroundings/targets\n" "X : eXamine level map (X? for help)\n" - "V : list monsters and items in sight\n" + "Ctrl-X : list monsters, items, features in sight\n" "Ctrl-O : show dungeon Overview\n" "Ctrl-A : toggle auto-pickup\n" "Ctrl-T : change ally pickup behaviour\n", @@ -2319,9 +2319,10 @@ static void _add_formatted_tutorial_help(column_composer &cols) "i : list inventory (select item to view it)\n" "g : pick up item from ground (also ,)\n" "d : drop item\n" - "X : show map of the whole level\n" "<< or > : ascend/descend the stairs\n" "Ctrl-P : show previous messages\n" + "X : show map of the whole level\n" + "Ctrl-X : list monsters, items, features in sight\n" "\n" "Targeting (for spells and missiles)\n" "Use + (or =) and - to cycle between\n" @@ -2432,7 +2433,7 @@ int list_wizard_commands(bool do_redraw_screen) "F : combat stats with fsim_kit\n" "Ctrl-F : combat stats (monster vs PC)\n" "Ctrl-I : item generation stats\n" - "\n" + "O : measure exploration time\n" "\n" "? : list wizard commands\n", true, true); diff --git a/crawl-ref/source/dat/database/godspeak.txt b/crawl-ref/source/dat/database/godspeak.txt index 8719d0700e..f874939513 100644 --- a/crawl-ref/source/dat/database/godspeak.txt +++ b/crawl-ref/source/dat/database/godspeak.txt @@ -320,7 +320,7 @@ You feel watched. Everything around seems to assume a strange transparency. -All the walls suddenly lose part of their structure. +The walls suddenly lose part of their structure. Xom alters the dungeon around you. %%%% diff --git a/crawl-ref/source/dat/descript/items.txt b/crawl-ref/source/dat/descript/items.txt index 83db31b818..5762378451 100644 --- a/crawl-ref/source/dat/descript/items.txt +++ b/crawl-ref/source/dat/descript/items.txt @@ -437,10 +437,6 @@ cloak A cloth cloak. %%%% -club noquote - -A heavy piece of wood, to be held or thrown. -%%%% club A heavy piece of wood, to be held or thrown. diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index ae8f27fe45..6f3b25eb2d 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -2139,8 +2139,15 @@ void wizard_heal(bool super_heal) void wizard_set_hunger_state() { - mpr("Set hunger state to s(T)arving, (N)ear starving, " - "(H)ungry, (S)atiated, (F)ull or (E)ngorged?", MSGCH_PROMPT); + std::string hunger_prompt = + "Set hunger state to s(T)arving, (N)ear starving, (H)ungry"; + if (you.species == SP_GHOUL) + hunger_prompt += " or (S)atiated?"; + else + hunger_prompt += ", (S)atiated, (F)ull or (E)ngorged?"; + + mprf(MSGCH_PROMPT, "%s", hunger_prompt.c_str()); + const int c = tolower(getch()); // Values taken from food.cc. @@ -2169,7 +2176,7 @@ void wizard_spawn_control() if (c == 'c') { - mprf(MSGCH_PROMPT, "Set monster spawn rate to what? (now %d) ", + mprf(MSGCH_PROMPT, "Set monster spawn rate to what? (now %d, lower value = higher rate) ", env.spawn_random_rate); if (!cancelable_get_line(specs, sizeof(specs))) @@ -5104,10 +5111,9 @@ void wizard_dismiss_all_monsters(bool force_all) static void _debug_kill_traps() { - for (int y = 0; y < GYM; ++y) - for (int x = 0; x < GXM; ++x) - if (grid_is_trap(grd[x][y], true)) - grd[x][y] = DNGN_FLOOR; + for (rectangle_iterator ri(1); ri; ++ri) + if (grid_is_trap(grd(*ri), true)) + grd(*ri) = DNGN_FLOOR; } static int _debug_time_explore() @@ -5161,7 +5167,7 @@ static void _debug_destroy_doors() void debug_test_explore() { wizard_dismiss_all_monsters(true); - _debug_kill_traps(); + _debug_kill_traps(); // doesn't work? (jpeg) _debug_destroy_doors(); forget_map(100); diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 5ab64b9cf7..bd531617c4 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -1880,8 +1880,10 @@ inline static bool _monster_warning(activity_interrupt_type ai, else if (at.context.find("leaps out") != std::string::npos) { if (mon->type == MONS_TRAPDOOR_SPIDER) + { text += " leaps out from its hiding place under the " "floor!"; + } else text += " leaps out from hiding!"; } diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index b608e83836..28ba3558e9 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -6851,7 +6851,7 @@ void monsters::remove_enchantment_effect(const mon_enchant &me, bool quiet) seen_context = "thin air"; else if (type == MONS_TRAPDOOR_SPIDER) seen_context = "leaps out"; - else if (monster_habitable_grid(this, DNGN_FLOOR)) + else if (!monster_habitable_grid(this, DNGN_FLOOR)) seen_context = "bursts forth"; else seen_context = "surfaces"; diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index e2b948b92d..7673208de5 100644 --- a/crawl-ref/source/monplace.cc +++ b/crawl-ref/source/monplace.cc @@ -724,6 +724,8 @@ int place_monster(mgen_data mg, bool force_pos) #ifdef DEBUG_MON_CREATION mpr("in place_monster()", MSGCH_DIAGNOSTICS); #endif +// mg.proximity = PROX_NEAR_STAIRS; + int tries = 0; dungeon_char_type stair_type = NUM_DCHAR_TYPES; int id = -1; @@ -782,7 +784,7 @@ int place_monster(mgen_data mg, bool force_pos) { tries = 0; - // Try to pick px, py that is + // Try to pick position that is // a) not occupied // b) compatible // c) in the 'correct' proximity to the player @@ -818,6 +820,8 @@ int place_monster(mgen_data mg, bool force_pos) case PROX_CLOSE_TO_PLAYER: case PROX_AWAY_FROM_PLAYER: + // If this is supposed to measure los vs not los, + // then see_grid(mg.pos) should be used instead. (jpeg) close_to_player = (distance(you.pos(), mg.pos) < 64); if (mg.proximity == PROX_CLOSE_TO_PLAYER && !close_to_player @@ -1199,7 +1203,7 @@ static int _place_monster_aux(const mgen_data &mg, mark_interesting_monst(&menv[id], mg.behaviour); if (you.can_see(&menv[id])) - seen_monster(&menv[id]); + handle_seen_interrupt(&menv[id]); if (crawl_state.arena) arena_placed_monster(&menv[id]); @@ -2140,9 +2144,6 @@ static monster_type _pick_zot_exit_defender() } int mons_place(mgen_data mg) - // int mon_type, beh_type behaviour, int target, bool summoned, - // int px, int py, int level_type, proximity_type proximity, - // int extra, int dur, bool permit_bands ) { #ifdef DEBUG_MON_CREATION mpr("in mons_place()", MSGCH_DIAGNOSTICS); diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index f06fcd797b..9112584216 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -965,7 +965,7 @@ void beogh_follower_convert(monsters *monster, bool orc_hit) } } -static void _handle_seen_interrupt(monsters* monster) +void handle_seen_interrupt(monsters* monster) { if (mons_is_unknown_mimic(monster)) return; @@ -981,7 +981,7 @@ static void _handle_seen_interrupt(monsters* monster) if (!mons_is_safe(monster) && !mons_class_flag(monster->type, M_NO_EXP_GAIN)) { - interrupt_activity( AI_SEE_MONSTER, aid ); + interrupt_activity(AI_SEE_MONSTER, aid); } seen_monster( monster ); } @@ -1002,13 +1002,13 @@ void flush_comes_into_view() return; } - _handle_seen_interrupt(mon); + handle_seen_interrupt(mon); } void handle_monster_shouts(monsters* monster, bool force) { - if (!force && x_chance_in_y(you.skills[SK_STEALTH], 30)) - return; +// if (!force && x_chance_in_y(you.skills[SK_STEALTH], 30)) +// return; // Friendly or neutral monsters don't shout. if (!force && (mons_friendly(monster) || mons_neutral(monster))) @@ -1182,8 +1182,7 @@ void handle_monster_shouts(monsters* monster, bool force) else if (param == "SOUND") channel = MSGCH_SOUND; - // Monster must come up from being submerged if it wants to - // shout. + // Monster must come up from being submerged if it wants to shout. if (mons_is_submerged(monster)) { if (!monster->del_ench(ENCH_SUBMERGED)) @@ -1196,7 +1195,7 @@ void handle_monster_shouts(monsters* monster, bool force) { monster->seen_context = "bursts forth shouting"; // Give interrupt message before shout message. - _handle_seen_interrupt(monster); + handle_seen_interrupt(monster); } } @@ -1207,7 +1206,13 @@ void handle_monster_shouts(monsters* monster, bool force) // Otherwise it can move away with no feedback. if (you.can_see(monster)) + { +/* + if (!(monster->flags & MF_WAS_IN_VIEW)) + handle_seen_interrupt(monster); +*/ seen_monster(monster); + } } } @@ -1323,7 +1328,7 @@ void update_monsters_in_view() else if (player_monster_visible(monster)) { if (!(monster->flags & MF_WAS_IN_VIEW) && you.turn_is_over) - _handle_seen_interrupt(monster); + handle_seen_interrupt(monster); seen_monster(monster); } diff --git a/crawl-ref/source/view.h b/crawl-ref/source/view.h index 4cba2a9dbb..3210182862 100644 --- a/crawl-ref/source/view.h +++ b/crawl-ref/source/view.h @@ -219,6 +219,7 @@ void flash_monster_colour(const monsters *mon, unsigned char fmc_colour, void calc_show_los(); void viewwindow(bool draw_it, bool do_updates); void update_monsters_in_view(); +void handle_seen_interrupt(monsters* monster); void flush_comes_into_view(); struct ray_def; -- cgit v1.2.3-54-g00ecf