#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 "game-option/cheat-options.h"
#include "inventory/inventory-object.h"
#include "object/object-kind-hook.h"
#include "perception/object-perception.h"
#include "sv-definition/sv-other-types.h"
+#include "system/baseitem-info.h"
+#include "system/dungeon-info.h"
#include "system/floor-type-definition.h"
-#include "system/monster-race-definition.h"
-#include "system/object-type-definition.h"
+#include "system/item-entity.h"
+#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include "term/term-color-types.h"
+#include "term/z-form.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
#include "world/world.h"
{
bool change = false;
GAME_TEXT o_name[MAX_NLEN];
- ObjectType *o_ptr;
+ ItemEntity *o_ptr;
for (INVENTORY_IDX i = 0; i <= INVEN_SUB_HAND; i++) {
o_ptr = &player_ptr->inventory_list[i];
const auto r_idx_of_item = static_cast<MonsterRaceId>(o_ptr->pval);
- if ((o_ptr->tval == ItemKindType::CAPTURE) && (r_idx_of_item == MonsterRaceId::TSUCHINOKO)) {
- char buf[MAX_NLEN + 32];
+ if ((o_ptr->bi_key.tval() == ItemKindType::CAPTURE) && (r_idx_of_item == MonsterRaceId::TSUCHINOKO)) {
describe_flavor(player_ptr, o_name, o_ptr, 0);
- sprintf(buf, _("%s を換金しますか?", "Convert %s into money? "), o_name);
- if (get_check(buf)) {
+ if (get_check(format(_("%s を換金しますか?", "Convert %s into money? "), o_name))) {
msg_format(_("賞金 %ld$を手に入れた。", "You get %ldgp."), (long int)(1000000L * o_ptr->number));
player_ptr->au += 1000000L * o_ptr->number;
player_ptr->redraw |= (PR_GOLD);
o_ptr = &player_ptr->inventory_list[i];
const auto r_idx_of_item = static_cast<MonsterRaceId>(o_ptr->pval);
- if ((o_ptr->tval == ItemKindType::CORPSE) && (o_ptr->sval == SV_CORPSE) && (r_idx_of_item == MonsterRaceId::TSUCHINOKO)) {
- char buf[MAX_NLEN + 32];
+ if (o_ptr->bi_key == BaseitemKey(ItemKindType::CORPSE, SV_CORPSE) && (r_idx_of_item == MonsterRaceId::TSUCHINOKO)) {
describe_flavor(player_ptr, o_name, o_ptr, 0);
- sprintf(buf, _("%s を換金しますか?", "Convert %s into money? "), o_name);
- if (get_check(buf)) {
+ if (get_check(format(_("%s を換金しますか?", "Convert %s into money? "), o_name))) {
msg_format(_("賞金 %ld$を手に入れた。", "You get %ldgp."), (long int)(200000L * o_ptr->number));
player_ptr->au += 200000L * o_ptr->number;
player_ptr->redraw |= (PR_GOLD);
o_ptr = &player_ptr->inventory_list[i];
const auto r_idx_of_item = static_cast<MonsterRaceId>(o_ptr->pval);
- if ((o_ptr->tval == ItemKindType::CORPSE) && (o_ptr->sval == SV_SKELETON) && (r_idx_of_item == MonsterRaceId::TSUCHINOKO)) {
- char buf[MAX_NLEN + 32];
+ if (o_ptr->bi_key == BaseitemKey(ItemKindType::CORPSE, SV_SKELETON) && (r_idx_of_item == MonsterRaceId::TSUCHINOKO)) {
describe_flavor(player_ptr, o_name, o_ptr, 0);
- sprintf(buf, _("%s を換金しますか?", "Convert %s into money? "), o_name);
- if (get_check(buf)) {
+ if (get_check(format(_("%s を換金しますか?", "Convert %s into money? "), o_name))) {
msg_format(_("賞金 %ld$を手に入れた。", "You get %ldgp."), (long int)(100000L * o_ptr->number));
player_ptr->au += 100000L * o_ptr->number;
player_ptr->redraw |= (PR_GOLD);
o_ptr = &player_ptr->inventory_list[i];
const auto r_idx_of_item = static_cast<MonsterRaceId>(o_ptr->pval);
- if ((o_ptr->tval == ItemKindType::CORPSE) && (o_ptr->sval == SV_CORPSE) && (streq(monraces_info[r_idx_of_item].name.c_str(), monraces_info[w_ptr->today_mon].name.c_str()))) {
- char buf[MAX_NLEN + 32];
+ if (o_ptr->bi_key == BaseitemKey(ItemKindType::CORPSE, SV_CORPSE) && (streq(monraces_info[r_idx_of_item].name.data(), monraces_info[w_ptr->today_mon].name.data()))) {
describe_flavor(player_ptr, o_name, o_ptr, 0);
- sprintf(buf, _("%s を換金しますか?", "Convert %s into money? "), o_name);
- if (get_check(buf)) {
+ if (get_check(format(_("%s を換金しますか?", "Convert %s into money? "), o_name))) {
msg_format(
_("賞金 %ld$を手に入れた。", "You get %ldgp."), (long int)((monraces_info[w_ptr->today_mon].level * 50 + 100) * o_ptr->number));
player_ptr->au += (monraces_info[w_ptr->today_mon].level * 50 + 100) * o_ptr->number;
o_ptr = &player_ptr->inventory_list[i];
const auto r_idx_of_item = static_cast<MonsterRaceId>(o_ptr->pval);
- if ((o_ptr->tval == ItemKindType::CORPSE) && (o_ptr->sval == SV_SKELETON) && (streq(monraces_info[r_idx_of_item].name.c_str(), monraces_info[w_ptr->today_mon].name.c_str()))) {
- char buf[MAX_NLEN + 32];
+ if (o_ptr->bi_key == BaseitemKey(ItemKindType::CORPSE, SV_SKELETON) && (streq(monraces_info[r_idx_of_item].name.data(), monraces_info[w_ptr->today_mon].name.data()))) {
describe_flavor(player_ptr, o_name, o_ptr, 0);
- sprintf(buf, _("%s を換金しますか?", "Convert %s into money? "), o_name);
- if (get_check(buf)) {
+ if (get_check(format(_("%s を換金しますか?", "Convert %s into money? "), o_name))) {
msg_format(_("賞金 %ld$を手に入れた。", "You get %ldgp."), (long int)((monraces_info[w_ptr->today_mon].level * 30 + 60) * o_ptr->number));
player_ptr->au += (monraces_info[w_ptr->today_mon].level * 30 + 60) * o_ptr->number;
player_ptr->redraw |= (PR_GOLD);
o_ptr = &player_ptr->inventory_list[i];
const auto r_idx_of_item = static_cast<MonsterRaceId>(o_ptr->pval);
- if ((o_ptr->tval != ItemKindType::CORPSE) || (r_idx_of_item != r_idx)) {
+ if ((o_ptr->bi_key.tval() != ItemKindType::CORPSE) || (r_idx_of_item != r_idx)) {
continue;
}
- char buf[MAX_NLEN + 20];
INVENTORY_IDX item_new;
- ObjectType forge;
+ ItemEntity forge;
describe_flavor(player_ptr, o_name, o_ptr, 0);
- sprintf(buf, _("%sを渡しますか?", "Hand %s over? "), o_name);
- if (!get_check(buf)) {
+ if (!get_check(format(_("%sを渡しますか?", "Hand %s over? "), o_name))) {
continue;
}
msg_format(_("これで合計 %d ポイント獲得しました。", "You earned %d point%s total."), num, (num > 1 ? "s" : ""));
- (&forge)->prep(lookup_kind(prize_list[num - 1].tval, prize_list[num - 1].sval));
+ (&forge)->prep(lookup_baseitem_id(prize_list[num - 1]));
ItemMagicApplier(player_ptr, &forge, player_ptr->current_floor_ptr->object_level, AM_NO_FIXED_ART).execute();
object_aware(player_ptr, &forge);
*/
void today_target(PlayerType *player_ptr)
{
- char buf[160];
auto *r_ptr = &monraces_info[w_ptr->today_mon];
clear_bldg(4, 18);
c_put_str(TERM_YELLOW, _("本日の賞金首", "Wanted monster that changes from day to day"), 5, 10);
- sprintf(buf, _("ターゲット: %s", "target: %s"), r_ptr->name.c_str());
- c_put_str(TERM_YELLOW, buf, 6, 10);
- sprintf(buf, _("死体 ---- $%d", "corpse ---- $%d"), (int)r_ptr->level * 50 + 100);
- prt(buf, 8, 10);
- sprintf(buf, _("骨 ---- $%d", "skeleton ---- $%d"), (int)r_ptr->level * 30 + 60);
- prt(buf, 9, 10);
+ c_put_str(TERM_YELLOW, format(_("ターゲット: %s", "target: %s"), r_ptr->name.data()), 6, 10);
+ prt(format(_("死体 ---- $%d", "corpse ---- $%d"), (int)r_ptr->level * 50 + 100), 8, 10);
+ prt(format(_("骨 ---- $%d", "skeleton ---- $%d"), (int)r_ptr->level * 30 + 60), 9, 10);
player_ptr->knows_daily_bounty = true;
}
for (auto i = 0U; i < std::size(w_ptr->bounties); i++) {
const auto &[r_idx, is_achieved] = w_ptr->bounties[i];
- monster_race *r_ptr = &monraces_info[r_idx];
+ MonsterRaceInfo *r_ptr = &monraces_info[r_idx];
auto color = is_achieved ? TERM_RED : TERM_WHITE;
auto done_mark = is_achieved ? _("(済)", "(done)") : "";
- c_prt(color, format("%s %s", r_ptr->name.c_str(), done_mark), y + 7, 10);
+ c_prt(color, format("%s %s", r_ptr->name.data(), done_mark), y + 7, 10);
y = (y + 1) % 10;
if (!y && (i < std::size(w_ptr->bounties) - 1)) {
while (true) {
w_ptr->today_mon = get_mon_num(player_ptr, std::min(max_dl / 2, 40), max_dl, GMN_ARENA);
- monster_race *r_ptr;
+ MonsterRaceInfo *r_ptr;
r_ptr = &monraces_info[w_ptr->today_mon];
if (cheat_hear) {
- msg_format("日替わり候補: %s ", r_ptr->name.c_str());
+ msg_format("日替わり候補: %s ", r_ptr->name.data());
}
if (r_ptr->kind_flags.has(MonsterKindType::UNIQUE)) {