Of course I had not, thanks for the pointer.
From f48ff8426ef93b64d2a490811dd1d3b156fe9195 Mon Sep 17 00:00:00 2001
From: Chris Oelmueller <chris.oelmueller@gmail.com>
Date: Wed, 31 Jul 2013 03:11:17 +0200
Subject: Make Trog hate all spells but not spells in rods
This should display them as "forbidden" in the M screen, fixing 0001588.
Still maintaining that a proper fix here would be to make Trog hate rod
spells though.
---
crawl-ref/source/religion.cc | 5 ++++-
crawl-ref/source/religion.h | 3 ++-
crawl-ref/source/spl-util.cc | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 4cbe67e..df0394c 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -3878,11 +3878,14 @@ bool god_likes_spell(spell_type spell, god_type god)
}
}
-bool god_hates_spell(spell_type spell, god_type god)
+bool god_hates_spell(spell_type spell, god_type god, bool rod_spell)
{
if (is_good_god(god) && (is_unholy_spell(spell) || is_evil_spell(spell)))
return true;
+ if (god == GOD_TROG && !rod_spell)
+ return true;
+
unsigned int disciplines = get_spell_disciplines(spell);
switch (god)
diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h
index c5ac3d4..6706d4d 100644
--- a/crawl-ref/source/religion.h
+++ b/crawl-ref/source/religion.h
@@ -65,7 +65,8 @@ bool god_hates_killing(god_type god, const monster* mon);
bool god_likes_fresh_corpses(god_type god);
bool god_likes_butchery(god_type god);
bool god_likes_spell(spell_type spell, god_type god);
-bool god_hates_spell(spell_type spell, god_type god);
+bool god_hates_spell(spell_type spell, god_type god,
+ bool rod_spell = false);
bool god_loathes_spell(spell_type spell, god_type god);
bool god_can_protect_from_harm(god_type god);
int elyvilon_lifesaving();
diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc
index 2b66185..95cdce1 100644
--- a/crawl-ref/source/spl-util.cc
+++ b/crawl-ref/source/spl-util.cc
@@ -1203,7 +1203,7 @@ int spell_highlight_by_utility(spell_type spell, int default_color,
{
// If your god hates the spell, that
// overrides all other concerns
- if (god_hates_spell(spell, you.religion))
+ if (god_hates_spell(spell, you.religion, rod_spell))
return COL_FORBIDDEN;
if (_spell_is_empowered(spell) && !rod_spell)
--
1.8.3.4
|