From 3abead0503b523effaacc54221ce60f16e277d5e Mon Sep 17 00:00:00 2001 From: Johanna Ploog Date: Sun, 20 Dec 2009 21:46:10 +0100 Subject: Give shields of reflection the same price modifier as robes of resistance. --- crawl-ref/source/shopping.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc index d03614cce9..8cb0dfa4be 100644 --- a/crawl-ref/source/shopping.cc +++ b/crawl-ref/source/shopping.cc @@ -1371,6 +1371,7 @@ unsigned int item_value( item_def item, bool ident ) case SPARM_DARKNESS: case SPARM_RESISTANCE: + case SPARM_REFLECTION: valued *= 60; break; -- cgit v1.2.3-54-g00ecf From c56e3c96ac815fed49a4b3b0c7d3bc917c5697d7 Mon Sep 17 00:00:00 2001 From: Johanna Ploog Date: Sun, 20 Dec 2009 21:48:46 +0100 Subject: Only inform wizmode players about lack of ghosts if they want to load one. --- crawl-ref/source/files.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index f44cf20d76..8ae63853a1 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -1801,7 +1801,7 @@ static std::string _make_ghost_filename() bool load_ghost(bool creating_level) { - const bool wiz_cmd = crawl_state.prev_cmd == CMD_WIZARD; + const bool wiz_cmd = (crawl_state.prev_cmd == CMD_WIZARD); ASSERT(you.transit_stair == DNGN_UNSEEN || creating_level); ASSERT(!you.entering_level || creating_level); @@ -1835,7 +1835,7 @@ bool load_ghost(bool creating_level) if (gfile == NULL) { - if (wiz_cmd) + if (wiz_cmd && !creating_level) mpr("No ghost files for this level.", MSGCH_PROMPT); return (false); // no such ghost. } -- cgit v1.2.3-54-g00ecf From 586a911d21af4e9f084402610bb44a6f3cf86f4f Mon Sep 17 00:00:00 2001 From: Johanna Ploog Date: Sun, 20 Dec 2009 22:41:24 +0100 Subject: Add a turtleshaped altar tile for Cheibriados. Can still be improved. --- crawl-ref/source/rltiles/dc-dngn.txt | 2 +- .../rltiles/dc-dngn/altars/dngn_altar_cheibriados.png | Bin 0 -> 795 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 crawl-ref/source/rltiles/dc-dngn/altars/dngn_altar_cheibriados.png diff --git a/crawl-ref/source/rltiles/dc-dngn.txt b/crawl-ref/source/rltiles/dc-dngn.txt index bd555197b7..cb19cf936d 100644 --- a/crawl-ref/source/rltiles/dc-dngn.txt +++ b/crawl-ref/source/rltiles/dc-dngn.txt @@ -483,7 +483,7 @@ dngn_altar_jiyva DNGN_ALTAR_JIYVA %rim 1 dngn_altar_fedhas DNGN_ALTAR_FEDHAS %rim 0 -dngn_altar DNGN_ALTAR_CHEIBRIADOS +dngn_altar_cheibriados DNGN_ALTAR_CHEIBRIADOS %sdir dc-dngn dngn_blue_fountain DNGN_BLUE_FOUNTAIN diff --git a/crawl-ref/source/rltiles/dc-dngn/altars/dngn_altar_cheibriados.png b/crawl-ref/source/rltiles/dc-dngn/altars/dngn_altar_cheibriados.png new file mode 100644 index 0000000000..bfebb6344b Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/altars/dngn_altar_cheibriados.png differ -- cgit v1.2.3-54-g00ecf From b8bd27fabb5e716978980c2894934924f9a4439f Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Mon, 21 Dec 2009 02:02:59 -0800 Subject: contribs: correct some minor build issues, ignore junk files Signed-off-by: Steven Noonan --- crawl-ref/source/contrib/freetype | 2 +- crawl-ref/source/contrib/libpng | 2 +- crawl-ref/source/contrib/sdl-image | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crawl-ref/source/contrib/freetype b/crawl-ref/source/contrib/freetype index 18ee3862be..5cc0f9cb0a 160000 --- a/crawl-ref/source/contrib/freetype +++ b/crawl-ref/source/contrib/freetype @@ -1 +1 @@ -Subproject commit 18ee3862be4f96d3b3145dee253e80cf6a86522f +Subproject commit 5cc0f9cb0aaa3a188c05ddb99c7d246eb00e0fb3 diff --git a/crawl-ref/source/contrib/libpng b/crawl-ref/source/contrib/libpng index dba1428416..1106497bfb 160000 --- a/crawl-ref/source/contrib/libpng +++ b/crawl-ref/source/contrib/libpng @@ -1 +1 @@ -Subproject commit dba142841631c2683fd636f29ae5572509db2655 +Subproject commit 1106497bfb29c4d7f9399dcbe06ace494d71fb6b diff --git a/crawl-ref/source/contrib/sdl-image b/crawl-ref/source/contrib/sdl-image index 975a9df40a..c8a64a54ab 160000 --- a/crawl-ref/source/contrib/sdl-image +++ b/crawl-ref/source/contrib/sdl-image @@ -1 +1 @@ -Subproject commit 975a9df40a0d82c211bcc743e75ca814c614bcc3 +Subproject commit c8a64a54abe3243843541b95ad7e609200a66afc -- cgit v1.2.3-54-g00ecf From e73c57e2444cd401edf060070c3766853d5578ec Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Mon, 21 Dec 2009 02:16:03 -0800 Subject: contribs: ignore more junk files Signed-off-by: Steven Noonan --- crawl-ref/source/contrib/sdl | 2 +- crawl-ref/source/contrib/zlib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crawl-ref/source/contrib/sdl b/crawl-ref/source/contrib/sdl index e8c8283f8d..4c5fa44b99 160000 --- a/crawl-ref/source/contrib/sdl +++ b/crawl-ref/source/contrib/sdl @@ -1 +1 @@ -Subproject commit e8c8283f8d94f559f84c5a4d0c3d3afe534bbea9 +Subproject commit 4c5fa44b99857d289152e15d3ff4cff2433ee2ee diff --git a/crawl-ref/source/contrib/zlib b/crawl-ref/source/contrib/zlib index 25eeb98fc4..925b66b5e6 160000 --- a/crawl-ref/source/contrib/zlib +++ b/crawl-ref/source/contrib/zlib @@ -1 +1 @@ -Subproject commit 25eeb98fc4448d4c556521beda2e0ddfdc9f5133 +Subproject commit 925b66b5e6c5e029657db0b9e9ce8b528b9d031b -- cgit v1.2.3-54-g00ecf From 452089b27eeb323d277751ef224f23b2ea708ffb Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Mon, 21 Dec 2009 17:05:33 +0100 Subject: Fix a crash with pickup of items with subtype=21 mysteriously failing. --- crawl-ref/source/monster.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index b71b2a4558..55b342a903 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -1783,7 +1783,7 @@ bool monsters::pickup_gold(item_def &item, int near) bool monsters::pickup_misc(item_def &item, int near) { // Never pick up runes. - if (item.sub_type == MISC_RUNE_OF_ZOT) + if (item.base_type == OBJ_MISCELLANY && item.sub_type == MISC_RUNE_OF_ZOT) return (false); // Holy monsters and worshippers of good gods won't pick up evil -- cgit v1.2.3-54-g00ecf From 0e15cbcd0545bda8db270dd354c93bbf6d82208e Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Tue, 22 Dec 2009 14:44:11 +1000 Subject: Add a tile for Nikola (purge). --- crawl-ref/source/rltiles/dc-mon.txt | 1 + crawl-ref/source/rltiles/dc-mon/unique/nikola.png | Bin 0 -> 3707 bytes crawl-ref/source/tilepick.cc | 2 +- 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 crawl-ref/source/rltiles/dc-mon/unique/nikola.png diff --git a/crawl-ref/source/rltiles/dc-mon.txt b/crawl-ref/source/rltiles/dc-mon.txt index d253cc152c..dd347bd4fb 100644 --- a/crawl-ref/source/rltiles/dc-mon.txt +++ b/crawl-ref/source/rltiles/dc-mon.txt @@ -310,6 +310,7 @@ louise MONS_LOUISE margery MONS_MARGERY maud MONS_MAUD maurice MONS_MAURICE +nikola MONS_NIKOLA norbert MONS_NORBERT norris MONS_NORRIS psyche MONS_PSYCHE diff --git a/crawl-ref/source/rltiles/dc-mon/unique/nikola.png b/crawl-ref/source/rltiles/dc-mon/unique/nikola.png new file mode 100644 index 0000000000..3d2e235670 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-mon/unique/nikola.png differ diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc index 31c4145456..ddc0a9013f 100644 --- a/crawl-ref/source/tilepick.cc +++ b/crawl-ref/source/tilepick.cc @@ -1079,7 +1079,7 @@ int tileidx_monster_base(const monsters *mon, bool detected) case MONS_KIRKE: return TILEP_MONS_KIRKE; case MONS_NIKOLA: - return TILEP_TODO; // TODO + return TILEP_MONS_NIKOLA; // TODO case MONS_MAURICE: return TILEP_MONS_MAURICE; -- cgit v1.2.3-54-g00ecf From 19b368a30ab08540eddec3314ff8128c020e6fdf Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Tue, 22 Dec 2009 12:14:25 +0100 Subject: Don't destroy monster inventory prematurely -- banished/summoned mimics need it. --- crawl-ref/source/mon-stuff.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc index 76f964fe20..77f74ff11c 100644 --- a/crawl-ref/source/mon-stuff.cc +++ b/crawl-ref/source/mon-stuff.cc @@ -158,6 +158,7 @@ const item_def *give_mimic_item(monsters *mimic) return 0; if (!mimic->pickup_misc(mitm[it], 0)) ASSERT("Mimic failed to pickup its item."); + ASSERT(mimic->inv[MSLOT_MISCELLANY] != NON_ITEM); return (&mitm[mimic->inv[MSLOT_MISCELLANY]]); } @@ -1461,7 +1462,7 @@ int monster_die(monsters *monster, killer_type killer, const bool gives_xp = (!summoned && !mons_class_flag(monster->type, M_NO_EXP_GAIN)); - const bool drop_items = !hard_reset; + bool drop_items = !hard_reset; const bool mons_reset(killer == KILL_RESET || killer == KILL_DISMISSED); @@ -2047,7 +2048,7 @@ int monster_die(monsters *monster, killer_type killer, // A banished monster that doesn't go on the transit list // loses all items. if (!monster->is_summoned()) - monster->destroy_inventory(); + drop_items = false; break; } @@ -2055,7 +2056,7 @@ int monster_die(monsters *monster, killer_type killer, monster->flags |= MF_BANISHED; monster->set_transit(level_id(LEVEL_ABYSS)); in_transit = true; - monster->destroy_inventory(); + drop_items = false; // Make monster stop patrolling and/or travelling. monster->patrol_point.reset(); monster->travel_path.clear(); @@ -2066,7 +2067,7 @@ int monster_die(monsters *monster, killer_type killer, break; default: - monster->destroy_inventory(); + drop_items = false; break; } @@ -2129,7 +2130,7 @@ int monster_die(monsters *monster, killer_type killer, _elven_twin_died(monster, in_transit); } else if (mons_is_mimic(monster->type)) - monster->destroy_inventory(); + drop_items = false; else if (!monster->is_summoned()) { if (mons_genus(monster->type) == MONS_MUMMY) -- cgit v1.2.3-54-g00ecf From e4920e5fdf6a8d2ac33b463de967b1190b9353cc Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Tue, 22 Dec 2009 12:40:11 +0100 Subject: Don't mimic potions of blood, they decay. --- crawl-ref/source/mon-stuff.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc index 77f74ff11c..d0446ff563 100644 --- a/crawl-ref/source/mon-stuff.cc +++ b/crawl-ref/source/mon-stuff.cc @@ -133,7 +133,9 @@ int _make_mimic_item(monster_type type) case MONS_POTION_MIMIC: item.base_type = OBJ_POTIONS; - item.sub_type = random2(NUM_POTIONS); + do + item.sub_type = random2(NUM_POTIONS); + while (is_blood_potion(item)); break; case MONS_GOLD_MIMIC: -- cgit v1.2.3-54-g00ecf From 86fe0e02db7ee289be861dcd572be84576de1bd1 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Tue, 22 Dec 2009 13:54:56 +0100 Subject: Make petrified and sleeping monsters not "fast" wrt Che piety gain and slouch. --- crawl-ref/source/godabil.cc | 2 +- crawl-ref/source/mon-stuff.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crawl-ref/source/godabil.cc b/crawl-ref/source/godabil.cc index edb1b723fb..f8b6ce9960 100644 --- a/crawl-ref/source/godabil.cc +++ b/crawl-ref/source/godabil.cc @@ -1256,7 +1256,7 @@ bool ponderousify_armour() static int _slouch_monsters(coord_def where, int pow, int, actor* agent) { monsters* mon = monster_at(where); - if (mon == NULL || mons_is_stationary(mon)) + if (mon == NULL || mons_is_stationary(mon) || mon->cannot_move()) return (0); int dmg = (mon->speed - 1000/player_movement_speed()/player_speed()); diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc index d0446ff563..add22f09c5 100644 --- a/crawl-ref/source/mon-stuff.cc +++ b/crawl-ref/source/mon-stuff.cc @@ -1731,7 +1731,7 @@ int monster_die(monsters *monster, killer_type killer, } // Cheibriados hates fast monsters. - if (mons_is_fast(monster)) + if (mons_is_fast(monster) && !monster->cannot_move()) { did_god_conduct(DID_KILL_FAST, monster->hit_dice, true, monster); -- cgit v1.2.3-54-g00ecf From bc3529421a5b0713eb2c4966b244a93542b62c18 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Tue, 22 Dec 2009 15:07:58 +0100 Subject: Remove rPois and rC from monster merfolk, they can't drown anymore (Mantis 034). --- crawl-ref/source/mon-data.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h index e9094329bd..7dff442836 100644 --- a/crawl-ref/source/mon-data.h +++ b/crawl-ref/source/mon-data.h @@ -1097,7 +1097,7 @@ static monsterentry mondata[] = { { MONS_MERFOLK, 'm', LIGHTBLUE, "merfolk", M_WARM_BLOOD | M_SPEAKS, - MR_RES_POISON | MR_RES_COLD, + MR_NO_FLAGS, 500, 10, MONS_MERFOLK, MONS_MERFOLK, MH_NATURAL, -3, { {AT_HIT, AF_PLAIN, 14}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, { 9, 2, 4, 0 }, @@ -1109,7 +1109,7 @@ static monsterentry mondata[] = { { MONS_MERMAID, 'm', CYAN, "mermaid", M_SPELLCASTER | M_WARM_BLOOD | M_SPEAKS, - MR_RES_POISON | MR_RES_COLD, + MR_NO_FLAGS, 500, 10, MONS_MERMAID, MONS_MERMAID, MH_NATURAL, -5, { {AT_HIT, AF_PLAIN, 10}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, { 8, 2, 3, 0 }, @@ -1121,7 +1121,7 @@ static monsterentry mondata[] = { { MONS_SIREN, 'm', LIGHTCYAN, "siren", M_SPELLCASTER | M_WARM_BLOOD | M_SPEAKS, - MR_RES_POISON | MR_RES_COLD, + MR_NO_FLAGS, 500, 12, MONS_MERMAID, MONS_SIREN, MH_NATURAL, -7, { {AT_HIT, AF_PLAIN, 10}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, { 8, 2, 3, 0 }, -- cgit v1.2.3-54-g00ecf From b0c8e0751e6798c6686f3a62867aee7fbfef5797 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Tue, 22 Dec 2009 15:18:16 +0100 Subject: Add sixfirhies to summon_any_demon(), with a 3% chance in the middle tier. --- crawl-ref/source/mon-place.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crawl-ref/source/mon-place.cc b/crawl-ref/source/mon-place.cc index a4273c6a7c..9faa371cb8 100644 --- a/crawl-ref/source/mon-place.cc +++ b/crawl-ref/source/mon-place.cc @@ -2927,8 +2927,9 @@ monster_type summon_any_demon(demon_class_type dct) break; case DEMON_COMMON: - temp_rand = random2(3948); - mon = ((temp_rand > 3367) ? MONS_NEQOXEC : // 14.69% + temp_rand = random2(4066); + mon = ((temp_rand > 3947) ? MONS_SIXFIRHY : // 3.00% + (temp_rand > 3367) ? MONS_NEQOXEC : // 14.69% (temp_rand > 2787) ? MONS_ORANGE_DEMON : // 14.69% (temp_rand > 2207) ? MONS_HELLWING : // 14.69% (temp_rand > 1627) ? MONS_SMOKE_DEMON : // 14.69% -- cgit v1.2.3-54-g00ecf From 419a15a2f1561f0c513b6a67c7683c3ee4af7dba Mon Sep 17 00:00:00 2001 From: Johanna Ploog Date: Wed, 23 Dec 2009 23:07:39 +0100 Subject: Improved shaft tile. The thicker outline makes it easily visible on *all* terrain types, and the transparent gradient makes it fit differently coloured backgrounds. While I was at it, I also corrected the shadows falling in the wrong direction. Considering the shaft was my first tile back then, it's easy to see I've become better at drawing them. I'm very happy with this one. :) --- crawl-ref/source/rltiles/dc-dngn/dngn_trap_shaft.png | Bin 317 -> 551 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/crawl-ref/source/rltiles/dc-dngn/dngn_trap_shaft.png b/crawl-ref/source/rltiles/dc-dngn/dngn_trap_shaft.png index 32129807fb..a931331eed 100644 Binary files a/crawl-ref/source/rltiles/dc-dngn/dngn_trap_shaft.png and b/crawl-ref/source/rltiles/dc-dngn/dngn_trap_shaft.png differ -- cgit v1.2.3-54-g00ecf From cdda3cfe049baa077d37e5cf23e7952f7747580a Mon Sep 17 00:00:00 2001 From: Johanna Ploog Date: Wed, 23 Dec 2009 23:10:53 +0100 Subject: Add base tiles for altars and statues (pedestal) to the UNUSED folder. --- crawl-ref/source/rltiles/UNUSED/other/dngn_altar_base.png | Bin 0 -> 512 bytes crawl-ref/source/rltiles/UNUSED/other/pedestal.png | Bin 0 -> 617 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 crawl-ref/source/rltiles/UNUSED/other/dngn_altar_base.png create mode 100644 crawl-ref/source/rltiles/UNUSED/other/pedestal.png diff --git a/crawl-ref/source/rltiles/UNUSED/other/dngn_altar_base.png b/crawl-ref/source/rltiles/UNUSED/other/dngn_altar_base.png new file mode 100644 index 0000000000..322d674f71 Binary files /dev/null and b/crawl-ref/source/rltiles/UNUSED/other/dngn_altar_base.png differ diff --git a/crawl-ref/source/rltiles/UNUSED/other/pedestal.png b/crawl-ref/source/rltiles/UNUSED/other/pedestal.png new file mode 100644 index 0000000000..07e57b7480 Binary files /dev/null and b/crawl-ref/source/rltiles/UNUSED/other/pedestal.png differ -- cgit v1.2.3-54-g00ecf From d60fd07417f8a5f7d0fece9c514a0741487bd031 Mon Sep 17 00:00:00 2001 From: Johanna Ploog Date: Thu, 24 Dec 2009 01:59:18 +0100 Subject: Improve Kirke's tile by removing the superfluous internal outlines. (With thanks to Enne for pointing out the value of pixel art tutorials! :D) --- crawl-ref/source/rltiles/dc-mon/unique/kirke.png | Bin 1029 -> 1072 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/crawl-ref/source/rltiles/dc-mon/unique/kirke.png b/crawl-ref/source/rltiles/dc-mon/unique/kirke.png index a10a319863..77769d5e06 100644 Binary files a/crawl-ref/source/rltiles/dc-mon/unique/kirke.png and b/crawl-ref/source/rltiles/dc-mon/unique/kirke.png differ -- cgit v1.2.3-54-g00ecf From 4b8c9fc0252de2891aede359b39dd0c44ee743ed Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Thu, 24 Dec 2009 01:05:17 +0100 Subject: Let ghouls wield vampiric weapons. Change the wield fail message. --- crawl-ref/source/item_use.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 4553465d97..691ffb0217 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -175,12 +175,13 @@ bool can_wield(item_def *weapon, bool say_reason, } if (you.hunger_state < HS_FULL + && you.hunger < you_max_hunger() - 500 // ghouls && get_weapon_brand(*weapon) == SPWPN_VAMPIRICISM && you.species != SP_VAMPIRE && you.species != SP_MUMMY) { if (say_reason) { - mpr("You're too hungry to wield that."); + mpr("As you grasp it, you feel a great hunger. Being not satiated, you stop."); // If it's a standard weapon, you know its ego now. if (!is_artefact(*weapon) && !is_blessed(*weapon) && !item_type_known(*weapon)) -- cgit v1.2.3-54-g00ecf From 5b9916a319a570598c8cd54e916eb10dab0eb916 Mon Sep 17 00:00:00 2001 From: Enne Walker Date: Sat, 19 Dec 2009 19:07:58 -0500 Subject: Fixing power-of-two image loading issue. If any tile image was a power of two, it would use a different path to load and swap R and B. --- crawl-ref/source/tiletex.cc | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/crawl-ref/source/tiletex.cc b/crawl-ref/source/tiletex.cc index ec65f779a1..804408ec0d 100644 --- a/crawl-ref/source/tiletex.cc +++ b/crawl-ref/source/tiletex.cc @@ -81,30 +81,29 @@ bool GenericTexture::load_texture(const char *filename, GLenum texture_format; if (bpp == 4) { - if (new_width != img->w || new_height != img->h) - { - SDL_LockSurface(img); - pixels = new unsigned char[4 * new_width * new_height]; - memset(pixels, 0, 4 * new_width * new_height); + // Even if the size is the same, still go through + // SDL_GetRGBA to put the image in the right format. + SDL_LockSurface(img); + pixels = new unsigned char[4 * new_width * new_height]; + memset(pixels, 0, 4 * new_width * new_height); - int dest = 0; - for (int y = 0; y < img->h; y++) + int dest = 0; + for (int y = 0; y < img->h; y++) + { + for (int x = 0; x < img->w; x++) { - for (int x = 0; x < img->w; x++) - { - unsigned char *p = ((unsigned char*)img->pixels - + y * img->pitch + x * bpp); - unsigned int pixel = *(unsigned int*)p; - SDL_GetRGBA(pixel, img->format, &pixels[dest], - &pixels[dest+1], &pixels[dest+2], - &pixels[dest+3]); - dest += 4; - } - dest += 4 * (new_width - img->w); + unsigned char *p = ((unsigned char*)img->pixels + + y * img->pitch + x * bpp); + unsigned int pixel = *(unsigned int*)p; + SDL_GetRGBA(pixel, img->format, &pixels[dest], + &pixels[dest+1], &pixels[dest+2], + &pixels[dest+3]); + dest += 4; } - - SDL_UnlockSurface(img); + dest += 4 * (new_width - img->w); } + + SDL_UnlockSurface(img); texture_format = GL_RGBA; } else if (bpp == 3) -- cgit v1.2.3-54-g00ecf From bcc249f77c1459b75b7a4f96b018a15569e675b3 Mon Sep 17 00:00:00 2001 From: Enne Walker Date: Wed, 23 Dec 2009 23:32:52 -0500 Subject: Basic support for tile recolouring. Added %variation, %repeat, %desat, %lum, %hue, %pal, %resetcol commands to rltiles. Also, multiple enum synonyms can now be specified. Documentation on all rltiles commands is forthcoming. Sorry. Added coloured variations for a number of floor and wall tiles, removing duplicate source art where it made sense. The variations probably need some adjusting to look less like fruit salad. COLOUR in a vault specification will now automatically try to pick coloured variations of basic floor and rock wall tiles by default. It will also pick coloured variations of any tiles specified by FTILE/RTILE/TILE. I'll leave it as an exercise for due to generalize this to features and monsters. tile_dngn_coloured (and corresponding functions for other tile sheets) can be used to look up coloured variations for a given tile index. --- crawl-ref/docs/develop/levels/syntax.txt | 9 + crawl-ref/source/mapdef.cc | 12 +- crawl-ref/source/rltiles/dc-dngn.txt | 678 +++++++++++++++++++-- .../source/rltiles/dc-dngn/floor/pebble_brown0.png | Bin 0 -> 1392 bytes .../source/rltiles/dc-dngn/floor/pebble_brown1.png | Bin 0 -> 1380 bytes .../source/rltiles/dc-dngn/floor/pebble_brown2.png | Bin 0 -> 1227 bytes .../source/rltiles/dc-dngn/floor/pebble_brown3.png | Bin 0 -> 1284 bytes .../source/rltiles/dc-dngn/floor/pebble_brown4.png | Bin 0 -> 1423 bytes .../source/rltiles/dc-dngn/floor/pebble_brown5.png | Bin 0 -> 1388 bytes .../source/rltiles/dc-dngn/floor/pebble_brown6.png | Bin 0 -> 1260 bytes .../source/rltiles/dc-dngn/floor/pebble_brown7.png | Bin 0 -> 1332 bytes .../source/rltiles/dc-dngn/floor/pebble_brown8.png | Bin 0 -> 1268 bytes .../source/rltiles/dc-dngn/floor/pebble_gray0.png | Bin 919 -> 0 bytes .../source/rltiles/dc-dngn/floor/pebble_gray1.png | Bin 893 -> 0 bytes .../source/rltiles/dc-dngn/floor/pebble_gray2.png | Bin 853 -> 0 bytes .../source/rltiles/dc-dngn/floor/pebble_gray3.png | Bin 864 -> 0 bytes .../source/rltiles/dc-dngn/floor/pebble_gray4.png | Bin 956 -> 0 bytes .../source/rltiles/dc-dngn/floor/pebble_gray5.png | Bin 1275 -> 0 bytes .../source/rltiles/dc-dngn/floor/pebble_gray6.png | Bin 1255 -> 0 bytes .../source/rltiles/dc-dngn/floor/pebble_gray7.png | Bin 1267 -> 0 bytes .../source/rltiles/dc-dngn/floor/pebble_gray8.png | Bin 1259 -> 0 bytes crawl-ref/source/rltiles/dc-dngn/wall/ice0.png | Bin 679 -> 0 bytes crawl-ref/source/rltiles/dc-dngn/wall/ice1.png | Bin 899 -> 0 bytes crawl-ref/source/rltiles/dc-dngn/wall/ice2.png | Bin 886 -> 0 bytes crawl-ref/source/rltiles/dc-dngn/wall/ice3.png | Bin 987 -> 0 bytes crawl-ref/source/rltiles/dc-dngn/wall/snake0.png | Bin 936 -> 0 bytes crawl-ref/source/rltiles/dc-dngn/wall/snake1.png | Bin 938 -> 0 bytes crawl-ref/source/rltiles/dc-dngn/wall/snake2.png | Bin 1057 -> 0 bytes crawl-ref/source/rltiles/dc-dngn/wall/snake3.png | Bin 1119 -> 0 bytes .../source/rltiles/dc-dngn/wall/stone2_brown0.png | Bin 0 -> 1561 bytes .../source/rltiles/dc-dngn/wall/stone2_brown1.png | Bin 0 -> 1885 bytes .../source/rltiles/dc-dngn/wall/stone2_brown2.png | Bin 0 -> 1745 bytes .../source/rltiles/dc-dngn/wall/stone2_brown3.png | Bin 0 -> 1709 bytes .../source/rltiles/dc-dngn/wall/zot_cyan0.png | Bin 679 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_cyan1.png | Bin 899 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_cyan2.png | Bin 886 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_cyan3.png | Bin 987 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_gray0.png | Bin 701 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_gray1.png | Bin 1020 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_gray2.png | Bin 981 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_gray3.png | Bin 1100 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_green0.png | Bin 679 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_green1.png | Bin 840 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_green2.png | Bin 833 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_green3.png | Bin 921 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_magenta0.png | Bin 686 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_magenta1.png | Bin 930 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_magenta2.png | Bin 905 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_magenta3.png | Bin 1016 -> 0 bytes crawl-ref/source/rltiles/dc-dngn/wall/zot_red0.png | Bin 677 -> 0 bytes crawl-ref/source/rltiles/dc-dngn/wall/zot_red1.png | Bin 836 -> 0 bytes crawl-ref/source/rltiles/dc-dngn/wall/zot_red2.png | Bin 831 -> 0 bytes crawl-ref/source/rltiles/dc-dngn/wall/zot_red3.png | Bin 914 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_yellow0.png | Bin 673 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_yellow1.png | Bin 894 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_yellow2.png | Bin 883 -> 0 bytes .../source/rltiles/dc-dngn/wall/zot_yellow3.png | Bin 970 -> 0 bytes crawl-ref/source/rltiles/tiledef_defines.h | 47 ++ crawl-ref/source/rltiles/tool/tile.cc | 43 +- crawl-ref/source/rltiles/tool/tile.h | 20 +- crawl-ref/source/rltiles/tool/tile_colour.cc | 220 +++++++ crawl-ref/source/rltiles/tool/tile_colour.h | 49 ++ .../source/rltiles/tool/tile_list_processor.cc | 390 ++++++++++-- .../source/rltiles/tool/tile_list_processor.h | 17 + crawl-ref/source/rltiles/tool/tile_page.cc | 34 ++ crawl-ref/source/rltiles/tool/tile_page.h | 5 + crawl-ref/source/tile2.cc | 2 +- crawl-ref/source/tilepick.cc | 28 +- 68 files changed, 1400 insertions(+), 154 deletions(-) create mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown0.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown1.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown2.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown3.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown4.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown5.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown6.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown7.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown8.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray0.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray1.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray2.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray3.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray4.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray5.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray6.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray7.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray8.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/ice0.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/ice1.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/ice2.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/ice3.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/snake0.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/snake1.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/snake2.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/snake3.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown0.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown1.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown2.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown3.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan0.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan1.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan2.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan3.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_gray0.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_gray1.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_gray2.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_gray3.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_green0.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_green1.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_green2.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_green3.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta0.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta1.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta2.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta3.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_red0.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_red1.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_red2.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_red3.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow0.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow1.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow2.png delete mode 100644 crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow3.png diff --git a/crawl-ref/docs/develop/levels/syntax.txt b/crawl-ref/docs/develop/levels/syntax.txt index 0a7b56d7e2..d99fb5faf9 100644 --- a/crawl-ref/docs/develop/levels/syntax.txt +++ b/crawl-ref/docs/develop/levels/syntax.txt @@ -821,6 +821,9 @@ COLOUR: . = green / blue:5 / red / none Even more so than base colours, elemental colours should be used very, very, very sparingly. + Colours apply automatically to floor and rock wall tiles, although + not all branches have coloured variations for their tile set. + FTILE: . = floor_grass:20 / floor_dirt / none Similar to COLOUR, FTILE allows you to attach explicit floor tiles to any glyph. In non-tiles builds, this does nothing. @@ -838,6 +841,9 @@ FTILE: . = floor_grass:20 / floor_dirt / none Like COLOUR, this should be used sparingly. + If COLOUR is also specified and there is a coloured variation + of this tile, then it will be used. + RTILE: x = wall_hive:15 / wall_lair / none Identical to FTILE, but for rock walls. Not useful for anything but the rock wall feature. @@ -854,6 +860,9 @@ TILE: x = wall_flesh Like COLOUR and FTILE, this should be used sparingly and to good effect. + If COLOUR is also specified and there is a coloured variation + of this tile, then it will be used. + To override doors, use the specific tile set in combination with the "no_random" specifier. Example: + = no_random dngn_fleshy_orifice diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index effde648fa..060ec78677 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -501,21 +501,27 @@ void map_lines::apply_grid_overlay(const coord_def &c) // Over-ride whatever property is already there. env.pgrid(gc) |= property; #ifdef USE_TILE - const int floor = (*overlay)(x, y).floortile; + int floor = (*overlay)(x, y).floortile; if (floor) { + if (colour) + floor = tile_dngn_coloured(floor, colour); int offset = random2(tile_dngn_count(floor)); env.tile_flv(gc).floor = floor + offset; } - const int rock = (*overlay)(x, y).rocktile; + int rock = (*overlay)(x, y).rocktile; if (rock) { + if (colour) + rock = tile_dngn_coloured(rock, colour); int offset = random2(tile_dngn_count(rock)); env.tile_flv(gc).wall = rock + offset; } - const int tile = (*overlay)(x, y).tile; + int tile = (*overlay)(x, y).tile; if (tile) { + if (colour) + tile = tile_dngn_coloured(tile, colour); int offset = random2(tile_dngn_count(tile)); if (grd(gc) == DNGN_FLOOR && !floor) env.tile_flv(gc).floor = tile + offset; diff --git a/crawl-ref/source/rltiles/dc-dngn.txt b/crawl-ref/source/rltiles/dc-dngn.txt index cb19cf936d..53a5f1270a 100644 --- a/crawl-ref/source/rltiles/dc-dngn.txt +++ b/crawl-ref/source/rltiles/dc-dngn.txt @@ -8,7 +8,8 @@ dngn_unseen DNGN_UNSEEN # Multiple tile definitions are STATIC, that is they may change between # saves but are otherwise fixed. -wall/brick_brown0 WALL_NORMAL + +wall/brick_brown0 WALL_NORMAL WALL_BRICK WALL_BRICK_BROWN wall/brick_brown1 wall/brick_brown2 wall/brick_brown3 @@ -16,15 +17,246 @@ wall/brick_brown4 wall/brick_brown5 wall/brick_brown6 wall/brick_brown7 -floor/pebble_gray0 FLOOR_NORMAL -floor/pebble_gray1 -floor/pebble_gray2 -floor/pebble_gray3 -floor/pebble_gray4 -floor/pebble_gray5 -floor/pebble_gray6 -floor/pebble_gray7 -floor/pebble_gray8 + +%variation WALL_BRICK blue +%hue 30 240 +%hue 0 240 +%repeat WALL_BRICK WALL_BRICK_BLUE +%resetcol + +%variation WALL_BRICK green +%hue 30 90 +%hue 0 90 +%repeat WALL_BRICK WALL_BRICK_GREEN WALL_SNAKE +%resetcol + +%variation WALL_BRICK cyan +%hue 30 180 +%hue 0 180 +%repeat WALL_BRICK WALL_BRICK_CYAN +%resetcol + +%variation WALL_BRICK red +%hue 30 0 +%repeat WALL_BRICK WALL_BRICK_RED +%resetcol + +%variation WALL_BRICK magenta +%hue 30 300 +%hue 0 300 +%repeat WALL_BRICK WALL_BRICK_MAGENTA +%resetcol + +%variation WALL_BRICK lightgray +%desat 30 +%desat 0 +%lum 0 10 +%repeat WALL_BRICK WALL_BRICK_LIGHTGRAY +%resetcol + +%variation WALL_BRICK darkgray +%desat 30 +%lum 30 -20 +%desat 0 +%repeat WALL_BRICK WALL_BRICK_DARKGRAY +%resetcol + +%variation WALL_BRICK lightblue +%hue 30 240 +%lum 30 15 +%hue 0 240 +%repeat WALL_BRICK WALL_BRICK_LIGHTBLUE +%resetcol + +%variation WALL_BRICK lightgreen +%hue 30 90 +%lum 30 15 +%hue 0 90 +%lum 0 5 +%repeat WALL_BRICK WALL_BRICK_LIGHTGREEN +%resetcol + +%variation WALL_BRICK lightcyan +%hue 30 180 +%lum 30 15 +%hue 0 180 +%lum 0 5 +%repeat WALL_BRICK WALL_BRICK_LIGHTCYAN +%resetcol + +%variation WALL_BRICK lightred +%hue 30 0 +%lum 30 15 +%lum 0 5 +%repeat WALL_BRICK WALL_BRICK_LIGHTRED +%resetcol + +%variation WALL_BRICK lightmagenta +%hue 30 300 +%lum 30 15 +%hue 0 300 +%lum 0 5 +%repeat WALL_BRICK WALL_BRICK_LIGHTMAGENTA +%resetcol + +%variation WALL_BRICK yellow +%hue 30 60 +%hue 0 60 +%repeat WALL_BRICK WALL_BRICK_YELLOW +%resetcol + +%variation WALL_BRICK white +%desat 30 +%lum 30 30 +%desat 0 +%lum 0 15 +%repeat WALL_BRICK WALL_BRICK_WHITE +%resetcol + +# The colorized versions of FLOOR_PEBBLE were made from +# pebble_gray*.png, by colorizing the non-border color +# with hue 30, sat 50, lum +20 in GIMP. +%desat 28 +%desat 29 +%desat 30 +floor/pebble_brown0 FLOOR_PEBBLE FLOOR_PEBBLE_LIGHTGRAY FLOOR_NORMAL +floor/pebble_brown1 +floor/pebble_brown2 +floor/pebble_brown3 +floor/pebble_brown4 +floor/pebble_brown5 +floor/pebble_brown6 +floor/pebble_brown7 +floor/pebble_brown8 +%resetcol + +%variation FLOOR_PEBBLE brown +%hue 28 30 +%hue 29 30 +# Can't just use %repeat here, as we want the coloured versions. +floor/pebble_brown0 FLOOR_PEBBLE_BROWN +floor/pebble_brown1 +floor/pebble_brown2 +floor/pebble_brown3 +floor/pebble_brown4 +floor/pebble_brown5 +floor/pebble_brown6 +floor/pebble_brown7 +floor/pebble_brown8 +%resetcol + +%variation FLOOR_PEBBLE blue +%hue 28 240 +%hue 29 240 +%hue 30 240 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_BLUE +%resetcol + +%variation FLOOR_PEBBLE green +%hue 28 90 +%hue 29 90 +%hue 30 90 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_GREEN +%resetcol + +%variation FLOOR_PEBBLE cyan +%hue 28 180 +%hue 29 180 +%hue 30 180 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_CYAN +%resetcol + +%variation FLOOR_PEBBLE red +%hue 28 0 +%hue 29 0 +%hue 30 0 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_RED +%resetcol + +%variation FLOOR_PEBBLE magenta +%hue 28 300 +%hue 29 300 +%hue 30 300 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_MAGENTA +%resetcol + +%variation FLOOR_PEBBLE darkgray +%desat 28 +%desat 29 +%desat 30 +%lum 28 -7 +%lum 29 -7 +%lum 30 -7 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_DARKGRAY +%resetcol + +%variation FLOOR_PEBBLE lightblue +%hue 28 240 +%hue 29 240 +%hue 30 240 +%lum 28 7 +%lum 29 7 +%lum 30 7 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_LIGHTBLUE +%resetcol + +%variation FLOOR_PEBBLE lightgreen +%hue 28 90 +%hue 29 90 +%hue 30 90 +%lum 28 7 +%lum 29 7 +%lum 30 7 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_LIGHTGREEN +%resetcol + +%variation FLOOR_PEBBLE lightcyan +%hue 28 180 +%hue 29 180 +%hue 30 180 +%lum 28 7 +%lum 29 7 +%lum 30 7 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_LIGHTCYAN +%resetcol + +%variation FLOOR_PEBBLE lightred +%hue 28 0 +%hue 29 0 +%hue 30 0 +%lum 28 7 +%lum 29 7 +%lum 30 7 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_LIGHTRED +%resetcol + +%variation FLOOR_PEBBLE lightmagenta +%hue 28 300 +%hue 29 300 +%hue 30 300 +%lum 28 7 +%lum 29 7 +%lum 30 7 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_LIGHTMAGENTA +%resetcol + +%variation FLOOR_PEBBLE yellow +%hue 28 60 +%hue 29 60 +%hue 30 60 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_YELLOW +%resetcol + +%variation FLOOR_PEBBLE white +%desat 28 +%desat 29 +%desat 30 +%lum 0 20 +%lum 28 40 +%lum 29 40 +%lum 30 40 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_WHITE +%resetcol wall/relief0 WALL_HALL wall/relief1 @@ -39,21 +271,18 @@ wall/hive0 WALL_HIVE wall/hive1 wall/hive2 wall/hive3 -floor/hive0 FLOOR_HIVE + +floor/hive0 FLOOR_HIVE FLOOR_ORC floor/hive1 floor/hive2 floor/hive3 -wall/ice0 WALL_ICE -wall/ice1 -wall/ice2 -wall/ice3 floor/ice0 FLOOR_ICE floor/ice1 floor/ice2 floor/ice3 -wall/lair0 WALL_LAIR +wall/lair0 WALL_LAIR WALL_ORC WALL_SWAMP wall/lair1 wall/lair2 wall/lair3 @@ -62,16 +291,6 @@ floor/lair1 floor/lair2 floor/lair3 -## orcs don't have their own floor or walls yet... -wall/lair0 WALL_ORC -wall/lair1 -wall/lair2 -wall/lair3 -floor/hive0 FLOOR_ORC -floor/hive1 -floor/hive2 -floor/hive3 - wall/slime0 WALL_SLIME wall/slime1 wall/slime2 @@ -81,20 +300,12 @@ floor/bog_green1 floor/bog_green2 floor/bog_green3 -wall/snake0 WALL_SNAKE -wall/snake1 -wall/snake2 -wall/snake3 floor/snake0 FLOOR_SNAKE floor/snake1 floor/snake2 floor/snake3 ## swamp also doesn't have any unique walls... -wall/lair0 WALL_SWAMP -wall/lair1 -wall/lair2 -wall/lair3 floor/swamp0 FLOOR_SWAMP floor/swamp1 floor/swamp2 @@ -118,40 +329,87 @@ floor/rect_gray1 floor/rect_gray2 floor/rect_gray3 -wall/zot_blue0 WALL_ZOT_BLUE +wall/zot_blue0 WALL_ZOT WALL_ZOT_BLUE wall/zot_blue1 wall/zot_blue2 wall/zot_blue3 -wall/zot_cyan0 WALL_ZOT_CYAN -wall/zot_cyan1 -wall/zot_cyan2 -wall/zot_cyan3 +%variation WALL_ZOT green +%hue 240 120 +%repeat WALL_ZOT WALL_ZOT_GREEN +%resetcol + +%variation WALL_ZOT cyan +%hue 240 180 +%repeat WALL_ZOT WALL_ZOT_CYAN WALL_ICE +%resetcol + +%variation WALL_ZOT red +%hue 240 0 +%repeat WALL_ZOT WALL_ZOT_RED +%resetcol + +%variation WALL_ZOT magenta +%hue 240 300 +%repeat WALL_ZOT WALL_ZOT_MAGENTA +%resetcol + +%variation WALL_ZOT brown +%hue 240 30 +%repeat WALL_ZOT WALL_ZOT_BROWN +%resetcol + +%variation WALL_ZOT lightgray +%desat 240 +%lum 240 -15 +%repeat WALL_ZOT WALL_ZOT_LIGHTGRAY +%resetcol + +%variation WALL_ZOT darkgray +%desat 240 +%lum 240 -30 +%repeat WALL_ZOT WALL_ZOT_DARKGRAY +%resetcol -wall/zot_gray0 WALL_ZOT_GRAY -wall/zot_gray1 -wall/zot_gray2 -wall/zot_gray3 +%variation WALL_ZOT lightblue +%lum 240 40 +%repeat WALL_ZOT WALL_ZOT_LIGHTBLUE +%resetcol -wall/zot_green0 WALL_ZOT_GREEN -wall/zot_green1 -wall/zot_green2 -wall/zot_green3 +%variation WALL_ZOT lightgreen +%hue 240 120 +%lum 240 15 +%repeat WALL_ZOT WALL_ZOT_LIGHTGREEN +%resetcol -wall/zot_magenta0 WALL_ZOT_MAGENTA -wall/zot_magenta1 -wall/zot_magenta2 -wall/zot_magenta3 +%variation WALL_ZOT lightcyan +%hue 240 180 +%lum 240 15 +%repeat WALL_ZOT WALL_ZOT_LIGHTCYAN +%resetcol -wall/zot_red0 WALL_ZOT_RED -wall/zot_red1 -wall/zot_red2 -wall/zot_red3 +%variation WALL_ZOT lightred +%hue 240 0 +%lum 240 40 +%repeat WALL_ZOT WALL_ZOT_LIGHTRED +%resetcol -wall/zot_yellow0 WALL_ZOT_YELLOW -wall/zot_yellow1 -wall/zot_yellow2 -wall/zot_yellow3 +%variation WALL_ZOT lightmagenta +%hue 240 300 +%lum 240 40 +%repeat WALL_ZOT WALL_ZOT_LIGHTMAGENTA +%resetcol + +%variation WALL_ZOT yellow +%hue 240 60 +%repeat WALL_ZOT WALL_ZOT_YELLOW +%resetcol + +%variation WALL_ZOT white +%desat 240 +%lum 240 10 +%repeat WALL_ZOT WALL_ZOT_WHITE +%resetcol wall/wall_flesh0 WALL_FLESH wall/wall_flesh1 @@ -177,16 +435,169 @@ floor/floor_vines4 floor/floor_vines5 floor/floor_vines6 -wall/pebble_red0 WALL_PEBBLE_RED +wall/pebble_red0 WALL_PEBBLE WALL_PEBBLE_RED wall/pebble_red1 wall/pebble_red2 wall/pebble_red3 -floor/rough_red0 FLOOR_ROUGH_RED +%variation WALL_PEBBLE blue +%hue 0 240 +%repeat WALL_PEBBLE WALL_PEBBLE_BLUE +%resetcol + +%variation WALL_PEBBLE green +%hue 0 90 +%repeat WALL_PEBBLE WALL_PEBBLE_GREEN +%resetcol + +%variation WALL_PEBBLE cyan +%hue 0 180 +%repeat WALL_PEBBLE WALL_PEBBLE_CYAN +%resetcol + +%variation WALL_PEBBLE magenta +%hue 0 300 +%repeat WALL_PEBBLE WALL_PEBBLE_MAGENTA +%resetcol + +%variation WALL_PEBBLE brown +%hue 0 30 +%repeat WALL_PEBBLE WALL_PEBBLE_BROWN +%resetcol + +%variation WALL_PEBBLE lightgray +%desat 0 +%lum 0 -10 +%repeat WALL_PEBBLE WALL_PEBBLE_LIGHTGRAY +%resetcol + +%variation WALL_PEBBLE darkgray +%desat 0 +%lum 0 -30 +%repeat WALL_PEBBLE WALL_PEBBLE_DARKGRAY +%resetcol + +%variation WALL_PEBBLE lightblue +%hue 0 240 +%lum 0 15 +%repeat WALL_PEBBLE WALL_PEBBLE_LIGHTBLUE +%resetcol + +%variation WALL_PEBBLE lightgreen +%hue 0 90 +%lum 0 15 +%repeat WALL_PEBBLE WALL_PEBBLE_LIGHTGREEN +%resetcol + +%variation WALL_PEBBLE lightcyan +%hue 0 180 +%lum 0 15 +%repeat WALL_PEBBLE WALL_PEBBLE_LIGHTCYAN +%resetcol + +%variation WALL_PEBBLE lightred +%lum 0 15 +%repeat WALL_PEBBLE WALL_PEBBLE_LIGHTRED +%resetcol + +%variation WALL_PEBBLE lightmagenta +%hue 0 300 +%lum 0 15 +%repeat WALL_PEBBLE WALL_PEBBLE_LIGHTMAGENTA +%resetcol + +%variation WALL_PEBBLE yellow +%hue 0 60 +%repeat WALL_PEBBLE WALL_PEBBLE_YELLOW +%resetcol + +%variation WALL_PEBBLE white +%desat 0 +%lum 0 20 +%repeat WALL_PEBBLE WALL_PEBBLE_WHITE +%resetcol + +floor/rough_red0 FLOOR_ROUGH FLOOR_ROUGH_RED floor/rough_red1 floor/rough_red2 floor/rough_red3 +%variation FLOOR_ROUGH blue +%hue 0 240 +%repeat FLOOR_ROUGH FLOOR_ROUGH_BLUE +%resetcol + +%variation FLOOR_ROUGH green +%hue 0 90 +%repeat FLOOR_ROUGH FLOOR_ROUGH_GREEN +%resetcol + +%variation FLOOR_ROUGH cyan +%hue 0 180 +%repeat FLOOR_ROUGH FLOOR_ROUGH_CYAN +%resetcol + +%variation FLOOR_ROUGH magenta +%hue 0 300 +%repeat FLOOR_ROUGH FLOOR_ROUGH_MAGENTA +%resetcol + +%variation FLOOR_ROUGH brown +%hue 0 30 +%repeat FLOOR_ROUGH FLOOR_ROUGH_BROWN +%resetcol + +%variation FLOOR_ROUGH lightgray +%desat 0 +%repeat FLOOR_ROUGH FLOOR_ROUGH_LIGHTGRAY +%resetcol + +%variation FLOOR_ROUGH darkgray +%desat 0 +%lum 0 -10 +%repeat FLOOR_ROUGH FLOOR_ROUGH_DARKGRAY +%resetcol + +%variation FLOOR_ROUGH lightblue +%hue 0 240 +%lum 0 10 +%repeat FLOOR_ROUGH FLOOR_ROUGH_LIGHTBLUE +%resetcol + +%variation FLOOR_ROUGH lightgreen +%hue 0 90 +%lum 0 10 +%repeat FLOOR_ROUGH FLOOR_ROUGH_LIGHTGREEN +%resetcol + +%variation FLOOR_ROUGH lightcyan +%hue 0 180 +%lum 0 10 +%repeat FLOOR_ROUGH FLOOR_ROUGH_LIGHTCYAN +%resetcol + +%variation FLOOR_ROUGH lightred +%lum 0 10 +%repeat FLOOR_ROUGH FLOOR_ROUGH_LIGHTRED +%resetcol + +%variation FLOOR_ROUGH lightmagenta +%hue 0 300 +%lum 0 10 +%repeat FLOOR_ROUGH FLOOR_ROUGH_LIGHTMAGENTA +%resetcol + +%variation FLOOR_ROUGH yellow +%hue 0 60 +%repeat FLOOR_ROUGH FLOOR_ROUGH_YELLOW +%resetcol + +%variation FLOOR_ROUGH white +%desat 0 +%lum 0 20 +%repeat FLOOR_ROUGH FLOOR_ROUGH_WHITE +%resetcol + floor/floor_sand_stone0 FLOOR_SAND_STONE floor/floor_sand_stone1 floor/floor_sand_stone2 @@ -320,15 +731,149 @@ floor/dirt_w floor/dirt_nw floor/dirt_full -wall/stone2_gray0 DNGN_STONE_WALL +wall/stone2_gray0 DNGN_STONE_WALL DNGN_STONE_WALL_LIGHTGRAY wall/stone2_gray1 wall/stone2_gray2 wall/stone2_gray3 -wall/dngn_metal_wall DNGN_METAL_WALL -wall/dngn_green_crystal_wall DNGN_GREEN_CRYSTAL_WALL +%variation DNGN_STONE_WALL blue +%hue 26 240 +%hue 27 240 +%hue 28 240 +%hue 29 240 +%hue 30 240 +%hue 31 240 +%hue 32 240 +%hue 33 240 +wall/stone2_brown0 DNGN_STONE_WALL_BLUE +wall/stone2_brown1 +wall/stone2_brown2 +wall/stone2_brown3 +%resetcol + +%variation DNGN_STONE_WALL green +%hue 240 120 +%repeat DNGN_STONE_WALL_BLUE DNGN_STONE_WALL_GREEN +%resetcol + +%variation DNGN_STONE_WALL cyan +%hue 240 180 +%repeat DNGN_STONE_WALL_BLUE DNGN_STONE_WALL_CYAN +%resetcol + +%variation DNGN_STONE_WALL red +%hue 240 0 +%repeat DNGN_STONE_WALL_BLUE DNGN_STONE_WALL_RED +%resetcol + +%variation DNGN_STONE_WALL magenta +%hue 240 300 +%repeat DNGN_STONE_WALL_BLUE DNGN_STONE_WALL_MAGENTA +%resetcol + +%variation DNGN_STONE_WALL brown +%hue 240 30 +%repeat DNGN_STONE_WALL_BLUE DNGN_STONE_WALL_BROWN +%resetcol + +%variation DNGN_STONE_WALL darkgray +%lum 0 -20 +%repeat DNGN_STONE_WALL DNGN_STONE_WALL_DARKGRAY +%resetcol + +%variation DNGN_STONE_WALL yellow +%hue 240 60 +%repeat DNGN_STONE_WALL_BLUE DNGN_STONE_WALL_YELLOW +%resetcol + +%variation DNGN_STONE_WALL white +%lum 0 30 +%repeat DNGN_STONE_WALL DNGN_STONE_WALL_WHITE +%resetcol + wall/dngn_wax_wall DNGN_WAX_WALL wall/dngn_transparent_wall DNGN_TRANSPARENT_WALL +wall/dngn_metal_wall DNGN_METAL_WALL + +%hue 150 120 +wall/dngn_green_crystal_wall DNGN_GREEN_CRYSTAL_WALL DNGN_CRYSTAL DNGN_CRYSTAL_GREEN +%resetcol + +%variation DNGN_CRYSTAL blue +%hue 120 240 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_BLUE +%resetcol + +%variation DNGN_CRYSTAL cyan +%hue 120 180 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_CYAN +%resetcol + +%variation DNGN_CRYSTAL red +%hue 120 0 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_RED +%resetcol + +%variation DNGN_CRYSTAL magenta +%hue 120 300 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_MAGENTA +%resetcol + +%variation DNGN_CRYSTAL brown +%hue 120 30 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_BROWN +%resetcol + +%variation DNGN_CRYSTAL lightgray +%desat 120 +%lum 120 -20 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_LIGHTGRAY +%resetcol + +%variation DNGN_CRYSTAL darkgray +%desat 120 +%lum 120 -40 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_DARKGRAY +%resetcol + +%variation DNGN_CRYSTAL lightblue +%hue 120 240 +%lum 120 30 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_LIGHTBLUE +%resetcol + +%variation DNGN_CRYSTAL lightgreen +%lum 120 30 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_LIGHTGREEN +%resetcol + +%variation DNGN_CRYSTAL lightcyan +%hue 120 180 +%lum 120 30 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_LIGHTCYAN +%resetcol + +%variation DNGN_CRYSTAL lightred +%hue 120 0 +%lum 120 30 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_LIGHTRED +%resetcol + +%variation DNGN_CRYSTAL lightmagenta +%hue 120 300 +%lum 120 30 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_LIGHTMAGENTA +%resetcol + +%variation DNGN_CRYSTAL yellow +%hue 120 60 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_YELLOW +%resetcol + +%variation DNGN_CRYSTAL white +%desat 120 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_WHITE +%resetcol ## doors dngn_detected_secret_door DNGN_DETECTED_SECRET_DOOR @@ -400,9 +945,11 @@ dngn_open_sea DNGN_OPEN_SEA dngn_open_sea dngn_open_sea dngn_open_sea2 + dngn_deep_water DNGN_DEEP_WATER dngn_deep_water dngn_deep_water2 + dngn_shallow_water DNGN_SHALLOW_WATER dngn_shallow_water dngn_shallow_water @@ -486,8 +1033,9 @@ dngn_altar_fedhas DNGN_ALTAR_FEDHAS dngn_altar_cheibriados DNGN_ALTAR_CHEIBRIADOS %sdir dc-dngn -dngn_blue_fountain DNGN_BLUE_FOUNTAIN +dngn_blue_fountain DNGN_FOUNTAIN DNGN_BLUE_FOUNTAIN dngn_blue_fountain2 + dngn_sparkling_fountain DNGN_SPARKLING_FOUNTAIN dngn_sparkling_fountain2 dngn_blood_fountain DNGN_BLOOD_FOUNTAIN diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown0.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown0.png new file mode 100644 index 0000000000..5dc062e52b Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown0.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown1.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown1.png new file mode 100644 index 0000000000..1ce8b1266c Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown1.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown2.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown2.png new file mode 100644 index 0000000000..ed419e9c05 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown2.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown3.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown3.png new file mode 100644 index 0000000000..2ce7e3b88a Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown3.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown4.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown4.png new file mode 100644 index 0000000000..68445fb04c Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown4.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown5.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown5.png new file mode 100644 index 0000000000..6fb2823fd8 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown5.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown6.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown6.png new file mode 100644 index 0000000000..4fc9439df5 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown6.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown7.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown7.png new file mode 100644 index 0000000000..c16754ea86 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown7.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown8.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown8.png new file mode 100644 index 0000000000..7309612217 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown8.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray0.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray0.png deleted file mode 100644 index 8e1001ba8a..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray0.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray1.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray1.png deleted file mode 100644 index d30a2d3032..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray1.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray2.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray2.png deleted file mode 100644 index 4be0aa155d..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray2.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray3.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray3.png deleted file mode 100644 index feb030714b..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray3.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray4.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray4.png deleted file mode 100644 index 64f2dd7878..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray4.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray5.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray5.png deleted file mode 100644 index 024c193f48..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray5.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray6.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray6.png deleted file mode 100644 index 74a9ecfc4a..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray6.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray7.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray7.png deleted file mode 100644 index ba61403cf8..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray7.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray8.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray8.png deleted file mode 100644 index 12967b7c9d..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray8.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/ice0.png b/crawl-ref/source/rltiles/dc-dngn/wall/ice0.png deleted file mode 100644 index d5b8dbc269..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/ice0.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/ice1.png b/crawl-ref/source/rltiles/dc-dngn/wall/ice1.png deleted file mode 100644 index aa17851f29..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/ice1.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/ice2.png b/crawl-ref/source/rltiles/dc-dngn/wall/ice2.png deleted file mode 100644 index 5ed0cfd9af..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/ice2.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/ice3.png b/crawl-ref/source/rltiles/dc-dngn/wall/ice3.png deleted file mode 100644 index 60b4d072f5..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/ice3.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/snake0.png b/crawl-ref/source/rltiles/dc-dngn/wall/snake0.png deleted file mode 100644 index 867db7b4c1..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/snake0.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/snake1.png b/crawl-ref/source/rltiles/dc-dngn/wall/snake1.png deleted file mode 100644 index 485609f953..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/snake1.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/snake2.png b/crawl-ref/source/rltiles/dc-dngn/wall/snake2.png deleted file mode 100644 index 673912e445..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/snake2.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/snake3.png b/crawl-ref/source/rltiles/dc-dngn/wall/snake3.png deleted file mode 100644 index 46bd9d32d4..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/snake3.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown0.png b/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown0.png new file mode 100644 index 0000000000..d4bdb5a45d Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown0.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown1.png b/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown1.png new file mode 100644 index 0000000000..53e64d6cbd Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown1.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown2.png b/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown2.png new file mode 100644 index 0000000000..67b967acdf Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown2.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown3.png b/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown3.png new file mode 100644 index 0000000000..1ff9c971b3 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown3.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan0.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan0.png deleted file mode 100644 index d5b8dbc269..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan0.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan1.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan1.png deleted file mode 100644 index aa17851f29..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan1.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan2.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan2.png deleted file mode 100644 index 5ed0cfd9af..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan2.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan3.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan3.png deleted file mode 100644 index 60b4d072f5..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan3.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray0.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray0.png deleted file mode 100644 index cc512906af..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray0.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray1.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray1.png deleted file mode 100644 index 2c1e681055..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray1.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray2.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray2.png deleted file mode 100644 index 1173861ea8..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray2.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray3.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray3.png deleted file mode 100644 index 541a48bb9b..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray3.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_green0.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_green0.png deleted file mode 100644 index 2a7cb2fbe5..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_green0.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_green1.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_green1.png deleted file mode 100644 index 9e6da5180d..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_green1.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_green2.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_green2.png deleted file mode 100644 index f3005eece8..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_green2.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_green3.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_green3.png deleted file mode 100644 index f6c8823dcd..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_green3.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta0.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta0.png deleted file mode 100644 index 081bd32cd7..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta0.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta1.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta1.png deleted file mode 100644 index 32c59f0ec8..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta1.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta2.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta2.png deleted file mode 100644 index d3ad13c8b0..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta2.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta3.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta3.png deleted file mode 100644 index 9517f113a2..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta3.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_red0.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_red0.png deleted file mode 100644 index 6f31de45e3..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_red0.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_red1.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_red1.png deleted file mode 100644 index bc20553c60..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_red1.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_red2.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_red2.png deleted file mode 100644 index b0f709c961..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_red2.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_red3.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_red3.png deleted file mode 100644 index fed8b0cd3d..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_red3.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow0.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow0.png deleted file mode 100644 index 6994559ef6..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow0.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow1.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow1.png deleted file mode 100644 index aaa15e6709..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow1.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow2.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow2.png deleted file mode 100644 index e21cd799ff..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow2.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow3.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow3.png deleted file mode 100644 index d1ab2feb2f..0000000000 Binary files a/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow3.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/tiledef_defines.h b/crawl-ref/source/rltiles/tiledef_defines.h index fb7e447988..238afd682b 100644 --- a/crawl-ref/source/rltiles/tiledef_defines.h +++ b/crawl-ref/source/rltiles/tiledef_defines.h @@ -2,6 +2,7 @@ #define TILEDEF_DEFINES_H #include +#include class tile_info { @@ -47,4 +48,50 @@ typedef unsigned int (tile_count_func)(unsigned int); typedef const char *(tile_name_func)(unsigned int); typedef tile_info &(tile_info_func)(unsigned int); +typedef struct tile_variation +{ + tile_variation(int i, int c) : idx(i), col(c) { } + int idx; + int col; + + static int cmp(tile_variation left, tile_variation right) + { + if (left.idx < right.idx) + return (-1); + if (left.idx > right.idx) + return (1); + if (left.col < right.col) + return (-1); + if (left.col > right.col) + return (1); + return (0); + } +}; + +template +bool binary_search(F find, std::pair *arr, int num_pairs, + int (*cmpfnc)(F, F), R &result) +{ + int first = 0; + int last = num_pairs - 1; + + do + { + int half = (last - first) / 2 + first; + int cmp = cmpfnc(find, arr[half].first); + if (cmp < 0) + last = half - 1; + else if (cmp > 0) + first = half + 1; + else + { + result = arr[half].second; + return true; + } + + } while (first <= last); + + return false; +} + #endif diff --git a/crawl-ref/source/rltiles/tool/tile.cc b/crawl-ref/source/rltiles/tool/tile.cc index 2febfd73b2..65d82c9b18 100644 --- a/crawl-ref/source/rltiles/tool/tile.cc +++ b/crawl-ref/source/rltiles/tool/tile.cc @@ -17,9 +17,12 @@ tile::tile(const tile &img, const char *enumnam, const char *parts) : copy(img); if (enumnam) - m_enumname = enumnam; + m_enumname.push_back(enumnam); if (parts) m_parts_ctg = parts; + + for (int i = 0; i < MAX_COLOUR; ++i) + m_variations[i] = -1; } tile::~tile() @@ -39,27 +42,37 @@ bool tile::valid() const return m_pixels && m_width && m_height; } -const std::string &tile::filename() +const std::string &tile::filename() const { return m_filename; } -const std::string &tile::enumname() +int tile::enumcount() const +{ + return m_enumname.size(); +} + +const std::string &tile::enumname(int idx) const { - return m_enumname; + return m_enumname[idx]; } -const std::string &tile::parts_ctg() +void tile::add_enumname(const std::string &name) +{ + m_enumname.push_back(name); +} + +const std::string &tile::parts_ctg() const { return m_parts_ctg; } -int tile::width() +int tile::width() const { return m_width; } -int tile::height() +int tile::height() const { return m_height; } @@ -484,3 +497,19 @@ void tile::get_bounding_box(int &x0, int &y0, int &w, int &h) w = x1 - x0 + 1; h = y1 - y0 + 1; } + +void tile::add_variation(int colour, int idx) +{ + assert(colour >= 0); + assert(colour < MAX_COLOUR); + m_variations[colour] = idx; +} + +bool tile::get_variation(int colour, int &idx) +{ + if (m_variations[colour] == -1) + return (false); + + idx = m_variations[colour]; + return (true); +} diff --git a/crawl-ref/source/rltiles/tool/tile.h b/crawl-ref/source/rltiles/tool/tile.h index b14e14d100..7381763ead 100644 --- a/crawl-ref/source/rltiles/tool/tile.h +++ b/crawl-ref/source/rltiles/tool/tile.h @@ -3,6 +3,7 @@ #include "tile_colour.h" #include +#include class tile { @@ -30,25 +31,32 @@ public: void replace_colour(tile_colour &find, tile_colour &replace); void fill(const tile_colour &col); - const std::string &filename(); - const std::string &enumname(); - const std::string &parts_ctg(); - int width(); - int height(); + const std::string &filename() const; + int enumcount() const; + const std::string &enumname(int idx) const; + void add_enumname(const std::string &name); + const std::string &parts_ctg() const; + int width() const; + int height() const; bool shrink(); void set_shrink(bool new_shrink); void get_bounding_box(int &x0, int &y0, int &w, int &h); tile_colour &get_pixel(unsigned int x, unsigned int y); + + void add_variation(int colour, int idx); + bool get_variation(int colour, int &idx); protected: int m_width; int m_height; std::string m_filename; - std::string m_enumname; + std::vector m_enumname; std::string m_parts_ctg; tile_colour *m_pixels; bool m_shrink; + + int m_variations[MAX_COLOUR]; }; #endif diff --git a/crawl-ref/source/rltiles/tool/tile_colour.cc b/crawl-ref/source/rltiles/tool/tile_colour.cc index f1969f37be..2f098b387b 100644 --- a/crawl-ref/source/rltiles/tool/tile_colour.cc +++ b/crawl-ref/source/rltiles/tool/tile_colour.cc @@ -28,6 +28,226 @@ const tile_colour &tile_colour::operator=(const tile_colour &rhs) return (*this); } +unsigned char &tile_colour::operator[](int idx) +{ + assert(idx >= 0 && idx <= 4); + switch (idx) + { + default: + case 0: return r; + case 1: return g; + case 2: return b; + case 3: return a; + } +} + +unsigned char tile_colour::operator[](int idx) const +{ + assert(idx >= 0 && idx <= 4); + switch (idx) + { + default: + case 0: return r; + case 1: return g; + case 2: return b; + case 3: return a; + } +} + +int tile_colour::get_hue() const +{ + int max_rgb = get_max_rgb(); + int min_rgb = get_min_rgb(); + + if (max_rgb == min_rgb) + return (0); + + int diff = max_rgb - min_rgb; + + if (max_rgb == r) + { + return ((60 * (g - b)) / diff + 360) % 360; + } + else if (max_rgb == g) + { + return (60 * (b - r)) / diff + 120; + } + else // if (max_rgb == b) + { + return (60 * (r - g)) / diff + 240; + } +} + +int tile_colour::get_max_rgb() const +{ + int max_rgb = std::max(std::max(r, g), b); + return (max_rgb); +} + +int tile_colour::get_min_rgb() const +{ + int min_rgb = std::min(std::min(r, g), b); + return (min_rgb); +} + +void tile_colour::set_hue(int h) +{ + set_from_hue(h, get_min_rgb(), get_max_rgb()); +} + +void tile_colour::set_from_hue(int h, int min_rgb, int max_rgb) +{ + // http://en.wikipedia.org/wiki/HSL_and_HSV + // H is passed in + // S = diff / max or 0 if max == 0 + // V = max / 255 + + int v = max_rgb; + int s = max_rgb - min_rgb; + + float f = ((float)h / 60.0f) - (int)(h / 60); + + // When calculating P, Q, T, also convert to 0..255 range. + int p = v - s; + int q = v - f * s; + int t = v - (1.0f - f) * s; + + // Sanity bounds. + q = std::max(std::min(q, 255), 0); + t = std::max(std::min(t, 255), 0); + + int h_idx = (h / 60) % 6; + + switch (h_idx) + { + default: + case 0: + r = static_cast(v); + g = static_cast(t); + b = static_cast(p); + break; + case 1: + r = static_cast(q); + g = static_cast(v); + b = static_cast(p); + break; + case 2: + r = static_cast(p); + g = static_cast(v); + b = static_cast(t); + break; + case 3: + r = static_cast(p); + g = static_cast(q); + b = static_cast(v); + break; + case 4: + r = static_cast(t); + g = static_cast(p); + b = static_cast(v); + break; + case 5: + r = static_cast(v); + g = static_cast(p); + b = static_cast(q); + break; + } +} + +void tile_colour::desaturate() +{ + set_from_hue(get_hue(), get_max_rgb(), get_max_rgb()); +} + +float tile_colour::get_lum() const +{ + return ((get_min_rgb() + get_max_rgb()) / (255 * 2.0f)); +} + +float tile_colour::get_sat() const +{ + int min_rgb = get_min_rgb(); + int max_rgb = get_max_rgb(); + int sum = min_rgb + max_rgb; + + float sat; + if (sum == 0) + sat = 0; + else if (sum > 255) + sat = (max_rgb - min_rgb) / (float)(255*2 - min_rgb - max_rgb); + else + sat = (max_rgb - min_rgb) / (float)(min_rgb + max_rgb); + + return (sat); +} + +void tile_colour::set_from_hsl(int hue, float sat, float lum) +{ + float q; + if (lum < 0.5f) + q = lum * (1 + sat); + else + q = lum + sat - (lum * sat); + + float p = 2 * lum - q; + + for (int i = 0; i < 3; ++i) + { + int h = hue + (1 - i) * 120; + if (h < 0) + h += 360; + if (h >= 360) + h -= 360; + + float val; + + if (h < 60) + val = p + (q - p) * h / 60.0f; + else if (h < 180) + val = q; + else if (h < 240) + val = p + (q - p) * (4 - h / 60.0f); + else + val = p; + + int final = val * 255; + final = std::max(0, std::min(255, final)); + (*this)[i] = static_cast(final); + } +} + +void tile_colour::change_lum(int lum_percent) +{ + int min_rgb = get_min_rgb(); + int max_rgb = get_max_rgb(); + int hue = get_hue(); + + if (min_rgb == max_rgb) + { + int rgb_change = (lum_percent * 255) / 100; + + min_rgb += rgb_change; + max_rgb += rgb_change; + + min_rgb = std::max(0, std::min(255, min_rgb)); + max_rgb = std::max(0, std::min(255, max_rgb)); + + set_from_hue(get_hue(), min_rgb, max_rgb); + return; + } + + float lum_change = lum_percent / 100.0f; + float lum = get_lum() + lum_change; + + if (lum > 1.0f) + lum = 1.0f; + if (lum < 0.0f) + lum = 0.0f; + + float sat = get_sat(); + set_from_hsl(hue, sat, lum); +} + bool write_png(const char *filename, tile_colour *pixels, unsigned int width, unsigned int height) { diff --git a/crawl-ref/source/rltiles/tool/tile_colour.h b/crawl-ref/source/rltiles/tool/tile_colour.h index 4c77162b9f..f660c84829 100644 --- a/crawl-ref/source/rltiles/tool/tile_colour.h +++ b/crawl-ref/source/rltiles/tool/tile_colour.h @@ -1,6 +1,30 @@ #ifndef TILE_COLOUR_H #define TILE_COLOUR_H +enum COLORS +{ + BLACK, + BLUE, + GREEN, + CYAN, + RED, + MAGENTA, + BROWN, + LIGHTGRAY, + LIGHTGREY = LIGHTGRAY, + DARKGRAY, + DARKGREY = DARKGRAY, + LIGHTBLUE, + LIGHTGREEN, + LIGHTCYAN, + LIGHTRED, + LIGHTMAGENTA, + YELLOW, + WHITE, + MAX_TERM_COLOUR, + MAX_COLOUR = MAX_TERM_COLOUR +}; + class tile_colour { public: @@ -12,6 +36,31 @@ public: bool operator!=(const tile_colour &rhs) const; const tile_colour &operator=(const tile_colour &rhs); + unsigned char &operator[](int idx); + unsigned char operator[](int idx) const; + + // Get the HSV/HSL hue, from 0..360. + int get_hue() const; + // Set the hue, from 0..360. + void set_hue(int h); + // Change the saturation to 0. + void desaturate(); + // Change the luminance by lum_percent %. + void change_lum(int lum_percent); + + int get_max_rgb() const; + int get_min_rgb() const; + + // Set the color from HSV. hue is 0..360. min_rgb and max_rgb are 0..255. + void set_from_hue(int hue, int min_rgb, int max_rgb); + + // Set the color from HSL. hue is 0..360. sat and lum are 0..1. + void set_from_hsl(int hue, float sat, float lum); + // Get the HSL saturation, from 0..1. + float get_sat() const; + // Get the HSL luminance, from 0..1. + float get_lum() const; + unsigned char r; unsigned char g; unsigned char b; diff --git a/crawl-ref/source/rltiles/tool/tile_list_processor.cc b/crawl-ref/source/rltiles/tool/tile_list_processor.cc index 091d195fca..dfd8385296 100644 --- a/crawl-ref/source/rltiles/tool/tile_list_processor.cc +++ b/crawl-ref/source/rltiles/tool/tile_list_processor.cc @@ -17,7 +17,9 @@ tile_list_processor::tile_list_processor() : m_composing(false), m_shrink(true), m_prefix("TILE"), - m_start_value("0") + m_start_value("0"), + m_variation_idx(-1), + m_variation_col(-1) { } @@ -150,6 +152,73 @@ static void eat_comments(char *&text) } } +static const std::string colour_list[16] = +{ + "black", "blue", "green", "cyan", "red", "magenta", "brown", + "lightgrey", "darkgrey", "lightblue", "lightgreen", "lightcyan", + "lightred", "lightmagenta", "yellow", "white" +}; + +static int str_to_colour(std::string colour) +{ + if (colour.empty()) + return (0); + + for (unsigned int c = 0; c < colour.size(); c++) + colour[c] = std::tolower(colour[c]); + + for (int i = 0; i < 16; ++i) + { + if (colour == colour_list[i]) + return (i); + } + + // Check for alternate spellings. + if (colour == "lightgray") + return (7); + else if (colour == "darkgray") + return (8); + + return (0); +} + +void tile_list_processor::recolour(tile &img) +{ + for (int y = 0; y < img.height(); ++y) + for (int x = 0; x < img.width(); ++x) + { + tile_colour &col = img.get_pixel(x, y); + tile_colour orig = col; + for (palette_list::iterator iter = m_palette.begin(); + iter != m_palette.end(); ++iter) + { + if (orig == iter->first) + col = iter->second; + } + + for (hue_list::iterator iter = m_hues.begin(); + iter != m_hues.end(); ++iter) + { + if (orig.get_hue() == iter->first) + col.set_hue(iter->second); + } + + for (desat_list::iterator iter = m_desat.begin(); + iter != m_desat.end(); ++iter) + { + if (orig.get_hue() == *iter) + col.desaturate(); + } + + for (lum_list::iterator iter = m_lum.begin(); + iter != m_lum.end(); ++iter) + { + if (orig.get_hue() == iter->first) + col.change_lum(iter->second); + } + } +} + bool tile_list_processor::process_line(char *read_line, const char *list_file, int line) { @@ -254,6 +323,8 @@ bool tile_list_processor::process_line(char *read_line, const char *list_file, if (m_rim) img.add_rim(tile_colour::black); + recolour(img); + if (!m_compose.compose(img)) { fprintf(stderr, "Error (%s:%d): failed composing '%s'" @@ -270,6 +341,8 @@ bool tile_list_processor::process_line(char *read_line, const char *list_file, "'%s'.\n", list_file, line, m_args[1]); return (false); } + + recolour(m_compose); } } else if (strcmp(arg, "corpse") == 0) @@ -409,6 +482,133 @@ bool tile_list_processor::process_line(char *read_line, const char *list_file, if (m_args.size() > 2) m_include = m_args[2]; } + else if (strcmp(arg, "pal") == 0) + { + // rgb (optional a) = rgb (optional a) + tile_colour cols[2] = { tile_colour::black, tile_colour::black }; + int col_idx = 0; + int comp_idx = 0; + + for (size_t i = 1; i < m_args.size(); ++i) + { + if (strcmp(m_args[i], "=")) + { + if (comp_idx > 3) + { + fprintf(stderr, "Error (%s:%d): " + "Must be R G B (A) = R G B (A).\n", + list_file, line); + return (false); + } + + int val = atoi(m_args[i]); + if (val < 0 || val > 255) + { + fprintf(stderr, + "Error (%s:%d): Arg %d must be 0-255.\n", + list_file, line, i); + } + + cols[col_idx][comp_idx++] = static_cast(val); + } + else if (col_idx > 0) + { + fprintf(stderr, + "Error (%s:%d): Too many '=' characters.\n", + list_file, line); + return (false); + } + else + { + col_idx++; + comp_idx = 0; + } + } + + m_palette.push_back(palette_entry(cols[0], cols[1])); + } + else if (strcmp(arg, "hue") == 0) + { + CHECK_ARG(2); + m_hues.push_back(int_pair(atoi(m_args[1]), atoi(m_args[2]))); + } + else if (strcmp(arg, "resetcol") == 0) + { + CHECK_NO_ARG(1); + m_palette.clear(); + m_hues.clear(); + m_desat.clear(); + m_lum.clear(); + } + else if (strcmp(arg, "desat") == 0) + { + CHECK_ARG(1); + CHECK_NO_ARG(2); + + m_desat.push_back(atoi(m_args[1])); + } + else if (strcmp(arg, "lum") == 0) + { + CHECK_ARG(2); + CHECK_NO_ARG(3); + + m_lum.push_back(int_pair(atoi(m_args[1]), atoi(m_args[2]))); + } + else if (strcmp(arg, "variation") == 0) + { + CHECK_ARG(2); + CHECK_NO_ARG(3); + + int idx = m_page.find(m_args[1]); + if (idx == -1) + { + fprintf(stderr, "Error (%s:%d): invalid tile name '%s'\n", + list_file, line, m_args[1]); + return (false); + } + + int colour = str_to_colour(m_args[2]); + if (colour == 0) + { + fprintf(stderr, "Error (%s:%d): invalid colour '%s'\n", + list_file, line, m_args[2]); + return (false); + } + + m_variation_idx = idx; + m_variation_col = colour; + } + else if (strcmp(arg, "repeat") == 0) + { + CHECK_ARG(1); + + int idx = m_page.find(m_args[1]); + if (idx == -1) + { + fprintf(stderr, "Error (%s:%d): invalid tile name '%s'\n", + list_file, line, m_args[1]); + return (false); + } + + int cnt = m_page.m_counts[idx]; + + for (int i = 0; i < cnt; ++i) + { + tile img; + img.copy(*m_page.m_tiles[idx + i]); + recolour(img); + add_image(img, (i == 0 && m_args[2]) ? m_args[2] : NULL); + } + + if (m_args.size() > 2) + { + for (int i = 3; i < m_args.size(); ++i) + { + // Add enums for additional values. + m_page.add_synonym(m_args[2], m_args[i]); + } + } + } else { fprintf(stderr, "Error (%s:%d): unknown command '%%%s'\n", @@ -464,11 +664,19 @@ bool tile_list_processor::process_line(char *read_line, const char *list_file, img.corpsify(); } + recolour(img); + if (m_rim && !m_corpsify) img.add_rim(tile_colour::black); // Push tile onto tile page. add_image(img, m_args.size() > 1 ? m_args[1] : NULL); + + for (int i = 2; i < m_args.size(); ++i) + { + // Add enums for additional values. + m_page.add_synonym(m_args[1], m_args[i]); + } } return (true); @@ -489,6 +697,12 @@ void tile_list_processor::add_image(tile &img, const char *enumname) if (m_categories.size() > 0) m_ctg_counts[m_categories.size()-1]++; + + if (m_variation_idx != -1) + { + m_page.add_variation(m_last_enum, m_variation_idx, m_variation_col); + m_variation_idx = -1; + } } bool tile_list_processor::write_data() @@ -560,24 +774,47 @@ bool tile_list_processor::write_data() for (unsigned int i = 0; i < m_page.m_tiles.size(); i++) { - const std::string &enumname = m_page.m_tiles[i]->enumname(); const std::string &parts_ctg = m_page.m_tiles[i]->parts_ctg(); - if (enumname.empty()) + int enumcount = m_page.m_tiles[i]->enumcount(); + + std::string full_enum; + if (enumcount == 0) { fprintf(fp, " %s_%s_FILLER_%d%s,\n", m_prefix.c_str(), ucname.c_str(), i, start_val.c_str()); } else if (parts_ctg.empty()) { + const std::string &enumname = m_page.m_tiles[i]->enumname(0); fprintf(fp, " %s_%s%s,\n", m_prefix.c_str(), enumname.c_str(), start_val.c_str()); } else { + const std::string &enumname = m_page.m_tiles[i]->enumname(0); fprintf(fp, " %s_%s_%s%s,\n", m_prefix.c_str(), parts_ctg.c_str(), enumname.c_str(), start_val.c_str()); } + for (int c = 1; c < enumcount; ++c) + { + const std::string &basename = m_page.m_tiles[i]->enumname(0); + const std::string &enumname = m_page.m_tiles[i]->enumname(c); + + if (parts_ctg.empty()) + { + fprintf(fp, " %s_%s = %s_%s,\n", + m_prefix.c_str(), enumname.c_str(), + m_prefix.c_str(), basename.c_str()); + } + else + { + fprintf(fp, " %s_%s_%s = %s_%s_%s,\n", + m_prefix.c_str(), parts_ctg.c_str(), enumname.c_str(), + m_prefix.c_str(), parts_ctg.c_str(), basename.c_str()); + } + } + start_val = ""; if (!parts_ctg.empty()) @@ -597,13 +834,15 @@ bool tile_list_processor::write_data() fprintf(fp, "int tile_%s_count(unsigned int idx);\n", lcname.c_str()); fprintf(fp, "const char *tile_%s_name(unsigned int idx);\n", - lcname.c_str()); + lcname.c_str()); fprintf(fp, "tile_info &tile_%s_info(unsigned int idx);\n", - lcname.c_str()); + lcname.c_str()); fprintf(fp, "bool tile_%s_index(const char *str, unsigned int &idx);\n", - lcname.c_str()); + lcname.c_str()); fprintf(fp, "bool tile_%s_equal(unsigned int tile, unsigned int idx);\n", - lcname.c_str()); + lcname.c_str()); + fprintf(fp, "unsigned int tile_%s_coloured(unsigned int idx, int col);\n", + lcname.c_str()); if (m_categories.size() > 0) { @@ -663,11 +902,15 @@ bool tile_list_processor::write_data() lcname.c_str(), max.c_str(), m_start_value.c_str()); for (unsigned int i = 0; i < m_page.m_tiles.size(); i++) { - const std::string &enumname = m_page.m_tiles[i]->enumname(); - if (enumname.empty()) + if (m_page.m_tiles[i]->enumcount() == 0) + { fprintf(fp, " \"%s_FILLER_%d\",\n", ucname.c_str(), i); + } else + { + const std::string &enumname = m_page.m_tiles[i]->enumname(0); fprintf(fp, " \"%s\",\n", enumname.c_str()); + } } fprintf(fp, "};\n\n"); @@ -718,9 +961,9 @@ bool tile_list_processor::write_data() fprintf(fp, "};\n\n"); } - fprintf(fp, "\ntypedef std::pair _tile_pair;\n\n"); + fprintf(fp, "\ntypedef std::pair _name_pair;\n\n"); - fprintf(fp, "_tile_pair %s_map_pairs[] =\n" + fprintf(fp, "_name_pair %s_name_pairs[] =\n" "{\n", lcname.c_str()); typedef std::map sort_map; @@ -728,22 +971,22 @@ bool tile_list_processor::write_data() for (unsigned int i = 0; i < m_page.m_tiles.size(); i++) { - const std::string &enumname = m_page.m_tiles[i]->enumname(); - // Filler can't be looked up. - if (enumname.empty()) - continue; + for (int c = 0; c < m_page.m_tiles[i]->enumcount(); ++c) + { + const std::string &enumname = m_page.m_tiles[i]->enumname(c); - std::string lcenum = enumname; - for (unsigned int c = 0; c < enumname.size(); c++) - lcenum[c] = std::tolower(enumname[c]); + std::string lcenum = enumname; + for (unsigned int c = 0; c < enumname.size(); c++) + lcenum[c] = std::tolower(enumname[c]); - table.insert(sort_map::value_type(lcenum, i)); + table.insert(sort_map::value_type(lcenum, i)); + } } sort_map::iterator itor; for (itor = table.begin(); itor != table.end(); itor++) { - fprintf(fp, " _tile_pair(\"%s\", %d + %s),\n", + fprintf(fp, " _name_pair(\"%s\", %d + %s),\n", itor->first.c_str(), itor->second, m_start_value.c_str()); } @@ -760,29 +1003,12 @@ bool tile_list_processor::write_data() " for (unsigned int i = 0; i < lc.size(); i++)\n" " lc[i] = tolower(lc[i]);\n" "\n" - " int num_pairs = sizeof(%s_map_pairs) / sizeof(%s_map_pairs[0]);\n" - "\n" - " int first = 0;\n" - " int last = num_pairs - 1;\n" - "\n" - " do\n" - " {\n" - " int half = (last - first) / 2 + first;\n" - " int cmp = strcmp(str, %s_map_pairs[half].first);\n" - " if (cmp < 0)\n" - " last = half - 1;\n" - " else if (cmp > 0)\n" - " first = half + 1;\n" - " else\n" - " {\n" - " idx = %s_map_pairs[half].second;\n" - " return true;\n" - " }\n" "\n" - " } while (first <= last);\n" - "\n" - " return false;\n" - "}\n", - lcname.c_str(), lcname.c_str(), lcname.c_str(), lcname.c_str(), lcname.c_str()); + " int num_pairs = sizeof(%s_name_pairs) / sizeof(%s_name_pairs[0]);\n" + " bool result = binary_search(\n" + " lc.c_str(), &%s_name_pairs[0], num_pairs, &strcmp, idx);\n" + " return (result);\n" + "}\n\n", + lcname.c_str(), lcname.c_str(), lcname.c_str(), lcname.c_str()); fprintf(fp, "bool tile_%s_equal(unsigned int tile, unsigned int idx)\n" @@ -792,6 +1018,43 @@ bool tile_list_processor::write_data() "}\n\n", lcname.c_str(), m_start_value.c_str(), max.c_str(), lcname.c_str()); + fprintf(fp, "\ntypedef std::pair _colour_pair;\n\n"); + + fprintf(fp, + "_colour_pair %s_colour_pairs[] =\n" + "{\n" + " _colour_pair(tile_variation(0, 0), 0),\n", + lcname.c_str()); + + for (unsigned int i = 0; i < m_page.m_tiles.size(); i++) + { + for (int c = 0; c < MAX_COLOUR; ++c) + { + int var; + if (!m_page.m_tiles[i]->get_variation(c, var)) + continue; + + fprintf(fp, + " _colour_pair(tile_variation(%d + %s, %d), %d + %s),\n", + i, m_start_value.c_str(), c, var, m_start_value.c_str()); + } + } + + fprintf(fp, "%s", "};\n\n"); + + fprintf(fp, + "unsigned int tile_%s_coloured(unsigned int idx, int col)\n" + "{\n" + " int num_pairs = sizeof(%s_colour_pairs) / sizeof(%s_colour_pairs[0]);\n" + " tile_variation key(idx, col);\n" + " unsigned int found;\n" + " bool result = binary_search(\n" + " key, &%s_colour_pairs[0], num_pairs,\n" + " &tile_variation::cmp, found);\n" + " return (result ? found : idx);\n" + "}\n\n", + lcname.c_str(), lcname.c_str(), lcname.c_str(), lcname.c_str()); + fclose(fp); } @@ -818,29 +1081,32 @@ bool tile_list_processor::write_data() fprintf(fp, "", m_page.m_tiles[i]->filename().c_str()); - std::string lcenum = m_page.m_tiles[i]->enumname(); - for (unsigned int c = 0; c < lcenum.size(); c++) - lcenum[c] = std::tolower(lcenum[c]); - - fprintf(fp, "%s", lcenum.c_str()); - - const std::string &parts_ctg = m_page.m_tiles[i]->parts_ctg(); - if (m_page.m_tiles[i]->enumname().empty()) + if (m_page.m_tiles[i]->enumcount() == 0) { - fprintf(fp, ""); - } - else if (parts_ctg.empty()) - { - fprintf(fp, "%s_%s", - m_prefix.c_str(), - m_page.m_tiles[i]->enumname().c_str()); + fprintf(fp, ""); } else { - fprintf(fp, "%s_%s_%s", - m_prefix.c_str(), - parts_ctg.c_str(), - m_page.m_tiles[i]->enumname().c_str()); + std::string lcenum = m_page.m_tiles[i]->enumname(0); + for (unsigned int c = 0; c < lcenum.size(); c++) + lcenum[c] = std::tolower(lcenum[c]); + + fprintf(fp, "%s", lcenum.c_str()); + + const std::string &parts_ctg = m_page.m_tiles[i]->parts_ctg(); + if (parts_ctg.empty()) + { + fprintf(fp, "%s_%s", + m_prefix.c_str(), + m_page.m_tiles[i]->enumname(0).c_str()); + } + else + { + fprintf(fp, "%s_%s_%s", + m_prefix.c_str(), + parts_ctg.c_str(), + m_page.m_tiles[i]->enumname(0).c_str()); + } } fprintf(fp, "%s", m_page.m_tiles[i]->filename().c_str()); diff --git a/crawl-ref/source/rltiles/tool/tile_list_processor.h b/crawl-ref/source/rltiles/tool/tile_list_processor.h index 74b199b5ef..5e95d1815b 100644 --- a/crawl-ref/source/rltiles/tool/tile_list_processor.h +++ b/crawl-ref/source/rltiles/tool/tile_list_processor.h @@ -18,6 +18,7 @@ protected: bool load_image(tile &img, const char *filename); bool process_line(char *read_line, const char *list_file, int line); void add_image(tile &img, const char *enumname); + void recolour(tile &img); std::string m_name; @@ -38,6 +39,22 @@ protected: std::vector m_categories; std::vector m_ctg_counts; tile m_compose; + int m_variation_idx; + int m_variation_col; + + typedef std::pair palette_entry; + typedef std::vector palette_list; + palette_list m_palette; + + typedef std::pair int_pair; + typedef std::vector hue_list; + hue_list m_hues; + + typedef std::vector desat_list; + desat_list m_desat; + + typedef std::vector lum_list; + lum_list m_lum; }; #endif diff --git a/crawl-ref/source/rltiles/tool/tile_page.cc b/crawl-ref/source/rltiles/tool/tile_page.cc index 67c77db3ea..4bd6c8a10f 100644 --- a/crawl-ref/source/rltiles/tool/tile_page.cc +++ b/crawl-ref/source/rltiles/tool/tile_page.cc @@ -88,6 +88,31 @@ bool tile_page::place_images() return (true); } +int tile_page::find(const std::string &enumname) const +{ + for (size_t i = 0; i < m_tiles.size(); ++i) + { + for (int c = 0; c < m_tiles[i]->enumcount(); ++c) + { + if (m_tiles[i]->enumname(c) == enumname) + return (i); + } + } + + return (-1); +} + +bool tile_page::add_synonym(const std::string &enumname, const std::string &syn) +{ + int idx = find(enumname); + if (idx == -1) + return (false); + + m_tiles[idx]->add_enumname(syn); + + return (true); +} + bool tile_page::write_image(const char *filename) { if (m_width * m_height <= 0) @@ -123,3 +148,12 @@ bool tile_page::write_image(const char *filename) delete[] pixels; return success; } + +void tile_page::add_variation(int var_idx, int base_idx, int colour) +{ + assert(var_idx < (2 << 15)); + assert(base_idx < (2 << 15)); + + m_tiles[base_idx]->add_variation(colour, var_idx); +} + diff --git a/crawl-ref/source/rltiles/tool/tile_page.h b/crawl-ref/source/rltiles/tool/tile_page.h index 9f13651a1d..d9f6a47861 100644 --- a/crawl-ref/source/rltiles/tool/tile_page.h +++ b/crawl-ref/source/rltiles/tool/tile_page.h @@ -13,10 +13,15 @@ public: bool place_images(); bool write_image(const char *filename); + int find(const std::string &enumname) const; + bool add_synonym(const std::string &enumname, const std::string &syn); + void add_variation(int var_idx, int base_idx, int colour); + std::vector m_tiles; std::vector m_counts; std::vector m_texcoords; std::vector m_offsets; + protected: int m_width; int m_height; diff --git a/crawl-ref/source/tile2.cc b/crawl-ref/source/tile2.cc index 62f6955812..c4350791fa 100644 --- a/crawl-ref/source/tile2.cc +++ b/crawl-ref/source/tile2.cc @@ -37,7 +37,7 @@ void tile_default_flv(level_area_type lev, branch_type br, tile_flavour &flv) case 3: flv.wall = TILE_WALL_ZOT_GREEN; break; case 4: flv.wall = TILE_WALL_ZOT_CYAN; break; case 5: flv.wall = TILE_WALL_ZOT_YELLOW; break; - case 6: flv.wall = TILE_WALL_ZOT_GRAY; break; + case 6: flv.wall = TILE_WALL_ZOT_WHITE; break; } if (one_chance_in(3)) diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc index ddc0a9013f..0fe8bbbb32 100644 --- a/crawl-ref/source/tilepick.cc +++ b/crawl-ref/source/tilepick.cc @@ -3123,9 +3123,9 @@ int _get_door_offset (int base_tile, bool opened = false, // Modify wall tile index depending on floor/wall flavour. static inline void _finalise_tile(unsigned int *tile, - unsigned char wall_flv, - unsigned char floor_flv, - unsigned char special_flv, + unsigned int wall_flv, + unsigned int floor_flv, + unsigned int special_flv, coord_def gc) { int orig = (*tile) & TILE_FLAG_MASK; @@ -4411,14 +4411,22 @@ void tile_init_flavour(const coord_def &gc) if (!env.tile_flv(gc).floor) { - int floor_rnd = random2(tile_dngn_count(env.tile_default.floor)); - env.tile_flv(gc).floor = env.tile_default.floor + floor_rnd; + int floor_base = env.tile_default.floor; + int colour = env.grid_colours(gc); + if (colour) + floor_base = tile_dngn_coloured(floor_base, colour); + int floor_rnd = random2(tile_dngn_count(floor_base)); + env.tile_flv(gc).floor = floor_base + floor_rnd; } if (!env.tile_flv(gc).wall) { - int wall_rnd = random2(tile_dngn_count(env.tile_default.wall)); - env.tile_flv(gc).wall = env.tile_default.wall + wall_rnd; + int wall_base = env.tile_default.wall; + int colour = env.grid_colours(gc); + if (colour) + wall_base = tile_dngn_coloured(wall_base, colour); + int wall_rnd = random2(tile_dngn_count(wall_base)); + env.tile_flv(gc).wall = wall_base + wall_rnd; } if (feat_is_door(grd(gc))) @@ -4884,9 +4892,9 @@ void tile_finish_dngn(unsigned int *tileb, int cx, int cy) + coord_def(cx, cy) - crawl_view.vgrdc; const coord_def gc = view2grid(ep); - unsigned char wall_flv = 0; - unsigned char floor_flv = 0; - unsigned char special_flv = 0; + unsigned int wall_flv = 0; + unsigned int floor_flv = 0; + unsigned int special_flv = 0; const bool in_bounds = (map_bounds(gc)); if (in_bounds) -- cgit v1.2.3-54-g00ecf From 9fcc7c41761ea968d0da075f2974a8908a2ef19b Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Thu, 24 Dec 2009 20:34:29 +1000 Subject: New (rakshasa) unique: Mara, Lord of Ilusions. This re-uses several ideas from the Emerald Eye FR, and implements the spell "Mislead": this grants the "Misled" status effect to the player, and causes on-level monsters to appear (glyph, name and tile) to be other monsters. Only their appearance is changed. Healing potions and rain remove this status effect. Mara also has a beefed-up version of the Rakshasa clone spell: it instead creates an "exact" clone (slightly altered spells list, and non-unique status for his clones). Only two will ever be created at once. Finally, he has the spell "Summon Player Ghost". This spell creates a ghost of the player (though marked as a summon, meaning that it (shouldn't) register a milestone, though it will be treated as a self-ghost kill) that is hostile. Only one of these should be existant at any one point in time. I'm pretty sure that I haven't broken anything, but would definitely appreciate someone sanity-checking this commit. Known minor issue: Kirke's summon ugly things being cast while having the Misled status causes them to show up with no glyph. --- crawl-ref/source/cloud.cc | 6 + crawl-ref/source/dat/database/monspeak.txt | 50 +++++ crawl-ref/source/dat/database/monspell.txt | 24 +++ crawl-ref/source/dat/database/quotes.txt | 10 + crawl-ref/source/dat/descript/monsters.txt | 4 + crawl-ref/source/describe.cc | 24 ++- crawl-ref/source/directn.cc | 11 +- crawl-ref/source/effects.cc | 7 + crawl-ref/source/enum.h | 9 + crawl-ref/source/hiscores.cc | 4 + crawl-ref/source/it_use2.cc | 1 + crawl-ref/source/kills.cc | 7 +- crawl-ref/source/main.cc | 15 +- crawl-ref/source/mon-abil.cc | 2 + crawl-ref/source/mon-cast.cc | 249 ++++++++++++++++++++++-- crawl-ref/source/mon-cast.h | 1 + crawl-ref/source/mon-data.h | 26 +++ crawl-ref/source/mon-gear.cc | 8 + crawl-ref/source/mon-info.cc | 39 ++-- crawl-ref/source/mon-spll.h | 22 +++ crawl-ref/source/mon-util.cc | 14 +- crawl-ref/source/monster.cc | 54 +++-- crawl-ref/source/monster.h | 1 + crawl-ref/source/output.cc | 3 + crawl-ref/source/player.cc | 5 + crawl-ref/source/player.h | 1 + crawl-ref/source/rltiles/dc-mon.txt | 5 + crawl-ref/source/rltiles/dc-mon/unique/mara.png | Bin 0 -> 1430 bytes crawl-ref/source/show.cc | 3 +- crawl-ref/source/showsymb.cc | 11 +- crawl-ref/source/spl-data.h | 178 +++++++++++------ crawl-ref/source/tags.h | 2 +- crawl-ref/source/tilepick.cc | 8 + 33 files changed, 680 insertions(+), 124 deletions(-) create mode 100644 crawl-ref/source/rltiles/dc-mon/unique/mara.png diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc index 9678edc16c..638432f504 100644 --- a/crawl-ref/source/cloud.cc +++ b/crawl-ref/source/cloud.cc @@ -765,6 +765,12 @@ void in_a_cloud() if (you.duration[DUR_FIRE_SHIELD]) you.duration[DUR_FIRE_SHIELD] = 1; + if (you.misled()) + { + mpr("The rain washes away illusions!", MSGCH_DURATION); + you.duration[DUR_MISLED] = 0; + } + mpr("You are standing in the rain."); break; diff --git a/crawl-ref/source/dat/database/monspeak.txt b/crawl-ref/source/dat/database/monspeak.txt index 1b63fbcbcd..a9380051ec 100644 --- a/crawl-ref/source/dat/database/monspeak.txt +++ b/crawl-ref/source/dat/database/monspeak.txt @@ -2552,6 +2552,56 @@ Louise @_mercenary_guard_@ ### END Louise %%%% +############ MARA ### A powerful demon lord, Lord of Illusions +Mara + +@_Mara_common_@ + +w:5 + +@_Mara_rare_@ +%%%% +_Mara_common_ + +VISUAL:@The_monster@'s face changes twice. + +@The_monster@ says, "I mislead the hearts of men!" + +@The_monster@ says, "What good are steel and magic against my illusions?" + +# Buddhism +@The_monster@ says, "Entranced by some poetic flight, are you?" + +@The_monster@ says, "Bound art thou by all the snares!" + +# And original +@The_monster@ growls. + +VISUAL SPELL:@The_monster@ gestures. + +VISUAL SPELL:@The_monster@ points ostentatiously. + +SPELL:@The_monster@ weaves an illusion. +%%%% +_Mara_rare_ + +# Lord of Light +@The_monster@ screams, "Tenfold be your damnation!" + +@The_monster@'s features momentarily become yours. "Wouldst slay thyself?" + +@The_monster@ says, "I stand as high above you as a star above the ocean's bottom." + +@The_monster@ smirks. "I am one who seeks the Path and the Right." + +@The_monster@ says, "Thou art lean, ill-favoured, death is in thy neighbourhood!" + +@The_monster@ says, "Difficult is the way of exertion, difficult to pass, difficult to enter upon." + +@The_monster@ calls, "Stop! In seven days from now the wheel of empire will appear!" + +@The_monster@ boasts, "I am lord over the four continents and the two thousand adjacent isles." +%%%% ############ MARGERY ### A powerful sorceress, guarding the ORB Margery diff --git a/crawl-ref/source/dat/database/monspell.txt b/crawl-ref/source/dat/database/monspell.txt index 0ce22a12e5..c1556fcc50 100644 --- a/crawl-ref/source/dat/database/monspell.txt +++ b/crawl-ref/source/dat/database/monspell.txt @@ -85,6 +85,30 @@ Greater Healing cast @The_monster@ briefly glows brightly. %%%% +Mislead cast + +@The_monster@ weaves an illusion. + +@The_monster@ misleads you. + +@The_monster@ clouds your mind. +%%%% +unseen Mislead cast + +Something tries to mislead you! + +Something weaves an illusion around you! +%%%% +Mara Summon cast + +@The_monster@ weaves an illusion. + +@The_monster@ shimmers. +%%%% +unseen Mara summon cast + +Something weaves an illusion! +%%%% Symbol of Torment cast @The_monster@ calls on the powers of Hell! diff --git a/crawl-ref/source/dat/database/quotes.txt b/crawl-ref/source/dat/database/quotes.txt index 436eb7ab71..0f0e8d5920 100644 --- a/crawl-ref/source/dat/database/quotes.txt +++ b/crawl-ref/source/dat/database/quotes.txt @@ -756,6 +756,16 @@ dreadful nostrils and making ring waves around him, which can reach many miles. Could one doubt that this is the Leviathan of Job?" -Jacob Wallenberg, "Min son på galejan", 1781. %%%% +Mara + +"This night the Lord of Illusion passed among you, Mara, mighty among + dreamers, mighty for ill. He did come upon another who may work with the + stuff of dreams in a different way. He did meet with Dharma, who may expel + a dreamer from his dream. They did struggle, and the Lord Mara is no more. + Why did they struggle, deathgod against illusionist? You say their ways are + incomprehensible, being the ways of gods. This is not the answer." + -Roger Zelazny, "Lord of Light", 1967 +%%%% Menkaure "Ye men of Egypt, ye have heard your king! diff --git a/crawl-ref/source/dat/descript/monsters.txt b/crawl-ref/source/dat/descript/monsters.txt index 131c577bdb..da05efc32f 100644 --- a/crawl-ref/source/dat/descript/monsters.txt +++ b/crawl-ref/source/dat/descript/monsters.txt @@ -1042,6 +1042,10 @@ manticore A hideous cross-breed, bearing the features of a human and a lion, with great bat-like wings. Its tail bristles with spikes that can be loosed at potential prey. %%%% +Mara + +This tall and powerful demon is Mara, Lord of Illusions, mighty among dreamers. He is capable of creating intricately detailed illusions, able to mislead even the minds of the mightiest and most brilliant spell-casters. +%%%% merfolk Half fish, half man, the merfolk are citizens of both water and land, and they'll fiercely protect their chosen territory. diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 8846f838ea..95473fc4a1 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -2731,16 +2731,21 @@ static std::string _monster_stat_description(const monsters& mon) << ".$"; } - // Magic resistance at MAG_IMMUNE. - if (mons_immune_magic(&mon)) - result << pronoun << " is immune to magical enchantments.$"; - else // How resistant is it? Same scale as the player. + // Magic resistance at MAG_IMMUNE, but not for Rs, as there is then + // too much information leak. + if (mon.type != MONS_RAKSHASA && mon.type != MONS_MARA + && mon.type != MONS_RAKSHASA_FAKE && mon.type != MONS_MARA_FAKE) { - const int mr = mon.res_magic(); - if (mr >= 10) + if (mons_immune_magic(&mon)) + result << pronoun << " is immune to magical enchantments.$"; + else // How resistant is it? Same scale as the player. { - result << pronoun << make_stringf(" is %s resistant to magic.$", - magic_res_adjective(mr).c_str()); + const int mr = mon.res_magic(); + if (mr >= 10) + { + result << pronoun << make_stringf(" is %s resistant to magic.$", + magic_res_adjective(mr).c_str()); + } } } @@ -2929,7 +2934,8 @@ void get_monster_db_desc(const monsters& mons, describe_info &inf, << " is incapable of using stairs.$"; } - if (mons.is_summoned() && mons.type != MONS_RAKSHASA_FAKE) + if (mons.is_summoned() && (mons.type != MONS_RAKSHASA_FAKE + && mons.type != MONS_MARA_FAKE)) { inf.body << "$" << "This monster has been summoned, and is thus only " "temporary. Killing it yields no experience, nutrition " diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index 1526fd6255..518d21b23c 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -3140,8 +3140,11 @@ static std::string _get_monster_desc(const monsters *mon) else if (mon->neutral()) // don't differentiate between permanent or not text += pronoun + " is indifferent to you.\n"; - if (mon->is_summoned() && mon->type != MONS_RAKSHASA_FAKE) + if (mon->is_summoned() && (mon->type != MONS_RAKSHASA_FAKE + && mon->type != MONS_MARA_FAKE)) + { text += pronoun + " has been summoned.\n"; + } if (mon->haloed()) text += pronoun + " is illuminated by a divine halo.\n"; @@ -3242,7 +3245,8 @@ std::string get_monster_equipment_desc(const monsters *mon, bool full_desc, std::string weap = ""; // We don't report rakshasa equipment in order not to give away the - // true rakshasa when it summons. + // true rakshasa when it summons. But Mara is fine, because his weapons + // and armour are cloned with him. if (mon->type != MONS_DANCING_WEAPON && (mon->type != MONS_RAKSHASA || mon->friendly())) @@ -3258,7 +3262,8 @@ std::string get_monster_equipment_desc(const monsters *mon, bool full_desc, } // Print the rest of the equipment only for full descriptions. - if (full_desc && (mon->type != MONS_RAKSHASA || mon->friendly())) + if (full_desc && ((mon->type != MONS_RAKSHASA && mon->type != MONS_MARA + && mon->type != MONS_MARA_FAKE) || mon->friendly())) { const int mon_arm = mon->inv[MSLOT_ARMOUR]; const int mon_shd = mon->inv[MSLOT_SHIELD]; diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index e9894917b0..30687dd58d 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -937,6 +937,13 @@ void direct_effect(monsters *source, spell_type spell, mons_cast_haunt(source); break; + case SPELL_MISLEAD: + if (!def) + mons_cast_mislead(source); + else + defender->confuse(source, source->hit_dice * 12); + break; + default: ASSERT(false); } diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 94d2b6328d..322a67c270 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -1203,6 +1203,7 @@ enum duration_type DUR_SLIMIFY, DUR_TIME_STEP, DUR_ICEMAIL_DEPLETED, // Wait this many turns for full Icemail + DUR_MISLED, NUM_DURATIONS }; @@ -2060,6 +2061,8 @@ enum monster_type // (int) menv[].type MONS_CRAZY_YIUF, MONS_SLAVE, MONS_GIANT_LEECH, + MONS_MARA, + MONS_MARA_FAKE, // Testing monsters MONS_TEST_SPAWNER, @@ -2314,6 +2317,8 @@ enum mon_spellbook_type MST_AIZUL, MST_EXECUTIONER, MST_HAROLD, + MST_MARA, + MST_MARA_FAKE, MST_TEST_SPAWNER = 200, NUM_MSTYPES, @@ -2912,6 +2917,10 @@ enum spell_type SPELL_BLINK_CLOSE, SPELL_BLINK_RANGE, SPELL_BLINK_AWAY, + SPELL_MISLEAD, + SPELL_FAKE_MARA_SUMMON, + SPELL_SUMMON_RAKSHASA, + SPELL_SUMMON_PLAYER_GHOST, NUM_SPELLS }; diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc index 4fa9d16826..a64b191e73 100644 --- a/crawl-ref/source/hiscores.cc +++ b/crawl-ref/source/hiscores.cc @@ -1200,6 +1200,10 @@ std::string scorefile_entry::death_source_desc() const return (""); } + // XXX: Deals specially with Mara's clones. + if (death_source == MONS_MARA_FAKE) + return ("an illusion of Mara"); + // XXX no longer handles mons_num correctly! FIXME return (!death_source_name.empty() ? death_source_name : mons_type_name(death_source, DESC_NOCAP_A)); diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc index bc916fe007..ccca70a29d 100644 --- a/crawl-ref/source/it_use2.cc +++ b/crawl-ref/source/it_use2.cc @@ -76,6 +76,7 @@ bool potion_effect(potion_type pot_eff, int pow, bool drank_it, bool was_known) you.rotting = 0; you.disease = 0; you.duration[DUR_CONF] = 0; + you.duration[DUR_MISLED] = 0; break; case POT_HEAL_WOUNDS: diff --git a/crawl-ref/source/kills.cc b/crawl-ref/source/kills.cc index fa7e0a3924..f0ea8ee3f0 100644 --- a/crawl-ref/source/kills.cc +++ b/crawl-ref/source/kills.cc @@ -280,7 +280,7 @@ void Kills::merge(const Kills &k) void Kills::record_kill(const struct monsters *mon) { // Handle player ghosts separately. - if (mon->type == MONS_PLAYER_GHOST) + if (mon->type == MONS_PLAYER_GHOST && !mon->is_summoned()) { record_ghost_kill(mon); return ; @@ -533,6 +533,9 @@ std::string kill_def::base_name(const kill_monster_desc &md) const case MONS_RAKSHASA_FAKE: name = "illusory " + name; break; + case MONS_MARA_FAKE: + name = "illusory " + name; + break; } return name; } @@ -622,7 +625,7 @@ kill_ghost::kill_ghost(const monsters *mon) // Check whether this is really a ghost, since we also have to handle // the Pandemonic demons. - if (mon->type == MONS_PLAYER_GHOST) + if (mon->type == MONS_PLAYER_GHOST && !mon->is_summoned()) ghost_name = "The ghost of " + get_ghost_description(*mon, true); } diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc index d3feb08c00..c1b4c6d615 100644 --- a/crawl-ref/source/main.cc +++ b/crawl-ref/source/main.cc @@ -1296,6 +1296,12 @@ static void _go_upstairs() if (_marker_vetoes_stair()) return; + if (you.duration[DUR_MISLED]) + { + mpr("Away from their source, illusions no longer mislead you.", MSGCH_DURATION); + you.duration[DUR_MISLED] = 0; + } + tag_followers(); // Only those beside us right now can follow. start_delay(DELAY_ASCENDING_STAIRS, 1 + (you.burden_state > BS_UNENCUMBERED)); @@ -1367,6 +1373,12 @@ static void _go_downstairs() if (!check_annotation_exclusion_warning()) return; + if (you.duration[DUR_MISLED]) + { + mpr("Away from their source, illusions no longer mislead you.", MSGCH_DURATION); + you.duration[DUR_MISLED] = 0; + } + if (shaft) { start_delay( DELAY_DESCENDING_STAIRS, 0, you.your_level ); @@ -2427,6 +2439,7 @@ static void _decrement_durations() _decrement_a_duration(DUR_LOWERED_MR, delay, "You feel more resistant to magic."); _decrement_a_duration(DUR_SLIMIFY, delay, "You feel less slimy.", coinflip(), "Your slime is starting to congeal."); + _decrement_a_duration(DUR_MISLED, delay, "Your thoughts are your own once more."); if (you.duration[DUR_PARALYSIS] || you.petrified()) { @@ -4618,7 +4631,7 @@ static void _compile_time_asserts() COMPILE_CHECK(SP_VAMPIRE == 30 , c3); COMPILE_CHECK(SPELL_DEBUGGING_RAY == 103 , c4); COMPILE_CHECK(SPELL_RETURNING_AMMUNITION == 162 , c5); - COMPILE_CHECK(NUM_SPELLS == 211 , c6); + COMPILE_CHECK(NUM_SPELLS == 215 , c6); //jmf: NEW ASSERTS: we ought to do a *lot* of these COMPILE_CHECK(NUM_SPECIES < SP_UNKNOWN , c7); diff --git a/crawl-ref/source/mon-abil.cc b/crawl-ref/source/mon-abil.cc index 32a764bcb1..5325d3f27b 100644 --- a/crawl-ref/source/mon-abil.cc +++ b/crawl-ref/source/mon-abil.cc @@ -1043,6 +1043,8 @@ bool mon_special_ability(monsters *monster, bolt & beem) case MONS_BLINK_FROG: case MONS_KILLER_KLOWN: case MONS_PRINCE_RIBBIT: + case MONS_MARA: + case MONS_MARA_FAKE: case MONS_GOLDEN_EYE: if (one_chance_in(7) || monster->caught() && one_chance_in(3)) used = monster_blink(monster); diff --git a/crawl-ref/source/mon-cast.cc b/crawl-ref/source/mon-cast.cc index 8a6397d99f..761521f7ab 100644 --- a/crawl-ref/source/mon-cast.cc +++ b/crawl-ref/source/mon-cast.cc @@ -16,11 +16,14 @@ #include "fprop.h" #include "fight.h" #include "ghost.h" +#include "items.h" #include "misc.h" +#include "message.h" #include "mon-behv.h" #include "mon-iter.h" #include "mon-place.h" #include "terrain.h" +#include "tutorial.h" #include "mgen_data.h" #include "coord.h" #include "mon-speak.h" @@ -39,6 +42,7 @@ #include "teleport.h" #include "view.h" #include "viewchar.h" +#include "xom.h" static bool _valid_mon_spells[NUM_SPELLS]; @@ -727,7 +731,8 @@ static bool _los_free_spell(spell_type spell_cast) || spell_cast == SPELL_SMITING || spell_cast == SPELL_HAUNT || spell_cast == SPELL_FIRE_STORM - || spell_cast == SPELL_AIRSTRIKE); + || spell_cast == SPELL_AIRSTRIKE + || spell_cast == SPELL_MISLEAD); } // Set up bolt structure for monster spell casting. @@ -762,6 +767,7 @@ bool setup_mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast, case SPELL_BRAIN_FEED: pbolt.type = DMNBM_BRAIN_FEED; return (true); + case SPELL_MISLEAD: case SPELL_SMITING: case SPELL_AIRSTRIKE: pbolt.type = DMNBM_SMITING; @@ -781,6 +787,9 @@ bool setup_mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast, case SPELL_VAMPIRE_SUMMON: case SPELL_SHADOW_CREATURES: // summon anything appropriate for level case SPELL_FAKE_RAKSHASA_SUMMON: + case SPELL_FAKE_MARA_SUMMON: + case SPELL_SUMMON_PLAYER_GHOST: + case SPELL_SUMMON_RAKSHASA: case SPELL_SUMMON_DEMON: case SPELL_SUMMON_UGLY_THING: case SPELL_ANIMATE_DEAD: @@ -814,6 +823,7 @@ bool setup_mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast, case SPELL_CHAIN_LIGHTNING: // the only user is reckless case SPELL_SUMMON_EYEBALLS: case SPELL_SUMMON_BUTTERFLIES: + case SPELL_MISLEAD: return (true); default: if (check_validity) @@ -1542,6 +1552,130 @@ void mons_cast_haunt(monsters *monster) _pick_random_wraith, random_range(3, 6), GOD_NO_GOD, &fpos); } +int _count_mara_fakes() +{ + int count = 0; + for (monster_iterator mi; mi; ++mi) + { + if (mi->type == MONS_MARA_FAKE) + count++; + } + + return count; +} + +bool _unsuitable_misled_monster(monster_type mons) +{ + return (mons_is_unique(mons) || mons_is_mimic(mons) + || mons_class_is_stationary(mons) || mons_genus(mons) == MONS_DRACONIAN + || mons == MONS_DANCING_WEAPON || mons == MONS_UGLY_THING + || mons == MONS_VERY_UGLY_THING || mons == MONS_ZOMBIE_SMALL + || mons == MONS_ZOMBIE_LARGE || mons == MONS_SKELETON_SMALL + || mons == MONS_SKELETON_LARGE || mons == MONS_SIMULACRUM_SMALL + || mons == MONS_SIMULACRUM_LARGE || mons == MONS_SPECTRAL_THING + || mons == MONS_SLIME_CREATURE || mons == MONS_BALLISTOMYCETE + || mons == MONS_HYDRA || mons == MONS_PLAYER_GHOST + || mons == MONS_SHAPESHIFTER || mons == MONS_PANDEMONIUM_DEMON + || mons == MONS_KILLER_KLOWN || mons == MONS_KRAKEN + || mons == MONS_KRAKEN_TENTACLE + || mons == MONS_GLOWING_SHAPESHIFTER); +} + +monster_type _get_misled_monster (monsters *monster) +{ + monster_type mons = random_monster_at_grid(monster->pos()); + if (_unsuitable_misled_monster(mons)) + mons = random_monster_at_grid(monster->pos()); + + if (_unsuitable_misled_monster(mons)) + return (MONS_GIANT_BAT); + + return mons; +} + +int _update_mislead_monsters(monsters* monster) +{ + int count = 0; + + for (monster_iterator mi; mi; ++mi) + { + if (*mi == monster) + continue; + + // Don't affect uniques, named monsters, and monsters with special tiles. + if (mons_is_unique(mi->type) || !mi->mname.empty() + || mi->props.exists("monster_tile") || mi->props.exists("mislead_as")) + { + continue; + } + else + { + mi->props["mislead_as"] = short(_get_misled_monster(*mi)); + count++; + } + } + + return count; +} + +void mons_cast_mislead(monsters *monster) +{ + // This really only affects the player; it causes confusion when cast on + // non-player foes, but that is dealt with inside ye-great-Switch-of-Doom. + if (monster->foe != MHITYOU) + return; + + // Prevents Mislead spam by Mara and co. {due} + if (you.duration[DUR_MISLED] > 10 && one_chance_in(3)) + return; + + if (wearing_amulet(AMU_CLARITY)) + { + mpr("Your vision blurs momentarily."); + return; + } + + _update_mislead_monsters(monster); + + const int old_value = you.duration[DUR_MISLED]; + you.increase_duration(DUR_MISLED, monster->hit_dice * 12 / 3, 50); + if (you.duration[DUR_MISLED] > old_value) + { + you.check_awaken(500); + + if (old_value <= 0) + { + mpr("But for a moment, strange images dance in front of your eyes.", MSGCH_WARN); +#ifdef USE_TILE + tiles.add_overlay(you.pos(), tileidx_zap(MAGENTA)); + update_screen(); +#else + flash_view(MAGENTA); +#endif + more(); + } + else + mpr("You are even more misled!", MSGCH_WARN); + + learned_something_new(TUT_YOU_ENCHANTED); + + xom_is_stimulated((you.duration[DUR_MISLED] - old_value) + / BASELINE_DELAY); + } + + return; +} + +bool _find_players_ghost () +{ + bool found = false; + for (monster_iterator mi; mi; ++mi) + if (mi->type == MONS_PLAYER_GHOST && mi->mname == you.your_name) + found = true; + + return found; +} + void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast, bool do_noise, bool special_ability) { @@ -1605,8 +1739,8 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast, const bool wizard = monster->is_actual_spellcaster(); god_type god = (priest || !(priest || wizard)) ? monster->god : GOD_NO_GOD; - // Used for summon X elemental, and nothing else. {bookofjude} - monster_type el_summon_type = MONS_NO_MONSTER; + // Used for summon X elemental and nothing else. {bookofjude} + monster_type summon_type = MONS_NO_MONSTER; switch (spell_cast) { @@ -1667,20 +1801,20 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast, return; case SPELL_WATER_ELEMENTALS: - if (el_summon_type == MONS_NO_MONSTER) - el_summon_type = MONS_WATER_ELEMENTAL; + if (summon_type == MONS_NO_MONSTER) + summon_type = MONS_WATER_ELEMENTAL; // Deliberate fall through case SPELL_EARTH_ELEMENTALS: - if (el_summon_type == MONS_NO_MONSTER) - el_summon_type = MONS_EARTH_ELEMENTAL; + if (summon_type == MONS_NO_MONSTER) + summon_type = MONS_EARTH_ELEMENTAL; // Deliberate fall through case SPELL_AIR_ELEMENTALS: - if (el_summon_type == MONS_NO_MONSTER) - el_summon_type = MONS_AIR_ELEMENTAL; + if (summon_type == MONS_NO_MONSTER) + summon_type = MONS_AIR_ELEMENTAL; // Deliberate fall through case SPELL_FIRE_ELEMENTALS: - if (el_summon_type == MONS_NO_MONSTER) - el_summon_type = MONS_FIRE_ELEMENTAL; + if (summon_type == MONS_NO_MONSTER) + summon_type = MONS_FIRE_ELEMENTAL; if (_mons_abjured(monster, monsterNearby)) return; @@ -1690,11 +1824,42 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast, for (sumcount = 0; sumcount < sumcount2; sumcount++) { create_monster( - mgen_data(el_summon_type, SAME_ATTITUDE(monster), monster, + mgen_data(summon_type, SAME_ATTITUDE(monster), monster, + 3, spell_cast, monster->pos(), monster->foe, 0, god)); + } + return; + + case SPELL_SUMMON_RAKSHASA: + sumcount2 = 1 + random2(4) + random2(monster->hit_dice / 7 + 1); + + for (sumcount = 0; sumcount < sumcount2; sumcount++) + { + create_monster( + mgen_data(MONS_RAKSHASA, SAME_ATTITUDE(monster), monster, 3, spell_cast, monster->pos(), monster->foe, 0, god)); } return; + case SPELL_SUMMON_PLAYER_GHOST: + + // Do nothing in the arena; this could instead create a ghost of an + // existant monster, but that would require the spell being dealth with + // as a bolt instead. + if (crawl_state.arena) + return; + + // Only summon one ghost. + if (_find_players_ghost()) + return; + + mpr("There is a horrible, sudden wrenching feeling in your soul!", MSGCH_WARN); + + create_monster( + mgen_data(MONS_PLAYER_GHOST, SAME_ATTITUDE(monster), monster, + 6, spell_cast, monster->pos(), monster->foe, 0, god)); + + return; + case SPELL_KRAKEN_TENTACLES: { int kraken_index = monster->mindex(); @@ -1737,6 +1902,66 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast, mpr("Tentacles burst out of the water!"); return; } + case SPELL_FAKE_MARA_SUMMON: + // We only want there to be two fakes, which, plus Mara, means + // a total of three Maras; if we already have two, give up, otherwise + // we want to summon either one more or two more. + sumcount2 = 2 - _count_mara_fakes(); + + for (sumcount = 0; sumcount < sumcount2; sumcount++) + { + mgen_data summ_mon = mgen_data(MONS_MARA_FAKE, SAME_ATTITUDE(monster), + monster, 3, spell_cast, monster->pos(), + monster->foe, 0, god); + // This is somewhat hacky, to prevent "A Mara", and such, as MONS_FAKE_MARA + // is not M_UNIQUE. + summ_mon.mname = "Mara"; + summ_mon.extra_flags |= MF_NAME_REPLACE; + + int created = create_monster(summ_mon); + if (created == -1) + continue; + + // Mara's clones are special; they have the same stats as him, and + // are exact clones, so they are created damaged if necessary, with + // identical enchants and with the same items. + monsters *new_fake = &menv[created]; + new_fake->hit_points = monster->hit_points; + new_fake->max_hit_points = monster->max_hit_points; + mon_enchant_list::iterator ei; + for (ei = monster->enchantments.begin(); ei != monster->enchantments.end(); ++ei) + { + new_fake->enchantments.insert(*ei); + } + + // Code basically lifted from clone_monster. In theory, it only needs + // to copy weapon and armour slots; instead, copy the whole inventory. + for (int i = 0; i < NUM_MONSTER_SLOTS; i++) + { + const int old_index = monster->inv[i]; + + if (old_index == NON_ITEM) + continue; + + const int new_index = get_item_slot(0); + if (new_index == NON_ITEM) + { + new_fake->unequip(mitm[old_index], i, 0, true); + new_fake->inv[i] = NON_ITEM; + continue; + } + + new_fake->inv[i] = new_index; + mitm[new_index] = mitm[old_index]; + mitm[new_index].set_holding_monster(new_fake->mindex()); + + // Mark items as summoned, so there's no way to get three nice + // weapons or such out of him. + mitm[new_index].flags |= ISFLAG_SUMMONED; + } + } + return; + case SPELL_FAKE_RAKSHASA_SUMMON: sumcount2 = (coinflip() ? 2 : 3); diff --git a/crawl-ref/source/mon-cast.h b/crawl-ref/source/mon-cast.h index 896c377ceb..22629b4f9a 100644 --- a/crawl-ref/source/mon-cast.h +++ b/crawl-ref/source/mon-cast.h @@ -27,5 +27,6 @@ bool setup_mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast, bool check_validity = false); void mons_cast_haunt(monsters *monster); +void mons_cast_mislead(monsters *monster); #endif diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h index 7dff442836..c0c251c67b 100644 --- a/crawl-ref/source/mon-data.h +++ b/crawl-ref/source/mon-data.h @@ -4672,6 +4672,32 @@ static monsterentry mondata[] = { MONUSE_WEAPONS_ARMOUR, MONEAT_NOTHING, SIZE_MEDIUM }, +{ + MONS_MARA, 'R', LIGHTRED, "Mara", + M_SPELLCASTER | M_SEE_INVIS | M_ACTUAL_SPELLS | M_SPEAKS | M_UNIQUE, + MR_RES_POISON | MR_RES_ELEC, + 0, 15, MONS_RAKSHASA, MONS_RAKSHASA, MH_DEMONIC, -10, + { {AT_HIT, AF_PLAIN, 40}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, + { 20, 0, 0, 140 }, + 15, 15, MST_MARA, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT, + I_HIGH, HT_LAND, FL_NONE, 10, DEFAULT_ENERGY, + MONUSE_WEAPONS_ARMOUR, MONEAT_NOTHING, SIZE_MEDIUM +}, + +// Illusions of Mara. Only two ever exist at the one time; identical stats to +// Mara. +{ + MONS_MARA_FAKE, 'R', LIGHTRED, "Mara", + M_SPELLCASTER | M_SEE_INVIS | M_ACTUAL_SPELLS | M_SPEAKS, + MR_RES_POISON | MR_RES_ELEC, + 0, 15, MONS_RAKSHASA_FAKE, MONS_RAKSHASA_FAKE, MH_DEMONIC, MAG_IMMUNE, + { {AT_HIT, AF_PLAIN, 40}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, + { 20, 0, 0, 140 }, + 15, 15, MST_MARA_FAKE, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT, + I_HIGH, HT_LAND, FL_NONE, 10, DEFAULT_ENERGY, + MONUSE_WEAPONS_ARMOUR, MONEAT_NOTHING, SIZE_MEDIUM +}, + { // Snorg can go berserk. MONS_SNORG, 'T', LIGHTGREEN, "Snorg", diff --git a/crawl-ref/source/mon-gear.cc b/crawl-ref/source/mon-gear.cc index 1c261102a9..01edc35951 100644 --- a/crawl-ref/source/mon-gear.cc +++ b/crawl-ref/source/mon-gear.cc @@ -364,6 +364,13 @@ static item_make_species_type _give_weapon(monsters *mon, int level, 0); break; + case MONS_MARA: + item.base_type = OBJ_WEAPONS; + item.sub_type = random_choose(WPN_DEMON_BLADE, WPN_DEMON_TRIDENT, + WPN_DEMON_WHIP, -1); + level = MAKE_GOOD_ITEM; + break; + case MONS_DEEP_ELF_FIGHTER: case MONS_DEEP_ELF_HIGH_PRIEST: case MONS_DEEP_ELF_KNIGHT: @@ -1440,6 +1447,7 @@ void give_armour(monsters *mon, int level) case MONS_DRACONIAN_KNIGHT: case MONS_WIZARD: case MONS_ILSUIW: + case MONS_MARA: if (item_race == MAKE_ITEM_RANDOM_RACE) item_race = MAKE_ITEM_NO_RACE; item.base_type = OBJ_ARMOUR; diff --git a/crawl-ref/source/mon-info.cc b/crawl-ref/source/mon-info.cc index c62e6aaf1c..07b0e4eab8 100644 --- a/crawl-ref/source/mon-info.cc +++ b/crawl-ref/source/mon-info.cc @@ -42,6 +42,8 @@ monster_info::monster_info(const monsters *m) int mtype = m->type; if (mtype == MONS_RAKSHASA_FAKE) mtype = MONS_RAKSHASA; + else if (mtype == MONS_MARA_FAKE) + mtype = MONS_MARA; // Currently, difficulty is defined as "average hp". m_difficulty = mons_difficulty(mtype); @@ -79,12 +81,21 @@ bool monster_info::less_than(const monster_info& m1, int m1type = m1.m_mon->type; int m2type = m2.m_mon->type; + if (!crawl_state.arena && you.misled()) + { + m1type = m1.m_mon->get_mislead_type(); + m2type = m2.m_mon->get_mislead_type(); + } // Don't differentiate real rakshasas from fake ones. if (m1type == MONS_RAKSHASA_FAKE) m1type = MONS_RAKSHASA; + else if (m1type == MONS_MARA_FAKE) + m1type = MONS_MARA; if (m2type == MONS_RAKSHASA_FAKE) m2type = MONS_RAKSHASA; + else if (m2type == MONS_MARA_FAKE) + m2type = MONS_MARA; // Force plain but different coloured draconians to be treated like the // same sub-type. @@ -207,11 +218,15 @@ void monster_info::to_string(int count, std::string& desc, int& desc_color) const { std::ostringstream out; + monster_type type = m_mon->type; + if (!crawl_state.arena && you.misled()) + type = m_mon->get_mislead_type(); + if (count == 1) { - if (mons_is_mimic(m_mon->type)) - out << mons_type_name(m_mon->type, DESC_PLAIN); + if (mons_is_mimic(type)) + out << mons_type_name(type, DESC_PLAIN); else out << m_mon->full_name(DESC_PLAIN); } @@ -220,7 +235,9 @@ void monster_info::to_string(int count, std::string& desc, // Don't pluralise uniques, ever. Multiple copies of the same unique // are unlikely in the dungeon currently, but quite common in the // arena. This prevens "4 Gra", etc. {due} - if (mons_is_unique(m_mon->type)) + // Unless it's Mara, who summons illusions of himself. + if (mons_is_unique(type) && type != MONS_MARA + && type != MONS_MARA_FAKE) { out << count << " " << m_mon->name(DESC_PLAIN); @@ -228,18 +245,18 @@ void monster_info::to_string(int count, std::string& desc, // Don't differentiate between dancing weapons, mimics, (very) // ugly things or draconians of different types. else if (m_fullname - && m_mon->type != MONS_DANCING_WEAPON - && mons_genus(m_mon->type) != MONS_DRACONIAN - && m_mon->type != MONS_UGLY_THING - && m_mon->type != MONS_VERY_UGLY_THING - && !mons_is_mimic(m_mon->type) + && type != MONS_DANCING_WEAPON + && mons_genus(type) != MONS_DRACONIAN + && type != MONS_UGLY_THING + && type != MONS_VERY_UGLY_THING + && !mons_is_mimic(type) && m_mon->mname.empty()) { out << count << " " << pluralise(m_mon->name(DESC_PLAIN)); } - else if (m_mon->type >= MONS_DRACONIAN - && m_mon->type <= MONS_PALE_DRACONIAN) + else if (type >= MONS_DRACONIAN + && type <= MONS_PALE_DRACONIAN) { out << count << " " << pluralise(mons_type_name(MONS_DRACONIAN, DESC_PLAIN)); @@ -247,7 +264,7 @@ void monster_info::to_string(int count, std::string& desc, else { out << count << " " - << pluralise(mons_type_name(m_mon->type, DESC_PLAIN)); + << pluralise(mons_type_name(type, DESC_PLAIN)); } } diff --git a/crawl-ref/source/mon-spll.h b/crawl-ref/source/mon-spll.h index a5aaa6526b..526d37f378 100644 --- a/crawl-ref/source/mon-spll.h +++ b/crawl-ref/source/mon-spll.h @@ -1297,6 +1297,28 @@ } }, + { MST_MARA, + { + SPELL_MISLEAD, + SPELL_FAKE_MARA_SUMMON, + SPELL_LIGHTNING_BOLT, + SPELL_SUMMON_PLAYER_GHOST, + SPELL_PAIN, + SPELL_TELEPORT_SELF, + } + }, + + { MST_MARA_FAKE, + { + SPELL_MISLEAD, + SPELL_NO_SPELL, + SPELL_LIGHTNING_BOLT, + SPELL_NO_SPELL, + SPELL_PAIN, + SPELL_TELEPORT_SELF, + } + }, + { MST_TEST_SPAWNER, { SPELL_SHADOW_CREATURES, diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 9420d1d78c..3687e1711c 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -148,7 +148,8 @@ void init_mon_name_cache() if (mon == MONS_RAKSHASA_FAKE || mon == MONS_ARMOUR_MIMIC || mon == MONS_SCROLL_MIMIC - || mon == MONS_POTION_MIMIC) + || mon == MONS_POTION_MIMIC + || mon == MONS_MARA_FAKE) { // Keep previous entry. continue; @@ -2569,6 +2570,7 @@ static bool _ms_los_spell(spell_type monspell) if (monspell == SPELL_SMITING || monspell == SPELL_AIRSTRIKE || monspell == SPELL_HAUNT + || monspell == SPELL_MISLEAD || spell_typematch(monspell, SPTYP_SUMMONING)) { return (true); @@ -2584,7 +2586,8 @@ static bool _ms_ranged_spell(spell_type monspell, bool attack_only = false, // Check for Smiting specially, so it's not filtered along // with the summon spells. if (attack_only - && (monspell == SPELL_SMITING || monspell == SPELL_AIRSTRIKE)) + && (monspell == SPELL_SMITING || monspell == SPELL_AIRSTRIKE + || monspell == SPELL_MISLEAD)) { return (true); } @@ -2732,6 +2735,10 @@ const char *mons_pronoun(monster_type mon_type, pronoun_type variant, { gender = GENDER_FEMALE; } + // Mara's fakes aren't a unique, but should still be classified + // as male. + else if (mon_type == MONS_MARA_FAKE) + gender = GENDER_MALE; else if (mons_is_unique(mon_type) && mon_type != MONS_PLAYER_GHOST) { switch (mon_type) @@ -2812,7 +2819,8 @@ bool mons_has_smite_attack(const monsters *monster) || hspell_pass[i] == SPELL_SMITING || hspell_pass[i] == SPELL_HELLFIRE_BURST || hspell_pass[i] == SPELL_FIRE_STORM - || hspell_pass[i] == SPELL_AIRSTRIKE) + || hspell_pass[i] == SPELL_AIRSTRIKE + || hspell_pass[i] == SPELL_MISLEAD) { return (true); } diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index 55b342a903..4cefe30857 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -326,6 +326,7 @@ int monsters::body_weight() const case MONS_SPECTRAL_WARRIOR: case MONS_ELECTRIC_GOLEM: case MONS_RAKSHASA_FAKE: + case MONS_MARA_FAKE: return (0); case MONS_ZOMBIE_SMALL: @@ -2039,10 +2040,14 @@ static std::string _invalid_monster_str(monster_type type) static std::string _str_monam(const monsters& mon, description_level_type desc, bool force_seen) { - if (mon.type == MONS_NO_MONSTER) + monster_type type = mon.type; + if (!crawl_state.arena && you.misled()) + type = mon.get_mislead_type(); + + if (type == MONS_NO_MONSTER) return ("DEAD MONSTER"); - else if (invalid_monster_type(mon.type) && mon.type != MONS_PROGRAM_BUG) - return _invalid_monster_str(mon.type); + else if (invalid_monster_type(type) && type != MONS_PROGRAM_BUG) + return _invalid_monster_str(type); const bool arena_submerged = crawl_state.arena && !force_seen && mon.submerged(); @@ -2065,10 +2070,10 @@ static std::string _str_monam(const monsters& mon, description_level_type desc, // Various special cases: // non-gold mimics, dancing weapons, ghosts, Pan demons - if (mons_is_mimic(mon.type)) + if (mons_is_mimic(type)) return (get_mimic_item(&mon).name(desc)); - if (mon.type == MONS_DANCING_WEAPON && mon.inv[MSLOT_WEAPON] != NON_ITEM) + if (type == MONS_DANCING_WEAPON && mon.inv[MSLOT_WEAPON] != NON_ITEM) { unsigned long ignore_flags = ISFLAG_KNOW_CURSE | ISFLAG_KNOW_PLUSES; bool use_inscrip = true; @@ -2085,16 +2090,16 @@ static std::string _str_monam(const monsters& mon, description_level_type desc, } if (desc == DESC_DBNAME) - return (get_monster_data(mon.type)->name); + return (get_monster_data(type)->name); - if (mon.type == MONS_PLAYER_GHOST) + if (type == MONS_PLAYER_GHOST) return (apostrophise(mon.mname) + " ghost"); // Some monsters might want the name of a different creature. - monster_type nametype = mon.type; + monster_type nametype = type; // Tack on other prefixes. - switch (mon.type) + switch (type) { case MONS_ZOMBIE_SMALL: case MONS_ZOMBIE_LARGE: case MONS_SKELETON_SMALL: case MONS_SKELETON_LARGE: @@ -2159,7 +2164,7 @@ static std::string _str_monam(const monsters& mon, description_level_type desc, result += "submerged "; // Tack on other prefixes. - switch (mon.type) + switch (type) { case MONS_UGLY_THING: case MONS_VERY_UGLY_THING: @@ -2185,7 +2190,7 @@ static std::string _str_monam(const monsters& mon, description_level_type desc, break; } - if (mon.type == MONS_SLIME_CREATURE && desc != DESC_DBNAME) + if (type == MONS_SLIME_CREATURE && desc != DESC_DBNAME) { ASSERT(mon.number <= 5); const char* cardinals[] = {"buggy ", "", "large ", "very large ", @@ -2193,7 +2198,7 @@ static std::string _str_monam(const monsters& mon, description_level_type desc, result += cardinals[mon.number]; } - if (mon.type == MONS_BALLISTOMYCETE && desc != DESC_DBNAME) + if (type == MONS_BALLISTOMYCETE && desc != DESC_DBNAME) { result += mon.number ? "active " : ""; } @@ -2231,7 +2236,7 @@ static std::string _str_monam(const monsters& mon, description_level_type desc, } // Add suffixes. - switch (mon.type) + switch (type) { case MONS_ZOMBIE_SMALL: case MONS_ZOMBIE_LARGE: @@ -2260,7 +2265,7 @@ static std::string _str_monam(const monsters& mon, description_level_type desc, result.insert(1, "n"); } - if (mons_is_unique(mon.type) && starts_with(result, "the ")) + if (mons_is_unique(type) && starts_with(result, "the ")) { switch (desc) { @@ -2278,7 +2283,7 @@ static std::string _str_monam(const monsters& mon, description_level_type desc, { // If momentarily in original form, don't display "shaped // shifter". - if (mons_genus(mon.type) != MONS_SHAPESHIFTER) + if (mons_genus(type) != MONS_SHAPESHIFTER) result += " shaped shifter"; } @@ -2350,7 +2355,10 @@ std::string monsters::full_name(description_level_type desc, } } - const int _type = mons_is_zombified(this) ? base_monster : type; + int _type = mons_is_zombified(this) ? base_monster : type; + if (!crawl_state.arena && you.misled()) + _type = get_mislead_type(); + if (mons_genus(_type) == MONS_HYDRA && flag == 0) return (title); @@ -3720,7 +3728,11 @@ void monsters::ghost_init() enchantments.clear(); ench_countdown = 0; - find_place_to_live(); + // Summoned player ghosts are already given a position; calling this + // in those instances will cause a segfault. Instead, check to see + // if we have a home first. {due} + if (!in_bounds(pos())) + find_place_to_live(); } void monsters::uglything_init(bool only_mutate) @@ -5705,6 +5717,14 @@ const monsterentry *monsters::find_monsterentry() const : get_monster_data(type); } +monster_type monsters::get_mislead_type() const +{ + if (props.exists("mislead_as")) + return static_cast(props["mislead_as"].get_short()); + else + return type; +} + int monsters::action_energy(energy_use_type et) const { bool swift = has_ench(ENCH_SWIFT); diff --git a/crawl-ref/source/monster.h b/crawl-ref/source/monster.h index c17aeee6ce..400ad01769 100644 --- a/crawl-ref/source/monster.h +++ b/crawl-ref/source/monster.h @@ -117,6 +117,7 @@ public: bool has_base_name() const; const monsterentry *find_monsterentry() const; + monster_type get_mislead_type() const; void init_experience(); diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 04d4b9a7ca..4da287188f 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -734,6 +734,9 @@ static void _get_status_lights(std::vector& out) if (you.duration[DUR_LIQUID_FLAMES]) out.push_back(status_light(RED, "Fire")); + if (you.duration[DUR_MISLED]) + out.push_back(status_light(LIGHTMAGENTA, "Misled")); + if (you.duration[DUR_POISONING]) { int color = _bad_ench_colour( you.duration[DUR_POISONING], 5, 10 ); diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index fb6b425834..4e5cf2dc77 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -6895,6 +6895,11 @@ bool player::invisible() const return (duration[DUR_INVIS] && !backlit()); } +bool player::misled() const +{ + return (duration[DUR_MISLED]); +} + bool player::visible_to(const actor *looker) const { if (crawl_state.arena) diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index 285d438c0c..d7f5306c08 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -325,6 +325,7 @@ public: bool is_levitating() const; bool cannot_speak() const; bool invisible() const; + bool misled() const; bool can_see_invisible() const; bool can_see_invisible(bool unid) const; bool visible_to(const actor *looker) const; diff --git a/crawl-ref/source/rltiles/dc-mon.txt b/crawl-ref/source/rltiles/dc-mon.txt index dd347bd4fb..6809b0cd93 100644 --- a/crawl-ref/source/rltiles/dc-mon.txt +++ b/crawl-ref/source/rltiles/dc-mon.txt @@ -232,9 +232,14 @@ azrael MONS_AZRAEL efreet MONS_EFREET ## Rakshasa ('R') +%sdir dc-mon/unique +mara MONS_MARA +mara MONS_MARA_FAKE +%sdir dc-mon/demons rakshasa MONS_RAKSHASA rakshasa MONS_RAKSHASA_FAKE + ## Abominations ('X') abomination_large MONS_ABOMINATION_LARGE abomination_large1 diff --git a/crawl-ref/source/rltiles/dc-mon/unique/mara.png b/crawl-ref/source/rltiles/dc-mon/unique/mara.png new file mode 100644 index 0000000000..2cb82ea411 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-mon/unique/mara.png differ diff --git a/crawl-ref/source/show.cc b/crawl-ref/source/show.cc index f6fc5cad9e..d6c3ff577a 100644 --- a/crawl-ref/source/show.cc +++ b/crawl-ref/source/show.cc @@ -360,7 +360,8 @@ void show_def::_update_monster(const monsters* mons) _set_backup(e); grid(e).cls = SH_MONSTER; - grid(e).mons = mons->type; + grid(e).mons = (!crawl_state.arena && you.misled()) ? + mons->get_mislead_type() : mons->type; grid(e).colour = get_mons_glyph(mons).col; #ifdef USE_TILE diff --git a/crawl-ref/source/showsymb.cc b/crawl-ref/source/showsymb.cc index 1d3c4e7dae..50a6272d41 100644 --- a/crawl-ref/source/showsymb.cc +++ b/crawl-ref/source/showsymb.cc @@ -56,6 +56,11 @@ glyph get_show_glyph(show_type object) static int _get_mons_colour(const monsters *mons) { int col = mons->colour; + if (!crawl_state.arena && you.misled()) + { + const monsterentry* mdat = get_monster_data(mons->get_mislead_type()); + col = mdat->colour; + } if (mons->berserk()) col = RED; @@ -125,7 +130,11 @@ glyph get_item_glyph(const item_def *item) glyph get_mons_glyph(const monsters *mons) { glyph g; - g.ch = mons_char(mons->type); + + if (!crawl_state.arena && you.misled()) + g.ch = mons_char(mons->get_mislead_type()); + else + g.ch = mons_char(mons->type); g.col = _get_mons_colour(mons); return (g); } diff --git a/crawl-ref/source/spl-data.h b/crawl-ref/source/spl-data.h index 27f1ea2632..3adc30d1d3 100644 --- a/crawl-ref/source/spl-data.h +++ b/crawl-ref/source/spl-data.h @@ -2500,93 +2500,145 @@ { SPELL_FLAME_AMMUNITION, "Flame Ammunition", - SPTYP_ENCHANTMENT | SPTYP_FIRE, - SPFLAG_HELPFUL | SPFLAG_BATTLE, - 3, - 0, - -1,-1, - 0, - NULL, - false, - true + SPTYP_ENCHANTMENT | SPTYP_FIRE, + SPFLAG_HELPFUL | SPFLAG_BATTLE, + 3, + 0, + -1,-1, + 0, + NULL, + false, + true }, { SPELL_FROST_AMMUNITION, "Frost Ammunition", - SPTYP_ENCHANTMENT | SPTYP_ICE, - SPFLAG_HELPFUL | SPFLAG_BATTLE, - 3, - 0, - -1,-1, - 0, - NULL, - false, - true + SPTYP_ENCHANTMENT | SPTYP_ICE, + SPFLAG_HELPFUL | SPFLAG_BATTLE, + 3, + 0, + -1,-1, + 0, + NULL, + false, + true }, { SPELL_SHOCKING_AMMUNITION, "Shocking Ammunition", - SPTYP_ENCHANTMENT | SPTYP_AIR, - SPFLAG_HELPFUL | SPFLAG_BATTLE, - 5, - 0, - -1,-1, - 0, - NULL, - false, - true + SPTYP_ENCHANTMENT | SPTYP_AIR, + SPFLAG_HELPFUL | SPFLAG_BATTLE, + 5, + 0, + -1,-1, + 0, + NULL, + false, + true }, { SPELL_EXPLODING_AMMUNITION, "Exploding Ammunition", - SPTYP_ENCHANTMENT | SPTYP_FIRE | SPTYP_AIR, - SPFLAG_HELPFUL | SPFLAG_BATTLE, - 5, - 0, - -1,-1, - 0, - NULL, - false, - true + SPTYP_ENCHANTMENT | SPTYP_FIRE | SPTYP_AIR, + SPFLAG_HELPFUL | SPFLAG_BATTLE, + 5, + 0, + -1,-1, + 0, + NULL, + false, + true }, { SPELL_WARP_AMMUNITION, "Warp Ammunition", - SPTYP_ENCHANTMENT | SPTYP_TRANSLOCATION, - SPFLAG_HELPFUL | SPFLAG_BATTLE, - 5, - 0, - -1,-1, - 0, - NULL, - false, - true + SPTYP_ENCHANTMENT | SPTYP_TRANSLOCATION, + SPFLAG_HELPFUL | SPFLAG_BATTLE, + 5, + 0, + -1,-1, + 0, + NULL, + false, + true }, { SPELL_REAPING_AMMUNITION, "Reaping Ammunition", - SPTYP_ENCHANTMENT | SPTYP_NECROMANCY, - SPFLAG_HELPFUL | SPFLAG_BATTLE, - 7, - 0, - -1,-1, - 0, - NULL, - false, - true + SPTYP_ENCHANTMENT | SPTYP_NECROMANCY, + SPFLAG_HELPFUL | SPFLAG_BATTLE, + 7, + 0, + -1,-1, + 0, + NULL, + false, + true }, { SPELL_RETURNING_AMMUNITION, "Returning Ammunition", - SPTYP_ENCHANTMENT | SPTYP_TRANSLOCATION, - SPFLAG_HELPFUL | SPFLAG_BATTLE, - 3, - 0, - -1,-1, - 0, - NULL, - false, - true + SPTYP_ENCHANTMENT | SPTYP_TRANSLOCATION, + SPFLAG_HELPFUL | SPFLAG_BATTLE, + 3, + 0, + -1,-1, + 0, + NULL, + false, + true +}, + +{ + SPELL_FAKE_MARA_SUMMON, "Mara Summon", + SPTYP_SUMMONING, + SPFLAG_MONSTER, + 5, + 0, + -1, -1, + 0, + NULL, + false, + false +}, + +{ + SPELL_SUMMON_RAKSHASA, "Summon Rakshasa", + SPTYP_SUMMONING, + SPFLAG_MONSTER, + 5, + 0, + -1, -1, + 0, + NULL, + false, + false +}, + +{ + SPELL_MISLEAD, "Mislead", + SPTYP_ENCHANTMENT, + SPFLAG_TARGET | SPFLAG_NOT_SELF, + 5, + 200, + LOS_RADIUS, LOS_RADIUS, + 0, + NULL, + false, + false +}, + +{ + SPELL_SUMMON_PLAYER_GHOST, "Summon Player Ghost", + SPTYP_SUMMONING, + SPFLAG_MONSTER, + 5, + 0, + -1, -1, + 0, + NULL, + false, + false }, { diff --git a/crawl-ref/source/tags.h b/crawl-ref/source/tags.h index 33cc24396a..26ecf81233 100644 --- a/crawl-ref/source/tags.h +++ b/crawl-ref/source/tags.h @@ -40,7 +40,7 @@ enum tag_file_type // file types supported by tag system enum tag_major_version { TAG_MAJOR_START = 5, - TAG_MAJOR_VERSION = 10 + TAG_MAJOR_VERSION = 11 }; // Minor version will be reset to zero when major version changes. diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc index 0fe8bbbb32..725947c13c 100644 --- a/crawl-ref/source/tilepick.cc +++ b/crawl-ref/source/tilepick.cc @@ -121,6 +121,8 @@ int tileidx_monster_base(const monsters *mon, bool detected) bool in_water = feat_is_water(grd(mon->pos())); int type = mon->type; + if (!crawl_state.arena && you.misled()) + type = mon->get_mislead_type(); // Show only base class for detected monsters. if (detected) @@ -1014,6 +1016,12 @@ int tileidx_monster_base(const monsters *mon, bool detected) case MONS_EROLCHA: return TILEP_MONS_EROLCHA; + // rakshasas ('R') + case MONS_MARA: + return TILEP_MONS_MARA; + case MONS_MARA_FAKE: + return TILEP_MONS_MARA_FAKE; + // trolls ('T') case MONS_PURGY: return TILEP_MONS_PURGY; -- cgit v1.2.3-54-g00ecf From 52eb7cb1ac83e28c1ad0a0a9e476ebc1242868a8 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Thu, 24 Dec 2009 21:29:22 +1000 Subject: Actually let Mara generate (same area as Margery). --- crawl-ref/source/dat/uniques.des | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crawl-ref/source/dat/uniques.des b/crawl-ref/source/dat/uniques.des index 8f301d0ae3..365d66e8eb 100644 --- a/crawl-ref/source/dat/uniques.des +++ b/crawl-ref/source/dat/uniques.des @@ -215,6 +215,10 @@ NAME: uniq_maud DEPTH: 14-16 : place_unique(_G, "Maud") +NAME: uniq_mara +DEPTH: 20-27, !Lair, !Slime +: place_unique(_G, "Mara") + NAME: uniq_maurice DEPTH: 8-9, 10-13, !Lair, !Slime : place_unique(_G, "Maurice") -- cgit v1.2.3-54-g00ecf From d8bcaddd74127807fd2a7a3018559baa54948ed9 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Fri, 25 Dec 2009 10:27:30 +1000 Subject: Adjust unique placement levels (dpeg). Make A=2 instead of 3. --- crawl-ref/source/dungeon.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index f8d614d73f..bef185979e 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -3592,7 +3592,7 @@ static int _place_uniques(int level_number, char level_type) int num_placed = 0; // Magic numbers for dpeg's unique system. - int A = 3; + int A = 2; int B = 5; while (one_chance_in(A)) { -- cgit v1.2.3-54-g00ecf From 67f150128ce5d4c507b148e2321b1994068cf494 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Fri, 25 Dec 2009 10:31:44 +1000 Subject: Remove Ely's dislike of butchery during prayer. (FR231) As sacrifice is now simply praying over a corpse rather than butchering while praying, butchering during pray to Ely should no longer be construed as an attempt to sacrifice to her. --- crawl-ref/source/religion.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 3ec55a07cc..accadce94e 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -5151,7 +5151,7 @@ bool god_likes_fresh_corpses(god_type god) bool god_hates_butchery(god_type god) { - return (god == GOD_ELYVILON); + return (false); } harm_protection_type god_protects_from_harm(god_type god, bool actual) -- cgit v1.2.3-54-g00ecf From 9fc99a71b4cef054f5cf2b350fb427119bbd02fc Mon Sep 17 00:00:00 2001 From: Enne Walker Date: Thu, 24 Dec 2009 19:43:51 -0500 Subject: Updating zot.des due to previous rltiles change. --- crawl-ref/source/dat/zot.des | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl-ref/source/dat/zot.des b/crawl-ref/source/dat/zot.des index bdc8ee1d46..4f6d81b319 100644 --- a/crawl-ref/source/dat/zot.des +++ b/crawl-ref/source/dat/zot.des @@ -416,7 +416,7 @@ ORIENT: float LFLOORCOL: lightgrey LROCKCOL: lightgrey LFLOORTILE: floor_tomb -LROCKTILE: wall_zot_gray +LROCKTILE: wall_zot_white MAP . ENDMAP -- cgit v1.2.3-54-g00ecf From efa480596af6a5d28ab87e5bd4185f995c70cf93 Mon Sep 17 00:00:00 2001 From: Enne Walker Date: Thu, 24 Dec 2009 19:44:42 -0500 Subject: [160] Fixing vaults not spawning in Pan. Because layout vaults were changed to be true vaults rather than just writing to grd, they also wrote MMT_OPAQUE. This caused vault placement to fail (usually) on top of the layout vaults. Fixed by letting MMT_VAULT be the only mask that causes vault placement to fail. --- crawl-ref/source/maps.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc index 42006436f7..07da121e02 100644 --- a/crawl-ref/source/maps.cc +++ b/crawl-ref/source/maps.cc @@ -337,7 +337,7 @@ static bool _safe_vault_place(const map_def &map, if (lines[dp.y][dp.x] == ' ') continue; - if (dgn_Map_Mask[cp.x][cp.y]) + if (dgn_Map_Mask[cp.x][cp.y] == MMT_VAULT) return (false); const dungeon_feature_type dfeat = grd(cp); -- cgit v1.2.3-54-g00ecf From 3597a688057e8efc040996f5f340feb65402f314 Mon Sep 17 00:00:00 2001 From: Enne Walker Date: Thu, 24 Dec 2009 20:00:16 -0500 Subject: Fixing rltiles compile. Missing std includes. (Thanks, due). --- crawl-ref/source/rltiles/tool/tile_page.cc | 1 + crawl-ref/source/rltiles/tool/tile_page.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/crawl-ref/source/rltiles/tool/tile_page.cc b/crawl-ref/source/rltiles/tool/tile_page.cc index 4bd6c8a10f..3c90dcfce8 100644 --- a/crawl-ref/source/rltiles/tool/tile_page.cc +++ b/crawl-ref/source/rltiles/tool/tile_page.cc @@ -2,6 +2,7 @@ #include "tile_colour.h" #include #include +#include #include "tile.h" tile_page::tile_page() : m_width(1024), m_height(0) diff --git a/crawl-ref/source/rltiles/tool/tile_page.h b/crawl-ref/source/rltiles/tool/tile_page.h index d9f6a47861..c63ae43a5a 100644 --- a/crawl-ref/source/rltiles/tool/tile_page.h +++ b/crawl-ref/source/rltiles/tool/tile_page.h @@ -2,6 +2,8 @@ #define TILE_PAGE_H #include +#include + class tile; class tile_page -- cgit v1.2.3-54-g00ecf From fe8e010a8490d8ae9ec26f997a78e869039d382f Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Fri, 25 Dec 2009 10:56:19 +1000 Subject: Allow access to the memorisation screen regardless of spell levels. (FR #235) This commit still prevents access to the screen when you have no books available, but will suppress the "low XP" and "no spell levels" warnings. --- crawl-ref/source/spl-book.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc index f5f89f44b6..af1a551caa 100644 --- a/crawl-ref/source/spl-book.cc +++ b/crawl-ref/source/spl-book.cc @@ -1447,15 +1447,11 @@ static bool _get_mem_list(spell_list &mem_spells, "You cannot memorise any of the available spells because you " "are a %s.", lowercase_string(species).c_str()); } - else if (num_low_levels > 0) + else if (num_low_levels > 0 || num_low_xl > 0) { - mpr("You do not have enough free spell levels to memorise any of the " - "available spells.", MSGCH_PROMPT); - } - else if (num_low_xl > 0) - { - mpr("You aren't experienced enough to memorise any of the " - "available spells.", MSGCH_PROMPT); + // Just because we can't memorise them doesn't mean we don't want to + // see what we have available. See FR #235. {due} + return (true); } else { -- cgit v1.2.3-54-g00ecf From 701f0d3bae53d22d476eeec3d85ee02a26623a66 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Fri, 25 Dec 2009 11:10:30 +1000 Subject: Make auto-travel killing toadstools saner. Use wielded_weapon_check, though in this instance do not print a prompt. This means that if you have previously been asked about your weapon and say yes, it will kill toadstools while autoexploring. This means no more "Really attack while wielding your bow?" prompts, and it also should obey no-attack/etc inscriptions. --- crawl-ref/source/fight.cc | 5 ++++- crawl-ref/source/fight.h | 1 + crawl-ref/source/travel.cc | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 3ddd3ba835..1543ddabb1 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -5670,7 +5670,7 @@ int melee_attack::mons_to_hit() /////////////////////////////////////////////////////////////////////////// -static bool wielded_weapon_check(const item_def *weapon) +bool wielded_weapon_check(item_def *weapon, bool no_message) { bool weapon_warning = false; bool unarmed_warning = false; @@ -5694,6 +5694,9 @@ static bool wielded_weapon_check(const item_def *weapon) if (!you.received_weapon_warning && !you.confused() && (weapon_warning || unarmed_warning)) { + if (no_message) + return (false); + std::string prompt = "Really attack while "; if (unarmed_warning) prompt += "being unarmed?"; diff --git a/crawl-ref/source/fight.h b/crawl-ref/source/fight.h index 70e29f2a02..2bc47bd030 100644 --- a/crawl-ref/source/fight.h +++ b/crawl-ref/source/fight.h @@ -60,6 +60,7 @@ bool monster_attack(monsters* attacker, bool allow_unarmed = true); bool monsters_fight(monsters* attacker, monsters* attacked, bool allow_unarmed = true); +bool wielded_weapon_check(item_def *weapon, bool no_message = false); int calc_your_to_hit(bool random_factor); int calc_heavy_armour_penalty(bool random_factor); diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 6da7bc6ee0..28b593d97a 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -24,6 +24,7 @@ #include "directn.h" #include "map_knowledge.h" #include "exclude.h" +#include "fight.h" #include "godabil.h" #include "itemname.h" #include "itemprop.h" @@ -2208,6 +2209,9 @@ static travel_target _prompt_travel_depth(const level_id &id, bool travel_kill_monster(const monsters * monster) { + if (!wielded_weapon_check(you.weapon(), true)) + return (false); + return (monster->type == MONS_TOADSTOOL); } -- cgit v1.2.3-54-g00ecf From 8ea088ee387d26e09048d47c0d105702ff47ca1e Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Fri, 25 Dec 2009 11:37:39 +1000 Subject: Add another missing include. --- crawl-ref/source/rltiles/tool/tile_colour.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/crawl-ref/source/rltiles/tool/tile_colour.cc b/crawl-ref/source/rltiles/tool/tile_colour.cc index 2f098b387b..b5569ee073 100644 --- a/crawl-ref/source/rltiles/tool/tile_colour.cc +++ b/crawl-ref/source/rltiles/tool/tile_colour.cc @@ -1,4 +1,5 @@ #include "tile_colour.h" +#include #include #include #include -- cgit v1.2.3-54-g00ecf From 750012d6a9fc992d5651acd58a4eaff69dac106c Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Fri, 25 Dec 2009 02:42:20 +0100 Subject: Remove an empty typedef. --- crawl-ref/source/rltiles/tiledef_defines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl-ref/source/rltiles/tiledef_defines.h b/crawl-ref/source/rltiles/tiledef_defines.h index 238afd682b..32a8df946c 100644 --- a/crawl-ref/source/rltiles/tiledef_defines.h +++ b/crawl-ref/source/rltiles/tiledef_defines.h @@ -48,7 +48,7 @@ typedef unsigned int (tile_count_func)(unsigned int); typedef const char *(tile_name_func)(unsigned int); typedef tile_info &(tile_info_func)(unsigned int); -typedef struct tile_variation +struct tile_variation { tile_variation(int i, int c) : idx(i), col(c) { } int idx; -- cgit v1.2.3-54-g00ecf From e711d4b1bb15d82886af6fbf557d63e74f2b5fd0 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Fri, 25 Dec 2009 13:22:48 +1000 Subject: A start at a dLua spells library. Provides wrappers for non-player Toxic Radiance and Ozocubu's Refrigeration. These are basically just an adjustment of kill categories and messages to allow them to be used as background effects in WizLabs (Ozocubu's and Olgreb's). Hopefully a wrapper for monster (and possibly player)-cast bolt structures can also be included, which could then be accessed with the (planned) Lua traps functionality. --- crawl-ref/source/dlua.cc | 1 + crawl-ref/source/l_feat.cc | 2 +- crawl-ref/source/l_libs.h | 1 + crawl-ref/source/l_spells.cc | 30 ++++++++++++++++++++++++++++++ crawl-ref/source/makefile.obj | 1 + crawl-ref/source/spells2.cc | 31 +++++++++++++++++++++++-------- crawl-ref/source/spells2.h | 4 ++-- 7 files changed, 59 insertions(+), 11 deletions(-) create mode 100644 crawl-ref/source/l_spells.cc diff --git a/crawl-ref/source/dlua.cc b/crawl-ref/source/dlua.cc index dec579a9a1..218819a4d5 100644 --- a/crawl-ref/source/dlua.cc +++ b/crawl-ref/source/dlua.cc @@ -284,6 +284,7 @@ void init_dungeon_lua() luaL_openlib(dlua, "dgn", dgn_subvault_dlib, 0); luaL_openlib(dlua, "dgn", dgn_tile_dlib, 0); luaL_openlib(dlua, "feat", feat_dlib, 0); + luaL_openlib(dlua, "spells", spells_dlib, 0); luaL_openlib(dlua, "debug", debug_dlib, 0); luaL_openlib(dlua, "los", los_dlib, 0); diff --git a/crawl-ref/source/l_feat.cc b/crawl-ref/source/l_feat.cc index a9ae861a14..00529c11dc 100644 --- a/crawl-ref/source/l_feat.cc +++ b/crawl-ref/source/l_feat.cc @@ -1,5 +1,5 @@ /* - * File: l_featfeat.cc + * File: l_feat.cc * Summary: Boolean feat-related functions lua library "feat". */ diff --git a/crawl-ref/source/l_libs.h b/crawl-ref/source/l_libs.h index 0d7484fe75..d09434be0c 100644 --- a/crawl-ref/source/l_libs.h +++ b/crawl-ref/source/l_libs.h @@ -51,6 +51,7 @@ extern const struct luaL_reg dgn_mons_dlib[]; extern const struct luaL_reg dgn_subvault_dlib[]; extern const struct luaL_reg dgn_tile_dlib[]; extern const struct luaL_reg feat_dlib[]; +extern const struct luaL_reg spells_dlib[]; extern const struct luaL_reg los_dlib[]; extern const struct luaL_reg mapmarker_dlib[]; diff --git a/crawl-ref/source/l_spells.cc b/crawl-ref/source/l_spells.cc new file mode 100644 index 0000000000..8e5c2feffa --- /dev/null +++ b/crawl-ref/source/l_spells.cc @@ -0,0 +1,30 @@ +/* + * File: l_spells.cc + * Summary: Boolean feat-related functions lua library "feat". + */ + +#include "AppHdr.h" + +#include "clua.h" +#include "cluautil.h" +#include "l_libs.h" + +#include "coord.h" +#include "dungeon.h" +#include "env.h" +#include "spells1.h" +#include "spells2.h" +#include "spells3.h" +#include "spells4.h" +#include "terrain.h" + +LUAWRAP(_refrigeration, cast_refrigeration(luaL_checkint(ls, 1), true)) +LUAWRAP(_toxic_radiance, cast_toxic_radiance(true)) + +const struct luaL_reg spells_dlib[] = +{ +{ "refrigeration", _refrigeration }, +{ "toxic_radiance", _toxic_radiance }, +{ NULL, NULL } +}; + diff --git a/crawl-ref/source/makefile.obj b/crawl-ref/source/makefile.obj index fd38cf9783..8761eb11e7 100644 --- a/crawl-ref/source/makefile.obj +++ b/crawl-ref/source/makefile.obj @@ -79,6 +79,7 @@ l_mapmrk.o \ l_moninf.o \ l_mons.o \ l_option.o \ +l_spells.o \ l_subvault.o \ l_travel.o \ l_view.o \ diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index b4e15848b8..4902786aa6 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -625,9 +625,12 @@ static std::string _describe_monsters(const counted_monster_list &list) // Poisonous light passes right through invisible players // and monsters, and so, they are unaffected by this spell -- // assumes only you can cast this spell (or would want to). -void cast_toxic_radiance() +void cast_toxic_radiance(bool non_player) { - mpr("You radiate a sickly green light!"); + if (non_player) + mpr("The air is filled with a sickly green light!"); + else + mpr("You radiate a sickly green light!"); flash_view(GREEN); more(); @@ -655,10 +658,13 @@ void cast_toxic_radiance() // this check should not be !monster->invisible(). if (!mi->has_ench(ENCH_INVIS)) { + kill_category kc = KC_YOU; + if (non_player) + kc = KC_OTHER; bool affected = - poison_monster(*mi, KC_YOU, 1, false, false); + poison_monster(*mi, kc, 1, false, false); - if (coinflip() && poison_monster(*mi, KC_YOU, false, false)) + if (coinflip() && poison_monster(*mi, kc, false, false)) affected = true; if (affected) @@ -685,14 +691,20 @@ void cast_toxic_radiance() { // Exclamation mark to suggest that a lot of creatures were // affected. - mpr("The monsters around you are poisoned!"); + if (non_player) + mpr("Nearby monsters are poisoned!"); + else + mpr("The monsters around you are poisoned!"); } } } -void cast_refrigeration(int pow) +void cast_refrigeration(int pow, bool non_player) { - mpr("The heat is drained from your surroundings."); + if (non_player) + mpr("Something drains the heat from around you."); + else + mpr("The heat is drained from your surroundings."); flash_view(LIGHTCYAN); more(); @@ -752,7 +764,10 @@ void cast_refrigeration(int pow) // Calculate damage and apply. int hurt = mons_adjust_flavoured(*mi, beam, dam_dice.roll()); - mi->hurt(&you, hurt, BEAM_COLD); + if (non_player) + mi->hurt(NULL, hurt, BEAM_COLD); + else + mi->hurt(&you, hurt, BEAM_COLD); // Cold-blooded creatures can be slowed. if (mi->alive() diff --git a/crawl-ref/source/spells2.h b/crawl-ref/source/spells2.h index c85b9ea605..64349079de 100644 --- a/crawl-ref/source/spells2.h +++ b/crawl-ref/source/spells2.h @@ -24,8 +24,8 @@ bool vampiric_drain(int pow, const dist &vmove); int detect_creatures(int pow, bool telepathic = false); int detect_items(int pow); int detect_traps(int pow); -void cast_refrigeration(int pow); -void cast_toxic_radiance(void); +void cast_refrigeration(int pow, bool non_player = false); +void cast_toxic_radiance(bool non_player = false); void drain_life(int pow); bool restore_stat(unsigned char which_stat, unsigned char stat_gain, -- cgit v1.2.3-54-g00ecf From 214c798064a28a48126a6faf487303fab25b2dd7 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Fri, 25 Dec 2009 11:36:22 +0100 Subject: Add new inventory menu type for item knowledge. This means the knowledge menu is not affected by the main inventory sort options. In particular, this fixes item knowledge sort order breaking down once you know a lot of items of a given type. --- crawl-ref/source/enum.h | 4 ++-- crawl-ref/source/initfile.cc | 3 ++- crawl-ref/source/itemname.cc | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 322a67c270..61dbeb3b2f 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -1590,8 +1590,8 @@ enum menu_type MT_INVLIST, // List inventory MT_DROP, - - MT_PICKUP + MT_PICKUP, + MT_KNOW }; enum mon_holy_type diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index 396f217e40..529cbf4b04 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -4038,7 +4038,8 @@ void menu_sort_condition::set_menu_type(std::string &s) { "any:", MT_ANY }, { "inv:", MT_INVLIST }, { "drop:", MT_DROP }, - { "pickup:", MT_PICKUP } + { "pickup:", MT_PICKUP }, + { "know:", MT_KNOW } }; for (unsigned mi = 0; mi < ARRAYSZ(menu_type_map); ++mi) diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index ee2e39b4b5..8d487d2682 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -1978,6 +1978,7 @@ bool check_item_knowledge(bool quiet) InvMenu menu; menu.set_title("You recognise:"); menu.set_flags(MF_NOSELECT); + menu.set_type(MT_KNOW); menu.load_items(items, discoveries_item_mangle); menu.show(); redraw_screen(); -- cgit v1.2.3-54-g00ecf From cff43655c657b8ce52e2710cff321b49f05eeea5 Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Fri, 25 Dec 2009 16:18:47 +0530 Subject: Fix util.append (due). --- crawl-ref/source/dat/clua/util.lua | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/crawl-ref/source/dat/clua/util.lua b/crawl-ref/source/dat/clua/util.lua index 5ef063d9fb..d6e842fa7e 100644 --- a/crawl-ref/source/dat/clua/util.lua +++ b/crawl-ref/source/dat/clua/util.lua @@ -86,18 +86,12 @@ function util.set(list) end -- Appends the elements in any number of additional tables to the first table. -function util.append(table, ...) - local res = table +function util.append(first, ...) + local res = first local tables = { ... } - if #tables == 0 then - return res - elseif #tables == 1 and #res == 0 then - return tables[1] - else - for _, tab in ipairs(tables) do - for _, val in ipairs(tab) do - table.insert(res, val) - end + for _, tab in ipairs(tables) do + for _, val in ipairs(tab) do + table.insert(res, val) end end return res -- cgit v1.2.3-54-g00ecf From cff7a75e11416d6441b23bd905514c980362d7e8 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Fri, 25 Dec 2009 13:01:02 +0100 Subject: Credit player with kills by reflection. The player now gains experience both for player-thrown beams that are reflected by monsters, and monster-thrown beams reflected by the player. I assume not giving experience wasn't by design. --- crawl-ref/source/beam.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index f2e247b4b8..dc2c669e3f 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -5052,7 +5052,12 @@ void bolt::affect_monster(monsters* mon) corpse = monster_die(mon, KILL_MON, beam_source_as_target()); } else - corpse = monster_die(mon, thrower, beam_source_as_target()); + { + killer_type killer = thrower; + if (!YOU_KILL(thrower) && reflector == NON_MONSTER) + killer = KILL_YOU_MISSILE; + corpse = monster_die(mon, killer, beam_source_as_target()); + } } // Give the callbacks a dead-but-valid monster object. -- cgit v1.2.3-54-g00ecf From 30983439966314fc2afb1e9cbba07b710f6c9e3a Mon Sep 17 00:00:00 2001 From: Johanna Ploog Date: Sat, 26 Dec 2009 01:15:05 +0100 Subject: Add tiles for animated statues wielding bow, axe, mace, ... Hope these are okay, more can be added if needed. :) --- .../source/rltiles/dc-mon/statues/statue_archer.png | Bin 0 -> 996 bytes crawl-ref/source/rltiles/dc-mon/statues/statue_axe.png | Bin 0 -> 1026 bytes crawl-ref/source/rltiles/dc-mon/statues/statue_base.png | Bin 0 -> 922 bytes .../source/rltiles/dc-mon/statues/statue_crossbow.png | Bin 0 -> 1104 bytes crawl-ref/source/rltiles/dc-mon/statues/statue_mace.png | Bin 0 -> 979 bytes crawl-ref/source/rltiles/dc-mon/statues/statue_mage.png | Bin 0 -> 975 bytes .../source/rltiles/dc-mon/statues/statue_scythe.png | Bin 0 -> 1008 bytes crawl-ref/source/rltiles/dc-mon/statues/statue_sword.png | Bin 0 -> 993 bytes 8 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 crawl-ref/source/rltiles/dc-mon/statues/statue_archer.png create mode 100644 crawl-ref/source/rltiles/dc-mon/statues/statue_axe.png create mode 100644 crawl-ref/source/rltiles/dc-mon/statues/statue_base.png create mode 100644 crawl-ref/source/rltiles/dc-mon/statues/statue_crossbow.png create mode 100644 crawl-ref/source/rltiles/dc-mon/statues/statue_mace.png create mode 100644 crawl-ref/source/rltiles/dc-mon/statues/statue_mage.png create mode 100644 crawl-ref/source/rltiles/dc-mon/statues/statue_scythe.png create mode 100644 crawl-ref/source/rltiles/dc-mon/statues/statue_sword.png diff --git a/crawl-ref/source/rltiles/dc-mon/statues/statue_archer.png b/crawl-ref/source/rltiles/dc-mon/statues/statue_archer.png new file mode 100644 index 0000000000..0358366f7c Binary files /dev/null and b/crawl-ref/source/rltiles/dc-mon/statues/statue_archer.png differ diff --git a/crawl-ref/source/rltiles/dc-mon/statues/statue_axe.png b/crawl-ref/source/rltiles/dc-mon/statues/statue_axe.png new file mode 100644 index 0000000000..795928ef22 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-mon/statues/statue_axe.png differ diff --git a/crawl-ref/source/rltiles/dc-mon/statues/statue_base.png b/crawl-ref/source/rltiles/dc-mon/statues/statue_base.png new file mode 100644 index 0000000000..41f174dfdd Binary files /dev/null and b/crawl-ref/source/rltiles/dc-mon/statues/statue_base.png differ diff --git a/crawl-ref/source/rltiles/dc-mon/statues/statue_crossbow.png b/crawl-ref/source/rltiles/dc-mon/statues/statue_crossbow.png new file mode 100644 index 0000000000..80fa73380d Binary files /dev/null and b/crawl-ref/source/rltiles/dc-mon/statues/statue_crossbow.png differ diff --git a/crawl-ref/source/rltiles/dc-mon/statues/statue_mace.png b/crawl-ref/source/rltiles/dc-mon/statues/statue_mace.png new file mode 100644 index 0000000000..c74efdd79e Binary files /dev/null and b/crawl-ref/source/rltiles/dc-mon/statues/statue_mace.png differ diff --git a/crawl-ref/source/rltiles/dc-mon/statues/statue_mage.png b/crawl-ref/source/rltiles/dc-mon/statues/statue_mage.png new file mode 100644 index 0000000000..bc709937e2 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-mon/statues/statue_mage.png differ diff --git a/crawl-ref/source/rltiles/dc-mon/statues/statue_scythe.png b/crawl-ref/source/rltiles/dc-mon/statues/statue_scythe.png new file mode 100644 index 0000000000..19ab6410ce Binary files /dev/null and b/crawl-ref/source/rltiles/dc-mon/statues/statue_scythe.png differ diff --git a/crawl-ref/source/rltiles/dc-mon/statues/statue_sword.png b/crawl-ref/source/rltiles/dc-mon/statues/statue_sword.png new file mode 100644 index 0000000000..6a8c005184 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-mon/statues/statue_sword.png differ -- cgit v1.2.3-54-g00ecf From b4730459f0f395ae28bd58e8b44980907d3a3187 Mon Sep 17 00:00:00 2001 From: Johanna Ploog Date: Sat, 26 Dec 2009 01:26:15 +0100 Subject: Move other statue tiles into the new dc-mon/statues folder. --- crawl-ref/source/rltiles/dc-mon.txt | 3 ++- crawl-ref/source/rltiles/dc-mon/ice_statue.png | Bin 695 -> 0 bytes crawl-ref/source/rltiles/dc-mon/orange_crystal_statue.png | Bin 694 -> 0 bytes crawl-ref/source/rltiles/dc-mon/silver_statue.png | Bin 690 -> 0 bytes crawl-ref/source/rltiles/dc-mon/statues/ice_statue.png | Bin 0 -> 695 bytes .../rltiles/dc-mon/statues/orange_crystal_statue.png | Bin 0 -> 694 bytes crawl-ref/source/rltiles/dc-mon/statues/silver_statue.png | Bin 0 -> 690 bytes 7 files changed, 2 insertions(+), 1 deletion(-) delete mode 100644 crawl-ref/source/rltiles/dc-mon/ice_statue.png delete mode 100644 crawl-ref/source/rltiles/dc-mon/orange_crystal_statue.png delete mode 100644 crawl-ref/source/rltiles/dc-mon/silver_statue.png create mode 100644 crawl-ref/source/rltiles/dc-mon/statues/ice_statue.png create mode 100644 crawl-ref/source/rltiles/dc-mon/statues/orange_crystal_statue.png create mode 100644 crawl-ref/source/rltiles/dc-mon/statues/silver_statue.png diff --git a/crawl-ref/source/rltiles/dc-mon.txt b/crawl-ref/source/rltiles/dc-mon.txt index 6809b0cd93..18a2dc86b1 100644 --- a/crawl-ref/source/rltiles/dc-mon.txt +++ b/crawl-ref/source/rltiles/dc-mon.txt @@ -283,12 +283,13 @@ wood_golem MONS_WOOD_GOLEM ## Statues (also '8') %sdir dc-mon/unique roxanne MONS_ROXANNE -%sdir dc-mon +%sdir dc-mon/statues ice_statue MONS_ICE_STATUE silver_statue MONS_SILVER_STATUE orange_crystal_statue MONS_ORANGE_CRYSTAL_STATUE ## Gargoyles ('9') +%sdir dc-mon gargoyle MONS_GARGOYLE metal_gargoyle MONS_METAL_GARGOYLE molten_gargoyle MONS_MOLTEN_GARGOYLE diff --git a/crawl-ref/source/rltiles/dc-mon/ice_statue.png b/crawl-ref/source/rltiles/dc-mon/ice_statue.png deleted file mode 100644 index fa946250bd..0000000000 Binary files a/crawl-ref/source/rltiles/dc-mon/ice_statue.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-mon/orange_crystal_statue.png b/crawl-ref/source/rltiles/dc-mon/orange_crystal_statue.png deleted file mode 100644 index 04cdce0087..0000000000 Binary files a/crawl-ref/source/rltiles/dc-mon/orange_crystal_statue.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-mon/silver_statue.png b/crawl-ref/source/rltiles/dc-mon/silver_statue.png deleted file mode 100644 index ccd5986f35..0000000000 Binary files a/crawl-ref/source/rltiles/dc-mon/silver_statue.png and /dev/null differ diff --git a/crawl-ref/source/rltiles/dc-mon/statues/ice_statue.png b/crawl-ref/source/rltiles/dc-mon/statues/ice_statue.png new file mode 100644 index 0000000000..fa946250bd Binary files /dev/null and b/crawl-ref/source/rltiles/dc-mon/statues/ice_statue.png differ diff --git a/crawl-ref/source/rltiles/dc-mon/statues/orange_crystal_statue.png b/crawl-ref/source/rltiles/dc-mon/statues/orange_crystal_statue.png new file mode 100644 index 0000000000..04cdce0087 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-mon/statues/orange_crystal_statue.png differ diff --git a/crawl-ref/source/rltiles/dc-mon/statues/silver_statue.png b/crawl-ref/source/rltiles/dc-mon/statues/silver_statue.png new file mode 100644 index 0000000000..ccd5986f35 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-mon/statues/silver_statue.png differ -- cgit v1.2.3-54-g00ecf From 43719e94ae7cfb7d5bf0dc8852402124f0ad1333 Mon Sep 17 00:00:00 2001 From: Johanna Ploog Date: Sat, 26 Dec 2009 01:35:29 +0100 Subject: Display Crazy Yiuf's tile with the wielded weapon. --- crawl-ref/source/tilemcache.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/crawl-ref/source/tilemcache.cc b/crawl-ref/source/tilemcache.cc index 2a6ff9f6f8..3597fc9e3d 100644 --- a/crawl-ref/source/tilemcache.cc +++ b/crawl-ref/source/tilemcache.cc @@ -369,6 +369,7 @@ bool mcache_monster::get_weapon_offset(int mon_tile, int &ofs_x, int &ofs_y) // Shift upwards. case TILEP_MONS_GNOLL: case TILEP_MONS_GRUM: + case TILEP_MONS_CRAZY_YIUF: case TILEP_MONS_DEEP_ELF_DEATH_MAGE: ofs_x = -1; ofs_y = 0; -- cgit v1.2.3-54-g00ecf From 1c6fbd31a13a5c3bb8ef2b08bd2851d77f1ea598 Mon Sep 17 00:00:00 2001 From: Johanna Ploog Date: Sat, 26 Dec 2009 01:38:35 +0100 Subject: Make wizard heal clear the misled effect. --- crawl-ref/source/wiz-you.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crawl-ref/source/wiz-you.cc b/crawl-ref/source/wiz-you.cc index 48fdeddba8..cf570e928f 100644 --- a/crawl-ref/source/wiz-you.cc +++ b/crawl-ref/source/wiz-you.cc @@ -210,7 +210,8 @@ void wizard_heal(bool super_heal) // Clear most status ailments. you.rotting = 0; you.disease = 0; - you.duration[DUR_CONF] = 0; + you.duration[DUR_CONF] = 0; + you.duration[DUR_MISLED] = 0; you.duration[DUR_POISONING] = 0; set_hp(you.hp_max, false); set_mp(you.max_magic_points, false); -- cgit v1.2.3-54-g00ecf From 16b3fe2aa3157b62e00c839c93fae2e692ad3ee4 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sat, 26 Dec 2009 10:55:28 +1000 Subject: Rename a shadowed variable. --- crawl-ref/source/beam.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index dc2c669e3f..2888e091c0 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -5053,10 +5053,10 @@ void bolt::affect_monster(monsters* mon) } else { - killer_type killer = thrower; + killer_type ref_killer = thrower; if (!YOU_KILL(thrower) && reflector == NON_MONSTER) - killer = KILL_YOU_MISSILE; - corpse = monster_die(mon, killer, beam_source_as_target()); + ref_killer = KILL_YOU_MISSILE; + corpse = monster_die(mon, ref_killer, beam_source_as_target()); } } -- cgit v1.2.3-54-g00ecf From 98a4866e0c628757d9137e171b502fd7193f10c3 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sat, 26 Dec 2009 12:49:25 +1000 Subject: Deal with summoned player ghost milestones (N78291, pointless) Hopefully this is the last of them. Summoned ghosts shouldn't be treated as milestones, especially as, when they time out, it gives a "banished XYZ's ghost" milestone. --- crawl-ref/source/mon-stuff.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc index add22f09c5..e746fd5d07 100644 --- a/crawl-ref/source/mon-stuff.cc +++ b/crawl-ref/source/mon-stuff.cc @@ -533,7 +533,7 @@ static void _check_kill_milestone(const monsters *mons, if (mons->props.exists("original_was_unique")) is_unique = mons->props["original_was_unique"].get_bool(); - if (mons->type == MONS_PLAYER_GHOST) + if (mons->type == MONS_PLAYER_GHOST && !mons->is_summoned()) { std::string milestone = _milestone_kill_verb(killer) + "the ghost of "; milestone += get_ghost_description(*mons, true); -- cgit v1.2.3-54-g00ecf From 9db07b06e8c59d76596875751e239e5fff4ac50e Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sat, 26 Dec 2009 12:50:09 +1000 Subject: Tweak Mara's depth and stats. After watching some people fight against him on CDO, I've reduced his magic resistance as HD adjusts this considerably (giving him an MR of around 260) to around 210. His HP and HD remain the same, but I've also reduced AC and EV back to those of a normal Rakshasa. (10 and 14 respectively). I've also increased his depth to 22-27 and tweaked the EXP modifier slightly (though this may be too much and require adjusting back down in future). --- crawl-ref/source/dat/uniques.des | 2 +- crawl-ref/source/mon-data.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crawl-ref/source/dat/uniques.des b/crawl-ref/source/dat/uniques.des index 365d66e8eb..851b3fb320 100644 --- a/crawl-ref/source/dat/uniques.des +++ b/crawl-ref/source/dat/uniques.des @@ -216,7 +216,7 @@ DEPTH: 14-16 : place_unique(_G, "Maud") NAME: uniq_mara -DEPTH: 20-27, !Lair, !Slime +DEPTH: 22-27, !Lair, !Slime : place_unique(_G, "Mara") NAME: uniq_maurice diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h index c0c251c67b..4467317458 100644 --- a/crawl-ref/source/mon-data.h +++ b/crawl-ref/source/mon-data.h @@ -4676,10 +4676,10 @@ static monsterentry mondata[] = { MONS_MARA, 'R', LIGHTRED, "Mara", M_SPELLCASTER | M_SEE_INVIS | M_ACTUAL_SPELLS | M_SPEAKS | M_UNIQUE, MR_RES_POISON | MR_RES_ELEC, - 0, 15, MONS_RAKSHASA, MONS_RAKSHASA, MH_DEMONIC, -10, - { {AT_HIT, AF_PLAIN, 40}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, + 0, 20, MONS_RAKSHASA, MONS_RAKSHASA, MH_DEMONIC, -8, + { {AT_HIT, AF_PLAIN, 30}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, { 20, 0, 0, 140 }, - 15, 15, MST_MARA, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT, + 10, 14, MST_MARA, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT, I_HIGH, HT_LAND, FL_NONE, 10, DEFAULT_ENERGY, MONUSE_WEAPONS_ARMOUR, MONEAT_NOTHING, SIZE_MEDIUM }, @@ -4690,10 +4690,10 @@ static monsterentry mondata[] = { MONS_MARA_FAKE, 'R', LIGHTRED, "Mara", M_SPELLCASTER | M_SEE_INVIS | M_ACTUAL_SPELLS | M_SPEAKS, MR_RES_POISON | MR_RES_ELEC, - 0, 15, MONS_RAKSHASA_FAKE, MONS_RAKSHASA_FAKE, MH_DEMONIC, MAG_IMMUNE, - { {AT_HIT, AF_PLAIN, 40}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, + 0, 20, MONS_RAKSHASA_FAKE, MONS_RAKSHASA_FAKE, MH_DEMONIC, MAG_IMMUNE, + { {AT_HIT, AF_PLAIN, 30}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, { 20, 0, 0, 140 }, - 15, 15, MST_MARA_FAKE, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT, + 10, 14, MST_MARA_FAKE, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT, I_HIGH, HT_LAND, FL_NONE, 10, DEFAULT_ENERGY, MONUSE_WEAPONS_ARMOUR, MONEAT_NOTHING, SIZE_MEDIUM }, -- cgit v1.2.3-54-g00ecf From 0a55f4c9f2c0a4c004a1bd6d9a2385b61134c233 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sat, 26 Dec 2009 13:46:39 +1000 Subject: Auto-ID rods when wielded (cbus). --- crawl-ref/source/item_use.cc | 13 +++++++++++++ crawl-ref/source/spl-book.cc | 18 +----------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 691ffb0217..11c92d1fbe 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -517,6 +517,19 @@ void wield_effects(int item_wield_2, bool showMsgs) // Right now that's always "uncursed". -- bwr set_ident_flags(item, ISFLAG_KNOW_CURSE); } + // Automatically identify rods; you can do this by wielding and then + // evoking them, so do it automatically instead. We don't need to give + // a message either, as the game will do that automatically. {due} + if (item_is_rod(item)) + { + if (!item_type_known(item)) + { + set_ident_type( OBJ_STAVES, item.sub_type, ID_KNOWN_TYPE ); + set_ident_flags( item, ISFLAG_KNOW_TYPE ); + } + if (!item_ident( item, ISFLAG_KNOW_PLUSES)) + set_ident_flags( item, ISFLAG_KNOW_PLUSES ); + } break; } diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc index af1a551caa..66d9c9d194 100644 --- a/crawl-ref/source/spl-book.cc +++ b/crawl-ref/source/spl-book.cc @@ -1924,23 +1924,7 @@ int staff_spell( int staff ) return (-1); } - bool need_id = false; - if (!item_type_known(istaff)) - { - set_ident_type( OBJ_STAVES, istaff.sub_type, ID_KNOWN_TYPE ); - set_ident_flags( istaff, ISFLAG_KNOW_TYPE ); - need_id = true; - } - if (!item_ident( istaff, ISFLAG_KNOW_PLUSES)) - { - set_ident_flags( istaff, ISFLAG_KNOW_PLUSES ); - need_id = true; - } - if (need_id) - { - mprf(MSGCH_EQUIPMENT, "%s", istaff.name(DESC_INVENTORY_EQUIP).c_str()); - you.wield_change = true; - } + // ID code got moved to item_use::wield_effects. {due} const int num_spells = count_staff_spells(istaff, false); -- cgit v1.2.3-54-g00ecf From c124daef6c8b8535427ce56a0b419f3000fb774e Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sat, 26 Dec 2009 14:02:32 +1000 Subject: Some tweaks to Mu's elemental vault. --- crawl-ref/source/dat/float.des | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crawl-ref/source/dat/float.des b/crawl-ref/source/dat/float.des index 17f3cd4b58..493d018b9e 100644 --- a/crawl-ref/source/dat/float.des +++ b/crawl-ref/source/dat/float.des @@ -954,8 +954,10 @@ KMONS: Z = col:gila wizard hd:15 name_descriptor \ . dagger ego:freezing | dagger ego:flaming | \ dagger ego:electrocution : end -KITEM: B = any book -KITEM: | = staff of fire / staff of cold / staff of earth / staff of air +KITEM: B = randbook disc:air / randbook disc:fire / randbook disc:ice / \ + randbook disc:earth +KITEM: | = staff of fire / staff of cold / staff of earth / staff of air / \ + quarterstaff unrand:elemental_staff MAP ccccccccc ccE+'''cwcc -- cgit v1.2.3-54-g00ecf From 8238ce8d9d23dda0f7ec88bc297ea325070ff722 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 26 Dec 2009 02:18:50 -0600 Subject: clean up one more warning --- crawl-ref/source/initfile.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index 529cbf4b04..506e49c56e 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -3527,7 +3527,9 @@ static void _print_version() static void _print_save_version(char *name) { +#ifdef LOAD_UNPACKAGE_CMD bool need_unlink = false; +#endif std::string basename = get_savedir_filename(name, "", ""); std::string filename = basename + ".sav"; -- cgit v1.2.3-54-g00ecf From 0ede21ec50340b1249f9f9d75aac30605efd6e9f Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Sat, 26 Dec 2009 14:11:14 +0100 Subject: Broaden Agnes' range. --- crawl-ref/source/dat/uniques.des | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl-ref/source/dat/uniques.des b/crawl-ref/source/dat/uniques.des index 851b3fb320..0632db8edb 100644 --- a/crawl-ref/source/dat/uniques.des +++ b/crawl-ref/source/dat/uniques.des @@ -95,7 +95,7 @@ ENDMAP ################################################################################ NAME: uniq_agnes -DEPTH: 14-16, !Lair, !Slime +DEPTH: 12-18, !Lair, !Slime : place_unique(_G, "Agnes") NAME: uniq_aizul -- cgit v1.2.3-54-g00ecf From f0dccf90776fe087a34b22d04e7125b8ce3842fc Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Sat, 26 Dec 2009 18:58:53 +0530 Subject: Experimental changes to Shoals level generation. Use more random Shoal island generation. Still needs work on placing Shoal:$ huts correctly and connectivity fixes. --- crawl-ref/source/dungeon.cc | 394 +++++++++++++++++--------------------------- 1 file changed, 149 insertions(+), 245 deletions(-) diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index bef185979e..c7b1f9c88d 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -13,6 +13,7 @@ #include #include #include +#include #include "abyss.h" #include "artefact.h" @@ -1104,8 +1105,7 @@ static void _build_layout_skeleton(int level_number, int level_type, if (!dgn_level_vetoed && skip_build == BUILD_CONTINUE) { - if (!player_in_branch(BRANCH_SHOALS)) - skip_build = _builder_basic(level_number); + skip_build = _builder_basic(level_number); if (!dgn_level_vetoed && skip_build == BUILD_CONTINUE) _builder_extras(level_number, level_type); } @@ -1798,8 +1798,6 @@ static void _build_dungeon_level(int level_number, int level_type) // Time to make the swamp or shoals {dlb}: if (player_in_branch(BRANCH_SWAMP)) _prepare_swamp(); - else if (player_in_branch(BRANCH_SHOALS)) - _prepare_shoals(level_number); if (dgn_level_vetoed) return; @@ -2003,19 +2001,6 @@ static void _hide_doors() } } -// Places a randomised ellipse with centre (x, y) and half axes a and b. -static void _place_ellipse(int x, int y, int a, int b, - dungeon_feature_type feat, int margin) -{ - for (int i = std::max(x-a, margin); i < std::min(x+a, GXM-margin); ++i) - for (int j = std::max(y-b, margin); j < std::min(y+b, GYM-margin); ++j) - if ( (x-i)*(x-i)*b*b + (y-j)*(y-j)*a*a - <= a*a*b*b/2 + roll_dice(2, a*a*b*b)/4 + random2(3) ) - { - grd[i][j] = feat; - } -} - int count_feature_in_box(int x0, int y0, int x1, int y1, dungeon_feature_type feat) { @@ -2042,18 +2027,6 @@ int count_neighbours(int x, int y, dungeon_feature_type feat) return count_feature_in_box(x-1, y-1, x+2, y+2, feat); } -static void _replace_in_grid(int x1, int y1, int x2, int y2, - dungeon_feature_type oldfeat, - dungeon_feature_type newfeat) -{ - for (int x = x1; x < x2; ++x) - for (int y = y1; y < y2; ++y) - { - if (grd[x][y] == oldfeat) - grd[x][y] = newfeat; - } -} - static void _connected_flood(int margin, int i, int j, bool taken[GXM][GYM]) { if (i < margin || i >= GXM - margin || j < margin || j >= GYM - margin @@ -2068,270 +2041,182 @@ static void _connected_flood(int margin, int i, int j, bool taken[GXM][GYM]) _connected_flood(margin, i + idelta, j + jdelta, taken); } -// Yes, yes, this can probably use travel to avoid duplicating code. -static int _count_connected(int margin) -{ - bool taken[GXM][GYM]; +static int _shoals_heights[GYM][GXM]; +static std::vector _shoals_islands; - for (int i = margin; i < GXM - margin; ++i) - for (int j = margin; j < GYM - margin; ++j) - taken[i][j] = feat_is_water(grd[i][j]); +const int ISLAND_COLLIDE_DIST2 = 5 * 5; +const int N_PERTURB_ISLAND_CENTER = 50; +const int ISLAND_CENTER_RADIUS_LOW = 3; +const int ISLAND_CENTER_RADIUS_HIGH = 10; - int count = 0; +const int N_PERTURB_OFFSET_LOW = 25; +const int N_PERTURB_OFFSET_HIGH = 45; +const int PERTURB_OFFSET_RADIUS_LOW = 2; +const int PERTURB_OFFSET_RADIUS_HIGH = 7; - for (int i = margin; i < GXM - margin; ++i) - for (int j = margin; j < GYM - margin; ++j) - if (!taken[i][j]) - { - ++count; - _connected_flood(margin,i,j,taken); - } +const int _shoals_margin = 6; - return count; +static void _shoals_init_heights() +{ + for (int y = 0; y < GYM; ++y) + for (int x = 0; x < GXM; ++x) + _shoals_heights[y][x] = -17; } -static void _place_base_islands(int margin, int num_islands, int estradius, - coord_def centres[10]) +static coord_def _random_point_from(const coord_def &c, int radius) { - for (int i = 0; i < num_islands; ++i) - { - // smaller axis - int b = (2 * estradius + roll_dice(3, estradius)) / 4; - b = std::max(b, 4); - b = std::min(b, (GYM - 2*margin - 2) / 2); - - int a = b + roll_dice(2, b)/3; // more wide than tall - a = std::min(a, (GXM - 2*margin - 2) / 2); - - int island_distance = estradius*estradius * (2 + num_islands/3); - - // Make sure an island fits into the map without getting - // cut off on the edges, i.e. leave margin + radius space - // at each side. - const int rnd_x_size = GXM - 2*(margin+a) - 1; - const int rnd_y_size = GYM - 2*(margin+b) - 1; - ASSERT(rnd_x_size > 0); - ASSERT(rnd_y_size > 0); - - bool centre_ok = false; - int tries = 1000; - do + while (true) { + const double angle = random2(360) * M_PI / 180; + coord_def res = c + coord_def(radius * cos(angle), radius * sin(angle)); + if (res.x >= _shoals_margin && res.x < GXM - _shoals_margin + && res.y >= _shoals_margin && res.y < GYM - _shoals_margin) { - centre_ok = true; - - centres[i].x = margin + a + random2(rnd_x_size); - centres[i].y = margin + b + random2(rnd_y_size); - - for (int j = 0; j < i; ++j) - { - // Calculate the distance from the centers of - // previous islands. - if (distance(centres[i].x, centres[i].y, - centres[j].x, centres[j].y) < island_distance) - { - centre_ok = false; - break; - } - } - if (island_distance && !one_chance_in(num_islands)) - --island_distance; + return res; } - while (!centre_ok && --tries > 0); - -#ifdef DEBUG_DIAGNOSTICS - if (tries == 0) - mprf(MSGCH_ERROR, "Failure to place island #%d!", i); -#endif - // Eventually, place an ellipse around the new coordinate. - _place_ellipse( centres[i].x, centres[i].y, a, b, DNGN_FLOOR, margin); } } -typedef std::pair located_feature; -typedef std::list located_feature_list; - -bool _is_critical_feature(dungeon_feature_type feat) -{ - return (feat == DNGN_ENTER_PORTAL_VAULT - || feat == DNGN_ENTER_LABYRINTH - || feat == DNGN_ENTER_SHOP); +static coord_def _random_point(int offset = 0) { + return coord_def(random_range(offset, GXM - offset - 1), + random_range(offset, GYM - offset - 1)); } -static located_feature_list _save_critical_features() +static void _shoals_island_center(const coord_def &c, int n_perturb, int radius, + int bounce_low, int bounce_high) { - located_feature_list result; - - for (rectangle_iterator ri(1); ri; ++ri) - if (_is_critical_feature(grd(*ri))) - result.push_back(located_feature(*ri, grd(*ri))); - - return result; + for (int i = 0; i < n_perturb; ++i) { + coord_def p = _random_point_from(c, random2(1 + radius)); + _shoals_heights[p.y][p.x] += random_range(bounce_low, bounce_high); + } } -static void _restore_critical_features(const located_feature_list& lfl) +static coord_def _shoals_pick_island_spot() { - for (located_feature_list::const_iterator ci = lfl.begin(); - ci != lfl.end(); ++ci) + coord_def c; + for (int i = 0; i < 15; ++i) { - grd(ci->first) = ci->second; + c = _random_point(_shoals_margin * 2); + + bool collides = false; + for (int j = 0, size = _shoals_islands.size(); j < size; ++j) + { + const coord_def island = _shoals_islands[j]; + const coord_def dist = island - c; + if (dist.abs() < ISLAND_COLLIDE_DIST2) + { + collides = true; + break; + } + } + if (!collides) + break; } + _shoals_islands.push_back(c); + return c; } -static void _prepare_shoals(int level_number) +static void _shoals_build_island() { - // Don't destroy portals, etc. - const located_feature_list lfl = _save_critical_features(); - - dgn_Build_Method += make_stringf(" shoals [%d]", level_number); - dgn_Layout_Type = "shoals"; - - // dpeg's algorithm. - // We could have just used spotty_level() and changed rock to - // water, but this is much cooler. Right? - const int margin = 6; + coord_def c = _shoals_pick_island_spot(); + _shoals_island_center(c, N_PERTURB_ISLAND_CENTER, + random_range(ISLAND_CENTER_RADIUS_LOW, + ISLAND_CENTER_RADIUS_HIGH), + 40, 60); + const int additional_heights = random2(4); + for (int i = 0; i < additional_heights; ++i) { + const int addition_offset = random_range(2, 10); - int num_islands = player_branch_depth() + 1; - - if (at_branch_bottom()) - num_islands += random2(3); + coord_def offsetC = _random_point_from(c, addition_offset); - const int estradius = 50 / num_islands - (num_islands == 2 ? 5 : 0); - - int num_tries = 0; - coord_def centres[10]; - do - { - for (int x = margin; x < GXM-margin; ++x) - for (int y = margin; y < GYM-margin; ++y) - grd[x][y] = DNGN_DEEP_WATER; - - _place_base_islands(margin, num_islands, estradius, centres); + _shoals_island_center(offsetC, random_range(N_PERTURB_OFFSET_LOW, + N_PERTURB_OFFSET_HIGH), + random_range(PERTURB_OFFSET_RADIUS_LOW, + PERTURB_OFFSET_RADIUS_HIGH), + 25, 35); } - while (++num_tries < 100 && _count_connected(margin) != num_islands); - -#ifdef DEBUG_DIAGNOSTICS - mprf(MSGCH_DIAGNOSTICS, "Num tries: %d Connected components: %d", - num_tries, _count_connected(margin)); -#endif - - // Adding shallow water at deep water adjacent to floor. - // Randomisation: place shallow water if at least 1d(1d3) floor neighbours - for (int i = margin; i < GXM - margin; ++i) - for (int j = margin; j < GYM - margin; ++j) - if (grd[i][j] == DNGN_DEEP_WATER - && count_neighbours(i, j, DNGN_FLOOR) > random2(random2(3)+1)) - { - grd[i][j] = DNGN_SHALLOW_WATER; - } - - // Placing sandbanks. - for (int banks = 0; banks < 8; ++banks) - { - int xsize = 3 + random2(3); // random rectangle - int ysize = 3 + random2(3); - int xb = margin + 2 + random2(GXM - 2 * margin - xsize - 2); - int yb = margin + 2 + random2(GYM - 2 * margin - ysize - 2); +} - bool ok_place = true; - for (int i = xb; i < xb + xsize; ++i) - for (int j = yb; j < yb + ysize; ++j) - { - if (grd[i][j] != DNGN_DEEP_WATER) - { - ok_place = false; - break; - } - } +static void _shoals_init_islands(int depth) +{ + const int nislands = 25 - depth * 3; + for (int i = 0; i < nislands; ++i) + _shoals_build_island(); +} - if (ok_place) - { - for (int i = xb; i < xb + xsize; ++i) - for (int j = yb; j < yb + ysize; ++j) - { - if (!one_chance_in(3)) - grd[i][j] = DNGN_SHALLOW_WATER; - } +static void _shoals_smooth_at(const coord_def &c, int radius) +{ + int max_delta = radius * radius * 2 + 2; + int divisor = 0; + int total = 0; + for (int y = c.y - radius; y <= c.y + radius; ++y) { + for (int x = c.x - radius; x <= c.x + radius; ++x) { + const coord_def p(x, y); + if (!in_bounds(p)) + continue; + const coord_def off = c - p; + int weight = max_delta - off.abs(); + divisor += weight; + total += _shoals_heights[p.y][p.x] * weight; } } + _shoals_heights[c.y][c.x] = total / divisor; +} - // Fractalisation - - // LAVA is a placeholder for cells which will become shallow water - // at the end of the current iteration. - // WATER_RESERVED is a placeholder for last iteration's generated water. - _replace_in_grid(margin, margin, GXM-margin, GYM-margin, - DNGN_SHALLOW_WATER, DNGN_WATER_RESERVED); - - for (int iteration = 0; iteration < 6; ++iteration) - { - for (int x = margin; x < GXM - margin; ++x) - for (int y = margin; y < GYM - margin; ++y) - if (grd[x][y] == DNGN_DEEP_WATER) - { - int badness = count_neighbours(x, y, DNGN_WATER_RESERVED); - if (random2(badness) >= 2 && coinflip()) - grd[x][y] = DNGN_LAVA; - } - - _replace_in_grid(margin, margin, GXM-margin, GYM-margin, - DNGN_LAVA, DNGN_WATER_RESERVED); - } - _replace_in_grid(margin, margin, GXM-margin, GYM-margin, - DNGN_WATER_RESERVED, DNGN_SHALLOW_WATER); +static void _shoals_smooth() +{ + for (int y = 0; y < GYM; ++y) + for (int x = 0; x < GXM; ++x) + _shoals_smooth_at(coord_def(x, y), 1); +} - // Turn rock walls into deep water and "open sea". This must happen - // before vaults are placed as those may contain rock as well. - const int margin2 = margin - 1; - _replace_in_grid(margin2, margin2, GXM-margin2, GYM-margin2, - DNGN_ROCK_WALL, DNGN_DEEP_WATER); +static dungeon_feature_type _shoals_feature_at(int x, int y) +{ + const int height = _shoals_heights[y][x]; + return height >= 0? DNGN_FLOOR : + height >= -14? DNGN_SHALLOW_WATER : DNGN_DEEP_WATER; +} - _replace_area(0, 0, GXM-1, GYM-1, DNGN_BUILDER_SPECIAL_WALL, - DNGN_ROCK_WALL); - _replace_area(0, 0, GXM-1, GYM-1, DNGN_ROCK_WALL, DNGN_OPEN_SEA); +static void _shoals_apply_level() +{ + for (int y = 1; y < GYM - 1; ++y) + for (int x = 1; x < GXM - 1; ++x) + grd[x][y] = _shoals_feature_at(x, y); +} - // Put important things back. - _restore_critical_features(lfl); +static coord_def _pick_shoals_island() +{ + const int lucky_island = random2(_shoals_islands.size()); + const coord_def c = _shoals_islands[lucky_island]; + _shoals_islands.erase(_shoals_islands.begin() + lucky_island); + return c; +} +static void _shoals_furniture(int margin) +{ if (at_branch_bottom()) { - // Find an island to place the stairs up on. - int j; - const coord_def d1(1,0), d2(-1,0); - for (j = 0; j < num_islands; ++j) - { - if (!_is_critical_feature(grd(centres[j])) - && !_is_critical_feature(grd(centres[j] + d1)) - && !_is_critical_feature(grd(centres[j] + d2))) - { - break; - } - } - if (j == num_islands) - { - // Oh well. - j = 0; - mprf(MSGCH_ERROR, "Clobbering critical features: %d %d %d.", - grd(centres[j]), grd(centres[j] + d1), grd(centres[j] + d2)); - } + const coord_def c = _pick_shoals_island(); // Put all the stairs on one island. - grd[centres[j].x ][centres[j].y] = DNGN_STONE_STAIRS_UP_I; - grd[centres[j].x+1][centres[j].y] = DNGN_STONE_STAIRS_UP_II; - grd[centres[j].x-1][centres[j].y] = DNGN_STONE_STAIRS_UP_III; + grd(c) = DNGN_STONE_STAIRS_UP_I; + grd(c + coord_def(1, 0)) = DNGN_STONE_STAIRS_UP_II; + grd(c - coord_def(1, 0)) = DNGN_STONE_STAIRS_UP_III; + const coord_def p = _pick_shoals_island(); // Place the rune const map_def *vault = random_map_for_tag("shoal_rune"); - _build_secondary_vault(level_number, vault, -1, false, true, - centres[1]); + _build_secondary_vault(you.your_level, vault, -1, false, true, + p); - for (int i = 2; i < num_islands; ++i) + const int nhuts = std::min(8, int(_shoals_islands.size())); + for (int i = 2; i < nhuts; ++i) { // Place (non-rune) minivaults on the other islands do vault = random_map_for_tag("shoal"); while (!vault); - _build_secondary_vault(level_number, vault, -1, false, true, - centres[i]); + _build_secondary_vault(you.your_level, vault, -1, false, true, + _pick_shoals_island()); } } else @@ -2361,6 +2246,22 @@ static void _prepare_shoals(int level_number) = static_cast(DNGN_STONE_STAIRS_UP_I + i); } } + +} + +static void _prepare_shoals(int level_number) +{ + dgn_Build_Method += make_stringf(" shoals+ [%d]", level_number); + dgn_Layout_Type = "shoals"; + + const int shoals_depth = level_id::current().depth - 1; + _replace_area(0, 0, GXM-1, GYM-1, DNGN_ROCK_WALL, DNGN_OPEN_SEA); + _shoals_init_heights(); + _shoals_islands.clear(); + _shoals_init_islands(shoals_depth); + _shoals_smooth(); + _shoals_apply_level(); + _shoals_furniture(6); } static void _prepare_swamp() @@ -2755,6 +2656,9 @@ static builder_rc_type _builder_by_branch(int level_number) spotty_level(false, iterations, false); return BUILD_SKIP; } + case BRANCH_SHOALS: + _prepare_shoals(level_number); + return BUILD_SKIP; default: break; -- cgit v1.2.3-54-g00ecf From 14da0d8a05d8f7ca55d05a198733e9abf82208f1 Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Sat, 26 Dec 2009 19:17:44 +0530 Subject: Tweak placement of rune hut on Shoal:$. --- crawl-ref/source/dungeon.cc | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index c7b1f9c88d..88fdbddc67 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -2191,6 +2191,30 @@ static coord_def _pick_shoals_island() return c; } +struct point_sort_distance_from +{ + coord_def bad_place; + point_sort_distance_from(coord_def c) : bad_place(c) { } + bool operator () (coord_def a, coord_def b) const + { + const int dista = (a - bad_place).abs(), distb = (b - bad_place).abs(); + return dista >= distb; + } +}; + +static coord_def _pick_shoals_island_distant_from(coord_def bad_place) +{ + ASSERT(!_shoals_islands.empty()); + + std::sort(_shoals_islands.begin(), _shoals_islands.end(), + point_sort_distance_from(bad_place)); + const int top_picks = std::min(4, int(_shoals_islands.size())); + const int choice = random2(top_picks); + coord_def chosen = _shoals_islands[choice]; + _shoals_islands.erase(_shoals_islands.begin() + choice); + return chosen; +} + static void _shoals_furniture(int margin) { if (at_branch_bottom()) @@ -2201,7 +2225,7 @@ static void _shoals_furniture(int margin) grd(c + coord_def(1, 0)) = DNGN_STONE_STAIRS_UP_II; grd(c - coord_def(1, 0)) = DNGN_STONE_STAIRS_UP_III; - const coord_def p = _pick_shoals_island(); + const coord_def p = _pick_shoals_island_distant_from(c); // Place the rune const map_def *vault = random_map_for_tag("shoal_rune"); _build_secondary_vault(you.your_level, vault, -1, false, true, -- cgit v1.2.3-54-g00ecf From 7024702fd974bd3e993eec789237df0d4d29d1df Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Sat, 26 Dec 2009 19:36:52 +0530 Subject: Adjust number of islands per Shoal level. --- crawl-ref/source/dungeon.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 88fdbddc67..a0100ed3aa 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -2138,7 +2138,7 @@ static void _shoals_build_island() static void _shoals_init_islands(int depth) { - const int nislands = 25 - depth * 3; + const int nislands = 20 - depth * 2; for (int i = 0; i < nislands; ++i) _shoals_build_island(); } -- cgit v1.2.3-54-g00ecf From e5e6474f335d47ce81f0d33d5adf95b4dd64ba46 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Sat, 26 Dec 2009 16:25:41 +0100 Subject: Deuglify a temple layout, now that we're not limited to 12 altars only. --- crawl-ref/source/dat/temple.des | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/crawl-ref/source/dat/temple.des b/crawl-ref/source/dat/temple.des index 78df580778..20902ec963 100644 --- a/crawl-ref/source/dat/temple.des +++ b/crawl-ref/source/dat/temple.des @@ -1000,14 +1000,16 @@ WEIGHT: 5 SHUFFLE: {([ MAP bbbbb + b...b + b.(.b bbbbb...bbbbb - b...b.(.b...b + b...bb.bb...b b.B.......B.b - bbbbb...bbbbb...bbbbb - b...bb.bbbbbbbbbb...b -bbbbb.{.b...bbbbb.....[.bbbbb -b...b...b.B.......B.b...b...b -b.B....bb...b...b...bb....B.b + bbbbb...b...b...bbbbb + b...bb.bb.B.bbbbb...b +bbbbb.{.b...b...b.....[.bbbbb +b...b...b.B.bbbbb.B.b...b...b +b.B....bb...........bb....B.b b...b...bbbbb.B.bbbbb...b...b bbbbb.B....bb...bb....B.bbbbb b...b...bbbbb...b...b -- cgit v1.2.3-54-g00ecf From 414b1c3e9ebefcc08531c15a2f3aa53fedcb31ef Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Sat, 26 Dec 2009 16:39:47 +0100 Subject: Revert beams to not affect the source cell. The change was originally done to allow hostile oklobs to target the player if he happens to be standing in the same cell, but they appear to do that successfully regardless. Fixes issue #133, issue #246. --- crawl-ref/source/beam.cc | 50 ++++++++++++++---------------------------------- crawl-ref/source/beam.h | 2 +- 2 files changed, 15 insertions(+), 37 deletions(-) diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 2888e091c0..cdeefc8204 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -1995,7 +1995,7 @@ bool bolt::hit_wall() return (false); } -void bolt::affect_cell(bool avoid_self) +void bolt::affect_cell() { // Shooting through clouds affects accuracy. if (env.cgrid(pos()) != EMPTY_CLOUD) @@ -2006,25 +2006,14 @@ void bolt::affect_cell(bool avoid_self) const coord_def old_pos = pos(); const bool was_solid = feat_is_solid(grd(pos())); - bool avoid_monster = false; - bool avoid_player = false; - - if (avoid_self) - { - if (YOU_KILL(thrower)) - avoid_player = true; - else if (MON_KILL(thrower)) - avoid_monster = true; - } - if (was_solid) { // Some special casing. if (monsters* mon = monster_at(pos())) { - if (can_affect_wall_monster(mon) && !avoid_monster) + if (can_affect_wall_monster(mon)) affect_monster(mon); - else if (!avoid_monster) + else { mprf("The %s protects %s from harm.", raw_feature_description(grd(mon->pos())).c_str(), @@ -2040,26 +2029,19 @@ void bolt::affect_cell(bool avoid_self) return; } - const bool still_wall = (was_solid && old_pos == pos()); - - bool hit_player = false; // If the player can ever walk through walls, this will need // special-casing too. - if (found_player() && !avoid_player) - { + bool hit_player = found_player(); + if (hit_player) affect_player(); - hit_player = true; - } - // We don't want to hit a monster in a wall square twice. Also, + // We don't want to hit a monster in a wall square twice. Also, // stop single target beams from affecting a monster if they already // affected the player on this square. -cao - if ((!hit_player || is_beam || is_explosion) - && !still_wall && !avoid_monster) - { - if (monsters* m = monster_at(pos()) ) + const bool still_wall = (was_solid && old_pos == pos()); + if ((!hit_player || is_beam || is_explosion) && !still_wall) + if (monsters* m = monster_at(pos())) affect_monster(m); - } if (!feat_is_solid(grd(pos()))) affect_ground(); @@ -2167,12 +2149,12 @@ void bolt::do_fire() } #endif - bool avoid_self = (!aimed_at_feet && (!is_explosion || !in_explosion_phase)); - msg_generated = false; if (!aimed_at_feet) { choose_ray(); + // Take *one* step, so as not to hurt the source. + ray.advance(); } #if defined(TARGET_OS_WINDOWS) && !defined(USE_TILE) @@ -2187,11 +2169,9 @@ void bolt::do_fire() path_taken.push_back(pos()); if (!affects_nothing) - affect_cell(avoid_self); - - if (!avoid_self) - range_used++; + affect_cell(); + range_used++; if (range_used >= range) break; @@ -2205,7 +2185,7 @@ void bolt::do_fire() break; } - ASSERT((!feat_is_solid(grd(pos())) || avoid_self) + ASSERT(!feat_is_solid(grd(pos())) || is_tracer && affects_wall(grd(pos()))); const bool was_seen = seen; @@ -2228,8 +2208,6 @@ void bolt::do_fire() draw(pos()); ray.advance(); - - avoid_self = false; } if (!map_bounds(pos())) diff --git a/crawl-ref/source/beam.h b/crawl-ref/source/beam.h index aad832b574..61f5640d07 100644 --- a/crawl-ref/source/beam.h +++ b/crawl-ref/source/beam.h @@ -232,7 +232,7 @@ private: // operate on the beam's current position (i.e., whatever pos() // returns.) public: - void affect_cell(bool avoid_self = false); + void affect_cell(); void affect_wall(); void affect_monster( monsters* m ); void affect_player(); -- cgit v1.2.3-54-g00ecf From 4a400aebb95684b1bd34e4ba3bad609548ff6671 Mon Sep 17 00:00:00 2001 From: Johanna Ploog Date: Sat, 26 Dec 2009 16:42:42 +0100 Subject: Include all monsters containing the word "statue" in the autoexclude list. This is better than listing all the names used for vault modified statue names. Granite statues are no monsters, so that isn't an issue, either. --- crawl-ref/settings/init.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crawl-ref/settings/init.txt b/crawl-ref/settings/init.txt index 49524d2ae7..795c463a43 100644 --- a/crawl-ref/settings/init.txt +++ b/crawl-ref/settings/init.txt @@ -165,8 +165,7 @@ drop_filter = useless_item # explore_improved = true # # explore_stop_pickup_ignore = curare -auto_exclude = oklob plant,silver statue,orange crystal statue,ice statue -auto_exclude = curse skull,roxanne +auto_exclude = oklob plant,statue,curse skull,roxanne # tc_reachable = blue # tc_dangerous = cyan -- cgit v1.2.3-54-g00ecf From b1ede8b9a0b8200538147f8031f6ed8b4f9de8c8 Mon Sep 17 00:00:00 2001 From: Johanna Ploog Date: Sat, 26 Dec 2009 17:01:08 +0100 Subject: Add default answer 'n' to several instances of yesno(). --- crawl-ref/source/it_use3.cc | 2 +- crawl-ref/source/item_use.cc | 8 ++++---- crawl-ref/source/overmap.cc | 2 +- crawl-ref/source/religion.cc | 2 +- crawl-ref/source/spl-book.cc | 2 +- crawl-ref/source/wiz-item.cc | 4 ++-- crawl-ref/source/wiz-you.cc | 16 ++++++++++++++-- 7 files changed, 24 insertions(+), 12 deletions(-) diff --git a/crawl-ref/source/it_use3.cc b/crawl-ref/source/it_use3.cc index 295b5d24e6..81dfb15479 100644 --- a/crawl-ref/source/it_use3.cc +++ b/crawl-ref/source/it_use3.cc @@ -487,7 +487,7 @@ void tome_of_power(int slot) set_ident_flags(you.inv[slot], ISFLAG_KNOW_TYPE); you.turn_is_over = true; - if (!yesno("Read it?")) + if (!yesno("Read it?", false, 'n')) return; if (player_mutation_level(MUT_BLURRY_VISION) > 0 diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 11c92d1fbe..38bf295a7a 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -4155,7 +4155,7 @@ static bool _dont_use_invis() } else if (get_contamination_level() > 0 && !yesno("Invisibility will do you no good right now; " - "use anyways?")) + "use anyways?", false, 'n')) { return (true); } @@ -4560,14 +4560,14 @@ bool _drink_fountain() potion_type fountain_effect = POT_WATER; if (feat == DNGN_FOUNTAIN_BLUE) { - if (!yesno("Drink from the fountain?")) + if (!yesno("Drink from the fountain?", true, 'n')) return (false); mpr("You drink the pure, clear water."); } else if (feat == DNGN_FOUNTAIN_BLOOD) { - if (!yesno("Drink from the fountain of blood?")) + if (!yesno("Drink from the fountain of blood?", true, 'n')) return (false); mpr("You drink the blood."); @@ -4575,7 +4575,7 @@ bool _drink_fountain() } else { - if (!yesno("Drink from the sparkling fountain?")) + if (!yesno("Drink from the sparkling fountain?", true, 'n')) return (false); mpr("You drink the sparkling water."); diff --git a/crawl-ref/source/overmap.cc b/crawl-ref/source/overmap.cc index 647008b6a1..6e823ddcd9 100644 --- a/crawl-ref/source/overmap.cc +++ b/crawl-ref/source/overmap.cc @@ -831,7 +831,7 @@ void annotate_level() { if (get_level_annotation(li, true).length() > 0) { - if (!yesno("Really clear the annotation?")) + if (!yesno("Really clear the annotation?", false, 'n')) return; } else diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index accadce94e..395db6af89 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -4809,7 +4809,7 @@ void offer_items() const std::string msg = "Really sacrifice " + item.name(DESC_NOCAP_A) + "?"; - if (!yesno(msg.c_str())) + if (!yesno(msg.c_str(), false, 'n')) { i = next; continue; diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc index 66d9c9d194..6630e0c0db 100644 --- a/crawl-ref/source/spl-book.cc +++ b/crawl-ref/source/spl-book.cc @@ -1856,7 +1856,7 @@ bool learn_spell(spell_type specspell, int book, bool is_safest_book) #ifdef WIZARD if (!you.wizard) return (false); - else if (!yesno("Memorise anyway?")) + else if (!yesno("Memorise anyway?", true, 'n')) return (false); #else return (false); diff --git a/crawl-ref/source/wiz-item.cc b/crawl-ref/source/wiz-item.cc index 42376be3ae..b4b94bb94f 100644 --- a/crawl-ref/source/wiz-item.cc +++ b/crawl-ref/source/wiz-item.cc @@ -165,7 +165,7 @@ void wizard_create_spec_object() if (mons_weight(mon) <= 0) { if (!yesno("That monster doesn't leave corpses; make one " - "anyway?")) + "anyway?", true, 'y')) { return; } @@ -630,7 +630,7 @@ void wizard_make_object_randart() if (is_random_artefact(item)) { - if (!yesno("Is already a randart; wipe and re-use?")) + if (!yesno("Is already a randart; wipe and re-use?", true, 'n')) { canned_msg(MSG_OK); return; diff --git a/crawl-ref/source/wiz-you.cc b/crawl-ref/source/wiz-you.cc index cf570e928f..dfc4d32fbb 100644 --- a/crawl-ref/source/wiz-you.cc +++ b/crawl-ref/source/wiz-you.cc @@ -454,7 +454,13 @@ bool wizard_add_mutation() } } - bool force = yesno("Force mutation to happen?", true, 'n'); + int answer = yesnoquit("Force mutation to happen?", true, 'n'); + if (answer == -1) + { + canned_msg(MSG_OK); + return (false); + } + const bool force = (answer == 1); if (player_mutation_level(MUT_MUTATION_RESISTANCE) == 3 && !force) { @@ -463,7 +469,13 @@ bool wizard_add_mutation() return (false); } - bool god_gift = yesno("Treat mutation as god gift?", true, 'n'); + answer = yesnoquit("Treat mutation as god gift?", true, 'n'); + if (answer == -1) + { + canned_msg(MSG_OK); + return (false); + } + const bool god_gift = (answer == 1); mpr("Which mutation (name, 'good', 'bad', 'any', 'xom')? ", MSGCH_PROMPT); get_input_line( specs, sizeof( specs ) ); -- cgit v1.2.3-54-g00ecf From f751c126a10132e7f3efd1f27f03abb228082f7a Mon Sep 17 00:00:00 2001 From: Johanna Ploog Date: Sat, 26 Dec 2009 17:06:14 +0100 Subject: Fix a typo. --- crawl-ref/docs/develop/levels/syntax.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crawl-ref/docs/develop/levels/syntax.txt b/crawl-ref/docs/develop/levels/syntax.txt index d99fb5faf9..b058e6387d 100644 --- a/crawl-ref/docs/develop/levels/syntax.txt +++ b/crawl-ref/docs/develop/levels/syntax.txt @@ -520,7 +520,7 @@ ITEM: (list of items, separated by comma) provided. For example, "owner:Roxanne" may create "Roxanne's Treatise on Mountains". - NOTE: You can place multiple items on the same square by using the + NOTE: You can place multiple items on the same square by using the KITEM directive. See that section for more information. MONS: (list of monsters) @@ -562,7 +562,7 @@ MONS: (list of monsters) MONS: rat tile:mons_giant_bat In tiles version, this would create a monster that uses the - 'monst_giant_bat' tile, but is otherwise identical to a rat. + 'mons_giant_bat' tile, but is otherwise identical to a rat. Obviously, this substition of one monster onto another should never be used, but it can be useful for customised vault monsters if an alternate tile exists. In ASCII mode, this will do nothing. @@ -808,9 +808,9 @@ COLOUR: . = green / blue:5 / red / none the COLOUR will transfer to the resulting transformed glyph. There are two types of colour available: base and "elemental". - Available base colours are as follows: blue, green, cyan, - red, magenta, brown, lightgrey, darkgrey, lightblue, lightgreen, - lightcyan, lightred, lightmagenta, yellow and white. + Available base colours are as follows: blue, green, cyan, + red, magenta, brown, lightgrey, darkgrey, lightblue, lightgreen, + lightcyan, lightred, lightmagenta, yellow and white. Elemental colours are: fire, ice, earth, electricity, air, poison, water, magic, mutagenic, warp, enchant, heal, holy, dark, death, @@ -1041,7 +1041,7 @@ KPROP: x = bloody Available properties are: * "bloody": Causes features to appear as though splattered with - blood. This should be used very, very sparingly! + blood. This should be used very, very sparingly! * "no_cloud_gen": Prevents clouds from being generated over this feature (usually lava). Does not stop fog generators or clouds entering from nearby squares. -- cgit v1.2.3-54-g00ecf From e498a6cf12a2a1428f7135867739e6b64ffa394a Mon Sep 17 00:00:00 2001 From: Johanna Ploog Date: Sat, 26 Dec 2009 17:11:29 +0100 Subject: Actually use the archer statue tile in the corresponding vault definition. --- crawl-ref/source/dat/mini.des | 2 +- crawl-ref/source/rltiles/dc-mon.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crawl-ref/source/dat/mini.des b/crawl-ref/source/dat/mini.des index 4f61617b69..2927e8362c 100644 --- a/crawl-ref/source/dat/mini.des +++ b/crawl-ref/source/dat/mini.des @@ -2667,7 +2667,7 @@ ENDMAP # NAME: archer_statue DEPTH: D:8-, Vault, Elf -MONS: statue name:archer name_adjective; longbow . arrow q:30 +MONS: statue tile:mons_archer_statue name:archer name_adjective; longbow . arrow q:30 MAP ccc ccccc1ccccc diff --git a/crawl-ref/source/rltiles/dc-mon.txt b/crawl-ref/source/rltiles/dc-mon.txt index 18a2dc86b1..a01f00d479 100644 --- a/crawl-ref/source/rltiles/dc-mon.txt +++ b/crawl-ref/source/rltiles/dc-mon.txt @@ -287,6 +287,7 @@ roxanne MONS_ROXANNE ice_statue MONS_ICE_STATUE silver_statue MONS_SILVER_STATUE orange_crystal_statue MONS_ORANGE_CRYSTAL_STATUE +statue_archer MONS_ARCHER_STATUE ## Gargoyles ('9') %sdir dc-mon -- cgit v1.2.3-54-g00ecf From 61e082e6697779272d5f3503e2751a0ec91283c7 Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Sat, 26 Dec 2009 22:21:09 +0530 Subject: Move Shoals code out into its own file. --- crawl-ref/source/dgn-shoals.cc | 257 ++++++++++++++++++++++++++++ crawl-ref/source/dgn-shoals.h | 6 + crawl-ref/source/dungeon.cc | 370 +++++++---------------------------------- crawl-ref/source/dungeon.h | 12 ++ crawl-ref/source/makefile.obj | 1 + 5 files changed, 337 insertions(+), 309 deletions(-) create mode 100644 crawl-ref/source/dgn-shoals.cc create mode 100644 crawl-ref/source/dgn-shoals.h diff --git a/crawl-ref/source/dgn-shoals.cc b/crawl-ref/source/dgn-shoals.cc new file mode 100644 index 0000000000..949812d05f --- /dev/null +++ b/crawl-ref/source/dgn-shoals.cc @@ -0,0 +1,257 @@ +#include "AppHdr.h" + +#include "branch.h" +#include "coord.h" +#include "dungeon.h" +#include "dgn-shoals.h" +#include "env.h" +#include "maps.h" +#include "random.h" + +#include +#include +#include + +static int _shoals_heights[GYM][GXM]; +static std::vector _shoals_islands; + +const int ISLAND_COLLIDE_DIST2 = 5 * 5; +const int N_PERTURB_ISLAND_CENTER = 50; +const int ISLAND_CENTER_RADIUS_LOW = 3; +const int ISLAND_CENTER_RADIUS_HIGH = 10; + +const int N_PERTURB_OFFSET_LOW = 25; +const int N_PERTURB_OFFSET_HIGH = 45; +const int PERTURB_OFFSET_RADIUS_LOW = 2; +const int PERTURB_OFFSET_RADIUS_HIGH = 7; + +const int _shoals_margin = 6; + +static void _shoals_init_heights() +{ + for (int y = 0; y < GYM; ++y) + for (int x = 0; x < GXM; ++x) + _shoals_heights[y][x] = -17; +} + +static coord_def _random_point_from(const coord_def &c, int radius) +{ + while (true) { + const double angle = random2(360) * M_PI / 180; + coord_def res = c + coord_def(radius * cos(angle), radius * sin(angle)); + if (res.x >= _shoals_margin && res.x < GXM - _shoals_margin + && res.y >= _shoals_margin && res.y < GYM - _shoals_margin) + { + return res; + } + } +} + +static coord_def _random_point(int offset = 0) { + return coord_def(random_range(offset, GXM - offset - 1), + random_range(offset, GYM - offset - 1)); +} + +static void _shoals_island_center(const coord_def &c, int n_perturb, int radius, + int bounce_low, int bounce_high) +{ + for (int i = 0; i < n_perturb; ++i) { + coord_def p = _random_point_from(c, random2(1 + radius)); + _shoals_heights[p.y][p.x] += random_range(bounce_low, bounce_high); + } +} + +static coord_def _shoals_pick_island_spot() +{ + coord_def c; + for (int i = 0; i < 15; ++i) + { + c = _random_point(_shoals_margin * 2); + + bool collides = false; + for (int j = 0, size = _shoals_islands.size(); j < size; ++j) + { + const coord_def island = _shoals_islands[j]; + const coord_def dist = island - c; + if (dist.abs() < ISLAND_COLLIDE_DIST2) + { + collides = true; + break; + } + } + if (!collides) + break; + } + _shoals_islands.push_back(c); + return c; +} + +static void _shoals_build_island() +{ + coord_def c = _shoals_pick_island_spot(); + _shoals_island_center(c, N_PERTURB_ISLAND_CENTER, + random_range(ISLAND_CENTER_RADIUS_LOW, + ISLAND_CENTER_RADIUS_HIGH), + 40, 60); + const int additional_heights = random2(4); + for (int i = 0; i < additional_heights; ++i) { + const int addition_offset = random_range(2, 10); + + coord_def offsetC = _random_point_from(c, addition_offset); + + _shoals_island_center(offsetC, random_range(N_PERTURB_OFFSET_LOW, + N_PERTURB_OFFSET_HIGH), + random_range(PERTURB_OFFSET_RADIUS_LOW, + PERTURB_OFFSET_RADIUS_HIGH), + 25, 35); + } +} + +static void _shoals_init_islands(int depth) +{ + const int nislands = 20 - depth * 2; + for (int i = 0; i < nislands; ++i) + _shoals_build_island(); +} + +static void _shoals_smooth_at(const coord_def &c, int radius) +{ + int max_delta = radius * radius * 2 + 2; + int divisor = 0; + int total = 0; + for (int y = c.y - radius; y <= c.y + radius; ++y) { + for (int x = c.x - radius; x <= c.x + radius; ++x) { + const coord_def p(x, y); + if (!in_bounds(p)) + continue; + const coord_def off = c - p; + int weight = max_delta - off.abs(); + divisor += weight; + total += _shoals_heights[p.y][p.x] * weight; + } + } + _shoals_heights[c.y][c.x] = total / divisor; +} + +static void _shoals_smooth() +{ + for (int y = 0; y < GYM; ++y) + for (int x = 0; x < GXM; ++x) + _shoals_smooth_at(coord_def(x, y), 1); +} + +static dungeon_feature_type _shoals_feature_at(int x, int y) +{ + const int height = _shoals_heights[y][x]; + return height >= 0? DNGN_FLOOR : + height >= -14? DNGN_SHALLOW_WATER : DNGN_DEEP_WATER; +} + +static void _shoals_apply_level() +{ + for (int y = 1; y < GYM - 1; ++y) + for (int x = 1; x < GXM - 1; ++x) + grd[x][y] = _shoals_feature_at(x, y); +} + +static coord_def _pick_shoals_island() +{ + const int lucky_island = random2(_shoals_islands.size()); + const coord_def c = _shoals_islands[lucky_island]; + _shoals_islands.erase(_shoals_islands.begin() + lucky_island); + return c; +} + +struct point_sort_distance_from +{ + coord_def bad_place; + point_sort_distance_from(coord_def c) : bad_place(c) { } + bool operator () (coord_def a, coord_def b) const + { + const int dista = (a - bad_place).abs(), distb = (b - bad_place).abs(); + return dista >= distb; + } +}; + +static coord_def _pick_shoals_island_distant_from(coord_def bad_place) +{ + ASSERT(!_shoals_islands.empty()); + + std::sort(_shoals_islands.begin(), _shoals_islands.end(), + point_sort_distance_from(bad_place)); + const int top_picks = std::min(4, int(_shoals_islands.size())); + const int choice = random2(top_picks); + coord_def chosen = _shoals_islands[choice]; + _shoals_islands.erase(_shoals_islands.begin() + choice); + return chosen; +} + +static void _shoals_furniture(int margin) +{ + if (at_branch_bottom()) + { + const coord_def c = _pick_shoals_island(); + // Put all the stairs on one island. + grd(c) = DNGN_STONE_STAIRS_UP_I; + grd(c + coord_def(1, 0)) = DNGN_STONE_STAIRS_UP_II; + grd(c - coord_def(1, 0)) = DNGN_STONE_STAIRS_UP_III; + + const coord_def p = _pick_shoals_island_distant_from(c); + // Place the rune + const map_def *vault = random_map_for_tag("shoal_rune"); + dgn_place_map(vault, false, true, p); + + const int nhuts = std::min(8, int(_shoals_islands.size())); + for (int i = 2; i < nhuts; ++i) + { + // Place (non-rune) minivaults on the other islands + do + vault = random_map_for_tag("shoal"); + while (!vault); + dgn_place_map(vault, false, true, _pick_shoals_island()); + } + } + else + { + // Place stairs randomly. No elevators. + for (int i = 0; i < 3; ++i) + { + int x, y; + do + { + x = margin + random2(GXM - 2*margin); + y = margin + random2(GYM - 2*margin); + } + while (grd[x][y] != DNGN_FLOOR); + + grd[x][y] + = static_cast(DNGN_STONE_STAIRS_DOWN_I + i); + + do + { + x = margin + random2(GXM - 2*margin); + y = margin + random2(GYM - 2*margin); + } + while (grd[x][y] != DNGN_FLOOR); + + grd[x][y] + = static_cast(DNGN_STONE_STAIRS_UP_I + i); + } + } + +} + +void prepare_shoals(int level_number) +{ + dgn_Build_Method += make_stringf(" shoals+ [%d]", level_number); + dgn_Layout_Type = "shoals"; + + const int shoals_depth = level_id::current().depth - 1; + dgn_replace_area(0, 0, GXM-1, GYM-1, DNGN_ROCK_WALL, DNGN_OPEN_SEA); + _shoals_init_heights(); + _shoals_islands.clear(); + _shoals_init_islands(shoals_depth); + _shoals_smooth(); + _shoals_apply_level(); + _shoals_furniture(6); +} diff --git a/crawl-ref/source/dgn-shoals.h b/crawl-ref/source/dgn-shoals.h new file mode 100644 index 0000000000..023f321fe6 --- /dev/null +++ b/crawl-ref/source/dgn-shoals.h @@ -0,0 +1,6 @@ +#ifndef DGN_SHOALS_H +#define DGN_SHOALS_H + +void prepare_shoals(int level_number); + +#endif diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index a0100ed3aa..3d1102b31d 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -13,7 +13,6 @@ #include #include #include -#include #include "abyss.h" #include "artefact.h" @@ -24,6 +23,7 @@ #include "coord.h" #include "coordit.h" #include "defines.h" +#include "dgn-shoals.h" #include "effects.h" #include "env.h" #include "enum.h" @@ -113,18 +113,6 @@ static bool _make_box(int room_x1, int room_y1, int room_x2, int room_y2, dungeon_feature_type floor=DNGN_UNSEEN, dungeon_feature_type wall=DNGN_UNSEEN, dungeon_feature_type avoid=DNGN_UNSEEN); -static void _replace_area(const coord_def& p1, const coord_def& p2, - dungeon_feature_type replace, - dungeon_feature_type feature, - unsigned mmask = 0, bool needs_update = false); -static void _replace_area(int sx, int sy, int ex, int ey, - dungeon_feature_type replace, - dungeon_feature_type feature, - unsigned mmask = 0, bool needs_update = false) -{ - _replace_area( coord_def(sx, sy), coord_def(ex, ey), - replace, feature, mmask, needs_update ); -} static builder_rc_type _builder_by_type(int level_number, char level_type); static builder_rc_type _builder_by_branch(int level_number); @@ -146,7 +134,6 @@ static int _place_uniques(int level_number, char level_type); static void _place_traps( int level_number ); static void _place_fog_machines( int level_number ); static void _prepare_swamp(); -static void _prepare_shoals( int level_number ); static void _prepare_water( int level_number ); static void _check_doors(); static void _hide_doors(); @@ -1172,8 +1159,8 @@ static void _fixup_walls() else if (player_in_branch(BRANCH_CRYPT)) vault_wall = DNGN_STONE_WALL; - _replace_area(0, 0, GXM-1, GYM-1, DNGN_ROCK_WALL, vault_wall, - MMT_NO_WALL); + dgn_replace_area(0, 0, GXM-1, GYM-1, DNGN_ROCK_WALL, vault_wall, + MMT_NO_WALL); } } @@ -1808,9 +1795,10 @@ static void _build_dungeon_level(int level_number, int level_type) _hide_doors(); // Change pre-rock to rock, and pre-floor to floor. - _replace_area(0, 0, GXM-1, GYM-1, DNGN_BUILDER_SPECIAL_WALL, - DNGN_ROCK_WALL); - _replace_area(0, 0, GXM-1, GYM-1, DNGN_BUILDER_SPECIAL_FLOOR, DNGN_FLOOR); + dgn_replace_area(0, 0, GXM-1, GYM-1, DNGN_BUILDER_SPECIAL_WALL, + DNGN_ROCK_WALL); + dgn_replace_area(0, 0, GXM-1, GYM-1, DNGN_BUILDER_SPECIAL_FLOOR, + DNGN_FLOOR); const unsigned nvaults = Level_Vaults.size(); @@ -2041,253 +2029,6 @@ static void _connected_flood(int margin, int i, int j, bool taken[GXM][GYM]) _connected_flood(margin, i + idelta, j + jdelta, taken); } -static int _shoals_heights[GYM][GXM]; -static std::vector _shoals_islands; - -const int ISLAND_COLLIDE_DIST2 = 5 * 5; -const int N_PERTURB_ISLAND_CENTER = 50; -const int ISLAND_CENTER_RADIUS_LOW = 3; -const int ISLAND_CENTER_RADIUS_HIGH = 10; - -const int N_PERTURB_OFFSET_LOW = 25; -const int N_PERTURB_OFFSET_HIGH = 45; -const int PERTURB_OFFSET_RADIUS_LOW = 2; -const int PERTURB_OFFSET_RADIUS_HIGH = 7; - -const int _shoals_margin = 6; - -static void _shoals_init_heights() -{ - for (int y = 0; y < GYM; ++y) - for (int x = 0; x < GXM; ++x) - _shoals_heights[y][x] = -17; -} - -static coord_def _random_point_from(const coord_def &c, int radius) -{ - while (true) { - const double angle = random2(360) * M_PI / 180; - coord_def res = c + coord_def(radius * cos(angle), radius * sin(angle)); - if (res.x >= _shoals_margin && res.x < GXM - _shoals_margin - && res.y >= _shoals_margin && res.y < GYM - _shoals_margin) - { - return res; - } - } -} - -static coord_def _random_point(int offset = 0) { - return coord_def(random_range(offset, GXM - offset - 1), - random_range(offset, GYM - offset - 1)); -} - -static void _shoals_island_center(const coord_def &c, int n_perturb, int radius, - int bounce_low, int bounce_high) -{ - for (int i = 0; i < n_perturb; ++i) { - coord_def p = _random_point_from(c, random2(1 + radius)); - _shoals_heights[p.y][p.x] += random_range(bounce_low, bounce_high); - } -} - -static coord_def _shoals_pick_island_spot() -{ - coord_def c; - for (int i = 0; i < 15; ++i) - { - c = _random_point(_shoals_margin * 2); - - bool collides = false; - for (int j = 0, size = _shoals_islands.size(); j < size; ++j) - { - const coord_def island = _shoals_islands[j]; - const coord_def dist = island - c; - if (dist.abs() < ISLAND_COLLIDE_DIST2) - { - collides = true; - break; - } - } - if (!collides) - break; - } - _shoals_islands.push_back(c); - return c; -} - -static void _shoals_build_island() -{ - coord_def c = _shoals_pick_island_spot(); - _shoals_island_center(c, N_PERTURB_ISLAND_CENTER, - random_range(ISLAND_CENTER_RADIUS_LOW, - ISLAND_CENTER_RADIUS_HIGH), - 40, 60); - const int additional_heights = random2(4); - for (int i = 0; i < additional_heights; ++i) { - const int addition_offset = random_range(2, 10); - - coord_def offsetC = _random_point_from(c, addition_offset); - - _shoals_island_center(offsetC, random_range(N_PERTURB_OFFSET_LOW, - N_PERTURB_OFFSET_HIGH), - random_range(PERTURB_OFFSET_RADIUS_LOW, - PERTURB_OFFSET_RADIUS_HIGH), - 25, 35); - } -} - -static void _shoals_init_islands(int depth) -{ - const int nislands = 20 - depth * 2; - for (int i = 0; i < nislands; ++i) - _shoals_build_island(); -} - -static void _shoals_smooth_at(const coord_def &c, int radius) -{ - int max_delta = radius * radius * 2 + 2; - int divisor = 0; - int total = 0; - for (int y = c.y - radius; y <= c.y + radius; ++y) { - for (int x = c.x - radius; x <= c.x + radius; ++x) { - const coord_def p(x, y); - if (!in_bounds(p)) - continue; - const coord_def off = c - p; - int weight = max_delta - off.abs(); - divisor += weight; - total += _shoals_heights[p.y][p.x] * weight; - } - } - _shoals_heights[c.y][c.x] = total / divisor; -} - -static void _shoals_smooth() -{ - for (int y = 0; y < GYM; ++y) - for (int x = 0; x < GXM; ++x) - _shoals_smooth_at(coord_def(x, y), 1); -} - -static dungeon_feature_type _shoals_feature_at(int x, int y) -{ - const int height = _shoals_heights[y][x]; - return height >= 0? DNGN_FLOOR : - height >= -14? DNGN_SHALLOW_WATER : DNGN_DEEP_WATER; -} - -static void _shoals_apply_level() -{ - for (int y = 1; y < GYM - 1; ++y) - for (int x = 1; x < GXM - 1; ++x) - grd[x][y] = _shoals_feature_at(x, y); -} - -static coord_def _pick_shoals_island() -{ - const int lucky_island = random2(_shoals_islands.size()); - const coord_def c = _shoals_islands[lucky_island]; - _shoals_islands.erase(_shoals_islands.begin() + lucky_island); - return c; -} - -struct point_sort_distance_from -{ - coord_def bad_place; - point_sort_distance_from(coord_def c) : bad_place(c) { } - bool operator () (coord_def a, coord_def b) const - { - const int dista = (a - bad_place).abs(), distb = (b - bad_place).abs(); - return dista >= distb; - } -}; - -static coord_def _pick_shoals_island_distant_from(coord_def bad_place) -{ - ASSERT(!_shoals_islands.empty()); - - std::sort(_shoals_islands.begin(), _shoals_islands.end(), - point_sort_distance_from(bad_place)); - const int top_picks = std::min(4, int(_shoals_islands.size())); - const int choice = random2(top_picks); - coord_def chosen = _shoals_islands[choice]; - _shoals_islands.erase(_shoals_islands.begin() + choice); - return chosen; -} - -static void _shoals_furniture(int margin) -{ - if (at_branch_bottom()) - { - const coord_def c = _pick_shoals_island(); - // Put all the stairs on one island. - grd(c) = DNGN_STONE_STAIRS_UP_I; - grd(c + coord_def(1, 0)) = DNGN_STONE_STAIRS_UP_II; - grd(c - coord_def(1, 0)) = DNGN_STONE_STAIRS_UP_III; - - const coord_def p = _pick_shoals_island_distant_from(c); - // Place the rune - const map_def *vault = random_map_for_tag("shoal_rune"); - _build_secondary_vault(you.your_level, vault, -1, false, true, - p); - - const int nhuts = std::min(8, int(_shoals_islands.size())); - for (int i = 2; i < nhuts; ++i) - { - // Place (non-rune) minivaults on the other islands - do - vault = random_map_for_tag("shoal"); - while (!vault); - - _build_secondary_vault(you.your_level, vault, -1, false, true, - _pick_shoals_island()); - } - } - else - { - // Place stairs randomly. No elevators. - for (int i = 0; i < 3; ++i) - { - int x, y; - do - { - x = margin + random2(GXM - 2*margin); - y = margin + random2(GYM - 2*margin); - } - while (grd[x][y] != DNGN_FLOOR); - - grd[x][y] - = static_cast(DNGN_STONE_STAIRS_DOWN_I + i); - - do - { - x = margin + random2(GXM - 2*margin); - y = margin + random2(GYM - 2*margin); - } - while (grd[x][y] != DNGN_FLOOR); - - grd[x][y] - = static_cast(DNGN_STONE_STAIRS_UP_I + i); - } - } - -} - -static void _prepare_shoals(int level_number) -{ - dgn_Build_Method += make_stringf(" shoals+ [%d]", level_number); - dgn_Layout_Type = "shoals"; - - const int shoals_depth = level_id::current().depth - 1; - _replace_area(0, 0, GXM-1, GYM-1, DNGN_ROCK_WALL, DNGN_OPEN_SEA); - _shoals_init_heights(); - _shoals_islands.clear(); - _shoals_init_islands(shoals_depth); - _shoals_smooth(); - _shoals_apply_level(); - _shoals_furniture(6); -} - static void _prepare_swamp() { dgn_Build_Method += " swamp"; @@ -2556,7 +2297,8 @@ static void _portal_vault_level(int level_number) { // XXX: This is pretty hackish, I confess. if (vault->border_fill_type != DNGN_ROCK_WALL) - _replace_area(0, 0, GXM-1, GYM-1, DNGN_ROCK_WALL, vault->border_fill_type); + dgn_replace_area(0, 0, GXM-1, GYM-1, DNGN_ROCK_WALL, + vault->border_fill_type); _ensure_vault_placed( _build_vaults(level_number, vault), true ); } @@ -2681,7 +2423,7 @@ static builder_rc_type _builder_by_branch(int level_number) return BUILD_SKIP; } case BRANCH_SHOALS: - _prepare_shoals(level_number); + prepare_shoals(level_number); return BUILD_SKIP; default: @@ -3984,8 +3726,8 @@ static void _build_rooms(const dgn_region_list &excluded, } const coord_def end = myroom.end(); - _replace_area(myroom.pos.x, myroom.pos.y, end.x, end.y, - DNGN_ROCK_WALL, DNGN_FLOOR); + dgn_replace_area(myroom.pos.x, myroom.pos.y, end.x, end.y, + DNGN_ROCK_WALL, DNGN_FLOOR); if (which_room > 0) { @@ -5302,10 +5044,19 @@ bool seen_replace_feat(dungeon_feature_type old_feat, return (seen); } -static void _replace_area( const coord_def& p1, const coord_def& p2, - dungeon_feature_type replace, - dungeon_feature_type feature, unsigned mapmask, - bool needs_update) +void dgn_replace_area(int sx, int sy, int ex, int ey, + dungeon_feature_type replace, + dungeon_feature_type feature, + unsigned mmask, bool needs_update) +{ + dgn_replace_area( coord_def(sx, sy), coord_def(ex, ey), + replace, feature, mmask, needs_update ); +} + +void dgn_replace_area( const coord_def& p1, const coord_def& p2, + dungeon_feature_type replace, + dungeon_feature_type feature, unsigned mapmask, + bool needs_update) { for (rectangle_iterator ri(p1, p2); ri; ++ri) { @@ -6211,7 +5962,7 @@ static void _plan_main(int level_number, int force_plan) } if (one_chance_in(20)) - _replace_area(0, 0, GXM-1, GYM-1, DNGN_ROCK_WALL, special_grid); + dgn_replace_area(0, 0, GXM-1, GYM-1, DNGN_ROCK_WALL, special_grid); } static bool _plan_1(int level_number) @@ -6292,7 +6043,8 @@ static bool _plan_4(char forbid_x1, char forbid_y1, char forbid_x2, : DNGN_METAL_WALL); // odds: 3 in 18 {dlb} } - _replace_area(10, 10, (GXM - 10), (GYM - 10), DNGN_ROCK_WALL, DNGN_FLOOR); + dgn_replace_area(10, 10, (GXM - 10), (GYM - 10), DNGN_ROCK_WALL, + DNGN_FLOOR); // replace_area can also be used to fill in: for (i = 0; i < number_boxes; i++) @@ -6338,7 +6090,7 @@ static bool _plan_4(char forbid_x1, char forbid_y1, char forbid_x2, temp_rand = random2(210); if (temp_rand > 71) // odds: 138 in 210 {dlb} - _replace_area(b1x, b1y, b2x, b2y, DNGN_FLOOR, drawing); + dgn_replace_area(b1x, b1y, b2x, b2y, DNGN_FLOOR, drawing); else // odds: 72 in 210 {dlb} _box_room(b1x, b2x - 1, b1y, b2y - 1, drawing); } @@ -7151,12 +6903,12 @@ static void _box_room(int bx1, int bx2, int by1, int by2, int temp_rand, new_doors, doors_placed; // Do top & bottom walls. - _replace_area(bx1, by1, bx2, by1, DNGN_FLOOR, wall_type); - _replace_area(bx1, by2, bx2, by2, DNGN_FLOOR, wall_type); + dgn_replace_area(bx1, by1, bx2, by1, DNGN_FLOOR, wall_type); + dgn_replace_area(bx1, by2, bx2, by2, DNGN_FLOOR, wall_type); // Do left & right walls. - _replace_area(bx1, by1+1, bx1, by2-1, DNGN_FLOOR, wall_type); - _replace_area(bx2, by1+1, bx2, by2-1, DNGN_FLOOR, wall_type); + dgn_replace_area(bx1, by1+1, bx1, by2-1, DNGN_FLOOR, wall_type); + dgn_replace_area(bx2, by1+1, bx2, by2-1, DNGN_FLOOR, wall_type); // Sometimes we have to place doors, or else we shut in other // buildings' doors. @@ -7394,8 +7146,8 @@ static void _big_room(int level_number) } // Make the big room. - _replace_area(sr.tl, sr.br, DNGN_ROCK_WALL, type_floor); - _replace_area(sr.tl, sr.br, DNGN_CLOSED_DOOR, type_floor); + dgn_replace_area(sr.tl, sr.br, DNGN_ROCK_WALL, type_floor); + dgn_replace_area(sr.tl, sr.br, DNGN_CLOSED_DOOR, type_floor); if (type_floor == DNGN_FLOOR) { @@ -7493,8 +7245,8 @@ static void _roguey_level(int level_number, spec_room &sr, bool make_stairs) for (i = 0; i < 25; i++) { - _replace_area( rox1[i], roy1[i], rox2[i], roy2[i], - DNGN_ROCK_WALL, DNGN_FLOOR ); + dgn_replace_area( rox1[i], roy1[i], rox2[i], roy2[i], + DNGN_ROCK_WALL, DNGN_FLOOR ); // Inner room? if (rox2[i] - rox1[i] > 5 && roy2[i] - roy1[i] > 5 @@ -7612,36 +7364,36 @@ static void _roguey_level(int level_number, spec_room &sr, bool make_stairs) // by something else (or put monsters in walls, etc...) // top - _replace_area(sr.tl.x-1, sr.tl.y-1, sr.br.x+1,sr.tl.y-1, - DNGN_ROCK_WALL, DNGN_BUILDER_SPECIAL_WALL); - _replace_area(sr.tl.x-1, sr.tl.y-1, sr.br.x+1,sr.tl.y-1, - DNGN_FLOOR, DNGN_BUILDER_SPECIAL_FLOOR); - _replace_area(sr.tl.x-1, sr.tl.y-1, sr.br.x+1,sr.tl.y-1, - DNGN_CLOSED_DOOR, DNGN_BUILDER_SPECIAL_FLOOR); + dgn_replace_area(sr.tl.x-1, sr.tl.y-1, sr.br.x+1,sr.tl.y-1, + DNGN_ROCK_WALL, DNGN_BUILDER_SPECIAL_WALL); + dgn_replace_area(sr.tl.x-1, sr.tl.y-1, sr.br.x+1,sr.tl.y-1, + DNGN_FLOOR, DNGN_BUILDER_SPECIAL_FLOOR); + dgn_replace_area(sr.tl.x-1, sr.tl.y-1, sr.br.x+1,sr.tl.y-1, + DNGN_CLOSED_DOOR, DNGN_BUILDER_SPECIAL_FLOOR); // bottom - _replace_area(sr.tl.x-1, sr.br.y+1, sr.br.x+1,sr.br.y+1, - DNGN_ROCK_WALL, DNGN_BUILDER_SPECIAL_WALL); - _replace_area(sr.tl.x-1, sr.br.y+1, sr.br.x+1,sr.br.y+1, - DNGN_FLOOR, DNGN_BUILDER_SPECIAL_FLOOR); - _replace_area(sr.tl.x-1, sr.br.y+1, sr.br.x+1,sr.br.y+1, - DNGN_CLOSED_DOOR, DNGN_BUILDER_SPECIAL_FLOOR); + dgn_replace_area(sr.tl.x-1, sr.br.y+1, sr.br.x+1,sr.br.y+1, + DNGN_ROCK_WALL, DNGN_BUILDER_SPECIAL_WALL); + dgn_replace_area(sr.tl.x-1, sr.br.y+1, sr.br.x+1,sr.br.y+1, + DNGN_FLOOR, DNGN_BUILDER_SPECIAL_FLOOR); + dgn_replace_area(sr.tl.x-1, sr.br.y+1, sr.br.x+1,sr.br.y+1, + DNGN_CLOSED_DOOR, DNGN_BUILDER_SPECIAL_FLOOR); // left - _replace_area(sr.tl.x-1, sr.tl.y-1, sr.tl.x-1, sr.br.y+1, - DNGN_ROCK_WALL, DNGN_BUILDER_SPECIAL_WALL); - _replace_area(sr.tl.x-1, sr.tl.y-1, sr.tl.x-1, sr.br.y+1, - DNGN_FLOOR, DNGN_BUILDER_SPECIAL_FLOOR); - _replace_area(sr.tl.x-1, sr.tl.y-1, sr.tl.x-1, sr.br.y+1, - DNGN_CLOSED_DOOR, DNGN_BUILDER_SPECIAL_FLOOR); + dgn_replace_area(sr.tl.x-1, sr.tl.y-1, sr.tl.x-1, sr.br.y+1, + DNGN_ROCK_WALL, DNGN_BUILDER_SPECIAL_WALL); + dgn_replace_area(sr.tl.x-1, sr.tl.y-1, sr.tl.x-1, sr.br.y+1, + DNGN_FLOOR, DNGN_BUILDER_SPECIAL_FLOOR); + dgn_replace_area(sr.tl.x-1, sr.tl.y-1, sr.tl.x-1, sr.br.y+1, + DNGN_CLOSED_DOOR, DNGN_BUILDER_SPECIAL_FLOOR); // right - _replace_area(sr.br.x+1, sr.tl.y-1, sr.br.x+1, sr.br.y+1, - DNGN_ROCK_WALL, DNGN_BUILDER_SPECIAL_WALL); - _replace_area(sr.br.x+1, sr.tl.y-1, sr.br.x+1, sr.br.y+1, - DNGN_FLOOR, DNGN_BUILDER_SPECIAL_FLOOR); - _replace_area(sr.br.x+1, sr.tl.y-1, sr.br.x+1, sr.br.y+1, - DNGN_CLOSED_DOOR, DNGN_BUILDER_SPECIAL_FLOOR); + dgn_replace_area(sr.br.x+1, sr.tl.y-1, sr.br.x+1, sr.br.y+1, + DNGN_ROCK_WALL, DNGN_BUILDER_SPECIAL_WALL); + dgn_replace_area(sr.br.x+1, sr.tl.y-1, sr.br.x+1, sr.br.y+1, + DNGN_FLOOR, DNGN_BUILDER_SPECIAL_FLOOR); + dgn_replace_area(sr.br.x+1, sr.tl.y-1, sr.br.x+1, sr.br.y+1, + DNGN_CLOSED_DOOR, DNGN_BUILDER_SPECIAL_FLOOR); } if (!make_stairs) diff --git a/crawl-ref/source/dungeon.h b/crawl-ref/source/dungeon.h index 590a91b897..bc140c3f2e 100644 --- a/crawl-ref/source/dungeon.h +++ b/crawl-ref/source/dungeon.h @@ -163,6 +163,7 @@ public: extern bool Generating_Level; extern std::string dgn_Layout_Type; +extern std::string dgn_Build_Method; extern std::set Level_Unique_Maps; extern std::set Level_Unique_Tags; @@ -187,6 +188,7 @@ void dgn_set_grid_colour_at(const coord_def &c, int colour); bool dgn_place_map(const map_def *map, bool clobber, bool make_no_exits, const coord_def &pos = coord_def(-1, -1)); + void level_clear_vault_memory(); void level_welcome_messages(); @@ -256,6 +258,16 @@ bool octa_room(spec_room &sr, int oblique_max, int count_feature_in_box(int x0, int y0, int x1, int y1, dungeon_feature_type feat); + +void dgn_replace_area(const coord_def& p1, const coord_def& p2, + dungeon_feature_type replace, + dungeon_feature_type feature, + unsigned mmask = 0, bool needs_update = false); +void dgn_replace_area(int sx, int sy, int ex, int ey, + dungeon_feature_type replace, + dungeon_feature_type feature, + unsigned mmask = 0, bool needs_update = false); + inline int count_feature_in_box( const coord_def& p1, const coord_def& p2, dungeon_feature_type feat ) { diff --git a/crawl-ref/source/makefile.obj b/crawl-ref/source/makefile.obj index 8761eb11e7..926b9d5e50 100644 --- a/crawl-ref/source/makefile.obj +++ b/crawl-ref/source/makefile.obj @@ -34,6 +34,7 @@ dgnevent.o \ directn.o \ dlua.o \ dungeon.o \ +dgn-shoals.o \ effects.o \ exclude.o \ feature.o \ -- cgit v1.2.3-54-g00ecf From 0195242aa2ca905ad68c99368a06d8100b2a2fa2 Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Sat, 26 Dec 2009 22:46:16 +0530 Subject: Add rock outcrops at the highest points of the Shoal islands. Also fix Shoal:$ having no rune. --- crawl-ref/source/dgn-shoals.cc | 4 +++- crawl-ref/source/dungeon.cc | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crawl-ref/source/dgn-shoals.cc b/crawl-ref/source/dgn-shoals.cc index 949812d05f..170a004b59 100644 --- a/crawl-ref/source/dgn-shoals.cc +++ b/crawl-ref/source/dgn-shoals.cc @@ -143,7 +143,9 @@ static void _shoals_smooth() static dungeon_feature_type _shoals_feature_at(int x, int y) { const int height = _shoals_heights[y][x]; - return height >= 0? DNGN_FLOOR : + return height >= 230 ? DNGN_STONE_WALL : + height >= 170? DNGN_ROCK_WALL : + height >= 0? DNGN_FLOOR : height >= -14? DNGN_SHALLOW_WATER : DNGN_DEEP_WATER; } diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 3d1102b31d..53658c2a58 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -4091,7 +4091,7 @@ bool dgn_place_map(const map_def *mdef, bool clobber, bool make_no_exits, } } - dungeon_feature_type rune_subst = DNGN_FLOOR; + int rune_subst = -1; if (mdef->has_tag_suffix("_entry")) rune_subst = _dgn_find_rune_subst_tags(mdef->tags); did_map = _build_secondary_vault(you.your_level, mdef, rune_subst, -- cgit v1.2.3-54-g00ecf From 1622664e84adc8657645329ec66ebb738bdfa8d6 Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Sat, 26 Dec 2009 23:45:21 +0530 Subject: Add the occasional cliff in the shoals. --- crawl-ref/source/dgn-shoals.cc | 95 +++++++++++++++++++++++++++++++++--------- 1 file changed, 76 insertions(+), 19 deletions(-) diff --git a/crawl-ref/source/dgn-shoals.cc b/crawl-ref/source/dgn-shoals.cc index 170a004b59..c4cdf30cca 100644 --- a/crawl-ref/source/dgn-shoals.cc +++ b/crawl-ref/source/dgn-shoals.cc @@ -2,6 +2,7 @@ #include "branch.h" #include "coord.h" +#include "coordit.h" #include "dungeon.h" #include "dgn-shoals.h" #include "env.h" @@ -27,6 +28,29 @@ const int PERTURB_OFFSET_RADIUS_HIGH = 7; const int _shoals_margin = 6; +enum shoals_height_thresholds +{ + SHT_STONE = 230, + SHT_ROCK = 170, + SHT_FLOOR = 0, + SHT_SHALLOW_WATER = -14 +}; + +static double _to_radians(int degrees) +{ + return degrees * M_PI / 180; +} + +static dungeon_feature_type _shoals_feature_at(const coord_def &c) +{ + const int height = _shoals_heights[c.y][c.x]; + return height >= SHT_STONE ? DNGN_STONE_WALL : + height >= SHT_ROCK? DNGN_ROCK_WALL : + height >= SHT_FLOOR? DNGN_FLOOR : + height >= SHT_SHALLOW_WATER? DNGN_SHALLOW_WATER + : DNGN_DEEP_WATER; +} + static void _shoals_init_heights() { for (int y = 0; y < GYM; ++y) @@ -34,11 +58,24 @@ static void _shoals_init_heights() _shoals_heights[y][x] = -17; } -static coord_def _random_point_from(const coord_def &c, int radius) +static double _angle_fuzz() { + double fuzz = _to_radians(random2(15)); + return coinflip()? fuzz : -fuzz; +} + +static coord_def _random_point_from(const coord_def &c, int radius, + int directed_angle = -1) +{ + const double directed_radians( + directed_angle == -1? 0.0 : _to_radians(directed_angle)); while (true) { - const double angle = random2(360) * M_PI / 180; - coord_def res = c + coord_def(radius * cos(angle), radius * sin(angle)); + const double angle = + directed_angle == -1? _to_radians(random2(360)) + : ((coinflip()? directed_radians : -directed_radians) + + _angle_fuzz()); + coord_def res = c + coord_def(radius * cos(angle), + radius * sin(angle)); if (res.x >= _shoals_margin && res.x < GXM - _shoals_margin && res.y >= _shoals_margin && res.y < GYM - _shoals_margin) { @@ -114,6 +151,36 @@ static void _shoals_init_islands(int depth) _shoals_build_island(); } +// Cliffs are usually constructed in shallow water adjacent to deep +// water (for effect). +static void _shoals_build_cliff() +{ + coord_def cliffc = _random_point(_shoals_margin * 2); + if (in_bounds(cliffc)) + { + const int length = random_range(6, 15); + double angle = _to_radians(random2(360)); + for (int i = 0; i < length; i += 3) + { + int distance = i - length / 2; + coord_def place = cliffc + coord_def(distance * cos(angle), + distance * sin(angle)); + coord_def fuzz = coord_def(random_range(-2, 2), + random_range(-2, 2)); + place += fuzz; + _shoals_island_center(place, random_range(40, 60), 3, + 100, 130); + } + } +} + +static void _shoals_cliffs() +{ + const int ncliffs = random_range(0, 6, 2); + for (int i = 0; i < ncliffs; ++i) + _shoals_build_cliff(); +} + static void _shoals_smooth_at(const coord_def &c, int radius) { int max_delta = radius * radius * 2 + 2; @@ -135,25 +202,14 @@ static void _shoals_smooth_at(const coord_def &c, int radius) static void _shoals_smooth() { - for (int y = 0; y < GYM; ++y) - for (int x = 0; x < GXM; ++x) - _shoals_smooth_at(coord_def(x, y), 1); -} - -static dungeon_feature_type _shoals_feature_at(int x, int y) -{ - const int height = _shoals_heights[y][x]; - return height >= 230 ? DNGN_STONE_WALL : - height >= 170? DNGN_ROCK_WALL : - height >= 0? DNGN_FLOOR : - height >= -14? DNGN_SHALLOW_WATER : DNGN_DEEP_WATER; + for (rectangle_iterator ri(0); ri; ++ri) + _shoals_smooth_at(*ri, 1); } static void _shoals_apply_level() { - for (int y = 1; y < GYM - 1; ++y) - for (int x = 1; x < GXM - 1; ++x) - grd[x][y] = _shoals_feature_at(x, y); + for (rectangle_iterator ri(1); ri; ++ri) + grd(*ri) = _shoals_feature_at(*ri); } static coord_def _pick_shoals_island() @@ -253,7 +309,8 @@ void prepare_shoals(int level_number) _shoals_init_heights(); _shoals_islands.clear(); _shoals_init_islands(shoals_depth); + _shoals_cliffs(); _shoals_smooth(); _shoals_apply_level(); - _shoals_furniture(6); + _shoals_furniture(_shoals_margin); } -- cgit v1.2.3-54-g00ecf From ec717839b67f5acc52044fca7820df71680f5ff6 Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Sun, 27 Dec 2009 02:46:16 +0530 Subject: Remove floor at corners of shoal huts. --- crawl-ref/source/dat/shoals.des | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crawl-ref/source/dat/shoals.des b/crawl-ref/source/dat/shoals.des index 4983347ecd..2b52eb6ade 100644 --- a/crawl-ref/source/dat/shoals.des +++ b/crawl-ref/source/dat/shoals.des @@ -243,13 +243,13 @@ SHUFFLE: ABCD SUBST: A:x, B:x, C:x=, D=+ LROCKTILE: wall_vines MAP -.xxCxx. + xxCxx xx...xx x.....x B..O..D x.....x xx...xx -.xxAxx + xxAxx ENDMAP ################################################################################ @@ -262,11 +262,11 @@ TAGS: allow_dup water_ok shoal no_dump SHUFFLE: ABCD SUBST: A:x, B:x, C:x=, D=+ MAP -.xxCxx. + xxCxx xx...xx x.....x B..|..D x.....x xx...xx -.xxAxx + xxAxx ENDMAP -- cgit v1.2.3-54-g00ecf From b9b709e2e741ad27b31193925ada1f47f3b0b935 Mon Sep 17 00:00:00 2001 From: David Ploog Date: Sun, 27 Dec 2009 02:10:10 +0100 Subject: Three new Vault:8 subvaults (Neil). Guarantee exactly one Vault:8 subvault rich in loot. --- crawl-ref/source/dat/vaults.des | 187 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 171 insertions(+), 16 deletions(-) diff --git a/crawl-ref/source/dat/vaults.des b/crawl-ref/source/dat/vaults.des index cee6e36ea2..274a32e4df 100644 --- a/crawl-ref/source/dat/vaults.des +++ b/crawl-ref/source/dat/vaults.des @@ -230,7 +230,7 @@ ENDMAP # NAME: metal_show ORIENT: float -DEPTH: Vault:3- +DEPTH: Vault:3-7 TAGS: no_secret_doors no_monster_gen no_item_gen no_wall_fixup COLOUR: M = magenta COLOUR: K = magenta @@ -325,7 +325,7 @@ lua_marker('e', portal_desc { teleport_spot=1}) lua_marker('m', portal_desc { teleport_spot=2}) }} ORIENT: float -DEPTH: Vault:3- +DEPTH: Vault:3-7 TAGS: no_secret_doors no_monster_gen no_item_gen uniq_the_teleporter \ patrolling COLOUR: ME = yellow @@ -489,8 +489,9 @@ ENDMAP # tagged vault8_room should just provide loot. Note that the rooms # are not all the same sizes. # +# about 24 | NAME: vault8_rooms -TAGS: vault8_quadrant +TAGS: vault8_quadrant uniq_vault8_prize SHUFFLE: AC/BD, EG/FH, IKN/MJL SUBST: A=., B=xx=, C=+, D=x, E=+, F=xx=, G=., H=x SUBST: I=., M=xx=, J=x, K=+, N=+, L=xx= @@ -613,7 +614,7 @@ ENDMAP ############################################################################## # Vault:8 - Cross Quadrant -# +# about 2 | NAME: vault8_cross TAGS: vault8_quadrant NSUBST: U = 1:. / *:xxxx= @@ -649,7 +650,7 @@ ENDMAP ############################################################################## # Vault:8 - Diamond Quadrant -# +# about 4 | NAME: vault8_diamond TAGS: vault8_quadrant SHUFFLE: !_ @@ -686,7 +687,7 @@ ENDMAP ############################################################################## # Vault:8 - Stripes Quadrant -# +# about 5 | NAME: vault8_stripes TAGS: vault8_quadrant # double use of Y=Y. and Z=Z. for decreasing variance @@ -725,7 +726,7 @@ ENDMAP ############################################################################## # Vault:8 - Clover Quadrant (by Mu.) -# +# about 4 | NAME: vault8_clover TAGS: vault8_quadrant SUBST: Q = 8 9 .:20 @@ -761,9 +762,9 @@ ENDMAP ############################################################################## # Vault:8 - Triangles Quadrant (by Mu.) -# +# about 19 | NAME: vault8_triangles -TAGS: vault8_quadrant +TAGS: vault8_quadrant uniq_vault8_prize SUBST: Q = 8 9 .:20 NSUBST: ? = 1:O / *:| SUBST: " = =:1 x:99 @@ -781,11 +782,11 @@ x..Q..xx..Q..xx****xx.Q...x x......xx.....xx**xx......x x....Q..xx..Q.."xxx|Q.....x x........xx.....xx||....Q.x -x......Q.*x"..Q.."x|Q.....x -x..Q.....**xx.....xx......x -x......Q.*xxx"..Q..xx.Q...x +x......Q.|x"..Q.."x|Q.....x +x..Q.....*|xx.....xx......x +x......Q.|xxx"..Q..xx.Q...x x........xx||xx.....xx....x -x....Q..xx||||xx..Q..xx.Q.x +x....Q..xx||||xx..Q..xx.Q|x x......xx..Q.Q.xx.....xx||x x..Q..xx........xx..Q..xx?x x....xx..Q.....Q.xx.....xxx @@ -798,9 +799,9 @@ ENDMAP ############################################################################## # Vault:8 - Not Diamond Quadrant (by Mu.) -# +# about 8 | NAME: vault8_not_diamond -TAGS: vault8_quadrant +TAGS: vault8_quadrant SUBST: Q = 8 9 *:20 : vault8_loot(_G) : vault8_rune(_G) @@ -832,7 +833,7 @@ ENDMAP ############################################################################## # Vault:8 - Boxes (by Mu.) -# +# about 11 | NAME: vault8_boxes TAGS: vault8_quadrant NSUBST: a = 1:+ / *:x @@ -877,6 +878,160 @@ x..........xxexx..........x xxxxxxxxxxxxxxxxxxxxxxxxx ENDMAP +############################################################################## +# Vault:8 - Corners Quadrant (by Mu.) +# about 25 | +NAME: vault8_corners +TAGS: vault8_quadrant uniq_vault8_prize +SUBST: Q = 8 9 .:10 +NSUBST: $ = 1:O / *:$ +SUBST: $ = | *:20 $ +SUBST: a = x. +: vault8_loot(_G) +: vault8_rune(_G) +MAP +xxxxxxxxxxxxxxxxxxxxxxxxxxx +x$$$$x.......xQQ...x..$$$$x +x$$$$x.......xQQ...x.x$$$$x +x$$$$x..xxx..x..x..x.x$$$$x +x$$$$x..xxx..x..x..x.x$$$$x +x.xxxx..xxx..x..x..x.xxxxxx +x.......xxx.....xQQ.......x +xxxxxx..xxx.....xQQ.......x +x.......xxxxxxxxxxxxxxxx..x +x.......xQQ...$$$$xQQ.....x +x..xxxxxxQQxxx$$$$xQQ.....x +xQQ.....x..xxx$$$$x..xxxxxx +xQQ.....x..xxx$$$$x.....QQx +xxxxxx..x..xxxxxxxx.....QQx +x.......x..xxxxxxxxxxxxx..x +x.......x.................x +x..xxxxxx.................x +xQQ.....x..xxxxxxxxx.xxxxxx +xQQ.....x..xxx$$$$xx.x$$$$x +xxxxxx..x..xxx$$$$xx.x$$$$x +a.......xQQxxx$$$$xx.x$$$$x + .......xQQ...$$$$xx..$$$$x + axxxxxxxxxxxxxxxxxxxxxxxx +ENDMAP + +############################################################################## +# Vault:8 - Flips Quadrant (by Mu.) +# about 21 | +NAME: vault8_flips +TAGS: vault8_quadrant uniq_vault8_prize +NSUBST: ; = 3:l / 3:z / 3:a / *:. +SUBST: Q = 8 9 +SUBST: $ = | * $ +KFEAT: l = teleport trap +KFEAT: z = zot trap +KFEAT: a = alarm trap +SUBST: s = .:250 =:1 +SUBST: a = x. +: vault8_loot(_G) +: vault8_rune(_G) +MAP +xxxxxxxxxxxxxxxxxxxxxxxxxxx +xQQQ......................x +xQQQxxxxxxxxxxxxxxxxxxxxs.x +xQQQ....................x.x +x.x.xxxxxxxxxxxxxxxxxxs.x.x +x.x.xQQQ..............x.x.x +x.x.xQQQxxxxxxxxxxxxs.x.x.x +x.x.xQQQ;;;;;;;;$$$$x.x.x.x +x.x.x.x;;;;;;;;;$$$$x.x.x.x +x.x.x.x;;;;;;;;;$$$$x.x.x.x +x.x.x.x;;;;;;;;;$$$$x.x.x.x +x.x.x.x;;;;;;;;;$$$$x.x.x.x +x.x.x.x;;;;;;;;;$$$$x.x.x.x +x.x.x.x$$$$$$$$$$$$$x.x.x.x +x.x.x.x$$$$$$$$$$$$$x.x.x.x +x.x.x.x$$$$$$$$$$$$Ox.x.x.x +x.x.x.sxxxxxxxxxxxxxx.x.x.x +x.x.x................QQQx.x +x.x.sxxxxxxxxxxxxxxxxQQQx.x +x.x..................QQQx.x +x.sxxxxxxxxxxxxxxxxxxxxxx.a +x......................... +xxxxxxxxxxxxxxxxxxxxxxxxa +ENDMAP + +############################################################################## +# Vault:8 - Construction Quadrant (by Mu.) +# about 21 | +NAME: vault8_construction +TAGS: vault8_quadrant uniq_vault8_prize +SUBST: Q = 8 9 . +NSUBST: $ = 1:O / *:$ +SUBST: $ = |*$. +SUBST: c = xnQ. +NSUBST: D = 1:+ / *:x +SUBST: a = xn.. +: vault8_loot(_G) +: vault8_rune(_G) +MAP + axxxxxxxxxxxxxxxxxxxxxxxx + ..c.c.c.c.c.c.c.c.c.c.c.cx +a.c.c.c.c.c.c.c.c.c.c.c.c.x +xc.c.c.c.c.c.c.c.c.c.c.c.cx +x.c.c.c.c.c.c.c.c.c.c.c.c.x +xc.c.c.c.c.c.c.c.c.c.c.c.cx +x.c.c.c.c.c.c.c.c.c.c.c.c.x +xc.c.c.c.c.c.c.c.c.c.c.c.cx +x.c.c.c.c.c.c.c.c.c.c.c.c.x +xc.c.c.c.c.c.c.c.c.c.c.c.cx +x.c.c.c.c.c.c.c.c.c.c.c.c.x +xDxDxDxDxDxDxDxDxDxDxDxDxDx +x.........................x +x.........................x +x.Qx..x..x..xQx..x..x..xQ.x +x.........................x +x.........................x +xxx+xxxx+xxxx+xxxx+xxxx+xxx +x$$$$x$$$$$x$$$x$$$$$x$$$$x +x$$$$x$$$$$x$$$x$$$$$x$$$$x +x$$$$x$$$$$x$$$x$$$$$x$$$$x +x$$$$x$$$$$x$$$x$$$$$x$$$$x +xxxxxxxxxxxxxxxxxxxxxxxxxxx +ENDMAP + +############################################################################## +# Vault:8 - Long Quadrant (by Mu.) +# about 8 | +NAME: vault8_long +TAGS: vault8_quadrant +SUBST: Q = 8 9 .:10 +NSUBST: $ = 1:O / *:$ +SUBST: $ = |**$ +SUBST: a = x. +: vault8_loot(_G) +: vault8_rune(_G) +MAP +xxxxxxxxxxxxxxxxxxxxxxxxa +x......................... +x.........................a +x.........................x +x..xxxxxxxxxxxxxxxxxxxxx..x +x....QQQ............$$$x..x +x....QQQ............$$$x..x +x..xxxxxxxxxxxxxxxxxxxxx..x +x..x$$$............QQQ....x +x..x$$$............QQQ....x +x..xxxxxxxxxxxxxxxxxxxxx..x +x....QQQ............$$$x..x +x....QQQ............$$$x..x +x..xxxxxxxxxxxxxxxxxxxxx..x +x..x$$$............QQQ....x +x..x$$$............QQQ....x +x..xxxxxxxxxxxxxxxxxxxxx..x +x....QQQ............$$$x..x +x....QQQ............$$$x..x +x..xxxxxxxxxxxxxxxxxxxxx..x +x.........................x +x.........................x +xxxxxxxxxxxxxxxxxxxxxxxxxxx +ENDMAP + ############################################################################## -- cgit v1.2.3-54-g00ecf From 8c410379d02b62467016224d62040a3075ec3a99 Mon Sep 17 00:00:00 2001 From: David Ploog Date: Sun, 27 Dec 2009 02:21:58 +0100 Subject: Slight changes to labyrinth vaults. --- crawl-ref/source/dat/lab.des | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/crawl-ref/source/dat/lab.des b/crawl-ref/source/dat/lab.des index e54833f85c..fd7c942d23 100644 --- a/crawl-ref/source/dat/lab.des +++ b/crawl-ref/source/dat/lab.des @@ -83,9 +83,10 @@ ENDMAP ############################################################################# # Green exit -NAME: labyrinth_green -TAGS: minotaur generate_loot allow_dup -MONS: patrolling minotaur +NAME: labyrinth_green +TAGS: minotaur generate_loot allow_dup +MONS: patrolling minotaur +WEIGHT: 2 MAP ........ .bbbbbb. @@ -119,7 +120,7 @@ ENDMAP NAME: labyrinth_hidden_loot TAGS: minotaur generate_loot allow_dup MONS: patrolling minotaur, minotaur zombie -SUBST: d = 2% +SUBST: d = 2%* SUBST: c : cvv MAP ............ @@ -183,11 +184,11 @@ WEIGHT: 2 MAP .............. .cccccccccccc. -.g..ddD+.cccc. +.g.dddD+.cccc. .c.ccccc.cccc. -.g..ddD+.+1 Date: Sat, 26 Dec 2009 22:17:45 +1000 Subject: Make steel ammo rarer before D:10. Centaurs with steel ammo seem to do an average of 17 to 20 damage, as opposed to another with flame ammo, which did between 5 and 10 damage per hit. At low levels, this is an instantaneous kill. --- crawl-ref/source/makeitem.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index 3d8421ade8..ee473f1a04 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -1849,7 +1849,8 @@ static special_missile_type _determine_missile_brand(const item_def& item, rc = SPMSL_REAPING; else if (temp_rand < 110) rc = SPMSL_SILVER; - else if (temp_rand < 120) + // Make steel rarer at lower levels. {due} + else if (temp_rand < 120 && (you.your_level > 10 || one_chance_in(3))) rc = SPMSL_STEEL; else if (temp_rand < 130) rc = SPMSL_DISPERSAL; -- cgit v1.2.3-54-g00ecf From 67a41e98876dfb01bc65f2a9c25b6f915bbaadea Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sun, 27 Dec 2009 08:48:41 +1000 Subject: Change some colours and glyphs as per FR#250. * Queen bees become yellow 'k'. * Bees become brown 'k'. * Queen ants become lightred 'a'. * Minotaurs become lightred 'H'. * Trapdoor spiders become lightcyan 's'. * Wolf spiders become white 's'. * Giant cockroaches become brown 's'. Of all of the changes, the most disconcerting may be the minotaur and the cockroach; the minotaur is not often seen, and as it is actually a hybrid, is more properly represented on the 'H' glyph. The giant cockroach is seen regularly throughout the early game, and it may cause confusion to old players who are used to brown 's' being either trapdoor spiders of wolf spiders. However, there are currently more insects on the 's' glyph than there are on the 'a' glyph, which itself is described as being dedicated to insects. As queen bees have been moved onto 'a', it makes more sense for them to be on their own on this glyph, similarly to the fact that bees are on their own on the 'k' glyph. This now means that the following glyphs are empty: 'i', 'Q', 't', '6'. --- crawl-ref/source/mon-data.h | 108 ++++++++++++++++++++++---------------------- 1 file changed, 53 insertions(+), 55 deletions(-) diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h index 4467317458..5d42867f4d 100644 --- a/crawl-ref/source/mon-data.h +++ b/crawl-ref/source/mon-data.h @@ -215,19 +215,7 @@ static monsterentry mondata[] = { // Real monsters begin here {dlb}: -// insects ('a') -{ - MONS_GIANT_COCKROACH, 'a', BROWN, "giant cockroach", - M_NO_SKELETON, - MR_NO_FLAGS, - 250, 10, MONS_GIANT_COCKROACH, MONS_GIANT_COCKROACH, MH_NATURAL, -1, - { {AT_BITE, AF_PLAIN, 2}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, - { 1, 3, 4, 0 }, - 3, 10, MST_NO_SPELLS, CE_CONTAMINATED, Z_SMALL, S_SILENT, - I_INSECT, HT_LAND, FL_NONE, 12, DEFAULT_ENERGY, - MONUSE_NOTHING, MONEAT_NOTHING, SIZE_TINY -}, - +// ants ('a') { MONS_GIANT_ANT, 'a', RED, "giant ant", M_NO_SKELETON, @@ -240,6 +228,18 @@ static monsterentry mondata[] = { MONUSE_NOTHING, MONEAT_NOTHING, SIZE_LITTLE }, +{ + MONS_QUEEN_ANT, 'a', LIGHTRED, "queen ant", + M_NO_SKELETON | M_NO_FLAGS, + MR_VUL_POISON, + 1200, 10, MONS_GIANT_ANT, MONS_QUEEN_ANT, MH_NATURAL, -3, + { {AT_STING, AF_POISON_NASTY, 20}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, + { 13, 3, 5, 0 }, + 14, 3, MST_NO_SPELLS, CE_POISONOUS, Z_SMALL, S_SILENT, + I_INSECT, HT_LAND, FL_NONE, 7, DEFAULT_ENERGY, + MONUSE_NOTHING, MONEAT_NOTHING, SIZE_SMALL +}, + { MONS_SOLDIER_ANT, 'a', LIGHTGREY, "soldier ant", M_NO_SKELETON, @@ -941,7 +941,19 @@ static monsterentry mondata[] = { // killer bees ('k') { - MONS_KILLER_BEE, 'k', YELLOW, "killer bee", + MONS_QUEEN_BEE, 'k', YELLOW, "queen bee", + M_NO_SKELETON, + MR_VUL_POISON, + 200, 14, MONS_KILLER_BEE, MONS_QUEEN_BEE, MH_NATURAL, -3, + { {AT_STING, AF_POISON_NASTY, 20}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, + { 7, 3, 5, 0 }, + 10, 10, MST_NO_SPELLS, CE_POISONOUS, Z_SMALL, S_SILENT, + I_INSECT, HT_LAND, FL_FLY, 10, DEFAULT_ENERGY, + MONUSE_NOTHING, MONEAT_NOTHING, SIZE_LITTLE +}, + +{ + MONS_KILLER_BEE, 'k', BROWN, "killer bee", M_NO_SKELETON, MR_VUL_POISON, 150, 11, MONS_KILLER_BEE, MONS_KILLER_BEE, MH_NATURAL, -3, @@ -1393,7 +1405,19 @@ static monsterentry mondata[] = { MONUSE_NOTHING, MONEAT_NOTHING, SIZE_LITTLE }, -// spiders and scorpions ('s') +// spiders and insects ('s') +{ + MONS_GIANT_COCKROACH, 's', BROWN, "giant cockroach", + M_NO_SKELETON, + MR_NO_FLAGS, + 250, 10, MONS_GIANT_COCKROACH, MONS_GIANT_COCKROACH, MH_NATURAL, -1, + { {AT_BITE, AF_PLAIN, 2}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, + { 1, 3, 4, 0 }, + 3, 10, MST_NO_SPELLS, CE_CONTAMINATED, Z_SMALL, S_SILENT, + I_INSECT, HT_LAND, FL_NONE, 12, DEFAULT_ENERGY, + MONUSE_NOTHING, MONEAT_NOTHING, SIZE_TINY +}, + { MONS_GIANT_MITE, 's', LIGHTRED, "giant mite", M_NO_SKELETON, @@ -1431,7 +1455,7 @@ static monsterentry mondata[] = { }, { - MONS_WOLF_SPIDER, 's', BROWN, "wolf spider", + MONS_WOLF_SPIDER, 's', WHITE, "wolf spider", M_NO_SKELETON, MR_VUL_POISON, 800, 10, MONS_WOLF_SPIDER, MONS_WOLF_SPIDER, MH_NATURAL, -3, @@ -1443,7 +1467,7 @@ static monsterentry mondata[] = { }, { - MONS_TRAPDOOR_SPIDER, 's', BROWN, "trapdoor spider", + MONS_TRAPDOOR_SPIDER, 's', LIGHTCYAN, "trapdoor spider", M_NO_SKELETON, MR_VUL_POISON, 800, 10, MONS_TRAPDOOR_SPIDER, MONS_TRAPDOOR_SPIDER, MH_NATURAL, -3, @@ -1466,19 +1490,6 @@ static monsterentry mondata[] = { MONUSE_NOTHING, MONEAT_NOTHING, SIZE_TINY }, -// minotaur ('t') -{ - MONS_MINOTAUR, 't', RED, "minotaur", - M_FIGHTER | M_WARM_BLOOD | M_SPEAKS, - MR_NO_FLAGS, - 1500, 10, MONS_MINOTAUR, MONS_MINOTAUR, MH_NATURAL, -3, - { {AT_HIT, AF_PLAIN, 35}, {AT_GORE, AF_PLAIN, 20}, AT_NO_ATK, AT_NO_ATK }, - { 13, 3, 5, 0 }, - 5, 7, MST_NO_SPELLS, CE_CONTAMINATED, Z_BIG, S_BELLOW, - I_NORMAL, HT_LAND, FL_NONE, 10, DEFAULT_ENERGY, - MONUSE_WEAPONS_ARMOUR, MONEAT_NOTHING, SIZE_MEDIUM -}, - // ugly things ('u') { MONS_UGLY_THING, 'u', BLACK, "ugly thing", @@ -2365,6 +2376,18 @@ static monsterentry mondata[] = { MONUSE_OPEN_DOORS, MONEAT_NOTHING, SIZE_BIG }, +{ + MONS_MINOTAUR, 'H', LIGHTRED, "minotaur", + M_FIGHTER | M_WARM_BLOOD | M_SPEAKS, + MR_NO_FLAGS, + 1500, 10, MONS_MINOTAUR, MONS_MINOTAUR, MH_NATURAL, -3, + { {AT_HIT, AF_PLAIN, 35}, {AT_GORE, AF_PLAIN, 20}, AT_NO_ATK, AT_NO_ATK }, + { 13, 3, 5, 0 }, + 5, 7, MST_NO_SPELLS, CE_CONTAMINATED, Z_BIG, S_BELLOW, + I_NORMAL, HT_LAND, FL_NONE, 10, DEFAULT_ENERGY, + MONUSE_WEAPONS_ARMOUR, MONEAT_NOTHING, SIZE_MEDIUM +}, + { MONS_GRIFFON, 'H', YELLOW, "griffon", M_WARM_BLOOD, @@ -2777,31 +2800,6 @@ static monsterentry mondata[] = { MONUSE_NOTHING, MONEAT_NOTHING, SIZE_BIG }, -// queen insects ('Q') -{ - MONS_QUEEN_BEE, 'Q', YELLOW, "queen bee", - M_NO_SKELETON, - MR_VUL_POISON, - 200, 14, MONS_KILLER_BEE, MONS_QUEEN_BEE, MH_NATURAL, -3, - { {AT_STING, AF_POISON_NASTY, 20}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, - { 7, 3, 5, 0 }, - 10, 10, MST_NO_SPELLS, CE_POISONOUS, Z_SMALL, S_SILENT, - I_INSECT, HT_LAND, FL_FLY, 10, DEFAULT_ENERGY, - MONUSE_NOTHING, MONEAT_NOTHING, SIZE_LITTLE -}, - -{ - MONS_QUEEN_ANT, 'Q', LIGHTGREY, "queen ant", - M_NO_SKELETON | M_NO_FLAGS, - MR_VUL_POISON, - 1200, 10, MONS_GIANT_ANT, MONS_QUEEN_ANT, MH_NATURAL, -3, - { {AT_STING, AF_POISON_NASTY, 20}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, - { 13, 3, 5, 0 }, - 14, 3, MST_NO_SPELLS, CE_POISONOUS, Z_SMALL, S_SILENT, - I_INSECT, HT_LAND, FL_NONE, 7, DEFAULT_ENERGY, - MONUSE_NOTHING, MONEAT_NOTHING, SIZE_SMALL -}, - // rakshasas ('R') { MONS_RAKSHASA, 'R', YELLOW, "rakshasa", -- cgit v1.2.3-54-g00ecf From caa3c8aacc375d4b6caf03670bf216d624af9de4 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sun, 27 Dec 2009 12:25:16 +1000 Subject: Make berserk monsters ignore unsafe clouds (FR256). --- crawl-ref/source/mon-stuff.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc index e746fd5d07..22917b895e 100644 --- a/crawl-ref/source/mon-stuff.cc +++ b/crawl-ref/source/mon-stuff.cc @@ -3126,6 +3126,11 @@ bool mons_avoids_cloud(const monsters *monster, cloud_struct cloud, if (placement) extra_careful = true; + // Berserk monsters are less careful and will blindly plow through any + // dangerous cloud, just to kill you. {due} + if (!extra_careful && monster->berserk()) + return (true); + switch (cl_type) { case CLOUD_MIASMA: -- cgit v1.2.3-54-g00ecf From 359d6d7fe959bd89ee94cb03732e22408bdc7aff Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sun, 27 Dec 2009 12:28:17 +1000 Subject: Fix ugly things/butterflies going black while Misled. --- crawl-ref/source/showsymb.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crawl-ref/source/showsymb.cc b/crawl-ref/source/showsymb.cc index 50a6272d41..6f3c77fea6 100644 --- a/crawl-ref/source/showsymb.cc +++ b/crawl-ref/source/showsymb.cc @@ -60,6 +60,14 @@ static int _get_mons_colour(const monsters *mons) { const monsterentry* mdat = get_monster_data(mons->get_mislead_type()); col = mdat->colour; + // Some monsters (specifically, ugly things and butterflies) are generated + // black. Ugly things are an object of mislead, but never a subject; however + // if a monster summons ugly things (such as Kirke) while under the Misled + // status effect, they will show up black instead of their assigned colour. + // Likewise with any other black-coloured monsters on-screen but not yet + // mislead. {due} + if (col == BLACK) + col = mons->colour; } if (mons->berserk()) -- cgit v1.2.3-54-g00ecf From 061e97f1722560e2180323b3e38c76add540b4b6 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sun, 27 Dec 2009 12:57:27 +1000 Subject: Fix "shot with an orcish bolt by a yellow wasp" during Mislead. Hopefully that's every occurence. --- crawl-ref/source/hiscores.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc index a64b191e73..bf684601c8 100644 --- a/crawl-ref/source/hiscores.cc +++ b/crawl-ref/source/hiscores.cc @@ -777,6 +777,13 @@ void scorefile_entry::init_death_cause(int dam, int dsrc, death_type = dtype; damage = dam; + // Save this here. We don't want to completely remove the status, as that + // would look odd in the "screenshot", but having DUR_MISLED as a non-zero + // value at his point in time will generate such odities as "killed by a + // golden eye, wielding an orcish crossbo [19 damage]", etc. {due} + int misled = you.duration[DUR_MISLED]; + you.duration[DUR_MISLED] = 0; + // Set the default aux data value... // If aux is passed in (ie for a trap), we'll default to that. if (aux == NULL) @@ -887,6 +894,9 @@ void scorefile_entry::init_death_cause(int dam, int dsrc, if (auxkilldata.empty()) auxkilldata = "unknown source"; } + + // And restore it here. + you.duration[DUR_MISLED] = misled; } void scorefile_entry::reset() -- cgit v1.2.3-54-g00ecf From 79479ce91ed4542ed9ceec458f9260cc5d579283 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sun, 27 Dec 2009 13:45:19 +1000 Subject: Don't mark milestones for summoned ghosts or uniques. This should also hopefully deal with summoned ghosts in the kills tracker. --- crawl-ref/source/kills.cc | 9 +++++++-- crawl-ref/source/mon-stuff.cc | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/crawl-ref/source/kills.cc b/crawl-ref/source/kills.cc index f0ea8ee3f0..3d577cb283 100644 --- a/crawl-ref/source/kills.cc +++ b/crawl-ref/source/kills.cc @@ -279,7 +279,8 @@ void Kills::merge(const Kills &k) void Kills::record_kill(const struct monsters *mon) { - // Handle player ghosts separately. + // Handle player ghosts separately, but don't handle summoned + // ghosts at all. {due} if (mon->type == MONS_PLAYER_GHOST && !mon->is_summoned()) { record_ghost_kill(mon); @@ -365,6 +366,9 @@ void Kills::load(reader& inf) void Kills::record_ghost_kill(const struct monsters *mon) { + // We should never get to this point, but just in case... {due} + if (mon->is_summoned()) + return; kill_ghost ghostk(mon); ghosts.push_back(ghostk); } @@ -482,7 +486,8 @@ void kill_def::merge(const kill_def &k, bool uniq) void kill_def::add_kill(const struct monsters *mon, unsigned short place) { kills++; - add_place(place, mons_is_unique(mon->type)); + // They're only unique if they aren't summoned. + add_place(place, mons_is_unique(mon->type) && !mon->is_summoned()); } void kill_def::add_place(unsigned short place, bool force) diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc index 22917b895e..d8f0a8e7a2 100644 --- a/crawl-ref/source/mon-stuff.cc +++ b/crawl-ref/source/mon-stuff.cc @@ -533,6 +533,7 @@ static void _check_kill_milestone(const monsters *mons, if (mons->props.exists("original_was_unique")) is_unique = mons->props["original_was_unique"].get_bool(); + // Don't give milestones for summoned ghosts {due} if (mons->type == MONS_PLAYER_GHOST && !mons->is_summoned()) { std::string milestone = _milestone_kill_verb(killer) + "the ghost of "; @@ -540,7 +541,8 @@ static void _check_kill_milestone(const monsters *mons, milestone += "."; mark_milestone("ghost", milestone); } - else if (is_unique) + // Or summoned uniques, which a summoned ghost is treated as {due} + else if (is_unique && !mons->is_summoned()) { mark_milestone("unique", _milestone_kill_verb(killer) -- cgit v1.2.3-54-g00ecf From 04eb4061b739269ea4fe9d30a899a49b45116ecd Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sun, 27 Dec 2009 18:01:52 +1000 Subject: Update prebuilt level compiler files for TILE specifier. Hopefully I've done this right. --- crawl-ref/source/prebuilt/levcomp.lex.cc | 2339 +++++++++++++++--------------- crawl-ref/source/prebuilt/levcomp.tab.cc | 752 +++++----- crawl-ref/source/prebuilt/levcomp.tab.h | 50 +- 3 files changed, 1620 insertions(+), 1521 deletions(-) diff --git a/crawl-ref/source/prebuilt/levcomp.lex.cc b/crawl-ref/source/prebuilt/levcomp.lex.cc index 09810f30db..25a0dd73f8 100644 --- a/crawl-ref/source/prebuilt/levcomp.lex.cc +++ b/crawl-ref/source/prebuilt/levcomp.lex.cc @@ -9,7 +9,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 33 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -31,7 +31,7 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. @@ -54,7 +54,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -85,6 +84,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -94,11 +95,12 @@ typedef unsigned int flex_uint32_t; #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST @@ -140,7 +142,15 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -191,14 +201,9 @@ extern FILE *yyin, *yyout; #define unput(c) yyunput( c, (yytext_ptr) ) -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; +typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -377,8 +382,8 @@ static void yy_fatal_error (yyconst char msg[] ); *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 81 -#define YY_END_OF_BUFFER 82 +#define YY_NUM_RULES 82 +#define YY_END_OF_BUFFER 83 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -386,129 +391,130 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[1096] = +static yyconst flex_int16_t yy_accept[1111] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 82, 80, 77, 78, - 79, 75, 80, 73, 76, 74, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 77, 34, 36, 80, 80, 80, 80, 80, - 80, 81, 6, 81, 81, 4, 2, 3, 81, 2, - 2, 2, 2, 9, 10, 81, 9, 9, 81, 12, - 81, 32, 77, 33, 79, 32, 32, 32, 32, 32, + 0, 0, 0, 0, 0, 0, 83, 81, 78, 79, + 80, 76, 81, 74, 77, 75, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 78, 34, 36, 81, 81, 81, 81, 81, + 81, 82, 6, 82, 82, 4, 2, 3, 82, 2, + 2, 2, 2, 9, 10, 82, 9, 9, 82, 12, + 82, 32, 78, 33, 80, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 77, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 78, 32, 32, - 32, 32, 32, 32, 32, 32, 80, 28, 23, 28, - 75, 80, 27, 76, 74, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 28, 34, 36, 80, 80, 80, 80, 80, - 80, 15, 16, 79, 13, 13, 13, 13, 13, 13, + 32, 32, 32, 32, 32, 32, 81, 28, 23, 28, + 76, 81, 27, 77, 75, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 28, 34, 36, 81, 81, 81, 81, 81, + 81, 15, 16, 80, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 80, 13, 15, 13, 13, 13, 13, 13, - 81, 21, 22, 81, 20, 81, 77, 78, 76, 0, + 13, 13, 81, 13, 15, 13, 13, 13, 13, 13, + 82, 21, 22, 82, 20, 82, 78, 79, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 34, 36, 0, 0, 0, - 0, 34, 0, 0, 0, 0, 0, 0, 0, 39, - 6, 5, 0, 0, 2, 3, 2, 0, 2, 2, - 2, 2, 9, 9, 10, 9, 9, 9, 0, 11, - 0, 12, 31, 0, 31, 77, 33, 0, 0, 33, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, + 0, 0, 0, 0, 0, 78, 34, 36, 0, 0, + 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, + 39, 6, 5, 0, 0, 2, 3, 2, 0, 2, + 2, 2, 2, 9, 9, 10, 9, 9, 9, 0, + 11, 0, 12, 31, 0, 31, 78, 33, 0, 0, + 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 0, 30, 31, 77, 31, - 34, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 26, 0, 26, 28, 23, 28, 0, 23, 26, 26, + 31, 31, 31, 31, 31, 31, 31, 0, 30, 31, + 78, 31, 34, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 26, 0, 26, 28, 23, 28, 0, 23, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 0, 25, 0, 26, 28, 26, 34, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 15, - 16, 0, 0, 0, 16, 13, 13, 13, 13, 13, + 26, 26, 26, 26, 26, 26, 0, 25, 0, 26, + 28, 26, 34, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 15, 16, 0, 0, 0, 16, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 0, 14, 13, 15, 13, 13, 13, 13, 13, - 13, 13, 19, 0, 19, 21, 22, 0, 0, 0, - 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, + 13, 13, 13, 13, 13, 0, 14, 13, 15, 13, + 13, 13, 13, 13, 13, 13, 19, 0, 19, 21, + 22, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2, 9, 9, 9, - 7, 0, 0, 29, 0, 31, 31, 31, 31, 31, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2, 9, 9, 9, 7, 0, 0, 29, 0, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 34, 31, 31, 31, 31, 31, 31, 0, - 24, 0, 26, 26, 26, 26, 26, 26, 26, 26, + 31, 31, 31, 31, 31, 31, 31, 31, 34, 31, + 31, 31, 31, 31, 31, 0, 24, 0, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 34, - 34, 26, 26, 26, 26, 26, 26, 13, 13, 13, + 26, 26, 26, 26, 26, 26, 34, 34, 26, 26, + 26, 26, 26, 26, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, + 13, 13, 13, 13, 13, 13, 13, 13, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 35, 0, 0, 0, 0, 0, 2, - 9, 8, 0, 9, 7, 0, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 35, 0, 0, 0, 0, 0, 2, 9, + 8, 0, 9, 7, 0, 31, 31, 31, 31, 31, + 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 0, 0, 31, 31, 31, 31, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 0, 0, 26, 26, 26, 26, 13, 13, 13, 13, + 26, 0, 0, 26, 26, 26, 26, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 0, 0, - 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 63, 42, 0, 0, 0, 0, - 0, 0, 0, 51, 0, 0, 0, 38, 0, 0, - 0, 0, 2, 31, 31, 31, 31, 31, 31, 31, + 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 64, 42, 0, 0, + 0, 0, 0, 0, 0, 51, 63, 0, 0, 0, + 38, 0, 0, 0, 0, 2, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 0, 31, 26, 26, 26, + 31, 31, 31, 31, 31, 31, 31, 31, 31, 0, + 31, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, - 26, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 26, 26, 26, 26, 0, 26, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 0, 0, - 0, 44, 50, 61, 67, 68, 70, 69, 71, 0, - 0, 0, 0, 0, 0, 0, 46, 62, 0, 54, - 0, 0, 0, 0, 0, 0, 41, 1, 31, 31, + 13, 13, 13, 0, 0, 0, 44, 50, 61, 68, + 69, 71, 70, 72, 0, 0, 0, 0, 0, 0, + 0, 46, 62, 0, 54, 0, 0, 0, 0, 0, + 0, 41, 1, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 26, 26, 26, + 31, 31, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - - 26, 26, 26, 26, 26, 26, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 53, 48, 56, 52, 0, 0, 0, - 0, 65, 55, 45, 0, 0, 49, 0, 0, 0, - 0, 1, 31, 31, 31, 31, 31, 31, 31, 31, + 26, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 53, 48, + 56, 52, 0, 0, 0, 0, 66, 55, 45, 0, + 0, 49, 0, 0, 0, 0, 1, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 31, 31, 31, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 0, 0, - 0, 0, 66, 0, 47, 0, 0, 0, 0, 31, - - 31, 31, 31, 31, 31, 31, 31, 0, 31, 31, - 26, 26, 26, 26, 26, 26, 26, 26, 0, 26, - 26, 13, 13, 13, 13, 13, 13, 13, 0, 0, - 58, 0, 72, 0, 37, 0, 0, 31, 31, 31, - 31, 31, 31, 31, 0, 31, 26, 26, 26, 26, - 26, 26, 26, 0, 26, 13, 13, 13, 13, 57, - 0, 60, 0, 40, 31, 31, 31, 31, 31, 26, - 26, 26, 26, 26, 13, 13, 59, 0, 31, 31, - 26, 26, 13, 0, 31, 26, 13, 0, 31, 26, - 13, 43, 31, 26, 0 - + 26, 26, 26, 13, 13, 13, 13, 13, 13, 13, + + 13, 13, 13, 0, 0, 0, 0, 67, 0, 47, + 0, 0, 0, 0, 31, 31, 31, 31, 31, 31, + 31, 31, 0, 31, 31, 26, 26, 26, 26, 26, + 26, 26, 26, 0, 26, 26, 13, 13, 13, 13, + 13, 13, 13, 0, 0, 58, 0, 73, 0, 37, + 0, 0, 31, 31, 31, 31, 31, 31, 31, 0, + 31, 26, 26, 26, 26, 26, 26, 26, 0, 26, + 13, 13, 13, 13, 57, 0, 60, 0, 40, 31, + 31, 31, 31, 31, 26, 26, 26, 26, 26, 13, + 13, 59, 0, 31, 31, 26, 26, 13, 0, 31, + + 26, 13, 0, 31, 26, 13, 43, 31, 26, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -553,261 +559,263 @@ static yyconst flex_int32_t yy_meta[52] = 1 } ; -static yyconst flex_int16_t yy_base[1113] = +static yyconst flex_int16_t yy_base[1128] = { 0, 0, 50, 54, 61, 65, 67, 50, 69, 118, 168, - 218, 268, 318, 368, 77, 173, 2459, 3602, 72, 3602, - 2451, 3602, 2438, 3602, 2435, 3602, 2426, 56, 2418, 60, - 2403, 77, 72, 76, 74, 2398, 2398, 2377, 65, 2390, - 2385, 2360, 417, 0, 3602, 158, 2339, 2338, 63, 70, - 2324, 3602, 3602, 2361, 183, 3602, 0, 3602, 2353, 187, - 0, 2329, 155, 2301, 3602, 2344, 64, 2293, 180, 3602, - 2337, 273, 280, 3602, 373, 380, 385, 390, 395, 399, + 218, 268, 318, 368, 77, 173, 2365, 3660, 72, 3660, + 2361, 3660, 2350, 3660, 2345, 3660, 2335, 56, 2335, 60, + 2310, 77, 72, 76, 74, 2311, 2309, 2294, 65, 93, + 2301, 2274, 417, 0, 3660, 158, 2263, 2260, 63, 72, + 2254, 3660, 3660, 2289, 183, 3660, 0, 3660, 2285, 187, + 0, 2260, 155, 2224, 3660, 2263, 133, 2214, 191, 3660, + 2257, 273, 280, 3660, 373, 380, 385, 390, 395, 399, 422, 433, 437, 445, 460, 494, 479, 498, 488, 502, - 522, 530, 534, 538, 543, 572, 548, 577, 554, 566, - - 583, 588, 593, 600, 604, 609, 274, 617, 3602, 627, - 381, 589, 3602, 632, 386, 453, 443, 643, 645, 651, - 656, 661, 670, 687, 666, 683, 668, 704, 652, 706, - 710, 714, 723, 728, 729, 733, 738, 742, 746, 760, - 754, 780, 3602, 797, 2322, 2319, 0, 2302, 175, 2302, - 172, 2281, 179, 176, 186, 168, 2281, 2282, 2273, 266, - 2283, 2278, 285, 2256, 803, 268, 2238, 2238, 68, 173, - 774, 808, 3602, 814, 3602, 818, 289, 3602, 2269, 2254, - 2261, 2248, 2238, 2251, 2227, 2226, 2217, 2201, 279, 2201, - 2192, 2185, 2182, 2180, 2171, 2158, 2167, 2168, 2145, 2132, - - 2139, 2129, 275, 2107, 0, 0, 3602, 2092, 2093, 264, - 2086, 0, 187, 2092, 2079, 2102, 356, 2069, 2061, 3602, - 3602, 3602, 2083, 300, 0, 3602, 0, 2079, 428, 2047, - 2032, 255, 2005, 1998, 3602, 265, 1997, 822, 368, 3602, - 2041, 3602, 826, 831, 837, 842, 3602, 852, 860, 3602, - 865, 877, 881, 886, 891, 900, 904, 913, 927, 918, - 932, 936, 950, 956, 964, 968, 973, 977, 984, 1002, - 1009, 1016, 1020, 1024, 1036, 1059, 3602, 1031, 0, 1045, - 1063, 1070, 1074, 1079, 1083, 1087, 1091, 1106, 1115, 1123, - 922, 941, 1128, 1140, 3602, 1149, 1162, 3602, 945, 1099, - - 982, 1133, 1144, 1134, 1168, 1169, 1175, 1051, 1180, 1176, - 1185, 1186, 1193, 1192, 1194, 1212, 1221, 1228, 1229, 1230, - 1234, 1235, 1247, 1255, 3602, 1270, 1241, 0, 1279, 1287, - 1295, 1300, 1301, 1305, 1306, 1307, 1313, 1311, 1315, 1321, - 3602, 1357, 1361, 1347, 3602, 0, 2032, 2018, 2020, 2007, - 1998, 2012, 2000, 2001, 1992, 1977, 460, 1976, 1978, 1973, - 1970, 1964, 1961, 1952, 1961, 1956, 1943, 1928, 1940, 1928, - 422, 1365, 3602, 1899, 0, 423, 1899, 1893, 1917, 382, - 1883, 1877, 1342, 1352, 1369, 1376, 3602, 1381, 1386, 1391, - 1395, 3602, 1403, 1906, 1891, 1886, 1878, 1886, 1880, 1875, - - 1870, 1856, 1842, 1833, 1822, 462, 1832, 1822, 1814, 1789, - 1790, 1782, 1778, 1767, 1770, 444, 1750, 1754, 1757, 1733, - 1410, 480, 1726, 1733, 1715, 1711, 1711, 1415, 1419, 1429, - 3602, 1433, 1437, 3602, 1441, 1446, 1423, 1450, 1458, 1463, - 1471, 1482, 1486, 1492, 1498, 1506, 1510, 1521, 1514, 1534, - 1538, 1542, 1548, 1559, 1570, 1576, 1584, 1588, 1594, 1608, - 1599, 1604, 1628, 1633, 1640, 1644, 1648, 1652, 1656, 1662, - 3602, 1667, 1582, 1672, 1620, 1657, 1676, 1680, 1698, 1700, - 1704, 1712, 1714, 1723, 1724, 1729, 1469, 1722, 1736, 1741, - 1743, 1760, 1761, 1765, 1772, 1779, 1784, 1777, 1785, 1813, - - 1821, 1825, 1796, 1808, 1806, 1830, 1831, 1719, 1704, 1695, - 1689, 1699, 1688, 1685, 1695, 1684, 1666, 1668, 1662, 528, - 1669, 1657, 1643, 1634, 1627, 1611, 1611, 1596, 1598, 480, - 1577, 1578, 1576, 1546, 1835, 764, 1537, 1543, 1525, 1522, - 1849, 3602, 1853, 1541, 1543, 1523, 1534, 1521, 1518, 1519, - 1499, 1499, 1499, 1490, 1485, 1486, 1456, 1456, 1461, 1457, - 1452, 1431, 1431, 1430, 1412, 1392, 1378, 1390, 1390, 1381, - 1367, 1328, 1859, 3602, 995, 1325, 1297, 1302, 1451, 1325, - 1865, 3602, 1873, 1877, 3602, 1883, 1887, 1892, 1897, 1906, - 1910, 1916, 1932, 1944, 1948, 1953, 1957, 1961, 1966, 1976, - - 1989, 1993, 2002, 2011, 2015, 2025, 2030, 2036, 2050, 2057, - 2062, 2068, 2074, 2079, 2085, 2096, 2091, 2100, 2108, 2114, - 2119, 1937, 1888, 2120, 2125, 2127, 2142, 2156, 2132, 2168, - 2034, 2169, 2137, 2072, 2173, 2174, 2178, 2180, 2182, 2184, - 2196, 2216, 2218, 2222, 2223, 2224, 2234, 2236, 2240, 2242, - 2258, 2247, 2263, 2268, 2274, 2279, 1315, 1318, 1299, 1307, - 1291, 1284, 1283, 1263, 1268, 1264, 1256, 1257, 1260, 1251, - 1254, 1250, 1254, 1249, 1225, 1227, 1234, 1228, 1220, 1194, - 1211, 1204, 1192, 1181, 1158, 1154, 1164, 1565, 1170, 1166, - 1147, 1149, 1148, 1147, 3602, 1144, 1143, 1128, 1117, 1112, - - 1083, 1083, 282, 1078, 3602, 3602, 1075, 1068, 1085, 1078, - 1053, 1057, 1026, 3602, 1023, 1027, 1004, 3602, 1005, 1003, - 1792, 982, 1003, 2287, 2283, 2297, 2303, 2319, 2323, 2332, - 2337, 2341, 2357, 2361, 2366, 2375, 2346, 2380, 2384, 2389, - 2395, 2402, 2412, 2416, 2427, 2421, 2436, 2448, 2453, 2459, - 2464, 2468, 2472, 2477, 2482, 2491, 2496, 2500, 2504, 2407, - 2473, 2517, 2522, 2355, 2531, 2535, 2543, 2548, 2549, 2557, - 2562, 2567, 2566, 2523, 2571, 2572, 2583, 2584, 2588, 2603, - 2608, 2607, 2619, 2620, 2624, 2626, 2628, 2630, 2635, 2639, - 2643, 997, 1006, 987, 998, 990, 989, 984, 980, 978, - - 952, 951, 921, 913, 490, 904, 897, 883, 899, 895, - 879, 887, 866, 866, 867, 847, 847, 844, 866, 863, - 862, 3602, 3602, 3602, 3602, 3602, 3602, 3602, 3602, 859, - 513, 841, 839, 847, 846, 840, 3602, 3602, 834, 3602, - 826, 836, 820, 787, 791, 756, 3602, 792, 2648, 2675, - 2680, 2671, 2686, 2692, 2696, 2700, 2707, 2712, 2718, 2724, - 2735, 2728, 2739, 2744, 2760, 2771, 2776, 2780, 2784, 2788, - 2792, 2798, 2803, 2820, 2824, 2830, 2835, 2756, 2839, 2840, - 2664, 2752, 2812, 2841, 2848, 2852, 2856, 2858, 2866, 2864, - 2879, 2883, 2884, 2895, 2900, 2906, 2908, 2915, 2919, 2920, - - 2921, 2929, 2934, 2935, 2940, 2947, 782, 781, 779, 778, - 584, 761, 759, 766, 763, 762, 755, 746, 755, 744, - 710, 717, 707, 3602, 3602, 3602, 3602, 726, 729, 718, - 705, 3602, 3602, 3602, 709, 689, 3602, 698, 694, 1893, - 664, 693, 2955, 2961, 2972, 2981, 2987, 2996, 3000, 3004, - 3008, 3016, 3021, 3025, 3036, 3040, 3045, 3059, 3050, 3068, - 3031, 3057, 3063, 3072, 3074, 3076, 3081, 3086, 3082, 3088, - 3094, 3110, 3122, 3123, 3128, 3129, 3130, 3136, 667, 672, - 640, 631, 639, 618, 629, 623, 1972, 589, 602, 593, - 604, 586, 3602, 572, 3602, 535, 2200, 517, 2205, 3142, - - 3146, 3150, 3171, 3182, 3187, 3191, 3196, 3200, 3205, 3209, - 3192, 3210, 3216, 3236, 3227, 3234, 3247, 3252, 3256, 3258, - 3262, 540, 539, 550, 532, 508, 480, 3218, 504, 492, - 3602, 482, 3602, 448, 3602, 3268, 429, 3272, 3281, 3276, - 3290, 3299, 3315, 3319, 3324, 3328, 3333, 3334, 3270, 3335, - 3308, 3344, 3350, 3355, 3356, 444, 427, 424, 375, 3602, - 399, 3602, 365, 3602, 3360, 3382, 3394, 3398, 3405, 3378, - 3399, 3387, 3410, 3414, 393, 354, 3602, 332, 3416, 3421, - 3422, 3426, 260, 231, 3434, 3430, 166, 167, 3448, 3470, - 105, 3602, 3442, 3453, 3602, 3505, 3511, 3517, 3523, 3529, - - 3535, 3541, 3547, 3553, 3559, 3565, 3571, 3577, 3583, 3589, - 55, 3595 + 522, 530, 534, 538, 543, 572, 548, 577, 566, 583, + + 587, 591, 600, 606, 611, 615, 274, 625, 3660, 651, + 381, 631, 3660, 632, 386, 453, 443, 646, 656, 657, + 672, 666, 697, 701, 680, 670, 706, 714, 737, 716, + 724, 718, 758, 743, 562, 752, 720, 738, 764, 762, + 769, 803, 3660, 809, 2248, 2239, 0, 2226, 176, 2220, + 173, 2200, 181, 182, 259, 168, 2190, 2194, 2181, 267, + 192, 2189, 286, 2159, 813, 268, 2135, 2132, 246, 79, + 786, 820, 3660, 824, 3660, 828, 292, 3660, 2162, 2134, + 2133, 2121, 2110, 2119, 2110, 2111, 2109, 2093, 289, 2094, + 2090, 2086, 2078, 2080, 2080, 2068, 2078, 2082, 2071, 2059, + + 2074, 2068, 2057, 277, 2041, 0, 0, 3660, 2028, 2029, + 267, 2017, 0, 187, 2028, 2019, 2042, 356, 2006, 1997, + 3660, 3660, 3660, 2034, 428, 0, 3660, 0, 2030, 470, + 2011, 1999, 390, 1949, 1948, 3660, 260, 1947, 832, 368, + 3660, 1987, 3660, 837, 841, 847, 862, 3660, 866, 875, + 3660, 882, 886, 890, 894, 900, 907, 911, 922, 932, + 939, 946, 950, 956, 960, 964, 984, 973, 992, 999, + 1009, 1021, 1013, 1026, 1031, 1047, 1053, 1060, 3660, 1065, + 0, 1071, 1076, 1081, 1085, 1089, 1094, 1105, 1117, 1126, + 1131, 1139, 928, 1004, 1144, 1151, 3660, 1155, 1167, 3660, + + 1162, 1103, 1110, 1160, 1175, 1180, 1186, 1187, 1194, 1196, + 1203, 1204, 1212, 1218, 1223, 1230, 1232, 1238, 1239, 1246, + 1259, 1244, 1261, 1266, 1267, 1282, 1295, 3660, 1305, 1281, + 0, 1309, 1317, 1329, 1322, 1310, 1290, 1334, 1335, 1351, + 1288, 1353, 1363, 3660, 1369, 1373, 1357, 3660, 0, 1974, + 1956, 1965, 1951, 1941, 1952, 1940, 1915, 1912, 1897, 503, + 1898, 1901, 1892, 1889, 1891, 1890, 1882, 1892, 1894, 1885, + 1873, 1880, 1872, 1846, 283, 1380, 3660, 1830, 0, 415, + 1822, 1816, 1840, 431, 1805, 1794, 1385, 1389, 1397, 1403, + 3660, 1407, 1411, 1417, 1423, 3660, 1431, 1816, 1802, 1789, + + 1780, 1787, 1781, 1774, 1785, 1775, 1758, 1760, 1748, 528, + 1755, 1740, 1724, 1736, 1738, 1718, 1713, 1692, 1697, 449, + 1684, 1693, 1686, 1686, 1659, 1441, 508, 1652, 1661, 1647, + 1630, 1647, 1445, 1451, 1457, 3660, 1461, 1465, 3660, 1469, + 1474, 1478, 1484, 1489, 1493, 1501, 1512, 1525, 1529, 1537, + 1547, 1551, 1557, 1561, 1575, 1583, 1589, 1595, 1599, 1610, + 1603, 1615, 1624, 1635, 1639, 1644, 1656, 1662, 1673, 1678, + 1682, 1688, 1698, 1702, 1707, 1716, 3660, 1736, 1505, 1720, + 1722, 1729, 1650, 1742, 1743, 1754, 1756, 1760, 1767, 1769, + 1774, 1779, 1780, 1778, 1795, 1805, 1815, 1816, 1820, 1821, + + 1831, 1822, 1832, 1840, 1833, 1841, 1869, 1877, 1881, 1858, + 1694, 1860, 1885, 1887, 1655, 1636, 1626, 1620, 1628, 1618, + 1611, 1622, 1615, 1601, 1597, 1595, 536, 1606, 1588, 1565, + 1573, 1575, 1566, 1566, 1551, 1556, 456, 1539, 1551, 1539, + 1535, 1512, 1894, 619, 1503, 1516, 1502, 1492, 1898, 3660, + 1907, 1513, 1507, 1489, 1495, 1471, 1482, 1480, 1459, 1459, + 1458, 1447, 1447, 1438, 1424, 1418, 1422, 1419, 1418, 1399, + 1397, 1401, 1400, 1385, 1366, 1383, 1383, 1377, 1360, 1352, + 1315, 1932, 3660, 790, 1304, 1301, 1311, 856, 1330, 1936, + 3660, 1940, 1944, 3660, 1948, 1953, 1958, 1962, 1966, 1972, + + 1979, 1919, 1987, 2001, 2006, 2015, 2011, 2019, 2026, 2047, + 2030, 2054, 2067, 2038, 2058, 2073, 2081, 2092, 2099, 2107, + 2113, 2117, 2131, 2135, 2139, 2151, 2145, 2155, 2159, 2163, + 2167, 2173, 2174, 1977, 2179, 2180, 2186, 2199, 2191, 2211, + 2218, 2222, 2223, 2228, 2227, 2233, 2238, 2237, 2259, 2265, + 2243, 2272, 2274, 2278, 2279, 2280, 2285, 2296, 2297, 2301, + 2314, 2319, 2324, 2325, 2332, 2333, 2337, 1323, 1326, 1297, + 1285, 1274, 1272, 1276, 1251, 1253, 1254, 1232, 1227, 1235, + 1223, 1219, 1209, 1212, 1207, 1188, 1187, 1195, 1185, 1182, + 1163, 1174, 1171, 1169, 1156, 1148, 1103, 1102, 1102, 1435, + + 1107, 1117, 1097, 1105, 1091, 1090, 3660, 1089, 1085, 1080, + 1067, 1060, 1038, 1031, 490, 1030, 3660, 3660, 1023, 1022, + 1035, 1034, 1019, 1029, 1006, 3660, 3660, 1006, 1007, 987, + 3660, 984, 980, 1521, 962, 979, 2341, 2346, 2353, 2381, + 2387, 2392, 2396, 2401, 2405, 2416, 2421, 2430, 2439, 2410, + 2444, 2448, 2453, 2458, 2466, 2476, 2480, 2494, 2485, 2498, + 2512, 2517, 2521, 2526, 2530, 2534, 2538, 2544, 2549, 2558, + 2562, 2566, 2459, 2570, 2575, 2586, 2590, 2342, 2601, 2602, + 2614, 2615, 2626, 2613, 2627, 2637, 2628, 2639, 2649, 2662, + 2664, 2653, 2668, 2674, 2673, 2681, 2685, 2687, 2699, 2689, + + 2700, 2705, 2710, 2716, 2721, 2723, 975, 985, 971, 980, + 978, 972, 971, 970, 964, 960, 959, 926, 924, 513, + 918, 914, 909, 926, 919, 899, 910, 887, 883, 883, + 865, 863, 853, 873, 869, 863, 3660, 3660, 3660, 3660, + 3660, 3660, 3660, 3660, 862, 541, 846, 841, 848, 845, + 844, 3660, 3660, 837, 3660, 829, 835, 803, 762, 765, + 755, 3660, 796, 2727, 2755, 2764, 2739, 2744, 2759, 2773, + 2778, 2782, 2787, 2791, 2798, 2810, 2802, 2814, 2819, 2834, + 2838, 2851, 2855, 2859, 2863, 2873, 2877, 2883, 2891, 2897, + 2901, 2905, 2909, 2911, 2915, 2869, 2917, 2923, 2928, 2929, + + 2937, 2949, 2951, 2955, 2960, 2966, 2964, 2968, 2976, 2977, + 2972, 2992, 3000, 3004, 3008, 3013, 3014, 3018, 3019, 3024, + 3028, 784, 782, 778, 774, 575, 758, 763, 770, 769, + 768, 760, 752, 763, 753, 697, 700, 688, 3660, 3660, + 3660, 3660, 703, 696, 689, 688, 3660, 3660, 3660, 692, + 667, 3660, 684, 679, 1552, 645, 674, 3032, 3040, 3056, + 3064, 3068, 3072, 3076, 3080, 3084, 3092, 3104, 3108, 3119, + 3112, 3124, 3128, 3140, 3144, 3096, 3100, 3120, 3132, 3151, + 3156, 3160, 3164, 3166, 3168, 3178, 3192, 3187, 3191, 3200, + 3204, 3205, 3206, 651, 655, 649, 646, 652, 626, 632, + + 630, 1954, 600, 608, 601, 611, 592, 3660, 591, 3660, + 562, 2584, 548, 2731, 3219, 3226, 3244, 3255, 3232, 3261, + 3266, 3272, 3276, 3280, 3284, 3227, 3240, 3290, 3289, 3298, + 3308, 3303, 3312, 3316, 3326, 3327, 570, 560, 550, 503, + 505, 472, 2748, 482, 470, 3660, 473, 3660, 414, 3660, + 2842, 401, 3340, 3351, 3335, 3355, 3367, 3376, 3380, 3387, + 3391, 3392, 3396, 3398, 3404, 3403, 3405, 3415, 3416, 3423, + 434, 411, 401, 373, 3660, 397, 3660, 361, 3660, 3430, + 3440, 3444, 3451, 3455, 3459, 3465, 3466, 3467, 3478, 386, + 335, 3660, 266, 3480, 3487, 3491, 3501, 253, 256, 3503, + + 3507, 167, 171, 3515, 3516, 81, 3660, 3527, 3528, 3660, + 3563, 3569, 3575, 3581, 3587, 3593, 3599, 3605, 3611, 3617, + 3623, 3629, 3635, 3641, 3647, 55, 3653 } ; -static yyconst flex_int16_t yy_def[1113] = +static yyconst flex_int16_t yy_def[1128] = { 0, - 1095, 1, 1096, 1097, 1098, 1098, 1099, 1099, 1095, 9, - 1095, 11, 1095, 13, 1100, 1100, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1101, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1102, 1095, 1103, 1095, 1095, 1104, - 1103, 1103, 1103, 1105, 1095, 1095, 1105, 1105, 1106, 1095, - 1095, 1107, 1095, 1095, 1095, 1107, 1107, 1107, 1107, 1107, - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 43, 1108, 1107, - - 1107, 1107, 1107, 1107, 1107, 1107, 1109, 1095, 1095, 1095, - 1109, 1109, 1095, 1109, 1109, 1109, 1109, 1109, 1109, 1109, - 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, - 1109, 1109, 43, 1110, 1109, 1109, 1109, 1109, 1109, 1109, - 1109, 1095, 1095, 1095, 1111, 1111, 1111, 1111, 1111, 1111, - 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, - 1111, 1111, 1095, 1111, 43, 1111, 1111, 1111, 1111, 1111, - 1112, 1095, 1095, 1095, 1095, 1112, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - - 1095, 1095, 1095, 1095, 43, 1101, 1095, 1095, 1095, 1095, - 1095, 1101, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1103, 1095, 1103, 1095, 1103, 1103, - 1103, 1103, 1105, 1105, 1095, 1105, 1105, 1105, 1106, 1095, - 1095, 1095, 1107, 1107, 1107, 1095, 1095, 1095, 1095, 1095, - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - 1107, 1107, 1107, 1107, 1107, 1107, 1095, 1107, 98, 1108, - 1108, 1108, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - 1109, 1109, 1109, 1095, 1095, 1095, 1095, 1095, 1109, 1109, - - 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, - 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, - 1109, 1109, 1109, 1109, 1095, 1095, 1109, 133, 1110, 1110, - 1110, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1095, - 1095, 1095, 1095, 1095, 1095, 1111, 1111, 1111, 1111, 1111, - 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, - 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, - 1111, 1095, 1095, 1111, 165, 1111, 1111, 1111, 1111, 1111, - 1111, 1111, 1112, 1112, 1112, 1095, 1095, 1095, 1095, 1095, - 1112, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1103, 1105, 1105, 1105, - 1095, 1095, 1107, 1095, 1095, 1107, 1107, 1107, 1107, 1107, - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - 1107, 1107, 1108, 1107, 1107, 1107, 1107, 1107, 1107, 1109, - 1095, 1095, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, - 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, - 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1110, - - 1101, 1109, 1109, 1109, 1109, 1109, 1109, 1111, 1111, 1111, - 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, - 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, - 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, - 1112, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1103, - 1105, 1095, 1095, 1105, 1095, 1095, 1107, 1107, 1107, 1107, - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - 1107, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, - 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, - 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, - 1109, 1109, 1109, 1109, 1109, 1109, 1111, 1111, 1111, 1111, - 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, - 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, - 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1103, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1109, 1109, 1109, - 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, - 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, - 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, - 1109, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, - - 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, - 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1103, 1107, 1107, - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1109, 1109, 1109, - 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, - 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, - - 1109, 1109, 1109, 1109, 1109, 1109, 1111, 1111, 1111, 1111, - 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, - 1111, 1111, 1111, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1103, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, - 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1111, 1111, - 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1107, - - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, - 1109, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1107, 1107, 1107, - 1107, 1107, 1107, 1107, 1107, 1107, 1109, 1109, 1109, 1109, - 1109, 1109, 1109, 1109, 1109, 1111, 1111, 1111, 1111, 1095, - 1095, 1095, 1095, 1095, 1107, 1107, 1107, 1107, 1107, 1109, - 1109, 1109, 1109, 1109, 1111, 1111, 1095, 1095, 1107, 1107, - 1109, 1109, 1111, 1095, 1107, 1109, 1111, 1095, 1107, 1109, - 1111, 1095, 1107, 1109, 0, 1095, 1095, 1095, 1095, 1095, - - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095 + 1110, 1, 1111, 1112, 1113, 1113, 1114, 1114, 1110, 9, + 1110, 11, 1110, 13, 1115, 1115, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1116, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1117, 1110, 1118, 1110, 1110, 1119, + 1118, 1118, 1118, 1120, 1110, 1110, 1120, 1120, 1121, 1110, + 1110, 1122, 1110, 1110, 1110, 1122, 1122, 1122, 1122, 1122, + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 43, 1123, 1122, + + 1122, 1122, 1122, 1122, 1122, 1122, 1124, 1110, 1110, 1110, + 1124, 1124, 1110, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + 1124, 1124, 43, 1125, 1124, 1124, 1124, 1124, 1124, 1124, + 1124, 1110, 1110, 1110, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1110, 1126, 43, 1126, 1126, 1126, 1126, 1126, + 1127, 1110, 1110, 1110, 1110, 1127, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + + 1110, 1110, 1110, 1110, 1110, 43, 1116, 1110, 1110, 1110, + 1110, 1110, 1116, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1118, 1110, 1118, 1110, 1118, + 1118, 1118, 1118, 1120, 1120, 1110, 1120, 1120, 1120, 1121, + 1110, 1110, 1110, 1122, 1122, 1122, 1110, 1110, 1110, 1110, + 1110, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1110, 1122, + 98, 1123, 1123, 1123, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1122, 1124, 1124, 1124, 1110, 1110, 1110, 1110, 1110, + + 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1110, 1110, 1124, + 133, 1125, 1125, 1125, 1124, 1124, 1124, 1124, 1124, 1124, + 1124, 1124, 1110, 1110, 1110, 1110, 1110, 1110, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1110, 1110, 1126, 165, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1127, 1127, 1127, 1110, + 1110, 1110, 1110, 1110, 1127, 1110, 1110, 1110, 1110, 1110, + + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1118, 1120, 1120, 1120, 1110, 1110, 1122, 1110, 1110, + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1123, 1122, + 1122, 1122, 1122, 1122, 1122, 1124, 1110, 1110, 1124, 1124, + 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + + 1124, 1124, 1124, 1124, 1124, 1124, 1125, 1116, 1124, 1124, + 1124, 1124, 1124, 1124, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1127, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1118, 1120, + 1110, 1110, 1120, 1110, 1110, 1122, 1122, 1122, 1122, 1122, + + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1118, 1122, 1122, 1122, 1122, + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + + 1124, 1124, 1124, 1124, 1124, 1124, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1118, 1122, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1122, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + + 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + 1124, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1118, 1122, 1122, 1122, + 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1122, 1122, 1122, 1122, 1124, 1124, 1124, 1124, 1124, + 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + 1124, 1124, 1124, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + + 1126, 1126, 1126, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1122, 1122, 1122, 1122, 1124, 1124, 1124, 1124, 1124, + 1124, 1124, 1124, 1124, 1124, 1124, 1126, 1126, 1126, 1126, + 1126, 1126, 1126, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, + 1122, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, + 1126, 1126, 1126, 1126, 1110, 1110, 1110, 1110, 1110, 1122, + 1122, 1122, 1122, 1122, 1124, 1124, 1124, 1124, 1124, 1126, + 1126, 1110, 1110, 1122, 1122, 1124, 1124, 1126, 1110, 1122, + + 1124, 1126, 1110, 1122, 1124, 1126, 1110, 1122, 1124, 0, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110 } ; -static yyconst flex_int16_t yy_nxt[3654] = +static yyconst flex_int16_t yy_nxt[3712] = { 0, 18, 19, 20, 21, 19, 18, 22, 23, 24, 23, 25, 26, 18, 27, 28, 29, 18, 30, 18, 18, @@ -815,405 +823,412 @@ static yyconst flex_int16_t yy_nxt[3654] = 40, 18, 18, 41, 18, 18, 42, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 43, 70, 71, 43, 44, 53, 54, 55, 56, - 346, 45, 52, 58, 59, 60, 61, 65, 66, 65, + 349, 45, 52, 58, 59, 60, 61, 65, 66, 65, 66, 70, 71, 177, 46, 181, 177, 62, 172, 173, - 174, 172, 182, 184, 200, 175, 195, 216, 193, 191, - 185, 47, 379, 48, 187, 49, 201, 188, 50, 51, + 174, 172, 182, 184, 200, 175, 195, 217, 193, 191, + 185, 47, 1107, 48, 187, 49, 201, 188, 50, 51, - 192, 189, 194, 196, 190, 218, 63, 219, 217, 236, - 67, 176, 67, 380, 237, 68, 1092, 68, 72, 73, + 192, 189, 194, 196, 190, 202, 63, 219, 218, 220, + 67, 176, 67, 203, 385, 68, 386, 68, 72, 73, 74, 75, 73, 72, 76, 77, 78, 77, 79, 80, 72, 81, 82, 83, 72, 84, 72, 72, 85, 72, 86, 87, 88, 89, 90, 91, 92, 93, 94, 72, 72, 95, 96, 72, 97, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 98, - 213, 231, 98, 99, 172, 173, 174, 172, 1092, 100, - 363, 175, 240, 241, 194, 221, 223, 224, 222, 226, - 228, 229, 101, 359, 349, 352, 355, 364, 361, 356, + 214, 232, 98, 99, 172, 173, 174, 172, 237, 100, + 366, 175, 1107, 238, 194, 222, 224, 225, 223, 227, + 229, 230, 101, 241, 242, 352, 355, 367, 358, 362, - 232, 350, 353, 357, 360, 1091, 358, 176, 381, 102, - 382, 103, 362, 104, 421, 408, 105, 106, 107, 108, + 233, 359, 353, 356, 373, 360, 1106, 176, 361, 102, + 363, 103, 374, 104, 426, 412, 105, 106, 107, 108, 109, 110, 108, 107, 111, 112, 113, 112, 114, 115, 107, 116, 117, 118, 107, 119, 107, 107, 120, 107, 121, 122, 123, 124, 125, 126, 127, 128, 129, 107, 107, 130, 131, 107, 132, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 133, - 1088, 231, 133, 134, 244, 292, 244, 244, 292, 135, - 376, 246, 247, 248, 246, 368, 372, 373, 372, 372, - 177, 403, 136, 177, 362, 418, 832, 369, 419, 218, + 383, 364, 133, 134, 245, 294, 245, 245, 294, 135, + 380, 247, 248, 249, 247, 365, 371, 376, 377, 376, + 376, 384, 136, 177, 365, 1103, 177, 423, 372, 1102, - 232, 219, 221, 223, 224, 404, 1087, 245, 293, 137, - 236, 138, 833, 139, 249, 237, 140, 141, 18, 142, + 424, 407, 219, 540, 220, 237, 541, 246, 295, 137, + 238, 138, 1099, 139, 250, 408, 140, 141, 18, 142, 143, 144, 142, 18, 22, 23, 24, 145, 146, 26, 147, 148, 149, 150, 147, 151, 147, 147, 152, 147, 153, 154, 155, 156, 157, 158, 159, 160, 161, 147, 147, 162, 163, 147, 164, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 18, 18, 165, - 240, 241, 165, 44, 248, 250, 248, 248, 1084, 45, - 216, 244, 292, 244, 244, 292, 244, 292, 244, 244, - 292, 244, 166, 244, 244, 251, 244, 1083, 244, 244, - - 244, 217, 244, 244, 1077, 251, 379, 249, 1078, 167, - 1077, 168, 1076, 169, 245, 293, 170, 51, 205, 245, - 293, 205, 206, 244, 245, 244, 244, 380, 207, 245, - 226, 228, 229, 245, 244, 1062, 244, 244, 244, 252, - 244, 244, 532, 1075, 292, 533, 244, 292, 244, 244, - 535, 522, 253, 255, 292, 1060, 245, 292, 208, 254, - 209, 244, 301, 244, 244, 210, 211, 245, 256, 302, - 300, 245, 517, 567, 556, 257, 568, 293, 1064, 245, - 244, 575, 244, 244, 575, 1063, 518, 293, 557, 244, - 258, 244, 244, 1062, 245, 244, 263, 244, 244, 244, - - 267, 244, 244, 244, 912, 244, 244, 264, 1061, 680, - 265, 259, 681, 245, 260, 1060, 1059, 268, 261, 1033, - 913, 262, 245, 244, 266, 244, 244, 928, 245, 576, - 269, 244, 245, 244, 244, 244, 245, 244, 244, 244, - 669, 244, 244, 929, 244, 270, 244, 244, 1058, 244, - 274, 244, 244, 272, 670, 281, 245, 281, 281, 275, - 271, 1031, 1057, 1056, 245, 273, 1035, 244, 245, 244, - 244, 1034, 245, 276, 277, 276, 276, 245, 279, 247, - 248, 279, 245, 1033, 244, 278, 244, 244, 282, 244, - 292, 244, 244, 292, 244, 283, 244, 244, 979, 299, - - 245, 244, 1032, 244, 244, 244, 245, 244, 244, 266, - 244, 249, 244, 244, 980, 1031, 1030, 245, 294, 295, - 296, 294, 245, 293, 286, 1029, 1028, 245, 296, 298, - 296, 296, 1027, 292, 245, 284, 292, 285, 245, 288, - 995, 289, 299, 245, 292, 287, 292, 292, 1026, 292, - 993, 297, 292, 292, 1025, 292, 292, 292, 290, 303, - 292, 297, 292, 1024, 322, 292, 293, 292, 304, 292, - 292, 292, 292, 307, 292, 305, 308, 293, 311, 293, - 309, 306, 313, 310, 292, 293, 293, 292, 292, 312, - 293, 292, 1023, 1022, 317, 293, 314, 942, 319, 315, - - 293, 999, 293, 996, 293, 292, 318, 292, 292, 995, - 292, 324, 325, 326, 324, 292, 316, 293, 292, 994, - 993, 293, 323, 320, 328, 295, 296, 328, 992, 330, - 292, 212, 330, 292, 292, 321, 212, 292, 293, 292, - 293, 991, 292, 292, 293, 332, 292, 292, 293, 990, - 292, 327, 989, 988, 987, 292, 986, 297, 292, 314, - 985, 292, 331, 293, 292, 575, 937, 293, 575, 984, - 335, 983, 293, 934, 933, 384, 293, 932, 384, 982, - 293, 340, 341, 342, 340, 333, 334, 981, 293, 927, - 926, 336, 925, 924, 293, 337, 942, 338, 344, 345, - - 344, 344, 941, 339, 375, 341, 342, 375, 385, 386, - 387, 388, 386, 576, 343, 390, 387, 390, 390, 391, - 392, 393, 391, 430, 431, 432, 430, 244, 940, 244, - 244, 343, 244, 939, 244, 244, 938, 343, 433, 434, - 433, 433, 389, 246, 247, 248, 246, 937, 389, 936, - 935, 934, 385, 248, 247, 248, 248, 933, 932, 931, - 245, 435, 277, 435, 435, 245, 244, 930, 244, 244, - 927, 245, 428, 926, 925, 251, 249, 924, 244, 923, - 244, 244, 244, 922, 244, 244, 249, 244, 921, 244, - 244, 920, 244, 437, 244, 244, 919, 918, 840, 245, - - 436, 244, 917, 244, 244, 244, 838, 244, 244, 438, - 837, 245, 440, 916, 244, 245, 244, 244, 439, 244, - 245, 244, 244, 292, 441, 245, 292, 915, 244, 442, - 244, 244, 914, 244, 245, 244, 244, 244, 245, 244, - 244, 911, 292, 443, 445, 292, 292, 245, 444, 292, - 910, 244, 245, 244, 244, 299, 293, 244, 446, 244, - 244, 245, 829, 828, 447, 244, 245, 244, 244, 244, - 245, 244, 244, 448, 244, 293, 244, 244, 244, 293, - 244, 244, 449, 292, 245, 244, 292, 244, 244, 827, - 245, 826, 450, 451, 474, 825, 575, 452, 245, 575, - - 824, 823, 245, 244, 454, 244, 244, 245, 453, 822, - 244, 245, 244, 244, 455, 909, 293, 244, 245, 244, - 244, 244, 908, 244, 244, 244, 907, 244, 244, 456, - 848, 847, 244, 458, 244, 244, 245, 244, 846, 244, - 244, 845, 459, 245, 576, 844, 281, 457, 281, 281, - 245, 843, 292, 842, 245, 292, 460, 841, 245, 461, - 276, 277, 276, 276, 281, 245, 281, 281, 840, 462, - 245, 463, 434, 463, 463, 244, 839, 244, 244, 282, - 244, 481, 244, 244, 244, 293, 244, 244, 244, 838, - 244, 244, 244, 245, 244, 244, 837, 282, 836, 467, - - 292, 464, 450, 292, 282, 835, 834, 244, 245, 244, - 244, 831, 830, 245, 465, 286, 244, 245, 244, 244, - 466, 245, 473, 829, 244, 245, 244, 244, 828, 470, - 471, 472, 470, 293, 292, 292, 287, 292, 292, 827, - 245, 294, 295, 296, 294, 292, 477, 468, 292, 245, - 296, 295, 296, 296, 826, 825, 475, 245, 824, 823, - 822, 469, 293, 326, 325, 326, 326, 293, 293, 292, - 292, 476, 292, 292, 297, 821, 292, 292, 293, 292, - 292, 292, 820, 297, 292, 479, 292, 292, 478, 292, - 292, 480, 482, 292, 292, 292, 292, 292, 292, 819, - - 818, 817, 293, 293, 484, 816, 483, 815, 485, 293, - 293, 814, 486, 292, 293, 714, 292, 488, 489, 293, - 293, 487, 292, 813, 812, 292, 293, 293, 293, 292, - 292, 292, 292, 292, 292, 292, 292, 811, 292, 292, - 492, 491, 292, 490, 810, 292, 293, 495, 292, 493, - 809, 292, 808, 496, 807, 293, 324, 325, 326, 324, - 706, 494, 293, 293, 293, 705, 806, 497, 293, 293, - 498, 326, 325, 326, 326, 293, 805, 804, 803, 499, - 330, 293, 212, 330, 802, 801, 800, 212, 330, 293, - 212, 330, 799, 798, 695, 212, 500, 471, 501, 500, - - 797, 292, 292, 212, 292, 292, 292, 292, 292, 292, - 292, 292, 292, 331, 292, 292, 292, 292, 505, 292, - 796, 331, 340, 341, 342, 340, 795, 502, 487, 331, - 794, 335, 793, 792, 293, 293, 503, 723, 720, 293, - 293, 293, 504, 384, 719, 293, 384, 293, 344, 293, - 344, 344, 336, 384, 506, 343, 384, 507, 344, 341, - 344, 344, 372, 373, 372, 372, 372, 373, 372, 372, - 541, 542, 543, 541, 718, 717, 385, 386, 387, 388, - 386, 343, 390, 387, 390, 390, 385, 393, 392, 393, - 393, 343, 390, 716, 390, 390, 391, 392, 393, 391, - - 715, 714, 713, 385, 393, 392, 393, 393, 712, 711, - 389, 573, 574, 573, 573, 389, 581, 582, 583, 581, - 584, 585, 586, 584, 244, 389, 244, 244, 710, 385, - 430, 431, 432, 430, 432, 431, 432, 432, 433, 434, - 433, 433, 435, 277, 435, 435, 709, 244, 588, 244, - 244, 244, 721, 244, 244, 721, 708, 245, 587, 244, - 707, 244, 244, 706, 244, 428, 244, 244, 705, 428, - 292, 245, 244, 292, 244, 244, 589, 704, 703, 234, - 245, 591, 702, 244, 245, 244, 244, 244, 590, 244, - 244, 637, 245, 244, 592, 244, 244, 245, 594, 244, - - 722, 244, 244, 293, 701, 245, 593, 244, 595, 244, - 244, 244, 700, 244, 244, 244, 245, 244, 244, 699, - 245, 698, 244, 697, 244, 244, 245, 596, 601, 696, - 695, 597, 245, 599, 694, 244, 598, 244, 244, 244, - 245, 244, 244, 244, 245, 244, 244, 600, 245, 244, - 693, 244, 244, 692, 691, 245, 602, 690, 604, 689, - 244, 605, 244, 244, 688, 687, 721, 603, 245, 721, - 535, 244, 245, 244, 244, 606, 245, 244, 686, 244, - 244, 685, 245, 292, 607, 244, 292, 244, 244, 244, - 684, 244, 244, 245, 622, 244, 683, 244, 244, 608, - - 244, 609, 244, 244, 245, 244, 682, 244, 244, 244, - 245, 244, 244, 614, 722, 679, 293, 610, 245, 678, - 611, 292, 245, 612, 292, 677, 613, 676, 245, 463, - 434, 463, 463, 245, 616, 574, 616, 616, 245, 615, - 675, 617, 245, 244, 617, 244, 624, 244, 244, 244, - 674, 244, 244, 244, 293, 244, 244, 244, 292, 244, - 244, 292, 282, 470, 471, 472, 470, 245, 472, 471, - 472, 472, 673, 292, 245, 464, 292, 292, 245, 672, - 292, 292, 245, 671, 292, 619, 245, 625, 668, 618, - 245, 293, 620, 667, 626, 666, 293, 623, 621, 292, - - 665, 292, 292, 627, 292, 292, 293, 664, 292, 663, - 293, 662, 629, 292, 293, 292, 292, 661, 292, 660, - 630, 659, 628, 292, 292, 292, 292, 292, 292, 658, - 292, 657, 293, 292, 293, 580, 634, 292, 293, 632, - 292, 631, 292, 636, 292, 292, 293, 292, 293, 633, - 635, 638, 639, 579, 640, 578, 293, 293, 293, 641, - 421, 292, 292, 293, 292, 292, 292, 577, 572, 292, - 293, 571, 570, 292, 642, 293, 292, 293, 292, 569, - 292, 292, 644, 292, 643, 292, 292, 566, 292, 292, - 565, 649, 564, 721, 293, 293, 721, 652, 563, 293, - - 652, 645, 648, 562, 646, 561, 293, 292, 647, 292, - 292, 293, 292, 293, 500, 471, 501, 500, 293, 293, - 650, 212, 501, 471, 501, 501, 651, 574, 573, 651, - 293, 292, 292, 502, 292, 292, 573, 574, 573, 573, - 293, 722, 293, 560, 559, 653, 558, 331, 555, 654, - 541, 542, 543, 541, 543, 542, 543, 543, 554, 293, - 573, 574, 573, 573, 293, 293, 581, 582, 583, 581, - 655, 553, 552, 656, 583, 582, 583, 583, 584, 585, - 586, 584, 551, 385, 586, 585, 586, 586, 244, 292, - 244, 244, 292, 244, 997, 244, 244, 997, 244, 550, - - 244, 244, 759, 549, 548, 724, 725, 244, 547, 244, - 244, 244, 546, 244, 244, 234, 545, 244, 544, 244, - 244, 245, 293, 540, 539, 727, 245, 234, 726, 538, - 537, 245, 729, 244, 536, 244, 244, 534, 292, 728, - 245, 292, 998, 730, 245, 244, 531, 244, 244, 244, - 245, 244, 244, 530, 244, 758, 244, 244, 244, 529, - 244, 244, 244, 528, 244, 244, 245, 244, 527, 244, - 244, 293, 732, 997, 731, 733, 997, 244, 245, 244, - 244, 526, 245, 525, 736, 524, 734, 245, 735, 523, - 244, 245, 244, 244, 244, 245, 244, 244, 522, 521, - - 245, 520, 737, 244, 519, 244, 244, 516, 515, 739, - 245, 738, 244, 740, 244, 244, 244, 514, 244, 244, - 513, 998, 741, 245, 512, 511, 244, 245, 244, 244, - 510, 244, 509, 244, 244, 292, 245, 244, 292, 244, - 244, 508, 347, 240, 742, 245, 744, 429, 428, 245, - 743, 244, 745, 244, 244, 234, 767, 230, 244, 245, - 244, 244, 427, 244, 245, 244, 244, 746, 293, 244, - 245, 244, 244, 292, 748, 244, 292, 244, 244, 749, - 244, 226, 244, 244, 245, 221, 244, 747, 244, 244, - 770, 245, 617, 750, 244, 617, 245, 616, 574, 616, - - 616, 244, 245, 244, 244, 751, 293, 426, 245, 244, - 425, 244, 244, 245, 424, 244, 423, 244, 244, 245, - 756, 292, 244, 756, 292, 245, 292, 422, 292, 292, - 245, 292, 752, 292, 245, 220, 292, 215, 292, 214, - 618, 292, 245, 292, 761, 420, 292, 417, 245, 753, - 755, 760, 416, 245, 293, 754, 762, 292, 763, 293, - 292, 293, 765, 415, 769, 414, 293, 764, 757, 292, - 292, 293, 292, 292, 292, 292, 293, 292, 292, 292, - 413, 292, 292, 292, 292, 292, 292, 412, 292, 411, - 293, 774, 766, 775, 773, 410, 772, 292, 768, 771, - - 292, 997, 293, 293, 997, 409, 1036, 293, 293, 1036, - 408, 407, 293, 776, 293, 406, 293, 292, 293, 292, - 292, 777, 292, 292, 292, 292, 292, 292, 292, 405, - 293, 402, 778, 401, 779, 292, 782, 292, 292, 780, - 292, 292, 400, 292, 292, 783, 292, 399, 652, 998, - 293, 652, 293, 781, 1037, 784, 293, 293, 293, 651, - 574, 573, 651, 398, 292, 397, 785, 292, 293, 292, - 293, 396, 292, 395, 293, 292, 293, 394, 292, 179, - 790, 293, 378, 790, 244, 377, 244, 244, 244, 786, - 244, 244, 293, 374, 371, 370, 653, 293, 244, 850, - - 244, 244, 293, 367, 244, 366, 244, 244, 293, 365, - 789, 354, 787, 293, 852, 788, 849, 245, 351, 348, - 244, 245, 244, 244, 244, 851, 244, 244, 791, 347, - 853, 245, 347, 244, 854, 244, 244, 245, 244, 242, - 244, 244, 244, 238, 244, 244, 235, 244, 855, 244, - 244, 234, 856, 245, 230, 226, 292, 245, 244, 292, - 244, 244, 244, 221, 244, 244, 245, 244, 857, 244, - 244, 245, 858, 220, 861, 245, 244, 859, 244, 244, - 245, 244, 215, 244, 244, 244, 214, 244, 244, 293, - 244, 245, 244, 244, 862, 245, 244, 204, 244, 244, - - 245, 203, 202, 244, 860, 244, 244, 199, 292, 245, - 863, 292, 864, 244, 245, 244, 244, 244, 245, 244, - 244, 198, 244, 245, 244, 244, 197, 867, 244, 245, - 244, 244, 865, 186, 183, 880, 245, 244, 868, 244, - 244, 293, 866, 180, 869, 179, 245, 870, 179, 244, - 245, 244, 244, 178, 244, 245, 244, 244, 1095, 1095, - 244, 245, 244, 244, 1095, 244, 1095, 244, 244, 244, - 245, 244, 244, 244, 292, 244, 244, 292, 244, 871, - 244, 244, 245, 244, 881, 244, 244, 245, 873, 872, - 1095, 1095, 756, 245, 244, 756, 1095, 244, 245, 244, - - 244, 292, 245, 1095, 292, 292, 245, 293, 292, 874, - 1095, 245, 1095, 875, 1095, 1095, 245, 876, 292, 1095, - 879, 292, 1095, 292, 292, 245, 292, 292, 882, 878, - 245, 1095, 292, 883, 293, 292, 292, 1095, 293, 292, - 757, 1095, 884, 1095, 292, 877, 885, 292, 1095, 292, - 292, 293, 292, 292, 886, 1095, 293, 293, 292, 887, - 888, 292, 1095, 292, 1095, 293, 292, 292, 292, 293, - 292, 292, 292, 292, 1095, 292, 292, 293, 1095, 1095, - 1095, 891, 293, 293, 292, 292, 889, 292, 292, 292, - 890, 293, 292, 1095, 893, 896, 293, 892, 1095, 897, - - 293, 293, 894, 1095, 292, 293, 293, 292, 292, 292, - 1095, 292, 292, 895, 1095, 1095, 1095, 293, 293, 899, - 292, 292, 293, 292, 292, 292, 898, 292, 292, 292, - 292, 292, 292, 1095, 292, 1095, 292, 293, 900, 292, - 790, 293, 293, 790, 292, 1095, 1095, 292, 902, 244, - 901, 244, 244, 293, 293, 1095, 1095, 1095, 293, 943, - 293, 1095, 293, 1095, 293, 292, 904, 903, 292, 293, - 905, 1095, 244, 293, 244, 244, 244, 293, 244, 244, - 1095, 244, 245, 244, 244, 1095, 944, 244, 791, 244, - 244, 945, 906, 244, 1095, 244, 244, 244, 293, 244, - - 244, 244, 1095, 244, 244, 245, 1095, 1095, 244, 245, - 244, 244, 1095, 244, 245, 244, 244, 1095, 1095, 244, - 245, 244, 244, 1095, 1095, 244, 245, 244, 244, 244, - 245, 244, 244, 1095, 245, 946, 244, 1095, 244, 244, - 244, 245, 244, 244, 1095, 244, 245, 244, 244, 947, - 1095, 1095, 245, 292, 949, 951, 292, 292, 245, 950, - 292, 244, 245, 244, 244, 948, 1095, 961, 1095, 245, - 1095, 952, 244, 245, 244, 244, 1095, 244, 245, 244, - 244, 244, 953, 244, 244, 244, 293, 244, 244, 244, - 293, 244, 244, 244, 245, 244, 244, 1095, 1095, 244, - - 954, 244, 244, 1095, 244, 245, 244, 244, 1095, 956, - 245, 1095, 1095, 292, 245, 955, 292, 1095, 245, 957, - 1095, 244, 245, 244, 244, 244, 245, 244, 244, 1095, - 1095, 244, 245, 244, 244, 1095, 244, 245, 244, 244, - 292, 292, 292, 292, 292, 292, 293, 1095, 1095, 292, - 962, 963, 292, 292, 245, 1095, 292, 292, 245, 292, - 292, 959, 292, 1095, 245, 292, 958, 292, 292, 245, - 292, 1095, 1095, 293, 293, 293, 960, 964, 965, 1095, - 292, 1095, 293, 292, 292, 292, 293, 292, 292, 1095, - 293, 1095, 293, 1095, 966, 969, 292, 1095, 293, 292, - - 293, 292, 1095, 968, 292, 967, 970, 292, 1095, 292, - 292, 971, 292, 293, 1095, 1095, 292, 293, 293, 292, - 292, 292, 292, 292, 292, 292, 1095, 1095, 1095, 293, - 292, 972, 974, 292, 293, 292, 292, 1095, 292, 292, - 293, 292, 293, 973, 292, 975, 1095, 1095, 292, 293, - 1095, 292, 1095, 293, 293, 293, 244, 1095, 244, 244, - 1095, 1095, 244, 293, 244, 244, 1095, 1095, 293, 293, - 1095, 1095, 977, 244, 293, 244, 244, 1095, 1095, 1095, - 976, 293, 244, 1095, 244, 244, 978, 1095, 244, 245, - 244, 244, 1095, 1095, 1095, 245, 1095, 244, 1095, 244, - - 244, 244, 1095, 244, 244, 244, 245, 244, 244, 244, - 1095, 244, 244, 1000, 1095, 245, 1001, 244, 1095, 244, - 244, 245, 244, 1002, 244, 244, 244, 1003, 244, 244, - 245, 1095, 292, 1095, 245, 292, 1004, 244, 245, 244, - 244, 244, 245, 244, 244, 1095, 244, 1095, 244, 244, - 245, 1008, 1095, 244, 1008, 245, 1006, 1095, 292, 245, - 244, 292, 244, 244, 292, 293, 1005, 292, 1007, 244, - 245, 244, 244, 292, 245, 292, 292, 292, 292, 245, - 292, 1095, 292, 292, 245, 292, 292, 292, 1095, 292, - 292, 293, 292, 245, 1095, 292, 1012, 293, 292, 1009, - - 1011, 1095, 245, 1095, 1013, 1010, 293, 1095, 293, 1014, - 293, 292, 1095, 1095, 292, 293, 293, 1095, 1095, 1095, - 293, 1015, 293, 292, 292, 1095, 292, 292, 293, 292, - 292, 1019, 292, 292, 1019, 1095, 1095, 292, 1018, 1017, - 292, 1095, 1095, 244, 293, 244, 244, 244, 1095, 244, - 244, 244, 1016, 244, 244, 1095, 293, 293, 1095, 1095, - 1095, 1040, 293, 293, 293, 1038, 1095, 1095, 1095, 1039, - 293, 1095, 244, 1021, 244, 244, 245, 1095, 1095, 1020, - 245, 1095, 1095, 244, 245, 244, 244, 1041, 244, 1095, - 244, 244, 244, 292, 244, 244, 292, 244, 1042, 244, - - 244, 1008, 1095, 244, 1008, 245, 244, 1095, 244, 244, - 1045, 292, 244, 1045, 292, 1047, 245, 292, 1095, 1036, - 292, 245, 1036, 1095, 1095, 245, 293, 1049, 292, 1095, - 245, 292, 1043, 1048, 245, 292, 1095, 292, 292, 245, - 292, 1095, 1095, 245, 293, 1051, 1095, 1095, 292, 1009, - 293, 292, 1050, 292, 1044, 1095, 292, 1019, 1046, 292, - 1019, 293, 292, 1054, 1095, 1095, 1054, 1037, 293, 1036, - 293, 292, 1036, 244, 292, 244, 244, 244, 1095, 244, - 244, 293, 244, 1065, 244, 244, 293, 1095, 1052, 1095, - 293, 244, 293, 244, 244, 1095, 293, 1066, 1095, 1095, - - 244, 1067, 244, 244, 293, 1020, 245, 1053, 1095, 292, - 245, 1055, 292, 1095, 1095, 245, 244, 1037, 244, 244, - 244, 1095, 244, 244, 245, 1045, 1095, 244, 1045, 244, - 1095, 244, 244, 245, 292, 292, 292, 292, 292, 292, - 1095, 1095, 293, 1095, 1070, 292, 1072, 1095, 292, 245, - 1071, 292, 1068, 245, 292, 1095, 1054, 292, 245, 1054, - 292, 244, 245, 244, 244, 1095, 1095, 293, 293, 293, - 1095, 1095, 1095, 1046, 1095, 1095, 1095, 1069, 293, 292, - 1095, 1073, 292, 244, 293, 244, 244, 1095, 292, 293, - 293, 292, 1095, 1079, 245, 244, 1095, 244, 244, 244, - - 292, 244, 244, 292, 1055, 1074, 244, 1095, 244, 244, - 1081, 292, 293, 1095, 292, 292, 245, 244, 292, 244, - 244, 293, 244, 292, 244, 244, 292, 292, 245, 1095, - 292, 292, 245, 293, 292, 244, 1095, 244, 244, 245, - 1095, 1080, 1095, 244, 293, 244, 244, 1095, 293, 244, - 245, 244, 244, 1082, 292, 245, 293, 292, 1095, 1093, - 293, 1095, 1095, 1095, 293, 1095, 1095, 1085, 245, 1090, - 1095, 292, 1086, 1089, 292, 1095, 245, 1095, 1095, 1095, - 1095, 1094, 245, 1095, 1095, 1095, 1095, 293, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - - 1095, 1095, 1095, 1095, 293, 52, 52, 52, 52, 52, - 52, 57, 57, 57, 57, 57, 57, 64, 64, 64, - 64, 64, 64, 69, 69, 69, 69, 69, 69, 171, - 171, 171, 171, 171, 171, 212, 212, 1095, 212, 212, - 212, 222, 222, 222, 222, 222, 222, 225, 1095, 1095, - 1095, 225, 225, 227, 227, 227, 227, 227, 227, 233, - 233, 1095, 1095, 233, 233, 239, 239, 239, 239, 239, - 239, 243, 243, 1095, 243, 243, 243, 280, 280, 1095, - 280, 280, 280, 291, 291, 1095, 1095, 1095, 291, 329, - 329, 1095, 329, 329, 329, 383, 383, 1095, 1095, 1095, - - 383, 17, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095 + 241, 242, 165, 44, 249, 251, 249, 249, 1098, 45, + 217, 245, 294, 245, 245, 294, 245, 294, 245, 245, + 294, 245, 166, 245, 245, 252, 245, 1092, 245, 245, + + 245, 218, 245, 245, 1093, 252, 232, 250, 1092, 167, + 1091, 168, 1077, 169, 246, 295, 170, 51, 206, 246, + 295, 206, 207, 245, 246, 245, 245, 1090, 208, 246, + 222, 224, 225, 246, 245, 233, 245, 245, 245, 253, + 245, 245, 543, 529, 294, 1075, 245, 294, 245, 245, + 1079, 1078, 254, 256, 294, 383, 246, 294, 209, 255, + 210, 245, 303, 245, 245, 211, 212, 246, 257, 304, + 302, 246, 227, 229, 230, 258, 384, 295, 575, 246, + 245, 576, 245, 245, 1077, 691, 1076, 295, 692, 245, + 259, 245, 245, 1075, 246, 245, 264, 245, 245, 245, + + 268, 245, 245, 245, 847, 245, 245, 265, 1074, 584, + 266, 260, 584, 246, 261, 524, 1048, 269, 262, 1073, + 848, 263, 246, 245, 267, 245, 245, 927, 246, 525, + 270, 245, 246, 245, 245, 245, 246, 245, 245, 245, + 564, 245, 245, 928, 245, 271, 245, 245, 680, 245, + 275, 245, 245, 273, 565, 943, 246, 585, 276, 277, + 272, 1046, 681, 294, 246, 274, 294, 283, 246, 283, + 283, 944, 246, 278, 279, 278, 278, 246, 281, 248, + 249, 281, 246, 1072, 245, 280, 245, 245, 245, 994, + 245, 245, 245, 1071, 245, 245, 295, 1050, 1049, 285, + + 284, 245, 1048, 245, 245, 995, 246, 245, 1047, 245, + 245, 250, 245, 267, 245, 245, 245, 246, 245, 245, + 584, 246, 1046, 584, 1045, 246, 296, 297, 298, 296, + 288, 1044, 294, 294, 246, 294, 294, 1043, 286, 1042, + 246, 301, 301, 1010, 287, 246, 290, 294, 291, 246, + 294, 289, 298, 300, 298, 298, 1041, 294, 294, 299, + 294, 294, 305, 1008, 292, 295, 295, 294, 585, 1040, + 294, 294, 1039, 294, 294, 1038, 294, 1037, 957, 306, + 295, 294, 1014, 313, 294, 299, 307, 308, 1011, 309, + 295, 295, 310, 320, 314, 1010, 311, 1009, 294, 312, + + 295, 294, 294, 1008, 295, 294, 295, 294, 319, 315, + 294, 1007, 1006, 317, 295, 294, 1005, 294, 294, 294, + 294, 294, 294, 316, 294, 327, 328, 329, 327, 1004, + 318, 295, 326, 322, 1003, 295, 321, 1002, 294, 294, + 295, 294, 294, 1001, 333, 323, 213, 333, 295, 324, + 295, 213, 295, 294, 295, 330, 294, 325, 295, 331, + 297, 298, 331, 294, 335, 294, 294, 336, 294, 1000, + 294, 295, 295, 294, 952, 999, 998, 334, 316, 949, + 948, 947, 337, 997, 996, 942, 295, 388, 338, 941, + 388, 584, 299, 940, 584, 939, 295, 340, 295, 341, + + 957, 956, 955, 295, 343, 344, 345, 343, 954, 339, + 347, 348, 347, 347, 379, 344, 345, 379, 342, 953, + 389, 390, 391, 392, 390, 394, 391, 394, 394, 395, + 396, 397, 395, 435, 436, 437, 435, 346, 245, 585, + 245, 245, 245, 346, 245, 245, 952, 346, 438, 439, + 438, 438, 951, 950, 393, 949, 948, 734, 393, 947, + 734, 946, 389, 247, 248, 249, 247, 249, 248, 249, + 249, 246, 945, 942, 941, 246, 440, 279, 440, 440, + 940, 246, 433, 245, 939, 245, 245, 245, 938, 245, + 245, 245, 252, 245, 245, 245, 250, 245, 245, 937, + + 250, 245, 442, 245, 245, 735, 936, 935, 245, 441, + 245, 245, 245, 934, 245, 245, 246, 443, 933, 445, + 246, 855, 932, 245, 246, 245, 245, 444, 246, 294, + 853, 446, 294, 245, 246, 245, 245, 852, 447, 931, + 245, 246, 245, 245, 930, 246, 929, 245, 448, 245, + 245, 245, 926, 245, 245, 925, 246, 245, 450, 245, + 245, 245, 295, 245, 245, 245, 246, 245, 245, 449, + 844, 843, 451, 246, 245, 842, 245, 245, 452, 453, + 246, 841, 840, 839, 246, 245, 454, 245, 245, 838, + 246, 837, 455, 245, 246, 245, 245, 457, 246, 924, + + 245, 923, 245, 245, 922, 294, 863, 246, 294, 456, + 245, 862, 245, 245, 245, 861, 245, 245, 246, 459, + 860, 460, 245, 458, 245, 245, 246, 245, 859, 245, + 245, 858, 245, 246, 245, 245, 857, 856, 295, 463, + 855, 461, 854, 246, 462, 853, 852, 246, 245, 464, + 245, 245, 851, 850, 245, 246, 245, 245, 849, 846, + 246, 278, 279, 278, 278, 246, 245, 845, 245, 245, + 465, 844, 283, 466, 283, 283, 467, 283, 843, 283, + 283, 246, 469, 439, 469, 469, 245, 246, 245, 245, + 245, 842, 245, 245, 246, 245, 841, 245, 245, 246, + + 840, 839, 838, 468, 294, 284, 245, 294, 245, 245, + 284, 294, 470, 455, 294, 284, 837, 473, 245, 246, + 245, 245, 480, 246, 471, 836, 479, 245, 246, 245, + 245, 472, 245, 835, 245, 245, 834, 295, 833, 246, + 245, 288, 245, 245, 295, 476, 477, 478, 476, 832, + 831, 246, 296, 297, 298, 296, 298, 297, 298, 298, + 246, 294, 289, 294, 294, 246, 294, 474, 329, 328, + 329, 329, 301, 246, 830, 829, 294, 475, 295, 294, + 727, 294, 726, 481, 294, 299, 828, 294, 294, 299, + 294, 294, 483, 827, 295, 294, 295, 294, 294, 826, + + 294, 825, 482, 485, 294, 294, 484, 294, 294, 295, + 486, 824, 823, 294, 295, 488, 294, 822, 718, 294, + 295, 295, 294, 717, 294, 821, 487, 294, 295, 489, + 295, 294, 490, 294, 294, 491, 294, 295, 295, 294, + 294, 820, 294, 294, 492, 294, 295, 294, 294, 819, + 294, 493, 295, 818, 817, 494, 495, 295, 498, 497, + 294, 816, 294, 294, 295, 294, 295, 294, 294, 496, + 294, 294, 295, 295, 501, 500, 815, 814, 295, 499, + 295, 813, 294, 294, 502, 294, 294, 707, 812, 294, + 503, 294, 294, 295, 294, 295, 327, 328, 329, 327, + + 295, 295, 504, 811, 810, 505, 329, 328, 329, 329, + 333, 294, 213, 333, 294, 295, 295, 213, 333, 506, + 213, 333, 295, 294, 295, 213, 294, 511, 809, 295, + 507, 477, 508, 507, 514, 294, 294, 213, 294, 294, + 808, 807, 736, 334, 295, 510, 512, 733, 732, 509, + 493, 334, 294, 731, 294, 294, 295, 294, 347, 338, + 347, 347, 730, 334, 343, 344, 345, 343, 295, 295, + 347, 344, 347, 347, 376, 377, 376, 376, 729, 728, + 339, 376, 377, 376, 376, 295, 388, 295, 727, 388, + 388, 346, 513, 388, 726, 725, 724, 346, 549, 550, + + 551, 549, 723, 346, 390, 391, 392, 390, 394, 391, + 394, 394, 397, 396, 397, 397, 722, 721, 394, 389, + 394, 394, 720, 389, 395, 396, 397, 395, 719, 718, + 717, 389, 397, 396, 397, 397, 734, 393, 716, 734, + 715, 393, 582, 583, 582, 582, 590, 591, 592, 590, + 714, 393, 593, 594, 595, 593, 713, 389, 435, 436, + 437, 435, 437, 436, 437, 437, 438, 439, 438, 438, + 440, 279, 440, 440, 712, 245, 711, 245, 245, 245, + 710, 245, 245, 709, 735, 245, 596, 245, 245, 708, + 245, 707, 245, 245, 245, 433, 245, 245, 706, 246, + + 705, 433, 245, 597, 245, 245, 294, 235, 246, 294, + 598, 600, 246, 245, 704, 245, 245, 632, 246, 599, + 703, 702, 734, 246, 601, 734, 245, 246, 245, 245, + 245, 701, 245, 245, 700, 246, 602, 603, 245, 295, + 245, 245, 699, 543, 698, 604, 246, 697, 245, 696, + 245, 245, 245, 1012, 245, 245, 1012, 695, 245, 246, + 245, 245, 245, 246, 245, 245, 605, 694, 693, 608, + 735, 246, 606, 690, 689, 610, 245, 607, 245, 245, + 688, 246, 687, 609, 245, 246, 245, 245, 686, 685, + 245, 246, 245, 245, 684, 246, 245, 611, 245, 245, + + 245, 1013, 245, 245, 245, 613, 245, 245, 614, 246, + 683, 245, 612, 245, 245, 615, 245, 246, 245, 245, + 682, 679, 678, 246, 616, 245, 617, 245, 245, 246, + 677, 676, 618, 246, 675, 674, 245, 246, 245, 245, + 245, 673, 245, 245, 246, 245, 672, 245, 245, 246, + 671, 294, 670, 619, 294, 622, 620, 245, 246, 245, + 245, 669, 623, 245, 621, 245, 245, 668, 636, 246, + 624, 589, 588, 246, 469, 439, 469, 469, 246, 626, + 583, 626, 626, 627, 295, 245, 627, 587, 426, 245, + 246, 245, 245, 586, 581, 294, 246, 625, 294, 245, + + 580, 245, 245, 245, 579, 245, 245, 284, 245, 578, + 245, 245, 246, 577, 574, 573, 246, 476, 477, 478, + 476, 294, 246, 294, 294, 470, 294, 572, 295, 629, + 294, 628, 246, 294, 571, 665, 246, 478, 477, 478, + 478, 246, 630, 294, 294, 633, 294, 294, 634, 631, + 295, 570, 569, 568, 295, 294, 295, 294, 294, 635, + 294, 294, 567, 295, 294, 637, 639, 638, 294, 566, + 294, 294, 640, 294, 563, 294, 295, 295, 294, 294, + 294, 294, 294, 294, 294, 562, 644, 561, 295, 641, + 295, 560, 642, 646, 295, 643, 294, 559, 558, 294, + + 645, 295, 647, 295, 557, 556, 294, 648, 295, 294, + 555, 649, 295, 295, 295, 554, 294, 294, 650, 294, + 294, 294, 294, 294, 294, 294, 294, 553, 552, 295, + 652, 651, 294, 294, 294, 294, 294, 294, 654, 295, + 548, 294, 294, 653, 294, 294, 547, 660, 658, 295, + 295, 657, 546, 545, 295, 295, 295, 544, 659, 663, + 655, 294, 663, 656, 294, 295, 295, 295, 542, 539, + 507, 477, 508, 507, 295, 295, 661, 213, 508, 477, + 508, 508, 662, 583, 582, 662, 294, 509, 294, 294, + 538, 294, 295, 537, 295, 582, 583, 582, 582, 549, + + 550, 551, 549, 334, 536, 535, 534, 664, 551, 550, + 551, 551, 533, 532, 531, 295, 530, 529, 528, 295, + 245, 295, 245, 245, 527, 666, 526, 523, 522, 667, + 743, 521, 389, 582, 583, 582, 582, 590, 591, 592, + 590, 592, 591, 592, 592, 593, 594, 595, 593, 595, + 594, 595, 595, 246, 245, 1012, 245, 245, 1012, 245, + 520, 245, 245, 245, 519, 245, 245, 245, 518, 245, + 245, 737, 738, 245, 517, 245, 245, 516, 294, 515, + 245, 294, 245, 245, 350, 740, 235, 246, 245, 241, + 245, 245, 246, 739, 235, 742, 246, 434, 433, 235, + + 246, 741, 245, 1013, 245, 245, 246, 245, 774, 245, + 245, 295, 245, 246, 245, 245, 245, 744, 245, 245, + 245, 246, 245, 245, 231, 745, 432, 245, 746, 245, + 245, 245, 227, 245, 245, 246, 222, 749, 748, 245, + 246, 245, 245, 431, 747, 246, 752, 430, 245, 246, + 245, 245, 750, 246, 429, 245, 428, 245, 245, 245, + 246, 245, 245, 427, 246, 753, 221, 755, 245, 751, + 245, 245, 246, 216, 245, 215, 245, 245, 754, 425, + 422, 246, 245, 756, 245, 245, 421, 420, 246, 757, + 419, 418, 246, 245, 417, 245, 245, 758, 416, 415, + + 245, 246, 245, 245, 414, 413, 412, 246, 245, 759, + 245, 245, 411, 410, 245, 246, 245, 245, 245, 761, + 245, 245, 409, 406, 762, 405, 246, 404, 763, 760, + 403, 402, 245, 246, 245, 245, 245, 401, 245, 245, + 245, 246, 245, 245, 400, 399, 627, 246, 245, 627, + 764, 246, 626, 583, 626, 626, 245, 398, 245, 245, + 245, 765, 245, 245, 245, 246, 245, 245, 770, 246, + 245, 770, 179, 246, 294, 294, 382, 294, 294, 246, + 294, 294, 381, 294, 294, 246, 766, 294, 773, 246, + 294, 772, 294, 246, 628, 294, 378, 246, 775, 769, + + 294, 246, 777, 294, 767, 375, 768, 295, 295, 776, + 778, 370, 294, 295, 295, 294, 771, 369, 368, 294, + 295, 779, 294, 294, 294, 295, 294, 294, 294, 294, + 357, 294, 294, 295, 294, 780, 354, 294, 294, 294, + 781, 294, 294, 351, 294, 295, 784, 294, 788, 350, + 783, 782, 295, 785, 787, 786, 295, 295, 350, 243, + 294, 295, 295, 294, 239, 236, 294, 295, 791, 294, + 789, 295, 295, 294, 235, 294, 294, 295, 294, 294, + 294, 294, 294, 294, 294, 231, 294, 227, 792, 294, + 793, 222, 796, 295, 790, 794, 797, 294, 294, 295, + + 294, 294, 294, 221, 216, 294, 295, 798, 295, 795, + 215, 205, 295, 295, 295, 294, 799, 204, 294, 295, + 662, 583, 582, 662, 199, 663, 294, 800, 663, 294, + 295, 295, 198, 294, 294, 295, 294, 294, 805, 197, + 186, 805, 245, 294, 245, 245, 294, 245, 295, 245, + 245, 183, 180, 295, 245, 179, 245, 245, 295, 295, + 179, 801, 865, 178, 1110, 1110, 295, 295, 1110, 804, + 864, 295, 1110, 664, 802, 246, 295, 1110, 1110, 803, + 246, 866, 245, 1110, 245, 245, 806, 246, 245, 1110, + 245, 245, 867, 245, 1110, 245, 245, 245, 868, 245, + + 245, 1110, 245, 869, 245, 245, 245, 1110, 245, 245, + 1110, 245, 870, 245, 245, 246, 871, 245, 1110, 245, + 245, 246, 245, 1110, 245, 245, 246, 872, 1110, 1110, + 246, 245, 873, 245, 245, 246, 1110, 1110, 876, 246, + 245, 874, 245, 245, 246, 245, 1110, 245, 245, 245, + 246, 245, 245, 1110, 245, 246, 245, 245, 877, 245, + 294, 245, 245, 294, 246, 1110, 1110, 245, 875, 245, + 245, 1110, 1110, 246, 878, 894, 879, 245, 246, 245, + 245, 245, 246, 245, 245, 1110, 245, 246, 245, 245, + 1110, 882, 246, 295, 1110, 245, 880, 245, 245, 245, + + 246, 245, 245, 1110, 1110, 883, 881, 1110, 884, 885, + 246, 1110, 1110, 245, 246, 245, 245, 1110, 245, 246, + 245, 245, 245, 1110, 245, 245, 1110, 245, 246, 245, + 245, 245, 246, 245, 245, 245, 1110, 245, 245, 245, + 1110, 245, 245, 886, 1110, 245, 246, 245, 245, 1110, + 245, 246, 245, 245, 888, 246, 887, 1110, 1110, 770, + 246, 245, 770, 245, 246, 245, 245, 294, 246, 1110, + 294, 294, 246, 1110, 294, 889, 294, 1110, 246, 294, + 890, 1110, 1110, 246, 891, 1012, 896, 294, 1012, 1110, + 294, 294, 246, 1110, 294, 893, 246, 897, 895, 1110, + + 295, 898, 294, 294, 295, 294, 294, 771, 1110, 295, + 1110, 892, 899, 900, 294, 294, 294, 294, 294, 294, + 295, 1110, 1110, 1110, 295, 901, 902, 294, 294, 294, + 294, 294, 294, 1013, 1110, 295, 295, 903, 294, 1110, + 294, 294, 904, 294, 1110, 1110, 1110, 295, 295, 295, + 294, 906, 1110, 294, 294, 905, 908, 294, 1110, 1110, + 295, 295, 295, 294, 911, 294, 294, 907, 294, 294, + 1110, 295, 294, 295, 294, 294, 1110, 294, 294, 912, + 1110, 1110, 294, 295, 914, 294, 294, 295, 294, 294, + 294, 294, 909, 294, 910, 1110, 295, 913, 295, 1110, + + 294, 294, 295, 294, 294, 1110, 294, 295, 295, 294, + 1110, 294, 915, 917, 294, 295, 1110, 294, 1110, 295, + 294, 295, 805, 295, 294, 805, 1110, 294, 245, 916, + 245, 245, 1051, 295, 295, 1051, 1110, 1110, 958, 295, + 245, 918, 245, 245, 295, 245, 919, 245, 245, 1051, + 295, 920, 1051, 1110, 1110, 295, 245, 295, 245, 245, + 245, 246, 245, 245, 1110, 245, 959, 245, 245, 1110, + 806, 1110, 921, 246, 245, 960, 245, 245, 246, 245, + 1052, 245, 245, 245, 1110, 245, 245, 1110, 245, 246, + 245, 245, 245, 246, 245, 245, 1110, 1052, 246, 245, + + 1110, 245, 245, 245, 1110, 245, 245, 246, 1110, 961, + 1110, 245, 246, 245, 245, 245, 246, 245, 245, 1110, + 245, 246, 245, 245, 962, 246, 1110, 1110, 964, 1110, + 966, 1110, 246, 1110, 965, 245, 246, 245, 245, 245, + 963, 245, 245, 1051, 246, 967, 1051, 1110, 246, 968, + 1110, 1110, 245, 246, 245, 245, 245, 1110, 245, 245, + 245, 1110, 245, 245, 245, 1110, 245, 245, 246, 1110, + 294, 1110, 246, 294, 245, 969, 245, 245, 245, 1110, + 245, 245, 1110, 1110, 245, 246, 245, 245, 971, 246, + 1110, 1052, 245, 246, 245, 245, 970, 246, 245, 972, + + 245, 245, 245, 295, 245, 245, 245, 246, 245, 245, + 294, 246, 294, 294, 1110, 294, 294, 246, 294, 294, + 976, 294, 977, 1110, 294, 246, 978, 294, 1110, 294, + 294, 246, 294, 294, 974, 246, 1110, 973, 294, 246, + 1110, 294, 1110, 295, 1110, 295, 1110, 975, 1110, 295, + 294, 295, 294, 294, 1110, 294, 294, 295, 1110, 294, + 1110, 294, 295, 295, 294, 294, 979, 294, 294, 294, + 294, 295, 294, 294, 980, 1110, 294, 294, 294, 984, + 294, 294, 1110, 295, 983, 295, 1110, 985, 986, 295, + 981, 1110, 982, 294, 295, 1110, 294, 1110, 295, 1110, + + 295, 294, 295, 1110, 294, 294, 295, 1110, 294, 294, + 295, 295, 294, 1110, 294, 294, 987, 294, 294, 294, + 294, 1110, 294, 294, 989, 294, 295, 1110, 294, 294, + 990, 988, 294, 245, 295, 245, 245, 1110, 295, 1110, + 1110, 245, 295, 245, 245, 1110, 1110, 295, 295, 1110, + 1110, 1110, 295, 295, 1110, 1110, 992, 245, 295, 245, + 245, 1110, 295, 1110, 991, 245, 246, 245, 245, 245, + 993, 245, 245, 245, 246, 245, 245, 245, 1110, 245, + 245, 245, 1110, 245, 245, 245, 1110, 245, 245, 1110, + 246, 1110, 1016, 245, 1015, 245, 245, 294, 246, 1017, + + 294, 294, 246, 1018, 294, 245, 246, 245, 245, 245, + 246, 245, 245, 245, 246, 245, 245, 1110, 246, 1019, + 245, 294, 245, 245, 294, 245, 246, 245, 245, 245, + 295, 245, 245, 294, 295, 1021, 294, 1022, 246, 1110, + 1110, 1023, 246, 245, 1023, 245, 246, 245, 245, 1020, + 1110, 1110, 294, 246, 295, 294, 1110, 294, 246, 1110, + 294, 294, 246, 1110, 294, 294, 295, 294, 294, 294, + 294, 1110, 294, 1110, 246, 1110, 1027, 1026, 246, 294, + 1110, 1025, 294, 1028, 1110, 295, 1110, 1029, 294, 1024, + 295, 294, 294, 294, 295, 294, 294, 1110, 295, 1110, + + 295, 294, 295, 1030, 294, 294, 1034, 294, 294, 1034, + 294, 1032, 295, 1033, 1110, 1110, 1110, 1031, 1110, 1110, + 245, 295, 245, 245, 1110, 295, 295, 245, 294, 245, + 245, 294, 1110, 245, 295, 245, 245, 1110, 295, 295, + 295, 294, 1053, 1036, 294, 245, 1110, 245, 245, 1054, + 1062, 1110, 1110, 246, 1035, 1055, 245, 1110, 245, 245, + 246, 295, 245, 1063, 245, 245, 246, 245, 1110, 245, + 245, 1056, 1057, 245, 295, 245, 245, 1023, 246, 245, + 1023, 245, 1110, 245, 245, 1060, 1110, 245, 1060, 246, + 294, 294, 1110, 294, 294, 246, 1110, 1110, 1110, 294, + + 246, 1064, 294, 1110, 294, 1065, 246, 294, 1058, 294, + 246, 1110, 294, 294, 246, 1110, 294, 1034, 246, 1066, + 1034, 1110, 1110, 295, 295, 1024, 1110, 294, 1069, 1059, + 294, 1069, 295, 1061, 1110, 1110, 245, 295, 245, 245, + 1110, 245, 295, 245, 245, 1110, 295, 1110, 1067, 1110, + 295, 1080, 245, 1110, 245, 245, 245, 1110, 245, 245, + 295, 295, 1110, 1110, 1110, 1035, 1082, 1081, 245, 246, + 245, 245, 1110, 1110, 246, 1068, 1070, 245, 1110, 245, + 245, 245, 1110, 245, 245, 246, 1110, 1110, 1060, 246, + 245, 1060, 245, 294, 245, 245, 294, 294, 1110, 294, + + 294, 246, 294, 1085, 294, 294, 294, 294, 294, 294, + 246, 1110, 1086, 1083, 246, 1087, 294, 1069, 1110, 294, + 1069, 246, 1110, 1110, 294, 246, 295, 294, 1110, 1110, + 295, 245, 295, 245, 245, 1110, 1061, 295, 295, 295, + 1084, 245, 1088, 245, 245, 245, 1110, 245, 245, 295, + 295, 1094, 245, 1110, 245, 245, 245, 295, 245, 245, + 294, 1110, 1110, 294, 246, 1070, 294, 294, 294, 294, + 294, 294, 1089, 1110, 246, 1110, 1096, 1110, 246, 294, + 1110, 245, 294, 245, 245, 246, 1110, 1110, 245, 246, + 245, 245, 294, 295, 1095, 294, 1110, 1110, 1110, 295, + + 295, 295, 294, 1110, 245, 294, 245, 245, 294, 1110, + 1097, 294, 295, 1110, 246, 1110, 245, 294, 245, 245, + 294, 246, 1110, 1110, 1110, 295, 1108, 1109, 245, 294, + 245, 245, 294, 1100, 1110, 295, 1110, 246, 1110, 1110, + 1110, 295, 1104, 1110, 1110, 1110, 1105, 1101, 1110, 246, + 295, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 246, 295, 52, 52, 52, 52, 52, 52, 57, + 57, 57, 57, 57, 57, 64, 64, 64, 64, 64, + 64, 69, 69, 69, 69, 69, 69, 171, 171, 171, + 171, 171, 171, 213, 213, 1110, 213, 213, 213, 223, + + 223, 223, 223, 223, 223, 226, 1110, 1110, 1110, 226, + 226, 228, 228, 228, 228, 228, 228, 234, 234, 1110, + 1110, 234, 234, 240, 240, 240, 240, 240, 240, 244, + 244, 1110, 244, 244, 244, 282, 282, 1110, 282, 282, + 282, 293, 293, 1110, 1110, 1110, 293, 332, 332, 1110, + 332, 332, 332, 387, 387, 1110, 1110, 1110, 387, 17, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110 } ; -static yyconst flex_int16_t yy_chk[3654] = +static yyconst flex_int16_t yy_chk[3712] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1221,412 +1236,419 @@ static yyconst flex_int16_t yy_chk[3654] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 7, 7, 2, 2, 3, 3, 3, 3, - 1111, 2, 4, 4, 4, 4, 4, 5, 5, 6, + 1126, 2, 4, 4, 4, 4, 4, 5, 5, 6, 6, 8, 8, 19, 2, 28, 19, 4, 15, 15, 15, 15, 28, 30, 39, 15, 35, 49, 34, 33, - 30, 2, 169, 2, 32, 2, 39, 32, 2, 2, + 30, 2, 1106, 2, 32, 2, 39, 32, 2, 2, - 33, 32, 34, 35, 32, 50, 4, 50, 49, 67, - 5, 15, 6, 169, 67, 5, 1091, 6, 9, 9, + 33, 32, 34, 35, 32, 40, 4, 50, 49, 50, + 5, 15, 6, 40, 170, 5, 170, 6, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, - 46, 63, 10, 10, 16, 16, 16, 16, 1088, 10, - 156, 16, 69, 69, 46, 55, 55, 55, 60, 60, - 60, 60, 10, 154, 149, 151, 153, 156, 155, 153, + 46, 63, 10, 10, 16, 16, 16, 16, 67, 10, + 156, 16, 1103, 67, 46, 55, 55, 55, 60, 60, + 60, 60, 10, 69, 69, 149, 151, 156, 153, 154, - 63, 149, 151, 153, 154, 1087, 153, 16, 170, 10, - 170, 10, 155, 10, 213, 213, 10, 10, 11, 11, + 63, 153, 149, 151, 161, 153, 1102, 16, 153, 10, + 154, 10, 161, 10, 214, 214, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, - 1084, 232, 12, 12, 72, 107, 72, 72, 107, 12, - 166, 73, 73, 73, 73, 160, 163, 163, 163, 163, - 177, 189, 12, 177, 166, 203, 703, 160, 203, 210, + 169, 155, 12, 12, 72, 107, 72, 72, 107, 12, + 166, 73, 73, 73, 73, 155, 160, 163, 163, 163, + 163, 169, 12, 177, 166, 1099, 177, 204, 160, 1098, - 232, 210, 224, 224, 224, 189, 1083, 72, 107, 12, - 236, 12, 703, 12, 73, 236, 12, 12, 13, 13, + 204, 189, 211, 375, 211, 237, 375, 72, 107, 12, + 237, 12, 1093, 12, 73, 189, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, - 239, 239, 14, 14, 75, 75, 75, 75, 1078, 14, - 217, 76, 111, 76, 76, 111, 77, 115, 77, 77, - 115, 78, 14, 78, 78, 77, 79, 1076, 79, 79, - - 80, 217, 80, 80, 1075, 79, 380, 75, 1063, 14, - 1061, 14, 1059, 14, 76, 111, 14, 14, 43, 77, - 115, 43, 43, 81, 78, 81, 81, 380, 43, 79, - 229, 229, 229, 80, 82, 1058, 82, 82, 83, 81, - 83, 83, 371, 1057, 117, 371, 84, 117, 84, 84, - 376, 376, 82, 83, 116, 1056, 81, 116, 43, 82, + 240, 240, 14, 14, 75, 75, 75, 75, 1091, 14, + 218, 76, 111, 76, 76, 111, 77, 115, 77, 77, + 115, 78, 14, 78, 78, 77, 79, 1090, 79, 79, + + 80, 218, 80, 80, 1078, 79, 233, 75, 1076, 14, + 1074, 14, 1073, 14, 76, 111, 14, 14, 43, 77, + 115, 43, 43, 81, 78, 81, 81, 1072, 43, 79, + 225, 225, 225, 80, 82, 233, 82, 82, 83, 81, + 83, 83, 380, 380, 117, 1071, 84, 117, 84, 84, + 1052, 1049, 82, 83, 116, 384, 81, 116, 43, 82, 43, 85, 117, 85, 85, 43, 43, 82, 84, 117, - 116, 83, 357, 416, 406, 84, 416, 117, 1037, 84, - 87, 422, 87, 87, 422, 1034, 357, 116, 406, 89, - 85, 89, 89, 1032, 85, 86, 87, 86, 86, 88, + 116, 83, 230, 230, 230, 84, 384, 117, 420, 84, + 87, 420, 87, 87, 1047, 537, 1045, 116, 537, 89, + 85, 89, 89, 1044, 85, 86, 87, 86, 86, 88, - 89, 88, 88, 90, 805, 90, 90, 87, 1030, 530, - 88, 86, 530, 87, 86, 1029, 1027, 89, 86, 1026, - 805, 86, 89, 91, 88, 91, 91, 831, 86, 422, + 89, 88, 88, 90, 715, 90, 90, 87, 1042, 427, + 88, 86, 427, 87, 86, 360, 1041, 89, 86, 1040, + 715, 86, 89, 91, 88, 91, 91, 820, 86, 360, 90, 92, 88, 92, 92, 93, 90, 93, 93, 94, - 520, 94, 94, 831, 95, 91, 95, 95, 1025, 97, - 94, 97, 97, 93, 520, 99, 91, 99, 99, 95, - 92, 1024, 1023, 1022, 92, 93, 998, 100, 93, 100, - 100, 996, 94, 96, 96, 96, 96, 95, 98, 98, - 98, 98, 97, 994, 101, 97, 101, 101, 99, 102, - 112, 102, 102, 112, 103, 101, 103, 103, 911, 112, - - 100, 104, 992, 104, 104, 105, 96, 105, 105, 101, - 106, 98, 106, 106, 911, 991, 990, 101, 108, 108, - 108, 108, 102, 112, 104, 989, 988, 103, 110, 110, - 110, 110, 986, 114, 104, 102, 114, 103, 105, 105, - 985, 105, 114, 106, 118, 104, 119, 118, 984, 119, - 983, 108, 120, 129, 982, 120, 129, 121, 106, 118, - 121, 110, 122, 981, 129, 122, 114, 125, 119, 127, - 125, 123, 127, 121, 123, 119, 121, 118, 122, 119, - 121, 120, 123, 121, 126, 120, 129, 126, 124, 122, - 121, 124, 980, 979, 125, 122, 123, 942, 127, 124, - - 125, 941, 127, 939, 123, 128, 126, 130, 128, 938, - 130, 131, 131, 131, 131, 132, 124, 126, 132, 936, - 935, 124, 130, 128, 133, 133, 133, 133, 931, 134, - 135, 134, 134, 135, 136, 128, 134, 136, 128, 137, - 130, 930, 137, 138, 131, 136, 138, 139, 132, 929, - 139, 132, 928, 923, 922, 141, 921, 133, 141, 136, - 920, 140, 134, 135, 140, 536, 919, 136, 536, 918, - 139, 917, 137, 916, 915, 171, 138, 914, 171, 913, - 139, 142, 142, 142, 142, 137, 138, 912, 141, 910, - 909, 139, 908, 907, 140, 140, 848, 140, 144, 144, - - 144, 144, 846, 141, 165, 165, 165, 165, 171, 172, - 172, 172, 172, 536, 142, 174, 174, 174, 174, 176, - 176, 176, 176, 238, 238, 238, 238, 243, 845, 243, - 243, 144, 244, 844, 244, 244, 843, 165, 245, 245, - 245, 245, 172, 246, 246, 246, 246, 842, 174, 841, - 839, 836, 176, 248, 248, 248, 248, 835, 834, 833, - 243, 249, 249, 249, 249, 244, 251, 832, 251, 251, - 830, 245, 238, 821, 820, 251, 246, 819, 252, 818, - 252, 252, 253, 817, 253, 253, 248, 254, 816, 254, - 254, 815, 255, 253, 255, 255, 814, 813, 812, 251, - - 252, 256, 811, 256, 256, 257, 810, 257, 257, 254, - 809, 252, 256, 808, 258, 253, 258, 258, 255, 260, - 254, 260, 260, 291, 257, 255, 291, 807, 259, 258, - 259, 259, 806, 261, 256, 261, 261, 262, 257, 262, - 262, 804, 292, 259, 261, 292, 299, 258, 260, 299, - 803, 263, 260, 263, 263, 299, 291, 264, 261, 264, - 264, 259, 802, 801, 262, 265, 261, 265, 265, 266, - 262, 266, 266, 263, 267, 292, 267, 267, 268, 299, - 268, 268, 264, 301, 263, 269, 301, 269, 269, 800, - 264, 799, 265, 266, 301, 798, 575, 267, 265, 575, - - 797, 796, 266, 270, 269, 270, 270, 267, 268, 795, - 271, 268, 271, 271, 270, 794, 301, 272, 269, 272, - 272, 273, 793, 273, 273, 274, 792, 274, 274, 271, - 723, 722, 278, 273, 278, 278, 270, 275, 720, 275, - 275, 719, 274, 271, 575, 717, 280, 272, 280, 280, - 272, 716, 308, 715, 273, 308, 275, 713, 274, 275, - 276, 276, 276, 276, 281, 278, 281, 281, 712, 278, - 275, 282, 282, 282, 282, 283, 711, 283, 283, 280, - 284, 308, 284, 284, 285, 308, 285, 285, 286, 710, - 286, 286, 287, 276, 287, 287, 709, 281, 708, 286, - - 300, 283, 283, 300, 282, 707, 704, 288, 283, 288, - 288, 702, 701, 284, 284, 287, 289, 285, 289, 289, - 285, 286, 300, 700, 290, 287, 290, 290, 699, 293, - 293, 293, 293, 300, 302, 304, 287, 302, 304, 698, - 288, 294, 294, 294, 294, 303, 304, 288, 303, 289, - 296, 296, 296, 296, 697, 696, 302, 290, 694, 693, - 692, 289, 293, 297, 297, 297, 297, 302, 304, 305, - 306, 303, 305, 306, 294, 691, 307, 310, 303, 307, - 310, 309, 690, 296, 309, 306, 311, 312, 305, 311, - 312, 307, 309, 314, 313, 315, 314, 313, 315, 689, - - 687, 686, 305, 306, 310, 685, 309, 684, 311, 307, - 310, 683, 312, 316, 309, 682, 316, 314, 315, 311, - 312, 313, 317, 681, 680, 317, 314, 313, 315, 318, - 319, 320, 318, 319, 320, 321, 322, 679, 321, 322, - 318, 317, 327, 316, 678, 327, 316, 321, 323, 319, - 677, 323, 676, 322, 675, 317, 324, 324, 324, 324, - 674, 320, 318, 319, 320, 673, 672, 323, 321, 322, - 323, 326, 326, 326, 326, 327, 671, 670, 669, 327, - 329, 323, 329, 329, 668, 667, 666, 329, 330, 324, - 330, 330, 665, 664, 663, 330, 331, 331, 331, 331, - - 662, 332, 333, 331, 332, 333, 334, 335, 336, 334, - 335, 336, 338, 329, 337, 338, 339, 337, 335, 339, - 661, 330, 340, 340, 340, 340, 660, 332, 332, 331, - 659, 336, 658, 657, 332, 333, 333, 580, 578, 334, - 335, 336, 334, 383, 577, 338, 383, 337, 344, 339, - 344, 344, 336, 384, 337, 340, 384, 338, 342, 342, - 342, 342, 343, 343, 343, 343, 372, 372, 372, 372, - 385, 385, 385, 385, 576, 572, 383, 386, 386, 386, - 386, 344, 388, 388, 388, 388, 384, 389, 389, 389, - 389, 342, 390, 571, 390, 390, 391, 391, 391, 391, - - 570, 569, 568, 385, 393, 393, 393, 393, 567, 566, - 386, 421, 421, 421, 421, 388, 428, 428, 428, 428, - 429, 429, 429, 429, 437, 390, 437, 437, 565, 391, - 430, 430, 430, 430, 432, 432, 432, 432, 433, 433, - 433, 433, 435, 435, 435, 435, 564, 436, 437, 436, - 436, 438, 579, 438, 438, 579, 563, 437, 436, 439, - 562, 439, 439, 561, 440, 428, 440, 440, 560, 429, - 487, 433, 441, 487, 441, 441, 438, 559, 558, 430, - 436, 440, 557, 442, 438, 442, 442, 443, 439, 443, - 443, 487, 439, 444, 441, 444, 444, 440, 443, 445, - - 579, 445, 445, 487, 556, 441, 442, 446, 444, 446, - 446, 447, 555, 447, 447, 449, 442, 449, 449, 554, - 443, 553, 448, 552, 448, 448, 444, 445, 449, 551, - 550, 446, 445, 448, 549, 450, 447, 450, 450, 451, - 446, 451, 451, 452, 447, 452, 452, 448, 449, 453, - 548, 453, 453, 547, 546, 448, 450, 545, 452, 544, - 454, 453, 454, 454, 540, 539, 688, 451, 450, 688, - 538, 455, 451, 455, 455, 454, 452, 456, 537, 456, - 456, 534, 453, 473, 455, 457, 473, 457, 457, 458, - 533, 458, 458, 454, 473, 459, 532, 459, 459, 456, - - 461, 457, 461, 461, 455, 462, 531, 462, 462, 460, - 456, 460, 460, 461, 688, 529, 473, 458, 457, 528, - 458, 475, 458, 459, 475, 527, 460, 526, 459, 463, - 463, 463, 463, 461, 464, 464, 464, 464, 462, 462, - 525, 465, 460, 465, 465, 466, 475, 466, 466, 467, - 524, 467, 467, 468, 475, 468, 468, 469, 476, 469, - 469, 476, 463, 470, 470, 470, 470, 464, 472, 472, - 472, 472, 523, 474, 465, 467, 474, 477, 466, 522, - 477, 478, 467, 521, 478, 466, 468, 476, 519, 465, - 469, 476, 468, 518, 477, 517, 470, 474, 469, 479, - - 516, 480, 479, 478, 480, 481, 474, 515, 481, 514, - 477, 513, 480, 482, 478, 483, 482, 512, 483, 511, - 481, 510, 479, 488, 484, 485, 488, 484, 485, 509, - 486, 508, 479, 486, 480, 427, 485, 489, 481, 483, - 489, 482, 490, 486, 491, 490, 482, 491, 483, 484, - 485, 488, 489, 426, 490, 425, 488, 484, 485, 491, - 424, 492, 493, 486, 492, 493, 494, 423, 420, 494, - 489, 419, 418, 495, 492, 490, 495, 491, 498, 417, - 496, 498, 494, 496, 493, 497, 499, 415, 497, 499, - 414, 498, 413, 721, 492, 493, 721, 503, 412, 494, - - 503, 495, 497, 411, 495, 410, 495, 505, 496, 504, - 505, 498, 504, 496, 500, 500, 500, 500, 497, 499, - 499, 500, 501, 501, 501, 501, 502, 502, 502, 502, - 503, 506, 507, 505, 506, 507, 535, 535, 535, 535, - 505, 721, 504, 409, 408, 503, 407, 500, 405, 504, - 541, 541, 541, 541, 543, 543, 543, 543, 404, 502, - 573, 573, 573, 573, 506, 507, 581, 581, 581, 581, - 506, 403, 402, 507, 583, 583, 583, 583, 584, 584, - 584, 584, 401, 541, 586, 586, 586, 586, 587, 623, - 587, 587, 623, 588, 940, 588, 588, 940, 589, 400, - - 589, 589, 623, 399, 398, 587, 588, 590, 397, 590, - 590, 591, 396, 591, 591, 581, 395, 592, 394, 592, - 592, 587, 623, 382, 381, 590, 588, 584, 589, 379, - 378, 589, 592, 593, 377, 593, 593, 374, 622, 591, - 590, 622, 940, 593, 591, 594, 370, 594, 594, 595, - 592, 595, 595, 369, 596, 622, 596, 596, 597, 368, - 597, 597, 598, 367, 598, 598, 593, 599, 366, 599, - 599, 622, 595, 987, 594, 596, 987, 600, 594, 600, - 600, 365, 595, 364, 599, 363, 597, 596, 598, 362, - 601, 597, 601, 601, 602, 598, 602, 602, 361, 360, - - 599, 359, 600, 603, 358, 603, 603, 356, 355, 602, - 600, 601, 604, 603, 604, 604, 605, 354, 605, 605, - 353, 987, 604, 601, 352, 351, 606, 602, 606, 606, - 350, 607, 349, 607, 607, 631, 603, 608, 631, 608, - 608, 348, 347, 241, 605, 604, 607, 237, 234, 605, - 606, 609, 608, 609, 609, 233, 631, 231, 610, 606, - 610, 610, 230, 611, 607, 611, 611, 609, 631, 612, - 608, 612, 612, 634, 611, 613, 634, 613, 613, 612, - 614, 228, 614, 614, 609, 223, 615, 610, 615, 615, - 634, 610, 617, 613, 617, 617, 611, 616, 616, 616, - - 616, 618, 612, 618, 618, 614, 634, 219, 613, 619, - 218, 619, 619, 614, 216, 620, 215, 620, 620, 615, - 621, 624, 621, 621, 624, 617, 625, 214, 626, 625, - 616, 626, 615, 629, 618, 211, 629, 209, 633, 208, - 617, 633, 619, 627, 625, 204, 627, 202, 620, 618, - 620, 624, 201, 621, 624, 619, 626, 628, 627, 625, - 628, 626, 629, 200, 633, 199, 629, 628, 621, 630, - 632, 633, 630, 632, 635, 636, 627, 635, 636, 637, - 198, 638, 637, 639, 638, 640, 639, 197, 640, 196, - 628, 638, 630, 639, 637, 195, 636, 641, 632, 635, - - 641, 997, 630, 632, 997, 194, 999, 635, 636, 999, - 193, 192, 637, 640, 638, 191, 639, 642, 640, 643, - 642, 641, 643, 644, 645, 646, 644, 645, 646, 190, - 641, 188, 642, 187, 643, 647, 646, 648, 647, 644, - 648, 649, 186, 650, 649, 647, 650, 185, 652, 997, - 642, 652, 643, 645, 999, 648, 644, 645, 646, 651, - 651, 651, 651, 184, 653, 183, 649, 653, 647, 654, - 648, 182, 654, 181, 649, 655, 650, 180, 655, 179, - 656, 652, 168, 656, 725, 167, 725, 725, 724, 650, - 724, 724, 651, 164, 162, 161, 652, 653, 726, 725, - - 726, 726, 654, 159, 727, 158, 727, 727, 655, 157, - 655, 152, 653, 656, 727, 654, 724, 725, 150, 148, - 728, 724, 728, 728, 729, 726, 729, 729, 656, 146, - 728, 726, 145, 730, 729, 730, 730, 727, 731, 71, - 731, 731, 732, 68, 732, 732, 66, 737, 731, 737, - 737, 64, 732, 728, 62, 59, 764, 729, 733, 764, - 733, 733, 734, 54, 734, 734, 730, 735, 733, 735, - 735, 731, 734, 51, 737, 732, 736, 735, 736, 736, - 737, 738, 48, 738, 738, 739, 47, 739, 739, 764, - 740, 733, 740, 740, 738, 734, 741, 42, 741, 741, - - 735, 41, 40, 742, 736, 742, 742, 38, 760, 736, - 738, 760, 739, 743, 738, 743, 743, 744, 739, 744, - 744, 37, 746, 740, 746, 746, 36, 744, 745, 741, - 745, 745, 742, 31, 29, 760, 742, 747, 745, 747, - 747, 760, 743, 27, 746, 25, 743, 747, 23, 748, - 744, 748, 748, 21, 749, 746, 749, 749, 17, 0, - 750, 745, 750, 750, 0, 751, 0, 751, 751, 752, - 747, 752, 752, 753, 761, 753, 753, 761, 754, 748, - 754, 754, 748, 755, 761, 755, 755, 749, 751, 750, - 0, 0, 756, 750, 756, 756, 0, 757, 751, 757, - - 757, 758, 752, 0, 758, 759, 753, 761, 759, 752, - 0, 754, 0, 754, 0, 0, 755, 755, 762, 0, - 759, 762, 0, 763, 774, 756, 763, 774, 762, 758, - 757, 0, 765, 763, 758, 765, 766, 0, 759, 766, - 756, 0, 765, 0, 767, 757, 766, 767, 0, 768, - 769, 762, 768, 769, 767, 0, 763, 774, 770, 768, - 769, 770, 0, 771, 0, 765, 771, 773, 772, 766, - 773, 772, 775, 776, 0, 775, 776, 767, 0, 0, - 0, 772, 768, 769, 777, 778, 770, 777, 778, 779, - 771, 770, 779, 0, 773, 778, 771, 772, 0, 779, - - 773, 772, 776, 0, 780, 775, 776, 780, 782, 781, - 0, 782, 781, 777, 0, 0, 0, 777, 778, 781, - 783, 784, 779, 783, 784, 785, 780, 786, 785, 787, - 786, 788, 787, 0, 788, 0, 789, 780, 782, 789, - 790, 782, 781, 790, 791, 0, 0, 791, 785, 849, - 784, 849, 849, 783, 784, 0, 0, 0, 785, 849, - 786, 0, 787, 0, 788, 881, 788, 786, 881, 789, - 789, 0, 852, 790, 852, 852, 850, 791, 850, 850, - 0, 851, 849, 851, 851, 0, 850, 853, 790, 853, - 853, 851, 791, 854, 0, 854, 854, 855, 881, 855, - - 855, 856, 0, 856, 856, 852, 0, 0, 857, 850, - 857, 857, 0, 858, 851, 858, 858, 0, 0, 859, - 853, 859, 859, 0, 0, 860, 854, 860, 860, 862, - 855, 862, 862, 0, 856, 860, 861, 0, 861, 861, - 863, 857, 863, 863, 0, 864, 858, 864, 864, 861, - 0, 0, 859, 882, 862, 864, 882, 878, 860, 863, - 878, 865, 862, 865, 865, 861, 0, 878, 0, 861, - 0, 865, 866, 863, 866, 866, 0, 867, 864, 867, - 867, 868, 866, 868, 868, 869, 882, 869, 869, 870, - 878, 870, 870, 871, 865, 871, 871, 0, 0, 872, - - 869, 872, 872, 0, 873, 866, 873, 873, 0, 872, - 867, 0, 0, 883, 868, 871, 883, 0, 869, 873, - 0, 874, 870, 874, 874, 875, 871, 875, 875, 0, - 0, 876, 872, 876, 876, 0, 877, 873, 877, 877, - 879, 880, 884, 879, 880, 884, 883, 0, 0, 885, - 879, 880, 885, 886, 874, 0, 886, 887, 875, 888, - 887, 875, 888, 0, 876, 890, 874, 889, 890, 877, - 889, 0, 0, 879, 880, 884, 876, 889, 890, 0, - 891, 0, 885, 891, 892, 893, 886, 892, 893, 0, - 887, 0, 888, 0, 890, 893, 894, 0, 890, 894, - - 889, 895, 0, 892, 895, 891, 894, 896, 0, 897, - 896, 895, 897, 891, 0, 0, 898, 892, 893, 898, - 899, 900, 901, 899, 900, 901, 0, 0, 0, 894, - 902, 898, 901, 902, 895, 903, 904, 0, 903, 904, - 896, 905, 897, 900, 905, 902, 0, 0, 906, 898, - 0, 906, 0, 899, 900, 901, 943, 0, 943, 943, - 0, 0, 944, 902, 944, 944, 0, 0, 903, 904, - 0, 0, 904, 945, 905, 945, 945, 0, 0, 0, - 903, 906, 946, 0, 946, 946, 905, 0, 947, 943, - 947, 947, 0, 0, 0, 944, 0, 948, 0, 948, - - 948, 949, 0, 949, 949, 950, 945, 950, 950, 951, - 0, 951, 951, 947, 0, 946, 948, 952, 0, 952, - 952, 947, 953, 949, 953, 953, 954, 950, 954, 954, - 948, 0, 961, 0, 949, 961, 954, 955, 950, 955, - 955, 956, 951, 956, 956, 0, 957, 0, 957, 957, - 952, 959, 0, 959, 959, 953, 957, 0, 962, 954, - 958, 962, 958, 958, 963, 961, 955, 963, 958, 960, - 955, 960, 960, 964, 956, 965, 964, 966, 965, 957, - 966, 0, 967, 969, 959, 967, 969, 968, 0, 970, - 968, 962, 970, 958, 0, 971, 966, 963, 971, 959, - - 965, 0, 960, 0, 967, 960, 964, 0, 965, 968, - 966, 972, 0, 0, 972, 967, 969, 0, 0, 0, - 968, 972, 970, 973, 974, 0, 973, 974, 971, 975, - 976, 977, 975, 976, 977, 0, 0, 978, 976, 975, - 978, 0, 0, 1000, 972, 1000, 1000, 1001, 0, 1001, - 1001, 1002, 973, 1002, 1002, 0, 973, 974, 0, 0, - 0, 1002, 975, 976, 977, 1000, 0, 0, 0, 1001, - 978, 0, 1003, 978, 1003, 1003, 1000, 0, 0, 977, - 1001, 0, 0, 1004, 1002, 1004, 1004, 1003, 1005, 0, - 1005, 1005, 1006, 1011, 1006, 1006, 1011, 1007, 1005, 1007, - - 1007, 1008, 0, 1008, 1008, 1003, 1009, 0, 1009, 1009, - 1010, 1012, 1010, 1010, 1012, 1011, 1004, 1013, 0, 1028, - 1013, 1005, 1028, 0, 0, 1006, 1011, 1013, 1015, 0, - 1007, 1015, 1007, 1012, 1008, 1016, 0, 1014, 1016, 1009, - 1014, 0, 0, 1010, 1012, 1016, 0, 0, 1017, 1008, - 1013, 1017, 1014, 1018, 1009, 0, 1018, 1019, 1010, 1020, - 1019, 1015, 1020, 1021, 0, 0, 1021, 1028, 1016, 1036, - 1014, 1049, 1036, 1038, 1049, 1038, 1038, 1040, 0, 1040, - 1040, 1017, 1039, 1038, 1039, 1039, 1018, 0, 1018, 0, - 1019, 1041, 1020, 1041, 1041, 0, 1021, 1039, 0, 0, - - 1042, 1041, 1042, 1042, 1049, 1019, 1038, 1020, 0, 1051, - 1040, 1021, 1051, 0, 0, 1039, 1043, 1036, 1043, 1043, - 1044, 0, 1044, 1044, 1041, 1045, 0, 1045, 1045, 1046, - 0, 1046, 1046, 1042, 1047, 1048, 1050, 1047, 1048, 1050, - 0, 0, 1051, 0, 1047, 1052, 1050, 0, 1052, 1043, - 1048, 1053, 1043, 1044, 1053, 0, 1054, 1055, 1045, 1054, - 1055, 1065, 1046, 1065, 1065, 0, 0, 1047, 1048, 1050, - 0, 0, 0, 1045, 0, 0, 0, 1046, 1052, 1070, - 0, 1052, 1070, 1066, 1053, 1066, 1066, 0, 1072, 1054, - 1055, 1072, 0, 1066, 1065, 1067, 0, 1067, 1067, 1068, - - 1071, 1068, 1068, 1071, 1054, 1055, 1069, 0, 1069, 1069, - 1071, 1073, 1070, 0, 1073, 1074, 1066, 1079, 1074, 1079, - 1079, 1072, 1080, 1081, 1080, 1080, 1081, 1082, 1067, 0, - 1082, 1086, 1068, 1071, 1086, 1085, 0, 1085, 1085, 1069, - 0, 1068, 0, 1093, 1073, 1093, 1093, 0, 1074, 1089, - 1079, 1089, 1089, 1073, 1094, 1080, 1081, 1094, 0, 1089, - 1082, 0, 0, 0, 1086, 0, 0, 1080, 1085, 1086, - 0, 1090, 1082, 1085, 1090, 0, 1093, 0, 0, 0, - 0, 1090, 1089, 0, 0, 0, 0, 1094, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 1090, 1096, 1096, 1096, 1096, 1096, - 1096, 1097, 1097, 1097, 1097, 1097, 1097, 1098, 1098, 1098, - 1098, 1098, 1098, 1099, 1099, 1099, 1099, 1099, 1099, 1100, - 1100, 1100, 1100, 1100, 1100, 1101, 1101, 0, 1101, 1101, - 1101, 1102, 1102, 1102, 1102, 1102, 1102, 1103, 0, 0, - 0, 1103, 1103, 1104, 1104, 1104, 1104, 1104, 1104, 1105, - 1105, 0, 0, 1105, 1105, 1106, 1106, 1106, 1106, 1106, - 1106, 1107, 1107, 0, 1107, 1107, 1107, 1108, 1108, 0, - 1108, 1108, 1108, 1109, 1109, 0, 0, 0, 1109, 1110, - 1110, 0, 1110, 1110, 1110, 1112, 1112, 0, 0, 0, - - 1112, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, - 1095, 1095, 1095 + 410, 94, 94, 820, 95, 91, 95, 95, 527, 97, + 94, 97, 97, 93, 410, 846, 91, 427, 94, 95, + 92, 1039, 527, 135, 92, 93, 135, 99, 93, 99, + 99, 846, 94, 96, 96, 96, 96, 95, 98, 98, + 98, 98, 97, 1038, 100, 97, 100, 100, 101, 926, + 101, 101, 102, 1037, 102, 102, 135, 1013, 1011, 101, + + 99, 103, 1009, 103, 103, 926, 96, 104, 1007, 104, + 104, 98, 105, 101, 105, 105, 106, 100, 106, 106, + 544, 101, 1006, 544, 1005, 102, 108, 108, 108, 108, + 104, 1004, 112, 114, 103, 112, 114, 1003, 102, 1001, + 104, 112, 114, 1000, 103, 105, 105, 118, 105, 106, + 118, 104, 110, 110, 110, 110, 999, 119, 120, 108, + 119, 120, 118, 998, 106, 112, 114, 122, 544, 997, + 122, 126, 996, 121, 126, 995, 121, 994, 957, 119, + 118, 125, 956, 122, 125, 110, 119, 120, 954, 121, + 119, 120, 121, 126, 122, 953, 121, 951, 123, 121, + + 122, 123, 124, 950, 126, 124, 121, 127, 125, 123, + 127, 946, 945, 124, 125, 128, 944, 130, 128, 132, + 130, 137, 132, 123, 137, 131, 131, 131, 131, 943, + 124, 123, 130, 128, 938, 124, 127, 937, 129, 138, + 127, 129, 138, 936, 134, 128, 134, 134, 128, 129, + 130, 134, 132, 136, 137, 132, 136, 129, 131, 133, + 133, 133, 133, 140, 136, 139, 140, 137, 139, 935, + 141, 129, 138, 141, 934, 933, 932, 134, 136, 931, + 930, 929, 138, 928, 927, 925, 136, 171, 139, 924, + 171, 584, 133, 923, 584, 922, 140, 140, 139, 140, + + 863, 861, 860, 141, 142, 142, 142, 142, 859, 139, + 144, 144, 144, 144, 165, 165, 165, 165, 141, 858, + 171, 172, 172, 172, 172, 174, 174, 174, 174, 176, + 176, 176, 176, 239, 239, 239, 239, 142, 244, 584, + 244, 244, 245, 144, 245, 245, 857, 165, 246, 246, + 246, 246, 856, 854, 172, 851, 850, 588, 174, 849, + 588, 848, 176, 247, 247, 247, 247, 249, 249, 249, + 249, 244, 847, 845, 836, 245, 250, 250, 250, 250, + 835, 246, 239, 252, 834, 252, 252, 253, 833, 253, + 253, 254, 252, 254, 254, 255, 247, 255, 255, 832, + + 249, 256, 254, 256, 256, 588, 831, 830, 257, 253, + 257, 257, 258, 829, 258, 258, 252, 255, 828, 257, + 253, 827, 826, 259, 254, 259, 259, 256, 255, 293, + 825, 258, 293, 260, 256, 260, 260, 824, 259, 823, + 261, 257, 261, 261, 822, 258, 821, 262, 260, 262, + 262, 263, 819, 263, 263, 818, 259, 264, 262, 264, + 264, 265, 293, 265, 265, 266, 260, 266, 266, 261, + 817, 816, 262, 261, 268, 815, 268, 268, 263, 264, + 262, 814, 813, 812, 263, 267, 265, 267, 267, 811, + 264, 810, 266, 269, 265, 269, 269, 268, 266, 809, + + 270, 808, 270, 270, 807, 294, 736, 268, 294, 267, + 271, 735, 271, 271, 273, 733, 273, 273, 267, 270, + 732, 271, 272, 269, 272, 272, 269, 274, 730, 274, + 274, 729, 275, 270, 275, 275, 728, 725, 294, 274, + 724, 272, 723, 271, 273, 722, 721, 273, 276, 275, + 276, 276, 720, 719, 277, 272, 277, 277, 716, 714, + 274, 278, 278, 278, 278, 275, 280, 713, 280, 280, + 276, 712, 282, 277, 282, 282, 277, 283, 711, 283, + 283, 276, 284, 284, 284, 284, 285, 277, 285, 285, + 286, 710, 286, 286, 278, 287, 709, 287, 287, 280, + + 708, 706, 705, 280, 302, 282, 288, 302, 288, 288, + 283, 303, 285, 285, 303, 284, 704, 288, 289, 285, + 289, 289, 303, 286, 286, 703, 302, 290, 287, 290, + 290, 287, 291, 702, 291, 291, 701, 302, 699, 288, + 292, 289, 292, 292, 303, 295, 295, 295, 295, 698, + 697, 289, 296, 296, 296, 296, 298, 298, 298, 298, + 290, 304, 289, 301, 304, 291, 301, 290, 299, 299, + 299, 299, 301, 292, 696, 695, 305, 291, 295, 305, + 694, 306, 693, 304, 306, 296, 692, 307, 308, 298, + 307, 308, 306, 691, 304, 309, 301, 310, 309, 690, + + 310, 689, 305, 308, 311, 312, 307, 311, 312, 305, + 309, 688, 687, 313, 306, 311, 313, 686, 685, 314, + 307, 308, 314, 684, 315, 683, 310, 315, 309, 311, + 310, 316, 312, 317, 316, 313, 317, 311, 312, 318, + 319, 682, 318, 319, 314, 322, 313, 320, 322, 681, + 320, 315, 314, 680, 679, 316, 317, 315, 320, 319, + 321, 678, 323, 321, 316, 323, 317, 324, 325, 318, + 324, 325, 318, 319, 323, 322, 677, 676, 322, 321, + 320, 675, 330, 326, 324, 330, 326, 674, 673, 341, + 325, 337, 341, 321, 337, 323, 327, 327, 327, 327, + + 324, 325, 326, 672, 671, 326, 329, 329, 329, 329, + 332, 336, 332, 332, 336, 330, 326, 332, 333, 330, + 333, 333, 341, 335, 337, 333, 335, 337, 670, 327, + 334, 334, 334, 334, 341, 338, 339, 334, 338, 339, + 669, 668, 589, 332, 336, 336, 338, 587, 586, 335, + 335, 333, 340, 585, 342, 340, 335, 342, 347, 339, + 347, 347, 581, 334, 343, 343, 343, 343, 338, 339, + 345, 345, 345, 345, 346, 346, 346, 346, 580, 579, + 339, 376, 376, 376, 376, 340, 387, 342, 578, 387, + 388, 347, 340, 388, 577, 576, 575, 343, 389, 389, + + 389, 389, 574, 345, 390, 390, 390, 390, 392, 392, + 392, 392, 393, 393, 393, 393, 573, 572, 394, 387, + 394, 394, 571, 388, 395, 395, 395, 395, 570, 569, + 568, 389, 397, 397, 397, 397, 700, 390, 567, 700, + 566, 392, 426, 426, 426, 426, 433, 433, 433, 433, + 565, 394, 434, 434, 434, 434, 564, 395, 435, 435, + 435, 435, 437, 437, 437, 437, 438, 438, 438, 438, + 440, 440, 440, 440, 563, 441, 562, 441, 441, 442, + 561, 442, 442, 560, 700, 443, 441, 443, 443, 559, + 444, 558, 444, 444, 445, 433, 445, 445, 557, 438, + + 556, 434, 446, 442, 446, 446, 479, 435, 441, 479, + 443, 445, 442, 447, 555, 447, 447, 479, 443, 444, + 554, 553, 734, 444, 446, 734, 448, 445, 448, 448, + 449, 552, 449, 449, 548, 446, 447, 448, 450, 479, + 450, 450, 547, 546, 545, 449, 447, 542, 451, 541, + 451, 451, 452, 955, 452, 452, 955, 540, 453, 448, + 453, 453, 454, 449, 454, 454, 450, 539, 538, 453, + 734, 450, 451, 536, 535, 454, 455, 452, 455, 455, + 534, 451, 533, 453, 456, 452, 456, 456, 532, 531, + 457, 453, 457, 457, 530, 454, 458, 455, 458, 458, + + 459, 955, 459, 459, 461, 457, 461, 461, 458, 455, + 529, 460, 456, 460, 460, 459, 462, 456, 462, 462, + 528, 526, 525, 457, 460, 463, 461, 463, 463, 458, + 524, 523, 462, 459, 522, 521, 464, 461, 464, 464, + 465, 520, 465, 465, 460, 466, 519, 466, 466, 462, + 518, 483, 517, 463, 483, 465, 463, 467, 463, 467, + 467, 516, 466, 468, 464, 468, 468, 515, 483, 464, + 467, 432, 431, 465, 469, 469, 469, 469, 466, 470, + 470, 470, 470, 471, 483, 471, 471, 430, 429, 472, + 467, 472, 472, 428, 425, 511, 468, 468, 511, 473, + + 424, 473, 473, 474, 423, 474, 474, 469, 475, 422, + 475, 475, 470, 421, 419, 418, 471, 476, 476, 476, + 476, 480, 472, 481, 480, 473, 481, 417, 511, 472, + 482, 471, 473, 482, 416, 511, 474, 478, 478, 478, + 478, 475, 474, 484, 485, 480, 484, 485, 481, 475, + 476, 415, 414, 413, 480, 486, 481, 487, 486, 482, + 487, 488, 412, 482, 488, 484, 486, 485, 489, 411, + 490, 489, 487, 490, 409, 491, 484, 485, 491, 494, + 492, 493, 494, 492, 493, 408, 491, 407, 486, 488, + 487, 406, 489, 492, 488, 490, 495, 405, 404, 495, + + 491, 489, 493, 490, 403, 402, 496, 494, 491, 496, + 401, 495, 494, 492, 493, 400, 497, 498, 496, 497, + 498, 499, 500, 502, 499, 500, 502, 399, 398, 495, + 498, 497, 501, 503, 505, 501, 503, 505, 500, 496, + 386, 504, 506, 499, 504, 506, 385, 505, 503, 497, + 498, 502, 383, 382, 499, 500, 502, 381, 504, 510, + 501, 512, 510, 501, 512, 501, 503, 505, 378, 374, + 507, 507, 507, 507, 504, 506, 506, 507, 508, 508, + 508, 508, 509, 509, 509, 509, 513, 512, 514, 513, + 373, 514, 510, 372, 512, 543, 543, 543, 543, 549, + + 549, 549, 549, 507, 371, 370, 369, 510, 551, 551, + 551, 551, 368, 367, 366, 509, 365, 364, 363, 513, + 602, 514, 602, 602, 362, 513, 361, 359, 358, 514, + 602, 357, 549, 582, 582, 582, 582, 590, 590, 590, + 590, 592, 592, 592, 592, 593, 593, 593, 593, 595, + 595, 595, 595, 602, 596, 1002, 596, 596, 1002, 597, + 356, 597, 597, 598, 355, 598, 598, 599, 354, 599, + 599, 596, 597, 600, 353, 600, 600, 352, 634, 351, + 601, 634, 601, 601, 350, 599, 590, 596, 603, 242, + 603, 603, 597, 598, 593, 601, 598, 238, 235, 234, + + 599, 600, 604, 1002, 604, 604, 600, 605, 634, 605, + 605, 634, 607, 601, 607, 607, 606, 603, 606, 606, + 608, 603, 608, 608, 232, 604, 231, 609, 605, 609, + 609, 611, 229, 611, 611, 604, 224, 608, 607, 614, + 605, 614, 614, 220, 606, 607, 611, 219, 610, 606, + 610, 610, 609, 608, 217, 612, 216, 612, 612, 615, + 609, 615, 615, 215, 611, 612, 212, 614, 613, 610, + 613, 613, 614, 210, 616, 209, 616, 616, 613, 205, + 203, 610, 617, 615, 617, 617, 202, 201, 612, 616, + 200, 199, 615, 618, 198, 618, 618, 617, 197, 196, + + 619, 613, 619, 619, 195, 194, 193, 616, 620, 618, + 620, 620, 192, 191, 621, 617, 621, 621, 622, 620, + 622, 622, 190, 188, 621, 187, 618, 186, 622, 619, + 185, 184, 623, 619, 623, 623, 624, 183, 624, 624, + 625, 620, 625, 625, 182, 181, 627, 621, 627, 627, + 623, 622, 626, 626, 626, 626, 628, 180, 628, 628, + 629, 624, 629, 629, 630, 623, 630, 630, 631, 624, + 631, 631, 179, 625, 632, 633, 168, 632, 633, 627, + 635, 636, 167, 635, 636, 626, 625, 637, 633, 628, + 637, 632, 639, 629, 627, 639, 164, 630, 635, 630, + + 638, 631, 637, 638, 628, 162, 629, 632, 633, 636, + 638, 159, 640, 635, 636, 640, 631, 158, 157, 641, + 637, 639, 641, 642, 643, 639, 642, 643, 645, 644, + 152, 645, 644, 638, 646, 640, 150, 646, 648, 647, + 641, 648, 647, 148, 651, 640, 644, 651, 648, 146, + 643, 642, 641, 645, 647, 646, 642, 643, 145, 71, + 649, 645, 644, 649, 68, 66, 650, 646, 651, 650, + 649, 648, 647, 652, 64, 653, 652, 651, 653, 654, + 655, 656, 654, 655, 656, 62, 657, 59, 652, 657, + 653, 54, 656, 649, 650, 654, 657, 658, 659, 650, + + 658, 659, 660, 51, 48, 660, 652, 658, 653, 655, + 47, 42, 654, 655, 656, 661, 659, 41, 661, 657, + 662, 662, 662, 662, 38, 663, 664, 660, 663, 664, + 658, 659, 37, 665, 666, 660, 665, 666, 667, 36, + 31, 667, 737, 778, 737, 737, 778, 738, 661, 738, + 738, 29, 27, 662, 739, 25, 739, 739, 663, 664, + 23, 661, 738, 21, 17, 0, 665, 666, 0, 666, + 737, 667, 0, 663, 664, 737, 778, 0, 0, 665, + 738, 739, 740, 0, 740, 740, 667, 739, 741, 0, + 741, 741, 740, 742, 0, 742, 742, 743, 741, 743, + + 743, 0, 744, 742, 744, 744, 745, 0, 745, 745, + 0, 750, 744, 750, 750, 740, 745, 746, 0, 746, + 746, 741, 747, 0, 747, 747, 742, 746, 0, 0, + 743, 748, 747, 748, 748, 744, 0, 0, 750, 745, + 749, 748, 749, 749, 750, 751, 0, 751, 751, 752, + 746, 752, 752, 0, 753, 747, 753, 753, 751, 754, + 773, 754, 754, 773, 748, 0, 0, 755, 749, 755, + 755, 0, 0, 749, 751, 773, 752, 756, 751, 756, + 756, 757, 752, 757, 757, 0, 759, 753, 759, 759, + 0, 757, 754, 773, 0, 758, 755, 758, 758, 760, + + 755, 760, 760, 0, 0, 758, 756, 0, 759, 760, + 756, 0, 0, 761, 757, 761, 761, 0, 762, 759, + 762, 762, 763, 0, 763, 763, 0, 764, 758, 764, + 764, 765, 760, 765, 765, 766, 0, 766, 766, 767, + 0, 767, 767, 761, 0, 768, 761, 768, 768, 0, + 769, 762, 769, 769, 765, 763, 764, 0, 0, 770, + 764, 770, 770, 771, 765, 771, 771, 772, 766, 0, + 772, 774, 767, 0, 774, 766, 775, 0, 768, 775, + 768, 0, 0, 769, 769, 1012, 775, 776, 1012, 0, + 776, 777, 770, 0, 777, 772, 771, 776, 774, 0, + + 772, 777, 779, 780, 774, 779, 780, 770, 0, 775, + 0, 771, 779, 780, 784, 781, 782, 784, 781, 782, + 776, 0, 0, 0, 777, 781, 782, 783, 785, 787, + 783, 785, 787, 1012, 0, 779, 780, 783, 786, 0, + 788, 786, 784, 788, 0, 0, 0, 784, 781, 782, + 789, 786, 0, 789, 792, 785, 787, 792, 0, 0, + 783, 785, 787, 790, 792, 791, 790, 786, 791, 793, + 0, 786, 793, 788, 795, 794, 0, 795, 794, 793, + 0, 0, 796, 789, 795, 796, 797, 792, 798, 797, + 800, 798, 790, 800, 791, 0, 790, 794, 791, 0, + + 799, 801, 793, 799, 801, 0, 802, 795, 794, 802, + 0, 803, 796, 800, 803, 796, 0, 804, 0, 797, + 804, 798, 805, 800, 806, 805, 0, 806, 864, 799, + 864, 864, 1014, 799, 801, 1014, 0, 0, 864, 802, + 867, 801, 867, 867, 803, 868, 803, 868, 868, 1043, + 804, 804, 1043, 0, 0, 805, 865, 806, 865, 865, + 869, 864, 869, 869, 0, 866, 865, 866, 866, 0, + 805, 0, 806, 867, 870, 866, 870, 870, 868, 871, + 1014, 871, 871, 872, 0, 872, 872, 0, 873, 865, + 873, 873, 874, 869, 874, 874, 0, 1043, 866, 875, + + 0, 875, 875, 877, 0, 877, 877, 870, 0, 875, + 0, 876, 871, 876, 876, 878, 872, 878, 878, 0, + 879, 873, 879, 879, 876, 874, 0, 0, 877, 0, + 879, 0, 875, 0, 878, 880, 877, 880, 880, 881, + 876, 881, 881, 1051, 876, 880, 1051, 0, 878, 881, + 0, 0, 882, 879, 882, 882, 883, 0, 883, 883, + 884, 0, 884, 884, 885, 0, 885, 885, 880, 0, + 896, 0, 881, 896, 886, 884, 886, 886, 887, 0, + 887, 887, 0, 0, 888, 882, 888, 888, 887, 883, + 0, 1051, 889, 884, 889, 889, 886, 885, 890, 888, + + 890, 890, 891, 896, 891, 891, 892, 886, 892, 892, + 893, 887, 894, 893, 0, 894, 895, 888, 897, 895, + 893, 897, 894, 0, 898, 889, 895, 898, 0, 899, + 900, 890, 899, 900, 890, 891, 0, 889, 901, 892, + 0, 901, 0, 893, 0, 894, 0, 891, 0, 895, + 902, 897, 903, 902, 0, 903, 904, 898, 0, 904, + 0, 905, 899, 900, 905, 907, 904, 906, 907, 908, + 906, 901, 908, 911, 905, 0, 911, 909, 910, 908, + 909, 910, 0, 902, 907, 903, 0, 909, 910, 904, + 905, 0, 906, 912, 905, 0, 912, 0, 907, 0, + + 906, 913, 908, 0, 913, 914, 911, 0, 914, 915, + 909, 910, 915, 0, 916, 917, 913, 916, 917, 918, + 919, 0, 918, 919, 916, 920, 912, 0, 920, 921, + 917, 915, 921, 958, 913, 958, 958, 0, 914, 0, + 0, 959, 915, 959, 959, 0, 0, 916, 917, 0, + 0, 0, 918, 919, 0, 0, 919, 960, 920, 960, + 960, 0, 921, 0, 918, 961, 958, 961, 961, 962, + 920, 962, 962, 963, 959, 963, 963, 964, 0, 964, + 964, 965, 0, 965, 965, 966, 0, 966, 966, 0, + 960, 0, 963, 967, 962, 967, 967, 976, 961, 964, + + 976, 977, 962, 965, 977, 968, 963, 968, 968, 969, + 964, 969, 969, 971, 965, 971, 971, 0, 966, 969, + 970, 978, 970, 970, 978, 972, 967, 972, 972, 973, + 976, 973, 973, 979, 977, 972, 979, 973, 968, 0, + 0, 974, 969, 974, 974, 975, 971, 975, 975, 970, + 0, 0, 980, 970, 978, 980, 0, 981, 972, 0, + 981, 982, 973, 0, 982, 983, 979, 984, 983, 985, + 984, 0, 985, 0, 974, 0, 981, 980, 975, 986, + 0, 975, 986, 982, 0, 980, 0, 983, 988, 974, + 981, 988, 989, 987, 982, 989, 987, 0, 983, 0, + + 984, 990, 985, 987, 990, 991, 992, 993, 991, 992, + 993, 990, 986, 991, 0, 0, 0, 988, 0, 0, + 1015, 988, 1015, 1015, 0, 989, 987, 1016, 1026, 1016, + 1016, 1026, 0, 1019, 990, 1019, 1019, 0, 991, 992, + 993, 1027, 1015, 993, 1027, 1017, 0, 1017, 1017, 1016, + 1026, 0, 0, 1015, 992, 1017, 1018, 0, 1018, 1018, + 1016, 1026, 1020, 1027, 1020, 1020, 1019, 1021, 0, 1021, + 1021, 1018, 1020, 1022, 1027, 1022, 1022, 1023, 1017, 1023, + 1023, 1024, 0, 1024, 1024, 1025, 0, 1025, 1025, 1018, + 1029, 1028, 0, 1029, 1028, 1020, 0, 0, 0, 1030, + + 1021, 1028, 1030, 0, 1032, 1029, 1022, 1032, 1022, 1031, + 1023, 0, 1031, 1033, 1024, 0, 1033, 1034, 1025, 1031, + 1034, 0, 0, 1029, 1028, 1023, 0, 1035, 1036, 1024, + 1035, 1036, 1030, 1025, 0, 0, 1055, 1032, 1055, 1055, + 0, 1053, 1031, 1053, 1053, 0, 1033, 0, 1033, 0, + 1034, 1053, 1054, 0, 1054, 1054, 1056, 0, 1056, 1056, + 1035, 1036, 0, 0, 0, 1034, 1056, 1054, 1057, 1055, + 1057, 1057, 0, 0, 1053, 1035, 1036, 1058, 0, 1058, + 1058, 1059, 0, 1059, 1059, 1054, 0, 0, 1060, 1056, + 1060, 1060, 1061, 1062, 1061, 1061, 1062, 1063, 0, 1064, + + 1063, 1057, 1064, 1062, 1066, 1065, 1067, 1066, 1065, 1067, + 1058, 0, 1063, 1058, 1059, 1065, 1068, 1069, 0, 1068, + 1069, 1060, 0, 0, 1070, 1061, 1062, 1070, 0, 0, + 1063, 1080, 1064, 1080, 1080, 0, 1060, 1066, 1065, 1067, + 1061, 1081, 1067, 1081, 1081, 1082, 0, 1082, 1082, 1068, + 1069, 1081, 1083, 0, 1083, 1083, 1084, 1070, 1084, 1084, + 1085, 0, 0, 1085, 1080, 1069, 1086, 1087, 1088, 1086, + 1087, 1088, 1070, 0, 1081, 0, 1086, 0, 1082, 1089, + 0, 1094, 1089, 1094, 1094, 1083, 0, 0, 1095, 1084, + 1095, 1095, 1096, 1085, 1083, 1096, 0, 0, 0, 1086, + + 1087, 1088, 1097, 0, 1100, 1097, 1100, 1100, 1101, 0, + 1088, 1101, 1089, 0, 1094, 0, 1104, 1105, 1104, 1104, + 1105, 1095, 0, 0, 0, 1096, 1104, 1105, 1108, 1109, + 1108, 1108, 1109, 1095, 0, 1097, 0, 1100, 0, 0, + 0, 1101, 1100, 0, 0, 0, 1101, 1097, 0, 1104, + 1105, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1108, 1109, 1111, 1111, 1111, 1111, 1111, 1111, 1112, + 1112, 1112, 1112, 1112, 1112, 1113, 1113, 1113, 1113, 1113, + 1113, 1114, 1114, 1114, 1114, 1114, 1114, 1115, 1115, 1115, + 1115, 1115, 1115, 1116, 1116, 0, 1116, 1116, 1116, 1117, + + 1117, 1117, 1117, 1117, 1117, 1118, 0, 0, 0, 1118, + 1118, 1119, 1119, 1119, 1119, 1119, 1119, 1120, 1120, 0, + 0, 1120, 1120, 1121, 1121, 1121, 1121, 1121, 1121, 1122, + 1122, 0, 1122, 1122, 1122, 1123, 1123, 0, 1123, 1123, + 1123, 1124, 1124, 0, 0, 0, 1124, 1125, 1125, 0, + 1125, 1125, 1125, 1127, 1127, 0, 0, 0, 1127, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, + 1110 } ; /* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[82] = +static yyconst flex_int32_t yy_rule_can_match_eol[83] = { 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, }; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0, }; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; @@ -1766,7 +1788,7 @@ static void cattext(bool trim_right = false, int strip_trailing = 0) -#line 1770 "levcomp.lex.cc" +#line 1792 "levcomp.lex.cc" #define INITIAL 0 #define MAPDEF 1 @@ -1791,6 +1813,35 @@ static void cattext(bool trim_right = false, int strip_trailing = 0) static int yy_init_globals (void ); +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy (void ); + +int yyget_debug (void ); + +void yyset_debug (int debug_flag ); + +YY_EXTRA_TYPE yyget_extra (void ); + +void yyset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in (void ); + +void yyset_in (FILE * in_str ); + +FILE *yyget_out (void ); + +void yyset_out (FILE * out_str ); + +int yyget_leng (void ); + +char *yyget_text (void ); + +int yyget_lineno (void ); + +void yyset_lineno (int line_number ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -1825,7 +1876,12 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1833,7 +1889,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1932,7 +1988,7 @@ YY_DECL #line 133 "levcomp.lpp" -#line 1936 "levcomp.lex.cc" +#line 1992 "levcomp.lex.cc" if ( !(yy_init) ) { @@ -1986,13 +2042,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1096 ) + if ( yy_current_state >= 1111 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_current_state != 1095 ); + while ( yy_current_state != 1110 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); @@ -2394,89 +2450,89 @@ YY_RULE_SETUP case 63: YY_RULE_SETUP #line 254 "levcomp.lpp" -{ CBEGIN(MNAME); return MONS; } +{ CBEGIN(ITEM_LIST); return TILE; } YY_BREAK case 64: YY_RULE_SETUP #line 255 "levcomp.lpp" -{ CBEGIN(ITEM_LIST); return ITEM; } +{ CBEGIN(MNAME); return MONS; } YY_BREAK case 65: YY_RULE_SETUP #line 256 "levcomp.lpp" -{ CBEGIN(ARGUMENT); return MARKER; } +{ CBEGIN(ITEM_LIST); return ITEM; } YY_BREAK case 66: YY_RULE_SETUP #line 257 "levcomp.lpp" -{ CBEGIN(ITEM_LIST); return SHUFFLE; } +{ CBEGIN(ARGUMENT); return MARKER; } YY_BREAK case 67: YY_RULE_SETUP -#line 259 "levcomp.lpp" -{ CBEGIN(ARGUMENT); return KFEAT; } +#line 258 "levcomp.lpp" +{ CBEGIN(ITEM_LIST); return SHUFFLE; } YY_BREAK case 68: YY_RULE_SETUP #line 260 "levcomp.lpp" -{ CBEGIN(ARGUMENT); return KITEM; } +{ CBEGIN(ARGUMENT); return KFEAT; } YY_BREAK case 69: YY_RULE_SETUP #line 261 "levcomp.lpp" -{ CBEGIN(ARGUMENT); return KMONS; } +{ CBEGIN(ARGUMENT); return KITEM; } YY_BREAK case 70: YY_RULE_SETUP #line 262 "levcomp.lpp" -{ CBEGIN(ARGUMENT); return KMASK; } +{ CBEGIN(ARGUMENT); return KMONS; } YY_BREAK case 71: YY_RULE_SETUP #line 263 "levcomp.lpp" -{ CBEGIN(ARGUMENT); return KPROP; } +{ CBEGIN(ARGUMENT); return KMASK; } YY_BREAK case 72: YY_RULE_SETUP #line 264 "levcomp.lpp" -{ CBEGIN(ARGUMENT); return SUBVAULT; } +{ CBEGIN(ARGUMENT); return KPROP; } YY_BREAK case 73: YY_RULE_SETUP -#line 266 "levcomp.lpp" -return COMMA; +#line 265 "levcomp.lpp" +{ CBEGIN(ARGUMENT); return SUBVAULT; } YY_BREAK case 74: YY_RULE_SETUP -#line 268 "levcomp.lpp" -return COLON; +#line 267 "levcomp.lpp" +return COMMA; YY_BREAK case 75: YY_RULE_SETUP -#line 270 "levcomp.lpp" -return PERC; +#line 269 "levcomp.lpp" +return COLON; YY_BREAK case 76: YY_RULE_SETUP -#line 272 "levcomp.lpp" +#line 271 "levcomp.lpp" +return PERC; + YY_BREAK +case 77: +YY_RULE_SETUP +#line 273 "levcomp.lpp" { clean(); yylval.i = atoi(yytext); return INTEGER; } YY_BREAK -case 77: -YY_RULE_SETUP -#line 278 "levcomp.lpp" -; - YY_BREAK case 78: -/* rule 78 can match eol */ YY_RULE_SETUP #line 279 "levcomp.lpp" ; YY_BREAK case 79: +/* rule 79 can match eol */ YY_RULE_SETUP #line 280 "levcomp.lpp" ; @@ -2484,14 +2540,19 @@ YY_RULE_SETUP case 80: YY_RULE_SETUP #line 281 "levcomp.lpp" -return CHARACTER; +; YY_BREAK case 81: YY_RULE_SETUP -#line 283 "levcomp.lpp" +#line 282 "levcomp.lpp" +return CHARACTER; + YY_BREAK +case 82: +YY_RULE_SETUP +#line 284 "levcomp.lpp" ECHO; YY_BREAK -#line 2495 "levcomp.lex.cc" +#line 2556 "levcomp.lex.cc" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(MAPDEF): case YY_STATE_EOF(LUA): @@ -2730,7 +2791,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -2754,6 +2815,14 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; @@ -2784,7 +2853,7 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1096 ) + if ( yy_current_state >= 1111 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2812,11 +2881,11 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1096 ) + if ( yy_current_state >= 1111 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 1095); + yy_is_jam = (yy_current_state == 1110); return yy_is_jam ? 0 : yy_current_state; } @@ -2910,7 +2979,7 @@ static int yy_get_next_buffer (void) case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) - return 0; + return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -3176,7 +3245,9 @@ static void yyensure_buffer_stack (void) (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); - + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; @@ -3194,6 +3265,8 @@ static void yyensure_buffer_stack (void) ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -3238,7 +3311,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. - * @param str a NUL-terminated string to scan + * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use @@ -3252,8 +3325,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ @@ -3495,7 +3568,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 283 "levcomp.lpp" +#line 284 "levcomp.lpp" diff --git a/crawl-ref/source/prebuilt/levcomp.tab.cc b/crawl-ref/source/prebuilt/levcomp.tab.cc index 5c3e88f475..c725141f18 100644 --- a/crawl-ref/source/prebuilt/levcomp.tab.cc +++ b/crawl-ref/source/prebuilt/levcomp.tab.cc @@ -99,17 +99,18 @@ LROCKTILE = 288, FTILE = 289, RTILE = 290, - SUBVAULT = 291, - COMMA = 292, - COLON = 293, - PERC = 294, - INTEGER = 295, - CHARACTER = 296, - STRING = 297, - MAP_LINE = 298, - MONSTER_NAME = 299, - ITEM_INFO = 300, - LUA_LINE = 301 + TILE = 291, + SUBVAULT = 292, + COMMA = 293, + COLON = 294, + PERC = 295, + INTEGER = 296, + CHARACTER = 297, + STRING = 298, + MAP_LINE = 299, + MONSTER_NAME = 300, + ITEM_INFO = 301, + LUA_LINE = 302 }; #endif /* Tokens. */ @@ -146,17 +147,18 @@ #define LROCKTILE 288 #define FTILE 289 #define RTILE 290 -#define SUBVAULT 291 -#define COMMA 292 -#define COLON 293 -#define PERC 294 -#define INTEGER 295 -#define CHARACTER 296 -#define STRING 297 -#define MAP_LINE 298 -#define MONSTER_NAME 299 -#define ITEM_INFO 300 -#define LUA_LINE 301 +#define TILE 291 +#define SUBVAULT 292 +#define COMMA 293 +#define COLON 294 +#define PERC 295 +#define INTEGER 296 +#define CHARACTER 297 +#define STRING 298 +#define MAP_LINE 299 +#define MONSTER_NAME 300 +#define ITEM_INFO 301 +#define LUA_LINE 302 @@ -232,8 +234,8 @@ typedef union YYSTYPE const char *text; raw_range range; } -/* Line 193 of yacc.c. */ -#line 237 "levcomp.tab.c" +/* Line 187 of yacc.c. */ +#line 239 "levcomp.tab.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -246,7 +248,7 @@ typedef union YYSTYPE /* Line 216 of yacc.c. */ -#line 250 "levcomp.tab.c" +#line 252 "levcomp.tab.c" #ifdef short # undef short @@ -296,7 +298,7 @@ typedef short int yytype_int16; #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS +# if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) @@ -461,20 +463,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 107 +#define YYLAST 109 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 47 +#define YYNTOKENS 48 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 78 +#define YYNNTS 81 /* YYNRULES -- Number of rules. */ -#define YYNRULES 147 +#define YYNRULES 152 /* YYNRULES -- Number of states. */ -#define YYNSTATES 174 +#define YYNSTATES 181 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 301 +#define YYMAXUTOK 302 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -512,7 +514,7 @@ static const yytype_uint8 yytranslate[] = 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46 + 45, 46, 47 }; #if YYDEBUG @@ -525,57 +527,60 @@ static const yytype_uint16 yyprhs[] = 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, - 102, 105, 106, 109, 111, 114, 115, 118, 120, 123, - 124, 127, 129, 132, 133, 136, 138, 141, 142, 145, - 147, 149, 152, 154, 157, 159, 162, 164, 167, 169, - 172, 175, 177, 181, 183, 186, 187, 190, 192, 195, - 198, 201, 204, 206, 209, 211, 214, 216, 219, 221, - 224, 227, 229, 233, 235, 238, 240, 244, 246, 248, - 252, 254, 257, 259, 263, 265, 268, 270, 274, 276, - 278, 281, 285, 287, 289, 291, 294, 298, 300, 302, - 305, 307, 310, 316, 321, 325, 328, 331, 333, 336, - 339, 341, 344, 346, 348, 351, 353, 357 + 102, 104, 107, 108, 111, 113, 116, 117, 120, 122, + 125, 126, 129, 131, 134, 135, 138, 140, 143, 144, + 147, 149, 151, 154, 156, 159, 161, 164, 166, 169, + 171, 174, 177, 179, 183, 185, 188, 189, 192, 194, + 197, 200, 203, 206, 208, 211, 213, 216, 218, 221, + 223, 226, 229, 231, 235, 237, 240, 242, 246, 248, + 251, 253, 257, 259, 261, 265, 267, 270, 272, 276, + 278, 281, 283, 287, 289, 291, 294, 298, 300, 302, + 304, 307, 311, 313, 315, 318, 320, 323, 329, 334, + 338, 341, 344, 346, 349, 352, 354, 357, 359, 361, + 364, 366, 370 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = +static const yytype_int16 yyrhs[] = { - 48, 0, -1, 49, -1, -1, 49, 50, -1, 52, - -1, 54, -1, 41, -1, 53, -1, 59, -1, 3, - 42, -1, 57, 55, -1, -1, 55, 56, -1, 58, - -1, 119, -1, 12, 42, -1, 113, -1, 114, -1, - 115, -1, 116, -1, 117, -1, 118, -1, 110, -1, - 107, -1, 87, -1, 104, -1, 101, -1, 88, -1, - 89, -1, 90, -1, 91, -1, 92, -1, 93, -1, - 96, -1, 79, -1, 82, -1, 85, -1, 86, -1, - 74, -1, 76, -1, 75, -1, 77, -1, 78, -1, - 122, -1, 62, -1, 71, -1, 65, -1, 68, -1, - 51, -1, 23, 60, -1, -1, 60, 61, -1, 46, - -1, 23, 63, -1, -1, 63, 64, -1, 46, -1, - 24, 66, -1, -1, 66, 67, -1, 46, -1, 25, - 69, -1, -1, 69, 70, -1, 46, -1, 22, 72, - -1, -1, 72, 73, -1, 46, -1, 7, -1, 7, - 42, -1, 9, -1, 9, 42, -1, 8, -1, 8, - 42, -1, 10, -1, 10, 42, -1, 11, -1, 11, - 42, -1, 4, 80, -1, 81, -1, 80, 37, 81, - -1, 45, -1, 6, 83, -1, -1, 83, 84, -1, - 42, -1, 28, 42, -1, 29, 42, -1, 20, 42, - -1, 21, 99, -1, 30, -1, 30, 42, -1, 31, - -1, 31, 42, -1, 32, -1, 32, 42, -1, 33, - -1, 33, 42, -1, 34, 94, -1, 95, -1, 94, - 37, 95, -1, 45, -1, 35, 97, -1, 98, -1, - 97, 37, 98, -1, 45, -1, 100, -1, 99, 37, - 100, -1, 45, -1, 26, 102, -1, 103, -1, 102, - 37, 103, -1, 45, -1, 5, 105, -1, 106, -1, - 106, 37, 105, -1, 45, -1, 19, -1, 19, 108, - -1, 108, 37, 109, -1, 109, -1, 45, -1, 18, - -1, 18, 111, -1, 112, 37, 111, -1, 112, -1, - 44, -1, 15, 42, -1, 13, -1, 13, 42, -1, - 16, 40, 38, 40, 39, -1, 16, 40, 38, 40, - -1, 16, 40, 39, -1, 16, 40, -1, 17, 40, - -1, 14, -1, 14, 42, -1, 27, 42, -1, 120, - -1, 120, 121, -1, 121, -1, 43, -1, 36, 123, - -1, 124, -1, 123, 37, 124, -1, 42, -1 + 49, 0, -1, 50, -1, -1, 50, 51, -1, 53, + -1, 55, -1, 42, -1, 54, -1, 60, -1, 3, + 43, -1, 58, 56, -1, -1, 56, 57, -1, 59, + -1, 123, -1, 12, 43, -1, 117, -1, 118, -1, + 119, -1, 120, -1, 121, -1, 122, -1, 114, -1, + 111, -1, 88, -1, 108, -1, 105, -1, 89, -1, + 90, -1, 91, -1, 92, -1, 93, -1, 94, -1, + 97, -1, 100, -1, 80, -1, 83, -1, 86, -1, + 87, -1, 75, -1, 77, -1, 76, -1, 78, -1, + 79, -1, 126, -1, 63, -1, 72, -1, 66, -1, + 69, -1, 52, -1, 23, 61, -1, -1, 61, 62, + -1, 47, -1, 23, 64, -1, -1, 64, 65, -1, + 47, -1, 24, 67, -1, -1, 67, 68, -1, 47, + -1, 25, 70, -1, -1, 70, 71, -1, 47, -1, + 22, 73, -1, -1, 73, 74, -1, 47, -1, 7, + -1, 7, 43, -1, 9, -1, 9, 43, -1, 8, + -1, 8, 43, -1, 10, -1, 10, 43, -1, 11, + -1, 11, 43, -1, 4, 81, -1, 82, -1, 81, + 38, 82, -1, 46, -1, 6, 84, -1, -1, 84, + 85, -1, 43, -1, 28, 43, -1, 29, 43, -1, + 20, 43, -1, 21, 103, -1, 30, -1, 30, 43, + -1, 31, -1, 31, 43, -1, 32, -1, 32, 43, + -1, 33, -1, 33, 43, -1, 34, 95, -1, 96, + -1, 95, 38, 96, -1, 46, -1, 35, 98, -1, + 99, -1, 98, 38, 99, -1, 46, -1, 36, 101, + -1, 102, -1, 101, 38, 102, -1, 46, -1, 104, + -1, 103, 38, 104, -1, 46, -1, 26, 106, -1, + 107, -1, 106, 38, 107, -1, 46, -1, 5, 109, + -1, 110, -1, 110, 38, 109, -1, 46, -1, 19, + -1, 19, 112, -1, 112, 38, 113, -1, 113, -1, + 46, -1, 18, -1, 18, 115, -1, 116, 38, 115, + -1, 116, -1, 45, -1, 15, 43, -1, 13, -1, + 13, 43, -1, 16, 41, 39, 41, 40, -1, 16, + 41, 39, 41, -1, 16, 41, 40, -1, 16, 41, + -1, 17, 41, -1, 14, -1, 14, 43, -1, 27, + 43, -1, 124, -1, 124, 125, -1, 125, -1, 44, + -1, 37, 127, -1, 128, -1, 127, 38, 128, -1, + 43, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -586,16 +591,17 @@ static const yytype_uint16 yyrline[] = 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 186, 188, 189, 192, 197, 199, 200, 203, 208, 210, - 211, 214, 219, 221, 222, 225, 230, 232, 233, 236, - 241, 242, 250, 251, 259, 260, 268, 269, 277, 278, - 286, 289, 290, 293, 301, 304, 305, 308, 317, 326, - 335, 368, 371, 372, 380, 381, 389, 390, 398, 399, - 408, 411, 412, 415, 424, 427, 428, 431, 440, 441, - 444, 453, 456, 457, 460, 469, 472, 473, 476, 485, - 486, 489, 490, 493, 501, 502, 505, 506, 509, 518, - 527, 528, 537, 544, 551, 558, 566, 574, 575, 584, - 593, 596, 597, 600, 609, 612, 613, 616 + 184, 187, 189, 190, 193, 198, 200, 201, 204, 209, + 211, 212, 215, 220, 222, 223, 226, 231, 233, 234, + 237, 242, 243, 251, 252, 260, 261, 269, 270, 278, + 279, 287, 290, 291, 294, 302, 305, 306, 309, 318, + 327, 336, 369, 372, 373, 381, 382, 390, 391, 399, + 400, 409, 412, 413, 416, 425, 428, 429, 432, 441, + 444, 445, 448, 458, 459, 462, 471, 474, 475, 478, + 487, 490, 491, 494, 503, 504, 507, 508, 511, 519, + 520, 523, 524, 527, 536, 545, 546, 555, 562, 569, + 576, 584, 592, 593, 602, 611, 614, 615, 618, 627, + 630, 631, 634 }; #endif @@ -609,19 +615,20 @@ static const char *const yytname[] = "ORIENT", "PLACE", "CHANCE", "WEIGHT", "MONS", "ITEM", "MARKER", "COLOUR", "PRELUDE", "MAIN", "VALIDATE", "VETO", "NSUBST", "WELCOME", "LFLAGS", "BFLAGS", "LFLOORCOL", "LROCKCOL", "LFLOORTILE", "LROCKTILE", - "FTILE", "RTILE", "SUBVAULT", "COMMA", "COLON", "PERC", "INTEGER", - "CHARACTER", "STRING", "MAP_LINE", "MONSTER_NAME", "ITEM_INFO", - "LUA_LINE", "$accept", "file", "definitions", "definition", "error_seq", - "def", "defdepth", "level", "map_specs", "map_spec", "name", "metaline", - "global_lua", "global_lua_lines", "global_lua_line", "main_lua", - "main_lua_lines", "main_lua_line", "validate_lua", "validate_lua_lines", - "validate_lua_line", "veto_lua", "veto_lua_lines", "veto_lua_line", - "prelude_lua", "prelude_lua_lines", "prelude_lua_line", "kfeat", "kmons", - "kitem", "kmask", "kprop", "shuffle", "shuffle_specifiers", - "shuffle_spec", "tags", "tagstrings", "tagstring", "lflags", "bflags", - "marker", "colour", "lfloorcol", "lrockcol", "lfloortile", "lrocktile", - "ftile", "ftile_specifiers", "ftile_specifier", "rtile", - "rtile_specifiers", "rtile_specifier", "colour_specifiers", + "FTILE", "RTILE", "TILE", "SUBVAULT", "COMMA", "COLON", "PERC", + "INTEGER", "CHARACTER", "STRING", "MAP_LINE", "MONSTER_NAME", + "ITEM_INFO", "LUA_LINE", "$accept", "file", "definitions", "definition", + "error_seq", "def", "defdepth", "level", "map_specs", "map_spec", "name", + "metaline", "global_lua", "global_lua_lines", "global_lua_line", + "main_lua", "main_lua_lines", "main_lua_line", "validate_lua", + "validate_lua_lines", "validate_lua_line", "veto_lua", "veto_lua_lines", + "veto_lua_line", "prelude_lua", "prelude_lua_lines", "prelude_lua_line", + "kfeat", "kmons", "kitem", "kmask", "kprop", "shuffle", + "shuffle_specifiers", "shuffle_spec", "tags", "tagstrings", "tagstring", + "lflags", "bflags", "marker", "colour", "lfloorcol", "lrockcol", + "lfloortile", "lrocktile", "ftile", "ftile_specifiers", + "ftile_specifier", "rtile", "rtile_specifiers", "rtile_specifier", + "tile", "tile_specifiers", "tile_specifier", "colour_specifiers", "colour_specifier", "nsubst", "nsubst_specifiers", "nsubst_spec", "subst", "subst_specifiers", "subst_spec", "items", "item_specifiers", "item_specifier", "mons", "mnames", "mname", "place", "depth", "chance", @@ -639,28 +646,29 @@ static const yytype_uint16 yytoknum[] = 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301 + 295, 296, 297, 298, 299, 300, 301, 302 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 47, 48, 49, 49, 50, 50, 51, 52, 52, - 53, 54, 55, 55, 56, 56, 57, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 59, 60, 60, 61, 62, 63, 63, 64, 65, 66, - 66, 67, 68, 69, 69, 70, 71, 72, 72, 73, - 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, - 79, 80, 80, 81, 82, 83, 83, 84, 85, 86, - 87, 88, 89, 89, 90, 90, 91, 91, 92, 92, - 93, 94, 94, 95, 96, 97, 97, 98, 99, 99, - 100, 101, 102, 102, 103, 104, 105, 105, 106, 107, - 107, 108, 108, 109, 110, 110, 111, 111, 112, 113, - 114, 114, 115, 115, 115, 115, 116, 117, 117, 118, - 119, 120, 120, 121, 122, 123, 123, 124 + 0, 48, 49, 50, 50, 51, 51, 52, 53, 53, + 54, 55, 56, 56, 57, 57, 58, 59, 59, 59, + 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, + 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, + 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, + 59, 60, 61, 61, 62, 63, 64, 64, 65, 66, + 67, 67, 68, 69, 70, 70, 71, 72, 73, 73, + 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, + 79, 80, 81, 81, 82, 83, 84, 84, 85, 86, + 87, 88, 89, 90, 90, 91, 91, 92, 92, 93, + 93, 94, 95, 95, 96, 97, 98, 98, 99, 100, + 101, 101, 102, 103, 103, 104, 105, 106, 106, 107, + 108, 109, 109, 110, 111, 111, 112, 112, 113, 114, + 114, 115, 115, 116, 117, 118, 118, 119, 119, 119, + 119, 120, 121, 121, 122, 123, 124, 124, 125, 126, + 127, 127, 128 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -671,16 +679,17 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 0, 2, 1, 2, 0, 2, 1, 2, 0, - 2, 1, 2, 0, 2, 1, 2, 0, 2, 1, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 2, 1, 3, 1, 2, 0, 2, 1, 2, 2, - 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 2, 1, 3, 1, 2, 1, 3, 1, 1, 3, - 1, 2, 1, 3, 1, 2, 1, 3, 1, 1, - 2, 3, 1, 1, 1, 2, 3, 1, 1, 2, - 1, 2, 5, 4, 3, 2, 2, 1, 2, 2, - 1, 2, 1, 1, 2, 1, 3, 1 + 1, 2, 0, 2, 1, 2, 0, 2, 1, 2, + 0, 2, 1, 2, 0, 2, 1, 2, 0, 2, + 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, + 2, 2, 1, 3, 1, 2, 0, 2, 1, 2, + 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, + 2, 2, 1, 3, 1, 2, 1, 3, 1, 2, + 1, 3, 1, 1, 3, 1, 2, 1, 3, 1, + 2, 1, 3, 1, 1, 2, 3, 1, 1, 1, + 2, 3, 1, 1, 2, 1, 2, 5, 4, 3, + 2, 2, 1, 2, 2, 1, 2, 1, 1, 2, + 1, 3, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -688,75 +697,79 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 3, 0, 2, 1, 0, 0, 51, 4, 5, 8, - 6, 12, 9, 10, 16, 50, 11, 53, 52, 0, - 0, 85, 70, 74, 72, 76, 78, 130, 137, 0, - 0, 0, 124, 119, 0, 0, 67, 55, 59, 63, - 0, 0, 0, 0, 92, 94, 96, 98, 0, 0, - 0, 7, 143, 49, 13, 14, 45, 47, 48, 46, - 39, 41, 40, 42, 43, 35, 36, 37, 38, 25, - 28, 29, 30, 31, 32, 33, 34, 27, 26, 24, - 23, 17, 18, 19, 20, 21, 22, 15, 140, 142, - 44, 83, 80, 81, 118, 115, 116, 84, 71, 75, - 73, 77, 79, 131, 138, 129, 135, 136, 128, 125, - 127, 123, 120, 122, 90, 110, 91, 108, 66, 54, - 58, 62, 114, 111, 112, 139, 88, 89, 93, 95, - 97, 99, 103, 100, 101, 107, 104, 105, 147, 144, - 145, 141, 0, 0, 87, 86, 0, 134, 0, 0, - 0, 69, 68, 57, 56, 61, 60, 65, 64, 0, - 0, 0, 0, 82, 117, 133, 126, 121, 109, 113, - 102, 106, 146, 132 + 3, 0, 2, 1, 0, 0, 52, 4, 5, 8, + 6, 12, 9, 10, 16, 51, 11, 54, 53, 0, + 0, 86, 71, 75, 73, 77, 79, 135, 142, 0, + 0, 0, 129, 124, 0, 0, 68, 56, 60, 64, + 0, 0, 0, 0, 93, 95, 97, 99, 0, 0, + 0, 0, 7, 148, 50, 13, 14, 46, 48, 49, + 47, 40, 42, 41, 43, 44, 36, 37, 38, 39, + 25, 28, 29, 30, 31, 32, 33, 34, 35, 27, + 26, 24, 23, 17, 18, 19, 20, 21, 22, 15, + 145, 147, 45, 84, 81, 82, 123, 120, 121, 85, + 72, 76, 74, 78, 80, 136, 143, 134, 140, 141, + 133, 130, 132, 128, 125, 127, 91, 115, 92, 113, + 67, 55, 59, 63, 119, 116, 117, 144, 89, 90, + 94, 96, 98, 100, 104, 101, 102, 108, 105, 106, + 112, 109, 110, 152, 149, 150, 146, 0, 0, 88, + 87, 0, 139, 0, 0, 0, 70, 69, 58, 57, + 62, 61, 66, 65, 0, 0, 0, 0, 0, 83, + 122, 138, 131, 126, 114, 118, 103, 107, 111, 151, + 137 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 1, 2, 7, 53, 8, 9, 10, 16, 54, - 11, 55, 12, 15, 18, 56, 119, 154, 57, 120, - 156, 58, 121, 158, 59, 118, 152, 60, 61, 62, - 63, 64, 65, 92, 93, 66, 97, 145, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 133, 134, 76, - 136, 137, 116, 117, 77, 123, 124, 78, 95, 96, - 79, 112, 113, 80, 109, 110, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 139, 140 + -1, 1, 2, 7, 54, 8, 9, 10, 16, 55, + 11, 56, 12, 15, 18, 57, 121, 159, 58, 122, + 161, 59, 123, 163, 60, 120, 157, 61, 62, 63, + 64, 65, 66, 94, 95, 67, 99, 150, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 135, 136, 77, + 138, 139, 78, 141, 142, 118, 119, 79, 125, 126, + 80, 97, 98, 81, 114, 115, 82, 111, 112, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 144, + 145 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -93 +#define YYPACT_NINF -97 static const yytype_int8 yypact[] = { - -93, 8, 30, -93, -8, -2, -93, -93, -93, -93, - -93, -93, -93, -93, -93, -5, -4, -93, -93, -7, - -1, -93, 1, 3, 4, 5, 6, 7, 9, 10, - 14, 15, 12, 13, 17, 16, -93, -93, -93, -93, + -97, 8, 31, -97, -8, -2, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -5, -4, -97, -97, -7, + -1, -97, 1, 3, 4, 5, 6, 7, 9, 10, + 14, 15, 12, 13, 17, 16, -97, -97, -97, -97, 18, 20, 22, 23, 24, 25, 26, 27, 28, 29, - 33, -93, -93, -93, -93, -93, -93, -93, -93, -93, - -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, - -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, - -93, -93, -93, -93, -93, -93, -93, -93, 34, -93, - -93, -93, 35, -93, -93, -93, 39, 36, -93, -93, - -93, -93, -93, -93, -93, -93, -3, -93, -93, -93, - 42, -93, 43, -93, -93, -93, 44, -93, 11, 37, - 38, 40, -93, 45, -93, -93, -93, -93, -93, -93, - -93, -93, -93, 48, -93, -93, 50, -93, -93, 51, - -93, -93, -7, -1, -93, -93, 31, -93, 12, 13, - 16, -93, -93, -93, -93, -93, -93, -93, -93, 18, - 28, 29, 33, -93, -93, 21, -93, -93, -93, -93, - -93, -93, -93, -93 + 30, 34, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + 35, -97, -97, -97, 33, -97, -97, -97, 40, 37, + -97, -97, -97, -97, -97, -97, -97, -97, -3, -97, + -97, -97, 43, -97, 44, -97, -97, -97, 45, -97, + 11, 38, 39, 41, -97, 46, -97, -97, -97, -97, + -97, -97, -97, -97, -97, 49, -97, -97, 51, -97, + -97, 52, -97, -97, 53, -97, -97, -7, -1, -97, + -97, 32, -97, 12, 13, 16, -97, -97, -97, -97, + -97, -97, -97, -97, 18, 28, 29, 30, 34, -97, + -97, 21, -97, -97, -97, -97, -97, -97, -97, -97, + -97 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, - -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, - -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, - -93, -93, -93, -93, -92, -93, -93, -93, -93, -93, - -93, -93, -93, -93, -93, -93, -93, -93, -90, -93, - -93, -72, -93, -60, -93, -93, -68, -93, -51, -93, - -93, -93, -56, -93, -54, -93, -93, -93, -93, -93, - -93, -93, -93, -93, 19, -93, -93, -67 + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -96, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -93, -97, + -97, -74, -97, -97, -73, -97, -62, -97, -97, -69, + -97, -52, -97, -97, -97, -57, -97, -55, -97, -97, + -97, -97, -97, -97, -97, -97, -97, 19, -97, -97, + -68 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -769,14 +782,14 @@ static const yytype_uint8 yytable[] = 19, 20, 21, 22, 23, 24, 25, 26, 3, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 4, 13, 146, 147, 51, 91, 52, - 14, 17, 5, 98, 94, 99, 100, 101, 102, 103, - 163, 104, 105, 6, 106, 107, 108, 151, 111, 114, - 173, 115, 125, 122, 126, 127, 128, 129, 130, 131, - 170, 165, 142, 132, 135, 138, 143, 52, 144, 148, - 149, 150, 159, 153, 155, 160, 157, 161, 162, 171, - 168, 169, 164, 167, 166, 172, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 141 + 48, 49, 50, 51, 4, 13, 151, 152, 52, 93, + 53, 14, 17, 5, 100, 96, 101, 102, 103, 104, + 105, 169, 106, 107, 6, 108, 109, 110, 156, 113, + 116, 180, 117, 127, 124, 128, 129, 130, 131, 132, + 133, 147, 176, 171, 134, 137, 140, 143, 148, 53, + 149, 153, 154, 155, 164, 158, 160, 165, 162, 166, + 167, 168, 177, 174, 178, 175, 170, 173, 172, 0, + 179, 0, 0, 0, 0, 0, 0, 0, 0, 146 }; static const yytype_int16 yycheck[] = @@ -784,38 +797,39 @@ static const yytype_int16 yycheck[] = 4, 5, 6, 7, 8, 9, 10, 11, 0, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 3, 42, 38, 39, 41, 45, 43, - 42, 46, 12, 42, 45, 42, 42, 42, 42, 42, - 142, 42, 42, 23, 40, 40, 44, 46, 45, 42, - 39, 45, 42, 45, 42, 42, 42, 42, 42, 42, - 160, 40, 37, 45, 45, 42, 37, 43, 42, 37, - 37, 37, 37, 46, 46, 37, 46, 37, 37, 161, - 150, 159, 143, 149, 148, 162, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 88 + 34, 35, 36, 37, 3, 43, 39, 40, 42, 46, + 44, 43, 47, 12, 43, 46, 43, 43, 43, 43, + 43, 147, 43, 43, 23, 41, 41, 45, 47, 46, + 43, 40, 46, 43, 46, 43, 43, 43, 43, 43, + 43, 38, 165, 41, 46, 46, 46, 43, 38, 44, + 43, 38, 38, 38, 38, 47, 47, 38, 47, 38, + 38, 38, 166, 155, 167, 164, 148, 154, 153, -1, + 168, -1, -1, -1, -1, -1, -1, -1, -1, 90 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 48, 49, 0, 3, 12, 23, 50, 52, 53, - 54, 57, 59, 42, 42, 60, 55, 46, 61, 4, + 0, 49, 50, 0, 3, 12, 23, 51, 53, 54, + 55, 58, 60, 43, 43, 61, 56, 47, 62, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 41, 43, 51, 56, 58, 62, 65, 68, 71, - 74, 75, 76, 77, 78, 79, 82, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 96, 101, 104, 107, - 110, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 45, 80, 81, 45, 105, 106, 83, 42, 42, - 42, 42, 42, 42, 42, 42, 40, 40, 44, 111, - 112, 45, 108, 109, 42, 45, 99, 100, 72, 63, - 66, 69, 45, 102, 103, 42, 42, 42, 42, 42, - 42, 42, 45, 94, 95, 45, 97, 98, 42, 123, - 124, 121, 37, 37, 42, 84, 38, 39, 37, 37, - 37, 46, 73, 46, 64, 46, 67, 46, 70, 37, - 37, 37, 37, 81, 105, 40, 111, 109, 100, 103, - 95, 98, 124, 39 + 36, 37, 42, 44, 52, 57, 59, 63, 66, 69, + 72, 75, 76, 77, 78, 79, 80, 83, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 97, 100, 105, + 108, 111, 114, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 46, 81, 82, 46, 109, 110, 84, + 43, 43, 43, 43, 43, 43, 43, 43, 41, 41, + 45, 115, 116, 46, 112, 113, 43, 46, 103, 104, + 73, 64, 67, 70, 46, 106, 107, 43, 43, 43, + 43, 43, 43, 43, 46, 95, 96, 46, 98, 99, + 46, 101, 102, 43, 127, 128, 125, 38, 38, 43, + 85, 39, 40, 38, 38, 38, 47, 74, 47, 65, + 47, 68, 47, 71, 38, 38, 38, 38, 38, 82, + 109, 41, 115, 113, 104, 107, 96, 99, 102, 128, + 40 }; #define yyerrok (yyerrstatus = 0) @@ -889,7 +903,7 @@ while (YYID (0)) we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ @@ -1750,18 +1764,13 @@ yyreduce: } break; - case 49: -#line 183 "levcomp.ypp" - {} - break; - case 50: -#line 186 "levcomp.ypp" - { } +#line 184 "levcomp.ypp" + {} break; case 51: -#line 188 "levcomp.ypp" +#line 187 "levcomp.ypp" { } break; @@ -1771,19 +1780,19 @@ yyreduce: break; case 53: -#line 193 "levcomp.ypp" - { - lc_global_prelude.add(yylineno, (yyvsp[(1) - (1)].text)); - } +#line 190 "levcomp.ypp" + { } break; case 54: -#line 197 "levcomp.ypp" - { } +#line 194 "levcomp.ypp" + { + lc_global_prelude.add(yylineno, (yyvsp[(1) - (1)].text)); + } break; case 55: -#line 199 "levcomp.ypp" +#line 198 "levcomp.ypp" { } break; @@ -1793,19 +1802,19 @@ yyreduce: break; case 57: -#line 204 "levcomp.ypp" - { - lc_map.main.add(yylineno, (yyvsp[(1) - (1)].text)); - } +#line 201 "levcomp.ypp" + { } break; case 58: -#line 208 "levcomp.ypp" - { } +#line 205 "levcomp.ypp" + { + lc_map.main.add(yylineno, (yyvsp[(1) - (1)].text)); + } break; case 59: -#line 210 "levcomp.ypp" +#line 209 "levcomp.ypp" { } break; @@ -1815,19 +1824,19 @@ yyreduce: break; case 61: -#line 215 "levcomp.ypp" - { - lc_map.validate.add(yylineno, (yyvsp[(1) - (1)].text)); - } +#line 212 "levcomp.ypp" + { } break; case 62: -#line 219 "levcomp.ypp" - { } +#line 216 "levcomp.ypp" + { + lc_map.validate.add(yylineno, (yyvsp[(1) - (1)].text)); + } break; case 63: -#line 221 "levcomp.ypp" +#line 220 "levcomp.ypp" { } break; @@ -1837,19 +1846,19 @@ yyreduce: break; case 65: -#line 226 "levcomp.ypp" - { - lc_map.veto.add(yylineno, (yyvsp[(1) - (1)].text)); - } +#line 223 "levcomp.ypp" + { } break; case 66: -#line 230 "levcomp.ypp" - { } +#line 227 "levcomp.ypp" + { + lc_map.veto.add(yylineno, (yyvsp[(1) - (1)].text)); + } break; case 67: -#line 232 "levcomp.ypp" +#line 231 "levcomp.ypp" { } break; @@ -1859,19 +1868,24 @@ yyreduce: break; case 69: -#line 237 "levcomp.ypp" +#line 234 "levcomp.ypp" + { } + break; + + case 70: +#line 238 "levcomp.ypp" { lc_map.prelude.add(yylineno, (yyvsp[(1) - (1)].text)); } break; - case 70: -#line 241 "levcomp.ypp" + case 71: +#line 242 "levcomp.ypp" { } break; - case 71: -#line 243 "levcomp.ypp" + case 72: +#line 244 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -1880,13 +1894,13 @@ yyreduce: } break; - case 72: -#line 250 "levcomp.ypp" + case 73: +#line 251 "levcomp.ypp" { } break; - case 73: -#line 252 "levcomp.ypp" + case 74: +#line 253 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -1895,13 +1909,13 @@ yyreduce: } break; - case 74: -#line 259 "levcomp.ypp" + case 75: +#line 260 "levcomp.ypp" { } break; - case 75: -#line 261 "levcomp.ypp" + case 76: +#line 262 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -1910,13 +1924,13 @@ yyreduce: } break; - case 76: -#line 268 "levcomp.ypp" + case 77: +#line 269 "levcomp.ypp" { } break; - case 77: -#line 270 "levcomp.ypp" + case 78: +#line 271 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -1925,13 +1939,13 @@ yyreduce: } break; - case 78: -#line 277 "levcomp.ypp" + case 79: +#line 278 "levcomp.ypp" { } break; - case 79: -#line 279 "levcomp.ypp" + case 80: +#line 280 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -1940,13 +1954,13 @@ yyreduce: } break; - case 80: -#line 286 "levcomp.ypp" + case 81: +#line 287 "levcomp.ypp" {} break; - case 83: -#line 294 "levcomp.ypp" + case 84: +#line 295 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -1955,13 +1969,13 @@ yyreduce: } break; - case 84: -#line 301 "levcomp.ypp" + case 85: +#line 302 "levcomp.ypp" {} break; - case 87: -#line 309 "levcomp.ypp" + case 88: +#line 310 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -1970,8 +1984,8 @@ yyreduce: } break; - case 88: -#line 318 "levcomp.ypp" + case 89: +#line 319 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -1980,8 +1994,8 @@ yyreduce: } break; - case 89: -#line 327 "levcomp.ypp" + case 90: +#line 328 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -1990,8 +2004,8 @@ yyreduce: } break; - case 90: -#line 336 "levcomp.ypp" + case 91: +#line 337 "levcomp.ypp" { std::string key, arg; int sep(0); @@ -2024,18 +2038,18 @@ yyreduce: } break; - case 91: -#line 368 "levcomp.ypp" + case 92: +#line 369 "levcomp.ypp" { } break; - case 92: -#line 371 "levcomp.ypp" + case 93: +#line 372 "levcomp.ypp" { } break; - case 93: -#line 373 "levcomp.ypp" + case 94: +#line 374 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2044,13 +2058,13 @@ yyreduce: } break; - case 94: -#line 380 "levcomp.ypp" + case 95: +#line 381 "levcomp.ypp" { } break; - case 95: -#line 382 "levcomp.ypp" + case 96: +#line 383 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2059,13 +2073,13 @@ yyreduce: } break; - case 96: -#line 389 "levcomp.ypp" + case 97: +#line 390 "levcomp.ypp" { } break; - case 97: -#line 391 "levcomp.ypp" + case 98: +#line 392 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2074,13 +2088,13 @@ yyreduce: } break; - case 98: -#line 398 "levcomp.ypp" + case 99: +#line 399 "levcomp.ypp" { } break; - case 99: -#line 400 "levcomp.ypp" + case 100: +#line 401 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2089,8 +2103,8 @@ yyreduce: } break; - case 103: -#line 416 "levcomp.ypp" + case 104: +#line 417 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2099,8 +2113,8 @@ yyreduce: } break; - case 107: -#line 432 "levcomp.ypp" + case 108: +#line 433 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2109,18 +2123,28 @@ yyreduce: } break; - case 108: -#line 440 "levcomp.ypp" + case 112: +#line 449 "levcomp.ypp" + { + lc_map.main.add( + yylineno, + make_stringf("tile(\"%s\")", + quote_lua_string((yyvsp[(1) - (1)].text)).c_str())); + } + break; + + case 113: +#line 458 "levcomp.ypp" { } break; - case 109: -#line 441 "levcomp.ypp" + case 114: +#line 459 "levcomp.ypp" { } break; - case 110: -#line 445 "levcomp.ypp" + case 115: +#line 463 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2129,23 +2153,23 @@ yyreduce: } break; - case 111: -#line 453 "levcomp.ypp" + case 116: +#line 471 "levcomp.ypp" { } break; - case 112: -#line 456 "levcomp.ypp" + case 117: +#line 474 "levcomp.ypp" { } break; - case 113: -#line 457 "levcomp.ypp" + case 118: +#line 475 "levcomp.ypp" { } break; - case 114: -#line 461 "levcomp.ypp" + case 119: +#line 479 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2154,13 +2178,13 @@ yyreduce: } break; - case 115: -#line 469 "levcomp.ypp" + case 120: +#line 487 "levcomp.ypp" { } break; - case 118: -#line 477 "levcomp.ypp" + case 123: +#line 495 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2169,18 +2193,18 @@ yyreduce: } break; - case 119: -#line 485 "levcomp.ypp" + case 124: +#line 503 "levcomp.ypp" {} break; - case 120: -#line 486 "levcomp.ypp" + case 125: +#line 504 "levcomp.ypp" {} break; - case 123: -#line 494 "levcomp.ypp" + case 128: +#line 512 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2189,18 +2213,18 @@ yyreduce: } break; - case 124: -#line 501 "levcomp.ypp" + case 129: +#line 519 "levcomp.ypp" {} break; - case 125: -#line 502 "levcomp.ypp" + case 130: +#line 520 "levcomp.ypp" {} break; - case 128: -#line 510 "levcomp.ypp" + case 133: +#line 528 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2209,8 +2233,8 @@ yyreduce: } break; - case 129: -#line 519 "levcomp.ypp" + case 134: +#line 537 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2219,13 +2243,13 @@ yyreduce: } break; - case 130: -#line 527 "levcomp.ypp" + case 135: +#line 545 "levcomp.ypp" {} break; - case 131: -#line 529 "levcomp.ypp" + case 136: +#line 547 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2234,8 +2258,8 @@ yyreduce: } break; - case 132: -#line 538 "levcomp.ypp" + case 137: +#line 556 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2243,8 +2267,8 @@ yyreduce: } break; - case 133: -#line 545 "levcomp.ypp" + case 138: +#line 563 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2252,8 +2276,8 @@ yyreduce: } break; - case 134: -#line 552 "levcomp.ypp" + case 139: +#line 570 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2261,8 +2285,8 @@ yyreduce: } break; - case 135: -#line 559 "levcomp.ypp" + case 140: +#line 577 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2270,8 +2294,8 @@ yyreduce: } break; - case 136: -#line 567 "levcomp.ypp" + case 141: +#line 585 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2279,13 +2303,13 @@ yyreduce: } break; - case 137: -#line 574 "levcomp.ypp" + case 142: +#line 592 "levcomp.ypp" {} break; - case 138: -#line 576 "levcomp.ypp" + case 143: +#line 594 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2294,8 +2318,8 @@ yyreduce: } break; - case 139: -#line 585 "levcomp.ypp" + case 144: +#line 603 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2304,8 +2328,8 @@ yyreduce: } break; - case 143: -#line 601 "levcomp.ypp" + case 148: +#line 619 "levcomp.ypp" { lc_map.mapchunk.add( yylineno, @@ -2314,8 +2338,8 @@ yyreduce: } break; - case 147: -#line 617 "levcomp.ypp" + case 152: +#line 635 "levcomp.ypp" { lc_map.main.add( yylineno, @@ -2326,7 +2350,7 @@ yyreduce: /* Line 1267 of yacc.c. */ -#line 2330 "levcomp.tab.c" +#line 2354 "levcomp.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2540,6 +2564,6 @@ yyreturn: } -#line 625 "levcomp.ypp" +#line 643 "levcomp.ypp" diff --git a/crawl-ref/source/prebuilt/levcomp.tab.h b/crawl-ref/source/prebuilt/levcomp.tab.h index 6d66e054bb..854ee5c3b3 100644 --- a/crawl-ref/source/prebuilt/levcomp.tab.h +++ b/crawl-ref/source/prebuilt/levcomp.tab.h @@ -72,17 +72,18 @@ LROCKTILE = 288, FTILE = 289, RTILE = 290, - SUBVAULT = 291, - COMMA = 292, - COLON = 293, - PERC = 294, - INTEGER = 295, - CHARACTER = 296, - STRING = 297, - MAP_LINE = 298, - MONSTER_NAME = 299, - ITEM_INFO = 300, - LUA_LINE = 301 + TILE = 291, + SUBVAULT = 292, + COMMA = 293, + COLON = 294, + PERC = 295, + INTEGER = 296, + CHARACTER = 297, + STRING = 298, + MAP_LINE = 299, + MONSTER_NAME = 300, + ITEM_INFO = 301, + LUA_LINE = 302 }; #endif /* Tokens. */ @@ -119,17 +120,18 @@ #define LROCKTILE 288 #define FTILE 289 #define RTILE 290 -#define SUBVAULT 291 -#define COMMA 292 -#define COLON 293 -#define PERC 294 -#define INTEGER 295 -#define CHARACTER 296 -#define STRING 297 -#define MAP_LINE 298 -#define MONSTER_NAME 299 -#define ITEM_INFO 300 -#define LUA_LINE 301 +#define TILE 291 +#define SUBVAULT 292 +#define COMMA 293 +#define COLON 294 +#define PERC 295 +#define INTEGER 296 +#define CHARACTER 297 +#define STRING 298 +#define MAP_LINE 299 +#define MONSTER_NAME 300 +#define ITEM_INFO 301 +#define LUA_LINE 302 @@ -142,8 +144,8 @@ typedef union YYSTYPE const char *text; raw_range range; } -/* Line 1529 of yacc.c. */ -#line 147 "levcomp.tab.h" +/* Line 1489 of yacc.c. */ +#line 149 "levcomp.tab.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 -- cgit v1.2.3-54-g00ecf From e19066eb4995805ccfdfc3c9f2c5ca0890e2c41e Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sun, 27 Dec 2009 18:44:35 +1000 Subject: Add a tile for human slaves (purge). --- crawl-ref/source/rltiles/dc-mon.txt | 1 + crawl-ref/source/rltiles/dc-mon/slave.png | Bin 0 -> 3395 bytes crawl-ref/source/tilepick.cc | 2 ++ 3 files changed, 3 insertions(+) create mode 100644 crawl-ref/source/rltiles/dc-mon/slave.png diff --git a/crawl-ref/source/rltiles/dc-mon.txt b/crawl-ref/source/rltiles/dc-mon.txt index a01f00d479..3a48f1307d 100644 --- a/crawl-ref/source/rltiles/dc-mon.txt +++ b/crawl-ref/source/rltiles/dc-mon.txt @@ -335,6 +335,7 @@ vault_guard MONS_VAULT_GUARD shapeshifter MONS_SHAPESHIFTER glowing_shapeshifter MONS_GLOWING_SHAPESHIFTER killer_klown MONS_KILLER_KLOWN +slave MONS_SLAVE ## Angels ('A') angel MONS_ANGEL diff --git a/crawl-ref/source/rltiles/dc-mon/slave.png b/crawl-ref/source/rltiles/dc-mon/slave.png new file mode 100644 index 0000000000..0f7e353e5c Binary files /dev/null and b/crawl-ref/source/rltiles/dc-mon/slave.png differ diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc index 725947c13c..36b3e5014c 100644 --- a/crawl-ref/source/tilepick.cc +++ b/crawl-ref/source/tilepick.cc @@ -764,6 +764,8 @@ int tileidx_monster_base(const monsters *mon, bool detected) return TILEP_MONS_GLOWING_SHAPESHIFTER; case MONS_KILLER_KLOWN: return TILEP_MONS_KILLER_KLOWN; + case MONS_SLAVE: + return TILEP_MONS_SLAVE; // mimics case MONS_GOLD_MIMIC: -- cgit v1.2.3-54-g00ecf From 5684de7409e72c5ded581455409981cc5786a662 Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Sun, 27 Dec 2009 15:22:34 +0530 Subject: Save Shoals heightmap in level tag, increment tag minor version. --- crawl-ref/source/dgn-shoals.cc | 20 ++++++++++++-------- crawl-ref/source/directn.cc | 9 +++++++-- crawl-ref/source/dungeon.cc | 1 + crawl-ref/source/env.h | 3 +++ crawl-ref/source/tags.cc | 24 ++++++++++++++++++++++++ crawl-ref/source/tags.h | 5 +++-- 6 files changed, 50 insertions(+), 12 deletions(-) diff --git a/crawl-ref/source/dgn-shoals.cc b/crawl-ref/source/dgn-shoals.cc index c4cdf30cca..f3b7e386fd 100644 --- a/crawl-ref/source/dgn-shoals.cc +++ b/crawl-ref/source/dgn-shoals.cc @@ -13,7 +13,11 @@ #include #include -static int _shoals_heights[GYM][GXM]; +inline short &shoals_heights(const coord_def &c) +{ + return (*env.heightmap)(c); +} + static std::vector _shoals_islands; const int ISLAND_COLLIDE_DIST2 = 5 * 5; @@ -43,7 +47,7 @@ static double _to_radians(int degrees) static dungeon_feature_type _shoals_feature_at(const coord_def &c) { - const int height = _shoals_heights[c.y][c.x]; + const int height = shoals_heights(c); return height >= SHT_STONE ? DNGN_STONE_WALL : height >= SHT_ROCK? DNGN_ROCK_WALL : height >= SHT_FLOOR? DNGN_FLOOR : @@ -53,9 +57,9 @@ static dungeon_feature_type _shoals_feature_at(const coord_def &c) static void _shoals_init_heights() { - for (int y = 0; y < GYM; ++y) - for (int x = 0; x < GXM; ++x) - _shoals_heights[y][x] = -17; + env.heightmap.reset(new grid_heightmap); + for (rectangle_iterator ri(0); ri; ++ri) + shoals_heights(*ri) = SHT_SHALLOW_WATER - 3; } static double _angle_fuzz() @@ -94,7 +98,7 @@ static void _shoals_island_center(const coord_def &c, int n_perturb, int radius, { for (int i = 0; i < n_perturb; ++i) { coord_def p = _random_point_from(c, random2(1 + radius)); - _shoals_heights[p.y][p.x] += random_range(bounce_low, bounce_high); + shoals_heights(p) += random_range(bounce_low, bounce_high); } } @@ -194,10 +198,10 @@ static void _shoals_smooth_at(const coord_def &c, int radius) const coord_def off = c - p; int weight = max_delta - off.abs(); divisor += weight; - total += _shoals_heights[p.y][p.x] * weight; + total += shoals_heights(p) * weight; } } - _shoals_heights[c.y][c.x] = total / divisor; + shoals_heights(c) = total / divisor; } static void _shoals_smooth() diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index 518d21b23c..9807ec54dc 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -3468,14 +3468,19 @@ static void _describe_cell(const coord_def& where, bool in_range) marker = " (" + desc + ")"; } const std::string traveldest = _stair_destination_description(where); + std::string height_desc; + if (env.heightmap.get()) + height_desc = make_stringf(" (height: %d)", (*env.heightmap)(where)); const dungeon_feature_type feat = grd(where); - mprf(MSGCH_DIAGNOSTICS, "(%d,%d): %s - %s (%d/%s)%s%s", where.x, where.y, + mprf(MSGCH_DIAGNOSTICS, "(%d,%d): %s - %s (%d/%s)%s%s%s", + where.x, where.y, stringize_glyph(get_screen_glyph(where)).c_str(), feature_desc.c_str(), feat, dungeon_feature_name(feat), marker.c_str(), - traveldest.c_str()); + traveldest.c_str(), + height_desc.c_str()); #else if (Tutorial.tutorial_left && tutorial_pos_interesting(where.x, where.y)) { diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 53658c2a58..c5f6a788ca 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -975,6 +975,7 @@ void dgn_reset_level() // Forget level properties. env.properties.clear(); + env.heightmap.reset(NULL); // Set up containers for storing some level generation info. env.properties[LEVEL_VAULTS_KEY].new_table(); diff --git a/crawl-ref/source/env.h b/crawl-ref/source/env.h index 1f3c02f142..aa78f2ac0f 100644 --- a/crawl-ref/source/env.h +++ b/crawl-ref/source/env.h @@ -6,6 +6,7 @@ #include "show.h" #include "trap_def.h" +typedef FixedArray grid_heightmap; struct crawl_environment { public: @@ -22,6 +23,8 @@ public: FixedArray< unsigned short, GXM, GYM > cgrid; // cloud grid FixedArray< unsigned short, GXM, GYM > grid_colours; // colour overrides + std::auto_ptr heightmap; + // Player-remembered terrain. TODO: move to class player. FixedArray< map_cell, GXM, GYM > map_knowledge; diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index ab60932b4f..c092062c23 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -61,6 +61,7 @@ #include "artefact.h" #include "branch.h" +#include "coordit.h" #include "describe.h" #include "dungeon.h" #include "enum.h" @@ -1825,6 +1826,15 @@ static void tag_construct_level(writer &th) env.markers.write(th); env.properties.write(th); + + // Save heightmap, if present. + marshallByte(th, !!env.heightmap.get()); + if (env.heightmap.get()) + { + grid_heightmap &heightmap(*env.heightmap); + for (rectangle_iterator ri(0); ri; ++ri) + marshallShort(th, heightmap(*ri)); + } } void marshallItem(writer &th, const item_def &item) @@ -2217,6 +2227,20 @@ static void tag_read_level( reader &th, char minorVersion ) env.properties.clear(); env.properties.read(th); + + // Restore heightmap + env.heightmap.reset(NULL); + if (_tag_minor_version >= TAG_MINOR_HEIGHTMAP) + { + const bool have_heightmap(unmarshallByte(th)); + if (have_heightmap) + { + env.heightmap.reset(new grid_heightmap); + grid_heightmap &heightmap(*env.heightmap); + for (rectangle_iterator ri(0); ri; ++ri) + heightmap(*ri) = unmarshallShort(th); + } + } } static void tag_read_level_items(reader &th, char minorVersion) diff --git a/crawl-ref/source/tags.h b/crawl-ref/source/tags.h index 26ecf81233..e7877dfd6f 100644 --- a/crawl-ref/source/tags.h +++ b/crawl-ref/source/tags.h @@ -46,8 +46,9 @@ enum tag_major_version // Minor version will be reset to zero when major version changes. enum tag_minor_version { - TAG_MINOR_RESET = 0, // Minor tags were reset - TAG_MINOR_VERSION = 0 // Current version. (Keep equal to max.) + TAG_MINOR_RESET = 0, // Minor tags were reset + TAG_MINOR_HEIGHTMAP = 1, + TAG_MINOR_VERSION = 1 // Current version. (Keep equal to max.) }; struct enum_info -- cgit v1.2.3-54-g00ecf From 382a17cfc82a018bc2c071a6fed85150fe3d2154 Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Sun, 27 Dec 2009 15:49:39 +0530 Subject: Increase depths of deep water by distance from shore. --- crawl-ref/source/dgn-shoals.cc | 66 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/crawl-ref/source/dgn-shoals.cc b/crawl-ref/source/dgn-shoals.cc index f3b7e386fd..1f7485dd5b 100644 --- a/crawl-ref/source/dgn-shoals.cc +++ b/crawl-ref/source/dgn-shoals.cc @@ -216,6 +216,71 @@ static void _shoals_apply_level() grd(*ri) = _shoals_feature_at(*ri); } +static bool _has_adjacent_feat(coord_def c, dungeon_feature_type feat) +{ + for (adjacent_iterator ai(c); ai; ++ai) + if (grd(*ai) == feat) + return true; + return false; +} + +// Returns all points in deep water with an adjacent square in shallow water. +static std::vector _shoals_water_depth_change_points() +{ + std::vector points; + for (rectangle_iterator ri(1); ri; ++ri) + { + coord_def c(*ri); + if (grd(c) == DNGN_DEEP_WATER + && _has_adjacent_feat(c, DNGN_SHALLOW_WATER)) + points.push_back(c); + } + return points; +} + +static inline void _shoals_deepen_water_at(coord_def p, int distance) +{ + shoals_heights(p) -= distance * 5; +} + +static void _shoals_deepen_water() +{ + std::vector pages[2]; + int current_page = 0; + pages[current_page] = _shoals_water_depth_change_points(); + FixedArray seen_points(false); + + for (int i = 0, size = pages[current_page].size(); i < size; ++i) + seen_points(pages[current_page][i]) = true; + + int distance = 0; + while (!pages[current_page].empty()) + { + const int next_page = !current_page; + std::vector &cpage(pages[current_page]); + std::vector &npage(pages[next_page]); + for (int i = 0, size = cpage.size(); i < size; ++i) + { + coord_def c(cpage[i]); + if (distance) + _shoals_deepen_water_at(c, distance); + + for (adjacent_iterator ai(c); ai; ++ai) + { + coord_def adj(*ai); + if (!seen_points(adj) && grd(adj) == DNGN_DEEP_WATER) + { + npage.push_back(adj); + seen_points(adj) = true; + } + } + } + cpage.clear(); + current_page = next_page; + distance++; + } +} + static coord_def _pick_shoals_island() { const int lucky_island = random2(_shoals_islands.size()); @@ -316,5 +381,6 @@ void prepare_shoals(int level_number) _shoals_cliffs(); _shoals_smooth(); _shoals_apply_level(); + _shoals_deepen_water(); _shoals_furniture(_shoals_margin); } -- cgit v1.2.3-54-g00ecf From 191aad1fa653d19020b28368bf7423d4b44c38c7 Mon Sep 17 00:00:00 2001 From: Johanna Ploog Date: Sun, 27 Dec 2009 13:27:41 +0100 Subject: Replace the flat Maurice tile with a more 3dimensional one. I'm not entirely convinced this is actually better but the flat one stood out like a sore thumb, so that's a nogo. --- crawl-ref/source/rltiles/dc-mon/unique/maurice.png | Bin 902 -> 1080 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/crawl-ref/source/rltiles/dc-mon/unique/maurice.png b/crawl-ref/source/rltiles/dc-mon/unique/maurice.png index 284ad4645c..874963221c 100644 Binary files a/crawl-ref/source/rltiles/dc-mon/unique/maurice.png and b/crawl-ref/source/rltiles/dc-mon/unique/maurice.png differ -- cgit v1.2.3-54-g00ecf From bd29fc66d15166b3c34dcad3abaea54e0e3bacbc Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Sun, 27 Dec 2009 18:32:52 +0530 Subject: Add tides to the Shoals. --- crawl-ref/source/actor.h | 8 ++ crawl-ref/source/dgn-shoals.cc | 242 ++++++++++++++++++++++++++++++++++++++++- crawl-ref/source/dgn-shoals.h | 1 + crawl-ref/source/effects.cc | 2 + crawl-ref/source/misc.cc | 2 + crawl-ref/source/player.cc | 14 ++- crawl-ref/source/player.h | 1 + 7 files changed, 264 insertions(+), 6 deletions(-) diff --git a/crawl-ref/source/actor.h b/crawl-ref/source/actor.h index f8e920eb14..b29e826307 100644 --- a/crawl-ref/source/actor.h +++ b/crawl-ref/source/actor.h @@ -28,7 +28,15 @@ public: virtual bool is_summoned(int* duration = NULL, int* summon_type = NULL) const = 0; + // [ds] Low-level moveto() - moves the actor without updating relevant + // grids, such as mgrd. virtual void moveto(const coord_def &c) = 0; + + // High-level actor movement. If in doubt, use this. Returns true if the + // actor cannot be moved to the target, possibly because it is already + // occupied. + virtual bool move_to_pos(const coord_def &c) = 0; + virtual void set_position(const coord_def &c); virtual const coord_def& pos() const { return position; } diff --git a/crawl-ref/source/dgn-shoals.cc b/crawl-ref/source/dgn-shoals.cc index 1f7485dd5b..b21315f1a8 100644 --- a/crawl-ref/source/dgn-shoals.cc +++ b/crawl-ref/source/dgn-shoals.cc @@ -6,13 +6,20 @@ #include "dungeon.h" #include "dgn-shoals.h" #include "env.h" +#include "items.h" #include "maps.h" +#include "mon-place.h" +#include "mon-util.h" #include "random.h" +#include "terrain.h" #include #include #include +const char *ENVP_SHOALS_TIDE_KEY = "shoals-tide-height"; +const char *ENVP_SHOALS_TIDE_VEL = "shoals-tide-velocity"; + inline short &shoals_heights(const coord_def &c) { return (*env.heightmap)(c); @@ -45,9 +52,8 @@ static double _to_radians(int degrees) return degrees * M_PI / 180; } -static dungeon_feature_type _shoals_feature_at(const coord_def &c) +static dungeon_feature_type _shoals_feature_by_height(int height) { - const int height = shoals_heights(c); return height >= SHT_STONE ? DNGN_STONE_WALL : height >= SHT_ROCK? DNGN_ROCK_WALL : height >= SHT_FLOOR? DNGN_FLOOR : @@ -55,6 +61,12 @@ static dungeon_feature_type _shoals_feature_at(const coord_def &c) : DNGN_DEEP_WATER; } +static dungeon_feature_type _shoals_feature_at(const coord_def &c) +{ + const int height = shoals_heights(c); + return _shoals_feature_by_height(height); +} + static void _shoals_init_heights() { env.heightmap.reset(new grid_heightmap); @@ -240,7 +252,7 @@ static std::vector _shoals_water_depth_change_points() static inline void _shoals_deepen_water_at(coord_def p, int distance) { - shoals_heights(p) -= distance * 5; + shoals_heights(p) -= distance * 7; } static void _shoals_deepen_water() @@ -365,7 +377,28 @@ static void _shoals_furniture(int margin) = static_cast(DNGN_STONE_STAIRS_UP_I + i); } } +} +static void _shoals_deepen_edges() +{ + const int edge = 2; + // Water of the edge of the screen is too deep to be exposed by tides. + for (int y = 1; y < GYM - 2; ++y) + { + for (int x = 1; x <= edge; ++x) + { + shoals_heights(coord_def(x, y)) -= 800; + shoals_heights(coord_def(GXM - 1 - x, y)) -= 800; + } + } + for (int x = 1; x < GXM - 2; ++x) + { + for (int y = 1; y <= edge; ++y) + { + shoals_heights(coord_def(x, y)) -= 800; + shoals_heights(coord_def(x, GYM - 1 - y)) -= 800; + } + } } void prepare_shoals(int level_number) @@ -382,5 +415,208 @@ void prepare_shoals(int level_number) _shoals_smooth(); _shoals_apply_level(); _shoals_deepen_water(); + _shoals_deepen_edges(); _shoals_furniture(_shoals_margin); } + +// The raw tide height / TIDE_MULTIPLIER is the actual tide height. The higher +// the tide multiplier, the slower the tide advances and recedes. A multiplier +// of X implies that the tide will advance visibly about once in X turns. +const int TIDE_MULTIPLIER = 30; + +const int LOW_TIDE = -25 * TIDE_MULTIPLIER; +const int HIGH_TIDE = 25 * TIDE_MULTIPLIER; +const int TIDE_DECEL_MARGIN = 8; +const int START_TIDE_RISE = 2; + +static void _shoals_run_tide(int &tide, int &acc) +{ + tide += acc; + tide = std::max(std::min(tide, HIGH_TIDE), LOW_TIDE); + if ((tide == HIGH_TIDE && acc > 0) + || (tide == LOW_TIDE && acc < 0)) + acc = -acc; + bool in_decel_margin = + (abs(tide - HIGH_TIDE) < TIDE_DECEL_MARGIN) + || (abs(tide - LOW_TIDE) < TIDE_DECEL_MARGIN); + if ((abs(acc) == 2) == in_decel_margin) + acc = in_decel_margin? acc / 2 : acc * 2; +} + +static coord_def _shoals_escape_place_from(coord_def bad_place, + bool monster_free) +{ + int best_height = -1000; + coord_def chosen; + for (adjacent_iterator ai(bad_place); ai; ++ai) + { + coord_def p(*ai); + const dungeon_feature_type feat(grd(p)); + if (!feat_is_solid(feat) && !feat_destroys_items(feat) + && (!monster_free || !actor_at(p))) + { + if (best_height == -1000 || shoals_heights(p) > best_height) + { + best_height = shoals_heights(p); + chosen = p; + } + } + } + return chosen; +} + +static bool _shoals_tide_sweep_items_clear(coord_def c) +{ + int link = igrd(c); + if (link == NON_ITEM) + return true; + + const coord_def target(_shoals_escape_place_from(c, false)); + if (target.origin()) + return false; + + move_item_stack_to_grid(c, target); + return true; +} + +static bool _shoals_tide_sweep_actors_clear(coord_def c) +{ + actor *victim = actor_at(c); + if (!victim) + return true; + + if (victim->atype() == ACT_MONSTER) + { + monsters *mvictim = dynamic_cast(victim); + // Plants and statues cannot be moved away; the tide cannot + // drown them. + if (mons_class_is_stationary(mvictim->type)) + return false; + + // If the monster doesn't need help, move along. + if (monster_habitable_grid(mvictim, DNGN_DEEP_WATER)) + return true; + } + coord_def evacuation_point(_shoals_escape_place_from(c, true)); + // The tide moves on even if we cannot evacuate the tile! + if (!evacuation_point.origin()) + victim->move_to_pos(evacuation_point); + return true; +} + +// The tide will attempt to push items and non-water-capable monsters to +// adjacent squares. +static bool _shoals_tide_sweep_clear(coord_def c) +{ + return _shoals_tide_sweep_items_clear(c) + && _shoals_tide_sweep_actors_clear(c); +} + +static void _shoals_apply_tide_feature_at(coord_def c, + dungeon_feature_type feat) +{ + if (feat == DNGN_DEEP_WATER && !_shoals_tide_sweep_clear(c)) + feat = DNGN_SHALLOW_WATER; + + const dungeon_feature_type current_feat = grd(c); + if (feat == current_feat) + return; + + dungeon_terrain_changed(c, feat, true, false, true); +} + +static void _shoals_apply_tide_at(coord_def c, int tide) +{ + const int effective_height = shoals_heights(c) - tide; + dungeon_feature_type newfeat = + _shoals_feature_by_height(effective_height); + // Make sure we're not sprouting new walls. + if (feat_is_wall(newfeat)) + newfeat = DNGN_FLOOR; + + _shoals_apply_tide_feature_at(c, newfeat); +} + +static void _shoals_apply_tide(int tide) +{ + std::vector pages[2]; + int current_page = 0; + + // Start from corners of the map. + pages[current_page].push_back(coord_def(1,1)); + pages[current_page].push_back(coord_def(GXM - 2, 1)); + pages[current_page].push_back(coord_def(1, GYM - 2)); + pages[current_page].push_back(coord_def(GXM - 2, GYM - 2)); + + FixedArray seen_points(false); + + while (!pages[current_page].empty()) + { + int next_page = !current_page; + std::vector &cpage(pages[current_page]); + std::vector &npage(pages[next_page]); + + for (int i = 0, size = cpage.size(); i < size; ++i) + { + coord_def c(cpage[i]); + const bool was_wet(feat_is_water(grd(c))); + seen_points(c) = true; + _shoals_apply_tide_at(c, tide); + + // Only wet squares can propagate the tide onwards. + if (was_wet) + { + for (adjacent_iterator ai(c); ai; ++ai) + { + coord_def adj(*ai); + if (!in_bounds(adj)) + continue; + if (!seen_points(adj)) + { + const dungeon_feature_type feat = grd(adj); + if (feat_is_water(feat) || feat == DNGN_FLOOR) + { + npage.push_back(adj); + seen_points(adj) = true; + } + } + } + } + } + + cpage.clear(); + current_page = next_page; + } +} + +static void _shoals_init_tide() +{ + if (!env.properties.exists(ENVP_SHOALS_TIDE_KEY)) + { + env.properties[ENVP_SHOALS_TIDE_KEY] = short(0); + env.properties[ENVP_SHOALS_TIDE_VEL] = short(2); + } +} + +void shoals_apply_tides(int turns_elapsed) +{ + if (!player_in_branch(BRANCH_SHOALS) || !turns_elapsed + || !env.heightmap.get()) + { + return; + } + + const int TIDE_UNIT = HIGH_TIDE - LOW_TIDE; + // If we've been gone a long time, eliminate some unnecessary math. + if (turns_elapsed > TIDE_UNIT * 2) + turns_elapsed = turns_elapsed % TIDE_UNIT + TIDE_UNIT; + + _shoals_init_tide(); + int tide = env.properties[ENVP_SHOALS_TIDE_KEY].get_short(); + int acc = env.properties[ENVP_SHOALS_TIDE_VEL].get_short(); + while (turns_elapsed-- > 0) + _shoals_run_tide(tide, acc); + env.properties[ENVP_SHOALS_TIDE_KEY] = short(tide); + env.properties[ENVP_SHOALS_TIDE_VEL] = short(acc); + _shoals_apply_tide(tide / TIDE_MULTIPLIER); +} diff --git a/crawl-ref/source/dgn-shoals.h b/crawl-ref/source/dgn-shoals.h index 023f321fe6..aae09ff653 100644 --- a/crawl-ref/source/dgn-shoals.h +++ b/crawl-ref/source/dgn-shoals.h @@ -2,5 +2,6 @@ #define DGN_SHOALS_H void prepare_shoals(int level_number); +void shoals_apply_tides(int turns_elapsed); #endif diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 30687dd58d..bede6d46c2 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -27,6 +27,7 @@ #include "coordit.h" #include "decks.h" #include "delay.h" +#include "dgn-shoals.h" #include "dungeon.h" #include "directn.h" #include "dgnevent.h" @@ -4263,6 +4264,7 @@ void update_level(double elapsedTime) #endif update_corpses(elapsedTime); + shoals_apply_tides(turns); if (env.sanctuary_time) { diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 5697133c4a..3312bfcf94 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -36,6 +36,7 @@ #include "coordit.h" #include "database.h" #include "delay.h" +#include "dgn-shoals.h" #include "directn.h" #include "dgnevent.h" #include "directn.h" @@ -3092,6 +3093,7 @@ void run_environment_effects() } run_corruption_effects(you.time_taken); + shoals_apply_tides(div_rand_round(you.time_taken, 10)); } coord_def pick_adjacent_free_square(const coord_def& p) diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 4e5cf2dc77..e7e54c63d6 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -7031,6 +7031,17 @@ void player::moveto(const coord_def &c) set_position(c); } +bool player::move_to_pos(const coord_def &c) +{ + actor *target = actor_at(c); + if (!target || target->submerged()) + { + moveto(c); + return true; + } + return false; +} + void player::shiftto(const coord_def &c) { crawl_view.shift_player_to(c); @@ -7423,6 +7434,3 @@ void player::set_duration(duration_type dur, int turns, you.duration[dur] = 0; increase_duration(dur, turns, cap, msg); } - - - diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index d7f5306c08..a02e5f5c4c 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -314,6 +314,7 @@ public: void set_position(const coord_def &c); // Low-level move the player. Use this instead of changing pos directly. void moveto(const coord_def &c); + bool move_to_pos(const coord_def &c); // Move the player during an abyss shift. void shiftto(const coord_def &c); bool blink_to(const coord_def& c, bool quiet = false); -- cgit v1.2.3-54-g00ecf From 0fe55b6adbe990a2321dfc9b50e862da27186759 Mon Sep 17 00:00:00 2001 From: Vsevolod Kozlov Date: Sun, 27 Dec 2009 16:40:20 +0300 Subject: Use strip_tag for cursed/randart/damaged in parse_single_spec. --- crawl-ref/source/mapdef.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index 060ec78677..5eda9e7792 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -3898,20 +3898,17 @@ item_spec item_list::parse_single_spec(std::string s) } } - if (s.find("damaged ") == 0) + if (strip_tag(s, "damaged")) { result.level = ISPEC_DAMAGED; - s = s.substr(8); } - if (s.find("cursed ") == 0) + if (strip_tag(s, "cursed")) { result.level = ISPEC_BAD; // damaged + cursed, actually - s = s.substr(7); } - if (s.find("randart ") == 0) + if (strip_tag(s, "randart")) { result.level = ISPEC_RANDART; - s = s.substr(8); } if (strip_tag(s, "no_uniq")) -- cgit v1.2.3-54-g00ecf From c0788ba0603604a5d998c0c30afd8e33b4c1c6ce Mon Sep 17 00:00:00 2001 From: Vsevolod Kozlov Date: Sun, 27 Dec 2009 16:50:24 +0300 Subject: Reduce code duplication in trap_def::shot_damage. --- crawl-ref/source/traps.cc | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc index e8b8d92bce..e2dcd625ea 100644 --- a/crawl-ref/source/traps.cc +++ b/crawl-ref/source/traps.cc @@ -679,36 +679,26 @@ void trap_def::trigger(actor& triggerer, bool flat_footed) int trap_def::shot_damage(actor& act) { - if (act.atype() == ACT_PLAYER) - { - switch (this->type) - { - case TRAP_NEEDLE: return 0; - case TRAP_DART: return random2( 4 + you.your_level/2) + 1; - case TRAP_ARROW: return random2( 7 + you.your_level) + 1; - case TRAP_SPEAR: return random2(10 + you.your_level) + 1; - case TRAP_BOLT: return random2(13 + you.your_level) + 1; - case TRAP_AXE: return random2(15 + you.your_level) + 1; - default: return 0; - } - } - else if (act.atype() == ACT_MONSTER) + int level = you.your_level; + + // Trap damage to monsters is not a function of level, because + // they are fairly stupid and tend to have fewer hp than + // players -- this choice prevents traps from easily killing + // large monsters fairly deep within the dungeon. + if (act.atype() == ACT_MONSTER) + level = 0; + + switch (this->type) { - // Trap damage to monsters is not a function of level, because - // they are fairly stupid and tend to have fewer hp than - // players -- this choice prevents traps from easily killing - // large monsters fairly deep within the dungeon. - switch (this->type) - { case TRAP_NEEDLE: return 0; - case TRAP_DART: return random2( 4) + 1; - case TRAP_ARROW: return random2( 7) + 1; - case TRAP_SPEAR: return random2(10) + 1; - case TRAP_BOLT: return random2(13) + 1; - case TRAP_AXE: return random2(15) + 1; + case TRAP_DART: return random2( 4 + level/2) + 1; + case TRAP_ARROW: return random2( 7 + level) + 1; + case TRAP_SPEAR: return random2(10 + level) + 1; + case TRAP_BOLT: return random2(13 + level) + 1; + case TRAP_AXE: return random2(15 + level) + 1; default: return 0; - } } + return (0); } -- cgit v1.2.3-54-g00ecf From 34c10bc02d11249b2f24faa34a157db3911046e7 Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Sun, 27 Dec 2009 19:25:19 +0530 Subject: Reduce low tide effects in the Shoals. --- crawl-ref/source/dgn-shoals.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl-ref/source/dgn-shoals.cc b/crawl-ref/source/dgn-shoals.cc index b21315f1a8..f7a44a0c5c 100644 --- a/crawl-ref/source/dgn-shoals.cc +++ b/crawl-ref/source/dgn-shoals.cc @@ -424,7 +424,7 @@ void prepare_shoals(int level_number) // of X implies that the tide will advance visibly about once in X turns. const int TIDE_MULTIPLIER = 30; -const int LOW_TIDE = -25 * TIDE_MULTIPLIER; +const int LOW_TIDE = -18 * TIDE_MULTIPLIER; const int HIGH_TIDE = 25 * TIDE_MULTIPLIER; const int TIDE_DECEL_MARGIN = 8; const int START_TIDE_RISE = 2; -- cgit v1.2.3-54-g00ecf From 22d52312ea69d1ad0e291920defa83e84d273992 Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Sun, 27 Dec 2009 19:33:10 +0530 Subject: Shoals tides should not try to move flying/swimming monsters out of the way, fixed. --- crawl-ref/source/dgn-shoals.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl-ref/source/dgn-shoals.cc b/crawl-ref/source/dgn-shoals.cc index f7a44a0c5c..5de4294d8d 100644 --- a/crawl-ref/source/dgn-shoals.cc +++ b/crawl-ref/source/dgn-shoals.cc @@ -482,7 +482,7 @@ static bool _shoals_tide_sweep_items_clear(coord_def c) static bool _shoals_tide_sweep_actors_clear(coord_def c) { actor *victim = actor_at(c); - if (!victim) + if (!victim || victim->airborne() || victim->swimming()) return true; if (victim->atype() == ACT_MONSTER) -- cgit v1.2.3-54-g00ecf From 1b9f02892b65f3e7b0c1c02ca8de71a45f041787 Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Sun, 27 Dec 2009 19:48:39 +0530 Subject: Apply second smoothing pass to Shoals deep water to reduce ugly rectangular deep water outlines at low tide. --- crawl-ref/source/dgn-shoals.cc | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/crawl-ref/source/dgn-shoals.cc b/crawl-ref/source/dgn-shoals.cc index 5de4294d8d..201f3f4690 100644 --- a/crawl-ref/source/dgn-shoals.cc +++ b/crawl-ref/source/dgn-shoals.cc @@ -41,6 +41,7 @@ const int _shoals_margin = 6; enum shoals_height_thresholds { + SHT_UNDEFINED = -10000, SHT_STONE = 230, SHT_ROCK = 170, SHT_FLOOR = 0, @@ -197,8 +198,13 @@ static void _shoals_cliffs() _shoals_build_cliff(); } -static void _shoals_smooth_at(const coord_def &c, int radius) +static void _shoals_smooth_at(const coord_def &c, int radius, + int max_height = SHT_UNDEFINED) { + const int height = shoals_heights(c); + if (max_height != SHT_UNDEFINED && height > max_height) + return; + int max_delta = radius * radius * 2 + 2; int divisor = 0; int total = 0; @@ -207,10 +213,13 @@ static void _shoals_smooth_at(const coord_def &c, int radius) const coord_def p(x, y); if (!in_bounds(p)) continue; + const int nheight = shoals_heights(p); + if (max_height != SHT_UNDEFINED && nheight > max_height) + continue; const coord_def off = c - p; int weight = max_delta - off.abs(); divisor += weight; - total += shoals_heights(p) * weight; + total += nheight * weight; } } shoals_heights(c) = total / divisor; @@ -222,6 +231,12 @@ static void _shoals_smooth() _shoals_smooth_at(*ri, 1); } +static void _shoals_smooth_water() +{ + for (rectangle_iterator ri(0); ri; ++ri) + _shoals_smooth_at(*ri, 1, SHT_SHALLOW_WATER - 1); +} + static void _shoals_apply_level() { for (rectangle_iterator ri(1); ri; ++ri) @@ -416,6 +431,7 @@ void prepare_shoals(int level_number) _shoals_apply_level(); _shoals_deepen_water(); _shoals_deepen_edges(); + _shoals_smooth_water(); _shoals_furniture(_shoals_margin); } -- cgit v1.2.3-54-g00ecf From 21d39fbc5baa0d247abb40f66dfee07a3abd7a99 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Sun, 27 Dec 2009 03:33:57 +0100 Subject: Don't say that "Kiku likes sacrifices of corpses", as that costs piety. --- crawl-ref/source/religion.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 395db6af89..2524fbfcd5 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -609,7 +609,7 @@ std::string get_god_likes(god_type which_god, bool verbose) break; } - if (god_likes_fresh_corpses(which_god)) + if (god_likes_fresh_corpses(which_god) && which_god != GOD_KIKUBAAQUDGHA) { snprintf(info, INFO_SIZE, "you sacrifice fresh corpses%s", verbose ? " (by standing over them and praying)" : ""); -- cgit v1.2.3-54-g00ecf From f10addfc13d3b174e4de2529978db2cfce4e5bb1 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Sun, 27 Dec 2009 15:13:02 +0100 Subject: Replace '+' by '∞' for books in CSET_UNICODE and CSET_IBM. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crawl-ref/source/viewchar.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/crawl-ref/source/viewchar.cc b/crawl-ref/source/viewchar.cc index 78818642bd..bf0460591c 100644 --- a/crawl-ref/source/viewchar.cc +++ b/crawl-ref/source/viewchar.cc @@ -24,27 +24,35 @@ static const unsigned dchar_table[ NUM_CSET ][ NUM_DCHAR_TYPES ] = 177, 176, 249, 250, '\'', 254, '^', '>', '<', // wall .. stairs up 220, 239, 244, 247, '8', '~', '~', // altar .. item detect '0', ')', '[', '/', '%', '?', '=', '!', '(', // orb .. missile - '+', '\\', '}', '%', '$', '"', '#', 234, // book .. trees + 236, '\\', '}', '%', '$', '"', '#', 234, // book .. trees ' ', '!', '#', '%', '+', ')', '*', '+', // space .. fired_burst '/', '=', '?', 'X', '[', '`', '#' // fi_stick .. explosion }, // CSET_DEC - remember: 224-255 are mapped to shifted 96-127 + // It's better known as "vt100 line drawing characters". { 225, 224, 254, ':', '\'', 238, '^', '>', '<', // wall .. stairs up 251, 182, 167, 187, '8', 171, 168, // altar .. item detect '0', ')', '[', '/', '%', '?', '=', '!', '(', // orb .. missile - '+', '\\', '}', '%', '$', '"', '#', '7', // book .. trees + ':', '\\', '}', '%', '$', '"', '#', '7', // book .. trees ' ', '!', '#', '%', '+', ')', '*', '+', // space .. fired_burst '/', '=', '?', 'X', '[', '`', '#' // fi_stick .. explosion }, // CSET_UNICODE + /* Beware, some popular terminals (PuTTY, xterm) are incapable of coping with + the lack of a character in the chosen font, and most popular fonts have a + quite limited repertoire. A subset that is reasonably likely to be present + is http://en.wikipedia.org/wiki/WGL4; we could provide a richer alternate + set for those on more capable terminals (including for example Thai 0xEB0 + for clouds), but that would require decoupling encoding from charset. + */ { 0x2592, 0x2591, 0xB7, 0x25E6, '\'', 0x25FC, '^', '>', '<', '_', 0x2229, 0x2320, 0x2248, '8', '~', '~', '0', ')', '[', '/', '%', '?', '=', '!', '(', - '+', '|', '}', '%', '$', '"', '#', 0x2663, + 0x221E, '|', '}', '%', '$', '"', '#', 0x2663, ' ', '!', '#', '%', '+', ')', '*', '+', // space .. fired_burst '/', '=', '?', 'X', '[', '`', '#' // fi_stick .. explosion }, -- cgit v1.2.3-54-g00ecf From e42132c99bf63b213388404676a54c6610bd613c Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Sun, 27 Dec 2009 15:19:32 +0100 Subject: Before a better solution is decided on, slash TSO holy revenge by a factor of 4. This is roughly half of maxhp for vampires and mummies -- still harsh after a hard battle, especially when there's more holies around. --- crawl-ref/source/godwrath.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crawl-ref/source/godwrath.cc b/crawl-ref/source/godwrath.cc index a94b0ec2c8..e3e87198ca 100644 --- a/crawl-ref/source/godwrath.cc +++ b/crawl-ref/source/godwrath.cc @@ -1249,7 +1249,8 @@ static void _tso_blasts_cleansing_flame(const char *message) simple_god_message(" blasts you with cleansing flame!", GOD_SHINING_ONE); - cleansing_flame(20 + (you.experience_level * 7) / 3, + // damage is 2d(pow), *3/2 for undead and demonspawn + cleansing_flame(5 + (you.experience_level * 7) / 12, CLEANSING_FLAME_TSO, you.pos()); } } -- cgit v1.2.3-54-g00ecf From 23929ee3b2452b1c3a133061eff44b31dc70fb09 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Mon, 28 Dec 2009 00:17:23 +1000 Subject: Customisable clouds! cloud_struct now has members for colour, name, and tile; colour will be used instead of the default colour of the cloud type, and will be used to recolour the tile of the cloud (if it exists). Name will be used to rebrand the cloud's description, and also alter the message generate while standing in a cloud. Finally, tile can be used to completely customise the tile used for the cloud. The value is stored as a string in order to maintain save compatibility across ASCII and tiles. A random tile (found using tile_main_count) from that set will also be used, however, no duration effects will be applied. Recoloured cloud tiles using just the colour code should be possible, though aren't yet fully tested. This commit bumps TAG_MAJOR_VERSION: changing marshalling of the FogMachine Lua code causes nasty crashes on reloading saved games. Otherwise, I don't think I broke anything else. :-) --- crawl-ref/source/beam.cc | 5 +- crawl-ref/source/cloud.cc | 110 ++++++++++++++++++++++++++--------- crawl-ref/source/cloud.h | 24 ++++++-- crawl-ref/source/dat/clua/lm_fog.lua | 21 ++++++- crawl-ref/source/directn.cc | 3 +- crawl-ref/source/externs.h | 6 +- crawl-ref/source/l_dgn.cc | 18 ++++-- crawl-ref/source/misc.cc | 5 +- crawl-ref/source/player.cc | 2 +- crawl-ref/source/show.cc | 3 +- crawl-ref/source/spells1.cc | 17 +++--- crawl-ref/source/spells1.h | 9 ++- crawl-ref/source/spells4.cc | 5 +- crawl-ref/source/spells4.h | 3 +- crawl-ref/source/spl-util.cc | 19 +++--- crawl-ref/source/spl-util.h | 6 +- crawl-ref/source/tags.cc | 6 ++ crawl-ref/source/tags.h | 2 +- crawl-ref/source/tilepick.cc | 109 +++++++++++++++++++++------------- crawl-ref/source/tilereg.cc | 8 +-- crawl-ref/source/tiles.h | 2 +- crawl-ref/source/tutorial.cc | 2 +- 22 files changed, 261 insertions(+), 124 deletions(-) diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index cdeefc8204..8b05a833d9 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -3243,17 +3243,18 @@ void bolt::affect_place_clouds() if (p == you.pos()) { mprf("The %s you are in turns into %s!", - cloud_name(ctype).c_str(), cloud_name(new_type).c_str()); + cloud_name(cloudidx).c_str(), cloud_name(new_type).c_str()); obvious_effect = true; } else if (you.see_cell(p)) { mprf("A cloud of %s turns into %s.", - cloud_name(ctype).c_str(), cloud_name(new_type).c_str()); + cloud_name(cloudidx).c_str(), cloud_name(new_type).c_str()); obvious_effect = true; } ctype = new_type; + env.cloud[cloudidx].name = ""; return; } diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc index 638432f504..bd5670b846 100644 --- a/crawl-ref/source/cloud.cc +++ b/crawl-ref/source/cloud.cc @@ -27,6 +27,11 @@ #include "stuff.h" #include "env.h" #include "terrain.h" +#ifdef USE_TILE +#include "tiles.h" +#include "tiledef-gui.h" +#include "tiledef-main.h" +#endif #include "mutation.h" static int _actual_spread_rate(cloud_type type, int spread_rate) @@ -70,7 +75,8 @@ static bool _killer_whose_match(kill_category whose, killer_type killer) static void _new_cloud( int cloud, cloud_type type, const coord_def& p, int decay, kill_category whose, killer_type killer, - unsigned char spread_rate ) + unsigned char spread_rate, int colour, std::string name, + std::string tile) { ASSERT( env.cloud[cloud].type == CLOUD_NONE ); ASSERT(_killer_whose_match(whose, killer)); @@ -83,13 +89,28 @@ static void _new_cloud( int cloud, cloud_type type, const coord_def& p, c.whose = whose; c.killer = killer; c.spread_rate = spread_rate; + c.colour = colour; + c.name = name; +#ifdef USE_TILE + if (!tile.empty()) + { + unsigned int index; + if (!tile_main_index(tile.c_str(), index)) + { + mprf(MSGCH_ERROR, "Invalid tile requested for cloud: '%s'.", tile.c_str()); + tile = ""; + } + } +#endif + c.tile = tile; env.cgrid(p) = cloud; env.cloud_no++; } static void _place_new_cloud(cloud_type cltype, const coord_def& p, int decay, kill_category whose, killer_type killer, - int spread_rate) + int spread_rate, int colour, std::string name, + std::string tile) { if (env.cloud_no >= MAX_CLOUDS) return; @@ -99,7 +120,8 @@ static void _place_new_cloud(cloud_type cltype, const coord_def& p, int decay, { if (env.cloud[ci].type == CLOUD_NONE) // i.e., is empty { - _new_cloud( ci, cltype, p, decay, whose, killer, spread_rate ); + _new_cloud( ci, cltype, p, decay, whose, killer, spread_rate, colour, + name, tile ); break; } } @@ -129,7 +151,7 @@ static int _spread_cloud(const cloud_struct &cloud) newdecay = cloud.decay - 1; _place_new_cloud( cloud.type, *ai, newdecay, cloud.whose, cloud.killer, - cloud.spread_rate ); + cloud.spread_rate, cloud.colour, cloud.name, cloud.tile ); extra_decay += 8; } @@ -151,7 +173,8 @@ static void _spread_fire(const cloud_struct &cloud) // burning trees produce flames all around if (!cell_is_solid(*ai) && make_flames) _place_new_cloud( CLOUD_FIRE, *ai, cloud.decay/2+1, cloud.whose, - cloud.killer, cloud.spread_rate ); + cloud.killer, cloud.spread_rate, cloud.colour, + cloud.name, cloud.tile ); // forest fire doesn't spread in all directions at once, // every neighbouring square gets a separate roll @@ -161,7 +184,8 @@ static void _spread_fire(const cloud_struct &cloud) mpr("The forest fire spreads!"); grd(*ai) = DNGN_FLOOR; _place_new_cloud( cloud.type, *ai, random2(30)+25, cloud.whose, - cloud.killer, cloud.spread_rate ); + cloud.killer, cloud.spread_rate, cloud.colour, + cloud.name, cloud.tile ); } } @@ -248,6 +272,9 @@ void delete_cloud( int cloud ) c.whose = KC_OTHER; c.killer = KILL_NONE; c.spread_rate = 0; + c.colour = -1; + c.name = ""; + c.tile = ""; env.cgrid(c.pos) = EMPTY_CLOUD; c.pos.reset(); @@ -271,32 +298,37 @@ void move_cloud( int cloud, const coord_def& newpos ) // Places a cloud with the given stats assuming one doesn't already // exist at that point. void check_place_cloud( cloud_type cl_type, const coord_def& p, int lifetime, - kill_category whose, int spread_rate ) + kill_category whose, int spread_rate, int colour, + std::string name, std::string tile) { check_place_cloud(cl_type, p, lifetime, whose, - cloud_struct::whose_to_killer(whose), spread_rate); + cloud_struct::whose_to_killer(whose), spread_rate, colour, + name, tile); } // Places a cloud with the given stats assuming one doesn't already // exist at that point. void check_place_cloud( cloud_type cl_type, const coord_def& p, int lifetime, - killer_type killer, int spread_rate ) + killer_type killer, int spread_rate, int colour, + std::string name, std::string tile) { check_place_cloud(cl_type, p, lifetime, cloud_struct::killer_to_whose(killer), killer, - spread_rate); + spread_rate, colour, name, tile); } // Places a cloud with the given stats assuming one doesn't already // exist at that point. void check_place_cloud( cloud_type cl_type, const coord_def& p, int lifetime, kill_category whose, killer_type killer, - int spread_rate ) + int spread_rate, int colour, std::string name, + std::string tile) { if (!in_bounds(p) || env.cgrid(p) != EMPTY_CLOUD) return; - place_cloud( cl_type, p, lifetime, whose, killer, spread_rate ); + place_cloud( cl_type, p, lifetime, whose, killer, spread_rate, colour, + name, tile ); } int steam_cloud_damage(const cloud_struct &cloud) @@ -317,27 +349,32 @@ int steam_cloud_damage(int decay) // make way if there are too many on level. Will overwrite an old // cloud under some circumstances. void place_cloud(cloud_type cl_type, const coord_def& ctarget, int cl_range, - kill_category whose, int _spread_rate) + kill_category whose, int _spread_rate, int colour, + std::string name, std::string tile) { place_cloud(cl_type, ctarget, cl_range, whose, - cloud_struct::whose_to_killer(whose), _spread_rate); + cloud_struct::whose_to_killer(whose), _spread_rate, + colour, name, tile); } // Places a cloud with the given stats. May delete old clouds to // make way if there are too many on level. Will overwrite an old // cloud under some circumstances. void place_cloud(cloud_type cl_type, const coord_def& ctarget, int cl_range, - killer_type killer, int _spread_rate) + killer_type killer, int _spread_rate, int colour, + std::string name, std::string tile) { place_cloud(cl_type, ctarget, cl_range, - cloud_struct::killer_to_whose(killer), killer, _spread_rate); + cloud_struct::killer_to_whose(killer), killer, _spread_rate, + colour, name, tile); } // Places a cloud with the given stats. May delete old clouds to // make way if there are too many on level. Will overwrite an old // cloud under some circumstances. void place_cloud(cloud_type cl_type, const coord_def& ctarget, int cl_range, - kill_category whose, killer_type killer, int _spread_rate) + kill_category whose, killer_type killer, int _spread_rate, + int colour, std::string name, std::string tile) { if (is_sanctuary(ctarget) && !is_harmless_cloud(cl_type)) return; @@ -393,7 +430,7 @@ void place_cloud(cloud_type cl_type, const coord_def& ctarget, int cl_range, if (cl_new != -1) { _new_cloud( cl_new, cl_type, ctarget, cl_range * 10, - whose, killer, spread_rate ); + whose, killer, spread_rate, colour, name, tile ); } else { @@ -403,7 +440,7 @@ void place_cloud(cloud_type cl_type, const coord_def& ctarget, int cl_range, if (env.cloud[ci].type == CLOUD_NONE) // ie is empty { _new_cloud( ci, cl_type, ctarget, cl_range * 10, - whose, killer, spread_rate ); + whose, killer, spread_rate, colour, name, tile ); break; } } @@ -609,6 +646,7 @@ void in_a_cloud() int cl = env.cgrid(you.pos()); int hurted = 0; int resist; + std::string name = env.cloud[cl].name; if (you.duration[DUR_CONDENSATION_SHIELD] > 0) remove_condensation_shield(); @@ -620,7 +658,7 @@ void in_a_cloud() if (you.duration[DUR_FIRE_SHIELD]) return; - mpr("You are engulfed in roaring flames!"); + mprf("You are engulfed in %s!", !name.empty() ? name.c_str() : "roaring flames"); resist = player_res_fire(); @@ -650,7 +688,8 @@ void in_a_cloud() case CLOUD_STINK: // If you don't have to breathe, unaffected - mpr("You are engulfed in noxious fumes!"); + mprf("You are engulfed in %s!", !name.empty() ? name.c_str() : "noxious fumes"); + if (player_res_poison()) break; @@ -674,7 +713,7 @@ void in_a_cloud() if (you.mutation[MUT_PASSIVE_FREEZE]) break; - mpr("You are engulfed in freezing vapours!"); + mprf("You are engulfed in %s!", !name.empty() ? name.c_str() : "freezing vapours"); resist = player_res_cold(); @@ -703,7 +742,8 @@ void in_a_cloud() case CLOUD_POISON: // If you don't have to breathe, unaffected - mpr("You are engulfed in poison gas!"); + mprf("You are engulfed in %s!", !name.empty() ? name.c_str() : "poison gas"); + if (!player_res_poison()) { ouch((random2(10) * you.time_taken) / 10, cl, KILLED_BY_CLOUD, @@ -717,12 +757,14 @@ void in_a_cloud() case CLOUD_TLOC_ENERGY: case CLOUD_PURPLE_SMOKE: case CLOUD_BLACK_SMOKE: - mpr("You are engulfed in a cloud of smoke!"); + mprf("You are engulfed in %s!", !name.empty() ? name.c_str() : "a cloud of smoke"); + break; case CLOUD_STEAM: { - mpr("You are engulfed in a cloud of scalding steam!"); + mprf("You are engulfed in %s!", !name.empty() ? name.c_str() : "a cloud of scalding steam"); + if (player_res_steam() > 0) { mpr("It doesn't seem to affect you."); @@ -746,7 +788,7 @@ void in_a_cloud() } case CLOUD_MIASMA: - mpr("You are engulfed in a dark miasma."); + mprf("You are engulfed in %s!", !name.empty() ? name.c_str() : "a dark miasma"); if (you.res_rotting()) return; @@ -771,11 +813,12 @@ void in_a_cloud() you.duration[DUR_MISLED] = 0; } - mpr("You are standing in the rain."); + mprf("You are engulfed in %s.", !name.empty() ? name.c_str() : "the rain"); + break; case CLOUD_MUTAGENIC: - mpr("You are engulfed in a mutagenic fog!"); + mprf("You are engulfed in %s!", !name.empty() ? name.c_str() : "a mutagenic fog"); if (coinflip()) { @@ -870,6 +913,14 @@ cloud_type in_what_cloud() return (env.cloud[cl].type); } +std::string cloud_name(int cloudno) +{ + if (!env.cloud[cloudno].name.empty()) + return (env.cloud[cloudno].name); + else + return cloud_name(env.cloud[cloudno].type); +} + std::string cloud_name(cloud_type type) { switch (type) @@ -975,6 +1026,9 @@ void cloud_struct::set_killer(killer_type _killer) int get_cloud_colour(int cloudno) { int which_colour = LIGHTGREY; + if (env.cloud[cloudno].colour != -1) + return (env.cloud[cloudno].colour); + switch (env.cloud[cloudno].type) { case CLOUD_FIRE: diff --git a/crawl-ref/source/cloud.h b/crawl-ref/source/cloud.h index 9cd1ef249c..9bb5ba7f00 100644 --- a/crawl-ref/source/cloud.h +++ b/crawl-ref/source/cloud.h @@ -34,19 +34,30 @@ void delete_cloud( int cloud ); void move_cloud( int cloud, const coord_def& newpos ); void check_place_cloud( cloud_type cl_type, const coord_def& p, int lifetime, - kill_category whose, int spread_rate = -1 ); + kill_category whose, int spread_rate = -1, + int colour = -1, std::string name = "", + std::string tile = ""); void check_place_cloud( cloud_type cl_type, const coord_def& p, int lifetime, - killer_type killer, int spread_rate = -1 ); + killer_type killer, int spread_rate = -1, + int colour = -1, std::string name = "", + std::string tile = ""); void check_place_cloud( cloud_type cl_type, const coord_def& p, int lifetime, kill_category whose, killer_type killer, - int spread_rate = -1 ); + int spread_rate = -1, + int colour = -1, std::string name = "", + std::string tile = ""); void place_cloud( cloud_type cl_type, const coord_def& ctarget, - int cl_range, kill_category whose, int spread_rate = -1 ); + int cl_range, kill_category whose, int spread_rate = -1, + int colour = -1, std::string name = "", + std::string tile = ""); void place_cloud( cloud_type cl_type, const coord_def& ctarget, - int cl_range, killer_type killer, int spread_rate = -1 ); + int cl_range, killer_type killer, int spread_rate = -1, + int colour = -1, std::string name = "", + std::string tile = ""); void place_cloud( cloud_type cl_type, const coord_def& ctarget, int cl_range, kill_category whose, killer_type killer, - int spread_rate = -1 ); + int spread_rate = -1, int colour = -1, std::string name = "", + std::string tile = ""); void manage_clouds(void); @@ -61,6 +72,7 @@ int resist_fraction(int resist, int bonus_res = 0); int max_cloud_damage(cloud_type cl_type, int power = -1); void in_a_cloud(void); +std::string cloud_name(int cloudno); std::string cloud_name(cloud_type type); int get_cloud_colour(int cloudno); diff --git a/crawl-ref/source/dat/clua/lm_fog.lua b/crawl-ref/source/dat/clua/lm_fog.lua index 17b80e652e..ace95fec53 100644 --- a/crawl-ref/source/dat/clua/lm_fog.lua +++ b/crawl-ref/source/dat/clua/lm_fog.lua @@ -52,6 +52,10 @@ -- start_clouds: The number of clouds to lay when the level containing -- the cloud machine is entered. This is necessary since clouds -- are cleared when the player leaves a level. +-- colour: A string value with which to recolour the cloud. +-- name: A string value with which to rebrand (specifically, rename) the +-- cloud in question. +-- tile: A string value with which to retile the cloud. -- listener: A table with a function field called 'func'. Will be called -- whenever the countdown is activated, and whenever the fog -- machine is reset. It will be called with a reference to the table, @@ -100,6 +104,9 @@ function FogMachine:new(pars) m.size_max = pars.size_max or pars.size m.spread_rate = pars.spread_rate or -1 m.start_clouds = pars.start_clouds or 1 + m.colour = pars.colour or "" + m.name = pars.name or "" + m.tile = pars.tile or "" m.size_buildup_amnt = pars.size_buildup_amnt or 0 m.size_buildup_time = pars.size_buildup_time or 1 @@ -125,9 +132,10 @@ function FogMachine:new(pars) end function FogMachine:apply_cloud(point, pow_min, pow_max, pow_rolls, - size, cloud_type, kill_cat, spread) + size, cloud_type, kill_cat, spread, colour, + name, tile) dgn.apply_area_cloud(point.x, point.y, pow_min, pow_max, pow_rolls, size, - cloud_type, kill_cat, spread) + cloud_type, kill_cat, spread, colour, name, tile) end function FogMachine:do_fog(point) @@ -165,7 +173,8 @@ function FogMachine:do_fog(point) self:apply_cloud(p, self.pow_min, self.pow_max, self.pow_rolls, crawl.random_range(size_min, size_max, 1), - self.cloud_type, self.kill_cat, spread) + self.cloud_type, self.kill_cat, spread, self.colour, + self.name, self.tile) end function FogMachine:do_trigger(triggerer, marker, ev) @@ -225,6 +234,9 @@ function FogMachine:write(marker, th) file.marshall(th, self.spread_buildup_amnt) file.marshall(th, self.spread_buildup_time) file.marshall(th, self.buildup_turns) + file.marshall(th, self.colour) + file.marshall(th, self.name) + file.marshall(th, self.tile) end function FogMachine:read(marker, th) @@ -245,6 +257,9 @@ function FogMachine:read(marker, th) self.spread_buildup_amnt = file.unmarshall_number(th) self.spread_buildup_time = file.unmarshall_number(th) self.buildup_turns = file.unmarshall_number(th) + self.colour = file.unmarshall_string(th) + self.name = file.unmarshall_string(th) + self.tile = file.unmarshall_string(th) setmetatable(self, FogMachine) diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index 9807ec54dc..3b0a1262b3 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -3418,10 +3418,9 @@ static void _describe_cell(const coord_def& where, bool in_range) if (env.cgrid(where) != EMPTY_CLOUD) { const int cloud_inspected = env.cgrid(where); - const cloud_type ctype = (cloud_type) env.cloud[cloud_inspected].type; mprf(MSGCH_EXAMINE, "There is a cloud of %s here.", - cloud_name(ctype).c_str()); + cloud_name(cloud_inspected).c_str()); cloud_described = true; } diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index e1a8083ef3..c3eb240a16 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -257,9 +257,13 @@ struct cloud_struct unsigned char spread_rate; kill_category whose; killer_type killer; + int colour; + std::string name; + std::string tile; cloud_struct() : pos(), type(CLOUD_NONE), decay(0), spread_rate(0), - whose(KC_OTHER), killer(KILL_NONE) + whose(KC_OTHER), killer(KILL_NONE), colour(-1), + name(""), tile("") { } diff --git a/crawl-ref/source/l_dgn.cc b/crawl-ref/source/l_dgn.cc index 99035d37f0..dddb216da4 100644 --- a/crawl-ref/source/l_dgn.cc +++ b/crawl-ref/source/l_dgn.cc @@ -1173,14 +1173,16 @@ static int lua_cloud_pow_rolls; static int make_a_lua_cloud(coord_def where, int garbage, int spread_rate, cloud_type ctype, kill_category whose, - killer_type killer) + killer_type killer, int colour, std::string name, + std::string tile) { UNUSED( garbage ); const int pow = random_range(lua_cloud_pow_min, lua_cloud_pow_max, lua_cloud_pow_rolls); - place_cloud( ctype, where, pow, whose, killer, spread_rate ); + place_cloud( ctype, where, pow, whose, killer, spread_rate, colour, name, + tile ); return 1; } @@ -1200,6 +1202,10 @@ static int dgn_apply_area_cloud(lua_State *ls) const int spread_rate = lua_isnumber(ls, 9) ? luaL_checkint(ls, 9) : -1; + const int colour = lua_isstring(ls, 10) ? str_to_colour(luaL_checkstring(ls, 10)) : -1; + std::string name = lua_isstring(ls, 11) ? luaL_checkstring(ls, 11) : ""; + std::string tile = lua_isstring(ls, 12) ? luaL_checkstring(ls, 12) : ""; + if (!in_bounds(x, y)) { char buf[80]; @@ -1265,7 +1271,7 @@ static int dgn_apply_area_cloud(lua_State *ls) apply_area_cloud(make_a_lua_cloud, coord_def(x, y), 0, size, ctype, kc, cloud_struct::whose_to_killer(kc), - spread_rate); + spread_rate, colour, name, tile); return (0); } @@ -1282,6 +1288,10 @@ static int dgn_place_cloud(lua_State *ls) const int spread_rate = lua_isnumber(ls, 6) ? luaL_checkint(ls, 6) : -1; + const int colour = lua_isstring(ls, 7) ? str_to_colour(luaL_checkstring(ls, 7)) : -1; + std::string name = lua_isstring(ls, 8) ? luaL_checkstring(ls, 8) : ""; + std::string tile = lua_isstring(ls, 9) ? luaL_checkstring(ls, 9) : ""; + if (!in_bounds(x, y)) { char buf[80]; @@ -1315,7 +1325,7 @@ static int dgn_place_cloud(lua_State *ls) return (0); } - place_cloud(ctype, coord_def(x, y), cl_range, kc, spread_rate); + place_cloud(ctype, coord_def(x, y), cl_range, kc, spread_rate, colour, name, tile); return (0); } diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 3312bfcf94..b5c9e6bb40 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -2889,14 +2889,15 @@ bool i_feel_safe(bool announce, bool want_move, bool just_monsters, int range) // check clouds if (in_bounds(you.pos()) && env.cgrid(you.pos()) != EMPTY_CLOUD) { - const cloud_type type = env.cloud[env.cgrid(you.pos())].type; + const int cloudidx = env.cgrid(you.pos()); + const cloud_type type = env.cloud[cloudidx].type; if (is_damaging_cloud(type, want_move)) { if (announce) { mprf(MSGCH_WARN, "You're standing in a cloud of %s!", - cloud_name(type).c_str()); + cloud_name(cloudidx).c_str()); } return (false); } diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index e7e54c63d6..f16b6742c6 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -165,7 +165,7 @@ bool move_player_to_grid( const coord_def& p, bool stepped, bool allow_shift, { std::string prompt = make_stringf( "Really step into that cloud of %s?", - cloud_name(ctype).c_str()); + cloud_name(cloud).c_str()); if (!yesno(prompt.c_str(), false, 'n')) { diff --git a/crawl-ref/source/show.cc b/crawl-ref/source/show.cc index d6c3ff577a..c37901d7e0 100644 --- a/crawl-ref/source/show.cc +++ b/crawl-ref/source/show.cc @@ -273,8 +273,7 @@ void show_def::_update_cloud(int cloudno) grid(e).colour = which_colour; #ifdef USE_TILE - tile_place_cloud(e.x, e.y, env.cloud[cloudno].type, - env.cloud[cloudno].decay); + tile_place_cloud(e.x, e.y, env.cloud[cloudno]); #endif } diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index 647077f2f4..f6dd4009a3 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -661,29 +661,32 @@ bool stinking_cloud( int pow, bolt &beem ) int cast_big_c(int pow, cloud_type cty, kill_category whose, bolt &beam) { - big_cloud( cty, whose, beam.target, pow, 8 + random2(3) ); + big_cloud( cty, whose, beam.target, pow, 8 + random2(3), -1 ); return (1); } void big_cloud(cloud_type cl_type, kill_category whose, - const coord_def& where, int pow, int size, int spread_rate) + const coord_def& where, int pow, int size, int spread_rate, + int colour, std::string name, std::string tile) { big_cloud(cl_type, whose, cloud_struct::whose_to_killer(whose), - where, pow, size, spread_rate); + where, pow, size, spread_rate, colour, name, tile); } void big_cloud(cloud_type cl_type, killer_type killer, - const coord_def& where, int pow, int size, int spread_rate) + const coord_def& where, int pow, int size, int spread_rate, + int colour, std::string name, std::string tile) { big_cloud(cl_type, cloud_struct::killer_to_whose(killer), killer, - where, pow, size, spread_rate); + where, pow, size, spread_rate, colour, name, tile); } void big_cloud(cloud_type cl_type, kill_category whose, killer_type killer, - const coord_def& where, int pow, int size, int spread_rate) + const coord_def& where, int pow, int size, int spread_rate, + int colour, std::string name, std::string tile) { apply_area_cloud(make_a_normal_cloud, where, pow, size, - cl_type, whose, killer, spread_rate); + cl_type, whose, killer, spread_rate, colour, name, tile); } static bool _mons_hostile(const monsters *mon) diff --git a/crawl-ref/source/spells1.h b/crawl-ref/source/spells1.h index 8368947f03..b342b71684 100644 --- a/crawl-ref/source/spells1.h +++ b/crawl-ref/source/spells1.h @@ -21,11 +21,14 @@ void remove_divine_stamina(); bool cast_vitalisation(); void big_cloud(cloud_type cl_type, kill_category whose, const coord_def& where, - int pow, int size, int spread_rate = -1); + int pow, int size, int spread_rate = -1, int colour = -1, + std::string name = "", std::string tile = ""); void big_cloud(cloud_type cl_type, killer_type killer, const coord_def& where, - int pow, int size, int spread_rate = -1); + int pow, int size, int spread_rate = -1, int colour = -1, + std::string name = "", std::string tile = ""); void big_cloud(cloud_type cl_type, kill_category whose, killer_type killer, - const coord_def& where, int pow, int size, int spread_rate = -1); + const coord_def& where, int pow, int size, int spread_rate = -1, + int colour = -1, std::string name = "", std::string tile = ""); int blink(int pow, bool high_level_controlled_blink, bool wizard_blink = false); diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index 6819599ee5..6fbb55f399 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -879,14 +879,15 @@ void cast_dispersal(int pow) int make_a_normal_cloud(coord_def where, int pow, int spread_rate, cloud_type ctype, kill_category whose, - killer_type killer) + killer_type killer, int colour, std::string name, + std::string tile) { if (killer == KILL_NONE) killer = cloud_struct::whose_to_killer(whose); place_cloud( ctype, where, (3 + random2(pow / 4) + random2(pow / 4) + random2(pow / 4)), - whose, killer, spread_rate ); + whose, killer, spread_rate, colour, name, tile ); return 1; } diff --git a/crawl-ref/source/spells4.h b/crawl-ref/source/spells4.h index fbadac0203..cd977e3d01 100644 --- a/crawl-ref/source/spells4.h +++ b/crawl-ref/source/spells4.h @@ -16,7 +16,8 @@ struct bolt; bool backlight_monsters(coord_def where, int pow, int garbage); int make_a_normal_cloud(coord_def where, int pow, int spread_rate, cloud_type ctype, kill_category, - killer_type killer = KILL_NONE); + killer_type killer = KILL_NONE, int colour = -1, + std::string name = "", std::string tile = ""); int disperse_monsters(coord_def where, int pow); void remove_condensation_shield(); diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc index 2f32ea67e1..75d7264e07 100644 --- a/crawl-ref/source/spl-util.cc +++ b/crawl-ref/source/spl-util.cc @@ -73,7 +73,8 @@ static struct spell_desc *_seekspell(spell_type spellid); static bool _cloud_helper(cloud_func func, const coord_def& where, int pow, int spread_rate, cloud_type ctype, kill_category whose, - killer_type killer); + killer_type killer, int colour, + std::string name, std::string tile); // // BEGIN PUBLIC FUNCTIONS @@ -677,13 +678,14 @@ int apply_area_within_radius(cell_func cf, const coord_def& where, void apply_area_cloud( cloud_func func, const coord_def& where, int pow, int number, cloud_type ctype, kill_category whose, killer_type killer, - int spread_rate ) + int spread_rate, int colour, std::string name, + std::string tile) { int good_squares = 0; int neighbours[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; if (number && _cloud_helper(func, where, pow, spread_rate, ctype, whose, - killer)) + killer, colour, name, tile)) number--; if (number == 0) @@ -703,7 +705,8 @@ void apply_area_cloud( cloud_func func, const coord_def& where, { const int aux = arrs[m][i]; if ( _cloud_helper(func, where + Compass[aux], - pow, spread_rate, ctype, whose, killer)) + pow, spread_rate, ctype, whose, killer, colour, + name, tile)) { number--; good_squares++; @@ -729,7 +732,7 @@ void apply_area_cloud( cloud_func func, const coord_def& where, number -= spread; good_squares--; apply_area_cloud(func, where + Compass[j], pow, spread, ctype, whose, - killer, spread_rate); + killer, spread_rate, colour, name, tile); } } @@ -893,11 +896,13 @@ bool is_valid_spell(spell_type spell) static bool _cloud_helper(cloud_func func, const coord_def& where, int pow, int spread_rate, cloud_type ctype, kill_category whose, - killer_type killer) + killer_type killer, int colour, std::string name, + std::string tile) { if (!feat_is_solid(grd(where)) && env.cgrid(where) == EMPTY_CLOUD) { - func(where, pow, spread_rate, ctype, whose, killer); + func(where, pow, spread_rate, ctype, whose, killer, colour, name, + tile); return (true); } diff --git a/crawl-ref/source/spl-util.h b/crawl-ref/source/spl-util.h index 8ff8e4ceeb..eb44f4db07 100644 --- a/crawl-ref/source/spl-util.h +++ b/crawl-ref/source/spl-util.h @@ -80,7 +80,8 @@ const char* spelltype_long_name( int which_spelltype ); typedef int cell_func(coord_def where, int pow, int aux, actor *agent); typedef int cloud_func(coord_def where, int pow, int spreadrate, cloud_type type, kill_category whose, - killer_type killer); + killer_type killer, int colour, std::string name, + std::string tile); int apply_area_visible(cell_func cf, int power, bool pass_through_trans = false, actor *agent = NULL); @@ -104,7 +105,8 @@ int apply_area_within_radius(cell_func cf, const coord_def& where, void apply_area_cloud(cloud_func func, const coord_def& where, int pow, int number, cloud_type ctype, kill_category kc, killer_type killer, - int spread_rate = -1); + int spread_rate = -1, int colour = -1, + std::string name = "", std::string tile = ""); bool spell_direction( dist &spelld, bolt &pbolt, targetting_type restrict = DIR_NONE, diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index c092062c23..8a90a4ee00 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -1803,6 +1803,9 @@ static void tag_construct_level(writer &th) marshallByte(th, (char) env.cloud[i].spread_rate); marshallByte(th, env.cloud[i].whose); marshallByte(th, env.cloud[i].killer); + marshallShort(th, env.cloud[i].colour); + marshallString(th, env.cloud[i].name); + marshallString(th, env.cloud[i].tile); } // how many shops? @@ -2201,6 +2204,9 @@ static void tag_read_level( reader &th, char minorVersion ) env.cloud[i].spread_rate = (unsigned char) unmarshallByte(th); env.cloud[i].whose = static_cast(unmarshallByte(th)); env.cloud[i].killer = static_cast(unmarshallByte(th)); + env.cloud[i].colour = unmarshallShort(th); + env.cloud[i].name = unmarshallString(th); + env.cloud[i].tile = unmarshallString(th); } // how many shops? diff --git a/crawl-ref/source/tags.h b/crawl-ref/source/tags.h index e7877dfd6f..3ecacbbcd1 100644 --- a/crawl-ref/source/tags.h +++ b/crawl-ref/source/tags.h @@ -40,7 +40,7 @@ enum tag_file_type // file types supported by tag system enum tag_major_version { TAG_MAJOR_START = 5, - TAG_MAJOR_VERSION = 11 + TAG_MAJOR_VERSION = 12 }; // Minor version will be reset to zero when major version changes. diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc index 36b3e5014c..34cbf7eb7f 100644 --- a/crawl-ref/source/tilepick.cc +++ b/crawl-ref/source/tilepick.cc @@ -2649,64 +2649,89 @@ int tileidx_feature(dungeon_feature_type feat, int gx, int gy) } } -static int _tileidx_cloud(int type, int decay) +static int _tileidx_cloud(cloud_struct cl) { + int type = cl.type; + int decay = cl.decay; + std::string override = cl.tile; + int colour = cl.colour; + int ch = TILE_ERROR; int dur = decay/20; if (dur > 2) dur = 2; - switch (type) + if (!override.empty()) { - case CLOUD_FIRE: - ch = TILE_CLOUD_FIRE_0 + dur; - break; + unsigned int index; + if (!tile_main_index(override.c_str(), index)) + { + mprf(MSGCH_ERROR, "Invalid tile requested for cloud: '%s'.", override.c_str()); + } + else + { + int offset = tile_main_count(index); + ch = index + offset; + } + } + else + { + switch (type) + { + case CLOUD_FIRE: + ch = TILE_CLOUD_FIRE_0 + dur; + break; - case CLOUD_COLD: - ch = TILE_CLOUD_COLD_0 + dur; - break; + case CLOUD_COLD: + ch = TILE_CLOUD_COLD_0 + dur; + break; - case CLOUD_STINK: - case CLOUD_POISON: - ch = TILE_CLOUD_POISON_0 + dur; - break; + case CLOUD_STINK: + case CLOUD_POISON: + ch = TILE_CLOUD_POISON_0 + dur; + break; - case CLOUD_BLUE_SMOKE: - ch = TILE_CLOUD_BLUE_SMOKE; - break; + case CLOUD_BLUE_SMOKE: + ch = TILE_CLOUD_BLUE_SMOKE; + break; - case CLOUD_PURPLE_SMOKE: - case CLOUD_TLOC_ENERGY: - ch = TILE_CLOUD_TLOC_ENERGY; - break; + case CLOUD_PURPLE_SMOKE: + case CLOUD_TLOC_ENERGY: + ch = TILE_CLOUD_TLOC_ENERGY; + break; - case CLOUD_MIASMA: - ch = TILE_CLOUD_MIASMA; - break; + case CLOUD_MIASMA: + ch = TILE_CLOUD_MIASMA; + break; - case CLOUD_BLACK_SMOKE: - ch = TILE_CLOUD_BLACK_SMOKE; - break; + case CLOUD_BLACK_SMOKE: + ch = TILE_CLOUD_BLACK_SMOKE; + break; - case CLOUD_MUTAGENIC: - ch = (dur == 0 ? TILE_CLOUD_MUTAGENIC_0 : - dur == 1 ? TILE_CLOUD_MUTAGENIC_1 - : TILE_CLOUD_MUTAGENIC_2); - ch += random2(tile_main_count(ch)); - break; + case CLOUD_MUTAGENIC: + ch = (dur == 0 ? TILE_CLOUD_MUTAGENIC_0 : + dur == 1 ? TILE_CLOUD_MUTAGENIC_1 + : TILE_CLOUD_MUTAGENIC_2); + ch += random2(tile_main_count(ch)); + break; - case CLOUD_MIST: - ch = TILE_CLOUD_MIST; - break; + case CLOUD_MIST: + ch = TILE_CLOUD_MIST; + break; - case CLOUD_RAIN: - ch = TILE_CLOUD_RAIN + random2(tile_main_count(TILE_CLOUD_RAIN)); - break; + case CLOUD_RAIN: + ch = TILE_CLOUD_RAIN + random2(tile_main_count(TILE_CLOUD_RAIN)); + break; - default: - ch = TILE_CLOUD_GREY_SMOKE; - break; + default: + ch = TILE_CLOUD_GREY_SMOKE; + break; + } } + + if (colour != -1) + ch = tile_main_coloured(ch, colour); + return (ch | TILE_FLAG_FLYING); } @@ -4852,9 +4877,9 @@ void tile_place_monster(int gx, int gy, int idx, bool foreground, bool detected) } } -void tile_place_cloud(int x, int y, int type, int decay) +void tile_place_cloud(int x, int y, cloud_struct cl) { - env.tile_fg[x][y] = _tileidx_cloud(type, decay); + env.tile_fg[x][y] = _tileidx_cloud(cl); } unsigned int num_tile_rays = 0; diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index 753ea5be30..82ed562c56 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -1541,10 +1541,8 @@ int DungeonRegion::handle_mouse(MouseEvent &event) const int cloudidx = env.cgrid(gc); if (cloudidx != EMPTY_CLOUD) { - cloud_type ctype = env.cloud[cloudidx].type; - std::string terrain_desc = desc; - desc = cloud_name(ctype); + desc = cloud_name(cloudidx); if (!terrain_desc.empty()) desc += "\n" + terrain_desc; @@ -1937,9 +1935,7 @@ bool DungeonRegion::update_alt_text(std::string &alt) const int cloudidx = env.cgrid(gc); if (cloudidx != EMPTY_CLOUD) { - cloud_type ctype = env.cloud[cloudidx].type; - - inf.prefix = "There is a cloud of " + cloud_name(ctype) + inf.prefix = "There is a cloud of " + cloud_name(cloudidx) + " here.$$"; } } diff --git a/crawl-ref/source/tiles.h b/crawl-ref/source/tiles.h index d938715e55..2f1028b72d 100644 --- a/crawl-ref/source/tiles.h +++ b/crawl-ref/source/tiles.h @@ -74,7 +74,7 @@ void tile_place_monster(int gx, int gy, int idx, bool foreground = true, bool detected = false); void tile_place_item(int x, int y, int idx); void tile_place_item_marker(int x, int y, int idx); -void tile_place_cloud(int x, int y, int type, int decay); +void tile_place_cloud(int x, int y, cloud_struct cl); void tile_place_ray(const coord_def& gc, bool in_range); void tile_draw_rays(bool resetCount); void tile_clear_buf(); diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc index 6893f64262..7f6bc68bc8 100644 --- a/crawl-ref/source/tutorial.cc +++ b/crawl-ref/source/tutorial.cc @@ -4440,7 +4440,7 @@ static void _tutorial_describe_cloud(int x, int y) if (ctype == CLOUD_NONE) return; - std::string cname = cloud_name(ctype); + std::string cname = cloud_name(env.cgrid(coord_def(x, y))); std::ostringstream ostr; -- cgit v1.2.3-54-g00ecf From 8b00e0051117ac616b658fddddfc61451aaf5e74 Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Sun, 27 Dec 2009 20:02:40 +0530 Subject: Reset tag minor version, since major version has been incremented (due). --- crawl-ref/source/tags.cc | 15 ++++++--------- crawl-ref/source/tags.h | 3 +-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index 8a90a4ee00..6d12c323ab 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -2236,16 +2236,13 @@ static void tag_read_level( reader &th, char minorVersion ) // Restore heightmap env.heightmap.reset(NULL); - if (_tag_minor_version >= TAG_MINOR_HEIGHTMAP) + const bool have_heightmap(unmarshallByte(th)); + if (have_heightmap) { - const bool have_heightmap(unmarshallByte(th)); - if (have_heightmap) - { - env.heightmap.reset(new grid_heightmap); - grid_heightmap &heightmap(*env.heightmap); - for (rectangle_iterator ri(0); ri; ++ri) - heightmap(*ri) = unmarshallShort(th); - } + env.heightmap.reset(new grid_heightmap); + grid_heightmap &heightmap(*env.heightmap); + for (rectangle_iterator ri(0); ri; ++ri) + heightmap(*ri) = unmarshallShort(th); } } diff --git a/crawl-ref/source/tags.h b/crawl-ref/source/tags.h index 3ecacbbcd1..f9c3959299 100644 --- a/crawl-ref/source/tags.h +++ b/crawl-ref/source/tags.h @@ -47,8 +47,7 @@ enum tag_major_version enum tag_minor_version { TAG_MINOR_RESET = 0, // Minor tags were reset - TAG_MINOR_HEIGHTMAP = 1, - TAG_MINOR_VERSION = 1 // Current version. (Keep equal to max.) + TAG_MINOR_VERSION = 0 // Current version. (Keep equal to max.) }; struct enum_info -- cgit v1.2.3-54-g00ecf From 21c3ed598c240e9ab0bcb856c6dc84d2cee11f99 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Sun, 27 Dec 2009 15:35:16 +0100 Subject: Use the old message for rain, "You are engulfed in the rain." is bad. --- crawl-ref/source/cloud.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc index bd5670b846..58eb185c97 100644 --- a/crawl-ref/source/cloud.cc +++ b/crawl-ref/source/cloud.cc @@ -813,7 +813,10 @@ void in_a_cloud() you.duration[DUR_MISLED] = 0; } - mprf("You are engulfed in %s.", !name.empty() ? name.c_str() : "the rain"); + if (name.empty() || name == "the rain") + mpr("You are standing in the rain."); + else + mprf("You are engulfed in %s.", name.c_str()); break; -- cgit v1.2.3-54-g00ecf From caad029e611bb2eeedcab049d624a9e2be4e0dd5 Mon Sep 17 00:00:00 2001 From: Vsevolod Kozlov Date: Sun, 27 Dec 2009 18:21:20 +0300 Subject: Unify wizard_create_feature_{name,number}. It works fine, but it does not show the verbose message about placing the feature, as wizard_create_feature_name used to. (This doesn't seem very necessary since debug-mode 'x' tends to give enough information.) --- crawl-ref/source/main.cc | 4 +- crawl-ref/source/wiz-dgn.cc | 91 ++++++++++++++++++--------------------------- crawl-ref/source/wiz-dgn.h | 3 +- 3 files changed, 39 insertions(+), 59 deletions(-) diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc index c1b4c6d615..9dcd774a00 100644 --- a/crawl-ref/source/main.cc +++ b/crawl-ref/source/main.cc @@ -533,8 +533,8 @@ static void _do_wizard_command(int wiz_command, bool silent_fail) case 'I': wizard_unidentify_pack(); break; case 'Z': case 'z': wizard_cast_spec_spell(); break; - case '(': wizard_create_feature_number(); break; - case ')': wizard_create_feature_name(); break; + case '(': + case ')': wizard_create_feature(); break; case ':': wizard_list_branches(); break; case '{': wizard_map_level(); break; case '}': wizard_reveal_traps(); break; diff --git a/crawl-ref/source/wiz-dgn.cc b/crawl-ref/source/wiz-dgn.cc index ea55dc9e56..8251e6c76e 100644 --- a/crawl-ref/source/wiz-dgn.cc +++ b/crawl-ref/source/wiz-dgn.cc @@ -269,70 +269,53 @@ void wizard_create_portal() } } -void wizard_create_feature_number() +void wizard_create_feature() { char specs[256]; int feat_num; - mpr("Create which feature (by number)? ", MSGCH_PROMPT); + dungeon_feature_type feat; + mpr("Create which feature? ", MSGCH_PROMPT); - if (!cancelable_get_line(specs, sizeof(specs)) - && (feat_num = atoi(specs))) + if (!cancelable_get_line(specs, sizeof(specs)) && specs[0] != 0) { - dungeon_feature_type feat = static_cast(feat_num); - if (feat == DNGN_ENTER_SHOP) + if ((feat_num = atoi(specs))) { - debug_make_shop(); - return; + feat = static_cast(feat_num); } - - dungeon_terrain_changed(you.pos(), feat, false); -#ifdef USE_TILE - env.tile_flv(you.pos()).special = 0; -#endif - } - else - canned_msg(MSG_OK); -} - -void wizard_create_feature_name() -{ - char specs[256]; - mpr("Create which feature (by name)? ", MSGCH_PROMPT); - if (!cancelable_get_line(specs, sizeof(specs)) && specs[0] != 0) - { - // Accept both "shallow_water" and "Shallow water" - std::string name = lowercase_string(specs); - name = replace_all(name, " ", "_"); - - dungeon_feature_type feat = dungeon_feature_by_name(name); - if (feat == DNGN_UNSEEN) // no exact match + else { - std::vector matches = dungeon_feature_matches(name); - - if (matches.empty()) + std::string name = lowercase_string(specs); + name = replace_all(name, " ", "_"); + feat = dungeon_feature_by_name(name); + if (feat == DNGN_UNSEEN) // no exact match { - mprf(MSGCH_DIAGNOSTICS, "No features matching '%s'", - name.c_str()); - return; - } + std::vector matches = dungeon_feature_matches(name); - // Only one possible match, use that. - if (matches.size() == 1) - { - name = matches[0]; - feat = dungeon_feature_by_name(name); - } - // Multiple matches, list them to wizard - else - { - std::string prefix = "No exact match for feature '" + - name + "', possible matches are: "; + if (matches.empty()) + { + mprf(MSGCH_DIAGNOSTICS, "No features matching '%s'", + name.c_str()); + return; + } - // Use mpr_comma_separated_list() because the list - // might be *LONG*. - mpr_comma_separated_list(prefix, matches, " and ", ", ", - MSGCH_DIAGNOSTICS); - return; + // Only one possible match, use that. + if (matches.size() == 1) + { + name = matches[0]; + feat = dungeon_feature_by_name(name); + } + // Multiple matches, list them to wizard + else + { + std::string prefix = "No exact match for feature '" + + name + "', possible matches are: "; + + // Use mpr_comma_separated_list() because the list + // might be *LONG*. + mpr_comma_separated_list(prefix, matches, " and ", ", ", + MSGCH_DIAGNOSTICS); + return; + } } } @@ -342,8 +325,6 @@ void wizard_create_feature_name() return; } - mprf(MSGCH_DIAGNOSTICS, "Setting (%d,%d) to %s (%d)", - you.pos().x, you.pos().y, name.c_str(), feat); dungeon_terrain_changed(you.pos(), feat, false); #ifdef USE_TILE env.tile_flv(you.pos()).special = 0; diff --git a/crawl-ref/source/wiz-dgn.h b/crawl-ref/source/wiz-dgn.h index c8561dcb1f..3db62ceb1b 100644 --- a/crawl-ref/source/wiz-dgn.h +++ b/crawl-ref/source/wiz-dgn.h @@ -10,8 +10,7 @@ #include void wizard_create_portal(); -void wizard_create_feature_number(); -void wizard_create_feature_name(); +void wizard_create_feature(); void wizard_list_branches(); void wizard_reveal_traps(); void wizard_map_level(); -- cgit v1.2.3-54-g00ecf From fa0307d3451bef981c807759f956b0de01d5485f Mon Sep 17 00:00:00 2001 From: Vsevolod Kozlov Date: Sun, 27 Dec 2009 18:23:31 +0300 Subject: dungeon.cc: Kill a small piece of code duplication in special room handling. Hopefully I've got the logic inversion right... --- crawl-ref/source/dungeon.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index c5f6a788ca..61b09b2717 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -7346,12 +7346,11 @@ static void _roguey_level(int level_number, spec_room &sr, bool make_stairs) // Is one of them a special room? const map_def *sroom = NULL; -#ifdef DEBUG_SPECIAL_ROOMS - if ((sroom = random_map_for_tag("special_room", true)) != NULL) -#else - if (one_chance_in(10) - && (sroom = random_map_for_tag("special_room", true)) != NULL) + if ( +#ifndef DEBUG_SPECIAL_ROOMS + one_chance_in(10) && #endif + (sroom = random_map_for_tag("special_room", true)) != NULL) { int spec_room_done = random2(25); -- cgit v1.2.3-54-g00ecf From 2be5d5f08528b99817be0cf6fe8c04bab40842ec Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Sun, 27 Dec 2009 16:37:34 +0100 Subject: Untie disarm confirmations from autotravel settings (Mantis 254). Since it is done only on an explicit request, copious safety margins are not needed. I didn't provide an alternate way to disable the confirmation, but since the danger is now always real, I don't think that's needed. --- crawl-ref/source/trap_def.h | 1 + crawl-ref/source/traps.cc | 37 ++++++++++++++++++++++++++----------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/crawl-ref/source/trap_def.h b/crawl-ref/source/trap_def.h index 90c2cc4372..2ec924d3b4 100644 --- a/crawl-ref/source/trap_def.h +++ b/crawl-ref/source/trap_def.h @@ -18,6 +18,7 @@ struct trap_def void prepare_ammo(); bool type_has_ammo() const; bool active() const; + int max_damage(const actor& act); private: void message_trap_entry(); diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc index e2dcd625ea..9083576b6e 100644 --- a/crawl-ref/source/traps.cc +++ b/crawl-ref/source/traps.cc @@ -677,7 +677,7 @@ void trap_def::trigger(actor& triggerer, bool flat_footed) this->destroy(); } -int trap_def::shot_damage(actor& act) +int trap_def::max_damage(const actor& act) { int level = you.your_level; @@ -691,17 +691,27 @@ int trap_def::shot_damage(actor& act) switch (this->type) { case TRAP_NEEDLE: return 0; - case TRAP_DART: return random2( 4 + level/2) + 1; - case TRAP_ARROW: return random2( 7 + level) + 1; - case TRAP_SPEAR: return random2(10 + level) + 1; - case TRAP_BOLT: return random2(13 + level) + 1; - case TRAP_AXE: return random2(15 + level) + 1; + case TRAP_DART: return 4 + level/2; + case TRAP_ARROW: return 7 + level; + case TRAP_SPEAR: return 10 + level; + case TRAP_BOLT: return 13 + level; + case TRAP_AXE: return 15 + level; default: return 0; + case TRAP_BLADE: return (level ? level*2 : 10) + 28; } return (0); } +int trap_def::shot_damage(actor& act) +{ + const int dam = max_damage(act); + + if (!dam) + return 0; + return random2(dam) + 1; +} + int reveal_traps(const int range) { int traps_found = 0; @@ -746,6 +756,15 @@ trap_type get_trap_type(const coord_def& pos) return (TRAP_UNASSIGNED); } +static bool _disarm_is_deadly(trap_def& trap) +{ + int dam = trap.max_damage(you); + if (trap.type == TRAP_NEEDLE && you.res_poison() <= 0) + dam += 15; // arbitrary + + return you.hp <= dam; +} + // where *must* point to a valid, discovered trap. void disarm_trap(const coord_def& where) { @@ -770,11 +789,8 @@ void disarm_trap(const coord_def& where) break; } -#ifdef CLUA_BINDINGS // Prompt for any trap for which you might not survive setting it off. - // (See trapwalk.lua) - if (Options.trap_prompt - && !clua.callbooleanfn(false, "ch_cross_trap", "s", trap_name(where))) + if (_disarm_is_deadly(trap)) { std::string prompt = make_stringf( "Really try disarming that %s?", @@ -789,7 +805,6 @@ void disarm_trap(const coord_def& where) return; } } -#endif // Make the actual attempt you.turn_is_over = true; -- cgit v1.2.3-54-g00ecf From 76b76949fb3f6fe4c1e735f0b1d9ef72ae4a6a68 Mon Sep 17 00:00:00 2001 From: Vsevolod Kozlov Date: Sun, 27 Dec 2009 18:43:04 +0300 Subject: Don't show normal teleport messages on wizard teleports. The "You may choose your destination..." and "Expect minor deviation" messages are lost due to the absence of the more prompt on wizard teleports, and arrive after the teleport, which is more annoying than not at all. --- crawl-ref/source/spells3.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 26747c1f07..3a7f8130e1 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -1528,13 +1528,15 @@ static bool _teleport_player(bool allow_control, bool new_abyss_area, bool wizar if (is_controlled) { - mpr("You may choose your destination (press '.' or delete to select)."); - mpr("Expect minor deviation."); check_ring_TC = true; - // Only have the more prompt for non-wizard. + // Only have the messages and the more prompt for non-wizard. if (!wizard_tele) + { + mpr("You may choose your destination (press '.' or delete to select)."); + mpr("Expect minor deviation."); more(); + } while (true) { -- cgit v1.2.3-54-g00ecf From 507c3523d54cd2c15185f06f8be1f1ea353497d8 Mon Sep 17 00:00:00 2001 From: Vsevolod Kozlov Date: Sun, 27 Dec 2009 19:00:10 +0300 Subject: Make item_is_critical a method of item_def. --- crawl-ref/source/externs.h | 3 +++ crawl-ref/source/itemprop.cc | 15 --------------- crawl-ref/source/itemprop.h | 3 --- crawl-ref/source/items.cc | 15 +++++++++++++++ crawl-ref/source/terrain.cc | 2 +- crawl-ref/source/xom.cc | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index c3eb240a16..cf2b98d8d0 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -533,6 +533,9 @@ public: bool is_valid() const; + // Returns true if this item should be preserved as far as possible. + bool is_critical() const; + private: std::string name_aux(description_level_type desc, bool terse, bool ident, diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index 720dfff844..ee8e022c63 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -567,21 +567,6 @@ bool item_ident( const item_def &item, unsigned long flags ) return ((item.flags & flags) == flags); } -// The Orb of Zot and unique runes are considered critical. -bool item_is_critical(const item_def &item) -{ - if (!item.is_valid()) - return (false); - - if (item.base_type == OBJ_ORBS) - return (true); - - return (item.base_type == OBJ_MISCELLANY - && item.sub_type == MISC_RUNE_OF_ZOT - && item.plus != RUNE_DEMONIC - && item.plus != RUNE_ABYSSAL); -} - // Is item something that no one would usually bother enchanting? bool item_is_mundane(const item_def &item) { diff --git a/crawl-ref/source/itemprop.h b/crawl-ref/source/itemprop.h index a8f1eceabd..3a38fdb35b 100644 --- a/crawl-ref/source/itemprop.h +++ b/crawl-ref/source/itemprop.h @@ -14,9 +14,6 @@ struct bolt; void init_properties(void); -// Returns true if this item should be preserved as far as possible. -bool item_is_critical(const item_def &item); - // Returns true if this item should not normally be enchanted. bool item_is_mundane(const item_def &item); diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index a3418761d4..fa2b57fdea 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -2919,6 +2919,21 @@ bool item_def::is_valid() const return (base_type != OBJ_UNASSIGNED && quantity > 0); } +// The Orb of Zot and unique runes are considered critical. +bool item_def::is_critical() const +{ + if (!is_valid()) + return (false); + + if (base_type == OBJ_ORBS) + return (true); + + return (base_type == OBJ_MISCELLANY + && sub_type == MISC_RUNE_OF_ZOT + && plus != RUNE_DEMONIC + && plus != RUNE_ABYSSAL); +} + static void _rune_from_specs(const char* _specs, item_def &item) { char specs[80]; diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc index 05b3033e8e..9b2fe96deb 100644 --- a/crawl-ref/source/terrain.cc +++ b/crawl-ref/source/terrain.cc @@ -664,7 +664,7 @@ static void _dgn_check_terrain_items(const coord_def &pos, bool preserve_items) item = mitm[item].link; // Game-critical item. - if (preserve_items || item_is_critical(mitm[curr])) + if (preserve_items || mitm[curr].is_critical()) _dgn_shift_item(pos, mitm[curr]); else { diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index a2c7a4d227..4f01f1145a 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -2308,7 +2308,7 @@ static void _xom_zero_miscast() { const item_def &item(you.inv[i]); if (item.is_valid() && !item_is_equipped(item) - && !item_is_critical(item)) + && !item.is_critical()) { inv_items.push_back(i); } -- cgit v1.2.3-54-g00ecf From dc3e12a4da48363a7cadb77f30b8e784d5f82acf Mon Sep 17 00:00:00 2001 From: Vsevolod Kozlov Date: Sun, 27 Dec 2009 19:25:32 +0300 Subject: Replace uses of item_cursed with item_def::cursed. --- crawl-ref/source/delay.cc | 2 +- crawl-ref/source/fight.cc | 4 ++-- crawl-ref/source/food.cc | 4 ++-- crawl-ref/source/invent.cc | 2 +- crawl-ref/source/item_use.cc | 42 +++++++++++++++++++++--------------------- crawl-ref/source/itemname.cc | 10 +++++----- crawl-ref/source/itemprop.cc | 9 ++------- crawl-ref/source/itemprop.h | 1 - crawl-ref/source/items.cc | 4 ++-- crawl-ref/source/l_item.cc | 2 +- crawl-ref/source/makeitem.cc | 2 +- crawl-ref/source/mon-stuff.cc | 2 +- crawl-ref/source/monster.cc | 6 +++--- crawl-ref/source/player.cc | 2 +- crawl-ref/source/religion.cc | 2 +- crawl-ref/source/spells2.cc | 4 ++-- crawl-ref/source/spells3.cc | 4 ++-- crawl-ref/source/tilereg.cc | 4 ++-- crawl-ref/source/tilesdl.cc | 2 +- crawl-ref/source/transfor.cc | 2 +- crawl-ref/source/tutorial.cc | 4 ++-- crawl-ref/source/wiz-item.cc | 2 +- 22 files changed, 55 insertions(+), 61 deletions(-) diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index a3a6ca6d5d..56c166fdec 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -1564,7 +1564,7 @@ void armour_wear_effects(const int item_slot) use_artefact(arm, &show_msgs, melded); } - if (item_cursed(arm) && !melded) + if (arm.cursed() && !melded) { mpr("Oops, that feels deathly cold."); learned_something_new(TUT_YOU_CURSED); diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 1543ddabb1..b2237a92cb 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -374,7 +374,7 @@ void melee_attack::check_hand_half_bonus_eligible() && !can_do_unarmed && !shield && weapon - && !item_cursed(*weapon) + && !weapon->cursed() && hands == HANDS_HALF); } @@ -3832,7 +3832,7 @@ int melee_attack::player_to_hit(bool random_factor) && !can_do_unarmed && !shield && weapon - && !item_cursed( *weapon ) + && !weapon ->cursed() && hands == HANDS_HALF; int your_to_hit = 15 + (calc_stat_to_hit_base() / 2); diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 112f9e1739..bd2db8d728 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -377,7 +377,7 @@ static void _terminate_butchery(bool wpn_switch, bool removed_gloves, { // Switch weapon back. if (wpn_switch && you.equip[EQ_WEAPON] != old_weapon - && (!you.weapon() || !item_cursed(*you.weapon()))) + && (!you.weapon() || !you.weapon()->cursed())) { start_delay(DELAY_WEAPON_SWAP, 1, old_weapon); } @@ -479,7 +479,7 @@ bool butchery(int which_corpse) && !player_wearing_slot(EQ_GLOVES); bool gloved_butcher = (you.has_claws() && player_wearing_slot(EQ_GLOVES) - && !item_cursed(you.inv[you.equip[EQ_GLOVES]])); + && !you.inv[you.equip[EQ_GLOVES]].cursed()); bool can_butcher = (teeth_butcher || barehand_butcher || you.weapon() && can_cut_meat(*you.weapon())); diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 047a502467..887fbd436c 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -109,7 +109,7 @@ const std::string &InvEntry::get_fullname() const bool InvEntry::is_item_cursed() const { - return (item_ident(*item, ISFLAG_KNOW_CURSE) && item_cursed(*item)); + return (item_ident(*item, ISFLAG_KNOW_CURSE) && item->cursed()); } bool InvEntry::is_item_glowing() const diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 38bf295a7a..fd01008e25 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -112,7 +112,7 @@ bool can_wield(item_def *weapon, bool say_reason, if (!ignore_temporary_disability && you.weapon() && you.weapon()->base_type == OBJ_WEAPONS - && item_cursed(*you.weapon())) + && you.weapon()->cursed()) { SAY(mpr("You can't unwield your weapon to draw a new one!")); return (false); @@ -721,7 +721,7 @@ void wield_effects(int item_wield_2, bool showMsgs) } } - if (item_cursed(item)) + if (item.cursed()) { mpr("It sticks to your hand!"); int amusement = 16; @@ -1059,7 +1059,7 @@ bool do_wear_armour(int item, bool quiet) && you.equip[EQ_CLOAK] != -1 && !cloak_is_being_removed()) { if (you.equip[EQ_BODY_ARMOUR] != -1 - && item_cursed(you.inv[you.equip[EQ_BODY_ARMOUR]])) + && you.inv[you.equip[EQ_BODY_ARMOUR]].cursed()) { if (!quiet) { @@ -1069,7 +1069,7 @@ bool do_wear_armour(int item, bool quiet) } return (false); } - if (!item_cursed(you.inv[you.equip[EQ_CLOAK]])) + if (!you.inv[you.equip[EQ_CLOAK]].cursed()) { cloak = you.equip[EQ_CLOAK]; if (!takeoff_armour(you.equip[EQ_CLOAK])) @@ -1149,7 +1149,7 @@ bool takeoff_armour(int item) } // If we get here, we're wearing the item. - if (item_cursed(invitem)) + if (invitem.cursed()) { mprf("%s is stuck to your body!", invitem.name(DESC_CAP_YOUR).c_str()); return (false); @@ -1165,7 +1165,7 @@ bool takeoff_armour(int item) { if (you.equip[EQ_CLOAK] != -1 && !cloak_is_being_removed()) { - if (!item_cursed(you.inv[you.equip[EQ_CLOAK]])) + if (!you.inv[you.equip[EQ_CLOAK]].cursed()) { cloak = you.equip[ EQ_CLOAK ]; if (!takeoff_armour(you.equip[EQ_CLOAK])) @@ -1453,7 +1453,7 @@ static bool _fire_validate_item(int slot, std::string &err) { if (slot == you.equip[EQ_WEAPON] && you.inv[slot].base_type == OBJ_WEAPONS - && item_cursed(you.inv[slot])) + && you.inv[slot].cursed()) { err = "That weapon is stuck to your hand!"; return (false); @@ -3481,7 +3481,7 @@ void jewellery_wear_effects(item_def &item) set_ident_flags(item, ISFLAG_EQ_JEWELLERY_MASK); } - if (item_cursed(item)) + if (item.cursed()) { mprf("Oops, that %s feels deathly cold.", jewellery_is_amulet(item)? "amulet" : "ring"); @@ -3510,7 +3510,7 @@ static int _prompt_ring_to_remove(int new_ring) const item_def *left = you.slot_item(EQ_LEFT_RING); const item_def *right = you.slot_item(EQ_RIGHT_RING); - if (item_cursed(*left) && item_cursed(*right)) + if (left->cursed() && right->cursed()) { mprf("You're already wearing two cursed rings!"); return (-1); @@ -3730,7 +3730,7 @@ static bool _swap_rings(int ring_slot) const item_def* lring = you.slot_item(EQ_LEFT_RING); const item_def* rring = you.slot_item(EQ_RIGHT_RING); - if (item_cursed(*lring) && item_cursed(*rring)) + if (lring->cursed() && rring->cursed()) { mprf("You're already wearing two cursed rings!"); return (false); @@ -3744,7 +3744,7 @@ static bool _swap_rings(int ring_slot) && lring->plus2 == rring->plus2 && !is_artefact(*lring) && !is_artefact(*rring)) { - if (item_cursed(*lring)) + if (lring->cursed()) unwanted = you.equip[EQ_RIGHT_RING]; else unwanted = you.equip[EQ_LEFT_RING]; @@ -3811,7 +3811,7 @@ bool puton_item(int item_slot) if (!is_amulet) // i.e. it's a ring { const item_def* gloves = you.slot_item(EQ_GLOVES); - if (gloves && item_cursed(*gloves)) + if (gloves && gloves->cursed()) { mpr("You can't take your gloves off to put on a ring!"); return (false); @@ -4025,7 +4025,7 @@ bool remove_ring(int slot, bool announce) } if (you.equip[EQ_GLOVES] != -1 - && item_cursed( you.inv[you.equip[EQ_GLOVES]] ) + && you.inv[you.equip[EQ_GLOVES]] .cursed() && you.equip[EQ_AMULET] == -1) { mpr("You can't take your gloves off to remove any rings!"); @@ -4089,7 +4089,7 @@ bool remove_ring(int slot, bool announce) } if (you.equip[EQ_GLOVES] != -1 - && item_cursed( you.inv[you.equip[EQ_GLOVES]] ) + && you.inv[you.equip[EQ_GLOVES]] .cursed() && (hand_used == EQ_LEFT_RING || hand_used == EQ_RIGHT_RING)) { mpr("You can't take your gloves off to remove any rings!"); @@ -4102,7 +4102,7 @@ bool remove_ring(int slot, bool announce) return (false); } - if (item_cursed( you.inv[you.equip[hand_used]] )) + if (you.inv[you.equip[hand_used]] .cursed()) { if (announce) { @@ -4771,7 +4771,7 @@ bool enchant_weapon(enchant_stat_type which_stat, bool quiet, item_def &wpn) return (false); } - const bool is_cursed = item_cursed(wpn); + const bool is_cursed = wpn.cursed(); // Missiles only have one stat. if (wpn.base_type == OBJ_MISSILES) @@ -4882,7 +4882,7 @@ bool enchant_armour(int &ac_change, bool quiet, item_def &arm) return (false); } - const bool is_cursed = item_cursed(arm); + const bool is_cursed = arm.cursed(); // Turn hides into mails where applicable. // NOTE: It is assumed that armour which changes in this way does @@ -5355,7 +5355,7 @@ void read_scroll(int slot) case SCR_CURSE_WEAPON: if (!you.weapon() || you.weapon()->base_type != OBJ_WEAPONS - || item_cursed(*you.weapon())) + || you.weapon()->cursed()) { canned_msg(MSG_NOTHING_HAPPENS); id_the_scroll = false; @@ -5383,7 +5383,7 @@ void read_scroll(int slot) { item_def& wpn = *you.weapon(); - const bool is_cursed = item_cursed(wpn); + const bool is_cursed = wpn.cursed(); if (wpn.base_type != OBJ_WEAPONS && wpn.base_type != OBJ_MISSILES || !is_cursed @@ -5491,7 +5491,7 @@ void read_scroll(int slot) int affected = EQ_WEAPON; for (int i = EQ_CLOAK; i <= EQ_BODY_ARMOUR; i++) { - if (you.equip[i] != -1 && !item_cursed(you.inv[you.equip[i]])) + if (you.equip[i] != -1 && !you.inv[you.equip[i]].cursed()) { count++; if (one_chance_in(count)) @@ -5695,7 +5695,7 @@ void use_artefact(item_def &item, bool *show_msgs, bool unmeld) artefact_wpn_learn_prop(item, ARTP_BERSERK); } - if (!unmeld && !item_cursed(item) && proprt[ARTP_CURSED] > 0 + if (!unmeld && !item.cursed() && proprt[ARTP_CURSED] > 0 && one_chance_in(proprt[ARTP_CURSED])) { do_curse_item( item, false ); diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 8d487d2682..c8ce048107 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -1037,7 +1037,7 @@ std::string item_def::name_aux(description_level_type desc, // this behaviour, *please* make it so that there is an option // that maintains this behaviour. -- bwr // Nor for artefacts. Again, the state should be obvious. --jpeg - if (item_cursed(*this)) + if (cursed()) buff << "cursed "; else if (Options.show_uncursed && !know_pluses && (!know_type || !is_artefact(*this))) @@ -1108,7 +1108,7 @@ std::string item_def::name_aux(description_level_type desc, if (know_brand) buff << weapon_brand_name(*this, terse); - if (know_curse && item_cursed(*this) && terse) + if (know_curse && cursed() && terse) buff << " (curse)"; break; @@ -1197,7 +1197,7 @@ std::string item_def::name_aux(description_level_type desc, case OBJ_ARMOUR: if (know_curse && !terse) { - if (item_cursed(*this)) + if (cursed()) buff << "cursed "; else if (Options.show_uncursed && !know_pluses) buff << "uncursed "; @@ -1310,7 +1310,7 @@ std::string item_def::name_aux(description_level_type desc, } } - if (know_curse && item_cursed(*this) && terse) + if (know_curse && cursed() && terse) buff << " (curse)"; break; @@ -1462,7 +1462,7 @@ std::string item_def::name_aux(description_level_type desc, if (know_curse) { - if (item_cursed(*this)) + if (cursed()) buff << "cursed "; else if (Options.show_uncursed && !terse && (!is_randart || !know_type) diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index ee8e022c63..ea2f8bd7b3 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -457,11 +457,6 @@ void init_properties() // // Item cursed status functions: // -bool item_cursed( const item_def &item ) -{ - return (item.flags & ISFLAG_CURSED); -} - bool item_known_cursed( const item_def &item ) { return ((item.flags & ISFLAG_KNOW_CURSE) && (item.flags & ISFLAG_CURSED)); @@ -1195,7 +1190,7 @@ bool is_enchantable_weapon(const item_def &wpn, bool uncurse, bool first) || first && wpn.plus >= MAX_WPN_ENCHANT || !first && wpn.plus2 >= MAX_WPN_ENCHANT) { - return (uncurse && item_cursed(wpn)); + return (uncurse && wpn.cursed()); } } // Highly enchanted missiles, which have only one stat, cannot be @@ -1228,7 +1223,7 @@ bool is_enchantable_armour(const item_def &arm, bool uncurse, bool unknown) // Artefacts or highly enchanted armour cannot be enchanted, only // uncursed. if (is_artefact(arm) || arm.plus >= armour_max_enchant(arm)) - return (uncurse && item_cursed(arm)); + return (uncurse && arm.cursed()); return (true); } diff --git a/crawl-ref/source/itemprop.h b/crawl-ref/source/itemprop.h index 3a38fdb35b..99c861da67 100644 --- a/crawl-ref/source/itemprop.h +++ b/crawl-ref/source/itemprop.h @@ -18,7 +18,6 @@ void init_properties(void); bool item_is_mundane(const item_def &item); // cursed: -bool item_cursed( const item_def &item ); bool item_known_cursed( const item_def &item ); bool item_known_uncursed( const item_def &item ); void do_curse_item( item_def &item, bool quiet = true ); diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index fa2b57fdea..7543da8ea5 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -1921,7 +1921,7 @@ bool drop_item( int item_dropped, int quant_drop, bool try_offer ) if (item_dropped == you.equip[EQ_WEAPON] && you.inv[item_dropped].base_type == OBJ_WEAPONS - && item_cursed( you.inv[item_dropped] )) + && you.inv[item_dropped] .cursed()) { mpr("That object is stuck to you!"); return (false); @@ -2821,7 +2821,7 @@ int item_def::book_number() const bool item_def::cursed() const { - return (item_cursed(*this)); + return (flags & ISFLAG_CURSED); } bool item_def::launched_by(const item_def &launcher) const diff --git a/crawl-ref/source/l_item.cc b/crawl-ref/source/l_item.cc index c2248e1682..80bbc88df9 100644 --- a/crawl-ref/source/l_item.cc +++ b/crawl-ref/source/l_item.cc @@ -463,7 +463,7 @@ static int l_item_cursed(lua_State *ls) { LUA_ITEM(item, 1); bool cursed = item && item_ident(*item, ISFLAG_KNOW_CURSE) - && item_cursed(*item); + && item->cursed(); lua_pushboolean(ls, cursed); return (1); } diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index ee473f1a04..977198929d 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -2924,7 +2924,7 @@ static void _generate_jewellery_item(item_def& item, bool allow_uniques, if (item.sub_type == RING_SLAYING ) // requires plus2 too { - if (item_cursed(item) && !one_chance_in(20)) + if (item.cursed() && !one_chance_in(20)) item.plus2 = -1 - random2avg(6, 2); else { diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc index d8f0a8e7a2..730fb54ef2 100644 --- a/crawl-ref/source/mon-stuff.cc +++ b/crawl-ref/source/mon-stuff.cc @@ -198,7 +198,7 @@ bool curse_an_item( bool decay_potions, bool quiet ) || you.inv[i].base_type == OBJ_JEWELLERY || you.inv[i].base_type == OBJ_POTIONS) { - if (item_cursed( you.inv[i] )) + if (you.inv[i] .cursed()) continue; if (you.inv[i].base_type != OBJ_POTIONS diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index 4cefe30857..5285da7795 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -577,11 +577,11 @@ bool monsters::can_wield(const item_def& item, bool ignore_curse, if (!ignore_curse) { int num_cursed = 0; - if (weap1 && item_cursed(*weap1)) + if (weap1 && weap1->cursed()) num_cursed++; - if (weap2 && item_cursed(*weap2)) + if (weap2 && weap2->cursed()) num_cursed++; - if (_shield && item_cursed(*_shield)) + if (_shield && _shield->cursed()) num_cursed++; if (two_handed && num_cursed > 0 || num_cursed >= avail_slots) diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index f16b6742c6..04c1498297 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -5732,7 +5732,7 @@ bool player::can_wield(const item_def& item, bool ignore_curse, { if (equip[EQ_WEAPON] != -1 && !ignore_curse) { - if (item_cursed(inv[equip[EQ_WEAPON]])) + if (inv[equip[EQ_WEAPON]].cursed()) return (false); } diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 2524fbfcd5..763f1c0709 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -4230,7 +4230,7 @@ static bool _bless_weapon(god_type god, brand_type brand, int colour) set_item_ego_type(wpn, OBJ_WEAPONS, brand); wpn.colour = colour; - const bool is_cursed = item_cursed(wpn); + const bool is_cursed = wpn.cursed(); enchant_weapon(ENCHANT_TO_HIT, true, wpn); diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 4902786aa6..d765d4db5f 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -1101,7 +1101,7 @@ bool cast_sticks_to_snakes(int pow, god_type god) const int dur = std::min(3 + random2(pow) / 20, 5); int how_many_max = 1 + random2(1 + you.skills[SK_TRANSMUTATIONS]) / 4; - const bool friendly = (!item_cursed(wpn)); + const bool friendly = (!wpn.cursed()); const beh_type beha = (friendly) ? BEH_FRIENDLY : BEH_HOSTILE; int count = 0; @@ -1712,7 +1712,7 @@ bool cast_tukimas_dance(int pow, god_type god, bool force_hostile) if (success) { // Cursed weapons become hostile. - const bool friendly = (!force_hostile && !item_cursed(you.inv[wpn])); + const bool friendly = (!force_hostile && !you.inv[wpn].cursed()); mgen_data mg(MONS_DANCING_WEAPON, friendly ? BEH_FRIENDLY : BEH_HOSTILE, diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 3a7f8130e1..1a30607199 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -130,7 +130,7 @@ bool remove_curse(bool suppress_msg) // Only cursed *weapons* in hand count as cursed. - bwr if (you.weapon() && you.weapon()->base_type == OBJ_WEAPONS - && item_cursed(*you.weapon())) + && you.weapon()->cursed()) { // Also sets wield_change. do_uncurse_item(*you.weapon()); @@ -142,7 +142,7 @@ bool remove_curse(bool suppress_msg) for (int i = EQ_WEAPON + 1; i < NUM_EQUIP; i++) { // Melded equipment can also get uncursed this way. - if (you.equip[i] != -1 && item_cursed(you.inv[you.equip[i]])) + if (you.equip[i] != -1 && you.inv[you.equip[i]].cursed()) { do_uncurse_item(you.inv[you.equip[i]]); success = true; diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index 82ed562c56..4490e3a59a 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -2484,7 +2484,7 @@ static bool _can_use_item(const item_def &item, bool equipped) && mons_has_blood(item.plus)); } - if (equipped && item_cursed(item)) + if (equipped && item.cursed()) { // Misc. items/rods can always be evoked, cursed or not. if (item.base_type == OBJ_MISCELLANY || item_is_rod(item)) @@ -2770,7 +2770,7 @@ bool InventoryRegion::update_tip_text(std::string& tip) tip += "\n[R-Click] Info"; // Has to be non-equipped or non-cursed to drop. if (!equipped || !_is_true_equipped_item(you.inv[idx]) - || !item_cursed(you.inv[idx])) + || !you.inv[idx].cursed()) { tip += "\n[Shift-L-Click] Drop (d)"; } diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index e3c1e978fd..50dbb83f58 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -1433,7 +1433,7 @@ static void _fill_item_info(InventoryTile &desc, const item_def &item) desc.special = tile_known_weapon_brand(item); desc.flag = 0; - if (item_cursed(item) && item_ident(item, ISFLAG_KNOW_CURSE)) + if (item.cursed() && item_ident(item, ISFLAG_KNOW_CURSE)) desc.flag |= TILEI_FLAG_CURSE; if (item_type_tried(item)) desc.flag |= TILEI_FLAG_TRIED; diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc index 39f932a5eb..eaa1d12afb 100644 --- a/crawl-ref/source/transfor.cc +++ b/crawl-ref/source/transfor.cc @@ -311,7 +311,7 @@ static bool _check_for_cursed_equipment(const std::set &remove, continue; const item_def& item = you.inv[ you.equip[e] ]; - if (item_cursed(item)) + if (item.cursed()) { if (e != EQ_WEAPON && _tran_may_meld_cursed(trans)) continue; diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc index 7f6bc68bc8..69aeb760a2 100644 --- a/crawl-ref/source/tutorial.cc +++ b/crawl-ref/source/tutorial.cc @@ -1549,7 +1549,7 @@ static bool _cant_butcher() if (!wpn || wpn->base_type != OBJ_WEAPONS) return false; - return (item_cursed(*wpn) && !can_cut_meat(*wpn)); + return (wpn->cursed() && !can_cut_meat(*wpn)); } static int _num_butchery_tools() @@ -3012,7 +3012,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) int wpn = you.equip[EQ_WEAPON]; if (wpn != -1 && you.inv[wpn].base_type == OBJ_WEAPONS - && item_cursed(you.inv[wpn])) + && you.inv[wpn].cursed()) { // Don't trigger if the wielded weapon is cursed. Tutorial.tutorial_events[seen_what] = true; diff --git a/crawl-ref/source/wiz-item.cc b/crawl-ref/source/wiz-item.cc index b4b94bb94f..6fa4b411b0 100644 --- a/crawl-ref/source/wiz-item.cc +++ b/crawl-ref/source/wiz-item.cc @@ -697,7 +697,7 @@ void wizard_uncurse_item() { item_def& item(you.inv[i]); - if (item_cursed(item)) + if (item.cursed()) do_uncurse_item(item); else if (_item_type_can_be_cursed(item.base_type)) do_curse_item(item); -- cgit v1.2.3-54-g00ecf