diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-05-29 04:01:42 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-05-29 04:01:42 +0200 |
commit | aff44e3dcf63bf0a5426c8d6998c8954bb44d26d (patch) | |
tree | 1708e320052e6631f93e85301ff6d2ad75ebb1ef /crawl-ref/source/showsymb.cc | |
parent | 30cd027a1c26d7375360584f5df8ec9f57a09c85 (diff) | |
parent | 1ef5305b68a6936247e5ee2a4aa7516222258490 (diff) | |
download | crawl-ref-aff44e3dcf63bf0a5426c8d6998c8954bb44d26d.tar.gz crawl-ref-aff44e3dcf63bf0a5426c8d6998c8954bb44d26d.zip |
Merge branch 'master' into lava_orcs
Diffstat (limited to 'crawl-ref/source/showsymb.cc')
-rw-r--r-- | crawl-ref/source/showsymb.cc | 57 |
1 files changed, 43 insertions, 14 deletions
diff --git a/crawl-ref/source/showsymb.cc b/crawl-ref/source/showsymb.cc index 5a90f85675..a1a2d3475a 100644 --- a/crawl-ref/source/showsymb.cc +++ b/crawl-ref/source/showsymb.cc @@ -145,6 +145,31 @@ unsigned short _cell_feat_show_colour(const map_cell& cell, return colour; } +static monster_type _show_mons_type(const monster_info& mi) +{ + if (mi.type == MONS_SLIME_CREATURE && mi.number > 1) + return MONS_MERGED_SLIME_CREATURE; + else if (mi.type == MONS_ZOMBIE) + { + return mons_zombie_size(mi.base_type) == Z_BIG ? + MONS_ZOMBIE_LARGE : MONS_ZOMBIE_SMALL; + } + else if (mi.type == MONS_SKELETON) + { + return mons_zombie_size(mi.base_type) == Z_BIG ? + MONS_SKELETON_LARGE : MONS_SKELETON_SMALL; + } + else if (mi.type == MONS_SIMULACRUM) + { + return mons_zombie_size(mi.base_type) == Z_BIG ? + MONS_SIMULACRUM_LARGE : MONS_SIMULACRUM_SMALL; + } + else if (mi.type == MONS_SENSED) + return mi.base_type; + + return mi.type; +} + static int _get_mons_colour(const monster_info& mi) { if (crawl_state.viewport_monster_hp) // show hp directly on the monster @@ -152,8 +177,12 @@ static int _get_mons_colour(const monster_info& mi) int col = mi.colour; - if (mi.type == MONS_SLIME_CREATURE && mi.number > 1) - col = mons_class_colour(MONS_MERGED_SLIME_CREATURE); + // We really shouldn't store unmodified colour. This hack compares + // effective type, but really, all redefinitions should work instantly, + // rather than for newly spawned monsters only. + monster_type stype = _show_mons_type(mi); + if (stype != mi.type && mi.type != MONS_SENSED) + col = mons_class_colour(stype); if (mi.is(MB_BERSERK)) col = RED; @@ -195,8 +224,10 @@ static int _get_mons_colour(const monster_info& mi) } // Backlit monsters are fuzzy and override brands. - if (!crawl_state.game_is_arena() && - !you.can_see_invisible() && mi.is(MB_INVISIBLE)) + if (!crawl_state.game_is_arena() + && !you.can_see_invisible() + && mi.is(MB_INVISIBLE) + && mi.attitude != ATT_FRIENDLY) { col = DARKGREY; } @@ -345,17 +376,18 @@ static cglyph_t _get_cell_glyph_with_class(const map_cell& cell, else g.col = _get_mons_colour(*mi); - const bool override = Options.mon_glyph_overrides.find(mi->type) + monster_type stype = _show_mons_type(*mi); + const bool override = Options.mon_glyph_overrides.find(stype) != Options.mon_glyph_overrides.end(); if (mi->props.exists("glyph") && !override) g.ch = mi->props["glyph"].get_int(); else if (show.mons == MONS_SENSED) g.ch = mons_char(mi->base_type); else - g.ch = mons_char(show.mons); + g.ch = mons_char(stype); if (mi->props.exists("glyph") && override) - g.col = mons_class_colour(mi->type); + g.col = mons_class_colour(stype); break; } @@ -468,20 +500,17 @@ cglyph_t get_item_glyph(const item_def *item) cglyph_t get_mons_glyph(const monster_info& mi) { + monster_type stype = _show_mons_type(mi); cglyph_t g; - const bool override = Options.mon_glyph_overrides.find(mi.type) + const bool override = Options.mon_glyph_overrides.find(stype) != Options.mon_glyph_overrides.end(); if (mi.props.exists("glyph") && !override) g.ch = mi.props["glyph"].get_int(); - else if (mi.type == MONS_SLIME_CREATURE && mi.number > 1) - g.ch = mons_char(MONS_MERGED_SLIME_CREATURE); - else if (mi.type == MONS_SENSED) - g.ch = mons_char(mi.base_type); else - g.ch = mons_char(mi.type); + g.ch = mons_char(stype); if (mi.props.exists("glyph") && override) - g.col = mons_class_colour(mi.type); + g.col = mons_class_colour(stype); else g.col = _get_mons_colour(mi); g.col = real_colour(g.col); |