The master and develop branches track hengband.
OS X development happens on the macos-1-6-2, macos-2-2-1, and macos-develop branches.
Revision | 36aa118a3408549c451c4c01460dff9fc67e8664 (tree) |
---|---|
Zeit | 2020-10-25 00:35:53 |
Autor | deskull <deskull@user...> |
Commiter | deskull |
[Refactor] #40662 DARK_SOURCE をアイテムフラグに追加. / Add DARK_SOURCE item flag.
@@ -1033,6 +1033,7 @@ N:145:暗闇の | ||
1033 | 1033 | E:of Darkness |
1034 | 1034 | X:30:0 |
1035 | 1035 | W:0:36:0:0 |
1036 | +F:DARK_SOURCE | |
1036 | 1037 | C:0:0:0:0 |
1037 | 1038 | |
1038 | 1039 | N:146:不朽の眼の |
@@ -156,6 +156,7 @@ concptr k_info_flags[NUM_K_FLAGS] = { | ||
156 | 156 | "RES_TIME", |
157 | 157 | "RES_WATER", |
158 | 158 | "INVULN_ARROW", |
159 | + "DARK_SOURCE", | |
159 | 160 | }; |
160 | 161 | |
161 | 162 | /*! |
@@ -2,7 +2,7 @@ | ||
2 | 2 | |
3 | 3 | #include "system/angband.h" |
4 | 4 | |
5 | -#define NUM_K_FLAGS 146 | |
5 | +#define NUM_K_FLAGS 147 | |
6 | 6 | #define NUM_K_GENERATION_FLAGS 32 |
7 | 7 | |
8 | 8 | extern concptr k_info_flags[NUM_K_FLAGS]; |
@@ -154,5 +154,6 @@ typedef enum tr_type { | ||
154 | 154 | TR_RES_TIME = 143, |
155 | 155 | TR_RES_WATER = 144, |
156 | 156 | TR_INVULN_ARROW = 145, |
157 | - TR_FLAG_MAX = 146, | |
157 | + TR_DARK_SOURCE = 146, | |
158 | + TR_FLAG_MAX = 147, | |
158 | 159 | } tr_type; |
@@ -116,15 +116,15 @@ bool screen_object(player_type *player_ptr, object_type *o_ptr, BIT_FLAGS mode) | ||
116 | 116 | info[i++] = _("それは部屋に飾ると楽しい。", "It is cheerful."); |
117 | 117 | } |
118 | 118 | |
119 | - if (o_ptr->name2 == EGO_LITE_DARKNESS) | |
119 | + if (has_flag(flgs, TR_DARK_SOURCE)) | |
120 | 120 | info[i++] = _("それは全く光らない。", "It provides no light."); |
121 | 121 | |
122 | 122 | POSITION rad = 0; |
123 | - if (has_flag(flgs, TR_LITE_1) && o_ptr->name2 != EGO_LITE_DARKNESS) | |
123 | + if (has_flag(flgs, TR_LITE_1) && !has_flag(flgs, TR_DARK_SOURCE)) | |
124 | 124 | rad += 1; |
125 | - if (has_flag(flgs, TR_LITE_2) && o_ptr->name2 != EGO_LITE_DARKNESS) | |
125 | + if (has_flag(flgs, TR_LITE_2) && !has_flag(flgs, TR_DARK_SOURCE)) | |
126 | 126 | rad += 2; |
127 | - if (has_flag(flgs, TR_LITE_3) && o_ptr->name2 != EGO_LITE_DARKNESS) | |
127 | + if (has_flag(flgs, TR_LITE_3) && !has_flag(flgs, TR_DARK_SOURCE)) | |
128 | 128 | rad += 3; |
129 | 129 | if (has_flag(flgs, TR_LITE_M1)) |
130 | 130 | rad -= 1; |
@@ -136,7 +136,7 @@ bool screen_object(player_type *player_ptr, object_type *o_ptr, BIT_FLAGS mode) | ||
136 | 136 | if (o_ptr->name2 == EGO_LITE_SHINE) |
137 | 137 | rad++; |
138 | 138 | |
139 | - if (has_flag(flgs, TR_LITE_FUEL) && o_ptr->name2 != EGO_LITE_DARKNESS) { | |
139 | + if (has_flag(flgs, TR_LITE_FUEL) && !has_flag(flgs, TR_DARK_SOURCE)) { | |
140 | 140 | if (rad > 0) |
141 | 141 | sprintf(desc, _("それは燃料補給によって明かり(半径 %d)を授ける。", "It provides light (radius %d) when fueled."), (int)rad); |
142 | 142 | } else { |
@@ -75,13 +75,16 @@ void calc_lite_radius(player_type *creature_ptr) | ||
75 | 75 | for (inventory_slot_type i = INVEN_RARM; i < INVEN_TOTAL; i++) { |
76 | 76 | object_type *o_ptr; |
77 | 77 | o_ptr = &creature_ptr->inventory_list[i]; |
78 | + BIT_FLAGS flgs[TR_FLAG_SIZE]; | |
79 | + object_flags(creature_ptr, o_ptr, flgs); | |
80 | + | |
78 | 81 | if (!o_ptr->k_idx) |
79 | 82 | continue; |
80 | 83 | |
81 | 84 | if (o_ptr->name2 == EGO_LITE_SHINE) |
82 | 85 | creature_ptr->cur_lite++; |
83 | 86 | |
84 | - if (o_ptr->name2 != EGO_LITE_DARKNESS) { | |
87 | + if (has_flag(flgs, TR_DARK_SOURCE)) { | |
85 | 88 | if (o_ptr->tval == TV_LITE) { |
86 | 89 | if ((o_ptr->sval == SV_LITE_TORCH) && !(o_ptr->xtra4 > 0)) |
87 | 90 | continue; |
@@ -91,17 +94,15 @@ void calc_lite_radius(player_type *creature_ptr) | ||
91 | 94 | } |
92 | 95 | } |
93 | 96 | |
94 | - BIT_FLAGS flgs[TR_FLAG_SIZE]; | |
95 | - object_flags(creature_ptr, o_ptr, flgs); | |
96 | 97 | |
97 | 98 | POSITION rad = 0; |
98 | - if (has_flag(flgs, TR_LITE_1) && o_ptr->name2 != EGO_LITE_DARKNESS) | |
99 | + if (has_flag(flgs, TR_LITE_1) && !has_flag(flgs, TR_DARK_SOURCE)) | |
99 | 100 | rad += 1; |
100 | 101 | |
101 | - if (has_flag(flgs, TR_LITE_2) && o_ptr->name2 != EGO_LITE_DARKNESS) | |
102 | + if (has_flag(flgs, TR_LITE_2) && !has_flag(flgs, TR_DARK_SOURCE)) | |
102 | 103 | rad += 2; |
103 | 104 | |
104 | - if (has_flag(flgs, TR_LITE_3) && o_ptr->name2 != EGO_LITE_DARKNESS) | |
105 | + if (has_flag(flgs, TR_LITE_3) && !has_flag(flgs, TR_DARK_SOURCE)) | |
105 | 106 | rad += 3; |
106 | 107 | |
107 | 108 | if (has_flag(flgs, TR_LITE_M1)) |