OSDN Git Service

[Refactor] #40647 Separated base-status-info.c/h from self-info.c
[hengbandforosx/hengbandosx.git] / src / player-info / base-status-info.c
1 #include "player-info/base-status-info.h"
2 #include "inventory/inventory-slot-types.h"
3 #include "player-info/self-info-util.h"
4 #include "object/object-flags.h"
5 #include "object-enchant/tr-types.h"
6 #include "util/bit-flags-calculator.h"
7
8 void set_equipment_influence(player_type *creature_ptr, self_info_type *si_ptr)
9 {
10     for (int k = INVEN_RARM; k < INVEN_TOTAL; k++) {
11         u32b tflgs[TR_FLAG_SIZE];
12         object_type *o_ptr = &creature_ptr->inventory_list[k];
13         if (o_ptr->k_idx == 0)
14             continue;
15
16         object_flags(creature_ptr, o_ptr, tflgs);
17         for (int j = 0; j < TR_FLAG_SIZE; j++)
18             si_ptr->flags[j] |= tflgs[j];
19     }
20
21     if (have_flag(si_ptr->flags, TR_STR))
22         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\98r\97Í\82Í\91\95\94õ\82É\82æ\82Á\82Ä\89e\8b¿\82ð\8eó\82¯\82Ä\82¢\82é\81B", "Your strength is affected by your equipment.");
23
24     if (have_flag(si_ptr->flags, TR_INT))
25         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\92m\94\\82Í\91\95\94õ\82É\82æ\82Á\82Ä\89e\8b¿\82ð\8eó\82¯\82Ä\82¢\82é\81B", "Your intelligence is affected by your equipment.");
26
27     if (have_flag(si_ptr->flags, TR_WIS))
28         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\8c«\82³\82Í\91\95\94õ\82É\82æ\82Á\82Ä\89e\8b¿\82ð\8eó\82¯\82Ä\82¢\82é\81B", "Your wisdom is affected by your equipment.");
29
30     if (have_flag(si_ptr->flags, TR_DEX))
31         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\8aí\97p\82³\82Í\91\95\94õ\82É\82æ\82Á\82Ä\89e\8b¿\82ð\8eó\82¯\82Ä\82¢\82é\81B", "Your dexterity is affected by your equipment.");
32
33     if (have_flag(si_ptr->flags, TR_CON))
34         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\91Ï\8bv\97Í\82Í\91\95\94õ\82É\82æ\82Á\82Ä\89e\8b¿\82ð\8eó\82¯\82Ä\82¢\82é\81B", "Your constitution is affected by your equipment.");
35
36     if (have_flag(si_ptr->flags, TR_CHR))
37         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\96£\97Í\82Í\91\95\94õ\82É\82æ\82Á\82Ä\89e\8b¿\82ð\8eó\82¯\82Ä\82¢\82é\81B", "Your charisma is affected by your equipment.");
38
39     if (have_flag(si_ptr->flags, TR_STEALTH))
40         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\89B\96§\8ds\93®\94\\97Í\82Í\91\95\94õ\82É\82æ\82Á\82Ä\89e\8b¿\82ð\8eó\82¯\82Ä\82¢\82é\81B", "Your stealth is affected by your equipment.");
41
42     if (have_flag(si_ptr->flags, TR_SEARCH))
43         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\92T\8dõ\94\\97Í\82Í\91\95\94õ\82É\82æ\82Á\82Ä\89e\8b¿\82ð\8eó\82¯\82Ä\82¢\82é\81B", "Your searching ability is affected by your equipment.");
44
45     if (have_flag(si_ptr->flags, TR_INFRA))
46         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\90Ô\8aO\90ü\8e\8b\97Í\82Í\91\95\94õ\82É\82æ\82Á\82Ä\89e\8b¿\82ð\8eó\82¯\82Ä\82¢\82é\81B", "Your infravision is affected by your equipment.");
47
48     if (have_flag(si_ptr->flags, TR_TUNNEL))
49         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\8dÌ\8c@\94\\97Í\82Í\91\95\94õ\82É\82æ\82Á\82Ä\89e\8b¿\82ð\8eó\82¯\82Ä\82¢\82é\81B", "Your digging ability is affected by your equipment.");
50
51     if (have_flag(si_ptr->flags, TR_SPEED))
52         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\83X\83s\81[\83h\82Í\91\95\94õ\82É\82æ\82Á\82Ä\89e\8b¿\82ð\8eó\82¯\82Ä\82¢\82é\81B", "Your speed is affected by your equipment.");
53
54     if (have_flag(si_ptr->flags, TR_BLOWS))
55         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\8dU\8c\82\91¬\93x\82Í\91\95\94õ\82É\82æ\82Á\82Ä\89e\8b¿\82ð\8eó\82¯\82Ä\82¢\82é\81B", "Your attack speed is affected by your equipment.");
56 }
57
58 void set_status_sustain_info(player_type *creature_ptr, self_info_type *si_ptr)
59 {
60     if (creature_ptr->sustain_str) {
61         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\98r\97Í\82Í\88Û\8e\9d\82³\82ê\82Ä\82¢\82é\81B", "Your strength is sustained.");
62     }
63     if (creature_ptr->sustain_int) {
64         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\92m\94\\82Í\88Û\8e\9d\82³\82ê\82Ä\82¢\82é\81B", "Your intelligence is sustained.");
65     }
66     if (creature_ptr->sustain_wis) {
67         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\8c«\82³\82Í\88Û\8e\9d\82³\82ê\82Ä\82¢\82é\81B", "Your wisdom is sustained.");
68     }
69     if (creature_ptr->sustain_con) {
70         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\91Ï\8bv\97Í\82Í\88Û\8e\9d\82³\82ê\82Ä\82¢\82é\81B", "Your constitution is sustained.");
71     }
72     if (creature_ptr->sustain_dex) {
73         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\8aí\97p\82³\82Í\88Û\8e\9d\82³\82ê\82Ä\82¢\82é\81B", "Your dexterity is sustained.");
74     }
75     if (creature_ptr->sustain_chr) {
76         si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Ì\96£\97Í\82Í\88Û\8e\9d\82³\82ê\82Ä\82¢\82é\81B", "Your charisma is sustained.");
77     }
78 }