OSDN Git Service

Merge remote-tracking branch 'remotes/hengbandosx/english-knowledge-edits' into featu...
[hengband/hengband.git] / src / view / display-lore-magics.c
1 #include "view/display-lore-magics.h"
2 #include "monster-race/race-flags2.h"
3 #include "term/term-color-types.h"
4
5 void display_monster_breath(lore_type *lore_ptr)
6 {
7     lore_ptr->breath = FALSE;
8     if (lore_ptr->vn <= 0)
9         return;
10
11     lore_ptr->breath = TRUE;
12     hooked_roff(format(_("%^sは", "%^s"), wd_he[lore_ptr->msex]));
13     for (int n = 0; n < lore_ptr->vn; n++) {
14 #ifdef JP
15         if (n != 0)
16             hooked_roff("や");
17 #else
18         if (n == 0)
19             hooked_roff(" may breathe ");
20         else if (n < lore_ptr->vn - 1)
21             hooked_roff(", ");
22         else
23             hooked_roff(" or ");
24 #endif
25         hook_c_roff(lore_ptr->color[n], lore_ptr->vp[n]);
26     }
27
28 #ifdef JP
29     hooked_roff("のブレスを吐くことがある");
30 #endif
31 }
32
33 void display_monster_magic_types(lore_type *lore_ptr)
34 {
35     lore_ptr->magic = FALSE;
36     if (lore_ptr->vn == 0)
37         return;
38
39     lore_ptr->magic = TRUE;
40     if (lore_ptr->breath) {
41         hooked_roff(_("、なおかつ", ", and is also"));
42     } else {
43         hooked_roff(format(_("%^sは", "%^s is"), wd_he[lore_ptr->msex]));
44     }
45
46 #ifdef JP
47     if (lore_ptr->flags2 & (RF2_SMART))
48         hook_c_roff(TERM_YELLOW, "的確に");
49
50     hooked_roff("魔法を使うことができ、");
51 #else
52     hooked_roff(" magical, casting spells");
53     if (lore_ptr->flags2 & RF2_SMART)
54         hook_c_roff(TERM_YELLOW, " intelligently");
55 #endif
56
57     for (int n = 0; n < lore_ptr->vn; n++) {
58 #ifdef JP
59         if (n != 0)
60             hooked_roff("、");
61 #else
62         if (n == 0)
63             hooked_roff(" which ");
64         else if (n < lore_ptr->vn - 1)
65             hooked_roff(", ");
66         else
67             hooked_roff(" or ");
68 #endif
69         hook_c_roff(lore_ptr->color[n], lore_ptr->vp[n]);
70     }
71
72 #ifdef JP
73     hooked_roff("の呪文を唱えることがある");
74 #endif
75 }
76
77 void display_mosnter_magic_possibility(lore_type *lore_ptr)
78 {
79     if (!lore_ptr->breath && !lore_ptr->magic)
80         return;
81
82     int m = lore_ptr->r_ptr->r_cast_spell;
83     int n = lore_ptr->r_ptr->freq_spell;
84     if (m > 100 || lore_ptr->know_everything) {
85         hooked_roff(format(_("(確率:1/%d)", "; 1 time in %d"), 100 / n));
86     } else if (m) {
87         n = ((n + 9) / 10) * 10;
88         hooked_roff(format(_("(確率:約1/%d)", "; about 1 time in %d"), 100 / n));
89     }
90
91     hooked_roff(_("。", ".  "));
92 }