summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-08 17:00:33 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-08 17:00:33 +0000
commit6760ab3170033b2ecceb6ced51e2de7a5d78d6fe (patch)
tree9d5ed416ad5402c17ae593404ca6589d8c07a3ba /crawl-ref
parent1854b1209c376c3e3359b4d8a54f9bbf38e1a5ba (diff)
downloadcrawl-ref-6760ab3170033b2ecceb6ced51e2de7a5d78d6fe.tar.gz
crawl-ref-6760ab3170033b2ecceb6ced51e2de7a5d78d6fe.zip
* Rarely, allow randart books to use entirely random names.
* Use monsters' 'x' descriptions as inf.title when hovering your mouse over monster tiles. * A bit of code cleanup. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9385 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/docs/obsolete/cut_spells.txt55
-rw-r--r--crawl-ref/source/dat/database/rand_arm.txt13
-rw-r--r--crawl-ref/source/dat/database/randbook.txt52
-rw-r--r--crawl-ref/source/dat/database/randname.txt2
-rw-r--r--crawl-ref/source/debug.cc16
-rw-r--r--crawl-ref/source/delay.cc2
-rw-r--r--crawl-ref/source/describe.cc24
-rw-r--r--crawl-ref/source/describe.h4
-rw-r--r--crawl-ref/source/directn.cc122
-rw-r--r--crawl-ref/source/directn.h11
-rw-r--r--crawl-ref/source/monstuff.cc18
-rw-r--r--crawl-ref/source/monstuff.h1
-rw-r--r--crawl-ref/source/spl-book.cc146
-rw-r--r--crawl-ref/source/state.cc2
-rw-r--r--crawl-ref/source/tilereg.cc2
15 files changed, 303 insertions, 167 deletions
diff --git a/crawl-ref/docs/obsolete/cut_spells.txt b/crawl-ref/docs/obsolete/cut_spells.txt
index 5d675cf96f..fa856badd2 100644
--- a/crawl-ref/docs/obsolete/cut_spells.txt
+++ b/crawl-ref/docs/obsolete/cut_spells.txt
@@ -353,6 +353,21 @@ Spell definitions cut from the code:
false
},
+ // Removing Air Walk... it's currently broken in a number or ways:
+ // - the AC/EV bonus probably means very little to any character
+ // capable of casting a level nine spell
+ // - the penalty of dropping inventory is a bit harsh considering
+ // the above
+ // - the fire/ice susceptibility doesn't work... the AC/EV bonus
+ // cancel it out (so you'd hardly be wary of them since they
+ // can't really do any damage).
+ // - there is no need for another invulnerability spell (which is
+ // what this spell is trying to be), one is more than enough...
+ // let people use necromancy.
+ // - there is no need for another air spell... air spells are
+ // already very common (i.e,. this level nine spell occurred in
+ // two books!)
+
{
SPELL_AIR_WALK, "Air Walk",
SPTYP_TRANSMUTATION | SPTYP_AIR,
@@ -414,63 +429,63 @@ Spell descriptions cut from the code:
%%%%
Create Noise
-This spell causes a loud noise to be heard.
+This spell causes a loud noise to be heard.
%%%%
Swap
-This spell allows the caster to swap positions with an adjacent being.
+This spell allows the caster to swap positions with an adjacent being.
%%%%
Twist
-This spell causes a slight spatial distortion around a monster in line of sight of the caster, causing injury.
+This spell causes a slight spatial distortion around a monster in line of sight of the caster, causing injury.
%%%%
Far Strike
-This spell allows the caster to transfer the force of a weapon strike to any target the caster can see. This spell will only deliver the impact of the blow; magical side-effects and enchantments cannot be transferred in this way. The force transferred by this spell has little to do with one's skill with weapons, and more to do with personal strength, translocation skill and magic ability.
+This spell allows the caster to transfer the force of a weapon strike to any target the caster can see. This spell will only deliver the impact of the blow; magical side-effects and enchantments cannot be transferred in this way. The force transferred by this spell has little to do with one's skill with weapons, and more to do with personal strength, translocation skill and magic ability.
%%%%
Restore Strength
-This spell restores the physical strength of the caster.
+This spell restores the physical strength of the caster.
%%%%
Restore Intelligence
-This spell restores the intelligence of the caster.
+This spell restores the intelligence of the caster.
%%%%
Restore Dexterity
-This spell restores the dexterity of the caster.
+This spell restores the dexterity of the caster.
%%%%
Purification
-This spell purifies the caster's body, removing poison, disease and certain malign enchantments.
+This spell purifies the caster's body, removing poison, disease and certain malign enchantments.
%%%%
Repel Undead
-This spell calls on a divine power to repel the unholy.
+This spell calls on a divine power to repel the unholy.
%%%%
Holy Word
-This spell involves the intonation of a word of power which repels and can destroy unholy creatures.
+This spell involves the intonation of a word of power which repels and can destroy unholy creatures.
%%%%
Heal Other
-This spell heals another creature from a distance.
+This spell heals another creature from a distance.
%%%%
Burn
-This spell burns a creature.
+This spell burns a creature.
%%%%
Crush
-This spell crushes a nearby creature with waves of gravitational force.
+This spell crushes a nearby creature with waves of gravitational force.
%%%%
Tomb of Doroklohe
-This spell entombs the caster within four walls of rock. These walls will destroy most objects in their way, but their growth is obstructed by the presence of any creature. Beware - only the unwise cast this spell without reliable means of escape.
+This spell entombs the caster within four walls of rock. These walls will destroy most objects in their way, but their growth is obstructed by the presence of any creature. Beware - only the unwise cast this spell without reliable means of escape.
%%%%
Orb of Electrocution
-This spell hurls a crackling orb of electrical energy which explodes with immense force on impact.
+This spell hurls a crackling orb of electrical energy which explodes with immense force on impact.
%%%%
Arc
@@ -478,21 +493,21 @@ This spell zaps at random a nearby creature with a powerful electrical current.
%%%%
Bend
-This spell applies a localized spatial distortion to the detriment of some nearby creature.
+This spell applies a localized spatial distortion to the detriment of some nearby creature.
%%%%
Eringya's Surprising Bouquet
-This spell transmutes any wooden items in the caster's grasp into a bouquet of beautiful flowers.
+This spell transmutes any wooden items in the caster's grasp into a bouquet of beautiful flowers.
%%%%
Air Walk
-This spell transforms the caster's body into an insubstantial cloud. The caster becomes immaterial and nearly immune to physical harm, but is vulnerable to magical fire and ice. While insubstantial the caster is, of course, unable to interact with physical objects (but may still cast spells).
+This spell transforms the caster's body into an insubstantial cloud. The caster becomes immaterial and nearly immune to physical harm, but is vulnerable to magical fire and ice. While insubstantial the caster is, of course, unable to interact with physical objects (but may still cast spells).
%%%%
Rotting
-This spell causes the flesh of all those near the caster to rot. It will affect the living and many of the corporeal undead.
+This spell causes the flesh of all those near the caster to rot. It will affect the living and many of the corporeal undead.
%%%%
Detect Magic
-This spell probes one or more items lying nearby for enchantment. An experienced diviner may glean additional information.
+This spell probes one or more items lying nearby for enchantment. An experienced diviner may glean additional information.
%%%%
diff --git a/crawl-ref/source/dat/database/rand_arm.txt b/crawl-ref/source/dat/database/rand_arm.txt
index 8fc562e800..0c78510388 100644
--- a/crawl-ref/source/dat/database/rand_arm.txt
+++ b/crawl-ref/source/dat/database/rand_arm.txt
@@ -4,7 +4,7 @@
# rand_arm.txt: keywords for randart ARMOUR
#
# This file contains the lists of keywords (and their
-# weights) for most of the keywords used for randart
+# weights) for most of the keywords used for randart
# armour. You will find others in rand_wpn.txt and
# rand_all.txt, respectively.
#
@@ -91,12 +91,12 @@ the Garden
# non-Crawl critters
critter_name
-the Slorg
+Slorg
-the Alphagorgon
+Alphagorgon
# from the crawl.akrasiac.org patch.
-the Hot Ocelot
+Hot Ocelot
Eight Boll Weevils
%%%%
@@ -192,7 +192,8 @@ the Invisible Hand
Divine Intervention
%%%%
-# in contrast to "wacky_armour_name" these do have some connection to armour and protection
+# in contrast to "wacky_armour_name" these do have some
+# connection to armour and protection
armour_name_shielding
Shielding
@@ -322,7 +323,7 @@ the Accordion
the Bagpipe
the Lute
-%%%%
+%%%%
evil_being
the Devil
diff --git a/crawl-ref/source/dat/database/randbook.txt b/crawl-ref/source/dat/database/randbook.txt
index 0bc397000c..80de91d40f 100644
--- a/crawl-ref/source/dat/database/randbook.txt
+++ b/crawl-ref/source/dat/database/randbook.txt
@@ -92,6 +92,58 @@ w:9
w:4
@book_noun_on@ on
%%%%
+# @book_noun@ of ...
+random_book_title
+
+w:15
+the @book_plant_animal@
+
+w:20
+@number_or_qualifier@ @thing_names@
+
+w:4
+the @profession_name@
+
+w:13
+@philosophy_or_science@
+
+w:8
+@wacky_armour_name@
+
+w:2
+@destiny_name@
+
+w:6
+@place_name@
+
+w:1
+@magic_name@
+
+w:4
+@substance_name@
+
+w:2
+@power_name@
+
+w:2
+@mental_illness_weapon@
+%%%%
+book_plant_animal
+
+w:1
+@jewellery_animal@
+
+w:1
+@critter_name@
+
+w:1
+@plant_name@
+
+w:6
+@weapon_animal@
+
+@armour_animal@
+%%%%
book_adjective
glistering
diff --git a/crawl-ref/source/dat/database/randname.txt b/crawl-ref/source/dat/database/randname.txt
index ef392f162b..e46bbda9c0 100644
--- a/crawl-ref/source/dat/database/randname.txt
+++ b/crawl-ref/source/dat/database/randname.txt
@@ -189,7 +189,7 @@ w:3
of @flower_name@
w:3
-of @critter_name@
+of the @critter_name@
w:5
of @evil_being@
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index e43ec587e1..08f9ccb237 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -1175,11 +1175,11 @@ void wizard_create_spec_object()
while (class_wanted == OBJ_UNASSIGNED)
{
mpr(") - weapons ( - missiles [ - armour / - wands ? - scrolls",
- MSGCH_PROMPT);
+ MSGCH_PROMPT);
mpr("= - jewellery ! - potions : - books | - staves 0 - The Orb",
- MSGCH_PROMPT);
+ MSGCH_PROMPT);
mpr("} - miscellany X - corpses % - food $ - gold ESC - exit",
- MSGCH_PROMPT);
+ MSGCH_PROMPT);
mpr("What class of item? ", MSGCH_PROMPT);
@@ -1561,12 +1561,16 @@ bool get_item_by_name(item_def *item, char* specs,
item->plus2 = 3 + random2(15);
}
else
- mpr( "Sorry, no books on that skill today." );
+ mpr("Sorry, no books on that skill today.");
}
else if (type_wanted == BOOK_RANDART_THEME)
- make_book_theme_randart(*item);
+ make_book_theme_randart(*item, 0, 0, 5 + coinflip(), 20);
else if (type_wanted == BOOK_RANDART_LEVEL)
- make_book_level_randart(*item);
+ {
+ int level = random_range(1, 9);
+ int max_spells = 5 + level/3;
+ make_book_level_randart(*item, level, max_spells);
+ }
break;
case OBJ_WANDS:
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index 04c3b429bc..1bb9808b55 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -1825,7 +1825,7 @@ inline static bool _monster_warning(activity_interrupt_type ai,
text += " comes into view.";
const std::string mweap =
- get_monster_desc(mon, false, DESC_NONE);
+ get_monster_equipment_desc(mon, false, DESC_NONE);
if (!mweap.empty())
{
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 80ba34ff21..cb8b69786a 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -331,7 +331,7 @@ static void _trim_randart_inscrip( item_def& item )
std::string randart_auto_inscription( const item_def& item )
{
if (item.base_type == OBJ_BOOKS)
- return("");
+ return ("");
const std::vector<std::string> propnames = _randart_propnames(item);
@@ -2683,7 +2683,7 @@ static std::string _monster_stat_description(const monsters& mon)
result << pronoun << " can sense the presence of invisible creatures.$";
// Unusual monster speed.
- const int speed = mons_speed(&mon);
+ const int speed = mons_class_speed(mon.type);
if (speed != 10)
{
result << pronoun << " is ";
@@ -2711,7 +2711,9 @@ static std::string _monster_stat_description(const monsters& mon)
return (result.str());
}
-void get_monster_desc(const monsters& mons, describe_info &inf, bool force_seen)
+// Fetches the monster's database description and reads it into inf.
+void get_monster_db_desc(const monsters& mons, describe_info &inf,
+ bool force_seen)
{
// For undetected mimics describe mimicked item instead.
if (!force_seen && mons_is_unknown_mimic(&mons))
@@ -2722,13 +2724,15 @@ void get_monster_desc(const monsters& mons, describe_info &inf, bool force_seen)
return;
}
- inf.title = mons.full_name(DESC_CAP_A, true);
+ if (inf.title.empty())
+ inf.title = mons.full_name(DESC_CAP_A, true);
std::string db_name = mons.base_name(DESC_DBNAME, force_seen);
if (mons_is_mimic(mons.type) && mons.type != MONS_GOLD_MIMIC)
{
- db_name = "mimic";
- inf.title = "A mimic";
+ db_name = "mimic";
+ if (inf.title.empty())
+ inf.title = "A mimic";
}
// Don't get description for player ghosts.
@@ -2855,7 +2859,7 @@ void get_monster_desc(const monsters& mons, describe_info &inf, bool force_seen)
{
inf.body << "$" << mons_pronoun(static_cast<monster_type>(mons.type),
PRONOUN_CAP, true)
- << " is incapable of using stairs.$";
+ << " is incapable of using stairs.$";
}
if (mons_is_summoned(&mons))
@@ -2911,7 +2915,7 @@ void get_monster_desc(const monsters& mons, describe_info &inf, bool force_seen)
has_item = true;
}
inf.body << " " << i << ") "
- << mitm[mons.inv[i]].name(DESC_NOCAP_A, false, true);
+ << mitm[mons.inv[i]].name(DESC_NOCAP_A, false, true);
}
}
#endif
@@ -2920,12 +2924,12 @@ void get_monster_desc(const monsters& mons, describe_info &inf, bool force_seen)
void describe_monsters(const monsters& mons, bool force_seen)
{
describe_info inf;
- get_monster_desc(mons, inf, force_seen);
+ get_monster_db_desc(mons, inf, force_seen);
print_description(inf);
mouse_control mc(MOUSE_MODE_MORE);
- // TODO enne - this should really move into get_monster_desc
+ // TODO enne - this should really move into get_monster_db_desc
// and an additional tutorial string added to describe_info.
if (Options.tutorial_left)
tutorial_describe_monster(&mons);
diff --git a/crawl-ref/source/describe.h b/crawl-ref/source/describe.h
index 7e661e61f1..4a09ad0d81 100644
--- a/crawl-ref/source/describe.h
+++ b/crawl-ref/source/describe.h
@@ -88,8 +88,8 @@ void append_missile_info(std::string &description);
* called from: command - direct
* *********************************************************************** */
void describe_monsters(const monsters &mons, bool force_seen = false);
-void get_monster_desc(const monsters &item, describe_info &inf,
- bool force_seen = false);
+void get_monster_db_desc(const monsters &item, describe_info &inf,
+ bool force_seen = false);
// last updated 12 Jun 2008 {jpeg}
/* ***********************************************************************
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 16aaf8e3fe..4843493939 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -120,6 +120,7 @@ static char _find_square( const coord_def& where,
static int _targeting_cmd_to_compass( command_type command );
static void _describe_oos_square(const coord_def& where);
static void _extend_move_to_edge(dist &moves);
+static std::string _get_monster_desc(const monsters *mon);
void direction_choose_compass( dist& moves, targeting_behaviour *beh)
{
@@ -553,8 +554,8 @@ void full_describe_view()
damage_level = MDAM_OKAY;
std::vector<formatted_string> fss;
- std::string str = get_monster_desc(list_mons[i], true, DESC_CAP_A,
- true);
+ std::string str = get_monster_equipment_desc(list_mons[i], true,
+ DESC_CAP_A, true);
if (player_mesmerised_by(list_mons[i]))
str += ", keeping you mesmerised";
@@ -1642,7 +1643,8 @@ void terse_describe_square(const coord_def &c, bool in_range)
_describe_cell(c, in_range);
}
-void get_square_desc(const coord_def &c, describe_info &inf)
+void get_square_desc(const coord_def &c, describe_info &inf,
+ bool examine_mons)
{
// NOTE: Keep this function in sync with full_describe_square.
@@ -1656,7 +1658,20 @@ void get_square_desc(const coord_def &c, describe_info &inf)
if (mons && player_monster_visible(mons))
{
// First priority: monsters.
- get_monster_desc(*mons, inf);
+ if (examine_mons && !mons_is_unknown_mimic(mons))
+ {
+ // If examine_mons is true (currently only for the Tiles
+ // mouse-over information), set monster's
+ // equipment/woundedness/enchantment description as title.
+ std::string desc = get_monster_equipment_desc(mons) + ".\n";
+ std::string wounds = get_wounds_description(mons);
+ if (!wounds.empty())
+ desc += mons->pronoun(PRONOUN_CAP) + wounds + "\n";
+ desc += _get_monster_desc(mons);
+
+ inf.title = desc;
+ }
+ get_monster_db_desc(*mons, inf);
}
else if (oid != NON_ITEM)
{
@@ -2879,31 +2894,27 @@ std::string _mon_enchantments_string(const monsters* mon)
return "";
}
-static void _describe_monster(const monsters *mon)
+// Returns the description string for a given monster, including attitude
+// and enchantments but not equipment or wounds.
+static std::string _get_monster_desc(const monsters *mon)
{
- // First print type and equipment.
- std::string text = get_monster_desc(mon) + ".";
- print_formatted_paragraph(text);
+ std::string text = "";
+ std::string pronoun = mon->pronoun(PRONOUN_CAP);
if (player_mesmerised_by(mon))
- mpr("You are mesmerised by her song.", MSGCH_EXAMINE);
-
- print_wounds(mon);
+ text += "You are mesmerised by her song.\n";
if (!mons_is_mimic(mon->type) && mons_behaviour_perceptible(mon))
{
if (mons_is_sleeping(mon))
{
- mprf(MSGCH_EXAMINE, "%s appears to be %s.",
- mon->pronoun(PRONOUN_CAP).c_str(),
- mons_is_confused(mon) ? "sleepwalking" : "resting");
+ text += pronoun + " appears to be "
+ + (mons_is_confused(mon) ? "sleepwalking" : "resting")
+ + ".\n";
}
// Applies to both friendlies and hostiles
else if (mons_is_fleeing(mon))
- {
- mprf(MSGCH_EXAMINE, "%s is retreating.",
- mon->pronoun(PRONOUN_CAP).c_str());
- }
+ text += pronoun + " is retreating.\n";
// hostile with target != you
else if (!mons_friendly(mon) && !mons_neutral(mon)
&& mon->foe != MHITYOU && !crawl_state.arena_suspended)
@@ -2911,29 +2922,17 @@ static void _describe_monster(const monsters *mon)
// special case: batty monsters get set to BEH_WANDER as
// part of their special behaviour.
if (!mons_is_batty(mon))
- {
- mprf(MSGCH_EXAMINE, "%s doesn't appear to have noticed you.",
- mon->pronoun(PRONOUN_CAP).c_str());
- }
+ text += pronoun + " doesn't appear to have noticed you.\n";
}
}
if (mon->attitude == ATT_FRIENDLY)
- {
- mprf(MSGCH_EXAMINE, "%s is friendly.",
- mon->pronoun(PRONOUN_CAP).c_str());
- }
+ text += pronoun + " is friendly.\n";
else if (mons_neutral(mon)) // don't differentiate between permanent or not
- {
- mprf(MSGCH_EXAMINE, "%s is indifferent to you.",
- mon->pronoun(PRONOUN_CAP).c_str());
- }
+ text += pronoun + " is indifferent to you.\n";
if (mon->haloed())
- {
- mprf(MSGCH_EXAMINE, "%s is illuminated by a divine halo.",
- mon->pronoun(PRONOUN_CAP).c_str());
- }
+ text += pronoun + " is illuminated by a divine halo.\n";
// Give an indication of monsters being capable of seeing/sensing
// invisible creatures.
@@ -2945,54 +2944,57 @@ static void _describe_monster(const monsters *mon)
if (foe && foe->invisible() && !mons_is_fleeing(mon))
{
if (!you.can_see(foe))
- {
- mprf(MSGCH_EXAMINE, "%s is looking at something unseen.",
- mon->pronoun(PRONOUN_CAP).c_str());
- }
+ text += pronoun + " is looking at something unseen.\n";
else if (mons_see_invis(mon))
{
- mprf(MSGCH_EXAMINE, "%s is watching %s carefully.",
- mon->pronoun(PRONOUN_CAP).c_str(),
- foe->name(DESC_NOCAP_THE).c_str());
+ text += pronoun + " is watching "
+ + foe->name(DESC_NOCAP_THE)
+ + ".\n";
}
else
{
+ text += pronoun + " is looking in ";
std::string name = foe->atype() == ACT_PLAYER
- ? "your" : (foe->name(DESC_NOCAP_THE) + "'s");
- mprf(MSGCH_EXAMINE, "%s is looking in %s general direction.",
- mon->pronoun(PRONOUN_CAP).c_str(),
- name.c_str());
+ ? "your" : (foe->name(DESC_NOCAP_THE) + "'s");
+ text += name + "general direction.\n";
}
}
else if (!foe || mons_is_fleeing(mon))
- {
- mprf(MSGCH_EXAMINE, "%s seems to be peering into the shadows.",
- mon->pronoun(PRONOUN_CAP).c_str());
- }
+ text += pronoun + " seems to be peering into the shadows.\n";
}
if (mons_enslaved_body_and_soul(mon))
{
- mprf(MSGCH_EXAMINE, "%s soul is ripe for the taking.",
- mon->pronoun(PRONOUN_CAP_POSSESSIVE).c_str());
+ text += mon->pronoun(PRONOUN_CAP_POSSESSIVE)
+ + " soul is ripe for the taking.\n";
}
else if (mons_enslaved_soul(mon))
- {
- mprf(MSGCH_EXAMINE, "%s is a disembodied soul.",
- mon->pronoun(PRONOUN_CAP).c_str());
- }
+ text += pronoun + " is a disembodied soul.\n";
+
+ text += _mon_enchantments_string(mon);
+ return text;
+}
+
+static void _describe_monster(const monsters *mon)
+{
+ // First print type and equipment.
+ std::string text = get_monster_equipment_desc(mon) + ".";
+ print_formatted_paragraph(text);
+
+ print_wounds(mon);
- text = _mon_enchantments_string(mon);
+ // Print the rest of the description.
+ text = _get_monster_desc(mon);
if (!text.empty())
- print_formatted_paragraph(text);
+ print_formatted_paragraph(text, MSGCH_EXAMINE);
}
// This method is called in two cases:
// a) Monsters coming into view: "An ogre comes into view. It is wielding ..."
// b) Monster description via 'x': "An ogre, wielding a club, and wearing ..."
-std::string get_monster_desc(const monsters *mon, bool full_desc,
- description_level_type mondtype,
- bool print_attitude)
+std::string get_monster_equipment_desc(const monsters *mon, bool full_desc,
+ description_level_type mondtype,
+ bool print_attitude)
{
std::string desc = "";
if (mondtype != DESC_NONE)
diff --git a/crawl-ref/source/directn.h b/crawl-ref/source/directn.h
index da0d972f1b..a465565e87 100644
--- a/crawl-ref/source/directn.h
+++ b/crawl-ref/source/directn.h
@@ -177,13 +177,14 @@ std::string thing_do_grammar(description_level_type dtype,
std::string get_terse_square_desc(const coord_def &gc);
void terse_describe_square(const coord_def &c, bool in_range = true);
void full_describe_square(const coord_def &c);
-void get_square_desc(const coord_def &c, describe_info &inf);
+void get_square_desc(const coord_def &c, describe_info &inf,
+ bool examine_mons = false);
void describe_floor();
-std::string get_monster_desc(const monsters *mon,
- bool full_desc = true,
- description_level_type mondtype = DESC_CAP_A,
- bool print_attitude = false);
+std::string get_monster_equipment_desc(const monsters *mon,
+ bool full_desc = true,
+ description_level_type mondtype = DESC_CAP_A,
+ bool print_attitude = false);
int dos_direction_unmunge(int doskey);
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 0e1640ddc0..c625891ae4 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -2467,6 +2467,24 @@ void mons_get_damage_level( const monsters* monster, std::string& desc,
desc += _wounded_damaged(monster->type) ? "damaged" : "wounded";
}
+std::string get_wounds_description(const monsters *monster)
+{
+ if (!monster->alive() || monster->hit_points == monster->max_hit_points)
+ return "";
+
+ if (monster_descriptor(monster->type, MDSC_NOMSG_WOUNDS))
+ return "";
+
+ std::string desc;
+ mon_dam_level_type dam_level;
+ mons_get_damage_level(monster, desc, dam_level);
+
+ desc.insert(0, " is ");
+ desc += ".";
+
+ return desc;
+}
+
void print_wounds(const monsters *monster)
{
if (!monster->alive() || monster->hit_points == monster->max_hit_points)
diff --git a/crawl-ref/source/monstuff.h b/crawl-ref/source/monstuff.h
index 614b639ef9..9a9975def7 100644
--- a/crawl-ref/source/monstuff.h
+++ b/crawl-ref/source/monstuff.h
@@ -162,6 +162,7 @@ bool swap_places(monsters *monster, const coord_def &loc);
bool swap_check(monsters *monster, coord_def &loc, bool quiet = false);
+std::string get_wounds_description(const monsters *monster);
void print_wounds(const monsters *monster);
void handle_monsters(void);
bool monster_descriptor(int which_class, mon_desc_type which_descriptor);
diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc
index d17f388910..7f6c98f44e 100644
--- a/crawl-ref/source/spl-book.cc
+++ b/crawl-ref/source/spl-book.cc
@@ -56,7 +56,7 @@ REVISION("$Rev$");
static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
{
- // 0 - Minor Magic I
+ // 0 - Minor Magic I (fire)
{SPELL_MAGIC_DART,
SPELL_SUMMON_SMALL_MAMMALS,
SPELL_THROW_FLAME,
@@ -66,7 +66,8 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_CONJURE_FLAME,
SPELL_NO_SPELL,
},
- // 1 - Minor Magic II
+
+ // 1 - Minor Magic II (ice)
{SPELL_MAGIC_DART,
SPELL_THROW_FROST,
SPELL_BLINK,
@@ -76,7 +77,8 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_OZOCUBUS_ARMOUR,
SPELL_NO_SPELL,
},
- // 2 - Minor Magic III
+
+ // 2 - Minor Magic III (summ)
{SPELL_MAGIC_DART,
SPELL_SUMMON_SMALL_MAMMALS,
SPELL_BLINK,
@@ -86,6 +88,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_MEPHITIC_CLOUD,
SPELL_NO_SPELL,
},
+
// 3 - Book of Conjurations I - Fire and Earth
{SPELL_MAGIC_DART,
SPELL_THROW_FLAME,
@@ -96,6 +99,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 4 - Book of Conjurations II - Air and Ice
{SPELL_MAGIC_DART,
SPELL_THROW_FROST,
@@ -106,6 +110,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 5 - Book of Flames
{SPELL_FLAME_TONGUE,
SPELL_THROW_FLAME,
@@ -116,6 +121,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 6 - Book of Frost
{SPELL_FREEZE,
SPELL_THROW_FROST,
@@ -126,6 +132,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 7 - Book of Summonings
{SPELL_ABJURATION,
SPELL_RECALL,
@@ -136,6 +143,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_SUMMON_HORRIBLE_THINGS,
SPELL_NO_SPELL,
},
+
// 8 - Book of Fire
{SPELL_EVAPORATE,
SPELL_FIRE_BRAND,
@@ -146,6 +154,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_RING_OF_FLAMES,
SPELL_NO_SPELL,
},
+
// 9 - Book of Ice
{SPELL_FREEZING_AURA,
SPELL_SLEEP,
@@ -167,6 +176,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL
},
+
// 11 - Book of Spatial Translocations
{SPELL_APPORTATION,
SPELL_PORTAL_PROJECTILE,
@@ -177,6 +187,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_TELEPORT_SELF,
SPELL_NO_SPELL,
},
+
// 12 - Book of Enchantments (fourth one)
{SPELL_LEVITATION,
SPELL_SELECTIVE_AMNESIA,
@@ -187,6 +198,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_HASTE,
SPELL_NO_SPELL,
},
+
// 13 - Young Poisoner's Handbook
{SPELL_STING,
SPELL_CURE_POISON,
@@ -197,6 +209,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 14 - Book of the Tempests
{SPELL_DISCHARGE,
SPELL_LIGHTNING_BOLT,
@@ -207,6 +220,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 15 - Book of Death
{SPELL_CORPSE_ROT,
SPELL_LETHAL_INFUSION,
@@ -217,6 +231,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 16 - Book of Hinderance
{SPELL_CONFUSING_TOUCH,
SPELL_SLOW,
@@ -227,6 +242,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 17 - Book of Changes
{SPELL_FULSOME_DISTILLATION,
SPELL_STICKS_TO_SNAKES,
@@ -237,6 +253,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_BLADE_HANDS,
SPELL_NO_SPELL,
},
+
// 18 - Book of Transfigurations
{SPELL_SANDBLAST,
SPELL_POLYMORPH_OTHER,
@@ -247,6 +264,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 19 - Book of Practical Magic
{SPELL_PROJECTED_NOISE,
SPELL_DETECT_CURSE,
@@ -268,6 +286,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 21 - Book of Clouds
{SPELL_EVAPORATE,
SPELL_MEPHITIC_CLOUD,
@@ -278,6 +297,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 22 - Book of Necromancy
{SPELL_PAIN,
SPELL_ANIMATE_SKELETON,
@@ -288,6 +308,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 23 - Book of Callings
{SPELL_SUMMON_SMALL_MAMMALS,
SPELL_STICKS_TO_SNAKES,
@@ -298,6 +319,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 24 - Book of Charms
{SPELL_BACKLIGHT,
SPELL_REPEL_MISSILES,
@@ -308,6 +330,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_INVISIBILITY,
SPELL_NO_SPELL,
},
+
// 25 - Book of Air
{SPELL_SHOCK,
SPELL_SWIFTNESS,
@@ -319,21 +342,6 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
},
- // Removing Air Walk... it's currently broken in a number or ways:
- // - the AC/EV bonus probably means very little to any character
- // capable of casting a level nine spell
- // - the penalty of dropping inventory is a bit harsh considering
- // the above
- // - the fire/ice susceptibility doesn't work... the AC/EV bonus
- // cancel it out (so you'd hardly be wary of them since they
- // can't really do any damage).
- // - there is no need for another invulnerability spell (which is
- // what this spell is trying to be), one is more than enough...
- // let people use necromancy.
- // - there is no need for another air spell... air spells are
- // already very common (i.e,. this level nine spell occurred in
- // two books!)
-
// 26 - Book of the Sky
{SPELL_SUMMON_ELEMENTAL,
SPELL_INSULATION,
@@ -355,6 +363,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_IDENTIFY,
SPELL_NO_SPELL,
},
+
// 28 - Book of the Warp
{SPELL_BANISHMENT,
SPELL_WARP_BRAND,
@@ -365,6 +374,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 29 - Book of Envenomations
{SPELL_SPIDER_FORM,
SPELL_SUMMON_SCORPIONS,
@@ -375,6 +385,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 30 - Book of Unlife
{SPELL_SUBLIMATION_OF_BLOOD,
SPELL_ANIMATE_DEAD,
@@ -396,6 +407,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 32 - Book of Morphology
{SPELL_FRAGMENTATION,
SPELL_POLYMORPH_OTHER,
@@ -407,6 +419,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 33 - Book of Tukima
{SPELL_SURE_BLADE,
SPELL_TUKIMAS_VORPAL_BLADE,
@@ -417,6 +430,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 34 - Book of Geomancy
{SPELL_SANDBLAST,
SPELL_STONESKIN,
@@ -438,6 +452,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL
},
+
// 36 - Book of Wizardry
{SPELL_DETECT_CREATURES,
SPELL_SUMMON_ELEMENTAL,
@@ -448,6 +463,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_HASTE,
SPELL_NO_SPELL,
},
+
// 37 - Book of Power
{SPELL_ANIMATE_DEAD,
SPELL_TELEPORT_OTHER,
@@ -458,6 +474,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_POISONOUS_CLOUD,
SPELL_NO_SPELL,
},
+
// 38 - Book of Cantrips //jmf: added 04jan2000
{SPELL_CONFUSING_TOUCH,
SPELL_ANIMATE_SKELETON,
@@ -613,6 +630,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 52 - Rod of destruction (fire)
{SPELL_THROW_FLAME,
SPELL_BOLT_OF_FIRE,
@@ -623,6 +641,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 53 - Rod of destruction (ice)
{SPELL_THROW_FROST,
SPELL_ICE_BOLT,
@@ -633,6 +652,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 54 - Rod of destruction (lightning, iron, fireball)
{SPELL_LIGHTNING_BOLT,
SPELL_BOLT_OF_IRON,
@@ -643,6 +663,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 55 - Rod of destruction (inaccuracy, magma, cold)
{SPELL_BOLT_OF_INACCURACY,
SPELL_BOLT_OF_MAGMA,
@@ -653,6 +674,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 56 - Rod of warding
{SPELL_ABJURATION,
SPELL_CONDENSATION_SHIELD,
@@ -663,6 +685,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 57 - Rod of discovery
{SPELL_DETECT_SECRET_DOORS,
SPELL_DETECT_TRAPS,
@@ -673,6 +696,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 58 - Rod of demonology
{SPELL_ABJURATION,
SPELL_RECALL,
@@ -683,6 +707,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 59 - Rod of striking
{SPELL_STRIKING,
SPELL_NO_SPELL,
@@ -693,6 +718,7 @@ static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
+
// 60 - Rod of venom
{SPELL_CURE_POISON,
SPELL_VENOM_BOLT,
@@ -2597,56 +2623,68 @@ bool make_book_theme_randart(item_def &book, int disc1, int disc2,
else
book.props["is_named"].get_bool() = false;
- name += getRandNameString("book_name") + " ";
+ // Sometimes use a completely random title.
+ std::string bookname = "";
+ if (one_chance_in(20) && (owner.empty() || one_chance_in(3)))
+ bookname = getRandNameString("random_book_title");
- // For the actual name there's a 66% chance of getting something like
- // <book> of the Fiery Traveller (Translocation/Fire), else
- // <book> of Displacement and Flames.
- std::string type_name;
- if (disc1 != disc2 && !one_chance_in(3))
- {
- std::string lookup = spelltype_long_name(disc2);
- type_name = getRandNameString(lookup + " adj");
- }
-
- if (type_name.empty())
+ if (!bookname.empty())
+ name += getRandNameString("book_noun") + " of " + bookname;
+ else
{
- // No adjective found, use the normal method of combining two nouns.
- type_name = getRandNameString(spelltype_long_name(disc1));
- if (type_name.empty())
- name += spelltype_long_name(disc1);
- else
- name += type_name;
+ // Give a name that reflects the primary and secondary
+ // spell disciplines of the spells contained in the book.
+ name += getRandNameString("book_name") + " ";
- if (disc1 != disc2)
+ // For the actual name there's a 66% chance of getting something like
+ // <book> of the Fiery Traveller (Translocation/Fire), else
+ // <book> of Displacement and Flames.
+ std::string type_name;
+ if (disc1 != disc2 && !one_chance_in(3))
{
- name += " and ";
- type_name = getRandNameString(spelltype_long_name(disc2));
+ std::string lookup = spelltype_long_name(disc2);
+ type_name = getRandNameString(lookup + " adj");
+ }
+ if (type_name.empty())
+ {
+ // No adjective found, use the normal method of combining two nouns.
+ type_name = getRandNameString(spelltype_long_name(disc1));
if (type_name.empty())
- name += spelltype_long_name(disc2);
+ name += spelltype_long_name(disc1);
else
name += type_name;
- }
- }
- else
- {
- std::string bookname = type_name + " ";
- // Add the noun for the first discipline.
- type_name = getRandNameString(spelltype_long_name(disc1));
- if (type_name.empty())
- bookname += spelltype_long_name(disc1);
+ if (disc1 != disc2)
+ {
+ name += " and ";
+ type_name = getRandNameString(spelltype_long_name(disc2));
+
+ if (type_name.empty())
+ name += spelltype_long_name(disc2);
+ else
+ name += type_name;
+ }
+ }
else
{
- if (type_name.find("the ", 0) != std::string::npos)
+ bookname = type_name + " ";
+
+ // Add the noun for the first discipline.
+ type_name = getRandNameString(spelltype_long_name(disc1));
+ if (type_name.empty())
+ bookname += spelltype_long_name(disc1);
+ else
{
- type_name = replace_all(type_name, "the ", "");
- bookname = "the " + bookname;
+ if (type_name.find("the ", 0) != std::string::npos)
+ {
+ type_name = replace_all(type_name, "the ", "");
+ bookname = "the " + bookname;
+ }
+ bookname += type_name;
}
- bookname += type_name;
+ name += bookname;
}
- name += bookname;
}
set_randart_name(book, name);
diff --git a/crawl-ref/source/state.cc b/crawl-ref/source/state.cc
index a0023224b7..1e57e372c9 100644
--- a/crawl-ref/source/state.cc
+++ b/crawl-ref/source/state.cc
@@ -195,7 +195,7 @@ bool interrupt_cmd_repeat( activity_interrupt_type ai,
#ifndef DEBUG_DIAGNOSTICS
if (at.context == "newly seen")
{
- std::string text = get_monster_desc(mon, false);
+ std::string text = get_monster_equipment_desc(mon, false);
text += " comes into view.";
print_formatted_paragraph(text, MSGCH_WARN);
}
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index 7ff7b35ca0..98ae845dbf 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -1168,7 +1168,7 @@ bool DungeonRegion::update_alt_text(std::string &alt)
return (false);
describe_info inf;
- get_square_desc(gc, inf);
+ get_square_desc(gc, inf, true);
alt_desc_proc proc(crawl_view.msgsz.x, crawl_view.msgsz.y);
process_description<alt_desc_proc>(proc, inf);