1 #include "player-info/alignment.h"
2 #include "game-option/text-display-options.h"
3 #include "system/player-type-definition.h"
5 PlayerAlignment::PlayerAlignment(player_type *creature_ptr)
7 this->creature_ptr = creature_ptr;
11 * @brief クリーチャーの抽象的善悪アライメントの表記名のみを返す。 / Return only alignment title
12 * @param creature_ptr 算出するクリーチャーの参照ポインタ。
15 concptr PlayerAlignment::alignment_label()
17 if (this->creature_ptr->alignment > 150)
18 return _("大善", "Lawful");
19 else if (this->creature_ptr->alignment > 50)
20 return _("中善", "Good");
21 else if (this->creature_ptr->alignment > 10)
22 return _("小善", "Neutral Good");
23 else if (this->creature_ptr->alignment > -11)
24 return _("中立", "Neutral");
25 else if (this->creature_ptr->alignment > -51)
26 return _("小悪", "Neutral Evil");
27 else if (this->creature_ptr->alignment > -151)
28 return _("中悪", "Evil");
30 return _("大悪", "Chaotic");
34 * @brief クリーチャーの抽象的善悪アライメントの表記を返す。 / Return alignment title
35 * @param creature_ptr 算出するクリーチャーの参照ポインタ。
36 * @return アライメントの表記を返す。
38 concptr PlayerAlignment::get_alignment_description(bool with_value)
40 auto s = alignment_label();
41 if (with_value || show_actual_value)
42 return format(_("%s(%ld)", "%s (%ld)"), s, static_cast<long>(this->creature_ptr->alignment));