Skip to content

Commit

Permalink
Check for box of beasts/sack of spiders destruction after success (Pl…
Browse files Browse the repository at this point in the history
…easingFungus)

This approach feels better than having the item just fall apart on you, but it's
also considerably more consistent/powerful, so I upped the destruction rate to 1/3.
  • Loading branch information
cbuchananhowland committed Jun 11, 2016
1 parent 387a89b commit cff94a7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
8 changes: 4 additions & 4 deletions crawl-ref/source/dat/descript/items.txt
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ box of beasts
A box filled with the bizarre leftovers of a depraved wizard's magical
experimentations. Opening it might set loose a friendly mutant beast: bizarre
creatures, each with their own combination of traits. Increased skill with
Evocations will allow stronger beasts to be released, and reduce the chances
of accidentally destroying the box when using it.
Evocations will allow stronger beasts to be released. There is a one in three
chance of accidentally destroying the box when using it.

There are six known traits:
* Bat beasts fly and move very quickly, but erratically.
Expand Down Expand Up @@ -991,8 +991,8 @@ sack of spiders

A woven silk bag. Opening it will release a number of spiders and other
insects, as well as creating webs nearby. Evocations skill increases its
effectiveness and reduces the chances of accidentally destroying the bag when
it is used.
effectiveness. There is a one in three chance of accidentally destroying the
sack when using it.
%%%%
sacred scourge

Expand Down
35 changes: 16 additions & 19 deletions crawl-ref/source/evoke.cc
Original file line number Diff line number Diff line change
Expand Up @@ -992,14 +992,6 @@ static bool _box_of_beasts(item_def &box)
surge_power(surge);
mpr("You open the lid...");

if (one_chance_in(4))
{
mpr("...but the box appears empty, and falls apart.");
ASSERT(in_inventory(box));
dec_inv_item_quantity(box.link, 1);
return false;
}

// two rolls to reduce std deviation - +-6 so can get < max even at 27 sk
const int hd_min = min(27,
player_adjust_evoc_power(
Expand Down Expand Up @@ -1034,6 +1026,14 @@ static bool _box_of_beasts(item_def &box)
xom_is_stimulated(10); // dubious
did_god_conduct(DID_CHAOS, random_range(5,10));

// After unboxing a beast, chance to break.
if (one_chance_in(3))
{
mpr("The now-empty box falls apart.");
ASSERT(in_inventory(box));
dec_inv_item_quantity(box.link, 1);
}

return true;
}

Expand All @@ -1055,14 +1055,6 @@ static bool _sack_of_spiders(item_def &sack)
1 + random2(2) + random2(div_rand_round(evo_skill * 10, 30)), surge);
const int power = player_adjust_evoc_power(evo_skill, surge);

if (one_chance_in(4))
{
mpr("...but the bag is empty, and unravels at your touch.");
ASSERT(in_inventory(sack));
dec_inv_item_quantity(sack.link, 1);
return false;
}

if (x_chance_in_y(5, 10 + power))
{
mpr("...but nothing happens.");
Expand Down Expand Up @@ -1126,10 +1118,15 @@ static bool _sack_of_spiders(item_def &sack)
trap = trap_at((*mi)->pos());
trap->trigger(**mi);
}

}
// After gettin' some bugs, check for destruction.
if (one_chance_in(3))
{
mpr("The now-empty bag unravels in your hand.");
ASSERT(in_inventory(sack));
dec_inv_item_quantity(sack.link, 1);
}
// Decrease charges
sack.charges--;
sack.used_count++;
}
else
// Failed to create monster for some reason
Expand Down

0 comments on commit cff94a7

Please sign in to comment.