summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2010-01-15 19:07:58 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2010-01-15 19:13:08 +1000
commit9e2960c3a8067a5365a1261209528a1ee79b7b6d (patch)
tree4c954d9872093b6e9ee0803606629f7dac4cc847
parent03588849963bb625e961f4f256ed5f4fa0ed6cb3 (diff)
downloadcrawl-ref-9e2960c3a8067a5365a1261209528a1ee79b7b6d.tar.gz
crawl-ref-9e2960c3a8067a5365a1261209528a1ee79b7b6d.zip
Fix bugs involving branded ammunition and their messages.
This fix multiple bugs, including one reported on SourceForge that Poison Weapon wasn't working properly for any launchers; that has now been fixed. This commit should also solve the issue with "poisoned poison arrow" and "arrow of flame of flame". Hopefully we won't see any more of them.
-rw-r--r--crawl-ref/source/item_use.cc46
1 files changed, 22 insertions, 24 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index ac4953d619..4e345054cb 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -2112,30 +2112,6 @@ bool setup_missile_beam(const actor *agent, bolt &beam, item_def &item,
bow_brand = get_weapon_brand(*launcher);
int ammo_brand = get_ammo_brand(item);
- bool poisoned = ammo_brand == SPMSL_POISONED;
-
- const bool exploding = ammo_brand == SPMSL_EXPLODING;
- const bool penetrating = (!exploding
- && (bow_brand == SPWPN_PENETRATION
- || ammo_brand == SPMSL_PENETRATION));
- const bool silver = (ammo_brand == SPMSL_SILVER);
- const bool disperses = (ammo_brand == SPMSL_DISPERSAL);
- const bool reaping = (bow_brand == SPWPN_REAPING
- || ammo_brand == SPMSL_REAPING)
- && bow_brand != SPWPN_HOLY_WRATH;
- const bool charged = bow_brand == SPWPN_ELECTROCUTION;
- const bool blessed = bow_brand == SPWPN_HOLY_WRATH
- && ammo_brand != SPMSL_REAPING;
-
- const bool paralysis = ammo_brand == SPMSL_PARALYSIS;
- const bool slow = ammo_brand == SPMSL_SLOW;
- const bool sleep = ammo_brand == SPMSL_SLEEP;
- const bool confusion = ammo_brand == SPMSL_CONFUSION;
- const bool sickness = ammo_brand == SPMSL_SICKNESS;
- const bool rage = ammo_brand == SPMSL_RAGE;
-
-
- ASSERT(!exploding || !is_artefact(item));
// Launcher brand does not affect ammunition.
if (ammo_brand != SPMSL_NORMAL && bow_brand != SPWPN_NORMAL)
@@ -2151,6 +2127,28 @@ bool setup_missile_beam(const actor *agent, bolt &beam, item_def &item,
bow_brand = SPWPN_NORMAL;
}
+ bool poisoned = (bow_brand == SPWPN_VENOM
+ || ammo_brand == SPMSL_POISONED);
+
+ const bool exploding = (ammo_brand == SPMSL_EXPLODING);
+ const bool penetrating = (bow_brand == SPWPN_PENETRATION
+ || ammo_brand == SPMSL_PENETRATION);
+ const bool silver = (ammo_brand == SPMSL_SILVER);
+ const bool disperses = (ammo_brand == SPMSL_DISPERSAL);
+ const bool reaping = (bow_brand == SPWPN_REAPING
+ || ammo_brand == SPMSL_REAPING);
+ const bool charged = bow_brand == SPWPN_ELECTROCUTION;
+ const bool blessed = bow_brand == SPWPN_HOLY_WRATH;
+
+ const bool paralysis = ammo_brand == SPMSL_PARALYSIS;
+ const bool slow = ammo_brand == SPMSL_SLOW;
+ const bool sleep = ammo_brand == SPMSL_SLEEP;
+ const bool confusion = ammo_brand == SPMSL_CONFUSION;
+ const bool sickness = ammo_brand == SPMSL_SICKNESS;
+ const bool rage = ammo_brand == SPMSL_RAGE;
+
+ ASSERT(!exploding || !is_artefact(item));
+
beam.name = item.name(DESC_PLAIN, false, false, false);
// Print type of item as influenced by launcher.