diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-11 12:38:33 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-11 12:38:33 +0000 |
commit | 5a10cfbf8b5800a362608ebfd534e643cc5cbbcd (patch) | |
tree | 4d1cadca24ee81a50ddb06475421cf0409f61db3 /crawl-ref/source/delay.cc | |
parent | e3c86b100dc45f37ef5e0d4759b867a5c0b22a22 (diff) | |
download | crawl-ref-5a10cfbf8b5800a362608ebfd534e643cc5cbbcd.tar.gz crawl-ref-5a10cfbf8b5800a362608ebfd534e643cc5cbbcd.zip |
Increase efficiency for pathfinding around glass structures by lowering
the chance to "try again" if the last time we were unsuccessful. Also,
if a monster tries to find a path to the player (not directly reachable)
and fails, mark all surrounding monsters of the same species within a
radius of 2 as having been unsuccessful. This includes monsters that are
currently out of los of the player or that are targetting a different
monster. Once they target the player, there'll either be a direct path
which they can use, or there won't, in which case there's a low chance of
using path finding; otherwise they'll simply advance the traditional way
as close as they can get.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5733 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/delay.cc')
-rw-r--r-- | crawl-ref/source/delay.cc | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index c571d2985a..35a19bdd62 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -767,14 +767,16 @@ void handle_delay( void ) } else { - // Only give the rotting message if the corpse wasn't - // previously rotten. (special < 100 is the rottenness check) - if (food_is_rotten(mitm[delay.parm1]) && delay.parm2 >= 100) + if (food_is_rotten(mitm[delay.parm1])) { - mpr("The corpse rots.", MSGCH_ROTTEN_MEAT); + // Only give the rotting message if the corpse wasn't + // previously rotten. (special < 100 is the rottenness check). + if (delay.parm2 >= 100) + mpr("The corpse rots.", MSGCH_ROTTEN_MEAT); + if (delay.type == DELAY_OFFER_CORPSE) { - // don't attempt to offer a rotten corpse + // Don't attempt to offer a rotten corpse. _pop_delay(); // Chain onto the next delay. @@ -782,7 +784,7 @@ void handle_delay( void ) return; } - delay.parm2 = 99; // don't give the message twice + delay.parm2 = 99; // Don't give the message twice. if (you.is_undead != US_UNDEAD && player_mutation_level(MUT_SAPROVOROUS) < 3) @@ -798,7 +800,7 @@ void handle_delay( void ) } } - // mark work done on the corpse in case we stop -- bwr + // Mark work done on the corpse in case we stop. -- bwr mitm[ delay.parm1 ].plus2++; } } @@ -1176,8 +1178,21 @@ static void _finish_delay(const delay_queue_item &delay) return; } - offer_corpse(delay.parm1); - StashTrack.update_stash(); // Don't stash-track this corpse anymore. + if (food_is_rotten(mitm[delay.parm1])) + { + simple_god_message(coinflip() ? " refuses to accept that" + " mouldy sacrifice!" + : " demands fresh blood!", + you.religion); + _pop_delay(); + // Chain onto the next delay. + handle_delay(); + } + else + { + offer_corpse(delay.parm1); + StashTrack.update_stash(); // Don't stash-track this corpse anymore. + } break; } case DELAY_DROP_ITEM: |