summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-30 10:44:02 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-30 10:44:02 +0000
commitf22bd308c51e4f4425210e98d6623a6ed2be344a (patch)
tree1526b82248f63e17c4bba62c4278ab6d7efc10ad /crawl-ref
parentdb8fcd01b8752fe7d9e29763ddcb2e64da064af6 (diff)
downloadcrawl-ref-f22bd308c51e4f4425210e98d6623a6ed2be344a.tar.gz
crawl-ref-f22bd308c51e4f4425210e98d6623a6ed2be344a.zip
Just for kicks, reuse monster property mname to name zombies/skeletons
raised from unique monster's corpses. The unique number is stored in orig_monnum, so this doesn't apply to orcish followers. I thought it would be cool to have Sigmund the human zombie in your ranks, or to fight againt Blork the orc skeleton. The corpses are currently not differentiated (just "human corpse", "orc skeleton"), just the resulting undead. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5343 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/delay.cc2
-rw-r--r--crawl-ref/source/directn.cc7
-rw-r--r--crawl-ref/source/enum.h3
-rw-r--r--crawl-ref/source/externs.h14
-rw-r--r--crawl-ref/source/items.cc9
-rw-r--r--crawl-ref/source/items.h1
-rw-r--r--crawl-ref/source/mon-util.cc10
-rw-r--r--crawl-ref/source/monstuff.cc1
-rw-r--r--crawl-ref/source/spells2.cc23
9 files changed, 42 insertions, 28 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index b0605fb4ff..04173437e2 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -1589,7 +1589,7 @@ inline static void monster_warning(activity_interrupt_type ai,
std::string text = mon->name(DESC_CAP_A);
// For named monsters also mention the base type.
if (!(mon->mname).empty())
- text += " " + mons_type_name(mon->type, DESC_NOCAP_THE);
+ text += " the " + mon->name(DESC_BASENAME);
if (at.context == "thin air")
{
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 5b85906d81..30cad152a3 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -2180,9 +2180,12 @@ std::string get_monster_desc(const monsters *mon, bool full_desc,
{
desc = mon->name(mondtype);
// For named monsters also mention the base type in the form of
- // "Morbeogh the orc priest".
+ // "Morbeogh the orc priest", "Sigmund the human zombie".
+ // Note that the only difference between DESC_BASENAME and DESC_PLAIN
+ // is that basename will ignore mname, so the monster _must_ be named
+ // for this to make any sense.
if (!(mon->mname).empty())
- desc += " " + mons_type_name(mon->type, DESC_NOCAP_THE);
+ desc += " the " + mon->name(DESC_BASENAME);
}
std::string weap = "";
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 3e242deec1..d3edde0a47 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -2729,7 +2729,8 @@ enum tutorial_event_type
TUT_DONE_EXPLORE,
TUT_STAIR_BRAND,
TUT_EVENTS_NUM // 63
-}; // for numbers higher than 70 change size of tutorial_events in externs.h
+};
+// NOTE: For numbers higher than 70 change size of tutorial_events in externs.h.
enum tutorial_types
{
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index d05fcff2ea..91cc735a1e 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -393,13 +393,13 @@ struct delay_queue_item
struct item_def
{
object_class_type base_type; // basic class (ie OBJ_WEAPON)
- unsigned char sub_type; // type within that class (ie WPN_DAGGER)
- short plus; // +to hit, charges, corpse mon id
- short plus2; // +to dam, sub-sub type for boots and helms
- long special; // special stuff
- unsigned char colour; // item colour
- unsigned long flags; // item status flags
- short quantity; // number of items
+ unsigned char sub_type; // type within that class (ie WPN_DAGGER)
+ short plus; // +to hit, charges, corpse mon id
+ short plus2; // +to dam, sub-sub type for boots/helms
+ long special; // special stuff
+ unsigned char colour; // item colour
+ unsigned long flags; // item status flags
+ short quantity; // number of items
short x; // x-location; for inventory items = -1
short y; // y-location; for inventory items = -1
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index 70fa4e2fe1..c8f20d1cf0 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -1012,7 +1012,7 @@ static void _origin_freeze(item_def &item, int x, int y)
}
}
-static std::string _origin_monster_name(const item_def &item)
+std::string origin_monster_name(const item_def &item)
{
const int monnum = item.orig_monnum - 1;
if (monnum == MONS_PLAYER_GHOST)
@@ -1022,11 +1022,6 @@ static std::string _origin_monster_name(const item_def &item)
return mons_type_name(monnum, DESC_NOCAP_A);
}
-static std::string _origin_monster_desc(const item_def &item)
-{
- return (_origin_monster_name(item));
-}
-
static std::string _origin_place_desc(const item_def &item)
{
return prep_branch_level_name(item.orig_place);
@@ -1114,7 +1109,7 @@ std::string origin_desc(const item_def &item)
else
{
desc += "You took " + _article_it(item) + " off "
- + _origin_monster_desc(item) + " ";
+ + origin_monster_name(item) + " ";
}
}
else
diff --git a/crawl-ref/source/items.h b/crawl-ref/source/items.h
index b9a9311e73..1be9387d4d 100644
--- a/crawl-ref/source/items.h
+++ b/crawl-ref/source/items.h
@@ -132,6 +132,7 @@ void origin_acquired(item_def &item, int agent);
void origin_set_startequip(item_def &item);
void origin_set_unknown(item_def &item);
void origin_set_inventory( void (*oset)(item_def &item) );
+std::string origin_monster_name(const item_def &item);
bool item_needs_autopickup(const item_def &);
bool can_autopickup();
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index dea0163bad..1d1fed8710 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -1636,7 +1636,7 @@ static std::string _str_monam(const monsters& mon, description_level_type desc,
// If the monster has an explicit name, return that, handling it like
// a unique's name.
- if (!mon.mname.empty())
+ if (desc != DESC_BASENAME && !mon.mname.empty())
return mon.mname;
std::string result;
@@ -1773,10 +1773,10 @@ std::string mons_type_name(int type, description_level_type desc )
result += get_monster_data(type)->name;
// Vowel fix: Change 'a orc' to 'an orc'
- if ( result.length() >= 3
- && (result[0] == 'a' || result[0] == 'A')
- && result[1] == ' '
- && is_vowel(result[2]) )
+ if (result.length() >= 3
+ && (result[0] == 'a' || result[0] == 'A')
+ && result[1] == ' '
+ && is_vowel(result[2]) )
{
result.insert(1, "n");
}
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 7973e56655..22e0b7357a 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -351,6 +351,7 @@ static void _place_monster_corpse(const monsters *monster)
mitm[o].base_type = OBJ_UNASSIGNED;
return;
}
+ origin_set_monster(mitm[o], monster);
// Don't care if 'o' is changed, and it shouldn't be (corpses don't stack).
move_item_to_grid( &o, monster->x, monster->y );
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index 3880f22b79..7c163f1d73 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -466,11 +466,24 @@ static int raise_corpse( int corps, int corx, int cory,
if (!number && zombie_type == MONS_HYDRA)
return (0);
- create_monster(
- mgen_data(
- type, corps_beh, 0,
- coord_def(corx, cory), corps_hit,
- 0, zombie_type, number));
+ int monster = create_monster(
+ mgen_data(
+ type, corps_beh, 0,
+ coord_def(corx, cory), corps_hit,
+ 0, zombie_type, number));
+
+ if (monster != -1)
+ {
+ const int monnum = mitm[corps].orig_monnum - 1;
+ if (mons_is_unique(monnum))
+ {
+ menv[monster].mname = origin_monster_name(mitm[corps]);
+ // Special case for Blork the orc: shorten his name to "Blork"
+ // to avoid mentions of "Blork the orc the orc skeleton".
+ if (monnum == MONS_BLORK_THE_ORC)
+ menv[monster].mname = "Blork";
+ }
+ }
destroy_item(corps);
}