summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/art-func.h
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-10-30 20:04:45 +0100
committerAdam Borowski <kilobyte@angband.pl>2013-10-30 20:04:45 +0100
commit1920e206283180c58ab8b6055076ab3e91989eda (patch)
tree7bb14609516a78623bc0075cf7a27435c2b9c4d6 /crawl-ref/source/art-func.h
parentd938c595830be2dcaae8d99621945988006b2f69 (diff)
downloadcrawl-ref-1920e206283180c58ab8b6055076ab3e91989eda.tar.gz
crawl-ref-1920e206283180c58ab8b6055076ab3e91989eda.zip
Elemental Staff rework, try 2.
It's a 100% staff now (per the name) rather than 25% as it was before. In return, its special damage has been improved, and no longer depends on the base hit. The new formula has the same damage as the elec brand (obeying one of random four resistances), with a chance of proccing depending on the Evoc skill. At 27 skill, it does ~2/3 damage of enhancer staves. It lacks the power boost (ie, the main reason to use such staves) but its awesome resists make it a good fixedart.
Diffstat (limited to 'crawl-ref/source/art-func.h')
-rw-r--r--crawl-ref/source/art-func.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/crawl-ref/source/art-func.h b/crawl-ref/source/art-func.h
index 7046c2ad65..af45af3520 100644
--- a/crawl-ref/source/art-func.h
+++ b/crawl-ref/source/art-func.h
@@ -23,6 +23,7 @@
#include "cloud.h" // For storm bow's and robe of clouds' rain
#include "effects.h" // For Sceptre of Torment tormenting
#include "env.h" // For storm bow env.cgrid
+#include "fight.h"
#include "food.h" // For evokes
#include "godconduct.h" // did_god_conduct
#include "misc.h"
@@ -898,3 +899,49 @@ static void _HIGH_COUNCIL_world_reacts(item_def *item)
string msg = getSpeakString("hat of the High Council");
item_noise(*item, msg);
}
+
+///////////////////////////////////////////////////
+
+static void _ELEMENTAL_STAFF_melee_effects(item_def* item, actor* attacker,
+ actor* defender, bool mondied, int dam)
+{
+ int evoc = attacker->skill(SK_EVOCATIONS, 27);
+
+ if (mondied || !(x_chance_in_y(evoc, 729) || x_chance_in_y(evoc, 729)))
+ return;
+
+ int d = 10 + random2(15);
+
+ const char *verb;
+ switch (random2(4))
+ {
+ case 0:
+ d = resist_adjust_damage(defender, BEAM_FIRE,
+ defender->res_fire(), d);
+ verb = "burn";
+ break;
+ case 1:
+ d = resist_adjust_damage(defender, BEAM_COLD,
+ defender->res_cold(), d);
+ verb = "freeze";
+ break;
+ case 2:
+ d = resist_adjust_damage(defender, BEAM_ELECTRICITY,
+ defender->res_elec(), d);
+ verb = "electrocute";
+ break;
+ case 3:
+ d = defender->apply_ac(d);
+ verb = "crush";
+ break;
+ }
+
+ if (!d)
+ return;
+
+ mprf("%s %s %s.",
+ attacker->name(DESC_THE).c_str(),
+ attacker->is_player() ? verb : pluralise(verb).c_str(),
+ defender->name(DESC_THE).c_str());
+ defender->hurt(attacker, d);
+}