OSDN Git Service

2605b561deb42eb50b365ed06c7a6cd843dbbdef
[hengbandforosx/hengbandosx.git] / src / lore / lore-util.cpp
1 #include "lore/lore-util.h"
2 #include "game-option/birth-options.h"
3 #include "monster-attack/monster-attack-table.h"
4 #include "monster-race/monster-race.h"
5 #include "system/monster-race-info.h"
6 #include "term/screen-processor.h"
7 #include "term/term-color-types.h"
8
9 const who_word_definition Who::words = {
10     { WHO_WORD_TYPE::WHO,
11         {
12             { false, { { MSEX_NONE, _("それ", "it") }, { MSEX_MALE, _("彼", "he") }, { MSEX_FEMALE, _("彼女", "she") } } },
13             { true, { { MSEX_NONE, _("それら", "they") }, { MSEX_MALE, _("彼ら", "they") }, { MSEX_FEMALE, _("彼女ら", "they") } } },
14         } },
15     { WHO_WORD_TYPE::WHOSE,
16         {
17             { false, { { MSEX_NONE, _("それの", "its") }, { MSEX_MALE, _("彼の", "his") }, { MSEX_FEMALE, _("彼女の", "her") } } },
18             { true, { { MSEX_NONE, _("それらの", "their") }, { MSEX_MALE, _("彼らの", "their") }, { MSEX_FEMALE, _("彼女らの", "their") } } },
19         } },
20     { WHO_WORD_TYPE::WHOM,
21         {
22             { false, { { MSEX_NONE, _("それ", "it") }, { MSEX_MALE, _("彼", "him") }, { MSEX_FEMALE, _("彼女", "her") } } },
23             { true, { { MSEX_NONE, _("それら", "them") }, { MSEX_MALE, _("彼ら", "them") }, { MSEX_FEMALE, _("彼女ら", "them") } } },
24         } },
25 };
26
27 /*
28  * Prepare hook for c_roff(). It will be changed for spoiler generation in wizard1.c.
29  */
30 hook_c_roff_pf hook_c_roff = c_roff;
31
32 lore_type::lore_type(MonsterRaceId r_idx, monster_lore_mode mode)
33     : r_idx(r_idx)
34     , mode(mode)
35     , msex(MSEX_NONE)
36     , method(RaceBlowMethodType::NONE)
37 {
38     this->nightmare = ironman_nightmare && (mode != MONSTER_LORE_DEBUG);
39     this->r_ptr = &monraces_info[r_idx];
40     this->speed = this->nightmare ? this->r_ptr->speed + 5 : this->r_ptr->speed;
41     this->drop_gold = this->r_ptr->r_drop_gold;
42     this->drop_item = this->r_ptr->r_drop_item;
43     this->flags1 = (this->r_ptr->flags1 & this->r_ptr->r_flags1);
44     this->flags2 = (this->r_ptr->flags2 & this->r_ptr->r_flags2);
45     this->flags3 = (this->r_ptr->flags3 & this->r_ptr->r_flags3);
46     this->ability_flags = (this->r_ptr->ability_flags & this->r_ptr->r_ability_flags);
47     this->aura_flags = (this->r_ptr->aura_flags & this->r_ptr->r_aura_flags);
48     this->behavior_flags = (this->r_ptr->behavior_flags & this->r_ptr->r_behavior_flags);
49     this->drop_flags = (this->r_ptr->drop_flags & this->r_ptr->r_drop_flags);
50     this->flags7 = (this->r_ptr->flags7 & this->r_ptr->flags7);
51     this->resistance_flags = (this->r_ptr->resistance_flags & this->r_ptr->r_resistance_flags);
52     this->feature_flags = (this->r_ptr->feature_flags & this->r_ptr->r_feature_flags);
53     this->brightness_flags = this->r_ptr->brightness_flags;
54     this->special_flags = (this->r_ptr->special_flags & this->r_ptr->r_special_flags);
55     this->misc_flags = (this->r_ptr->misc_flags & this->r_ptr->r_misc_flags);
56 }
57
58 /*!
59  * @brief モンスターの思い出メッセージをあらかじめ指定された関数ポインタに基づき出力する
60  * @param str 出力文字列
61  */
62 void hooked_roff(std::string_view str)
63 {
64     hook_c_roff(TERM_WHITE, str);
65 }