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

Summon several kinds of kittycat from Bag of Cats #40656

Merged
merged 6 commits into from
May 19, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Swap position of damage and range in spell info
This makes the typically shorter strings (Range and AOE) share a line in
two colums, while Damage (or Summon, Spawn, etc.) gets its own line.
wapcaplet committed May 17, 2020
commit e5433e421cd2f037a52d45c3c60a6b387c7669f9
13 changes: 9 additions & 4 deletions src/magic.cpp
Original file line number Diff line number Diff line change
@@ -1730,6 +1730,7 @@ void spellcasting_callback::draw_spell_info( const spell &sp, const uilist *menu

const int damage = sp.damage();
std::string damage_string;
std::string range_string;
std::string aoe_string;
// if it's any type of attack spell, the stats are normal.
if( fx == "target_attack" || fx == "projectile_attack" || fx == "cone_attack" ||
@@ -1768,7 +1769,7 @@ void spellcasting_callback::draw_spell_info( const spell &sp, const uilist *menu
} else if( fx == "summon" ) {
std::string monster_name = "FIXME";
if( sp.has_flag( spell_flag::SPAWN_GROUP ) ) {
// TODO: Get a more user-friendly group name, and make it fit better the available space
// TODO: Get a more user-friendly group name
if( MonsterGroupManager::isValidMonsterGroup( mongroup_id( sp.effect_data() ) ) ) {
monster_name = "of " + sp.effect_data();
} else {
@@ -1783,11 +1784,15 @@ void spellcasting_callback::draw_spell_info( const spell &sp, const uilist *menu
aoe_string = string_format( "%s: %s", _( "Spell Radius" ), sp.aoe_string() );
}

print_colored_text( w_menu, point( h_col1, line ), gray, gray, damage_string );
range_string = string_format( "%s: %s", _( "Range" ),
sp.range() <= 0 ? _( "self" ) : to_string( sp.range() ) );

// Range / AOE in two columns
print_colored_text( w_menu, point( h_col1, line ), gray, gray, range_string );
print_colored_text( w_menu, point( h_col2, line++ ), gray, gray, aoe_string );

print_colored_text( w_menu, point( h_col1, line++ ), gray, gray,
string_format( "%s: %s", _( "Range" ), sp.range() <= 0 ? _( "self" ) : to_string( sp.range() ) ) );
// One line for damage / healing / spawn / summon effect
print_colored_text( w_menu, point( h_col1, line++ ), gray, gray, damage_string );

// todo: damage over time here, when it gets implemeted