• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisiondb87c46ed7b7f995bd1d157aec82d481c853d258 (tree)
Time2019-07-08 22:40:25
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 take_hit() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/chest.c
+++ b/src/chest.c
@@ -154,7 +154,7 @@ void chest_trap(POSITION y, POSITION x, OBJECT_IDX o_idx)
154154 if (trap & (CHEST_LOSE_STR))
155155 {
156156 msg_print(_("仕掛けられていた小さな針に刺されてしまった!", "A small needle has pricked you!"));
157- take_hit(DAMAGE_NOESCAPE, damroll(1, 4), _("毒針", "a poison needle"), -1);
157+ take_hit(p_ptr, DAMAGE_NOESCAPE, damroll(1, 4), _("毒針", "a poison needle"), -1);
158158 (void)do_dec_stat(p_ptr, A_STR);
159159 }
160160
@@ -162,7 +162,7 @@ void chest_trap(POSITION y, POSITION x, OBJECT_IDX o_idx)
162162 if (trap & (CHEST_LOSE_CON))
163163 {
164164 msg_print(_("仕掛けられていた小さな針に刺されてしまった!", "A small needle has pricked you!"));
165- take_hit(DAMAGE_NOESCAPE, damroll(1, 4), _("毒針", "a poison needle"), -1);
165+ take_hit(p_ptr, DAMAGE_NOESCAPE, damroll(1, 4), _("毒針", "a poison needle"), -1);
166166 (void)do_dec_stat(p_ptr, A_CON);
167167 }
168168
@@ -282,7 +282,7 @@ void chest_trap(POSITION y, POSITION x, OBJECT_IDX o_idx)
282282 /* ...but a high saving throw does help a little. */
283283 if (randint1(100 + o_ptr->pval * 2) > p_ptr->skill_sav)
284284 {
285- if (one_in_(6)) take_hit(DAMAGE_NOESCAPE, damroll(5, 20), _("破滅のトラップの宝箱", "a chest dispel-player trap"), -1);
285+ if (one_in_(6)) take_hit(p_ptr, DAMAGE_NOESCAPE, damroll(5, 20), _("破滅のトラップの宝箱", "a chest dispel-player trap"), -1);
286286 else if (one_in_(5)) (void)set_cut(p_ptr,p_ptr->cut + 200);
287287 else if (one_in_(4))
288288 {
@@ -322,7 +322,7 @@ void chest_trap(POSITION y, POSITION x, OBJECT_IDX o_idx)
322322 msg_print(_("箱の中の物はすべて粉々に砕け散った!", "Everything inside the chest is destroyed!"));
323323 o_ptr->pval = 0;
324324 sound(SOUND_EXPLODE);
325- take_hit(DAMAGE_ATTACK, damroll(5, 8), _("爆発する箱", "an exploding chest"), -1);
325+ take_hit(p_ptr, DAMAGE_ATTACK, damroll(5, 8), _("爆発する箱", "an exploding chest"), -1);
326326 }
327327 /* Scatter contents. */
328328 if ((trap & (CHEST_SCATTER)) && o_ptr->k_idx)
--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1562,7 +1562,7 @@ bool activate_artifact(object_type *o_ptr)
15621562 wiz_lite(FALSE);
15631563
15641564 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
1565- take_hit(DAMAGE_LOSELIFE, damroll(3, 8), _("審判の宝石", "the Jewel of Judgement"), -1);
1565+ take_hit(p_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("審判の宝石", "the Jewel of Judgement"), -1);
15661566
15671567 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
15681568 (void)detect_doors(DETECT_RAD_DEFAULT);
@@ -1727,7 +1727,7 @@ bool activate_artifact(object_type *o_ptr)
17271727 {
17281728 int t;
17291729 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
1730- take_hit(DAMAGE_LOSELIFE, damroll(3, 8), _("加速した疲労", "the strain of haste"), -1);
1730+ take_hit(p_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("加速した疲労", "the strain of haste"), -1);
17311731 t = 25 + randint1(25);
17321732 (void)set_fast(p_ptr, p_ptr->fast + t, FALSE);
17331733 break;
--- a/src/cmd-eat.c
+++ b/src/cmd-eat.c
@@ -140,7 +140,7 @@ void exe_eat_food(INVENTORY_IDX item)
140140
141141 case SV_FOOD_WEAKNESS:
142142 {
143- take_hit(DAMAGE_NOESCAPE, damroll(6, 6), _("毒入り食料", "poisonous food"), -1);
143+ take_hit(p_ptr, DAMAGE_NOESCAPE, damroll(6, 6), _("毒入り食料", "poisonous food"), -1);
144144 (void)do_dec_stat(p_ptr, A_STR);
145145 ident = TRUE;
146146 break;
@@ -148,7 +148,7 @@ void exe_eat_food(INVENTORY_IDX item)
148148
149149 case SV_FOOD_SICKNESS:
150150 {
151- take_hit(DAMAGE_NOESCAPE, damroll(6, 6), _("毒入り食料", "poisonous food"), -1);
151+ take_hit(p_ptr, DAMAGE_NOESCAPE, damroll(6, 6), _("毒入り食料", "poisonous food"), -1);
152152 (void)do_dec_stat(p_ptr, A_CON);
153153 ident = TRUE;
154154 break;
@@ -156,7 +156,7 @@ void exe_eat_food(INVENTORY_IDX item)
156156
157157 case SV_FOOD_STUPIDITY:
158158 {
159- take_hit(DAMAGE_NOESCAPE, damroll(8, 8), _("毒入り食料", "poisonous food"), -1);
159+ take_hit(p_ptr, DAMAGE_NOESCAPE, damroll(8, 8), _("毒入り食料", "poisonous food"), -1);
160160 (void)do_dec_stat(p_ptr, A_INT);
161161 ident = TRUE;
162162 break;
@@ -164,7 +164,7 @@ void exe_eat_food(INVENTORY_IDX item)
164164
165165 case SV_FOOD_NAIVETY:
166166 {
167- take_hit(DAMAGE_NOESCAPE, damroll(8, 8), _("毒入り食料", "poisonous food"), -1);
167+ take_hit(p_ptr, DAMAGE_NOESCAPE, damroll(8, 8), _("毒入り食料", "poisonous food"), -1);
168168 (void)do_dec_stat(p_ptr, A_WIS);
169169 ident = TRUE;
170170 break;
@@ -172,7 +172,7 @@ void exe_eat_food(INVENTORY_IDX item)
172172
173173 case SV_FOOD_UNHEALTH:
174174 {
175- take_hit(DAMAGE_NOESCAPE, damroll(10, 10), _("毒入り食料", "poisonous food"), -1);
175+ take_hit(p_ptr, DAMAGE_NOESCAPE, damroll(10, 10), _("毒入り食料", "poisonous food"), -1);
176176 (void)do_dec_stat(p_ptr, A_CON);
177177 ident = TRUE;
178178 break;
@@ -180,7 +180,7 @@ void exe_eat_food(INVENTORY_IDX item)
180180
181181 case SV_FOOD_DISEASE:
182182 {
183- take_hit(DAMAGE_NOESCAPE, damroll(10, 10), _("毒入り食料", "poisonous food"), -1);
183+ take_hit(p_ptr, DAMAGE_NOESCAPE, damroll(10, 10), _("毒入り食料", "poisonous food"), -1);
184184 (void)do_dec_stat(p_ptr, A_STR);
185185 ident = TRUE;
186186 break;
--- a/src/cmd-pet.c
+++ b/src/cmd-pet.c
@@ -1054,7 +1054,7 @@ bool rakuba(HIT_POINT dam, bool force)
10541054 {
10551055 monster_desc(m_name, m_ptr, 0);
10561056 msg_format(_("%sから振り落とされそうになって、壁にぶつかった。", "You have nearly fallen from %s, but bumped into wall."), m_name);
1057- take_hit(DAMAGE_NOESCAPE, r_ptr->level + 3, _("壁への衝突", "bumping into wall"), -1);
1057+ take_hit(p_ptr, DAMAGE_NOESCAPE, r_ptr->level + 3, _("壁への衝突", "bumping into wall"), -1);
10581058 return FALSE;
10591059 }
10601060
@@ -1095,7 +1095,7 @@ bool rakuba(HIT_POINT dam, bool force)
10951095 }
10961096 else
10971097 {
1098- take_hit(DAMAGE_NOESCAPE, r_ptr->level + 3, _("落馬", "Falling from riding"), -1);
1098+ take_hit(p_ptr, DAMAGE_NOESCAPE, r_ptr->level + 3, _("落馬", "Falling from riding"), -1);
10991099 fall_dam = TRUE;
11001100 }
11011101
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -206,7 +206,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
206206
207207 case SV_POTION_RUINATION:
208208 msg_print(_("身も心も弱ってきて、精気が抜けていくようだ。", "Your nerves and muscles feel weak and lifeless!"));
209- take_hit(DAMAGE_LOSELIFE, damroll(10, 10), _("破滅の薬", "a potion of Ruination"), -1);
209+ take_hit(p_ptr, DAMAGE_LOSELIFE, damroll(10, 10), _("破滅の薬", "a potion of Ruination"), -1);
210210
211211 (void)dec_stat(p_ptr, A_DEX, 25, TRUE);
212212 (void)dec_stat(p_ptr, A_WIS, 25, TRUE);
@@ -249,7 +249,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
249249 chg_virtue(p_ptr, V_VITALITY, -1);
250250 chg_virtue(p_ptr, V_UNLIFE, 5);
251251 msg_print(_("死の予感が体中を駆けめぐった。", "A feeling of Death flows through your body."));
252- take_hit(DAMAGE_LOSELIFE, 5000, _("死の薬", "a potion of Death"), -1);
252+ take_hit(p_ptr, DAMAGE_LOSELIFE, 5000, _("死の薬", "a potion of Death"), -1);
253253 ident = TRUE;
254254 break;
255255
--- a/src/cmd-read.c
+++ b/src/cmd-read.c
@@ -460,7 +460,7 @@ void exe_read(INVENTORY_IDX item, bool known)
460460 fire_ball(GF_FIRE, 0, 666, 4);
461461 /* Note: "Double" damage since it is centered on the player ... */
462462 if (!(IS_OPPOSE_FIRE() || p_ptr->resist_fire || p_ptr->immune_fire))
463- take_hit(DAMAGE_NOESCAPE, 50+randint1(50), _("炎の巻物", "a Scroll of Fire"), -1);
463+ take_hit(p_ptr, DAMAGE_NOESCAPE, 50+randint1(50), _("炎の巻物", "a Scroll of Fire"), -1);
464464
465465 ident = TRUE;
466466 break;
@@ -471,7 +471,7 @@ void exe_read(INVENTORY_IDX item, bool known)
471471 {
472472 fire_ball(GF_ICE, 0, 777, 4);
473473 if (!(IS_OPPOSE_COLD() || p_ptr->resist_cold || p_ptr->immune_cold))
474- take_hit(DAMAGE_NOESCAPE, 100+randint1(100), _("氷の巻物", "a Scroll of Ice"), -1);
474+ take_hit(p_ptr, DAMAGE_NOESCAPE, 100+randint1(100), _("氷の巻物", "a Scroll of Ice"), -1);
475475
476476 ident = TRUE;
477477 break;
@@ -481,7 +481,7 @@ void exe_read(INVENTORY_IDX item, bool known)
481481 {
482482 fire_ball(GF_CHAOS, 0, 1000, 4);
483483 if (!p_ptr->resist_chaos)
484- take_hit(DAMAGE_NOESCAPE, 111+randint1(111), _("ログルスの巻物", "a Scroll of Logrus"), -1);
484+ take_hit(p_ptr, DAMAGE_NOESCAPE, 111+randint1(111), _("ログルスの巻物", "a Scroll of Logrus"), -1);
485485
486486 ident = TRUE;
487487 break;
--- a/src/cmd-spell.c
+++ b/src/cmd-spell.c
@@ -1260,7 +1260,7 @@ void do_cmd_cast(void)
12601260 else
12611261 {
12621262 msg_print(_("痛い!", "It hurts!"));
1263- take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), _("暗黒魔法の逆流", "a miscast Death spell"), -1);
1263+ take_hit(p_ptr, DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), _("暗黒魔法の逆流", "a miscast Death spell"), -1);
12641264
12651265 if ((spell > 15) && one_in_(6) && !p_ptr->hold_exp)
12661266 lose_exp(p_ptr, spell * 250);
--- a/src/core.c
+++ b/src/core.c
@@ -732,14 +732,14 @@ static bool pattern_effect(void)
732732
733733 case PATTERN_TILE_WRECKED:
734734 if (!IS_INVULN())
735- take_hit(DAMAGE_NOESCAPE, 200, _("壊れた「パターン」を歩いたダメージ", "walking the corrupted Pattern"), -1);
735+ take_hit(p_ptr, DAMAGE_NOESCAPE, 200, _("壊れた「パターン」を歩いたダメージ", "walking the corrupted Pattern"), -1);
736736 break;
737737
738738 default:
739739 if (PRACE_IS_(p_ptr, RACE_AMBERITE) && !one_in_(2))
740740 return TRUE;
741741 else if (!IS_INVULN())
742- take_hit(DAMAGE_NOESCAPE, damroll(1, 3), _("「パターン」を歩いたダメージ", "walking the Pattern"), -1);
742+ take_hit(p_ptr, DAMAGE_NOESCAPE, damroll(1, 3), _("「パターン」を歩いたダメージ", "walking the Pattern"), -1);
743743 break;
744744 }
745745
@@ -1322,7 +1322,7 @@ static void process_world_aux_digestion(void)
13221322 /* Calculate damage */
13231323 HIT_POINT dam = (PY_FOOD_STARVE - p_ptr->food) / 10;
13241324
1325- if (!IS_INVULN()) take_hit(DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1);
1325+ if (!IS_INVULN()) take_hit(p_ptr, DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1);
13261326 }
13271327 }
13281328 }
@@ -1348,7 +1348,7 @@ static void process_world_aux_hp_and_sp(void)
13481348 /* Take damage from poison */
13491349 if (p_ptr->poisoned && !IS_INVULN())
13501350 {
1351- take_hit(DAMAGE_NOESCAPE, 1, _("毒", "poison"), -1);
1351+ take_hit(p_ptr, DAMAGE_NOESCAPE, 1, _("毒", "poison"), -1);
13521352 }
13531353
13541354 /* Take damage from cuts */
@@ -1394,7 +1394,7 @@ static void process_world_aux_hp_and_sp(void)
13941394 dam = 1;
13951395 }
13961396
1397- take_hit(DAMAGE_NOESCAPE, dam, _("致命傷", "a fatal wound"), -1);
1397+ take_hit(p_ptr, DAMAGE_NOESCAPE, dam, _("致命傷", "a fatal wound"), -1);
13981398 }
13991399
14001400 /* (Vampires) Take damage from sunlight */
@@ -1405,7 +1405,7 @@ static void process_world_aux_hp_and_sp(void)
14051405 if ((current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
14061406 {
14071407 msg_print(_("日光があなたのアンデッドの肉体を焼き焦がした!", "The sun's rays scorch your undead flesh!"));
1408- take_hit(DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1);
1408+ take_hit(p_ptr, DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1);
14091409 cave_no_regen = TRUE;
14101410 }
14111411 }
@@ -1427,7 +1427,7 @@ static void process_world_aux_hp_and_sp(void)
14271427 object_desc(o_name, o_ptr, OD_NAME_ONLY);
14281428 sprintf(ouch, _("%sを装備したダメージ", "wielding %s"), o_name);
14291429
1430- if (!IS_INVULN()) take_hit(DAMAGE_NOESCAPE, 1, ouch, -1);
1430+ if (!IS_INVULN()) take_hit(p_ptr, DAMAGE_NOESCAPE, 1, ouch, -1);
14311431 }
14321432 }
14331433
@@ -1456,14 +1456,14 @@ static void process_world_aux_hp_and_sp(void)
14561456 if (p_ptr->levitation)
14571457 {
14581458 msg_print(_("熱で火傷した!", "The heat burns you!"));
1459- take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
1459+ take_hit(p_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
14601460 f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name), -1);
14611461 }
14621462 else
14631463 {
14641464 concptr name = f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name;
14651465 msg_format(_("%sで火傷した!", "The %s burns you!"), name);
1466- take_hit(DAMAGE_NOESCAPE, damage, name, -1);
1466+ take_hit(p_ptr, DAMAGE_NOESCAPE, damage, name, -1);
14671467 }
14681468
14691469 cave_no_regen = TRUE;
@@ -1494,14 +1494,14 @@ static void process_world_aux_hp_and_sp(void)
14941494 if (p_ptr->levitation)
14951495 {
14961496 msg_print(_("冷気に覆われた!", "The cold engulfs you!"));
1497- take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
1497+ take_hit(p_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
14981498 f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name), -1);
14991499 }
15001500 else
15011501 {
15021502 concptr name = f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name;
15031503 msg_format(_("%sに凍えた!", "The %s frostbites you!"), name);
1504- take_hit(DAMAGE_NOESCAPE, damage, name, -1);
1504+ take_hit(p_ptr, DAMAGE_NOESCAPE, damage, name, -1);
15051505 }
15061506
15071507 cave_no_regen = TRUE;
@@ -1532,14 +1532,14 @@ static void process_world_aux_hp_and_sp(void)
15321532 if (p_ptr->levitation)
15331533 {
15341534 msg_print(_("電撃を受けた!", "The electric shocks you!"));
1535- take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
1535+ take_hit(p_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
15361536 f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name), -1);
15371537 }
15381538 else
15391539 {
15401540 concptr name = f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name;
15411541 msg_format(_("%sに感電した!", "The %s shocks you!"), name);
1542- take_hit(DAMAGE_NOESCAPE, damage, name, -1);
1542+ take_hit(p_ptr, DAMAGE_NOESCAPE, damage, name, -1);
15431543 }
15441544
15451545 cave_no_regen = TRUE;
@@ -1570,14 +1570,14 @@ static void process_world_aux_hp_and_sp(void)
15701570 if (p_ptr->levitation)
15711571 {
15721572 msg_print(_("酸が飛び散った!", "The acid melt you!"));
1573- take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
1573+ take_hit(p_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
15741574 f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name), -1);
15751575 }
15761576 else
15771577 {
15781578 concptr name = f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name;
15791579 msg_format(_("%sに溶かされた!", "The %s melts you!"), name);
1580- take_hit(DAMAGE_NOESCAPE, damage, name, -1);
1580+ take_hit(p_ptr, DAMAGE_NOESCAPE, damage, name, -1);
15811581 }
15821582
15831583 cave_no_regen = TRUE;
@@ -1608,7 +1608,7 @@ static void process_world_aux_hp_and_sp(void)
16081608 if (p_ptr->levitation)
16091609 {
16101610 msg_print(_("毒気を吸い込んだ!", "The gas poisons you!"));
1611- take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
1611+ take_hit(p_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
16121612 f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name), -1);
16131613 if (p_ptr->resist_pois) (void)set_poisoned(p_ptr, p_ptr->poisoned + 1);
16141614 }
@@ -1616,7 +1616,7 @@ static void process_world_aux_hp_and_sp(void)
16161616 {
16171617 concptr name = f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name;
16181618 msg_format(_("%sに毒された!", "The %s poisons you!"), name);
1619- take_hit(DAMAGE_NOESCAPE, damage, name, -1);
1619+ take_hit(p_ptr, DAMAGE_NOESCAPE, damage, name, -1);
16201620 if (p_ptr->resist_pois) (void)set_poisoned(p_ptr, p_ptr->poisoned + 3);
16211621 }
16221622
@@ -1630,7 +1630,7 @@ static void process_world_aux_hp_and_sp(void)
16301630 if (p_ptr->total_weight > weight_limit())
16311631 {
16321632 msg_print(_("溺れている!", "You are drowning!"));
1633- take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), _("溺れ", "drowning"), -1);
1633+ take_hit(p_ptr, DAMAGE_NOESCAPE, randint1(p_ptr->lev), _("溺れ", "drowning"), -1);
16341634 cave_no_regen = TRUE;
16351635 }
16361636 }
@@ -1645,7 +1645,7 @@ static void process_world_aux_hp_and_sp(void)
16451645 if (p_ptr->resist_fire) damage = damage / 3;
16461646 if (IS_OPPOSE_FIRE()) damage = damage / 3;
16471647 msg_print(_("熱い!", "It's hot!"));
1648- take_hit(DAMAGE_NOESCAPE, damage, _("炎のオーラ", "Fire aura"), -1);
1648+ take_hit(p_ptr, DAMAGE_NOESCAPE, damage, _("炎のオーラ", "Fire aura"), -1);
16491649 }
16501650 if ((r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !p_ptr->immune_elec)
16511651 {
@@ -1654,7 +1654,7 @@ static void process_world_aux_hp_and_sp(void)
16541654 if (p_ptr->resist_elec) damage = damage / 3;
16551655 if (IS_OPPOSE_ELEC()) damage = damage / 3;
16561656 msg_print(_("痛い!", "It hurts!"));
1657- take_hit(DAMAGE_NOESCAPE, damage, _("電気のオーラ", "Elec aura"), -1);
1657+ take_hit(p_ptr, DAMAGE_NOESCAPE, damage, _("電気のオーラ", "Elec aura"), -1);
16581658 }
16591659 if ((r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !p_ptr->immune_cold)
16601660 {
@@ -1662,7 +1662,7 @@ static void process_world_aux_hp_and_sp(void)
16621662 if (p_ptr->resist_cold) damage = damage / 3;
16631663 if (IS_OPPOSE_COLD()) damage = damage / 3;
16641664 msg_print(_("冷たい!", "It's cold!"));
1665- take_hit(DAMAGE_NOESCAPE, damage, _("冷気のオーラ", "Cold aura"), -1);
1665+ take_hit(p_ptr, DAMAGE_NOESCAPE, damage, _("冷気のオーラ", "Cold aura"), -1);
16661666 }
16671667 }
16681668
@@ -1691,7 +1691,7 @@ static void process_world_aux_hp_and_sp(void)
16911691 dam_desc = _("硬い岩", "solid rock");
16921692 }
16931693
1694- take_hit(DAMAGE_NOESCAPE, 1 + (p_ptr->lev / 5), dam_desc, -1);
1694+ take_hit(p_ptr, DAMAGE_NOESCAPE, 1 + (p_ptr->lev / 5), dam_desc, -1);
16951695 }
16961696 }
16971697
@@ -2548,7 +2548,7 @@ static void process_world_aux_mutation(void)
25482548
25492549 p_ptr->csp += healing;
25502550 p_ptr->redraw |= (PR_HP | PR_MANA);
2551- take_hit(DAMAGE_LOSELIFE, healing, _("頭に昇った血", "blood rushing to the head"), -1);
2551+ take_hit(p_ptr, DAMAGE_LOSELIFE, healing, _("頭に昇った血", "blood rushing to the head"), -1);
25522552 }
25532553 }
25542554
@@ -2559,7 +2559,7 @@ static void process_world_aux_mutation(void)
25592559
25602560 disturb(FALSE, TRUE);
25612561 msg_print(_("足がもつれて転んだ!", "You trip over your own feet!"));
2562- take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), _("転倒", "tripping"), -1);
2562+ take_hit(p_ptr, DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), _("転倒", "tripping"), -1);
25632563
25642564 msg_print(NULL);
25652565 if (has_melee_weapon(INVEN_RARM))
@@ -2783,7 +2783,7 @@ static void process_world_aux_curse(void)
27832783
27842784 object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_HP), (OD_OMIT_PREFIX | OD_NAME_ONLY));
27852785 msg_format(_("%sはあなたの体力を吸収した!", "Your %s drains HP from you!"), o_name);
2786- take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev*2, 100), o_name, -1);
2786+ take_hit(p_ptr, DAMAGE_LOSELIFE, MIN(p_ptr->lev*2, 100), o_name, -1);
27872787 }
27882788 /* Handle mana draining */
27892789 if ((p_ptr->cursed & TRC_DRAIN_MANA) && p_ptr->csp && one_in_(666))
@@ -2813,7 +2813,7 @@ static void process_world_aux_curse(void)
28132813 msg_print(_("『審判の宝石』はあなたの体力を吸収した!", "The Jewel of Judgement drains life from you!"));
28142814 else
28152815 msg_print(_("なにかがあなたの体力を吸収した!", "Something drains life from you!"));
2816- take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), _("審判の宝石", "the Jewel of Judgement"), -1);
2816+ take_hit(p_ptr, DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), _("審判の宝石", "the Jewel of Judgement"), -1);
28172817 }
28182818 }
28192819 }
--- a/src/melee1.c
+++ b/src/melee1.c
@@ -2125,7 +2125,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b
21252125 k += (p_ptr->to_d[hand] + o_ptr->to_d);
21262126 if (k < 0) k = 0;
21272127
2128- take_hit(DAMAGE_FORCE, k, _("死の大鎌", "Death scythe"), -1);
2128+ take_hit(p_ptr, DAMAGE_FORCE, k, _("死の大鎌", "Death scythe"), -1);
21292129 handle_stuff();
21302130 }
21312131 else
@@ -2798,7 +2798,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
27982798 msg_print(_("痛恨の一撃!", "It was a critical hit!"));
27992799 tmp_damage = MAX(damage, tmp_damage*2);
28002800
2801- get_damage += take_hit(DAMAGE_ATTACK, tmp_damage, ddesc, -1);
2801+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, tmp_damage, ddesc, -1);
28022802 break;
28032803 }
28042804 }
@@ -2806,7 +2806,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
28062806 {
28072807 obvious = TRUE;
28082808 damage -= (damage * ((ac < 150) ? ac : 150) / 250);
2809- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2809+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
28102810 break;
28112811 }
28122812
@@ -2823,7 +2823,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
28232823 }
28242824 }
28252825
2826- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2826+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
28272827
28282828 /* Learn about the player */
28292829 update_smart_learn(m_idx, DRS_POIS);
@@ -2847,7 +2847,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
28472847 }
28482848 }
28492849
2850- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2850+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
28512851
28522852 /* Learn about the player */
28532853 update_smart_learn(m_idx, DRS_DISEN);
@@ -2857,7 +2857,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
28572857
28582858 case RBE_UN_POWER:
28592859 {
2860- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2860+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
28612861
28622862 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
28632863
@@ -2911,7 +2911,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
29112911
29122912 case RBE_EAT_GOLD:
29132913 {
2914- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2914+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
29152915
29162916 /* Confused monsters cannot steal successfully. -LM-*/
29172917 if (MON_CONFUSED(m_ptr)) break;
@@ -2971,7 +2971,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
29712971
29722972 case RBE_EAT_ITEM:
29732973 {
2974- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2974+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
29752975
29762976 /* Confused monsters cannot steal successfully. -LM-*/
29772977 if (MON_CONFUSED(m_ptr)) break;
@@ -3067,7 +3067,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
30673067
30683068 case RBE_EAT_FOOD:
30693069 {
3070- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3070+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
30713071
30723072 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
30733073
@@ -3107,7 +3107,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
31073107 {
31083108 /* Access the lite */
31093109 o_ptr = &p_ptr->inventory_list[INVEN_LITE];
3110- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3110+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
31113111
31123112 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
31133113
@@ -3173,7 +3173,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
31733173
31743174 case RBE_BLIND:
31753175 {
3176- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3176+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
31773177 if (p_ptr->is_dead) break;
31783178
31793179 /* Increase "blind" */
@@ -3199,7 +3199,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
31993199 case RBE_CONFUSE:
32003200 {
32013201 if (explode) break;
3202- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3202+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
32033203
32043204 if (p_ptr->is_dead) break;
32053205
@@ -3220,7 +3220,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
32203220
32213221 case RBE_TERRIFY:
32223222 {
3223- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3223+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
32243224
32253225 if (p_ptr->is_dead) break;
32263226
@@ -3255,7 +3255,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
32553255
32563256 case RBE_PARALYZE:
32573257 {
3258- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3258+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
32593259
32603260 if (p_ptr->is_dead) break;
32613261
@@ -3293,7 +3293,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
32933293
32943294 case RBE_LOSE_STR:
32953295 {
3296- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3296+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
32973297
32983298 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
32993299 if (do_dec_stat(p_ptr, A_STR)) obvious = TRUE;
@@ -3303,7 +3303,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
33033303
33043304 case RBE_LOSE_INT:
33053305 {
3306- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3306+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
33073307
33083308 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
33093309 if (do_dec_stat(p_ptr, A_INT)) obvious = TRUE;
@@ -3313,7 +3313,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
33133313
33143314 case RBE_LOSE_WIS:
33153315 {
3316- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3316+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
33173317
33183318 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
33193319 if (do_dec_stat(p_ptr, A_WIS)) obvious = TRUE;
@@ -3323,7 +3323,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
33233323
33243324 case RBE_LOSE_DEX:
33253325 {
3326- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3326+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
33273327
33283328 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
33293329 if (do_dec_stat(p_ptr, A_DEX)) obvious = TRUE;
@@ -3333,7 +3333,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
33333333
33343334 case RBE_LOSE_CON:
33353335 {
3336- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3336+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
33373337
33383338 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
33393339 if (do_dec_stat(p_ptr, A_CON)) obvious = TRUE;
@@ -3343,7 +3343,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
33433343
33443344 case RBE_LOSE_CHR:
33453345 {
3346- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3346+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
33473347
33483348 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
33493349 if (do_dec_stat(p_ptr, A_CHR)) obvious = TRUE;
@@ -3353,7 +3353,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
33533353
33543354 case RBE_LOSE_ALL:
33553355 {
3356- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3356+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
33573357
33583358 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
33593359
@@ -3375,7 +3375,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
33753375 /* Hack -- Reduce damage based on the player armor class */
33763376 damage -= (damage * ((ac < 150) ? ac : 150) / 250);
33773377
3378- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3378+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
33793379
33803380 /* Radius 8 earthquake centered at the monster */
33813381 if (damage > 23 || explode)
@@ -3392,7 +3392,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
33923392
33933393 obvious = TRUE;
33943394
3395- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3395+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
33963396
33973397 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
33983398
@@ -3406,7 +3406,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
34063406
34073407 obvious = TRUE;
34083408
3409- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3409+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
34103410
34113411 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
34123412
@@ -3420,7 +3420,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
34203420
34213421 obvious = TRUE;
34223422
3423- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3423+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
34243424
34253425 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
34263426
@@ -3434,7 +3434,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
34343434
34353435 obvious = TRUE;
34363436
3437- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3437+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
34383438
34393439 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
34403440
@@ -3444,7 +3444,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
34443444
34453445 case RBE_DISEASE:
34463446 {
3447- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3447+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
34483448
34493449 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
34503450
@@ -3531,7 +3531,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
35313531 }
35323532 }
35333533 }
3534- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3534+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
35353535
35363536 break;
35373537 }
@@ -3542,7 +3542,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
35423542
35433543 obvious = TRUE;
35443544
3545- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3545+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
35463546
35473547 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
35483548
@@ -3622,7 +3622,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
36223622 }
36233623 case RBE_INERTIA:
36243624 {
3625- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3625+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
36263626
36273627 if (p_ptr->is_dead) break;
36283628
@@ -3643,7 +3643,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
36433643 }
36443644 case RBE_STUN:
36453645 {
3646- get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
3646+ get_damage += take_hit(p_ptr, DAMAGE_ATTACK, damage, ddesc, -1);
36473647
36483648 if (p_ptr->is_dead) break;
36493649
--- a/src/mind.c
+++ b/src/mind.c
@@ -1227,7 +1227,7 @@ static bool cast_force_spell(int spell)
12271227 {
12281228 msg_print(_("気が暴走した!", "The Force exploded!"));
12291229 fire_ball(GF_MANA, 0, P_PTR_KI / 2, 10);
1230- take_hit(DAMAGE_LOSELIFE, p_ptr->magic_num1[0] / 2, _("気の暴走", "Explosion of the Force"), -1);
1230+ take_hit(p_ptr, DAMAGE_LOSELIFE, p_ptr->magic_num1[0] / 2, _("気の暴走", "Explosion of the Force"), -1);
12311231 }
12321232 else return TRUE;
12331233 break;
@@ -2007,7 +2007,7 @@ void do_cmd_mind(void)
20072007
20082008 if ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU))
20092009 {
2010- take_hit(DAMAGE_USELIFE, mana_cost, _("過度の集中", "concentrating too hard"), -1);
2010+ take_hit(p_ptr, DAMAGE_USELIFE, mana_cost, _("過度の集中", "concentrating too hard"), -1);
20112011 /* Redraw hp */
20122012 p_ptr->redraw |= (PR_HP);
20132013 }
--- a/src/mspells4.c
+++ b/src/mspells4.c
@@ -2099,7 +2099,7 @@ HIT_POINT spell_RF6_SPECIAL_B(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER
20992099 /* Mega hack -- this special action deals damage to the player. Therefore the code of "eyeeye" is necessary.
21002100 -- henkma
21012101 */
2102- get_damage = take_hit(DAMAGE_NOESCAPE, dam, m_name, -1);
2102+ get_damage = take_hit(p_ptr, DAMAGE_NOESCAPE, dam, m_name, -1);
21032103 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
21042104 {
21052105 GAME_TEXT m_name_self[80];
--- a/src/mutation.c
+++ b/src/mutation.c
@@ -2265,7 +2265,7 @@ bool mutation_power_aux(player_type *creature_ptr, int power)
22652265
22662266 case MUT1_STERILITY:
22672267 msg_print(_("突然頭が痛くなった!", "You suddenly have a headache!"));
2268- take_hit(DAMAGE_LOSELIFE, randint1(17) + 17, _("禁欲を強いた疲労", "the strain of forcing abstinence"), -1);
2268+ take_hit(p_ptr, DAMAGE_LOSELIFE, randint1(17) + 17, _("禁欲を強いた疲労", "the strain of forcing abstinence"), -1);
22692269 current_floor_ptr->num_repro += MAX_REPRO;
22702270 break;
22712271
--- a/src/patron.c
+++ b/src/patron.c
@@ -476,7 +476,7 @@ void gain_level_reward(player_type *creature_ptr, int chosen_reward)
476476 msg_print(_("「苦しむがよい、無能な愚か者よ!」", "'Suffer, pathetic fool!'"));
477477
478478 fire_ball(GF_DISINTEGRATE, 0, creature_ptr->lev * 4, 4);
479- take_hit(DAMAGE_NOESCAPE, creature_ptr->lev * 4, wrath_reason, -1);
479+ take_hit(p_ptr, DAMAGE_NOESCAPE, creature_ptr->lev * 4, wrath_reason, -1);
480480 reward = _("分解の球が発生した。", "generating disintegration ball");
481481 break;
482482
@@ -569,7 +569,7 @@ void gain_level_reward(player_type *creature_ptr, int chosen_reward)
569569 msg_format(_("%sの声が轟き渡った:", "The voice of %s thunders:"), chaos_patrons[creature_ptr->chaos_patron]);
570570 msg_print(_("「死ぬがよい、下僕よ!」", "'Die, mortal!'"));
571571
572- take_hit(DAMAGE_LOSELIFE, creature_ptr->lev * 4, wrath_reason, -1);
572+ take_hit(p_ptr, DAMAGE_LOSELIFE, creature_ptr->lev * 4, wrath_reason, -1);
573573 for (dummy = 0; dummy < A_MAX; dummy++)
574574 {
575575 (void)dec_stat(creature_ptr, dummy, 10 + randint1(15), FALSE);
--- a/src/player-damage.c
+++ b/src/player-damage.c
@@ -221,7 +221,7 @@ HIT_POINT acid_dam(HIT_POINT dam, concptr kb_str, int monspell, bool aura)
221221 if (acid_minus_ac(p_ptr)) dam = (dam + 1) / 2;
222222 }
223223
224- get_damage = take_hit(aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
224+ get_damage = take_hit(p_ptr, aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
225225
226226 /* Inventory damage */
227227 if (!aura && !(double_resist && p_ptr->resist_acid))
@@ -268,7 +268,7 @@ HIT_POINT elec_dam(HIT_POINT dam, concptr kb_str, int monspell, bool aura)
268268 (void)do_dec_stat(p_ptr, A_DEX);
269269 }
270270
271- get_damage = take_hit(aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
271+ get_damage = take_hit(p_ptr, aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
272272
273273 /* Inventory damage */
274274 if (!aura && !(double_resist && p_ptr->resist_elec))
@@ -316,7 +316,7 @@ HIT_POINT fire_dam(HIT_POINT dam, concptr kb_str, int monspell, bool aura)
316316 (void)do_dec_stat(p_ptr, A_STR);
317317 }
318318
319- get_damage = take_hit(aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
319+ get_damage = take_hit(p_ptr, aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
320320
321321 /* Inventory damage */
322322 if (!aura && !(double_resist && p_ptr->resist_fire))
@@ -363,7 +363,7 @@ HIT_POINT cold_dam(HIT_POINT dam, concptr kb_str, int monspell, bool aura)
363363 (void)do_dec_stat(p_ptr, A_STR);
364364 }
365365
366- get_damage = take_hit(aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
366+ get_damage = take_hit(p_ptr, aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
367367
368368 /* Inventory damage */
369369 if (!aura && !(double_resist && p_ptr->resist_cold))
@@ -383,18 +383,18 @@ HIT_POINT cold_dam(HIT_POINT dam, concptr kb_str, int monspell, bool aura)
383383 * setting the player to "dead".
384384 */
385385
386-int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
386+int take_hit(player_type *creature_ptr, int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
387387 {
388- int old_chp = p_ptr->chp;
388+ int old_chp = creature_ptr->chp;
389389
390390 char death_message[1024];
391391 char tmp[1024];
392392
393- int warning = (p_ptr->mhp * hitpoint_warn / 10);
394- if (p_ptr->is_dead) return 0;
393+ int warning = (creature_ptr->mhp * hitpoint_warn / 10);
394+ if (creature_ptr->is_dead) return 0;
395395
396- if (p_ptr->sutemi) damage *= 2;
397- if (p_ptr->special_defense & KATA_IAI) damage += (damage + 4) / 5;
396+ if (creature_ptr->sutemi) damage *= 2;
397+ if (creature_ptr->special_defense & KATA_IAI) damage += (damage + 4) / 5;
398398
399399 if (easy_band) damage = (damage + 1) / 2;
400400
@@ -403,7 +403,7 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
403403 disturb(TRUE, TRUE);
404404 if (auto_more)
405405 {
406- p_ptr->now_damaged = TRUE;
406+ creature_ptr->now_damaged = TRUE;
407407 }
408408 }
409409
@@ -441,7 +441,7 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
441441 }
442442 }
443443
444- if (p_ptr->wraith_form)
444+ if (creature_ptr->wraith_form)
445445 {
446446 if (damage_type == DAMAGE_FORCE)
447447 {
@@ -454,7 +454,7 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
454454 }
455455 }
456456
457- if (p_ptr->special_defense & KATA_MUSOU)
457+ if (creature_ptr->special_defense & KATA_MUSOU)
458458 {
459459 damage /= 2;
460460 if ((damage == 0) && one_in_(2)) damage = 1;
@@ -462,28 +462,28 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
462462 } /* not if LOSELIFE USELIFE */
463463
464464 /* Hurt the player */
465- p_ptr->chp -= damage;
466- if (damage_type == DAMAGE_GENO && p_ptr->chp < 0)
465+ creature_ptr->chp -= damage;
466+ if (damage_type == DAMAGE_GENO && creature_ptr->chp < 0)
467467 {
468- damage += p_ptr->chp;
469- p_ptr->chp = 0;
468+ damage += creature_ptr->chp;
469+ creature_ptr->chp = 0;
470470 }
471471
472472 /* Display the hitpoints */
473- p_ptr->redraw |= (PR_HP);
473+ creature_ptr->redraw |= (PR_HP);
474474
475- p_ptr->window |= (PW_PLAYER);
475+ creature_ptr->window |= (PW_PLAYER);
476476
477- if (damage_type != DAMAGE_GENO && p_ptr->chp == 0)
477+ if (damage_type != DAMAGE_GENO && creature_ptr->chp == 0)
478478 {
479- chg_virtue(p_ptr, V_SACRIFICE, 1);
480- chg_virtue(p_ptr, V_CHANCE, 2);
479+ chg_virtue(creature_ptr, V_SACRIFICE, 1);
480+ chg_virtue(creature_ptr, V_CHANCE, 2);
481481 }
482482
483483 /* Dead player */
484- if (p_ptr->chp < 0)
484+ if (creature_ptr->chp < 0)
485485 {
486- bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
486+ bool android = (creature_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
487487
488488 #ifdef JP /* 死んだ時に強制終了して死を回避できなくしてみた by Habu */
489489 if (!cheat_save)
@@ -492,26 +492,26 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
492492
493493 sound(SOUND_DEATH);
494494
495- chg_virtue(p_ptr, V_SACRIFICE, 10);
495+ chg_virtue(creature_ptr, V_SACRIFICE, 10);
496496
497497 handle_stuff();
498- p_ptr->leaving = TRUE;
498+ creature_ptr->leaving = TRUE;
499499
500500 /* Note death */
501- p_ptr->is_dead = TRUE;
501+ creature_ptr->is_dead = TRUE;
502502
503- if (p_ptr->inside_arena)
503+ if (creature_ptr->inside_arena)
504504 {
505- concptr m_name = r_name + r_info[arena_info[p_ptr->arena_number].r_idx].name;
505+ concptr m_name = r_name + r_info[arena_info[creature_ptr->arena_number].r_idx].name;
506506 msg_format(_("あなたは%sの前に敗れ去った。", "You are beaten by %s."), m_name);
507507 msg_print(NULL);
508- if (record_arena) do_cmd_write_nikki(NIKKI_ARENA, -1 - p_ptr->arena_number, m_name);
508+ if (record_arena) do_cmd_write_nikki(NIKKI_ARENA, -1 - creature_ptr->arena_number, m_name);
509509 }
510510 else
511511 {
512512 QUEST_IDX q_idx = quest_number(current_floor_ptr->dun_level);
513513 bool seppuku = streq(hit_from, "Seppuku");
514- bool winning_seppuku = p_ptr->total_winner && seppuku;
514+ bool winning_seppuku = creature_ptr->total_winner && seppuku;
515515
516516 play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_GAMEOVER);
517517
@@ -523,24 +523,24 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
523523 /* Note cause of death */
524524 if (seppuku)
525525 {
526- strcpy(p_ptr->died_from, hit_from);
526+ strcpy(creature_ptr->died_from, hit_from);
527527 #ifdef JP
528- if (!winning_seppuku) strcpy(p_ptr->died_from, "切腹");
528+ if (!winning_seppuku) strcpy(creature_ptr->died_from, "切腹");
529529 #endif
530530 }
531531 else
532532 {
533533 char dummy[1024];
534534 #ifdef JP
535- sprintf(dummy, "%s%s%s", !p_ptr->paralyzed ? "" : p_ptr->free_act ? "彫像状態で" : "麻痺状態で", p_ptr->image ? "幻覚に歪んだ" : "", hit_from);
535+ sprintf(dummy, "%s%s%s", !creature_ptr->paralyzed ? "" : creature_ptr->free_act ? "彫像状態で" : "麻痺状態で", creature_ptr->image ? "幻覚に歪んだ" : "", hit_from);
536536 #else
537- sprintf(dummy, "%s%s", hit_from, !p_ptr->paralyzed ? "" : " while helpless");
537+ sprintf(dummy, "%s%s", hit_from, !creature_ptr->paralyzed ? "" : " while helpless");
538538 #endif
539- my_strcpy(p_ptr->died_from, dummy, sizeof p_ptr->died_from);
539+ my_strcpy(creature_ptr->died_from, dummy, sizeof creature_ptr->died_from);
540540 }
541541
542542 /* No longer a winner */
543- p_ptr->total_winner = FALSE;
543+ creature_ptr->total_winner = FALSE;
544544
545545 if (winning_seppuku)
546546 {
@@ -550,7 +550,7 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
550550 {
551551 char buf[20];
552552
553- if (p_ptr->inside_arena)
553+ if (creature_ptr->inside_arena)
554554 strcpy(buf, _("アリーナ", "in the Arena"));
555555 else if (!current_floor_ptr->dun_level)
556556 strcpy(buf, _("地上", "on the surface"));
@@ -560,7 +560,7 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
560560 else
561561 sprintf(buf, _("%d階", "level %d"), (int)current_floor_ptr->dun_level);
562562
563- sprintf(tmp, _("%sで%sに殺された。", "killed by %s %s."), buf, p_ptr->died_from);
563+ sprintf(tmp, _("%sで%sに殺された。", "killed by %s %s."), buf, creature_ptr->died_from);
564564 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
565565 }
566566
@@ -577,8 +577,8 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
577577 flush();
578578
579579 /* Initialize "last message" buffer */
580- if (p_ptr->last_message) string_free(p_ptr->last_message);
581- p_ptr->last_message = NULL;
580+ if (creature_ptr->last_message) string_free(creature_ptr->last_message);
581+ creature_ptr->last_message = NULL;
582582
583583 /* Hack -- Note death */
584584 if (!last_words)
@@ -619,7 +619,7 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
619619 strcpy(death_message, android ? "You are broken." : "You die.");
620620 #endif
621621 }
622- else p_ptr->last_message = string_make(death_message);
622+ else creature_ptr->last_message = string_make(death_message);
623623
624624 #ifdef JP
625625 if (winning_seppuku)
@@ -687,7 +687,7 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
687687 handle_stuff();
688688
689689 /* Hitpoint warning */
690- if (p_ptr->chp < warning)
690+ if (creature_ptr->chp < warning)
691691 {
692692 /* Hack -- bell on first notice */
693693 if (old_chp > warning) bell();
@@ -696,7 +696,7 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
696696
697697 if (record_danger && (old_chp > warning))
698698 {
699- if (p_ptr->image && damage_type == DAMAGE_ATTACK)
699+ if (creature_ptr->image && damage_type == DAMAGE_ATTACK)
700700 hit_from = _("何か", "something");
701701
702702 sprintf(tmp, _("%sによってピンチに陥った。", "A critical situation because of %s."), hit_from);
@@ -706,14 +706,14 @@ int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
706706 if (auto_more)
707707 {
708708 /* stop auto_more even if DAMAGE_USELIFE */
709- p_ptr->now_damaged = TRUE;
709+ creature_ptr->now_damaged = TRUE;
710710 }
711711
712712 msg_print(_("*** 警告:低ヒット・ポイント! ***", "*** LOW HITPOINT WARNING! ***"));
713713 msg_print(NULL);
714714 flush();
715715 }
716- if (p_ptr->wild_mode && !p_ptr->leaving && (p_ptr->chp < MAX(warning, p_ptr->mhp / 5)))
716+ if (creature_ptr->wild_mode && !creature_ptr->leaving && (creature_ptr->chp < MAX(warning, creature_ptr->mhp / 5)))
717717 {
718718 change_wild_mode(FALSE);
719719 }
--- a/src/player-damage.h
+++ b/src/player-damage.h
@@ -9,7 +9,7 @@
99 #define DAMAGE_ATTACK 4
1010 #define DAMAGE_NOESCAPE 5
1111 #define DAMAGE_USELIFE 6
12-extern int take_hit(int damage_type, HIT_POINT damage, concptr kb_str, int monspell);
12+extern int take_hit(player_type *creature_ptr, int damage_type, HIT_POINT damage, concptr kb_str, int monspell);
1313
1414 /*
1515 * This seems like a pretty standard "typedef"
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -3694,7 +3694,7 @@ void do_poly_wounds(player_type *creature_ptr)
36943694 if (Nasty_effect)
36953695 {
36963696 msg_print(_("新たな傷ができた!", "A new wound was created!"));
3697- take_hit(DAMAGE_LOSELIFE, change / 2, _("変化した傷", "a polymorphed wound"), -1);
3697+ take_hit(p_ptr, DAMAGE_LOSELIFE, change / 2, _("変化した傷", "a polymorphed wound"), -1);
36983698 set_cut(creature_ptr,change);
36993699 }
37003700 else
@@ -3869,7 +3869,7 @@ void do_poly_self(player_type *creature_ptr)
38693869 if (one_in_(6))
38703870 {
38713871 msg_print(_("現在の姿で生きていくのは困難なようだ!", "You find living difficult in your present form!"));
3872- take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), creature_ptr->lev), _("致命的な突然変異", "a lethal mutation"), -1);
3872+ take_hit(p_ptr, DAMAGE_LOSELIFE, damroll(randint1(10), creature_ptr->lev), _("致命的な突然変異", "a lethal mutation"), -1);
38733873
38743874 power -= 10;
38753875 }
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -5177,7 +5177,7 @@ void wreck_the_pattern(void)
51775177 msg_print(_("パターンを血で汚してしまった!", "You bleed on the Pattern!"));
51785178 msg_print(_("何か恐ろしい事が起こった!", "Something terrible happens!"));
51795179
5180- if (!IS_INVULN()) take_hit(DAMAGE_NOESCAPE, damroll(10, 8), _("パターン損壊", "corrupting the Pattern"), -1);
5180+ if (!IS_INVULN()) take_hit(p_ptr, DAMAGE_NOESCAPE, damroll(10, 8), _("パターン損壊", "corrupting the Pattern"), -1);
51815181 to_ruin = randint1(45) + 35;
51825182
51835183 while (to_ruin--)
--- a/src/racial.c
+++ b/src/racial.c
@@ -2026,7 +2026,7 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
20262026 {
20272027 actual_racial_cost -= p_ptr->csp;
20282028 p_ptr->csp = 0;
2029- take_hit(DAMAGE_USELIFE, actual_racial_cost, _("過度の集中", "concentrating too hard"), -1);
2029+ take_hit(p_ptr, DAMAGE_USELIFE, actual_racial_cost, _("過度の集中", "concentrating too hard"), -1);
20302030 }
20312031 else p_ptr->csp -= actual_racial_cost;
20322032
--- a/src/realm-daemon.c
+++ b/src/realm-daemon.c
@@ -569,7 +569,7 @@ concptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
569569 if (!get_aim_dir(&dir)) return NULL;
570570
571571 fire_ball_hide(GF_BLOOD_CURSE, dir, dam, rad);
572- take_hit(DAMAGE_USELIFE, 20 + randint1(30), _("血の呪い", "Blood curse"), -1);
572+ take_hit(p_ptr, DAMAGE_USELIFE, 20 + randint1(30), _("血の呪い", "Blood curse"), -1);
573573 }
574574 }
575575 break;
--- a/src/realm-death.c
+++ b/src/realm-death.c
@@ -612,7 +612,7 @@ concptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
612612 if (!get_aim_dir(&dir)) return NULL;
613613
614614 fire_ball(GF_HELL_FIRE, dir, dam, rad);
615- take_hit(DAMAGE_USELIFE, 20 + randint1(30), _("地獄の劫火の呪文を唱えた疲労", "the strain of casting Hellfire"), -1);
615+ take_hit(p_ptr, DAMAGE_USELIFE, 20 + randint1(30), _("地獄の劫火の呪文を唱えた疲労", "the strain of casting Hellfire"), -1);
616616 }
617617 }
618618 break;
--- a/src/realm-hissatsu.c
+++ b/src/realm-hissatsu.c
@@ -919,7 +919,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
919919 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
920920 return NULL;
921921 }
922- take_hit(DAMAGE_NOESCAPE, 100 + randint1(100), _("慶雲鬼忍剣を使った衝撃", "exhaustion on using Keiun-Kininken"), -1);
922+ take_hit(p_ptr, DAMAGE_NOESCAPE, 100 + randint1(100), _("慶雲鬼忍剣を使った衝撃", "exhaustion on using Keiun-Kininken"), -1);
923923 }
924924 break;
925925
@@ -940,13 +940,13 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
940940 if (i != '@') return NULL;
941941 if (p_ptr->total_winner)
942942 {
943- take_hit(DAMAGE_FORCE, 9999, "Seppuku", -1);
943+ take_hit(p_ptr, DAMAGE_FORCE, 9999, "Seppuku", -1);
944944 p_ptr->total_winner = TRUE;
945945 }
946946 else
947947 {
948948 msg_print(_("武士道とは、死ぬことと見つけたり。", "Meaning of Bushi-do is found in the death."));
949- take_hit(DAMAGE_FORCE, 9999, "Seppuku", -1);
949+ take_hit(p_ptr, DAMAGE_FORCE, 9999, "Seppuku", -1);
950950 }
951951 }
952952 break;
--- a/src/realm-nature.c
+++ b/src/realm-nature.c
@@ -125,7 +125,7 @@ concptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
125125 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!"));
128- take_hit(DAMAGE_NOESCAPE, damroll(2, 2), _("日の光", "daylight"), -1);
128+ take_hit(p_ptr, DAMAGE_NOESCAPE, damroll(2, 2), _("日の光", "daylight"), -1);
129129 }
130130 }
131131 }
@@ -529,7 +529,7 @@ concptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
529529 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!"));
532- take_hit(DAMAGE_NOESCAPE, 50, _("日光", "sunlight"), -1);
532+ take_hit(p_ptr, DAMAGE_NOESCAPE, 50, _("日光", "sunlight"), -1);
533533 }
534534 }
535535 }
--- a/src/spells-floor.c
+++ b/src/spells-floor.c
@@ -910,7 +910,7 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
910910 killer = _("地震", "an earthquake");
911911 }
912912
913- take_hit(DAMAGE_ATTACK, damage, killer, -1);
913+ take_hit(p_ptr, DAMAGE_ATTACK, damage, killer, -1);
914914 }
915915 }
916916
--- a/src/spells-object.c
+++ b/src/spells-object.c
@@ -850,12 +850,12 @@ bool perilous_secrets(player_type *creature_ptr)
850850 }
851851 creature_ptr->redraw |= (PR_MANA);
852852 }
853- take_hit(DAMAGE_LOSELIFE, damroll(1, 12), _("危険な秘密", "perilous secrets"), -1);
853+ take_hit(p_ptr, DAMAGE_LOSELIFE, damroll(1, 12), _("危険な秘密", "perilous secrets"), -1);
854854 /* Confusing. */
855855 if (one_in_(5)) (void)set_confused(p_ptr, creature_ptr->confused + randint1(10));
856856
857857 /* Exercise a little care... */
858- if (one_in_(20)) take_hit(DAMAGE_LOSELIFE, damroll(4, 10), _("危険な秘密", "perilous secrets"), -1);
858+ if (one_in_(20)) take_hit(p_ptr, DAMAGE_LOSELIFE, damroll(4, 10), _("危険な秘密", "perilous secrets"), -1);
859859 return TRUE;
860860
861861 }
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -1738,7 +1738,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
17381738 {
17391739 /* Injure +/- confusion */
17401740 monster_desc(killer, m_ptr, MD_WRONGDOER_NAME);
1741- take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
1741+ take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
17421742 if (one_in_(4) && !CHECK_MULTISHADOW())
17431743 {
17441744 switch (randint1(4))
@@ -1836,7 +1836,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
18361836 p_ptr->redraw |= PR_MANA;
18371837 p_ptr->window |= (PW_SPELL);
18381838 }
1839- take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
1839+ take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
18401840 }
18411841 dam = 0;
18421842 }
@@ -4163,7 +4163,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
41634163 do_dec_stat(p_ptr, A_CON);
41644164 }
41654165
4166- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4166+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
41674167
41684168 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
41694169 {
@@ -4180,7 +4180,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
41804180
41814181 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
41824182 if (double_resist) dam = (2 * dam + 2) / 5;
4183- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4183+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
41844184 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
41854185 {
41864186 set_poisoned(p_ptr, p_ptr->poisoned + randint0(dam) + 10);
@@ -4206,7 +4206,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
42064206 case GF_MISSILE:
42074207 {
42084208 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4209- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4209+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
42104210 break;
42114211 }
42124212
@@ -4218,7 +4218,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
42184218 dam /= 2;
42194219 else if (p_ptr->align < -10)
42204220 dam *= 2;
4221- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4221+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
42224222 break;
42234223 }
42244224
@@ -4227,7 +4227,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
42274227 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
42284228 if (p_ptr->align > 10)
42294229 dam *= 2;
4230- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4230+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
42314231 break;
42324232 }
42334233
@@ -4243,7 +4243,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
42434243 msg_print(_("矢を斬り捨てた!", "You cut down the arrow!"));
42444244 break;
42454245 }
4246- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4246+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
42474247 break;
42484248 }
42494249
@@ -4251,7 +4251,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
42514251 case GF_PLASMA:
42524252 {
42534253 if (fuzzy) msg_print(_("何かとても熱いもので攻撃された!", "You are hit by something *HOT*!"));
4254- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4254+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
42554255
42564256 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
42574257 {
@@ -4288,7 +4288,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
42884288 }
42894289 else
42904290 {
4291- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4291+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
42924292 }
42934293
42944294 break;
@@ -4317,7 +4317,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
43174317 if (p_ptr->resist_water) get_damage /= 4;
43184318 }
43194319
4320- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4320+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
43214321 break;
43224322 }
43234323
@@ -4357,7 +4357,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
43574357 }
43584358 }
43594359
4360- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4360+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
43614361 break;
43624362 }
43634363
@@ -4379,7 +4379,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
43794379 inven_damage(set_cold_destroy, 2);
43804380 }
43814381
4382- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4382+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
43834383 break;
43844384 }
43854385
@@ -4402,7 +4402,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
44024402 inven_damage(set_cold_destroy, 2);
44034403 }
44044404
4405- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4405+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
44064406 break;
44074407 }
44084408
@@ -4418,7 +4418,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
44184418 {
44194419 (void)set_confused(p_ptr, p_ptr->confused + randint1(20) + 10);
44204420 }
4421- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4421+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
44224422 break;
44234423 }
44244424
@@ -4434,7 +4434,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
44344434 {
44354435 (void)apply_disenchant(0);
44364436 }
4437- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4437+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
44384438 break;
44394439 }
44404440
@@ -4450,7 +4450,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
44504450 {
44514451 apply_nexus(m_ptr);
44524452 }
4453- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4453+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
44544454 break;
44554455 }
44564456
@@ -4462,7 +4462,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
44624462 {
44634463 (void)set_stun(p_ptr, p_ptr->stun + randint1(20));
44644464 }
4465- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4465+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
44664466 break;
44674467 }
44684468
@@ -4490,7 +4490,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
44904490 inven_damage(set_cold_destroy, 3);
44914491 }
44924492
4493- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4493+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
44944494 break;
44954495 }
44964496
@@ -4499,7 +4499,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
44994499 {
45004500 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
45014501 if (!CHECK_MULTISHADOW()) (void)set_slow(p_ptr, p_ptr->slow + randint0(4) + 4, FALSE);
4502- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4502+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
45034503 break;
45044504 }
45054505
@@ -4527,7 +4527,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
45274527 }
45284528
45294529 if (p_ptr->wraith_form) dam *= 2;
4530- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4530+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
45314531
45324532 if (p_ptr->wraith_form && !CHECK_MULTISHADOW())
45334533 {
@@ -4557,7 +4557,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
45574557 {
45584558 (void)set_blind(p_ptr, p_ptr->blind + randint1(5) + 2);
45594559 }
4560- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4560+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
45614561 break;
45624562 }
45634563
@@ -4620,7 +4620,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
46204620 }
46214621 }
46224622
4623- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4623+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
46244624 break;
46254625 }
46264626
@@ -4651,7 +4651,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
46514651 inven_damage(set_cold_destroy, 2);
46524652 }
46534653
4654- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4654+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
46554655 break;
46564656 }
46574657
@@ -4660,7 +4660,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
46604660 {
46614661 if (fuzzy) msg_print(_("純粋なエネルギーで攻撃された!", "You are hit by pure energy!"));
46624662
4663- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4663+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
46644664 break;
46654665 }
46664666
@@ -4711,7 +4711,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
47114711 case GF_SUPER_RAY:
47124712 {
47134713 if (fuzzy) msg_print(_("魔法のオーラで攻撃された!", "You are hit by an aura of magic!"));
4714- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4714+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
47154715 break;
47164716 }
47174717
@@ -4719,7 +4719,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
47194719 case GF_PSY_SPEAR:
47204720 {
47214721 if (fuzzy) msg_print(_("エネルギーの塊で攻撃された!", "You are hit by an energy!"));
4722- get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
4722+ get_damage = take_hit(p_ptr, DAMAGE_FORCE, dam, killer, monspell);
47234723 break;
47244724 }
47254725
@@ -4728,7 +4728,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
47284728 {
47294729 if (fuzzy) msg_print(_("何かが空からあなたの頭上に落ちてきた!", "Something falls from the sky on you!"));
47304730
4731- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4731+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
47324732 if (!p_ptr->resist_shard || one_in_(13))
47334733 {
47344734 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
@@ -4771,7 +4771,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
47714771 if (p_ptr->mimic_form)
47724772 {
47734773 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
4774- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4774+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
47754775 }
47764776 else
47774777 {
@@ -4792,7 +4792,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
47924792 /* Hurt a lot */
47934793 default:
47944794 {
4795- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4795+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
47964796 break;
47974797 }
47984798 }
@@ -4893,7 +4893,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
48934893 p_ptr->redraw |= PR_MANA;
48944894 }
48954895
4896- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4896+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
48974897 }
48984898 break;
48994899 }
@@ -4921,7 +4921,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
49214921 p_ptr->redraw |= PR_MANA;
49224922 }
49234923
4924- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4924+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
49254925 if (!CHECK_MULTISHADOW())
49264926 {
49274927 if (!p_ptr->resist_blind)
@@ -4963,7 +4963,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
49634963 else
49644964 {
49654965 if (!CHECK_MULTISHADOW()) curse_equipment(15, 0);
4966- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4966+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
49674967 }
49684968 break;
49694969 }
@@ -4979,7 +4979,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
49794979 else
49804980 {
49814981 if (!CHECK_MULTISHADOW()) curse_equipment(25, MIN(rlev / 2 - 15, 5));
4982- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4982+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
49834983 }
49844984 break;
49854985 }
@@ -4995,7 +4995,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
49954995 else
49964996 {
49974997 if (!CHECK_MULTISHADOW()) curse_equipment(33, MIN(rlev / 2 - 15, 15));
4998- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4998+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
49994999 }
50005000 break;
50015001 }
@@ -5010,7 +5010,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
50105010 }
50115011 else
50125012 {
5013- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5013+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, killer, monspell);
50145014 if (!CHECK_MULTISHADOW()) (void)set_cut(p_ptr,p_ptr->cut + damroll(10, 10));
50155015 }
50165016 break;
@@ -5032,7 +5032,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
50325032 curse_equipment(40, 20);
50335033 }
50345034
5035- get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
5035+ get_damage = take_hit(p_ptr, DAMAGE_ATTACK, dam, m_name, monspell);
50365036
50375037 if (p_ptr->chp < 1) p_ptr->chp = 1;
50385038 }
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -930,7 +930,7 @@ bool unleash_mana_storm(player_type *creature_ptr, bool powerful)
930930 (randint1(200) + (powerful ? 500 : 300)) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
931931 if ((creature_ptr->pclass != CLASS_MAGE) && (creature_ptr->pclass != CLASS_HIGH_MAGE) && (creature_ptr->pclass != CLASS_SORCERER) && (creature_ptr->pclass != CLASS_MAGIC_EATER) && (creature_ptr->pclass != CLASS_BLUE_MAGE))
932932 {
933- (void)take_hit(DAMAGE_NOESCAPE, 50, _("コントロールし難い強力な魔力の解放", "unleashing magics too mighty to control"), -1);
933+ (void)take_hit(p_ptr, DAMAGE_NOESCAPE, 50, _("コントロールし難い強力な魔力の解放", "unleashing magics too mighty to control"), -1);
934934 }
935935 return TRUE;
936936 }
@@ -1081,7 +1081,7 @@ bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side,
10811081
10821082 if (player_cast)
10831083 {
1084- take_hit(DAMAGE_GENO, randint1(dam_side), format(_("%^sの呪文を唱えた疲労", "the strain of casting %^s"), spell_name), -1);
1084+ take_hit(p_ptr, DAMAGE_GENO, randint1(dam_side), format(_("%^sの呪文を唱えた疲労", "the strain of casting %^s"), spell_name), -1);
10851085 }
10861086
10871087 /* Visual feedback */
@@ -2566,7 +2566,7 @@ bool activate_ty_curse(bool stop_ty, int *count)
25662566 HIT_POINT dam = damroll(10, 10);
25672567 msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!"));
25682568 project(0, 8, p_ptr->y, p_ptr->x, dam, GF_MANA, flg, -1);
2569- take_hit(DAMAGE_NOESCAPE, dam, _("純粋な魔力の解放", "released pure mana"), -1);
2569+ take_hit(p_ptr, DAMAGE_NOESCAPE, dam, _("純粋な魔力の解放", "released pure mana"), -1);
25702570 if (!one_in_(6)) break;
25712571 }
25722572 case 32: case 33:
@@ -2583,7 +2583,7 @@ bool activate_ty_curse(bool stop_ty, int *count)
25832583 if (!randint0(7))
25842584 {
25852585 project(0, 7, p_ptr->y, p_ptr->x, 50, GF_KILL_WALL, flg, -1);
2586- take_hit(DAMAGE_NOESCAPE, 50, _("エネルギーのうねり", "surge of energy"), -1);
2586+ take_hit(p_ptr, DAMAGE_NOESCAPE, 50, _("エネルギーのうねり", "surge of energy"), -1);
25872587 }
25882588 if (!one_in_(6)) break;
25892589 case 1: case 2: case 3: case 16: case 17:
@@ -4269,7 +4269,7 @@ bool double_attack(player_type *creature_ptr)
42694269
42704270 bool comvert_hp_to_mp(player_type *creature_ptr)
42714271 {
4272- int gain_sp = take_hit(DAMAGE_USELIFE, creature_ptr->lev, _("HPからMPへの無謀な変換", "thoughtless convertion from HP to SP"), -1) / 5;
4272+ int gain_sp = take_hit(p_ptr, DAMAGE_USELIFE, creature_ptr->lev, _("HPからMPへの無謀な変換", "thoughtless convertion from HP to SP"), -1) / 5;
42734273 if (gain_sp)
42744274 {
42754275 creature_ptr->csp += gain_sp;
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -1226,7 +1226,7 @@ void call_the_(void)
12261226 msg_print(_("ダンジョンは大きく揺れた。", "The dungeon trembles."));
12271227 }
12281228
1229- take_hit(DAMAGE_NOESCAPE, 100 + randint1(150), _("自殺的な虚無招来", "a suicidal Call the Void"), -1);
1229+ take_hit(p_ptr, DAMAGE_NOESCAPE, 100 + randint1(150), _("自殺的な虚無招来", "a suicidal Call the Void"), -1);
12301230 }
12311231 }
12321232
@@ -3466,7 +3466,7 @@ bool booze(player_type *creature_ptr)
34663466 bool detonation(player_type *creature_ptr)
34673467 {
34683468 msg_print(_("体の中で激しい爆発が起きた!", "Massive explosions rupture your body!"));
3469- take_hit(DAMAGE_NOESCAPE, damroll(50, 20), _("爆発の薬", "a potion of Detonation"), -1);
3469+ take_hit(p_ptr, DAMAGE_NOESCAPE, damroll(50, 20), _("爆発の薬", "a potion of Detonation"), -1);
34703470 (void)set_stun(p_ptr, creature_ptr->stun + 75);
34713471 (void)set_cut(p_ptr,creature_ptr->cut + 5000);
34723472 return TRUE;
--- a/src/trap.c
+++ b/src/trap.c
@@ -320,7 +320,7 @@ static void hit_trap_pit(int trap_feat_type)
320320 }
321321 }
322322
323- take_hit(DAMAGE_NOESCAPE, dam, trap_name, -1);
323+ take_hit(p_ptr, DAMAGE_NOESCAPE, dam, trap_name, -1);
324324 }
325325
326326 /*!
@@ -334,7 +334,7 @@ static bool hit_trap_dart(void)
334334 if (check_hit(125))
335335 {
336336 msg_print(_("小さなダーツが飛んできて刺さった!", "A small dart hits you!"));
337- take_hit(DAMAGE_ATTACK, damroll(1, 4), _("ダーツの罠", "a dart trap"), -1);
337+ take_hit(p_ptr, DAMAGE_ATTACK, damroll(1, 4), _("ダーツの罠", "a dart trap"), -1);
338338 if (!CHECK_MULTISHADOW()) hit = TRUE;
339339 }
340340 else
@@ -437,7 +437,7 @@ void hit_trap(bool break_trap)
437437 dam = damroll(2, 8);
438438 name = _("落とし戸", "a trap door");
439439
440- take_hit(DAMAGE_NOESCAPE, dam, name, -1);
440+ take_hit(p_ptr, DAMAGE_NOESCAPE, dam, name, -1);
441441
442442 /* Still alive and autosave enabled */
443443 if (autosave_l && (p_ptr->chp >= 0))
Show on old repository browser