OSDN Git Service

Merge remote-tracking branch 'remotes/origin/For2.2.2-Fix-Hourier' into For2.2.2...
[hengband/hengband.git] / src / market / bounty.c
index c0173da..e806a86 100644 (file)
@@ -1,18 +1,37 @@
 #include "market/bounty.h"
 #include "autopick/autopick.h"
+#include "cmd-building/cmd-building.h"
+#include "core/asking-player.h"
+#include "core/player-redraw-types.h"
 #include "core/stuff-handler.h"
 #include "dungeon/dungeon.h"
+#include "flavor/flavor-describer.h"
 #include "inventory/inventory-object.h"
+#include "inventory/inventory-slot-types.h"
+#include "io/input-key-acceptor.h"
 #include "market/bounty-prize-table.h"
 #include "market/building-util.h"
-#include "monster/monster-race-hook.h"
-#include "object/item-apply-magic.h"
-#include "object/object-appraiser.h"
-#include "object/object-flavor.h"
-#include "object/object2.h"
-#include "object/sv-other-types.h"
+#include "monster-race/monster-race-hook.h"
+#include "monster-race/monster-race.h"
+#include "monster-race/race-flags1.h"
+#include "monster-race/race-flags2.h"
+#include "monster-race/race-flags7.h"
+#include "monster-race/race-flags9.h"
+#include "monster-race/race-indice-types.h"
+#include "monster/monster-list.h"
+#include "monster/monster-util.h"
+#include "object-enchant/apply-magic.h"
+#include "object-enchant/item-apply-magic.h"
+#include "object/object-generator.h"
+#include "object/object-info.h"
+#include "object/object-kind-hook.h"
+#include "perception/object-perception.h"
 #include "player/avatar.h"
-#include "term/gameterm.h"
+#include "sv-definition/sv-other-types.h"
+#include "system/floor-type-definition.h"
+#include "term/screen-processor.h"
+#include "term/term-color-types.h"
+#include "view/display-messages.h"
 #include "world/world.h"
 
 /*!
@@ -30,7 +49,7 @@ bool exchange_cash(player_type *player_ptr)
         o_ptr = &player_ptr->inventory_list[i];
         if ((o_ptr->tval == TV_CAPTURE) && (o_ptr->pval == MON_TSUCHINOKO)) {
             char buf[MAX_NLEN + 20];
-            object_desc(player_ptr, o_name, o_ptr, 0);
+            describe_flavor(player_ptr, o_name, o_ptr, 0);
             sprintf(buf, _("%s を換金しますか?", "Convert %s into money? "), o_name);
             if (get_check(buf)) {
                 msg_format(_("賞金 %ld$を手に入れた。", "You get %ldgp."), (long int)(1000000L * o_ptr->number));
@@ -47,7 +66,7 @@ bool exchange_cash(player_type *player_ptr)
         o_ptr = &player_ptr->inventory_list[i];
         if ((o_ptr->tval == TV_CORPSE) && (o_ptr->sval == SV_CORPSE) && (o_ptr->pval == MON_TSUCHINOKO)) {
             char buf[MAX_NLEN + 20];
-            object_desc(player_ptr, o_name, o_ptr, 0);
+            describe_flavor(player_ptr, o_name, o_ptr, 0);
             sprintf(buf, _("%s を換金しますか?", "Convert %s into money? "), o_name);
             if (get_check(buf)) {
                 msg_format(_("賞金 %ld$を手に入れた。", "You get %ldgp."), (long int)(200000L * o_ptr->number));
@@ -64,7 +83,7 @@ bool exchange_cash(player_type *player_ptr)
         o_ptr = &player_ptr->inventory_list[i];
         if ((o_ptr->tval == TV_CORPSE) && (o_ptr->sval == SV_SKELETON) && (o_ptr->pval == MON_TSUCHINOKO)) {
             char buf[MAX_NLEN + 20];
-            object_desc(player_ptr, o_name, o_ptr, 0);
+            describe_flavor(player_ptr, o_name, o_ptr, 0);
             sprintf(buf, _("%s を換金しますか?", "Convert %s into money? "), o_name);
             if (get_check(buf)) {
                 msg_format(_("賞金 %ld$を手に入れた。", "You get %ldgp."), (long int)(100000L * o_ptr->number));
@@ -81,7 +100,7 @@ bool exchange_cash(player_type *player_ptr)
         o_ptr = &player_ptr->inventory_list[i];
         if ((o_ptr->tval == TV_CORPSE) && (o_ptr->sval == SV_CORPSE) && (streq(r_name + r_info[o_ptr->pval].name, r_name + r_info[today_mon].name))) {
             char buf[MAX_NLEN + 20];
-            object_desc(player_ptr, o_name, o_ptr, 0);
+            describe_flavor(player_ptr, o_name, o_ptr, 0);
             sprintf(buf, _("%s を換金しますか?", "Convert %s into money? "), o_name);
             if (get_check(buf)) {
                 msg_format(_("賞金 %ld$を手に入れた。", "You get %ldgp."), (long int)((r_info[today_mon].level * 50 + 100) * o_ptr->number));
@@ -99,7 +118,7 @@ bool exchange_cash(player_type *player_ptr)
 
         if ((o_ptr->tval == TV_CORPSE) && (o_ptr->sval == SV_SKELETON) && (streq(r_name + r_info[o_ptr->pval].name, r_name + r_info[today_mon].name))) {
             char buf[MAX_NLEN + 20];
-            object_desc(player_ptr, o_name, o_ptr, 0);
+            describe_flavor(player_ptr, o_name, o_ptr, 0);
             sprintf(buf, _("%s を換金しますか?", "Convert %s into money? "), o_name);
             if (get_check(buf)) {
                 msg_format(_("賞金 %ld$を手に入れた。", "You get %ldgp."), (long int)((r_info[today_mon].level * 30 + 60) * o_ptr->number));
@@ -123,7 +142,7 @@ bool exchange_cash(player_type *player_ptr)
             INVENTORY_IDX item_new;
             object_type forge;
 
-            object_desc(player_ptr, o_name, o_ptr, 0);
+            describe_flavor(player_ptr, o_name, o_ptr, 0);
             sprintf(buf, _("%sを渡しますか?", "Hand %s over? "), o_name);
             if (!get_check(buf))
                 continue;
@@ -139,19 +158,19 @@ bool exchange_cash(player_type *player_ptr)
 
             msg_format(_("これで合計 %d ポイント獲得しました。", "You earned %d point%s total."), num, (num > 1 ? "s" : ""));
 
-            object_prep(&forge, lookup_kind(prize_list[num - 1].tval, prize_list[num - 1].sval));
+            object_prep(player_ptr, &forge, lookup_kind(prize_list[num - 1].tval, prize_list[num - 1].sval));
             apply_magic(player_ptr, &forge, player_ptr->current_floor_ptr->object_level, AM_NO_FIXED_ART);
 
             object_aware(player_ptr, &forge);
             object_known(&forge);
 
             /*
-                        * Hand it --- Assume there is an empty slot.
-                        * Since a corpse is handed at first,
-                        * there is at least one empty slot.
-                        */
-            item_new = inven_carry(player_ptr, &forge);
-            object_desc(player_ptr, o_name, &forge, 0);
+             * Hand it --- Assume there is an empty slot.
+             * Since a corpse is handed at first,
+             * there is at least one empty slot.
+             */
+            item_new = store_item_to_inventory(player_ptr, &forge);
+            describe_flavor(player_ptr, o_name, &forge, 0);
             msg_format(_("%s(%c)を貰った。", "You get %s (%c). "), o_name, index_to_label(item_new));
 
             autopick_alter_item(player_ptr, item_new, FALSE);
@@ -218,7 +237,8 @@ void show_bounty(void)
     for (int i = 0; i < MAX_BOUNTY; i++) {
         byte color;
         concptr done_mark;
-        monster_race *r_ptr = &r_info[(current_world_ptr->bounty_r_idx[i] > 10000 ? current_world_ptr->bounty_r_idx[i] - 10000 : current_world_ptr->bounty_r_idx[i])];
+        monster_race *r_ptr
+            = &r_info[(current_world_ptr->bounty_r_idx[i] > 10000 ? current_world_ptr->bounty_r_idx[i] - 10000 : current_world_ptr->bounty_r_idx[i])];
 
         if (current_world_ptr->bounty_r_idx[i] > 10000) {
             color = TERM_RED;