summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-26 22:11:10 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-26 22:11:10 +0000
commit32ee07c57a39f77aede3c432ea6292e20be6df65 (patch)
tree549871616bc908259099c5cc81a82d75d9000898
parentc506a674c81b916e395579c5d4ad7b42b22990ae (diff)
downloadcrawl-ref-32ee07c57a39f77aede3c432ea6292e20be6df65.tar.gz
crawl-ref-32ee07c57a39f77aede3c432ea6292e20be6df65.zip
Modify Ely's "Destroy Weapon" invocation and
Trog's "Brothers in Arms Ely: Items of high value (artefacts etc.) are very likely to raise piety. For the rest, the probability depends on piety. Trog: BiA has a fixed cost of 4 to which a piety dependent bonus is added, making the total piety cost range from 4 (bears) to 7 (giants). Also, the intermediate monsters (oges and trolls) turn up over a longer piety range. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.3@2605 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/abl-show.cc8
-rw-r--r--crawl-ref/source/religion.cc23
-rw-r--r--crawl-ref/source/spells2.cc19
3 files changed, 31 insertions, 19 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index b9aa1d4075..0b2e1c8856 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -276,7 +276,7 @@ static const ability_def Ability_List[] =
{ ABIL_TROG_BERSERK, "Berserk", 0, 0, 200, 0, ABFLAG_NONE },
{ ABIL_TROG_REGENERATION, "Trog's Hand", 0, 0, 50, 1, ABFLAG_NONE },
{ ABIL_TROG_BROTHERS_IN_ARMS, "Brothers in Arms",
- 0, 0, 100, generic_cost::range(5, 6), ABFLAG_NONE },
+ 0, 0, 100, generic_cost::fixed(4), ABFLAG_NONE },
// Elyvilon
{ ABIL_ELYVILON_DESTROY_WEAPONS, "Destroy Weapons", 0, 0, 0, 0, ABFLAG_NONE },
@@ -1781,7 +1781,11 @@ static void pay_ability_costs(const ability_def& abil)
you.turn_is_over = !(abil.flags & ABFLAG_INSTANT);
const int food_cost = abil.food_cost + random2avg(abil.food_cost, 2);
- const int piety_cost = abil.piety_cost.cost();
+ int piety_cost = abil.piety_cost.cost();
+
+ if (abil.ability == ABIL_TROG_BROTHERS_IN_ARMS)
+ // increase cost depending on current piety
+ piety_cost += (you.piety-100)/20;
#if DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "Cost: mp=%d; hp=%d; food=%d; piety=%d",
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index c7a1102aed..1f28de1c22 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -1612,25 +1612,32 @@ bool ely_destroy_weapons()
continue;
}
- std::ostream& strm = msg::streams(MSGCH_GOD);
- strm << mitm[i].name(DESC_CAP_THE);
- if ( mitm[i].quantity == 1 )
- strm << " shimmers and breaks into pieces." << std::endl;
- else
- strm << " shimmer and break into pieces." << std::endl;
-
const int value = item_value( mitm[i], true );
#ifdef DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "Destroyed weapon value: %d", value);
#endif
- if (random2(value) >= random2(50)
+ bool pgain = false;
+ if (random2(value) >= random2(250) // artefacts (incl. most randarts)
+ || random2(value) >= random2(100) && one_chance_in(1 + you.piety/50)
|| (mitm[i].base_type == OBJ_WEAPONS
&& (you.piety < 30 || player_under_penance())))
{
+ pgain = true;
gain_piety(1);
}
+ std::ostream& strm = msg::streams(MSGCH_GOD);
+ strm << mitm[i].name(DESC_CAP_THE);
+
+ if (!pgain)
+ strm << " barely";
+
+ if ( mitm[i].quantity == 1 )
+ strm << " shimmers and breaks into pieces." << std::endl;
+ else
+ strm << " shimmer and break into pieces." << std::endl;
+
destroy_item(i);
success = true;
i = next;
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index 8ca8b6cecc..64c48926eb 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -1455,12 +1455,13 @@ void summon_ice_beast_etc(int pow, int ibc, bool divine_gift)
void summon_berserker()
{
beh_type beha = BEH_GOD_GIFT;
- int pow = you.piety + random2(you.piety/4) - random2(you.piety/4);
+ // randomize a bit to make things more interesting
+ int pow = you.piety + random2(30) - random2(30);
int numsc = std::min(2 + (random2(pow) / 4), 6);
monster_type mon = MONS_TROLL;
- if (pow <= 100)
+ if (pow <= 120) // 100-120 -> 20
{
// bears
if (coinflip())
@@ -1468,7 +1469,7 @@ void summon_berserker()
else
mon = MONS_GRIZZLY_BEAR;
}
- else if (pow <= 140)
+ else if (pow <= 150) // 121-150 -> 30
{
// ogres
if (one_chance_in(3))
@@ -1476,28 +1477,28 @@ void summon_berserker()
else
mon = MONS_OGRE;
}
- else if (pow <= 180)
+ else if (pow <= 180) // 151-180 -> 30
{
// trolls
switch(random2(8))
{
- case 0:
+ case 0: // 12.5%
mon = MONS_DEEP_TROLL;
break;
case 1:
- case 2:
+ case 2: // 25%
mon = MONS_IRON_TROLL;
break;
case 3:
- case 4:
+ case 4: // 25%
mon = MONS_ROCK_TROLL;
break;
- default:
+ default: // 37.5%
mon = MONS_TROLL;
break;
}
}
- else
+ else // 181-200 -> 20
{
// giants
if (coinflip())