summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/delay.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-30 05:56:13 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-30 05:56:13 +0000
commitfc944616f69e347423c408a9d3e3efee9140a46d (patch)
tree342a77d3a517969c7ac57c6d6bc0408dc07422c3 /crawl-ref/source/delay.cc
parentcc20c6d673722c6dd4ca32290d9cc66e55597f3c (diff)
downloadcrawl-ref-fc944616f69e347423c408a9d3e3efee9140a46d.tar.gz
crawl-ref-fc944616f69e347423c408a9d3e3efee9140a46d.zip
This commit breaks save file compatability.
Lots of new things that amuse/stimulate Xom, and a few things which don't amuse him as much anymore. Among the new things is a corpse turning into a skeleton while butchering it; if this is too harsh to do just for Xom's amusement (previously turning into a skeleton while butchering was an ignored case and still produced chunks of flesh) it can be changed back. Also, if a Xom worshiper draws the Blank card, Xom makes it act like a Xom card, since a plain old Blank card is boring. Keep track of which branch the Orb is in, if the player isn't carrying it. Keep track of how/why the player ended up in a particular level type (Abyss, Pan, etc). Changed most "a distortion effect" cause strings for distortion caused tranlsocation miscast effects to something more specific. Added new wizard commands 'C' to curse or uncruse an item, and 'Ctrl-A' to re-generate the Abyss. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2256 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/delay.cc')
-rw-r--r--crawl-ref/source/delay.cc77
1 files changed, 65 insertions, 12 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index 941d82d223..326fa33151 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -42,6 +42,7 @@
#include "travel.h"
#include "tutorial.h"
#include "view.h"
+#include "xom.h"
extern std::vector<SelItem> items_for_multidrop;
@@ -293,6 +294,17 @@ bool is_being_butchered(const item_def &item)
return (false);
}
+// Xom is amused by a potential food source going to waste, and is
+// more amused the hungrier you are.
+static void xom_check_corpse_waste()
+{
+ int food_need = 7000 - you.hunger;
+ if (food_need < 0)
+ food_need = 0;
+
+ xom_is_stimulated(64 + (191 * food_need / 6000));
+}
+
void handle_delay( void )
/***********************/
{
@@ -353,24 +365,41 @@ void handle_delay( void )
// Note that a monster could have raised the corpse and another
// monster could die and create a corpse with the same ID number...
// However, it would not be at the player's square like the
- // original and that's why we do it this way. Note that
- // we ignore the conversion to skeleton possibility just to
- // be nice. -- bwr
+ // original and that's why we do it this way.
if (is_valid_item( mitm[ delay.parm1 ] )
&& mitm[ delay.parm1 ].base_type == OBJ_CORPSES
&& mitm[ delay.parm1 ].x == you.x_pos
&& mitm[ delay.parm1 ].y == you.y_pos )
{
- // special < 100 is the rottenness check
- if ( (mitm[delay.parm1].special < 100) &&
- (delay.parm2 >= 100) )
+ if (mitm[ delay.parm1 ].sub_type == CORPSE_SKELETON)
{
- mpr("The corpse rots.", MSGCH_ROTTEN_MEAT);
- delay.parm2 = 99; // don't give the message twice
+ mpr("The corpse rots away into a skeleton!");
+ if (you.species == SP_GHOUL)
+ xom_check_corpse_waste();
+ else
+ xom_is_stimulated(32);
+ delay.duration = 0;
}
+ else
+ {
+ // special < 100 is the rottenness check
+ if ( (mitm[delay.parm1].special < 100) &&
+ (delay.parm2 >= 100) )
+ {
+ mpr("The corpse rots.", MSGCH_ROTTEN_MEAT);
+ delay.parm2 = 99; // don't give the message twice
+
+ if (you.species != SP_VAMPIRE
+ && you.species != SP_MUMMY
+ && you.species != SP_GHOUL)
+ {
+ xom_check_corpse_waste();
+ }
+ }
- // mark work done on the corpse in case we stop -- bwr
- mitm[ delay.parm1 ].plus2++;
+ // mark work done on the corpse in case we stop -- bwr
+ mitm[ delay.parm1 ].plus2++;
+ }
}
else
{
@@ -589,6 +618,20 @@ static void finish_delay(const delay_queue_item &delay)
const item_def &item = mitm[delay.parm1];
if (is_valid_item(item) && item.base_type == OBJ_CORPSES)
{
+
+ if (item.sub_type == CORPSE_SKELETON)
+ {
+ mpr("The corpse rots away into a skeleton just before you "
+ "finish butchering it!");
+
+ if (you.species == SP_GHOUL)
+ xom_check_corpse_waste();
+ else
+ xom_is_stimulated(64);
+
+ break;
+ }
+
mprf("You finish %s the corpse into pieces.",
(you.has_usable_claws() || you.mutation[MUT_FANGS] == 3) ?
"ripping" : "chopping");
@@ -679,7 +722,8 @@ static void armour_wear_effects(const int item_slot)
set_ident_flags(arm, ISFLAG_EQ_ARMOUR_MASK );
mprf("You finish putting on %s.", arm.name(DESC_NOCAP_YOUR).c_str());
- const equipment_type eq_slot = get_armour_slot(arm);
+ const equipment_type eq_slot = get_armour_slot(arm);
+ const bool known_cursed = item_known_cursed(arm);
if (eq_slot == EQ_BODY_ARMOUR)
{
@@ -811,7 +855,16 @@ static void armour_wear_effects(const int item_slot)
{
mpr( "Oops, that feels deathly cold." );
learned_something_new(TUT_YOU_CURSED);
- xom_is_stimulated(128);
+
+ // Cursed cloaks prevent you from removing body armour
+ int cloak_mult = 1;
+ if (get_armour_slot(arm) == EQ_CLOAK)
+ cloak_mult = 2;
+
+ if (known_cursed)
+ xom_is_stimulated(32 * cloak_mult);
+ else
+ xom_is_stimulated(64 * cloak_mult);
}
if (eq_slot == EQ_SHIELD)