Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retroday outline #36402

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified gfx/RetroDaysTileset/tiles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 28 additions & 20 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5794,8 +5794,7 @@ void game::print_visibility_info( const catacurses::window &w_look, int column,
visibility_message = _( "Unseen." );
break;
}

mvwprintw( w_look, point( line, column ), visibility_message );
mvwprintz( w_look, point( line, column ), c_light_gray, visibility_message );
line += 2;
}

Expand All @@ -5806,24 +5805,25 @@ void game::print_terrain_info( const tripoint &lp, const catacurses::window &w_l
const int max_width = getmaxx( w_look ) - column - 1;
int lines;
std::string tile = m.tername( lp );
tile = "(" + area_name + ") " + tile;
tile = _( "Place : " ) + area_name + _( "\nTile : " ) + tile;
if( m.has_furn( lp ) ) {
tile += "; " + m.furnname( lp );
tile += "\n";
tile += _( "Decor : " ) + m.furnname( lp );
}

if( m.impassable( lp ) ) {
lines = fold_and_print( w_look, point( column, line ), max_width, c_light_gray,
_( "%s; Impassable" ),
_( "%s, Impassable" ),
tile );
} else {
lines = fold_and_print( w_look, point( column, line ), max_width, c_light_gray,
_( "%s; Movement cost %d" ),
_( "%s\nMove : %d" ),
tile, m.move_cost( lp ) * 50 );

const auto ll = get_light_level( std::max( 1.0,
LIGHT_AMBIENT_LIT - m.ambient_light_at( lp ) + 1.0 ) );
mvwprintw( w_look, point( column, ++lines ), _( "Lighting: " ) );
wprintz( w_look, ll.second, ll.first );
mvwprintz( w_look, point( column, ++lines ), c_light_gray, _( "Light : " ) );
mvwprintz( w_look, point( column + 9, lines ), ll.second, ll.first );
}

std::string signage = m.get_signage( lp );
Expand All @@ -5838,7 +5838,7 @@ void game::print_terrain_info( const tripoint &lp, const catacurses::window &w_l
tripoint below( lp.xy(), lp.z - 1 );
std::string tile_below = m.tername( below );
if( m.has_furn( below ) ) {
tile_below += "; " + m.furnname( below );
tile_below += ", " + m.furnname( below );
}

if( !m.has_floor_or_support( lp ) ) {
Expand All @@ -5851,13 +5851,12 @@ void game::print_terrain_info( const tripoint &lp, const catacurses::window &w_l
tile_below );
}
}

int map_features = fold_and_print( w_look, point( column, ++lines ), max_width, c_dark_gray,
m.features( lp ) );
fold_and_print( w_look, point( column, ++lines ), max_width, c_light_gray, _( "Coverage: %d%%" ),
fold_and_print( w_look, point( column, ++lines ), max_width, c_light_gray,
_( "Type : " ) + m.features( lp ) );
fold_and_print( w_look, point( column, ++lines ), max_width, c_light_gray, _( "Surface: %d%% \n" ),
m.coverage( lp ) );
if( line < lines ) {
line = lines + map_features - 1;
line = lines + 1;
}
}

Expand All @@ -5874,9 +5873,15 @@ void game::print_fields_info( const tripoint &lp, const catacurses::window &w_lo
get_fire_fuel_string( lp ) ) - 1;
line += lines;
} else {
// display tile special detail if it exists (blood stain, puddle of acid ..)
mvwprintz( w_look, point( column, ++line ), cur.color(), cur.name() );
}
}
// only display new line if there is items to show
int size = std::distance( tmpfield.begin(), tmpfield.end() );
if( size > 0 ) {
mvwprintz( w_look, point( column, ++line ), c_white, "\n" );
}
}

void game::print_trap_info( const tripoint &lp, const catacurses::window &w_look, const int column,
Expand Down Expand Up @@ -5960,9 +5965,11 @@ void game::print_items_info( const tripoint &lp, const catacurses::window &w_loo
_( "There's something there, but you can't see what it is." ) );
return;
} else {
std::map<std::string, int> item_names;
//loop through list of items, get their names and colored string
std::map<std::string, std::pair<int, nc_color>> item_names;
for( auto &item : m.i_at( lp ) ) {
++item_names[item.tname()];
++item_names[item.tname()].first;
item_names[item.tname()].second = item.color_in_inventory();
}

const int max_width = getmaxx( w_look ) - column - 1;
Expand All @@ -5972,12 +5979,13 @@ void game::print_items_info( const tripoint &lp, const catacurses::window &w_loo
break;
}

if( it.second > 1 ) {
trim_and_print( w_look, point( column, ++line ), max_width, c_white,
if( it.second.first > 1 ) {
trim_and_print( w_look, point( column, ++line ), max_width, it.second.second,
pgettext( "%s is the name of the item. %d is the quantity of that item.", "%s [%d]" ),
it.first.c_str(), it.second );
it.first.c_str(), it.second.first );
} else {
trim_and_print( w_look, point( column, ++line ), max_width, c_white, it.first );
// display colored item list in look_around window
trim_and_print( w_look, point( column, ++line ), max_width, it.second.second, it.first );
}
}
}
Expand Down
66 changes: 48 additions & 18 deletions src/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,38 +597,68 @@ int monster::print_info( const catacurses::window &w, int vStart, int vLines, in
{
const int vEnd = vStart + vLines;

mvwprintz( w, point( column, vStart ), c_white, "%s ", name() );
// display name
mvwprintz( w, point( column, vStart ), c_light_gray, _( "Entity : " ) );
mvwprintz( w, point( column + 9, vStart ), c_white, name() );

const auto att = get_attitude();
wprintz( w, att.second, att.first );
std::string effects = get_effect_status();
//size_t used_space = utf8_width( att.first ) + utf8_width( name() ) + 3;
size_t used_space = utf8_width( "Entity : " ) + utf8_width( name() ) + 3;
trim_and_print( w, point( used_space, vStart ), getmaxx( w ) - used_space - 2,
h_white, effects );

if( debug_mode ) {
wprintz( w, c_light_gray, _( " Difficulty " ) + to_string( type->difficulty ) );
}
// display health
nc_color color = c_white;
std::string sText;
get_HP_Bar( color, sText );
mvwprintz( w, point( column, ++vStart ), c_light_gray, _( "Health : " ) );
mvwprintz( w, point( column + 9, vStart ), color, sText );

// display sense
std::string senses_str = "--";
if( sees( g->u ) ) {
mvwprintz( w, point( column, ++vStart ), c_yellow, _( "Aware of your presence!" ) );
senses_str = _( "It is aware of your presence" );
} else {
senses_str = _( "It hasn't noticed you" );
}

std::string effects = get_effect_status();
size_t used_space = utf8_width( att.first ) + utf8_width( name() ) + 3;
trim_and_print( w, point( used_space, vStart++ ), getmaxx( w ) - used_space - 2,
h_white, effects );
mvwprintz( w, point( column, ++vStart ), c_light_gray, _( "Senses : " ) );
mvwprintz( w, point( column + 9, vStart ), sees( g->u ) ? c_red : c_green, senses_str );

const auto hp_desc = hp_description( hp, type->hp );
mvwprintz( w, point( column, vStart++ ), hp_desc.second, hp_desc.first );
if( has_effect( effect_ridden ) && mounted_player ) {
mvwprintz( w, point( column, vStart++ ), c_white, _( "Rider: %s" ), mounted_player->disp_name() );
}
// display stance
mvwprintz( w, point( column, ++vStart ), c_light_gray, _( "Stance : " ) );
mvwprintz( w, point( column + 9, vStart ), att.second, att.first );

if( size_bonus > 0 ) {
wprintz( w, c_light_gray, _( " It is %s." ), size_names.at( get_size() ) );
// display threat
int threatlvl = type->difficulty;
nc_color threatlvl_color = c_white;
if( threatlvl >= 8 ) {
threatlvl_color = c_red;
} else if( threatlvl >= 4 ) {
threatlvl_color = c_yellow;
} else if( threatlvl >= 0 ) {
threatlvl_color = c_blue;
}

mvwprintz( w, point( column, ++vStart ), c_light_gray, _( "Threat : " ) );
mvwprintz( w, point( column + 9, vStart ), threatlvl_color, to_string( threatlvl ) );

// dipslay aspect
//mvwprintz( w, point( column, ++vStart ), c_light_gray, _( "Aspect :" ) );
vStart++;
std::vector<std::string> lines = foldstring( type->get_description(), getmaxx( w ) - 1 - column );
int numlines = lines.size();
for( int i = 0; i < numlines && vStart <= vEnd; i++ ) {
mvwprintz( w, point( column, vStart++ ), c_white, lines[i] );
mvwprintz( w, point( column, ++vStart ), c_white, lines[i] );
}

if( has_effect( effect_ridden ) && mounted_player ) {
mvwprintz( w, point( column, vStart++ ), c_white, _( "Rider: %s" ), mounted_player->disp_name() );
}

if( size_bonus > 0 ) {
wprintz( w, c_light_gray, _( " It is %s." ), size_names.at( get_size() ) );
}

return vStart;
Expand Down