summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-09 03:41:34 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-09 03:41:34 +0000
commitc15760bd3d76ec0e893e21cdf4793936102f1fa6 (patch)
tree6344396817beac9848aec8bf149d6466a906dc71 /crawl-ref
parent7ea1d488da8e25508c91a9fdd315db4d232e70ad (diff)
downloadcrawl-ref-c15760bd3d76ec0e893e21cdf4793936102f1fa6.tar.gz
crawl-ref-c15760bd3d76ec0e893e21cdf4793936102f1fa6.zip
Fix the name of Lernaean hydra zombies by adding special handling for named
hydras; kind of hackish. During arena mode don't give "You see a puff of smoke" message if the arena vetoed the placement of a monster, don't brand item stacks, and always use full names for zombified uniques. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8348 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/mon-util.cc68
-rw-r--r--crawl-ref/source/monplace.cc5
-rw-r--r--crawl-ref/source/view.cc5
3 files changed, 54 insertions, 24 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 43da96b512..a19d3a1aab 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -987,6 +987,9 @@ bool name_zombified_unique(monsters *mon, int mc, const std::string mon_name)
// to avoid mentions of e.g "Blork the orc the orc zombie".
if (mc == MONS_BLORK_THE_ORC)
mon->mname = "Blork";
+ // Also for the Lernaean hydra.
+ else if (mc == MONS_LERNAEAN_HYDRA)
+ mon->mname = "Lernaean hydra";
return (true);
}
@@ -1984,10 +1987,30 @@ static std::string _str_monam(const monsters& mon, description_level_type desc,
if (mon.type == MONS_PLAYER_GHOST)
return apostrophise(mon.mname) + " ghost";
+ // Some monsters might want the name of a different creature.
+ int nametype = mon.type;
+
+ // Tack on other prefixes.
+ switch (mon.type)
+ {
+ case MONS_ZOMBIE_SMALL: case MONS_ZOMBIE_LARGE:
+ case MONS_SKELETON_SMALL: case MONS_SKELETON_LARGE:
+ case MONS_SIMULACRUM_SMALL: case MONS_SIMULACRUM_LARGE:
+ case MONS_SPECTRAL_THING:
+ nametype = mon.base_monster;
+ break;
+
+ default:
+ break;
+ }
+
// If the monster has an explicit name, return that, handling it like
- // a unique's name.
- if (desc != DESC_BASENAME && !mon.mname.empty())
+ // a unique's name. Special handling for named hydras.
+ if (desc != DESC_BASENAME && !mon.mname.empty()
+ && mons_genus(nametype) != MONS_HYDRA)
+ {
return mon.mname;
+ }
std::string result;
@@ -1995,7 +2018,8 @@ static std::string _str_monam(const monsters& mon, description_level_type desc,
// Start with the prefix.
// (Uniques don't get this, because their names are proper nouns.)
- if (!mons_is_unique(mon.type))
+ if (!mons_is_unique(nametype)
+ && (mon.mname.empty() || mons_genus(nametype) == MONS_HYDRA))
{
const bool use_your = mons_friendly(&mon);
switch (desc)
@@ -2007,38 +2031,31 @@ static std::string _str_monam(const monsters& mon, description_level_type desc,
result = (use_your ? "your " : "the ");
break;
case DESC_CAP_A:
- result = "A ";
+ if (mon.mname.empty())
+ result = "A ";
+ else
+ result = "The ";
break;
case DESC_NOCAP_A:
- result = "a ";
+ if (mon.mname.empty())
+ result = "a ";
+ else
+ result = "the ";
break;
case DESC_PLAIN:
default:
break;
}
}
- else
- {
- }
if (arena_submerged)
result += "submerged ";
- // Some monsters might want the name of a different creature.
- int nametype = mon.type;
-
// Tack on other prefixes.
switch (mon.type)
{
case MONS_SPECTRAL_THING:
result += "spectral ";
- nametype = mon.base_monster;
- break;
-
- case MONS_ZOMBIE_SMALL: case MONS_ZOMBIE_LARGE:
- case MONS_SKELETON_SMALL: case MONS_SKELETON_LARGE:
- case MONS_SIMULACRUM_SMALL: case MONS_SIMULACRUM_LARGE:
- nametype = mon.base_monster;
break;
case MONS_DRACONIAN_CALLER:
@@ -2085,13 +2102,13 @@ static std::string _str_monam(const monsters& mon, description_level_type desc,
result += "-headed ";
}
- if (nametype == MONS_LERNAEAN_HYDRA)
+ if (!mon.mname.empty())
+ result += mon.mname;
+ else if (nametype == MONS_LERNAEAN_HYDRA)
result += "Lernaean hydra";
else
- {
// Add the base name.
result += get_monster_data(nametype)->name;
- }
// Add suffixes.
switch (mon.type)
@@ -5111,8 +5128,11 @@ std::string monsters::name(description_level_type desc, bool force_vis) const
desc = DESC_NOCAP_THE;
std::string monnam;
- if ((flags & MF_NAME_MASK) && (force_vis || you.can_see(this)))
+ if ((flags & MF_NAME_MASK) && (force_vis || you.can_see(this))
+ || crawl_state.arena && mons_class_is_zombified(type))
+ {
monnam = full_name(desc);
+ }
else
monnam = _str_monam(*this, desc, force_vis);
@@ -5137,6 +5157,10 @@ std::string monsters::full_name(description_level_type desc,
{
std::string title = _str_monam(*this, desc, true);
+ const int _type = mons_is_zombified(this) ? base_monster : type;
+ if (mons_genus(_type) == MONS_HYDRA)
+ return (title);
+
if (has_base_name())
{
const unsigned long flag = flags & MF_NAME_MASK;
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index 01556be79b..8032d753c9 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -2430,7 +2430,12 @@ int create_monster(mgen_data mg, bool fail_msg)
}
if (in_bounds(mg.pos))
+ {
summd = mons_place(mg);
+ // If the arena vetoed the placement then give no fail message.
+ if (crawl_state.arena)
+ fail_msg = false;
+ }
// Determine whether creating a monster is successful (summd != -1) {dlb}:
// then handle the outcome. {dlb}:
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 465f294115..40d8f5ca40 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -855,7 +855,8 @@ int get_mons_colour(const monsters *mons)
col |= COLFLAG_FEATURE_ITEM;
}
else if (Options.heap_brand != CHATTR_NORMAL
- && igrd(mons->pos()) != NON_ITEM)
+ && igrd(mons->pos()) != NON_ITEM
+ && !crawl_state.arena)
{
col |= COLFLAG_ITEM_HEAP;
}
@@ -1466,7 +1467,7 @@ inline static void _update_item_grid(const coord_def &gp, const coord_def &ep)
const unsigned short gcol = env.grid_colours(gp);
ecol = (grid == DNGN_SHALLOW_WATER) ?
(gcol != BLACK ? gcol : CYAN) : eitem.colour;
- if (eitem.link != NON_ITEM)
+ if (eitem.link != NON_ITEM && !crawl_state.arena)
ecol |= COLFLAG_ITEM_HEAP;
env.show(ep) = _get_item_dngn_code( eitem );
}