summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.h
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-13 14:35:40 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-13 14:35:40 +0000
commitf48cb619b22ecd68a58ccd896cb553c53850dc38 (patch)
treeb470e2939e85bf671d71a2dd822df3963d94af77 /crawl-ref/source/mon-util.h
parent9b3b399350ef28d68a1098e47651664c705d055b (diff)
downloadcrawl-ref-f48cb619b22ecd68a58ccd896cb553c53850dc38.tar.gz
crawl-ref-f48cb619b22ecd68a58ccd896cb553c53850dc38.zip
Give amphibians movement speed boost in water, give deep elf master archers a very fast missile attack.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6526 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mon-util.h')
-rw-r--r--crawl-ref/source/mon-util.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index f5189ca2a6..06e5040b34 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -271,6 +271,7 @@ struct mon_attack_def
// to 10.
struct mon_energy_usage
{
+public:
char move;
char swim;
char attack;
@@ -282,6 +283,51 @@ struct mon_energy_usage
// Percent of monster->speed used when picking up an item; defaults
// to 100%
char pickup_percent;
+
+public:
+ mon_energy_usage(int mv = 10, int sw = 10, int att = 10, int miss = 10,
+ int spl = 10, int spc = 10, int itm = 10, int pick = 100)
+ : move(mv), swim(sw), attack(att), missile(miss),
+ spell(spl), special(spc), item(itm), pickup_percent(pick)
+ {
+ }
+
+ static mon_energy_usage attack_cost(int cost)
+ {
+ mon_energy_usage me;
+ me.attack = cost;
+ return me;
+ }
+
+ static mon_energy_usage missile_cost(int cost)
+ {
+ mon_energy_usage me;
+ me.missile = cost;
+ return me;
+ }
+
+ static mon_energy_usage move_cost(int mv, int sw = 10)
+ {
+ const mon_energy_usage me(mv, sw);
+ return me;
+ }
+
+ mon_energy_usage operator | (const mon_energy_usage &o) const
+ {
+ return mon_energy_usage( combine(move, o.move),
+ combine(swim, o.swim),
+ combine(attack, o.attack),
+ combine(missile, o.missile),
+ combine(spell, o.spell),
+ combine(special, o.special),
+ combine(item, o.item),
+ combine(pickup_percent, o.pickup_percent,
+ 100) );
+ }
+private:
+ char combine(char a, char b, char def = 10) const {
+ return (b != def? b : a);
+ }
};
struct mon_resist_def