2 * @brief モンスターの思い出表示に必要なフラグ類の処理
7 #include "lore/monster-lore.h"
8 #include "game-option/cheat-options.h"
9 #include "lore/lore-calculator.h"
10 #include "lore/lore-util.h"
11 #include "lore/magic-types-setter.h"
12 #include "monster-race/monster-race.h"
13 #include "monster-race/race-flags1.h"
14 #include "monster-race/race-flags2.h"
15 #include "monster-race/race-flags3.h"
16 #include "monster-race/race-indice-types.h"
17 #include "monster-race/race-sex-const.h"
18 #include "player-ability/player-ability-types.h"
19 #include "system/angband.h"
20 #include "system/monster-race-info.h"
21 #include "term/term-color-types.h"
22 #include "view/display-lore-attacks.h"
23 #include "view/display-lore-drops.h"
24 #include "view/display-lore-magics.h"
25 #include "view/display-lore-status.h"
26 #include "view/display-lore.h"
29 static void set_msex_flags(lore_type *lore_ptr)
31 lore_ptr->msex = MSEX_NONE;
32 if (is_male(*(lore_ptr->r_ptr))) {
33 lore_ptr->msex = MSEX_MALE;
35 if (is_female(*(lore_ptr->r_ptr))) {
36 lore_ptr->msex = MSEX_FEMALE;
40 static void set_flags1(lore_type *lore_ptr)
42 if (lore_ptr->r_ptr->kind_flags.has(MonsterKindType::UNIQUE)) {
43 lore_ptr->kind_flags.set(MonsterKindType::UNIQUE);
46 if (lore_ptr->r_ptr->flags1 & RF1_QUESTOR) {
47 lore_ptr->flags1 |= (RF1_QUESTOR);
50 if (lore_ptr->r_ptr->flags1 & RF1_FRIENDS) {
51 lore_ptr->flags1 |= (RF1_FRIENDS);
54 if (lore_ptr->r_ptr->flags1 & RF1_ESCORT) {
55 lore_ptr->flags1 |= (RF1_ESCORT);
58 if (lore_ptr->r_ptr->flags1 & RF1_ESCORTS) {
59 lore_ptr->flags1 |= (RF1_ESCORTS);
63 static void set_race_flags(lore_type *lore_ptr)
65 if (!lore_ptr->r_ptr->r_tkills && !lore_ptr->know_everything) {
69 if (lore_ptr->r_ptr->kind_flags.has(MonsterKindType::ORC)) {
70 lore_ptr->kind_flags.set(MonsterKindType::ORC);
73 if (lore_ptr->r_ptr->kind_flags.has(MonsterKindType::TROLL)) {
74 lore_ptr->kind_flags.set(MonsterKindType::TROLL);
77 if (lore_ptr->r_ptr->kind_flags.has(MonsterKindType::GIANT)) {
78 lore_ptr->kind_flags.set(MonsterKindType::GIANT);
81 if (lore_ptr->r_ptr->kind_flags.has(MonsterKindType::DRAGON)) {
82 lore_ptr->kind_flags.set(MonsterKindType::DRAGON);
85 if (lore_ptr->r_ptr->kind_flags.has(MonsterKindType::DEMON)) {
86 lore_ptr->kind_flags.set(MonsterKindType::DEMON);
89 if (lore_ptr->r_ptr->kind_flags.has(MonsterKindType::UNDEAD)) {
90 lore_ptr->kind_flags.set(MonsterKindType::UNDEAD);
93 if (lore_ptr->r_ptr->kind_flags.has(MonsterKindType::EVIL)) {
94 lore_ptr->kind_flags.set(MonsterKindType::EVIL);
97 if (lore_ptr->r_ptr->kind_flags.has(MonsterKindType::GOOD)) {
98 lore_ptr->kind_flags.set(MonsterKindType::GOOD);
101 if (lore_ptr->r_ptr->kind_flags.has(MonsterKindType::ANIMAL)) {
102 lore_ptr->kind_flags.set(MonsterKindType::ANIMAL);
105 if (lore_ptr->r_ptr->kind_flags.has(MonsterKindType::AMBERITE)) {
106 lore_ptr->kind_flags.set(MonsterKindType::AMBERITE);
109 if (lore_ptr->r_ptr->kind_flags.has(MonsterKindType::HUMAN)) {
110 lore_ptr->kind_flags.set(MonsterKindType::HUMAN);
113 if (lore_ptr->r_ptr->kind_flags.has(MonsterKindType::QUANTUM)) {
114 lore_ptr->kind_flags.set(MonsterKindType::QUANTUM);
117 if (lore_ptr->r_ptr->flags1 & RF1_FORCE_DEPTH) {
118 lore_ptr->flags1 |= (RF1_FORCE_DEPTH);
121 if (lore_ptr->r_ptr->flags1 & RF1_FORCE_MAXHP) {
122 lore_ptr->flags1 |= (RF1_FORCE_MAXHP);
127 * @brief モンスターの思い出情報を表示するメインルーチン
128 * Hack -- display monster information using "hooked_roff()"
129 * @param r_idx モンスターの種族ID
130 * @param mode 表示オプション
132 * This function should only be called with the cursor placed at the
133 * left edge of the screen, on a cleared line, in which the recall is
134 * to take place. One extra blank line is left after the recall.
136 void process_monster_lore(PlayerType *player_ptr, MonsterRaceId r_idx, monster_lore_mode mode)
138 lore_type tmp_lore(r_idx, mode);
139 lore_type *lore_ptr = &tmp_lore;
141 auto is_valid_reinforcer = [](const auto &reinforce) {
142 auto [r_idx, dd, ds] = reinforce;
143 auto is_reinforce = MonsterRace(r_idx).is_valid();
144 is_reinforce &= dd > 0;
145 is_reinforce &= ds > 0;
149 lore_ptr->reinforce =
151 lore_ptr->r_ptr->reinforces.begin(), lore_ptr->r_ptr->reinforces.end(),
152 is_valid_reinforcer) != lore_ptr->r_ptr->reinforces.end();
154 if (cheat_know || (mode == MONSTER_LORE_RESEARCH) || (mode == MONSTER_LORE_DEBUG)) {
155 lore_ptr->know_everything = true;
158 set_flags_for_full_knowledge(lore_ptr);
159 set_msex_flags(lore_ptr);
160 set_flags1(lore_ptr);
161 set_race_flags(lore_ptr);
162 display_kill_numbers(lore_ptr);
163 concptr tmp = lore_ptr->r_ptr->text.data();
169 if (r_idx == MonsterRaceId::KAGE) {
174 if (!display_where_to_appear(lore_ptr)) {
178 display_monster_move(lore_ptr);
179 display_monster_never_move(lore_ptr);
181 hooked_roff(_("。", ". "));
182 lore_ptr->old = false;
185 display_lore_this(player_ptr, lore_ptr);
186 if (lore_ptr->special_flags.has(MonsterSpecialType::DIMINISH_MAX_DAMAGE)) {
187 hooked_roff(format(_("%s^は", "%s^ "), Who::who(lore_ptr->msex)));
188 hook_c_roff(TERM_RED, _("致命的な威力の攻撃に対して大きな耐性を持っている。", "has the strong resistance for a critical damage. "));
190 display_monster_aura(lore_ptr);
191 if (lore_ptr->flags2 & RF2_REFLECTING) {
192 hooked_roff(format(_("%s^は矢の呪文を跳ね返す。", "%s^ reflects bolt spells. "), Who::who(lore_ptr->msex)));
195 display_monster_collective(lore_ptr);
197 if (lore_ptr->ability_flags.has(MonsterAbilityType::SHRIEK)) {
198 lore_ptr->vp[lore_ptr->vn] = _("悲鳴で助けを求める", "shriek for help");
199 lore_ptr->color[lore_ptr->vn++] = TERM_L_WHITE;
202 display_monster_launching(player_ptr, lore_ptr);
203 if (lore_ptr->ability_flags.has(MonsterAbilityType::SPECIAL)) {
204 lore_ptr->vp[lore_ptr->vn] = _("特別な行動をする", "do something");
205 lore_ptr->color[lore_ptr->vn++] = TERM_VIOLET;
208 display_monster_sometimes(lore_ptr);
209 set_breath_types(player_ptr, lore_ptr);
210 display_monster_breath(lore_ptr);
213 set_ball_types(player_ptr, lore_ptr);
214 set_particular_types(player_ptr, lore_ptr);
215 set_bolt_types(player_ptr, lore_ptr);
216 set_status_types(lore_ptr);
217 set_teleport_types(lore_ptr);
218 set_floor_types(player_ptr, lore_ptr);
219 set_summon_types(lore_ptr);
220 display_monster_magic_types(lore_ptr);
221 display_mosnter_magic_possibility(lore_ptr);
222 display_monster_hp_ac(lore_ptr);
225 display_monster_concrete_abilities(lore_ptr);
226 display_monster_abilities(lore_ptr);
227 display_monster_constitutions(lore_ptr);
230 display_monster_concrete_weakness(lore_ptr);
231 display_monster_weakness(lore_ptr);
234 display_monster_concrete_resistances(lore_ptr);
235 display_monster_resistances(lore_ptr);
236 display_monster_evolution(lore_ptr);
239 display_monster_concrete_immunities(lore_ptr);
240 display_monster_immunities(lore_ptr);
241 display_monster_alert(lore_ptr);
242 display_monster_drops(lore_ptr);
243 display_monster_blows(lore_ptr);
244 display_monster_guardian(lore_ptr);