summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-17 07:34:30 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-17 07:34:30 +0000
commitd05ad02e6ca609c768a843eb62beda9f602e821a (patch)
treedcbe30e255651b4502aee6a2e62779b5d68d7635
parente14b5260df1fa0e9400a1d0c3472f5d8dcc97e89 (diff)
downloadcrawl-ref-d05ad02e6ca609c768a843eb62beda9f602e821a.tar.gz
crawl-ref-d05ad02e6ca609c768a843eb62beda9f602e821a.zip
Fix 2018458: Portal projectile not handling branded ammo or nets.
Fix 2019803: cold/fire destroying all susceptible items on the floor Change "You don't eat raw eat!" to "Blech - you need greens!" Also: Experimentally change sacrifices to take only 1 turn again, no matter how many corpses are actually sacrificed during this turn. Allow chained 'yes' and 'no' answers during the butchering prompt, so that 'cccccc' is now really functionally identical to 'ca'. In another return to previous handling, always get in that first turn of butchering for a single corpse (or the first corpse in butcher chains), so it takes a maximum of 3 turns rather than 4. Same for draining corpses as a Vampire: when draining corpses you get at least a little bit of nutrition out of it before you are interrupted. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6579 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/beam.cc5
-rw-r--r--crawl-ref/source/cloud.cc2
-rw-r--r--crawl-ref/source/delay.cc7
-rw-r--r--crawl-ref/source/food.cc46
-rw-r--r--crawl-ref/source/item_use.cc2
-rw-r--r--crawl-ref/source/ouch.cc18
-rw-r--r--crawl-ref/source/ouch.h2
7 files changed, 50 insertions, 32 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index dcc697eba0..e5a40bd57d 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -3144,7 +3144,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 3979b187d6..7b9133594b 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 44f39bdb5a..8e876e67f7 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -314,7 +314,8 @@ static bool _prepare_butchery(bool can_butcher, bool removed_gloves,
return (true);
}
-static bool _butcher_corpse(int corpse_id, bool force_butcher = false)
+static bool _butcher_corpse(int corpse_id, bool first_corpse = true,
+ bool force_butcher = false)
{
ASSERT(corpse_id != -1);
@@ -324,7 +325,7 @@ static bool _butcher_corpse(int corpse_id, bool force_butcher = false)
if (can_sac && !rotten)
{
- start_delay(DELAY_OFFER_CORPSE, 1, corpse_id);
+ start_delay(DELAY_OFFER_CORPSE, 0, corpse_id);
}
else
{
@@ -336,7 +337,7 @@ static bool _butcher_corpse(int corpse_id, bool force_butcher = false)
you.religion);
}
- int work_req = 4 - mitm[corpse_id].plus2;
+ int work_req = 4 - mitm[corpse_id].plus2 - (first_corpse ? 1 : 0);
if (work_req < 0)
work_req = 0;
@@ -546,7 +547,7 @@ bool butchery(int which_corpse)
{
return (false);
}
- success = _butcher_corpse(corpse_id);
+ success = _butcher_corpse(corpse_id, true);
_terminate_butchery(wpn_switch, removed_gloves, old_weapon, old_gloves);
// Remind player of corpses in pack that could be butchered or
@@ -561,6 +562,8 @@ bool butchery(int which_corpse)
bool bottle_all = false; // for Vampires
bool force_butcher = false;
bool repeat_prompt = false;
+ bool did_weap_swap = false;
+ bool first_corpse = true;
int keyin;
for (stack_iterator si(you.pos()); si; ++si)
{
@@ -611,10 +614,15 @@ bool butchery(int which_corpse)
case 'c':
case 'd':
case 'a':
- if (!_prepare_butchery(can_butcher, removed_gloves,
- wpn_switch, butcher_tool))
+ if (!did_weap_swap)
{
- return (false);
+ if (_prepare_butchery(can_butcher, removed_gloves,
+ wpn_switch, butcher_tool))
+ {
+ did_weap_swap = true;
+ }
+ else
+ return (false);
}
corpse_id = si->index();
@@ -654,11 +662,15 @@ bool butchery(int which_corpse)
if (corpse_id != -1)
{
- if (_butcher_corpse(corpse_id, force_butcher || butcher_all))
+ if (_butcher_corpse(corpse_id, first_corpse,
+ force_butcher || butcher_all))
+ {
success = true;
+ first_corpse = false;
+ }
- if (!butcher_all && !bottle_all)
- break;
+// if (!butcher_all && !bottle_all)
+// break;
}
}
@@ -2093,7 +2105,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)
@@ -2328,8 +2340,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 9fc7428131..643c115589 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -2580,7 +2580,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/ouch.cc b/crawl-ref/source/ouch.cc
index e87b2499ab..97e51b76a6 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -538,7 +538,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;
@@ -551,16 +551,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))
{
@@ -602,7 +604,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