• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision4f2d407faeb4b48a48154c425cb9c26ee6aa6971 (tree)
Time2019-06-23 14:40:31
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -4571,7 +4571,7 @@ static void process_player(void)
45714571 /* Fast */
45724572 if (p_ptr->lightspeed)
45734573 {
4574- (void)set_lightspeed(p_ptr->lightspeed - 1, TRUE);
4574+ (void)set_lightspeed(p_ptr, p_ptr->lightspeed - 1, TRUE);
45754575 }
45764576 if ((p_ptr->pclass == CLASS_FORCETRAINER) && P_PTR_KI)
45774577 {
--- a/src/mind.c
+++ b/src/mind.c
@@ -1280,7 +1280,7 @@ static bool cast_force_spell(int spell)
12801280 fire_beam(GF_MANA, dir, damroll(10 + (plev / 2) + boost * 3 / 10, 15));
12811281 break;
12821282 case 13:
1283- set_lightspeed(randint1(16) + 16 + boost / 20, FALSE);
1283+ set_lightspeed(p_ptr, randint1(16) + 16 + boost / 20, FALSE);
12841284 break;
12851285 default:
12861286 msg_print(_("なに?", "Zap?"));
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -291,7 +291,7 @@ void reset_tim_flags(void)
291291 void dispel_player(void)
292292 {
293293 (void)set_fast(p_ptr, 0, TRUE);
294- (void)set_lightspeed(0, TRUE);
294+ (void)set_lightspeed(p_ptr, 0, TRUE);
295295 (void)set_slow(p_ptr, 0, TRUE);
296296 (void)set_shield(p_ptr, 0, TRUE);
297297 (void)set_blessed(p_ptr, 0, TRUE);
@@ -832,23 +832,23 @@ bool set_fast(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
832832 * @param do_dec 現在の継続時間より長い値のみ上書きする
833833 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
834834 */
835-bool set_lightspeed(TIME_EFFECT v, bool do_dec)
835+bool set_lightspeed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
836836 {
837837 bool notice = FALSE;
838838 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
839839
840- if (p_ptr->is_dead) return FALSE;
840+ if (creature_ptr->is_dead) return FALSE;
841841
842- if (p_ptr->wild_mode) v = 0;
842+ if (creature_ptr->wild_mode) v = 0;
843843
844844 /* Open */
845845 if (v)
846846 {
847- if (p_ptr->lightspeed && !do_dec)
847+ if (creature_ptr->lightspeed && !do_dec)
848848 {
849- if (p_ptr->lightspeed > v) return FALSE;
849+ if (creature_ptr->lightspeed > v) return FALSE;
850850 }
851- else if (!p_ptr->lightspeed)
851+ else if (!creature_ptr->lightspeed)
852852 {
853853 msg_print(_("非常に素早く動けるようになった!", "You feel yourself moving extremely faster!"));
854854 notice = TRUE;
@@ -860,7 +860,7 @@ bool set_lightspeed(TIME_EFFECT v, bool do_dec)
860860 /* Shut */
861861 else
862862 {
863- if (p_ptr->lightspeed)
863+ if (creature_ptr->lightspeed)
864864 {
865865 msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
866866 notice = TRUE;
@@ -868,13 +868,13 @@ bool set_lightspeed(TIME_EFFECT v, bool do_dec)
868868 }
869869
870870 /* Use the value */
871- p_ptr->lightspeed = v;
871+ creature_ptr->lightspeed = v;
872872
873873 /* Nothing to notice */
874874 if (!notice) return (FALSE);
875875
876876 if (disturb_state) disturb(FALSE, FALSE);
877- p_ptr->update |= (PU_BONUS);
877+ creature_ptr->update |= (PU_BONUS);
878878 handle_stuff();
879879 return (TRUE);
880880 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -35,7 +35,7 @@ extern bool set_tim_invis(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
3535 extern bool set_tim_infra(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3636 extern bool set_tim_regen(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3737 extern bool set_tim_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
38-extern bool set_lightspeed(TIME_EFFECT v, bool do_dec);
38+extern bool set_lightspeed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3939 extern bool set_tim_levitation(TIME_EFFECT v, bool do_dec);
4040 extern bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec);
4141 extern bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec);
Show on old repository browser