intended to be portal vaults for Hell portals; we need to add support for portal vaults.
Added support for monster slot randomisation for maps.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@865 c06c8d41-db1a-0410-9941-cceddc491573
A3CO4KBFTFU3ZSHWRY2OPPX3MMTFV7OUCZGL7Q4Y2FU7JO4AP7MAC 5P64LHKJKGKIO3FUV63KFQ2OHZ5RNRV7WXS25OHXVNYYFZAVGLMAC 3DRML4TAWIPPWCXCCXTPWV33SZCRSC2I6DWGAEUNJF7ZOIIWA35QC QUYSD2DWCIKAAQJGI43EENAWWPA5W33UT3I5WFRSHU6FPSSXTX2AC RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC MSQI3TH6T62JAXQGLL52QZCWAMC372TGB6ZNNRDGUGMJKBNNV2VAC 34C4U6EQWERY75GZJKUCM5KVGU2OUICETS5LGZF6RMKMZT4R5SQAC L6O4LGZRKBURVWEY7XRVCSQLJ5RULNBEWMQJ6I2UYVWWB66FM3MQC 7J3H7JY6AUO2UHNF6DAHDZI4O33JMTUUTYTPRM3CKNPUOF2RQOGAC XAFFD52IHN6FWFR2TT5F2KCUS7HAVCBI5CWTFMKPQG77GGTGAHLAC QPF4HHRIRNZTEJUMRMB7EFYRF6RT6CTJECAAWRXV7EKHUEO77V7QC static void apply_monsters(const map_def &def,FixedVector<int,7> &marray){const std::vector<int> &mids = def.mons.get_ids();size_t ndx = 0;for (int i = 0, size = mids.size(); i < size; ++i){int mid = mids[i];if (mid < 0){mid = -100 - mid;if (mid == DEMON_RANDOM)mid = random2(DEMON_RANDOM);mid = summon_any_demon( mid );}if (ndx < marray.size())marray[ndx++] = mid;}}
const std::vector<int> &get_ids() const;
int get_monster(int index);// Returns an error string if the monster is unrecognised.std::string add_mons(const std::string &s);size_t size() const { return mons.size(); }private:struct mons_spec{int mid;int genweight;bool fix_mons;
// Returns false if the monster is unrecognised.bool add_mons(const std::string &s);
mons_spec(int id = RANDOM_MONSTER, int gw = 10, bool _fixmons = false): mid(id), genweight(gw), fix_mons(_fixmons){}};typedef std::vector<mons_spec> mons_spec_list;
size_t size() const { return mons_ids.size(); }
struct mons_spec_slot{mons_spec_list mlist;bool fix_slot;mons_spec_slot(const mons_spec_list &list, bool fix = false): mlist(list), fix_slot(fix){}mons_spec_slot(): mlist(), fix_slot(false){}};
const std::vector<int> &mons_list::get_ids() const
int mons_list::pick_monster(mons_spec_slot &slot){int totweight = 0;int pick = RANDOM_MONSTER;for (mons_spec_list::iterator i = slot.mlist.begin();i != slot.mlist.end(); ++i){const int weight = i->genweight;if (random2(totweight += weight) < weight){pick = i->mid;if (pick < 0 && i->fix_mons)pick = i->mid = fix_demon(pick);}}if (pick < 0)pick = fix_demon(pick);if (slot.fix_slot){slot.mlist.clear();slot.mlist.push_back( mons_spec(pick) );slot.fix_slot = false;}return (pick);}int mons_list::get_monster(int index)
mons_ids.clear();
mons_spec_slot slot;slot.fix_slot = strip_tag(spec, "fix_slot");std::vector<std::string> specs = split_string("/", spec);for (int i = 0, ssize = specs.size(); i < ssize; ++i){std::string s = specs[i];int weight = strip_number_tag(s, "weight:");if (weight == TAG_UNFOUND || weight <= 0)weight = 10;const bool fixmons = strip_tag(s, "fix_mons");trim_string(s);const int mid = mons_by_name(s);if (mid == MONS_PROGRAM_BUG){error = make_stringf("unrecognised monster \"%s\"", s.c_str());return (slot);}slot.mlist.push_back( mons_spec(mid, weight, fixmons) );}return (slot);
const int mid = mons_by_name(s);if (mid != MONS_PROGRAM_BUG)mons_ids.push_back(mid);return (mid != MONS_PROGRAM_BUG);
error.clear();mons_spec_slot slotmons = parse_mons_spec(s);if (!error.empty())return (error);mons.push_back( slotmons );return (error);
return (items);
int cumulative = 0;item_spec spec;for (item_spec_list::const_iterator i = slot.ilist.begin();i != slot.ilist.end(); ++i){const int weight = i->genweight;if (random2(cumulative += weight) < weight)spec = *i;}if (slot.fix_slot){slot.ilist.clear();slot.ilist.push_back(spec);slot.fix_slot = false;}return (spec);}item_spec item_list::get_item(int index){if (index < 0 || index >= (int) items.size())return (item_spec());return (pick_item(items[index]));
static const item_spec *dngn_item_by_weight(const item_spec_list &specs){int cumulative = 0;const item_spec *spec = NULL;for (item_spec_list::const_iterator i = specs.begin();i != specs.end(); ++i){const int weight = i->genweight;if (random2(cumulative += weight) < weight)spec = &*i;}return (spec);}
xxxxxxxxxxxxxxxxxxxxxxxxxxxx{.....(.....[xxxxxxxxxx.............xxxxxxxxxxx...........xxxxxxxxxxxx...........xxxxxxxxxxxxx.........xxxxxxxxxxxxxx.........xxxxxxxxxxxxxxx.......xxxxxxxxxxxxxxxx.......xxxxxxxxxxxxxxxxx.....xxxxxxxxxxxxxxxxxx.....xxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxx+++xxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxENDMAP
xxxxxxxxxxxxxxxx{.....(.....[xx.............xxx...........xxxx...........xxxxx.........xxxxxx.........xxxxxxx.......xxxxxxxx.......xxxxxxxxx.....xxxxxxxxxx.....xxxxxxxxxxx...xxxxxxxxxxxx...xxxxxxxxxxxx...xxxxxxxxxxxx+++xxxxxxxxxxxx...xxxxxxENDMAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxx{..1..(.1ww.[xxxxxxxxxx1.........ww.xxxxxxxxxxx..w..1....1.xxxxxxxxxxx........2...xxxxxxxxxxw...1......w.xxxxxxxxxxw...........xxxxxxxxxxx.1....2......xxxxxxxxxx1......w2....xxxxxxxxxx............xxxxxxxxxxxx..........xxxxxxxxxxxxx..........xxxxxxxxxxxxx...2......xxxxxxxxxxxx...........xxxxxxxxxxxx.2.w......xxxxxxxxxxxxxxx..2.....xxxxxxxxxxxxxxx......2xxxxxxxxxxxx.........xxxxxxxxxxxxx..xx......xxxxxxxxxxx...xxxxx.....xxxxxxxxxxxxxxxxxxxx....xxxxxxxxxxxxxxxxxxxxx...xxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxx{..1..(.1ww.[xxxxxx1.........ww.xxxxxxx..w..1....1.xxxxxxx........2...xxxxxxw...1......w.xxxxxxw...........xxxxxxx.1....2......xxxxxx1......w2....xxxxxx............xxxxxxxx..........xxxxxxxxx..........xxxxxxxxx...2......xxxxxxxx...........xxxxxxxx.2.w......xxxxxxxxxxx..2.....xxxxxxxxxxx......2xxxxxxxx.........xxxxxxxxx..xx......xxxxxxx...xxxxx.....xxxxxxxxxxxxxxxx....xxxxxxxxxxxxxxxxx...xxxx
#################################### broad hallNAME: lemuel_hallTAGS: entryORIENT: floatMAPxxxxxxxxxxxx{...(...[xx.........xx.x.....x.xx.........xx.........xx.x.....x.xx.........xx.........xx.x.....x.xx.........xx.........xx.x.....x.xx.........xx.........xx.x.....x.xx.........xx@...@...@xENDMAP#################################### broad hall with supply closetNAME: lemuel_hall2TAGS: entryORIENT: floatITEM: meat ration / bread ration / beef jerky / spear / potion of water / apple / club / hammer / knifeMAPxxxxxxxxxxxxx{...(...[xxx.........xxx.x.....x.xxx.........xxx.........xxx.x.....x.xxx.........xxx.........xxxxxxx.x.....x.xxxddxx.........=..ddxx.........xxxxxxx.x.....x.xxx.........xxx.........xxx.x.....x.xxx.........xxx@...@...@xxENDMAP#################################### behind the green doorNAME: lemuel_greenTAGS: entryORIENT: float
#################################### Hellmouth (Lemuel)# note that other than the imps, the demons here cannot flyNAME: hellmouth_1FLAGS: no_rotateMONS: imp / quasit / shadow imp, hellion / rotting devil / iron devil / hairy devil / hell houndITEM: good_item demon blade / good_item demon whip / good_item demon trident / wand of draining / wand of fire / ring of fire / Necronomicon / book of demonology / scroll of tormentORIENT: float
MAPxxxxxxxxxxxxxxxxxxxxxxxxxxxlllxxxxxxxxxxxxxxlllAlllxxxxxxxxxlllll.d.llll.xxxxlllllll121lllll..xx.lllllll1llll....xx...llllllll......xx....llllll.......xx.....lllll.......xxxx....lll......xxxxxxx...lll.....xxxxxxxxx..ll.....xxxxxxxxxx.lll.....xxxxxxxxxxxlll....xxxxxxxxxxxxxlll...xxxxxxxxxxxxxxll..xxxxxxxxxxxxxxxll..xxxxxxxxxxxxxxxl.@xxxxxxxxENDMAP#################################### Hellmouth 2 (Lemuel)# note that other than the imps, the demons here cannot flyNAME: hellmouth_2TAGS: no_monster_genFLAGS: no_rotateMONS: imp / quasit / shadow imp / manes / lemureMONS: hellion / rotting devil / iron devil / hairy devil / hell houndITEM: good_item demon blade / good_item demon whip / good_item demon trident / wand of draining / wand of fire / ring of fire / Necronomicon / book of demonology / scroll of tormentITEM: good_item demon blade / good_item demon whip / good_item demon tridentORIENT: floatMAP.......bbbbbbbbbbbb...........bbbb..........bbbb......bbb....llllllll....bbb...bb....llllllllllll....bb..b....llllllllllllll....b..b....llllll..llllll....b..b....lll........lll....b..b....ll....111...ll....b..+....l....11211d..l....b..+....l....12A21|e.l....b..b....ll...11211d.ll....b..b....lll...111..lll....b..b....llll......llll....b..b....llllll..llllll....b..bb....llllllllllll....bb...bbb....llllllll....bbb......bbbb..........bbbb...........bbbbbbbbbbbb.......ENDMAP#################################### Hellmouth 3 (Lemuel)NAME: hellmouth_3MONS: weight:50 imp / quasit / shadow imp / manes / lemure, hell houndITEM: good_item demon blade / good_item demon whip / good_item demon tridentORIENT: floatMAP................l...........................................................l.................ll..........l................lll..........l.................l..........l...........................lll........................lllllll.....................llllllllll...................lll111111llll.................llll12Ad1lll...................lll11111ll.....................lllll1ll........................llllll.........................llll......ll...................ll........ll......................................................l..........ENDMAP#############################################################################