summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-07 14:55:57 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-07 14:55:57 +0000
commit31a05064c33c78579f5e0c1af3302350f06046c2 (patch)
treeecc0c37f84effe74698bd8ccb7193ccd1c28663e /crawl-ref/source/fight.cc
parentff1a1fcbf85c8d8b263fa8dbffda35f76ce9a5e5 (diff)
downloadcrawl-ref-31a05064c33c78579f5e0c1af3302350f06046c2.tar.gz
crawl-ref-31a05064c33c78579f5e0c1af3302350f06046c2.zip
[1808968] Using the weapons of the demon lords in combat angers TSO and Zin.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2365 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc41
1 files changed, 31 insertions, 10 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 39b1dfc6e1..857daf5109 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -1450,12 +1450,8 @@ void melee_attack::player_exercise_combat_skills()
}
}
-// Returns true if the combat round should end here.
-bool melee_attack::player_monattk_hit_effects(bool mondied)
+void melee_attack::player_check_weapon_effects()
{
- if (mons_holiness(def) == MH_HOLY)
- did_god_conduct(mondied? DID_KILL_ANGEL : DID_ATTACK_HOLY, 1);
-
if (spwld == SPWLD_TORMENT && coinflip())
{
torment(TORMENT_SPWLD, you.x_pos, you.y_pos);
@@ -1465,12 +1461,37 @@ bool melee_attack::player_monattk_hit_effects(bool mondied)
if (spwld == SPWLD_ZONGULDROK || spwld == SPWLD_CURSE)
did_god_conduct(DID_NECROMANCY, 3);
- if (weapon
- && weapon->base_type == OBJ_WEAPONS
- && is_demonic( *weapon ))
+ if (weapon)
{
- did_god_conduct(DID_UNHOLY, 1);
- }
+ if (weapon->base_type == OBJ_WEAPONS
+ && is_demonic( *weapon ))
+ {
+ did_god_conduct(DID_UNHOLY, 1);
+ }
+
+ if (is_fixed_artefact(*weapon))
+ {
+ switch (weapon->special)
+ {
+ case SPWPN_SCEPTRE_OF_ASMODEUS:
+ case SPWPN_STAFF_OF_DISPATER:
+ case SPWPN_SWORD_OF_CEREBOV:
+ did_god_conduct(DID_UNHOLY, 3);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+}
+
+// Returns true if the combat round should end here.
+bool melee_attack::player_monattk_hit_effects(bool mondied)
+{
+ if (mons_holiness(def) == MH_HOLY)
+ did_god_conduct(mondied? DID_KILL_ANGEL : DID_ATTACK_HOLY, 1);
+
+ player_check_weapon_effects();
// Vampiric effects for the killing blow.
if (mondied && damage_brand == SPWPN_VAMPIRICISM)