From 2540d1003bb76a86c1c068f5834b04673ffd6f30 Mon Sep 17 00:00:00 2001 From: haranp Date: Fri, 29 Jun 2007 22:41:14 +0000 Subject: Added a spell inspection screen, bound to 'I'. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1694 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/acr.cc | 6 +++++- crawl-ref/source/enum.h | 19 ++++++++++--------- crawl-ref/source/spl-cast.cc | 19 +++++++++++++++++++ crawl-ref/source/spl-cast.h | 2 ++ 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index c91ce1fe86..5aadc5dadd 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1323,6 +1323,10 @@ void process_command( command_type cmd ) flush_input_buffer( FLUSH_ON_FAILURE ); break; + case CMD_DISPLAY_SPELLS: + inspect_spells(); + break; + case CMD_WEAPON_SWAP: wield_weapon(true); break; @@ -2694,7 +2698,7 @@ command_type keycode_to_command( keycode_type key ) case 'E': return CMD_EVOKE; case 'F': return CMD_NO_CMD; case 'G': return CMD_NO_CMD; - case 'I': return CMD_NO_CMD; + case 'I': return CMD_DISPLAY_SPELLS; case 'M': return CMD_MEMORISE_SPELL; case 'O': return CMD_DISPLAY_OVERMAP; case 'P': return CMD_WEAR_JEWELLERY; diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 11f49aabd4..30b6dc4256 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -560,7 +560,7 @@ enum cloud_type enum command_type { - CMD_NO_CMD = 1000, // 1000 + CMD_NO_CMD = 1000, CMD_MOVE_NOWHERE, CMD_MOVE_LEFT, CMD_MOVE_DOWN, @@ -570,7 +570,7 @@ enum command_type CMD_MOVE_DOWN_LEFT, CMD_MOVE_UP_RIGHT, CMD_MOVE_DOWN_RIGHT, - CMD_RUN_LEFT, // 1000 + 10 + CMD_RUN_LEFT, CMD_RUN_DOWN, CMD_RUN_UP, CMD_RUN_RIGHT, @@ -580,7 +580,7 @@ enum command_type CMD_RUN_DOWN_RIGHT, CMD_OPEN_DOOR_LEFT, CMD_OPEN_DOOR_DOWN, - CMD_OPEN_DOOR_UP, // 1000 + 20 + CMD_OPEN_DOOR_UP, CMD_OPEN_DOOR_RIGHT, CMD_OPEN_DOOR_UP_LEFT, CMD_OPEN_DOOR_DOWN_LEFT, @@ -590,7 +590,7 @@ enum command_type CMD_CLOSE_DOOR, CMD_REST, CMD_GO_UPSTAIRS, - CMD_GO_DOWNSTAIRS, // 1000 + 30 + CMD_GO_DOWNSTAIRS, CMD_TOGGLE_AUTOPICKUP, CMD_PICKUP, CMD_DROP, @@ -600,7 +600,7 @@ enum command_type CMD_EVOKE, CMD_WIELD_WEAPON, CMD_WEAPON_SWAP, - CMD_THROW, // 1000 + 40 + CMD_THROW, CMD_FIRE, CMD_WEAR_ARMOUR, CMD_REMOVE_ARMOUR, @@ -610,7 +610,7 @@ enum command_type CMD_LIST_ARMOUR, CMD_LIST_JEWELLERY, CMD_ZAP_WAND, - CMD_CAST_SPELL, // 1000 + 50 + CMD_CAST_SPELL, CMD_MEMORISE_SPELL, CMD_USE_ABILITY, CMD_PRAY, @@ -620,7 +620,7 @@ enum command_type CMD_LOOK_AROUND, CMD_SEARCH, CMD_SHOUT, - CMD_DISARM_TRAP, // 1000 + 60 + CMD_DISARM_TRAP, CMD_CHARACTER_DUMP, CMD_DISPLAY_COMMANDS, CMD_DISPLAY_INVENTORY, @@ -630,7 +630,8 @@ enum command_type CMD_DISPLAY_MAP, CMD_DISPLAY_OVERMAP, CMD_DISPLAY_RELIGION, - CMD_DISPLAY_CHARACTER_STATUS, // 1000 + 70 + CMD_DISPLAY_CHARACTER_STATUS, + CMD_DISPLAY_SPELLS, CMD_EXPERIENCE_CHECK, CMD_GET_VERSION, CMD_ADJUST_INVENTORY, @@ -640,7 +641,7 @@ enum command_type CMD_SAVE_GAME, CMD_SAVE_GAME_NOW, CMD_SUSPEND_GAME, - CMD_QUIT, // 1000 + 80 + CMD_QUIT, CMD_WIZARD, CMD_DESTROY_ITEM, diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 7936fbaa76..cf0fdeadb3 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -24,6 +24,7 @@ #include "beam.h" #include "cloud.h" +#include "describe.h" #include "effects.h" #include "fight.h" #include "food.h" @@ -545,6 +546,24 @@ int spell_enhancement( unsigned int typeflags ) return (enhanced); } // end spell_enhancement() +void inspect_spells() +{ + if (!you.spell_no) + { + mpr("You don't know any spells."); + return; + } + + // Maybe we should honour auto_list here, but if you want the + // description, you probably want the listing, too. + int keyin = list_spells(); + if ( isalpha(keyin) ) + { + describe_spell(get_spell_by_letter(keyin)); + redraw_screen(); + } +} + // returns false if spell failed, and true otherwise bool cast_a_spell() { diff --git a/crawl-ref/source/spl-cast.h b/crawl-ref/source/spl-cast.h index 6d7a94c7a8..650a221f27 100644 --- a/crawl-ref/source/spl-cast.h +++ b/crawl-ref/source/spl-cast.h @@ -35,6 +35,8 @@ void exercise_spell( spell_type spell_ex, bool spc, bool divide ); * *********************************************************************** */ bool cast_a_spell( void ); +void inspect_spells(); + // last updaetd 12may2000 {dlb} /* *********************************************************************** -- cgit v1.2.3-54-g00ecf