summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-15 18:51:46 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-15 18:51:46 +0000
commit24dd7bfc967050b9fcead40e820742feffe3ac49 (patch)
tree9a3f3fb2ea561bfc65beb1a9b0e3ffb45b23135a
parent7426d8145861b8ec8bb2b95ca0f541cc94ac343b (diff)
downloadcrawl-ref-24dd7bfc967050b9fcead40e820742feffe3ac49.tar.gz
crawl-ref-24dd7bfc967050b9fcead40e820742feffe3ac49.zip
* Add deck names to card descriptions, and vice versa. This should
eventually be done procedurally but for now this will do. * Use non-verbose descriptions when hovering over spellbooks in Tiles, so the description will include the spell list. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9506 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/command.cc12
-rw-r--r--crawl-ref/source/dat/descript/cards.txt185
-rw-r--r--crawl-ref/source/dat/descript/items.txt18
-rw-r--r--crawl-ref/source/describe.cc18
-rw-r--r--crawl-ref/source/describe.h3
-rw-r--r--crawl-ref/source/directn.cc3
-rw-r--r--crawl-ref/source/tilereg.cc2
7 files changed, 170 insertions, 71 deletions
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index f758fd84bc..624607b165 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -1160,20 +1160,30 @@ static void _append_non_item(std::string &desc, std::string key)
unsigned int flags = get_spell_flags(type);
if (flags & SPFLAG_DEVEL)
+ {
desc += "$This spell is still being developed, and is only available "
"via the &Z wizard command.";
+ }
else if (flags & SPFLAG_TESTING)
+ {
desc += "$This is a testing spell, only available via the "
"&Z wizard command.";
+ }
else if (flags & SPFLAG_MONSTER)
+ {
desc += "$This is a monster-only spell, only available via the "
"&Z wizard command.";
+ }
else if (flags & SPFLAG_CARD)
+ {
desc += "$This is a card-effect spell, unavailable in ordinary "
"spellbooks.";
+ }
else
+ {
desc += "$Odd, this spell can't be found anywhere. Please "
"file a bug report.";
+ }
#ifdef WIZARD
if (!you.wizard)
@@ -1182,8 +1192,10 @@ static void _append_non_item(std::string &desc, std::string key)
#endif
{
if (flags & (SPFLAG_TESTING | SPFLAG_MONSTER | SPFLAG_DEVEL))
+ {
desc += "$$You aren't in wizard mode, so you shouldn't be "
"seeing this entry. Please file a bug report.";
+ }
}
}
diff --git a/crawl-ref/source/dat/descript/cards.txt b/crawl-ref/source/dat/descript/cards.txt
index 7e93dd2843..85b87f0358 100644
--- a/crawl-ref/source/dat/descript/cards.txt
+++ b/crawl-ref/source/dat/descript/cards.txt
@@ -1,224 +1,289 @@
%%%%
+# decks of transport -> escape
the Portal
This card teleports you to a random location. At higher power levels this may be instantaneous, controlled or both.
+It is usually found in decks of escape and war, or in Nemelex' deck of punishment.
%%%%
the Warp
This card translocates you a short distance, either randomly or with increasing levels of control at higher power levels.
+It is usually found in decks of escape and war.
%%%%
Swap
This card swaps your position with that of a nearby monster.
+It is usually found in decks of escape and war.
%%%%
Velocity
This card makes you move or even act faster.
+It is usually found in decks of escape and war.
+%%%%
+# decks of emergency -> escape
+the Tomb
+
+This card entombs the player in protective walls of solid rock. At lower power levels, the tomb may be imperfect. Use with caution!
+It is usually found in decks of defence, escape, and war, or in Nemelex' deck of punishment.
+%%%%
+the Banshee
+
+The wail of the Banshee instils fear in nearby creatures.
+It is usually found in decks of defence, escape, and war.
%%%%
Damnation
This card banishes one or more nearby creatures to the Abyss, possibly including you.
+It is usually found in decks of defence, escape, and war, or in Nemelex' deck of punishment.
%%%%
Solitude
This card randomly teleports creatures adjacent to you.
+It is usually found in decks of defence, escape, and war.
+%%%%
+Warpwright
+
+This card may create teleporters.
+It is usually found in decks of defence, escape, and war.
+%%%%
+Flight
+
+This card helps you run away by transforming you, speeding you up or creating other avenues of escape.
+It is usually found in decks of defence, escape, and war.
%%%%
+# deck of battle -> changes, defence, war
the Elixir
This card heals you and may also drain or restore your magical energy in the process.
+It is usually found in decks of changes, defence and war.
%%%%
Battlelust
This card makes your more powerful in physical combat.
+It is usually found in decks of changes, defence and war.
%%%%
Metamorphosis
This card temporarily transforms you.
+It is usually found in decks of changes, defence and war.
%%%%
the Helm
This card increases your defences.
+It is usually found in decks of changes, defence and war.
%%%%
the Blade
This card temporarily enchants or even animates your weapon.
+It is usually found in decks of changes, defence and war.
%%%%
the Shadow
This card lets you blend into the shadows, making you less perceptible.
+It is usually found in decks of changes, defence and war.
%%%%
+# deck of wonders -> also changes
the Potion
This card has the same effect, positive or negative, as drinking a random magical potion.
+It is usually found in decks of changes and wonders.
%%%%
Focus
This card further boosts your strongest attribute at the cost of your worst.
+It is usually found in decks of changes and wonders.
%%%%
Shuffle
This card interchanges your three attributes. Use with caution!
+It is usually found in decks of changes and wonders.
%%%%
Experience
This card makes you more experienced.
+It is usually found in decks of changes and wonders.
%%%%
the Helix
This cards changes your mutations. Higher power levels make the change more likely to be beneficial.
+It is usually found in decks of changes and wonders.
%%%%
the Sage
This card will funnel some of your earned experience towards a training specific skill and train it faster than it normally would.
+It is usually found in decks of changes and wonders.
%%%%
-Dowsing
-
-This card lets you detect secret doors, traps, creatures or some combination thereof.
-%%%%
-the Trowel
-
-This card may create an altar, a statue, a golem or a portal.
-%%%%
-the Minefield
-
-This card makes your immediate surroundings more dangerous.
-%%%%
-the Stairs
-
-This card makes staircases slide towards or away from you.
-%%%%
-the Genie
-
-The Genie may grant you an acquirement or punish you for trying.
-%%%%
-the Tomb
-
-This card entombs the player in protective walls of solid rock. At lower power levels, the tomb may be imperfect. Use with caution!
-%%%%
+# deck of dungeons -> also changes
Water
This card changes the floor around you into water.
+It is usually found in decks of changes and dungeons.
%%%%
Vitrification
This card turns walls translucent.
+It is usually found in decks of changes and dungeons.
%%%%
the Map
This card reveals your surroundings.
+It is usually found in decks of changes and dungeons.
%%%%
-the Banshee
+Dowsing
-The wail of the Banshee instils fear in nearby creatures.
+This card lets you detect secret doors, traps, creatures or some combination thereof.
+It is usually found in decks of changes and dungeons.
%%%%
-Wild Magic
+the Spade
-This card causes wild magic, as if from miscasting a spell, to act upon you.
+This card digs a tunnel through unworked rock.
+It is usually found in decks of changes and dungeons.
+%%%%
+the Trowel
+
+This card may create an altar, a statue, a golem or a portal.
+It is usually found in decks of changes and dungeons.
%%%%
+the Minefield
+
+This card makes your immediate surroundings more dangerous.
+It is usually found in decks of changes and dungeons, or in Nemelex' deck of punishment.
+%%%%
+# deck of summonings
the Crusade
This card tries to convert nearby creatures to your cause.
+It is usually found in decks of summonings and war.
%%%%
the Herd
This card summons animals.
+It is usually found in decks of summonings and war.
%%%%
the Pentagram
This card summons a demon to your aid.
+It is usually found in decks of summonings and war.
%%%%
the Dance
This card summons a dancing weapon.
+It is usually found in decks of summonings and war.
%%%%
Foxfire
This card summons flying creatures.
+It is usually found in decks of summonings and war.
%%%%
the Bones
This card summons a skeletal monster.
+It is usually found in decks of summonings and war.
%%%%
Repulsiveness
This card summons an ugly or very ugly thing.
-%%%%
-Summoning
-
-This card summons random creatures.
-%%%%
-Xom
-
-This card draws the attention of Xom on yourself.
-%%%%
-Famine
-
-This card starves you.
-%%%%
-the Feast
-
-This card feeds you.
-%%%%
-Warpwright
-
-This card may create teleporters.
-%%%%
-Flight
-
-This card helps you run away by transforming you, speeding you up or creating other avenues of escape.
+It is usually found in decks of summonings and war.
%%%%
Vitriol
This card unleashes a corrosive or degenerating attack spell.
+It is usually found in decks of destruction and war.
%%%%
Flame
This card unleashes a fiery attack spell.
+It is usually found in decks of destruction and war.
%%%%
Frost
This card unleashes an icy attack spell.
+It is usually found in decks of destruction and war.
%%%%
Venom
This card unleashes a poisonous attack spell, which may affect you as well.
+It is usually found in decks of destruction and war.
%%%%
the Spark
This card unleashes an electrical attack spell.
+It is usually found in decks of destruction and war.
%%%%
the Hammer
This card unleashes a physical attack spell.
+It is usually found in decks of destruction and war.
%%%%
Pain
The Pain card unleashes a necromantic attack spell, which may affect you as well.
+It is usually found in decks of destruction and war.
%%%%
Torment
This card calls on the powers of Hell to agonising injury to any nearby living creature.
+It is usually found in decks of destruction and war.
%%%%
-the Spade
-
-This card digs a tunnel through unworked rock.
-%%%%
-the Bargain
-
-This card grants you a temporary discount in shops.
-%%%%
+# deck of punishment (along with a few others)
Wrath
This card draws a god's wrath against you.
+It is usually only found in Nemelex' deck of punishment.
%%%%
the Wraith
This card will drain you.
+It is usually only found in Nemelex' deck of punishment.
%%%%
the Curse
This card places curses on your possessions and may even spoil your potions.
+It is usually only found in Nemelex' deck of punishment.
+%%%%
+Xom
+
+This card draws the attention of Xom on yourself.
+It is usually only found in Nemelex' deck of punishment.
+%%%%
+Famine
+
+This card starves you.
+It is usually only found in Nemelex' deck of punishment.
+%%%%
+Wild Magic
+
+This card causes wild magic, as if from miscasting a spell, to act upon you.
+It is usually only found in Nemelex' deck of punishment.
+%%%%
+# deck of oddities (random card, along with a few others)
+the Bargain
+
+This card grants you a temporary discount in shops.
+It is not normally part of any deck.
+%%%%
+the Genie
+
+The Genie may grant you an acquirement or punish you for trying.
+It is not normally part of any deck.
+%%%%
+the Feast
+
+This card feeds you.
+It is not normally part of any deck.
+%%%%
+# cards for wizmode testing (&c)
+the Stairs
+
+This card makes staircases slide towards or away from you.
+(It is a bug if you ever encounter this card.)
+%%%%
+Summoning
+
+This card summons random creatures.
+(It is a bug if you ever encounter this card.)
%%%%
+# buggy cards
a buggy card
Buggy
diff --git a/crawl-ref/source/dat/descript/items.txt b/crawl-ref/source/dat/descript/items.txt
index 867096709b..3f444988cc 100644
--- a/crawl-ref/source/dat/descript/items.txt
+++ b/crawl-ref/source/dat/descript/items.txt
@@ -491,46 +491,64 @@ deck of changes
A deck of magical cards which induce changes in the user or his
environment.
+
+It may contain the following cards: the Elixir, Battlelust, Metamorphosis, the Helm, the Blade, the Shadow, the Potion, Focus, Shuffle, Experience, the Helix, the Sage, Water, Vitrification, the Map, Dowsing, the Spade, Trowel, the Minefield.
%%%%
deck of defence
A deck of magical cards, most of which defend the user from harm in
various ways.
+
+It may contain the following cards: the Tomb, the Banshee, Damnation, Solitude, Warpwright, Flight, the Elixir, Battlelust, Metamorphosis, the Helm, the Blade, the Shadow.
%%%%
deck of destruction
A deck of magical cards, most of which hurl death and destruction at
one's foes (or, if unlucky, at oneself).
+
+It may contain the following cards: Vitriol, Flame, Frost, Venom, the Spark, the Hammer, Pain, Torment.
%%%%
deck of dungeons
A deck of magical cards which deal with shaping the dungeon. Unlike
most other decks, the cards from this deck tend to be ignored by
Nemelex, who prefers more amusing pursuits.
+
+It may contain the following cards: Water, Vitrification, the Map, Dowsing, the Spade, Trowel, the Minefield.
%%%%
deck of escape
A deck of magical cards, mainly dealing with various forms of
escape. Incautious use may lead to being dumped from the frying pan
into the fire!
+
+It may contain the following cards: the Portal, the Warp, Swap, Velocity, the Tomb, the Banshee, Damnation, Solitude, Warpwright, Flight.
%%%%
deck of punishment
A deck of magical cards which wreak havoc on the user.
+
+It may contain the following cards: Wrath, the Wraith, the Curse, Xom, Famine, Wild Magic, the Portal, the Tomb, Damnation, the Minefield.
%%%%
deck of summonings
A deck of magical cards, depicting a range of weird and wondrous
creatures.
+
+It may contain the following cards: the Crusade, the Herd, the Pentagram, the Dance, Foxfire, the Bones, Repulsiveness.
%%%%
deck of war
A deck of magical cards which are useful before and during battle.
+
+It may contain the following cards: the Portal, the Warp, Swap, Velocity, the Tomb, the Banshee, Damnation, Solitude, Warpwright, Flight, the Elixir, Battlelust, Metamorphosis, the Helm, the Blade, the Shadow, the Crusade, the Herd, the Pentagram, the Dance, Foxfire, the Bones, Repulsiveness, Vitriol, Flame, Frost, Venom, the Spark, the Hammer, Pain, Torment
%%%%
deck of wonders
A deck of highly mysterious and magical cards, which can permanently
alter the drawer's physical and mental condition, for better or worse.
+
+It may contain the following cards: the Potion, Focus, Shuffle, Experience, the Helix, the Sage.
%%%%
demon blade
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 3e61fce6f1..9b43b76a8c 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -2082,7 +2082,7 @@ std::string get_item_description( const item_def &item, bool verbose,
}
return description.str();
-} // end get_item_description()
+}
static std::string _marker_feature_description(const coord_def &pos)
{
@@ -2193,9 +2193,13 @@ void set_feature_desc_long(const std::string &raw_name,
desc_table[raw_name] = desc;
}
-void get_item_desc(const item_def &item, describe_info &inf)
+void get_item_desc(const item_def &item, describe_info &inf, bool terse)
{
- inf.body << get_item_description(item, true, false, Options.tutorial_left);
+ // Don't use verbose descriptions if terse and the item contains spells,
+ // so we can actually output these spells if space is scarce.
+ const bool verbose = !terse || !item.has_spells();
+ inf.body << get_item_description(item, verbose, false,
+ Options.tutorial_left);
}
// Returns true if spells can be shown to player.
@@ -2228,11 +2232,9 @@ static bool _show_item_description(const item_def &item)
formatted_string fs;
item_def dup = item;
- spellbook_contents( dup,
- item.base_type == OBJ_BOOKS?
- RBOOK_READ_SPELL
- : RBOOK_USE_STAFF,
- &fs );
+ spellbook_contents( dup, item.base_type == OBJ_BOOKS ? RBOOK_READ_SPELL
+ : RBOOK_USE_STAFF,
+ &fs );
fs.display(2, -2);
return (true);
}
diff --git a/crawl-ref/source/describe.h b/crawl-ref/source/describe.h
index 3bcf2f1fb6..d3a1b5b188 100644
--- a/crawl-ref/source/describe.h
+++ b/crawl-ref/source/describe.h
@@ -73,7 +73,8 @@ void set_feature_desc_long(const std::string &raw_name,
* called from: item_use - shopping
* *********************************************************************** */
void describe_item(item_def &item, bool allow_inscribe = false);
-void get_item_desc(const item_def &item, describe_info &inf);
+void get_item_desc(const item_def &item, describe_info &inf,
+ bool terse = false);
void inscribe_item(item_def &item, bool proper_prompt);
/* ***********************************************************************
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index c004d28f99..71c8ec454d 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -1712,7 +1712,8 @@ void get_square_desc(const coord_def &c, describe_info &inf,
else if (oid != NON_ITEM)
{
// Second priority: objects.
- get_item_desc(mitm[oid], inf);
+ // If examine_mons is true, use terse descriptions.
+ get_item_desc(mitm[oid], inf, examine_mons);
}
else
{
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index a08cf54b79..79387e594a 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -1847,7 +1847,7 @@ bool InventoryRegion::update_alt_text(std::string &alt)
item = &you.inv[idx];
describe_info inf;
- get_item_desc(*item, inf);
+ get_item_desc(*item, inf, true);
alt_desc_proc proc(crawl_view.msgsz.x, crawl_view.msgsz.y);
process_description<alt_desc_proc>(proc, inf);