summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-05-06 17:47:45 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-05-06 17:47:45 +0000
commitaaaf25173613a29674b9e86c0cd871c888749639 (patch)
treeee6abd8754aed992a1b0f7e2b3894ab4673d984e
parentdc09560ed3f01a349766baf0a2cfc016041f9a6b (diff)
downloadcrawl-ref-aaaf25173613a29674b9e86c0cd871c888749639.tar.gz
crawl-ref-aaaf25173613a29674b9e86c0cd871c888749639.zip
Make Trog's Hand grant both regeneration and magic resistance.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9741 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/abl-show.cc2
-rw-r--r--crawl-ref/source/acr.cc19
-rw-r--r--crawl-ref/source/enum.h5
-rw-r--r--crawl-ref/source/player.cc6
-rw-r--r--crawl-ref/source/religion.cc13
-rw-r--r--crawl-ref/source/spells1.cc19
-rw-r--r--crawl-ref/source/spells1.h3
7 files changed, 49 insertions, 18 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index 566cea8741..8be6b565d5 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -1682,7 +1682,7 @@ static bool _do_ability(const ability_def& abil)
case ABIL_TROG_REGENERATION:
// Trog abilities don't use or train invocations.
- cast_regen(you.piety/2);
+ cast_regen(you.piety / 2, true);
break;
case ABIL_TROG_BROTHERS_IN_ARMS:
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 48f977a3d0..8beab070af 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -2073,10 +2073,12 @@ static void _decrement_durations()
coinflip(),
"Your deflect missiles spell is about to expire...");
- _decrement_a_duration(DUR_REGENERATION,
- "Your skin stops crawling.",
- coinflip(),
- "Your skin is crawling a little less now.");
+ if (_decrement_a_duration(DUR_REGENERATION,
+ NULL, coinflip(),
+ "Your skin is crawling a little less now."))
+ {
+ remove_regen(you.attribute[ATTR_DIVINE_REGENERATION]);
+ }
if (you.duration[DUR_PRAYER] > 1)
you.duration[DUR_PRAYER]--;
@@ -2199,7 +2201,7 @@ static void _decrement_durations()
if (_decrement_a_duration(DUR_CONDENSATION_SHIELD))
remove_condensation_shield();
- if (you.duration[DUR_CONDENSATION_SHIELD] > 0 && player_res_cold() < 0)
+ if (you.duration[DUR_CONDENSATION_SHIELD] && player_res_cold() < 0)
{
mpr("You feel very cold.");
ouch(2 + random2avg(13, 2), NON_MONSTER, KILLED_BY_FREEZING);
@@ -2318,11 +2320,8 @@ static void _decrement_durations()
}
}
- if (you.duration[DUR_PARALYSIS] == 0
- && you.duration[DUR_PETRIFIED] == 0)
- {
+ if (!you.duration[DUR_PARALYSIS] && !you.duration[DUR_PETRIFIED])
mpr("You are exhausted.", MSGCH_WARN);
- }
// This resets from an actual penalty or from NO_BERSERK_PENALTY.
you.berserk_penalty = 0;
@@ -2351,7 +2350,7 @@ static void _decrement_durations()
Options.tutorial_events[TUT_YOU_ENCHANTED] = tut_slow;
}
- if (you.duration[DUR_BACKLIGHT] > 0 && !--you.duration[DUR_BACKLIGHT]
+ if (you.duration[DUR_BACKLIGHT] && !--you.duration[DUR_BACKLIGHT]
&& !you.backlit())
{
mpr("You are no longer glowing.", MSGCH_DURATION);
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 973c475fb0..74bd3723b9 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -111,7 +111,7 @@ enum ability_type
enum activity_interrupt_type
{
- AI_FORCE_INTERRUPT = 0, // Forcibly kills any activity that can be
+ AI_FORCE_INTERRUPT = 0, // Forcibly kills any activity that can be
// interrupted.
AI_KEYPRESS,
AI_FULL_HP, // Player is fully healed
@@ -141,7 +141,8 @@ enum actor_type
enum attribute_type
{
- ATTR_DIVINE_LIGHTNING_PROTECTION, // 0
+ ATTR_DIVINE_LIGHTNING_PROTECTION,
+ ATTR_DIVINE_REGENERATION,
ATTR_DIVINE_DEATH_CHANNEL,
ATTR_TRANSFORMATION,
ATTR_CARD_COUNTDOWN,
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 4f5f0a1346..7d11542b83 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -1096,7 +1096,7 @@ int player_hunger_rate(void)
if (you.species == SP_TROLL)
hunger += 3; // in addition to the +3 for fast metabolism
- if (you.duration[DUR_REGENERATION] > 0)
+ if (you.duration[DUR_REGENERATION])
hunger += 4;
// Moved here from acr.cc... maintaining the >= 40 behaviour.
@@ -1270,6 +1270,10 @@ int player_res_magic(void)
if (you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH)
rm += 50;
+ // Trog's Hand
+ if (you.attribute[ATTR_DIVINE_REGENERATION])
+ rm += 70;
+
// Enchantment effect
if (you.duration[DUR_LOWERED_MR])
rm /= 2;
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 03b797ac8b..751154dfdd 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -249,7 +249,7 @@ const char* god_gain_power_messages[NUM_GODS][MAX_GOD_ABILITIES] =
"" },
// Trog
{ "go berserk at will",
- "call upon Trog for regeneration",
+ "call upon Trog for regeneration and magic resistance",
"",
"call in reinforcements",
"" },
@@ -335,7 +335,7 @@ const char* god_lose_power_messages[NUM_GODS][MAX_GOD_ABILITIES] =
"" },
// Trog
{ "go berserk at will",
- "call upon Trog for regeneration",
+ "call upon Trog for regeneration and magic resistance",
"",
"call in reinforcements",
"" },
@@ -879,6 +879,15 @@ static void _inc_penance(god_type god, int val)
// Orcish bonuses don't apply under penance.
if (god == GOD_BEOGH)
you.redraw_armour_class = true;
+ // Neither does Trog's regeneration or magic resistance.
+ else if (god == GOD_TROG)
+ {
+ if (you.duration[DUR_REGENERATION]
+ && you.attribute[ATTR_DIVINE_REGENERATION])
+ {
+ remove_regen(true);
+ }
+ }
// Neither does Zin's divine stamina.
else if (god == GOD_ZIN)
{
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index 292a0a5b10..f6ff7ca7c3 100644
--- a/crawl-ref/source/spells1.cc
+++ b/crawl-ref/source/spells1.cc
@@ -1301,10 +1301,27 @@ void deflection(int pow)
"You feel very safe from missiles.");
}
-void cast_regen(int pow)
+void remove_regen(bool divine_ability)
+{
+ mpr("Your skin stops crawling.", MSGCH_DURATION);
+ you.duration[DUR_REGENERATION] = 0;
+ if (divine_ability)
+ {
+ mpr("You feel less resistant to magic.", MSGCH_DURATION);
+ you.attribute[ATTR_DIVINE_REGENERATION] = 0;
+ }
+}
+
+void cast_regen(int pow, bool divine_ability)
{
_increase_duration(DUR_REGENERATION, 5 + roll_dice(2, pow / 3 + 1), 100,
"Your skin crawls.");
+
+ if (divine_ability)
+ {
+ mpr("You feel resistant to magic.");
+ you.attribute[ATTR_DIVINE_REGENERATION] = 1;
+ }
}
void cast_berserk(void)
diff --git a/crawl-ref/source/spells1.h b/crawl-ref/source/spells1.h
index c8302a8c5b..e63c136fa3 100644
--- a/crawl-ref/source/spells1.h
+++ b/crawl-ref/source/spells1.h
@@ -54,7 +54,8 @@ void abjuration(int pow);
void cast_fly(int power);
void cast_insulation(int power);
-void cast_regen(int pow);
+void remove_regen(bool divine_ability = false);
+void cast_regen(int pow, bool divine_ability = false);
void cast_resist_poison(int power);
void cast_swiftness(int power);
void cast_teleport_control(int power);