diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-03-21 05:23:36 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-03-21 05:45:35 +0100 |
commit | 34b3b447c5096fe864dc8a9500c1f44706977b3e (patch) | |
tree | 2bf8408602a033370e419826d93ada02702a3a90 /crawl-ref/source/dungeon.h | |
parent | af4a235e5fc769a5c81a40885c68354630f01905 (diff) | |
parent | 6a66c87f159d4a26f1d6d09557ffc61334ca907f (diff) | |
download | crawl-ref-34b3b447c5096fe864dc8a9500c1f44706977b3e.tar.gz crawl-ref-34b3b447c5096fe864dc8a9500c1f44706977b3e.zip |
Merge branch 'mon-pick'
The behaviour should be preserved exactly or almost exactly, only the code
changes from totally, utterly unreadable to merely hard to read.
Actual differences:
* strong OODs in shallow branches would degenerate into picking a monster
randomly from the whole branch, now they pick from the bottom level (or
so-called OOD cap of Elf:7, Tomb:5, D:31 and Vaults:15).
* Zot no longer replaces requests for Zot:5 by Zot:4, and proper hells,
$(HELL):4-7 by $(HELL):3.
* this means hell monster sets need fixing!
* zombie size doesn't affect their spawning
* zombie selection obeys the depth passed
* which makes zombie sets pretty limited -- needs review/redesign?
The new format is:
{ 9, 19, 826, SEMI, MONS_YAK },
which means: yaks can spawn on D:9-19, with _linear_ rarity 826 in the
middle of the range. A "SEMI" distribution means that at the edges,
D:9 and D:19, the effective rarity is half that, 413.
Distributions:
FLAT 100% 100% 100%
SEMI 50% 100% 50%
PEAK 0% 100% 0%
UP 0% 50% 100%
DOWN 100% 50% 0%
That "0%" doesn't mean the monster won't spawn on the top/bottom level
(D:9 and D:19 for yaks), the range is fudged so D:8 receives 0% chance,
D:9 16.6%, linearly up to 100% on D:14.
Yes, this sounds and is complex, but at least the complexity is not strewn
around obscure code anymore, and a number of limitations have been lifted.
ZotDef still uses the old code via an emulation layer.
Diffstat (limited to 'crawl-ref/source/dungeon.h')
-rw-r--r-- | crawl-ref/source/dungeon.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crawl-ref/source/dungeon.h b/crawl-ref/source/dungeon.h index 73ff66b652..3f29c51969 100644 --- a/crawl-ref/source/dungeon.h +++ b/crawl-ref/source/dungeon.h @@ -10,6 +10,7 @@ #include "env.h" #include "externs.h" #include "mapdef.h" +#include "mon-pick.h" #include <vector> #include <set> @@ -129,8 +130,6 @@ public: map_def map; vector<coord_def> exits; - int level_number; - // The PC has seen at least one square of this vault. bool seen; @@ -227,8 +226,7 @@ coord_def dgn_find_nearby_stair(dungeon_feature_type stair_to_find, coord_def base_pos, bool find_closest); class mons_spec; -monster *dgn_place_monster(mons_spec &mspec, - int monster_level, const coord_def& where, +monster *dgn_place_monster(mons_spec &mspec, coord_def where, bool force_pos = false, bool generate_awake = false, bool patrolling = false); int dgn_place_item(const item_spec &spec, @@ -237,8 +235,7 @@ int dgn_place_item(const item_spec &spec, class item_list; void dgn_place_multiple_items(item_list &list, - const coord_def& where, - int level); + const coord_def& where); bool set_level_flags(uint32_t flags, bool silent = false); bool unset_level_flags(uint32_t flags, bool silent = false); |