summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.h
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-09 14:24:11 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-09 14:24:11 +0000
commitf2a95ba0d453ba6685ed29201beda8a2f703ab79 (patch)
treee7201beb995472236921334a363644e5782d648b /crawl-ref/source/mon-util.h
parent447bc8ac9d8557be01da02c40349e4301f42c089 (diff)
downloadcrawl-ref-f2a95ba0d453ba6685ed29201beda8a2f703ab79.tar.gz
crawl-ref-f2a95ba0d453ba6685ed29201beda8a2f703ab79.zip
Monsters get multilevel resists (incomplete). Monster data needs to be
adjusted per monster to hand out the right resists. The current MR_RES_FIRE gives one level of resistance only. Added a real ghost structure, discarded the old ghost values array. Adjusted bones file format so bones will work out-of-the-box with Hearse. Breaks bones format, older bones will be rejected. Fixed some maps with bad DEPTHs. Added more safe answers in Y/N prompts, added a check to make it less likely that Crawl will spin in a tight loop reading input from a closed tty. (Experimental) !a will override existing foe of friendlies in LOS. Blademasters no longer pick up stuff to throw (Erik). Zombies of swimming things are also swimming things. Currently applies only to zombies explicitly placed in .des files, since fish zombies cannot be generated otherwise (can of worms). Morgue is now saved before showing the inventory and other boring end-of-game stuff. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3231 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mon-util.h')
-rw-r--r--crawl-ref/source/mon-util.h71
1 files changed, 45 insertions, 26 deletions
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index 4877271260..9aaccb551e 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -201,7 +201,11 @@ enum mon_resist_flags
MR_VUL_PIERCE = (1<<14),
MR_VUL_SLICE = (1<<15),
- MR_VUL_BLUDGEON = (1<<16)
+ MR_VUL_BLUDGEON = (1<<16),
+
+ // immune to stickiness of sticky flame.
+ MR_RES_STICKY_FLAME = (1 << 17),
+ MR_RES_STEAM = (1 << 18)
};
enum shout_type
@@ -275,6 +279,37 @@ struct mon_energy_usage
char pickup_percent;
};
+struct mon_resist_def
+{
+ // All values are actually saved as single-bytes, so practical
+ // range is -128 - 127, and the game only distinguishes values in
+ // the range -1 to 3.
+
+ short elec;
+ short poison;
+ short fire;
+ short steam;
+ short cold;
+ short hellfire;
+ short asphyx;
+ short acid;
+
+ bool sticky_flame;
+
+ // Physical damage resists (currently unused)
+ short pierce;
+ short slice;
+ short bludgeon;
+
+ mon_resist_def();
+ mon_resist_def(int flags, short level = 1);
+
+ mon_resist_def operator | (const mon_resist_def &other) const;
+ const mon_resist_def &operator |= (const mon_resist_def &other);
+};
+
+typedef mon_resist_def mrd;
+
struct monsterentry
{
short mc; // monster number
@@ -283,7 +318,7 @@ struct monsterentry
const char *name;
unsigned long bitfields;
- unsigned long resists;
+ mon_resist_def resists;
short weight;
// [Obsolete] Experience used to be calculated like this:
@@ -446,35 +481,18 @@ bool mons_is_summoned(const monsters *m);
* *********************************************************************** */
mon_intel_type mons_intel(int mc);
-habitat_type mons_habitat(int mc);
+// Use mons_habitat(const monster *) wherever possible since the other
+// variant does not handle zombies correctly.
+habitat_type mons_habitat(const monsters *m);
+habitat_type mons_habitat_by_type(int mc);
bool intelligent_ally(const monsters *mon);
-// last updated 12may2000 {dlb}
-/* ***********************************************************************
- * called from: beam - fight - monstuff
- * *********************************************************************** */
+bool mons_res_sticky_flame( const monsters *mon );
int mons_res_cold( const monsters *mon );
-
-
-// last updated 12may2000 {dlb}
-/* ***********************************************************************
- * called from: beam - fight - spells4
- * *********************************************************************** */
int mons_res_elec( const monsters *mon );
-
-
-// last updated 12may2000 {dlb}
-/* ***********************************************************************
- * called from: beam - fight - monstuff
- * *********************************************************************** */
int mons_res_fire( const monsters *mon );
-
-
-// last updated 12may2000 {dlb}
-/* ***********************************************************************
- * called from: beam - monstuff - spells4
- * *********************************************************************** */
+int mons_res_steam( const monsters *mon );
int mons_res_poison( const monsters *mon );
int mons_res_acid( const monsters *mon );
int mons_res_negative_energy( const monsters *mon );
@@ -509,7 +527,8 @@ int mons_speed(int mclass);
* called from: dungeon - mon-util - spells2
* *********************************************************************** */
int mons_zombie_size(int mc);
-
+int mons_zombie_base(const monsters *monster);
+bool mons_is_zombified(const monsters *monster);
// last updated 12may2000 {dlb}
/* ***********************************************************************