summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/religion.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-08 05:55:47 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-08 05:55:47 +0000
commite7240df9978d7ba42ed7dcfdf9ab385b2ce74d36 (patch)
tree31ecdc6a9945ba6bfb8e1b35cb484808df1f4f57 /crawl-ref/source/religion.cc
parent16a8b1fe4a5acec73e490b9f7d3e53f567673763 (diff)
downloadcrawl-ref-e7240df9978d7ba42ed7dcfdf9ab385b2ce74d36.tar.gz
crawl-ref-e7240df9978d7ba42ed7dcfdf9ab385b2ce74d36.zip
Added class CrawlHashTable, a savable/loadable string-keyed
associative array with heterogeneous values, capable of holding booleans, bytes, shorts, longs, floats, string, coordinates (coord_def), items (item_def) and nested hash tables. A table can be made to be homogeneous by giving it a value type, which causes dynamic type checking to be performed. The same type checking can be performed for individual member values of a heterogeneous table by setting a flag on that value. A flag can also be set on an individual member value to prevent its value from being changed. CrawlHashTable is currently only used for the props field of the item_def struct (though it could easily be added elsewhere), and is only being used by decks. The deck structure has been changed so that deck.plus is the original number of cards in the deck, deck.plus2 is either the number of cards used or the number of cards left, and deck.special hold the deck's rarity. The cards themselves are selected at deck creation time and stored in the nested hash table deck.props["cards"]. The Nemelex "Peek Deck" ability has been changed to identify the deck, draw three cards from it, show them to the user, and shuffle them back into the deck (with special cases for decks containing only one or two cards). A fourth Nemelex ability, "Mark Deck", has been added, which picks four cards from the deck, marks them, and then shuffles them back into the deck, creating a deck with a mixture of marked and unmarked cards. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2370 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r--crawl-ref/source/religion.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 961df346ea..3129a0808c 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -241,10 +241,10 @@ const char* god_gain_power_messages[NUM_GODS][MAX_GOD_ABILITIES] =
"call in reinforcement",
"" },
// Nemelex
- { "peek at the first card of a deck",
+ { "peek at three random cards from a deck",
"draw cards from decks in your inventory",
"draw cards with careful consideration",
- "",
+ "mark decks",
"stack decks" },
// Elyvilon
{ "call upon Elyvilon for minor healing",
@@ -327,10 +327,10 @@ const char* god_lose_power_messages[NUM_GODS][MAX_GOD_ABILITIES] =
"call in reinforcement",
"" },
// Nemelex
- { "peek at the first card of a deck",
+ { "peek at three random cards from a deck",
"draw cards from decks in your inventory",
"draw cards with careful consideration",
- "",
+ "mark decks",
"stack decks" },
// Elyvilon
{ "call upon Elyvilon for minor healing",
@@ -660,7 +660,8 @@ static void do_god_gift(bool prayed_for)
item_def &deck(mitm[thing_created]);
- deck.colour = deck_rarity_to_color(rarity);
+ deck.special = rarity;
+ deck.colour = deck_rarity_to_color(rarity);
move_item_to_grid( &thing_created, you.x_pos, you.y_pos );
origin_acquired(deck, you.religion);