• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionba542c4750d624d21fae73fce42244e876331c82 (tree)
Time2019-08-15 22:52:19
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-item.c
+++ b/src/cmd-item.c
@@ -610,7 +610,7 @@ void do_cmd_drop(player_type *creature_ptr)
610610 * @brief アイテムを破壊するコマンドのメインルーチン / Destroy an item
611611 * @return なし
612612 */
613-void do_cmd_destroy(void)
613+void do_cmd_destroy(player_type *creature_ptr)
614614 {
615615 OBJECT_IDX item;
616616 QUANTITY amt = 1;
@@ -627,9 +627,9 @@ void do_cmd_destroy(void)
627627
628628 concptr q, s;
629629
630- if (p_ptr->special_defense & KATA_MUSOU)
630+ if (creature_ptr->special_defense & KATA_MUSOU)
631631 {
632- set_action(p_ptr, ACTION_NONE);
632+ set_action(creature_ptr, ACTION_NONE);
633633 }
634634
635635 /* Hack -- force destruction */
@@ -652,7 +652,7 @@ void do_cmd_destroy(void)
652652
653653 /* HACK : Add the line to message buffer */
654654 message_add(out_val);
655- p_ptr->window |= (PW_MESSAGE);
655+ creature_ptr->window |= (PW_MESSAGE);
656656 handle_stuff();
657657
658658 /* Get an acceptable answer */
@@ -705,12 +705,12 @@ void do_cmd_destroy(void)
705705 object_desc(o_name, o_ptr, 0);
706706 o_ptr->number = old_number;
707707
708- take_turn(p_ptr, 100);
708+ take_turn(creature_ptr, 100);
709709
710710 /* Artifacts cannot be destroyed */
711711 if (!can_player_destroy_object(o_ptr))
712712 {
713- free_turn(p_ptr);
713+ free_turn(creature_ptr);
714714
715715 msg_format(_("%sは破壊不可能だ。", "You cannot destroy %s."), o_name);
716716 return;
@@ -744,16 +744,16 @@ void do_cmd_destroy(void)
744744 {
745745 bool gain_expr = FALSE;
746746
747- if (p_ptr->prace == RACE_ANDROID)
747+ if (creature_ptr->prace == RACE_ANDROID)
748748 {
749749 }
750- else if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_BERSERKER))
750+ else if ((creature_ptr->pclass == CLASS_WARRIOR) || (creature_ptr->pclass == CLASS_BERSERKER))
751751 {
752752 gain_expr = TRUE;
753753 }
754- else if (p_ptr->pclass == CLASS_PALADIN)
754+ else if (creature_ptr->pclass == CLASS_PALADIN)
755755 {
756- if (is_good_realm(p_ptr->realm1))
756+ if (is_good_realm(creature_ptr->realm1))
757757 {
758758 if (!is_good_realm(tval2realm(q_ptr->tval))) gain_expr = TRUE;
759759 }
@@ -763,41 +763,41 @@ void do_cmd_destroy(void)
763763 }
764764 }
765765
766- if (gain_expr && (p_ptr->exp < PY_MAX_EXP))
766+ if (gain_expr && (creature_ptr->exp < PY_MAX_EXP))
767767 {
768- s32b tester_exp = p_ptr->max_exp / 20;
768+ s32b tester_exp = creature_ptr->max_exp / 20;
769769 if (tester_exp > 10000) tester_exp = 10000;
770770 if (q_ptr->sval < 3) tester_exp /= 4;
771771 if (tester_exp<1) tester_exp = 1;
772772
773773 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
774- gain_exp(p_ptr, tester_exp * amt);
774+ gain_exp(creature_ptr, tester_exp * amt);
775775 }
776776 if (item_tester_high_level_book(q_ptr) && q_ptr->tval == TV_LIFE_BOOK)
777777 {
778- chg_virtue(p_ptr, V_UNLIFE, 1);
779- chg_virtue(p_ptr, V_VITALITY, -1);
778+ chg_virtue(creature_ptr, V_UNLIFE, 1);
779+ chg_virtue(creature_ptr, V_VITALITY, -1);
780780 }
781781 else if (item_tester_high_level_book(q_ptr) && q_ptr->tval == TV_DEATH_BOOK)
782782 {
783- chg_virtue(p_ptr, V_UNLIFE, -1);
784- chg_virtue(p_ptr, V_VITALITY, 1);
783+ chg_virtue(creature_ptr, V_UNLIFE, -1);
784+ chg_virtue(creature_ptr, V_VITALITY, 1);
785785 }
786786
787787 if (q_ptr->to_a || q_ptr->to_h || q_ptr->to_d)
788- chg_virtue(p_ptr, V_ENCHANT, -1);
788+ chg_virtue(creature_ptr, V_ENCHANT, -1);
789789
790790 if (object_value_real(q_ptr) > 30000)
791- chg_virtue(p_ptr, V_SACRIFICE, 2);
791+ chg_virtue(creature_ptr, V_SACRIFICE, 2);
792792
793793 else if (object_value_real(q_ptr) > 10000)
794- chg_virtue(p_ptr, V_SACRIFICE, 1);
794+ chg_virtue(creature_ptr, V_SACRIFICE, 1);
795795 }
796796
797797 if (q_ptr->to_a != 0 || q_ptr->to_d != 0 || q_ptr->to_h != 0)
798- chg_virtue(p_ptr, V_HARMONY, 1);
798+ chg_virtue(creature_ptr, V_HARMONY, 1);
799799
800- if (item >= INVEN_RARM) calc_android_exp(p_ptr);
800+ if (item >= INVEN_RARM) calc_android_exp(creature_ptr);
801801 }
802802
803803
--- a/src/cmd-item.h
+++ b/src/cmd-item.h
@@ -5,7 +5,7 @@ extern void do_cmd_equip(player_type *creature_ptr);
55 extern void do_cmd_wield(player_type *creature_ptr);
66 extern void do_cmd_takeoff(player_type *creature_ptr);
77 extern void do_cmd_drop(player_type *creature_ptr);
8-extern void do_cmd_destroy(void);
8+extern void do_cmd_destroy(player_type *creature_ptr);
99 extern void do_cmd_observe(void);
1010 extern void do_cmd_uninscribe(void);
1111 extern void do_cmd_inscribe(void);
--- a/src/core.c
+++ b/src/core.c
@@ -3606,7 +3606,7 @@ static void process_command(void)
36063606 /* Destroy an item */
36073607 case 'k':
36083608 {
3609- do_cmd_destroy();
3609+ do_cmd_destroy(p_ptr);
36103610 break;
36113611 }
36123612
--- a/src/store.c
+++ b/src/store.c
@@ -5455,7 +5455,7 @@ static void store_process_command(void)
54555455 /* Destroy an item */
54565456 case 'k':
54575457 {
5458- do_cmd_destroy();
5458+ do_cmd_destroy(p_ptr);
54595459 break;
54605460 }
54615461
Show on old repository browser