diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-15 18:20:37 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-15 18:20:37 +0000 |
commit | 62cfec6f0b7b50f1b0fbed90afaaa354681fe9ef (patch) | |
tree | 0f9cc74855df6edc8292977b9960fb2cf6adee64 /crawl-ref | |
parent | b9dc53d4acb66609024ff5303184135ba5866bc2 (diff) | |
download | crawl-ref-62cfec6f0b7b50f1b0fbed90afaaa354681fe9ef.tar.gz crawl-ref-62cfec6f0b7b50f1b0fbed90afaaa354681fe9ef.zip |
&^X allows you to set experience level directly in wizmode.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1877 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/acr.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/command.cc | 12 | ||||
-rw-r--r-- | crawl-ref/source/debug.cc | 41 | ||||
-rw-r--r-- | crawl-ref/source/debug.h | 1 | ||||
-rw-r--r-- | crawl-ref/source/message.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/ouch.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/player.h | 2 |
8 files changed, 58 insertions, 10 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index d85a080e7e..59a41ffd28 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -400,6 +400,10 @@ static void handle_wizard_command( void ) level_change(); break; + case CONTROL('X'): + debug_set_xl(); + break; + case 's': you.exp_available = 20000; you.redraw_experience = 1; diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index ea370ed5d3..3b4a476490 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -1084,22 +1084,23 @@ static void list_wizard_commands() "m/M : create monster by number/name\n" "o/% : create an object\n" "p : make entrance to pandemonium\n" - "x : gain an experience level\n" "r : change character's species\n" "s : gain 20000 skill points\n" "S : set skill to level\n" - "t : tweak object properties\n", + "t : tweak object properties\n" + "T : make a trap\n" + "v : show gold value of an item\n", true, true); cols.add_formatted(1, - "T : make a trap\n" - "v : show gold value of an item\n" + "x : gain an experience level\n" + "Ctrl-X : change experience level\n" "X : make Xom do something now\n" "z/Z : cast spell by number/name\n" "$ : get 1000 gold\n" "</> : create up/down staircase\n" "u/d : shift up/down one level\n" - "~/\" : go to a specific level\n" + "~ : go to a specific level\n" "(/) : make feature by number/name\n" "] : get a mutation\n" "[ : get a demonspawn mutation\n" @@ -1108,6 +1109,7 @@ static void list_wizard_commands() "^ : gain piety\n" "_ : gain religion\n" "' : list items\n" + "\" : list monsters\n" "? : list wizard commands\n" "| : make unrand/fixed artefacts\n" "+ : make randart from item\n" diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index 4d79857f54..daf1f0ee64 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -58,6 +58,7 @@ #include "monstuff.h" #include "mon-util.h" #include "mutation.h" +#include "ouch.h" #include "player.h" #include "randart.h" #include "religion.h" @@ -2402,4 +2403,44 @@ void generate_map_stats() write_mapgen_stats(); } +static void debug_uptick_xl(int newxl) +{ + while (newxl > you.experience_level) + { + you.experience = 1 + exp_needed( 2 + you.experience_level ); + level_change(true); + } +} + +static void debug_downtick_xl(int newxl) +{ + you.hp = you.hp_max; + while (newxl < you.experience_level) + lose_level(); +} + +void debug_set_xl() +{ + mprf(MSGCH_PROMPT, "Enter new experience level: "); + char buf[30]; + if (cancelable_get_line(buf, sizeof buf)) + { + canned_msg(MSG_OK); + return; + } + + const int newxl = atoi(buf); + if (newxl < 1 || newxl > 27 || newxl == you.experience_level) + { + canned_msg(MSG_OK); + return; + } + + no_messages mx; + if (newxl < you.experience_level) + debug_downtick_xl(newxl); + else + debug_uptick_xl(newxl); +} + #endif // DEBUG_DIAGNOSTICS diff --git a/crawl-ref/source/debug.h b/crawl-ref/source/debug.h index 6e0073eb30..62ca22d53a 100644 --- a/crawl-ref/source/debug.h +++ b/crawl-ref/source/debug.h @@ -152,6 +152,7 @@ void debug_set_stats( void ); void debug_list_monsters(); void debug_card(); +void debug_set_xl(); #ifdef DEBUG_DIAGNOSTICS void generate_map_stats(); diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc index b5bde3ec19..9789881fbb 100644 --- a/crawl-ref/source/message.cc +++ b/crawl-ref/source/message.cc @@ -651,7 +651,7 @@ void mesclr( bool force ) void more(void) { - if (Options.show_more_prompt) + if (Options.show_more_prompt && !suppress_messages) { char keypress = 0; diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 4323b3e38f..d3ae812e33 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -581,7 +581,7 @@ void expose_player_to_element( beam_type flavour, int strength ) expose_invent_to_element( flavour, strength ); } -void lose_level(void) +void lose_level() { // because you.experience is unsigned long, if it's going to be -ve // must die straightaway. diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 93088eff46..c323ae53ac 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -2342,7 +2342,7 @@ void gain_exp( unsigned int exp_gained ) tutorial_finished(); } // end gain_exp() -void level_change(void) +void level_change(bool skip_ability_increase) { int hp_adjust = 0; int mp_adjust = 0; @@ -2384,7 +2384,7 @@ void level_change(void) inc_hp( brek, true ); inc_mp( 1, true ); - if (!(you.experience_level % 3)) + if (!(you.experience_level % 3) && !skip_ability_increase) ability_increase(); switch (you.species) diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index 04695039f3..90921e3362 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -287,7 +287,7 @@ void modify_stat(stat_type which_stat, char amount, bool suppress_msg); /* *********************************************************************** * called from: decks - it_use2 - player * *********************************************************************** */ -void level_change(void); +void level_change(bool skip_ability_increase = false); /* *********************************************************************** |