• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision5697a8c7615f570366e21f18a55d2c70b48c9c23 (tree)
Time2019-06-22 12:18:02
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-usestaff.c
+++ b/src/cmd-usestaff.c
@@ -165,7 +165,7 @@ int staff_effect(OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, boo
165165 case SV_STAFF_CURING:
166166 {
167167 ident = true_healing(0);
168- if (set_shero(0, TRUE)) ident = TRUE;
168+ if (set_shero(p_ptr, 0, TRUE)) ident = TRUE;
169169 break;
170170 }
171171
@@ -179,7 +179,7 @@ int staff_effect(OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, boo
179179 {
180180 if (do_res_stat(p_ptr, A_INT)) ident = TRUE;
181181 ident |= restore_mana(FALSE);
182- if (set_shero(0, TRUE)) ident = TRUE;
182+ if (set_shero(p_ptr, 0, TRUE)) ident = TRUE;
183183 break;
184184 }
185185
--- a/src/cmd-zaprod.c
+++ b/src/cmd-zaprod.c
@@ -99,7 +99,7 @@ int rod_effect(OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool *use_charge, bool
9999 case SV_ROD_CURING:
100100 {
101101 if (true_healing(0)) ident = TRUE;
102- if (set_shero(0, TRUE)) ident = TRUE;
102+ if (set_shero(p_ptr, 0, TRUE)) ident = TRUE;
103103 break;
104104 }
105105
--- a/src/core.c
+++ b/src/core.c
@@ -2007,7 +2007,7 @@ static void process_world_aux_timeout(void)
20072007 /* Super Heroism */
20082008 if (p_ptr->shero)
20092009 {
2010- (void)set_shero(p_ptr->shero - 1, TRUE);
2010+ (void)set_shero(p_ptr, p_ptr->shero - 1, TRUE);
20112011 }
20122012
20132013 /* Blessed */
@@ -2160,7 +2160,7 @@ static void process_world_aux_mutation(void)
21602160 disturb(FALSE, TRUE);
21612161 msg_print(_("ウガァァア!", "RAAAAGHH!"));
21622162 msg_print(_("激怒の発作に襲われた!", "You feel a fit of rage coming over you!"));
2163- (void)set_shero(10 + randint1(p_ptr->lev), FALSE);
2163+ (void)set_shero(p_ptr, 10 + randint1(p_ptr->lev), FALSE);
21642164 (void)set_afraid(p_ptr, 0);
21652165 }
21662166
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -297,7 +297,7 @@ void dispel_player(void)
297297 (void)set_blessed(p_ptr, 0, TRUE);
298298 (void)set_tsuyoshi(0, TRUE);
299299 (void)set_hero(p_ptr, 0, TRUE);
300- (void)set_shero(0, TRUE);
300+ (void)set_shero(p_ptr, 0, TRUE);
301301 (void)set_protevil(0, TRUE);
302302 (void)set_invuln(0, TRUE);
303303 (void)set_wraith_form(0, TRUE);
@@ -1191,22 +1191,22 @@ bool set_hero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
11911191 * @param do_dec FALSEの場合現在の継続時間より長い値のみ上書きする
11921192 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
11931193 */
1194-bool set_shero(TIME_EFFECT v, bool do_dec)
1194+bool set_shero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
11951195 {
11961196 bool notice = FALSE;
11971197 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
11981198
1199- if (p_ptr->is_dead) return FALSE;
1199+ if (creature_ptr->is_dead) return FALSE;
12001200
1201- if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
1201+ if (creature_ptr->pclass == CLASS_BERSERKER) v = 1;
12021202 /* Open */
12031203 if (v)
12041204 {
1205- if (p_ptr->shero && !do_dec)
1205+ if (creature_ptr->shero && !do_dec)
12061206 {
1207- if (p_ptr->shero > v) return FALSE;
1207+ if (creature_ptr->shero > v) return FALSE;
12081208 }
1209- else if (!p_ptr->shero)
1209+ else if (!creature_ptr->shero)
12101210 {
12111211 msg_print(_("殺戮マシーンになった気がする!", "You feel like a killing machine!"));
12121212 notice = TRUE;
@@ -1216,7 +1216,7 @@ bool set_shero(TIME_EFFECT v, bool do_dec)
12161216 /* Shut */
12171217 else
12181218 {
1219- if (p_ptr->shero)
1219+ if (creature_ptr->shero)
12201220 {
12211221 msg_print(_("野蛮な気持ちが消え失せた。", "You feel less Berserk."));
12221222 notice = TRUE;
@@ -1224,17 +1224,17 @@ bool set_shero(TIME_EFFECT v, bool do_dec)
12241224 }
12251225
12261226 /* Use the value */
1227- p_ptr->shero = v;
1228- p_ptr->redraw |= (PR_STATUS);
1227+ creature_ptr->shero = v;
1228+ creature_ptr->redraw |= (PR_STATUS);
12291229
12301230 /* Nothing to notice */
12311231 if (!notice) return (FALSE);
12321232
12331233 if (disturb_state) disturb(FALSE, FALSE);
1234- p_ptr->update |= (PU_BONUS);
1234+ creature_ptr->update |= (PU_BONUS);
12351235
12361236 /* Recalculate hitpoints */
1237- p_ptr->update |= (PU_HP);
1237+ creature_ptr->update |= (PU_HP);
12381238 handle_stuff();
12391239 return (TRUE);
12401240 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -28,7 +28,7 @@ extern bool set_tsubureru(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2828 extern bool set_magicdef(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
2929 extern bool set_blessed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3030 extern bool set_hero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
31-extern bool set_shero(TIME_EFFECT v, bool do_dec);
31+extern bool set_shero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3232 extern bool set_protevil(TIME_EFFECT v, bool do_dec);
3333 extern bool set_invuln(TIME_EFFECT v, bool do_dec);
3434 extern bool set_tim_invis(TIME_EFFECT v, bool do_dec);
--- a/src/spells-status.c
+++ b/src/spells-status.c
@@ -284,7 +284,7 @@ bool_hack life_stream(bool_hack message, bool_hack virtue_change)
284284 (void)set_stun(0);
285285 (void)set_cut(0);
286286 (void)restore_all_status();
287- (void)set_shero(0, TRUE);
287+ (void)set_shero(p_ptr, 0, TRUE);
288288 handle_stuff();
289289 hp_player(p_ptr, 5000);
290290
@@ -304,7 +304,7 @@ bool_hack berserk(int base)
304304 {
305305 bool_hack ident = FALSE;
306306 if (set_afraid(p_ptr, 0)) ident = TRUE;
307- if (set_shero(p_ptr->shero + randint1(base) + base, FALSE)) ident = TRUE;
307+ if (set_shero(p_ptr, p_ptr->shero + randint1(base) + base, FALSE)) ident = TRUE;
308308 if (hp_player(p_ptr, 30)) ident = TRUE;
309309 return ident;
310310 }
@@ -315,7 +315,7 @@ bool_hack cure_light_wounds(DICE_NUMBER dice, DICE_SID sides)
315315 if (hp_player(p_ptr, damroll(dice, sides))) ident = TRUE;
316316 if (set_blind(p_ptr, 0)) ident = TRUE;
317317 if (set_cut(p_ptr->cut - 10)) ident = TRUE;
318- if (set_shero(0, TRUE)) ident = TRUE;
318+ if (set_shero(p_ptr, 0, TRUE)) ident = TRUE;
319319 return ident;
320320 }
321321
@@ -326,7 +326,7 @@ bool_hack cure_serious_wounds(DICE_NUMBER dice, DICE_SID sides)
326326 if (set_blind(p_ptr, 0)) ident = TRUE;
327327 if (set_confused(p_ptr, 0)) ident = TRUE;
328328 if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
329- if (set_shero(0, TRUE)) ident = TRUE;
329+ if (set_shero(p_ptr, 0, TRUE)) ident = TRUE;
330330 return ident;
331331 }
332332
@@ -339,7 +339,7 @@ bool_hack cure_critical_wounds(HIT_POINT pow)
339339 if (set_poisoned(p_ptr, 0)) ident = TRUE;
340340 if (set_stun(0)) ident = TRUE;
341341 if (set_cut(0)) ident = TRUE;
342- if (set_shero(0, TRUE)) ident = TRUE;
342+ if (set_shero(p_ptr, 0, TRUE)) ident = TRUE;
343343 return ident;
344344 }
345345
@@ -466,7 +466,7 @@ bool cosmic_cast_off(player_type *creature_ptr, object_type *o_ptr)
466466 (void)set_hero(p_ptr, creature_ptr->hero + t, FALSE);
467467 (void)set_blessed(p_ptr, creature_ptr->blessed + t, FALSE);
468468 (void)set_fast(p_ptr, creature_ptr->fast + t, FALSE);
469- (void)set_shero(creature_ptr->shero + t, FALSE);
469+ (void)set_shero(p_ptr, creature_ptr->shero + t, FALSE);
470470 if (creature_ptr->pclass == CLASS_FORCETRAINER)
471471 {
472472 P_PTR_KI = creature_ptr->lev * 5 + 190;
Show on old repository browser