diff options
author | Neil Moore <neil@s-z.org> | 2012-12-16 21:06:07 -0500 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2012-12-16 22:42:27 -0500 |
commit | 251c4eefad2ecb921549c0920a1de381aa801ce7 (patch) | |
tree | 943d7bfcf88e0a0b360cfcd0ae6c64312fecd954 /crawl-ref/source/l_you.cc | |
parent | 64abc101d999d4d937e519d7acf787a5da99be88 (diff) | |
download | crawl-ref-251c4eefad2ecb921549c0920a1de381aa801ce7.tar.gz crawl-ref-251c4eefad2ecb921549c0920a1de381aa801ce7.zip |
Refactor amulet and equipment-checking functions.
Move most of the player_* functions related to amulets, and all of the
player_effect_* functions, into class actor, with some overridden in
class player. Likewise, move player_equip(), player_equip_ego_type(),
and scan_artefacts() into class player, with pure virtuals in class
actor and corresponding implementations in class monster. Also remove a
few now-redundant functions.
This commit doesn't actually make any kinds of equipment have an effect
on monsters that didn't already, but it should be much easier to do so
now, since the relevant methods are there now. Monster gourmand,
conservation, faith don't necessarily make sense, but those methods are
in actor anyway for consistency with the rest.
Fixes #6172. We now check for innate gourmand (etc.) without reference
to suppression.
Diffstat (limited to 'crawl-ref/source/l_you.cc')
-rw-r--r-- | crawl-ref/source/l_you.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/crawl-ref/source/l_you.cc b/crawl-ref/source/l_you.cc index c37b6eddc6..d1b9cded9e 100644 --- a/crawl-ref/source/l_you.cc +++ b/crawl-ref/source/l_you.cc @@ -115,12 +115,13 @@ LUARET1(you_res_cold, number, player_res_cold(false)) LUARET1(you_res_draining, number, player_prot_life(false)) LUARET1(you_res_shock, number, player_res_electricity(false)) LUARET1(you_res_statdrain, number, player_sust_abil(false)) -LUARET1(you_res_mutation, number, wearing_amulet(AMU_RESIST_MUTATION, false)) +LUARET1(you_res_mutation, number, you.rmut_from_item(false) ? 1 : 0) LUARET1(you_see_invisible, boolean, you.can_see_invisible(false)) -LUARET1(you_spirit_shield, number, player_spirit_shield()) -LUARET1(you_gourmand, boolean, wearing_amulet(AMU_THE_GOURMAND, false)) -LUARET1(you_conservation, boolean, player_item_conserve(false)) -LUARET1(you_res_corr, boolean, player_res_corr(false)) +// Returning a number so as not to break existing scripts. +LUARET1(you_spirit_shield, number, you.spirit_shield(false) ? 1 : 0) +LUARET1(you_gourmand, boolean, you.gourmand(false)) +LUARET1(you_conservation, boolean, you.conservation(false)) +LUARET1(you_res_corr, boolean, you.res_corr(false)) LUARET1(you_like_chunks, number, player_likes_chunks(true)) LUARET1(you_saprovorous, number, player_mutation_level(MUT_SAPROVOROUS)) LUARET1(you_flying, boolean, you.flight_mode()) |