diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-29 22:59:35 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-29 22:59:35 +0000 |
commit | 63036c9e5ed0103475fea0c6710317f15e8cdb24 (patch) | |
tree | c6e731b631741fc069a6baeb80bf15c58458e9e0 /crawl-ref/source/player.cc | |
parent | e744cede0540585248737db8e27a8320e5476955 (diff) | |
download | crawl-ref-63036c9e5ed0103475fea0c6710317f15e8cdb24.tar.gz crawl-ref-63036c9e5ed0103475fea0c6710317f15e8cdb24.zip |
Implemented monster spell miscasts. Spell miscasting is now handled
by the MiscastEffect class, which has helper methods to make most of
the non-helper code agnostic with respect to whether the miscaster is
the player or a monster. Mummy death curses now affect monsters, and
Zot traps now directly affect friendly and good-neutral monsters.
In wizard mode you can force the player or a monster to miscast by
targeting it and pressing 'M'.
Todo/issues/notes:
* Clouds now have a killer_type in addition to a kill_category.
* There aren't any divination monster miscast effects yet.
* Many of the harmless message-only miscast effects are missing
monster messages.
* If a monster actually miscasts a spell (not getting a mummy
death curse or setting off a Zot trap) and this kills both the
monster and the player then the wrong monster will be listed in
hiscore entry. Since monsters can't do true spell miscasts yet, this
can wait.
* There was old, non-functioning code making Zot traps heal, haste or
turn invisible hostile monsters that triggered it. I fixed it and
then commented it out.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6723 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 61 |
1 files changed, 57 insertions, 4 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 23ca730271..3b5e0d7d7d 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -5954,12 +5954,12 @@ item_def *player::shield() return slot_item(EQ_SHIELD); } -std::string player::name(description_level_type type) const +std::string player::name(description_level_type type, bool) const { return (pronoun_you(type)); } -std::string player::pronoun(pronoun_type pro) const +std::string player::pronoun(pronoun_type pro, bool) const { switch (pro) { @@ -5977,6 +5977,54 @@ std::string player::conj_verb(const std::string &verb) const return (verb); } +std::string player::hand_name(bool plural, bool *can_plural) const +{ + if (can_plural != NULL) + *can_plural = true; + return your_hand(plural); +} + +std::string player::foot_name(bool plural, bool *can_plural) const +{ + bool _can_plural; + if (can_plural == NULL) + can_plural = &_can_plural; + *can_plural = true; + + std::string str; + + if (you.attribute[ATTR_TRANSFORMATION] == TRAN_AIR) + { + str = "lowest portion"; + *can_plural = false; + } + else if (!transform_changed_physiology()) + { + if (player_mutation_level(MUT_HOOVES)) + str = "hoof"; + else if (player_mutation_level(MUT_TALONS)) + str = "talon"; + else if (you.species == SP_NAGA) + { + str = "underbelly"; + *can_plural = false; + } + else if (you.species == SP_MERFOLK && player_is_swimming()) + { + str = "tail"; + *can_plural = false; + } + } + + if (str.empty()) + return (plural ? "feet" : "foot"); + + if (plural && *can_plural) + str = pluralise(str); + + return str; +} + int player::id() const { return (-1); @@ -6335,6 +6383,11 @@ int player::res_rotting() const return 0; } +int player::res_torment() const +{ + return player_res_torment(); +} + bool player::confusable() const { return (player_mental_clarity() == 0); @@ -6423,9 +6476,9 @@ void player::expose_to_element(beam_type element, int st) ::expose_player_to_element(element, st); } -void player::blink() +void player::blink(bool allow_partial_control) { - random_blink(true); + random_blink(allow_partial_control); } void player::teleport(bool now, bool abyss_shift) |