• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision643ed157992994b87dbb81820139a3780df9473f (tree)
Time2019-06-21 23:43:38
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/chest.c
+++ b/src/chest.c
@@ -172,7 +172,7 @@ void chest_trap(POSITION y, POSITION x, OBJECT_IDX o_idx)
172172 msg_print(_("突如吹き出した緑色のガスに包み込まれた!", "A puff of green gas surrounds you!"));
173173 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
174174 {
175- (void)set_poisoned(p_ptr->poisoned + 10 + randint1(20));
175+ (void)set_poisoned(p_ptr, p_ptr->poisoned + 10 + randint1(20));
176176 }
177177 }
178178
--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1261,7 +1261,7 @@ bool activate_artifact(object_type *o_ptr)
12611261 {
12621262 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
12631263 (void)set_afraid(0);
1264- (void)set_poisoned(0);
1264+ (void)set_poisoned(p_ptr, 0);
12651265 break;
12661266 }
12671267
--- a/src/cmd-eat.c
+++ b/src/cmd-eat.c
@@ -70,7 +70,7 @@ void exe_eat_food(INVENTORY_IDX item)
7070 {
7171 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
7272 {
73- if (set_poisoned(p_ptr->poisoned + randint0(10) + 10))
73+ if (set_poisoned(p_ptr, p_ptr->poisoned + randint0(10) + 10))
7474 {
7575 ident = TRUE;
7676 }
@@ -188,7 +188,7 @@ void exe_eat_food(INVENTORY_IDX item)
188188
189189 case SV_FOOD_CURE_POISON:
190190 {
191- if (set_poisoned(0)) ident = TRUE;
191+ if (set_poisoned(p_ptr, 0)) ident = TRUE;
192192 break;
193193 }
194194
@@ -280,7 +280,7 @@ void exe_eat_food(INVENTORY_IDX item)
280280 case SV_FOOD_WAYBREAD:
281281 {
282282 msg_print(_("これはひじょうに美味だ。", "That tastes good."));
283- (void)set_poisoned(0);
283+ (void)set_poisoned(p_ptr, 0);
284284 (void)hp_player(p_ptr, damroll(4, 8));
285285 ident = TRUE;
286286 break;
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -145,7 +145,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
145145 (void)set_food(PY_FOOD_STARVE - 1);
146146 }
147147
148- (void)set_poisoned(0);
148+ (void)set_poisoned(p_ptr, 0);
149149 (void)set_paralyzed(p_ptr->paralyzed + 4);
150150 ident = TRUE;
151151 break;
@@ -153,7 +153,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
153153 case SV_POTION_POISON:
154154 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
155155 {
156- if (set_poisoned(p_ptr->poisoned + randint0(15) + 10))
156+ if (set_poisoned(p_ptr, p_ptr->poisoned + randint0(15) + 10))
157157 {
158158 ident = TRUE;
159159 }
@@ -268,11 +268,11 @@ void exe_quaff_potion(INVENTORY_IDX item)
268268 break;
269269
270270 case SV_POTION_SLOW_POISON:
271- if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
271+ if (set_poisoned(p_ptr, p_ptr->poisoned / 2)) ident = TRUE;
272272 break;
273273
274274 case SV_POTION_CURE_POISON:
275- if (set_poisoned(0)) ident = TRUE;
275+ if (set_poisoned(p_ptr, 0)) ident = TRUE;
276276 break;
277277
278278 case SV_POTION_BOLDNESS:
--- a/src/core.c
+++ b/src/core.c
@@ -1610,14 +1610,14 @@ static void process_world_aux_hp_and_sp(void)
16101610 msg_print(_("毒気を吸い込んだ!", "The gas poisons you!"));
16111611 take_hit(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);
1613- if (p_ptr->resist_pois) (void)set_poisoned(p_ptr->poisoned + 1);
1613+ if (p_ptr->resist_pois) (void)set_poisoned(p_ptr, p_ptr->poisoned + 1);
16141614 }
16151615 else
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);
16191619 take_hit(DAMAGE_NOESCAPE, damage, name, -1);
1620- if (p_ptr->resist_pois) (void)set_poisoned(p_ptr->poisoned + 3);
1620+ if (p_ptr->resist_pois) (void)set_poisoned(p_ptr, p_ptr->poisoned + 3);
16211621 }
16221622
16231623 cave_no_regen = TRUE;
@@ -2083,7 +2083,7 @@ static void process_world_aux_timeout(void)
20832083 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
20842084
20852085 /* Apply some healing */
2086- (void)set_poisoned(p_ptr->poisoned - adjust);
2086+ (void)set_poisoned(p_ptr, p_ptr->poisoned - adjust);
20872087 }
20882088
20892089 /* Stun */
--- a/src/melee1.c
+++ b/src/melee1.c
@@ -2817,7 +2817,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
28172817 /* Take "poison" effect */
28182818 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()) && !CHECK_MULTISHADOW())
28192819 {
2820- if (set_poisoned(p_ptr->poisoned + randint1(rlev) + 5))
2820+ if (set_poisoned(p_ptr, p_ptr->poisoned + randint1(rlev) + 5))
28212821 {
28222822 obvious = TRUE;
28232823 }
@@ -3451,7 +3451,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
34513451 /* Take "poison" effect */
34523452 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
34533453 {
3454- if (set_poisoned(p_ptr->poisoned + randint1(rlev) + 5))
3454+ if (set_poisoned(p_ptr, p_ptr->poisoned + randint1(rlev) + 5))
34553455 {
34563456 obvious = TRUE;
34573457 }
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -569,17 +569,17 @@ bool set_confused(player_type *creature_ptr, TIME_EFFECT v)
569569 * @param v 継続時間
570570 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
571571 */
572-bool set_poisoned(TIME_EFFECT v)
572+bool set_poisoned(player_type *creature_ptr, TIME_EFFECT v)
573573 {
574574 bool notice = FALSE;
575575 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
576576
577- if (p_ptr->is_dead) return FALSE;
577+ if (creature_ptr->is_dead) return FALSE;
578578
579579 /* Open */
580580 if (v)
581581 {
582- if (!p_ptr->poisoned)
582+ if (!creature_ptr->poisoned)
583583 {
584584 msg_print(_("毒に侵されてしまった!", "You are poisoned!"));
585585 notice = TRUE;
@@ -589,7 +589,7 @@ bool set_poisoned(TIME_EFFECT v)
589589 /* Shut */
590590 else
591591 {
592- if (p_ptr->poisoned)
592+ if (creature_ptr->poisoned)
593593 {
594594 msg_print(_("やっと毒の痛みがなくなった。", "You are no longer poisoned."));
595595 notice = TRUE;
@@ -597,8 +597,8 @@ bool set_poisoned(TIME_EFFECT v)
597597 }
598598
599599 /* Use the value */
600- p_ptr->poisoned = v;
601- p_ptr->redraw |= (PR_STATUS);
600+ creature_ptr->poisoned = v;
601+ creature_ptr->redraw |= (PR_STATUS);
602602
603603 /* Nothing to notice */
604604 if (!notice) return (FALSE);
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -17,7 +17,7 @@ extern void dispel_player(void);
1717 extern bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, IDX p, bool do_dec);
1818 extern bool set_blind(player_type *creature_ptr, TIME_EFFECT v);
1919 extern bool set_confused(player_type *creature_ptr, TIME_EFFECT v);
20-extern bool set_poisoned(TIME_EFFECT v);
20+extern bool set_poisoned(player_type *creature_ptr, TIME_EFFECT v);
2121 extern bool set_afraid(TIME_EFFECT v);
2222 extern bool set_paralyzed(TIME_EFFECT v);
2323 extern bool set_image(TIME_EFFECT v);
--- a/src/realm-arcane.c
+++ b/src/realm-arcane.c
@@ -243,7 +243,7 @@ concptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
243243 {
244244 if (cast)
245245 {
246- set_poisoned(0);
246+ set_poisoned(p_ptr, 0);
247247 }
248248 }
249249 break;
--- a/src/realm-crusade.c
+++ b/src/realm-crusade.c
@@ -128,7 +128,7 @@ concptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
128128 if (cast)
129129 {
130130 set_cut(0);
131- set_poisoned(0);
131+ set_poisoned(p_ptr, 0);
132132 set_stun(0);
133133 }
134134 }
@@ -268,7 +268,7 @@ concptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
268268 dispel_evil(randint1(dam_sides));
269269 hp_player(p_ptr, heal);
270270 set_afraid(0);
271- set_poisoned(0);
271+ set_poisoned(p_ptr, 0);
272272 set_stun(0);
273273 set_cut(0);
274274 }
--- a/src/realm-life.c
+++ b/src/realm-life.c
@@ -121,7 +121,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
121121 {
122122 if (cast)
123123 {
124- set_poisoned(0);
124+ set_poisoned(p_ptr, 0);
125125 }
126126 }
127127 break;
--- a/src/realm-nature.c
+++ b/src/realm-nature.c
@@ -182,7 +182,7 @@ concptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
182182 {
183183 hp_player(p_ptr, damroll(dice, sides));
184184 set_cut(0);
185- set_poisoned(0);
185+ set_poisoned(p_ptr, 0);
186186 }
187187 }
188188 break;
--- a/src/spells-status.c
+++ b/src/spells-status.c
@@ -277,7 +277,7 @@ bool_hack life_stream(bool_hack message, bool_hack virtue_change)
277277 msg_print(_("体中に生命力が満ちあふれてきた!", "You feel life flow through your body!"));
278278 }
279279 restore_level();
280- (void)set_poisoned(0);
280+ (void)set_poisoned(p_ptr, 0);
281281 (void)set_blind(p_ptr, 0);
282282 (void)set_confused(p_ptr, 0);
283283 (void)set_image(0);
@@ -336,7 +336,7 @@ bool_hack cure_critical_wounds(HIT_POINT pow)
336336 if (hp_player(p_ptr, pow)) ident = TRUE;
337337 if (set_blind(p_ptr, 0)) ident = TRUE;
338338 if (set_confused(p_ptr, 0)) ident = TRUE;
339- if (set_poisoned(0)) ident = TRUE;
339+ if (set_poisoned(p_ptr, 0)) ident = TRUE;
340340 if (set_stun(0)) ident = TRUE;
341341 if (set_cut(0)) ident = TRUE;
342342 if (set_shero(0, TRUE)) ident = TRUE;
@@ -349,7 +349,7 @@ bool_hack true_healing(HIT_POINT pow)
349349 if (hp_player(p_ptr, pow)) ident = TRUE;
350350 if (set_blind(p_ptr, 0)) ident = TRUE;
351351 if (set_confused(p_ptr, 0)) ident = TRUE;
352- if (set_poisoned(0)) ident = TRUE;
352+ if (set_poisoned(p_ptr, 0)) ident = TRUE;
353353 if (set_stun(0)) ident = TRUE;
354354 if (set_cut(0)) ident = TRUE;
355355 if (set_image(0)) ident = TRUE;
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -4167,7 +4167,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
41674167
41684168 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
41694169 {
4170- set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4170+ set_poisoned(p_ptr, p_ptr->poisoned + randint0(dam) + 10);
41714171 }
41724172 break;
41734173 }
@@ -4183,7 +4183,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
41834183 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
41844184 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
41854185 {
4186- set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4186+ set_poisoned(p_ptr, p_ptr->poisoned + randint0(dam) + 10);
41874187
41884188 if (one_in_(5)) /* 6 */
41894189 {
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -915,7 +915,7 @@ bool cleansing_nova(player_type *creature_ptr, bool magic, bool powerful)
915915 if (dispel_evil(powerful ? 225 : 150)) ident = TRUE;
916916 int k = 3 * creature_ptr->lev;
917917 if (set_protevil((magic ? 0 : creature_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
918- if (set_poisoned(0)) ident = TRUE;
918+ if (set_poisoned(p_ptr, 0)) ident = TRUE;
919919 if (set_afraid(0)) ident = TRUE;
920920 if (hp_player(p_ptr, 50)) ident = TRUE;
921921 if (set_stun(0)) ident = TRUE;
--- a/src/trap.c
+++ b/src/trap.c
@@ -315,7 +315,7 @@ static void hit_trap_pit(int trap_feat_type)
315315 else
316316 {
317317 dam = dam * 2;
318- (void)set_poisoned(p_ptr->poisoned + randint1(dam));
318+ (void)set_poisoned(p_ptr, p_ptr->poisoned + randint1(dam));
319319 }
320320 }
321321 }
@@ -547,7 +547,7 @@ void hit_trap(bool break_trap)
547547
548548 case TRAP_POISON:
549549 {
550- hit_trap_set_abnormal_status(
550+ hit_trap_set_abnormal_status_p(
551551 _("刺激的な緑色のガスに包み込まれた!", "A pungent green gas surrounds you!"),
552552 p_ptr->resist_pois || IS_OPPOSE_POIS(),
553553 set_poisoned, p_ptr->poisoned + (TIME_EFFECT)randint0(20) + 10);
Show on old repository browser