summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-11 15:15:23 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-11 15:15:23 +0000
commit849424e409cebbd7f4bed89f3e229e8dc6803eeb (patch)
tree1bea8762abfadf3840785e3c34c2ceab8c083ecb
parentf51fc3911ca9e3f26839513f9ea39a3484f15633 (diff)
downloadcrawl-ref-849424e409cebbd7f4bed89f3e229e8dc6803eeb.tar.gz
crawl-ref-849424e409cebbd7f4bed89f3e229e8dc6803eeb.zip
[1808191] Fixed truncated imp messages.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2429 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/dat/shout.txt2
-rw-r--r--crawl-ref/source/direct.cc12
-rw-r--r--crawl-ref/source/fight.cc4
-rw-r--r--crawl-ref/source/insult.cc1
-rw-r--r--crawl-ref/source/mon-util.cc19
-rw-r--r--crawl-ref/source/mon-util.h4
6 files changed, 20 insertions, 22 deletions
diff --git a/crawl-ref/source/dat/shout.txt b/crawl-ref/source/dat/shout.txt
index 3c00797c17..491b36b8bb 100644
--- a/crawl-ref/source/dat/shout.txt
+++ b/crawl-ref/source/dat/shout.txt
@@ -243,7 +243,7 @@ imp
# Shout one half the time, taunt the other half.
@__SHOUT@
-@The_monster@ @says@: @imp_taunt@
+@The_monster@ @says@, "@imp_taunt@"
%%%%
shadow imp
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc
index 40f16abf09..5c98b25623 100644
--- a/crawl-ref/source/direct.cc
+++ b/crawl-ref/source/direct.cc
@@ -1857,13 +1857,13 @@ static void describe_monster(const monsters *mon)
if (mon->behaviour == BEH_SLEEP)
{
mprf(MSGCH_EXAMINE, "%s appears to be resting.",
- mons_pronoun(mon->type, PRONOUN_CAP));
+ mon->pronoun(PRONOUN_CAP).c_str());
}
// Applies to both friendlies and hostiles
else if (mon->behaviour == BEH_FLEE)
{
mprf(MSGCH_EXAMINE, "%s is retreating.",
- mons_pronoun(mon->type, PRONOUN_CAP));
+ mon->pronoun(PRONOUN_CAP).c_str());
}
// hostile with target != you
else if (!mons_friendly(mon) && mon->foe != MHITYOU)
@@ -1873,17 +1873,17 @@ static void describe_monster(const monsters *mon)
if (!testbits(mon->flags, MF_BATTY))
{
mprf(MSGCH_EXAMINE, "%s doesn't appear to have noticed you.",
- mons_pronoun(mon->type, PRONOUN_CAP));
+ mon->pronoun(PRONOUN_CAP).c_str());
}
}
}
if (mon->attitude == ATT_FRIENDLY)
mprf(MSGCH_EXAMINE, "%s is friendly.",
- mons_pronoun(mon->type, PRONOUN_CAP));
+ mon->pronoun(PRONOUN_CAP).c_str());
else if (mon->attitude == ATT_NEUTRAL)
mprf(MSGCH_EXAMINE, "%s is indifferent to you.",
- mons_pronoun(mon->type, PRONOUN_CAP));
+ mon->pronoun(PRONOUN_CAP).c_str());
std::string desc = "";
std::string last_desc = "";
@@ -1915,7 +1915,7 @@ static void describe_monster(const monsters *mon)
if (!desc.empty())
{
- text = mons_pronoun(mon->type, PRONOUN_CAP);
+ text = mon->pronoun(PRONOUN_CAP);
text += " is ";
text += desc;
text += ".";
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index a9dcc7c14e..69560b7187 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -3758,8 +3758,8 @@ static void stab_message( struct monsters *defender, int stab_bonus )
break;
case 1:
mprf( "%s fails to defend %s.",
- defender->name(DESC_CAP_THE).c_str(),
- mons_pronoun( defender->type, PRONOUN_REFLEXIVE ) );
+ defender->name(DESC_CAP_THE).c_str(),
+ defender->pronoun(PRONOUN_REFLEXIVE).c_str() );
break;
} // end switch
}
diff --git a/crawl-ref/source/insult.cc b/crawl-ref/source/insult.cc
index 24bbd93f0b..1c7384aaac 100644
--- a/crawl-ref/source/insult.cc
+++ b/crawl-ref/source/insult.cc
@@ -45,7 +45,6 @@ std::string imp_taunt_str()
"%s, thou %s!",
random2(7) ? run_away() : give_up(),
generic_insult() );
-
init_cap( buff );
return (buff);
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index c072eef980..7391bc244f 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -2149,9 +2149,9 @@ bool mons_has_ranged_attack( const monsters *mon )
// 3 : It sticks to her sword! (lower case possessive)
// ... as needed
-const char *mons_pronoun(int mon_type, int variant)
+const char *mons_pronoun(monster_type mon_type, pronoun_type variant)
{
- int gender = GENDER_NEUTER;
+ gender_type gender = GENDER_NEUTER;
if (mons_is_unique( mon_type ) && mon_type != MONS_PLAYER_GHOST)
{
@@ -3260,7 +3260,7 @@ std::string monsters::name(description_level_type desc, bool force_vis) const
std::string monsters::pronoun(pronoun_type pro) const
{
- return (mons_pronoun(type, pro));
+ return (mons_pronoun(static_cast<monster_type>(type), pro));
}
std::string monsters::conj_verb(const std::string &verb) const
@@ -5093,11 +5093,10 @@ void mon_enchant::set_duration(const monsters *mons, const mon_enchant *added)
// Replaces the "@foo@" strings in monster shout and monster speak
// definitions.
-std::string do_mon_str_replacements(const std::string in_msg,
+std::string do_mon_str_replacements(const std::string &in_msg,
const monsters* monster)
{
std::string msg = in_msg;
-
description_level_type nocap, cap;
if (monster->attitude == ATT_FRIENDLY && player_monster_visible(monster))
@@ -5173,14 +5172,14 @@ std::string do_mon_str_replacements(const std::string in_msg,
msg = replace_all(msg, "@A_monster@", monster->name(DESC_CAP_A));
msg = replace_all(msg, "@The_monster@", monster->name(cap));
+ msg = replace_all(msg, "@Pronoun@",
+ monster->pronoun(PRONOUN_CAP));
msg = replace_all(msg, "@pronoun@",
- mons_pronoun(monster->type, 0));
- msg = replace_all(msg, "@pronoun@",
- mons_pronoun(monster->type, 1));
+ monster->pronoun(PRONOUN_NOCAP));
msg = replace_all(msg, "@Possessive@",
- mons_pronoun(monster->type, 2));
+ monster->pronoun(PRONOUN_CAP_POSSESSIVE));
msg = replace_all(msg, "@possessive@",
- mons_pronoun(monster->type, 3));
+ monster->pronoun(PRONOUN_NOCAP_POSSESSIVE));
msg = replace_all(msg, "@imp_taunt@", imp_taunt_str());
msg = replace_all(msg, "@demon_taunt@", demon_taunt_str());
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index 68659bd890..a519bee1d9 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -539,7 +539,7 @@ bool mons_is_magic_user( const monsters *mon );
/* ***********************************************************************
* called from:
* *********************************************************************** */
-const char *mons_pronoun(int mon_type, int variant);
+const char *mons_pronoun(monster_type mon_type, pronoun_type variant);
// last updated 14mar2001 (gdl)
/* ***********************************************************************
@@ -598,7 +598,7 @@ monster_type random_monster_at_grid(int grid);
monster_type get_monster_by_name(std::string name, bool exact = false);
-std::string do_mon_str_replacements(const std::string msg,
+std::string do_mon_str_replacements(const std::string &msg,
const monsters* monster);
enum mon_body_shape {