• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision2c5f33293bbf2268e5174837afb8853277c323b1 (tree)
Time2019-08-13 23:55:54
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-hissatsu.c
+++ b/src/cmd-hissatsu.c
@@ -367,7 +367,7 @@ void do_cmd_hissatsu(player_type *creature_ptr)
367367 * @brief 剣術コマンドの学習
368368 * @return なし
369369 */
370-void do_cmd_gain_hissatsu(void)
370+void do_cmd_gain_hissatsu(player_type *creature_ptr)
371371 {
372372 OBJECT_IDX item;
373373 int i, j;
@@ -377,24 +377,24 @@ void do_cmd_gain_hissatsu(void)
377377
378378 bool gain = FALSE;
379379
380- if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
380+ if (creature_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
381381 {
382- set_action(p_ptr, ACTION_NONE);
382+ set_action(creature_ptr, ACTION_NONE);
383383 }
384384
385- if (cmd_limit_blind(p_ptr)) return;
386- if (cmd_limit_confused(p_ptr)) return;
385+ if (cmd_limit_blind(creature_ptr)) return;
386+ if (cmd_limit_confused(creature_ptr)) return;
387387
388- if (!(p_ptr->new_spells))
388+ if (!(creature_ptr->new_spells))
389389 {
390390 msg_print(_("新しい必殺技を覚えることはできない!", "You cannot learn any new special attacks!"));
391391 return;
392392 }
393393
394394 #ifdef JP
395- msg_format("あと %d 種の必殺技を学べる。", p_ptr->new_spells);
395+ msg_format("あと %d 種の必殺技を学べる。", creature_ptr->new_spells);
396396 #else
397- msg_format("You can learn %d new special attack%s.", p_ptr->new_spells, (p_ptr->new_spells == 1?"":"s"));
397+ msg_format("You can learn %d new special attack%s.", creature_ptr->new_spells, (creature_ptr->new_spells == 1?"":"s"));
398398 #endif
399399
400400 q = _("どの書から学びますか? ", "Study which book? ");
@@ -405,18 +405,18 @@ void do_cmd_gain_hissatsu(void)
405405
406406 for (i = o_ptr->sval * 8; i < o_ptr->sval * 8 + 8; i++)
407407 {
408- if (p_ptr->spell_learned1 & (1L << i)) continue;
409- if (technic_info[TECHNIC_HISSATSU][i].slevel > p_ptr->lev) continue;
408+ if (creature_ptr->spell_learned1 & (1L << i)) continue;
409+ if (technic_info[TECHNIC_HISSATSU][i].slevel > creature_ptr->lev) continue;
410410
411- p_ptr->spell_learned1 |= (1L << i);
412- p_ptr->spell_worked1 |= (1L << i);
411+ creature_ptr->spell_learned1 |= (1L << i);
412+ creature_ptr->spell_worked1 |= (1L << i);
413413 msg_format(_("%sの技を覚えた。", "You have learned the special attack of %s."), exe_spell(REALM_HISSATSU, i, SPELL_NAME));
414414 for (j = 0; j < 64; j++)
415415 {
416416 /* Stop at the first empty space */
417- if (p_ptr->spell_order[j] == 99) break;
417+ if (creature_ptr->spell_order[j] == 99) break;
418418 }
419- p_ptr->spell_order[j] = i;
419+ creature_ptr->spell_order[j] = i;
420420 gain = TRUE;
421421 }
422422
@@ -426,10 +426,10 @@ void do_cmd_gain_hissatsu(void)
426426 }
427427 else
428428 {
429- take_turn(p_ptr, 100);
429+ take_turn(creature_ptr, 100);
430430 }
431431
432- p_ptr->update |= (PU_SPELLS);
432+ creature_ptr->update |= (PU_SPELLS);
433433 }
434434
435435
--- a/src/cmd-hissatsu.h
+++ b/src/cmd-hissatsu.h
@@ -2,4 +2,4 @@
22 /* hissatsu.c */
33
44 extern void do_cmd_hissatsu(player_type *creature_ptr);
5-extern void do_cmd_gain_hissatsu(void);
5+extern void do_cmd_gain_hissatsu(player_type *creature_ptr);
--- a/src/core.c
+++ b/src/core.c
@@ -3820,7 +3820,7 @@ static void process_command(void)
38203820 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
38213821 msg_print(_("呪文を学習する必要はない!", "You don't have to learn spells!"));
38223822 else if (p_ptr->pclass == CLASS_SAMURAI)
3823- do_cmd_gain_hissatsu();
3823+ do_cmd_gain_hissatsu(p_ptr);
38243824 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
38253825 import_magic_device();
38263826 else
Show on old repository browser