• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisiond57bc7b09d13d79baf5d4b21cc68fbf1c75df1a5 (tree)
Time2019-08-13 23:52:58
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-hissatsu.c
+++ b/src/cmd-hissatsu.c
@@ -310,27 +310,27 @@ static int get_hissatsu_power(SPELL_IDX *sn)
310310 * @brief 剣術コマンドのメインルーチン
311311 * @return なし
312312 */
313-void do_cmd_hissatsu(void)
313+void do_cmd_hissatsu(player_type *creature_ptr)
314314 {
315315 SPELL_IDX n = 0;
316316 magic_type spell;
317317
318- if (cmd_limit_confused(p_ptr)) return;
319- if (!has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM))
318+ if (cmd_limit_confused(creature_ptr)) return;
319+ if (!has_melee_weapon(creature_ptr, INVEN_RARM) && !has_melee_weapon(creature_ptr, INVEN_LARM))
320320 {
321321 if (flush_failure) flush();
322322 msg_print(_("武器を持たないと必殺技は使えない!", "You need to wield a weapon!"));
323323 return;
324324 }
325- if (!p_ptr->spell_learned1)
325+ if (!creature_ptr->spell_learned1)
326326 {
327327 msg_print(_("何も技を知らない。", "You don't know any special attacks."));
328328 return;
329329 }
330330
331- if (p_ptr->special_defense & KATA_MASK)
331+ if (creature_ptr->special_defense & KATA_MASK)
332332 {
333- set_action(p_ptr, ACTION_NONE);
333+ set_action(creature_ptr, ACTION_NONE);
334334 }
335335
336336 if (!get_hissatsu_power(&n)) return;
@@ -338,7 +338,7 @@ void do_cmd_hissatsu(void)
338338 spell = technic_info[TECHNIC_HISSATSU][n];
339339
340340 /* Verify "dangerous" spells */
341- if (spell.smana > p_ptr->csp)
341+ if (spell.smana > creature_ptr->csp)
342342 {
343343 if (flush_failure) flush();
344344 /* Warning */
@@ -351,15 +351,15 @@ void do_cmd_hissatsu(void)
351351
352352 if (!exe_spell(REALM_HISSATSU, n, SPELL_CAST)) return;
353353
354- take_turn(p_ptr, 100);
354+ take_turn(creature_ptr, 100);
355355
356356 /* Use some mana */
357- p_ptr->csp -= spell.smana;
357+ creature_ptr->csp -= spell.smana;
358358
359359 /* Limit */
360- if (p_ptr->csp < 0) p_ptr->csp = 0;
361- p_ptr->redraw |= (PR_MANA);
362- p_ptr->window |= (PW_PLAYER | PW_SPELL);
360+ if (creature_ptr->csp < 0) creature_ptr->csp = 0;
361+ creature_ptr->redraw |= (PR_MANA);
362+ creature_ptr->window |= (PW_PLAYER | PW_SPELL);
363363 }
364364
365365
--- a/src/cmd-hissatsu.h
+++ b/src/cmd-hissatsu.h
@@ -1,5 +1,5 @@
11 #pragma once
22 /* hissatsu.c */
33
4-extern void do_cmd_hissatsu(void);
4+extern void do_cmd_hissatsu(player_type *creature_ptr);
55 extern void do_cmd_gain_hissatsu(void);
--- a/src/core.c
+++ b/src/core.c
@@ -3898,7 +3898,7 @@ static void process_command(void)
38983898 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
38993899 do_cmd_magic_eater(FALSE, FALSE);
39003900 else if (p_ptr->pclass == CLASS_SAMURAI)
3901- do_cmd_hissatsu();
3901+ do_cmd_hissatsu(p_ptr);
39023902 else if (p_ptr->pclass == CLASS_BLUE_MAGE)
39033903 do_cmd_cast_learned();
39043904 else if (p_ptr->pclass == CLASS_SMITH)
Show on old repository browser