summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/abl-show.h
diff options
context:
space:
mode:
authorStefan O'Rear <stefanor@cox.net>2009-11-02 22:12:06 -0800
committerStefan O'Rear <stefanor@cox.net>2009-11-02 22:12:55 -0800
commit0addd910ea1fec2edab2a0672cd086ee83c19f67 (patch)
treeb154cde334309ab4c5dc3fd631c45758002a48fc /crawl-ref/source/abl-show.h
parent2ffa9dc23fdcedf0f014c4ee85daa38f33b1dadd (diff)
downloadcrawl-ref-0addd910ea1fec2edab2a0672cd086ee83c19f67.tar.gz
crawl-ref-0addd910ea1fec2edab2a0672cd086ee83c19f67.zip
Mutated spell-like abilities are fueled by %HP, not MP
Diffstat (limited to 'crawl-ref/source/abl-show.h')
-rw-r--r--crawl-ref/source/abl-show.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/crawl-ref/source/abl-show.h b/crawl-ref/source/abl-show.h
index 7f097e6d0b..caf55b909d 100644
--- a/crawl-ref/source/abl-show.h
+++ b/crawl-ref/source/abl-show.h
@@ -39,13 +39,29 @@ struct generic_cost
operator bool () const { return base > 0 || add > 0; }
};
+struct scaling_cost
+{
+ int value;
+
+ scaling_cost(int permille) : value(permille) {}
+
+ static scaling_cost fixed(int fixed)
+ {
+ return scaling_cost(-fixed);
+ }
+
+ int cost(int max) const;
+
+ operator bool () const { return value != 0; }
+};
+
// Structure for representing an ability:
struct ability_def
{
ability_type ability;
const char * name;
unsigned int mp_cost; // magic cost of ability
- unsigned int hp_cost; // hit point cost of ability
+ scaling_cost hp_cost; // hit point cost of ability
unsigned int food_cost; // + rand2avg( food_cost, 2 )
generic_cost piety_cost; // + random2( (piety_cost + 1) / 2 + 1 )
unsigned int flags; // used for additonal cost notices