• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision4f44db28b1c56c021902f5a0001e503660c40b3f (tree)
Time2019-06-26 00:09:11
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/chest.c
+++ b/src/chest.c
@@ -283,7 +283,7 @@ void chest_trap(POSITION y, POSITION x, OBJECT_IDX o_idx)
283283 if (randint1(100 + o_ptr->pval * 2) > p_ptr->skill_sav)
284284 {
285285 if (one_in_(6)) take_hit(DAMAGE_NOESCAPE, damroll(5, 20), _("破滅のトラップの宝箱", "a chest dispel-player trap"), -1);
286- else if (one_in_(5)) (void)set_cut(p_ptr->cut + 200);
286+ else if (one_in_(5)) (void)set_cut(p_ptr,p_ptr->cut + 200);
287287 else if (one_in_(4))
288288 {
289289 if (!p_ptr->free_act)
--- a/src/cmd-mane.c
+++ b/src/cmd-mane.c
@@ -659,7 +659,7 @@ static bool use_mane(int spell)
659659 msg_print(_("自分の傷に念を集中した。", "You concentrate on your wounds!"));
660660 (void)hp_player(p_ptr, plev*6);
661661 (void)set_stun(p_ptr, 0);
662- (void)set_cut(0);
662+ (void)set_cut(p_ptr,0);
663663 break;
664664 case MS_INVULNER:
665665 msg_print(_("無傷の球の呪文を唱えた。", "You cast a Globe of Invulnerability."));
--- a/src/core.c
+++ b/src/core.c
@@ -2092,7 +2092,7 @@ static void process_world_aux_timeout(void)
20922092 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
20932093
20942094 /* Apply some healing */
2095- (void)set_stun(p_ptr->stun - adjust);
2095+ (void)set_stun(p_ptr, p_ptr->stun - adjust);
20962096 }
20972097
20982098 /* Cut */
@@ -2104,7 +2104,7 @@ static void process_world_aux_timeout(void)
21042104 if (p_ptr->cut > 1000) adjust = 0;
21052105
21062106 /* Apply some healing */
2107- (void)set_cut(p_ptr->cut - adjust);
2107+ (void)set_cut(p_ptr,p_ptr->cut - adjust);
21082108 }
21092109 }
21102110
--- a/src/melee1.c
+++ b/src/melee1.c
@@ -3702,7 +3702,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
37023702 }
37033703
37043704 /* Apply the cut */
3705- if (cut_plus) (void)set_cut(p_ptr->cut + cut_plus);
3705+ if (cut_plus) (void)set_cut(p_ptr,p_ptr->cut + cut_plus);
37063706 }
37073707
37083708 /* Handle stun */
--- a/src/mind.c
+++ b/src/mind.c
@@ -1132,7 +1132,7 @@ static bool cast_mindcrafter_spell(int spell)
11321132 case 9:
11331133 /* Adrenaline */
11341134 set_afraid(p_ptr, 0);
1135- set_stun(0);
1135+ set_stun(p_ptr, 0);
11361136
11371137 /*
11381138 * Only heal when Adrenalin Channeling is not active. We check
@@ -1919,7 +1919,7 @@ void do_cmd_mind(void)
19191919 }
19201920 else if (b < 90)
19211921 {
1922- set_stun(p_ptr->stun + randint1(8));
1922+ set_stun(p_ptr, p_ptr->stun + randint1(8));
19231923 }
19241924 else
19251925 {
--- a/src/mspells3.c
+++ b/src/mspells3.c
@@ -1282,7 +1282,7 @@ static bool cast_learned_spell(int spell, bool success)
12821282 msg_print(_("自分の傷に念を集中した。", "You concentrate on your wounds!"));
12831283 (void)hp_player(p_ptr, plev*4);
12841284 (void)set_stun(p_ptr, 0);
1285- (void)set_cut(0);
1285+ (void)set_cut(p_ptr,0);
12861286 break;
12871287 case MS_INVULNER:
12881288 msg_print(_("無傷の球の呪文を唱えた。", "You cast a Globe of Invulnerability."));
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -2678,29 +2678,29 @@ bool set_oppose_pois(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
26782678 * @details
26792679 * Note the special code to only notice "range" changes.
26802680 */
2681-bool set_stun(TIME_EFFECT v)
2681+bool set_stun(player_type *creature_ptr, TIME_EFFECT v)
26822682 {
26832683 int old_aux, new_aux;
26842684 bool notice = FALSE;
26852685 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
26862686
2687- if (p_ptr->is_dead) return FALSE;
2688- if (PRACE_IS_(p_ptr, RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
2687+ if (creature_ptr->is_dead) return FALSE;
2688+ if (PRACE_IS_(creature_ptr, RACE_GOLEM) || ((creature_ptr->pclass == CLASS_BERSERKER) && (creature_ptr->lev > 34))) v = 0;
26892689
26902690 /* Knocked out */
2691- if (p_ptr->stun > 100)
2691+ if (creature_ptr->stun > 100)
26922692 {
26932693 old_aux = 3;
26942694 }
26952695
26962696 /* Heavy stun */
2697- else if (p_ptr->stun > 50)
2697+ else if (creature_ptr->stun > 50)
26982698 {
26992699 old_aux = 2;
27002700 }
27012701
27022702 /* Stun */
2703- else if (p_ptr->stun > 0)
2703+ else if (creature_ptr->stun > 0)
27042704 {
27052705 old_aux = 1;
27062706 }
@@ -2757,31 +2757,31 @@ bool set_stun(TIME_EFFECT v)
27572757
27582758 if (one_in_(3))
27592759 {
2760- if (!p_ptr->sustain_int) (void)do_dec_stat(p_ptr, A_INT);
2761- if (!p_ptr->sustain_wis) (void)do_dec_stat(p_ptr, A_WIS);
2760+ if (!creature_ptr->sustain_int) (void)do_dec_stat(creature_ptr, A_INT);
2761+ if (!creature_ptr->sustain_wis) (void)do_dec_stat(creature_ptr, A_WIS);
27622762 }
27632763 else if (one_in_(2))
27642764 {
2765- if (!p_ptr->sustain_int) (void)do_dec_stat(p_ptr, A_INT);
2765+ if (!creature_ptr->sustain_int) (void)do_dec_stat(creature_ptr, A_INT);
27662766 }
27672767 else
27682768 {
2769- if (!p_ptr->sustain_wis) (void)do_dec_stat(p_ptr, A_WIS);
2769+ if (!creature_ptr->sustain_wis) (void)do_dec_stat(creature_ptr, A_WIS);
27702770 }
27712771 }
2772- if (p_ptr->special_defense & KATA_MASK)
2772+ if (creature_ptr->special_defense & KATA_MASK)
27732773 {
27742774 msg_print(_("型が崩れた。", "Your posture gets loose."));
2775- p_ptr->special_defense &= ~(KATA_MASK);
2776- p_ptr->update |= (PU_BONUS);
2777- p_ptr->update |= (PU_MONSTERS);
2778- p_ptr->redraw |= (PR_STATE);
2779- p_ptr->redraw |= (PR_STATUS);
2780- p_ptr->action = ACTION_NONE;
2775+ creature_ptr->special_defense &= ~(KATA_MASK);
2776+ creature_ptr->update |= (PU_BONUS);
2777+ creature_ptr->update |= (PU_MONSTERS);
2778+ creature_ptr->redraw |= (PR_STATE);
2779+ creature_ptr->redraw |= (PR_STATUS);
2780+ creature_ptr->action = ACTION_NONE;
27812781 }
27822782
27832783 /* Sniper */
2784- if (p_ptr->concent) reset_concentration(TRUE);
2784+ if (creature_ptr->concent) reset_concentration(TRUE);
27852785
27862786 /* Hex */
27872787 if (hex_spelling_any()) stop_hex_spell_all();
@@ -2807,16 +2807,16 @@ bool set_stun(TIME_EFFECT v)
28072807 }
28082808
28092809 /* Use the value */
2810- p_ptr->stun = v;
2810+ creature_ptr->stun = v;
28112811
28122812 /* No change */
28132813 if (!notice) return (FALSE);
28142814
28152815 if (disturb_state) disturb(FALSE, FALSE);
2816- p_ptr->update |= (PU_BONUS);
2816+ creature_ptr->update |= (PU_BONUS);
28172817
28182818 /* Redraw the "stun" */
2819- p_ptr->redraw |= (PR_STUN);
2819+ creature_ptr->redraw |= (PR_STUN);
28202820 handle_stuff();
28212821 return (TRUE);
28222822 }
@@ -2829,59 +2829,59 @@ bool set_stun(TIME_EFFECT v)
28292829 * @details
28302830 * Note the special code to only notice "range" changes.
28312831 */
2832-bool set_cut(TIME_EFFECT v)
2832+bool set_cut(player_type *creature_ptr, TIME_EFFECT v)
28332833 {
28342834 int old_aux, new_aux;
28352835 bool notice = FALSE;
28362836 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
28372837
2838- if (p_ptr->is_dead) return FALSE;
2838+ if (creature_ptr->is_dead) return FALSE;
28392839
2840- if ((p_ptr->prace == RACE_GOLEM ||
2841- p_ptr->prace == RACE_SKELETON ||
2842- p_ptr->prace == RACE_SPECTRE ||
2843- (p_ptr->prace == RACE_ZOMBIE && p_ptr->lev > 11)) &&
2844- !p_ptr->mimic_form)
2840+ if ((creature_ptr->prace == RACE_GOLEM ||
2841+ creature_ptr->prace == RACE_SKELETON ||
2842+ creature_ptr->prace == RACE_SPECTRE ||
2843+ (creature_ptr->prace == RACE_ZOMBIE && creature_ptr->lev > 11)) &&
2844+ !creature_ptr->mimic_form)
28452845 v = 0;
28462846
28472847 /* Mortal wound */
2848- if (p_ptr->cut > 1000)
2848+ if (creature_ptr->cut > 1000)
28492849 {
28502850 old_aux = 7;
28512851 }
28522852
28532853 /* Deep gash */
2854- else if (p_ptr->cut > 200)
2854+ else if (creature_ptr->cut > 200)
28552855 {
28562856 old_aux = 6;
28572857 }
28582858
28592859 /* Severe cut */
2860- else if (p_ptr->cut > 100)
2860+ else if (creature_ptr->cut > 100)
28612861 {
28622862 old_aux = 5;
28632863 }
28642864
28652865 /* Nasty cut */
2866- else if (p_ptr->cut > 50)
2866+ else if (creature_ptr->cut > 50)
28672867 {
28682868 old_aux = 4;
28692869 }
28702870
28712871 /* Bad cut */
2872- else if (p_ptr->cut > 25)
2872+ else if (creature_ptr->cut > 25)
28732873 {
28742874 old_aux = 3;
28752875 }
28762876
28772877 /* Light cut */
2878- else if (p_ptr->cut > 10)
2878+ else if (creature_ptr->cut > 10)
28792879 {
28802880 old_aux = 2;
28812881 }
28822882
28832883 /* Graze */
2884- else if (p_ptr->cut > 0)
2884+ else if (creature_ptr->cut > 0)
28852885 {
28862886 old_aux = 1;
28872887 }
@@ -2972,10 +2972,10 @@ bool set_cut(TIME_EFFECT v)
29722972
29732973 if (randint1(1000) < v || one_in_(16))
29742974 {
2975- if (!p_ptr->sustain_chr)
2975+ if (!creature_ptr->sustain_chr)
29762976 {
29772977 msg_print(_("ひどい傷跡が残ってしまった。", "You have been horribly scarred."));
2978- do_dec_stat(p_ptr, A_CHR);
2978+ do_dec_stat(creature_ptr, A_CHR);
29792979 }
29802980 }
29812981 }
@@ -2988,7 +2988,7 @@ bool set_cut(TIME_EFFECT v)
29882988 {
29892989 /* None */
29902990 case 0:
2991- msg_format(_("やっと%s。", "You are no longer bleeding."), p_ptr->prace == RACE_ANDROID ? "怪我が直った" : "出血が止まった");
2991+ msg_format(_("やっと%s。", "You are no longer bleeding."), creature_ptr->prace == RACE_ANDROID ? "怪我が直った" : "出血が止まった");
29922992
29932993 if (disturb_state) disturb(FALSE, FALSE);
29942994 break;
@@ -2998,16 +2998,16 @@ bool set_cut(TIME_EFFECT v)
29982998 }
29992999
30003000 /* Use the value */
3001- p_ptr->cut = v;
3001+ creature_ptr->cut = v;
30023002
30033003 /* No change */
30043004 if (!notice) return (FALSE);
30053005
30063006 if (disturb_state) disturb(FALSE, FALSE);
3007- p_ptr->update |= (PU_BONUS);
3007+ creature_ptr->update |= (PU_BONUS);
30083008
30093009 /* Redraw the "cut" */
3010- p_ptr->redraw |= (PR_CUT);
3010+ creature_ptr->redraw |= (PR_CUT);
30113011 handle_stuff();
30123012 return (TRUE);
30133013 }
@@ -3695,11 +3695,11 @@ void do_poly_wounds(void)
36953695 {
36963696 msg_print(_("新たな傷ができた!", "A new wound was created!"));
36973697 take_hit(DAMAGE_LOSELIFE, change / 2, _("変化した傷", "a polymorphed wound"), -1);
3698- set_cut(change);
3698+ set_cut(p_ptr,change);
36993699 }
37003700 else
37013701 {
3702- set_cut(p_ptr->cut - (change / 2));
3702+ set_cut(p_ptr,p_ptr->cut - (change / 2));
37033703 }
37043704 }
37053705
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -55,7 +55,7 @@ extern bool set_oppose_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_de
5555 extern bool set_oppose_cold(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
5656 extern bool set_oppose_pois(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
5757 extern bool set_stun(player_type *creature_ptr, TIME_EFFECT v);
58-extern bool set_cut(TIME_EFFECT v);
58+extern bool set_cut(player_type *creature_ptr, TIME_EFFECT v);
5959 extern bool set_food(TIME_EFFECT v);
6060 extern bool inc_stat(player_type *creature_ptr, int stat);
6161 extern bool dec_stat(player_type *creature_ptr, int stat, int amount, int permanent);
--- a/src/realm-crusade.c
+++ b/src/realm-crusade.c
@@ -127,7 +127,7 @@ concptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
127127 {
128128 if (cast)
129129 {
130- set_cut(0);
130+ set_cut(p_ptr,0);
131131 set_poisoned(p_ptr, 0);
132132 set_stun(p_ptr, 0);
133133 }
@@ -270,7 +270,7 @@ concptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
270270 set_afraid(p_ptr, 0);
271271 set_poisoned(p_ptr, 0);
272272 set_stun(p_ptr, 0);
273- set_cut(0);
273+ set_cut(p_ptr,0);
274274 }
275275 }
276276 break;
--- a/src/realm-hissatsu.c
+++ b/src/realm-hissatsu.c
@@ -529,9 +529,9 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
529529 monster_type *m_ptr;
530530
531531 if (p_ptr->cut < 300)
532- set_cut(p_ptr->cut + 300);
532+ set_cut(p_ptr,p_ptr->cut + 300);
533533 else
534- set_cut(p_ptr->cut * 2);
534+ set_cut(p_ptr,p_ptr->cut * 2);
535535
536536 for (dir = 0; dir < 8; dir++)
537537 {
--- a/src/realm-nature.c
+++ b/src/realm-nature.c
@@ -181,7 +181,7 @@ concptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
181181 if (cast)
182182 {
183183 hp_player(p_ptr, damroll(dice, sides));
184- set_cut(0);
184+ set_cut(p_ptr,0);
185185 set_poisoned(p_ptr, 0);
186186 }
187187 }
--- a/src/realm-song.c
+++ b/src/realm-song.c
@@ -849,7 +849,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
849849 {
850850 hp_player(p_ptr, damroll(dice, sides));
851851 set_stun(p_ptr, 0);
852- set_cut(0);
852+ set_cut(p_ptr,0);
853853 }
854854 }
855855
--- a/src/spells-status.c
+++ b/src/spells-status.c
@@ -282,7 +282,7 @@ bool_hack life_stream(bool_hack message, bool_hack virtue_change)
282282 (void)set_confused(p_ptr, 0);
283283 (void)set_image(p_ptr, 0);
284284 (void)set_stun(p_ptr, 0);
285- (void)set_cut(0);
285+ (void)set_cut(p_ptr,0);
286286 (void)restore_all_status();
287287 (void)set_shero(p_ptr, 0, TRUE);
288288 handle_stuff();
@@ -314,7 +314,7 @@ bool_hack cure_light_wounds(DICE_NUMBER dice, DICE_SID sides)
314314 bool_hack ident = FALSE;
315315 if (hp_player(p_ptr, damroll(dice, sides))) ident = TRUE;
316316 if (set_blind(p_ptr, 0)) ident = TRUE;
317- if (set_cut(p_ptr->cut - 10)) ident = TRUE;
317+ if (set_cut(p_ptr,p_ptr->cut - 10)) ident = TRUE;
318318 if (set_shero(p_ptr, 0, TRUE)) ident = TRUE;
319319 return ident;
320320 }
@@ -325,7 +325,7 @@ bool_hack cure_serious_wounds(DICE_NUMBER dice, DICE_SID sides)
325325 if (hp_player(p_ptr, damroll(dice, sides))) ident = TRUE;
326326 if (set_blind(p_ptr, 0)) ident = TRUE;
327327 if (set_confused(p_ptr, 0)) ident = TRUE;
328- if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
328+ if (set_cut(p_ptr,(p_ptr->cut / 2) - 50)) ident = TRUE;
329329 if (set_shero(p_ptr, 0, TRUE)) ident = TRUE;
330330 return ident;
331331 }
@@ -338,7 +338,7 @@ bool_hack cure_critical_wounds(HIT_POINT pow)
338338 if (set_confused(p_ptr, 0)) ident = TRUE;
339339 if (set_poisoned(p_ptr, 0)) ident = TRUE;
340340 if (set_stun(p_ptr, 0)) ident = TRUE;
341- if (set_cut(0)) ident = TRUE;
341+ if (set_cut(p_ptr,0)) ident = TRUE;
342342 if (set_shero(p_ptr, 0, TRUE)) ident = TRUE;
343343 return ident;
344344 }
@@ -351,7 +351,7 @@ bool_hack true_healing(HIT_POINT pow)
351351 if (set_confused(p_ptr, 0)) ident = TRUE;
352352 if (set_poisoned(p_ptr, 0)) ident = TRUE;
353353 if (set_stun(p_ptr, 0)) ident = TRUE;
354- if (set_cut(0)) ident = TRUE;
354+ if (set_cut(p_ptr,0)) ident = TRUE;
355355 if (set_image(p_ptr, 0)) ident = TRUE;
356356 return ident;
357357 }
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -4371,7 +4371,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
43714371 }
43724372 else if (!CHECK_MULTISHADOW())
43734373 {
4374- (void)set_cut(p_ptr->cut + dam);
4374+ (void)set_cut(p_ptr,p_ptr->cut + dam);
43754375 }
43764376
43774377 if (!p_ptr->resist_shard || one_in_(13))
@@ -4482,7 +4482,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
44824482 }
44834483 else if (!CHECK_MULTISHADOW())
44844484 {
4485- (void)set_cut(p_ptr->cut + (dam / 2));
4485+ (void)set_cut(p_ptr,p_ptr->cut + (dam / 2));
44864486 }
44874487
44884488 if (!p_ptr->resist_shard || one_in_(12))
@@ -4747,7 +4747,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
47474747 {
47484748 if (!p_ptr->resist_shard)
47494749 {
4750- (void)set_cut(p_ptr->cut + damroll(5, 8));
4750+ (void)set_cut(p_ptr,p_ptr->cut + damroll(5, 8));
47514751 }
47524752 if (!p_ptr->resist_sound)
47534753 {
@@ -5011,7 +5011,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
50115011 else
50125012 {
50135013 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5014- if (!CHECK_MULTISHADOW()) (void)set_cut(p_ptr->cut + damroll(10, 10));
5014+ if (!CHECK_MULTISHADOW()) (void)set_cut(p_ptr,p_ptr->cut + damroll(10, 10));
50155015 }
50165016 break;
50175017 }
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -919,7 +919,7 @@ bool cleansing_nova(player_type *creature_ptr, bool magic, bool powerful)
919919 if (set_afraid(p_ptr, 0)) ident = TRUE;
920920 if (hp_player(p_ptr, 50)) ident = TRUE;
921921 if (set_stun(p_ptr, 0)) ident = TRUE;
922- if (set_cut(0)) ident = TRUE;
922+ if (set_cut(p_ptr,0)) ident = TRUE;
923923 return ident;
924924 }
925925
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -3468,7 +3468,7 @@ bool detonation(player_type *creature_ptr)
34683468 msg_print(_("体の中で激しい爆発が起きた!", "Massive explosions rupture your body!"));
34693469 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), _("爆発の薬", "a potion of Detonation"), -1);
34703470 (void)set_stun(p_ptr, creature_ptr->stun + 75);
3471- (void)set_cut(creature_ptr->cut + 5000);
3471+ (void)set_cut(p_ptr,creature_ptr->cut + 5000);
34723472 return TRUE;
34733473 }
34743474
--- a/src/trap.c
+++ b/src/trap.c
@@ -305,7 +305,7 @@ static void hit_trap_pit(int trap_feat_type)
305305 msg_format(_("%sが刺さった!", "You are impaled on %s!"), spike_name);
306306
307307 dam = dam * 2;
308- (void)set_cut(p_ptr->cut + randint1(dam));
308+ (void)set_cut(p_ptr,p_ptr->cut + randint1(dam));
309309
310310 if (trap_feat_type == TRAP_POISON_PIT) {
311311 if (p_ptr->resist_pois || IS_OPPOSE_POIS())
Show on old repository browser