• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision6089591fc151ca0bd3770bc3fd12187e21c31ee6 (tree)
Time2019-08-29 23:39:39
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 cast_sniper_spell() に player_type * 引数を追加. / Add player_type * argument to cast_sniper_spell().

Change Summary

Incremental Difference

--- a/src/snipe.c
+++ b/src/snipe.c
@@ -481,9 +481,9 @@ MULTIPLY tot_dam_aux_snipe(player_type *sniper_ptr, MULTIPLY mult, monster_type
481481 * @param spell 発動する特殊技能のID
482482 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
483483 */
484-static bool cast_sniper_spell(int spell)
484+static bool cast_sniper_spell(player_type *sniper_ptr, int spell)
485485 {
486- object_type *o_ptr = &p_ptr->inventory_list[INVEN_BOW];
486+ object_type *o_ptr = &sniper_ptr->inventory_list[INVEN_BOW];
487487 SPELL_IDX snipe_type = SP_NONE;
488488
489489 if (o_ptr->tval != TV_BOW)
@@ -496,8 +496,8 @@ static bool cast_sniper_spell(int spell)
496496 switch (spell)
497497 {
498498 case 0: /* Concentration */
499- if (!snipe_concentrate(p_ptr)) return (FALSE);
500- take_turn(p_ptr, 100);
499+ if (!snipe_concentrate(sniper_ptr)) return (FALSE);
500+ take_turn(sniper_ptr, 100);
501501 return (TRUE);
502502 case 1: snipe_type = SP_LITE; break;
503503 case 2: snipe_type = SP_AWAY; break;
@@ -519,9 +519,9 @@ static bool cast_sniper_spell(int spell)
519519 }
520520
521521 command_cmd = 'f';
522- do_cmd_fire(p_ptr, snipe_type);
522+ do_cmd_fire(sniper_ptr, snipe_type);
523523
524- return (p_ptr->is_fired);
524+ return (sniper_ptr->is_fired);
525525 }
526526
527527 /*!
@@ -540,7 +540,7 @@ void do_cmd_snipe(void)
540540 if (!get_snipe_power(&n, FALSE)) return;
541541
542542 sound(SOUND_SHOOT);
543- cast = cast_sniper_spell(n);
543+ cast = cast_sniper_spell(p_ptr, n);
544544
545545 if (!cast) return;
546546 p_ptr->redraw |= (PR_HP | PR_MANA);
Show on old repository browser