From 0addd910ea1fec2edab2a0672cd086ee83c19f67 Mon Sep 17 00:00:00 2001 From: Stefan O'Rear Date: Mon, 2 Nov 2009 22:12:06 -0800 Subject: Mutated spell-like abilities are fueled by %HP, not MP --- crawl-ref/source/abl-show.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/abl-show.h') 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 -- cgit v1.2.3-54-g00ecf