summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/delay.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-03 18:21:11 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-03 18:21:11 +0000
commite31e50c63a31aa249510d5c23e9a6d7c26e5dfb5 (patch)
tree5c1493c9a2208aa2f4d0f6fc2cec1df7f0fc60a1 /crawl-ref/source/delay.cc
parentb84db940665bbe61b706f0b69eb661ea4118800b (diff)
downloadcrawl-ref-e31e50c63a31aa249510d5c23e9a6d7c26e5dfb5.tar.gz
crawl-ref-e31e50c63a31aa249510d5c23e9a6d7c26e5dfb5.zip
Fix 1999363: Vampire eating issues.
Tidy up the new lines item descriptions a bit, so you don't get three free lines in some cases (non-randart, non-special description items) and one or two in other cases. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6370 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/delay.cc')
-rw-r--r--crawl-ref/source/delay.cc49
1 files changed, 33 insertions, 16 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index 65a4dd7b60..7fef1d1f86 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -41,6 +41,7 @@
#include "stash.h"
#include "state.h"
#include "stuff.h"
+#include "transfor.h"
#include "travel.h"
#include "tutorial.h"
#include "view.h"
@@ -138,7 +139,7 @@ static int _recite_to_monsters(int x, int y, int pow, int unused)
else
return (0); // nothing happens
- // bad effects stop the recital
+ // Bad effects stop the recital.
stop_delay();
return (1);
}
@@ -496,19 +497,20 @@ void stop_delay( bool stop_stair_travel )
did_god_conduct(DID_DRINK_BLOOD, 8);
delay.duration = 0;
_pop_delay();
- break;
+ handle_delay();
+ return;
}
case DELAY_ARMOUR_ON:
case DELAY_ARMOUR_OFF:
// These two have the default action of not being interruptible,
- // although they will often be chained (remove cloak, remove
- // armour, wear new armour, replace cloak), all of which can
- // be stopped when complete. This is a fairly reasonable
- // behaviour, although perhaps the character should have
- // option of reversing the current action if it would take
- // less time to get out of the plate mail that's half on
- // than it would take to continue. Probably too much trouble,
- // and would have to have a prompt... this works just fine. -- bwr
+ // although they will often consist of chained intermediary steps
+ // (remove cloak, remove armour, wear new armour, replace cloak),
+ // all of which can be stopped when complete. This is a fairly
+ // reasonable behaviour, although perhaps the character should have
+ // the option of reversing the current action if it would take less
+ // time to get out of the plate mail that's half on than it would
+ // take to continue. Probably too much trouble, and we'd have to
+ // have a prompt... this works just fine. -- bwr
break;
case DELAY_ASCENDING_STAIRS: // short... and probably what people want
@@ -678,7 +680,7 @@ void handle_delay( void )
: "butchering"),
mitm[delay.parm1].name(DESC_PLAIN).c_str());
- // also for bottling blood
+ // Also for bottling blood - just in case.
if (you.duration[DUR_PRAYER]
&& god_hates_butchery(you.religion))
{
@@ -728,8 +730,19 @@ void handle_delay( void )
// First check cases where delay may no longer be valid:
// XXX: need to handle passwall when monster digs -- bwr
- if (delay.type == DELAY_BUTCHER || delay.type == DELAY_BOTTLE_BLOOD
- || delay.type == DELAY_OFFER_CORPSE)
+ if (delay.type == DELAY_FEED_VAMPIRE)
+ {
+ if (you.hunger_state == HS_ENGORGED
+ || you.hunger_state > HS_SATIATED
+ && you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ {
+ // Messages handled in _food_change() in food.cc.
+ stop_delay();
+ return;
+ }
+ }
+ else if (delay.type == DELAY_BUTCHER || delay.type == DELAY_BOTTLE_BLOOD
+ || delay.type == DELAY_OFFER_CORPSE)
{
if (delay.type == DELAY_BOTTLE_BLOOD && you.experience_level < 6)
{
@@ -801,7 +814,9 @@ void handle_delay( void )
{
mpr("You stop bottling this corpse's foul-smelling "
"blood!");
- delay.duration = 0;
+ _pop_delay();
+ handle_delay();
+ return;
}
}
@@ -850,10 +865,10 @@ void handle_delay( void )
}
else if (delay.type == DELAY_RECITE)
{
- if (check_recital_audience() < 1 // maybe you've lost your audience
+ if (check_recital_audience() < 1 // Maybe you've lost your audience...
|| Options.hp_warning && you.hp*Options.hp_warning <= you.hp_max
&& delay.parm2*Options.hp_warning > you.hp_max
- || you.hp*2 < delay.parm2) // or significant health drop
+ || you.hp*2 < delay.parm2) // ... or significant health drop.
{
stop_delay();
return;
@@ -1170,6 +1185,8 @@ static void _finish_delay(const delay_queue_item &delay)
mprf("You stop %s.",
delay.type == DELAY_BUTCHER ? "butchering the corpse"
: "bottling this corpse's blood");
+ _pop_delay();
+ handle_delay();
}
StashTrack.update_stash(); // Stash-track the generated item(s).
break;