From 5500ccf5c9c2cca2694a642278d55c3e342bd469 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Wed, 10 Jun 2009 13:35:36 +0000 Subject: Fix lua errors for Ziggurats in Tiles. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9941 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/dat/clua/ziggurat.lua | 20 ++++++++-- crawl-ref/source/dat/icecave.des | 8 ++-- crawl-ref/source/dat/ziggurat.des | 28 ++++++------- crawl-ref/source/misc.cc | 72 ++++++++++++++++++---------------- crawl-ref/source/tile2.cc | 2 +- 5 files changed, 74 insertions(+), 56 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/dat/clua/ziggurat.lua b/crawl-ref/source/dat/clua/ziggurat.lua index 2e95545451..0792043c49 100644 --- a/crawl-ref/source/dat/clua/ziggurat.lua +++ b/crawl-ref/source/dat/clua/ziggurat.lua @@ -190,11 +190,23 @@ local function clamp_in_bounds(x, y) end local function set_tiles_for_place(place) - local rock = dgn.lev_rocktile(place) - dgn.change_rock_tile(rock) +-- local rock = dgn.lev_rocktile(place) +-- local floor = dgn.lev_floortile(place) + local tileset = { + blue = "wall_zot_blue", + red = "wall_zot_red", + lightblue = "wall_zot_cyan", + magenta = "wall_zot_magenta", + green = "wall_zot_green", + white = "wall_vault" + } - local floor = dgn.lev_floortile(place) - dgn.change_floor_tile(floor) + local wall = tileset[ziggurat_wall_colour()] + if (wall == nil) then + wall = "wall_vault" + end + dgn.change_rock_tile(wall) + dgn.change_floor_tile("floor_vault") end local function set_floor_colour(colour) diff --git a/crawl-ref/source/dat/icecave.des b/crawl-ref/source/dat/icecave.des index f85a8fa8b4..fc010f72b5 100644 --- a/crawl-ref/source/dat/icecave.des +++ b/crawl-ref/source/dat/icecave.des @@ -9,7 +9,7 @@ # # Flavour: white colours, ice monsters, appropriate clouds. # The escape is at the start. The player can back away if s/he decides -# some challenges are too much to handle. +# some challenges are too much to handle. # ############################################################################### @@ -20,7 +20,7 @@ function ice_cave_portal(e) "grim and arctic fury. You note that the archway is melting away." local timeout_turns = crawl.random_range(1200, 1700) - + local messager = timed_msg { visible = true, @@ -236,7 +236,7 @@ xxx.xxx xxx+xxx ENDMAP -NAME: portal_ice_cave_ice_statue_001 +NAME: portal_ice_cave_entry_ice_statue_001 TAGS: uniq_ice_cave DEPTH: D:14-24 ORIENT: float @@ -254,7 +254,7 @@ x.....x xxx+xxx ENDMAP -NAME: portal_ice_cave_ice_statue_002 +NAME: portal_ice_cave_entry_ice_statue_002 TAGS: uniq_ice_cave DEPTH: 14-24 ORIENT: float diff --git a/crawl-ref/source/dat/ziggurat.des b/crawl-ref/source/dat/ziggurat.des index 4b2c34b574..d2523fbab5 100644 --- a/crawl-ref/source/dat/ziggurat.des +++ b/crawl-ref/source/dat/ziggurat.des @@ -51,18 +51,18 @@ SHUFFLE: wW' / l;_ COLOUR: ; = red COLOUR: _ : blue / lightred COLOUR: ' = cyan -FTILE: ' = floor_hall, _ = floor_hall, ; = floor_hall, O = floor_hall +FTILE: ' = floor_hall, _ = floor_hall, ; = floor_hall, O = floor_hall SUBST: '=. , ;=. , _=. : ziggurat_portal(_G) MAP - ..'.. - ..'W'.. - ..'WwW'.. + ..'.. + ..'W'.. + ..'WwW'.. ..'WwwwW'.. .'WwwOwwW'. ..'WwwwW'.. - ..'WwW'.. - ..'W'.. + ..'WwW'.. + ..'W'.. ..'.. ENDMAP @@ -151,7 +151,7 @@ ENDMAP NAME: enter_shallow_ziggurat_d CHANCE: 50 -TAGS: chance_shallow_zig +TAGS: chance_shallow_zig MONS: angel / nothing w:20 : ziggurat_portal(_G) MAP @@ -199,14 +199,14 @@ FTILE: ' = floor_hall, _ = floor_hall, ; = floor_hall, O = floor_hall SUBST: '=. , ;=. , _=. : ziggurat_portal(_G) MAP - ..'.. - ..'W'.. - ..'WwW'.. + ..'.. + ..'W'.. + ..'WwW'.. ..'WwwwW'.. .'WwwOwwW'. ..'WwwwW'.. - ..'WwW'.. - ..'W'.. + ..'WwW'.. + ..'W'.. ..'.. ENDMAP @@ -261,7 +261,7 @@ default-depth: ####################################################################### # Pillars for ziggurats. # Ziggurat pillars are handled specially in ziggurat.lua. In particular: -# - ziggurat pillars do not need allow_dup. The pillar map is never +# - ziggurat pillars do not need allow_dup. The pillar map is never # registered as used. # - ziggurat pillars cannot use map markers. ####################################################################### @@ -276,7 +276,7 @@ NAME: ziggurat_pillar_b TAGS: ziggurat_pillar SUBST: c : cxvb MAP -c +c cc ENDMAP diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 9f494299d1..7420143953 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -420,39 +420,32 @@ void maybe_coagulate_blood_potions_floor(int obj) _compare_blood_quantity(blood, timer.size()); } +static std::string _get_desc_quantity(const int quant, const int total) +{ + if (total == quant) + return "Your"; + else if (quant == 1) + return "One of your"; + else if (quant == 2) + return "Two of your"; + else if (quant >= (total * 3) / 4) + return "Most of your"; + else + return "Some of your"; +} + // Prints messages for blood potions coagulating in inventory (coagulate = true) // or whenever potions are cursed into potions of decay (coagulate = false). static void _potion_stack_changed_message(item_def &potion, int num_changed, - bool coagulate = true) + std::string verb) { ASSERT(num_changed > 0); - if (coagulate) - ASSERT(potion.sub_type == POT_BLOOD); - - std::string msg; - if (potion.quantity == num_changed) - msg = "Your "; - else if (num_changed == 1) - msg = "One of your "; - else if (num_changed == 2) - msg = "Two of your "; - else if (num_changed >= (potion.quantity * 3) / 4) - msg = "Most of your "; - else - msg = "Some of your "; - - msg += potion.name(DESC_PLAIN, false); - if (coagulate) - msg += " coagulate"; - else - msg += " decay"; - - if (num_changed == 1) - msg += "s"; - msg += "."; - - mpr(msg.c_str(), MSGCH_ROTTEN_MEAT); + verb = replace_all(verb, "%s", num_changed == 1 ? "s" : ""); + mprf(MSGCH_ROTTEN_MEAT, "%s %s %s.", + _get_desc_quantity(num_changed, potion.quantity).c_str(), + potion.name(DESC_PLAIN, false).c_str(), + verb.c_str()); } // Returns true if "equipment weighs less" message needed. @@ -518,9 +511,23 @@ bool maybe_coagulate_blood_potions_inv(item_def &blood) you.wield_change = true; you.redraw_quiver = true; - if (!coag_count) // Some potions rotted away. + const bool knew_coag = (get_ident_type(OBJ_POTIONS, POT_BLOOD_COAGULATED) + == ID_KNOWN_TYPE); + + if (!coag_count) // Some potions rotted away, but none coagulated. { + // Only coagulated blood can rot. + ASSERT(blood.sub_type == POT_BLOOD_COAGULATED); + _potion_stack_changed_message(blood, rot_count, "rot%s away"); blood.quantity -= rot_count; + + if (!knew_coag) + { + set_ident_type( OBJ_POTIONS, POT_BLOOD_COAGULATED, ID_KNOWN_TYPE ); + if (blood.quantity >= 1) + mpr(blood.name(DESC_INVENTORY).c_str()); + } + if (blood.quantity < 1) { if (you.equip[EQ_WEAPON] == blood.link) @@ -537,11 +544,10 @@ bool maybe_coagulate_blood_potions_inv(item_def &blood) // Coagulated blood cannot coagulate any further... ASSERT(blood.sub_type == POT_BLOOD); - bool knew_blood = get_ident_type(OBJ_POTIONS, POT_BLOOD) == ID_KNOWN_TYPE; - bool knew_coag = (get_ident_type(OBJ_POTIONS, POT_BLOOD_COAGULATED) - == ID_KNOWN_TYPE); + const bool knew_blood = get_ident_type(OBJ_POTIONS, POT_BLOOD) + == ID_KNOWN_TYPE; - _potion_stack_changed_message(blood, coag_count); + _potion_stack_changed_message(blood, coag_count, "coagulate%s"); // Identify both blood and coagulated blood, if necessary. if (!knew_blood) @@ -948,7 +954,7 @@ void split_potions_into_decay( int obj, int amount, bool need_msg ) // Output decay message. if (need_msg && get_ident_type(OBJ_POTIONS, POT_DECAY) == ID_KNOWN_TYPE) - _potion_stack_changed_message(potion, amount, false); + _potion_stack_changed_message(potion, amount, "decay%s"); if (you.equip[EQ_WEAPON] == obj) you.wield_change = true; diff --git a/crawl-ref/source/tile2.cc b/crawl-ref/source/tile2.cc index d79151d6ae..ab0fdae775 100644 --- a/crawl-ref/source/tile2.cc +++ b/crawl-ref/source/tile2.cc @@ -167,7 +167,7 @@ void tile_default_flv(level_area_type lev, branch_type br, tile_flavour &flv) return; case BRANCH_SHOALS: - flv.wall = TILE_WALL_YELLOW_ROCK; + flv.wall = TILE_WALL_YELLOW_ROCK; flv.floor = TILE_FLOOR_SAND_STONE; return; -- cgit v1.2.3-54-g00ecf