diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-02-08 09:12:58 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-02-08 09:12:58 +0000 |
commit | 6a7804a077312c11ade9582bf5957628046ea3d7 (patch) | |
tree | a84abd9cb89482ba7e2065ab481f15ccc1e41267 /crawl-ref/source/player.cc | |
parent | bf1085165e25a72de45edd793a6b9f17752a4a38 (diff) | |
download | crawl-ref-6a7804a077312c11ade9582bf5957628046ea3d7.tar.gz crawl-ref-6a7804a077312c11ade9582bf5957628046ea3d7.zip |
Hydras now behave the same way in monster-vs-monster combat as they do in
player vs monster. Specifically, hydras get their as many attacks as they have
heads vs other monsters, and other monsters can chop off hydra heads (at 25% of
the probability that the player has of chopping off heads).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@936 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 4cd501d463..dea3890397 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -57,8 +57,42 @@ #include "tutorial.h" #include "view.h" +///////////////////////////////////////////////////////////////////////////// +// Actor stuff - generic functions that can be called with a monster pointer, +// or NULL for the player. + +std::string pronoun_you(description_level_type desc) +{ + return (desc == DESC_CAP_A || desc == DESC_CAP_THE? "You" : "you"); +} + +std::string actor_name(const monsters *actor, description_level_type desc) +{ + return (actor? ptr_monam(actor, desc) : pronoun_you(desc)); +} + +// actor_verb(NULL, "chop") == chop, as in "You chop" +// actor_verb(monster, "chop") == chops, as in "The skeletal warrior chops". +std::string actor_verb(const monsters *actor, const std::string &verb) +{ + // Simplistic - we really should be conjugating the verb + // appropriately. We'll special-case as necessary. + return (actor? verb + "s" : verb); +} + +int actor_damage_type(const monsters *actor) +{ + return (actor? mons_damage_type(actor) : player_damage_type()); +} + +int actor_damage_brand(const monsters *actor) +{ + return (actor? mons_damage_brand(actor) : player_damage_brand()); +} + /* you.duration []: //jmf: obsolete, see enum.h instead + //[ds] Well, can we lose it yet? 0 - liquid flames 1 - icy armour 2 - repel missiles @@ -600,14 +634,18 @@ int player_damage_type( void ) return (get_vorpal_type(you.inv[wpn])); } else if (you.equip[EQ_GLOVES] == -1 && - (you.attribute[ATTR_TRANSFORMATION] == TRAN_BLADE_HANDS - || you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON - || you.mutation[MUT_CLAWS] - || you.species == SP_TROLL - || you.species == SP_GHOUL)) + you.attribute[ATTR_TRANSFORMATION] == TRAN_BLADE_HANDS) { return (DVORP_SLICING); } + else if (you.equip[EQ_GLOVES] == -1 && + (you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON + || you.mutation[MUT_CLAWS] + || you.species == SP_TROLL + || you.species == SP_GHOUL)) + { + return (DVORP_CLAWING); + } return (DVORP_CRUSHING); } |