summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-25 11:48:21 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-25 11:48:21 +0000
commitfd7dc681f01391fac151867b2d9152d7795c6e76 (patch)
tree136453f8c9bb22855d1a7a2f8e07bf98e077ac68
parent5e50467df71766be3f79b72d59f93c797164834f (diff)
downloadcrawl-ref-fd7dc681f01391fac151867b2d9152d7795c6e76.tar.gz
crawl-ref-fd7dc681f01391fac151867b2d9152d7795c6e76.zip
Mention named orcs' base type in the monster descriptions.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5231 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/beam.cc25
-rw-r--r--crawl-ref/source/delay.cc14
-rw-r--r--crawl-ref/source/directn.cc10
-rw-r--r--crawl-ref/source/monstuff.cc2
-rw-r--r--crawl-ref/source/spl-util.cc2
5 files changed, 35 insertions, 18 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index cec3294896..9fc6b6350a 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -681,7 +681,6 @@ bool player_tracer( zap_type ztype, int power, bolt &pbolt, int range)
pbolt.is_tracer = true;
pbolt.source_x = you.x_pos;
pbolt.source_y = you.y_pos;
- pbolt.beam_source = 0;
pbolt.can_see_invis = player_see_invis();
pbolt.smart_monster = true;
pbolt.attitude = ATT_FRIENDLY;
@@ -1749,8 +1748,8 @@ void fire_beam( bolt &pbolt, item_def *item, bool drop_item )
if (item && !pbolt.is_tracer)
{
tile_beam = tileidx_item_throw(*item,
- pbolt.target_x-pbolt.source_x,
- pbolt.target_y-pbolt.source_y);
+ pbolt.target_x - pbolt.source_x,
+ pbolt.target_y - pbolt.source_y);
}
#endif
@@ -1874,6 +1873,7 @@ void fire_beam( bolt &pbolt, item_def *item, bool drop_item )
if (rangeRemaining < 1)
break;
+
tx = ray.x();
ty = ray.y();
} // end else - beam doesn't affect walls
@@ -1900,7 +1900,7 @@ void fire_beam( bolt &pbolt, item_def *item, bool drop_item )
// hit and the beam is type 'term on target'.
if (!beamTerminate || !pbolt.is_explosion)
{
- // random beams: randomize before affect
+ // Random beams: randomize before affect().
bool random_beam = false;
if (pbolt.flavour == BEAM_RANDOM)
{
@@ -2746,13 +2746,13 @@ void _sticky_flame_monster( int mn, kill_category who, int levels )
* fr_power, foe_power: a measure of how many 'friendly' hit dice it will
* affect, and how many 'unfriendly' hit dice.
*
- * note that beam properties must be set, as the tracer will take them
+ * Note that beam properties must be set, as the tracer will take them
* into account, as well as the monster's intelligence.
*
*/
void fire_tracer(const monsters *monster, bolt &pbolt)
{
- // don't fiddle with any input parameters other than tracer stuff!
+ // Don't fiddle with any input parameters other than tracer stuff!
pbolt.is_tracer = true;
pbolt.source_x = monster->x; // always safe to do.
pbolt.source_y = monster->y;
@@ -2761,7 +2761,7 @@ void fire_tracer(const monsters *monster, bolt &pbolt)
pbolt.smart_monster = (mons_intel(monster->type) >= I_NORMAL);
pbolt.attitude = mons_attitude(monster);
- // init tracer variables
+ // Init tracer variables.
pbolt.foe_count = pbolt.fr_count = 0;
pbolt.foe_power = pbolt.fr_power = 0;
pbolt.fr_helped = pbolt.fr_hurt = 0;
@@ -3108,8 +3108,8 @@ int affect(bolt &beam, int x, int y, item_def *item)
// aimed at that spot.
if (mon->alive()
&& (!mon->submerged()
- || (beam.aimed_at_spot && beam.target() == mon->pos()
- && grd(mon->pos()) == DNGN_SHALLOW_WATER)))
+ || beam.aimed_at_spot && beam.target() == mon->pos()
+ && grd(mon->pos()) == DNGN_SHALLOW_WATER))
{
if (!beam.is_big_cloud
&& (!beam.is_explosion || beam.in_explosion_phase))
@@ -3471,8 +3471,10 @@ static void _beam_ouch( int dam, bolt &beam )
if (beam.flavour == BEAM_SPORE)
ouch( dam, beam.beam_source, KILLED_BY_SPORE );
else
+ {
ouch( dam, beam.beam_source, KILLED_BY_BEAM,
beam.aux_source.c_str() );
+ }
}
else // KILL_MISC || (YOU_KILL && aux_source)
{
@@ -3623,7 +3625,7 @@ static int _affect_player( bolt &beam, item_def *item )
}
else if (_beam_is_blockable(beam))
{
- // non-beams can be blocked or dodged
+ // Non-beams can be blocked or dodged.
if (you.equip[EQ_SHIELD] != -1
&& !beam.aimed_at_feet
&& player_shield_class() > 0)
@@ -4614,6 +4616,7 @@ static int _affect_monster(bolt &beam, monsters *mon, item_def *item)
engulfs? "engulfs" : "hits",
player_monster_visible(&menv[tid]) ?
mon->name(DESC_NOCAP_THE).c_str() : "something");
+
}
else
{
@@ -4676,7 +4679,7 @@ static int _affect_monster(bolt &beam, monsters *mon, item_def *item)
_sticky_flame_monster( tid, _whose_kill(beam), levels );
}
- /* looks for missiles which aren't poison but are poison*ed* */
+ /* Look for missiles which aren't poison but are poison*ed*. */
if (item)
{
if (item->base_type == OBJ_MISSILES
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index da87dfe510..2bfccaaab6 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -1542,7 +1542,7 @@ inline static void monster_warning(activity_interrupt_type ai,
const activity_interrupt_data &at,
int atype)
{
- if ( ai == AI_SEE_MONSTER && is_run_delay(atype) )
+ if (ai == AI_SEE_MONSTER && is_run_delay(atype))
{
const monsters* mon = static_cast<const monsters*>(at.data);
if (!mon->visible())
@@ -1552,14 +1552,17 @@ inline static void monster_warning(activity_interrupt_type ai,
// Only say "comes into view" if the monster wasn't in view
// during the previous turn.
if (testbits(mon->flags, MF_WAS_IN_VIEW))
+ {
mprf(MSGCH_WARN, "%s is too close now for your liking.",
mon->name(DESC_CAP_THE).c_str());
+ }
}
else
{
- const std::string mweap =
- get_monster_desc(mon, false, DESC_NONE);
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_A) + ",";
if (at.context == "thin air")
{
@@ -1584,10 +1587,13 @@ inline static void monster_warning(activity_interrupt_type ai,
else
text += " comes into view.";
+ const std::string mweap =
+ get_monster_desc(mon, false, DESC_NONE);
+
if (!mweap.empty())
{
text += " " + mon->pronoun(PRONOUN_CAP)
- + " is" + mweap + ".";
+ + " is" + mweap + ".";
}
print_formatted_paragraph(text,
get_number_of_cols(),
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 1c14c2e8f6..eef4efefa4 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -2169,13 +2169,20 @@ static void describe_monster(const monsters *mon)
}
}
+// 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)
{
std::string desc = "";
if (mondtype != DESC_NONE)
+ {
desc = mon->name(mondtype);
-
+ // For named monsters also mention the base type.
+ if (!(mon->mname).empty())
+ desc += ", " + mons_type_name(mon->type, DESC_NOCAP_A);
+ }
std::string weap = "";
if (mon->type != MONS_DANCING_WEAPON)
@@ -2188,6 +2195,7 @@ std::string get_monster_desc(const monsters *mon, bool full_desc,
desc += weap;
}
+ // Print the rest of the equipment only for full descriptions.
if (full_desc)
{
const int mon_arm = mon->inv[MSLOT_ARMOUR];
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 7ceaf8b3ff..2dd9f49472 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -2035,7 +2035,7 @@ void behaviour_event( monsters *mon, int event, int src,
case ME_WHACK:
case ME_ANNOY:
// will turn monster against <src>, unless they
- // are BOTH friendly or good neutral and stupid,
+ // are BOTH friendly or good neutral AND stupid,
// or else fleeing anyway. Hitting someone over
// the head, of course, always triggers this code.
if (event == ME_WHACK
diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc
index 13622f1e73..6e0496a643 100644
--- a/crawl-ref/source/spl-util.cc
+++ b/crawl-ref/source/spl-util.cc
@@ -774,7 +774,7 @@ bool spell_direction( dist &spelld, bolt &pbolt,
pbolt.source_y = you.y_pos;
return (true);
-} // end spell_direction()
+}
const char* spelltype_short_name( int which_spelltype )
{