-#include "spell/spell-info.h"
+#include "spell/spell-info.h"
#include "io/input-key-requester.h"
#include "monster-race/monster-race.h"
#include "player-base/player-class.h"
#include "realm/realm-types.h"
#include "spell/spells-execution.h"
#include "system/floor-type-definition.h"
-#include "system/monster-race-definition.h"
-#include "system/monster-type-definition.h"
+#include "system/monster-entity.h"
+#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include "term/term-color-types.h"
+#include "term/z-form.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
{
chance += player_ptr->to_m_chance;
- if (player_ptr->heavy_spell) {
+ if (player_ptr->hard_spell) {
chance += 20;
}
if (player_ptr->dec_mana) {
chance--;
}
- if (player_ptr->heavy_spell) {
+ if (player_ptr->hard_spell) {
chance += 5;
}
return std::max(chance, 0);
int i;
const magic_type *s_ptr;
- char info[80];
- char out_val[160];
char ryakuji[5];
bool max = false;
for (i = 0; i < num; i++) {
ryakuji[4] = '\0';
}
+ std::string out_val;
if (use_menu && target_spell) {
if (i == (target_spell - 1)) {
- strcpy(out_val, _(" 》 ", " > "));
+ out_val = _(" 》 ", " > ");
} else {
- strcpy(out_val, " ");
+ out_val = " ";
}
} else {
- sprintf(out_val, " %c) ", I2A(i));
+ out_val = format(" %c) ", I2A(i));
}
if (s_ptr->slevel >= 99) {
- strcat(out_val, format("%-30s", _("(判読不能)", "(illegible)")));
+ out_val.append(format("%-30s", _("(判読不能)", "(illegible)")));
c_prt(TERM_L_DARK, out_val, y + i + 1, x);
continue;
}
- strcpy(info, exe_spell(player_ptr, use_realm, spell, SpellProcessType::INFO));
- concptr comment = info;
+ const auto info = exe_spell(player_ptr, use_realm, spell, SpellProcessType::INFO);
+ concptr comment = info->data();
byte line_attr = TERM_WHITE;
if (pc.is_every_magic()) {
if (s_ptr->slevel > player_ptr->max_plv) {
line_attr = TERM_L_GREEN;
}
+ const auto spell_name = exe_spell(player_ptr, use_realm, spell, SpellProcessType::NAME);
if (use_realm == REALM_HISSATSU) {
- strcat(out_val, format("%-25s %2d %4d", exe_spell(player_ptr, use_realm, spell, SpellProcessType::NAME), s_ptr->slevel, need_mana));
+ out_val.append(format("%-25s %2d %4d", spell_name->data(), s_ptr->slevel, need_mana));
} else {
- strcat(out_val,
- format("%-25s%c%-4s %2d %4d %3d%% %s", exe_spell(player_ptr, use_realm, spell, SpellProcessType::NAME), (max ? '!' : ' '), ryakuji, s_ptr->slevel,
- need_mana, spell_chance(player_ptr, spell, use_realm), comment));
+ out_val.append(format("%-25s%c%-4s %2d %4d %3d%% %s", spell_name->data(), (max ? '!' : ' '), ryakuji, s_ptr->slevel,
+ need_mana, spell_chance(player_ptr, spell, use_realm), comment));
}
c_prt(line_attr, out_val, y + i + 1, x);