OSDN Git Service

[Refactor] #37353 パトロン周りの整理。 / Refactor about patrons.
authordeskull <deskull@users.sourceforge.jp>
Tue, 12 Mar 2019 04:29:24 +0000 (13:29 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 12 Mar 2019 04:29:24 +0000 (13:29 +0900)
src/birth.c
src/defines.h
src/externs.h
src/files.c
src/load.c
src/monster1.c
src/patron.c
src/patron.h

index 85e63d5..445d8a6 100644 (file)
@@ -16,6 +16,7 @@
 #include "history.h"
 #include "monsterrace-hook.h"
 #include "store.h"
+#include "patron.h"
 #include "quest.h"
 #include "player-status.h"
 #include "spells.h"
index 6a026d1..9b21e3c 100644 (file)
 #define MAX_SEXES        2 /*!< 性別の定義最大数 / Maximum number of player "sex" types (see "table.c", etc) */
 #define MAX_CLASS       28 /*!< 職業の最大定義数 Maximum number of player "class" types (see "table.c", etc) */
 #define MAX_SEIKAKU     13 /*!< 性格の最大定義数 */
-#define MAX_PATRON      16 /*!< カオスパトロンの最大定義数 / The number of "patrons" available (for Chaos Warriors) */
 
 /* ELDRITCH_HORRORによるsanity blast処理に関するメッセージの最大数 / Number of entries in the sanity-blast descriptions */
 #define MAX_SAN_HORROR 20 /*!< 恐ろしい対象の形容数(正常時) */
index a845efe..2166f1f 100644 (file)
@@ -92,9 +92,6 @@ extern const concptr color_names[16];
 extern const concptr stat_names[6];
 extern const concptr stat_names_reduced[6];
 extern const concptr window_flag_desc[32];
-extern const concptr chaos_patrons[MAX_PATRON];
-extern const int chaos_stats[MAX_PATRON];
-extern const int chaos_rewards[MAX_PATRON][20];
 extern const martial_arts ma_blows[MAX_MA];
 extern const int monk_ave_damage[PY_MAX_LEVEL+1][3];
 extern const concptr game_inscriptions[];
index fa1bf1e..3ecc3c0 100644 (file)
@@ -24,6 +24,7 @@
 #include "avatar.h"
 #include "shoot.h"
 #include "player-move.h"
+#include "patron.h"
 
 
 /*
index 7a4e383..b932c67 100644 (file)
@@ -51,6 +51,7 @@
 #include "spells-status.h"
 #include "object-hook.h"
 #include "wild.h"
+#include "patron.h"
 
 
 /*
index 8d48d4d..3e1c11e 100644 (file)
@@ -17,6 +17,7 @@
 #include "projection.h"
 #include "monster.h"
 #include "spells-summon.h"
+#include "patron.h"
 #include "quest.h"
 #include "artifact.h"
 #include "avatar.h"
@@ -3123,11 +3124,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
 
                do_cmd_write_nikki(NIKKI_BUNSHOU, 0, _("見事に変愚蛮怒の勝利者となった!", "become *WINNER* of Hengband finely!"));
 
-               if ((p_ptr->pclass == CLASS_CHAOS_WARRIOR) || (p_ptr->muta2 & MUT2_CHAOS_GIFT))
-               {
-                       msg_format(_("%sからの声が響いた。", "The voice of %s booms out:"), chaos_patrons[p_ptr->chaos_patron]);
-                       msg_print(_("『よくやった、定命の者よ!』", "'Thou art donst well, mortal!'"));
-               }
+               admire_from_patron(p_ptr);
 
                /* Congratulations */
                msg_print(_("*** おめでとう ***", "*** CONGRATULATIONS ***"));
index 4d55baa..ba3306d 100644 (file)
@@ -1,6 +1,7 @@
-#include "patron.h"
-
+
 #include "angband.h"
+
+#include "patron.h"
 #include "cmd-pet.h"
 #include "object-curse.h"
 #include "monsterrace-hook.h"
@@ -661,3 +662,11 @@ void gain_level_reward(int chosen_reward)
        }
 }
 
+void admire_from_patron(player_type *creature_ptr)
+{
+       if ((creature_ptr->pclass == CLASS_CHAOS_WARRIOR) || (creature_ptr->muta2 & MUT2_CHAOS_GIFT))
+       {
+               msg_format(_("%sからの声が響いた。", "The voice of %s booms out:"), chaos_patrons[creature_ptr->chaos_patron]);
+               msg_print(_("『よくやった、定命の者よ!』", "'Thou art donst well, mortal!'"));
+       }
+}
index 1f44a66..bff6cd9 100644 (file)
@@ -1,4 +1,7 @@
-/* カオスパトロンからの報酬種別定義 / Chaos Warrior: Reward types: */
+
+#define MAX_PATRON      16 /*!< カオスパトロンの最大定義数 / The number of "patrons" available (for Chaos Warriors) */
+
+/* カオスパトロンからの報酬種別定義 / Chaos Warrior: Reward types: */
 #define REW_POLY_SLF    1   /*!< カオスパトロンからの報酬: 自己変容 */
 #define REW_GAIN_EXP    2   /*!< カオスパトロンからの報酬: 経験値増加 */
 #define REW_LOSE_EXP    3   /*!< カオスパトロンからの報酬: 経験値減少 */
@@ -37,3 +40,6 @@
 #define REW_SER_MONS    36  /*!< カオスパトロンからの報酬: モンスターの下僕下賜 */
 
 extern void gain_level_reward(int chosen_reward);
+extern void admire_from_patron(player_type *creature_ptr);
+extern const concptr chaos_patrons[MAX_PATRON];
+