• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisionfeb250fc813ebb746f436e524bd5a515c9f6f04c (tree)
Time2019-06-01 13:35:02
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 TVAL_* を object.h へ移動.

Change Summary

Incremental Difference

--- a/src/defines.h
+++ b/src/defines.h
@@ -279,87 +279,6 @@
279279
280280 /*** Object "tval" and "sval" codes ***/
281281
282-
283-/*
284- * The values for the "tval" field of various objects.
285- *
286- * This value is the primary means by which items are sorted in the
287- * player p_ptr->inventory_list, followed by "sval" and "cost".
288- *
289- * Note that a "BOW" with tval = 19 and sval S = 10*N+P takes a missile
290- * weapon with tval = 16+N, and does (xP) damage when so combined. This
291- * fact is not actually used in the source, but it kind of interesting.
292- *
293- * Note that as of 2.7.8, the "item flags" apply to all items, though
294- * only armor and weapons and a few other items use any of these flags.
295- */
296-
297-#define TV_SKELETON 1 /* Skeletons ('s'), not specified */
298-#define TV_BOTTLE 2 /* Empty bottles ('!') */
299-#define TV_JUNK 3 /* Sticks, Pottery, etc ('~') */
300-#define TV_WHISTLE 4 /* Whistle ('~') */
301-#define TV_SPIKE 5 /* Spikes ('~') */
302-#define TV_CHEST 7 /* Chests ('&') */
303-#define TV_FIGURINE 8 /* Magical figurines */
304-#define TV_STATUE 9 /* Statue, what a silly object... */
305-#define TV_CORPSE 10 /* Corpses and Skeletons, specific */
306-#define TV_CAPTURE 11 /* Monster ball */
307-#define TV_NO_AMMO 15 /* Ammo for crimson */
308-#define TV_SHOT 16 /* Ammo for slings */
309-#define TV_ARROW 17 /* Ammo for bows */
310-#define TV_BOLT 18 /* Ammo for x-bows */
311-#define TV_BOW 19 /* Slings/Bows/Xbows */
312-#define TV_DIGGING 20 /* Shovels/Picks */
313-#define TV_HAFTED 21 /* Priest Weapons */
314-#define TV_POLEARM 22 /* Axes and Pikes */
315-#define TV_SWORD 23 /* Edged Weapons */
316-#define TV_BOOTS 30 /* Boots */
317-#define TV_GLOVES 31 /* Gloves */
318-#define TV_HELM 32 /* Helms */
319-#define TV_CROWN 33 /* Crowns */
320-#define TV_SHIELD 34 /* Shields */
321-#define TV_CLOAK 35 /* Cloaks */
322-#define TV_SOFT_ARMOR 36 /* Soft Armor */
323-#define TV_HARD_ARMOR 37 /* Hard Armor */
324-#define TV_DRAG_ARMOR 38 /* Dragon Scale Mail */
325-#define TV_LITE 39 /* Lites (including Specials) */
326-#define TV_AMULET 40 /* Amulets (including Specials) */
327-#define TV_RING 45 /* Rings (including Specials) */
328-#define TV_CARD 50
329-#define TV_STAFF 55
330-#define TV_WAND 65
331-#define TV_ROD 66
332-#define TV_PARCHMENT 69
333-#define TV_SCROLL 70
334-#define TV_POTION 75
335-#define TV_FLASK 77
336-#define TV_FOOD 80
337-#define TV_LIFE_BOOK 90
338-#define TV_SORCERY_BOOK 91
339-#define TV_NATURE_BOOK 92
340-#define TV_CHAOS_BOOK 93
341-#define TV_DEATH_BOOK 94
342-#define TV_TRUMP_BOOK 95
343-#define TV_ARCANE_BOOK 96
344-#define TV_CRAFT_BOOK 97
345-#define TV_DAEMON_BOOK 98
346-#define TV_CRUSADE_BOOK 99
347-#define TV_MUSIC_BOOK 105
348-#define TV_HISSATSU_BOOK 106
349-#define TV_HEX_BOOK 107
350-#define TV_GOLD 127 /* Gold can only be picked up by players */
351-
352-#define TV_EQUIP_BEGIN TV_SHOT
353-#define TV_EQUIP_END TV_CARD
354-#define TV_MISSILE_BEGIN TV_SHOT
355-#define TV_MISSILE_END TV_BOLT
356-#define TV_WEARABLE_BEGIN TV_BOW
357-#define TV_WEARABLE_END TV_CARD
358-#define TV_WEAPON_BEGIN TV_BOW
359-#define TV_WEAPON_END TV_SWORD
360-#define TV_ARMOR_BEGIN TV_BOOTS
361-#define TV_ARMOR_END TV_DRAG_ARMOR
362-
363282 /* Any subvalue */
364283 #define SV_ANY 255
365284
--- a/src/object.h
+++ b/src/object.h
@@ -185,7 +185,88 @@ struct object_type
185185 POSITION iy; /* Y-position on map, or zero */
186186 POSITION ix; /* X-position on map, or zero */
187187
188+ /*
189+ * The values for the "tval" field of various objects.
190+ *
191+ * This value is the primary means by which items are sorted in the
192+ * player inventory_list, followed by "sval" and "cost".
193+ *
194+ * Note that a "BOW" with tval = 19 and sval S = 10*N+P takes a missile
195+ * weapon with tval = 16+N, and does (xP) damage when so combined. This
196+ * fact is not actually used in the source, but it kind of interesting.
197+ *
198+ * Note that as of 2.7.8, the "item flags" apply to all items, though
199+ * only armor and weapons and a few other items use any of these flags.
200+ */
201+
202+ #define TV_SKELETON 1 /* Skeletons ('s'), not specified */
203+ #define TV_BOTTLE 2 /* Empty bottles ('!') */
204+ #define TV_JUNK 3 /* Sticks, Pottery, etc ('~') */
205+ #define TV_WHISTLE 4 /* Whistle ('~') */
206+ #define TV_SPIKE 5 /* Spikes ('~') */
207+ #define TV_CHEST 7 /* Chests ('&') */
208+ #define TV_FIGURINE 8 /* Magical figurines */
209+ #define TV_STATUE 9 /* Statue, what a silly object... */
210+ #define TV_CORPSE 10 /* Corpses and Skeletons, specific */
211+ #define TV_CAPTURE 11 /* Monster ball */
212+ #define TV_NO_AMMO 15 /* Ammo for crimson */
213+ #define TV_SHOT 16 /* Ammo for slings */
214+ #define TV_ARROW 17 /* Ammo for bows */
215+ #define TV_BOLT 18 /* Ammo for x-bows */
216+ #define TV_BOW 19 /* Slings/Bows/Xbows */
217+ #define TV_DIGGING 20 /* Shovels/Picks */
218+ #define TV_HAFTED 21 /* Priest Weapons */
219+ #define TV_POLEARM 22 /* Axes and Pikes */
220+ #define TV_SWORD 23 /* Edged Weapons */
221+ #define TV_BOOTS 30 /* Boots */
222+ #define TV_GLOVES 31 /* Gloves */
223+ #define TV_HELM 32 /* Helms */
224+ #define TV_CROWN 33 /* Crowns */
225+ #define TV_SHIELD 34 /* Shields */
226+ #define TV_CLOAK 35 /* Cloaks */
227+ #define TV_SOFT_ARMOR 36 /* Soft Armor */
228+ #define TV_HARD_ARMOR 37 /* Hard Armor */
229+ #define TV_DRAG_ARMOR 38 /* Dragon Scale Mail */
230+ #define TV_LITE 39 /* Lites (including Specials) */
231+ #define TV_AMULET 40 /* Amulets (including Specials) */
232+ #define TV_RING 45 /* Rings (including Specials) */
233+ #define TV_CARD 50
234+ #define TV_STAFF 55
235+ #define TV_WAND 65
236+ #define TV_ROD 66
237+ #define TV_PARCHMENT 69
238+ #define TV_SCROLL 70
239+ #define TV_POTION 75
240+ #define TV_FLASK 77
241+ #define TV_FOOD 80
242+ #define TV_LIFE_BOOK 90
243+ #define TV_SORCERY_BOOK 91
244+ #define TV_NATURE_BOOK 92
245+ #define TV_CHAOS_BOOK 93
246+ #define TV_DEATH_BOOK 94
247+ #define TV_TRUMP_BOOK 95
248+ #define TV_ARCANE_BOOK 96
249+ #define TV_CRAFT_BOOK 97
250+ #define TV_DAEMON_BOOK 98
251+ #define TV_CRUSADE_BOOK 99
252+ #define TV_MUSIC_BOOK 105
253+ #define TV_HISSATSU_BOOK 106
254+ #define TV_HEX_BOOK 107
255+ #define TV_GOLD 127 /* Gold can only be picked up by players */
256+
257+ #define TV_EQUIP_BEGIN TV_SHOT
258+ #define TV_EQUIP_END TV_CARD
259+ #define TV_MISSILE_BEGIN TV_SHOT
260+ #define TV_MISSILE_END TV_BOLT
261+ #define TV_WEARABLE_BEGIN TV_BOW
262+ #define TV_WEARABLE_END TV_CARD
263+ #define TV_WEAPON_BEGIN TV_BOW
264+ #define TV_WEAPON_END TV_SWORD
265+ #define TV_ARMOR_BEGIN TV_BOOTS
266+ #define TV_ARMOR_END TV_DRAG_ARMOR
188267 OBJECT_TYPE_VALUE tval; /* Item type (from kind) */
268+
269+
189270 OBJECT_SUBTYPE_VALUE sval; /* Item sub-type (from kind) */
190271
191272 PARAMETER_VALUE pval; /* Item extra-parameter */
Show on old repository browser