From 0a69a524938f8c559947685b901abdb22043925b Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 17 Jul 2008 07:47:50 +0000 Subject: Apply r6579 to 0.4.1, and revert my local makefile change (oops!) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6581 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/docs/changes.stone_soup | 2 ++ crawl-ref/source/beam.cc | 5 ++++- crawl-ref/source/cloud.cc | 2 +- crawl-ref/source/delay.cc | 7 ------- crawl-ref/source/food.cc | 14 +++++++++++--- crawl-ref/source/item_use.cc | 2 +- crawl-ref/source/makefile | 4 ++-- crawl-ref/source/ouch.cc | 18 ++++++++++-------- crawl-ref/source/ouch.h | 2 +- 9 files changed, 32 insertions(+), 24 deletions(-) diff --git a/crawl-ref/docs/changes.stone_soup b/crawl-ref/docs/changes.stone_soup index 805b74a582..58f5706872 100644 --- a/crawl-ref/docs/changes.stone_soup +++ b/crawl-ref/docs/changes.stone_soup @@ -12,6 +12,8 @@ Disclaimer: These are merely the highlights, not an exhaustive list of changes. * Fixed targetting prompts being ignored or having the wrong result. * Fixed vampire bat jewellery exploit. * Fixed kills by hell effects counting as player kills. +* Fixed cold/fire always destroying all potions/scrolls on the floor. +* Fixed Portal Projectile not handling throwing nets or branded ammo correctly. * Fixed friendly pickup toggle being inappropriately disallowed. * Fixed known bad potions being subject to autopickup. diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 71cbfb8c87..b536d310a9 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -3143,7 +3143,10 @@ int affect(bolt &beam, int x, int y, item_def *item) // If not a tracer, affect items and place clouds. if (!beam.is_tracer) { - expose_items_to_element(beam.flavour, x, y); + const int burn_power = (beam.is_explosion) ? 5 : + (beam.is_beam) ? 3 : 2; + + expose_items_to_element(beam.flavour, x, y, burn_power); rangeUsed += _affect_place_clouds(beam, x, y); } diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc index 9b01fa84d6..0aef61b1f0 100644 --- a/crawl-ref/source/cloud.cc +++ b/crawl-ref/source/cloud.cc @@ -157,7 +157,7 @@ void manage_clouds(void) } expose_items_to_element(cloud2beam(env.cloud[cc].type), - env.cloud[cc].x, env.cloud[cc].y); + env.cloud[cc].x, env.cloud[cc].y, 2); _dissipate_cloud(cc, env.cloud[cc], dissipate); } diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 23237b1eae..2a97292056 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -698,13 +698,6 @@ void handle_delay( void ) if (apply_area_visible(_recite_to_monsters, delay.parm1)) viewwindow(true, false); break; - case DELAY_FEED_VAMPIRE: - { - item_def &corpse = (delay.parm1 ? you.inv[delay.parm2] - : mitm[delay.parm2]); - vampire_nutrition_per_turn(corpse, -1); - break; - } default: break; } diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 0723e53728..15577ae30e 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -2084,7 +2084,7 @@ bool can_ingest(int what_isit, int kindof_thing, bool suppress_msg, bool reqid, if (ur_herbivorous) { if (!suppress_msg) - mpr("You can't eat raw meat!"); + mpr("Blech - you need greens!"); return (false); } else if (kindof_thing == FOOD_CHUNK) @@ -2319,8 +2319,16 @@ static bool _vampire_consume_corpse(const int slot, bool invent) int chunk_amount = 1 + max_chunks/2; chunk_amount = stepdown_value( chunk_amount, 4, 4, 12, 12 ); - start_delay( DELAY_FEED_VAMPIRE, 1 + chunk_amount/2, - (int) invent, slot ); + // Get some nutrition right away, in case we're interrupted. + // (-1 for the starting message.) + vampire_nutrition_per_turn(corpse, -1); + if (chunk_amount/2 > 0) + { + // The draining delay doesn't have a start action, and we only need + // the continue/finish messages if it takes longer than 1 turn. + start_delay( DELAY_FEED_VAMPIRE, chunk_amount/2, + (int) invent, slot ); + } return (true); } diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 3a202aa312..0d29c0f554 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -2585,7 +2585,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, if (teleport) { // Violating encapsulation somewhat...oh well. - hit = (affect(pbolt, pbolt.target_x, pbolt.target_y) != 0); + hit = (affect(pbolt, pbolt.target_x, pbolt.target_y, &item) != 0); if (acc_bonus != DEBUG_COOKIE) beam_drop_object(pbolt, &item, pbolt.target_x, pbolt.target_y); } diff --git a/crawl-ref/source/makefile b/crawl-ref/source/makefile index 0bb53bc62a..9e1ded2ab6 100644 --- a/crawl-ref/source/makefile +++ b/crawl-ref/source/makefile @@ -4,12 +4,12 @@ #Makefile chooser. Choose one: -#MAKEFILE ?= makefile.unix +MAKEFILE ?= makefile.unix #MAKEFILE ?= makefile.dos #MAKEFILE ?= makefile.osx #MAKEFILE ?= makefile.mgw #MAKEFILE ?= makefile_tiles.mgw -MAKEFILE ?= makefile.x11 +#MAKEFILE ?= makefile.x11 #jmf: number of concurrent jobs -- good value is (#_of_CPUs * 2) + 1 # cuts build time a lot on multi-cpu machines diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index f53fa8d9bb..f309e7fc3a 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -541,7 +541,7 @@ static void _expose_invent_to_element(beam_type flavour, int strength) } } -void expose_items_to_element(beam_type flavour, int x, int y) +void expose_items_to_element(beam_type flavour, int x, int y, int strength) { int num_dest = 0; @@ -554,16 +554,18 @@ void expose_items_to_element(beam_type flavour, int x, int y) if (!is_valid_item(*si)) continue; - if ( si->base_type == target_class - || (target_class == OBJ_FOOD && si->base_type == OBJ_CORPSES)) + if (si->base_type == target_class + || target_class == OBJ_FOOD && si->base_type == OBJ_CORPSES) { - num_dest += si->quantity; - item_was_destroyed(*si); - destroy_item(si->index()); + if (x_chance_in_y(strength, 100)) + { + num_dest++; + dec_mitm_item_quantity(si->index(), 1); + } } } - if (num_dest > 0) + if (num_dest) { if (see_grid(x, y)) { @@ -605,7 +607,7 @@ void expose_items_to_element(beam_type flavour, int x, int y) // // This function now calls _expose_invent_to_element() if strength > 0. // -// XXX: this function is far from perfect and a work in progress. +// XXX: This function is far from perfect and a work in progress. void expose_player_to_element(beam_type flavour, int strength) { // Note that BEAM_TELEPORT is sent here when the player diff --git a/crawl-ref/source/ouch.h b/crawl-ref/source/ouch.h index 7f66535d75..18ca77f210 100644 --- a/crawl-ref/source/ouch.h +++ b/crawl-ref/source/ouch.h @@ -107,7 +107,7 @@ void lose_level(void); * *********************************************************************** */ void drain_exp(bool announce_full = true); -void expose_items_to_element(beam_type flavour, int x, int y); +void expose_items_to_element(beam_type flavour, int x, int y, int strength = 0); void expose_player_to_element(beam_type flavour, int strength = 0); #endif -- cgit v1.2.3-54-g00ecf