engine/translators/source/MapTranslator.cpp
// Create a display tile from a given tile
Create a display tile from a given tile
Create a display tile from a given tile
DisplayTile MapTranslator::create_display_tile_from_tile(const TilePtr& tile, const bool timewalking, const Colour oc, const ShimmerColours& shimmer_colours)
{
  DisplayTile display_tile;
  Game& game = Game::instance();
  Colour override_colour = oc;
  vector<DisplayTile> tiles_info = game.get_tile_display_info_ref();
  DisplayTile tile_info = tiles_info.at(static_cast<int>(tile->get_tile_type()));
  display_tile = tile_info;
  bool passable = tile && (tile->get_movement_multiplier() > 0);
  Colour shimmer_colour = Colour::COLOUR_UNDEFINED;
  int pct_chance_shimmer = shimmer_colours.get_pct_chance_shimmer();
  if (timewalking)
  {
    pct_chance_shimmer = 0;
  }
  if (RNG::percent_chance(pct_chance_shimmer))
  {
    shimmer_colour = shimmer_colours.get_shimmer_colour();
  }
  else
  {
    if (passable)
    {
      shimmer_colour = shimmer_colours.get_passable_colour();
    }
    else
    {
      shimmer_colour = shimmer_colours.get_impassable_colour();
    }
  }
  if (shimmer_colour != Colour::COLOUR_UNDEFINED)
  {
    override_colour = shimmer_colour;
  }
  if (override_colour != Colour::COLOUR_UNDEFINED)
  {
    display_tile.set_all_colours(static_cast<int>(override_colour));
  }
  return display_tile;
}
DisplayTile MapTranslator :: create_display_tile_from_tile ( const TilePtr & tile , const bool timewalking , const Colour oc , const ShimmerColours & shimmer_colours ) { DisplayTile display_tile ; Game & game = Game :: instance ( ) ; Colour override_colour = oc ; vector < DisplayTile > tiles_info = game . get_tile_display_info_ref ( ) ; DisplayTile tile_info = tiles_info . at ( static_cast < int > ( tile -> get_tile_type ( ) ) ) ; display_tile = tile_info ; bool passable = tile && ( tile -> get_movement_multiplier ( ) > 0 ) ; Colour shimmer_colour = Colour :: COLOUR_UNDEFINED ; int pct_chance_shimmer = shimmer_colours . get_pct_chance_shimmer ( ) ; if ( timewalking ) { pct_chance_shimmer = 0 ; } if ( RNG :: percent_chance ( pct_chance_shimmer ) ) { shimmer_colour = shimmer_colours . get_shimmer_colour ( ) ; } else { if ( passable ) { shimmer_colour = shimmer_colours . get_passable_colour ( ) ; } else { shimmer_colour = shimmer_colours . get_impassable_colour ( ) ; } } if ( shimmer_colour != Colour :: COLOUR_UNDEFINED ) { override_colour = shimmer_colour ; } if ( override_colour != Colour :: COLOUR_UNDEFINED ) { display_tile . set_all_colours ( static_cast < int > ( override_colour ) ) ; } return display_tile ; }
Create a display tile from a given tile
Create a display tile from a given tile
// Make a copy of the prototype tile off the game.