Skip to content

Commit

Permalink
spacing
Browse files Browse the repository at this point in the history
Consolidated descriptors, added 1 additional band, Lifestyle

Co-Authored-By: pfj <[email protected]>
Co-Authored-By: Terrorforge <[email protected]>
Co-Authored-By: PatrikLundell <[email protected]>
  • Loading branch information
4 people committed Mar 31, 2023
1 parent 27e3bff commit e08a567
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 33 deletions.
4 changes: 2 additions & 2 deletions src/newcharacter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,11 +990,11 @@ void set_points( tab_manager &tabs, avatar &u, pool_type &pool )
_( "Stats, traits and skills have separate point pools.\n"
"Putting stat points into traits and skills is allowed and putting trait points into skills is allowed.\n"
"Scenarios and professions affect skill points.\n\n"
"This is a legacy mode point totals are no longer balanced." ) );
"This is a legacy mode. Point totals are no longer balanced." ) );

const point_limit_tuple one_pool = std::make_tuple( pool_type::ONE_POOL, _( "Legacy: Single pool" ),
_( "Stats, traits and skills share a single point pool.\n\n"
"This is a legacy mode point totals are no longer balanced." ) );
"This is a legacy mode. Point totals are no longer balanced." ) );

const point_limit_tuple freeform = std::make_tuple( pool_type::FREEFORM, _( "Survivor" ),
_( "No point limits are enforced, create a character with the intention of telling a story or challenging yourself." ) );
Expand Down
48 changes: 18 additions & 30 deletions src/player_difficulty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ std::string player_difficulty::get_defense_difficulty( const Character &u ) cons
// calculate dodge
per += dodge * ( u.get_dodge() - average.get_dodge() ) / average.get_dodge();

return format_output( percent_band, per, true );
return format_output( percent_band, per );
}

double player_difficulty::calc_dps_value( const Character &u )
Expand Down Expand Up @@ -206,7 +206,7 @@ std::string player_difficulty::get_combat_difficulty( const Character &u ) const

float per = ( player_dps - npc_dps ) / npc_dps;

return format_output( percent_band, per, true );
return format_output( percent_band, per );
}

std::string player_difficulty::get_genetics_difficulty( const Character &u ) const
Expand Down Expand Up @@ -241,7 +241,7 @@ std::string player_difficulty::get_genetics_difficulty( const Character &u ) con
float per = static_cast<float>( genetics_total - average_stats ) / static_cast<float>
( average_stats );

return format_output( percent_band, per, false );
return format_output( percent_band, per );
}

std::string player_difficulty::get_expertise_difficulty( const Character &u ) const
Expand Down Expand Up @@ -291,7 +291,7 @@ std::string player_difficulty::get_expertise_difficulty( const Character &u ) co



return format_output( percent_band, per, false );
return format_output( percent_band, per );
}


Expand Down Expand Up @@ -324,36 +324,24 @@ std::string player_difficulty::get_social_difficulty( const Character &u ) const
float per = static_cast<float>( player_val - average_val ) / static_cast<float>
( average_val );

return format_output( percent_band, per, true );
return format_output( percent_band, per );
}

std::string player_difficulty::format_output( float percent_band, float per, bool difficulty )
std::string player_difficulty::format_output( float percent_band, float per )
{
std::string output;
if( difficulty ) {
if( per < -1 * percent_band ) {
output = string_format( "<color_%s>%s</color>", "light_red", _( "impossible" ) );
} else if( per < 0.0f ) {
output = string_format( "<color_%s>%s</color>", "light_red", _( "hard" ) );
} else if( per < percent_band ) {
output = string_format( "<color_%s>%s</color>", "yellow", _( "average" ) );
} else if( per < 2 * percent_band ) {
output = string_format( "<color_%s>%s</color>", "light_green", _( "easy" ) );
} else {
output = string_format( "<color_%s>%s</color>", "light_green", _( "trivial" ) );
}
if( per < -1 * percent_band ) {
output = string_format( "<color_%s>%s</color>", "light_red", _( "underpowered" ) );
} else if( per < 0.0f ) {
output = string_format( "<color_%s>%s</color>", "light_red", _( "weak" ) );
} else if( per < percent_band ) {
output = string_format( "<color_%s>%s</color>", "yellow", _( "average" ) );
} else if( per < 2 * percent_band ) {
output = string_format( "<color_%s>%s</color>", "light_green", _( "strong" ) );
} else if( per < 3 * percent_band ) {
output = string_format( "<color_%s>%s</color>", "light_green", _( "powerful" ) );
} else {
if( per < -1 * percent_band ) {
output = string_format( "<color_%s>%s</color>", "light_red", _( "underpowered" ) );
} else if( per < 0.0f ) {
output = string_format( "<color_%s>%s</color>", "light_red", _( "weak" ) );
} else if( per < percent_band ) {
output = string_format( "<color_%s>%s</color>", "yellow", _( "average" ) );
} else if( per < 2 * percent_band ) {
output = string_format( "<color_%s>%s</color>", "light_green", _( "powerful" ) );
} else {
output = string_format( "<color_%s>%s</color>", "light_green", _( "overpowered" ) );
}
output = string_format( "<color_%s>%s</color>", "light_green", _( "overpowered" ) );
}

if( get_option<bool>( "DEBUG_DIFFICULTIES" ) ) {
Expand All @@ -378,7 +366,7 @@ std::string player_difficulty::difficulty_to_string( const avatar &u ) const

return string_format( "%s | %s: %s %s: %s %s: %s %s: %s %s: %s",
_( "Summary" ),
_( "Genetics" ), genetics,
_( "Lifestyle" ), genetics,
_( "Knowledge" ), expertise,
_( "Offense" ), combat,
_( "Defense" ), defense,
Expand Down
2 changes: 1 addition & 1 deletion src/player_difficulty.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class player_difficulty
// per is the actual percent as a decimal
// difficulty is true for things going from Very Easy to Very Hard
// difficutly is false for things going from Very Weak to Very Powerful
static std::string format_output( float percent_band, float per, bool difficulty );
static std::string format_output( float percent_band, float per );


npc average;
Expand Down

0 comments on commit e08a567

Please sign in to comment.