• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision921191a13925c65cc2d2c2ad4d877eeea971dfc0 (tree)
Time2019-06-22 10:57:34
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1346,14 +1346,14 @@ bool activate_artifact(object_type *o_ptr)
13461346 case ACT_SPEED:
13471347 {
13481348 msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
1349- (void)set_fast(randint1(20) + 20, FALSE);
1349+ (void)set_fast(p_ptr, randint1(20) + 20, FALSE);
13501350 break;
13511351 }
13521352
13531353 case ACT_XTRA_SPEED:
13541354 {
13551355 msg_print(_("明るく輝いている...", "It glows brightly..."));
1356- (void)set_fast(randint1(75) + 75, FALSE);
1356+ (void)set_fast(p_ptr, randint1(75) + 75, FALSE);
13571357 break;
13581358 }
13591359
@@ -1377,7 +1377,7 @@ bool activate_artifact(object_type *o_ptr)
13771377
13781378 case ACT_HERO_SPEED:
13791379 {
1380- (void)set_fast(randint1(50) + 50, FALSE);
1380+ (void)set_fast(p_ptr, randint1(50) + 50, FALSE);
13811381 (void)heroism(50);
13821382 break;
13831383 }
@@ -1729,7 +1729,7 @@ bool activate_artifact(object_type *o_ptr)
17291729 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
17301730 take_hit(DAMAGE_LOSELIFE, damroll(3, 8), _("加速した疲労", "the strain of haste"), -1);
17311731 t = 25 + randint1(25);
1732- (void)set_fast(p_ptr->fast + t, FALSE);
1732+ (void)set_fast(p_ptr, p_ptr->fast + t, FALSE);
17331733 break;
17341734 }
17351735
--- a/src/cmd-mane.c
+++ b/src/cmd-mane.c
@@ -645,7 +645,7 @@ static bool use_mane(int spell)
645645 sleep_monster(dir, plev);
646646 break;
647647 case MS_SPEED:
648- (void)set_fast(randint1(20 + plev) + plev, FALSE);
648+ (void)set_fast(p_ptr, randint1(20 + plev) + plev, FALSE);
649649 break;
650650 case MS_HAND_DOOM:
651651 {
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -282,11 +282,11 @@ void exe_quaff_potion(INVENTORY_IDX item)
282282 case SV_POTION_SPEED:
283283 if (!p_ptr->fast)
284284 {
285- if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
285+ if (set_fast(p_ptr, randint1(25) + 15, FALSE)) ident = TRUE;
286286 }
287287 else
288288 {
289- (void)set_fast(p_ptr->fast + 5, FALSE);
289+ (void)set_fast(p_ptr, p_ptr->fast + 5, FALSE);
290290 }
291291 break;
292292
--- a/src/cmd-usestaff.c
+++ b/src/cmd-usestaff.c
@@ -197,7 +197,7 @@ int staff_effect(OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, boo
197197
198198 case SV_STAFF_SPEED:
199199 {
200- if (set_fast(randint1(30) + (powerful ? 30 : 15), FALSE)) ident = TRUE;
200+ if (set_fast(p_ptr, randint1(30) + (powerful ? 30 : 15), FALSE)) ident = TRUE;
201201 break;
202202 }
203203
--- a/src/cmd-zaprod.c
+++ b/src/cmd-zaprod.c
@@ -118,7 +118,7 @@ int rod_effect(OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool *use_charge, bool
118118
119119 case SV_ROD_SPEED:
120120 {
121- if (set_fast(randint1(30) + (powerful ? 30 : 15), FALSE)) ident = TRUE;
121+ if (set_fast(p_ptr, randint1(30) + (powerful ? 30 : 15), FALSE)) ident = TRUE;
122122 break;
123123 }
124124
--- a/src/core.c
+++ b/src/core.c
@@ -1971,7 +1971,7 @@ static void process_world_aux_timeout(void)
19711971 /* Fast */
19721972 if (p_ptr->fast)
19731973 {
1974- (void)set_fast(p_ptr->fast - 1, TRUE);
1974+ (void)set_fast(p_ptr, p_ptr->fast - 1, TRUE);
19751975 }
19761976
19771977 /* Slow */
@@ -2278,7 +2278,7 @@ static void process_world_aux_mutation(void)
22782278
22792279 if (p_ptr->fast > 0)
22802280 {
2281- set_fast(0, TRUE);
2281+ set_fast(p_ptr, 0, TRUE);
22822282 }
22832283 else
22842284 {
@@ -2295,7 +2295,7 @@ static void process_world_aux_mutation(void)
22952295 }
22962296 else
22972297 {
2298- set_fast(randint1(30) + 10, FALSE);
2298+ set_fast(p_ptr, randint1(30) + 10, FALSE);
22992299 }
23002300 }
23012301 msg_print(NULL);
--- a/src/mind.c
+++ b/src/mind.c
@@ -1146,7 +1146,7 @@ static bool cast_mindcrafter_spell(int spell)
11461146 t = 10 + randint1((plev * 3) / 2);
11471147 set_hero(t, FALSE);
11481148 /* Haste */
1149- (void)set_fast(t, FALSE);
1149+ (void)set_fast(p_ptr, t, FALSE);
11501150 break;
11511151 case 10:
11521152 /* Telekinesis */
--- a/src/mspells3.c
+++ b/src/mspells3.c
@@ -1268,7 +1268,7 @@ static bool cast_learned_spell(int spell, bool success)
12681268 sleep_monster(dir, plev);
12691269 break;
12701270 case MS_SPEED:
1271- (void)set_fast(randint1(20 + plev) + plev, FALSE);
1271+ (void)set_fast(p_ptr, randint1(20 + plev) + plev, FALSE);
12721272 break;
12731273 case MS_HAND_DOOM:
12741274 {
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -290,7 +290,7 @@ void reset_tim_flags(void)
290290 */
291291 void dispel_player(void)
292292 {
293- (void)set_fast(0, TRUE);
293+ (void)set_fast(p_ptr, 0, TRUE);
294294 (void)set_lightspeed(0, TRUE);
295295 (void)set_slow(0, TRUE);
296296 (void)set_shield(0, TRUE);
@@ -781,21 +781,21 @@ bool set_image(player_type *creature_ptr, TIME_EFFECT v)
781781 * @param do_dec 現在の継続時間より長い値のみ上書きする
782782 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
783783 */
784-bool set_fast(TIME_EFFECT v, bool do_dec)
784+bool set_fast(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
785785 {
786786 bool notice = FALSE;
787787 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
788788
789- if (p_ptr->is_dead) return FALSE;
789+ if (creature_ptr->is_dead) return FALSE;
790790
791791 /* Open */
792792 if (v)
793793 {
794- if (p_ptr->fast && !do_dec)
794+ if (creature_ptr->fast && !do_dec)
795795 {
796- if (p_ptr->fast > v) return FALSE;
796+ if (creature_ptr->fast > v) return FALSE;
797797 }
798- else if (!IS_FAST() && !p_ptr->lightspeed)
798+ else if (!IS_FAST() && !creature_ptr->lightspeed)
799799 {
800800 msg_print(_("素早く動けるようになった!", "You feel yourself moving much faster!"));
801801 notice = TRUE;
@@ -807,7 +807,7 @@ bool set_fast(TIME_EFFECT v, bool do_dec)
807807 /* Shut */
808808 else
809809 {
810- if (p_ptr->fast && !p_ptr->lightspeed && !music_singing(MUSIC_SPEED) && !music_singing(MUSIC_SHERO))
810+ if (creature_ptr->fast && !creature_ptr->lightspeed && !music_singing(MUSIC_SPEED) && !music_singing(MUSIC_SHERO))
811811 {
812812 msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
813813 notice = TRUE;
@@ -815,13 +815,13 @@ bool set_fast(TIME_EFFECT v, bool do_dec)
815815 }
816816
817817 /* Use the value */
818- p_ptr->fast = v;
818+ creature_ptr->fast = v;
819819
820820 /* Nothing to notice */
821821 if (!notice) return (FALSE);
822822
823823 if (disturb_state) disturb(FALSE, FALSE);
824- p_ptr->update |= (PU_BONUS);
824+ creature_ptr->update |= (PU_BONUS);
825825 handle_stuff();
826826 return (TRUE);
827827 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -21,7 +21,7 @@ extern bool set_poisoned(player_type *creature_ptr, TIME_EFFECT v);
2121 extern bool set_afraid(player_type *creature_ptr, TIME_EFFECT v);
2222 extern bool set_paralyzed(player_type *creature_ptr, TIME_EFFECT v);
2323 extern bool set_image(player_type *creature_ptr, TIME_EFFECT v);
24-extern bool set_fast(TIME_EFFECT v, bool do_dec);
24+extern bool set_fast(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
2525 extern bool set_slow(TIME_EFFECT v, bool do_dec);
2626 extern bool set_shield(TIME_EFFECT v, bool do_dec);
2727 extern bool set_tsubureru(TIME_EFFECT v, bool do_dec);
--- a/src/realm-craft.c
+++ b/src/realm-craft.c
@@ -342,7 +342,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
342342
343343 if (cast)
344344 {
345- set_fast(randint1(sides) + base, FALSE);
345+ set_fast(p_ptr, randint1(sides) + base, FALSE);
346346 }
347347 }
348348 break;
--- a/src/realm-crusade.c
+++ b/src/realm-crusade.c
@@ -567,7 +567,7 @@ concptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
567567 }
568568 set_hero(randint1(base) + base, FALSE);
569569 set_blessed(randint1(base) + base, FALSE);
570- set_fast(randint1(sp_sides) + sp_base, FALSE);
570+ set_fast(p_ptr, randint1(sp_sides) + sp_base, FALSE);
571571 set_protevil(randint1(base) + base, FALSE);
572572 set_afraid(p_ptr, 0);
573573 }
--- a/src/realm-death.c
+++ b/src/realm-death.c
@@ -431,7 +431,7 @@ concptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
431431 if (cast)
432432 {
433433 (void)berserk(b_base + randint1(b_base));
434- set_fast(randint1(sp_sides) + sp_base, FALSE);
434+ set_fast(p_ptr, randint1(sp_sides) + sp_base, FALSE);
435435 }
436436 }
437437 break;
--- a/src/realm-life.c
+++ b/src/realm-life.c
@@ -471,7 +471,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
471471 if (cast)
472472 {
473473 TIME_EFFECT v = randint1(base) + base;
474- set_fast(v, FALSE);
474+ set_fast(p_ptr, v, FALSE);
475475 set_oppose_acid(v, FALSE);
476476 set_oppose_elec(v, FALSE);
477477 set_oppose_fire(v, FALSE);
--- a/src/realm-sorcery.c
+++ b/src/realm-sorcery.c
@@ -257,7 +257,7 @@ concptr do_sorcery_spell(SPELL_IDX spell, BIT_FLAGS mode)
257257
258258 if (cast)
259259 {
260- set_fast(randint1(sides) + base, FALSE);
260+ set_fast(p_ptr, randint1(sides) + base, FALSE);
261261 }
262262 }
263263 break;
--- a/src/spells-status.c
+++ b/src/spells-status.c
@@ -465,7 +465,7 @@ bool cosmic_cast_off(player_type *creature_ptr, object_type *o_ptr)
465465 (void)set_tim_regen(creature_ptr->tim_regen + t, FALSE);
466466 (void)set_hero(creature_ptr->hero + t, FALSE);
467467 (void)set_blessed(creature_ptr->blessed + t, FALSE);
468- (void)set_fast(creature_ptr->fast + t, FALSE);
468+ (void)set_fast(p_ptr, creature_ptr->fast + t, FALSE);
469469 (void)set_shero(creature_ptr->shero + t, FALSE);
470470 if (creature_ptr->pclass == CLASS_FORCETRAINER)
471471 {
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -4676,7 +4676,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
46764676 case GF_OLD_SPEED:
46774677 {
46784678 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4679- (void)set_fast(p_ptr->fast + randint1(5), FALSE);
4679+ (void)set_fast(p_ptr, p_ptr->fast + randint1(5), FALSE);
46804680 dam = 0;
46814681 break;
46824682 }
Show on old repository browser