diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-05 19:43:57 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-05 19:43:57 +0000 |
commit | 8532044ddfbab381d1455e76f5c324ee19764259 (patch) | |
tree | 4eb939f1c4e41149434984564b1c20362a858d0a /crawl-ref/source/mon-util.h | |
parent | 15f4a9725ec09f6d06d2c460e96739bf508847c7 (diff) | |
download | crawl-ref-8532044ddfbab381d1455e76f5c324ee19764259.tar.gz crawl-ref-8532044ddfbab381d1455e76f5c324ee19764259.zip |
Adjust monster habitats again. Remove the M_AMPHIBIOUS flag, and
replace it with two new habitats: HT_AMPHIBIOUS_LAND and
HT_AMPHIBIOUS_WATER, to indicate which habitat a monster prefers. This
effectively gives amphibious monsters primary and secondary habitats;
check both when trying to place such monsters. With these changes,
merfolk can be placed on land properly (via wizard mode's &M) when no
water is around. The one monster that can move through rock is affected
as well: rock is its primary habitat, while land is its secondary one.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7142 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mon-util.h')
-rw-r--r-- | crawl-ref/source/mon-util.h | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h index 07c83658e5..e4f6a510b7 100644 --- a/crawl-ref/source/mon-util.h +++ b/crawl-ref/source/mon-util.h @@ -99,7 +99,7 @@ enum mons_class_flags M_CONFUSED = (1<<10), // monster is perma-confused, M_BATTY = (1<<11), // monster is batty M_SPLITS = (1<<12), // monster can split - M_AMPHIBIOUS = (1<<13), // monster can swim in water + M_STATIONARY = (1<<14), // monster is stationary M_BLOOD_SCENT = (1<<15), // monster can smell blood M_COLD_BLOOD = (1<<16), // susceptible to cold, @@ -150,10 +150,12 @@ enum mon_intel_type // Must be in increasing intelligence order enum habitat_type { // Flying monsters will appear in all categories except rock walls - HT_LAND = 0, // Land critters - HT_WATER, // Water critters - HT_LAVA, // Lava critters - HT_ROCK, // Rock critters + HT_LAND = 0, // Land critters + HT_AMPHIBIOUS_LAND, // Amphibious land-preferring critters + HT_AMPHIBIOUS_WATER, // Amphibious water-preferring critters + HT_WATER, // Water critters + HT_LAVA, // Lava critters + HT_ROCK, // Rock critters NUM_HABITATS }; @@ -444,6 +446,8 @@ flight_type mons_flies(const monsters *mon); bool mons_class_amphibious(int mc); bool mons_amphibious(const monsters *mon); +bool mons_class_wall_shielded(int mc); +bool mons_wall_shielded(const monsters *mon); // last updated XXmay2000 {dlb} /* *********************************************************************** @@ -543,10 +547,14 @@ bool mons_is_shapeshifter(const monsters *m); * *********************************************************************** */ mon_intel_type mons_intel(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); +// Use mons_habitat() and mons_primary_habitat() wherever possible, +// since the class variants do not handle zombies correctly. +habitat_type mons_class_habitat(int mc); +habitat_type mons_habitat(const monsters *mon); +habitat_type mons_class_primary_habitat(int mc); +habitat_type mons_primary_habitat(const monsters *mon); +habitat_type mons_class_secondary_habitat(int mc); +habitat_type mons_secondary_habitat(const monsters *mon); bool intelligent_ally(const monsters *mon); @@ -730,7 +738,6 @@ bool mons_class_is_confusable(int mc); bool mons_class_is_slowable(int mc); bool mons_class_is_stationary(int mc); bool mons_is_stationary(const monsters *mon); -bool mons_is_wall_shielded(int mc); bool mons_is_insubstantial(int mc); bool mons_has_blood(int mc); bool mons_is_submerged(const monsters *m); @@ -793,7 +800,8 @@ std::string get_mon_shape_str(const monsters *mon); std::string get_mon_shape_str(const int type); std::string get_mon_shape_str(const mon_body_shape shape); -bool mons_class_can_pass(const int mclass, const dungeon_feature_type grid); +bool mons_class_can_pass(int mc, const dungeon_feature_type grid); +bool mons_can_pass(const monsters *mon, dungeon_feature_type grid); mon_inv_type equip_slot_to_mslot(equipment_type eq); |