diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-08 18:18:10 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-08 18:18:10 +0000 |
commit | a753bdc6027688c12ad6c27a6952947713c8c7c0 (patch) | |
tree | a81e5e3794e1452263f0eb6c130d9165f81e90f4 /crawl-ref/source/abl-show.h | |
parent | d4828ced1edd21e0fc259c354c7bc45766e5f35d (diff) | |
download | crawl-ref-a753bdc6027688c12ad6c27a6952947713c8c7c0.tar.gz crawl-ref-a753bdc6027688c12ad6c27a6952947713c8c7c0.zip |
Adjust piety costs for various god powers.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2382 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/abl-show.h')
-rw-r--r-- | crawl-ref/source/abl-show.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/crawl-ref/source/abl-show.h b/crawl-ref/source/abl-show.h index 861dfae146..db4a1f5aa3 100644 --- a/crawl-ref/source/abl-show.h +++ b/crawl-ref/source/abl-show.h @@ -19,6 +19,32 @@ #include <string> #include <vector> +struct generic_cost +{ + int base, add, rolls; + + generic_cost(int num) + : base(num), add((num + 1) / 2 + 1), rolls(1) + { + } + generic_cost(int num, int _add, int _rolls = 1) + : base(num), add(_add), rolls(_rolls) + { + } + static generic_cost fixed(int fixed) + { + return generic_cost(fixed, 0, 1); + } + static generic_cost range(int low, int high, int rolls = 1) + { + return generic_cost(low, high - low + 1, rolls); + } + + int cost() const; + + operator bool () const { return base > 0 || add > 0; } +}; + // Structure for representing an ability: struct ability_def { @@ -27,7 +53,7 @@ struct ability_def unsigned int mp_cost; // magic cost of ability unsigned int hp_cost; // hit point cost of ability unsigned int food_cost; // + rand2avg( food_cost, 2 ) - unsigned int piety_cost; // + random2( (piety_cost + 1) / 2 + 1 ) + generic_cost piety_cost; // + random2( (piety_cost + 1) / 2 + 1 ) unsigned int flags; // used for additonal cost notices }; |