summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-13 15:57:55 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-13 15:57:55 +0000
commite6525c83826d150eb2a283ce5bf23218cb75f82e (patch)
treeb16a09028c1468efa825975fb1e85a3e4d722bf5 /crawl-ref/source/player.cc
parent674a9e64697629cc3266564ea4f8dc7eb2616b50 (diff)
downloadcrawl-ref-e6525c83826d150eb2a283ce5bf23218cb75f82e.tar.gz
crawl-ref-e6525c83826d150eb2a283ce5bf23218cb75f82e.zip
* Add Cannibalism to list of forbidded actions for good gods.
* Add simple warning message (god "did not appreciate that!") when using unID'd items that would otherwise be penalized. * Change protection from harm to be independent of prayer. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2849 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc82
1 files changed, 81 insertions, 1 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index eeb0a796e2..39a33acc47 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -408,6 +408,86 @@ bool player_genus(genus_type which_genus, species_type species)
return (false);
} // end player_genus()
+bool is_player_same_species(const int mon)
+{
+ switch (you.species)
+ {
+ case SP_HUMAN:
+ if (mons_species(mon) == MONS_HUMAN)
+ return (true);
+ return (false);
+ case SP_CENTAUR:
+ if (mons_species(mon) == MONS_CENTAUR)
+ return (true);
+ return (false);
+ case SP_OGRE:
+ case SP_OGRE_MAGE:
+ if (mons_species(mon) == MONS_OGRE)
+ return (true);
+ return (false);
+ case SP_TROLL:
+ if (mons_species(mon) == MONS_TROLL)
+ return (true);
+ return (false);
+ case SP_MUMMY:
+ if (mons_species(mon) == MONS_MUMMY)
+ return (true);
+ return (false);
+ case SP_VAMPIRE:
+ if (mons_species(mon) == MONS_VAMPIRE)
+ return (true);
+ return (false);
+ case SP_MINOTAUR:
+ if (mons_species(mon) == MONS_MINOTAUR)
+ return (true);
+ return (false);
+ case SP_NAGA:
+ if (mons_species(mon) == MONS_NAGA)
+ return (true);
+ return (false);
+ case SP_HILL_ORC:
+ if (mons_species(mon) == MONS_ORC)
+ return (true);
+ return (false);
+ case SP_MERFOLK:
+ if (mons_species(mon) == MONS_MERFOLK
+ || mons_species(mon) == MONS_MERMAID)
+ {
+ return (true);
+ }
+ return (false);
+
+ case SP_GREY_ELF:
+ case SP_HIGH_ELF:
+ case SP_DEEP_ELF:
+ case SP_SLUDGE_ELF:
+ if (mons_species(mon) == MONS_ELF)
+ return (true);
+ return (false);
+
+ case SP_RED_DRACONIAN:
+ case SP_WHITE_DRACONIAN:
+ case SP_GREEN_DRACONIAN:
+ case SP_GOLDEN_DRACONIAN:
+ case SP_GREY_DRACONIAN:
+ case SP_BLACK_DRACONIAN:
+ case SP_PURPLE_DRACONIAN:
+ case SP_MOTTLED_DRACONIAN:
+ case SP_PALE_DRACONIAN:
+ if (mons_species(mon) == MONS_DRACONIAN)
+ return (true);
+ return (false);
+
+ case SP_KOBOLD:
+ if (mons_species(mon) == MONS_KOBOLD)
+ return (true);
+ return (false);
+ default: // no monster equivalent
+ return (false);
+
+ }
+}
+
// checks whether the player's current species can
// use (usually wear) a given piece of equipment
// Note that EQ_BODY_ARMOUR and EQ_HELMET only check
@@ -5670,7 +5750,7 @@ void player::attacking(actor *other)
{
const monsters *mons = dynamic_cast<monsters*>(other);
if (mons_friendly(mons))
- did_god_conduct(DID_ATTACK_FRIEND, 5, mons);
+ did_god_conduct(DID_ATTACK_FRIEND, 5, true, mons);
else
pet_target = monster_index(mons);
}