diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-05-15 07:53:50 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-05-15 07:53:50 +0000 |
commit | 21a20c8edf221604f77decc0430145d13f305e5b (patch) | |
tree | bad911506f69e87d6b98f111e30a8f459be897c1 | |
parent | 9b09694770ae4724f3f264603b8ba7ff3865b06a (diff) | |
download | crawl-ref-21a20c8edf221604f77decc0430145d13f305e5b.tar.gz crawl-ref-21a20c8edf221604f77decc0430145d13f305e5b.zip |
Added a debug card command.
Documented some of the debug commands in the help.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1475 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/acr.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/command.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/debug.cc | 22 | ||||
-rw-r--r-- | crawl-ref/source/debug.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/decks.cc | 11 | ||||
-rw-r--r-- | crawl-ref/source/decks.h | 2 |
6 files changed, 38 insertions, 9 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 9ba81631f8..0fa011d87d 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -529,6 +529,11 @@ static void handle_wizard_command( void ) } break; + case 'c': + // draw a card + debug_card(); + break; + case 'h': you.rotting = 0; you.poisoning = 0; diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index 140b5b07e1..0d882bc3cf 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -1150,6 +1150,7 @@ static const char *wizard_string( int i ) (i == 13) ? "A : set all skills to level" : (i == 15) ? "b : controlled blink" : (i == 20) ? "B : banish yourself to the Abyss" : + (i == 25) ? "c : card effect" : (i == 30) ? "g : add a skill" : (i == 35) ? "G : remove all monsters" : (i == 40) ? "h/H : heal yourself (super-Heal)" : @@ -1163,6 +1164,7 @@ static const char *wizard_string( int i ) (i == 120) ? "s : gain 20000 skill points" : (i == 130) ? "S : set skill to level" : (i == 140) ? "t : tweak object properties" : + (i == 145) ? "T : make a trap" : (i == 150) ? "X : Receive a gift from Xom" : (i == 160) ? "z/Z : cast any spell by number/name": (i == 200) ? "$ : get 1000 gold" : @@ -1180,7 +1182,8 @@ static const char *wizard_string( int i ) (i == 320) ? "? : list wizard commands" : (i == 330) ? "| : acquire all unrand artefacts" : (i == 340) ? "+ : turn item into random artefact" : - (i == 350) ? "= : sum skill points" + (i == 350) ? "= : sum skill points" : + (i == 360) ? "@ : set stats" : ""); #else diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index dd93f536d3..6a57d1d069 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -17,6 +17,8 @@ #include "AppHdr.h" #include "debug.h" +#include <iostream> + #include <stdlib.h> #include <string.h> #include <stdio.h> @@ -35,8 +37,9 @@ #include "externs.h" #include "branch.h" -#include "direct.h" +#include "decks.h" #include "describe.h" +#include "direct.h" #include "dungeon.h" #include "fight.h" #include "files.h" @@ -2083,4 +2086,21 @@ void debug_set_stats() you.redraw_evasion = true; } +void debug_card() +{ + msg::streams(MSGCH_PROMPT) << "Which card? " << std::endl; + char buf[80]; + if (cancelable_get_line(buf, sizeof buf)) + return; + for ( int i = 0; i < NUM_CARDS; ++i ) + { + const card_type c = static_cast<card_type>(i); + if ( strstr(card_name(c), buf) != NULL ) + { + card_effect(c); + break; + } + } +} + #endif diff --git a/crawl-ref/source/debug.h b/crawl-ref/source/debug.h index 6f0a136097..3e647052df 100644 --- a/crawl-ref/source/debug.h +++ b/crawl-ref/source/debug.h @@ -150,4 +150,6 @@ void debug_make_trap( void ); void debug_make_shop( void ); void debug_set_stats( void ); +void debug_card(); + #endif diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc index 23c0d64c9d..3e995593ae 100644 --- a/crawl-ref/source/decks.cc +++ b/crawl-ref/source/decks.cc @@ -260,7 +260,6 @@ static card_type choose_one_card(deck_type which_deck, bool message) chosen = deck[random2(max_card)]; return chosen; } -static void cards(card_type which_card); // returns the deck type, of DECK_OF_PUNISHMENT if none deck_type subtype_to_decktype(int subtype) @@ -413,7 +412,7 @@ bool deck_triple_draw() else canned_msg(MSG_HUH); } - cards(draws[selected]); + card_effect(draws[selected]); // remove the cards from the deck item.plus -= num_to_draw; @@ -443,7 +442,7 @@ void evoke_deck( item_def& deck ) else { // draw the marked card - cards(static_cast<card_type>(deck.plus2 - 1)); + card_effect(static_cast<card_type>(deck.plus2 - 1)); // If there are more marked cards, shift them up if ( deck.special ) @@ -485,10 +484,10 @@ void evoke_deck( item_def& deck ) void deck_of_cards(deck_type which_deck) { - cards(choose_one_card(which_deck, true)); + card_effect(choose_one_card(which_deck, true)); } -static void cards(card_type which_card) +void card_effect(card_type which_card) { FixedVector < int, 5 > dvar; FixedVector < int, 5 > mvar; @@ -1058,4 +1057,4 @@ static void cards(card_type which_card) } return; -} // end cards() +} diff --git a/crawl-ref/source/decks.h b/crawl-ref/source/decks.h index 671f57c88c..735be7218d 100644 --- a/crawl-ref/source/decks.h +++ b/crawl-ref/source/decks.h @@ -24,6 +24,6 @@ deck_type subtype_to_decktype(int subtype); bool deck_triple_draw(); bool deck_peek(); bool deck_stack(); -const char* card_name(card_type card); +void card_effect(card_type which_card); #endif |