diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-08-09 16:59:57 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-08-09 16:59:57 +0000 |
commit | 65bf8d320e329008693d860cbf24c911be9a65a4 (patch) | |
tree | 47d5af79ee8f7bff26d7a93e7f8cdd666ababddb | |
parent | e6a12403170aa719f2ae597c3b251a7f25ddbb94 (diff) | |
download | crawl-ref-65bf8d320e329008693d860cbf24c911be9a65a4.tar.gz crawl-ref-65bf8d320e329008693d860cbf24c911be9a65a4.zip |
Item class name is now "jewellery", not "jewelry" for consistency (David).
Added &O command to show the number of turns used by explore to fully-explore
the (reachable areas of) the current level.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1983 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/acr.cc | 17 | ||||
-rw-r--r-- | crawl-ref/source/dat/bazaar.des | 2 | ||||
-rw-r--r-- | crawl-ref/source/dat/large.des | 2 | ||||
-rw-r--r-- | crawl-ref/source/dat/mini.des | 2 | ||||
-rw-r--r-- | crawl-ref/source/debug.cc | 75 | ||||
-rw-r--r-- | crawl-ref/source/debug.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/lua/stash.lua | 2 |
7 files changed, 88 insertions, 14 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 93bfc5ef4e..a7fcbc31d8 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -411,6 +411,10 @@ static void handle_wizard_command( void ) debug_set_xl(); break; + case 'O': + debug_test_explore(); + break; + case 's': you.exp_available = 20000; you.redraw_experience = 1; @@ -530,16 +534,7 @@ static void handle_wizard_command( void ) break; case 'G': - // Genocide... "unsummon" all the monsters from the level. - for (int mon = 0; mon < MAX_MONSTERS; mon++) - { - struct monsters *monster = &menv[mon]; - - if (monster->type == -1) - continue; - - monster_die(monster, KILL_RESET, 0); - } + debug_dismiss_all_monsters(); break; case 'c': @@ -3038,8 +3033,10 @@ static void move_player(int move_x, int move_y) else if (targ_solid) { stop_running(); + move_x = 0; move_y = 0; + you.turn_is_over = 0; } diff --git a/crawl-ref/source/dat/bazaar.des b/crawl-ref/source/dat/bazaar.des index 65bd852aa1..fc76a22748 100644 --- a/crawl-ref/source/dat/bazaar.des +++ b/crawl-ref/source/dat/bazaar.des @@ -150,7 +150,7 @@ ORIENT: encompass SHUFFLE: AB, def, xw/vl KFEAT: A = scroll shop / book shop / book shop KFEAT: B = jewellery shop -ITEM: any jewelry / good_item any jewelry +ITEM: any jewellery / good_item any jewellery ITEM: any book / good_item any book, any staff SUBST: w:w.l, x:b, c:., v=bl, d=.d, e=.e, f=.f : bazaar_message(_G) diff --git a/crawl-ref/source/dat/large.des b/crawl-ref/source/dat/large.des index e34102e181..b89c7d9307 100644 --- a/crawl-ref/source/dat/large.des +++ b/crawl-ref/source/dat/large.des @@ -1048,7 +1048,7 @@ KITEM: f = good_item helm / good_item cap #KITEM: e = any good gloves of dexterity / any good gloves of strength #KITEM: f = any good helm of intelligence / any good helm of see invisible KITEM: D = any good_item armour / any armour -KITEM: I = any good_item jewelry / any jewelry +KITEM: I = any good_item jewellery / any jewellery KFEAT: I = floor KITEM: g = good_item amulet KITEM: h = good_item ring diff --git a/crawl-ref/source/dat/mini.des b/crawl-ref/source/dat/mini.des index 97472702c6..58e90300f8 100644 --- a/crawl-ref/source/dat/mini.des +++ b/crawl-ref/source/dat/mini.des @@ -1220,7 +1220,7 @@ SHUFFLE: ABCDEF SUBST: A : !, B : !, C : !, D : !, E : !, F : =, G : ~ l:50 w:50 I SUBST: ! : xvcba SUBST: H = 0 . ~ , J = 1 0:100 $:20 -ITEM: any jewelry +ITEM: any jewellery MONS: giant eyeball MAP ........... diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index 3f929b4d1a..abc6ec8c0f 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -39,6 +39,7 @@ #include "branch.h" #include "cio.h" #include "decks.h" +#include "delay.h" #include "describe.h" #include "direct.h" #include "dungeon.h" @@ -2242,6 +2243,80 @@ void debug_place_map() debug_load_map_by_name(what); } +void debug_dismiss_all_monsters() +{ + // Genocide... "unsummon" all the monsters from the level. + for (int mon = 0; mon < MAX_MONSTERS; mon++) + { + monsters *monster = &menv[mon]; + + if (monster->alive()) + monster_die(monster, KILL_DISMISSED, 0); + } +} + +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]) || grd[x][y] == DNGN_UNDISCOVERED_TRAP) + grd[x][y] = DNGN_FLOOR; +} + +static int debug_time_explore() +{ + viewwindow(true, false); + start_explore(false); + + unwind_var<int> es(Options.explore_stop, 0); + + const long start = you.num_turns; + while (you_are_delayed()) + { + you.turn_is_over = false; + handle_delay(); + you.num_turns++; + } + + return (you.num_turns - start); +} + +static void debug_destroy_doors() +{ + for (int y = 0; y < GYM; ++y) + { + for (int x = 0; x < GXM; ++x) + { + const dungeon_feature_type feat = grd[x][y]; + if (feat == DNGN_CLOSED_DOOR || feat == DNGN_SECRET_DOOR) + grd[x][y] = DNGN_FLOOR; + } + } +} + +// Turns off greedy explore, then: +// a) Destroys all traps on the level. +// b) Kills all monsters on the level. +// c) Suppresses monster generation. +// d) Converts all closed doors and secret doors to floor. +// e) Forgets map. +// f) Counts number of turns needed to explore the level. +void debug_test_explore() +{ + debug_dismiss_all_monsters(); + debug_kill_traps(); + forget_map(100); + + debug_destroy_doors(); + + // Remember where we are now. + const coord_def where = you.pos(); + + const int explore_turns = debug_time_explore(); + + mprf("Explore took %d turns.", explore_turns); +} + #endif #ifdef DEBUG_DIAGNOSTICS diff --git a/crawl-ref/source/debug.h b/crawl-ref/source/debug.h index 964965ea30..fc12ac434d 100644 --- a/crawl-ref/source/debug.h +++ b/crawl-ref/source/debug.h @@ -154,6 +154,8 @@ void debug_list_monsters(); void debug_card(); void debug_set_xl(); void debug_place_map(); +void debug_test_explore(); +void debug_dismiss_all_monsters(); #ifdef DEBUG_DIAGNOSTICS void generate_map_stats(); diff --git a/crawl-ref/source/lua/stash.lua b/crawl-ref/source/lua/stash.lua index 6af1178b79..5b26e16d97 100644 --- a/crawl-ref/source/lua/stash.lua +++ b/crawl-ref/source/lua/stash.lua @@ -17,7 +17,7 @@ -- in your init.txt. -- -- The full list of item class names is: --- gold, weapon, missile, armour, wand, food, scroll, jewelry, potion, +-- gold, weapon, missile, armour, wand, food, scroll, jewellery, potion, -- book, staff, orb, misc, carrion -- -- Item annotations are always prefixed to the item name. For instance: |