* The "known" should be TRUE for cast/pray, FALSE for study
* </pre>
*/
-static int get_spell(PlayerType *player_ptr, SPELL_IDX *sn, concptr prompt, OBJECT_SUBTYPE_VALUE sval, bool learned, int16_t use_realm)
+static int get_spell(PlayerType *player_ptr, SPELL_IDX *sn, concptr prompt, int sval, bool learned, int16_t use_realm)
{
int i;
SPELL_IDX spell = -1;
char choice;
bool flag, request_list;
auto tval = ItemKindType::NONE;
- OBJECT_SUBTYPE_VALUE i = 0;
char out_val[160];
int menu_line = (use_menu ? 1 : 0);
request_list = always_show_list;
- const int ITEM_GROUP_SIZE = item_group.size();
+ const int item_group_size = item_group.size();
+ auto sval = 0;
while (!flag) {
/* Show the list */
if (request_list || use_menu) {
byte y, x = 0;
- OBJECT_SUBTYPE_VALUE ctr;
PERCENTAGE chance;
short bi_id;
POSITION x1, y1;
#endif
/* Print list */
- for (ctr = 0; ctr < ITEM_GROUP_SIZE; ctr++) {
- auto &item = item_group[ctr];
+ for (auto sval_ctr = 0; sval_ctr < item_group_size; sval_ctr++) {
+ auto &item = item_group[sval_ctr];
if (item.count == 0) {
continue;
}
- bi_id = lookup_baseitem_id({ tval, ctr });
+ bi_id = lookup_baseitem_id({ tval, sval_ctr });
std::string dummy;
if (use_menu) {
- if (ctr == (menu_line - 1)) {
+ if (sval_ctr == (menu_line - 1)) {
dummy = _("》", "> ");
} else {
dummy = " ";
/* letter/number for power selection */
else {
char letter;
- if (ctr < 26) {
- letter = I2A(ctr);
+ if (sval_ctr < 26) {
+ letter = I2A(sval_ctr);
} else {
- letter = '0' + ctr - 26;
+ letter = '0' + sval_ctr - 26;
}
dummy = format("%c)", letter);
}
- x1 = ((ctr < ITEM_GROUP_SIZE / 2) ? x : x + 40);
- y1 = ((ctr < ITEM_GROUP_SIZE / 2) ? y + ctr : y + ctr - ITEM_GROUP_SIZE / 2);
+ x1 = ((sval_ctr < item_group_size / 2) ? x : x + 40);
+ y1 = ((sval_ctr < item_group_size / 2) ? y + sval_ctr : y + sval_ctr - item_group_size / 2);
const auto &baseitem = baseitems_info[bi_id];
level = (tval == ItemKindType::ROD ? baseitem.level * 5 / 6 - 5 : baseitem.level);
chance = level * 4 / 5 + 20;
case 'k':
case 'K': {
do {
- menu_line += ITEM_GROUP_SIZE - 1;
- if (menu_line > ITEM_GROUP_SIZE) {
- menu_line -= ITEM_GROUP_SIZE;
+ menu_line += item_group_size - 1;
+ if (menu_line > item_group_size) {
+ menu_line -= item_group_size;
}
} while (item_group[menu_line - 1].count == 0);
break;
case 'J': {
do {
menu_line++;
- if (menu_line > ITEM_GROUP_SIZE) {
- menu_line -= ITEM_GROUP_SIZE;
+ if (menu_line > item_group_size) {
+ menu_line -= item_group_size;
}
} while (item_group[menu_line - 1].count == 0);
break;
if ((choice == '4') || (choice == 'h') || (choice == 'H')) {
reverse = true;
}
- if (menu_line > ITEM_GROUP_SIZE / 2) {
- menu_line -= ITEM_GROUP_SIZE / 2;
+ if (menu_line > item_group_size / 2) {
+ menu_line -= item_group_size / 2;
reverse = true;
} else {
- menu_line += ITEM_GROUP_SIZE / 2;
+ menu_line += item_group_size / 2;
}
while (item_group[menu_line - 1].count == 0) {
if (reverse) {
}
} else {
menu_line++;
- if (menu_line > ITEM_GROUP_SIZE - 1) {
+ if (menu_line > item_group_size - 1) {
reverse = true;
}
}
case 'x':
case 'X':
case '\r': {
- i = menu_line - 1;
+ sval = menu_line - 1;
should_redraw_cursor = false;
break;
}
if (!use_menu) {
if (isalpha(choice)) {
- i = A2I(choice);
+ sval = A2I(choice);
} else {
- i = choice - '0' + 26;
+ sval = choice - '0' + 26;
}
}
/* Totally Illegal */
- if ((i < 0) || (i > ITEM_GROUP_SIZE) || item_group[i].count == 0) {
+ if ((sval < 0) || (sval > item_group_size) || item_group[sval].count == 0) {
bell();
continue;
}
if (!only_browse) {
- auto &item = item_group[i];
+ auto &item = item_group[sval];
if (tval == ItemKindType::ROD) {
- if (item.charge > baseitems_info[lookup_baseitem_id({ tval, i })].pval * (item.count - 1) * EATER_ROD_CHARGE) {
+ if (item.charge > baseitems_info[lookup_baseitem_id({ tval, sval })].pval * (item.count - 1) * EATER_ROD_CHARGE) {
msg_print(_("その魔法はまだ充填している最中だ。", "The magic is still charging."));
msg_print(nullptr);
continue;
term_erase(7, 21, 255);
term_erase(7, 20, 255);
- display_wrap_around(baseitems_info[lookup_baseitem_id({ tval, i })].text, 62, 21, 10);
+ display_wrap_around(baseitems_info[lookup_baseitem_id({ tval, sval })].text, 62, 21, 10);
continue;
}
break;
}
- repeat_push(base + i);
+ repeat_push(base + sval);
- return BaseitemKey(tval, i);
+ return BaseitemKey(tval, sval);
}
/*!
* @param known 判明済ならばTRUE
* @return 発動により効果内容が確定したならばTRUEを返す
*/
-int staff_effect(PlayerType *player_ptr, OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, bool magic, bool known)
+int staff_effect(PlayerType *player_ptr, int sval, bool *use_charge, bool powerful, bool magic, bool known)
{
int k;
bool ident = false;
#pragma once
-#include "system/angband.h"
-
class PlayerType;
-int staff_effect(PlayerType *player_ptr, OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, bool magic, bool known);
+int staff_effect(PlayerType *player_ptr, int sval, bool *use_charge, bool powerful, bool magic, bool known);
void do_cmd_use_staff(PlayerType *player_ptr);
* @param powerful 強力発動上の処理ならばTRUE
* @return 発動により効果内容が確定したならばTRUEを返す
*/
-int rod_effect(PlayerType *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool *use_charge, bool powerful)
+int rod_effect(PlayerType *player_ptr, int sval, int dir, bool *use_charge, bool powerful)
{
int ident = false;
PLAYER_LEVEL lev = powerful ? player_ptr->lev * 2 : player_ptr->lev;
#pragma once
-#include "system/angband.h"
-
class PlayerType;
-int rod_effect(PlayerType *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool *use_charge, bool powerful);
+int rod_effect(PlayerType *player_ptr, int sval, int dir, bool *use_charge, bool powerful);
void do_cmd_zap_rod(PlayerType *player_ptr);
* @param magic 魔道具術上の処理ならばTRUE
* @return 発動により効果内容が確定したならばTRUEを返す
*/
-bool wand_effect(PlayerType *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool powerful, bool magic)
+bool wand_effect(PlayerType *player_ptr, int sval, int dir, bool powerful, bool magic)
{
bool ident = false;
PLAYER_LEVEL lev = powerful ? player_ptr->lev * 2 : player_ptr->lev;
/* XXX Hack -- Wand of wonder can do anything before it */
if (sval == SV_WAND_WONDER) {
int vir = virtue_number(player_ptr, Virtue::CHANCE);
- sval = (OBJECT_SUBTYPE_VALUE)randint0(SV_WAND_WONDER);
+ sval = randint0(SV_WAND_WONDER);
if (vir) {
if (player_ptr->virtues[vir - 1] > 0) {
#pragma once
-#include "system/angband.h"
-
class PlayerType;
-bool wand_effect(PlayerType *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool powerful, bool magic);
+bool wand_effect(PlayerType *player_ptr, int sval, int dir, bool powerful, bool magic);
void do_cmd_aim_wand(PlayerType *player_ptr);
ItemEntity forge;
auto *q_ptr = &forge;
- q_ptr->prep(lookup_baseitem_id({ ItemKindType::SHOT, (OBJECT_SUBTYPE_VALUE)m_bonus(1, player_ptr->lev) + 1 }));
+ q_ptr->prep(lookup_baseitem_id({ ItemKindType::SHOT, m_bonus(1, player_ptr->lev) + 1 }));
q_ptr->number = (byte)rand_range(15, 30);
object_aware(player_ptr, q_ptr);
object_known(q_ptr);
ItemEntity forge;
auto *q_ptr = &forge;
auto dummy = ItemKindType::SWORD;
- OBJECT_SUBTYPE_VALUE dummy2;
+ int dummy2;
switch (randint1(player_ptr->lev)) {
case 0:
case 1:
* Used to allocate proper treasure when "Creeping coins" die
* Note the use of actual "monster names"
*/
-static OBJECT_SUBTYPE_VALUE get_coin_type(MonsterRaceId r_idx)
+static int get_coin_type(MonsterRaceId r_idx)
{
switch (r_idx) {
case MonsterRaceId::COPPER_COINS:
*/
void OtherItemsEnchanter::generate_corpse()
{
- const std::unordered_map<OBJECT_SUBTYPE_VALUE, MonsterDropType> match = {
+ const std::unordered_map<int, MonsterDropType> match = {
{ SV_SKELETON, MonsterDropType::DROP_SKELETON },
{ SV_CORPSE, MonsterDropType::DROP_CORPSE },
};
typedef int32_t EXP; /*!< ゲーム中の主経験値の型定義 */
typedef int16_t SUB_EXP; /*!< ゲーム中の副経験値の型定義 */
-typedef int32_t OBJECT_SUBTYPE_VALUE; /*!< ゲーム中のアイテム副分類の型定義 */
typedef int16_t PARAMETER_VALUE; /*!< ゲーム中のアイテム能力値の型定義 */
typedef int32_t WEIGHT; /*!< ゲーム中の重量の型定義(ポンド) */
*/
bool (*get_obj_index_hook)(short bi_id);
-OBJECT_SUBTYPE_VALUE coin_type;
+int coin_type;
extern concptr ANGBAND_KEYBOARD;
extern concptr ANGBAND_GRAF;
-extern OBJECT_SUBTYPE_VALUE coin_type;
+extern int coin_type;
extern bool (*get_obj_index_hook)(short bi_id);