• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision6b180a9a9b9228dbb004a08c668e68d390c35ff1 (tree)
Time2019-05-03 15:00:18
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 max_*_idx をいくつか整理.

Change Summary

Incremental Difference

--- a/src/artifact.c
+++ b/src/artifact.c
@@ -37,6 +37,11 @@ artifact_type *a_info;
3737 char *a_name;
3838 char *a_text;
3939
40+/*
41+ * Maximum number of artifacts in a_info.txt
42+ */
43+ARTIFACT_IDX max_a_idx;
44+
4045 static bool has_extreme_damage_rate(object_type *o_ptr);
4146 static bool weakening_artifact(object_type *o_ptr);
4247
--- a/src/artifact.h
+++ b/src/artifact.h
@@ -53,6 +53,8 @@ extern artifact_type *a_info;
5353 extern char *a_name;
5454 extern char *a_text;
5555
56+extern ARTIFACT_IDX max_a_idx;
57+
5658 /* artifact.c */
5759 extern bool create_artifact(object_type *o_ptr, bool a_scroll);
5860 extern int activation_index(object_type *o_ptr);
--- a/src/externs.h
+++ b/src/externs.h
@@ -233,12 +233,10 @@ extern monsterrace_hook_type get_mon_num_hook;
233233 extern monsterrace_hook_type get_mon_num2_hook;
234234 extern bool (*get_obj_num_hook)(KIND_OBJECT_IDX k_idx);
235235
236-extern QUEST_IDX max_q_idx;
237-extern MONRACE_IDX max_r_idx;
238-extern KIND_OBJECT_IDX max_k_idx;
236+
239237 extern VAULT_IDX max_v_idx;
240238 extern FEAT_IDX max_f_idx;
241-extern ARTIFACT_IDX max_a_idx;
239+
242240 extern EGO_IDX max_e_idx;
243241 extern DUNGEON_IDX max_d_idx;
244242 extern char quest_text[10][80];
--- a/src/main-win.c
+++ b/src/main-win.c
@@ -107,6 +107,7 @@
107107 #include "init.h"
108108 #include "files.h"
109109 #include "scores.h"
110+#include "quest.h"
110111
111112 #ifdef WINDOWS
112113 #include <windows.h>
--- a/src/monsterrace.c
+++ b/src/monsterrace.c
@@ -16,3 +16,7 @@ s16b alloc_race_size;
1616 */
1717 alloc_entry *alloc_race_table;
1818
19+/*
20+ * Maximum number of monsters in r_info.txt
21+ */
22+MONRACE_IDX max_r_idx;
--- a/src/monsterrace.h
+++ b/src/monsterrace.h
@@ -20,6 +20,7 @@ struct monster_blow
2020 DICE_SID d_side;
2121 };
2222
23+extern MONRACE_IDX max_r_idx;
2324
2425 /*
2526 * Monster "race" information, including racial memories
--- a/src/objectkind.c
+++ b/src/objectkind.c
@@ -10,6 +10,11 @@ char *k_name;
1010 char *k_text;
1111
1212 /*
13+ * Maximum number of items in k_info.txt
14+ */
15+KIND_OBJECT_IDX max_k_idx;
16+
17+/*
1318 * The size of "alloc_kind_table" (at most max_k_idx * 4)
1419 */
1520 s16b alloc_kind_size;
--- a/src/objectkind.h
+++ b/src/objectkind.h
@@ -65,6 +65,7 @@ struct object_kind
6565 extern object_kind *k_info;
6666 extern char *k_name;
6767 extern char *k_text;
68+extern KIND_OBJECT_IDX max_k_idx;
6869
6970 extern s16b alloc_kind_size;
7071 extern alloc_entry *alloc_kind_table;
--- a/src/quest.c
+++ b/src/quest.c
@@ -19,6 +19,11 @@
1919 */
2020 quest_type *quest;
2121
22+/*
23+ * Maximum number of quests
24+ */
25+QUEST_IDX max_q_idx;
26+
2227 /*!
2328 * @brief クエスト突入時のメッセージテーブル / Array of places to find an inscription
2429 */
--- a/src/quest.h
+++ b/src/quest.h
@@ -79,8 +79,9 @@ struct quest_type
7979 };
8080
8181 typedef struct quest_type quest_type;
82-
8382 extern quest_type *quest;
83+extern QUEST_IDX max_q_idx;
84+
8485 extern void determine_random_questor(quest_type *q_ptr);
8586 extern void complete_quest(QUEST_IDX quest_num);
8687 extern void check_quest_completion(monster_type *m_ptr);
--- a/src/variable.c
+++ b/src/variable.c
@@ -503,21 +503,6 @@ monsterrace_hook_type get_mon_num2_hook;
503503 bool (*get_obj_num_hook)(KIND_OBJECT_IDX k_idx);
504504
505505 /*
506- * Maximum number of quests
507- */
508-QUEST_IDX max_q_idx;
509-
510-/*
511- * Maximum number of monsters in r_info.txt
512- */
513-MONRACE_IDX max_r_idx;
514-
515-/*
516- * Maximum number of items in k_info.txt
517- */
518-KIND_OBJECT_IDX max_k_idx;
519-
520-/*
521506 * Maximum number of vaults in v_info.txt
522507 */
523508 VAULT_IDX max_v_idx;
@@ -528,11 +513,6 @@ VAULT_IDX max_v_idx;
528513 FEAT_IDX max_f_idx;
529514
530515 /*
531- * Maximum number of artifacts in a_info.txt
532- */
533-ARTIFACT_IDX max_a_idx;
534-
535-/*
536516 * Maximum number of ego-items in e_info.txt
537517 */
538518 EGO_IDX max_e_idx;
Show on old repository browser