#include "util/sort.h"
#include "view/display-messages.h"
#include "world/world.h"
+#include <string>
/*!
* @brief プレイヤーのペット情報をファイルにダンプする
fprintf(fff, "%s ???\n", stat_names[v_nr]);
}
- fprintf(fff, _("\n属性 : %s\n", "\nYour alignment : %s\n"), your_alignment(creature_ptr));
+ std::string alg = your_alignment(creature_ptr);
+ fprintf(fff, _("\n属性 : %s\n", "\nYour alignment : %s\n"), alg.c_str());
fprintf(fff, "\n");
dump_virtues(creature_ptr, fff);
}
#include "util/buffer-shaper.h"
#include "util/int-char-converter.h"
#include "world/world.h"
+#include <string>
/*
* List virtues & status
if (!open_temporary_file(&fff, file_name))
return;
- fprintf(fff, _("現在の属性 : %s\n\n", "Your alignment : %s\n\n"), your_alignment(creature_ptr));
+ std::string alg = your_alignment(creature_ptr);
+ fprintf(fff, _("現在の属性 : %s\n\n", "Your alignment : %s\n\n"), alg.c_str());
dump_virtues(creature_ptr, fff);
angband_fclose(fff);
(void)show_file(creature_ptr, TRUE, file_name, _("八つの徳", "Virtues"), 0, 0);
GAME_TEXT vir_name[20];
int tester = creature_ptr->virtues[v_nr];
strcpy(vir_name, virtue[(creature_ptr->vir_types[v_nr]) - 1]);
- concptr vir_val = show_actual_value ? format(_("(%d)", " (%d)"), tester) : "";
+ concptr vir_val = show_actual_value ? format(" (%d)", tester) : "";
if (creature_ptr->vir_types[v_nr] == 0 || creature_ptr->vir_types[v_nr] > MAX_VIRTUE)
fprintf(out_file, _("おっと。%sの情報なし。", "Oops. No info about %s."), vir_name);
* @param creature_ptr 算出するクリーチャーの参照ポインタ。
* @return アライメントの表記を返す。
*/
-concptr your_alignment(player_type *creature_ptr)
+concptr your_alignment(player_type *creature_ptr, bool with_value)
{
auto s = alignment_label(creature_ptr);
- if (show_actual_value)
- return format(_("%s(%ld)", "%s (%ld)"), s, creature_ptr->align);
+ if (with_value || show_actual_value)
+ return format(_("%s(%ld)", "%s (%ld)"), s, static_cast<long>(creature_ptr->align));
return s;
}
extern player_type *p_ptr;
-extern concptr your_alignment(player_type *creature_ptr);
+extern concptr your_alignment(player_type *creature_ptr, bool with_value = false);
extern int weapon_exp_level(int weapon_exp);
extern int riding_exp_level(int riding_exp);
extern int spell_exp_level(int spell_exp);
#include "view/display-player-stat-info.h"
#include "view/display-util.h"
#include "world/world.h"
+#include <string>
/*!
* @brief
display_player_one_line(ENTRY_WEIGHT, format("%d", (int)creature_ptr->wt), TERM_L_BLUE);
display_player_one_line(ENTRY_SOCIAL, format("%d", (int)creature_ptr->sc), TERM_L_BLUE);
#endif
- display_player_one_line(ENTRY_ALIGN, format("%s", your_alignment(creature_ptr)), TERM_L_BLUE);
+ std::string alg = your_alignment(creature_ptr);
+ display_player_one_line(ENTRY_ALIGN, format("%s", alg.c_str()), TERM_L_BLUE);
}
/*!
#include "player/player-race.h"
#include "player/player-status-table.h"
#include "term/screen-processor.h"
+#include <string>
void display_life_rating(player_type *creature_ptr, self_info_type *self_ptr)
{
void display_virtue(player_type *creature_ptr, self_info_type *self_ptr)
{
self_ptr->info[self_ptr->line++] = "";
- sprintf(self_ptr->plev_buf, _("現在の属性 : %s(%ld)", "Your alignment : %s(%ld)"), your_alignment(creature_ptr), (long int)creature_ptr->align);
+ std::string alg = your_alignment(creature_ptr, true);
+ sprintf(self_ptr->plev_buf, _("現在の属性 : %s", "Your alignment : %s"), alg.c_str());
strcpy(self_ptr->buf[1], self_ptr->plev_buf);
self_ptr->info[self_ptr->line++] = self_ptr->buf[1];
for (int v_nr = 0; v_nr < 8; v_nr++) {