diff --git a/crawl-ref/source/rltiles/dc-mon.txt b/crawl-ref/source/rltiles/dc-mon.txt index 781eba3115f..7a215d3121c 100644 --- a/crawl-ref/source/rltiles/dc-mon.txt +++ b/crawl-ref/source/rltiles/dc-mon.txt @@ -1205,10 +1205,18 @@ wandering_mushroom MONS_WANDERING_MUSHROOM deathcap MONS_DEATHCAP sleepcap MONS_SLEEPCAP -# %rim 1 %sdir mon/fungi_plants cobalt_lichen MONS_COBALT_LICHEN +%rim 1 +cobalt_lichen MONS_COBALT_LICHEN_MASK + +# %rim 0 +# cobalt_lichen_corner MONS_COBALT_LICHEN_CORNER +# %rim 1 +# cobalt_lichen_corner MONS_COBALT_LICHEN_CORNER_MASK + +%rim 0 %start %compose cobalt_lichen %compose cobalt_lichen_eyestalk1 diff --git a/crawl-ref/source/rltiles/mon/fungi_plants/cobalt_lichen.png b/crawl-ref/source/rltiles/mon/fungi_plants/cobalt_lichen.png index 514266f8ec1..8645d7985d4 100644 Binary files a/crawl-ref/source/rltiles/mon/fungi_plants/cobalt_lichen.png and b/crawl-ref/source/rltiles/mon/fungi_plants/cobalt_lichen.png differ diff --git a/crawl-ref/source/rltiles/mon/fungi_plants/cobalt_lichen_corner.png b/crawl-ref/source/rltiles/mon/fungi_plants/cobalt_lichen_corner.png new file mode 100644 index 00000000000..7c3c6beea3b Binary files /dev/null and b/crawl-ref/source/rltiles/mon/fungi_plants/cobalt_lichen_corner.png differ diff --git a/crawl-ref/source/tilecell.h b/crawl-ref/source/tilecell.h index 1d54c72122e..169c0987f59 100644 --- a/crawl-ref/source/tilecell.h +++ b/crawl-ref/source/tilecell.h @@ -18,6 +18,7 @@ struct packed_cell enum { MAX_DNGN_OVERLAY = 20 }; int num_dngn_overlay; FixedVector dngn_overlay; + FixedVector fg_underlay = {0,0,0,0}; tileidx_t fg; tileidx_t bg; diff --git a/crawl-ref/source/tiledgnbuf.cc b/crawl-ref/source/tiledgnbuf.cc index 7b886fb57f7..b8b096cead5 100644 --- a/crawl-ref/source/tiledgnbuf.cc +++ b/crawl-ref/source/tiledgnbuf.cc @@ -50,6 +50,10 @@ void DungeonCellBuffer::add_glyph(const char32_t &g, const VColour &col, const V m_buf_glyphs.get_font_wrapper().store(m_buf_glyphs, sx, sy, g, col, bg); } +static const struct coord_def _buf_offset_coords[] = { + {0,16}, {16,16}, {16,0}, {16,-16}, +}; + void DungeonCellBuffer::add(const packed_cell &cell, int x, int y) { pack_background(x, y, cell); @@ -63,6 +67,25 @@ void DungeonCellBuffer::add(const packed_cell &cell, int x, int y) if (cloud_idx == TILE_CLOUD_INK && player_in_branch(BRANCH_SHOALS)) cloud_idx = 0; + for (int n=0; n < 4; n++) + { + if (cell.fg_underlay[n]) + { + m_buf_doll.add(cell.fg_underlay[n], x, y, 1, false, false, + _buf_offset_coords[n].x, _buf_offset_coords[n].y); + // Mask layer at lower z-index (to add rim around the entire blob) + m_buf_doll.add(cell.fg_underlay[n] + 1, x, y, -2, false, false, + _buf_offset_coords[n].x, _buf_offset_coords[n].y); + } + } + + if (fg_idx >= TILEP_MONS_COBALT_LICHEN + && fg_idx <= TILEP_MONS_COBALT_LICHEN_SAC) + { + // Mask layer at lower z-index (to add rim around the entire blob) + m_buf_doll.add(TILEP_MONS_COBALT_LICHEN_MASK, x, y, -2); + } + if (fg_idx >= TILEP_MCACHE_START) { mcache_entry *entry = mcache.get(fg_idx); diff --git a/crawl-ref/source/tiledgnbuf.h b/crawl-ref/source/tiledgnbuf.h index 43da276a486..fb7d9a92da6 100644 --- a/crawl-ref/source/tiledgnbuf.h +++ b/crawl-ref/source/tiledgnbuf.h @@ -55,6 +55,7 @@ class DungeonCellBuffer TileBuffer m_buf_floor; TileBuffer m_buf_wall; TileBuffer m_buf_feat; + TileBuffer m_buf_offset; SubmergedTileBuffer m_buf_feat_trans; SubmergedTileBuffer m_buf_doll; SubmergedTileBuffer m_buf_main_trans; diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc index 1f39e68ea68..26b75b735f8 100644 --- a/crawl-ref/source/tilepick.cc +++ b/crawl-ref/source/tilepick.cc @@ -2190,7 +2190,7 @@ tileidx_t tileidx_monster(const monster_info& mons) ch |= TILE_FLAG_UNUSUAL; else if (mons.type == MONS_PLAYER_GHOST) { - // Threat is always displayed for ghosts, with different tiles, + // Threat is always displayed for ghosts, with different tiles, // to make them more easily visible. ch |= TILE_FLAG_GHOST; switch (mons.threat) diff --git a/crawl-ref/source/tileview.cc b/crawl-ref/source/tileview.cc index cb063e55497..3708b793228 100644 --- a/crawl-ref/source/tileview.cc +++ b/crawl-ref/source/tileview.cc @@ -1055,7 +1055,7 @@ static void _tile_place_monster(const coord_def &gc, const monster_info& mon) else if (pref != TAGPREF_ALL && !mon.is_named()) return; - if (pref != TAGPREF_NAMED && pref != TAGPREF_ALL && mon.attitude == ATT_FRIENDLY) + if (pref != TAGPREF_NAMED && pref != TAGPREF_ALL && mon.attitude == ATT_FRIENDLY) return; tiles.add_text_tag(TAG_NAMED_MONSTER, mon); diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 3ac4ea3da3a..6b7635434b4 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -1697,6 +1697,41 @@ crawl_view_buffer view_dungeon(animation *a, bool anim_updates, view_renderer *r return vbuf; } +static void _pack_underlays(coord_def gc, packed_cell& cell, const monster_info& mon) +{ + if (!in_bounds(gc)) + return; + if (mons_species(mon.type) == MONS_COBALT_LICHEN) + { + int underlay_num = -1; + for (adjacent_iterator ri(gc, true); ri; ++ri) + { + int dx = ri->x - gc.x; + if (dx < 0) + continue; + int dy = ri->y - gc.y; + if (dy < 0 && dx < 1) + continue; + underlay_num++; + cell.fg_underlay[underlay_num] = 0; + + if (!map_bounds(*ri)) + continue; + const map_cell& adj_knowledge = env.map_knowledge(*ri); + if (!adj_knowledge.seen() && !adj_knowledge.mapped()) + continue; + // Now we know this is a connection we *might* want to check, see if + // there's an applicable monster there first + if (!adj_knowledge.monsterinfo() + || mons_species(adj_knowledge.monsterinfo()->type) != MONS_COBALT_LICHEN) + { + continue; + } + cell.fg_underlay[underlay_num] = TILEP_MONS_COBALT_LICHEN; + } + } +} + void draw_cell(screen_cell_t *cell, const coord_def &gc, bool anim_updates, int flash_colour) { @@ -1725,6 +1760,8 @@ void draw_cell(screen_cell_t *cell, const coord_def &gc, cell->tile.map_knowledge = map_bounds(gc) ? env.map_knowledge(gc) : map_cell(); cell->flash_colour = BLACK; cell->flash_alpha = 0; + if (cell->tile.map_knowledge.monsterinfo()) + _pack_underlays(gc, cell->tile, *cell->tile.map_knowledge.monsterinfo()); #endif // Don't hide important information by recolouring monsters.