engine/translators/source/MapTranslator.cpp
// Create a display tile from a given tile feature
Create a display tile from a given tile feature
Create a display tile from a given tile feature
DisplayTile MapTranslator::create_display_tile_from_feature(const FeaturePtr& feature, const bool timewalking, const Colour override_colour, const ShimmerColours& map_shimmer_colours)
{
  uchar symbol = '?';
  Colour colour = Colour::COLOUR_UNDEFINED;
  ShimmerColours shimmer_colours = map_shimmer_colours;
  if (feature->has_shimmer_colours())
  {
    shimmer_colours = feature->get_shimmer_colours();
  }
  int pct_chance_shimmer = shimmer_colours.get_pct_chance_shimmer();
  if (timewalking)
  {
    pct_chance_shimmer = 0;
  }
  Colour shimmer_colour = RNG::percent_chance(pct_chance_shimmer) ? shimmer_colours.get_shimmer_colour() : shimmer_colours.get_feature_colour();
  if (feature != nullptr)
  {
    symbol = feature->get_symbol();
    colour = feature->get_colour();
  }
  if (override_colour != Colour::COLOUR_UNDEFINED)
  {
    colour = override_colour;
  }
  if (shimmer_colour != Colour::COLOUR_UNDEFINED)
  {
    colour = shimmer_colour;
  }
  return create_display_tile_from_symbol_and_colour(symbol, colour);
}
DisplayTile MapTranslator :: create_display_tile_from_feature ( const FeaturePtr & feature , const bool timewalking , const Colour override_colour , const ShimmerColours & map_shimmer_colours ) { uchar symbol = ' ' ; Colour colour = Colour :: COLOUR_UNDEFINED ; ShimmerColours shimmer_colours = map_shimmer_colours ; if ( feature -> has_shimmer_colours ( ) ) { shimmer_colours = feature -> get_shimmer_colours ( ) ; } int pct_chance_shimmer = shimmer_colours . get_pct_chance_shimmer ( ) ; if ( timewalking ) { pct_chance_shimmer = 0 ; } Colour shimmer_colour = RNG :: percent_chance ( pct_chance_shimmer ) ? shimmer_colours . get_shimmer_colour ( ) : shimmer_colours . get_feature_colour ( ) ; if ( feature != nullptr ) { symbol = feature -> get_symbol ( ) ; colour = feature -> get_colour ( ) ; } if ( override_colour != Colour :: COLOUR_UNDEFINED ) { colour = override_colour ; } if ( shimmer_colour != Colour :: COLOUR_UNDEFINED ) { colour = shimmer_colour ; } return create_display_tile_from_symbol_and_colour ( symbol , colour ) ; }
Create a display tile from a given tile feature
Create a display tile from a given tile feature