• R/O
  • HTTP
  • SSH
  • HTTPS

hengbandosx: Commit

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.


Commit MetaInfo

Revision36aa118a3408549c451c4c01460dff9fc67e8664 (tree)
Zeit2020-10-25 00:35:53
Autordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #40662 DARK_SOURCE をアイテムフラグに追加. / Add DARK_SOURCE item flag.

Ändern Zusammenfassung

Diff

--- a/lib/edit/e_info.txt
+++ b/lib/edit/e_info.txt
@@ -1033,6 +1033,7 @@ N:145:暗闇の
10331033 E:of Darkness
10341034 X:30:0
10351035 W:0:36:0:0
1036+F:DARK_SOURCE
10361037 C:0:0:0:0
10371038
10381039 N:146:不朽の眼の
--- a/src/info-reader/kind-info-tokens-table.c
+++ b/src/info-reader/kind-info-tokens-table.c
@@ -156,6 +156,7 @@ concptr k_info_flags[NUM_K_FLAGS] = {
156156 "RES_TIME",
157157 "RES_WATER",
158158 "INVULN_ARROW",
159+ "DARK_SOURCE",
159160 };
160161
161162 /*!
--- a/src/info-reader/kind-info-tokens-table.h
+++ b/src/info-reader/kind-info-tokens-table.h
@@ -2,7 +2,7 @@
22
33 #include "system/angband.h"
44
5-#define NUM_K_FLAGS 146
5+#define NUM_K_FLAGS 147
66 #define NUM_K_GENERATION_FLAGS 32
77
88 extern concptr k_info_flags[NUM_K_FLAGS];
--- a/src/object-enchant/tr-types.h
+++ b/src/object-enchant/tr-types.h
@@ -154,5 +154,6 @@ typedef enum tr_type {
154154 TR_RES_TIME = 143,
155155 TR_RES_WATER = 144,
156156 TR_INVULN_ARROW = 145,
157- TR_FLAG_MAX = 146,
157+ TR_DARK_SOURCE = 146,
158+ TR_FLAG_MAX = 147,
158159 } tr_type;
--- a/src/perception/identification.c
+++ b/src/perception/identification.c
@@ -116,15 +116,15 @@ bool screen_object(player_type *player_ptr, object_type *o_ptr, BIT_FLAGS mode)
116116 info[i++] = _("それは部屋に飾ると楽しい。", "It is cheerful.");
117117 }
118118
119- if (o_ptr->name2 == EGO_LITE_DARKNESS)
119+ if (has_flag(flgs, TR_DARK_SOURCE))
120120 info[i++] = _("それは全く光らない。", "It provides no light.");
121121
122122 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))
124124 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))
126126 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))
128128 rad += 3;
129129 if (has_flag(flgs, TR_LITE_M1))
130130 rad -= 1;
@@ -136,7 +136,7 @@ bool screen_object(player_type *player_ptr, object_type *o_ptr, BIT_FLAGS mode)
136136 if (o_ptr->name2 == EGO_LITE_SHINE)
137137 rad++;
138138
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)) {
140140 if (rad > 0)
141141 sprintf(desc, _("それは燃料補給によって明かり(半径 %d)を授ける。", "It provides light (radius %d) when fueled."), (int)rad);
142142 } else {
--- a/src/specific-object/torch.c
+++ b/src/specific-object/torch.c
@@ -75,13 +75,16 @@ void calc_lite_radius(player_type *creature_ptr)
7575 for (inventory_slot_type i = INVEN_RARM; i < INVEN_TOTAL; i++) {
7676 object_type *o_ptr;
7777 o_ptr = &creature_ptr->inventory_list[i];
78+ BIT_FLAGS flgs[TR_FLAG_SIZE];
79+ object_flags(creature_ptr, o_ptr, flgs);
80+
7881 if (!o_ptr->k_idx)
7982 continue;
8083
8184 if (o_ptr->name2 == EGO_LITE_SHINE)
8285 creature_ptr->cur_lite++;
8386
84- if (o_ptr->name2 != EGO_LITE_DARKNESS) {
87+ if (has_flag(flgs, TR_DARK_SOURCE)) {
8588 if (o_ptr->tval == TV_LITE) {
8689 if ((o_ptr->sval == SV_LITE_TORCH) && !(o_ptr->xtra4 > 0))
8790 continue;
@@ -91,17 +94,15 @@ void calc_lite_radius(player_type *creature_ptr)
9194 }
9295 }
9396
94- BIT_FLAGS flgs[TR_FLAG_SIZE];
95- object_flags(creature_ptr, o_ptr, flgs);
9697
9798 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))
99100 rad += 1;
100101
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))
102103 rad += 2;
103104
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))
105106 rad += 3;
106107
107108 if (has_flag(flgs, TR_LITE_M1))
Show on old repository browser