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37DNUZSSB5IQLECMKRB6NX257I2X3G35LMPAC
// Maybe potions should automatically merge into those already on the floor,
// or the player's inventory.
// Max. amount is about one third of the max. amount for chunks.
int pot_quantity = max_chunks/3;
pot_quantity = stepdown_value( pot_quantity, 2, 2, 6, 6 );
// Halve number of potions obtained from contaminated chunk type corpses.
if (chunk_type == CE_CONTAMINATED)
pot_quantity /= 2;
if (pot_quantity < 1)
pot_quantity = 1;
return (pot_quantity);
}
// If autopickup is active, the potions are auto-picked up after creation.
// Max. amount is about one third of the max. amount for chunks.
const int max_chunks = mons_weight( mons_class ) / 150;
item.quantity = 1 + random2( max_chunks/3 );
item.quantity = stepdown_value( item.quantity, 2, 2, 6, 6 );
// Lower number of potions obtained from contaminated chunk type corpses.
if (mons_corpse_effect( mons_class ) == CE_CONTAMINATED)
{
item.quantity /= (random2(3) + 1);
// freshly killed: age = 200 --> potion timer = 2000 --> fresh !blood
init_stack_blood_potions(item, (item.special - 100) * 15 + 500);
// freshly killed: age = 200 --> potion timer = 2500 --> fresh !blood
init_stack_blood_potions(item, (item.special - 100) * 20 + 500);
int food_value = CHUNK_BASE_NUTRITION;
// int mass = CHUNK_BASE_NUTRITION * chunk_amount;
const int duration = 1 + chunk_amount/2;
// Add 1 for the artificial extra call at the start of draining.
const int duration = 1 + chunk_amount;
// Use number of potions per corpse to calculate total nutrition, which
// then gets distributed over the entire duration.
int food_value = CHUNK_BASE_NUTRITION
* num_blood_potions_from_corpse(mons_type, chunk_type);
// Human blood gives extra healing during feeding.
if (hp_amt >= duration)
hp_amt /= duration;
else if (x_chance_in_y(hp_amt, duration))
hp_amt = 1;
if (!end_feeding)
{
if (start_feeding)
mpr("This warm blood tastes really delicious!");
_heal_from_food(hp_amt, 0, one_chance_in(duration/2),
one_chance_in(duration));
}
else
{
// Give the remainder of healing at the end.
if (hp_amt > duration)
if (hp_amt >= duration)
hp_amt /= duration;
else if (x_chance_in_y(hp_amt, duration))
hp_amt = 1;
_heal_from_food(hp_amt);
}
else
// Elven blood gives mana at the end of feeding.
const int mp_amt = 1 + random2(3);
_heal_from_food(1, mp_amt, one_chance_in(duration/2),
one_chance_in(duration));
if (end_feeding)
{
const int mp_amt = 1 + random2(3);
_heal_from_food(1, mp_amt);
}
else if (start_feeding)
mpr("This warm blood tastes magically delicious!");