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 vaultNAME: ice1_lemuelMONS: ice statueTAGS: no_pool_fixupORIENT: floatSUBST: * : *$SUBST: * = |:5 * .SUBST: T = TUSHUFFLE: xb/ccMAPxxxxxxxxxxbbbbbbbxxb*****bxxb*****bxxb.....bxxb.....bxxb.....bxxb.....bxxbwwwwwbxxbww1wwbxxbwwwwwbxxb.....bxxb.....bxxb.....bxxb.....bxxb.....bxxbT.@.TbxENDMAP##################################Another Ice Statue vaultNAME: ice2_lemuelDEPTH: D:12-27, Lair, Swamp, CocTAGS: no_pool_fixup no_mons_genORIENT: floatSUBST: T = TUSUBST: W = w:20 W .:5MONS: ice statueMONS: ice devil w:5/blue devil w:5/ice dragon/freezing wraith/nothing w:30MONS: white imp/ice beast w:30/polar bear/nothing w:50MAPT..................T..WWW..........WWW...WWWWW........WWWWW.WWWWWWwww..wwwWWWWWWWWW3WwwwwwwwwwwW3WWWWW333wwwwwwwwww333WW.WW3WwwwwwwwwwwW3WW..WWWWwwwwwwwwwwWWWW...WWWwww||||wwwWWW.....WWwww|12|wwwwW.....WWWwww||||wwwWWW...WWWWwwwwwwwwwwWWWW..WW3WwwwwwwwwwwW3WW.WW333wwwwwwwwww333WWWWW3WwwwwwwwwwwW3WWWWWWWWWwww..wwwWWWWWW.WWWWW........WWWWW...WWW..........WWW..T..................T
############################## Pond minivaultNAME: pondDEPTH: D:8-27, LairMONS: plant w:30/fungusMONS: giant frog w:30/giant brown frog/snake/rat/green rat/swamp drake w:2MONS: giant mosquitoSUBST: ! : w.SUBST: 2 : 23SUBST: 2 = 2.SUBST: 3 = 3.SUBST: . = . 1:1KFEAT: ? = *KMONS: ? = plantTAGS: no_monster_genMAP..wwwww....wwwwwwww2.wwwwwwwww.2wwwwwwww..ww222ww..wwww222w.wwww!!22wwwww!!!?ww..ww!!!www..2w!!!ww2.....!!w...ENDMAP############################### Secret library minivaultNAME: libraryDEPTH: 1-27ITEM: any book w:20/any scroll/nothingMAP.......x=xx..xddx..xddx..xxxx.......ENDMAP
ENDMAP########################## Orcs are a clue, episode I#NAME: hiddenorc1_lemuelTAGS: orc_entryORIENT: floatMONS: orc w:40/orc wizard w:2/orc priest w:2, orc warriorSUBST: ? = .xSUBST: ! : .$MAPx??@....@....@??xxx??.........??xxxxx??1111111??xxxxxxx??11111??xxxxxxxxx??111??xxxxxxxxxxx??1??xxxxxxxxxxxxx?2?xxxxxxxxxxxxxxv=vxxxxxxxxxxxxxx!!!xxxxxxxxxxxxxx!O!xxxxxxxxxxxxxx!!!xxxxxxxxxxxxxxxxxxxxxxxxENDMAP########################## Orcs are a clue, episode II#NAME: hiddenorc2_lemuelTAGS: orc_entryORIENT: floatMONS: orc w:20/orc wizard w:2/orc priest w:2/orc warrior w:1SUBST: a : x.SUBST: b : x.SUBST: c : x.SUBST: d : x.SUBST: ? = @ x:20 + =SUBST: ! : .$MAPxx?xxxxxxx?xxx111xxxxx111x?111aaaaa111?x111xxxxx111xxxbx=xxx=xcxxxxbxx!!!xxcxxxxbxx!O!xxcxxxxbxx!!!xxcxxxxbx=xxx=xcxxx111xxxxx111x?111ddddd111xx111xxxxx111?xx?xxxxxxx@xx
######################## Haunted orc entrance#NAME: zombieorc1_lemuelTAGS: orc_entryORIENT: floatMONS: orc zombie/orc skeleton w:2/goblin zombie w:2/hobgoblin zombie w:2/goblin skeleton w:1/hobgoblin skeleton w:1MONS: ogre zombie/troll zombie w:3/hill giant zombie w:1MONS: hungry ghost/phantom/wraith, orc sorcerer/orc priest/nothingSUBST: ? = x . $:1MAPxxx.xxxxxxxxxxxxxxxxxxxxxx?.x?x?xx?xxx??xx?xxxxx..xxx..1.xxx....11xxxxx.x??x.x1xx?x.21xx?..xxx...x..xxx.2..1.x.x??.xx?x.....?x.x..x.x1?.xxxx..??12x?x31.1?x.x??xxxxx..x..x??O3x..x.xx.xxx?..?x....34x?.x.??x.xxxx.x??.x.x..?x..xx.x?xxx?xx?xx.x??...x.1x.1??xxx..xxx...x.x.x.1?1.xxxx?.2....xx2.x...xx.x??xxxx??xx..xx.xx.x?..xxxxxx..1.x.x.1...x2.x1..xx..x??x.xxx..xxxx??.??xxxx?.??.11.x?xxx..x..xxxx??xxxx???xx?xxx??x.?xxxxxxxxxxxxxxxxxxxxxx.xxENDMAP######################## Haunted orc entrance#NAME: zombieorc2_lemuelTAGS: orc_entryORIENT: floatMONS: orc zombie/orc skeleton w:2/goblin zombie w:2/hobgoblin zombie w:2/goblin skeleton w:1/hobgoblin skeleton w:1MONS: ogre zombie/troll zombie w:3/hill giant zombie w:1MONS: hungry ghost/phantom/wraith, orc sorcerer/orc priestSUBST: 4 = 34SUBST: ? = x . $:1MAPMAPxxxxx..@..xxxxxx21....I....12xx11...111...11xx.............x..1...343...1..@I1...2O2...1I@..1...212...1..x.............xx11...111...11xx21....I....12xxxxxx..@..xxxxxENDMAP
}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;