summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-07 11:16:07 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-07 11:16:07 +0000
commita300efc63ded7eca8eaf7cfa74bc7918b1d05a7d (patch)
tree912c91ab46b838e5163dec3715417eea02b98c03
parentc59c58e7a4e34a1f46ece4a45096b955d6caba65 (diff)
downloadcrawl-ref-a300efc63ded7eca8eaf7cfa74bc7918b1d05a7d.tar.gz
crawl-ref-a300efc63ded7eca8eaf7cfa74bc7918b1d05a7d.zip
Removed all uses of str_monam() outside of mon-util.cc; str_monam() is
now static. Some description fixes (mainly for mummies and nagas.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1782 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/beam.cc8
-rw-r--r--crawl-ref/source/dat/descript.txt88
-rw-r--r--crawl-ref/source/debug.cc12
-rw-r--r--crawl-ref/source/delay.cc4
-rw-r--r--crawl-ref/source/describe.cc33
-rw-r--r--crawl-ref/source/direct.cc2
-rw-r--r--crawl-ref/source/fight.cc16
-rw-r--r--crawl-ref/source/files.cc2
-rw-r--r--crawl-ref/source/hiscores.cc2
-rw-r--r--crawl-ref/source/insult.cc4
-rw-r--r--crawl-ref/source/misc.cc2
-rw-r--r--crawl-ref/source/mon-util.cc23
-rw-r--r--crawl-ref/source/mon-util.h4
-rw-r--r--crawl-ref/source/monplace.cc2
-rw-r--r--crawl-ref/source/monspeak.cc2
-rw-r--r--crawl-ref/source/monstuff.cc18
-rw-r--r--crawl-ref/source/mstuff2.cc10
-rw-r--r--crawl-ref/source/spells1.cc2
-rw-r--r--crawl-ref/source/spells2.cc12
-rw-r--r--crawl-ref/source/spells3.cc6
-rw-r--r--crawl-ref/source/spells4.cc14
-rw-r--r--crawl-ref/source/stuff.cc4
22 files changed, 89 insertions, 181 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index bb28e53645..2319a82f22 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -1993,7 +1993,7 @@ int mons_ench_f2(monsters *monster, bolt &pbolt)
case BEAM_INVISIBILITY: /* 5 = invisibility */
// Store the monster name before it becomes an "it" -- bwr
{
- const std::string monster_name = str_monam(*monster, DESC_CAP_THE);
+ const std::string monster_name = monster->name(DESC_CAP_THE);
if (!monster->has_ench(ENCH_INVIS)
&& monster->add_ench(ENCH_INVIS))
@@ -2977,7 +2977,7 @@ static std::string beam_zapper(const bolt &beam)
else if (bsrc == MHITNOT)
return ("");
else
- return str_monam( menv[bsrc], DESC_PLAIN );
+ return menv[bsrc].name(DESC_PLAIN);
}
// return amount of extra range used up by affectation of the player
@@ -3579,7 +3579,7 @@ static int affect_monster(bolt &beam, monsters *mon)
{
mprf(MSGCH_DIAGNOSTICS,
"Monster: %s; Damage: pre-AC: %d; post-AC: %d; post-resist: %d",
- str_monam(*mon, DESC_PLAIN).c_str(),hurt, raw_damage, hurt_final);
+ mon->name(DESC_PLAIN).c_str(), hurt, raw_damage, hurt_final);
}
#endif
@@ -3664,7 +3664,7 @@ static int affect_monster(bolt &beam, monsters *mon)
beam.name.c_str(),
engulfs? "engulfs" : "hits",
player_monster_visible(&menv[tid])?
- str_monam(*mon, DESC_NOCAP_THE).c_str()
+ mon->name(DESC_NOCAP_THE).c_str()
: "something");
}
else
diff --git a/crawl-ref/source/dat/descript.txt b/crawl-ref/source/dat/descript.txt
index 44dd75aca2..5650aceff2 100644
--- a/crawl-ref/source/dat/descript.txt
+++ b/crawl-ref/source/dat/descript.txt
@@ -158,25 +158,6 @@ A wizard who didn't want to die, a Lich is a skeletal, desiccated corpse kept al
mummy
An undead figure covered in bandages and embalming fluids, compelled to walk by an ancient curse. It radiates a malign aura to those who intrude on its domain.
%%%%
-guardian naga
-A hybrid; human from the chest up, with a scaly, muscular torso trailing off like that of a snake.
-
-"The insensible son of Pandu sank down till he reached the Naga kingdom.
-Nagas, furnished with fangs containing virulent venom, bit him by
-thousands. The vegetable poison, mingled in the blood of the son of the
-Wind god, was neutralised by the snake-poison. The serpents had bitten
-all over his frame, except his chest, the skin of which was so tough that
-their fangs could not penetrate it.
-
-"On regaining consciousness, the son of Kunti burst his bands and began
-to press the snakes down under the ground. A remnant fled for life, and
-going to their king Vasuki, represented, 'O king of snakes, a man drowned
-under the water, bound in chords of shrubs; probably he had drunk poison.
-For when he fell amongst us, he was insensible. But when we began to bite
-him, he regained his senses, and bursting his fetters, commenced laying
-at us. May it please Your Majesty to enquire who is.'"
- -_The Mahabharata, Sambhava Parva, Section CXXVIII
-%%%%
ogre
A larger, uglier and fatter relative of orcs and goblins.
%%%%
@@ -685,6 +666,10 @@ spatial vortex
A crazily shifting twist in the fabric of reality.
%%%%
+shuggoth
+
+A vile creature with an elongated head, spiked tail and wicked six-fingered claws. Its awesome strength is matched by its umbrage at being transported to this backwater dimension.
+%%%%
Pit Fiend
A huge winged fiend with incredibly tough skin.
@@ -720,45 +705,6 @@ Gloorx Vloq
A shadowy figure clothed in profound darkness.
%%%%
-naga mage
-
-A hybrid; human from the chest up, with a scaly, muscular torso trailing off like that of a snake.
-
-"The insensible son of Pandu sank down till he reached the Naga kingdom.
-Nagas, furnished with fangs containing virulent venom, bit him by
-thousands. The vegetable poison, mingled in the blood of the son of the
-Wind god, was neutralised by the snake-poison. The serpents had bitten
-all over his frame, except his chest, the skin of which was so tough that
-their fangs could not penetrate it.
-
-"On regaining consciousness, the son of Kunti burst his bands and began
-to press the snakes down under the ground. A remnant fled for life, and
-going to their king Vasuki, represented, 'O king of snakes, a man drowned
-under the water, bound in chords of shrubs; probably he had drunk poison.
-For when he fell amongst us, he was insensible. But when we began to bite
-him, he regained his senses, and bursting his fetters, commenced laying
-at us. May it please Your Majesty to enquire who is.'"
- -_The Mahabharata, Sambhava Parva, Section CXXVIII
-%%%%
-naga warrior
-A hybrid; human from the chest up, with a scaly, muscular torso trailing off like that of a snake.
-
-"The insensible son of Pandu sank down till he reached the Naga kingdom.
-Nagas, furnished with fangs containing virulent venom, bit him by
-thousands. The vegetable poison, mingled in the blood of the son of the
-Wind god, was neutralised by the snake-poison. The serpents had bitten
-all over his frame, except his chest, the skin of which was so tough that
-their fangs could not penetrate it.
-
-"On regaining consciousness, the son of Kunti burst his bands and began
-to press the snakes down under the ground. A remnant fled for life, and
-going to their king Vasuki, represented, 'O king of snakes, a man drowned
-under the water, bound in chords of shrubs; probably he had drunk poison.
-For when he fell amongst us, he was insensible. But when we began to bite
-him, he regained his senses, and bursting his fetters, commenced laying
-at us. May it please Your Majesty to enquire who is.'"
- -_The Mahabharata, Sambhava Parva, Section CXXVIII
-%%%%
orc warlord
A very large and strong looking orc.
@@ -1037,26 +983,6 @@ spectral thing
A hideous glowing apparition.
%%%%
-greater naga
-
-A hybrid; human from the chest up, with a scaly, muscular torso trailing off like that of a snake.
-
-"The insensible son of Pandu sank down till he reached the Naga kingdom.
-Nagas, furnished with fangs containing virulent venom, bit him by
-thousands. The vegetable poison, mingled in the blood of the son of the
-Wind god, was neutralised by the snake-poison. The serpents had bitten
-all over his frame, except his chest, the skin of which was so tough that
-their fangs could not penetrate it.
-
-"On regaining consciousness, the son of Kunti burst his bands and began
-to press the snakes down under the ground. A remnant fled for life, and
-going to their king Vasuki, represented, 'O king of snakes, a man drowned
-under the water, bound in chords of shrubs; probably he had drunk poison.
-For when he fell amongst us, he was insensible. But when we began to bite
-him, he regained his senses, and bursting his fetters, commenced laying
-at us. May it please Your Majesty to enquire who is.'"
- -_The Mahabharata, Sambhava Parva, Section CXXVIII
-%%%%
skeletal dragon
A huge undead abomination, pieced together from the broken bones of many dragons.
@@ -1078,10 +1004,12 @@ guardian mummy
An ancient warrior, embalmed and cursed to walk in undeath for eternity.
%%%%
greater mummy
-A greater mummy.
+
+The embalmed and undead corpse of an ancient ruler.
%%%%
mummy priest
-A mummy priest.
+
+The embalmed and undead corpse of an ancient servant of darkness.
%%%%
centaur warrior
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 5a33f3dd17..82b6741d6a 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -927,7 +927,7 @@ void stethoscope(int mwh)
// print type of monster
mprf(MSGCH_DIAGNOSTICS, "%s (id #%d; type=%d loc=(%d,%d) align=%s)",
- str_monam(menv[i], DESC_CAP_THE, true).c_str(),
+ menv[i].name(DESC_CAP_THE, true).c_str(),
i, menv[i].type, menv[i].x, menv[i].y,
((menv[i].attitude == ATT_FRIENDLY) ? "friendly" :
(menv[i].attitude == ATT_HOSTILE) ? "hostile" :
@@ -963,7 +963,7 @@ void stethoscope(int mwh)
((menv[i].foe == MHITYOU) ? "you" :
(menv[i].foe == MHITNOT) ? "none" :
(menv[menv[i].foe].type == -1) ? "unassigned monster"
- : str_monam(menv[menv[i].foe], DESC_PLAIN, true).c_str()),
+ : menv[menv[i].foe].name(DESC_PLAIN, true).c_str()),
menv[i].foe,
menv[i].foe_memory,
menv[i].target_x, menv[i].target_y );
@@ -1097,7 +1097,7 @@ void debug_item_scan( void )
if (menv[j].inv[k] == i)
{
mprf("Held by monster #%d: %s at (%d,%d)",
- j, str_monam( menv[j], DESC_CAP_A ).c_str(),
+ j, menv[j].name(DESC_CAP_A, true).c_str(),
menv[j].x, menv[j].y );
}
}
@@ -1159,7 +1159,7 @@ void debug_item_scan( void )
if (monster.type == -1)
continue;
- if (str_monam(monster, DESC_PLAIN, true).find("questionable") !=
+ if (monster.name(DESC_PLAIN, true).find("questionable") !=
std::string::npos)
{
mprf( MSGCH_WARN, "Program bug detected!" );
@@ -1697,7 +1697,7 @@ static std::string fsim_time_string()
static void fsim_mon_stats(FILE *o, const monsters &mon)
{
- fprintf(o, "Monster : %s\n", str_monam(mon, DESC_PLAIN, true).c_str());
+ fprintf(o, "Monster : %s\n", mon.name(DESC_PLAIN, true).c_str());
fprintf(o, "HD : %d\n", mon.hit_dice);
fprintf(o, "AC : %d\n", mon.ac);
fprintf(o, "EV : %d\n", mon.ev);
@@ -1709,7 +1709,7 @@ static void fsim_title(FILE *o, int mon, int ms)
fprintf(o, "Combat simulation: %s %s vs. %s (%ld rounds) (%s)\n",
species_name(you.species, you.experience_level),
you.class_name,
- str_monam(menv[mon], DESC_PLAIN, true).c_str(),
+ menv[mon].name(DESC_PLAIN, true).c_str(),
Options.fsim_rounds,
fsim_time_string().c_str());
fprintf(o, "Experience: %d\n", you.experience_level);
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index 0b954b25c5..fc016121d2 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -976,10 +976,10 @@ inline static void monster_warning(activity_interrupt_type ai,
#ifndef DEBUG_DIAGNOSTICS
if (at.context != "uncharm")
mprf(MSGCH_WARN, "%s comes into view.",
- str_monam(*mon, DESC_CAP_A).c_str());
+ mon->name(DESC_CAP_A).c_str());
#else
formatted_string fs( channel_to_colour(MSGCH_WARN) );
- fs.cprintf("%s (", str_monam(*mon, DESC_PLAIN, true).c_str());
+ fs.cprintf("%s (", mon->name(DESC_PLAIN, true).c_str());
fs.add_glyph( mon );
fs.cprintf(") in view: (%d,%d), see_grid: %s",
mon->x, mon->y,
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 1065984586..5fee2d0fd2 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -3537,7 +3537,7 @@ void describe_monsters(monsters& mons)
{
std::ostringstream description;
- description << str_monam( mons, DESC_CAP_A ) << "$$";
+ description << mons.name(DESC_CAP_A) << "$$";
// Note: Nearly all of the "long" descriptions have moved to
// mon-data.h, in an effort to give them some locality with the
@@ -3554,7 +3554,7 @@ void describe_monsters(monsters& mons)
// than what we have today.
//
// -peterb 4/14/07
- description << getLongDescription(str_monam(mons, DESC_PLAIN));
+ description << getLongDescription(mons.name(DESC_PLAIN));
// Now that the player has examined it, he knows it's a mimic.
if (mons_is_mimic(mons.type))
@@ -3574,15 +3574,6 @@ void describe_monsters(monsters& mons)
description << "It smells horrible.";
break;
- case MONS_GREATER_MUMMY:
- description << "The embalmed and undead corpse of an ancient ruler.";
- break;
-
- case MONS_MUMMY_PRIEST:
- description << "The embalmed and undead corpse of an ancient "
- "servant of darkness.";
- break;
-
case MONS_NAGA:
case MONS_NAGA_MAGE:
case MONS_NAGA_WARRIOR:
@@ -3591,17 +3582,21 @@ void describe_monsters(monsters& mons)
switch (mons.type)
{
case MONS_GUARDIAN_NAGA:
- description << "These nagas are "
- "often used as guardians by powerful creatures.";
+ description << getLongDescription("naga")
+ << "$These nagas are often used as guardians "
+ "by powerful creatures.$";
break;
case MONS_GREATER_NAGA:
- description << "It looks strong and aggressive.";
+ description << getLongDescription("naga")
+ << "$It looks strong and aggressive.$";
break;
case MONS_NAGA_MAGE:
- description << "An eldritch nimbus trails its motions.";
+ description << getLongDescription("naga")
+ << "$An eldritch nimbus trails its motions.$";
break;
case MONS_NAGA_WARRIOR:
- description << "It bears scars of many past battles.";
+ description << getLongDescription("naga")
+ << "$It bears scars of many past battles.$";
break;
}
if (you.species == SP_NAGA)
@@ -3660,12 +3655,6 @@ void describe_monsters(monsters& mons)
description << "He smells terrible.";
break;
- case MONS_SHUGGOTH:
- description << "A vile creature with an elongated head, spiked tail "
- "and wicked six-fingered claws. Its awesome strength is matched "
- "by its umbrage at being transported to this backwater dimension.";
- break;
-
case MONS_PROGRAM_BUG:
description << "If this monster is a \"program bug\", then it's "
"recommended that you save your game and reload. Please report "
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc
index 92512cc899..f8cef123fe 100644
--- a/crawl-ref/source/direct.cc
+++ b/crawl-ref/source/direct.cc
@@ -1601,7 +1601,7 @@ static void describe_cell(int mx, int my)
#endif
const int mon_arm = menv[i].inv[MSLOT_ARMOUR];
- mprf("%s.", str_monam(menv[i], DESC_CAP_A).c_str());
+ mprf("%s.", menv[i].name(DESC_CAP_A).c_str());
if (menv[i].type != MONS_DANCING_WEAPON)
describe_monster_weapon(&menv[i]);
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 6a4664513c..8e3a564bdd 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -854,7 +854,7 @@ void melee_attack::player_announce_hit()
verb_degree = " " + verb_degree;
msg::stream << "You " << attack_verb << ' '
- << str_monam(*def, DESC_NOCAP_THE)
+ << def->name(DESC_NOCAP_THE)
<< verb_degree << debug_damage_number()
<< attack_strength_punctuation()
<< std::endl;
@@ -877,7 +877,7 @@ void melee_attack::player_warn_miss()
behaviour_event( def, ME_WHACK, MHITYOU );
msg::stream << player_why_missed()
- << str_monam(*def, DESC_NOCAP_THE)
+ << def->name(DESC_NOCAP_THE)
<< "."
<< std::endl;
}
@@ -2009,7 +2009,7 @@ bool melee_attack::player_check_monster_died()
if (def->type == MONS_GIANT_SPORE || def->type == MONS_BALL_LIGHTNING)
msg::stream << "You " << attack_verb << ' '
- << str_monam(*def, DESC_NOCAP_THE) << '.' << std::endl;
+ << def->name(DESC_NOCAP_THE) << '.' << std::endl;
monster_die(def, KILL_YOU, 0);
return (true);
@@ -3410,29 +3410,29 @@ static void stab_message( struct monsters *defender, int stab_bonus )
if (r<3)
{
mprf( "You strike %s from a blind spot!",
- str_monam(*defender, DESC_NOCAP_THE).c_str() );
+ defender->name(DESC_NOCAP_THE).c_str() );
}
else
{
mprf( "You catch %s momentarily off-guard.",
- str_monam(*defender, DESC_NOCAP_THE).c_str() );
+ defender->name(DESC_NOCAP_THE).c_str() );
}
break;
case 2: // confused/fleeing
if (r<4)
{
mprf( "You catch %s completely off-guard!",
- str_monam(*defender, DESC_NOCAP_THE).c_str() );
+ defender->name(DESC_NOCAP_THE).c_str() );
}
else
{
mprf( "You strike %s from behind!",
- str_monam(*defender, DESC_NOCAP_THE).c_str() );
+ defender->name(DESC_NOCAP_THE).c_str() );
}
break;
case 1:
mprf( "%s fails to defend %s.",
- str_monam(*defender, DESC_CAP_THE).c_str(),
+ defender->name(DESC_CAP_THE).c_str(),
mons_pronoun( defender->type, PRONOUN_REFLEXIVE ) );
break;
} // end switch
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index a0450e8caa..8874815e79 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -929,7 +929,7 @@ static void grab_followers()
#if DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "%s is following.",
- str_monam(*fmenv, DESC_CAP_THE).c_str());
+ fmenv->name(DESC_CAP_THE, true).c_str());
#endif
fmenv->set_transit(level_id::current());
diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc
index 46d59737d2..350d336075 100644
--- a/crawl-ref/source/hiscores.cc
+++ b/crawl-ref/source/hiscores.cc
@@ -807,7 +807,7 @@ void scorefile_entry::init_death_cause(int dam, int dsrc,
auxkilldata = mitm[monster->inv[MSLOT_WEAPON]].name(DESC_NOCAP_A);
}
- death_source_name = str_monam(*monster, DESC_NOCAP_A, true);
+ death_source_name = monster->name(DESC_NOCAP_A, true);
}
}
else
diff --git a/crawl-ref/source/insult.cc b/crawl-ref/source/insult.cc
index 7e721bd540..160ef04a5e 100644
--- a/crawl-ref/source/insult.cc
+++ b/crawl-ref/source/insult.cc
@@ -41,7 +41,7 @@ void init_cap(char * str)
void imp_taunt( const monsters *mons )
{
char buff[80];
- const std::string mon_name = str_monam( *mons, DESC_CAP_THE );
+ const std::string mon_name = mons->name(DESC_CAP_THE);
snprintf( buff, sizeof(buff),
"%s, thou %s!",
@@ -82,7 +82,7 @@ void demon_taunt( const monsters *mons )
};
char buff[80];
- const std::string mon_name = str_monam( *mons, DESC_CAP_THE );
+ const std::string mon_name = mons->name(DESC_CAP_THE);
const char *voice = sound_list[ mons_shouts(mons->type) ];
if (coinflip())
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 52637882e1..988b322a17 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -1939,7 +1939,7 @@ bool i_feel_safe(bool announce)
{
const monsters &m = *mons[0];
mprf(MSGCH_WARN, "Not with %s in view!",
- str_monam(m, DESC_NOCAP_A).c_str());
+ m.name(DESC_NOCAP_A).c_str());
}
else if (mons.size() > 1)
{
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index d26bacc2e6..9f2f83775c 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -1362,8 +1362,8 @@ void define_monster(int index)
mons.enchantments.clear();
} // end define_monster()
-std::string str_monam(const monsters& mon, description_level_type desc,
- bool force_seen)
+static std::string str_monam(const monsters& mon, description_level_type desc,
+ bool force_seen)
{
// Handle non-visible case first
if ( !force_seen && !player_monster_visible(&mon) )
@@ -1375,7 +1375,6 @@ std::string str_monam(const monsters& mon, description_level_type desc,
case DESC_NOCAP_THE: case DESC_NOCAP_A: case DESC_PLAIN:
return "it";
default:
- mpr("XXX OOPS!", MSGCH_DIAGNOSTICS);
return "it (buggy)";
}
}
@@ -2839,23 +2838,19 @@ item_def *monsters::shield()
std::string monsters::name(description_level_type desc) const
{
+ return this->name(desc, false);
+}
+
+std::string monsters::name(description_level_type desc, bool force_vis) const
+{
const bool possessive =
(desc == DESC_NOCAP_YOUR || desc == DESC_NOCAP_ITS);
if (possessive)
desc = DESC_NOCAP_THE;
- std::string mname = str_monam(*this, desc);
- return (possessive? apostrophise(mname) : mname);
-}
-std::string monsters::name(description_level_type desc, bool force_vis) const
-{
- if (!force_vis || !has_ench(ENCH_INVIS))
- return (name(desc));
-
- monsters m = *this;
- m.del_ench(ENCH_INVIS, true);
- return (m.name(desc));
+ std::string mname = str_monam(*this, desc, force_vis);
+ return (possessive? apostrophise(mname) : mname);
}
std::string monsters::pronoun(pronoun_type pro) const
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index b4d58cbfb1..e5252b3ba3 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -121,10 +121,6 @@ struct monsterentry
* *********************************************************************** */
void init_monsters( FixedVector<unsigned short, 1000>& colour );
-// this is the old monam(), ptr_monam()
-std::string str_monam(const monsters& mon, description_level_type desc,
- bool force_seen = false);
-
// this is the old moname()
std::string mons_type_name(int type, description_level_type desc );
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index 3410ee40fb..1e9b55aa44 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -401,7 +401,7 @@ bool place_monster(int &id, int mon_type, int power, beh_type behaviour,
std::string msg;
if (player_monster_visible( &menv[id] ))
- msg = str_monam( menv[id], DESC_CAP_A );
+ msg = menv[id].name(DESC_CAP_A);
else if (shoved)
msg = "Something";
diff --git a/crawl-ref/source/monspeak.cc b/crawl-ref/source/monspeak.cc
index 8459ff91e7..a0441ea42c 100644
--- a/crawl-ref/source/monspeak.cc
+++ b/crawl-ref/source/monspeak.cc
@@ -156,7 +156,7 @@ bool mons_speaks(const monsters *monster)
// danger warning... everything else just goes into the talk channel -- bwr
msg_channel_type msg_type = MSGCH_TALK;
- const std::string m_name = str_monam(*monster, DESC_CAP_THE);
+ const std::string m_name = monster->name(DESC_CAP_THE);
strcpy(info, m_name.c_str());
if (monster->has_ench(ENCH_INVIS))
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index c72bc762e5..b8f55d54f4 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -391,7 +391,7 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent)
{
take_note(Note(NOTE_KILL_MONSTER,
monster->type, mons_friendly(monster),
- str_monam(*monster, DESC_NOCAP_A, true).c_str()));
+ monster->name(DESC_NOCAP_A, true).c_str()));
}
}
@@ -516,7 +516,7 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent)
{
mprf(MSGCH_MONSTER_DAMAGE, MDAM_DEAD, "You %s %s!",
wounded_damaged(monster->type) ? "destroy" : "kill",
- str_monam(*monster, DESC_NOCAP_THE).c_str());
+ monster->name(DESC_NOCAP_THE).c_str());
}
if (!created_friendly)
@@ -1074,7 +1074,7 @@ bool monster_polymorph( monsters *monster, monster_type targetc,
&& MONST_INTERESTING(monster))
{
take_note(Note(NOTE_POLY_MONSTER, monster->type, 0,
- str_monam(*monster, DESC_NOCAP_A, true).c_str()));
+ monster->name(DESC_NOCAP_A, true).c_str()));
}
// messaging: {dlb}
@@ -1868,7 +1868,7 @@ bool simple_monster_message(const monsters *monster, const char *event,
{
char buff[INFO_SIZE];
snprintf( buff, sizeof(buff), "%s%s",
- str_monam(*monster, descrip).c_str(), event );
+ monster->name(descrip).c_str(), event );
mpr( buff, channel, param );
return (true);
@@ -4079,7 +4079,7 @@ static bool monster_swaps_places( monsters *mon, int mx, int my )
#ifdef DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS,
"Alerting monster %s at (%d,%d)",
- str_monam(*m2, DESC_PLAIN).c_str(), m2->x, m2->y);
+ m2->name(DESC_PLAIN).c_str(), m2->x, m2->y);
#endif
behaviour_event( m2, ME_ALERT, MHITNOT );
}
@@ -4182,7 +4182,7 @@ void mons_check_pool(monsters *mons, killer_type killer)
// see if something has fallen into the lava
if (message)
mprf("%s falls into the %s!",
- str_monam(*mons, DESC_CAP_THE).c_str(),
+ mons->name(DESC_CAP_THE).c_str(),
(grid == DNGN_LAVA ? "lava" : "water"));
if (grid == DNGN_LAVA && mons_res_fire(mons) > 0)
@@ -4690,7 +4690,7 @@ forget_it:
#if DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS,
"%s is skipping movement in order to follow.",
- str_monam( *monster, DESC_CAP_THE ).c_str() );
+ monster->name(DESC_CAP_THE).c_str() );
#endif
mmov_x = 0;
mmov_y = 0;
@@ -5041,7 +5041,7 @@ bool message_current_target()
{
mprf( MSGCH_PROMPT, "Current target: %s "
"(use p/t/f to fire at it again.)",
- str_monam(*montarget, DESC_PLAIN).c_str() );
+ montarget->name(DESC_PLAIN).c_str() );
return (true);
}
@@ -5167,7 +5167,7 @@ void seen_monster(monsters *monster)
{
take_note(
Note(NOTE_SEEN_MONSTER, monster->type, 0,
- str_monam(*monster, DESC_NOCAP_A).c_str()));
+ monster->name(DESC_NOCAP_A).c_str()));
}
}
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc
index a2a9119591..74445a69d8 100644
--- a/crawl-ref/source/mstuff2.cc
+++ b/crawl-ref/source/mstuff2.cc
@@ -181,7 +181,7 @@ void mons_trap(struct monsters *monster)
if (player_monster_visible( monster ))
{
msg += " and slices into ";
- msg += str_monam( *monster, DESC_NOCAP_THE );
+ msg += monster->name(DESC_NOCAP_THE);
}
msg += "!";
mpr(msg.c_str());
@@ -291,7 +291,7 @@ void mons_trap(struct monsters *monster)
mprf("A%s %s %s%s!",
beem.name.c_str(),
(damage_taken >= 0) ? "hits" : "misses",
- str_monam( *monster, DESC_NOCAP_THE ).c_str(),
+ monster->name(DESC_NOCAP_THE).c_str(),
(damage_taken == 0) ? ", but does no damage" : "");
}
@@ -1204,7 +1204,7 @@ bool mons_throw(struct monsters *monster, struct bolt &pbolt, int hand_used)
// now, if a monster is, for some reason, throwing something really
// stupid, it will have baseHit of 0 and damage of 0. Ah well.
- std::string msg = str_monam(*monster, DESC_CAP_THE);
+ std::string msg = monster->name(DESC_CAP_THE);
msg += ((projected == LRET_LAUNCHED) ? " shoots " : " throws ");
if (!pbolt.name.empty())
@@ -1230,13 +1230,13 @@ bool mons_throw(struct monsters *monster, struct bolt &pbolt, int hand_used)
{
snprintf( throw_buff, sizeof(throw_buff), "Shot with a%s %s by %s",
(is_vowel(pbolt.name[0]) ? "n" : ""), pbolt.name.c_str(),
- str_monam( *monster, DESC_NOCAP_A ).c_str() );
+ monster->name(DESC_NOCAP_A).c_str() );
}
else
{
snprintf( throw_buff, sizeof(throw_buff), "Hit by a%s %s thrown by %s",
(is_vowel(pbolt.name[0]) ? "n" : ""), pbolt.name.c_str(),
- str_monam( *monster, DESC_NOCAP_A ).c_str() );
+ monster->name(DESC_NOCAP_A).c_str() );
}
pbolt.aux_source = throw_buff;
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index e78ef07a83..8989a0b238 100644
--- a/crawl-ref/source/spells1.cc
+++ b/crawl-ref/source/spells1.cc
@@ -536,7 +536,7 @@ static int healing_spell( int healed )
if (heal_monster(monster, healed, false))
{
- mprf("You heal %s.", str_monam( *monster, DESC_NOCAP_THE ).c_str());
+ mprf("You heal %s.", monster->name(DESC_NOCAP_THE).c_str());
if (monster->hit_points == monster->max_hit_points)
simple_monster_message( monster, " is completely healed." );
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index 1752ae6405..981ca972cc 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -836,7 +836,7 @@ void cast_toxic_radiance(void)
{
// message player re:"miss" where appropriate {dlb}
mprf("The light passes through %s.",
- str_monam( *monster, DESC_NOCAP_THE ).c_str());
+ monster->name(DESC_NOCAP_THE).c_str());
}
}
}
@@ -886,7 +886,7 @@ void cast_refrigeration(int pow)
if (mons_near(monster))
{
mprf("You freeze %s.",
- str_monam(*monster, DESC_NOCAP_THE).c_str());
+ monster->name(DESC_NOCAP_THE).c_str());
hurted = roll_dice( dam_dice );
hurted = mons_adjust_flavoured( monster, beam, hurted );
@@ -944,7 +944,7 @@ void drain_life(int pow)
if (mons_near(monster))
{
mprf("You draw life from %s.",
- str_monam(*monster, DESC_NOCAP_THE).c_str());
+ monster->name(DESC_NOCAP_THE).c_str());
hurted = 3 + random2(7) + random2(pow);
@@ -1020,7 +1020,7 @@ int vampiric_drain(int pow, const dist &vmove)
hurt_monster(monster, inflicted);
mprf("You feel life coursing from %s into your body!",
- str_monam( *monster, DESC_NOCAP_THE ).c_str());
+ monster->name(DESC_NOCAP_THE).c_str());
print_wounds(monster);
@@ -1077,11 +1077,11 @@ char burn_freeze(int pow, char flavour)
(flavour == BEAM_MISSILE) ? "crush" :
(flavour == BEAM_ELECTRICITY) ? "zap"
: "______",
- str_monam( *monster, DESC_NOCAP_THE ).c_str());
+ monster->name(DESC_NOCAP_THE).c_str());
int hurted = roll_dice( 1, 3 + pow / 3 );
- struct bolt beam;
+ bolt beam;
beam.flavour = flavour;
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index e068bda7f8..fff5a799d3 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -203,10 +203,10 @@ int cast_smiting(int power, dist &beam)
{
monster = &menv[mgrd[beam.tx][beam.ty]];
- mprf("You smite %s!", str_monam( *monster, DESC_NOCAP_THE ).c_str());
+ mprf("You smite %s!", monster->name(DESC_NOCAP_THE).c_str());
// Maxes out at around 40 damage at 27 Invocations, which is plenty
- // in my book (the old max damage was around 70, which seems excessive.
+ // in my book (the old max damage was around 70, which seems excessive)
hurt_monster(monster, 7 + (random2(power) * 33 / 191));
if (monster->hit_points < 1)
@@ -236,7 +236,7 @@ int airstrike(int power, dist &beam)
monster = &menv[mgrd[beam.tx][beam.ty]];
mprf("The air twists around and strikes %s!",
- str_monam( *monster, DESC_NOCAP_THE ).c_str());
+ monster->name(DESC_NOCAP_THE).c_str());
hurted = 8 + random2( random2(4) + (random2(power) / 6)
+ (random2(power) / 7) );
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index 0201207e34..96530f662e 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -1269,7 +1269,7 @@ static int discharge_monsters( int x, int y, int pow, int garbage )
if (damage)
{
mprf( "%s is struck by lightning.",
- str_monam( menv[mon], DESC_CAP_THE).c_str());
+ menv[mon].name(DESC_CAP_THE).c_str());
player_hurt_monster( mon, damage );
}
}
@@ -1373,13 +1373,13 @@ static int distortion_monsters(int x, int y, int pow, int message)
else if (coinflip())
{
mprf("Space bends around %s.",
- str_monam(*defender, DESC_NOCAP_THE).c_str());
+ defender->name(DESC_NOCAP_THE).c_str());
specdam += 1 + random2avg( 7, 2 ) + random2(pow) / 40;
}
else if (coinflip())
{
mprf("Space warps horribly around %s!",
- str_monam(*defender, DESC_NOCAP_THE ).c_str());
+ defender->name(DESC_NOCAP_THE).c_str());
specdam += 3 + random2avg( 12, 2 ) + random2(pow) / 25;
}
else if (one_chance_in(3))
@@ -1779,7 +1779,7 @@ static int glamour_monsters(int x, int y, int pow, int garbage)
// why no, there's no message as to which effect happened >:^)
if (!one_chance_in(4))
{
- std::string msg = str_monam(menv[mon], DESC_CAP_THE);
+ std::string msg = menv[mon].name(DESC_CAP_THE);
switch (random2(4))
{
@@ -2300,7 +2300,7 @@ static int snake_charm_monsters(int x, int y, int pow, int message)
if (check_mons_resist_magic(&menv[mon], pow)) return 0;
menv[mon].attitude = ATT_FRIENDLY;
- mprf("%s sways back and forth.",str_monam(menv[mon],DESC_CAP_THE).c_str());
+ mprf("%s sways back and forth.", menv[mon].name(DESC_CAP_THE).c_str());
return 1;
}
@@ -2358,7 +2358,7 @@ void cast_fragmentation(int pow) // jmf: ripped idea from airstrike
char explode_msg[80];
snprintf( explode_msg, sizeof( explode_msg ), "%s explodes!",
- str_monam( menv[mon], DESC_CAP_THE ).c_str() );
+ menv[mon].name(DESC_CAP_THE).c_str() );
switch (menv[mon].type)
{
@@ -2921,7 +2921,7 @@ int cast_apportation(int pow)
mpr( "There are no items there." );
else if (mons_is_mimic( menv[ mon ].type ))
{
- mprf("%s twitches.", str_monam(menv[mon], DESC_CAP_THE).c_str());
+ mprf("%s twitches.", menv[mon].name(DESC_CAP_THE).c_str());
}
else
mpr( "This spell does not work on creatures." );
diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc
index 3e1187d79f..1a622937d6 100644
--- a/crawl-ref/source/stuff.cc
+++ b/crawl-ref/source/stuff.cc
@@ -142,7 +142,7 @@ void tag_followers( void )
#if DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "%s is marked for following.",
- str_monam( *fmenv, DESC_CAP_THE ).c_str() );
+ fmenv->name(DESC_CAP_THE, true).c_str() );
#endif
}
}
@@ -1116,7 +1116,7 @@ void zap_los_monsters()
#ifdef DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "Dismissing %s",
- str_monam(*mon, DESC_PLAIN).c_str() );
+ mon->name(DESC_PLAIN, true).c_str() );
#endif
monster_die(mon, KILL_DISMISSED, 0);
}