#include <string>
-#include "io-dump/character-dump.h"
#include "artifact/fixed-art-types.h"
#include "cmd-building/cmd-building.h"
#include "dungeon/dungeon.h"
#include "game-option/birth-options.h"
#include "game-option/game-play-options.h"
#include "inventory/inventory-slot-types.h"
+#include "io-dump/character-dump.h"
#include "io-dump/player-status-dump.h"
#include "io-dump/special-class-dump.h"
#include "io/mutations-dump.h"
#include "monster/smart-learn-types.h"
#include "object/object-info.h"
#include "pet/pet-util.h"
-#include "player-info/avatar.h"
#include "player-info/alignment.h"
+#include "player-info/avatar.h"
#include "player/player-status-flags.h"
#include "player/player-status-table.h"
#include "player/race-info-table.h"
}
std::unique_ptr<PlayerAlignment> alignment(new PlayerAlignment(creature_ptr));
- std::string alg = alignment->your_alignment();
+ std::string alg = alignment->get_alignment();
fprintf(fff, _("\n属性 : %s\n", "\nYour alignment : %s\n"), alg.c_str());
fprintf(fff, "\n");
dump_virtues(creature_ptr, fff);
#include <cstdlib>
-#include "knowledge-self.h"
#include "birth/birth-explanations-table.h"
#include "core/show-file.h"
#include "flavor/flavor-describer.h"
#include "floor/floor-town.h"
#include "info-reader/fixed-map-parser.h"
#include "io-dump/dump-util.h"
-#include "player-info/avatar.h"
+#include "knowledge-self.h"
#include "player-info/alignment.h"
+#include "player-info/avatar.h"
#include "player/player-class.h"
#include "player/player-status-table.h"
#include "player/race-info-table.h"
return;
std::unique_ptr<PlayerAlignment> alignment(new PlayerAlignment(creature_ptr));
- std::string alg = alignment->your_alignment();
+ std::string alg = alignment->get_alignment();
fprintf(fff, _("現在の属性 : %s\n\n", "Your alignment : %s\n\n"), alg.c_str());
dump_virtues(creature_ptr, fff);
angband_fclose(fff);
if (monster_has_hostile_align(player_ptr, m_ptr, 0, 0, r_ptr))
return FALSE;
} else if (summon_specific_who < 0) {
- if (monster_has_hostile_align(player_ptr, NULL, 10, -10, r_ptr) && !one_in_(ABS(player_ptr->align) / 2 + 1))
+ if (monster_has_hostile_align(player_ptr, NULL, 10, -10, r_ptr) && !one_in_(ABS(player_ptr->alignment) / 2 + 1))
return FALSE;
}
sub_align1 = m_ptr->sub_align;
} else /* For player */
{
- if (player_ptr->align >= pa_good)
+ if (player_ptr->alignment >= pa_good)
sub_align1 |= SUB_ALIGN_GOOD;
- if (player_ptr->align <= pa_evil)
+ if (player_ptr->alignment <= pa_evil)
sub_align1 |= SUB_ALIGN_EVIL;
}
GAME_TEXT m_name[MAX_NLEN];
monster_desc(target_ptr, m_name, m_ptr, is_pet(m_ptr) ? MD_ASSUME_VISIBLE : 0);
- /* When riding a hostile align pet */
+ /* When riding a hostile alignment pet */
if (target_ptr->riding == m_idx) {
- if (abs(target_ptr->align / 10) < randint0(target_ptr->skill_exp[GINOU_RIDING]))
+ if (abs(target_ptr->alignment / 10) < randint0(target_ptr->skill_exp[GINOU_RIDING]))
return;
msg_format(_("%^sが突然暴れだした!", "%^s suddenly begins unruly!"), m_name);
*/
concptr PlayerAlignment::alignment_label()
{
- if (this->creature_ptr->align > 150)
+ if (this->creature_ptr->alignment > 150)
return _("大善", "Lawful");
- else if (this->creature_ptr->align > 50)
+ else if (this->creature_ptr->alignment > 50)
return _("中善", "Good");
- else if (this->creature_ptr->align > 10)
+ else if (this->creature_ptr->alignment > 10)
return _("小善", "Neutral Good");
- else if (this->creature_ptr->align > -11)
+ else if (this->creature_ptr->alignment > -11)
return _("中立", "Neutral");
- else if (this->creature_ptr->align > -51)
+ else if (this->creature_ptr->alignment > -51)
return _("小悪", "Neutral Evil");
- else if (this->creature_ptr->align > -151)
+ else if (this->creature_ptr->alignment > -151)
return _("中悪", "Evil");
else
return _("大悪", "Chaotic");
* @param creature_ptr 算出するクリーチャーの参照ポインタ。
* @return アライメントの表記を返す。
*/
-concptr PlayerAlignment::your_alignment(bool with_value)
+concptr PlayerAlignment::get_alignment(bool with_value)
{
auto s = alignment_label();
if (with_value || show_actual_value)
- return format(_("%s(%ld)", "%s (%ld)"), s, static_cast<long>(this->creature_ptr->align));
+ return format(_("%s(%ld)", "%s (%ld)"), s, static_cast<long>(this->creature_ptr->alignment));
return s;
}
PlayerAlignment(player_type *creature_ptr);
PlayerAlignment() = delete;
virtual ~PlayerAlignment() = default;
- concptr your_alignment(bool with_value = false);
+ concptr get_alignment(bool with_value = false);
private:
player_type *creature_ptr;
concptr alignment_label();
{
(void)mode; // unused
PERCENTAGE per = 100;
- if (creature_ptr->align > 10)
+ if (creature_ptr->alignment > 10)
per /= 2;
- else if (creature_ptr->align < -10)
+ else if (creature_ptr->alignment < -10)
per *= 2;
return per;
}
{
(void)mode; // unused
PERCENTAGE per = 100;
- if (creature_ptr->align > 10)
+ if (creature_ptr->alignment > 10)
per *= 2;
return per;
}
static void update_alignment(player_type *creature_ptr)
{
- creature_ptr->align = 0;
+ creature_ptr->alignment = 0;
floor_type *floor_ptr = creature_ptr->current_floor_ptr;
for (MONSTER_IDX m_idx = floor_ptr->m_max - 1; m_idx >= 1; m_idx--) {
monster_type *m_ptr;
continue;
if (any_bits(r_ptr->flags3, RF3_GOOD))
- creature_ptr->align += r_ptr->level;
+ creature_ptr->alignment += r_ptr->level;
if (any_bits(r_ptr->flags3, RF3_EVIL))
- creature_ptr->align -= r_ptr->level;
+ creature_ptr->alignment -= r_ptr->level;
}
if (creature_ptr->mimic_form) {
switch (creature_ptr->mimic_form) {
case MIMIC_DEMON:
- creature_ptr->align -= 200;
+ creature_ptr->alignment -= 200;
break;
case MIMIC_DEMON_LORD:
- creature_ptr->align -= 200;
+ creature_ptr->alignment -= 200;
break;
}
} else {
switch (creature_ptr->prace) {
case RACE_ARCHON:
- creature_ptr->align += 200;
+ creature_ptr->alignment += 200;
break;
case RACE_BALROG:
- creature_ptr->align -= 200;
+ creature_ptr->alignment -= 200;
break;
default:
continue;
if (creature_ptr->inventory_list[INVEN_MAIN_HAND + i].name1 != ART_IRON_BALL)
continue;
- creature_ptr->align -= 1000;
+ creature_ptr->alignment -= 1000;
}
int j = 0;
for (int i = 0; i < 8; i++) {
switch (creature_ptr->vir_types[i]) {
case V_JUSTICE:
- creature_ptr->align += creature_ptr->virtues[i] * 2;
+ creature_ptr->alignment += creature_ptr->virtues[i] * 2;
break;
case V_CHANCE:
break;
neutral[j++] = i;
break;
case V_UNLIFE:
- creature_ptr->align -= creature_ptr->virtues[i];
+ creature_ptr->alignment -= creature_ptr->virtues[i];
break;
default:
- creature_ptr->align += creature_ptr->virtues[i];
+ creature_ptr->alignment += creature_ptr->virtues[i];
break;
}
}
for (int i = 0; i < j; i++) {
- if (creature_ptr->align > 0) {
- creature_ptr->align -= creature_ptr->virtues[neutral[i]] / 2;
- if (creature_ptr->align < 0)
- creature_ptr->align = 0;
- } else if (creature_ptr->align < 0) {
- creature_ptr->align += creature_ptr->virtues[neutral[i]] / 2;
- if (creature_ptr->align > 0)
- creature_ptr->align = 0;
+ if (creature_ptr->alignment > 0) {
+ creature_ptr->alignment -= creature_ptr->virtues[neutral[i]] / 2;
+ if (creature_ptr->alignment < 0)
+ creature_ptr->alignment = 0;
+ } else if (creature_ptr->alignment < 0) {
+ creature_ptr->alignment += creature_ptr->virtues[neutral[i]] / 2;
+ if (creature_ptr->alignment > 0)
+ creature_ptr->alignment = 0;
}
}
}
* the room calling this function.\n
*\n
* We allocate space in 11x11 blocks, but want to make sure that rooms\n
- * align neatly on the standard screen. Therefore, we make them use\n
+ * alignment neatly on the standard screen. Therefore, we make them use\n
* blocks in few 11x33 rectangles as possible.\n
*\n
* Be careful to include the edges of the room in height and width!\n
*/
static void compensate_death_scythe_reflection_magnification(player_type *attacker_ptr, int *magnification, BIT_FLAGS *death_scythe_flags)
{
- if ((attacker_ptr->align < 0) && (*magnification < 20))
+ if ((attacker_ptr->alignment < 0) && (*magnification < 20))
*magnification = 20;
if (!(has_resist_acid(attacker_ptr) || is_oppose_acid(attacker_ptr) || has_immune_acid(attacker_ptr)) && (*magnification < 25))
PERCENTAGE penalty = (mp_ptr->spell_stat == A_WIS) ? 10 : 4;
switch (use_realm) {
case REALM_NATURE:
- if ((caster_ptr->align > 50) || (caster_ptr->align < -50))
+ if ((caster_ptr->alignment > 50) || (caster_ptr->alignment < -50))
chance += penalty;
break;
case REALM_LIFE:
case REALM_CRUSADE:
- if (caster_ptr->align < -20)
+ if (caster_ptr->alignment < -20)
chance += penalty;
break;
case REALM_DEATH:
case REALM_DAEMON:
case REALM_HEX:
- if (caster_ptr->align > 20)
+ if (caster_ptr->alignment > 20)
chance += penalty;
break;
}
bool sutemi{};
bool counter{};
- ALIGNMENT align{}; /* Good/evil/neutral */
+ ALIGNMENT alignment{}; /* Good/evil/neutral */
POSITION run_py{};
POSITION run_px{};
DIRECTION fishing_dir{};
display_player_one_line(ENTRY_SOCIAL, format("%d", (int)creature_ptr->sc), TERM_L_BLUE);
#endif
std::unique_ptr<PlayerAlignment> alignment(new PlayerAlignment(creature_ptr));
- std::string alg = alignment->your_alignment();
+ std::string alg = alignment->get_alignment();
display_player_one_line(ENTRY_ALIGN, format("%s", alg.c_str()), TERM_L_BLUE);
}
*/
void display_player_equippy(player_type *creature_ptr, TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode)
{
- int max_i = (mode & DP_WP) ? INVEN_BOW + 1 : INVEN_TOTAL;
- for (int i = INVEN_MAIN_HAND; i < max_i; i++)
- {
- object_type *o_ptr;
- o_ptr = &creature_ptr->inventory_list[i];
+ int max_i = (mode & DP_WP) ? INVEN_BOW + 1 : INVEN_TOTAL;
+ for (int i = INVEN_MAIN_HAND; i < max_i; i++) {
+ object_type *o_ptr;
+ o_ptr = &creature_ptr->inventory_list[i];
TERM_COLOR a = object_attr(o_ptr);
SYMBOL_CODE c = object_char(o_ptr);
#include "player-info/self-info-util.h"
#include "player/player-race.h"
#include "player/player-status-table.h"
-#include "player/player-status.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include <string>
{
self_ptr->info[self_ptr->line++] = "";
std::unique_ptr<PlayerAlignment> alignment(new PlayerAlignment(creature_ptr));
- std::string alg = alignment->your_alignment(true);
+ std::string alg = alignment->get_alignment(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];
case '\r':
break;
case 'a':
- msg_format("Your alignment is %d.", creature_ptr->align);
+ msg_format("Your alignment is %d.", creature_ptr->alignment);
break;
case 'c':
wiz_reset_class(creature_ptr);