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-06-27 17:04:31 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-27 17:04:31 +0000
commit1be101fd1fc43a252cdc4debf475edf0c6dba81b (patch)
tree13e5c780e21268c06bb28c48994f934e906ee62e /crawl-ref/source/monstuff.cc
parent39e1fb93fe8332c69e55c4364d28091a02d52ad5 (diff)
downloadcrawl-ref-1be101fd1fc43a252cdc4debf475edf0c6dba81b.tar.gz
crawl-ref-1be101fd1fc43a252cdc4debf475edf0c6dba81b.zip
Apply patch by Adam Borowski, introducing new unique enchantress Kirke.
This includes a new transformation TRAN_PIG that the player can not end at will but rather will have to time out. Pigs (or rather hogs) are fast but cannot use any equipment except amulets, or cast spells. If the transformation would cause death by stat loss (due to equipment loss) the player is paralysed instead. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10061 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index a7acbe5c0e..310fb9e111 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -58,6 +58,7 @@ REVISION("$Rev$");
#include "state.h"
#include "stuff.h"
#include "terrain.h"
+#include "transfor.h"
#include "traps.h"
#include "tutorial.h"
#include "view.h"
@@ -1068,6 +1069,39 @@ void _monster_die_cloud(const monsters* monster, bool corpse, bool silent,
}
}
+static void _hogs_to_humans()
+{
+ // Simplification: if, in a rare event, another hog which was not created
+ // as a part of Kirke's band happens to be on the level, the player can't
+ // tell them apart anyway.
+ // On the other hand, hogs which left the level are too far away to be
+ // affected by the magic of Kirke's death.
+ int any = 0;
+
+ for (int i = 0; i < MAX_MONSTERS; ++i)
+ {
+ monsters *monster = &menv[i];
+ if (monster->type == MONS_HOG)
+ {
+ monster->type = MONS_HUMAN;
+ monster->attitude = ATT_GOOD_NEUTRAL;
+ monster->flags |= MF_WAS_NEUTRAL;
+ behaviour_event(monster, ME_EVAL);
+
+ any++;
+ }
+ }
+
+ if (any==1)
+ mpr("No longer under Kirke's spell, the hog turns into a human!");
+ else if (any>1)
+ mpr("No longer under Kirke's spell, all hogs revert to their human form!");
+
+ // Revert the player as well.
+ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_PIG)
+ untransform();
+}
+
int monster_die(monsters *monster, killer_type killer,
int killer_index, bool silent, bool wizard)
{
@@ -1678,6 +1712,10 @@ int monster_die(monsters *monster, killer_type killer,
// creation again. -- bwr
you.unique_creatures[monster->type] = false;
}
+ else if (monster->type == MONS_KIRKE && !in_transit)
+ {
+ _hogs_to_humans();
+ }
else if (!mons_is_summoned(monster))
{
if (mons_genus(monster->type) == MONS_MUMMY)