summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/food.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-30 20:31:38 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-30 20:31:38 +0000
commite864f4d3b84c1efe09175652a9830dddbc0bd6a5 (patch)
tree7322d1cc0393f62adb256204a714cdcd976a2d62 /crawl-ref/source/food.cc
parent7554b6525e58b192f168e50233479f3fb1d19f5e (diff)
downloadcrawl-ref-e864f4d3b84c1efe09175652a9830dddbc0bd6a5.tar.gz
crawl-ref-e864f4d3b84c1efe09175652a9830dddbc0bd6a5.zip
A completely reworked version of Zin as per the lengthy
discussion in October/November. Zin effects: - protection from harm (like all good gods) - feeding when starving (as before) - mutation resistance (chance of piety/200) Zin restrictions: - no cannibalism (like all good gods) - no attacking friends - no eating of intelligent beings' corpses - no deliberate mutating Zin invocations: - Smiting (general priestly ability?) - Revitalisation (Minor Healing + 5 mp) - Sanctuary (protection from attacks) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3164 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/food.cc')
-rw-r--r--crawl-ref/source/food.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index 63866f3099..626517d118 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -55,7 +55,7 @@
#include "xom.h"
static int determine_chunk_effect(int which_chunk_type, bool rotten_chunk);
-static void eat_chunk( int chunk_effect, bool cannibal );
+static void eat_chunk( int chunk_effect, bool cannibal, int mon_intel = 0);
static void eating(unsigned char item_class, int item_type);
static void describe_food_change(int hunger_increment);
static bool food_change(bool suppress_message);
@@ -622,7 +622,6 @@ static bool food_change(bool suppress_message)
return (state_changed);
} // end food_change()
-
// food_increment is positive for eating, negative for hungering
static void describe_food_change(int food_increment)
{
@@ -694,13 +693,14 @@ void eat_from_inventory(int which_inventory_slot)
// handle this the same -- bwr
const int mons_type = you.inv[ which_inventory_slot ].plus;
const bool cannibal = is_player_same_species(mons_type);
+ const int intel = mons_intel(mons_type) - I_ANIMAL;
const int chunk_type = mons_corpse_effect( mons_type );
const bool rotten = (you.inv[which_inventory_slot].special < 100);
if (!prompt_eat_chunk(you.inv[which_inventory_slot], rotten))
return;
- eat_chunk( determine_chunk_effect( chunk_type, rotten ), cannibal );
+ eat_chunk( determine_chunk_effect( chunk_type, rotten ), cannibal, intel );
}
else
{
@@ -742,11 +742,12 @@ void eat_floor_item(int item_link)
else if (mitm[item_link].sub_type == FOOD_CHUNK)
{
const int chunk_type = mons_corpse_effect( mitm[item_link].plus );
+ const int intel = mons_intel( mitm[item_link].plus ) - I_ANIMAL;
const bool cannibal = is_player_same_species( mitm[item_link].plus );
const bool rotten = (mitm[item_link].special < 100);
if (!prompt_eat_chunk(mitm[item_link], rotten))
return;
- eat_chunk( determine_chunk_effect( chunk_type, rotten ), cannibal );
+ eat_chunk( determine_chunk_effect( chunk_type, rotten ), cannibal, intel );
}
else
{
@@ -879,7 +880,7 @@ static void say_chunk_flavour(bool likes_chunks)
// never called directly - chunk_effect values must pass
// through food::determine_chunk_effect() first {dlb}:
-static void eat_chunk( int chunk_effect, bool cannibal )
+static void eat_chunk( int chunk_effect, bool cannibal, int mon_intel )
{
bool likes_chunks = (you.omnivorous() ||
@@ -901,12 +902,14 @@ static void eat_chunk( int chunk_effect, bool cannibal )
case CE_MUTAGEN_RANDOM:
mpr("This meat tastes really weird.");
mutate(RANDOM_MUTATION);
+ did_god_conduct( DID_DELIBERATE_MUTATING, 10);
xom_is_stimulated(100);
break;
case CE_MUTAGEN_BAD:
mpr("This meat tastes *really* weird.");
give_bad_mutation();
+ did_god_conduct( DID_DELIBERATE_MUTATING, 10);
xom_is_stimulated(random2(200));
break;
@@ -963,6 +966,8 @@ static void eat_chunk( int chunk_effect, bool cannibal )
if (cannibal)
did_god_conduct( DID_CANNIBALISM, 10 );
+ else if (mon_intel > 0)
+ did_god_conduct( DID_EAT_SOULED_BEING, mon_intel);
if (do_eat)
{