diff options
author | Bardur Arantsson <bardur@scientician.net> | 2017-05-02 19:20:57 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2017-05-02 19:20:57 +0200 |
commit | aae967c8a33e1aad994b7349abad7fbd447264bb (patch) | |
tree | bfd33da5e04f1103710c4de430143e8cddd54de5 /src/spells1.cc | |
parent | 5bc01c584066a0cea37021eb6e13bd96d74de7b5 (diff) |
Remove random_spell::{name,desc}
Diffstat (limited to 'src/spells1.cc')
-rw-r--r-- | src/spells1.cc | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/spells1.cc b/src/spells1.cc index aad281a0..fe620256 100644 --- a/src/spells1.cc +++ b/src/spells1.cc @@ -50,6 +50,7 @@ #include "z-rand.hpp" #include <chrono> +#include <fmt/format.h> #include <thread> using std::this_thread::sleep_for; @@ -8775,8 +8776,7 @@ static void describe_attack_fully(int type, char* r) * Give a randomly-generated spell a name. * Note that it only describes the first effect! */ - -static void name_spell(random_spell* s_ptr) +std::string name_spell(random_spell const *s_ptr) { char buff[30]; cptr buff2 = "???"; @@ -8807,7 +8807,7 @@ static void name_spell(random_spell* s_ptr) } describe_attack_fully(s_ptr->GF, buff); - strnfmt(s_ptr->name, 30, "%s - %s", buff2, buff); + return fmt::format("{:s} - {:s}", buff2, buff); } void generate_spell(int plev) @@ -8913,22 +8913,6 @@ void generate_spell(int plev) rspell.GF = destructive_attack_types[rand_int(10)]; } - // Give the spell a name - name_spell(&rspell); - - // Give the spell a description - if (ball_desc) - { - /* 30 character limit on the string! */ - sprintf(rspell.desc, "Dam: %d, Rad: %d, Pow: %d", - sides, dice, power); - } - else - { - sprintf(rspell.desc, "Damage: %dd%d, Power: %d", - dice, sides, power); - } - // Add random_spells.emplace_back(rspell); } |