Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0007412 [DCSS] Patches tweak always 2013-07-30 17:36 2013-08-02 00:12
Reporter chris View Status public  
Assigned To neil
Priority normal Resolution done  
Status closed   Product Branch 0.13 ancient branch
Summary 0007412: Make Trog hate spells
Description
From 42d26d06792658b1da28ddf470da502f5621f0c8 Mon Sep 17 00:00:00 2001
From: Chris Oelmueller <chris.oelmueller@gmail.com>
Date: Tue, 30 Jul 2013 17:30:29 +0200
Subject: Make Trog hate all spells

This should display them as "forbidden" in the M screen, fixing 0001588.
---
 crawl-ref/source/religion.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 4cbe67e..6fb501f 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -3883,6 +3883,9 @@ bool god_hates_spell(spell_type spell, god_type god)
     if (is_good_god(god) && (is_unholy_spell(spell) || is_evil_spell(spell)))
         return true;
 
+    if (god == GOD_TROG)
+        return true;
+
     unsigned int disciplines = get_spell_disciplines(spell);
 
     switch (god)
-- 
1.8.3.4
Additional Information
Tags No tags attached.
Attached Files

- Relationships
child of 0001588resolvedneil Spells aren't marked as disliked for Trog 

-  Notes
(0023593)
chris (updater)
2013-07-30 17:38

Note that if you memorize spells through `r`eading a book (which is red in the inventory) or the `M` screen (where the spell should now be lightred), there is no further warning that memorizing this will incur penance except the color hint - should there be one?
(0023596)
neil (administrator)
2013-07-30 22:34

Did you test rods? I worry this will mark rods as hated too, but haven't had a chance to test it yet.
(0023600)
chris (updater)
2013-07-31 03:14

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
(0023623)
neil (administrator)
2013-08-02 00:11

Applied in trunk (0.13-a0-2590-g8c14591), thanks!

- Issue History
Date Modified Username Field Change
2013-07-30 17:36 chris New Issue
2013-07-30 17:38 chris Note Added: 0023593
2013-07-30 22:34 neil Note Added: 0023596
2013-07-31 03:14 chris Note Added: 0023600
2013-08-02 00:10 neil Relationship added child of 0001588
2013-08-02 00:11 neil Note Added: 0023623
2013-08-02 00:11 neil Status new => resolved
2013-08-02 00:11 neil Fixed in Branch => 0.13 development branch
2013-08-02 00:11 neil Resolution open => done
2013-08-02 00:11 neil Assigned To => neil
2013-08-02 00:12 chris Status resolved => closed


Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker