• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionf5aecf5a23cdb9af0d353f0f0c02f7e56acaa5b9 (tree)
Time2019-06-15 16:57:46
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-eat.c
+++ b/src/cmd-eat.c
@@ -335,7 +335,7 @@ void do_cmd_eat_food_aux(INVENTORY_IDX item)
335335
336336
337337 /* Food can feed the player */
338- if (PRACE_IS_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
338+ if (PRACE_IS_(p_ptr, RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
339339 {
340340 /* Reduced nutritional benefit */
341341 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
@@ -346,10 +346,10 @@ void do_cmd_eat_food_aux(INVENTORY_IDX item)
346346 msg_print(_("あなたの飢えは新鮮な血によってのみ満たされる!",
347347 "Your hunger can only be satisfied with fresh blood!"));
348348 }
349- else if ((PRACE_IS_(RACE_SKELETON) ||
350- PRACE_IS_(RACE_GOLEM) ||
351- PRACE_IS_(RACE_ZOMBIE) ||
352- PRACE_IS_(RACE_SPECTRE)) &&
349+ else if ((PRACE_IS_(p_ptr, RACE_SKELETON) ||
350+ PRACE_IS_(p_ptr, RACE_GOLEM) ||
351+ PRACE_IS_(p_ptr, RACE_ZOMBIE) ||
352+ PRACE_IS_(p_ptr, RACE_SPECTRE)) &&
353353 (o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND))
354354 {
355355 concptr staff;
@@ -420,7 +420,7 @@ void do_cmd_eat_food_aux(INVENTORY_IDX item)
420420 /* Don't eat a staff/wand itself */
421421 return;
422422 }
423- else if ((PRACE_IS_(RACE_DEMON) ||
423+ else if ((PRACE_IS_(p_ptr, RACE_DEMON) ||
424424 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON)) &&
425425 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_CORPSE &&
426426 my_strchr("pht", r_info[o_ptr->pval].d_char)))
@@ -431,7 +431,7 @@ void do_cmd_eat_food_aux(INVENTORY_IDX item)
431431 msg_format(_("%sは燃え上り灰になった。精力を吸収した気がする。", "%^s is burnt to ashes. You absorb its vitality!"), o_name);
432432 (void)set_food(PY_FOOD_MAX - 1);
433433 }
434- else if (PRACE_IS_(RACE_SKELETON))
434+ else if (PRACE_IS_(p_ptr, RACE_SKELETON))
435435 {
436436 #if 0
437437 if (o_ptr->tval == TV_SKELETON ||
@@ -460,12 +460,12 @@ void do_cmd_eat_food_aux(INVENTORY_IDX item)
460460 msg_print(_("食べ物がアゴを素通りして落ち、消えた!", "The food falls through your jaws and vanishes!"));
461461 }
462462 }
463- else if (PRACE_IS_(RACE_GOLEM) ||
464- PRACE_IS_(RACE_ZOMBIE) ||
465- PRACE_IS_(RACE_ENT) ||
466- PRACE_IS_(RACE_DEMON) ||
467- PRACE_IS_(RACE_ANDROID) ||
468- PRACE_IS_(RACE_SPECTRE) ||
463+ else if (PRACE_IS_(p_ptr, RACE_GOLEM) ||
464+ PRACE_IS_(p_ptr, RACE_ZOMBIE) ||
465+ PRACE_IS_(p_ptr, RACE_ENT) ||
466+ PRACE_IS_(p_ptr, RACE_DEMON) ||
467+ PRACE_IS_(p_ptr, RACE_ANDROID) ||
468+ PRACE_IS_(p_ptr, RACE_SPECTRE) ||
469469 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
470470 {
471471 msg_print(_("生者の食物はあなたにとってほとんど栄養にならない。", "The food of mortals is poor sustenance for you."));
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -134,11 +134,11 @@ void do_cmd_quaff_potion_aux(INVENTORY_IDX item)
134134 case SV_POTION_SALT_WATER:
135135 msg_print(_("うぇ!思わず吐いてしまった。", "The potion makes you vomit!"));
136136
137- if (!(PRACE_IS_(RACE_GOLEM) ||
138- PRACE_IS_(RACE_ZOMBIE) ||
139- PRACE_IS_(RACE_DEMON) ||
140- PRACE_IS_(RACE_ANDROID) ||
141- PRACE_IS_(RACE_SPECTRE) ||
137+ if (!(PRACE_IS_(p_ptr, RACE_GOLEM) ||
138+ PRACE_IS_(p_ptr, RACE_ZOMBIE) ||
139+ PRACE_IS_(p_ptr, RACE_DEMON) ||
140+ PRACE_IS_(p_ptr, RACE_ANDROID) ||
141+ PRACE_IS_(p_ptr, RACE_SPECTRE) ||
142142 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)))
143143 {
144144 /* Only living creatures get thirsty */
@@ -512,7 +512,7 @@ void do_cmd_quaff_potion_aux(INVENTORY_IDX item)
512512 }
513513 }
514514
515- if (PRACE_IS_(RACE_SKELETON))
515+ if (PRACE_IS_(p_ptr, RACE_SKELETON))
516516 {
517517 msg_print(_("液体の一部はあなたのアゴを素通りして落ちた!", "Some of the fluid falls through your jaws!"));
518518 (void)potion_smash_effect(0, p_ptr->y, p_ptr->x, q_ptr->k_idx);
--- a/src/cmd-usestaff.c
+++ b/src/cmd-usestaff.c
@@ -262,8 +262,8 @@ int staff_effect(OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, boo
262262 case SV_STAFF_NOTHING:
263263 {
264264 msg_print(_("何も起らなかった。", "Nothing happen."));
265- if (PRACE_IS_(RACE_SKELETON) || PRACE_IS_(RACE_GOLEM) ||
266- PRACE_IS_(RACE_ZOMBIE) || PRACE_IS_(RACE_SPECTRE))
265+ if (PRACE_IS_(p_ptr, RACE_SKELETON) || PRACE_IS_(p_ptr, RACE_GOLEM) ||
266+ PRACE_IS_(p_ptr, RACE_ZOMBIE) || PRACE_IS_(p_ptr, RACE_SPECTRE))
267267 msg_print(_("もったいない事をしたような気がする。食べ物は大切にしなくては。", "What a waste. It's your food!"));
268268 break;
269269 }
--- a/src/core.c
+++ b/src/core.c
@@ -694,7 +694,7 @@ static bool pattern_effect(void)
694694
695695 if (!pattern_tile(p_ptr->y, p_ptr->x)) return FALSE;
696696
697- if ((PRACE_IS_(RACE_AMBERITE)) &&
697+ if ((PRACE_IS_(p_ptr, RACE_AMBERITE)) &&
698698 (p_ptr->cut > 0) && one_in_(10))
699699 {
700700 wreck_the_pattern();
@@ -735,7 +735,7 @@ static bool pattern_effect(void)
735735 break;
736736
737737 default:
738- if (PRACE_IS_(RACE_AMBERITE) && !one_in_(2))
738+ if (PRACE_IS_(p_ptr, RACE_AMBERITE) && !one_in_(2))
739739 return TRUE;
740740 else if (!IS_INVULN())
741741 take_hit(DAMAGE_NOESCAPE, damroll(1, 3), _("「パターン」を歩いたダメージ", "walking the Pattern"), -1);
@@ -1397,7 +1397,7 @@ static void process_world_aux_hp_and_sp(void)
13971397 }
13981398
13991399 /* (Vampires) Take damage from sunlight */
1400- if (PRACE_IS_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
1400+ if (PRACE_IS_(p_ptr, RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
14011401 {
14021402 if (!current_floor_ptr->dun_level && !p_ptr->resist_lite && !IS_INVULN() && is_daytime())
14031403 {
@@ -1445,7 +1445,7 @@ static void process_world_aux_hp_and_sp(void)
14451445
14461446 if (damage)
14471447 {
1448- if(PRACE_IS_(RACE_ENT)) damage += damage / 3;
1448+ if(PRACE_IS_(p_ptr, RACE_ENT)) damage += damage / 3;
14491449 if(p_ptr->resist_fire) damage = damage / 3;
14501450 if(IS_OPPOSE_FIRE()) damage = damage / 3;
14511451 if(p_ptr->levitation) damage = damage / 5;
@@ -1640,7 +1640,7 @@ static void process_world_aux_hp_and_sp(void)
16401640 if ((r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !p_ptr->immune_fire)
16411641 {
16421642 damage = r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].level / 2;
1643- if (PRACE_IS_(RACE_ENT)) damage += damage / 3;
1643+ if (PRACE_IS_(p_ptr, RACE_ENT)) damage += damage / 3;
16441644 if (p_ptr->resist_fire) damage = damage / 3;
16451645 if (IS_OPPOSE_FIRE()) damage = damage / 3;
16461646 msg_print(_("熱い!", "It's hot!"));
@@ -1649,7 +1649,7 @@ static void process_world_aux_hp_and_sp(void)
16491649 if ((r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !p_ptr->immune_elec)
16501650 {
16511651 damage = r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].level / 2;
1652- if (PRACE_IS_(RACE_ANDROID)) damage += damage / 3;
1652+ if (PRACE_IS_(p_ptr, RACE_ANDROID)) damage += damage / 3;
16531653 if (p_ptr->resist_elec) damage = damage / 3;
16541654 if (IS_OPPOSE_ELEC()) damage = damage / 3;
16551655 msg_print(_("痛い!", "It hurts!"));
--- a/src/files.c
+++ b/src/files.c
@@ -2743,7 +2743,7 @@ static void tim_player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE])
27432743 if (IS_FAST() || p_ptr->slow)
27442744 add_flag(flgs, TR_SPEED);
27452745
2746- if (IS_OPPOSE_ACID() && !(p_ptr->special_defense & DEFENSE_ACID) && !(PRACE_IS_(RACE_YEEK) && (p_ptr->lev > 19)))
2746+ if (IS_OPPOSE_ACID() && !(p_ptr->special_defense & DEFENSE_ACID) && !(PRACE_IS_(p_ptr, RACE_YEEK) && (p_ptr->lev > 19)))
27472747 add_flag(flgs, TR_RES_ACID);
27482748 if (IS_OPPOSE_ELEC() && !(p_ptr->special_defense & DEFENSE_ELEC))
27492749 add_flag(flgs, TR_RES_ELEC);
@@ -2942,13 +2942,13 @@ static void player_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE])
29422942 for (i = 0; i < TR_FLAG_SIZE; i++)
29432943 flgs[i] = 0L;
29442944
2945- if (PRACE_IS_(RACE_SPECTRE))
2945+ if (PRACE_IS_(p_ptr, RACE_SPECTRE))
29462946 add_flag(flgs, TR_RES_NETHER);
2947- if (p_ptr->mimic_form == MIMIC_VAMPIRE || PRACE_IS_(RACE_VAMPIRE))
2947+ if (p_ptr->mimic_form == MIMIC_VAMPIRE || PRACE_IS_(p_ptr, RACE_VAMPIRE))
29482948 add_flag(flgs, TR_RES_DARK);
29492949 if (p_ptr->mimic_form == MIMIC_DEMON_LORD)
29502950 add_flag(flgs, TR_RES_FIRE);
2951- else if (PRACE_IS_(RACE_YEEK) && p_ptr->lev > 19)
2951+ else if (PRACE_IS_(p_ptr, RACE_YEEK) && p_ptr->lev > 19)
29522952 add_flag(flgs, TR_RES_ACID);
29532953 }
29542954
@@ -3001,11 +3001,11 @@ static void player_vuln_flags(BIT_FLAGS flgs[TR_FLAG_SIZE])
30013001 add_flag(flgs, TR_RES_FIRE);
30023002 add_flag(flgs, TR_RES_COLD);
30033003 }
3004- if (PRACE_IS_(RACE_ANDROID))
3004+ if (PRACE_IS_(p_ptr, RACE_ANDROID))
30053005 add_flag(flgs, TR_RES_ELEC);
3006- if (PRACE_IS_(RACE_ENT))
3006+ if (PRACE_IS_(p_ptr, RACE_ENT))
30073007 add_flag(flgs, TR_RES_FIRE);
3008- if (PRACE_IS_(RACE_VAMPIRE) || PRACE_IS_(RACE_S_FAIRY) ||
3008+ if (PRACE_IS_(p_ptr, RACE_VAMPIRE) || PRACE_IS_(p_ptr, RACE_S_FAIRY) ||
30093009 (p_ptr->mimic_form == MIMIC_VAMPIRE))
30103010 add_flag(flgs, TR_RES_LITE);
30113011 }
@@ -3614,7 +3614,7 @@ static void display_player_stat_info(void)
36143614 if ((p_ptr->stat_max[i] > 18) && (p_ptr->stat_top[i] <= 18))
36153615 e_adj = p_ptr->stat_top[i] - (p_ptr->stat_max[i] - 19) / 10 - 19;
36163616
3617- if (PRACE_IS_(RACE_ENT))
3617+ if (PRACE_IS_(p_ptr, RACE_ENT))
36183618 {
36193619 switch (i)
36203620 {
--- a/src/mspells1.c
+++ b/src/mspells1.c
@@ -261,7 +261,7 @@ static void remove_bad_spells(MONSTER_IDX m_idx, u32b *f4p, u32b *f5p, u32b *f6p
261261
262262 if (smart & (SM_RES_NETH))
263263 {
264- if (PRACE_IS_(RACE_SPECTRE))
264+ if (PRACE_IS_(p_ptr, RACE_SPECTRE))
265265 {
266266 f4 &= ~(RF4_BR_NETH);
267267 f5 &= ~(RF5_BA_NETH);
@@ -283,7 +283,7 @@ static void remove_bad_spells(MONSTER_IDX m_idx, u32b *f4p, u32b *f5p, u32b *f6p
283283
284284 if (smart & (SM_RES_DARK))
285285 {
286- if (PRACE_IS_(RACE_VAMPIRE))
286+ if (PRACE_IS_(p_ptr, RACE_VAMPIRE))
287287 {
288288 f4 &= ~(RF4_BR_DARK);
289289 f5 &= ~(RF5_BA_DARK);
--- a/src/object-hook.c
+++ b/src/object-hook.c
@@ -124,7 +124,7 @@ bool item_tester_hook_eatable(object_type *o_ptr)
124124 if (o_ptr->tval == TV_FOOD) return TRUE;
125125
126126 #if 0
127- if (PRACE_IS_(RACE_SKELETON))
127+ if (PRACE_IS_(p_ptr, RACE_SKELETON))
128128 {
129129 if (o_ptr->tval == TV_SKELETON ||
130130 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
@@ -133,15 +133,15 @@ bool item_tester_hook_eatable(object_type *o_ptr)
133133 else
134134 #endif
135135
136- if (PRACE_IS_(RACE_SKELETON) ||
137- PRACE_IS_(RACE_GOLEM) ||
138- PRACE_IS_(RACE_ZOMBIE) ||
139- PRACE_IS_(RACE_SPECTRE))
136+ if (PRACE_IS_(p_ptr, RACE_SKELETON) ||
137+ PRACE_IS_(p_ptr, RACE_GOLEM) ||
138+ PRACE_IS_(p_ptr, RACE_ZOMBIE) ||
139+ PRACE_IS_(p_ptr, RACE_SPECTRE))
140140 {
141141 if (o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND)
142142 return TRUE;
143143 }
144- else if (PRACE_IS_(RACE_DEMON) || (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON))
144+ else if (PRACE_IS_(p_ptr, RACE_DEMON) || (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON))
145145 {
146146 if (o_ptr->tval == TV_CORPSE &&
147147 o_ptr->sval == SV_CORPSE &&
@@ -266,7 +266,7 @@ bool item_tester_hook_quaff(object_type *o_ptr)
266266 {
267267 if (o_ptr->tval == TV_POTION) return TRUE;
268268
269- if (PRACE_IS_(RACE_ANDROID))
269+ if (PRACE_IS_(p_ptr, RACE_ANDROID))
270270 {
271271 if (o_ptr->tval == TV_FLASK && o_ptr->sval == SV_FLASK_OIL)
272272 return TRUE;
--- a/src/player-damage.c
+++ b/src/player-damage.c
@@ -489,7 +489,7 @@ HIT_POINT elec_dam(HIT_POINT dam, concptr kb_str, int monspell, bool aura)
489489 /* Vulnerability (Ouch!) */
490490 if (p_ptr->muta3 & MUT3_VULN_ELEM) dam *= 2;
491491 if (p_ptr->special_defense & KATA_KOUKIJIN) dam += dam / 3;
492- if (PRACE_IS_(RACE_ANDROID)) dam += dam / 3;
492+ if (PRACE_IS_(p_ptr, RACE_ANDROID)) dam += dam / 3;
493493
494494 /* Resist the damage */
495495 if (p_ptr->resist_elec) dam = (dam + 2) / 3;
@@ -536,7 +536,7 @@ HIT_POINT fire_dam(HIT_POINT dam, concptr kb_str, int monspell, bool aura)
536536
537537 /* Vulnerability (Ouch!) */
538538 if (p_ptr->muta3 & MUT3_VULN_ELEM) dam *= 2;
539- if (PRACE_IS_(RACE_ENT)) dam += dam / 3;
539+ if (PRACE_IS_(p_ptr, RACE_ENT)) dam += dam / 3;
540540 if (p_ptr->special_defense & KATA_KOUKIJIN) dam += dam / 3;
541541
542542 /* Resist the damage */
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -266,7 +266,7 @@ void reset_tim_flags(void)
266266 while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
267267 p_ptr->timewalk = FALSE;
268268
269- if (PRACE_IS_(RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
269+ if (PRACE_IS_(p_ptr, RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
270270 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
271271 if (p_ptr->pclass == CLASS_BERSERKER) p_ptr->shero = 1;
272272
@@ -2536,7 +2536,7 @@ bool set_oppose_fire(TIME_EFFECT v, bool do_dec)
25362536
25372537 if (p_ptr->is_dead) return FALSE;
25382538
2539- if ((PRACE_IS_(RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
2539+ if ((PRACE_IS_(p_ptr, RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
25402540 /* Open */
25412541 if (v)
25422542 {
@@ -2686,7 +2686,7 @@ bool set_stun(TIME_EFFECT v)
26862686 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
26872687
26882688 if (p_ptr->is_dead) return FALSE;
2689- if (PRACE_IS_(RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
2689+ if (PRACE_IS_(p_ptr, RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
26902690
26912691 /* Knocked out */
26922692 if (p_ptr->stun > 100)
--- a/src/player-race.h
+++ b/src/player-race.h
@@ -1,6 +1,6 @@
11 #pragma once
22
3-#define PRACE_IS_(A) (!p_ptr->mimic_form && (p_ptr->prace == A))
3+#define PRACE_IS_(C, A) (!(C)->mimic_form && ((C)->prace == A))
44
55 /*
66 * Player race constants (hard-coded by save-files, arrays, etc)
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -1643,8 +1643,8 @@ void calc_bonuses(void)
16431643 /* Unencumbered Monks become faster every 10 levels */
16441644 if (!(heavy_armor()))
16451645 {
1646- if (!(PRACE_IS_(RACE_KLACKON) ||
1647- PRACE_IS_(RACE_SPRITE) ||
1646+ if (!(PRACE_IS_(p_ptr, RACE_KLACKON) ||
1647+ PRACE_IS_(p_ptr, RACE_SPRITE) ||
16481648 (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)))
16491649 new_speed += (p_ptr->lev) / 10;
16501650
@@ -1695,8 +1695,8 @@ void calc_bonuses(void)
16951695 (!p_ptr->inventory_list[INVEN_LARM].k_idx || p_ptr->hidarite))
16961696 {
16971697 new_speed += 3;
1698- if (!(PRACE_IS_(RACE_KLACKON) ||
1699- PRACE_IS_(RACE_SPRITE) ||
1698+ if (!(PRACE_IS_(p_ptr, RACE_KLACKON) ||
1699+ PRACE_IS_(p_ptr, RACE_SPRITE) ||
17001700 (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)))
17011701 new_speed += (p_ptr->lev) / 10;
17021702 p_ptr->skill_stl += (p_ptr->lev) / 10;
@@ -2660,7 +2660,7 @@ void calc_bonuses(void)
26602660 if (p_ptr->sh_fire) p_ptr->lite = TRUE;
26612661
26622662 /* Golems also get an intrinsic AC bonus */
2663- if (PRACE_IS_(RACE_GOLEM) || PRACE_IS_(RACE_ANDROID))
2663+ if (PRACE_IS_(p_ptr, RACE_GOLEM) || PRACE_IS_(p_ptr, RACE_ANDROID))
26642664 {
26652665 p_ptr->to_a += 10 + (p_ptr->lev * 2 / 5);
26662666 p_ptr->dis_to_a += 10 + (p_ptr->lev * 2 / 5);
@@ -3703,7 +3703,7 @@ void calc_bonuses(void)
37033703 p_ptr->skill_tht += ((cp_ptr->x_thb * p_ptr->lev / 10) + (ap_ptr->a_thb * p_ptr->lev / 50));
37043704
37053705
3706- if ((PRACE_IS_(RACE_S_FAIRY)) && (p_ptr->pseikaku != SEIKAKU_SEXY) && (p_ptr->cursed & TRC_AGGRAVATE))
3706+ if ((PRACE_IS_(p_ptr, RACE_S_FAIRY)) && (p_ptr->pseikaku != SEIKAKU_SEXY) && (p_ptr->cursed & TRC_AGGRAVATE))
37073707 {
37083708 p_ptr->cursed &= ~(TRC_AGGRAVATE);
37093709 p_ptr->skill_stl = MIN(p_ptr->skill_stl - 3, (p_ptr->skill_stl + 2) / 2);
@@ -5264,12 +5264,12 @@ void sanity_blast(monster_type *m_ptr, bool necro)
52645264 r_ptr->r_flags2 |= RF2_ELDRITCH_HORROR;
52655265
52665266 /* Demon characters are unaffected */
5267- if (PRACE_IS_(RACE_IMP) || PRACE_IS_(RACE_DEMON) || (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON)) return;
5267+ if (PRACE_IS_(p_ptr, RACE_IMP) || PRACE_IS_(p_ptr, RACE_DEMON) || (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON)) return;
52685268 if (p_ptr->wizard) return;
52695269
52705270 /* Undead characters are 50% likely to be unaffected */
5271- if (PRACE_IS_(RACE_SKELETON) || PRACE_IS_(RACE_ZOMBIE)
5272- || PRACE_IS_(RACE_VAMPIRE) || PRACE_IS_(RACE_SPECTRE) ||
5271+ if (PRACE_IS_(p_ptr, RACE_SKELETON) || PRACE_IS_(p_ptr, RACE_ZOMBIE)
5272+ || PRACE_IS_(p_ptr, RACE_VAMPIRE) || PRACE_IS_(p_ptr, RACE_SPECTRE) ||
52735273 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_UNDEAD))
52745274 {
52755275 if (saving_throw(25 + p_ptr->lev)) return;
--- a/src/realm-nature.c
+++ b/src/realm-nature.c
@@ -122,7 +122,7 @@ concptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
122122 {
123123 lite_area(damroll(dice, sides), rad);
124124
125- if ((PRACE_IS_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
125+ if ((PRACE_IS_(p_ptr, RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
126126 {
127127 msg_print(_("日の光があなたの肉体を焦がした!", "The daylight scorches your flesh!"));
128128 take_hit(DAMAGE_NOESCAPE, damroll(2, 2), _("日の光", "daylight"), -1);
@@ -526,7 +526,7 @@ concptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
526526 chg_virtue(V_ENLIGHTEN, 1);
527527 wiz_lite(FALSE);
528528
529- if ((PRACE_IS_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
529+ if ((PRACE_IS_(p_ptr, RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) && !p_ptr->resist_lite)
530530 {
531531 msg_print(_("日光があなたの肉体を焦がした!", "The sunlight scorches your flesh!"));
532532 take_hit(DAMAGE_NOESCAPE, 50, _("日光", "sunlight"), -1);
--- a/src/selfinfo.c
+++ b/src/selfinfo.c
@@ -1253,7 +1253,7 @@ void self_knowledge(void)
12531253 info[i++] = _("あなたは電撃への耐性を持っている。", "You are resistant to lightning.");
12541254 }
12551255
1256- if (PRACE_IS_(RACE_ANDROID) && !p_ptr->immune_elec)
1256+ if (PRACE_IS_(p_ptr, RACE_ANDROID) && !p_ptr->immune_elec)
12571257 {
12581258 info[i++] = _("あなたは電撃に弱い。", "You are susceptible to damage from lightning.");
12591259 }
@@ -1271,7 +1271,7 @@ void self_knowledge(void)
12711271 info[i++] = _("あなたは火への耐性を持っている。", "You are resistant to fire.");
12721272 }
12731273
1274- if (PRACE_IS_(RACE_ENT) && !p_ptr->immune_fire)
1274+ if (PRACE_IS_(p_ptr, RACE_ENT) && !p_ptr->immune_fire)
12751275 {
12761276 info[i++] = _("あなたは火に弱い。", "You are susceptible to damage from fire.");
12771277 }
@@ -1303,12 +1303,12 @@ void self_knowledge(void)
13031303 info[i++] = _("あなたは閃光への耐性を持っている。", "You are resistant to bright light.");
13041304 }
13051305
1306- if (PRACE_IS_(RACE_VAMPIRE) || PRACE_IS_(RACE_S_FAIRY) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
1306+ if (PRACE_IS_(p_ptr, RACE_VAMPIRE) || PRACE_IS_(p_ptr, RACE_S_FAIRY) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
13071307 {
13081308 info[i++] = _("あなたは閃光に弱い。", "You are susceptible to damage from bright light.");
13091309 }
13101310
1311- if (PRACE_IS_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form)
1311+ if (PRACE_IS_(p_ptr, RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form)
13121312 {
13131313 info[i++] = _("あなたは暗黒に対する完全なる免疫を持っている。", "You are completely immune to darkness.");
13141314 }
@@ -1342,7 +1342,7 @@ void self_knowledge(void)
13421342 info[i++] = _("あなたは因果混乱の攻撃への耐性を持っている。", "You are resistant to nexus attacks.");
13431343 }
13441344
1345- if (PRACE_IS_(RACE_SPECTRE))
1345+ if (PRACE_IS_(p_ptr, RACE_SPECTRE))
13461346 {
13471347 info[i++] = _("あなたは地獄の力を吸収できる。", "You can drain nether forces.");
13481348 }
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -4273,14 +4273,14 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
42734273 if (fuzzy) msg_print(_("地獄の力で攻撃された!", "You are hit by nether forces!"));
42744274 if (p_ptr->resist_neth)
42754275 {
4276- if (!PRACE_IS_(RACE_SPECTRE))
4276+ if (!PRACE_IS_(p_ptr, RACE_SPECTRE))
42774277 {
42784278 dam *= 6; dam /= (randint1(4) + 7);
42794279 }
42804280 }
42814281 else if (!CHECK_MULTISHADOW()) drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
42824282
4283- if (PRACE_IS_(RACE_SPECTRE) && !CHECK_MULTISHADOW())
4283+ if (PRACE_IS_(p_ptr, RACE_SPECTRE) && !CHECK_MULTISHADOW())
42844284 {
42854285 msg_print(_("気分がよくなった。", "You feel invigorated!"));
42864286 hp_player(dam / 4);
@@ -4516,12 +4516,12 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
45164516 (void)set_blind(p_ptr->blind + randint1(5) + 2);
45174517 }
45184518
4519- if (PRACE_IS_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
4519+ if (PRACE_IS_(p_ptr, RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
45204520 {
45214521 if (!CHECK_MULTISHADOW()) msg_print(_("光で肉体が焦がされた!", "The light scorches your flesh!"));
45224522 dam *= 2;
45234523 }
4524- else if (PRACE_IS_(RACE_S_FAIRY))
4524+ else if (PRACE_IS_(p_ptr, RACE_S_FAIRY))
45254525 {
45264526 dam = dam * 4 / 3;
45274527 }
@@ -4551,7 +4551,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
45514551 {
45524552 dam *= 4; dam /= (randint1(4) + 7);
45534553
4554- if (PRACE_IS_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
4554+ if (PRACE_IS_(p_ptr, RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
45554555 }
45564556 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
45574557 {
--- a/src/warning.c
+++ b/src/warning.c
@@ -80,7 +80,7 @@ static void spell_damcalc(monster_type *m_ptr, EFFECT_ID typ, HIT_POINT dam, int
8080 {
8181 if (p_ptr->muta3 & MUT3_VULN_ELEM) dam *= 2;
8282 if (p_ptr->special_defense & KATA_KOUKIJIN) dam += dam / 3;
83- if (PRACE_IS_(RACE_ANDROID)) dam += dam / 3;
83+ if (PRACE_IS_(p_ptr, RACE_ANDROID)) dam += dam / 3;
8484 if (p_ptr->resist_elec) dam = (dam + 2) / 3;
8585 if (IS_OPPOSE_ELEC())
8686 dam = (dam + 2) / 3;
@@ -132,7 +132,7 @@ static void spell_damcalc(monster_type *m_ptr, EFFECT_ID typ, HIT_POINT dam, int
132132 else
133133 {
134134 if (p_ptr->muta3 & MUT3_VULN_ELEM) dam *= 2;
135- if (PRACE_IS_(RACE_ENT)) dam += dam / 3;
135+ if (PRACE_IS_(p_ptr, RACE_ENT)) dam += dam / 3;
136136 if (p_ptr->special_defense & KATA_KOUKIJIN) dam += dam / 3;
137137 if (p_ptr->resist_fire) dam = (dam + 2) / 3;
138138 if (IS_OPPOSE_FIRE()) dam = (dam + 2) / 3;
@@ -155,8 +155,8 @@ static void spell_damcalc(monster_type *m_ptr, EFFECT_ID typ, HIT_POINT dam, int
155155
156156 case GF_LITE:
157157 if (p_ptr->resist_lite) dam /= 2; /* Worst case of 4 / (d4 + 7) */
158- if (PRACE_IS_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) dam *= 2;
159- else if (PRACE_IS_(RACE_S_FAIRY)) dam = dam * 4 / 3;
158+ if (PRACE_IS_(p_ptr, RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) dam *= 2;
159+ else if (PRACE_IS_(p_ptr, RACE_S_FAIRY)) dam = dam * 4 / 3;
160160
161161 /*
162162 * Cannot use "ignore_wraith_form" strictly (for "random one damage")
@@ -166,7 +166,7 @@ static void spell_damcalc(monster_type *m_ptr, EFFECT_ID typ, HIT_POINT dam, int
166166 break;
167167
168168 case GF_DARK:
169- if (PRACE_IS_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form)
169+ if (PRACE_IS_(p_ptr, RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form)
170170 {
171171 dam = 0;
172172 ignore_wraith_form = TRUE;
@@ -191,7 +191,7 @@ static void spell_damcalc(monster_type *m_ptr, EFFECT_ID typ, HIT_POINT dam, int
191191 break;
192192
193193 case GF_NETHER:
194- if (PRACE_IS_(RACE_SPECTRE))
194+ if (PRACE_IS_(p_ptr, RACE_SPECTRE))
195195 {
196196 dam = 0;
197197 ignore_wraith_form = TRUE;
Show on old repository browser