Added support to the map designer for specifying the monster-type for zombies, skeletons, simulacra and spectral things. Also allow specifying the number of heads for hydras ("12-headed hydra").
Fixed lexer rule bug (IDENTIFIER).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1490 c06c8d41-db1a-0410-9941-cceddc491573
WW6THKR7JN447YC23YYHYYNH7ABMCFFSECNUFTIJBZX6JHX6W7TAC
KFM2ARORBIJ6BGX456VFW7EAVRIYBVFUV53JH63GSKNOKVPJWQ2QC
ILN2K6ASDZSMEHOPJ22IZLZJUO6DDGZTKAKXM3YXG6JZZHJNLX4AC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
7YSKYUNV34XIWRTJUHJV4QMQRTXXYDIXM5AZSPSDPAYDW4B4PU6QC
GRH4XPIYHDOXXF3R3QPMZTFHGLO2OJAZS4FLNBBXG3DHTQQM7RDQC
A3CO4KBFTFU3ZSHWRY2OPPX3MMTFV7OUCZGL7Q4Y2FU7JO4AP7MAC
KFJEFN377VIZ7OH2XCYOGCELNEGO4CIOOP7DNXEMX3LFKIKWXVTAC
OAPAH3WEFTT2T7NVSSENRR5JCIZYA6UZSQQ6LQEHAAXCX6FIM7HQC
2NCKGJDDPPGP2NXYYPEPVRJIIWEP6M7HE6WYMQN3UNNN3C2JIRFQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
TAVHZJPVNJBZR7CUURAOYNDZPNVQ3AGHTXDEP5K4JGYETBLQJDRQC
JDM27QE4HR52AYFSQE763BFF57ANOTF5MXKMO377PP5EXMN7SAOAC
7AMQN7MITMXBNVDAK5VOXTQ4TZIAOD6ZLOFJG7GQMBTY23Y2BKSAC
34C4U6EQWERY75GZJKUCM5KVGU2OUICETS5LGZF6RMKMZT4R5SQAC
FOCWL2MOKK6BNARCKZIN6DPTOYRFILRJLURUT2JBORS25MMVGGSQC
OVDIHWR5FEPTBZCTEAXNPB4MYP5NUNPQMC6UM4F6SC4EBGWH3DSQC
KXUQB3WNWC5IFL6VFWADEPQMMU3VV3NDI5FLA666PGOEWFYUHCLQC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
int mons_by_name(std::string name) const;
mons_spec mons_by_name(std::string name) const;
void get_zombie_type(std::string s, mons_spec &spec) const;
mons_spec get_hydra_spec(const std::string &name) const;
mons_spec get_zombified_monster(const std::string &name,
monster_type zomb) const;
int weight = find_weight(s);
int mlevel = 0;
if (weight == TAG_UNFOUND || weight <= 0)
weight = 10;
mons_spec mspec;
mspec.genweight = find_weight(s);
if (mspec.genweight == TAG_UNFOUND || mspec.genweight <= 0)
mspec.genweight = 10;
int mons_list::mons_by_name(std::string name) const
void mons_list::get_zombie_type(std::string s, mons_spec &spec) const
{
static const char *zombie_types[] =
{
" zombie", " skeleton", " simulacrum", NULL
};
// This order must match zombie_types, indexed from one.
static const monster_type zombie_montypes[][2] =
{
{ MONS_PROGRAM_BUG, MONS_PROGRAM_BUG },
{ MONS_ZOMBIE_SMALL, MONS_ZOMBIE_LARGE },
{ MONS_SKELETON_SMALL, MONS_SKELETON_LARGE },
{ MONS_SIMULACRUM_SMALL, MONS_SIMULACRUM_LARGE }
};
const int mod = ends_with(s, zombie_types);
if (!mod)
{
const std::string &spectre = "spectral ";
if (s.find(spectre) == 0)
{
s = s.substr(spectre.length());
spec.mid = MONS_SPECTRAL_THING;
spec.monnum = get_monster_by_name(s, true);
if (!mons_zombie_size(spec.monnum))
spec.mid = MONS_PROGRAM_BUG;
return;
}
spec.mid = MONS_PROGRAM_BUG;
return;
}
s = s.substr(0, s.length() - strlen(zombie_types[mod - 1]));
trim_string(s);
spec.monnum = get_monster_by_name(s, true);
const int zombie_size = mons_zombie_size(spec.monnum);
if (!zombie_size)
{
spec.mid = MONS_PROGRAM_BUG;
return;
}
spec.mid = zombie_montypes[mod][zombie_size - 1];
}
mons_spec mons_list::get_hydra_spec(const std::string &name) const
ENDMAP
#################################
# An Ice Statue vault
NAME: ice1_lemuel
MONS: ice statue
TAGS: no_pool_fixup
ORIENT: float
SUBST: * : *$
SUBST: * = |:5 * .
SUBST: T = TU
SHUFFLE: xb/cc
MAP
xxxxxxxxx
xbbbbbbbx
xb*****bx
xb*****bx
xb.....bx
xb.....bx
xb.....bx
xb.....bx
xbwwwwwbx
xbww1wwbx
xbwwwwwbx
xb.....bx
xb.....bx
xb.....bx
xb.....bx
xb.....bx
xbT.@.Tbx
ENDMAP
#################################
#Another Ice Statue vault
NAME: ice2_lemuel
DEPTH: D:12-27, Lair, Swamp, Coc
TAGS: no_pool_fixup no_mons_gen
ORIENT: float
SUBST: T = TU
SUBST: W = w:20 W .:5
MONS: ice statue
MONS: ice devil w:5/blue devil w:5/ice dragon/freezing wraith/nothing w:30
MONS: white imp/ice beast w:30/polar bear/nothing w:50
MAP
T..................T
..WWW..........WWW..
.WWWWW........WWWWW.
WWWWWWwww..wwwWWWWWW
WWW3WwwwwwwwwwwW3WWW
WW333wwwwwwwwww333WW
.WW3WwwwwwwwwwwW3WW.
.WWWWwwwwwwwwwwWWWW.
..WWWwww||||wwwWWW..
...WWwww|12|wwwwW...
..WWWwww||||wwwWWW..
.WWWWwwwwwwwwwwWWWW.
.WW3WwwwwwwwwwwW3WW.
WW333wwwwwwwwww333WW
WWW3WwwwwwwwwwwW3WWW
WWWWWWwww..wwwWWWWWW
.WWWWW........WWWWW.
..WWW..........WWW..
T..................T
#############################
# Pond minivault
NAME: pond
DEPTH: D:8-27, Lair
MONS: plant w:30/fungus
MONS: giant frog w:30/giant brown frog/snake/rat/green rat/swamp drake w:2
MONS: giant mosquito
SUBST: ! : w.
SUBST: 2 : 23
SUBST: 2 = 2.
SUBST: 3 = 3.
SUBST: . = . 1:1
KFEAT: ? = *
KMONS: ? = plant
TAGS: no_monster_gen
MAP
..wwwww...
.wwwwwwww2
.wwwwwwwww
.2wwwwwwww
..ww222ww.
.wwww222w.
wwww!!22ww
www!!!?ww.
.ww!!!www.
.2w!!!ww2.
....!!w...
ENDMAP
##############################
# Secret library minivault
NAME: library
DEPTH: 1-27
ITEM: any book w:20/any scroll/nothing
MAP
......
.x=xx.
.xddx.
.xddx.
.xxxx.
......
ENDMAP
ENDMAP
#########################
# Orcs are a clue, episode I
#
NAME: hiddenorc1_lemuel
TAGS: orc_entry
ORIENT: float
MONS: orc w:40/orc wizard w:2/orc priest w:2, orc warrior
SUBST: ? = .x
SUBST: ! : .$
MAP
x??@....@....@??x
xx??.........??xx
xxx??1111111??xxx
xxxx??11111??xxxx
xxxxx??111??xxxxx
xxxxxx??1??xxxxxx
xxxxxxx?2?xxxxxxx
xxxxxxxv=vxxxxxxx
xxxxxxx!!!xxxxxxx
xxxxxxx!O!xxxxxxx
xxxxxxx!!!xxxxxxx
xxxxxxxxxxxxxxxxx
ENDMAP
#########################
# Orcs are a clue, episode II
#
NAME: hiddenorc2_lemuel
TAGS: orc_entry
ORIENT: float
MONS: orc w:20/orc wizard w:2/orc priest w:2/orc warrior w:1
SUBST: a : x.
SUBST: b : x.
SUBST: c : x.
SUBST: d : x.
SUBST: ? = @ x:20 + =
SUBST: ! : .$
MAP
xx?xxxxxxx?xx
x111xxxxx111x
?111aaaaa111?
x111xxxxx111x
xxbx=xxx=xcxx
xxbxx!!!xxcxx
xxbxx!O!xxcxx
xxbxx!!!xxcxx
xxbx=xxx=xcxx
x111xxxxx111x
?111ddddd111x
x111xxxxx111?
xx?xxxxxxx@xx
#######################
# Haunted orc entrance
#
NAME: zombieorc1_lemuel
TAGS: orc_entry
ORIENT: float
MONS: orc zombie/orc skeleton w:2/goblin zombie w:2/hobgoblin zombie w:2/goblin skeleton w:1/hobgoblin skeleton w:1
MONS: ogre zombie/troll zombie w:3/hill giant zombie w:1
MONS: hungry ghost/phantom/wraith, orc sorcerer/orc priest/nothing
SUBST: ? = x . $:1
MAP
xxx.xxxxxxxxxxxxxxxxxxx
xxx?.x?x?xx?xxx??xx?xxx
xx..xxx..1.xxx....11xxx
xx.x??x.x1xx?x.21xx?..x
xx...x..xxx.2..1.x.x??.
xx?x.....?x.x..x.x1?.xx
xx..??12x?x31.1?x.x??xx
xxx..x..x??O3x..x.xx.xx
x?..?x....34x?.x.??x.xx
xx.x??.x.x..?x..xx.x?xx
x?xx?xx.x??...x.1x.1??x
xx..xxx...x.x.x.1?1.xxx
x?.2....xx2.x...xx.x??x
xxx??xx..xx.xx.x?..xxxx
xx..1.x.x.1...x2.x1..xx
..x??x.xxx..xxxx??.??xx
xx?.??.11.x?xxx..x..xxx
x??xxxx???xx?xxx??x.?xx
xxxxxxxxxxxxxxxxxxxx.xx
ENDMAP
#######################
# Haunted orc entrance
#
NAME: zombieorc2_lemuel
TAGS: orc_entry
ORIENT: float
MONS: orc zombie/orc skeleton w:2/goblin zombie w:2/hobgoblin zombie w:2/goblin skeleton w:1/hobgoblin skeleton w:1
MONS: ogre zombie/troll zombie w:3/hill giant zombie w:1
MONS: hungry ghost/phantom/wraith, orc sorcerer/orc priest
SUBST: 4 = 34
SUBST: ? = x . $:1
MAP
MAP
xxxxx..@..xxxxx
x21....I....12x
x11...111...11x
x.............x
..1...343...1..
@I1...2O2...1I@
..1...212...1..
x.............x
x11...111...11x
x21....I....12x
xxxxx..@..xxxxx
ENDMAP
}
static bool ends_with(const std::string &s, const char *suffix)
{
std::string other = suffix;
if (s.length() < other.length()) return false;
return (s.substr(s.length() - other.length()) == other);
}
static bool ends_with(const std::string &s, const char *suffixes[])
{
if (!suffixes) return false;
for ( ; *suffixes; suffixes++)
{
if (ends_with(s, *suffixes))
return true;
}
return false;