summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-20 03:35:47 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-20 03:35:47 +0000
commit76045c6d3d8d2fb15acf777d5998ef26aab764fa (patch)
tree9cfe433a26ca922e960eb71a5aaf74f0637239ab /crawl-ref/source
parentd92b5fb96be89a88b46a1061d4aba731bd56cd2b (diff)
downloadcrawl-ref-76045c6d3d8d2fb15acf777d5998ef26aab764fa.tar.gz
crawl-ref-76045c6d3d8d2fb15acf777d5998ef26aab764fa.zip
Add various patches of mine:
[1824221] don't give Yred-worshipping demonspawn the "raise dead" mutation [1829258] remove wrongly hardcoded exp-draining resistance for undead [1829691] typo fixes [1830030] clean up random god servant handling [1829890] fix divine retribution messages, generalize berserker summoning git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2877 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/abl-show.cc4
-rw-r--r--crawl-ref/source/decks.cc2
-rw-r--r--crawl-ref/source/mon-data.h2
-rw-r--r--crawl-ref/source/mutation.cc12
-rw-r--r--crawl-ref/source/ouch.cc2
-rw-r--r--crawl-ref/source/religion.cc100
-rw-r--r--crawl-ref/source/spells2.cc13
-rw-r--r--crawl-ref/source/spells2.h2
8 files changed, 82 insertions, 55 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index a7fa3bba2c..3892ceb210 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -1573,7 +1573,9 @@ static bool do_ability(const ability_def& abil)
case ABIL_TROG_BROTHERS_IN_ARMS:
// Trog abilities don't use or train invocations.
- summon_berserker();
+ summon_berserker(you.piety +
+ random2(you.piety/4) - random2(you.piety/4),
+ true);
break;
case ABIL_SIF_MUNA_FORGET_SPELL:
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc
index 0b59b66c7a..2775aa514a 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -1114,7 +1114,7 @@ static int xom_check_card(item_def &deck, card_type card,
switch (card)
{
case CARD_XOM:
- // Handled elswehre
+ // Handled elsewhere
amusement = 0;
break;
diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h
index de9adb26e2..54046d17b8 100644
--- a/crawl-ref/source/mon-data.h
+++ b/crawl-ref/source/mon-data.h
@@ -43,7 +43,7 @@
holy wrath weapons
natural - baseline monster type
undead - immunity from draining, pain, torment; extra
- damage from hoyl wrath/disruption; affected by
+ damage from holy wrath/disruption; affected by
repel undead and holy word
demonic - similar to undead, but holy wrath does even
more damage and disruption and repel undead
diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc
index a09ee6313f..9c66dbcbe7 100644
--- a/crawl-ref/source/mutation.cc
+++ b/crawl-ref/source/mutation.cc
@@ -245,6 +245,8 @@ const char *mutation_descrip[][3] = {
{"You can summon demons to your aid.", "", ""},
{"You can hurl blasts of hellfire.", "", ""},
{"You can call on the torments of Hell.", "", ""},
+
+ /* Not summoners/necromancers/worshippers of Yredelemnul */
{"You can raise the dead to walk for you.", "", ""},
// 50
{"You can control demons.", "", ""},
@@ -2218,7 +2220,8 @@ void demonspawn(void)
}
// Makhlebites have the summonings invocation
- if ((you.religion != GOD_MAKHLEB || you.piety < 100) &&
+ if ((you.religion != GOD_MAKHLEB ||
+ you.piety < piety_breakpoint(3)) &&
you.skills[SK_SUMMONINGS] < 5 && one_chance_in(3))
{ // good summoners don't get summon demon
whichm = MUT_SUMMON_DEMONS;
@@ -2294,8 +2297,11 @@ void demonspawn(void)
howm = 1;
}
- if (you.skills[SK_SUMMONINGS] < 3 && you.skills[SK_NECROMANCY] < 3
- && one_chance_in(10))
+ // Yredelemnulites have the raise dead invocation
+ if ((you.religion != GOD_YREDELEMNUL ||
+ you.piety < piety_breakpoint(3)) &&
+ you.skills[SK_SUMMONINGS] < 3 &&
+ you.skills[SK_NECROMANCY] < 3 && one_chance_in(10))
{
whichm = MUT_RAISE_DEAD;
howm = 1;
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index 8a86114499..a58b4dc0f5 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -633,7 +633,7 @@ void drain_exp(bool announce_full)
return;
}
- if (protection >= 3 || you.is_undead)
+ if (protection >= 3)
{
if ( announce_full )
mpr("You fully resist.");
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 8f203d69fc..3c666090c9 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -449,20 +449,45 @@ static void inc_gift_timeout(int val)
you.gift_timeout += val;
} // end inc_gift_timeout()
-static monster_type random_undead_servant(int religion /* unused */)
+// Only Yredelemnul and Okawaru use this for now
+static monster_type random_servant(god_type god)
{
// error trapping {dlb}
monster_type thing_called = MONS_PROGRAM_BUG;
int temp_rand = random2(100);
- thing_called = ((temp_rand > 66) ? MONS_WRAITH : // 33%
- (temp_rand > 52) ? MONS_WIGHT : // 12%
- (temp_rand > 40) ? MONS_SPECTRAL_WARRIOR : // 16%
- (temp_rand > 31) ? MONS_ROTTING_HULK : // 9%
- (temp_rand > 23) ? MONS_SKELETAL_WARRIOR : // 8%
- (temp_rand > 16) ? MONS_VAMPIRE : // 7%
- (temp_rand > 10) ? MONS_GHOUL : // 6%
- (temp_rand > 4) ? MONS_MUMMY // 6%
- : MONS_FLAYED_GHOST); // 5%
+
+ switch (god)
+ {
+ case GOD_YREDELEMNUL:
+ // undead
+ thing_called = ((temp_rand > 66) ? MONS_WRAITH : // 33%
+ (temp_rand > 52) ? MONS_WIGHT : // 12%
+ (temp_rand > 40) ? MONS_SPECTRAL_WARRIOR : // 16%
+ (temp_rand > 31) ? MONS_ROTTING_HULK : // 9%
+ (temp_rand > 23) ? MONS_SKELETAL_WARRIOR : // 8%
+ (temp_rand > 16) ? MONS_VAMPIRE : // 7%
+ (temp_rand > 10) ? MONS_GHOUL : // 6%
+ (temp_rand > 4) ? MONS_MUMMY // 6%
+ : MONS_FLAYED_GHOST); // 5%
+ break;
+ case GOD_OKAWARU:
+ // warriors
+ thing_called = ((temp_rand > 84) ? MONS_ORC_WARRIOR :
+ (temp_rand > 69) ? MONS_ORC_KNIGHT :
+ (temp_rand > 59) ? MONS_NAGA_WARRIOR :
+ (temp_rand > 49) ? MONS_CENTAUR_WARRIOR :
+ (temp_rand > 39) ? MONS_STONE_GIANT :
+ (temp_rand > 29) ? MONS_FIRE_GIANT :
+ (temp_rand > 19) ? MONS_FROST_GIANT :
+ (temp_rand > 9) ? MONS_CYCLOPS :
+ (temp_rand > 4) ? MONS_HILL_GIANT
+ : MONS_TITAN);
+
+ break;
+ default:
+ break;
+ }
+
return (thing_called);
}
@@ -782,13 +807,12 @@ static void do_god_gift(bool prayed_for)
case GOD_YREDELEMNUL:
if (random2(you.piety) > 80 && one_chance_in(5))
{
- monster_type thing_called =
- random_undead_servant(GOD_YREDELEMNUL);
+ monster_type thing_called =
+ random_servant(GOD_YREDELEMNUL);
- if (create_monster( thing_called, 0, BEH_FRIENDLY,
- you.x_pos, you.y_pos,
- you.pet_target, MAKE_ITEM_RANDOM_RACE )
- != -1)
+ if (create_monster(thing_called, 0, BEH_FRIENDLY,
+ you.x_pos, you.y_pos, you.pet_target,
+ MAKE_ITEM_RANDOM_RACE) != -1)
{
simple_god_message(" grants you an undead servant!");
more();
@@ -2109,9 +2133,10 @@ static bool zin_retribution()
if (!is_evil_god(you.religion))
return false;
+ bool success = false;
+
if (random2(you.experience_level) > 7 && !one_chance_in(5))
{
- bool success = false;
const int how_many = 1 + (you.experience_level / 10) + random2(3);
for (int i = 0; i < how_many; i++)
@@ -2128,8 +2153,11 @@ static bool zin_retribution()
else
{
// god_gift == false gives unfriendly
- summon_swarm( you.experience_level * 20, true, false );
- simple_god_message(" sends a plague down upon you!", god);
+ success = summon_swarm( you.experience_level * 20, true, false );
+ simple_god_message(success ?
+ " sends a plague down upon you!" :
+ "'s plague fails to arrive.",
+ god);
}
return false;
@@ -2213,13 +2241,11 @@ static bool yredelemnul_retribution()
for (int i = 0; i < how_many; i++)
{
- monster_type punisher =
- random_undead_servant(GOD_YREDELEMNUL);
+ monster_type punisher = random_servant(GOD_YREDELEMNUL);
- if (create_monster( punisher, 0, BEH_HOSTILE,
- you.x_pos, you.y_pos, MHITYOU, 250 ) != -1)
+ if (create_monster(punisher, 0, BEH_HOSTILE,
+ you.x_pos, you.y_pos, MHITYOU, 250) != -1)
count++;
-
}
simple_god_message(count > 1? " sends servants to punish you." :
@@ -2245,7 +2271,7 @@ static bool trog_retribution()
{
// Would be better if berserking monsters were available,
// we just send some big bruisers for now.
- bool success = false;
+ int count = 0;
int points = 3 + you.experience_level * 3;
while (points > 0)
@@ -2275,13 +2301,12 @@ static bool trog_retribution()
if (create_monster(punisher, 0, BEH_HOSTILE, you.x_pos,
you.y_pos, MHITYOU, 250) != -1)
- success = true;
+ count++;
}
-
- simple_god_message(success ?
- " sends monsters to punish you." :
- " has no time to punish you...now.",
- god);
+
+ simple_god_message(count > 1 ? " sends monsters to punish you." :
+ count > 0 ? " sends a monster to punish you." :
+ " has no time to punish you...now.", god);
}
else if ( !one_chance_in(3) )
{
@@ -2469,18 +2494,7 @@ static bool okawaru_retribution()
for (int i = 0; i < how_many; i++)
{
- const int temp_rand = random2(100);
-
- monster_type punisher = ((temp_rand > 84) ? MONS_ORC_WARRIOR :
- (temp_rand > 69) ? MONS_ORC_KNIGHT :
- (temp_rand > 59) ? MONS_NAGA_WARRIOR :
- (temp_rand > 49) ? MONS_CENTAUR_WARRIOR :
- (temp_rand > 39) ? MONS_STONE_GIANT :
- (temp_rand > 29) ? MONS_FIRE_GIANT :
- (temp_rand > 19) ? MONS_FROST_GIANT :
- (temp_rand > 9) ? MONS_CYCLOPS :
- (temp_rand > 4) ? MONS_HILL_GIANT
- : MONS_TITAN);
+ monster_type punisher = random_servant(GOD_OKAWARU);
if (create_monster(punisher, 0, BEH_HOSTILE,
you.x_pos, you.y_pos, MHITYOU, 250) != -1)
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index 5b1f6b5350..00bfd13163 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -1480,12 +1480,13 @@ void summon_ice_beast_etc(int pow, int ibc, bool divine_gift)
false, false, false, true);
} // end summon_ice_beast_etc()
-// Trog sends some fighting buddies for his followers
-void summon_berserker()
+// Trog sends some fighting buddies for his followers (or enemies if
+// god_gift is false)
+bool summon_berserker(int pow, bool god_gift)
{
- beh_type beha = BEH_GOD_GIFT;
- int pow = you.piety + random2(you.piety/4) - random2(you.piety/4);
+ beh_type beha = (god_gift) ? BEH_GOD_GIFT : BEH_HOSTILE;
int numsc = std::min(2 + (random2(pow) / 4), 6);
+ bool success = false;
monster_type mon = MONS_TROLL;
@@ -1540,6 +1541,8 @@ void summon_berserker()
if (mons != -1)
{
+ success = true;
+
monsters *summon = &menv[mons];
summon->go_berserk(false);
mon_enchant berserk = summon->get_ench(ENCH_BERSERK);
@@ -1553,6 +1556,8 @@ void summon_berserker()
summon->update_ench(berserk);
summon->update_ench(abj);
}
+
+ return success;
} // end summon_berserker()
bool summon_swarm( int pow, bool unfriendly, bool god_gift )
diff --git a/crawl-ref/source/spells2.h b/crawl-ref/source/spells2.h
index 9fc45ef1b0..57de63e987 100644
--- a/crawl-ref/source/spells2.h
+++ b/crawl-ref/source/spells2.h
@@ -155,7 +155,7 @@ void summon_animals(int pow);
* *********************************************************************** */
void summon_small_mammals(int pow);
-void summon_berserker();
+bool summon_berserker(int pow, bool god_gift);
// last updated 24may2000 {dlb}
/* ***********************************************************************