diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-05 22:02:47 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-05 22:02:47 +0000 |
commit | 46bf2998e5a6df900667ccb4f9ab4856c146d7d8 (patch) | |
tree | 8b5d8968dbe521234c76ba377d09ae0421faf43e /crawl-ref/source/mon-util.cc | |
parent | bd7e3ba074440a654ca14d6c977cb381abfec861 (diff) | |
download | crawl-ref-46bf2998e5a6df900667ccb4f9ab4856c146d7d8.tar.gz crawl-ref-46bf2998e5a6df900667ccb4f9ab4856c146d7d8.zip |
Fix 1984593: all monster being generated awake.
Some modifications to the pathfind travel_cost function.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5491 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r-- | crawl-ref/source/mon-util.cc | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 31c70f4404..b9acb16df5 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -446,6 +446,52 @@ bool mons_behaviour_perceptible(const monsters *mon) && mon->type != MONS_OKLOB_PLANT); } +// Returns true for monsters that obviously (to the player) feel +// "thematically at home" in a branch. Currently used for native +// monsters recognizing traps and patrolling branch entrances. +bool mons_is_native_in_branch(const monsters *monster, + const branch_type branch) +{ + switch (branch) + { + case BRANCH_ELVEN_HALLS: + return (mons_species(monster->type) == MONS_ELF); + + case BRANCH_ORCISH_MINES: + return (mons_species(monster->type) == MONS_ORC); + + case BRANCH_SHOALS: + return (mons_species(monster->type) == MONS_CYCLOPS + || mons_species(monster->type) == MONS_MERFOLK + || mons_species(monster->type) == MONS_MERMAID); + + case BRANCH_SLIME_PITS: + return (mons_species(monster->type) == MONS_JELLY); + + case BRANCH_SNAKE_PIT: + return (mons_species(monster->type) == MONS_NAGA + || mons_species(monster->type) == MONS_SNAKE); + + case BRANCH_HALL_OF_ZOT: + return (mons_species(monster->type) == MONS_DRACONIAN); + + case BRANCH_TOMB: + return (mons_species(monster->type) == MONS_MUMMY); + + case BRANCH_HIVE: + return (monster->type == MONS_KILLER_BEE_LARVA + || monster->type == MONS_KILLER_BEE + || monster->type == MONS_QUEEN_BEE); + + case BRANCH_HALL_OF_BLADES: + return (monster->type == MONS_DANCING_WEAPON); + + default: + return (false); + } +} + + bool mons_is_icy(const monsters *mon) { return (mons_is_icy(mon->type)); |