• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisiona0edb1621ae625d9ddf2b3b8a3159a9d5f1af903 (tree)
Time2019-06-15 17:03:56
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 IS_WIZARD_CLASS マクロに player_type の引数を追加.

Change Summary

Incremental Difference

--- a/src/cmd-dump.c
+++ b/src/cmd-dump.c
@@ -837,7 +837,7 @@ static void do_cmd_disp_nikki(void)
837837
838838 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
839839 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)]);
840- else if (IS_WIZARD_CLASS())
840+ else if (IS_WIZARD_CLASS(p_ptr))
841841 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)+1]);
842842 else strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-2)+1]);
843843
--- a/src/player-class.h
+++ b/src/player-class.h
@@ -57,8 +57,9 @@
5757 #define CLASS_SNIPER 27
5858 #define MAX_CLASS 28 /*!< 職業の最大定義数 Maximum number of player "class" types (see "table.c", etc) */
5959
60-#define IS_WIZARD_CLASS() \
61- (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER || p_ptr->pclass == CLASS_MAGIC_EATER || p_ptr->pclass == CLASS_BLUE_MAGE)
60+#define IS_WIZARD_CLASS(C) \
61+ ((C)->pclass == CLASS_MAGE || (C)->pclass == CLASS_HIGH_MAGE || (C)->pclass == CLASS_SORCERER || \
62+ (C)->pclass == CLASS_MAGIC_EATER || (C)->pclass == CLASS_BLUE_MAGE)
6263
6364 /*
6465 * Information about the player's "magic"
--- a/src/realm-chaos.c
+++ b/src/realm-chaos.c
@@ -109,7 +109,7 @@ concptr do_chaos_spell(SPELL_IDX spell, BIT_FLAGS mode)
109109 POSITION rad = (plev < 30) ? 2 : 3;
110110 int base;
111111
112- if (IS_WIZARD_CLASS())
112+ if (IS_WIZARD_CLASS(p_ptr))
113113 base = plev + plev / 2;
114114 else
115115 base = plev + plev / 4;
--- a/src/realm-daemon.c
+++ b/src/realm-daemon.c
@@ -163,7 +163,7 @@ concptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
163163 POSITION rad = (plev < 30) ? 2 : 3;
164164 int base;
165165
166- if (IS_WIZARD_CLASS())
166+ if (IS_WIZARD_CLASS(p_ptr))
167167 base = plev + plev / 2;
168168 else
169169 base = plev + plev / 4;
--- a/src/realm-death.c
+++ b/src/realm-death.c
@@ -206,7 +206,7 @@ concptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
206206 POSITION rad = (plev < 30) ? 2 : 3;
207207 int base;
208208
209- if (IS_WIZARD_CLASS())
209+ if (IS_WIZARD_CLASS(p_ptr))
210210 base = plev + plev / 2;
211211 else
212212 base = plev + plev / 4;
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -2424,7 +2424,7 @@ bool recharge(int power)
24242424 /*** Determine Seriousness of Failure ***/
24252425
24262426 /* Mages recharge objects more safely. */
2427- if (IS_WIZARD_CLASS() || p_ptr->pclass == CLASS_MAGIC_EATER || p_ptr->pclass == CLASS_BLUE_MAGE)
2427+ if (IS_WIZARD_CLASS(p_ptr) || p_ptr->pclass == CLASS_MAGIC_EATER || p_ptr->pclass == CLASS_BLUE_MAGE)
24282428 {
24292429 /* 10% chance to blow up one rod, otherwise draining. */
24302430 if (o_ptr->tval == TV_ROD)
@@ -3491,7 +3491,7 @@ bool eat_magic(int power)
34913491 /*** Determine Seriousness of Failure ***/
34923492
34933493 /* Mages recharge objects more safely. */
3494- if (IS_WIZARD_CLASS())
3494+ if (IS_WIZARD_CLASS(p_ptr))
34953495 {
34963496 /* 10% chance to blow up one rod, otherwise draining. */
34973497 if (o_ptr->tval == TV_ROD)
Show on old repository browser