summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-18 18:46:56 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-18 18:46:56 +0000
commit52635e528e83419737ee28b01286ecd3df9be11a (patch)
treec9b47fa14d928199de8e5dc44d6e1cf6803f1b58 /crawl-ref/source/monstuff.cc
parent89b84f43d74acefe2f6e405d39c5e6121111aeb3 (diff)
downloadcrawl-ref-52635e528e83419737ee28b01286ecd3df9be11a.tar.gz
crawl-ref-52635e528e83419737ee28b01286ecd3df9be11a.zip
* Fix Xom's piety wrapping around from 0 -> 255.
* Fix Xom piety 100 (initial state) favouring bad effects. * Limit tension bonus for good effects to 199. * Add penalty for tension 0, so bad effects become more likely without tension. * Revert order of Xom's amusement to actually match the amusement gain. (Was getting "roars with laughter" for gain of 2, etc.) * Add damage shaving to Deep Dwarf ghosts. * Add 'o' to pickup list commands -> stop prompting, start autoexplore. * Default menu_colour_item_class to true in initfile.cc. * Allow autopickup of chunks in Lich form. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9634 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc46
1 files changed, 29 insertions, 17 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index fa827d503b..edee201177 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -1126,7 +1126,7 @@ int monster_die(monsters *monster, killer_type killer,
{
take_note(Note(NOTE_KILL_MONSTER,
monster->type, mons_friendly(monster),
- monster->name(DESC_NOCAP_A, true).c_str()));
+ monster->full_name(DESC_NOCAP_A).c_str()));
}
// From time to time Trog gives you a little bonus
@@ -1979,17 +1979,17 @@ bool monster_polymorph(monsters *monster, monster_type targetc,
bool can_see = you.can_see(monster);
bool can_see_new = !mons_class_flag(targetc, M_INVIS) || player_see_invis();
+ bool need_note = false;
+ std::string old_name = monster->full_name(DESC_CAP_A);
// If old monster is visible to the player, and is interesting,
// then note why the interesting monster went away.
if (can_see && MONST_INTERESTING(monster))
- {
- take_note(Note(NOTE_POLY_MONSTER, monster->type, 0,
- monster->name(DESC_CAP_A, true).c_str()));
- }
+ need_note = true;
+ std::string new_name = "";
if (monster->type == MONS_OGRE && targetc == MONS_TWO_HEADED_OGRE)
- str_polymon = " grows a second head!";
+ str_polymon = " grows a second head";
else
{
if (mons_is_shapeshifter(monster))
@@ -2000,17 +2000,20 @@ bool monster_polymorph(monsters *monster, monster_type targetc,
str_polymon = " evaporates and reforms as ";
if (!can_see_new)
- str_polymon += "something you cannot see!";
+ {
+ new_name = "something unseen";
+ str_polymon += "something you cannot see";
+ }
else
{
str_polymon += mons_type_name(targetc, DESC_NOCAP_A);
if (targetc == MONS_PULSATING_LUMP)
str_polymon += " of flesh";
-
- str_polymon += "!";
}
}
+ str_polymon += "!";
+
bool player_messaged = can_see
&& simple_monster_message(monster, str_polymon.c_str());
@@ -2116,13 +2119,25 @@ bool monster_polymorph(monsters *monster, monster_type targetc,
// New monster type might be interesting.
mark_interesting_monst(monster);
+ if (new_name.empty())
+ new_name = monster->full_name(DESC_NOCAP_A);
+
+ if (need_note
+ || can_see && you.can_see(monster) && MONST_INTERESTING(monster))
+ {
+ take_note(Note(NOTE_POLY_MONSTER, 0, 0, old_name.c_str(),
+ new_name.c_str()));
+
+ if (you.can_see(monster))
+ monster->flags |= MF_SEEN;
+ }
// If new monster is visible to player, then we've seen it.
if (you.can_see(monster))
{
seen_monster(monster);
// If the player saw both the beginning and end results of a
- // shifter changing, then he/she knows it must be a shifter.
+ // shifter changing, then s/he knows it must be a shifter.
if (can_see && shifter.ench != ENCH_NONE)
monster->flags |= MF_KNOWN_MIMIC;
}
@@ -2680,17 +2695,14 @@ void behaviour_event(monsters *mon, mon_event_type event, int src,
break;
case ME_SCARE:
- // Stationary monsters can't flee.
- if (mons_is_stationary(mon))
+ // Stationary monsters can't flee, and berserking monsters
+ // are too enraged.
+ if (mons_is_stationary(mon) || mon->has_ench(ENCH_BERSERK))
{
mon->del_ench(ENCH_FEAR, true, true);
break;
}
- // Berserking monsters don't flee.
- if (mon->has_ench(ENCH_BERSERK))
- break;
-
// Neither do plants or nonliving beings.
if (mons_class_holiness(mon->type) == MH_PLANT
|| mons_class_holiness(mon->type) == MH_NONLIVING)
@@ -8888,7 +8900,7 @@ void seen_monster(monsters *monster)
{
take_note(
Note(NOTE_SEEN_MONSTER, monster->type, 0,
- monster->name(DESC_NOCAP_A).c_str()));
+ monster->name(DESC_NOCAP_A, true).c_str()));
}
}